MSAN: build libc++ with MSAN, link to it.
authormtklein <mtklein@chromium.org>
Tue, 16 Feb 2016 22:03:14 +0000 (14:03 -0800)
committerCommit bot <commit-bot@chromium.org>
Tue, 16 Feb 2016 22:03:15 +0000 (14:03 -0800)
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

DEPS
tools/dm_flags.json
tools/dm_flags.py
tools/xsan_build

diff --git a/DEPS b/DEPS
index 1118d4f..fda5350 100644 (file)
--- a/DEPS
+++ b/DEPS
@@ -55,6 +55,8 @@ deps = {
   "third_party/externals/llvm": "https://llvm.googlesource.com/llvm@release_38",
   "third_party/externals/llvm/tools/clang": "https://llvm.googlesource.com/clang@release_38",
   "third_party/externals/llvm/projects/compiler-rt": "https://llvm.googlesource.com/compiler-rt@release_38",
+  "third_party/externals/llvm/projects/libcxx": "https://llvm.googlesource.com/libcxx@release_38",
+  "third_party/externals/llvm/projects/libcxxabi": "https://llvm.googlesource.com/libcxxabi@release_38",
 }
 
 recursedeps = [ "common" ]
index 67e5845..1ce707f 100644 (file)
     "serialize-8888", 
     "gm", 
     "_", 
-    "image-cacherator-from-ctable", 
-    "_", 
-    "image", 
-    "_", 
-    ".wbmp", 
-    "_", 
-    "image", 
-    "_", 
-    ".png", 
-    "_", 
-    "image", 
-    "_", 
-    ".bmp"
+    "image-cacherator-from-ctable"
   ], 
   "Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-TSAN": [
     "--pre_log", 
index 5542e4f..bb1c464 100755 (executable)
@@ -188,12 +188,6 @@ def get_args(bot):
   if 'ANGLE' in bot and 'Debug' in bot:
     match.append('~GLPrograms') # skia:4717
 
-  # Hacking around trying to get the MSAN bot green.
-  if 'MSAN' in bot:
-    blacklist.extend(('_ image _ .wbmp').split(' '))  # skia:4900
-    blacklist.extend(('_ image _ .png').split(' '))  # I8 .png color tables
-    blacklist.extend(('_ image _ .bmp').split(' '))  # I8 .bmp color tables
-
   if blacklist:
     args.append('--blacklist')
     args.extend(blacklist)
index db255fb..b569a7b 100755 (executable)
@@ -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}"