Repository navigation
Ignore -C strip on MSVC#115120
-C strip on MSVC#115120Conversation
|
r? @b-naber (rustbot has picked a reviewer for you, use r? to override) |
|
There may be cases where someone doesn't want a PDB file to be created. One way around this is to prevent a PDB file from being created when |
I don't understand what you're trying to say here, do you mean that you could prevent a PDB file from being created on MSVC by using |
|
Currently, the value of the Yes, MSVC doesn't actually support |
|
I think it would make sense to treat |
|
earmarking this PR, waiting on that MCP seconding @rustbot author s-waiting-on-mcp |
|
These commits modify compiler targets. This PR changes |
split-debuginfo for PDB generation on MSVC
This comment has been minimized.
This comment has been minimized.
|
r? @bjorn3 |
This comment was marked as resolved.
This comment was marked as resolved.
|
@rustbot review |
split-debuginfo for PDB generation on MSVCdebuginfo for PDB generation on MSVC
debuginfo for PDB generation on MSVCsplit-debuginfo for PDB generation on MSVC
|
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. This will be merged soon. |
|
Thanks for keeping at this, @icedrocket! @bors r+ rollup=never |
|
☀️ Test successful - checks-actions |
|
Finished benchmarking commit (7f2fc33): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 671.419s -> 670.936s (-0.07%) |
|
Since this is in 1.79.0 already, should we revert this PR in Cargo? |
|
I found this change when I was trying to figure out why my link lines always include /DEBUG. I might be misreading the code, but it seems .debuginfo() is called unconditionally, which means that flag is now passed unconditionally, regardless of any profile's debug or strip settings(?). This not only produces a pdb, it also produces a debug info section in the resulting binary. It is the sort of thing I would expect some sort of debug-stripping flag to remove. (Edit: this assumption is wrong, see later comments) Note how most of these sections are empty, but the debug directory one isn't. That data is an IMAGE_DEBUG_DIRECTORY which points at data that is visualized in ghidra as
|
commented
Sep 16, 2024
|
@evmar Hi, can you open a new issue about your problem? Thanks! |
commented
Sep 16, 2024
|
commented
Sep 16, 2024
|
(@retep998 Happy to open a new bug if it helps, lemme know) /DEBUG:NONE is a good idea! I tried adding to my build.rs And then built with And the tail of the printed link line looks like: (where /DEBUG is from this PR, and noentry etc. are other flags I have already added) but the resulting binary seems to still include this section. I think the relevant flag-parsing bit of lld is here and it seems like that ought to be enough, so now I am just confused. Is there a way I can rerun the command directly to see if removing /DEBUG helps? It seems it refers to temporary files so if I copy-paste it to try it myself it fails. |
commented
Sep 16, 2024
|
I think I found it, it's this logic, which appears to have been tickled in my case by the /Brepro flag. Not your problem. I am happy with the /DEBUG:NONE solution, I agree with your take that this is sufficiently esoteric that it doesn't need an easy user-facing knob. |
commented
Sep 21, 2024
|
Just in case anyone finds this in the future, I asked the author of the relevant bits of LLVM and he pointed me at some relevant discussion: tldr LLVM is making a subtle and intentional choice to include this debug section. |

tl;dr - Define
-Cstripto only ever affect the binary; no other build artifacts.This is necessary to improve cross-platform behavior consistency: if someone wanted debug information to be contained only in separate files on all platforms, they would set
-Cstrip=symbolsand-Csplit-debuginfo=packed, but this would result in no PDB files on MSVC.Resolves #114215