-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Preserve ASAN-related symbols during LTO. #114946
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @compiler-errors (or someone else) soon. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
/cc @tmiasko |
This comment has been minimized.
This comment has been minimized.
72e4552
to
2c75640
Compare
sorry, I don't really have enough context to review this. r? compiler |
2c75640
to
f287205
Compare
Can you please also test |
Good point. Done, sort-of - I've added I don't know how to add this coverage to I also felt unable to tweak 4053e25#diff-4c2e2f96156d5aa76e678ae72c4006d62ec03e05a546330d8ea98275ac9b9f67 to also apply to thin LTO... Hopefully the coverage above is good enough?
I think that thin LTO should be safe, because AFAIU the problem here was internalization (inlining/hiding global symbols into local symbols). And it seems to me that thin LTO can't really do such thing (because it needs to preserve global symbols in case they are used by other CGUs). |
This comment has been minimized.
This comment has been minimized.
I've tried running I don't understand why there are multiple
Not sure why this doesn't repro locally. Maybe I should try to debug with llvm-15, starting by reading https://rustc-dev-guide.rust-lang.org/tests/docker.html?highlight=docker#testing-with-docker FWIW I feel a bit lost here. Any advice how to proceed here? |
FWIW it seems that the only already-existing ThinLTO test under |
Let me also try discussing this in t-compiler/help on Zulip: |
61880a4
to
3f7804e
Compare
This comment has been minimized.
This comment has been minimized.
3f7804e
to
9465277
Compare
This comment has been minimized.
This comment has been minimized.
Status update: I think this issue cannot be reprod using I believe that to repro the issue we need
But
So, I guess the next step is to try to author the new test under |
9465277
to
f582c2c
Compare
RE: @nikic: #114946 (comment): ThinLTO test coverage I am unable to provide such test coverage. In #113404 (comment) I am:
|
With this change won't we use a linker script that hides all those symbols? The linker script is generated from
|
RE: @bjorn3: #114946 (comment):
I agree that the PR here impacts what gets returned from At any rate, the paragraph I wrote above may not matter much. I think that ultimately you are pointing out that this PR may introduce a regression into
My apologies if I mixed up anything (as I said, I am not a linker expert) - I would appreciate your help with this. |
And I think that you are saying that before this PR symbols like |
Yes, when rustc does the linking with this PR the version script would hide those symbols. |
RE: @bjorn3: #114946 (comment):
Ack. Let me try to rephrase in my own words to double-check my understanding. AFAIU the trouble is when rust/compiler/rustc_codegen_ssa/src/back/link.rs Lines 2067 to 2076 in 4e78abb
I think you are saying that (always? on some platforms only?) the PR will affect the linker command line generated by But then
So maybe your concern doesn't necessarily apply to OTOH, I am not sure if the previous section (if correct at all) helps with other symbols. Maybe listing their LLVM-IR attributes will help us make some progress here:
If the concern still applies to the other symbols, then maybe this PR can be tweaked so that it only touches |
Correct.
I see. In that case adapting just the LTO code would work for now I think. |
f582c2c
to
e6dddbd
Compare
@bjorn3 / @nikic / @tmiasko - could you PTAL again? The latest shape of this PR:
Additional notes:
@rustbot review |
@bors r+ rollup=never |
☀️ Test successful - checks-actions |
Finished benchmarking commit (e3abbd4): 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.
CyclesResultsThis 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.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 628.332s -> 630.181s (0.29%) |
Fixes #113404