Index: build/common.gypi |
diff --git a/build/common.gypi b/build/common.gypi |
index 9eb94f3b62828aa0d7dc85ee997c64c58eb56e2f..d6bed70263920b41de50d434d16ee3f0c7068330 100644 |
--- a/build/common.gypi |
+++ b/build/common.gypi |
@@ -180,6 +180,10 @@ |
# Has no effect if 'clang' is not set as well. |
'clang_use_chrome_plugins%': 0, |
+ # Enable building with ASAN. |
+ # 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, |
@@ -297,6 +301,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)', |
'use_wayland%': '<(use_wayland)', |
@@ -668,6 +673,10 @@ |
['enable_register_protocol_handler==1', { |
'grit_defines': ['-D', 'enable_register_protocol_handler'], |
}], |
+ |
+ ['asan==1', { |
+ 'clang%': 1, |
+ }], |
], |
}, |
'target_defaults': { |
@@ -1511,6 +1520,11 @@ |
], |
}]], |
}], |
+ ['asan==1', { |
+ 'cflags': [ |
Nico
2011/08/10 18:48:17
Is this required for ldflags as well? aarya was se
glotov
2011/08/12 20:13:05
Yes, ldflags were added. ldl flag is passed by ASA
|
+ '-fasan', |
Nico
2011/08/10 18:15:20
Add a comment above this line "-fasan only works w
glotov
2011/08/12 20:13:05
Done.
|
+ ], |
+ }], |
['no_strict_aliasing==1', { |
'cflags': [ |
'-fno-strict-aliasing', |