light/tools/ci/amd64/clang/msan.sh

39 lines
812 B
Bash
Raw Normal View History

#!/bin/bash
set -e
cd $(git rev-parse --show-toplevel)/
2025-10-08 08:58:27 +03:30
rm -rf ./build && mkdir build/
Xvfb :99 -screen 0 1024x768x16 &
export CXX=$(which clang++)
export CC=$(which clang)
export DISPLAY=:99
2025-10-08 08:58:27 +03:30
cmake . \
2025-10-16 14:12:16 +03:30
-Bbuild \
-GNinja \
-DCMAKE_LINKER_TYPE=MOLD \
-DENABLE_UNIT_TESTS=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_FLAGS=" \
-fsanitize=memory \
-fsanitize-memory-track-origins \
-g \
-fno-omit-frame-pointer \
-std=c++23 \
-nostdinc++ \
-isystem /libcxx_msan/include/c++/v1/" \
2025-10-16 14:12:16 +03:30
-DCMAKE_EXE_LINKER_FLAGS=" \
-fsanitize=memory \
-fsanitize-memory-track-origins \
-L/libcxx_msan/lib \
-lc++ \
-lc++abi \
2025-10-16 14:12:16 +03:30
-Wl,-rpath,/libcxx_msan/lib" &&
cmake --build ./build -j$(nproc)
2025-10-08 09:02:15 +03:30
for test in $(find ./build -type f -name '*_tests' -executable); do
2025-10-16 14:12:16 +03:30
echo "Running $test"
"$test"
done