| OLD | NEW |
| (Empty) |
| 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 | |
| 3 # found in the LICENSE file. | |
| 4 | |
| 5 { | |
| 6 'target_defaults': { | |
| 7 'variables': { | |
| 8 # This code gets run a lot and debugged rarely, so it should be fast | |
| 9 # by default. See http://crbug.com/388949. | |
| 10 'debug_optimize': '2', | |
| 11 'win_debug_Optimization': '0', | |
| 12 # Run time checks are incompatible with any level of optimizations. | |
| 13 'win_debug_RuntimeChecks': '0', | |
| 14 }, | |
| 15 }, | |
| 16 'variables': { | |
| 17 'tcmalloc_dir': '../../third_party/tcmalloc/chromium', | |
| 18 'use_vtable_verify%': 0, | |
| 19 # Provide a way to force disable debugallocation in Debug builds | |
| 20 # e.g. for profiling (it's more rare to profile Debug builds, | |
| 21 # but people sometimes need to do that). | |
| 22 'disable_debugallocation%': 0, | |
| 23 }, | |
| 24 'targets': [ | |
| 25 # The only targets that should depend on allocator are 'base' and | |
| 26 # executables that don't depend, directly or indirectly, on base (a few). | |
| 27 # All the other targets get a transitive dependency on this target via base. | |
| 28 { | |
| 29 'target_name': 'allocator', | |
| 30 'variables': { | |
| 31 'conditions': [ | |
| 32 ['use_allocator!="none" or (OS=="win" and win_use_allocator_shim==1)',
{ | |
| 33 'allocator_target_type%': 'static_library', | |
| 34 }, { | |
| 35 'allocator_target_type%': 'none', | |
| 36 }], | |
| 37 ], | |
| 38 }, | |
| 39 'type': '<(allocator_target_type)', | |
| 40 'toolsets': ['host', 'target'], | |
| 41 'conditions': [ | |
| 42 ['OS=="win" and win_use_allocator_shim==1', { | |
| 43 'msvs_settings': { | |
| 44 # TODO(sgk): merge this with build/common.gypi settings | |
| 45 'VCLibrarianTool': { | |
| 46 'AdditionalOptions': ['/ignore:4006,4221'], | |
| 47 }, | |
| 48 'VCLinkerTool': { | |
| 49 'AdditionalOptions': ['/ignore:4006'], | |
| 50 }, | |
| 51 }, | |
| 52 'include_dirs': [ | |
| 53 '../..', | |
| 54 ], | |
| 55 'sources': [ | |
| 56 'allocator_shim_win.cc', | |
| 57 'allocator_shim_win.h', | |
| 58 'winheap_stubs_win.cc', | |
| 59 'winheap_stubs_win.h', | |
| 60 ], | |
| 61 'configurations': { | |
| 62 'Debug_Base': { | |
| 63 'msvs_settings': { | |
| 64 'VCCLCompilerTool': { | |
| 65 'RuntimeLibrary': '0', | |
| 66 }, | |
| 67 }, | |
| 68 }, | |
| 69 }, | |
| 70 }], # OS=="win" | |
| 71 ['use_allocator=="tcmalloc"', { | |
| 72 # Disable the heap checker in tcmalloc. | |
| 73 'defines': [ | |
| 74 'NO_HEAP_CHECK', | |
| 75 ], | |
| 76 'dependencies': [ | |
| 77 '../third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_
annotations', | |
| 78 ], | |
| 79 # The order of this include_dirs matters, as tc-malloc has its own | |
| 80 # base/ mini-fork. Do not factor these out of this conditions section. | |
| 81 'include_dirs': [ | |
| 82 '.', | |
| 83 '<(tcmalloc_dir)/src/base', | |
| 84 '<(tcmalloc_dir)/src', | |
| 85 '../..', | |
| 86 ], | |
| 87 'sources': [ | |
| 88 # Generated for our configuration from tcmalloc's build | |
| 89 # and checked in. | |
| 90 '<(tcmalloc_dir)/src/config.h', | |
| 91 '<(tcmalloc_dir)/src/config_android.h', | |
| 92 '<(tcmalloc_dir)/src/config_linux.h', | |
| 93 '<(tcmalloc_dir)/src/config_win.h', | |
| 94 | |
| 95 # all tcmalloc native and forked files | |
| 96 '<(tcmalloc_dir)/src/addressmap-inl.h', | |
| 97 '<(tcmalloc_dir)/src/base/abort.cc', | |
| 98 '<(tcmalloc_dir)/src/base/abort.h', | |
| 99 '<(tcmalloc_dir)/src/base/arm_instruction_set_select.h', | |
| 100 '<(tcmalloc_dir)/src/base/atomicops-internals-arm-generic.h', | |
| 101 '<(tcmalloc_dir)/src/base/atomicops-internals-arm-v6plus.h', | |
| 102 '<(tcmalloc_dir)/src/base/atomicops-internals-linuxppc.h', | |
| 103 '<(tcmalloc_dir)/src/base/atomicops-internals-macosx.h', | |
| 104 '<(tcmalloc_dir)/src/base/atomicops-internals-windows.h', | |
| 105 '<(tcmalloc_dir)/src/base/atomicops-internals-x86.cc', | |
| 106 '<(tcmalloc_dir)/src/base/atomicops-internals-x86.h', | |
| 107 '<(tcmalloc_dir)/src/base/atomicops.h', | |
| 108 '<(tcmalloc_dir)/src/base/commandlineflags.h', | |
| 109 '<(tcmalloc_dir)/src/base/cycleclock.h', | |
| 110 # We don't list dynamic_annotations.c since its copy is already | |
| 111 # present in the dynamic_annotations target. | |
| 112 '<(tcmalloc_dir)/src/base/dynamic_annotations.h', | |
| 113 '<(tcmalloc_dir)/src/base/elf_mem_image.cc', | |
| 114 '<(tcmalloc_dir)/src/base/elf_mem_image.h', | |
| 115 '<(tcmalloc_dir)/src/base/elfcore.h', | |
| 116 '<(tcmalloc_dir)/src/base/googleinit.h', | |
| 117 '<(tcmalloc_dir)/src/base/linux_syscall_support.h', | |
| 118 '<(tcmalloc_dir)/src/base/linuxthreads.cc', | |
| 119 '<(tcmalloc_dir)/src/base/linuxthreads.h', | |
| 120 '<(tcmalloc_dir)/src/base/logging.cc', | |
| 121 '<(tcmalloc_dir)/src/base/logging.h', | |
| 122 '<(tcmalloc_dir)/src/base/low_level_alloc.cc', | |
| 123 '<(tcmalloc_dir)/src/base/low_level_alloc.h', | |
| 124 '<(tcmalloc_dir)/src/base/simple_mutex.h', | |
| 125 '<(tcmalloc_dir)/src/base/spinlock.cc', | |
| 126 '<(tcmalloc_dir)/src/base/spinlock.h', | |
| 127 '<(tcmalloc_dir)/src/base/spinlock_internal.cc', | |
| 128 '<(tcmalloc_dir)/src/base/spinlock_internal.h', | |
| 129 '<(tcmalloc_dir)/src/base/spinlock_linux-inl.h', | |
| 130 '<(tcmalloc_dir)/src/base/spinlock_posix-inl.h', | |
| 131 '<(tcmalloc_dir)/src/base/spinlock_win32-inl.h', | |
| 132 '<(tcmalloc_dir)/src/base/stl_allocator.h', | |
| 133 '<(tcmalloc_dir)/src/base/synchronization_profiling.h', | |
| 134 '<(tcmalloc_dir)/src/base/sysinfo.cc', | |
| 135 '<(tcmalloc_dir)/src/base/sysinfo.h', | |
| 136 '<(tcmalloc_dir)/src/base/thread_annotations.h', | |
| 137 '<(tcmalloc_dir)/src/base/thread_lister.c', | |
| 138 '<(tcmalloc_dir)/src/base/thread_lister.h', | |
| 139 '<(tcmalloc_dir)/src/base/vdso_support.cc', | |
| 140 '<(tcmalloc_dir)/src/base/vdso_support.h', | |
| 141 '<(tcmalloc_dir)/src/central_freelist.cc', | |
| 142 '<(tcmalloc_dir)/src/central_freelist.h', | |
| 143 '<(tcmalloc_dir)/src/common.cc', | |
| 144 '<(tcmalloc_dir)/src/common.h', | |
| 145 '<(tcmalloc_dir)/src/debugallocation.cc', | |
| 146 '<(tcmalloc_dir)/src/free_list.cc', | |
| 147 '<(tcmalloc_dir)/src/free_list.h', | |
| 148 '<(tcmalloc_dir)/src/getpc.h', | |
| 149 '<(tcmalloc_dir)/src/gperftools/heap-checker.h', | |
| 150 '<(tcmalloc_dir)/src/gperftools/heap-profiler.h', | |
| 151 '<(tcmalloc_dir)/src/gperftools/malloc_extension.h', | |
| 152 '<(tcmalloc_dir)/src/gperftools/malloc_extension_c.h', | |
| 153 '<(tcmalloc_dir)/src/gperftools/malloc_hook.h', | |
| 154 '<(tcmalloc_dir)/src/gperftools/malloc_hook_c.h', | |
| 155 '<(tcmalloc_dir)/src/gperftools/profiler.h', | |
| 156 '<(tcmalloc_dir)/src/gperftools/stacktrace.h', | |
| 157 '<(tcmalloc_dir)/src/gperftools/tcmalloc.h', | |
| 158 '<(tcmalloc_dir)/src/heap-checker-bcad.cc', | |
| 159 '<(tcmalloc_dir)/src/heap-checker.cc', | |
| 160 '<(tcmalloc_dir)/src/heap-profile-table.cc', | |
| 161 '<(tcmalloc_dir)/src/heap-profile-table.h', | |
| 162 '<(tcmalloc_dir)/src/heap-profiler.cc', | |
| 163 '<(tcmalloc_dir)/src/internal_logging.cc', | |
| 164 '<(tcmalloc_dir)/src/internal_logging.h', | |
| 165 '<(tcmalloc_dir)/src/libc_override.h', | |
| 166 '<(tcmalloc_dir)/src/libc_override_gcc_and_weak.h', | |
| 167 '<(tcmalloc_dir)/src/libc_override_glibc.h', | |
| 168 '<(tcmalloc_dir)/src/libc_override_osx.h', | |
| 169 '<(tcmalloc_dir)/src/libc_override_redefine.h', | |
| 170 '<(tcmalloc_dir)/src/linked_list.h', | |
| 171 '<(tcmalloc_dir)/src/malloc_extension.cc', | |
| 172 '<(tcmalloc_dir)/src/malloc_hook-inl.h', | |
| 173 '<(tcmalloc_dir)/src/malloc_hook.cc', | |
| 174 '<(tcmalloc_dir)/src/malloc_hook_mmap_freebsd.h', | |
| 175 '<(tcmalloc_dir)/src/malloc_hook_mmap_linux.h', | |
| 176 '<(tcmalloc_dir)/src/maybe_threads.cc', | |
| 177 '<(tcmalloc_dir)/src/maybe_threads.h', | |
| 178 '<(tcmalloc_dir)/src/memfs_malloc.cc', | |
| 179 '<(tcmalloc_dir)/src/memory_region_map.cc', | |
| 180 '<(tcmalloc_dir)/src/memory_region_map.h', | |
| 181 '<(tcmalloc_dir)/src/packed-cache-inl.h', | |
| 182 '<(tcmalloc_dir)/src/page_heap.cc', | |
| 183 '<(tcmalloc_dir)/src/page_heap.h', | |
| 184 '<(tcmalloc_dir)/src/page_heap_allocator.h', | |
| 185 '<(tcmalloc_dir)/src/pagemap.h', | |
| 186 '<(tcmalloc_dir)/src/profile-handler.cc', | |
| 187 '<(tcmalloc_dir)/src/profile-handler.h', | |
| 188 '<(tcmalloc_dir)/src/profiledata.cc', | |
| 189 '<(tcmalloc_dir)/src/profiledata.h', | |
| 190 '<(tcmalloc_dir)/src/profiler.cc', | |
| 191 '<(tcmalloc_dir)/src/raw_printer.cc', | |
| 192 '<(tcmalloc_dir)/src/raw_printer.h', | |
| 193 '<(tcmalloc_dir)/src/sampler.cc', | |
| 194 '<(tcmalloc_dir)/src/sampler.h', | |
| 195 '<(tcmalloc_dir)/src/span.cc', | |
| 196 '<(tcmalloc_dir)/src/span.h', | |
| 197 '<(tcmalloc_dir)/src/stack_trace_table.cc', | |
| 198 '<(tcmalloc_dir)/src/stack_trace_table.h', | |
| 199 '<(tcmalloc_dir)/src/stacktrace.cc', | |
| 200 '<(tcmalloc_dir)/src/stacktrace_arm-inl.h', | |
| 201 '<(tcmalloc_dir)/src/stacktrace_config.h', | |
| 202 '<(tcmalloc_dir)/src/stacktrace_generic-inl.h', | |
| 203 '<(tcmalloc_dir)/src/stacktrace_libunwind-inl.h', | |
| 204 '<(tcmalloc_dir)/src/stacktrace_powerpc-inl.h', | |
| 205 '<(tcmalloc_dir)/src/stacktrace_win32-inl.h', | |
| 206 '<(tcmalloc_dir)/src/stacktrace_with_context.cc', | |
| 207 '<(tcmalloc_dir)/src/stacktrace_x86-inl.h', | |
| 208 '<(tcmalloc_dir)/src/static_vars.cc', | |
| 209 '<(tcmalloc_dir)/src/static_vars.h', | |
| 210 '<(tcmalloc_dir)/src/symbolize.cc', | |
| 211 '<(tcmalloc_dir)/src/symbolize.h', | |
| 212 '<(tcmalloc_dir)/src/system-alloc.cc', | |
| 213 '<(tcmalloc_dir)/src/system-alloc.h', | |
| 214 '<(tcmalloc_dir)/src/tcmalloc.cc', | |
| 215 '<(tcmalloc_dir)/src/tcmalloc_guard.h', | |
| 216 '<(tcmalloc_dir)/src/thread_cache.cc', | |
| 217 '<(tcmalloc_dir)/src/thread_cache.h', | |
| 218 | |
| 219 'debugallocation_shim.cc', | |
| 220 ], | |
| 221 # sources! means that these are not compiled directly. | |
| 222 'sources!': [ | |
| 223 # We simply don't use these, but list them above so that IDE | |
| 224 # users can view the full available source for reference, etc. | |
| 225 '<(tcmalloc_dir)/src/addressmap-inl.h', | |
| 226 '<(tcmalloc_dir)/src/base/atomicops-internals-linuxppc.h', | |
| 227 '<(tcmalloc_dir)/src/base/atomicops-internals-macosx.h', | |
| 228 '<(tcmalloc_dir)/src/base/atomicops-internals-x86-msvc.h', | |
| 229 '<(tcmalloc_dir)/src/base/atomicops-internals-x86.h', | |
| 230 '<(tcmalloc_dir)/src/base/atomicops.h', | |
| 231 '<(tcmalloc_dir)/src/base/commandlineflags.h', | |
| 232 '<(tcmalloc_dir)/src/base/cycleclock.h', | |
| 233 '<(tcmalloc_dir)/src/base/elf_mem_image.h', | |
| 234 '<(tcmalloc_dir)/src/base/elfcore.h', | |
| 235 '<(tcmalloc_dir)/src/base/googleinit.h', | |
| 236 '<(tcmalloc_dir)/src/base/linux_syscall_support.h', | |
| 237 '<(tcmalloc_dir)/src/base/simple_mutex.h', | |
| 238 '<(tcmalloc_dir)/src/base/spinlock_linux-inl.h', | |
| 239 '<(tcmalloc_dir)/src/base/spinlock_posix-inl.h', | |
| 240 '<(tcmalloc_dir)/src/base/spinlock_win32-inl.h', | |
| 241 '<(tcmalloc_dir)/src/base/stl_allocator.h', | |
| 242 '<(tcmalloc_dir)/src/base/thread_annotations.h', | |
| 243 '<(tcmalloc_dir)/src/getpc.h', | |
| 244 '<(tcmalloc_dir)/src/gperftools/heap-checker.h', | |
| 245 '<(tcmalloc_dir)/src/gperftools/heap-profiler.h', | |
| 246 '<(tcmalloc_dir)/src/gperftools/malloc_extension.h', | |
| 247 '<(tcmalloc_dir)/src/gperftools/malloc_extension_c.h', | |
| 248 '<(tcmalloc_dir)/src/gperftools/malloc_hook.h', | |
| 249 '<(tcmalloc_dir)/src/gperftools/malloc_hook_c.h', | |
| 250 '<(tcmalloc_dir)/src/gperftools/profiler.h', | |
| 251 '<(tcmalloc_dir)/src/gperftools/stacktrace.h', | |
| 252 '<(tcmalloc_dir)/src/gperftools/tcmalloc.h', | |
| 253 '<(tcmalloc_dir)/src/heap-checker-bcad.cc', | |
| 254 '<(tcmalloc_dir)/src/heap-checker.cc', | |
| 255 '<(tcmalloc_dir)/src/libc_override.h', | |
| 256 '<(tcmalloc_dir)/src/libc_override_gcc_and_weak.h', | |
| 257 '<(tcmalloc_dir)/src/libc_override_glibc.h', | |
| 258 '<(tcmalloc_dir)/src/libc_override_osx.h', | |
| 259 '<(tcmalloc_dir)/src/libc_override_redefine.h', | |
| 260 '<(tcmalloc_dir)/src/malloc_hook_mmap_freebsd.h', | |
| 261 '<(tcmalloc_dir)/src/malloc_hook_mmap_linux.h', | |
| 262 '<(tcmalloc_dir)/src/memfs_malloc.cc', | |
| 263 '<(tcmalloc_dir)/src/packed-cache-inl.h', | |
| 264 '<(tcmalloc_dir)/src/page_heap_allocator.h', | |
| 265 '<(tcmalloc_dir)/src/pagemap.h', | |
| 266 '<(tcmalloc_dir)/src/stacktrace_arm-inl.h', | |
| 267 '<(tcmalloc_dir)/src/stacktrace_config.h', | |
| 268 '<(tcmalloc_dir)/src/stacktrace_generic-inl.h', | |
| 269 '<(tcmalloc_dir)/src/stacktrace_libunwind-inl.h', | |
| 270 '<(tcmalloc_dir)/src/stacktrace_powerpc-inl.h', | |
| 271 '<(tcmalloc_dir)/src/stacktrace_win32-inl.h', | |
| 272 '<(tcmalloc_dir)/src/stacktrace_with_context.cc', | |
| 273 '<(tcmalloc_dir)/src/stacktrace_x86-inl.h', | |
| 274 '<(tcmalloc_dir)/src/tcmalloc_guard.h', | |
| 275 | |
| 276 # Included by debugallocation_shim.cc. | |
| 277 '<(tcmalloc_dir)/src/debugallocation.cc', | |
| 278 '<(tcmalloc_dir)/src/tcmalloc.cc', | |
| 279 ], | |
| 280 'variables': { | |
| 281 'clang_warning_flags': [ | |
| 282 # tcmalloc initializes some fields in the wrong order. | |
| 283 '-Wno-reorder', | |
| 284 # tcmalloc contains some unused local template specializations. | |
| 285 '-Wno-unused-function', | |
| 286 # tcmalloc uses COMPILE_ASSERT without static_assert but with | |
| 287 # typedefs. | |
| 288 '-Wno-unused-local-typedefs', | |
| 289 # for magic2_ in debugallocation.cc (only built in Debug builds) | |
| 290 # typedefs. | |
| 291 '-Wno-unused-private-field', | |
| 292 ], | |
| 293 }, | |
| 294 'conditions': [ | |
| 295 ['OS=="linux" or OS=="freebsd" or OS=="solaris" or OS=="android"', { | |
| 296 'sources!': [ | |
| 297 '<(tcmalloc_dir)/src/system-alloc.h', | |
| 298 ], | |
| 299 # We enable all warnings by default, but upstream disables a few. | |
| 300 # Keep "-Wno-*" flags in sync with upstream by comparing against: | |
| 301 # http://code.google.com/p/google-perftools/source/browse/trunk/Ma
kefile.am | |
| 302 'cflags': [ | |
| 303 '-Wno-sign-compare', | |
| 304 '-Wno-unused-result', | |
| 305 ], | |
| 306 'link_settings': { | |
| 307 'ldflags': [ | |
| 308 # Don't let linker rip this symbol out, otherwise the heap&cpu | |
| 309 # profilers will not initialize properly on startup. | |
| 310 '-Wl,-uIsHeapProfilerRunning,-uProfilerStart', | |
| 311 # Do the same for heap leak checker. | |
| 312 '-Wl,-u_Z21InitialMallocHook_NewPKvj,-u_Z22InitialMallocHook_M
MapPKvS0_jiiix,-u_Z22InitialMallocHook_SbrkPKvi', | |
| 313 '-Wl,-u_Z21InitialMallocHook_NewPKvm,-u_Z22InitialMallocHook_M
MapPKvS0_miiil,-u_Z22InitialMallocHook_SbrkPKvl', | |
| 314 '-Wl,-u_ZN15HeapLeakChecker12IgnoreObjectEPKv,-u_ZN15HeapLeakC
hecker14UnIgnoreObjectEPKv', | |
| 315 ], | |
| 316 }, | |
| 317 # Compiling tcmalloc with -fvisibility=default is only necessary w
hen | |
| 318 # not using the allocator shim, which provides the correct visibil
ity | |
| 319 # annotations for those symbols which need to be exported (see | |
| 320 # //base/allocator/allocator_shim_override_glibc_weak_symbols.h an
d | |
| 321 # //base/allocator/allocator_shim_internals.h for the definition o
f | |
| 322 # SHIM_ALWAYS_EXPORT). | |
| 323 'conditions': [ | |
| 324 ['use_experimental_allocator_shim==0', { | |
| 325 'cflags!': [ | |
| 326 '-fvisibility=hidden', | |
| 327 ], | |
| 328 }], | |
| 329 ], | |
| 330 }], | |
| 331 ['profiling!=1', { | |
| 332 'sources!': [ | |
| 333 # cpuprofiler | |
| 334 '<(tcmalloc_dir)/src/base/thread_lister.c', | |
| 335 '<(tcmalloc_dir)/src/base/thread_lister.h', | |
| 336 '<(tcmalloc_dir)/src/profile-handler.cc', | |
| 337 '<(tcmalloc_dir)/src/profile-handler.h', | |
| 338 '<(tcmalloc_dir)/src/profiledata.cc', | |
| 339 '<(tcmalloc_dir)/src/profiledata.h', | |
| 340 '<(tcmalloc_dir)/src/profiler.cc', | |
| 341 ], | |
| 342 }], | |
| 343 ['use_experimental_allocator_shim==1', { | |
| 344 'defines': [ | |
| 345 'TCMALLOC_DONT_REPLACE_SYSTEM_ALLOC', | |
| 346 ], | |
| 347 }] | |
| 348 ], | |
| 349 'configurations': { | |
| 350 'Debug_Base': { | |
| 351 'conditions': [ | |
| 352 ['disable_debugallocation==0', { | |
| 353 'defines': [ | |
| 354 # Use debugallocation for Debug builds to catch problems | |
| 355 # early and cleanly, http://crbug.com/30715 . | |
| 356 'TCMALLOC_FOR_DEBUGALLOCATION', | |
| 357 ], | |
| 358 }], | |
| 359 ], | |
| 360 }, | |
| 361 }, | |
| 362 }], # use_allocator=="tcmalloc | |
| 363 # For CrOS builds with vtable verification. According to the author of | |
| 364 # crrev.com/10854031 this is used in conjuction with some other CrOS | |
| 365 # build flag, to enable verification of any allocator that uses virtual | |
| 366 # function calls. | |
| 367 ['use_vtable_verify==1', { | |
| 368 'cflags': [ | |
| 369 '-fvtable-verify=preinit', | |
| 370 ], | |
| 371 }], | |
| 372 ['order_profiling != 0', { | |
| 373 'target_conditions' : [ | |
| 374 ['_toolset=="target"', { | |
| 375 'cflags!': [ '-finstrument-functions' ], | |
| 376 }], | |
| 377 ], | |
| 378 }], | |
| 379 ], # conditions of 'allocator' target. | |
| 380 }, # 'allocator' target. | |
| 381 { | |
| 382 # GN: //base/allocator:features | |
| 383 # When referenced from a target that might be compiled in the host | |
| 384 # toolchain, always refer to 'allocator_features#target'. | |
| 385 'target_name': 'allocator_features', | |
| 386 'includes': [ '../../build/buildflag_header.gypi' ], | |
| 387 'variables': { | |
| 388 'buildflag_header_path': 'base/allocator/features.h', | |
| 389 'buildflag_flags': [ | |
| 390 'USE_EXPERIMENTAL_ALLOCATOR_SHIM=<(use_experimental_allocator_shim)', | |
| 391 ], | |
| 392 'conditions': [ | |
| 393 ['<(use_experimental_allocator_shim) or <(win_use_allocator_shim)', | |
| 394 {'buildflag_flags': [ 'ENABLE_WIN_ALLOCATOR_SHIM_TESTS=1' ],}, | |
| 395 {'buildflag_flags': [ 'ENABLE_WIN_ALLOCATOR_SHIM_TESTS=0' ],} | |
| 396 ], | |
| 397 ], | |
| 398 }, | |
| 399 }, # 'allocator_features' target. | |
| 400 ], # targets. | |
| 401 'conditions': [ | |
| 402 ['use_experimental_allocator_shim==1', { | |
| 403 'targets': [ | |
| 404 { | |
| 405 # GN: //base/allocator:unified_allocator_shim | |
| 406 'target_name': 'unified_allocator_shim', | |
| 407 'toolsets': ['host', 'target'], | |
| 408 'type': 'static_library', | |
| 409 'defines': [ 'BASE_IMPLEMENTATION' ], | |
| 410 'sources': [ | |
| 411 'allocator_shim.cc', | |
| 412 'allocator_shim.h', | |
| 413 'allocator_shim_internals.h', | |
| 414 'allocator_shim_override_cpp_symbols.h', | |
| 415 'allocator_shim_override_libc_symbols.h', | |
| 416 ], | |
| 417 'include_dirs': [ | |
| 418 '../..', | |
| 419 ], | |
| 420 'conditions': [ | |
| 421 ['OS=="linux" and use_allocator=="tcmalloc"', { | |
| 422 'sources': [ | |
| 423 'allocator_shim_default_dispatch_to_tcmalloc.cc', | |
| 424 'allocator_shim_override_glibc_weak_symbols.h', | |
| 425 ], | |
| 426 }], | |
| 427 ['use_allocator=="none" and (OS=="linux" or (OS=="android" and _tool
set == "host" and host_os == "linux"))', { | |
| 428 'sources': [ | |
| 429 'allocator_shim_default_dispatch_to_glibc.cc', | |
| 430 ], | |
| 431 }], | |
| 432 ['OS=="android" and _toolset == "target"', { | |
| 433 'sources': [ | |
| 434 'allocator_shim_default_dispatch_to_linker_wrapped_symbols.cc', | |
| 435 'allocator_shim_override_linker_wrapped_symbols.h', | |
| 436 ], | |
| 437 # On Android all references to malloc & friends symbols are | |
| 438 # rewritten, at link time, and routed to the shim. | |
| 439 # See //base/allocator/README.md. | |
| 440 'all_dependent_settings': { | |
| 441 'ldflags': [ | |
| 442 '-Wl,-wrap,calloc', | |
| 443 '-Wl,-wrap,free', | |
| 444 '-Wl,-wrap,malloc', | |
| 445 '-Wl,-wrap,memalign', | |
| 446 '-Wl,-wrap,posix_memalign', | |
| 447 '-Wl,-wrap,pvalloc', | |
| 448 '-Wl,-wrap,realloc', | |
| 449 '-Wl,-wrap,valloc', | |
| 450 ], | |
| 451 }, | |
| 452 }], | |
| 453 ] | |
| 454 }, # 'unified_allocator_shim' target. | |
| 455 ], | |
| 456 }] | |
| 457 ], | |
| 458 } | |
| OLD | NEW |