about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2016-12-20 11:16:50 -0800
committerAlex Crichton <alex@alexcrichton.com>2016-12-20 12:59:11 -0800
commitc188635a2ab51d592e3d8e850d9d05b9eb905033 (patch)
tree031796ff9c3e0480285ee6d3797f61d0389131d9
parent10bb4a4801243f2465fa9b17cfa7ab40f7f3980d (diff)
parent73877a0bc882abc2a88fe9c0d4fb95d49c1ba492 (diff)
downloadrust-c188635a2ab51d592e3d8e850d9d05b9eb905033.tar.gz
rust-c188635a2ab51d592e3d8e850d9d05b9eb905033.zip
Rollup merge of #38493 - sanxiyn:filecheck, r=alexcrichton
Find FileCheck using llvm-config

This allows using system LLVM from Debian package to run codegen tests.

Fix #36282.

r? @alexcrichton
-rw-r--r--src/bootstrap/lib.rs3
-rw-r--r--src/bootstrap/sanity.rs2
2 files changed, 3 insertions, 2 deletions
diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs
index f6db6e786db..128e03fe8f8 100644
--- a/src/bootstrap/lib.rs
+++ b/src/bootstrap/lib.rs
@@ -721,7 +721,8 @@ impl Build {
     fn llvm_filecheck(&self, target: &str) -> PathBuf {
         let target_config = self.config.target_config.get(target);
         if let Some(s) = target_config.and_then(|c| c.llvm_config.as_ref()) {
-            s.parent().unwrap().join(exe("FileCheck", target))
+            let llvm_bindir = output(Command::new(s).arg("--bindir"));
+            Path::new(llvm_bindir.trim()).join(exe("FileCheck", target))
         } else {
             let base = self.llvm_out(&self.config.build).join("build");
             let exe = exe("FileCheck", target);
diff --git a/src/bootstrap/sanity.rs b/src/bootstrap/sanity.rs
index 2992099687d..5d543419fc9 100644
--- a/src/bootstrap/sanity.rs
+++ b/src/bootstrap/sanity.rs
@@ -143,7 +143,7 @@ pub fn check(build: &mut Build) {
     // Externally configured LLVM requires FileCheck to exist
     let filecheck = build.llvm_filecheck(&build.config.build);
     if !filecheck.starts_with(&build.out) && !filecheck.exists() && build.config.codegen_tests {
-        panic!("filecheck executable {:?} does not exist", filecheck);
+        panic!("FileCheck executable {:?} does not exist", filecheck);
     }
 
     for target in build.config.target.iter() {