rustc: Stabilize -Zrun-dsymutil as -Csplit-debuginfo#79570
Merged
bors merged 1 commit intorust-lang:masterfrom Jan 29, 2021
Merged
rustc: Stabilize -Zrun-dsymutil as -Csplit-debuginfo#79570bors merged 1 commit intorust-lang:masterfrom
-Zrun-dsymutil as -Csplit-debuginfo#79570bors merged 1 commit intorust-lang:masterfrom
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit adds a new stable codegen option to rustc,
-Csplit-debuginfo. The old-Zrun-dsymutilflag is deleted and nowsubsumed by this stable flag. Additionally
-Zsplit-dwarfis alsosubsumed by this flag but still requires
-Zunstable-optionstoactually activate. The
-Csplit-debuginfoflag takes one ofthree values:
off- This indicates that split-debuginfo from the final artifact isnot desired. This is not supported on Windows and is the default on
Unix platforms except macOS. On macOS this means that
dsymutilisnot executed.
packed- This means that debuginfo is desired in one locationseparate from the main executable. This is the default on Windows
(
*.pdb) and macOS (*.dSYM). On other Unix platforms this subsumes-Zsplit-dwarf=singleand produces a*.dwpfile.unpacked- This means that debuginfo will be roughly equivalent toobject files, meaning that it's throughout the build directory
rather than in one location (often the fastest for local development).
This is not the default on any platform and is not supported on Windows.
Each target can indicate its own default preference for how debuginfo is
handled. Almost all platforms default to
offexcept for Windows andmacOS which default to
packedfor historical reasons.Some equivalencies for previous unstable flags with the new flags are:
-Zrun-dsymutil=yes->-Csplit-debuginfo=packed-Zrun-dsymutil=no->-Csplit-debuginfo=unpacked-Zsplit-dwarf=single->-Csplit-debuginfo=packed-Zsplit-dwarf=split->-Csplit-debuginfo=unpackedNote that
-Csplit-debuginfostill requires-Zunstable-optionsfornon-macOS platforms since split-dwarf support was just implemented in
rustc.
There's some more rationale listed on #79361, but the main gist of the
motivation for this commit is that
dsymutilcan take quite a long timeto execute in debug builds and provides little benefit. This means that
incremental compile times appear that much worse on macOS because the
compiler is constantly running
dsymutilover every single binary itproduces during
cargo build(even build scripts!). Ideally rustc wouldswitch to not running
dsymutilby default, but that's a problem leftto get tackled another day.
Closes #79361