Inconsistent behavior across platform of split-debuginfo #114215
Labels
A-debuginfo
Area: Debugging information in compiled programs (DWARF, PDB, etc.)
C-bug
Category: This is a bug.
O-linux
Operating system: Linux
O-macos
Operating system: macOS
O-windows
Operating system: Windows
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Setting up a release profile with stripped binaries and split debuginfo is made very complicated due to subtle differences in how
debug
,strip
andsplit-debuginfo
interact with eachother across platforms. In particular, in the following setup:Then when targetting linux/macos, a
.dwp
/.dSYM
debug information file will be generated, while when targeting windows, no debug information file can be found. In particular, no.pdb
file is created.This seems to stem from how the flags propagate to linker invocation:
debuginfo
function of rustc_codegen_ssa only takesstrip
into account when choosing how to generate the debug information. If it's set to any value other than None, it will not generate any debuginfo whatsoever, regardless of the value ofsplit-debuginfo
.rustc_codegen_ssa::back::link_natively
that's responsible both for splitting debuginfo and stripping. A.dSYM
/.dwp
file will be created only ifdebug
is set to a value other than 0, andsplit-debuginfo
is set to packed. Stripping is, crucially, not a part of the equation.I believe the behavior with the windows should be adjusted to match what is done on macos/linux. In particular, if
split-debuginfo
is set topacked
and strip is set tosymbols
, then apdb
file should be generated.Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: