Skip to content

Commit

Permalink
build: enable building fuzz tests by default
Browse files Browse the repository at this point in the history
fixes bitcoin#19388

Changes configure's '--enable-fuzz' flag to '--disable-fuzz'.
Enables building fuzz tests by default.
Enables -fsanitize=fuzzer by default.

Signed-off-by: willcl-ark <will8clark@gmail.com>
  • Loading branch information
willcl-ark committed Jul 8, 2020
1 parent e645d06 commit e323b27
Showing 1 changed file with 15 additions and 28 deletions.
43 changes: 15 additions & 28 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,10 @@ AC_ARG_ENABLE([extended-functional-tests],
[use_extended_functional_tests=no])

AC_ARG_ENABLE([fuzz],
AS_HELP_STRING([--enable-fuzz],
[enable building of fuzz targets (default no). enabling this will disable all other targets]),
AS_HELP_STRING([--disable-fuzz],
[disable building of fuzz targets (default is to compile)]),
[enable_fuzz=$enableval],
[enable_fuzz=no])
[enable_fuzz=yes])

AC_ARG_WITH([qrencode],
[AS_HELP_STRING([--with-qrencode],
Expand Down Expand Up @@ -269,9 +269,16 @@ AC_ARG_ENABLE([debug],
dnl Enable different -fsanitize options
AC_ARG_WITH([sanitizers],
[AS_HELP_STRING([--with-sanitizers],
[comma separated list of extra sanitizers to build with (default is none enabled)])],
[comma separated list of extra sanitizers to build with (default is 'fuzzer' unless --disable-fuzzer is set)])],
[use_sanitizers=$withval])

dnl if fuzz testing is enabled and user didn't set -fsanitize, set it to "fuzzer"
if test "x$enable_fuzz" = xyes; then
if test "x$use_sanitizers" = x; then
use_sanitizers=fuzzer
fi
fi

dnl Enable gprof profiling
AC_ARG_ENABLE([gprof],
[AS_HELP_STRING([--enable-gprof],
Expand Down Expand Up @@ -1112,28 +1119,10 @@ AC_SUBST(LEVELDB_CPPFLAGS)
AC_SUBST(LIBLEVELDB)
AC_SUBST(LIBMEMENV)

dnl enable-fuzz should disable all other targets
if test "x$enable_fuzz" = "xyes"; then
AC_MSG_WARN(enable-fuzz will disable all other targets)
build_bitcoin_utils=no
build_bitcoin_cli=no
build_bitcoin_tx=no
build_bitcoin_wallet=no
build_bitcoind=no
build_bitcoin_libs=no
bitcoin_enable_qt=no
bitcoin_enable_qt_test=no
bitcoin_enable_qt_dbus=no
enable_wallet=no
use_bench=no
use_upnp=no
use_zmq=no
else
BITCOIN_QT_INIT
BITCOIN_QT_INIT

dnl sets $bitcoin_enable_qt, $bitcoin_enable_qt_test, $bitcoin_enable_qt_dbus
BITCOIN_QT_CONFIGURE
fi
dnl sets $bitcoin_enable_qt, $bitcoin_enable_qt_test, $bitcoin_enable_qt_dbus
BITCOIN_QT_CONFIGURE

if test x$enable_wallet != xno; then
dnl Check for libdb_cxx only if wallet enabled
Expand Down Expand Up @@ -1689,9 +1678,7 @@ if test x$bitcoin_enable_qt != xno; then
fi
echo " with zmq = $use_zmq"
echo " with test = $use_tests"
if test x$use_tests != xno; then
echo " with fuzz = $enable_fuzz"
fi
echo " with fuzz = $enable_fuzz"
echo " with bench = $use_bench"
echo " with upnp = $use_upnp"
echo " use asm = $use_asm"
Expand Down

0 comments on commit e323b27

Please sign in to comment.