Skip to content

Commit

Permalink
ci: enable additional libc++ checks in some tasks
Browse files Browse the repository at this point in the history
Enable `_LIBCPP_ABI_BOUNDED_*` when compiling Bitcoin Core on the
following CI tasks:

macOS 14 native, arm64, no depends, sqlite only, gui (GitHub)
macOS 14 native, arm64, fuzz (GitHub)
no wallet, libbitcoinkernel (Cirrus CI)
MSan, depends (Cirrus CI)

Docs at: https://libcxx.llvm.org/Hardening.html#abi-options
  • Loading branch information
vasild committed Jan 6, 2025
1 parent 1ef9f7c commit 39a1326
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 4 deletions.
13 changes: 12 additions & 1 deletion ci/test/00_setup_env_mac_native.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,18 @@ export LC_ALL=C.UTF-8
export PIP_PACKAGES="--break-system-packages zmq"
export GOAL="install"
export CMAKE_GENERATOR="Ninja"
export BITCOIN_CONFIG="-DBUILD_GUI=ON -DWITH_ZMQ=ON -DREDUCE_EXPORTS=ON"
export BITCOIN_CONFIG="\
-DAPPEND_CPPFLAGS='\
-D_LIBCPP_ABI_BOUNDED_ITERATORS \
-D_LIBCPP_ABI_BOUNDED_ITERATORS_IN_STD_ARRAY \
-D_LIBCPP_ABI_BOUNDED_ITERATORS_IN_STRING \
-D_LIBCPP_ABI_BOUNDED_ITERATORS_IN_VECTOR \
-D_LIBCPP_ABI_BOUNDED_UNIQUE_PTR \
' \
-DBUILD_GUI=ON \
-DREDUCE_EXPORTS=ON \
-DWITH_ZMQ=ON \
"
export CI_OS_NAME="macos"
export NO_DEPENDS=1
export OSX_SDK=""
11 changes: 10 additions & 1 deletion ci/test/00_setup_env_mac_native_fuzz.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,16 @@
export LC_ALL=C.UTF-8

export CMAKE_GENERATOR="Ninja"
export BITCOIN_CONFIG="-DBUILD_FOR_FUZZING=ON"
export BITCOIN_CONFIG="\
-DAPPEND_CPPFLAGS='\
-D_LIBCPP_ABI_BOUNDED_ITERATORS \
-D_LIBCPP_ABI_BOUNDED_ITERATORS_IN_STD_ARRAY \
-D_LIBCPP_ABI_BOUNDED_ITERATORS_IN_STRING \
-D_LIBCPP_ABI_BOUNDED_ITERATORS_IN_VECTOR \
-D_LIBCPP_ABI_BOUNDED_UNIQUE_PTR \
' \
-DBUILD_FOR_FUZZING=ON \
"
export CI_OS_NAME="macos"
export NO_DEPENDS=1
export OSX_SDK=""
Expand Down
9 changes: 8 additions & 1 deletion ci/test/00_setup_env_native_msan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ export BITCOIN_CONFIG="\
-DCMAKE_C_FLAGS_DEBUG='' \
-DCMAKE_CXX_FLAGS_DEBUG='' \
-DSANITIZERS=memory \
-DAPPEND_CPPFLAGS='-U_FORTIFY_SOURCE' \
-DAPPEND_CPPFLAGS='\
-D_LIBCPP_ABI_BOUNDED_ITERATORS \
-D_LIBCPP_ABI_BOUNDED_ITERATORS_IN_STD_ARRAY \
-D_LIBCPP_ABI_BOUNDED_ITERATORS_IN_STRING \
-D_LIBCPP_ABI_BOUNDED_ITERATORS_IN_VECTOR \
-D_LIBCPP_ABI_BOUNDED_UNIQUE_PTR \
-U_FORTIFY_SOURCE \
' \
"
export USE_MEMORY_SANITIZER="true"
14 changes: 13 additions & 1 deletion ci/test/00_setup_env_native_nowallet_libbitcoinkernel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,16 @@ export CI_IMAGE_NAME_TAG="docker.io/debian:bookworm"
export PACKAGES="python3-zmq clang-16 llvm-16 libc++abi-16-dev libc++-16-dev"
export DEP_OPTS="NO_WALLET=1 CC=clang-16 CXX='clang++-16 -stdlib=libc++'"
export GOAL="install"
export BITCOIN_CONFIG="-DREDUCE_EXPORTS=ON -DBUILD_UTIL_CHAINSTATE=ON -DBUILD_KERNEL_LIB=ON -DBUILD_SHARED_LIBS=ON"
export BITCOIN_CONFIG="\
-DAPPEND_CPPFLAGS='\
-D_LIBCPP_ABI_BOUNDED_ITERATORS \
-D_LIBCPP_ABI_BOUNDED_ITERATORS_IN_STD_ARRAY \
-D_LIBCPP_ABI_BOUNDED_ITERATORS_IN_STRING \
-D_LIBCPP_ABI_BOUNDED_ITERATORS_IN_VECTOR \
-D_LIBCPP_ABI_BOUNDED_UNIQUE_PTR \
' \
-DBUILD_KERNEL_LIB=ON \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_UTIL_CHAINSTATE=ON \
-DREDUCE_EXPORTS=ON \
"

0 comments on commit 39a1326

Please sign in to comment.