llvm compile fix

This commit is contained in:
van Hauser
2019-06-03 13:10:27 +02:00
parent 835b84fc49
commit 14bfde3f78
4 changed files with 15 additions and 8 deletions

View File

@ -27,8 +27,7 @@ Version ++2.52c (2019-05-28):
to the AFL schedule, not to the FAST schedule. So nothing changes unless to the AFL schedule, not to the FAST schedule. So nothing changes unless
you use the new -p option :-) - see docs/power_schedules.txt you use the new -p option :-) - see docs/power_schedules.txt
- added afl-system-config script to set all system performance options for fuzzing - added afl-system-config script to set all system performance options for fuzzing
- llvm_mode is currently configured to work with llvm 5.0 and 6.0. - llvm_mode works with llvm 3.9 up to including 6.0.1
To compile with 3.9 or 4.0 you must change CXX to clang++ in llvm_mode/Makefile
--------------------------- ---------------------------

View File

@ -119,7 +119,7 @@ The clang wrappers (afl-clang and afl-clang++) can be used in the same way;
clang users may also opt to leverage a higher-performance instrumentation mode, clang users may also opt to leverage a higher-performance instrumentation mode,
as described in llvm_mode/README.llvm. as described in llvm_mode/README.llvm.
Clang/LLVM has a much better performance, but only works with LLVM up to and Clang/LLVM has a much better performance, but only works with LLVM up to and
including 6.0. including 6.0.1.
Using the LAF Intel performance enhancements are also recommended, see Using the LAF Intel performance enhancements are also recommended, see
docs/README.laf-intel docs/README.laf-intel

View File

@ -23,6 +23,12 @@ BIN_PATH = $(PREFIX)/bin
VERSION = $(shell grep '^\#define VERSION ' ../config.h | cut -d '"' -f2) VERSION = $(shell grep '^\#define VERSION ' ../config.h | cut -d '"' -f2)
LLVM_CONFIG ?= llvm-config 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 ?= -O3 -funroll-loops
CFLAGS += -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign \ CFLAGS += -Wall -D_FORTIFY_SOURCE=2 -g -Wno-pointer-sign \
@ -51,8 +57,11 @@ endif
ifeq "$(origin CC)" "default" ifeq "$(origin CC)" "default"
CC = clang CC = clang
# if you use llvm 3.9 or 4.0 switch this to clang++ below ifeq "$(LLVM_OK)" "1"
CXX = g++ CXX = clang++
else
CXX = g++
endif
endif endif
ifndef AFL_TRACE_PC ifndef AFL_TRACE_PC

View File

@ -7,9 +7,8 @@ Fast LLVM-based instrumentation for afl-fuzz
1) Introduction 1) Introduction
--------------- ---------------
! llvm_mode is currently configured to compile with llvm 5.0 and 6.0 via g++ ! ! llvm_mode works with verison 3.0 up to 6.0.1 !
! To compile with llvm 3.9 and 4.0 edit the Makefile and change CXX to clang++ ! ! llvm version 7, 8 and 9 do not work !
! Fixes for llvm 3.7, 7 and 8 are in the work !
The code in this directory allows you to instrument programs for AFL using The code in this directory allows you to instrument programs for AFL using
true compiler-level instrumentation, instead of the more crude true compiler-level instrumentation, instead of the more crude