about summary refs log tree commit diff
diff options
context:
space:
mode:
authorvanhauser-thc <vh@thc.org>2022-03-30 09:16:47 +0200
committervanhauser-thc <vh@thc.org>2022-03-30 09:16:47 +0200
commita436ef47e5cf0cb16b4afddccc6530285a6bb6fa (patch)
treebf55160eb0586591bc2ed8b1503626babb611b02
parentb34751efbf9304128d8e52dfeeb3abe0d4f5ba3b (diff)
downloadafl++-a436ef47e5cf0cb16b4afddccc6530285a6bb6fa.tar.gz
fix instrumentlist for LTO with clang < 13
-rw-r--r--src/afl-cc.c2
-rwxr-xr-xtest/test-llvm-lto.sh3
2 files changed, 5 insertions, 0 deletions
diff --git a/src/afl-cc.c b/src/afl-cc.c
index dfcb2a89..4cec7740 100644
--- a/src/afl-cc.c
+++ b/src/afl-cc.c
@@ -577,6 +577,8 @@ static void edit_params(u32 argc, char **argv, char **envp) {
 
 #if defined(AFL_CLANG_LDPATH) && LLVM_MAJOR >= 13
       cc_params[cc_par_cnt++] = "-Wl,--lto-legacy-pass-manager";
+#else
+      cc_params[cc_par_cnt++] = "-fno-experimental-new-pass-manager";
 #endif
 
       cc_params[cc_par_cnt++] = "-Wl,--allow-multiple-definition";
diff --git a/test/test-llvm-lto.sh b/test/test-llvm-lto.sh
index 9ff2ec10..bb4a9f7c 100755
--- a/test/test-llvm-lto.sh
+++ b/test/test-llvm-lto.sh
@@ -49,6 +49,9 @@ test -e ../afl-clang-lto -a -e ../SanitizerCoverageLTO.so && {
     grep -q "No instrumentation targets found" test.out && {
       $ECHO "$GREEN[+] llvm_mode LTO instrumentlist feature works correctly"
     } || {
+	echo CUT------------------------------------------------------------------CUT
+        cat test.out
+        echo CUT------------------------------------------------------------------CUT
       $ECHO "$RED[!] llvm_mode LTO instrumentlist feature failed"
       CODE=1
     }