about summary refs log tree commit diff
path: root/llvm_mode/GNUmakefile
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2020-09-04 22:48:46 +0200
committerGitHub <noreply@github.com>2020-09-04 22:48:46 +0200
commit4f7a8a4c70de1b93b1dccd8f2bf092ec4b3626dc (patch)
tree8c81a16ba76661b0df5307b9964275ff529d4deb /llvm_mode/GNUmakefile
parent7f621509eee57f0b6fd9ad542adc4f2acafeb059 (diff)
parent976ee9022cda95e0715b82ff866098ad293117c9 (diff)
downloadafl++-4f7a8a4c70de1b93b1dccd8f2bf092ec4b3626dc.tar.gz
Merge pull request #542 from AFLplusplus/dev
push to stable
Diffstat (limited to 'llvm_mode/GNUmakefile')
-rw-r--r--llvm_mode/GNUmakefile8
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm_mode/GNUmakefile b/llvm_mode/GNUmakefile
index 55c488f9..c14e8b4e 100644
--- a/llvm_mode/GNUmakefile
+++ b/llvm_mode/GNUmakefile
@@ -217,6 +217,12 @@ ifeq "$(LLVM_LTO)" "1"
   endif
 endif
 
+ifeq "$(shell echo 'int main() {return 0; }' | $(CLANG_BIN) -x c - -fdebug-prefix-map=$(CURDIR)=llvm_mode -o .test 2>/dev/null && echo 1 || echo 0 ; rm -f .test )" "1"
+        AFL_CLANG_DEBUG_PREFIX = -fdebug-prefix-map="$(CURDIR)=llvm_mode"
+else
+        AFL_CLANG_DEBUG_PREFIX = ""
+endif
+
 CFLAGS          ?= -O3 -funroll-loops -fPIC -D_FORTIFY_SOURCE=2
 CFLAGS_SAFE     := -Wall -g -Wno-pointer-sign -I ../include/ \
                    -DAFL_PATH=\"$(HELPER_PATH)\" -DBIN_PATH=\"$(BIN_PATH)\" \
@@ -227,7 +233,7 @@ CFLAGS_SAFE     := -Wall -g -Wno-pointer-sign -I ../include/ \
                    -DAFL_CLANG_LDPATH=\"$(AFL_CLANG_LDPATH)\" \
                    -DAFL_CLANG_FUSELD=\"$(AFL_CLANG_FUSELD)\" \
                    -DCLANG_BIN=\"$(CLANG_BIN)\" -DCLANGPP_BIN=\"$(CLANGPP_BIN)\" -DUSE_BINDIR=$(USE_BINDIR) -Wno-unused-function \
-                   -fdebug-prefix-map="$(CURDIR)=llvm_mode"
+                   $(AFL_CLANG_DEBUG_PREFIX)
 override CFLAGS += $(CFLAGS_SAFE)
 
 ifdef AFL_TRACE_PC