Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
build boost::geometry with address sanitizer
#!/usr/bin/env bash
set -eu
set -o pipefail
${HOME}/projects/mason/mason install clang++ 5.0.1
${HOME}/projects/mason/mason link clang++ 5.0.1
export ASAN_SYMBOLIZER_PATH=$(pwd)/mason_packages/.link/bin/llvm-symbolizer
export MSAN_SYMBOLIZER_PATH=$(pwd)/mason_packages/.link/bin/llvm-symbolizer
export UBSAN_OPTIONS=print_stacktrace=1
export ASAN_OPTIONS=detect_leaks=1:symbolize=1:abort_on_error=1:detect_container_overflow=1:check_initialization_order=1:detect_stack_use_after_return=1
export MASON_SANITIZE="-fsanitize=address,undefined,integer,leak -fno-sanitize=vptr,function"
export MASON_SANITIZE_CXXFLAGS="${MASON_SANITIZE} -g -fno-sanitize=vptr,function -fsanitize-address-use-after-scope -fno-omit-frame-pointer -fno-common"
export MASON_SANITIZE_LDFLAGS="${MASON_SANITIZE}"
# NOTE: b2 is built like:
: '
cd ../../
git clone --recursive https://github.com/boostorg/boost.git
cd boost
git checkout develop
./bootstrap.sh
'
if [[ ! -f user-config.jam ]]; then
echo 'using clang : : mason_packages/.link/bin/clang++ ;' > user-config.jam
fi
time ../../b2 test -j6 -d1 \
--ignore-site-config --user-config=user-config.jam \
variant=debug toolset="clang" \
linkflags="${MASON_SANITIZE_LDFLAGS}" \
cxxflags="${MASON_SANITIZE_CXXFLAGS}" \
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment