-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Always pass /DEBUG to msvc linker #28448
Comments
@retep998 I'm curious, but to what degree did this make backtraces work? I just tried this out and it didn't help unless debuginfo was also generated. |
All tests done at
With
With neither
|
What's the __ImageBase thing that's ending up in the build with no debuginfo? |
@sfackler Since no debug info is being emitted, and each object file only exports symbols for publicly accessible symbols. Those |
Huh, now I'm not sure what I was testing... At least for a "hello world" executable it didn't have any affect on size, so 👍 from me! |
It shouldn't have any effect on binary size since all the debug info is being emitted to a separate .pdb. |
I have a PR for this ready to go, but despite the lack of impact on binary file size, I'm wondering if we actually want to go ahead with this. There's no way to turn it off short of creating a new |
As somebody that uses -msvc rustc a whole lot, those concerns don't matter to me at all. I'm already used to them when dealing with MSVC C/C++, and in practice they don't seem to matter anyway. Just make sure that the dependency tracking for incremental rebuilds is aware of the multiple outputs. |
Here is some further testing on a simple .exe built using Cargo.
As you can see the only size increase here is a really tiny bit in
I find it really weird that when emitting debug info with -msvc we're still also emitting dwarf debug info into the .exe itself. |
rustc tends to provide precise control over the output artifacts with @alexcrichton Does rustc have an existing option for tools to use that prints out all the outputs of an invocation? |
We do have |
For reference, MSVC will by default always produce a .pdb file, even for release builds, so there's a precedent for this. However, it somehow does this without passing |
From convo with @retep998, passing /DEBUG, even w/o emitting debuginfo, makes backtraces work. They 'see no reason' not to always pass this flag.
This should be a simple change to
rustc::back::link
.The text was updated successfully, but these errors were encountered: