Chromium Code Reviews| Index: base/allocator/allocator.gyp |
| diff --git a/base/allocator/allocator.gyp b/base/allocator/allocator.gyp |
| index ae93e9e03ca902fb8a10e66e1c2230f47a7d8ae7..174394bc56046ad9fb769f2d72f4cd304caff0d3 100644 |
| --- a/base/allocator/allocator.gyp |
| +++ b/base/allocator/allocator.gyp |
| @@ -24,69 +24,73 @@ |
| { |
| 'target_name': 'allocator', |
| 'type': 'static_library', |
|
Nico
2015/12/02 21:32:21
Maybe this should be type none by default and only
Primiano Tucci (use gerrit)
2015/12/03 10:00:55
OK, if you agree let's do this. I'm putting a TODO
|
| - 'direct_dependent_settings': { |
| - 'configurations': { |
| - 'Common_Base': { |
| - 'msvs_settings': { |
| - 'VCLinkerTool': { |
| - 'IgnoreDefaultLibraryNames': ['libcmtd.lib', 'libcmt.lib'], |
| - 'AdditionalDependencies': [ |
| - '<(SHARED_INTERMEDIATE_DIR)/allocator/libcmt.lib' |
| - ], |
| + 'conditions': [ |
| + #################################################################### |
| + # WINDOWS SHIM LAYER |
| + #################################################################### |
|
Nico
2015/12/02 21:32:21
##################################################
Primiano Tucci (use gerrit)
2015/12/03 10:00:55
Ok, ok, agree. this was mostly driven my yesterday
|
| + ['OS=="win" and win_use_allocator_shim==1', { |
| + 'msvs_settings': { |
| + # TODO(sgk): merge this with build/common.gypi settings |
| + 'VCLibrarianTool': { |
| + 'AdditionalOptions': ['/ignore:4006,4221'], |
| + }, |
| + 'VCLinkerTool': { |
| + 'AdditionalOptions': ['/ignore:4006'], |
| + }, |
| + }, |
| + 'dependencies': [ |
| + 'libcmt', |
| + ], |
| + 'include_dirs': [ |
| + '../..', |
| + ], |
| + 'sources': [ |
| + 'allocator_shim_win.cc', |
| + ], |
| + 'configurations': { |
| + 'Debug_Base': { |
| + 'msvs_settings': { |
| + 'VCCLCompilerTool': { |
| + 'RuntimeLibrary': '0', |
| + }, |
| }, |
| }, |
| }, |
| - }, |
| - 'conditions': [ |
| - ['OS=="win"', { |
| + 'direct_dependent_settings': { |
| + 'configurations': { |
| + 'Common_Base': { |
| + 'msvs_settings': { |
| + 'VCLinkerTool': { |
| + 'IgnoreDefaultLibraryNames': ['libcmtd.lib', 'libcmt.lib'], |
| + 'AdditionalDependencies': [ |
| + '<(SHARED_INTERMEDIATE_DIR)/allocator/libcmt.lib' |
| + ], |
| + }, |
| + }, |
| + }, |
| + }, |
| 'defines': [ |
| 'PERFTOOLS_DLL_DECL=', |
| ], |
| - }], |
| - ], |
| - }, |
| - 'dependencies': [ |
| - '../third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations', |
| - ], |
| - 'msvs_settings': { |
| - # TODO(sgk): merge this with build/common.gypi settings |
| - 'VCLibrarianTool': { |
| - 'AdditionalOptions': ['/ignore:4006,4221'], |
| - }, |
| - 'VCLinkerTool': { |
| - 'AdditionalOptions': ['/ignore:4006'], |
| - }, |
| - }, |
| - 'configurations': { |
| - 'Debug_Base': { |
| - 'msvs_settings': { |
| - 'VCCLCompilerTool': { |
| - 'RuntimeLibrary': '0', |
| - }, |
| }, |
| - 'variables': { |
| - # Provide a way to force disable debugallocation in Debug builds, |
| - # e.g. for profiling (it's more rare to profile Debug builds, |
| - # but people sometimes need to do that). |
| - 'disable_debugallocation%': 0, |
| - }, |
| - 'conditions': [ |
| - ['disable_debugallocation==0', { |
| - 'defines': [ |
| - # Use debugallocation for Debug builds to catch problems early |
| - # and cleanly, http://crbug.com/30715 . |
| - 'TCMALLOC_FOR_DEBUGALLOCATION', |
| - ], |
| - }], |
| - ], |
| - }, |
| - }, |
| - 'conditions': [ |
| - ['use_allocator=="tcmalloc"', { |
| + }], # OS=="win" |
| + #################################################################### |
| + # TCMALLOC |
| + #################################################################### |
| + # TODO(primiano): remove the per-os conditionals one common.gypi is |
|
Nico
2015/12/02 21:32:21
s/one/once
Primiano Tucci (use gerrit)
2015/12/03 10:00:55
Done.
|
| + # fixed (i.e. mac stops saying use_allocator=tcmalloc). One should be |
| + # able to say use_allocator=tcmalloc on Mac and as a result this should |
| + # at least try to build it, not silently ignore that. |
| + ['use_allocator=="tcmalloc" and os_posix==1 and OS!="mac" and OS!="ios"', { |
| # Disable the heap checker in tcmalloc. |
| 'defines': [ |
| 'NO_HEAP_CHECK', |
| ], |
| + 'dependencies': [ |
| + '../third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations', |
| + ], |
| + # The order of this include_dirs matters, as tc-malloc has its own |
| + # base/ mini-fork. Do not factor these out in the allocator target. |
|
Nico
2015/12/02 21:32:21
I'm not sure what the second sentence means. We ar
Primiano Tucci (use gerrit)
2015/12/03 10:00:55
Reworded. What I mean here is that it would be tem
|
| 'include_dirs': [ |
| '.', |
| '<(tcmalloc_dir)/src/base', |
| @@ -287,59 +291,72 @@ |
| # Included by debugallocation_shim.cc. |
| '<(tcmalloc_dir)/src/debugallocation.cc', |
| '<(tcmalloc_dir)/src/tcmalloc.cc', |
| - ] |
| - },{ |
| - 'include_dirs': [ |
| - '.', |
| - '../..', |
| - ], |
| - }], |
| - ['OS=="win" and component!="shared_library"', { |
| - 'dependencies': [ |
| - 'libcmt', |
|
Nico
2015/12/02 21:32:21
where did this go?
Primiano Tucci (use gerrit)
2015/12/03 10:00:55
On line 42.
You could argue: "wait but !shared_lib
|
| - ], |
| - 'sources': [ |
| - 'allocator_shim_win.cc', |
| - ], |
| - }], |
| - ['profiling!=1', { |
| - 'sources!': [ |
| - # cpuprofiler |
| - '<(tcmalloc_dir)/src/base/thread_lister.c', |
| - '<(tcmalloc_dir)/src/base/thread_lister.h', |
| - '<(tcmalloc_dir)/src/profile-handler.cc', |
| - '<(tcmalloc_dir)/src/profile-handler.h', |
| - '<(tcmalloc_dir)/src/profiledata.cc', |
| - '<(tcmalloc_dir)/src/profiledata.h', |
| - '<(tcmalloc_dir)/src/profiler.cc', |
| - ], |
| - }], |
| - ['OS=="linux" or OS=="freebsd" or OS=="solaris" or OS=="android"', { |
| - 'sources!': [ |
| - '<(tcmalloc_dir)/src/system-alloc.h', |
| ], |
| - # We enable all warnings by default, but upstream disables a few. |
| - # Keep "-Wno-*" flags in sync with upstream by comparing against: |
| - # http://code.google.com/p/google-perftools/source/browse/trunk/Makefile.am |
| - 'cflags': [ |
| - '-Wno-sign-compare', |
| - '-Wno-unused-result', |
| - ], |
| - 'cflags!': [ |
| - '-fvisibility=hidden', |
| + 'conditions': [ |
| + ['OS=="linux" or OS=="freebsd" or OS=="solaris" or OS=="android"', { |
| + 'sources!': [ |
| + '<(tcmalloc_dir)/src/system-alloc.h', |
| + ], |
| + # We enable all warnings by default, but upstream disables a few. |
| + # Keep "-Wno-*" flags in sync with upstream by comparing against: |
| + # http://code.google.com/p/google-perftools/source/browse/trunk/Makefile.am |
| + 'cflags': [ |
| + '-Wno-sign-compare', |
| + '-Wno-unused-result', |
| + ], |
| + 'cflags!': [ |
| + '-fvisibility=hidden', |
| + ], |
| + 'link_settings': { |
| + 'ldflags': [ |
| + # Don't let linker rip this symbol out, otherwise the heap&cpu |
| + # profilers will not initialize properly on startup. |
| + '-Wl,-uIsHeapProfilerRunning,-uProfilerStart', |
| + # Do the same for heap leak checker. |
| + '-Wl,-u_Z21InitialMallocHook_NewPKvj,-u_Z22InitialMallocHook_MMapPKvS0_jiiix,-u_Z22InitialMallocHook_SbrkPKvi', |
| + '-Wl,-u_Z21InitialMallocHook_NewPKvm,-u_Z22InitialMallocHook_MMapPKvS0_miiil,-u_Z22InitialMallocHook_SbrkPKvl', |
| + '-Wl,-u_ZN15HeapLeakChecker12IgnoreObjectEPKv,-u_ZN15HeapLeakChecker14UnIgnoreObjectEPKv', |
| + ], |
| + }, |
| + }], |
| + ['profiling!=1', { |
| + 'sources!': [ |
| + # cpuprofiler |
| + '<(tcmalloc_dir)/src/base/thread_lister.c', |
| + '<(tcmalloc_dir)/src/base/thread_lister.h', |
| + '<(tcmalloc_dir)/src/profile-handler.cc', |
| + '<(tcmalloc_dir)/src/profile-handler.h', |
| + '<(tcmalloc_dir)/src/profiledata.cc', |
| + '<(tcmalloc_dir)/src/profiledata.h', |
| + '<(tcmalloc_dir)/src/profiler.cc', |
| + ], |
| + }], |
| ], |
| - 'link_settings': { |
| - 'ldflags': [ |
| - # Don't let linker rip this symbol out, otherwise the heap&cpu |
| - # profilers will not initialize properly on startup. |
| - '-Wl,-uIsHeapProfilerRunning,-uProfilerStart', |
| - # Do the same for heap leak checker. |
| - '-Wl,-u_Z21InitialMallocHook_NewPKvj,-u_Z22InitialMallocHook_MMapPKvS0_jiiix,-u_Z22InitialMallocHook_SbrkPKvi', |
| - '-Wl,-u_Z21InitialMallocHook_NewPKvm,-u_Z22InitialMallocHook_MMapPKvS0_miiil,-u_Z22InitialMallocHook_SbrkPKvl', |
| - '-Wl,-u_ZN15HeapLeakChecker12IgnoreObjectEPKv,-u_ZN15HeapLeakChecker14UnIgnoreObjectEPKv', |
| - ]}, |
| - }], |
| - [ 'use_vtable_verify==1', { |
| + 'configurations': { |
| + 'Debug_Base': { |
| + 'variables': { |
| + # Provide a way to force disable debugallocation in Debug builds |
| + # e.g. for profiling (it's more rare to profile Debug builds, |
| + # but people sometimes need to do that). |
| + 'disable_debugallocation%': 0, |
|
Nico
2015/12/02 21:32:21
moving this into a configuration subtly changes be
Primiano Tucci (use gerrit)
2015/12/03 10:00:55
I can move it to the variables on top, but I think
|
| + }, |
| + 'conditions': [ |
| + ['disable_debugallocation==0', { |
| + 'defines': [ |
| + # Use debugallocation for Debug builds to catch problems |
| + # early and cleanly, http://crbug.com/30715 . |
| + 'TCMALLOC_FOR_DEBUGALLOCATION', |
| + ], |
| + }], |
| + ], |
| + }, |
| + }, |
| + }], # use_allocator=="tcmalloc |
| + # For CrOS builds with vtable verification. According to the author of |
| + # crrev.com/10854031 this is used in conjuction with some other CrOS |
| + # build flag, to enable verification of any allocator that uses virtual |
| + # function calls. |
| + ['use_vtable_verify==1', { |
| 'cflags': [ |
| '-fvtable-verify=preinit', |
| ], |
| @@ -351,8 +368,8 @@ |
| }], |
| ], |
| }], |
| - ], |
| - }, |
| + ], # condditions of 'allocator' target. |
|
Nico
2015/12/02 21:32:21
s/condditions/conditions
Primiano Tucci (use gerrit)
2015/12/03 10:00:55
Done.
|
| + }, # 'allocator' target. |
| { |
| # This library is linked in to src/base.gypi:base and allocator_unittests |
| # It can't depend on either and nothing else should depend on it - all |