From b3feda052d36aacd657b394169b90f05afdbbbde Mon Sep 17 00:00:00 2001 From: David Carlier Date: Wed, 10 Jun 2020 16:16:47 +0100 Subject: start of illumos cpu binding implementation. The current user needs the proc_owner permission, not something doable via the settings script. --- GNUmakefile | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'GNUmakefile') diff --git a/GNUmakefile b/GNUmakefile index 7556b617..0714a9d2 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -58,6 +58,11 @@ ifneq "$(shell uname)" "Darwin" CFLAGS_OPT += -D_FORTIFY_SOURCE=2 endif +ifeq "$(shell uname)" "SunOS" + CFLAGS_OPT += -Wno-format-truncation + LDFLAGS=-lkstat +endif + ifdef STATIC $(info Compiling static version of binaries) # Disable python for static compilation to simplify things -- cgit v1.2.3 From a632c00b0d023b8a40d09839fbb2662da1cb5d37 Mon Sep 17 00:00:00 2001 From: van Hauser Date: Fri, 12 Jun 2020 16:08:49 +0200 Subject: switch to faster and better hash + random --- GNUmakefile | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) (limited to 'GNUmakefile') diff --git a/GNUmakefile b/GNUmakefile index 0714a9d2..7818a362 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -50,10 +50,15 @@ else endif endif +ifeq "$(shell echo 'int main() {return 0; }' | $(CC) -fno-move-loop-invariants -fdisable-tree-cunrolli -x c - -o .test 2>/dev/null && echo 1 || echo 0 ; rm -f .test )" "1" + SPECIAL_PERFORMANCE += -fno-move-loop-invariants -fdisable-tree-cunrolli +endif + ifneq "$(shell uname)" "Darwin" - #ifeq "$(shell echo 'int main() {return 0; }' | $(CC) $(CFLAGS) -Werror -x c - -march=native -o .test 2>/dev/null && echo 1 || echo 0 ; rm -f .test )" "1" - # CFLAGS_OPT += -march=native - #endif + ifeq "$(shell echo 'int main() {return 0; }' | $(CC) $(CFLAGS) -Werror -x c - -march=native -o .test 2>/dev/null && echo 1 || echo 0 ; rm -f .test )" "1" + #CFLAGS_OPT += -march=native + SPECIAL_PERFORMANCE += -march=native + endif # OS X does not like _FORTIFY_SOURCE=2 CFLAGS_OPT += -D_FORTIFY_SOURCE=2 endif @@ -350,6 +355,9 @@ afl-as: src/afl-as.c include/afl-as.h $(COMM_HDR) | test_x86 $(CC) $(CFLAGS) src/$@.c -o $@ $(LDFLAGS) ln -sf afl-as as +src/afl-performance.o : $(COMM_HDR) src/afl-performance.c include/hash.h + $(CC) -Iinclude $(SPECIAL_PERFORMANCE) -O3 -fno-unroll-loops -c src/afl-performance.c -o src/afl-performance.o + src/afl-common.o : $(COMM_HDR) src/afl-common.c include/common.h $(CC) $(CFLAGS) $(CFLAGS_FLTO) -c src/afl-common.c -o src/afl-common.o @@ -365,25 +373,25 @@ radamsa: src/third_party/libradamsa/libradamsa.so src/third_party/libradamsa/libradamsa.so: src/third_party/libradamsa/libradamsa.c src/third_party/libradamsa/radamsa.h $(MAKE) -C src/third_party/libradamsa/ CFLAGS="$(CFLAGS)" -afl-fuzz: $(COMM_HDR) include/afl-fuzz.h $(AFL_FUZZ_FILES) src/afl-common.o src/afl-sharedmem.o src/afl-forkserver.o | test_x86 - $(CC) $(CFLAGS) $(COMPILE_STATIC) $(CFLAGS_FLTO) $(AFL_FUZZ_FILES) src/afl-common.o src/afl-sharedmem.o src/afl-forkserver.o -o $@ $(PYFLAGS) $(LDFLAGS) +afl-fuzz: $(COMM_HDR) include/afl-fuzz.h $(AFL_FUZZ_FILES) src/afl-common.o src/afl-sharedmem.o src/afl-forkserver.o src/afl-performance.o | test_x86 + $(CC) $(CFLAGS) $(COMPILE_STATIC) $(CFLAGS_FLTO) $(AFL_FUZZ_FILES) src/afl-common.o src/afl-sharedmem.o src/afl-forkserver.o src/afl-performance.o -o $@ $(PYFLAGS) $(LDFLAGS) afl-showmap: src/afl-showmap.c src/afl-common.o src/afl-sharedmem.o src/afl-forkserver.o $(COMM_HDR) | test_x86 $(CC) $(CFLAGS) $(COMPILE_STATIC) $(CFLAGS_FLTO) src/$@.c src/afl-common.o src/afl-sharedmem.o src/afl-forkserver.o -o $@ $(LDFLAGS) -afl-tmin: src/afl-tmin.c src/afl-common.o src/afl-sharedmem.o src/afl-forkserver.o $(COMM_HDR) | test_x86 - $(CC) $(CFLAGS) $(COMPILE_STATIC) $(CFLAGS_FLTO) src/$@.c src/afl-common.o src/afl-sharedmem.o src/afl-forkserver.o -o $@ $(LDFLAGS) +afl-tmin: src/afl-tmin.c src/afl-common.o src/afl-sharedmem.o src/afl-forkserver.o src/afl-performance.o $(COMM_HDR) | test_x86 + $(CC) $(CFLAGS) $(COMPILE_STATIC) $(CFLAGS_FLTO) src/$@.c src/afl-common.o src/afl-sharedmem.o src/afl-forkserver.o src/afl-performance.o -o $@ $(LDFLAGS) -afl-analyze: src/afl-analyze.c src/afl-common.o src/afl-sharedmem.o $(COMM_HDR) | test_x86 - $(CC) $(CFLAGS) $(COMPILE_STATIC) $(CFLAGS_FLTO) src/$@.c src/afl-common.o src/afl-sharedmem.o -o $@ $(LDFLAGS) +afl-analyze: src/afl-analyze.c src/afl-common.o src/afl-sharedmem.o src/afl-performance.o $(COMM_HDR) | test_x86 + $(CC) $(CFLAGS) $(COMPILE_STATIC) $(CFLAGS_FLTO) src/$@.c src/afl-common.o src/afl-sharedmem.o src/afl-performance.o -o $@ $(LDFLAGS) afl-gotcpu: src/afl-gotcpu.c src/afl-common.o $(COMM_HDR) | test_x86 $(CC) $(CFLAGS) $(COMPILE_STATIC) $(CFLAGS_FLTO) src/$@.c src/afl-common.o -o $@ $(LDFLAGS) # document all mutations and only do one run (use with only one input file!) -document: $(COMM_HDR) include/afl-fuzz.h $(AFL_FUZZ_FILES) src/afl-common.o src/afl-sharedmem.o src/afl-forkserver.o | test_x86 - $(CC) -D_AFL_DOCUMENT_MUTATIONS $(CFLAGS) $(CFLAGS_FLTO) $(AFL_FUZZ_FILES) src/afl-common.o src/afl-sharedmem.o src/afl-forkserver.o -o afl-fuzz-document $(PYFLAGS) $(LDFLAGS) +document: $(COMM_HDR) include/afl-fuzz.h $(AFL_FUZZ_FILES) src/afl-common.o src/afl-sharedmem.o src/afl-forkserver.o src/afl-performance.o | test_x86 + $(CC) -D_AFL_DOCUMENT_MUTATIONS $(CFLAGS) $(CFLAGS_FLTO) $(AFL_FUZZ_FILES) src/afl-common.o src/afl-sharedmem.o src/afl-forkserver.o src/afl-performance.o -o afl-fuzz-document $(PYFLAGS) $(LDFLAGS) test/unittests/unit_maybe_alloc.o : $(COMM_HDR) include/alloc-inl.h test/unittests/unit_maybe_alloc.c $(AFL_FUZZ_FILES) @$(CC) $(CFLAGS) $(ASAN_CFLAGS) -c test/unittests/unit_maybe_alloc.c -o test/unittests/unit_maybe_alloc.o -- cgit v1.2.3 From 67d87dd2a9dbc393b56162e77ff3178f4e3f59fa Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sun, 14 Jun 2020 15:26:43 +0000 Subject: Porting to Haiku. getrusage does not implement resident memory gathering, no shm api neither. --- GNUmakefile | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'GNUmakefile') diff --git a/GNUmakefile b/GNUmakefile index 7818a362..f1c5f99b 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -119,6 +119,13 @@ ifeq "$(shell uname -s)" "NetBSD" LDFLAGS += -L /usr/pkg/lib/ endif +ifeq "$(shell uname -s)" "Haiku" + SHMAT_OK=0 + override CFLAGS += -DUSEMMAP=1 -Wno-error=format -fpic + LDFLAGS+=-Wno-deprecated-declarations -lgnu + SPECIAL_PERFORMANCE += -DUSEMMAP=1 +endif + AFL_FUZZ_FILES = $(wildcard src/afl-fuzz*.c) ifneq "$(shell command -v python3m 2>/dev/null)" "" -- cgit v1.2.3 From 048e429356fb5a8592c3f6607fd4e91c7a7a2cd3 Mon Sep 17 00:00:00 2001 From: van Hauser Date: Sun, 21 Jun 2020 16:33:55 +0200 Subject: remove -Werror and add include for libdislocator --- GNUmakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'GNUmakefile') diff --git a/GNUmakefile b/GNUmakefile index f1c5f99b..555fa9cf 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -96,7 +96,7 @@ endif CFLAGS ?= -O3 -funroll-loops $(CFLAGS_OPT) override CFLAGS += -Wall -g -Wno-pointer-sign -Wmissing-declarations\ - -I include/ -Werror -DAFL_PATH=\"$(HELPER_PATH)\" \ + -I include/ -DAFL_PATH=\"$(HELPER_PATH)\" \ -DBIN_PATH=\"$(BIN_PATH)\" -DDOC_PATH=\"$(DOC_PATH)\" ifeq "$(shell uname -s)" "FreeBSD" -- cgit v1.2.3 From 5cad92e57ecda270753cf70311a7ac1ff6fdcc9e Mon Sep 17 00:00:00 2001 From: van Hauser Date: Sun, 21 Jun 2020 18:07:30 +0200 Subject: fix unicorn mode for CFLAGS --- GNUmakefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'GNUmakefile') diff --git a/GNUmakefile b/GNUmakefile index 555fa9cf..a171e916 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -524,7 +524,7 @@ distrib: all radamsa $(MAKE) -C examples/socket_fuzzing $(MAKE) -C examples/argv_fuzzing -cd qemu_mode && sh ./build_qemu_support.sh - cd unicorn_mode && sh ./build_unicorn_support.sh + cd unicorn_mode && unset CFLAGS && sh ./build_unicorn_support.sh binary-only: all radamsa $(MAKE) -C libdislocator @@ -533,7 +533,7 @@ binary-only: all radamsa $(MAKE) -C examples/socket_fuzzing $(MAKE) -C examples/argv_fuzzing -cd qemu_mode && sh ./build_qemu_support.sh - cd unicorn_mode && sh ./build_unicorn_support.sh + cd unicorn_mode && unset CFLAGS && sh ./build_unicorn_support.sh source-only: all radamsa -$(MAKE) -C llvm_mode -- cgit v1.2.3 From 7119bf5d860657dab7afb60fab8b7ad5dc0ef222 Mon Sep 17 00:00:00 2001 From: Dominik Maier Date: Mon, 22 Jun 2020 21:58:16 +0200 Subject: Added rand, hash unittests --- GNUmakefile | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'GNUmakefile') diff --git a/GNUmakefile b/GNUmakefile index a171e916..5a739ad8 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -403,13 +403,24 @@ document: $(COMM_HDR) include/afl-fuzz.h $(AFL_FUZZ_FILES) src/afl-common.o src/ test/unittests/unit_maybe_alloc.o : $(COMM_HDR) include/alloc-inl.h test/unittests/unit_maybe_alloc.c $(AFL_FUZZ_FILES) @$(CC) $(CFLAGS) $(ASAN_CFLAGS) -c test/unittests/unit_maybe_alloc.c -o test/unittests/unit_maybe_alloc.o -test/unittests/unit_preallocable.o : $(COMM_HDR) include/alloc-inl.h test/unittests/unit_preallocable.c $(AFL_FUZZ_FILES) - @$(CC) $(CFLAGS) $(ASAN_CFLAGS) -c test/unittests/unit_preallocable.c -o test/unittests/unit_preallocable.o - unit_maybe_alloc: test/unittests/unit_maybe_alloc.o @$(CC) $(CFLAGS) -Wl,--wrap=exit -Wl,--wrap=printf test/unittests/unit_maybe_alloc.o -o test/unittests/unit_maybe_alloc $(LDFLAGS) $(ASAN_LDFLAGS) -lcmocka ./test/unittests/unit_maybe_alloc +test/unittests/unit_hash.o : $(COMM_HDR) include/alloc-inl.h test/unittests/unit_hash.c $(AFL_FUZZ_FILES) src/afl-performance.o + @$(CC) $(CFLAGS) $(ASAN_CFLAGS) -c test/unittests/unit_hash.c -o test/unittests/unit_hash.o + +unit_hash: test/unittests/unit_hash.o src/afl-performance.o + @$(CC) $(CFLAGS) -Wl,--wrap=exit -Wl,--wrap=printf $^ -o test/unittests/unit_hash $(LDFLAGS) $(ASAN_LDFLAGS) -lcmocka + ./test/unittests/unit_hash + +test/unittests/unit_rand.o : $(COMM_HDR) include/alloc-inl.h test/unittests/unit_rand.c $(AFL_FUZZ_FILES) src/afl-performance.o + @$(CC) $(CFLAGS) $(ASAN_CFLAGS) -c test/unittests/unit_rand.c -o test/unittests/unit_rand.o + +unit_rand: test/unittests/unit_rand.o src/afl-common.o src/afl-performance.o + @$(CC) $(CFLAGS) $(ASAN_CFLAGS) -Wl,--wrap=exit -Wl,--wrap=printf $^ -o test/unittests/unit_rand $(LDFLAGS) $(ASAN_LDFLAGS) -lcmocka + ./test/unittests/unit_rand + test/unittests/unit_list.o : $(COMM_HDR) include/list.h test/unittests/unit_list.c $(AFL_FUZZ_FILES) @$(CC) $(CFLAGS) $(ASAN_CFLAGS) -c test/unittests/unit_list.c -o test/unittests/unit_list.o @@ -417,8 +428,8 @@ unit_list: test/unittests/unit_list.o @$(CC) $(CFLAGS) $(ASAN_CFLAGS) -Wl,--wrap=exit -Wl,--wrap=printf test/unittests/unit_list.o -o test/unittests/unit_list $(LDFLAGS) $(ASAN_LDFLAGS) -lcmocka ./test/unittests/unit_list -test/unittests/preallocable.o : $(COMM_HDR) include/afl-prealloc.h test/unittests/preallocable.c $(AFL_FUZZ_FILES) - @$(CC) $(CFLAGS) $(ASAN_CFLAGS) $(CFLAGS_FLTO) -c test/unittests/preallocable.c -o test/unittests/preallocable.o +test/unittests/unit_preallocable.o : $(COMM_HDR) include/alloc-inl.h test/unittests/unit_preallocable.c $(AFL_FUZZ_FILES) + @$(CC) $(CFLAGS) $(ASAN_CFLAGS) -c test/unittests/unit_preallocable.c -o test/unittests/unit_preallocable.o unit_preallocable: test/unittests/unit_preallocable.o @$(CC) $(CFLAGS) $(ASAN_CFLAGS) -Wl,--wrap=exit -Wl,--wrap=printf test/unittests/unit_preallocable.o -o test/unittests/unit_preallocable $(LDFLAGS) $(ASAN_LDFLAGS) -lcmocka @@ -429,7 +440,7 @@ unit_clean: ifneq "$(shell uname)" "Darwin" -unit: unit_maybe_alloc unit_preallocable unit_list unit_clean +unit: unit_maybe_alloc unit_preallocable unit_list unit_clean unit_rand unit_hash else -- cgit v1.2.3 From 5f1c0111a6b25e08393bd91bca5cece87beed448 Mon Sep 17 00:00:00 2001 From: van Hauser Date: Tue, 23 Jun 2020 18:06:08 +0200 Subject: fix make files --- GNUmakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'GNUmakefile') diff --git a/GNUmakefile b/GNUmakefile index 5a739ad8..53bbb34d 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -121,7 +121,7 @@ endif ifeq "$(shell uname -s)" "Haiku" SHMAT_OK=0 - override CFLAGS += -DUSEMMAP=1 -Wno-error=format -fpic + override CFLAGS += -DUSEMMAP=1 -Wno-error=format -fPIC LDFLAGS+=-Wno-deprecated-declarations -lgnu SPECIAL_PERFORMANCE += -DUSEMMAP=1 endif -- cgit v1.2.3 From 9858bc81a3fc1cccb2c3c73d824be2e1a4a18027 Mon Sep 17 00:00:00 2001 From: hexcoder- Date: Thu, 25 Jun 2020 13:28:34 +0200 Subject: GNUmakefile: warn about '.' being first path in PATH environment variable. This causes recursion in 'as'. (seen in Haiku) --- GNUmakefile | 2 ++ 1 file changed, 2 insertions(+) (limited to 'GNUmakefile') diff --git a/GNUmakefile b/GNUmakefile index 53bbb34d..06da959c 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -311,6 +311,8 @@ ifndef AFL_NO_X86 test_x86: @echo "[*] Checking for the default compiler cc..." @type $(CC) >/dev/null || ( echo; echo "Oops, looks like there is no compiler '"$(CC)"' in your path."; echo; echo "Don't panic! You can restart with '"$(_)" CC='."; echo; exit 1 ) + @echo "[*] Testing the PATH environment variable..." + @test "$${PATH}" != "$${PATH#.:}" && { echo "Please remove current directory '.' from PATH to avoid recursion of 'as', thanks!"; echo; exit 1; } || : @echo "[*] Checking for the ability to compile x86 code..." @echo 'main() { __asm__("xorb %al, %al"); }' | $(CC) $(CFLAGS) -w -x c - -o .test1 || ( echo; echo "Oops, looks like your compiler can't generate x86 code."; echo; echo "Don't panic! You can use the LLVM or QEMU mode, but see docs/INSTALL first."; echo "(To ignore this error, set AFL_NO_X86=1 and try again.)"; echo; exit 1 ) @rm -f .test1 -- cgit v1.2.3 From 8178f4dfddfb51f7a3e2f94e67bb9cf7332c7ef1 Mon Sep 17 00:00:00 2001 From: van Hauser Date: Thu, 25 Jun 2020 16:51:29 +0200 Subject: remove radamsa, add radamsa custom mutator --- GNUmakefile | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'GNUmakefile') diff --git a/GNUmakefile b/GNUmakefile index 06da959c..b154bbda 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -282,8 +282,8 @@ help: @echo "HELP --- the following make targets exist:" @echo "==========================================" @echo "all: just the main afl++ binaries" - @echo "binary-only: everything for binary-only fuzzing: qemu_mode, unicorn_mode, libdislocator, libtokencap, radamsa" - @echo "source-only: everything for source code fuzzing: llvm_mode, gcc_plugin, libdislocator, libtokencap, radamsa" + @echo "binary-only: everything for binary-only fuzzing: qemu_mode, unicorn_mode, libdislocator, libtokencap" + @echo "source-only: everything for source code fuzzing: llvm_mode, gcc_plugin, libdislocator, libtokencap" @echo "distrib: everything (for both binary-only and source code fuzzing)" @echo "man: creates simple man pages from the help option of the programs" @echo "install: installs everything you have compiled with the build option above" @@ -376,12 +376,6 @@ src/afl-forkserver.o : $(COMM_HDR) src/afl-forkserver.c include/forkserver.h src/afl-sharedmem.o : $(COMM_HDR) src/afl-sharedmem.c include/sharedmem.h $(CC) $(CFLAGS) $(CFLAGS_FLTO) -c src/afl-sharedmem.c -o src/afl-sharedmem.o -radamsa: src/third_party/libradamsa/libradamsa.so - cp src/third_party/libradamsa/libradamsa.so . - -src/third_party/libradamsa/libradamsa.so: src/third_party/libradamsa/libradamsa.c src/third_party/libradamsa/radamsa.h - $(MAKE) -C src/third_party/libradamsa/ CFLAGS="$(CFLAGS)" - afl-fuzz: $(COMM_HDR) include/afl-fuzz.h $(AFL_FUZZ_FILES) src/afl-common.o src/afl-sharedmem.o src/afl-forkserver.o src/afl-performance.o | test_x86 $(CC) $(CFLAGS) $(COMPILE_STATIC) $(CFLAGS_FLTO) $(AFL_FUZZ_FILES) src/afl-common.o src/afl-sharedmem.o src/afl-forkserver.o src/afl-performance.o -o $@ $(PYFLAGS) $(LDFLAGS) @@ -462,6 +456,8 @@ code-format: ./.custom-format.py -i gcc_plugin/*.c #./.custom-format.py -i gcc_plugin/*.h ./.custom-format.py -i gcc_plugin/*.cc + ./.custom-format.py -i custom_mutators/*/*.c + ./.custom-format.py -i custom_mutators/*/*.h ./.custom-format.py -i examples/*/*.c ./.custom-format.py -i examples/*/*.h ./.custom-format.py -i test/*.c @@ -514,7 +510,6 @@ clean: $(MAKE) -C examples/argv_fuzzing clean $(MAKE) -C qemu_mode/unsigaction clean $(MAKE) -C qemu_mode/libcompcov clean - $(MAKE) -C src/third_party/libradamsa/ clean rm -rf qemu_mode/qemu-3.1.1 ifeq "$(IN_REPO)" "1" test -d unicorn_mode/unicornafl && $(MAKE) -C unicorn_mode/unicornafl clean || true @@ -528,7 +523,7 @@ deepclean: clean rm -rf unicorn_mode/unicornafl git reset --hard >/dev/null 2>&1 || true -distrib: all radamsa +distrib: all -$(MAKE) -C llvm_mode -$(MAKE) -C gcc_plugin $(MAKE) -C libdislocator @@ -539,7 +534,7 @@ distrib: all radamsa -cd qemu_mode && sh ./build_qemu_support.sh cd unicorn_mode && unset CFLAGS && sh ./build_unicorn_support.sh -binary-only: all radamsa +binary-only: all $(MAKE) -C libdislocator $(MAKE) -C libtokencap $(MAKE) -C examples/afl_network_proxy @@ -548,7 +543,7 @@ binary-only: all radamsa -cd qemu_mode && sh ./build_qemu_support.sh cd unicorn_mode && unset CFLAGS && sh ./build_unicorn_support.sh -source-only: all radamsa +source-only: all -$(MAKE) -C llvm_mode -$(MAKE) -C gcc_plugin $(MAKE) -C libdislocator @@ -587,7 +582,6 @@ install: all $(MANPAGES) if [ -f libdislocator.so ]; then set -e; install -m 755 libdislocator.so $${DESTDIR}$(HELPER_PATH); fi if [ -f libtokencap.so ]; then set -e; install -m 755 libtokencap.so $${DESTDIR}$(HELPER_PATH); fi if [ -f libcompcov.so ]; then set -e; install -m 755 libcompcov.so $${DESTDIR}$(HELPER_PATH); fi - if [ -f libradamsa.so ]; then set -e; install -m 755 libradamsa.so $${DESTDIR}$(HELPER_PATH); fi if [ -f afl-fuzz-document ]; then set -e; install -m 755 afl-fuzz-document $${DESTDIR}$(BIN_PATH); fi if [ -f socketfuzz32.so -o -f socketfuzz64.so ]; then $(MAKE) -C examples/socket_fuzzing install; fi if [ -f argvfuzz32.so -o -f argvfuzz64.so ]; then $(MAKE) -C examples/argv_fuzzing install; fi -- cgit v1.2.3 From 633a3feab9f7cf98794eebad81cec730042d7e9b Mon Sep 17 00:00:00 2001 From: van Hauser Date: Thu, 25 Jun 2020 17:51:48 +0200 Subject: fix makefile --- GNUmakefile | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'GNUmakefile') diff --git a/GNUmakefile b/GNUmakefile index b154bbda..ad7169cd 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -199,12 +199,12 @@ ifneq "$(filter Linux GNU%,$(shell uname))" "" endif ifneq "$(findstring FreeBSD, $(shell uname))" "" - CFLAGS += -pthread + override CFLAGS += -pthread LDFLAGS += -lpthread endif ifneq "$(findstring NetBSD, $(shell uname))" "" - CFLAGS += -pthread + override CFLAGS += -pthread LDFLAGS += -lpthread endif @@ -244,7 +244,7 @@ endif ifdef ASAN_BUILD $(info Compiling ASAN version of binaries) - CFLAGS+=$(ASAN_CFLAGS) + override CFLAGS+=$(ASAN_CFLAGS) LDFLAGS+=$(ASAN_LDFLAGS) endif @@ -252,14 +252,15 @@ ifeq "$(shell echo '$(HASH)include @$(HASH)include @int ma SHMAT_OK=1 else SHMAT_OK=0 - CFLAGS+=-DUSEMMAP=1 + override CFLAGS+=-DUSEMMAP=1 LDFLAGS+=-Wno-deprecated-declarations endif -ifeq "$(TEST_MMAP)" "1" +ifdef TEST_MMAP SHMAT_OK=0 - CFLAGS+=-DUSEMMAP=1 - LDFLAGS+=-Wno-deprecated-declarations + override CFLAGS += -DUSEMMAP=1 + LDFLAGS += -Wno-deprecated-declarations +else endif all: test_x86 test_shm test_python ready $(PROGS) afl-as test_build all_done -- cgit v1.2.3 From 171b1923e94b7157d9c0574fae890d31fd880e4c Mon Sep 17 00:00:00 2001 From: van Hauser Date: Thu, 25 Jun 2020 22:02:02 +0200 Subject: shmem release fix --- GNUmakefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'GNUmakefile') diff --git a/GNUmakefile b/GNUmakefile index ad7169cd..616d4f70 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -122,7 +122,7 @@ endif ifeq "$(shell uname -s)" "Haiku" SHMAT_OK=0 override CFLAGS += -DUSEMMAP=1 -Wno-error=format -fPIC - LDFLAGS+=-Wno-deprecated-declarations -lgnu + LDFLAGS += -Wno-deprecated-declarations -lgnu SPECIAL_PERFORMANCE += -DUSEMMAP=1 endif @@ -253,14 +253,14 @@ ifeq "$(shell echo '$(HASH)include @$(HASH)include @int ma else SHMAT_OK=0 override CFLAGS+=-DUSEMMAP=1 - LDFLAGS+=-Wno-deprecated-declarations + LDFLAGS += -Wno-deprecated-declarations -lrt endif ifdef TEST_MMAP SHMAT_OK=0 override CFLAGS += -DUSEMMAP=1 - LDFLAGS += -Wno-deprecated-declarations -else + LDFLAGS += -Wno-deprecated-declarations -lrt +$(info LDFLAGS=$(LDFLAGS)) endif all: test_x86 test_shm test_python ready $(PROGS) afl-as test_build all_done -- cgit v1.2.3 From 590408323137b97807370929e56fba9790c2c51c Mon Sep 17 00:00:00 2001 From: van Hauser Date: Thu, 25 Jun 2020 22:28:56 +0200 Subject: remove debug --- GNUmakefile | 1 - 1 file changed, 1 deletion(-) (limited to 'GNUmakefile') diff --git a/GNUmakefile b/GNUmakefile index 616d4f70..41ac74e6 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -260,7 +260,6 @@ ifdef TEST_MMAP SHMAT_OK=0 override CFLAGS += -DUSEMMAP=1 LDFLAGS += -Wno-deprecated-declarations -lrt -$(info LDFLAGS=$(LDFLAGS)) endif all: test_x86 test_shm test_python ready $(PROGS) afl-as test_build all_done -- cgit v1.2.3 From cd6954e3c16282a6fe2a8f37879a06605990cb58 Mon Sep 17 00:00:00 2001 From: van Hauser Date: Sat, 27 Jun 2020 23:11:10 +0200 Subject: fix make static --- GNUmakefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'GNUmakefile') diff --git a/GNUmakefile b/GNUmakefile index 41ac74e6..d95eaab1 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -69,10 +69,11 @@ ifeq "$(shell uname)" "SunOS" endif ifdef STATIC - $(info Compiling static version of binaries) + $(info Compiling static version of binaries, disabling python though) # Disable python for static compilation to simplify things PYTHON_OK=0 PYFLAGS= + PYTHON_INCLUDE=/ CFLAGS_OPT += -static LDFLAGS += -lm -lpthread -lz -lutil -- cgit v1.2.3 From e5e485fcdb039fc77842b0753a4adf42d6063388 Mon Sep 17 00:00:00 2001 From: van Hauser Date: Mon, 29 Jun 2020 00:58:05 +0200 Subject: fix autodict --- GNUmakefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'GNUmakefile') diff --git a/GNUmakefile b/GNUmakefile index d95eaab1..748cd73c 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -394,8 +394,8 @@ afl-gotcpu: src/afl-gotcpu.c src/afl-common.o $(COMM_HDR) | test_x86 # document all mutations and only do one run (use with only one input file!) -document: $(COMM_HDR) include/afl-fuzz.h $(AFL_FUZZ_FILES) src/afl-common.o src/afl-sharedmem.o src/afl-forkserver.o src/afl-performance.o | test_x86 - $(CC) -D_AFL_DOCUMENT_MUTATIONS $(CFLAGS) $(CFLAGS_FLTO) $(AFL_FUZZ_FILES) src/afl-common.o src/afl-sharedmem.o src/afl-forkserver.o src/afl-performance.o -o afl-fuzz-document $(PYFLAGS) $(LDFLAGS) +document: $(COMM_HDR) include/afl-fuzz.h $(AFL_FUZZ_FILES) src/afl-common.o src/afl-sharedmem.o src/afl-performance.o | test_x86 + $(CC) -D_DEBUG=\"1\" -D_AFL_DOCUMENT_MUTATIONS $(CFLAGS) $(CFLAGS_FLTO) $(AFL_FUZZ_FILES) src/afl-common.o src/afl-sharedmem.o src/afl-forkserver.c src/afl-performance.o -o afl-fuzz-document $(PYFLAGS) $(LDFLAGS) test/unittests/unit_maybe_alloc.o : $(COMM_HDR) include/alloc-inl.h test/unittests/unit_maybe_alloc.c $(AFL_FUZZ_FILES) @$(CC) $(CFLAGS) $(ASAN_CFLAGS) -c test/unittests/unit_maybe_alloc.c -o test/unittests/unit_maybe_alloc.o -- cgit v1.2.3