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

Unified Diff: build/common.gypi

Issue 16658011: Add "lsan" to GYP options (enables LeakSanitizer). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/common.gypi
diff --git a/build/common.gypi b/build/common.gypi
index e34b1590dd6a731b9bc385b864ad52d58a6e1e75..26c0be5905b40439aca996cff2161cd46d7693f3 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -279,6 +279,11 @@
# See https://sites.google.com/a/chromium.org/dev/developers/testing/addresssanitizer
'asan%': 0,
+ # Enable building with LSan (Clang's -fsanitize=leak option).
+ # -fsanitize=leak only works with clang, but lsan=1 implies clang=1
+ # See https://sites.google.com/a/chromium.org/dev/developers/testing/leaksanitizer
+ 'lsan%': 0,
+
# Enable building with TSAN (Clang's -fsanitize=thread option).
# -fsanitize=thread only works with clang, but tsan=1 implies clang=1
# See http://clang.llvm.org/docs/ThreadSanitizer.html
@@ -777,6 +782,7 @@
'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)',
'mac_want_real_dsym%': '<(mac_want_real_dsym)',
'asan%': '<(asan)',
+ 'lsan%': '<(lsan)',
'msan%': '<(msan)',
'tsan%': '<(tsan)',
'tsan_blacklist%': '<(tsan_blacklist)',
@@ -1090,7 +1096,7 @@
# platforms except Windows, Mac and iOS.
# TODO(glider): set clang to 1 earlier for ASan and TSan builds so that
# it takes effect here.
- ['os_posix==1 and OS!="mac" and OS!="ios" and clang==0 and asan==0 and tsan==0 and msan==0', {
+ ['os_posix==1 and OS!="mac" and OS!="ios" and clang==0 and asan==0 and lsan==0 and tsan==0 and msan==0', {
'gcc_version%': '<!(python <(DEPTH)/build/compiler_version.py)',
}, {
'gcc_version%': 0,
@@ -1578,6 +1584,9 @@
# runtime is fully adopted. See http://crbug.com/242503.
'mac_strip_release': 0,
}],
+ ['lsan==1', {
+ 'clang%': 1,
+ }],
['tsan==1', {
'clang%': 1,
}],
@@ -3125,9 +3134,9 @@
'-fcolor-diagnostics',
],
}],
- # Common options for AddressSanitizer, ThreadSanitizer and
- # MemorySanitizer.
- ['asan==1 or tsan==1 or msan==1', {
+ # Common options for AddressSanitizer, LeakSanitizer,
+ # ThreadSanitizer and MemorySanitizer.
+ ['asan==1 or lsan==1 or tsan==1 or msan==1', {
'target_conditions': [
['_toolset=="target"', {
'cflags': [
@@ -3172,6 +3181,21 @@
}],
],
}],
+ ['lsan==1', {
+ 'target_conditions': [
+ ['_toolset=="target"', {
+ 'cflags': [
+ '-fsanitize=leak',
+ ],
+ 'ldflags': [
+ '-fsanitize=leak',
+ ],
Nico 2013/06/13 15:54:48 fyi: cflags and ldflags are linux-only (in case yo
+ 'defines': [
+ 'LEAK_SANITIZER',
+ ],
+ }],
+ ],
+ }],
['tsan==1', {
'target_conditions': [
['_toolset=="target"', {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698