Add configure option to replace main with a stub for fuzzing
This commit is contained in:
parent
586f54fc39
commit
8a0fb36b21
11
configure.ac
11
configure.ac
|
@ -107,6 +107,12 @@ AC_ARG_ENABLE(tests,
|
||||||
[use_tests=$enableval],
|
[use_tests=$enableval],
|
||||||
[use_tests=yes])
|
[use_tests=yes])
|
||||||
|
|
||||||
|
AC_ARG_ENABLE([fuzz-main],
|
||||||
|
[AS_HELP_STRING([--enable-fuzz-main],
|
||||||
|
[Replace main() with a stub for fuzzing (default is no)])],
|
||||||
|
[use_fuzz_main=$enableval],
|
||||||
|
[use_fuzz_main=no])
|
||||||
|
|
||||||
AC_ARG_ENABLE([asan],
|
AC_ARG_ENABLE([asan],
|
||||||
[AS_HELP_STRING([--enable-asan],
|
[AS_HELP_STRING([--enable-asan],
|
||||||
[instrument the executables with asan (default is no)])],
|
[instrument the executables with asan (default is no)])],
|
||||||
|
@ -447,6 +453,11 @@ if test x$TARGET_OS != xwindows; then
|
||||||
AX_CHECK_COMPILE_FLAG([-fPIC],[PIC_FLAGS="-fPIC"])
|
AX_CHECK_COMPILE_FLAG([-fPIC],[PIC_FLAGS="-fPIC"])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if test x$use_fuzz_main == xyes; then
|
||||||
|
CFLAGS="$CFLAGS -DZCASH_FUZZ=1"
|
||||||
|
CXXFLAGS="$CXXFLAGS -DZCASH_FUZZ=1"
|
||||||
|
fi
|
||||||
|
|
||||||
#asan and tsan cannot be used together
|
#asan and tsan cannot be used together
|
||||||
if test x$use_asan$use_tsan == xyesyes; then
|
if test x$use_asan$use_tsan == xyesyes; then
|
||||||
AC_MSG_ERROR(asan and tsan cannot be simultaneously enabled)
|
AC_MSG_ERROR(asan and tsan cannot be simultaneously enabled)
|
||||||
|
|
|
@ -10,4 +10,4 @@ export AFL_LOG_DIR="$(pwd)"
|
||||||
export ZCUTIL=$(realpath "./zcutil")
|
export ZCUTIL=$(realpath "./zcutil")
|
||||||
shift 1
|
shift 1
|
||||||
|
|
||||||
CONFIGURE_FLAGS=--enable-tests=no "$ZCUTIL/build.sh" "CC=$ZCUTIL/afl/zcash-wrapper-gcc" "CXX=$ZCUTIL/afl/zcash-wrapper-g++" AFL_HARDEN=1 "$@"
|
CONFIGURE_FLAGS="--enable-tests=no --enable-fuzz-main" "$ZCUTIL/build.sh" "CC=$ZCUTIL/afl/zcash-wrapper-gcc" "CXX=$ZCUTIL/afl/zcash-wrapper-g++" AFL_HARDEN=1 "$@"
|
||||||
|
|
Loading…
Reference in New Issue