Skip to content

Commit fe3cb56

Browse files
committed
build: Attempt #1
1 parent 9313c4e commit fe3cb56

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

configure.ac

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1779,6 +1779,20 @@ if test x$build_bitcoin_wallet$build_bitcoin_cli$build_bitcoin_tx$build_bitcoin_
17791779
AC_MSG_ERROR([No targets! Please specify at least one of: --with-utils --with-libs --with-daemon --with-gui --enable-bench or --enable-tests])
17801780
fi
17811781

1782+
if test x$enable_fuzz_binary = xyes; then
1783+
AC_LINK_IFELSE(
1784+
[AC_LANG_PROGRAM([[
1785+
#include <stdbool.h>
1786+
#include <stdint.h>
1787+
#if defined(__has_builtin) && __has_builtin(__builtin_mul_overflow)
1788+
bool test(int x, int y, int* prod) { return __builtin_mul_overflow(x, y, prod); }
1789+
#endif
1790+
]])],
1791+
[FUZZ_BINARY_LDFLAGS="empty"],
1792+
[FUZZ_BINARY_LDFLAGS="--rtlib=compiler-rt -lgcc_s"]
1793+
)
1794+
fi
1795+
17821796
AM_CONDITIONAL([TARGET_DARWIN], [test x$TARGET_OS = xdarwin])
17831797
AM_CONDITIONAL([BUILD_DARWIN], [test x$BUILD_OS = xdarwin])
17841798
AM_CONDITIONAL([TARGET_LINUX], [test x$TARGET_OS = xlinux])
@@ -1977,3 +1991,5 @@ echo " CXXFLAGS = $DEBUG_CXXFLAGS $HARDENED_CXXFLAGS $WARN_CXXFLAGS $NOW
19771991
echo " LDFLAGS = $PTHREAD_LIBS $HARDENED_LDFLAGS $GPROF_LDFLAGS $LDFLAGS"
19781992
echo " ARFLAGS = $ARFLAGS"
19791993
echo
1994+
echo " FUZZ_BINARY_LDFLAGS = $FUZZ_BINARY_LDFLAGS"
1995+
echo

0 commit comments

Comments
 (0)