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

Unified Diff: build/config/sanitizers/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/compiler/BUILD.gn ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/sanitizers/BUILD.gn
diff --git a/build/config/sanitizers/BUILD.gn b/build/config/sanitizers/BUILD.gn
index 3972a5c0e3b5e65b9ce25ab2081cef1577c49f47..d48ac4e8c07d05503a2317411bca418d930ace55 100644
--- a/build/config/sanitizers/BUILD.gn
+++ b/build/config/sanitizers/BUILD.gn
@@ -2,11 +2,11 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-# Contains the dependencies needed for asan to link into executables and
+# Contains the dependencies needed for sanitizers to link into executables and
# shared_libraries. Unconditionally depend upon this target as it is empty if
-# |is_asan| is false.
+# |is_asan|, |is_lsan|, |is_tsan| and |is_msan| are false.
group("deps") {
- if (is_asan) {
+ if (is_asan || is_lsan || is_tsan || is_msan) {
public_configs = [ ":sanitizer_options_link_helper" ]
deps = [
":options_sources",
@@ -15,10 +15,19 @@ group("deps") {
}
config("sanitizer_options_link_helper") {
- ldflags = [
- "-Wl,-u_sanitizer_options_link_helper",
- "-fsanitize=address",
- ]
+ ldflags = [ "-Wl,-u_sanitizer_options_link_helper" ]
+ if (is_asan) {
+ ldflags += [ "-fsanitize=address" ]
+ }
+ if (is_lsan) {
+ ldflags += [ "-fsanitize=leak" ]
+ }
+ if (is_tsan) {
+ ldflags += [ "-fsanitize=thread" ]
+ }
+ if (is_msan) {
+ ldflags += [ "-fsanitize=memory" ]
+ }
}
source_set("options_sources") {
@@ -34,6 +43,10 @@ source_set("options_sources") {
sources += [ "//build/sanitizers/asan_suppressions.cc" ]
}
+ if (is_lsan) {
+ sources += [ "//build/sanitizers/lsan_suppressions.cc" ]
+ }
+
if (is_tsan) {
sources += [ "//build/sanitizers/tsan_suppressions.cc" ]
}
« no previous file with comments | « build/config/compiler/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698