aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/xsan_build
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2016-02-16 14:03:14 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-02-16 14:03:15 -0800
commit0da8537555faf886a8cbac4bd0819ece9fa00dda (patch)
treee688f350168b09da83eabe53eb72ec339b69bb28 /tools/xsan_build
parent84f0e745839a0cb5ff5055f5ea0726bdd83b920b (diff)
MSAN: build libc++ with MSAN, link to it.
The errors that we see should now change to the unexplainable, rather than the explainable errors at head. We suspect that the original reason to blacklist was this, not building libc++ with MSAN. So unblacklist everything to start fresh. BUG=skia:4903,skia:4900 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1694353004 Review URL: https://codereview.chromium.org/1694353004
Diffstat (limited to 'tools/xsan_build')
-rwxr-xr-xtools/xsan_build18
1 files changed, 17 insertions, 1 deletions
diff --git a/tools/xsan_build b/tools/xsan_build
index db255fb20a..b569a7be9f 100755
--- a/tools/xsan_build
+++ b/tools/xsan_build
@@ -21,11 +21,14 @@ pushd $here/../third_party/externals/cmake
make -j $cores cmake
popd
+cmake=$here/../third_party/externals/cmake/bin/cmake
+
echo "Building Clang"
pushd $here/../third_party/externals/llvm
mkdir -p out/
cd out/
-$here/../third_party/externals/cmake/bin/cmake -DCMAKE_BUILD_TYPE=Release -G Ninja ..
+rm -f CMakeCache.txt # Force CMake to re-configure, in case DEPS has changed.
+$cmake -DCMAKE_BUILD_TYPE=Release -G Ninja ..
ninja
popd
@@ -34,7 +37,20 @@ export CXX=$here/../third_party/externals/llvm/out/bin/clang++
$CC --version
if [[ "$1" == "memory" ]]; then
+ echo "Building libc++ with MSAN"
+ pushd $here/../third_party/externals/llvm
+ mkdir -p msan_out/
+ cd msan_out/
+ rm -f CMakeCache.txt # Force CMake to re-configure, in case DEPS has changed.
+ $cmake -DLLVM_USE_SANITIZER=MemoryWithOrigins -DCMAKE_BUILD_TYPE=Release -G Ninja ..
+ ninja cxx cxxabi # No need to build all of LLVM+Clang with MSAN, just libc++.
+ popd
+
+ msan_out=$here/../third_party/externals/llvm/msan_out
+
export GYP_DEFINES="skia_gpu=0 skia_no_fontconfig=1 skia_freetype_static=1 ${GYP_DEFINES}"
+ export CXXFLAGS="-stdlib=libc++ -I$msan_out/include ${CXX_FLAGS}"
+ export LDFLAGS="-stdlib=libc++ -L$msan_out/lib -Wl,-rpath,$msan_out/lib ${LDFLAGS}"
fi
export GYP_DEFINES="skia_sanitizer=$1 ${GYP_DEFINES}"