aboutsummaryrefslogtreecommitdiff
path: root/ci/test/04_install.sh
diff options
context:
space:
mode:
authorpracticalswift <practicalswift@users.noreply.github.com>2020-06-01 08:12:33 +0000
committerpracticalswift <practicalswift@users.noreply.github.com>2020-06-23 09:09:30 +0000
commit870f0cd2a0534d54bba18190e9f024f88e832933 (patch)
treef54535816302eb6009f9d56012f4c621718a226c /ci/test/04_install.sh
parent80fd474e402bb003c3a427f1997eb649e69138ba (diff)
downloadbitcoin-870f0cd2a0534d54bba18190e9f024f88e832933.tar.xz
build: Add MemorySanitizer (MSan) in Travis to detect use of uninitialized memory
Diffstat (limited to 'ci/test/04_install.sh')
-rwxr-xr-xci/test/04_install.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/ci/test/04_install.sh b/ci/test/04_install.sh
index 165983d906..7cbf6f9d10 100755
--- a/ci/test/04_install.sh
+++ b/ci/test/04_install.sh
@@ -90,6 +90,15 @@ export DIR_FUZZ_IN=${DIR_QA_ASSETS}/fuzz_seed_corpus/
DOCKER_EXEC mkdir -p "${BASE_SCRATCH_DIR}/sanitizer-output/"
+if [[ ${USE_MEMORY_SANITIZER} == "true" ]]; then
+ DOCKER_EXEC "update-alternatives --install /usr/bin/clang++ clang++ \$(which clang++-9) 100"
+ DOCKER_EXEC "update-alternatives --install /usr/bin/clang clang \$(which clang-9) 100"
+ DOCKER_EXEC "mkdir -p ${BASE_SCRATCH_DIR}/msan/build/"
+ DOCKER_EXEC "git clone --depth=1 https://github.com/llvm/llvm-project -b llvmorg-10.0.0 ${BASE_SCRATCH_DIR}/msan/llvm-project"
+ DOCKER_EXEC "cd ${BASE_SCRATCH_DIR}/msan/build/ && cmake -DLLVM_ENABLE_PROJECTS='libcxx;libcxxabi' -DCMAKE_BUILD_TYPE=Release -DLLVM_USE_SANITIZER=Memory -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DLLVM_TARGETS_TO_BUILD=X86 ../llvm-project/llvm/"
+ DOCKER_EXEC "cd ${BASE_SCRATCH_DIR}/msan/build/ && make $MAKEJOBS cxx"
+fi
+
if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then
echo "Create $BASE_ROOT_DIR"
DOCKER_EXEC rsync -a /ro_base/ $BASE_ROOT_DIR