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

Unified Diff: build/config/sanitizers/sanitizers.gni

Issue 1379503002: Add Undefined Behaviour sanitizer support to GN. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments. Created 5 years, 3 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 | « build/config/sanitizers/BUILD.gn ('k') | build/toolchain/gcc_toolchain.gni » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/sanitizers/sanitizers.gni
diff --git a/build/config/sanitizers/sanitizers.gni b/build/config/sanitizers/sanitizers.gni
index 1aa212deab712df718a92d6bf0e00315348d2ab3..84348da425ae90a53e5f74edbf7709f51fd1cd50 100644
--- a/build/config/sanitizers/sanitizers.gni
+++ b/build/config/sanitizers/sanitizers.gni
@@ -15,10 +15,14 @@ declare_args() {
# Compile for Thread Sanitizer to find threading bugs.
is_tsan = false
+ # Compile for Undefined Behaviour Sanitizer to find various types of
+ # undefined behaviour.
+ is_ubsan = 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.
- use_custom_libcxx = (is_asan && is_linux) || is_tsan || is_msan
+ use_custom_libcxx = (is_asan && is_linux) || is_tsan || is_msan || is_ubsan
# Track where uninitialized memory originates from. From fastest to slowest:
# 0 - no tracking, 1 - track only the initial allocation site, 2 - track the
@@ -45,7 +49,7 @@ declare_args() {
}
# TODO(GYP) bug 527515: is_ubsan, is_ubsan_vptr
-using_sanitizer = is_asan || is_lsan || is_tsan || is_msan
+using_sanitizer = is_asan || is_lsan || is_tsan || is_msan || is_ubsan
assert(!using_sanitizer || is_clang,
"Sanitizers (is_*san) require setting is_clang = true in 'gn args'")
@@ -63,5 +67,5 @@ assert(!using_sanitizer || is_clang,
# unsupported or unadvisable configurations.
#
# For one-off testing, just comment this assertion out.
-assert(!is_debug || !(is_msan || is_lsan || is_tsan),
+assert(!is_debug || !(is_msan || is_lsan || is_tsan || is_ubsan),
"Sanitizers should generally be used in release (set is_debug=false).")
« no previous file with comments | « build/config/sanitizers/BUILD.gn ('k') | build/toolchain/gcc_toolchain.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698