From 108c04a8d299501d1aad7b6a279f38ac31819a70 Mon Sep 17 00:00:00 2001 From: David CARLIER Date: Sun, 3 Dec 2023 09:23:33 +0000 Subject: [PATCH] libafl_cc custom llvm_config lookup for solaris/illumos (#1708) --- libafl_cc/build.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libafl_cc/build.rs b/libafl_cc/build.rs index 8e321d26e2..ce75ebf795 100644 --- a/libafl_cc/build.rs +++ b/libafl_cc/build.rs @@ -82,7 +82,15 @@ fn find_llvm_config() -> Result { } }; - #[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() { let llvm_config_name: String = format!("llvm-config-{version}"); if which(&llvm_config_name).is_ok() {