-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Allow using self-contained LLD in bootstrap #135001
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
Conversation
…ntained"` is used Before, we just used the global `lld` anyway.
Not all targets support these flags, so we cannot just pass them to the tests unconditionally. Before, we were using a linker arg (`-Clink-arg=-fuse-ld=lld`), which circumvented this in a hacky way.
I have a 3970X (which may or may not qualify these days). On master, I see
On this PR, I see
running again:
(the difference caused by this PR is close to jitter) |
Thanks, it doesn't seem like there's any difference then. Actually, I wonder if the stage1 compiler uses LLD anyway, since it's now enabled by default on nightly 🤔 In any case, the second commit shouldn't regress perf. anyway. |
Measured on a 24c/48t Zen2 CPU
Doc test ranges overlap. But it seems to be a small slowdown for UI tests.
Not sure what you mean? LLD was already used before to build the tests, that's why bootstrap has some handling to set the thread count for lld (UI tests should be running with |
I meant that the tests are already linked with LLD even without using
Note: this is only true for stage 1+, since on stage0 the bootstrap compiler is beta, which doesn't use LLD by default, so |
I was going to check the time on native msvc, but it turns out with `tests\ui\asan-odr-win\asan_odr_windows.rs`
EDIT: opened #135013 to track that test failure. |
@@ -1901,7 +1901,6 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the | |||
|
|||
let mut targetflags = flags; | |||
targetflags.push(format!("-Lnative={}", builder.test_helpers_out(target).display())); | |||
targetflags.extend(linker_flags(builder, compiler.host, LldThreads::No)); |
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.
Shouldn't we design linker_flags
in a way that preserves the old logic for tests instead of removing it entirely?
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 saw only very minimal gains with LLD vs the default Linux linker on UI tests, but it's true that on some other platforms the difference might be larger.
The problem with the old approach is that it cannot respect the "self-contained" mode. So when you use lld = "self-contained"
, the old approach ignores that and just uses the global lld
for the tests.
I guess that a compromise could be to use the linker flag with use-lld = true
and the new compiler flag with use-lld = "self-contained"
, but I would eventually like to set use-lld = "self-contained"
to be the default on CI; with this approach, some tests would simply fail..
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 guess that a compromise could be to use the linker flag with use-lld = true and the new compiler flag with use-lld = "self-contained", but I would eventually like to set use-lld = "self-contained" to be the default on CI; with this approach, some tests would simply fail..
This sounds reasonable I think.
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.
But there's still the "some tests would fail" part 😆 Another alternative would be to actually modify the target configuration of the compiler when use-lld
is enabled, but this means that the compiler itself would be modified and would use lld
by default; right now, we just enable lld
in a hacky way in bootstrap.
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.
You said "eventually", I am not sure why we should concern on that part right now.
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.
It's not just about CI. Right now, use-lld
is quite useful to make local compiler builds faster. But if we actually make self-contained
working as intended, and keep the compiletest target flags, then use-lld = "self-contained"
will also cause UI tests to fail for people that use this config value.
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 see. In this case I am fine with landing it as is. We can create an issue to track that part.
@bors r+ |
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#133964 (core: implement `bool::select_unpredictable`) - rust-lang#135001 (Allow using self-contained LLD in bootstrap) - rust-lang#135055 (Report impl method has stricter requirements even when RPITIT inference gets in the way) - rust-lang#135064 (const-in-pattern: test that the PartialEq impl does not need to be const) - rust-lang#135066 (bootstrap: support `./x check run-make-support`) - rust-lang#135069 (remove unused function params) - rust-lang#135084 (Update carrying_mul_add test to tolerate `nuw`) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#135001 - Kobzol:bootstrap-mcp-510, r=onur-ozkan Allow using self-contained LLD in bootstrap In rust-lang#116278, I added a `"self-contained"` mode to the `rust.use-lld` bootstrap option, which was designed for using the built-in LLD for linking compiler artifacts. However, this was later reverted in rust-lang#118810. This PR brings the old logic back, which switches LLD in bootstrap from `-fuse-ld=lld` to [MCP510](rust-lang/compiler-team#510 way of passing linker flags to enable LLD (both external and self-contained). So this does two changes: 1) Goes from `-fuse-ld=lld` to MCP510 2) Actually makes it possible to use the self-contained LLD to compile compiler artifacts Regarding the second commit: Since rust-lang#86113, we have been passing `-fuse-ld=lld` as a target flag to all tests when `use-lld = true` is enabled. This kind of worked for all tests, since it was just a linker argument, which has bypassed any compiler checks, and probably resulted only in some warning if the given target linker didn't actually support LLD. However, after the first commit, some tests actually start failing with this approach: ``` error: linker flavor `gnu-lld-cc` is incompatible with the current target | = note: compatible flavors are: llbc, ptx ``` So the second commit removes the passing of LLD flags as target flags to tests. I don't think that it's a good idea to pass specific compiler flags to all tests unconditionally, tbh. The doctest command from rust-lang#86113 doesn't go through compiletest anymore, and doctests should be quite a lot faster since rust-lang#126245 in general. CC `@the8472` If someone has a beefy machine, it would be nice to test whether this doesn't regress test execution speed. How to do that: 1) Enable `rust.use-lld = true` and `rust.lld = true` in `config.toml` 2) Benchmark `./x test tests/ui --force-rerun` between `master` and this PR Once this is tested in the wild, I would like to make the self-contained LLD the default in CI, hopefully to make CI builds faster. r? `@onur-ozkan`
This is already merged, bors. @bors retry r- |
…trochenkov Use target-agnostic LLD flags in bootstrap for `use-lld` [Before](rust-lang#135001), I hardcoded LLD flags that pretty much only worked on GNU. The right way is to use `-Zlinker-features` instead though. I *think* that this should also make this work on Windows mingw, and thus `@petrochenkov's` workaround is no longer necessary. Fixes: rust-lang#139372 Closes: rust-lang#139375 r? `@lqd`
Rollup merge of rust-lang#139378 - Kobzol:bootstrap-use-lld-fix, r=petrochenkov Use target-agnostic LLD flags in bootstrap for `use-lld` [Before](rust-lang#135001), I hardcoded LLD flags that pretty much only worked on GNU. The right way is to use `-Zlinker-features` instead though. I *think* that this should also make this work on Windows mingw, and thus `@petrochenkov's` workaround is no longer necessary. Fixes: rust-lang#139372 Closes: rust-lang#139375 r? `@lqd`
* Add pkgconfig-native and openssl to resolve openssl-sys crate dependency on pkg-config. The exact commit was not found found, but the crate's document mentions it as the required dependecy. | error: failed to run custom build command for `openssl-sys v0.9.106` | Could not find openssl via pkg-config: | The pkg-config command could not be found. | | Most likely, you need to install a pkg-config package for your OS. | Try `apt install pkg-config`, or `yum install pkg-config`, | or `pkg install pkg-config`, or `apk add pkgconfig` depending on your distribution https://crates.io/crates/openssl-sys/0.9.108/dependencies https://github.com/rust-lang/rust/blob/master/INSTALL.md#dependencies * Add Ninja as a dependency for building Rust to prevent bootstrap build regression. Fixes: | Building LLD for x86_64-unknown-linux-gnu | | Couldn't find required command: ninja (or ninja-build) | | You should install ninja as described at | <https://github.com/ninja-build/ninja/wiki/Pre-built-Ninja-packages>, | or set `ninja = false` in the `[llvm]` section of `config.toml`. | Alternatively, set `download-ci-llvm = true` in that `[llvm]` section | to download LLVM rather than building it. * Add bash to DEPENDS to resolve missing dependency for subtree-sync.sh Fixes: ERROR: rust-1.86.0-r0 do_package_qa: QA Issue: /usr/lib/rustlib/src/rust/library/portable-simd/subtree-sync.sh contained in package rust requires /bin/bash, but no providers found in RDEPENDS:rust? [file-rdeps] * Add do_install:append() task to remove cargo bin from rust native builds. This resolves the following conflict: Fixes: ERROR: libstd-rs-1.86.0-r0 do_prepare_recipe_sysroot: The file /usr/bin/cargo is installed by both rust-native and cargo-native, aborting * Update Unicode-3.0 license checksums. License-Update: Copyright and license files to distributions are updated. rust-lang/rust@f9c1699 It adds copyright and license files (including HTML versions) to distributions, aligns with license compliance tools like reuse, and ensures all required license texts are properly included and formatted. * The "remote-test-server" bin is now generated in stage2-tools-bin dir rather than stage1. Update the test suite accordingly. * Fix do_package QA issue by packing missing zsh files and directories: Fixes: do_package: QA Issue: rust: Files/directories were installed but not shipped in any package: /usr/share/zsh /usr/share/zsh/site-functions /usr/share/zsh/site-functions/_cargo Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install * Install "llvm-tblgen" from native-sysroot to recipe sysroot to handle file not found error during rust builds: Fixes: /bin/sh: line 1:/home/poky/build/tmp/work/core2-64-poky-linux/rust/1.86.0/recipe-sysroot/usr/lib/llvm-rust/bin/llvm-tblgen: No such file or directory | make[2]: *** [COFF/CMakeFiles/COFFOptionsTableGen.dir/build.make:120: COFF/Options.inc] Error 127 | make[1]: *** [CMakeFiles/Makefile2:630: COFF/CMakeFiles/COFFOptionsTableGen.dir/all] Error 2 | make[1]: *** Waiting for unfinished jobs.... * From v1.86.0, a "self-contained" LLD is built as part of rust bootstrap build. This results in additional build time and installations. Disable rust-lld in config.toml to prevent it. References: rust-lang/rust#135001 rust-lang/rust@8744b44 * Enable INHIBIT_PACKAGE_DEBUG_SPLIT/STRIP to fix QA stripping errors. Fixes: ERROR: rust-1.86.0-r0 do_package: QA Issue: File '/usr/lib/rustlib/x86_64-poky-linux-gnu/bin/wasm-component-ld' from rust was already stripped, this will prevent future debugging! [already-stripped] * Drop Zdual-proc-macros-additional-check.patch patch since it's merged with v1.86.0 rust-lang/rust@139d6ba * LTO config is applied to rustdoc from v1.86.0. Rebase 0001-src-core-build_steps-tool.rs-switch-off-lto-for-rust.patch which disables it to avoid suffixes in binaries causing non-reproducibility. rust-lang/rust@1fe351b Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com> Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
* Add pkgconfig-native and openssl to resolve openssl-sys crate dependency on pkg-config. The exact commit was not found found, but the crate's document mentions it as the required dependecy. | error: failed to run custom build command for `openssl-sys v0.9.106` | Could not find openssl via pkg-config: | The pkg-config command could not be found. | | Most likely, you need to install a pkg-config package for your OS. | Try `apt install pkg-config`, or `yum install pkg-config`, | or `pkg install pkg-config`, or `apk add pkgconfig` depending on your distribution https://crates.io/crates/openssl-sys/0.9.108/dependencies https://github.com/rust-lang/rust/blob/master/INSTALL.md#dependencies * Add Ninja as a dependency for building Rust to prevent bootstrap build regression. Fixes: | Building LLD for x86_64-unknown-linux-gnu | | Couldn't find required command: ninja (or ninja-build) | | You should install ninja as described at | <https://github.com/ninja-build/ninja/wiki/Pre-built-Ninja-packages>, | or set `ninja = false` in the `[llvm]` section of `config.toml`. | Alternatively, set `download-ci-llvm = true` in that `[llvm]` section | to download LLVM rather than building it. * Add bash to DEPENDS to resolve missing dependency for subtree-sync.sh Fixes: ERROR: rust-1.86.0-r0 do_package_qa: QA Issue: /usr/lib/rustlib/src/rust/library/portable-simd/subtree-sync.sh contained in package rust requires /bin/bash, but no providers found in RDEPENDS:rust? [file-rdeps] * Add do_install:append() task to remove cargo bin from rust native builds. This resolves the following conflict: Fixes: ERROR: libstd-rs-1.86.0-r0 do_prepare_recipe_sysroot: The file /usr/bin/cargo is installed by both rust-native and cargo-native, aborting * Update Unicode-3.0 license checksums. License-Update: Copyright and license files to distributions are updated. rust-lang/rust@f9c1699 It adds copyright and license files (including HTML versions) to distributions, aligns with license compliance tools like reuse, and ensures all required license texts are properly included and formatted. * The "remote-test-server" bin is now generated in stage2-tools-bin dir rather than stage1. Update the test suite accordingly. * Fix do_package QA issue by packing missing zsh files and directories: Fixes: do_package: QA Issue: rust: Files/directories were installed but not shipped in any package: /usr/share/zsh /usr/share/zsh/site-functions /usr/share/zsh/site-functions/_cargo Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install * Install "llvm-tblgen" from native-sysroot to recipe sysroot to handle file not found error during rust builds: Fixes: /bin/sh: line 1:/home/poky/build/tmp/work/core2-64-poky-linux/rust/1.86.0/recipe-sysroot/usr/lib/llvm-rust/bin/llvm-tblgen: No such file or directory | make[2]: *** [COFF/CMakeFiles/COFFOptionsTableGen.dir/build.make:120: COFF/Options.inc] Error 127 | make[1]: *** [CMakeFiles/Makefile2:630: COFF/CMakeFiles/COFFOptionsTableGen.dir/all] Error 2 | make[1]: *** Waiting for unfinished jobs.... * From v1.86.0, a "self-contained" LLD is built as part of rust bootstrap build. This results in additional build time and installations. Disable rust-lld in config.toml to prevent it. References: rust-lang/rust#135001 rust-lang/rust@8744b44 * Drop Zdual-proc-macros-additional-check.patch patch since it's merged with v1.86.0 rust-lang/rust@139d6ba * LTO config is applied to rustdoc from v1.86.0. Rebase 0001-src-core-build_steps-tool.rs-switch-off-lto-for-rust.patch which disables it to avoid suffixes in binaries causing non-reproducibility. rust-lang/rust@1fe351b * Restrict tests using "//@only <target_arch>" to avoid failures on riscv64. qemuriscv64 was recently added to the default testing on AB. Riscv64 has Tier 2 status, (https://doc.rust-lang.org/rustc/platform-support.html#tier-2-with-host-tools) which guarantees successful builds but does not include automated testing. As a result, some tests may fail or exhibit unexpected behavior on this architecture. To avoid disabling these tests entirely, use //@only <target_arch> to limit their execution to architectures where they are known to work. This ensures the tests still run on supported targets while being skipped on riscv64. Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com> Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
Rust stable version updated to 1.86.0. https://blog.rust-lang.org/2025/04/03/Rust-1.86.0.html * Add pkgconfig-native and openssl to resolve openssl-sys crate dependency on pkg-config. As per rust document this is a required dependency. Fixes: | error: failed to run custom build command for `openssl-sys v0.9.106` | Could not find openssl via pkg-config: | The pkg-config command could not be found. | | Most likely, you need to install a pkg-config package for your OS. | Try `apt install pkg-config`, or `yum install pkg-config`, | or `pkg install pkg-config`, or `apk add pkgconfig` depending on your distribution https://crates.io/crates/openssl-sys/0.9.108/dependencies https://github.com/rust-lang/rust/blob/master/INSTALL.md#dependencies * Add Ninja as a dependency for building Rust to prevent bootstrap build regression. Fixes: | Building LLD for x86_64-unknown-linux-gnu | | Couldn't find required command: ninja (or ninja-build) | | You should install ninja as described at | <https://github.com/ninja-build/ninja/wiki/Pre-built-Ninja-packages>, | or set `ninja = false` in the `[llvm]` section of `config.toml`. | Alternatively, set `download-ci-llvm = true` in that `[llvm]` section | to download LLVM rather than building it. * Add bash to DEPENDS to resolve missing dependency for subtree-sync.sh Fixes: ERROR: rust-1.86.0-r0 do_package_qa: QA Issue: /usr/lib/rustlib/src/rust/library/portable-simd/subtree-sync.sh contained in package rust requires /bin/bash, but no providers found in RDEPENDS:rust? [file-rdeps] * Add do_install:append() task to remove cargo bin from rust native builds. This resolves the following conflict: Fixes: ERROR: libstd-rs-1.86.0-r0 do_prepare_recipe_sysroot: The file /usr/bin/cargo is installed by both rust-native and cargo-native, aborting * Update Unicode-3.0 license checksums. License-Update: Copyright and license files to distributions are updated. rust-lang/rust@f9c1699 It adds copyright and license files (including HTML versions) to distributions, aligns with license compliance tools like reuse, and ensures all required license texts are properly included and formatted. * Disable building of extended Rust tools to reduce build time and filesystem usage. Update config.toml to disable building of extended Rust tools that are not required. This helps minimize unnecessary build time and filesystem usage. * The "remote-test-server" bin is now generated in stage2-tools-bin dir rather than stage1. Update the test suite accordingly. * Fix do_package QA issue by packing missing zsh files and directories: Fixes: do_package: QA Issue: rust: Files/directories were installed but not shipped in any package: /usr/share/zsh /usr/share/zsh/site-functions /usr/share/zsh/site-functions/_cargo Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install * Install "llvm-tblgen" from native-sysroot to recipe sysroot to handle file not found error during rust builds: Fixes: /bin/sh: line 1:/home/poky/build/tmp/work/core2-64-poky-linux/rust/1.86.0/recipe-sysroot/usr/lib/llvm-rust/bin/llvm-tblgen: No such file or directory | make[2]: *** [COFF/CMakeFiles/COFFOptionsTableGen.dir/build.make:120: COFF/Options.inc] Error 127 | make[1]: *** [CMakeFiles/Makefile2:630: COFF/CMakeFiles/COFFOptionsTableGen.dir/all] Error 2 | make[1]: *** Waiting for unfinished jobs.... * From v1.86.0, a "self-contained" LLD is built as part of rust bootstrap build. This results in additional build time and installations. Disable rust-lld in config.toml to prevent it. References: rust-lang/rust#135001 rust-lang/rust@8744b44 * Drop Zdual-proc-macros-additional-check.patch patch since it's merged with v1.86.0 rust-lang/rust@139d6ba * LTO config is applied to rustdoc from v1.86.0. Rebase 0001-src-core-build_steps-tool.rs-switch-off-lto-for-rust.patch which disables it to avoid suffixes in binaries causing non-reproducibility. rust-lang/rust@1fe351b * Restrict tests using "//@only <target_arch>" to avoid failures on riscv64, which is now part of default AB testing. Since riscv64 is Tier 2 with no automated testing, some tests may fail. This approach ensures tests continue running on supported architectures while skipping them on riscv64. https://doc.rust-lang.org/rustc/platform-support.html#tier-2-with-host-tools (From OE-Core rev: 54690b42058829256c30fde3d1fdf33181e4ee3a) Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Rust stable version updated to 1.86.0. https://blog.rust-lang.org/2025/04/03/Rust-1.86.0.html * Add pkgconfig-native and openssl to resolve openssl-sys crate dependency on pkg-config. As per rust document this is a required dependency. Fixes: | error: failed to run custom build command for `openssl-sys v0.9.106` | Could not find openssl via pkg-config: | The pkg-config command could not be found. | | Most likely, you need to install a pkg-config package for your OS. | Try `apt install pkg-config`, or `yum install pkg-config`, | or `pkg install pkg-config`, or `apk add pkgconfig` depending on your distribution https://crates.io/crates/openssl-sys/0.9.108/dependencies https://github.com/rust-lang/rust/blob/master/INSTALL.md#dependencies * Add Ninja as a dependency for building Rust to prevent bootstrap build regression. Fixes: | Building LLD for x86_64-unknown-linux-gnu | | Couldn't find required command: ninja (or ninja-build) | | You should install ninja as described at | <https://github.com/ninja-build/ninja/wiki/Pre-built-Ninja-packages>, | or set `ninja = false` in the `[llvm]` section of `config.toml`. | Alternatively, set `download-ci-llvm = true` in that `[llvm]` section | to download LLVM rather than building it. * Add bash to DEPENDS to resolve missing dependency for subtree-sync.sh Fixes: ERROR: rust-1.86.0-r0 do_package_qa: QA Issue: /usr/lib/rustlib/src/rust/library/portable-simd/subtree-sync.sh contained in package rust requires /bin/bash, but no providers found in RDEPENDS:rust? [file-rdeps] * Add do_install:append() task to remove cargo bin from rust native builds. This resolves the following conflict: Fixes: ERROR: libstd-rs-1.86.0-r0 do_prepare_recipe_sysroot: The file /usr/bin/cargo is installed by both rust-native and cargo-native, aborting * Update Unicode-3.0 license checksums. License-Update: Copyright and license files to distributions are updated. rust-lang/rust@f9c1699 It adds copyright and license files (including HTML versions) to distributions, aligns with license compliance tools like reuse, and ensures all required license texts are properly included and formatted. * Disable building of extended Rust tools to reduce build time and filesystem usage. Update config.toml to disable building of extended Rust tools that are not required. This helps minimize unnecessary build time and filesystem usage. * The "remote-test-server" bin is now generated in stage2-tools-bin dir rather than stage1. Update the test suite accordingly. * Fix do_package QA issue by packing missing zsh files and directories: Fixes: do_package: QA Issue: rust: Files/directories were installed but not shipped in any package: /usr/share/zsh /usr/share/zsh/site-functions /usr/share/zsh/site-functions/_cargo Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install * Install "llvm-tblgen" from native-sysroot to recipe sysroot to handle file not found error during rust builds: Fixes: /bin/sh: line 1:/home/poky/build/tmp/work/core2-64-poky-linux/rust/1.86.0/recipe-sysroot/usr/lib/llvm-rust/bin/llvm-tblgen: No such file or directory | make[2]: *** [COFF/CMakeFiles/COFFOptionsTableGen.dir/build.make:120: COFF/Options.inc] Error 127 | make[1]: *** [CMakeFiles/Makefile2:630: COFF/CMakeFiles/COFFOptionsTableGen.dir/all] Error 2 | make[1]: *** Waiting for unfinished jobs.... * From v1.86.0, a "self-contained" LLD is built as part of rust bootstrap build. This results in additional build time and installations. Disable rust-lld in config.toml to prevent it. References: rust-lang/rust#135001 rust-lang/rust@8744b44 * Drop Zdual-proc-macros-additional-check.patch patch since it's merged with v1.86.0 rust-lang/rust@139d6ba * LTO config is applied to rustdoc from v1.86.0. Rebase 0001-src-core-build_steps-tool.rs-switch-off-lto-for-rust.patch which disables it to avoid suffixes in binaries causing non-reproducibility. rust-lang/rust@1fe351b * Restrict tests using "//@only <target_arch>" to avoid failures on riscv64, which is now part of default AB testing. Since riscv64 is Tier 2 with no automated testing, some tests may fail. This approach ensures tests continue running on supported architectures while skipping them on riscv64. https://doc.rust-lang.org/rustc/platform-support.html#tier-2-with-host-tools Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Rust stable version updated to 1.86.0. https://blog.rust-lang.org/2025/04/03/Rust-1.86.0.html * Add pkgconfig-native and openssl to resolve openssl-sys crate dependency on pkg-config. As per rust document this is a required dependency. Fixes: | error: failed to run custom build command for `openssl-sys v0.9.106` | Could not find openssl via pkg-config: | The pkg-config command could not be found. | | Most likely, you need to install a pkg-config package for your OS. | Try `apt install pkg-config`, or `yum install pkg-config`, | or `pkg install pkg-config`, or `apk add pkgconfig` depending on your distribution https://crates.io/crates/openssl-sys/0.9.108/dependencies https://github.com/rust-lang/rust/blob/master/INSTALL.md#dependencies * Add Ninja as a dependency for building Rust to prevent bootstrap build regression. Fixes: | Building LLD for x86_64-unknown-linux-gnu | | Couldn't find required command: ninja (or ninja-build) | | You should install ninja as described at | <https://github.com/ninja-build/ninja/wiki/Pre-built-Ninja-packages>, | or set `ninja = false` in the `[llvm]` section of `config.toml`. | Alternatively, set `download-ci-llvm = true` in that `[llvm]` section | to download LLVM rather than building it. * Add bash to DEPENDS to resolve missing dependency for subtree-sync.sh Fixes: ERROR: rust-1.86.0-r0 do_package_qa: QA Issue: /usr/lib/rustlib/src/rust/library/portable-simd/subtree-sync.sh contained in package rust requires /bin/bash, but no providers found in RDEPENDS:rust? [file-rdeps] * Add do_install:append() task to remove cargo bin from rust native builds. This resolves the following conflict: Fixes: ERROR: libstd-rs-1.86.0-r0 do_prepare_recipe_sysroot: The file /usr/bin/cargo is installed by both rust-native and cargo-native, aborting * Update Unicode-3.0 license checksums. License-Update: Copyright and license files to distributions are updated. rust-lang/rust@f9c1699 It adds copyright and license files (including HTML versions) to distributions, aligns with license compliance tools like reuse, and ensures all required license texts are properly included and formatted. * Disable building of extended Rust tools to reduce build time and filesystem usage. Update config.toml to disable building of extended Rust tools that are not required. This helps minimize unnecessary build time and filesystem usage. * The "remote-test-server" bin is now generated in stage2-tools-bin dir rather than stage1. Update the test suite accordingly. * Fix do_package QA issue by packing missing zsh files and directories: Fixes: do_package: QA Issue: rust: Files/directories were installed but not shipped in any package: /usr/share/zsh /usr/share/zsh/site-functions /usr/share/zsh/site-functions/_cargo Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install * Install "llvm-tblgen" from native-sysroot to recipe sysroot to handle file not found error during rust builds: Fixes: /bin/sh: line 1:/home/poky/build/tmp/work/core2-64-poky-linux/rust/1.86.0/recipe-sysroot/usr/lib/llvm-rust/bin/llvm-tblgen: No such file or directory | make[2]: *** [COFF/CMakeFiles/COFFOptionsTableGen.dir/build.make:120: COFF/Options.inc] Error 127 | make[1]: *** [CMakeFiles/Makefile2:630: COFF/CMakeFiles/COFFOptionsTableGen.dir/all] Error 2 | make[1]: *** Waiting for unfinished jobs.... * From v1.86.0, a "self-contained" LLD is built as part of rust bootstrap build. This results in additional build time and installations. Disable rust-lld in config.toml to prevent it. References: rust-lang/rust#135001 rust-lang/rust@8744b44 * Drop Zdual-proc-macros-additional-check.patch patch since it's merged with v1.86.0 rust-lang/rust@139d6ba * LTO config is applied to rustdoc from v1.86.0. Rebase 0001-src-core-build_steps-tool.rs-switch-off-lto-for-rust.patch which disables it to avoid suffixes in binaries causing non-reproducibility. rust-lang/rust@1fe351b * Restrict tests using "//@only <target_arch>" to avoid failures on riscv64, which is now part of default AB testing. Since riscv64 is Tier 2 with no automated testing, some tests may fail. This approach ensures tests continue running on supported architectures while skipping them on riscv64. https://doc.rust-lang.org/rustc/platform-support.html#tier-2-with-host-tools Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com> Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
Rust stable version updated to 1.86.0. https://blog.rust-lang.org/2025/04/03/Rust-1.86.0.html * Add pkgconfig-native and openssl to resolve openssl-sys crate dependency on pkg-config. As per rust document this is a required dependency. Fixes: | error: failed to run custom build command for `openssl-sys v0.9.106` | Could not find openssl via pkg-config: | The pkg-config command could not be found. | | Most likely, you need to install a pkg-config package for your OS. | Try `apt install pkg-config`, or `yum install pkg-config`, | or `pkg install pkg-config`, or `apk add pkgconfig` depending on your distribution https://crates.io/crates/openssl-sys/0.9.108/dependencies https://github.com/rust-lang/rust/blob/master/INSTALL.md#dependencies * Add Ninja as a dependency for building Rust to prevent bootstrap build regression. Fixes: | Building LLD for x86_64-unknown-linux-gnu | | Couldn't find required command: ninja (or ninja-build) | | You should install ninja as described at | <https://github.com/ninja-build/ninja/wiki/Pre-built-Ninja-packages>, | or set `ninja = false` in the `[llvm]` section of `config.toml`. | Alternatively, set `download-ci-llvm = true` in that `[llvm]` section | to download LLVM rather than building it. * Add bash to DEPENDS to resolve missing dependency for subtree-sync.sh Fixes: ERROR: rust-1.86.0-r0 do_package_qa: QA Issue: /usr/lib/rustlib/src/rust/library/portable-simd/subtree-sync.sh contained in package rust requires /bin/bash, but no providers found in RDEPENDS:rust? [file-rdeps] * Add do_install:append() task to remove cargo bin from rust native builds. This resolves the following conflict: Fixes: ERROR: libstd-rs-1.86.0-r0 do_prepare_recipe_sysroot: The file /usr/bin/cargo is installed by both rust-native and cargo-native, aborting * Update Unicode-3.0 license checksums. License-Update: Copyright and license files to distributions are updated. rust-lang/rust@f9c1699 It adds copyright and license files (including HTML versions) to distributions, aligns with license compliance tools like reuse, and ensures all required license texts are properly included and formatted. * Disable building of extended Rust tools to reduce build time and filesystem usage. Update config.toml to disable building of extended Rust tools that are not required. This helps minimize unnecessary build time and filesystem usage. * The "remote-test-server" bin is now generated in stage2-tools-bin dir rather than stage1. Update the test suite accordingly. * Fix do_package QA issue by packing missing zsh files and directories: Fixes: do_package: QA Issue: rust: Files/directories were installed but not shipped in any package: /usr/share/zsh /usr/share/zsh/site-functions /usr/share/zsh/site-functions/_cargo Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install * Install "llvm-tblgen" from native-sysroot to recipe sysroot to handle file not found error during rust builds: Fixes: /bin/sh: line 1:/home/poky/build/tmp/work/core2-64-poky-linux/rust/1.86.0/recipe-sysroot/usr/lib/llvm-rust/bin/llvm-tblgen: No such file or directory | make[2]: *** [COFF/CMakeFiles/COFFOptionsTableGen.dir/build.make:120: COFF/Options.inc] Error 127 | make[1]: *** [CMakeFiles/Makefile2:630: COFF/CMakeFiles/COFFOptionsTableGen.dir/all] Error 2 | make[1]: *** Waiting for unfinished jobs.... * From v1.86.0, a "self-contained" LLD is built as part of rust bootstrap build. This results in additional build time and installations. Disable rust-lld in config.toml to prevent it. References: rust-lang/rust#135001 rust-lang/rust@8744b44 * Drop Zdual-proc-macros-additional-check.patch patch since it's merged with v1.86.0 rust-lang/rust@139d6ba * LTO config is applied to rustdoc from v1.86.0. Rebase 0001-src-core-build_steps-tool.rs-switch-off-lto-for-rust.patch which disables it to avoid suffixes in binaries causing non-reproducibility. rust-lang/rust@1fe351b * Restrict tests using "//@only <target_arch>" to avoid failures on riscv64, which is now part of default AB testing. Since riscv64 is Tier 2 with no automated testing, some tests may fail. This approach ensures tests continue running on supported architectures while skipping them on riscv64. https://doc.rust-lang.org/rustc/platform-support.html#tier-2-with-host-tools (From OE-Core rev: 7cddb06dd77b90a246c5a41ff765a95d563c8fac) Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Rust stable version updated to 1.86.0. https://blog.rust-lang.org/2025/04/03/Rust-1.86.0.html * Add pkgconfig-native and openssl to resolve openssl-sys crate dependency on pkg-config. As per rust document this is a required dependency. Fixes: | error: failed to run custom build command for `openssl-sys v0.9.106` | Could not find openssl via pkg-config: | The pkg-config command could not be found. | | Most likely, you need to install a pkg-config package for your OS. | Try `apt install pkg-config`, or `yum install pkg-config`, | or `pkg install pkg-config`, or `apk add pkgconfig` depending on your distribution https://crates.io/crates/openssl-sys/0.9.108/dependencies https://github.com/rust-lang/rust/blob/master/INSTALL.md#dependencies * Add Ninja as a dependency for building Rust to prevent bootstrap build regression. Fixes: | Building LLD for x86_64-unknown-linux-gnu | | Couldn't find required command: ninja (or ninja-build) | | You should install ninja as described at | <https://github.com/ninja-build/ninja/wiki/Pre-built-Ninja-packages>, | or set `ninja = false` in the `[llvm]` section of `config.toml`. | Alternatively, set `download-ci-llvm = true` in that `[llvm]` section | to download LLVM rather than building it. * Add bash to DEPENDS to resolve missing dependency for subtree-sync.sh Fixes: ERROR: rust-1.86.0-r0 do_package_qa: QA Issue: /usr/lib/rustlib/src/rust/library/portable-simd/subtree-sync.sh contained in package rust requires /bin/bash, but no providers found in RDEPENDS:rust? [file-rdeps] * Add do_install:append() task to remove cargo bin from rust native builds. This resolves the following conflict: Fixes: ERROR: libstd-rs-1.86.0-r0 do_prepare_recipe_sysroot: The file /usr/bin/cargo is installed by both rust-native and cargo-native, aborting * Update Unicode-3.0 license checksums. License-Update: Copyright and license files to distributions are updated. rust-lang/rust@f9c1699 It adds copyright and license files (including HTML versions) to distributions, aligns with license compliance tools like reuse, and ensures all required license texts are properly included and formatted. * Disable building of extended Rust tools to reduce build time and filesystem usage. Update config.toml to disable building of extended Rust tools that are not required. This helps minimize unnecessary build time and filesystem usage. * The "remote-test-server" bin is now generated in stage2-tools-bin dir rather than stage1. Update the test suite accordingly. * Fix do_package QA issue by packing missing zsh files and directories: Fixes: do_package: QA Issue: rust: Files/directories were installed but not shipped in any package: /usr/share/zsh /usr/share/zsh/site-functions /usr/share/zsh/site-functions/_cargo Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install * Install "llvm-tblgen" from native-sysroot to recipe sysroot to handle file not found error during rust builds: Fixes: /bin/sh: line 1:/home/poky/build/tmp/work/core2-64-poky-linux/rust/1.86.0/recipe-sysroot/usr/lib/llvm-rust/bin/llvm-tblgen: No such file or directory | make[2]: *** [COFF/CMakeFiles/COFFOptionsTableGen.dir/build.make:120: COFF/Options.inc] Error 127 | make[1]: *** [CMakeFiles/Makefile2:630: COFF/CMakeFiles/COFFOptionsTableGen.dir/all] Error 2 | make[1]: *** Waiting for unfinished jobs.... * From v1.86.0, a "self-contained" LLD is built as part of rust bootstrap build. This results in additional build time and installations. Disable rust-lld in config.toml to prevent it. References: rust-lang/rust#135001 rust-lang/rust@8744b44 * Drop Zdual-proc-macros-additional-check.patch patch since it's merged with v1.86.0 rust-lang/rust@139d6ba * LTO config is applied to rustdoc from v1.86.0. Rebase 0001-src-core-build_steps-tool.rs-switch-off-lto-for-rust.patch which disables it to avoid suffixes in binaries causing non-reproducibility. rust-lang/rust@1fe351b * Restrict tests using "//@only <target_arch>" to avoid failures on riscv64, which is now part of default AB testing. Since riscv64 is Tier 2 with no automated testing, some tests may fail. This approach ensures tests continue running on supported architectures while skipping them on riscv64. https://doc.rust-lang.org/rustc/platform-support.html#tier-2-with-host-tools Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Rust stable version updated to 1.86.0. https://blog.rust-lang.org/2025/04/03/Rust-1.86.0.html * Add pkgconfig-native and openssl to resolve openssl-sys crate dependency on pkg-config. As per rust document this is a required dependency. Fixes: | error: failed to run custom build command for `openssl-sys v0.9.106` | Could not find openssl via pkg-config: | The pkg-config command could not be found. | | Most likely, you need to install a pkg-config package for your OS. | Try `apt install pkg-config`, or `yum install pkg-config`, | or `pkg install pkg-config`, or `apk add pkgconfig` depending on your distribution https://crates.io/crates/openssl-sys/0.9.108/dependencies https://github.com/rust-lang/rust/blob/master/INSTALL.md#dependencies * Add Ninja as a dependency for building Rust to prevent bootstrap build regression. Fixes: | Building LLD for x86_64-unknown-linux-gnu | | Couldn't find required command: ninja (or ninja-build) | | You should install ninja as described at | <https://github.com/ninja-build/ninja/wiki/Pre-built-Ninja-packages>, | or set `ninja = false` in the `[llvm]` section of `config.toml`. | Alternatively, set `download-ci-llvm = true` in that `[llvm]` section | to download LLVM rather than building it. * Add bash to DEPENDS to resolve missing dependency for subtree-sync.sh Fixes: ERROR: rust-1.86.0-r0 do_package_qa: QA Issue: /usr/lib/rustlib/src/rust/library/portable-simd/subtree-sync.sh contained in package rust requires /bin/bash, but no providers found in RDEPENDS:rust? [file-rdeps] * Add do_install:append() task to remove cargo bin from rust native builds. This resolves the following conflict: Fixes: ERROR: libstd-rs-1.86.0-r0 do_prepare_recipe_sysroot: The file /usr/bin/cargo is installed by both rust-native and cargo-native, aborting * Update Unicode-3.0 license checksums. License-Update: Copyright and license files to distributions are updated. rust-lang/rust@f9c1699 It adds copyright and license files (including HTML versions) to distributions, aligns with license compliance tools like reuse, and ensures all required license texts are properly included and formatted. * Disable building of extended Rust tools to reduce build time and filesystem usage. Update config.toml to disable building of extended Rust tools that are not required. This helps minimize unnecessary build time and filesystem usage. * The "remote-test-server" bin is now generated in stage2-tools-bin dir rather than stage1. Update the test suite accordingly. * Fix do_package QA issue by packing missing zsh files and directories: Fixes: do_package: QA Issue: rust: Files/directories were installed but not shipped in any package: /usr/share/zsh /usr/share/zsh/site-functions /usr/share/zsh/site-functions/_cargo Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install * Install "llvm-tblgen" from native-sysroot to recipe sysroot to handle file not found error during rust builds: Fixes: /bin/sh: line 1:/home/poky/build/tmp/work/core2-64-poky-linux/rust/1.86.0/recipe-sysroot/usr/lib/llvm-rust/bin/llvm-tblgen: No such file or directory | make[2]: *** [COFF/CMakeFiles/COFFOptionsTableGen.dir/build.make:120: COFF/Options.inc] Error 127 | make[1]: *** [CMakeFiles/Makefile2:630: COFF/CMakeFiles/COFFOptionsTableGen.dir/all] Error 2 | make[1]: *** Waiting for unfinished jobs.... * From v1.86.0, a "self-contained" LLD is built as part of rust bootstrap build. This results in additional build time and installations. Disable rust-lld in config.toml to prevent it. References: rust-lang/rust#135001 rust-lang/rust@8744b44 * Drop Zdual-proc-macros-additional-check.patch patch since it's merged with v1.86.0 rust-lang/rust@139d6ba * LTO config is applied to rustdoc from v1.86.0. Rebase 0001-src-core-build_steps-tool.rs-switch-off-lto-for-rust.patch which disables it to avoid suffixes in binaries causing non-reproducibility. rust-lang/rust@1fe351b * Restrict tests using "//@only <target_arch>" to avoid failures on riscv64, which is now part of default AB testing. Since riscv64 is Tier 2 with no automated testing, some tests may fail. This approach ensures tests continue running on supported architectures while skipping them on riscv64. https://doc.rust-lang.org/rustc/platform-support.html#tier-2-with-host-tools (From OE-Core rev: fd475231df58a6f122de5edfd08e6a4ee4d0816b) Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
In #116278, I added a
"self-contained"
mode to therust.use-lld
bootstrap option, which was designed for using the built-in LLD for linking compiler artifacts. However, this was later reverted in #118810.This PR brings the old logic back, which switches LLD in bootstrap from
-fuse-ld=lld
to MCP510's way of passing linker flags to enable LLD (both external and self-contained). So this does two changes:-fuse-ld=lld
to MCP510Regarding the second commit: Since #86113, we have been passing
-fuse-ld=lld
as a target flag to all tests whenuse-lld = true
is enabled. This kind of worked for all tests, since it was just a linker argument, which has bypassed any compiler checks, and probably resulted only in some warning if the given target linker didn't actually support LLD. However, after the first commit, some tests actually start failing with this approach:So the second commit removes the passing of LLD flags as target flags to tests. I don't think that it's a good idea to pass specific compiler flags to all tests unconditionally, tbh. The doctest command from #86113 doesn't go through compiletest anymore, and doctests should be quite a lot faster since #126245 in general.
CC @the8472
If someone has a beefy machine, it would be nice to test whether this doesn't regress test execution speed. How to do that:
rust.use-lld = true
andrust.lld = true
inconfig.toml
./x test tests/ui --force-rerun
betweenmaster
and this PROnce this is tested in the wild, I would like to make the self-contained LLD the default in CI, hopefully to make CI builds faster.
r? @onur-ozkan