about summary refs log tree commit diff
path: root/llvm_mode
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2019-07-03 12:11:02 +0200
committervan Hauser <vh@thc.org>2019-07-03 12:11:02 +0200
commitaaa810c64a7d54d21df6c74c3f7b77fb06d273fe (patch)
tree1d18a0ce8cece487c40200179995f1ea00eff573 /llvm_mode
parentcc48f4499a6b4d646c19b99c0905324161eb03ed (diff)
downloadafl++-aaa810c64a7d54d21df6c74c3f7b77fb06d273fe.tar.gz
add -lrt with afl-gcc/clang automatically in mmap mode
Diffstat (limited to 'llvm_mode')
-rw-r--r--llvm_mode/Makefile8
-rw-r--r--llvm_mode/afl-clang-fast.c4
2 files changed, 8 insertions, 4 deletions
diff --git a/llvm_mode/Makefile b/llvm_mode/Makefile
index e2ed07d6..d3e0c739 100644
--- a/llvm_mode/Makefile
+++ b/llvm_mode/Makefile
@@ -154,10 +154,10 @@ test_build: $(PROGS)
 
 all_done: test_build
 	@echo "[+] All done! You can now use '../afl-clang-fast' to compile programs."
-ifeq "$(SHMAT_OK)" "0"
-	@echo "[!] shmat isn't working on your platform - compile every target with -lrt:"
-	@echo "[!]  CFLAGS=-lrt LDFLAGS=-lrt CC=afl-clang-fast CXX=afl-clang-fast++ ./configure"
-endif
+#ifeq "$(SHMAT_OK)" "0"
+#	@echo "[!] shmat isn't working on your platform - compile every target with -lrt:"
+#	@echo "[!]  CFLAGS=-lrt LDFLAGS=-lrt CC=afl-clang-fast CXX=afl-clang-fast++ ./configure"
+#endif
 
 .NOTPARALLEL: clean
 
diff --git a/llvm_mode/afl-clang-fast.c b/llvm_mode/afl-clang-fast.c
index 1e2e04ea..366389b4 100644
--- a/llvm_mode/afl-clang-fast.c
+++ b/llvm_mode/afl-clang-fast.c
@@ -246,6 +246,10 @@ static void edit_params(u32 argc, char** argv) {
 
   }
 
+#ifdef USEMMAP
+  cc_params[cc_par_cnt++] = "-lrt";
+#endif
+
   cc_params[cc_par_cnt++] = "-D__AFL_HAVE_MANUAL_CONTROL=1";
   cc_params[cc_par_cnt++] = "-D__AFL_COMPILER=1";
   cc_params[cc_par_cnt++] = "-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION=1";