diff options
author | van Hauser <vh@thc.org> | 2019-09-20 18:37:16 +0200 |
---|---|---|
committer | van Hauser <vh@thc.org> | 2019-09-20 18:37:16 +0200 |
commit | 123d97bfb896aefca24ff8bdc235b900fe714fde (patch) | |
tree | e04b47c1d9b63d2f997be93b3e7cdab94874406b | |
parent | dd0a8c200c5de8ee87c2423ac1b954bb311ba872 (diff) | |
download | afl++-123d97bfb896aefca24ff8bdc235b900fe714fde.tar.gz |
LLVM_CONFIG llvm_mode fix
-rw-r--r-- | docs/ChangeLog | 2 | ||||
-rw-r--r-- | llvm_mode/Makefile | 16 | ||||
-rw-r--r-- | llvm_mode/README.md | 4 |
3 files changed, 18 insertions, 4 deletions
diff --git a/docs/ChangeLog b/docs/ChangeLog index 4ea4e4b2..b32253b6 100644 --- a/docs/ChangeLog +++ b/docs/ChangeLog @@ -22,6 +22,8 @@ Version ++2.54d (dev): add AFL_CUSTOM_MUTATOR_ONLY (that will trigger the previous behaviour) - no more unlinking the input file, this way the input file can also be a FIFO or disk partition + - setting LLVM_CONFIG for llvm_mode will now again switch to the selected + llvm version. If you setup is correct. - reducing duplicate code in afl-fuzz - added "make help" - removed compile warnings from python internal stuff diff --git a/llvm_mode/Makefile b/llvm_mode/Makefile index ed853d9d..2d35505e 100644 --- a/llvm_mode/Makefile +++ b/llvm_mode/Makefile @@ -38,6 +38,7 @@ endif LLVMVER = $(shell $(LLVM_CONFIG) --version) LLVM_UNSUPPORTED = $(shell $(LLVM_CONFIG) --version | egrep -q '^[12]|^3\.0|^1[0-9]' && echo 1 || echo 0 ) LLVM_MAJOR = $(shell $(LLVM_CONFIG) --version | sed 's/\..*//') +LLVM_BINDIR = $(shell $(LLVM_CONFIG) --bindir) ifeq "$(LLVM_UNSUPPORTED)" "1" $(warn llvm_mode only supports versions 3.8.0 up to 9) @@ -77,11 +78,18 @@ endif # this seems to be busted on some distros, so using the one in $PATH is # probably better. -ifeq "$(origin CC)" "default" - ifeq "$(shell uname)" "OpenBSD" - CC = $(BIN_PATH)/clang - CXX = $(BIN_PATH)/clang++ +CC = $(LLVM_BINDIR)/clang +CXX = $(LLVM_BINDIR)/clang++ + +ifeq "$(shell test -e $(CC) || echo 1 )" "1" + # llvm-config --bindir is not providing a valid path, so ... + ifeq "$(shell test -e "$(BIN_DIR)/clang" && echo 1)" "1" + # we found one in the local install directory, lets use these + CC = $(BIN_DIR)/clang + CXX = $(BIN_DIR)/clang++ else + # hope for the best + $(warn we have trouble finding clang/clang++ - llvm-config is not helping us) CC = clang CXX = clang++ endif diff --git a/llvm_mode/README.md b/llvm_mode/README.md index c7ef4b45..f196395b 100644 --- a/llvm_mode/README.md +++ b/llvm_mode/README.md @@ -41,6 +41,10 @@ In order to leverage this mechanism, you need to have clang installed on your system. You should also make sure that the llvm-config tool is in your path (or pointed to via LLVM_CONFIG in the environment). +Note that if you have several LLVM versions installed, pointing LLVM_CONFIG +to the version you want to use will switch compiling to this specific +version - if you installation is set up correctly :-) + Unfortunately, some systems that do have clang come without llvm-config or the LLVM development headers; one example of this is FreeBSD. FreeBSD users will also run into problems with clang being built statically and not being able to |