aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac14
1 files changed, 14 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index fbf56443f1..674ed1ee73 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1165,6 +1165,20 @@ if test "x$enable_fuzz" = "xyes"; then
use_bench=no
use_upnp=no
use_zmq=no
+
+ AC_MSG_CHECKING([whether main function is needed])
+ AX_CHECK_LINK_FLAG(
+ [[-fsanitize=$use_sanitizers]],
+ [AC_MSG_RESULT([no])],
+ [AC_MSG_RESULT([yes])
+ CPPFLAGS="$CPPFLAGS -DPROVIDE_MAIN_FUNCTION"],
+ [],
+ [AC_LANG_PROGRAM([[
+ #include <cstdint>
+ #include <cstddef>
+ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { return 0; }
+ /* unterminated comment to remove the main function ...
+ ]],[[]])])
else
BITCOIN_QT_INIT