Skip to content

Commit

Permalink
Rollup merge of rust-lang#38493 - sanxiyn:filecheck, r=alexcrichton
Browse files Browse the repository at this point in the history
Find FileCheck using llvm-config

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

Fix rust-lang#36282.

r? @alexcrichton
  • Loading branch information
alexcrichton committed Dec 20, 2016
2 parents 10bb4a4 + 73877a0 commit c188635
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/bootstrap/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/sanity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit c188635

Please sign in to comment.