rust
rust copied to clipboard
linker: Fix weak lang item linking with combination windows-gnu + LLD + LTO
In https://github.com/rust-lang/rust/pull/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.
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.
Sweet, I think this should also fix the issue I've been seeing on illumos lately with LTO.
e.g. trying to build bat:
error: linking with `gcc` failed: exit status: 1
|
= note: "gcc" "-m64" "-std=c99" "/tmp/rustcsVN1FO/symbols.o" "/tmp/bat/target/release/deps/bat-e4fceccbe6e2b327.bat.7aa865dd-cgu.0.rcgu.o" "-Wl,-z,ignore" "-L" "/tmp/bat/targe
t/release/deps" "-L" "/tmp/bat/target/release/build/libgit2-sys-b78d3b7d704ff41e/out/build" "-L" "/usr/lib/amd64" "-L" "/tmp/bat/target/release/build/onig_sys-159ec9d31ec0a92a/o
ut" "-L" "/home/luqman/.rustup/toolchains/nightly-x86_64-unknown-illumos/lib/rustlib/x86_64-unknown-illumos/lib" "-Wl,-Bstatic" "/tmp/rustcsVN1FO/liblibgit2_sys-e95cd72243699990.rlib" "/tmp/rustcsVN1FO
/libonig_sys-8c63ac69bc862d8b.rlib" "/home/luqman/.rustup/toolchains/nightly-x86_64-unknown-illumos/lib/rustlib/x86_64-unknown-illumos/lib/libcompiler_builtins-5843a5198c157050.rlib" "-Wl,-Bdynamic" "-
lkstat" "-lz" "-lsendfile" "-llgrp" "-lsocket" "-lposix4" "-lpthread" "-lresolv" "-lnsl" "-lumem" "-lgcc_s" "-lm" "-lrt" "-lpthread" "-lsendfile" "-llgrp" "-lc" "-lssp" "-L" "/home/luqman/.rustup/toolc
hains/nightly-x86_64-unknown-illumos/lib/rustlib/x86_64-unknown-illumos/lib" "-o" "/tmp/bat/target/release/deps/bat-e4fceccbe6e2b327" "-nodefaultlibs"
= note: Undefined first referenced
symbol in file
rust_begin_unwind /tmp/rustcsVN1FO/symbols.o
rust_oom /tmp/rustcsVN1FO/symbols.o
ld: fatal: symbol referencing errors. No output written to /tmp/bat/target/release/deps/bat-e4fceccbe6e2b327
collect2: error: ld returned 1 exit status
error: could not compile `bat` due to previous error
r? compiler
they are on vacation rn
r? compiler
@bors r+
:pushpin: Commit acf51e13457c45b97cdfd551d85d3e75140e0ff7 has been approved by wesleywiser
It is now in the queue for this repository.
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
:hourglass: Testing commit acf51e13457c45b97cdfd551d85d3e75140e0ff7 with merge 5ffa67d7309047ff47b9c624ba4061fb8c004c31...
:sunny: Test successful - checks-actions Approved by: wesleywiser Pushing 5ffa67d7309047ff47b9c624ba4061fb8c004c31 to master...
Finished benchmarking commit (5ffa67d7309047ff47b9c624ba4061fb8c004c31): comparison URL.
Overall result: no relevant changes - no action needed
@rustbot label: -perf-regression
Instruction count
This benchmark run did not return any relevant results for this metric.
Max RSS (memory usage)
Results
This 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.
mean[^1] | range | count[^2] | |
---|---|---|---|
Regressions ❌ (primary) |
- | - | 0 |
Regressions ❌ (secondary) |
2.1% | [2.1%, 2.1%] | 1 |
Improvements ✅ (primary) |
- | - | 0 |
Improvements ✅ (secondary) |
- | - | 0 |
All ❌✅ (primary) | - | - | 0 |
Cycles
This benchmark run did not return any relevant results for this metric.
[^1]: the arithmetic mean of the percent change [^2]: number of relevant changes