| Index: build/common.gypi
|
| diff --git a/build/common.gypi b/build/common.gypi
|
| index 4b6cd7ea834a87dc543524cf1796af8b9f766d74..cac76adb44b7c246029cf8242ed60c1b5ac6e004 100644
|
| --- a/build/common.gypi
|
| +++ b/build/common.gypi
|
| @@ -253,6 +253,13 @@
|
| # See http://clang.llvm.org/docs/ThreadSanitizer.html
|
| 'tsan%': 0,
|
|
|
| + # Use a modified version of Clang to intercept allocated types and sizes
|
| + # for allocated objects. -fintercept-allocated-type only works with the
|
| + # modified clang, but clang_use_allocated_type=1 implies clang=1
|
| + # TODO(dmikurube): Add a link to a description page.
|
| + # TODO(dmikurube): Support mac with another AllocatedTypeMap store.
|
| + 'clang_use_allocated_type%': 0,
|
| +
|
| # Set to true to instrument the code with function call logger.
|
| # See src/third_party/cygprofile/cyg-profile.cc for details.
|
| 'order_profiling%': 0,
|
| @@ -588,6 +595,7 @@
|
| 'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)',
|
| 'asan%': '<(asan)',
|
| 'tsan%': '<(tsan)',
|
| + 'clang_use_allocated_type%': '<(clang_use_allocated_type)',
|
| 'order_profiling%': '<(order_profiling)',
|
| 'order_text_section%': '<(order_text_section)',
|
| 'enable_extensions%': '<(enable_extensions)',
|
| @@ -1191,6 +1199,12 @@
|
| 'clang%': 1,
|
| }],
|
|
|
| + ['clang_use_allocated_type==1', {
|
| + 'clang%': 1,
|
| + 'clang_use_chrome_plugins%': 0,
|
| + 'make_clang_dir%': 'third_party/llvm-allocated-type/Linux_x64',
|
| + }],
|
| +
|
| # On valgrind bots, override the optimizer settings so we don't inline too
|
| # much and make the stacks harder to figure out.
|
| #
|
| @@ -1596,6 +1610,31 @@
|
| }],
|
| ], # conditions for 'target_defaults'
|
| 'target_conditions': [
|
| + ['_type=="executable" or _type=="loadable_module"', {
|
| + 'target_conditions': [
|
| + # Some binaries doesn't use tcmalloc. We use empty interceptors
|
| + # for these binaries since the allocated type mapping is recorded
|
| + # in a tcmalloc-dependent data structure.
|
| + ['_target_name=="mksnapshot" or _target_name=="protoc" or _target_name=="ppGoogleNaClPluginChrome"', {
|
| + # Ignore allocated types.
|
| + 'conditions': [
|
| + ['clang_use_allocated_type==1', {
|
| + 'dependencies': [
|
| + '<!(realpath <(DEPTH)/base/allocator/allocator.gyp)' + ':allocated_type_ignore#target',
|
| + ]},
|
| + ],
|
| + ]}, {
|
| + # Store allocated types in TCMalloc's allocated_type_map (extended).
|
| + 'conditions': [
|
| + ['clang_use_allocated_type==1', {
|
| + 'dependencies': [
|
| + '<!(realpath <(DEPTH)/base/allocator/allocator.gyp)' + ':allocated_type_tcmalloc#target',
|
| + ]},
|
| + ],
|
| + ]},
|
| + ]
|
| + ]},
|
| + ],
|
| ['enable_wexit_time_destructors==1', {
|
| 'conditions': [
|
| [ 'clang==1', {
|
| @@ -2342,6 +2381,22 @@
|
| '-fcolor-diagnostics',
|
| ],
|
| }],
|
| + ['clang_use_allocated_type==1', {
|
| + 'cflags_cc!': ['-fno-rtti'],
|
| + 'cflags_cc+': ['-gline-tables-only'],
|
| + 'target_conditions': [
|
| + ['_target_name!="allocator" and _target_name!="allocator_extension_thunks" and _target_name!="libcmt" and _target_name!="allocator_extension_thunks_win64" and _target_name!="allocated_type_log" and _target_name!="allocated_type_ignore" and _target_name!="allocated_type_tcmalloc"', {
|
| + 'cflags_cc+': [
|
| + '-frtti',
|
| + '-fintercept-allocation-functions',
|
| + '-I../../base/allocator',
|
| + '-include',
|
| + 'allocated_type.h',
|
| + ],
|
| + }],
|
| + ],
|
| + 'defines': ['USE_ALLOCATED_TYPE'],
|
| + }],
|
| ['asan==1', {
|
| 'target_conditions': [
|
| ['_toolset=="target"', {
|
|
|