Merge 28564 via fix_conf_fuzzbin_main

This commit is contained in:
Luke Dashjr 2025-03-05 03:27:08 +00:00
commit 86c5ef3785

View File

@ -1210,11 +1210,9 @@ fi
if test "$enable_fuzz_binary" = "yes"; then if test "$enable_fuzz_binary" = "yes"; then
AC_MSG_CHECKING([whether main function is needed for fuzz binary]) AC_MSG_CHECKING([whether main function is needed for fuzz binary])
AX_CHECK_LINK_FLAG( TEMP_LDFLAGS="$LDFLAGS"
[], LDFLAGS="$LDFLAGS $SANITIZER_LDFLAGS"
[AC_MSG_RESULT([no])], AC_LINK_IFELSE(
[AC_MSG_RESULT([yes]); CORE_CPPFLAGS="$CORE_CPPFLAGS -DPROVIDE_FUZZ_MAIN_FUNCTION"],
[$SANITIZER_LDFLAGS],
[AC_LANG_PROGRAM([[ [AC_LANG_PROGRAM([[
#include <cstdint> #include <cstdint>
#include <cstddef> #include <cstddef>
@ -1222,7 +1220,11 @@ if test "$enable_fuzz_binary" = "yes"; then
/* comment to remove the main function ... /* comment to remove the main function ...
]],[[ ]],[[
*/ int not_main() { */ int not_main() {
]])]) ]])],
[AC_MSG_RESULT([no])],
[AC_MSG_RESULT([yes]); CORE_CPPFLAGS="$CORE_CPPFLAGS -DPROVIDE_FUZZ_MAIN_FUNCTION"]
)
LDFLAGS="$TEMP_LDFLAGS"
fi fi
dnl Check for libsecp256k1, only if explicitly requested dnl Check for libsecp256k1, only if explicitly requested