aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorGravatar mtklein@google.com <mtklein@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-10-08 15:16:36 +0000
committerGravatar mtklein@google.com <mtklein@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-10-08 15:16:36 +0000
commit9f3b0e462e895f31dd68b311f915d1c2763edb9e (patch)
tree9b35c8b0a8afe98500caadaad6ac251e89b760d5 /tools
parent055a584abe73151b86a1f68a35daddc2fd2559a1 (diff)
skia/trunk changes for generic sanitizer gyp flag.
BUG= R=borenet@google.com Review URL: https://codereview.chromium.org/25564003 git-svn-id: http://skia.googlecode.com/svn/trunk@11648 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tools')
-rwxr-xr-xtools/asan_build42
-rwxr-xr-xtools/xsan_build34
2 files changed, 34 insertions, 42 deletions
diff --git a/tools/asan_build b/tools/asan_build
deleted file mode 100755
index 49817f66d4..0000000000
--- a/tools/asan_build
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/bin/bash
-
-# Build Skia with Address Sanitizer.
-#
-# Address Sanitizer is available in LLVM (and Clang) 3.1 and above, as well as
-# GCC 4.8. For now, this script assumes the use of Clang 3.2 or newer, which
-# uses different flag syntax from 3.1.
-#
-# For more information, see:
-# https://code.google.com/p/address-sanitizer/wiki/AddressSanitizer
-
-makeVars="$@"
-
-export CC="$(which clang)"
-export CXX="$(which clang++)"
-export LINK="$(which clang)"
-
-noClang="Couldn't find Clang on this machine!"
-if [[ -z "${CC}" ]]; then
- echo "${noClang}"
- exit 1
-fi
-if [[ -z "${CXX}" ]]; then
- echo "${noClang}"
- exit 1
-fi
-if [[ -z "${LINK}" ]]; then
- echo "${noClang}"
- exit 1
-fi
-
-export GYP_DEFINES="skia_asan_build=1 ${GYP_DEFINES}"
-
-python gyp_skia
-if [[ "$?" != "0" ]]; then
- exit 1
-fi
-
-make ${makeVars}
-if [[ "$?" != "0" ]]; then
- exit 1
-fi \ No newline at end of file
diff --git a/tools/xsan_build b/tools/xsan_build
new file mode 100755
index 0000000000..f4d82e9b9f
--- /dev/null
+++ b/tools/xsan_build
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+# Build Skia with one of Clang's many sanitizers.
+#
+# $ tools/xsan_build {address,thread,undefined,etc.} [any other flags to pass to make/ninja...]
+#
+# This script assumes the use of Clang >=3.2.
+#
+# For more information, see:
+# http://clang.llvm.org/docs/UsersManual.html#controlling-code-generation
+
+set -e
+
+sanitizer=$1
+shift
+args="$@"
+
+export CC="$(which clang)"
+export CXX="$(which clang++)"
+export LINK="$(which clang)"
+
+if [[ -z "${CC}" ]] || [[ -z "${CXX}" ]] || [[ -z "${LINK}" ]]; then
+ echo "Couldn't find Clang on this machine!"
+ exit 1
+fi
+
+export GYP_DEFINES="skia_sanitizer=$sanitizer ${GYP_DEFINES}"
+
+./gyp_skia
+if [[ $GYP_GENERATORS == "ninja" ]]; then
+ ninja ${args}
+else
+ make ${args}
+fi