Skip to content

Commit

Permalink
Auto merge of rust-lang#132720 - jieyouxu:do-not-strip, r=davidtwco
Browse files Browse the repository at this point in the history
Only copy, rename and link `llvm-objcopy` if llvm tools are enabled

Fixes rust-lang#132719.

cc `@bjorn3` who reported the bootstrapping problem for cg_clif.
cc `@davidtwco` in case this might be problematic for linux -> macOS cross-compile builds, but seems very unlikely.
cc `@albertlarsan68` (co-reviewed rust-lang#131405)

r? bootstrap
  • Loading branch information
bors committed Nov 11, 2024
2 parents d4822c2 + cf9cec3 commit de27914
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/bootstrap/src/core/build_steps/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1976,9 +1976,13 @@ impl Step for Assemble {
}
}

{
// `llvm-strip` is used by rustc, which is actually just a symlink to `llvm-objcopy`,
// so copy and rename `llvm-objcopy`.
if builder.config.llvm_enabled(target_compiler.host) && builder.config.llvm_tools_enabled {
// `llvm-strip` is used by rustc, which is actually just a symlink to `llvm-objcopy`, so
// copy and rename `llvm-objcopy`.
//
// But only do so if llvm-tools are enabled, as bootstrap compiler might not contain any
// LLVM tools, e.g. for cg_clif.
// See <https://github.com/rust-lang/rust/issues/132719>.
let src_exe = exe("llvm-objcopy", target_compiler.host);
let dst_exe = exe("rust-objcopy", target_compiler.host);
builder.copy_link(&libdir_bin.join(src_exe), &libdir_bin.join(dst_exe));
Expand Down

0 comments on commit de27914

Please sign in to comment.