Skip to content

Commit

Permalink
Rollup merge of #81594 - bjorn3:avoid_building_llvm_for_dwp, r=sanxiyn
Browse files Browse the repository at this point in the history
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.

Fixes https://github.com/bjorn3/rustc_codegen_cranelift/issues/1119
  • Loading branch information
jonas-schievink authored Feb 1, 2021
2 parents afa5163 + 1fe1fa9 commit 92fe441
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/bootstrap/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1050,8 +1050,10 @@ impl Step for Assemble {
builder.copy(&lld_install.join("bin").join(&src_exe), &libdir_bin.join(&dst_exe));
}

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

0 comments on commit 92fe441

Please sign in to comment.