Skip to content

Commit 1fe1fa9

Browse files
committed
Avoid building LLVM just for llvm-dwp
When the LLVM backend is disabled, the llvm-project submodule is not checked out by default. This breaks the bootstrap test for cg_clif. As cg_clif doesn't support split debuginfo anyway llvm-dwp is not necessary. Other backends would likely not want to build LLVM just for llvm-dwp either.
1 parent 0e63af5 commit 1fe1fa9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/bootstrap/compile.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -1050,8 +1050,10 @@ impl Step for Assemble {
10501050
builder.copy(&lld_install.join("bin").join(&src_exe), &libdir_bin.join(&dst_exe));
10511051
}
10521052

1053-
// Similarly, copy `llvm-dwp` into libdir for Split DWARF.
1054-
{
1053+
// Similarly, copy `llvm-dwp` into libdir for Split DWARF. Only copy it when the LLVM
1054+
// backend is used to avoid unnecessarily building LLVM and because LLVM is not checked
1055+
// out by default when the LLVM backend is not enabled.
1056+
if builder.config.rust_codegen_backends.contains(&INTERNER.intern_str("llvm")) {
10551057
let src_exe = exe("llvm-dwp", target_compiler.host);
10561058
let dst_exe = exe("rust-llvm-dwp", target_compiler.host);
10571059
let llvm_config_bin = builder.ensure(native::Llvm { target: target_compiler.host });

0 commit comments

Comments
 (0)