Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better error for libafl_cc when binaries are not found #2988

Merged
merged 2 commits into from
Feb 17, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions libafl_cc/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -333,18 +333,25 @@ pub const LIBAFL_CC_LLVM_VERSION: Option<usize> = None;
llvm_ar = Path::new(&llvm_ar_path).join("llvm-ar");
}

let mut found = true;

if !clang.exists() {
println!("cargo:warning=Failed to find clang frontend.");
return;
println!("cargo:warning=Failed to find binary: clang.");
found = false;
}

if !clangcpp.exists() {
println!("cargo:warning=Failed to find clang++ frontend.");
return;
println!("cargo:warning=Failed to find binary: clang++.");
found = false;
}

if !llvm_ar.exists() {
println!("cargo:warning=Failed to find llvm-ar archiver.");
return;
println!("cargo:warning=Failed to find binary: llvm-ar.");
found = false;
}

if !found {
panic!("\n\tOne of the LLVM dependencies has not been found.\n\tThe following search directory was considered: {}\n", bindir_path.display());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"At least one of the LLVM dependencies could not be found."

}

let cxxflags = if let Ok(flags) = llvm_cxxflags {
Expand Down
Loading