diff options
author | glider@chromium.org <glider@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-25 10:34:35 +0000 |
---|---|---|
committer | glider@chromium.org <glider@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-25 10:34:35 +0000 |
commit | 921c7b571ab4682edfabccfc0dfba08207265432 (patch) | |
tree | e1366aa83202f894c511e7501f1ff904c04bfe5f /build | |
parent | 45522dc30962318d078f363ed71cb7da6809fd22 (diff) | |
download | chromium_src-921c7b571ab4682edfabccfc0dfba08207265432.zip chromium_src-921c7b571ab4682edfabccfc0dfba08207265432.tar.gz chromium_src-921c7b571ab4682edfabccfc0dfba08207265432.tar.bz2 |
ASan Mac + cleanup:
-- move the compiler/linker options turned on by asan==1 to the conditions section to use them for host binaries too;
-- use 'defines' instead of -D on Linux
-- removed an obsolete comment
Review URL: http://codereview.chromium.org/8702003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111583 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build')
-rw-r--r-- | build/common.gypi | 59 |
1 files changed, 31 insertions, 28 deletions
diff --git a/build/common.gypi b/build/common.gypi index a1bfddb..e5f3af4 100644 --- a/build/common.gypi +++ b/build/common.gypi @@ -1921,20 +1921,20 @@ ], }], ['asan==1', { - # Only in the linux section for now, since ASAN doesn't - # work on Mac yet. # TODO(glider): -fasan is deprecated. Remove it when we stop using # it. 'cflags': [ '-fasan', '-faddress-sanitizer', '-w', - '-DADDRESS_SANITIZER', ], 'ldflags': [ '-fasan', '-faddress-sanitizer', ], + 'defines': [ + 'ADDRESS_SANITIZER', + ], }], ['no_strict_aliasing==1', { 'cflags': [ @@ -2278,6 +2278,34 @@ 'clang_dir': '../third_party/llvm-build/Release+Asserts/bin', }, }], + ['asan==1', { + 'xcode_settings': { + 'OTHER_CFLAGS': [ + '-fasan', + '-faddress-sanitizer', + '-w', + ], + 'OTHER_LDFLAGS': [ + '-fasan', + '-faddress-sanitizer', + # The symbols below are referenced in the ASan runtime + # library (compiled on OS X 10.6), but may be unavailable + # on the prior OS X versions. Because Chromium is currently + # targeting 10.5.0, we need to explicitly mark these + # symbols as dynamic_lookup. + '-Wl,-U,_malloc_default_purgeable_zone', + '-Wl,-U,_malloc_zone_memalign', + '-Wl,-U,_dispatch_sync_f', + '-Wl,-U,_dispatch_async_f', + '-Wl,-U,_dispatch_barrier_async_f', + '-Wl,-U,_dispatch_group_async_f', + '-Wl,-U,_dispatch_after_f', + ], + }, + 'defines': [ + 'ADDRESS_SANITIZER', + ], + }], ], 'target_conditions': [ ['_type!="static_library"', { @@ -2328,32 +2356,7 @@ }, 'xcode_settings': { 'CHROMIUM_STRIP_SAVE_FILE': '<(asan_saves_file)', - 'OTHER_CFLAGS': [ - '-fasan', - '-faddress-sanitizer', - '-w', - ], - 'OTHER_LDFLAGS': [ - '-fasan', - '-faddress-sanitizer', - # The symbols below are referenced in the ASan runtime - # library (compiled on OS X 10.6), but may be unavailable - # on the prior OS X versions. Because Chromium is currently - # targeting 10.5.0, we need to explicitly mark these - # symbols as dynamic_lookup. - '-Wl,-U,_malloc_default_purgeable_zone', - '-Wl,-U,_malloc_zone_memalign', - '-Wl,-U,_dispatch_sync_f', - '-Wl,-U,_dispatch_async_f', - '-Wl,-U,_dispatch_barrier_async_f', - '-Wl,-U,_dispatch_group_async_f', - '-Wl,-U,_dispatch_after_f', - - ], }, - 'defines': [ - 'ADDRESS_SANITIZER', - ], }], ], 'target_conditions': [ |