libafl_cc custom llvm_config lookup for solaris/illumos (#1708)

This commit is contained in:
David CARLIER 2023-12-03 09:23:33 +00:00 committed by GitHub
parent 517d6962bd
commit 108c04a8d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -82,7 +82,15 @@ fn find_llvm_config() -> Result<String, String> {
} }
}; };
#[cfg(not(target_vendor = "apple"))] #[cfg(any(target_os = "solaris", target_os = "illumos"))]
for version in (LLVM_VERSION_MIN..=LLVM_VERSION_MAX).rev() {
let llvm_config_name: String = format!("/usr/clang/{version}.0/bin/llvm-config");
if Path::new(&llvm_config_name).exists() {
return Ok(llvm_config_name);
}
}
#[cfg(not(any(target_vendor = "apple", target_os = "solaris", target_os = "illumos")))]
for version in (LLVM_VERSION_MIN..=LLVM_VERSION_MAX).rev() { for version in (LLVM_VERSION_MIN..=LLVM_VERSION_MAX).rev() {
let llvm_config_name: String = format!("llvm-config-{version}"); let llvm_config_name: String = format!("llvm-config-{version}");
if which(&llvm_config_name).is_ok() { if which(&llvm_config_name).is_ok() {