llvm support for up to version 8

This commit is contained in:
van Hauser
2019-06-03 23:20:30 +02:00
parent b3a504248f
commit 865212899a
4 changed files with 19 additions and 13 deletions

View File

@ -27,7 +27,7 @@ Version ++2.52c (2019-05-28):
to the AFL schedule, not to the FAST schedule. So nothing changes unless
you use the new -p option :-) - see docs/power_schedules.txt
- added afl-system-config script to set all system performance options for fuzzing
- llvm_mode works with llvm 3.9 up to including 6.0.1
- llvm_mode works with llvm 3.9 up to including 8 !
- qemu_mode got upgraded from 2.1 to 3.1 - incorporated from
https://github.com/andreafioraldi/afl and with community patches added

View File

@ -23,11 +23,11 @@ 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 )
#LLVM_OK = $(shell $(LLVM_CONFIG) --version | egrep -q '^[5-6]' && echo 0 || echo 1 )
LLVM_UNSUPPORTED = $(shell $(LLVM_CONFIG) --version | egrep -q '^9' && echo 1 || echo 0 )
ifeq "$(LLVM_UNSUPPORTED)" "1"
$(error llvm_mode only supports versions 3.9 up to 6.0.1 )
$(warn llvm_mode only supports versions 3.9 up to 8 )
endif
CFLAGS ?= -O3 -funroll-loops
@ -42,7 +42,7 @@ CXXFLAGS ?= -O3 -funroll-loops
CXXFLAGS += -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign \
-DVERSION=\"$(VERSION)\" -Wno-variadic-macros
CLANG_CFL = `$(LLVM_CONFIG) --cxxflags` -fno-rtti -fpic $(CXXFLAGS)
CLANG_CFL = `$(LLVM_CONFIG) --cxxflags` -Wl,-znodelete -fno-rtti -fpic $(CXXFLAGS)
CLANG_LFL = `$(LLVM_CONFIG) --ldflags` $(LDFLAGS)
# User teor2345 reports that this is required to make things work on MacOS X.
@ -57,11 +57,11 @@ endif
ifeq "$(origin CC)" "default"
CC = clang
ifeq "$(LLVM_OK)" "1"
# ifeq "$(LLVM_OK)" "1"
CXX = clang++
else
CXX = g++
endif
# else
# CXX = g++
# endif
endif
ifndef AFL_TRACE_PC

View File

@ -7,8 +7,8 @@ Fast LLVM-based instrumentation for afl-fuzz
1) Introduction
---------------
! llvm_mode works with verison 3.0 up to 6.0.1 !
! llvm version 7, 8 and 9 do not work !
! llvm_mode works with verison 3.9 up to 8 !
! llvm version 9 does not work yet !
The code in this directory allows you to instrument programs for AFL using
true compiler-level instrumentation, instead of the more crude

View File

@ -73,7 +73,13 @@ bool CompareTransform::transformCmps(Module &M, const bool processStrcmp, const
IntegerType *Int8Ty = IntegerType::getInt8Ty(C);
IntegerType *Int32Ty = IntegerType::getInt32Ty(C);
IntegerType *Int64Ty = IntegerType::getInt64Ty(C);
Constant* c = M.getOrInsertFunction("tolower",
#if __clang_major__ < 9
Constant*
#else
FunctionCallee
#endif
c = M.getOrInsertFunction("tolower",
Int32Ty,
Int32Ty
#if __clang_major__ < 7