Skip to content

Commit de27914

Browse files
committed
Auto merge of rust-lang#132720 - jieyouxu:do-not-strip, r=davidtwco
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
2 parents d4822c2 + cf9cec3 commit de27914

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/bootstrap/src/core/build_steps/compile.rs

+7-3
Original file line numberDiff line numberDiff line change
@@ -1976,9 +1976,13 @@ impl Step for Assemble {
19761976
}
19771977
}
19781978

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

0 commit comments

Comments
 (0)