@@ -1300,21 +1300,6 @@ if test "$enable_fuzz" = "yes"; then
1300
1300
enable_fuzz_binary=yes
1301
1301
1302
1302
AX_CHECK_PREPROC_FLAG ( [ -DABORT_ON_FAILED_ASSUME] , [ DEBUG_CPPFLAGS="$DEBUG_CPPFLAGS -DABORT_ON_FAILED_ASSUME"] , [ ] , [ $CXXFLAG_WERROR] )
1303
-
1304
- AC_MSG_CHECKING ( [ whether main function is needed for fuzz binary] )
1305
- AX_CHECK_LINK_FLAG (
1306
- [ -fsanitize=$use_sanitizers] ,
1307
- [ AC_MSG_RESULT ( [ no] ) ] ,
1308
- [ AC_MSG_RESULT ( [ yes] ) ; CORE_CPPFLAGS="$CORE_CPPFLAGS -DPROVIDE_FUZZ_MAIN_FUNCTION"] ,
1309
- [ ] ,
1310
- [ AC_LANG_PROGRAM ( [ [
1311
- #include <cstdint>
1312
- #include <cstddef>
1313
- extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { return 0; }
1314
- /* comment to remove the main function ...
1315
- ] ] ,[ [
1316
- */ int not_main() {
1317
- ] ] ) ] )
1318
1303
else
1319
1304
BITCOIN_QT_INIT
1320
1305
@@ -1328,8 +1313,25 @@ else
1328
1313
QT_DBUS_INCLUDES=SUPPRESS_WARNINGS($QT_DBUS_INCLUDES)
1329
1314
QT_TEST_INCLUDES=SUPPRESS_WARNINGS($QT_TEST_INCLUDES)
1330
1315
fi
1316
+ fi
1317
+
1318
+ if test "$enable_fuzz_binary" = "yes"; then
1319
+ AC_MSG_CHECKING ( [ whether main function is needed for fuzz binary] )
1320
+ AX_CHECK_LINK_FLAG (
1321
+ [ ] ,
1322
+ [ AC_MSG_RESULT ( [ no] ) ] ,
1323
+ [ AC_MSG_RESULT ( [ yes] ) ; CORE_CPPFLAGS="$CORE_CPPFLAGS -DPROVIDE_FUZZ_MAIN_FUNCTION"] ,
1324
+ [ $SANITIZER_LDFLAGS] ,
1325
+ [ AC_LANG_PROGRAM ( [ [
1326
+ #include <cstdint>
1327
+ #include <cstddef>
1328
+ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { return 0; }
1329
+ /* comment to remove the main function ...
1330
+ ] ] ,[ [
1331
+ */ int not_main() {
1332
+ ] ] ) ] )
1331
1333
1332
- CORE_CPPFLAGS="$CORE_CPPFLAGS -DPROVIDE_FUZZ_MAIN_FUNCTION"
1334
+ CHECK_RUNTIME_LIB
1333
1335
fi
1334
1336
1335
1337
if test "$enable_wallet" != "no"; then
@@ -1818,10 +1820,6 @@ if test "$build_bitcoin_wallet$build_bitcoin_cli$build_bitcoin_tx$build_bitcoin_
1818
1820
AC_MSG_ERROR ( [ No targets! Please specify at least one of: --with-utils --with-libs --with-daemon --with-gui --enable-bench or --enable-tests] )
1819
1821
fi
1820
1822
1821
- if test "$enable_fuzz_binary" = "yes"; then
1822
- CHECK_RUNTIME_LIB
1823
- fi
1824
-
1825
1823
AM_CONDITIONAL([ TARGET_DARWIN] , [ test "$TARGET_OS" = "darwin"] )
1826
1824
AM_CONDITIONAL([ BUILD_DARWIN] , [ test "$BUILD_OS" = "darwin"] )
1827
1825
AM_CONDITIONAL([ TARGET_LINUX] , [ test "$TARGET_OS" = "linux"] )
0 commit comments