-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Don't use gc-sections with profile-generate. #87004
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
OK -- I think we should land this for now, and I'm going to go ahead and beta-nominate it, as it is intending to fix #78226. This could potentially have performance implications if the PGO on x86_64 for the compiler is also affected (just to a lesser extent) by the bugs observed in #78226. So, no rollup. @bors r+ rollup=never |
📌 Commit a6fe9bc67ef1f4ded930b3f7ec7ad3bad08c7a0d has been approved by |
⌛ Testing commit a6fe9bc67ef1f4ded930b3f7ec7ad3bad08c7a0d with merge 069ca296f9a6a661da4170b84a6362c942e70fd9... |
This comment has been minimized.
This comment has been minimized.
Hm, CI failure looks likely to be non-spurious. |
💔 Test failed - checks-actions |
@JamieCunliffe -- happy to rerun CI if you disagree with my assumption, not sure what you meant by 👀 :) It looks like a number of PGO tests failed, but it does seem a little surprising. Maybe we are generating unlinkable symbols or something... |
Sorry for the confusion, I meant I was looking into it with the 👀 :) I have just managed to reproduce it locally with windows, so I don't think it's the CI. |
When building with profile-generate request that metadata is kept during the gc_sections call, as this can sometimes strip out profile data. This missing information in the prof files can then result in missing functions when using the profile information.
a6fe9bc
to
7c98b3c
Compare
It looks like the binary that was built is seg faulting when run to generate the profile data. This also happens with master if using I have changed it so that it now uses the |
Hm... I would not have expected us to need to keep metadata, which refers to Rust's metadata (basically equivalent of C headers, just with more information and embedded into rlibs/dylibs). It looks like that might just be masking the problem? It looks like with the gcc linker at least passing keep_metadata = true will just turn gc_sections into a no-op (seemingly defeating the point of the patch entirely, since that's the linker I believe CI uses on aarch64-unknown-linux-gnu). On MSVC, (the platform that was failing) it has no effect. |
The original patch didn't call The gcc linker sometimes strips the It does appear that different linkers handle that section differently, I suspect not passing With the MSVC linker it seems not setting |
@bors r+ rollup=never OK, let's try it out. |
📌 Commit 7c98b3c has been approved by |
☀️ Test successful - checks-actions |
discussed at T-compiler triage meeting. Declining for beta backport. |
When building with profile-generate don't call gc_sections as this can
can sometimes strip out profile data. This missing information in the
prof files can then result in missing functions when using the profile
information.
#78226
r? @Mark-Simulacrum