-
Notifications
You must be signed in to change notification settings - Fork 13k
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
rustbuild: Support specifying archiver and linker explicitly #45191
Conversation
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.
r=me pending review of the base PR, at least in terms of logic seeming sound. Not familiar enough with linkers and such to judge that part, but if it works, I'm happy with it.
src/bootstrap/builder.rs
Outdated
.env("CFG_RELEASE_CHANNEL", &self.build.config.channel) | ||
.env("RUSTDOC_REAL", self.rustdoc(host)); | ||
if let Some(linker) = self.build.linker(host) { | ||
cmd.arg("--linker").arg(linker).arg("-Z").arg("unstable-options"); |
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.
I'd prefer this logic to be in src/bin/rustdoc.rs
and we can just set RUSTDOC_LINKER
here.
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.
Hm, this could actually solve the issue with doctests as well if I understand correctly.
To give some background, I need to build Rust on a Linux server 1) using specific toolchain that is not in Without this patch my workaround looks roughly like this (in shell pseudocode): mkdir my_toolchain
ln -s actual_toolchain/gcc my_toolchain/cc
ln -s actual_toolchain/gar my_toolchain/ar
export PATH=my_toolchain:actual_toolchain:$PATH
./x.py build Even ignoring |
☔ The latest upstream changes (presumably #45233) made this pull request unmergeable. Please resolve the merge conflicts. |
@bors r=Mark-Simulacrum |
📌 Commit 399ff29 has been approved by |
⌛ Testing commit 399ff290c65df4a0f0381436a67c18b17f456fbc with merge 05c72874fef283a9dd41b2337b3cbef0e74404d5... |
💔 Test failed - status-travis |
Failed to find the symbol
|
☔ The latest upstream changes (presumably #45224) made this pull request unmergeable. Please resolve the merge conflicts. |
@bors r=Mark-Simulacrum |
📌 Commit 89d9ce4 has been approved by |
⌛ Testing commit 89d9ce4 with merge c09beac4654260fd53eb18db449229e7bb9c8385... |
💔 Test failed - status-travis |
Oops, that was silly. |
📌 Commit 0577b60 has been approved by |
rustbuild: Support specifying archiver and linker explicitly With this patch `x.py test` passes without toolchain being in `PATH` if `cc`, `cxx`, `ar`, `linker` and `gdb` are specified in `config.toml` (except for a few `run-make` tests using `nm`). Fixes #41821 r? @Mark-Simulacrum
☀️ Test successful - status-appveyor, status-travis |
Fix compilation after rust-lang/rust#45191
I believe this was forgotten from rust-lang#45191 but hopefully is a simple fix!
I believe this was forgotten from rust-lang#45191 but hopefully is a simple fix!
rustbuild: Build tests with LLD if `use-lld = true` was passed Addresses rust-lang#76127 (comment). Our test suite is generally ready to run with an explicitly specified linker (rust-lang#45191), so LLD specified with `use-lld = true` works as well. Only 4 tests fail (on `x86_64-pc-windows-msvc`): ``` ui/panic-runtime/lto-unwind.rs run-make-fulldeps/debug-assertions run-make-fulldeps/foreign-exceptions run-make-fulldeps/test-harness ``` All of them are legitimate issues with LLD (or at least with combination Rust+LLD) and manifest in segfaults on access to TLS (rust-lang#76127 (comment)). UPD: These issues are caused by rust-lang#72145 and appear because I had `-Ctarget-cpu=native` set. UPD: Further commits build tests with LLD for non-MSVC targets and propagate LLD to more places when `use-lld` is enabled.
With this patch
x.py test
passes without toolchain being inPATH
ifcc
,cxx
,ar
,linker
andgdb
are specified inconfig.toml
(except for a fewrun-make
tests usingnm
).Fixes #41821
r? @Mark-Simulacrum