Skip to content

Commit 5859b7d

Browse files
committed
Merge #16338: test: Disable other targets when enable-fuzz is set
84edfc7 Update doc and CI config (qmma) 48bcb2a Disable other targets when enable-fuzz is set (qmma) Pull request description: This is to fix bitcoin/bitcoin#16094 When the `enable-fuzz` flag is set, disable all other binary targets. ACKs for top commit: MarcoFalke: ACK 84edfc7 (only checked that travis compiled this) Tree-SHA512: f4ac80526388a67709986b22de88b00bf93ab44ae31a20bd4d8923a4982ab97e015a9f13010081d6ecf6c23ae8afeac7ca9d849d198ce6ebe239aa3127151efc
2 parents 8d12860 + 84edfc7 commit 5859b7d

File tree

3 files changed

+28
-9
lines changed

3 files changed

+28
-9
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ jobs:
179179
RUN_FUNCTIONAL_TESTS=false
180180
RUN_FUZZ_TESTS=true
181181
GOAL="install"
182-
BITCOIN_CONFIG="--disable-wallet --disable-bench --with-utils=no --with-daemon=no --with-libs=no --with-gui=no --enable-fuzz --with-sanitizers=fuzzer,address CC=clang CXX=clang++"
182+
BITCOIN_CONFIG="--enable-fuzz --with-sanitizers=fuzzer,address CC=clang CXX=clang++"
183183
184184
- stage: test
185185
name: 'x86_64 Linux [GOAL: install] [bionic] [no wallet]'

configure.ac

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@ AC_ARG_ENABLE([extended-functional-tests],
148148
[use_extended_functional_tests=no])
149149

150150
AC_ARG_ENABLE([fuzz],
151-
AS_HELP_STRING([--enable-fuzz],[enable building of fuzz targets (default no)]),
151+
AS_HELP_STRING([--enable-fuzz],
152+
[enable building of fuzz targets (default no). enabling this will disable all other targets]),
152153
[enable_fuzz=$enableval],
153154
[enable_fuzz=no])
154155

@@ -956,6 +957,29 @@ AC_SUBST(LEVELDB_CPPFLAGS)
956957
AC_SUBST(LIBLEVELDB)
957958
AC_SUBST(LIBMEMENV)
958959

960+
dnl enable-fuzz should disable all other targets
961+
if test "x$enable_fuzz" = "xyes"; then
962+
AC_MSG_WARN(enable-fuzz will disable all other targets)
963+
build_bitcoin_utils=no
964+
build_bitcoin_cli=no
965+
build_bitcoin_tx=no
966+
build_bitcoin_wallet=no
967+
build_bitcoind=no
968+
build_bitcoin_libs=no
969+
bitcoin_enable_qt=no
970+
bitcoin_enable_qt_test=no
971+
bitcoin_enable_qt_dbus=no
972+
enable_wallet=no
973+
use_bench=no
974+
use_upnp=no
975+
use_zmq=no
976+
else
977+
BITCOIN_QT_INIT
978+
979+
dnl sets $bitcoin_enable_qt, $bitcoin_enable_qt_test, $bitcoin_enable_qt_dbus
980+
BITCOIN_QT_CONFIGURE([$use_pkgconfig])
981+
fi
982+
959983
if test x$enable_wallet != xno; then
960984
dnl Check for libdb_cxx only if wallet enabled
961985
BITCOIN_FIND_BDB48
@@ -970,11 +994,6 @@ if test x$use_upnp != xno; then
970994
)
971995
fi
972996

973-
BITCOIN_QT_INIT
974-
975-
dnl sets $bitcoin_enable_qt, $bitcoin_enable_qt_test, $bitcoin_enable_qt_dbus
976-
BITCOIN_QT_CONFIGURE([$use_pkgconfig])
977-
978997
if test x$build_bitcoin_wallet$build_bitcoin_cli$build_bitcoin_tx$build_bitcoind$bitcoin_enable_qt$use_tests$use_bench = xnonononononono; then
979998
use_boost=no
980999
else

doc/fuzzing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export AFLPATH=$PWD
4646
To build Bitcoin Core using AFL instrumentation (this assumes that the
4747
`AFLPATH` was set as above):
4848
```
49-
./configure --disable-ccache --disable-shared --enable-tests --enable-fuzz --disable-wallet --disable-bench --with-utils=no --with-daemon=no --with-libs=no --with-gui=no CC=${AFLPATH}/afl-gcc CXX=${AFLPATH}/afl-g++
49+
./configure --disable-ccache --disable-shared --enable-tests --enable-fuzz CC=${AFLPATH}/afl-gcc CXX=${AFLPATH}/afl-g++
5050
export AFL_HARDEN=1
5151
cd src/
5252
make
@@ -83,7 +83,7 @@ found in the `compiler-rt` runtime libraries package).
8383
To build all fuzz targets with libFuzzer, run
8484

8585
```
86-
./configure --disable-ccache --disable-wallet --disable-bench --with-utils=no --with-daemon=no --with-libs=no --with-gui=no --enable-fuzz --with-sanitizers=fuzzer,address CC=clang CXX=clang++
86+
./configure --disable-ccache --enable-fuzz --with-sanitizers=fuzzer,address CC=clang CXX=clang++
8787
make
8888
```
8989

0 commit comments

Comments
 (0)