add -lrt with afl-gcc/clang automatically in mmap mode

This commit is contained in:
van Hauser 2019-07-03 12:11:02 +02:00
parent cc48f4499a
commit aaa810c64a
4 changed files with 16 additions and 8 deletions

View File

@ -176,10 +176,10 @@ endif
all_done: test_build
@if [ ! "`which clang 2>/dev/null`" = "" ]; then echo "[+] LLVM users: see llvm_mode/README.llvm for a faster alternative to afl-gcc."; fi
@echo "[+] All done! Be sure to review the README - it's pretty short and useful."
ifeq "$(SHMAT_OK)" "0"
@echo "[!] shmat isn't working on your platform - compile every target with -lrt:"
@echo "[!] CFLAGS=-lrt LDFLAGS=-lrt CC=afl-gcc CXX=afl-g++ ./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-gcc CXX=afl-g++ ./configure"
#endif
@if [ "`uname`" = "Darwin" ]; then printf "\nWARNING: Fuzzing on MacOS X is slow because of the unusually high overhead of\nfork() on this OS. Consider using Linux or *BSD. You can also use VirtualBox\n(virtualbox.org) to put AFL inside a Linux or *BSD VM.\n\n"; fi
@! tty <&1 >/dev/null || printf "\033[0;30mNOTE: If you can read this, your terminal probably uses white background.\nThis will make the UI hard to read. See docs/status_screen.txt for advice.\033[0m\n" 2>/dev/null

View File

@ -252,6 +252,10 @@ static void edit_params(u32 argc, char** argv) {
}
#ifdef USEMMAP
cc_params[cc_par_cnt++] = "-lrt";
#endif
if (!getenv("AFL_DONT_OPTIMIZE")) {
#if defined(__FreeBSD__) && defined(__x86_64__)

View File

@ -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

View File

@ -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";