-
Notifications
You must be signed in to change notification settings - Fork 14k
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
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-gnulld 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. |
1733: Validate `-fuse-ld=lld` is passed, enable on aarch64 r=Hoverbear a=Hoverbear Also needed to edit the test harness to allow non-strict args. [I am upstreaming the aarch64 enablement as well.](rust-lang/rust#146604). -- I do not expect it to merge as is, as Upstream is changing some stuff to make this story better. :) This is manually backported to 1.90/25.11: #1804 1800: Add 25.11 release notes r=Hoverbear a=Hoverbear https://app.clickup.com/t/8699ur681 1816: Remove `compare_and_swap` from the subset r=Hoverbear a=pvdrz This function is deprecated and not having it in the subset allows us to not write tests to increase coverage for a function that our users aren't supposed to use Co-authored-by: Ana Hobden <operator@hoverbear.org> Co-authored-by: Christian Poveda <christian.poveda@ferrous-systems.com>
1733: Validate `-fuse-ld=lld` is passed, enable on aarch64 r=Hoverbear a=Hoverbear Also needed to edit the test harness to allow non-strict args. [I am upstreaming the aarch64 enablement as well.](rust-lang/rust#146604). -- I do not expect it to merge as is, as Upstream is changing some stuff to make this story better. :) This is manually backported to 1.90/25.11: #1804 1816: Remove `compare_and_swap` from the subset r=Hoverbear a=pvdrz This function is deprecated and not having it in the subset allows us to not write tests to increase coverage for a function that our users aren't supposed to use 1818: Update certification docs for new code coverage tooling (blanket) r=pvdrz a=Hoverbear Recreate #1817 Co-authored-by: Ana Hobden <operator@hoverbear.org> Co-authored-by: Christian Poveda <christian.poveda@ferrous-systems.com> Co-authored-by: Urhengulas <johann.hemmann@ferrous-systems.com> Co-authored-by: Johann Hemmann <johann.hemmann@ferrous-systems.com>
1733: Validate `-fuse-ld=lld` is passed, enable on aarch64 r=Hoverbear a=Hoverbear Also needed to edit the test harness to allow non-strict args. [I am upstreaming the aarch64 enablement as well.](rust-lang/rust#146604). -- I do not expect it to merge as is, as Upstream is changing some stuff to make this story better. :) This is manually backported to 1.90/25.11: #1804 1792: Add more tests to `coretests` r=Hoverbear a=pvdrz Improve coverage numbers. This will get upstreamed. 1816: Remove `compare_and_swap` from the subset r=Hoverbear a=pvdrz This function is deprecated and not having it in the subset allows us to not write tests to increase coverage for a function that our users aren't supposed to use Co-authored-by: Ana Hobden <operator@hoverbear.org> Co-authored-by: Christian Poveda <christian.poveda@ferrous-systems.com>
|
You can use the new system for configuring LLD for aarch64. |
|
Does that imply no changes need to be made here, then? I'll close this, then. Thanks so much. :) |
|
Yes, indeed. |
1733: Validate `-fuse-ld=lld` is passed, enable on aarch64 r=jyn514 a=Hoverbear Also needed to edit the test harness to allow non-strict args. [I am upstreaming the aarch64 enablement as well.](rust-lang/rust#146604). -- I do not expect it to merge as is, as Upstream is changing some stuff to make this story better. :) This is manually backported to 1.90/25.11: #1804 A basic smoke test: ```bash #! /usr/bin/env bash # Run from repo root set +eux SCRATCH=/tmp/dummy-scratch DIST=build/dist rm -rf $SCRATCH mkdir $SCRATCH rm -rf $DIST RUST_BACKTRACE=1 ./x.py --stage 2 dist rustc cargo llvm-tools rust-std ferrocene-self-test for folder in build/dist/*.tar.xz; do tar xvf $folder -C $SCRATCH done cd $SCRATCH ./bin/ferrocene-self-test ``` 1865: pull-subtrees: no longer modify git state just to update the index r=Hoverbear a=jyn514 See similar existing code in `ferrocene/tools/pull-upstream/pull.sh:89`. I tested locally that this runs ok using the steps in ferrocene/doc/internal-procedures/src/subtree-pulls.rst#reproducing-failures. Co-authored-by: Ana Hobden <operator@hoverbear.org> Co-authored-by: Ana Hobden <ana.hobden@ferrous-systems.com> Co-authored-by: Jynn Nelson <jynn.nelson@ferrous-systems.com>
1733: Validate `-fuse-ld=lld` is passed, enable on aarch64 r=jyn514 a=Hoverbear Also needed to edit the test harness to allow non-strict args. [I am upstreaming the aarch64 enablement as well.](rust-lang/rust#146604). -- I do not expect it to merge as is, as Upstream is changing some stuff to make this story better. :) This is manually backported to 1.90/25.11: #1804 A basic smoke test: ```bash #! /usr/bin/env bash # Run from repo root set +eux SCRATCH=/tmp/dummy-scratch DIST=build/dist rm -rf $SCRATCH mkdir $SCRATCH rm -rf $DIST RUST_BACKTRACE=1 ./x.py --stage 2 dist rustc cargo llvm-tools rust-std ferrocene-self-test for folder in build/dist/*.tar.xz; do tar xvf $folder -C $SCRATCH done cd $SCRATCH ./bin/ferrocene-self-test ``` Co-authored-by: Ana Hobden <operator@hoverbear.org> Co-authored-by: Ana Hobden <ana.hobden@ferrous-systems.com>
1733: Validate `-fuse-ld=lld` is passed, enable on aarch64 r=Hoverbear a=Hoverbear Also needed to edit the test harness to allow non-strict args. [I am upstreaming the aarch64 enablement as well.](rust-lang/rust#146604). -- I do not expect it to merge as is, as Upstream is changing some stuff to make this story better. :) This is manually backported to 1.90/25.11: #1804 A basic smoke test: ```bash #! /usr/bin/env bash # Run from repo root set +eux SCRATCH=/tmp/dummy-scratch DIST=build/dist rm -rf $SCRATCH mkdir $SCRATCH rm -rf $DIST RUST_BACKTRACE=1 ./x.py --stage 2 dist rustc cargo llvm-tools rust-std ferrocene-self-test for folder in build/dist/*.tar.xz; do tar xvf $folder -C $SCRATCH done cd $SCRATCH ./bin/ferrocene-self-test ``` 1864: core: Don't try to link darwin-specific doctest r=Hoverbear a=jyn514 This avoids the following error when running `$ ./x test core --doc --coverage=library -- objc::class`: ``` ---- library/core/src/os/darwin/objc.rs - os::darwin::objc::class (line 70) stdout ---- error: linking with `cc` failed: exit status: 1 | = note: "cc" "/var/folders/t3/46yqwwp56vg2jp1604qr5wd00000gn/T/rustczK8Mih/symbols.o" "<2 object files omitted>" "<sysroot>/lib/rustlib/aarch64-apple-darwin/lib/{libstd-*,libpanic_unwind-*,libobject-*,libmemchr-*,libaddr2line-*,libgimli-*,libcfg_if-*,librustc_demangle-*,libstd_detect-*,libhashbrown-*,librustc_std_workspace_alloc-*,libminiz_oxide-*,libadler2-*,libunwind-*,liblibc-*,librustc_std_workspace_core-*,liballoc-*,libcore-*,libprofiler_builtins-*,libcompiler_builtins-*}.rlib" "-lSystem" "-lc" "-lm" "-arch" "arm64" "-mmacosx-version-min=11.0.0" "-L" "<sysroot>-std/aarch64-apple-darwin/release/build/profiler_builtins-05da451c1827ec8e/out" "-o" "/Users/jyn/src/ferrocene3/build/ferrocene/coverage/doctests-bins/library_core_src_os_darwin_objc_rs_70_0/rust_out" "-Wl,-dead_strip" "-nodefaultlibs" = note: some arguments are omitted. use `--verbose` to show all linker arguments = note: Undefined symbols for architecture arm64: "_OBJC_CLASS_$_NSString", referenced from: in rust_out.rust_out.6d77164725c1f174-cgu.0.rcgu.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` 1865: pull-subtrees: no longer modify git state just to update the index r=Hoverbear a=jyn514 See similar existing code in `ferrocene/tools/pull-upstream/pull.sh:89`. I tested locally that this runs ok using the steps in ferrocene/doc/internal-procedures/src/subtree-pulls.rst#reproducing-failures. 1867: `rustc --version` reports the ferrocene version r=Hoverbear a=jyn514 Example output on a dev branch: ``` rustc 1.92.0-dev (Ferrocene rolling by Ferrous Systems) ``` Example output on a release branch: ``` rustc 1.90.0-dev (Ferrocene 25.11.0 by Ferrous Systems) ``` 1870: some text fixes to core cert docs r=Hoverbear a=tshepang Co-authored-by: Ana Hobden <operator@hoverbear.org> Co-authored-by: Ana Hobden <ana.hobden@ferrous-systems.com> Co-authored-by: Jynn Nelson <jynn.nelson@ferrous-systems.com> Co-authored-by: Tshepang Mbambo <tshepang.mbambo@ferrous-systems.com>
1733: Validate `-fuse-ld=lld` is passed, enable on aarch64 r=Hoverbear a=Hoverbear Also needed to edit the test harness to allow non-strict args. [I am upstreaming the aarch64 enablement as well.](rust-lang/rust#146604). -- I do not expect it to merge as is, as Upstream is changing some stuff to make this story better. :) This is manually backported to 1.90/25.11: #1804 A basic smoke test: ```bash #! /usr/bin/env bash # Run from repo root set +eux SCRATCH=/tmp/dummy-scratch DIST=build/dist rm -rf $SCRATCH mkdir $SCRATCH rm -rf $DIST RUST_BACKTRACE=1 ./x.py --stage 2 dist rustc cargo llvm-tools rust-std ferrocene-self-test for folder in build/dist/*.tar.xz; do tar xvf $folder -C $SCRATCH done cd $SCRATCH ./bin/ferrocene-self-test ``` 1870: some text fixes to core cert docs r=Hoverbear a=tshepang Co-authored-by: Ana Hobden <operator@hoverbear.org> Co-authored-by: Ana Hobden <ana.hobden@ferrous-systems.com> Co-authored-by: Tshepang Mbambo <tshepang.mbambo@ferrous-systems.com>
1733: Validate `-fuse-ld=lld` is passed, enable on aarch64 r=Hoverbear a=Hoverbear Also needed to edit the test harness to allow non-strict args. [I am upstreaming the aarch64 enablement as well.](rust-lang/rust#146604). -- I do not expect it to merge as is, as Upstream is changing some stuff to make this story better. :) This is manually backported to 1.90/25.11: #1804 A basic smoke test: ```bash #! /usr/bin/env bash # Run from repo root set +eux SCRATCH=/tmp/dummy-scratch DIST=build/dist rm -rf $SCRATCH mkdir $SCRATCH rm -rf $DIST RUST_BACKTRACE=1 ./x.py --stage 2 dist rustc cargo llvm-tools rust-std ferrocene-self-test for folder in build/dist/*.tar.xz; do tar xvf $folder -C $SCRATCH done cd $SCRATCH ./bin/ferrocene-self-test ``` Co-authored-by: Ana Hobden <operator@hoverbear.org> Co-authored-by: Ana Hobden <ana.hobden@ferrous-systems.com>
1733: Validate `-fuse-ld=lld` is passed, enable on aarch64 r=Hoverbear a=Hoverbear Also needed to edit the test harness to allow non-strict args. [I am upstreaming the aarch64 enablement as well.](rust-lang/rust#146604). -- I do not expect it to merge as is, as Upstream is changing some stuff to make this story better. :) This is manually backported to 1.90/25.11: #1804 A basic smoke test: ```bash #! /usr/bin/env bash # Run from repo root set +eux SCRATCH=/tmp/dummy-scratch DIST=build/dist rm -rf $SCRATCH mkdir $SCRATCH rm -rf $DIST RUST_BACKTRACE=1 ./x.py --stage 2 dist rustc cargo llvm-tools rust-std ferrocene-self-test for folder in build/dist/*.tar.xz; do tar xvf $folder -C $SCRATCH done cd $SCRATCH ./bin/ferrocene-self-test ``` 1877: Switch back to `resolver = "2"` r=tshepang a=jyn514 This is a straight rebase of #1162. Unfortunately, the CI failure there was never recorded and the CircleCI logs have expired, so I don't know what caused it to fail last time. Let's try again? fixes #893 closes #1162 1882: blanket: Add header that links back to the documentation index r=Hoverbear a=jyn514 <img width="1334" height="318" alt="image" src="https://github.com/user-attachments/assets/9d0d5dde-b6dc-40c9-b454-49a05f08d899" /> 1884: Automated pull from upstream `HEAD` r=jyn514 a=ferrocene-automations[bot] :warning: **The automation reported these warnings:** :warning: * There are merge conflicts in this PR. Merge conflict markers have been committed. This PR pulls the following changes from the upstream repository: * `146186`: [Update cc-rs to 1.2.39](https://www.github.com/rust-lang/rust/issues/146186) * `148202`: [Rollup of 14 pull requests](https://www.github.com/rust-lang/rust/issues/148202) * `148186`: [rustdoc-search: add an integration test for CCI](https://www.github.com/rust-lang/rust/issues/148186) * `148175`: [Fix typos: duplicate words in comments](https://www.github.com/rust-lang/rust/issues/148175) * `148172`: [rustc-dev-guide subtree update](https://www.github.com/rust-lang/rust/issues/148172) * `148166`: [Re-enable macro-stepping test for AArch64](https://www.github.com/rust-lang/rust/issues/148166) * `148158`: [ci: loongarch64: use medium code model to avoid relocation overflows](https://www.github.com/rust-lang/rust/issues/148158) * `148154`: [Add a mailmap entry](https://www.github.com/rust-lang/rust/issues/148154) * `148139`: [Add `coverage` scope for controlling paths in code coverage](https://www.github.com/rust-lang/rust/issues/148139) * `148057`: [tests/ui/sanitizer/hwaddress.rs: Run on aarch64 and remove cgu hack](https://www.github.com/rust-lang/rust/issues/148057) * `148044`: [compiletest: show output in debug logging](https://www.github.com/rust-lang/rust/issues/148044) * `148013`: [1.91.0 release notes](https://www.github.com/rust-lang/rust/issues/148013) * `147915`: [Update target maintainers android.md](https://www.github.com/rust-lang/rust/issues/147915) * `147840`: [Rework unsizing coercions in the new solver](https://www.github.com/rust-lang/rust/issues/147840) * `147185`: [repr(transparent): do not consider repr(C) types to be 1-ZST](https://www.github.com/rust-lang/rust/issues/147185) * `144936`: [CFI: Fix types that implement Fn, FnMut, or FnOnce](https://www.github.com/rust-lang/rust/issues/144936) * `147083`: [Do not lifetime-extend array/slice indices](https://www.github.com/rust-lang/rust/issues/147083) * `148035`: [Skip codegen_crate call in check mode](https://www.github.com/rust-lang/rust/issues/148035) * `148167`: [Rollup of 4 pull requests](https://www.github.com/rust-lang/rust/issues/148167) * `148153`: [Fix duplicate 'the the' typos in comments](https://www.github.com/rust-lang/rust/issues/148153) * `147866`: [Add built-in `const` impls for `Clone` and `Copy`](https://www.github.com/rust-lang/rust/issues/147866) * `147478`: [More intuitive error when using self to instantiate tuple struct with private field](https://www.github.com/rust-lang/rust/issues/147478) * `145939`: [const `select_unpredictable`](https://www.github.com/rust-lang/rust/issues/145939) * `148040`: [Add a fast path for lowering trivial consts](https://www.github.com/rust-lang/rust/issues/148040) * `148163`: [`rust-analyzer` subtree update](https://www.github.com/rust-lang/rust/issues/148163) * `146069`: [Mark desugared range expression spans with DesugaringKind::RangeExpr](https://www.github.com/rust-lang/rust/issues/146069) * `147914`: [resolve: When suppressing `out_of_scope_macro_calls` suppress `unused_imports` as well](https://www.github.com/rust-lang/rust/issues/147914) * `147890`: [Deduce captures(none) for a return place and parameters](https://www.github.com/rust-lang/rust/issues/147890) * `146992`: [Improve source code for `highlight.rs`](https://www.github.com/rust-lang/rust/issues/146992) * `148003`: [compiletest: pass rustdoc mode as param, rather than implicitly](https://www.github.com/rust-lang/rust/issues/148003) * `148136`: [Rollup of 2 pull requests](https://www.github.com/rust-lang/rust/issues/148136) * `148134`: [Add myself as a windows-msvc maintainer](https://www.github.com/rust-lang/rust/issues/148134) * `148118`: [Improve the ICE message for invalid nullary intrinsic calls](https://www.github.com/rust-lang/rust/issues/148118) * `145665`: [Don't require `T: RefUnwindSafe` for `vec::IntoIter<T>: UnwindSafe`](https://www.github.com/rust-lang/rust/issues/145665) * `147818`: [Unify and deduplicate max recip float tests](https://www.github.com/rust-lang/rust/issues/147818) * `148066`: [remove a performance hack](https://www.github.com/rust-lang/rust/issues/148066) * `148100`: [Rollup of 4 pull requests](https://www.github.com/rust-lang/rust/issues/148100) * `148088`: [compiletest: Simplify passing arguments to spawned test threads](https://www.github.com/rust-lang/rust/issues/148088) * `148007`: [chore: Update to the latest annotate-snippets](https://www.github.com/rust-lang/rust/issues/148007) * `148000`: [Improvements to attribute suggestions](https://www.github.com/rust-lang/rust/issues/148000) * `143361`: [Stop passing resolver disambiguator state to AST lowering.](https://www.github.com/rust-lang/rust/issues/143361) * `147493`: [StateTransform: Only load pin field once.](https://www.github.com/rust-lang/rust/issues/147493) * `148090`: [Rollup of 5 pull requests](https://www.github.com/rust-lang/rust/issues/148090) * `148073`: [test(frontmatter): Rename tests to make coverage more obvious](https://www.github.com/rust-lang/rust/issues/148073) * `148072`: [Fix compiling `CondVar::wait_timeout` on 32-bit Apple platforms](https://www.github.com/rust-lang/rust/issues/148072) * `148065`: [compiletest: Add concrete examples for some config/test path fields](https://www.github.com/rust-lang/rust/issues/148065) * `148056`: [refactor(rustdoc): Remove redundant langstr checks](https://www.github.com/rust-lang/rust/issues/148056) * `147406`: [Remove needs-asm-support directive in tests with explicit targets](https://www.github.com/rust-lang/rust/issues/147406) * `148077`: [Bump the version number to 1.93.0](https://www.github.com/rust-lang/rust/issues/148077) * `142712`: [hir_analysis: add missing sizedness bounds](https://www.github.com/rust-lang/rust/issues/142712) * `148018`: [fix panic when rustc tries to reduce intermediate filenames len with utf8](https://www.github.com/rust-lang/rust/issues/148018) * `147950`: [rustc_codegen_llvm: adapt for LLVM 22 change to pass masked intrinsic alignment as an attribute](https://www.github.com/rust-lang/rust/issues/147950) * `148043`: [Revert "fix: Filter suggestion parts that match existing code"](https://www.github.com/rust-lang/rust/issues/148043) * `148059`: [Rollup of 5 pull requests](https://www.github.com/rust-lang/rust/issues/148059) * `148054`: [Streamline iterator chaining when computing successors.](https://www.github.com/rust-lang/rust/issues/148054) * `148042`: [test(frontmatter): Cover spaces between infostring parts](https://www.github.com/rust-lang/rust/issues/148042) * `148039`: [Add myself to the review rotation](https://www.github.com/rust-lang/rust/issues/148039) * `148021`: [[rustdoc] Simplify module rendering and HTML tags handling](https://www.github.com/rust-lang/rust/issues/148021) * `148016`: [Revert constification of `Borrow` and `Deref for Cow` due to inference failure](https://www.github.com/rust-lang/rust/issues/148016) * `148049`: [Revert "feat: implement `hash_map!` macro"](https://www.github.com/rust-lang/rust/issues/148049) 1885: add missing test annotation to label-operand.rs r=Hoverbear a=tshepang A different version of this file was added to 25.11 and 25.08 branches Co-authored-by: Ana Hobden <operator@hoverbear.org> Co-authored-by: Ana Hobden <ana.hobden@ferrous-systems.com> Co-authored-by: Lukas Wirth <lukas.wirth@ferrous-systems.com> Co-authored-by: Jynn Nelson <jynn.nelson@ferrous-systems.com> Co-authored-by: A4-Tacks <wdsjxhno1001@163.com> Co-authored-by: Chayim Refael Friedman <chayimfr@gmail.com> Co-authored-by: David Barsky <me@davidbarsky.com> Co-authored-by: Shoyu Vanilla <modulo641@gmail.com> Co-authored-by: Shoyu Vanilla (Flint) <modulo641@gmail.com> Co-authored-by: Lukas Wirth <me@lukaswirth.dev> Co-authored-by: Jana Dönszelmann <jana@donsz.nl> Co-authored-by: Michael Goulet <michael@errs.io> Co-authored-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com> Co-authored-by: The rustc-josh-sync Cronjob Bot <github-actions@github.com> Co-authored-by: Tshepang Mbambo <hopsi@tuta.io> Co-authored-by: Tshepang Mbambo <tshepang.mbambo@ferrous-systems.com>
1733: Validate `-fuse-ld=lld` is passed, enable on aarch64 r=Hoverbear a=Hoverbear Also needed to edit the test harness to allow non-strict args. [I am upstreaming the aarch64 enablement as well.](rust-lang/rust#146604). -- I do not expect it to merge as is, as Upstream is changing some stuff to make this story better. :) This is manually backported to 1.90/25.11: #1804 A basic smoke test: ```bash #! /usr/bin/env bash # Run from repo root set +eux SCRATCH=/tmp/dummy-scratch DIST=build/dist rm -rf $SCRATCH mkdir $SCRATCH rm -rf $DIST RUST_BACKTRACE=1 ./x.py --stage 2 dist rustc cargo llvm-tools rust-std ferrocene-self-test for folder in build/dist/*.tar.xz; do tar xvf $folder -C $SCRATCH done cd $SCRATCH ./bin/ferrocene-self-test ``` 1885: add missing test annotation to label-operand.rs r=Hoverbear a=tshepang A different version of this file was added to 25.11 and 25.08 branches Co-authored-by: Ana Hobden <operator@hoverbear.org> Co-authored-by: Ana Hobden <ana.hobden@ferrous-systems.com> Co-authored-by: Tshepang Mbambo <tshepang.mbambo@ferrous-systems.com>
On Ferrocene, we set
rust.lld = trueand have recently added a check to validate that the-fuse-ld=lldargument is passed in ferrocene/ferrocene#1733. When running our tests I noticed theaarch64-unknown-linux-gnutarget 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-gnuhost with a config like:Validate that
rustcdoesn'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 lldValidate how the output includes
-fuse-ld=lld.