[test suite] support afl-fuzz on Mac OS X which uses afl-clang

This commit is contained in:
Michael Rash
2015-06-25 22:01:20 -07:00
parent 2b5c38dc2b
commit 5ba88e7b83
4 changed files with 24 additions and 2 deletions
+1
View File
@@ -366,6 +366,7 @@ EXTRA_DIST = \
test/asan/Makefile \
test/afl/compile/afl-compile-code-coverage.sh \
test/afl/compile/afl-compile.sh \
test/afl/compile/fcns \
test/afl/doc/AFL_status_screen.png \
test/afl/README.md \
test/afl/fuzzing-wrappers/client-rc.sh \
+6 -1
View File
@@ -1,8 +1,13 @@
#!/bin/sh -x
. ./compile/fcns
### set either afl-gcc or afl-clang (defaults to afl-gcc)
set_afl_cc
cd ../../
AFL_USE_ASAN=1 CC=afl-gcc ./extras/apparmor/configure_args.sh --enable-afl-fuzzing --without-gpgme --enable-32bit-mode --enable-asan-support $@
AFL_USE_ASAN=1 CC=$AFL_CC ./extras/apparmor/configure_args.sh --enable-afl-fuzzing --without-gpgme --enable-32bit-mode --enable-asan-support $@
if [ $? -ne 0 ]
then
+6 -1
View File
@@ -1,8 +1,13 @@
#!/bin/sh -x
. ./compile/fcns
### set either afl-gcc or afl-clang (defaults to afl-gcc)
set_afl_cc
cd ../../
CC=afl-gcc ./extras/apparmor/configure_args.sh --enable-afl-fuzzing $@
CC=$AFL_CC ./extras/apparmor/configure_args.sh --enable-afl-fuzzing $@
if [ $? -ne 0 ]
then
+11
View File
@@ -0,0 +1,11 @@
AFL_CC=afl-gcc
set_afl_cc() {
$AFL_CC /dev/null 2>&1 | grep -q -i "On Apple systems.*wrapper for clang"
if [ $? -eq 0 ]
then
### Need to switch to afl-clang
AFL_CC=afl-clang
fi
}