Skip to content

Commit 73877a0

Browse files
committed
Find FileCheck using llvm-config
1 parent 94ae2a2 commit 73877a0

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/bootstrap/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,8 @@ impl Build {
721721
fn llvm_filecheck(&self, target: &str) -> PathBuf {
722722
let target_config = self.config.target_config.get(target);
723723
if let Some(s) = target_config.and_then(|c| c.llvm_config.as_ref()) {
724-
s.parent().unwrap().join(exe("FileCheck", target))
724+
let llvm_bindir = output(Command::new(s).arg("--bindir"));
725+
Path::new(llvm_bindir.trim()).join(exe("FileCheck", target))
725726
} else {
726727
let base = self.llvm_out(&self.config.build).join("build");
727728
let exe = exe("FileCheck", target);

src/bootstrap/sanity.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ pub fn check(build: &mut Build) {
143143
// Externally configured LLVM requires FileCheck to exist
144144
let filecheck = build.llvm_filecheck(&build.config.build);
145145
if !filecheck.starts_with(&build.out) && !filecheck.exists() && build.config.codegen_tests {
146-
panic!("filecheck executable {:?} does not exist", filecheck);
146+
panic!("FileCheck executable {:?} does not exist", filecheck);
147147
}
148148

149149
for target in build.config.target.iter() {

0 commit comments

Comments
 (0)