From a267ff1ab58ed29a39133309904e1c6eb7c1ea3f Mon Sep 17 00:00:00 2001 From: van Hauser Date: Sat, 1 Aug 2020 18:31:11 +0200 Subject: better LTO mode detection warnings --- llvm_mode/GNUmakefile | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'llvm_mode') diff --git a/llvm_mode/GNUmakefile b/llvm_mode/GNUmakefile index fbb77236..a202fbb4 100644 --- a/llvm_mode/GNUmakefile +++ b/llvm_mode/GNUmakefile @@ -183,18 +183,24 @@ ifeq "$(LLVM_LTO)" "1" ifneq "$(shell readlink $(LLVM_BINDIR)/ld.lld 2>&1)" "" AFL_REAL_LD = $(LLVM_BINDIR)/ld.lld else - $(warn ld.lld not found, can not enable LTO mode) + $(warn ld.lld not found, cannot enable LTO mode) LLVM_LTO = 0 endif endif + else + $(warn -flto is not working (LLVMgold.so not found?), cannot enable LTO mode) + LLVM_LTO = 0 endif endif AFL_CLANG_FUSELD= -ifneq "$(AFL_CLANG_FLTO)" "" -ifeq "$(shell echo 'int main() {return 0; }' | $(CLANG_BIN) -x c - -fuse-ld=`command -v ld` -o .test 2>/dev/null && echo 1 || echo 0 ; rm -f .test )" "1" - AFL_CLANG_FUSELD=1 -endif +ifeq "$(LLVM_LTO)" "1" + ifeq "$(shell echo 'int main() {return 0; }' | $(CLANG_BIN) -x c - -fuse-ld=`command -v ld` -o .test 2>/dev/null && echo 1 || echo 0 ; rm -f .test )" "1" + AFL_CLANG_FUSELD=1 + else + $(warn -fuse-ld is not working, cannot enable LTO mode) + LLVM_LTO = 0 + endif endif CFLAGS ?= -O3 -funroll-loops -fPIC -D_FORTIFY_SOURCE=2 -- cgit 1.4.1