Files
cargo/tests
Weihang Lo 14c6f0063c test(build-std): Add test for LTO (#16277)
Add a test for https://github.com/rust-lang/rust/pull/146133. `cargo
+nightly-2025-08-29 test --test build-std -- lto` can reproduce the
regression.
This is not a bug from Cargo, but it requires `-Zbuild-std` in most use
cases.
The test case is from https://github.com/rust-lang/rust/issues/146109.
The point is that when rustc is invoked with -Clto=fat or -Clto=thin, it
should perform LTO with ALL bitcodes. However,
https://github.com/rust-lang/rust/pull/145368 emits bitcodes for
compiler_builtins but excludes it from LTO participation.
As a result, the compiler_builtins bitcodes library is passed to the
linker, but the linkers, such as the GNU ld or older versions of LLD,
are unable to process bitcodes.
2025-11-20 20:22:00 +00:00
..