From 3671d7eb8a9dddc5be29ae5e3d4ba7669a898e53 Mon Sep 17 00:00:00 2001 From: hexcoder- Date: Fri, 17 Jan 2020 16:00:11 +0100 Subject: fixes for gcc 5.5 (does not understand -march=native) on NetBSD --- Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 56b77999..d208f509 100644 --- a/Makefile +++ b/Makefile @@ -44,11 +44,15 @@ else endif endif -CFLAGS ?= -O3 -funroll-loops -march=native +CFLAGS ?= -O3 -funroll-loops CFLAGS += -Wall -g -Wno-pointer-sign -I include/ \ -DAFL_PATH=\"$(HELPER_PATH)\" -DBIN_PATH=\"$(BIN_PATH)\" \ -DDOC_PATH=\"$(DOC_PATH)\" -Wno-unused-function +ifeq "$(shell echo 'int main() {return 0; }' | $(CC) -x c - -march=native -o .test 2>/dev/null && echo 1 || echo 0 ; rm -f .test )" "1" + CFLAGS += -march=native +endif + AFL_FUZZ_FILES = $(wildcard src/afl-fuzz*.c) ifneq "($filter %3.7m, $(shell python3.7m-config --includes 2>/dev/null)" "" @@ -253,7 +257,7 @@ 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/ + $(MAKE) -C src/third_party/libradamsa/ CFLAGS="$(CFLAGS)" afl-fuzz: include/afl-fuzz.h $(AFL_FUZZ_FILES) src/afl-common.o src/afl-sharedmem.o src/afl-forkserver.o $(COMM_HDR) | test_x86 $(CC) $(CFLAGS) $(CFLAGS_FLTO) $(AFL_FUZZ_FILES) src/afl-common.o src/afl-sharedmem.o src/afl-forkserver.o -o $@ $(PYFLAGS) $(LDFLAGS) -- cgit 1.4.1 From 7c0704b30c85b5fdaba582bfb4299623c255f498 Mon Sep 17 00:00:00 2001 From: hexcoder- Date: Fri, 17 Jan 2020 16:01:44 +0100 Subject: use default memory limit for afl-tmin (again) in test.sh, fix it in afl-tmin --- test/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test.sh b/test/test.sh index c763e91f..8f40773c 100755 --- a/test/test.sh +++ b/test/test.sh @@ -158,7 +158,7 @@ test "$SYS" = "i686" -o "$SYS" = "x86_64" -o "$SYS" = "amd64" && { CODE=1 ;; esac - ../afl-tmin -m200 -i in/in2 -o in2/in2 -- ./test-instr.plain > /dev/null 2>&1 + ../afl-tmin -i in/in2 -o in2/in2 -- ./test-instr.plain > /dev/null 2>&1 SIZE=`ls -l in2/in2 2> /dev/null | awk '{print$5}'` test "$SIZE" = 1 && $ECHO "$GREEN[+] afl-tmin correctly minimized the testcase" test "$SIZE" = 1 || { -- cgit 1.4.1 From cb23fe2aba8487464755abe2debfb78980cc5eba Mon Sep 17 00:00:00 2001 From: hexcoder- Date: Fri, 17 Jan 2020 16:06:43 +0100 Subject: increased default memory limit (200megs) on NetBSD (due to kernel bug), fixes the afl-tmin test --- include/config.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/include/config.h b/include/config.h index c5139dbd..69380282 100644 --- a/include/config.h +++ b/include/config.h @@ -61,12 +61,15 @@ /* Default memory limit for child process (MB): */ -#ifndef WORD_SIZE_64 -#define MEM_LIMIT 25 +#ifndef __NetBSD__ +# ifndef WORD_SIZE_64 +# define MEM_LIMIT 25 +# else +# define MEM_LIMIT 50 +# endif /* ^!WORD_SIZE_64 */ #else -#define MEM_LIMIT 50 -#endif /* ^!WORD_SIZE_64 */ - +# define MEM_LIMIT 200 +#endif /* Default memory limit when running in QEMU mode (MB): */ #define MEM_LIMIT_QEMU 200 -- cgit 1.4.1 From 800d43b84666461cb682be20fdc5df48c13c252b Mon Sep 17 00:00:00 2001 From: van Hauser Date: Fri, 17 Jan 2020 16:17:08 +0100 Subject: small change for march=native --- Makefile | 10 +++++----- docs/ChangeLog | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index d208f509..703ed673 100644 --- a/Makefile +++ b/Makefile @@ -44,15 +44,15 @@ else endif endif -CFLAGS ?= -O3 -funroll-loops +ifeq "$(shell echo 'int main() {return 0; }' | $(CC) -x c - -march=native -o .test 2>/dev/null && echo 1 || echo 0 ; rm -f .test )" "1" + CFLAGS_OPT = -march=native +endif + +CFLAGS ?= -O3 -funroll-loops $(CFLAGS_OPT) CFLAGS += -Wall -g -Wno-pointer-sign -I include/ \ -DAFL_PATH=\"$(HELPER_PATH)\" -DBIN_PATH=\"$(BIN_PATH)\" \ -DDOC_PATH=\"$(DOC_PATH)\" -Wno-unused-function -ifeq "$(shell echo 'int main() {return 0; }' | $(CC) -x c - -march=native -o .test 2>/dev/null && echo 1 || echo 0 ; rm -f .test )" "1" - CFLAGS += -march=native -endif - AFL_FUZZ_FILES = $(wildcard src/afl-fuzz*.c) ifneq "($filter %3.7m, $(shell python3.7m-config --includes 2>/dev/null)" "" diff --git a/docs/ChangeLog b/docs/ChangeLog index 594f75e9..5347d244 100644 --- a/docs/ChangeLog +++ b/docs/ChangeLog @@ -17,6 +17,7 @@ sending a mail to . Version ++2.60d (develop): -------------------------- + - use -march=native if available - afl-fuzz: - now prints the real python version support compiled in - set stronger performance compile options and little tweaks -- cgit 1.4.1