Revert "Make `lto` and `linker-plugin-lto` work the same for `compiler_builtins` by rcvalle · Pull Request #146133 · rust-lang/rust
tgross35
changed the title
Revert "Make
Revert "Make lto and linker-plugin-lto work the same for `compile…lto and linker-plugin-lto work the same for compiler_builtins
…r_builtins`" This reverts commit cf8753e and fixes the regressions reported.
rustbot
added
S-waiting-on-author
and removed S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.labels
Sep 2, 2025
rcvalle
marked this pull request as ready for review
rustbot
added
S-waiting-on-review
and removed S-waiting-on-author
Status: This is awaiting some action (such as code changes or more information) from the author.labels
Sep 3, 2025
lqd
mentioned this pull request
bors
added
S-waiting-on-bors
and removed S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.labels
Sep 3, 2025bors added a commit that referenced this pull request
Sep 3, 2025Rollup of 15 pull requests Successful merges: - #143725 (core: add Peekable::next_if_map) - #145209 (Stabilize `path_add_extension`) - #145750 (raw_vec.rs: Remove superfluous fn alloc_guard) - #145962 (Ensure we emit an allocator shim when only some crate types need one) - #145963 (Add LSX accelerated implementation for source file analysis) - #146054 (add `#[must_use]` to `array::repeat`) - #146090 (Derive `PartialEq` for `InvisibleOrigin`) - #146120 (Correct typo in `rustc_errors` comment) - #146127 (Rename `ToolRustc` to `ToolRustcPrivate`) - #146131 (rustdoc-search: add test case for indexing every item type) - #146133 (Revert "Make `lto` and `linker-plugin-lto` work the same for `compiler_builtins`) - #146134 (llvm: nvptx: Layout update to match LLVM) - #146136 (docs(std): add missing closing code block fences in doc comments) - #146137 (Disallow frontmatter in `--cfg` and `--check-cfg` arguments) - #146140 (compiletest: cygwin follows windows in using PATH for dynamic libraries) r? `@ghost` `@rustbot` modify labels: rollup
bors added a commit that referenced this pull request
Sep 3, 2025Rollup of 16 pull requests Successful merges: - #143725 (core: add Peekable::next_if_map) - #145209 (Stabilize `path_add_extension`) - #145342 (fix drop scope for `super let` bindings within `if let`) - #145750 (raw_vec.rs: Remove superfluous fn alloc_guard) - #145962 (Ensure we emit an allocator shim when only some crate types need one) - #145963 (Add LSX accelerated implementation for source file analysis) - #146054 (add `#[must_use]` to `array::repeat`) - #146090 (Derive `PartialEq` for `InvisibleOrigin`) - #146120 (Correct typo in `rustc_errors` comment) - #146127 (Rename `ToolRustc` to `ToolRustcPrivate`) - #146133 (Revert "Make `lto` and `linker-plugin-lto` work the same for `compiler_builtins`) - #146134 (llvm: nvptx: Layout update to match LLVM) - #146136 (docs(std): add missing closing code block fences in doc comments) - #146137 (Disallow frontmatter in `--cfg` and `--check-cfg` arguments) - #146140 (compiletest: cygwin follows windows in using PATH for dynamic libraries) - #146156 (miri subtree update) r? `@ghost` `@rustbot` modify labels: rollup
rcvalle
deleted the
rust-cfi-fix-145981
branch
This was referenced
Sep 4, 2025
ctz
mentioned this pull request
github-merge-queue bot pushed a commit to rust-lang/cargo that referenced this pull request
Nov 20, 2025Add a test for rust-lang/rust#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 rust-lang/rust#146109. The point is that when rustc is invoked with -Clto=fat or -Clto=thin, it should perform LTO with ALL bitcodes. However, rust-lang/rust#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.
Zalathar added a commit to Zalathar/rust that referenced this pull request
Dec 9, 2025…to, r=jieyouxu test: Add a test for 146133 This is a test without using `-Zbuild-std` for rust-lang#146133. There is another test using `-Zbuild-std`: rust-lang/cargo#16277. Even if a crate is marked as `#![no_builtins]`, we can still generate bitcode for rlib, but we cannot emit bitcode to the linker in rustc's LTO.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request
Dec 9, 2025…to, r=jieyouxu test: Add a test for 146133 This is a test without using `-Zbuild-std` for rust-lang#146133. There is another test using `-Zbuild-std`: rust-lang/cargo#16277. Even if a crate is marked as `#![no_builtins]`, we can still generate bitcode for rlib, but we cannot emit bitcode to the linker in rustc's LTO.
rust-timer added a commit that referenced this pull request
Dec 9, 2025Rollup merge of #149772 - dianqk:no-builtins-linker-plugin-lto, r=jieyouxu test: Add a test for 146133 This is a test without using `-Zbuild-std` for #146133. There is another test using `-Zbuild-std`: rust-lang/cargo#16277. Even if a crate is marked as `#![no_builtins]`, we can still generate bitcode for rlib, but we cannot emit bitcode to the linker in rustc's LTO.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters