about summary refs log tree commit diff
path: root/src/afl-cc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/afl-cc.c')
-rw-r--r--src/afl-cc.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/afl-cc.c b/src/afl-cc.c
index c516dc4c..1a7a837f 100644
--- a/src/afl-cc.c
+++ b/src/afl-cc.c
@@ -501,11 +501,22 @@ static void edit_params(u32 argc, char **argv, char **envp) {
 
       if (instrument_mode == INSTRUMENT_PCGUARD) {
 
-#if LLVM_MAJOR >= 4
+#if LLVM_MAJOR >= 10
+        cc_params[cc_par_cnt++] = "-Xclang";
+        cc_params[cc_par_cnt++] = "-load";
+        cc_params[cc_par_cnt++] = "-Xclang";
         cc_params[cc_par_cnt++] =
-            "-fsanitize-coverage=trace-pc-guard";  // edge coverage by default
+            alloc_printf("%s/SanitizerCoveragePCGUARD.so", obj_path);
 #else
+  #if LLVM_MAJOR >= 4
+        if (!be_quiet)
+          SAYF(
+              "Using unoptimized trace-pc-guard, upgrade to llvm 10+ for "
+              "enhanced version.\n");
+        cc_params[cc_par_cnt++] = "-fsanitize-coverage=trace-pc-guard";
+  #else
         FATAL("pcguard instrumentation requires llvm 4.0.1+");
+  #endif
 #endif
 
       } else {