Index: build/config/sanitizers/sanitizers.gni |
diff --git a/build/config/sanitizers/sanitizers.gni b/build/config/sanitizers/sanitizers.gni |
index c575eb1cc1f680218a6fe220ab38ae5af4b09ec6..1aa212deab712df718a92d6bf0e00315348d2ab3 100644 |
--- a/build/config/sanitizers/sanitizers.gni |
+++ b/build/config/sanitizers/sanitizers.gni |
@@ -3,6 +3,18 @@ |
# found in the LICENSE file. |
declare_args() { |
+ # Compile for Address Sanitizer to find memory bugs. |
+ is_asan = false |
+ |
+ # Compile for Leak Sanitizer to find leaks. |
+ is_lsan = false |
+ |
+ # Compile for Memory Sanitizer to find uninitialized reads. |
+ is_msan = false |
+ |
+ # Compile for Thread Sanitizer to find threading bugs. |
+ is_tsan = false |
+ |
# Use libc++ (buildtools/third_party/libc++ and |
# buildtools/third_party/libc++abi) instead of stdlibc++ as standard library. |
# This is intended to be used for instrumented builds. |
@@ -32,6 +44,12 @@ declare_args() { |
use_cfi_diag = false |
} |
+# TODO(GYP) bug 527515: is_ubsan, is_ubsan_vptr |
+using_sanitizer = is_asan || is_lsan || is_tsan || is_msan |
+ |
+assert(!using_sanitizer || is_clang, |
+ "Sanitizers (is_*san) require setting is_clang = true in 'gn args'") |
+ |
# MSan only links Chrome properly in release builds (brettw -- 9/1/2015). The |
# same is possibly true for the other non-ASan sanitizers. But regardless of |
# whether it links, one would normally never run a sanitizer in debug mode. |