Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(255)

Unified Diff: tools/xsan_build

Issue 1694353004: MSAN: build libc++ with MSAN, link to it. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: unblacklist Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/dm_flags.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/xsan_build
diff --git a/tools/xsan_build b/tools/xsan_build
index db255fb20a79941c9c0b156251572aa0be781520..b569a7be9f9ab801f7c5c19cecfb080bc8cf6dfd 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}"
« no previous file with comments | « tools/dm_flags.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698