From c2f13492fcb966d1d1adf2cfc0772637f0a12a62 Mon Sep 17 00:00:00 2001 From: evoskuil Date: Mon, 4 Mar 2024 20:39:52 -0500 Subject: [PATCH 1/2] Add checkpoint tests against std::less<>. --- test/chain/checkpoint.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/chain/checkpoint.cpp b/test/chain/checkpoint.cpp index 9a44779c82..7260ffd80f 100644 --- a/test/chain/checkpoint.cpp +++ b/test/chain/checkpoint.cpp @@ -127,6 +127,7 @@ BOOST_AUTO_TEST_CASE(checkpoint__lesser__same__false) const checkpoint instance1("0102030405060708090a0102030405060708090a0102030405060708090a0b0c", 42); const checkpoint instance2("0102030405060708090a0102030405060708090a0102030405060708090a0b0c", 42); BOOST_REQUIRE(!(instance1 < instance2)); + BOOST_REQUIRE(!std::less{}(instance1, instance2)); } BOOST_AUTO_TEST_CASE(checkpoint__lesser__lesser_hash_same_height__false) @@ -134,6 +135,7 @@ BOOST_AUTO_TEST_CASE(checkpoint__lesser__lesser_hash_same_height__false) const checkpoint instance1(null_hash, 42); const checkpoint instance2("0102030405060708090a0102030405060708090a0102030405060708090a0b0c", 42); BOOST_REQUIRE(!(instance1 < instance2)); + BOOST_REQUIRE(!std::less{}(instance1, instance2)); } BOOST_AUTO_TEST_CASE(checkpoint__lesser__same_hash_lesser_height__true) @@ -141,6 +143,7 @@ BOOST_AUTO_TEST_CASE(checkpoint__lesser__same_hash_lesser_height__true) const checkpoint instance1("0102030405060708090a0102030405060708090a0102030405060708090a0b0c", 41); const checkpoint instance2("0102030405060708090a0102030405060708090a0102030405060708090a0b0c", 42); BOOST_REQUIRE(instance1 < instance2); + BOOST_REQUIRE(std::less{}(instance1, instance2)); } BOOST_AUTO_TEST_CASE(checkpoint__lesser__same_hash_greater_height__false) @@ -148,6 +151,7 @@ BOOST_AUTO_TEST_CASE(checkpoint__lesser__same_hash_greater_height__false) const checkpoint instance1("0102030405060708090a0102030405060708090a0102030405060708090a0b0c", 43); const checkpoint instance2("0102030405060708090a0102030405060708090a0102030405060708090a0b0c", 42); BOOST_REQUIRE(!(instance1 < instance2)); + BOOST_REQUIRE(!std::less{}(instance1, instance2)); } BOOST_AUTO_TEST_CASE(checkpoint__equality__same__expected) From f744e8b3daa9b6ab07f9db08acb5a6ee4b835bff Mon Sep 17 00:00:00 2001 From: evoskuil Date: Tue, 5 Mar 2024 16:32:19 -0500 Subject: [PATCH 2/2] Regenerate artifacts. --- builds/cmake/CMakeLists.txt | 36 +++++++++++++++++----------------- builds/cmake/CMakePresets.json | 4 ++-- install-cmake.sh | 31 ----------------------------- install-cmakepresets.sh | 31 ----------------------------- install.sh | 31 ----------------------------- 5 files changed, 20 insertions(+), 113 deletions(-) diff --git a/builds/cmake/CMakeLists.txt b/builds/cmake/CMakeLists.txt index 5c03fcb3f7..7aeff4b5bb 100644 --- a/builds/cmake/CMakeLists.txt +++ b/builds/cmake/CMakeLists.txt @@ -45,7 +45,7 @@ set( CMAKE_CXX_STANDARD_REQUIRED ON ) # Warn on all stuff. check_cxx_compiler_flag( "-Wall" HAS_FLAG_WALL ) if ( HAS_FLAG_WALL ) - add_compile_options( $<$:-Wall> ) + add_compile_options( "-Wall" ) else() message( FATAL_ERROR "Compiler does not support -Wall" ) endif() @@ -53,7 +53,7 @@ endif() # Warn on extra stuff. check_cxx_compiler_flag( "-Wextra" HAS_FLAG_WEXTRA ) if ( HAS_FLAG_WEXTRA ) - add_compile_options( $<$:-Wextra> ) + add_compile_options( "-Wextra" ) else() message( FATAL_ERROR "Compiler does not support -Wextra" ) endif() @@ -61,7 +61,7 @@ endif() # Disallow warning on style order of declarations. check_cxx_compiler_flag( "-Wno-reorder" HAS_FLAG_WNO-REORDER ) if ( HAS_FLAG_WNO-REORDER ) - add_compile_options( $<$:-Wno-reorder> ) + add_compile_options( "-Wno-reorder" ) else() message( FATAL_ERROR "Compiler does not support -Wno-reorder" ) endif() @@ -69,7 +69,7 @@ endif() # Suppress warning for incomplete field initialization. check_cxx_compiler_flag( "-Wno-missing-field-initializers" HAS_FLAG_WNO-MISSING-FIELD-INITIALIZERS ) if ( HAS_FLAG_WNO-MISSING-FIELD-INITIALIZERS ) - add_compile_options( $<$:-Wno-missing-field-initializers> ) + add_compile_options( "-Wno-missing-field-initializers" ) else() message( FATAL_ERROR "Compiler does not support -Wno-missing-field-initializers" ) endif() @@ -77,7 +77,7 @@ endif() # Conform to style. check_cxx_compiler_flag( "-Wno-missing-braces" HAS_FLAG_WNO-MISSING-BRACES ) if ( HAS_FLAG_WNO-MISSING-BRACES ) - add_compile_options( $<$:-Wno-missing-braces> ) + add_compile_options( "-Wno-missing-braces" ) else() message( FATAL_ERROR "Compiler does not support -Wno-missing-braces" ) endif() @@ -85,7 +85,7 @@ endif() # Ignore comments within comments or commenting of backslash extended lines. check_cxx_compiler_flag( "-Wno-comment" HAS_FLAG_WNO-COMMENT ) if ( HAS_FLAG_WNO-COMMENT ) - add_compile_options( $<$:-Wno-comment> ) + add_compile_options( "-Wno-comment" ) else() message( FATAL_ERROR "Compiler does not support -Wno-comment" ) endif() @@ -93,7 +93,7 @@ endif() # Suppress warning for copy of implicitly generated copy constructor. check_cxx_compiler_flag( "-Wno-deprecated-copy" HAS_FLAG_WNO-DEPRECATED-COPY ) if ( HAS_FLAG_WNO-DEPRECATED-COPY ) - add_compile_options( $<$:-Wno-deprecated-copy> ) + add_compile_options( "-Wno-deprecated-copy" ) else() message( FATAL_ERROR "Compiler does not support -Wno-deprecated-copy" ) endif() @@ -101,7 +101,7 @@ endif() # Suppress warning for ignored attributes (arising on template arguments). check_cxx_compiler_flag( "-Wno-ignored-attributes" HAS_FLAG_WNO-IGNORED-ATTRIBUTES ) if ( HAS_FLAG_WNO-IGNORED-ATTRIBUTES ) - add_compile_options( $<$:-Wno-ignored-attributes> ) + add_compile_options( "-Wno-ignored-attributes" ) else() message( FATAL_ERROR "Compiler does not support -Wno-ignored-attributes" ) endif() @@ -109,7 +109,7 @@ endif() # Allow use of C99 'long long' type. check_cxx_compiler_flag( "-Wno-long-long" HAS_FLAG_WNO-LONG-LONG ) if ( HAS_FLAG_WNO-LONG-LONG ) - add_compile_options( $<$:-Wno-long-long> ) + add_compile_options( "-Wno-long-long" ) else() message( FATAL_ERROR "Compiler does not support -Wno-long-long" ) endif() @@ -118,7 +118,7 @@ endif() if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") check_cxx_compiler_flag( "-Wno-mismatched-tags" HAS_FLAG_WNO-MISMATCHED-TAGS ) if ( HAS_FLAG_WNO-MISMATCHED-TAGS ) - add_compile_options( $<$:-Wno-mismatched-tags> ) + add_compile_options( "-Wno-mismatched-tags" ) else() message( FATAL_ERROR "Compiler does not support -Wno-mismatched-tags" ) endif() @@ -128,7 +128,7 @@ endif() if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") check_cxx_compiler_flag( "-fno-var-tracking-assignments" HAS_FLAG_FNO-VAR-TRACKING-ASSIGNMENTS ) if ( HAS_FLAG_FNO-VAR-TRACKING-ASSIGNMENTS ) - add_compile_options( $<$:-fno-var-tracking-assignments> ) + add_compile_options( "-fno-var-tracking-assignments" ) else() message( FATAL_ERROR "Compiler does not support -fno-var-tracking-assignments" ) endif() @@ -192,8 +192,8 @@ if (enable-avx2) check_cxx_compiler_flag("-mavx -mavx2" HAS_FLAGS_AVX2) if (HAS_FLAGS_AVX2) - add_compile_options( $<$:-mavx> ) - add_compile_options( $<$:-mavx2> ) + add_compile_options( "-mavx" ) + add_compile_options( "-mavx2" ) set( CMAKE_REQUIRED_FLAGS_PREV "${CMAKE_REQUIRED_FLAGS}" ) set( CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -mavx -mavx2" ) endif() @@ -221,8 +221,8 @@ if (enable-avx512) check_cxx_compiler_flag("-mavx512f -mavx512bw" HAS_FLAGS_AVX512) if (HAS_FLAGS_AVX512) - add_compile_options( $<$:-mavx512f> ) - add_compile_options( $<$:-mavx512bw> ) + add_compile_options( "-mavx512f" ) + add_compile_options( "-mavx512bw" ) set( CMAKE_REQUIRED_FLAGS_PREV "${CMAKE_REQUIRED_FLAGS}" ) set( CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -mavx512f -mavx512bw" ) endif() @@ -250,8 +250,8 @@ if (enable-shani) check_cxx_compiler_flag("-msse4 -msha" HAS_FLAGS_SHANI) if (HAS_FLAGS_SHANI) - add_compile_options( $<$:-msse4> ) - add_compile_options( $<$:-msha> ) + add_compile_options( "-msse4" ) + add_compile_options( "-msha" ) set( CMAKE_REQUIRED_FLAGS_PREV "${CMAKE_REQUIRED_FLAGS}" ) set( CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -msse4 -msha" ) endif() @@ -281,7 +281,7 @@ if (enable-sse4) check_cxx_compiler_flag("-msse4.1" HAS_FLAGS_SSE4) if (HAS_FLAGS_SSE4) - add_compile_options( $<$:-msse4.1> ) + add_compile_options( "-msse4.1" ) set( CMAKE_REQUIRED_FLAGS_PREV "${CMAKE_REQUIRED_FLAGS}" ) set( CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -msse4.1" ) endif() diff --git a/builds/cmake/CMakePresets.json b/builds/cmake/CMakePresets.json index 1c328874b2..29c5e170b0 100644 --- a/builds/cmake/CMakePresets.json +++ b/builds/cmake/CMakePresets.json @@ -79,8 +79,8 @@ "description": "Factored size optimization settings.", "hidden": true, "cacheVariables": { - "CMAKE_C_FLAGS": "$env{CMAKE_C_FLAGS} -Os", - "CMAKE_CXX_FLAGS": "$env{CMAKE_CXX_FLAGS} -Os" + "CMAKE_C_FLAGS": "$env{CMAKE_C_FLAGS} -Os -s", + "CMAKE_CXX_FLAGS": "$env{CMAKE_CXX_FLAGS} -Os -s" } }, { diff --git a/install-cmake.sh b/install-cmake.sh index 2dde1f1d95..8496d53eee 100755 --- a/install-cmake.sh +++ b/install-cmake.sh @@ -854,12 +854,7 @@ build_from_tarball_boost() display_message "BOOST_OPTIONS : $*" display_message "--------------------------------------------------------------------" - guessed_toolset=`./tools/build/src/engine/build.sh --guess-toolset` - CXXFLAGS="-w" ./tools/build/src/engine/build.sh ${guessed_toolset} --cxxflags="-w" - cp tools/build/src/engine/b2 . - ./bootstrap.sh \ - "--with-bjam=./b2" \ "--prefix=$PREFIX" \ "--with-icu=$ICU_PREFIX" @@ -877,7 +872,6 @@ build_from_tarball_boost() "$BOOST_CXXFLAGS" \ "$BOOST_LINKFLAGS" \ "link=$BOOST_LINK" \ - "warnings=off" \ "boost.locale.iconv=$BOOST_ICU_ICONV" \ "boost.locale.posix=$BOOST_ICU_POSIX" \ "-sNO_BZIP2=1" \ @@ -901,22 +895,11 @@ build_from_tarball_boost() build_all() { unpack_from_tarball "$ICU_ARCHIVE" "$ICU_URL" gzip "$BUILD_ICU" - local SAVE_CPPFLAGS="$CPPFLAGS" - export CPPFLAGS="$CPPFLAGS ${ICU_FLAGS[@]}" build_from_tarball "$ICU_ARCHIVE" source "$PARALLEL" "$BUILD_ICU" "${ICU_OPTIONS[@]}" $CUMULATIVE_FILTERED_ARGS - export CPPFLAGS=$SAVE_CPPFLAGS unpack_from_tarball "$BOOST_ARCHIVE" "$BOOST_URL" bzip2 "$BUILD_BOOST" - local SAVE_CPPFLAGS="$CPPFLAGS" - export CPPFLAGS="$CPPFLAGS ${BOOST_FLAGS[@]}" build_from_tarball_boost "$BOOST_ARCHIVE" "$PARALLEL" "$BUILD_BOOST" "${BOOST_OPTIONS[@]}" - export CPPFLAGS=$SAVE_CPPFLAGS create_from_github libbitcoin secp256k1 version8 "yes" - local SAVE_CPPFLAGS="$CPPFLAGS" - export CPPFLAGS="$CPPFLAGS ${SECP256K1_FLAGS[@]}" build_from_github secp256k1 "$PARALLEL" false "yes" "${SECP256K1_OPTIONS[@]}" $CUMULATIVE_FILTERED_ARGS - export CPPFLAGS=$SAVE_CPPFLAGS - local SAVE_CPPFLAGS="$CPPFLAGS" - export CPPFLAGS="$CPPFLAGS ${BITCOIN_SYSTEM_FLAGS[@]}" if [[ ! ($CI == true) ]]; then create_from_github libbitcoin libbitcoin-system master "yes" build_from_github_cmake libbitcoin-system "$PARALLEL" true "yes" "${BITCOIN_SYSTEM_OPTIONS[@]}" $CUMULATIVE_FILTERED_ARGS_CMAKE "$@" @@ -927,7 +910,6 @@ build_all() pop_directory pop_directory fi - export CPPFLAGS=$SAVE_CPPFLAGS } @@ -949,19 +931,6 @@ set_with_boost_prefix remove_install_options -# Define build flags. -#============================================================================== -# Define icu flags. -#------------------------------------------------------------------------------ -ICU_FLAGS=( -"-w") - -# Define secp256k1 flags. -#------------------------------------------------------------------------------ -SECP256K1_FLAGS=( -"-w") - - # Define build options. #============================================================================== # Define icu options. diff --git a/install-cmakepresets.sh b/install-cmakepresets.sh index e6397471e4..87b99ed67c 100755 --- a/install-cmakepresets.sh +++ b/install-cmakepresets.sh @@ -924,12 +924,7 @@ build_from_tarball_boost() display_message "BOOST_OPTIONS : $*" display_message "--------------------------------------------------------------------" - guessed_toolset=`./tools/build/src/engine/build.sh --guess-toolset` - CXXFLAGS="-w" ./tools/build/src/engine/build.sh ${guessed_toolset} --cxxflags="-w" - cp tools/build/src/engine/b2 . - ./bootstrap.sh \ - "--with-bjam=./b2" \ "--prefix=$PREFIX" \ "--with-icu=$ICU_PREFIX" @@ -947,7 +942,6 @@ build_from_tarball_boost() "$BOOST_CXXFLAGS" \ "$BOOST_LINKFLAGS" \ "link=$BOOST_LINK" \ - "warnings=off" \ "boost.locale.iconv=$BOOST_ICU_ICONV" \ "boost.locale.posix=$BOOST_ICU_POSIX" \ "-sNO_BZIP2=1" \ @@ -971,22 +965,11 @@ build_from_tarball_boost() build_all() { unpack_from_tarball "$ICU_ARCHIVE" "$ICU_URL" gzip "$BUILD_ICU" - local SAVE_CPPFLAGS="$CPPFLAGS" - export CPPFLAGS="$CPPFLAGS ${ICU_FLAGS[@]}" build_from_tarball "$ICU_ARCHIVE" source "$PARALLEL" "$BUILD_ICU" "${ICU_OPTIONS[@]}" $CUMULATIVE_FILTERED_ARGS - export CPPFLAGS=$SAVE_CPPFLAGS unpack_from_tarball "$BOOST_ARCHIVE" "$BOOST_URL" bzip2 "$BUILD_BOOST" - local SAVE_CPPFLAGS="$CPPFLAGS" - export CPPFLAGS="$CPPFLAGS ${BOOST_FLAGS[@]}" build_from_tarball_boost "$BOOST_ARCHIVE" "$PARALLEL" "$BUILD_BOOST" "${BOOST_OPTIONS[@]}" - export CPPFLAGS=$SAVE_CPPFLAGS create_from_github libbitcoin secp256k1 version8 "yes" - local SAVE_CPPFLAGS="$CPPFLAGS" - export CPPFLAGS="$CPPFLAGS ${SECP256K1_FLAGS[@]}" build_from_github secp256k1 "$PARALLEL" false "yes" "${SECP256K1_OPTIONS[@]}" $CUMULATIVE_FILTERED_ARGS - export CPPFLAGS=$SAVE_CPPFLAGS - local SAVE_CPPFLAGS="$CPPFLAGS" - export CPPFLAGS="$CPPFLAGS ${BITCOIN_SYSTEM_FLAGS[@]}" if [[ ! ($CI == true) ]]; then create_from_github libbitcoin libbitcoin-system master "yes" display_message "libbitcoin-system PRESET ${REPO_PRESET[libbitcoin-system]}" @@ -999,7 +982,6 @@ build_all() pop_directory pop_directory fi - export CPPFLAGS=$SAVE_CPPFLAGS } @@ -1021,19 +1003,6 @@ set_with_boost_prefix remove_install_options -# Define build flags. -#============================================================================== -# Define icu flags. -#------------------------------------------------------------------------------ -ICU_FLAGS=( -"-w") - -# Define secp256k1 flags. -#------------------------------------------------------------------------------ -SECP256K1_FLAGS=( -"-w") - - # Define build options. #============================================================================== # Define icu options. diff --git a/install.sh b/install.sh index 654cb6d8c0..7613fc6966 100755 --- a/install.sh +++ b/install.sh @@ -729,12 +729,7 @@ build_from_tarball_boost() display_message "BOOST_OPTIONS : $*" display_message "--------------------------------------------------------------------" - guessed_toolset=`./tools/build/src/engine/build.sh --guess-toolset` - CXXFLAGS="-w" ./tools/build/src/engine/build.sh ${guessed_toolset} --cxxflags="-w" - cp tools/build/src/engine/b2 . - ./bootstrap.sh \ - "--with-bjam=./b2" \ "--prefix=$PREFIX" \ "--with-icu=$ICU_PREFIX" @@ -752,7 +747,6 @@ build_from_tarball_boost() "$BOOST_CXXFLAGS" \ "$BOOST_LINKFLAGS" \ "link=$BOOST_LINK" \ - "warnings=off" \ "boost.locale.iconv=$BOOST_ICU_ICONV" \ "boost.locale.posix=$BOOST_ICU_POSIX" \ "-sNO_BZIP2=1" \ @@ -776,22 +770,11 @@ build_from_tarball_boost() build_all() { unpack_from_tarball "$ICU_ARCHIVE" "$ICU_URL" gzip "$BUILD_ICU" - local SAVE_CPPFLAGS="$CPPFLAGS" - export CPPFLAGS="$CPPFLAGS ${ICU_FLAGS[@]}" build_from_tarball "$ICU_ARCHIVE" source "$PARALLEL" "$BUILD_ICU" "${ICU_OPTIONS[@]}" "$@" - export CPPFLAGS=$SAVE_CPPFLAGS unpack_from_tarball "$BOOST_ARCHIVE" "$BOOST_URL" bzip2 "$BUILD_BOOST" - local SAVE_CPPFLAGS="$CPPFLAGS" - export CPPFLAGS="$CPPFLAGS ${BOOST_FLAGS[@]}" build_from_tarball_boost "$BOOST_ARCHIVE" "$PARALLEL" "$BUILD_BOOST" "${BOOST_OPTIONS[@]}" - export CPPFLAGS=$SAVE_CPPFLAGS create_from_github libbitcoin secp256k1 version8 "yes" - local SAVE_CPPFLAGS="$CPPFLAGS" - export CPPFLAGS="$CPPFLAGS ${SECP256K1_FLAGS[@]}" build_from_github secp256k1 "$PARALLEL" false "yes" "${SECP256K1_OPTIONS[@]}" "$@" - export CPPFLAGS=$SAVE_CPPFLAGS - local SAVE_CPPFLAGS="$CPPFLAGS" - export CPPFLAGS="$CPPFLAGS ${BITCOIN_SYSTEM_FLAGS[@]}" if [[ ! ($CI == true) ]]; then create_from_github libbitcoin libbitcoin-system master "yes" build_from_github libbitcoin-system "$PARALLEL" true "yes" "${BITCOIN_SYSTEM_OPTIONS[@]}" "$@" @@ -802,7 +785,6 @@ build_all() pop_directory pop_directory fi - export CPPFLAGS=$SAVE_CPPFLAGS } @@ -823,19 +805,6 @@ set_pkgconfigdir set_with_boost_prefix -# Define build flags. -#============================================================================== -# Define icu flags. -#------------------------------------------------------------------------------ -ICU_FLAGS=( -"-w") - -# Define secp256k1 flags. -#------------------------------------------------------------------------------ -SECP256K1_FLAGS=( -"-w") - - # Define build options. #============================================================================== # Define icu options.