-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Allow lld
to be enabled on aarch64-unknown-linux-gnu
#146604
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
base: master
Are you sure you want to change the base?
Allow lld
to be enabled on aarch64-unknown-linux-gnu
#146604
Conversation
These commits modify compiler targets. |
rustbot has assigned @petrochenkov. Use |
aarch64-unknown-linux-gnu
lld
to be enabled on aarch64-unknown-linux-gnu
cc @lqd If you have a spare cycle, do you have any insight to what the proper handling for this would be? |
The |
Targets already have strong control over what linker will get used and how, assuming no arguments are passed, so that seems good to me. |
Given that this environment variable is compile-time checked this would be sensible. Regardless of the direction this will require an update to |
The "quality" of lld support will vary per-target, so centralization is also a trade-off versus the signal the opt-in suggests in the target spec. I'm not sure the ergonomics are particularly useful to optimize, but why not in the future. The internals of relying on linker flavors should be moved to using linker features instead: this wasn't a blocker for stabilization but may be so if more targets want to do such a thing.
The maintainers for In addition to maybe waiting a bit to see how the first use of this turns out in practice when the next stable is released on Thursday, and what if anything needs to be changed in response. |
d5a84ce
to
49dd168
Compare
This PR modifies If appropriate, please update |
49dd168
to
229be70
Compare
I made an update to the |
229be70
to
9cbfaae
Compare
9cbfaae
to
358f344
Compare
I think we should have an option to use lld by default, but it should be different from the option to ship lld with the compiler. In particular, I suggest that we split the (Note that all of this is unrelated to |
We already have both
I agree that once more Linux targets than just x64 start switching to a different default linker, we should make this more first-class in bootstrap, rather than implicitly changing the behavior of I created an issue where we can discuss this further: #146640 |
☔ The latest upstream changes (presumably #146685) made this pull request unmergeable. Please resolve the merge conflicts. |
@Hoverbear if you don't mind, I'd like to finish #146640 during next week, and prepare a way for targets to opt into LLD. Then this PR should become even smaller. |
@Kobzol sounds lovely. :) I'll adapt this once it lands. |
On Ferrocene, we set
rust.lld = true
and have recently added a check to validate that the-fuse-ld=lld
argument is passed in ferrocene/ferrocene#1733. When running our tests I noticed theaarch64-unknown-linux-gnu
target was failing.Looking into it, I noticed that the aarch64 target lacks what the x86_64 target has in this regard:
rust/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_gnu.rs
Lines 23 to 28 in f3fd3ef
I adjusted the target to the included the related changes to Ferrocene and ran our full suite as well as validated the check from ferrocene/ferrocene#1733 also passes.
Testing
You can validate this by taking an
aarch64-unknown-linux-gnu
host with a config like:Validate that
rustc
doesn't pass anything aboutlld
:Then, with a your toolchain link, as specified in the
rustc-dev-guide
, run the following:Notice no output is provided. Next, using this branch:
./x.py build --stage 1 rustc +stage1 main.rs --print link-args | grep lld
Validate how the output includes
-fuse-ld=lld
.