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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 # IMPORTANT: 5 # IMPORTANT:
6 # Please don't directly include this file if you are building via gyp_chromium, 6 # Please don't directly include this file if you are building via gyp_chromium,
7 # since gyp_chromium is automatically forcing its inclusion. 7 # since gyp_chromium is automatically forcing its inclusion.
8 { 8 {
9 # Variables expected to be overriden on the GYP command line (-D) or by 9 # Variables expected to be overriden on the GYP command line (-D) or by
10 # ~/.gyp/include.gypi. 10 # ~/.gyp/include.gypi.
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 # Run tools/clang/scripts/update.sh to make sure they are compiled. 272 # Run tools/clang/scripts/update.sh to make sure they are compiled.
273 # This causes 'clang_chrome_plugins_flags' to be set. 273 # This causes 'clang_chrome_plugins_flags' to be set.
274 # Has no effect if 'clang' is not set as well. 274 # Has no effect if 'clang' is not set as well.
275 'clang_use_chrome_plugins%': 1, 275 'clang_use_chrome_plugins%': 1,
276 276
277 # Enable building with ASAN (Clang's -fsanitize=address option). 277 # Enable building with ASAN (Clang's -fsanitize=address option).
278 # -fsanitize=address only works with clang, but asan=1 implies clang=1 278 # -fsanitize=address only works with clang, but asan=1 implies clang=1
279 # See https://sites.google.com/a/chromium.org/dev/developers/testing/addre sssanitizer 279 # See https://sites.google.com/a/chromium.org/dev/developers/testing/addre sssanitizer
280 'asan%': 0, 280 'asan%': 0,
281 281
282 # Enable building with LSan (Clang's -fsanitize=leak option).
283 # -fsanitize=leak only works with clang, but lsan=1 implies clang=1
284 # See https://sites.google.com/a/chromium.org/dev/developers/testing/leaks anitizer
285 'lsan%': 0,
286
282 # Enable building with TSAN (Clang's -fsanitize=thread option). 287 # Enable building with TSAN (Clang's -fsanitize=thread option).
283 # -fsanitize=thread only works with clang, but tsan=1 implies clang=1 288 # -fsanitize=thread only works with clang, but tsan=1 implies clang=1
284 # See http://clang.llvm.org/docs/ThreadSanitizer.html 289 # See http://clang.llvm.org/docs/ThreadSanitizer.html
285 'tsan%': 0, 290 'tsan%': 0,
286 'tsan_blacklist%': '<(PRODUCT_DIR)/../../tools/valgrind/tsan_v2/ignores.tx t', 291 'tsan_blacklist%': '<(PRODUCT_DIR)/../../tools/valgrind/tsan_v2/ignores.tx t',
287 292
288 # Enable building with MSAN (Clang's -fsanitize=memory option). 293 # Enable building with MSAN (Clang's -fsanitize=memory option).
289 # MemorySanitizer only works with clang, but msan=1 implies clang=1 294 # MemorySanitizer only works with clang, but msan=1 implies clang=1
290 # See http://clang.llvm.org/docs/MemorySanitizer.html 295 # See http://clang.llvm.org/docs/MemorySanitizer.html
291 'msan%': 0, 296 'msan%': 0,
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
770 'enable_one_click_signin%': '<(enable_one_click_signin)', 775 'enable_one_click_signin%': '<(enable_one_click_signin)',
771 'enable_webrtc%': '<(enable_webrtc)', 776 'enable_webrtc%': '<(enable_webrtc)',
772 'chromium_win_pch%': '<(chromium_win_pch)', 777 'chromium_win_pch%': '<(chromium_win_pch)',
773 'configuration_policy%': '<(configuration_policy)', 778 'configuration_policy%': '<(configuration_policy)',
774 'safe_browsing%': '<(safe_browsing)', 779 'safe_browsing%': '<(safe_browsing)',
775 'input_speech%': '<(input_speech)', 780 'input_speech%': '<(input_speech)',
776 'notifications%': '<(notifications)', 781 'notifications%': '<(notifications)',
777 'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)', 782 'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)',
778 'mac_want_real_dsym%': '<(mac_want_real_dsym)', 783 'mac_want_real_dsym%': '<(mac_want_real_dsym)',
779 'asan%': '<(asan)', 784 'asan%': '<(asan)',
785 'lsan%': '<(lsan)',
780 'msan%': '<(msan)', 786 'msan%': '<(msan)',
781 'tsan%': '<(tsan)', 787 'tsan%': '<(tsan)',
782 'tsan_blacklist%': '<(tsan_blacklist)', 788 'tsan_blacklist%': '<(tsan_blacklist)',
783 'clang_type_profiler%': '<(clang_type_profiler)', 789 'clang_type_profiler%': '<(clang_type_profiler)',
784 'order_profiling%': '<(order_profiling)', 790 'order_profiling%': '<(order_profiling)',
785 'order_text_section%': '<(order_text_section)', 791 'order_text_section%': '<(order_text_section)',
786 'enable_extensions%': '<(enable_extensions)', 792 'enable_extensions%': '<(enable_extensions)',
787 'enable_plugin_installation%': '<(enable_plugin_installation)', 793 'enable_plugin_installation%': '<(enable_plugin_installation)',
788 'enable_plugins%': '<(enable_plugins)', 794 'enable_plugins%': '<(enable_plugins)',
789 'enable_session_service%': '<(enable_session_service)', 795 'enable_session_service%': '<(enable_session_service)',
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
1083 1089
1084 # MDNS is disabled by default. 1090 # MDNS is disabled by default.
1085 'enable_mdns%' : 0, 1091 'enable_mdns%' : 0,
1086 1092
1087 'conditions': [ 1093 'conditions': [
1088 # The version of GCC in use, set later in platforms that use GCC and have 1094 # The version of GCC in use, set later in platforms that use GCC and have
1089 # not explicitly chosen to build with clang. Currently, this means all 1095 # not explicitly chosen to build with clang. Currently, this means all
1090 # platforms except Windows, Mac and iOS. 1096 # platforms except Windows, Mac and iOS.
1091 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so that 1097 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so that
1092 # it takes effect here. 1098 # it takes effect here.
1093 ['os_posix==1 and OS!="mac" and OS!="ios" and clang==0 and asan==0 and tsa n==0 and msan==0', { 1099 ['os_posix==1 and OS!="mac" and OS!="ios" and clang==0 and asan==0 and lsa n==0 and tsan==0 and msan==0', {
1094 'gcc_version%': '<!(python <(DEPTH)/build/compiler_version.py)', 1100 'gcc_version%': '<!(python <(DEPTH)/build/compiler_version.py)',
1095 }, { 1101 }, {
1096 'gcc_version%': 0, 1102 'gcc_version%': 0,
1097 }], 1103 }],
1098 ['OS=="win" and "<!(python <(DEPTH)/build/dir_exists.py <(windows_sdk_defa ult_path))"=="True"', { 1104 ['OS=="win" and "<!(python <(DEPTH)/build/dir_exists.py <(windows_sdk_defa ult_path))"=="True"', {
1099 'windows_sdk_path%': '<(windows_sdk_default_path)', 1105 'windows_sdk_path%': '<(windows_sdk_default_path)',
1100 }, { 1106 }, {
1101 'windows_sdk_path%': 'C:/Program Files (x86)/Windows Kits/8.0', 1107 'windows_sdk_path%': 'C:/Program Files (x86)/Windows Kits/8.0',
1102 }], 1108 }],
1103 ['OS=="win" and "<!(python <(DEPTH)/build/dir_exists.py <(directx_sdk_defa ult_path))"=="True"', { 1109 ['OS=="win" and "<!(python <(DEPTH)/build/dir_exists.py <(directx_sdk_defa ult_path))"=="True"', {
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
1571 }], 1577 }],
1572 1578
1573 ['asan==1 and OS!="win"', { 1579 ['asan==1 and OS!="win"', {
1574 'clang%': 1, 1580 'clang%': 1,
1575 }], 1581 }],
1576 ['asan==1 and OS=="mac"', { 1582 ['asan==1 and OS=="mac"', {
1577 # TODO(glider): we do not strip ASan binaries until the dynamic ASan 1583 # TODO(glider): we do not strip ASan binaries until the dynamic ASan
1578 # runtime is fully adopted. See http://crbug.com/242503. 1584 # runtime is fully adopted. See http://crbug.com/242503.
1579 'mac_strip_release': 0, 1585 'mac_strip_release': 0,
1580 }], 1586 }],
1587 ['lsan==1', {
1588 'clang%': 1,
1589 }],
1581 ['tsan==1', { 1590 ['tsan==1', {
1582 'clang%': 1, 1591 'clang%': 1,
1583 }], 1592 }],
1584 ['msan==1', { 1593 ['msan==1', {
1585 'clang%': 1, 1594 'clang%': 1,
1586 }], 1595 }],
1587 1596
1588 ['OS=="linux" and clang_type_profiler==1', { 1597 ['OS=="linux" and clang_type_profiler==1', {
1589 'clang%': 1, 1598 'clang%': 1,
1590 'clang_use_chrome_plugins%': 0, 1599 'clang_use_chrome_plugins%': 0,
(...skipping 1527 matching lines...) Expand 10 before | Expand all | Expand 10 after
3118 # see llvm.org/PR15798 / crbug.com/233709 3127 # see llvm.org/PR15798 / crbug.com/233709
3119 '-momit-leaf-frame-pointer', 3128 '-momit-leaf-frame-pointer',
3120 ], 3129 ],
3121 }], 3130 }],
3122 ['clang==1 and "<(GENERATOR)"=="ninja"', { 3131 ['clang==1 and "<(GENERATOR)"=="ninja"', {
3123 'cflags': [ 3132 'cflags': [
3124 # See http://crbug.com/110262 3133 # See http://crbug.com/110262
3125 '-fcolor-diagnostics', 3134 '-fcolor-diagnostics',
3126 ], 3135 ],
3127 }], 3136 }],
3128 # Common options for AddressSanitizer, ThreadSanitizer and 3137 # Common options for AddressSanitizer, LeakSanitizer,
3129 # MemorySanitizer. 3138 # ThreadSanitizer and MemorySanitizer.
3130 ['asan==1 or tsan==1 or msan==1', { 3139 ['asan==1 or lsan==1 or tsan==1 or msan==1', {
3131 'target_conditions': [ 3140 'target_conditions': [
3132 ['_toolset=="target"', { 3141 ['_toolset=="target"', {
3133 'cflags': [ 3142 'cflags': [
3134 '-fno-omit-frame-pointer', 3143 '-fno-omit-frame-pointer',
3135 '-gline-tables-only', 3144 '-gline-tables-only',
3136 ], 3145 ],
3137 'ldflags!': [ 3146 'ldflags!': [
3138 # Functions interposed by the sanitizers can make ld think 3147 # Functions interposed by the sanitizers can make ld think
3139 # that some libraries aren't needed when they actually are, 3148 # that some libraries aren't needed when they actually are,
3140 # http://crbug.com/234010. As workaround, disable --as-needed. 3149 # http://crbug.com/234010. As workaround, disable --as-needed.
(...skipping 24 matching lines...) Expand all
3165 }], 3174 }],
3166 ], 3175 ],
3167 'conditions': [ 3176 'conditions': [
3168 ['OS=="mac"', { 3177 ['OS=="mac"', {
3169 'cflags': [ 3178 'cflags': [
3170 '-mllvm -asan-globals=0', # http://crbug.com/196561 3179 '-mllvm -asan-globals=0', # http://crbug.com/196561
3171 ], 3180 ],
3172 }], 3181 }],
3173 ], 3182 ],
3174 }], 3183 }],
3184 ['lsan==1', {
3185 'target_conditions': [
3186 ['_toolset=="target"', {
3187 'cflags': [
3188 '-fsanitize=leak',
3189 ],
3190 'ldflags': [
3191 '-fsanitize=leak',
3192 ],
Nico 2013/06/13 15:54:48 fyi: cflags and ldflags are linux-only (in case yo
3193 'defines': [
3194 'LEAK_SANITIZER',
3195 ],
3196 }],
3197 ],
3198 }],
3175 ['tsan==1', { 3199 ['tsan==1', {
3176 'target_conditions': [ 3200 'target_conditions': [
3177 ['_toolset=="target"', { 3201 ['_toolset=="target"', {
3178 'cflags': [ 3202 'cflags': [
3179 '-fsanitize=thread', 3203 '-fsanitize=thread',
3180 '-fPIC', 3204 '-fPIC',
3181 '-mllvm', '-tsan-blacklist=<(tsan_blacklist)', 3205 '-mllvm', '-tsan-blacklist=<(tsan_blacklist)',
3182 ], 3206 ],
3183 'ldflags': [ 3207 'ldflags': [
3184 '-fsanitize=thread', 3208 '-fsanitize=thread',
(...skipping 1337 matching lines...) Expand 10 before | Expand all | Expand 10 after
4522 # settings in target dicts. SYMROOT is a special case, because many other 4546 # settings in target dicts. SYMROOT is a special case, because many other
4523 # Xcode variables depend on it, including variables such as 4547 # Xcode variables depend on it, including variables such as
4524 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something 4548 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
4525 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the 4549 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
4526 # files to appear (when present) in the UI as actual files and not red 4550 # files to appear (when present) in the UI as actual files and not red
4527 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR, 4551 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
4528 # and therefore SYMROOT, needs to be set at the project level. 4552 # and therefore SYMROOT, needs to be set at the project level.
4529 'SYMROOT': '<(DEPTH)/xcodebuild', 4553 'SYMROOT': '<(DEPTH)/xcodebuild',
4530 }, 4554 },
4531 } 4555 }
OLDNEW
« 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