Inconsistent behaviour about debuginfo in release builds when compiling for different platforms

I want to enable splitted debuginfo in release build. My config is:

lto = true
panic = "abort"
opt-level = 3
debug-assertions = false

split-debuginfo = "packed"
debug = true
strip = true

However the Windows build does not generate PDB file with strip = true.

What I get when after compiling:

  1. Windows build with cargo build --release: a dll, no pdb file
  2. Android build with cargo build --target aarch64-linux-android --release: a .so together with a .dwp symbol file

If I comment out strip = true, I get .dll and a .pdb both but Android build generates a large .so file which seems contain the same debuginfo as the .dwp file.

How do I configure cargo to get same result (library with debuginfo stripped out and a symbol file) on both Windows and Android platform?

This will be fixed by Ignore `-C strip` on MSVC by icedrocket · Pull Request #115120 · rust-lang/rust · GitHub


This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.