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

Unified Diff: build/common.gypi

Issue 7541045: Adding GYP_DEFINES=ASAN to enable ASAN build (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comment added Created 9 years, 4 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 a79a8a07b908ef73bbeb7b1a0de8e5d3d3e5ac32..ee0334ba9194fca62a0445ff6370e4aee05c8b08 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -181,6 +181,11 @@
# Has no effect if 'clang' is not set as well.
'clang_use_chrome_plugins%': 0,
+ # Enable building with ASAN (Clang's -fasan option).
+ # -fasan only works with clang, but asan=1 implies clang=1
+ # See https://sites.google.com/a/chromium.org/dev/developers/testing/addresssanitizer
+ 'asan%': 0,
+
# Set to 1 compile with -fPIC cflag on linux. This is a must for shared
# libraries on linux x86-64 and arm, plus ASLR.
'linux_fpic%': 1,
@@ -306,6 +311,7 @@
'configuration_policy%': '<(configuration_policy)',
'safe_browsing%': '<(safe_browsing)',
'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)',
+ 'asan%': '<(asan)',
'enable_register_protocol_handler%': '<(enable_register_protocol_handler)',
'enable_smooth_scrolling%': '<(enable_smooth_scrolling)',
# Whether to build for Wayland display server
@@ -690,6 +696,10 @@
['enable_register_protocol_handler==1', {
'grit_defines': ['-D', 'enable_register_protocol_handler'],
}],
+
+ ['asan==1', {
+ 'clang%': 1,
+ }],
],
},
'target_defaults': {
@@ -1543,6 +1553,16 @@
'-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
],
}],
+ ['asan==1', {
+ # Only in the linux section for now, since ASAN doesn't
+ # work on Mac yet.
+ 'cflags': [
+ '-fasan -w',
+ ],
+ 'ldflags': [
+ '-fasan',
+ ],
+ }],
['no_strict_aliasing==1', {
'cflags': [
'-fno-strict-aliasing',
« 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