about summary refs log tree commit diff
path: root/llvm_mode/Makefile
diff options
context:
space:
mode:
authorhexcoder- <heiko@hexco.de>2020-03-28 23:01:12 +0100
committerhexcoder- <heiko@hexco.de>2020-03-28 23:01:12 +0100
commit699f769385b39512f3f21f0866b69eefc1f475d6 (patch)
tree3f20eba302de122a35c37e0c8e2cda76cf54f160 /llvm_mode/Makefile
parent2548b657d8bc9370c8fded9befb4f30b8ed3ce15 (diff)
downloadafl++-699f769385b39512f3f21f0866b69eefc1f475d6.tar.gz
review adaptions for afl-llvm-pass
Diffstat (limited to 'llvm_mode/Makefile')
-rw-r--r--llvm_mode/Makefile7
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm_mode/Makefile b/llvm_mode/Makefile
index 6c55374b..202dcbc6 100644
--- a/llvm_mode/Makefile
+++ b/llvm_mode/Makefile
@@ -201,6 +201,8 @@ else
   TARGETS = test_shm test_deps $(PROGS) afl-clang-fast.8 test_build all_done
 endif
 
+LLVM_MIN_4_0_1 = $(shell awk 'BEGIN { exit ARGV[1] >= ARGV[2] }' $(LLVMVER) 4.0.1; echo $$?)
+
 all: $(TARGETS)
 
 ifeq "$(SHMAT_OK)" "1"
@@ -268,7 +270,10 @@ endif
 	-$(CXX) $(CLANG_CFL) -DLLVMInsTrim_EXPORTS -fno-rtti -fPIC -std=$(LLVM_STDCXX) -shared $< MarkNodes.cc -o $@ $(CLANG_LFL)
 
 ../afl-llvm-pass.so: afl-llvm-pass.so.cc | test_deps
-	$(CXX) $(CLANG_CFL) -DLLVMInsTrim_EXPORTS -Wno-#warnings -fno-rtti -fPIC -std=$(LLVM_STDCXX) -shared $< -o $@ $(CLANG_LFL)
+ifeq "$(LLVM_MIN_4_0_1)" "0"
+	$(info [!] N-gram branch coverage instrumentation is not available for llvm version $(LLVMVER))
+endif
+	$(CXX) $(CLANG_CFL) -DLLVMInsTrim_EXPORTS -fno-rtti -fPIC -std=$(LLVM_STDCXX) -shared $< -o $@ $(CLANG_LFL)
 
 ../afl-llvm-lto-whitelist.so: afl-llvm-lto-whitelist.so.cc
 ifeq "$(LLVM_LTO)" "1"