Skip to content

Commit 67403da

Browse files
authored
Rollup merge of #81955 - dtolnay:dwp, r=Mark-Simulacrum
bootstrap: Locate llvm-dwp based on llvm-config bindir Fixes #81949. Tested by successfully building 1.50.0 pre-release, which is where I originally hit the issue (https://internals.rust-lang.org/t/rust-1-50-0-pre-release-testing/14012/4?u=dtolnay). Tested both with and without prebuilt LLVM. The check for dry_run is necessary in the non-prebuilt case because the llvm-config built by bootstrap won't exist yet.
2 parents 2a76add + d3fea13 commit 67403da

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/bootstrap/compile.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -1075,8 +1075,11 @@ impl Step for Assemble {
10751075
let src_exe = exe("llvm-dwp", target_compiler.host);
10761076
let dst_exe = exe("rust-llvm-dwp", target_compiler.host);
10771077
let llvm_config_bin = builder.ensure(native::Llvm { target: target_compiler.host });
1078-
let llvm_bin_dir = llvm_config_bin.parent().unwrap();
1079-
builder.copy(&llvm_bin_dir.join(&src_exe), &libdir_bin.join(&dst_exe));
1078+
if !builder.config.dry_run {
1079+
let llvm_bin_dir = output(Command::new(llvm_config_bin).arg("--bindir"));
1080+
let llvm_bin_dir = Path::new(llvm_bin_dir.trim());
1081+
builder.copy(&llvm_bin_dir.join(&src_exe), &libdir_bin.join(&dst_exe));
1082+
}
10801083
}
10811084

10821085
// Ensure that `libLLVM.so` ends up in the newly build compiler directory,

0 commit comments

Comments
 (0)