Better error for libafl_cc when binaries are not found (#2988)
* better error when libafl_cc does not work as expected * better msg, clippy
This commit is contained in:
parent
d382b8381e
commit
530a3cc6aa
@ -333,20 +333,25 @@ pub const LIBAFL_CC_LLVM_VERSION: Option<usize> = None;
|
|||||||
llvm_ar = Path::new(&llvm_ar_path).join("llvm-ar");
|
llvm_ar = Path::new(&llvm_ar_path).join("llvm-ar");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let mut found = true;
|
||||||
|
|
||||||
if !clang.exists() {
|
if !clang.exists() {
|
||||||
println!("cargo:warning=Failed to find clang frontend.");
|
println!("cargo:warning=Failed to find binary: clang.");
|
||||||
return;
|
found = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if !clangcpp.exists() {
|
if !clangcpp.exists() {
|
||||||
println!("cargo:warning=Failed to find clang++ frontend.");
|
println!("cargo:warning=Failed to find binary: clang++.");
|
||||||
return;
|
found = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if !llvm_ar.exists() {
|
if !llvm_ar.exists() {
|
||||||
println!("cargo:warning=Failed to find llvm-ar archiver.");
|
println!("cargo:warning=Failed to find binary: llvm-ar.");
|
||||||
return;
|
found = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assert!(found, "\n\tAt least one of the LLVM dependencies could not be found.\n\tThe following search directory was considered: {}\n", bindir_path.display());
|
||||||
|
|
||||||
let cxxflags = if let Ok(flags) = llvm_cxxflags {
|
let cxxflags = if let Ok(flags) = llvm_cxxflags {
|
||||||
flags
|
flags
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user