aboutsummaryrefslogtreecommitdiff
path: root/llvm_mode/Makefile
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2019-06-03 13:10:27 +0200
committervan Hauser <vh@thc.org>2019-06-03 13:10:27 +0200
commit14bfde3f78ab7efdea0d72dc731a39e2e47bb2c3 (patch)
tree1e48bacf07ed4e137cf4a72bc9fb44d8258ce55f /llvm_mode/Makefile
parent835b84fc4953f38322084b8de08511e471f48a4a (diff)
downloadafl++-14bfde3f78ab7efdea0d72dc731a39e2e47bb2c3.tar.gz
llvm compile fix
Diffstat (limited to 'llvm_mode/Makefile')
-rw-r--r--llvm_mode/Makefile13
1 files changed, 11 insertions, 2 deletions
diff --git a/llvm_mode/Makefile b/llvm_mode/Makefile
index 100d57f5..c9e04aa5 100644
--- a/llvm_mode/Makefile
+++ b/llvm_mode/Makefile
@@ -23,6 +23,12 @@ BIN_PATH = $(PREFIX)/bin
VERSION = $(shell grep '^\#define VERSION ' ../config.h | cut -d '"' -f2)
LLVM_CONFIG ?= llvm-config
+LLVM_OK = $(shell $(LLVM_CONFIG) --version | egrep -q '^[5-6]' && echo 0 || echo 1 )
+LLVM_UNSUPPORTED = $(shell $(LLVM_CONFIG) --version | egrep -q '^[7-9]' && echo 1 || echo 0 )
+
+ifeq "$(LLVM_UNSUPPORTED)" "1"
+ $(error llvm_mode only supports versions 3.9 up to 6.0.1 )
+endif
CFLAGS ?= -O3 -funroll-loops
CFLAGS += -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign \
@@ -51,8 +57,11 @@ endif
ifeq "$(origin CC)" "default"
CC = clang
- # if you use llvm 3.9 or 4.0 switch this to clang++ below
- CXX = g++
+ ifeq "$(LLVM_OK)" "1"
+ CXX = clang++
+ else
+ CXX = g++
+ endif
endif
ifndef AFL_TRACE_PC