diff --git a/CMakeLists.txt b/CMakeLists.txt index 1be8748f25..c0eda5b24a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,7 +26,7 @@ set(CLIENT_NAME "Elements Core") set(CLIENT_VERSION_MAJOR 29) set(CLIENT_VERSION_MINOR 0) set(CLIENT_VERSION_BUILD 0) -set(CLIENT_VERSION_RC 2) +set(CLIENT_VERSION_RC 3) set(CLIENT_VERSION_IS_RELEASE "true") set(COPYRIGHT_YEAR "2025") @@ -384,6 +384,7 @@ if(SANITIZERS) int main() { return 0; } " RESULT_VAR linker_supports_sanitizers + NO_CACHE_IF_FAILED ) if(NOT linker_supports_sanitizers) message(FATAL_ERROR "Linker did not accept requested flags, you are missing required libraries.") diff --git a/cmake/module/TryAppendLinkerFlag.cmake b/cmake/module/TryAppendLinkerFlag.cmake index be41a2e1cc..fe7c2bce51 100644 --- a/cmake/module/TryAppendLinkerFlag.cmake +++ b/cmake/module/TryAppendLinkerFlag.cmake @@ -20,7 +20,7 @@ In configuration output, this function prints a string by the following pattern: function(try_append_linker_flag flag) cmake_parse_arguments(PARSE_ARGV 1 TALF # prefix - "" # options + "NO_CACHE_IF_FAILED" # options "TARGET;VAR;SOURCE;RESULT_VAR" # one_value_keywords "IF_CHECK_PASSED" # multi_value_keywords ) @@ -68,6 +68,10 @@ function(try_append_linker_flag flag) if(DEFINED TALF_RESULT_VAR) set(${TALF_RESULT_VAR} "${${result}}" PARENT_SCOPE) endif() + + if(NOT ${result} AND TALF_NO_CACHE_IF_FAILED) + unset(${result} CACHE) + endif() endfunction() if(MSVC) diff --git a/depends/Makefile b/depends/Makefile index 25c8646739..3dbd69221a 100644 --- a/depends/Makefile +++ b/depends/Makefile @@ -206,6 +206,7 @@ endif $(host_prefix)/toolchain.cmake : toolchain.cmake.in $(host_prefix)/.stamp_$(final_build_id) @mkdir -p $(@D) sed -e 's|@depends_crosscompiling@|$(crosscompiling)|' \ + -e 's|@host@|$(host)|' \ -e 's|@host_system_name@|$($(host_os)_cmake_system_name)|' \ -e 's|@host_system_version@|$($(host_os)_cmake_system_version)|' \ -e 's|@host_arch@|$(host_arch)|' \ diff --git a/depends/toolchain.cmake.in b/depends/toolchain.cmake.in index 89a6e36969..65036d07a9 100644 --- a/depends/toolchain.cmake.in +++ b/depends/toolchain.cmake.in @@ -13,6 +13,10 @@ if(@depends_crosscompiling@) set(CMAKE_SYSTEM_NAME @host_system_name@) set(CMAKE_SYSTEM_VERSION @host_system_version@) set(CMAKE_SYSTEM_PROCESSOR @host_arch@) + + set(CMAKE_C_COMPILER_TARGET @host@) + set(CMAKE_CXX_COMPILER_TARGET @host@) + set(CMAKE_OBJCXX_COMPILER_TARGET @host@) endif() if(NOT DEFINED CMAKE_C_FLAGS_INIT) diff --git a/src/test/fuzz/base_encode_decode.cpp b/src/test/fuzz/base_encode_decode.cpp index 2ffcbdf720..4508818717 100644 --- a/src/test/fuzz/base_encode_decode.cpp +++ b/src/test/fuzz/base_encode_decode.cpp @@ -92,5 +92,6 @@ FUZZ_TARGET(psbt_base64_decode) PartiallySignedTransaction psbt; std::string error; - assert(DecodeBase64PSBT(psbt, random_string, error) == error.empty()); + const bool ok{DecodeBase64PSBT(psbt, random_string, error)}; + assert(ok == error.empty()); } diff --git a/src/test/fuzz/rbf.cpp b/src/test/fuzz/rbf.cpp index 09a69c0c66..fd9e457912 100644 --- a/src/test/fuzz/rbf.cpp +++ b/src/test/fuzz/rbf.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2022 The Bitcoin Core developers +// Copyright (c) 2020-present The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -116,7 +116,7 @@ FUZZ_TARGET(package_rbf, .init = initialize_package_rbf) // Add a bunch of parent-child pairs to the mempool, and remember them. std::vector mempool_txs; - size_t iter{0}; + uint32_t iter{0}; // Keep track of the total vsize of CTxMemPoolEntry's being added to the mempool to avoid overflow // Add replacement_vsize since this is added to new diagram during RBF check @@ -124,9 +124,8 @@ FUZZ_TARGET(package_rbf, .init = initialize_package_rbf) if (!replacement_tx) { return; } - assert(iter <= g_outpoints.size()); replacement_tx->vin.resize(1); - replacement_tx->vin[0].prevout = g_outpoints[iter++]; + replacement_tx->vin[0].prevout = g_outpoints.at(iter++); CTransaction replacement_tx_final{*replacement_tx}; auto replacement_entry = ConsumeTxMemPoolEntry(fuzzed_data_provider, replacement_tx_final); int32_t replacement_vsize = replacement_entry.GetTxSize(); @@ -134,14 +133,14 @@ FUZZ_TARGET(package_rbf, .init = initialize_package_rbf) LOCK2(cs_main, pool.cs); - LIMITED_WHILE(fuzzed_data_provider.ConsumeBool(), NUM_ITERS) - { + while (fuzzed_data_provider.ConsumeBool()) { + if (iter >= NUM_ITERS) break; + // Make sure txns only have one input, and that a unique input is given to avoid circular references CMutableTransaction parent; - assert(iter <= g_outpoints.size()); parent.vin.resize(1); - parent.vin[0].prevout = g_outpoints[iter++]; - parent.vout.emplace_back(CAsset(), 0, CScript()); + parent.vin[0].prevout = g_outpoints.at(iter++); + parent.vout.emplace_back(CAsset(),0, CScript()); mempool_txs.emplace_back(parent); const auto parent_entry = ConsumeTxMemPoolEntry(fuzzed_data_provider, mempool_txs.back());