diff --git a/configure.ac b/configure.ac index 2e0c8bd1f..a7be75c61 100644 --- a/configure.ac +++ b/configure.ac @@ -644,6 +644,17 @@ AX_BOOST_PROGRAM_OPTIONS AX_BOOST_THREAD AX_BOOST_CHRONO +dnl Prevent use of std::unary_function, which was removed in C++17, +dnl and will generate warnings with newer compilers for Boost +dnl older than 1.80. +dnl See: https://github.com/boostorg/container_hash/issues/22, https://github.com/boostorg/config/pull/430. + +dnl _HAS_AUTO_PTR_ETC check required only for boost 1.72 and older, for 1.73+ we can use BOOST_NO_CXX98_FUNCTION_BASE +AX_CHECK_PREPROC_FLAG([-D_HAS_AUTO_PTR_ETC=0], [BOOST_CPPFLAGS="$BOOST_CPPFLAGS -D_HAS_AUTO_PTR_ETC=0"], [], [$CXXFLAG_WERROR], + [AC_LANG_PROGRAM([[#include ]])]) +AX_CHECK_PREPROC_FLAG([-DBOOST_NO_CXX98_FUNCTION_BASE], [BOOST_CPPFLAGS="$BOOST_CPPFLAGS -DBOOST_NO_CXX98_FUNCTION_BASE"], [], [$CXXFLAG_WERROR], + [AC_LANG_PROGRAM([[#include ]])]) + fi if test x$use_reduce_exports = xyes; then @@ -947,11 +958,12 @@ echo echo " target os = $TARGET_OS" echo " build os = $BUILD_OS" echo -echo " CC = $CC" -echo " CFLAGS = $CFLAGS" -echo " CPPFLAGS = $CPPFLAGS" -echo " CXX = $CXX" -echo " CXXFLAGS = $CXXFLAGS" -echo " LDFLAGS = $LDFLAGS" -echo " ARFLAGS = $ARFLAGS" +echo " CC = $CC" +echo " CFLAGS = $CFLAGS" +echo " CPPFLAGS = $CPPFLAGS" +echo " CXX = $CXX" +echo " CXXFLAGS = $CXXFLAGS" +echo " BOOST_CPPFLAGS = $BOOST_CPPFLAGS" +echo " LDFLAGS = $LDFLAGS" +echo " ARFLAGS = $ARFLAGS" echo diff --git a/depends/packages/boost.mk b/depends/packages/boost.mk index f7d34c253..ac9f5f74c 100644 --- a/depends/packages/boost.mk +++ b/depends/packages/boost.mk @@ -7,7 +7,7 @@ $(package)_sha256_hash=59c9b274bc451cf91a9ba1dd2c7fdcaf5d60b1b3aa83f2c9fa143417c $(package)_download_path=https://git.hush.is/attachments $(package)_file_name=7b13759e-8623-4e48-ae08-f78502f4b6a5 $(package)_download_file=7b13759e-8623-4e48-ae08-f78502f4b6a5 -$(package)_patches=fix-Solaris.patch +$(package)_patches=fix-Solaris.patch ignore_wnonnull_gcc_11.patch range_enums_clang_16.patch define $(package)_set_vars $(package)_config_opts_release=variant=release @@ -32,7 +32,9 @@ endef define $(package)_preprocess_cmds echo "using $(boost_toolset_$(host_os)) : : $($(package)_cxx) : \"$($(package)_cxxflags) $($(package)_cppflags)\" \"$($(package)_ldflags)\" \"$(boost_archiver_$(host_os))\" \"$(host_STRIP)\" \"$(host_RANLIB)\" \"$(host_WINDRES)\" : ;" > user-config.jam&& \ - patch -p1 < $($(package)_patch_dir)/fix-Solaris.patch + patch -p1 < $($(package)_patch_dir)/fix-Solaris.patch &&\ + patch -p2 < $($(package)_patch_dir)/ignore_wnonnull_gcc_11.patch &&\ + patch -p2 < $($(package)_patch_dir)/range_enums_clang_16.patch endef define $(package)_config_cmds diff --git a/depends/patches/boost/ignore_wnonnull_gcc_11.patch b/depends/patches/boost/ignore_wnonnull_gcc_11.patch new file mode 100644 index 000000000..f914c1e68 --- /dev/null +++ b/depends/patches/boost/ignore_wnonnull_gcc_11.patch @@ -0,0 +1,68 @@ +diff --git a/include/boost/concept/detail/general.hpp b/include/boost/concept/detail/general.hpp +index eeb08750..8d7d6f69 100644 +--- a/include/boost/concept/detail/general.hpp ++++ b/include/boost/concept/detail/general.hpp +@@ -28,7 +28,14 @@ namespace detail + template + struct requirement + { ++# if defined(BOOST_GCC) && (BOOST_GCC >= 110000) ++# pragma GCC diagnostic push ++# pragma GCC diagnostic ignored "-Wnonnull" ++# endif + static void failed() { ((Model*)0)->~Model(); } ++# if defined(BOOST_GCC) && (BOOST_GCC >= 110000) ++# pragma GCC diagnostic pop ++# endif + }; + + struct failed {}; +@@ -36,7 +43,14 @@ struct failed {}; + template + struct requirement + { ++# if defined(BOOST_GCC) && (BOOST_GCC >= 110000) ++# pragma GCC diagnostic push ++# pragma GCC diagnostic ignored "-Wnonnull" ++# endif + static void failed() { ((Model*)0)->~Model(); } ++# if defined(BOOST_GCC) && (BOOST_GCC >= 110000) ++# pragma GCC diagnostic pop ++# endif + }; + + # ifdef BOOST_OLD_CONCEPT_SUPPORT +@@ -44,7 +58,14 @@ struct requirement + template + struct constraint + { ++# if defined(BOOST_GCC) && (BOOST_GCC >= 110000) ++# pragma GCC diagnostic push ++# pragma GCC diagnostic ignored "-Wnonnull" ++# endif + static void failed() { ((Model*)0)->constraints(); } ++# if defined(BOOST_GCC) && (BOOST_GCC >= 110000) ++# pragma GCC diagnostic pop ++# endif + }; + + template +diff --git a/include/boost/concept/usage.hpp b/include/boost/concept/usage.hpp +index 373de63a..fe88b5f5 100644 +--- a/include/boost/concept/usage.hpp ++++ b/include/boost/concept/usage.hpp +@@ -13,7 +13,14 @@ namespace boost { namespace concepts { + template + struct usage_requirements + { ++# if defined(BOOST_GCC) && (BOOST_GCC >= 110000) ++# pragma GCC diagnostic push ++# pragma GCC diagnostic ignored "-Wnonnull" ++# endif + ~usage_requirements() { ((Model*)0)->~Model(); } ++# if defined(BOOST_GCC) && (BOOST_GCC >= 110000) ++# pragma GCC diagnostic pop ++# endif + }; + + # if BOOST_WORKAROUND(__GNUC__, <= 3) diff --git a/depends/patches/boost/range_enums_clang_16.patch b/depends/patches/boost/range_enums_clang_16.patch new file mode 100644 index 000000000..3e049e261 --- /dev/null +++ b/depends/patches/boost/range_enums_clang_16.patch @@ -0,0 +1,75 @@ +diff --git a/include/boost/numeric/conversion/detail/int_float_mixture.hpp b/include/boost/numeric/conversion/detail/int_float_mixture.hpp +index 464e527..7690d07 100644 +--- a/include/boost/numeric/conversion/detail/int_float_mixture.hpp ++++ b/include/boost/numeric/conversion/detail/int_float_mixture.hpp +@@ -16,15 +16,15 @@ + #include "boost/numeric/conversion/int_float_mixture_enum.hpp" + #include "boost/numeric/conversion/detail/meta.hpp" + +-#include "boost/mpl/integral_c.hpp" ++#include "boost/type_traits/integral_constant.hpp" + + namespace boost { namespace numeric { namespace convdetail + { + // Integral Constants for 'IntFloatMixture' +- typedef mpl::integral_c int2int_c ; +- typedef mpl::integral_c int2float_c ; +- typedef mpl::integral_c float2int_c ; +- typedef mpl::integral_c float2float_c ; ++ typedef boost::integral_constant int2int_c ; ++ typedef boost::integral_constant int2float_c ; ++ typedef boost::integral_constant float2int_c ; ++ typedef boost::integral_constant float2float_c ; + + // Metafunction: + // +diff --git a/include/boost/numeric/conversion/detail/sign_mixture.hpp b/include/boost/numeric/conversion/detail/sign_mixture.hpp +index c7f9e42..fde1584 100644 +--- a/include/boost/numeric/conversion/detail/sign_mixture.hpp ++++ b/include/boost/numeric/conversion/detail/sign_mixture.hpp +@@ -16,15 +16,15 @@ + #include "boost/numeric/conversion/sign_mixture_enum.hpp" + #include "boost/numeric/conversion/detail/meta.hpp" + +-#include "boost/mpl/integral_c.hpp" ++#include "boost/type_traits/integral_constant.hpp" + + namespace boost { namespace numeric { namespace convdetail + { + // Integral Constants for 'SignMixture' +- typedef mpl::integral_c unsig2unsig_c ; +- typedef mpl::integral_c sig2sig_c ; +- typedef mpl::integral_c sig2unsig_c ; +- typedef mpl::integral_c unsig2sig_c ; ++ typedef boost::integral_constant unsig2unsig_c ; ++ typedef boost::integral_constant sig2sig_c ; ++ typedef boost::integral_constant sig2unsig_c ; ++ typedef boost::integral_constant unsig2sig_c ; + + // Metafunction: + // +diff --git a/include/boost/numeric/conversion/detail/udt_builtin_mixture.hpp b/include/boost/numeric/conversion/detail/udt_builtin_mixture.hpp +index 36dbc49..a39d29f 100644 +--- a/include/boost/numeric/conversion/detail/udt_builtin_mixture.hpp ++++ b/include/boost/numeric/conversion/detail/udt_builtin_mixture.hpp +@@ -15,15 +15,15 @@ + #include "boost/numeric/conversion/udt_builtin_mixture_enum.hpp" + #include "boost/numeric/conversion/detail/meta.hpp" + +-#include "boost/mpl/integral_c.hpp" ++#include "boost/type_traits/integral_constant.hpp" + + namespace boost { namespace numeric { namespace convdetail + { + // Integral Constants for 'UdtMixture' +- typedef mpl::integral_c builtin2builtin_c ; +- typedef mpl::integral_c builtin2udt_c ; +- typedef mpl::integral_c udt2builtin_c ; +- typedef mpl::integral_c udt2udt_c ; ++ typedef boost::integral_constant builtin2builtin_c ; ++ typedef boost::integral_constant builtin2udt_c ; ++ typedef boost::integral_constant udt2builtin_c ; ++ typedef boost::integral_constant udt2udt_c ; + + // Metafunction: + // diff --git a/src/cc/Makefile_custom b/src/cc/Makefile_custom index 3c71a60c0..9db01b106 100644 --- a/src/cc/Makefile_custom +++ b/src/cc/Makefile_custom @@ -4,7 +4,7 @@ CC_DARWIN = g++-8 CC_WIN = x86_64-w64-mingw32-gcc-posix CC_AARCH64 = aarch64-linux-gnu-g++ CFLAGS_DARWIN = -DBUILD_CUSTOMCC -std=c++11 -arch x86_64 -I../secp256k1/include -I../../depends/$(shell echo `../..//depends/config.guess`/include) -I../univalue/include -I../leveldb/include -I.. -I. -fPIC -Wl,-undefined -Wl,dynamic_lookup -Wno-write-strings -shared -dynamiclib -CFLAGS = -Wno-write-strings -DBUILD_CUSTOMCC -std=c++11 -I../secp256k1/include -I../../depends/$(shell echo `../..//depends/config.guess`/include) -I../univalue/include -I../leveldb/include -I.. -I. -fPIC -shared +CFLAGS = -D_HAS_AUTO_PTR_ETC=0 -DBOOST_NO_CXX98_FUNCTION_BASE -Wno-write-strings -DBUILD_CUSTOMCC -std=c++11 -I../secp256k1/include -I../../depends/$(shell echo `../..//depends/config.guess`/include) -I../univalue/include -I../leveldb/include -I.. -I. -fPIC -shared CFLAGS_WIN = -Wno-write-strings -DBUILD_CUSTOMCC -std=c++11 -I../secp256k1/include -I../../depends/x86_64-w64-mingw32/include -I../univalue/include -I../leveldb/include -I.. -I. -fPIC -shared DEBUGFLAGS = -O0 -D _DEBUG RELEASEFLAGS = -O2 -D NDEBUG -combine -fwhole-program