Skip to content

Commit 7ea9498

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

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

configure.ac

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1779,6 +1779,22 @@ 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_LANG_PUSH([C++])
1784+
AC_LINK_IFELSE(
1785+
[AC_LANG_PROGRAM([[
1786+
#include <cstdint>
1787+
#if defined(__has_builtin) && __has_builtin(__builtin_mul_overflow)
1788+
template <typename T>
1789+
bool test(T x, T y, T* prod) { return __builtin_mul_overflow(x, y, prod); }
1790+
#endif
1791+
]])],
1792+
[FUZZ_BINARY_LDFLAGS="empty"],
1793+
[FUZZ_BINARY_LDFLAGS="--rtlib=compiler-rt -lgcc_s"]
1794+
)
1795+
AC_LANG_POP
1796+
fi
1797+
17821798
AM_CONDITIONAL([TARGET_DARWIN], [test x$TARGET_OS = xdarwin])
17831799
AM_CONDITIONAL([BUILD_DARWIN], [test x$BUILD_OS = xdarwin])
17841800
AM_CONDITIONAL([TARGET_LINUX], [test x$TARGET_OS = xlinux])
@@ -1977,3 +1993,5 @@ echo " CXXFLAGS = $DEBUG_CXXFLAGS $HARDENED_CXXFLAGS $WARN_CXXFLAGS $NOW
19771993
echo " LDFLAGS = $PTHREAD_LIBS $HARDENED_LDFLAGS $GPROF_LDFLAGS $LDFLAGS"
19781994
echo " ARFLAGS = $ARFLAGS"
19791995
echo
1996+
echo " FUZZ_BINARY_LDFLAGS = $FUZZ_BINARY_LDFLAGS"
1997+
echo

0 commit comments

Comments
 (0)