about summary refs log tree commit diff
diff options
context:
space:
mode:
authorYuki Okushi <huyuumi.dev@gmail.com>2021-02-12 19:32:11 +0900
committerGitHub <noreply@github.com>2021-02-12 19:32:11 +0900
commit67403da1ebefa360a4a2309d3ec92b56c8471362 (patch)
tree8f9e6dbb0d83e092f192925def0292a90422e6aa
parent2a76add29f3c78cffa6475c4e6fdf6dd49a8299c (diff)
parentd3fea13ae0949a64b5809ba6a7304307ddf3528e (diff)
downloadrust-67403da1ebefa360a4a2309d3ec92b56c8471362.tar.gz
rust-67403da1ebefa360a4a2309d3ec92b56c8471362.zip
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.
-rw-r--r--src/bootstrap/compile.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs
index 833c13e9a26..dee0c154201 100644
--- a/src/bootstrap/compile.rs
+++ b/src/bootstrap/compile.rs
@@ -1075,8 +1075,11 @@ impl Step for Assemble {
             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 });
-            let llvm_bin_dir = llvm_config_bin.parent().unwrap();
-            builder.copy(&llvm_bin_dir.join(&src_exe), &libdir_bin.join(&dst_exe));
+            if !builder.config.dry_run {
+                let llvm_bin_dir = output(Command::new(llvm_config_bin).arg("--bindir"));
+                let llvm_bin_dir = Path::new(llvm_bin_dir.trim());
+                builder.copy(&llvm_bin_dir.join(&src_exe), &libdir_bin.join(&dst_exe));
+            }
         }
 
         // Ensure that `libLLVM.so` ends up in the newly build compiler directory,