mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-18 21:35:13 +01:00
ci: compile clang and compiler-rt in MSAN jobs
This works around https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1005341.
This commit is contained in:
parent
796bd1d0d1
commit
d3cbcbf626
@ -7,13 +7,13 @@
|
|||||||
export LC_ALL=C.UTF-8
|
export LC_ALL=C.UTF-8
|
||||||
|
|
||||||
export CI_IMAGE_NAME_TAG="ubuntu:23.04" # Version 23.04 will reach EOL in Jan 2024, and can be replaced by "ubuntu:24.04" (or anything else that ships the wanted clang version).
|
export CI_IMAGE_NAME_TAG="ubuntu:23.04" # Version 23.04 will reach EOL in Jan 2024, and can be replaced by "ubuntu:24.04" (or anything else that ships the wanted clang version).
|
||||||
LIBCXX_DIR="${BASE_SCRATCH_DIR}/msan/build/"
|
LIBCXX_DIR="${BASE_SCRATCH_DIR}/msan/cxx_build/"
|
||||||
export MSAN_FLAGS="-fsanitize=memory -fsanitize-memory-track-origins=2 -fno-omit-frame-pointer -g -O1 -fno-optimize-sibling-calls"
|
export MSAN_FLAGS="-fsanitize=memory -fsanitize-memory-track-origins=2 -fno-omit-frame-pointer -g -O1 -fno-optimize-sibling-calls"
|
||||||
LIBCXX_FLAGS="-nostdinc++ -nostdlib++ -isystem ${LIBCXX_DIR}include/c++/v1 -L${LIBCXX_DIR}lib -Wl,-rpath,${LIBCXX_DIR}lib -lc++ -lc++abi -lpthread -Wno-unused-command-line-argument"
|
LIBCXX_FLAGS="-nostdinc++ -nostdlib++ -isystem ${LIBCXX_DIR}include/c++/v1 -L${LIBCXX_DIR}lib -Wl,-rpath,${LIBCXX_DIR}lib -lc++ -lc++abi -lpthread -Wno-unused-command-line-argument"
|
||||||
export MSAN_AND_LIBCXX_FLAGS="${MSAN_FLAGS} ${LIBCXX_FLAGS}"
|
export MSAN_AND_LIBCXX_FLAGS="${MSAN_FLAGS} ${LIBCXX_FLAGS}"
|
||||||
|
|
||||||
export CONTAINER_NAME="ci_native_fuzz_msan"
|
export CONTAINER_NAME="ci_native_fuzz_msan"
|
||||||
export PACKAGES="clang-16 llvm-16 libclang-rt-16-dev cmake"
|
export PACKAGES="cmake ninja-build"
|
||||||
# BDB generates false-positives and will be removed in future
|
# BDB generates false-positives and will be removed in future
|
||||||
export DEP_OPTS="NO_BDB=1 NO_QT=1 CC=clang CXX=clang++ CFLAGS='${MSAN_FLAGS}' CXXFLAGS='${MSAN_AND_LIBCXX_FLAGS}'"
|
export DEP_OPTS="NO_BDB=1 NO_QT=1 CC=clang CXX=clang++ CFLAGS='${MSAN_FLAGS}' CXXFLAGS='${MSAN_AND_LIBCXX_FLAGS}'"
|
||||||
export GOAL="install"
|
export GOAL="install"
|
||||||
|
@ -7,13 +7,13 @@
|
|||||||
export LC_ALL=C.UTF-8
|
export LC_ALL=C.UTF-8
|
||||||
|
|
||||||
export CI_IMAGE_NAME_TAG="ubuntu:23.04" # Version 23.04 will reach EOL in Jan 2024, and can be replaced by "ubuntu:24.04" (or anything else that ships the wanted clang version).
|
export CI_IMAGE_NAME_TAG="ubuntu:23.04" # Version 23.04 will reach EOL in Jan 2024, and can be replaced by "ubuntu:24.04" (or anything else that ships the wanted clang version).
|
||||||
LIBCXX_DIR="${BASE_SCRATCH_DIR}/msan/build/"
|
LIBCXX_DIR="${BASE_SCRATCH_DIR}/msan/cxx_build/"
|
||||||
export MSAN_FLAGS="-fsanitize=memory -fsanitize-memory-track-origins=2 -fno-omit-frame-pointer -g -O1 -fno-optimize-sibling-calls"
|
export MSAN_FLAGS="-fsanitize=memory -fsanitize-memory-track-origins=2 -fno-omit-frame-pointer -g -O1 -fno-optimize-sibling-calls"
|
||||||
LIBCXX_FLAGS="-nostdinc++ -nostdlib++ -isystem ${LIBCXX_DIR}include/c++/v1 -L${LIBCXX_DIR}lib -Wl,-rpath,${LIBCXX_DIR}lib -lc++ -lc++abi -lpthread -Wno-unused-command-line-argument"
|
LIBCXX_FLAGS="-nostdinc++ -nostdlib++ -isystem ${LIBCXX_DIR}include/c++/v1 -L${LIBCXX_DIR}lib -Wl,-rpath,${LIBCXX_DIR}lib -lc++ -lc++abi -lpthread -Wno-unused-command-line-argument"
|
||||||
export MSAN_AND_LIBCXX_FLAGS="${MSAN_FLAGS} ${LIBCXX_FLAGS}"
|
export MSAN_AND_LIBCXX_FLAGS="${MSAN_FLAGS} ${LIBCXX_FLAGS}"
|
||||||
|
|
||||||
export CONTAINER_NAME="ci_native_msan"
|
export CONTAINER_NAME="ci_native_msan"
|
||||||
export PACKAGES="clang-16 llvm-16 libclang-rt-16-dev cmake"
|
export PACKAGES="cmake ninja-build"
|
||||||
# BDB generates false-positives and will be removed in future
|
# BDB generates false-positives and will be removed in future
|
||||||
export DEP_OPTS="NO_BDB=1 NO_QT=1 CC=clang CXX=clang++ CFLAGS='${MSAN_FLAGS}' CXXFLAGS='${MSAN_AND_LIBCXX_FLAGS}'"
|
export DEP_OPTS="NO_BDB=1 NO_QT=1 CC=clang CXX=clang++ CFLAGS='${MSAN_FLAGS}' CXXFLAGS='${MSAN_AND_LIBCXX_FLAGS}'"
|
||||||
export GOAL="install"
|
export GOAL="install"
|
||||||
|
@ -42,11 +42,32 @@ if [ -n "$PIP_PACKAGES" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ${USE_MEMORY_SANITIZER} == "true" ]]; then
|
if [[ ${USE_MEMORY_SANITIZER} == "true" ]]; then
|
||||||
update-alternatives --install /usr/bin/clang++ clang++ "$(which clang++-16)" 100
|
|
||||||
update-alternatives --install /usr/bin/clang clang "$(which clang-16)" 100
|
|
||||||
git clone --depth=1 https://github.com/llvm/llvm-project -b llvmorg-16.0.4 "${BASE_SCRATCH_DIR}"/msan/llvm-project
|
git clone --depth=1 https://github.com/llvm/llvm-project -b llvmorg-16.0.4 "${BASE_SCRATCH_DIR}"/msan/llvm-project
|
||||||
cmake -B "${BASE_SCRATCH_DIR}"/msan/build/ -DLLVM_ENABLE_RUNTIMES='libcxx;libcxxabi' -DCMAKE_BUILD_TYPE=Release -DLLVM_USE_SANITIZER=MemoryWithOrigins -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF -DLIBCXX_ENABLE_DEBUG_MODE=ON -DLIBCXX_ENABLE_ASSERTIONS=ON -S "${BASE_SCRATCH_DIR}"/msan/llvm-project/runtimes
|
|
||||||
make -C "${BASE_SCRATCH_DIR}"/msan/build/ "$MAKEJOBS"
|
cmake -G Ninja -B "${BASE_SCRATCH_DIR}"/msan/clang_build/ -DLLVM_ENABLE_PROJECTS="clang" \
|
||||||
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
|
-DLLVM_TARGETS_TO_BUILD=X86 \
|
||||||
|
-DLLVM_ENABLE_RUNTIMES="compiler-rt;libcxx;libcxxabi;libunwind" \
|
||||||
|
-S "${BASE_SCRATCH_DIR}"/msan/llvm-project/llvm
|
||||||
|
|
||||||
|
ninja -C "${BASE_SCRATCH_DIR}"/msan/clang_build/ "$MAKEJOBS"
|
||||||
|
ninja -C "${BASE_SCRATCH_DIR}"/msan/clang_build/ install-runtimes
|
||||||
|
|
||||||
|
update-alternatives --install /usr/bin/clang++ clang++ "${BASE_SCRATCH_DIR}"/msan/clang_build/bin/clang++ 100
|
||||||
|
update-alternatives --install /usr/bin/clang clang "${BASE_SCRATCH_DIR}"/msan/clang_build/bin/clang 100
|
||||||
|
|
||||||
|
cmake -G Ninja -B "${BASE_SCRATCH_DIR}"/msan/cxx_build/ -DLLVM_ENABLE_RUNTIMES='libcxx;libcxxabi' \
|
||||||
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
|
-DLLVM_USE_SANITIZER=MemoryWithOrigins \
|
||||||
|
-DCMAKE_C_COMPILER=clang \
|
||||||
|
-DCMAKE_CXX_COMPILER=clang++ \
|
||||||
|
-DLLVM_TARGETS_TO_BUILD=X86 \
|
||||||
|
-DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF \
|
||||||
|
-DLIBCXX_ENABLE_DEBUG_MODE=ON \
|
||||||
|
-DLIBCXX_ENABLE_ASSERTIONS=ON \
|
||||||
|
-S "${BASE_SCRATCH_DIR}"/msan/llvm-project/runtimes
|
||||||
|
|
||||||
|
ninja -C "${BASE_SCRATCH_DIR}"/msan/cxx_build/ "$MAKEJOBS"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${RUN_TIDY}" == "true" ]]; then
|
if [[ "${RUN_TIDY}" == "true" ]]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user