-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
linker: Fix weak lang item linking with combination windows-gnu + LLD + LTO #103092
Conversation
r? @lcnr (rust-highfive has picked a reviewer for you, use r? to override) |
@belovdv you originally suggested this alternative, and you were right, this solution is probably the least bad. |
// If global LTO is enabled then almost everything (*) is glued into a single object file, | ||
// so this logic is not necessary and can cause issues on some targets (due to weak lang | ||
// item symbols being "privatized" to that object file), so we disable it. | ||
// (*) Native libs, and `#[compiler_builtins]` and `#[no_builtins]` crates are not glued, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#![no_builtins]
is stable. Lang items are not, so that is probably not an issue.
Sweet, I think this should also fix the issue I've been seeing on illumos lately with LTO. e.g. trying to build bat:
|
r? compiler |
they are on vacation rn r? compiler |
@bors r+ |
Beta-nominating as a regression fix (the regression has also first landed on beta). |
@bors p=1 Fixes beta regression and we'd like to see this land on nightly before it's backported |
☀️ Test successful - checks-actions |
Finished benchmarking commit (5ffa67d): 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. Footnotes |
[beta] backports - Use rebind instead of dummy binder in `SameTypeModuloInfer` relation rust-lang#102059 - Add missing space between notable trait tooltip and where clause rust-lang#102107 - Avoid repeated re-initialization of the BufReader buffer rust-lang#102760 - Ensure enum cast moves rust-lang#103016 - Fix `TyKind::is_simple_path` rust-lang#103176 - Do anonymous lifetimes remapping correctly for nested rpits rust-lang#103205 - [beta] Cargo backport 1.65.0 rust-lang#103303 - linker: Fix weak lang item linking with combination windows-gnu + LLD + LTO rust-lang#103092 r? `@ghost`
linker: Fix weak lang item linking with combination windows-gnu + LLD + LTO In rust-lang#100404 this logic was originally disabled for MSVC due to issues with LTO, but the same issues appear on windows-gnu with LLD because that LLD uses the same underlying logic as MSVC LLD, just with re-syntaxed command line options. So this PR just disables it for LTO builds in general.
In #100404 this logic was originally disabled for MSVC due to issues with LTO, but the same issues appear on windows-gnu with LLD because that LLD uses the same underlying logic as MSVC LLD, just with re-syntaxed command line options.
So this PR just disables it for LTO builds in general.