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

Unified Diff: build/config/compiler/BUILD.gn

Issue 1134003008: GN: Implement is_lsan, is_tsan and is_msan. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 7 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/allocator.gni ('k') | build/config/sanitizers/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/compiler/BUILD.gn
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index e6cc59b840a0dbaa45597a0a756074f720047eef..7aaa9fbe8b80fd420b0960578de9c7e81c169206 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -56,6 +56,11 @@ declare_args() {
# The patch is preapplied to the internal toolchain and hence all bots.
msvs_xtree_patched = false
}
+
+ # Track where uninitialized memory originates from. From fastest to slowest:
+ # 0 - no tracking, 1 - track only the initial allocation site, 2 - track the
+ # chain of stores leading from allocation site to use site.
+ msan_track_origins = 2
}
# default_include_dirs ---------------------------------------------------------
@@ -139,12 +144,39 @@ config("compiler") {
]
}
if (is_asan) {
- cflags += [ "-fsanitize=address" ]
+ asan_blacklist_path =
+ rebase_path("//tools/memory/asan/blacklist.txt", root_build_dir)
+ cflags += [
+ "-fsanitize=address",
+ "-fsanitize-blacklist=$asan_blacklist_path",
+ ]
if (is_mac) {
cflags += [ "-mllvm -asan-globals=0" ] # http://crbug.com/352073
# TODO(GYP): deal with mac_bundles.
}
}
+ if (is_lsan) {
+ cflags += [ "-fsanitize=leak" ]
+ }
+ if (is_tsan) {
+ tsan_blacklist_path =
+ rebase_path("//tools/memory/tsan_v2/ignores.txt", root_build_dir)
+ cflags += [
+ "-fsanitize=thread",
+ "-fsanitize-blacklist=$tsan_blacklist_path",
+ ]
+ }
+ if (is_msan) {
+ msan_blacklist_path =
+ rebase_path("//tools/msan/blacklist.txt", root_build_dir)
+ cflags += [
+ "-fsanitize=memory",
+ "-fsanitize-memory-track-origins=$msan_track_origins",
+ "-fsanitize-blacklist=$msan_blacklist_path",
+ ]
+
+ # TODO(GYP): Support instrumented libraries and custom libc++.
+ }
}
if (is_clang && is_debug) {
« no previous file with comments | « build/config/allocator.gni ('k') | build/config/sanitizers/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698