mirror of
https://github.com/rust-lang/cargo.git
synced 2026-03-21 20:03:56 +00:00
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.