From 6e786165ca08013fe3cfb2641241133563a3f051 Mon Sep 17 00:00:00 2001 From: fanquake Date: Thu, 18 Jul 2024 10:13:50 +0100 Subject: [PATCH 1/2] refactor: fix missing includes These cause compile failures with _LIBCPP_REMOVE_TRANSITIVE_INCLUDES. i.e: ```bash In file included from init.cpp:8: ./init.h:46:54: error: no template named 'atomic' in namespace 'std' 46 | bool AppInitBasicSetup(const ArgsManager& args, std::atomic& exit_status); | ~~~~~^ 1 error generated. ``` See: https://libcxx.llvm.org/DesignDocs/HeaderRemovalPolicy.html. --- src/crypto/sha256.cpp | 5 +++-- src/init.h | 4 +--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/crypto/sha256.cpp b/src/crypto/sha256.cpp index 89d72048084..deedc0a6d1c 100644 --- a/src/crypto/sha256.cpp +++ b/src/crypto/sha256.cpp @@ -7,8 +7,9 @@ #include #include -#include -#include +#include +#include +#include #if !defined(DISABLE_OPTIMIZED_SHA256) #include diff --git a/src/init.h b/src/init.h index ead5f5e0d21..40a5da3c0b5 100644 --- a/src/init.h +++ b/src/init.h @@ -6,9 +6,7 @@ #ifndef BITCOIN_INIT_H #define BITCOIN_INIT_H -#include -#include -#include +#include //! Default value for -daemon option static constexpr bool DEFAULT_DAEMON = false; From e3edaccd9deb2da50be70d2d8768eca8821785c7 Mon Sep 17 00:00:00 2001 From: fanquake Date: Thu, 18 Jul 2024 10:14:08 +0100 Subject: [PATCH 2/2] ci: add _LIBCPP_REMOVE_TRANSITIVE_INCLUDES to TSAN job See: https://libcxx.llvm.org/DesignDocs/HeaderRemovalPolicy.html. --- ci/test/00_setup_env_native_tsan.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/test/00_setup_env_native_tsan.sh b/ci/test/00_setup_env_native_tsan.sh index 3fcaa8c6c69..5bfbb4cbf1a 100755 --- a/ci/test/00_setup_env_native_tsan.sh +++ b/ci/test/00_setup_env_native_tsan.sh @@ -11,4 +11,4 @@ export CI_IMAGE_NAME_TAG="docker.io/ubuntu:24.04" export PACKAGES="clang-18 llvm-18 libclang-rt-18-dev libc++abi-18-dev libc++-18-dev python3-zmq" export DEP_OPTS="CC=clang-18 CXX='clang++-18 -stdlib=libc++'" export GOAL="install" -export BITCOIN_CONFIG="--enable-zmq CPPFLAGS='-DARENA_DEBUG -DDEBUG_LOCKORDER -DDEBUG_LOCKCONTENTION' --with-sanitizers=thread" +export BITCOIN_CONFIG="--enable-zmq CPPFLAGS='-DARENA_DEBUG -DDEBUG_LOCKORDER -DDEBUG_LOCKCONTENTION -D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES' --with-sanitizers=thread"