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

Side by Side Diff: base/allocator/allocator.gyp

Issue 12224030: Linux: add option to use system tcmalloc (off by default) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/chrome_renderer.gypi » ('j') | 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 { 5 {
6 'variables': { 6 'variables': {
7 'jemalloc_dir': '../../third_party/jemalloc/chromium', 7 'jemalloc_dir': '../../third_party/jemalloc/chromium',
8 'tcmalloc_dir': '../../third_party/tcmalloc/chromium', 8 'tcmalloc_dir': '../../third_party/tcmalloc/chromium',
9 'use_system_tcmalloc%': 0,
9 'use_vtable_verify%': 0, 10 'use_vtable_verify%': 0,
10 }, 11 },
11 'targets': [ 12 'targets': [
12 # Only executables and not libraries should depend on the
13 # allocator target; only the application (the final executable)
14 # knows what allocator makes sense.
15 { 13 {
16 'target_name': 'allocator', 14 # This library is linked in to src/base.gypi:base and allocator_unittests
15 # It can't depend on either and nothing else should depend on it - all
16 # other code should use the interfaced provided by base.
17 'target_name': 'allocator_extension_thunks',
17 'type': 'static_library', 18 'type': 'static_library',
18 # Make sure the allocation library is optimized to 19 'sources': [
19 # the hilt in official builds. 20 'allocator_extension_thunks.cc',
20 'variables': { 21 'allocator_extension_thunks.h',
21 'optimize': 'max', 22 ],
22 }, 23 'toolsets': ['host', 'target'],
23 'include_dirs': [ 24 'include_dirs': [
24 '.', 25 '../../'
25 '<(tcmalloc_dir)/src/base',
26 '<(tcmalloc_dir)/src',
27 '../..',
28 ], 26 ],
29 'direct_dependent_settings': {
30 'configurations': {
31 'Common_Base': {
32 'msvs_settings': {
33 'VCLinkerTool': {
34 'IgnoreDefaultLibraryNames': ['libcmtd.lib', 'libcmt.lib'],
35 'AdditionalDependencies': [
36 '<(SHARED_INTERMEDIATE_DIR)/allocator/libcmt.lib'
37 ],
38 },
39 },
40 },
41 },
42 'conditions': [
43 ['OS=="win"', {
44 'defines': [
45 'PERFTOOLS_DLL_DECL=',
46 ],
47 }],
48 ],
49 },
50 'sources': [
51 # Generated for our configuration from tcmalloc's build
52 # and checked in.
53 '<(tcmalloc_dir)/src/config.h',
54 '<(tcmalloc_dir)/src/config_linux.h',
55 '<(tcmalloc_dir)/src/config_win.h',
56
57 # all tcmalloc native and forked files
58 '<(tcmalloc_dir)/src/addressmap-inl.h',
59 '<(tcmalloc_dir)/src/base/abort.cc',
60 '<(tcmalloc_dir)/src/base/abort.h',
61 '<(tcmalloc_dir)/src/base/arm_instruction_set_select.h',
62 '<(tcmalloc_dir)/src/base/atomicops-internals-linuxppc.h',
63 '<(tcmalloc_dir)/src/base/atomicops-internals-arm-generic.h',
64 '<(tcmalloc_dir)/src/base/atomicops-internals-arm-v6plus.h',
65 '<(tcmalloc_dir)/src/base/atomicops-internals-macosx.h',
66 '<(tcmalloc_dir)/src/base/atomicops-internals-windows.h',
67 '<(tcmalloc_dir)/src/base/atomicops-internals-x86.cc',
68 '<(tcmalloc_dir)/src/base/atomicops-internals-x86.h',
69 '<(tcmalloc_dir)/src/base/atomicops.h',
70 '<(tcmalloc_dir)/src/base/basictypes.h',
71 '<(tcmalloc_dir)/src/base/commandlineflags.h',
72 '<(tcmalloc_dir)/src/base/cycleclock.h',
73 # We don't list dynamic_annotations.c since its copy is already
74 # present in the dynamic_annotations target.
75 '<(tcmalloc_dir)/src/base/dynamic_annotations.h',
76 '<(tcmalloc_dir)/src/base/elf_mem_image.cc',
77 '<(tcmalloc_dir)/src/base/elf_mem_image.h',
78 '<(tcmalloc_dir)/src/base/elfcore.h',
79 '<(tcmalloc_dir)/src/base/googleinit.h',
80 '<(tcmalloc_dir)/src/base/linux_syscall_support.h',
81 '<(tcmalloc_dir)/src/base/linuxthreads.cc',
82 '<(tcmalloc_dir)/src/base/linuxthreads.h',
83 '<(tcmalloc_dir)/src/base/logging.cc',
84 '<(tcmalloc_dir)/src/base/logging.h',
85 '<(tcmalloc_dir)/src/base/low_level_alloc.cc',
86 '<(tcmalloc_dir)/src/base/low_level_alloc.h',
87 '<(tcmalloc_dir)/src/base/simple_mutex.h',
88 '<(tcmalloc_dir)/src/base/spinlock.cc',
89 '<(tcmalloc_dir)/src/base/spinlock.h',
90 '<(tcmalloc_dir)/src/base/spinlock_internal.cc',
91 '<(tcmalloc_dir)/src/base/spinlock_internal.h',
92 '<(tcmalloc_dir)/src/base/spinlock_linux-inl.h',
93 '<(tcmalloc_dir)/src/base/spinlock_posix-inl.h',
94 '<(tcmalloc_dir)/src/base/spinlock_win32-inl.h',
95 '<(tcmalloc_dir)/src/base/stl_allocator.h',
96 '<(tcmalloc_dir)/src/base/synchronization_profiling.h',
97 '<(tcmalloc_dir)/src/base/sysinfo.cc',
98 '<(tcmalloc_dir)/src/base/sysinfo.h',
99 '<(tcmalloc_dir)/src/base/thread_annotations.h',
100 '<(tcmalloc_dir)/src/base/thread_lister.c',
101 '<(tcmalloc_dir)/src/base/thread_lister.h',
102 '<(tcmalloc_dir)/src/base/vdso_support.cc',
103 '<(tcmalloc_dir)/src/base/vdso_support.h',
104 '<(tcmalloc_dir)/src/central_freelist.cc',
105 '<(tcmalloc_dir)/src/central_freelist.h',
106 '<(tcmalloc_dir)/src/common.cc',
107 '<(tcmalloc_dir)/src/common.h',
108 '<(tcmalloc_dir)/src/debugallocation.cc',
109 '<(tcmalloc_dir)/src/deep-heap-profile.cc',
110 '<(tcmalloc_dir)/src/deep-heap-profile.h',
111 '<(tcmalloc_dir)/src/free_list.cc',
112 '<(tcmalloc_dir)/src/free_list.h',
113 '<(tcmalloc_dir)/src/getpc.h',
114 '<(tcmalloc_dir)/src/gperftools/heap-checker.h',
115 '<(tcmalloc_dir)/src/gperftools/heap-profiler.h',
116 '<(tcmalloc_dir)/src/gperftools/malloc_extension.h',
117 '<(tcmalloc_dir)/src/gperftools/malloc_extension_c.h',
118 '<(tcmalloc_dir)/src/gperftools/malloc_hook.h',
119 '<(tcmalloc_dir)/src/gperftools/malloc_hook_c.h',
120 '<(tcmalloc_dir)/src/gperftools/profiler.h',
121 '<(tcmalloc_dir)/src/gperftools/stacktrace.h',
122 '<(tcmalloc_dir)/src/gperftools/tcmalloc.h',
123 '<(tcmalloc_dir)/src/heap-checker-bcad.cc',
124 '<(tcmalloc_dir)/src/heap-checker.cc',
125 '<(tcmalloc_dir)/src/heap-profile-table.cc',
126 '<(tcmalloc_dir)/src/heap-profile-table.h',
127 '<(tcmalloc_dir)/src/heap-profiler.cc',
128 '<(tcmalloc_dir)/src/internal_logging.cc',
129 '<(tcmalloc_dir)/src/internal_logging.h',
130 '<(tcmalloc_dir)/src/libc_override.h',
131 '<(tcmalloc_dir)/src/libc_override_gcc_and_weak.h',
132 '<(tcmalloc_dir)/src/libc_override_glibc.h',
133 '<(tcmalloc_dir)/src/libc_override_osx.h',
134 '<(tcmalloc_dir)/src/libc_override_redefine.h',
135 '<(tcmalloc_dir)/src/linked_list.h',
136 '<(tcmalloc_dir)/src/malloc_extension.cc',
137 '<(tcmalloc_dir)/src/malloc_hook-inl.h',
138 '<(tcmalloc_dir)/src/malloc_hook.cc',
139 '<(tcmalloc_dir)/src/malloc_hook_mmap_freebsd.h',
140 '<(tcmalloc_dir)/src/malloc_hook_mmap_linux.h',
141 '<(tcmalloc_dir)/src/maybe_threads.cc',
142 '<(tcmalloc_dir)/src/maybe_threads.h',
143 '<(tcmalloc_dir)/src/memfs_malloc.cc',
144 '<(tcmalloc_dir)/src/memory_region_map.cc',
145 '<(tcmalloc_dir)/src/memory_region_map.h',
146 '<(tcmalloc_dir)/src/packed-cache-inl.h',
147 '<(tcmalloc_dir)/src/page_heap.cc',
148 '<(tcmalloc_dir)/src/page_heap.h',
149 '<(tcmalloc_dir)/src/page_heap_allocator.h',
150 '<(tcmalloc_dir)/src/pagemap.h',
151 '<(tcmalloc_dir)/src/profile-handler.cc',
152 '<(tcmalloc_dir)/src/profile-handler.h',
153 '<(tcmalloc_dir)/src/profiledata.cc',
154 '<(tcmalloc_dir)/src/profiledata.h',
155 '<(tcmalloc_dir)/src/profiler.cc',
156 '<(tcmalloc_dir)/src/raw_printer.cc',
157 '<(tcmalloc_dir)/src/raw_printer.h',
158 '<(tcmalloc_dir)/src/sampler.cc',
159 '<(tcmalloc_dir)/src/sampler.h',
160 '<(tcmalloc_dir)/src/span.cc',
161 '<(tcmalloc_dir)/src/span.h',
162 '<(tcmalloc_dir)/src/stack_trace_table.cc',
163 '<(tcmalloc_dir)/src/stack_trace_table.h',
164 '<(tcmalloc_dir)/src/stacktrace.cc',
165 '<(tcmalloc_dir)/src/stacktrace_arm-inl.h',
166 '<(tcmalloc_dir)/src/stacktrace_config.h',
167 '<(tcmalloc_dir)/src/stacktrace_generic-inl.h',
168 '<(tcmalloc_dir)/src/stacktrace_libunwind-inl.h',
169 '<(tcmalloc_dir)/src/stacktrace_powerpc-inl.h',
170 '<(tcmalloc_dir)/src/stacktrace_win32-inl.h',
171 '<(tcmalloc_dir)/src/stacktrace_with_context.cc',
172 '<(tcmalloc_dir)/src/stacktrace_x86-inl.h',
173 '<(tcmalloc_dir)/src/static_vars.cc',
174 '<(tcmalloc_dir)/src/static_vars.h',
175 '<(tcmalloc_dir)/src/symbolize.cc',
176 '<(tcmalloc_dir)/src/symbolize.h',
177 '<(tcmalloc_dir)/src/system-alloc.cc',
178 '<(tcmalloc_dir)/src/system-alloc.h',
179 '<(tcmalloc_dir)/src/tcmalloc.cc',
180 '<(tcmalloc_dir)/src/tcmalloc_guard.h',
181 '<(tcmalloc_dir)/src/thread_cache.cc',
182 '<(tcmalloc_dir)/src/thread_cache.h',
183 '<(tcmalloc_dir)/src/windows/config.h',
184 '<(tcmalloc_dir)/src/windows/get_mangled_names.cc',
185 '<(tcmalloc_dir)/src/windows/gperftools/tcmalloc.h',
186 '<(tcmalloc_dir)/src/windows/ia32_modrm_map.cc',
187 '<(tcmalloc_dir)/src/windows/ia32_opcode_map.cc',
188 '<(tcmalloc_dir)/src/windows/mingw.h',
189 '<(tcmalloc_dir)/src/windows/mini_disassembler.cc',
190 '<(tcmalloc_dir)/src/windows/mini_disassembler.h',
191 '<(tcmalloc_dir)/src/windows/mini_disassembler_types.h',
192 '<(tcmalloc_dir)/src/windows/override_functions.cc',
193 '<(tcmalloc_dir)/src/windows/patch_functions.cc',
194 '<(tcmalloc_dir)/src/windows/port.cc',
195 '<(tcmalloc_dir)/src/windows/port.h',
196 '<(tcmalloc_dir)/src/windows/preamble_patcher.cc',
197 '<(tcmalloc_dir)/src/windows/preamble_patcher.h',
198 '<(tcmalloc_dir)/src/windows/preamble_patcher_with_stub.cc',
199
200 # jemalloc files
201 '<(jemalloc_dir)/jemalloc.c',
202 '<(jemalloc_dir)/jemalloc.h',
203 '<(jemalloc_dir)/ql.h',
204 '<(jemalloc_dir)/qr.h',
205 '<(jemalloc_dir)/rb.h',
206
207 'allocator_shim.cc',
208 'allocator_shim.h',
209 'debugallocation_shim.cc',
210 'generic_allocators.cc',
211 'win_allocator.cc',
212 ],
213 # sources! means that these are not compiled directly.
214 'sources!': [
215 # Included by allocator_shim.cc for maximal inlining.
216 'generic_allocators.cc',
217 'win_allocator.cc',
218
219 # Included by debugallocation_shim.cc.
220 '<(tcmalloc_dir)/src/debugallocation.cc',
221 '<(tcmalloc_dir)/src/tcmalloc.cc',
222
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.cc',
230 '<(tcmalloc_dir)/src/base/atomicops-internals-x86.h',
231 '<(tcmalloc_dir)/src/base/atomicops.h',
232 '<(tcmalloc_dir)/src/base/basictypes.h',
233 '<(tcmalloc_dir)/src/base/commandlineflags.h',
234 '<(tcmalloc_dir)/src/base/cycleclock.h',
235 '<(tcmalloc_dir)/src/base/elf_mem_image.h',
236 '<(tcmalloc_dir)/src/base/elfcore.h',
237 '<(tcmalloc_dir)/src/base/googleinit.h',
238 '<(tcmalloc_dir)/src/base/linux_syscall_support.h',
239 '<(tcmalloc_dir)/src/base/simple_mutex.h',
240 '<(tcmalloc_dir)/src/base/spinlock_linux-inl.h',
241 '<(tcmalloc_dir)/src/base/spinlock_posix-inl.h',
242 '<(tcmalloc_dir)/src/base/spinlock_win32-inl.h',
243 '<(tcmalloc_dir)/src/base/stl_allocator.h',
244 '<(tcmalloc_dir)/src/base/thread_annotations.h',
245 '<(tcmalloc_dir)/src/getpc.h',
246 '<(tcmalloc_dir)/src/gperftools/heap-checker.h',
247 '<(tcmalloc_dir)/src/gperftools/heap-profiler.h',
248 '<(tcmalloc_dir)/src/gperftools/malloc_extension.h',
249 '<(tcmalloc_dir)/src/gperftools/malloc_extension_c.h',
250 '<(tcmalloc_dir)/src/gperftools/malloc_hook.h',
251 '<(tcmalloc_dir)/src/gperftools/malloc_hook_c.h',
252 '<(tcmalloc_dir)/src/gperftools/profiler.h',
253 '<(tcmalloc_dir)/src/gperftools/stacktrace.h',
254 '<(tcmalloc_dir)/src/gperftools/tcmalloc.h',
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 '<(tcmalloc_dir)/src/windows/config.h',
276 '<(tcmalloc_dir)/src/windows/gperftools/tcmalloc.h',
277 '<(tcmalloc_dir)/src/windows/get_mangled_names.cc',
278 '<(tcmalloc_dir)/src/windows/ia32_modrm_map.cc',
279 '<(tcmalloc_dir)/src/windows/ia32_opcode_map.cc',
280 '<(tcmalloc_dir)/src/windows/mingw.h',
281 '<(tcmalloc_dir)/src/windows/mini_disassembler.cc',
282 '<(tcmalloc_dir)/src/windows/mini_disassembler.h',
283 '<(tcmalloc_dir)/src/windows/mini_disassembler_types.h',
284 '<(tcmalloc_dir)/src/windows/override_functions.cc',
285 '<(tcmalloc_dir)/src/windows/patch_functions.cc',
286 '<(tcmalloc_dir)/src/windows/preamble_patcher.cc',
287 '<(tcmalloc_dir)/src/windows/preamble_patcher.h',
288 '<(tcmalloc_dir)/src/windows/preamble_patcher_with_stub.cc',
289 ],
290 'dependencies': [
291 '../third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_anno tations',
292 ],
293 'msvs_settings': {
294 # TODO(sgk): merge this with build/common.gypi settings
295 'VCLibrarianTool': {
296 'AdditionalOptions': ['/ignore:4006,4221'],
297 'AdditionalLibraryDirectories':
298 ['<(DEPTH)/third_party/platformsdk_win7/files/Lib'],
299 },
300 'VCLinkerTool': {
301 'AdditionalOptions': ['/ignore:4006'],
302 },
303 },
304 'configurations': {
305 'Debug_Base': {
306 'msvs_settings': {
307 'VCCLCompilerTool': {
308 'RuntimeLibrary': '0',
309 },
310 },
311 'variables': {
312 # Provide a way to force disable debugallocation in Debug builds,
313 # e.g. for profiling (it's more rare to profile Debug builds,
314 # but people sometimes need to do that).
315 'disable_debugallocation%': 0,
316 },
317 'conditions': [
318 # TODO(phajdan.jr): Also enable on Windows.
319 ['disable_debugallocation==0 and OS!="win"', {
320 'defines': [
321 # Use debugallocation for Debug builds to catch problems early
322 # and cleanly, http://crbug.com/30715 .
323 'TCMALLOC_FOR_DEBUGALLOCATION',
324 ],
325 }],
326 ],
327 },
328 },
329 'conditions': [ 27 'conditions': [
330 ['OS=="linux" and clang_type_profiler==1', { 28 ['OS=="linux" and clang_type_profiler==1', {
331 'dependencies': [
332 'type_profiler_tcmalloc',
333 ],
334 # It is undoing dependencies and cflags_cc for type_profiler which 29 # It is undoing dependencies and cflags_cc for type_profiler which
335 # build/common.gypi injects into all targets. 30 # build/common.gypi injects into all targets.
336 'dependencies!': [ 31 'dependencies!': [
337 'type_profiler', 32 'type_profiler',
338 ], 33 ],
339 'cflags_cc!': [ 34 'cflags_cc!': [
340 '-fintercept-allocation-functions', 35 '-fintercept-allocation-functions',
341 ], 36 ],
342 }], 37 }],
343 ['OS=="win"', { 38 ],
344 'defines': [ 39 },
345 'PERFTOOLS_DLL_DECL=', 40 ],
41 'conditions': [
42 ['use_system_tcmalloc == 0', {
43 'targets': [
44 # Only executables and not libraries should depend on the
45 # allocator target; only the application (the final executable)
46 # knows what allocator makes sense.
47 {
48 'target_name': 'allocator',
49 'type': 'static_library',
50 # Make sure the allocation library is optimized to
51 # the hilt in official builds.
52 'variables': {
53 'optimize': 'max',
54 },
55 'include_dirs': [
56 '.',
57 '<(tcmalloc_dir)/src/base',
58 '<(tcmalloc_dir)/src',
59 '../..',
346 ], 60 ],
347 'defines!': [ 61 'direct_dependent_settings': {
348 # tcmalloc source files unconditionally define this, remove it from 62 'configurations': {
349 # the list of defines that common.gypi defines globally. 63 'Common_Base': {
350 'NOMINMAX', 64 'msvs_settings': {
351 ], 65 'VCLinkerTool': {
352 'dependencies': [ 66 'IgnoreDefaultLibraryNames': ['libcmtd.lib', 'libcmt.lib'],
353 'libcmt', 67 'AdditionalDependencies': [
354 ], 68 '<(SHARED_INTERMEDIATE_DIR)/allocator/libcmt.lib'
355 'include_dirs': [ 69 ],
356 '<(jemalloc_dir)', 70 },
357 '<(tcmalloc_dir)/src/windows', 71 },
358 ], 72 },
359 'sources!': [ 73 },
74 'conditions': [
75 ['OS=="win"', {
76 'defines': [
77 'PERFTOOLS_DLL_DECL=',
78 ],
79 }],
80 ],
81 },
82 'sources': [
83 # Generated for our configuration from tcmalloc's build
84 # and checked in.
85 '<(tcmalloc_dir)/src/config.h',
86 '<(tcmalloc_dir)/src/config_linux.h',
87 '<(tcmalloc_dir)/src/config_win.h',
88
89 # all tcmalloc native and forked files
90 '<(tcmalloc_dir)/src/addressmap-inl.h',
91 '<(tcmalloc_dir)/src/base/abort.cc',
92 '<(tcmalloc_dir)/src/base/abort.h',
93 '<(tcmalloc_dir)/src/base/arm_instruction_set_select.h',
94 '<(tcmalloc_dir)/src/base/atomicops-internals-linuxppc.h',
95 '<(tcmalloc_dir)/src/base/atomicops-internals-arm-generic.h',
96 '<(tcmalloc_dir)/src/base/atomicops-internals-arm-v6plus.h',
97 '<(tcmalloc_dir)/src/base/atomicops-internals-macosx.h',
98 '<(tcmalloc_dir)/src/base/atomicops-internals-windows.h',
99 '<(tcmalloc_dir)/src/base/atomicops-internals-x86.cc',
100 '<(tcmalloc_dir)/src/base/atomicops-internals-x86.h',
101 '<(tcmalloc_dir)/src/base/atomicops.h',
102 '<(tcmalloc_dir)/src/base/basictypes.h',
103 '<(tcmalloc_dir)/src/base/commandlineflags.h',
104 '<(tcmalloc_dir)/src/base/cycleclock.h',
105 # We don't list dynamic_annotations.c since its copy is already
106 # present in the dynamic_annotations target.
107 '<(tcmalloc_dir)/src/base/dynamic_annotations.h',
360 '<(tcmalloc_dir)/src/base/elf_mem_image.cc', 108 '<(tcmalloc_dir)/src/base/elf_mem_image.cc',
361 '<(tcmalloc_dir)/src/base/elf_mem_image.h', 109 '<(tcmalloc_dir)/src/base/elf_mem_image.h',
110 '<(tcmalloc_dir)/src/base/elfcore.h',
111 '<(tcmalloc_dir)/src/base/googleinit.h',
112 '<(tcmalloc_dir)/src/base/linux_syscall_support.h',
362 '<(tcmalloc_dir)/src/base/linuxthreads.cc', 113 '<(tcmalloc_dir)/src/base/linuxthreads.cc',
363 '<(tcmalloc_dir)/src/base/linuxthreads.h', 114 '<(tcmalloc_dir)/src/base/linuxthreads.h',
115 '<(tcmalloc_dir)/src/base/logging.cc',
116 '<(tcmalloc_dir)/src/base/logging.h',
117 '<(tcmalloc_dir)/src/base/low_level_alloc.cc',
118 '<(tcmalloc_dir)/src/base/low_level_alloc.h',
119 '<(tcmalloc_dir)/src/base/simple_mutex.h',
120 '<(tcmalloc_dir)/src/base/spinlock.cc',
121 '<(tcmalloc_dir)/src/base/spinlock.h',
122 '<(tcmalloc_dir)/src/base/spinlock_internal.cc',
123 '<(tcmalloc_dir)/src/base/spinlock_internal.h',
124 '<(tcmalloc_dir)/src/base/spinlock_linux-inl.h',
125 '<(tcmalloc_dir)/src/base/spinlock_posix-inl.h',
126 '<(tcmalloc_dir)/src/base/spinlock_win32-inl.h',
127 '<(tcmalloc_dir)/src/base/stl_allocator.h',
128 '<(tcmalloc_dir)/src/base/synchronization_profiling.h',
129 '<(tcmalloc_dir)/src/base/sysinfo.cc',
130 '<(tcmalloc_dir)/src/base/sysinfo.h',
131 '<(tcmalloc_dir)/src/base/thread_annotations.h',
132 '<(tcmalloc_dir)/src/base/thread_lister.c',
133 '<(tcmalloc_dir)/src/base/thread_lister.h',
364 '<(tcmalloc_dir)/src/base/vdso_support.cc', 134 '<(tcmalloc_dir)/src/base/vdso_support.cc',
365 '<(tcmalloc_dir)/src/base/vdso_support.h', 135 '<(tcmalloc_dir)/src/base/vdso_support.h',
136 '<(tcmalloc_dir)/src/central_freelist.cc',
137 '<(tcmalloc_dir)/src/central_freelist.h',
138 '<(tcmalloc_dir)/src/common.cc',
139 '<(tcmalloc_dir)/src/common.h',
140 '<(tcmalloc_dir)/src/debugallocation.cc',
141 '<(tcmalloc_dir)/src/deep-heap-profile.cc',
142 '<(tcmalloc_dir)/src/deep-heap-profile.h',
143 '<(tcmalloc_dir)/src/free_list.cc',
144 '<(tcmalloc_dir)/src/free_list.h',
145 '<(tcmalloc_dir)/src/getpc.h',
146 '<(tcmalloc_dir)/src/gperftools/heap-checker.h',
147 '<(tcmalloc_dir)/src/gperftools/heap-profiler.h',
148 '<(tcmalloc_dir)/src/gperftools/malloc_extension.h',
149 '<(tcmalloc_dir)/src/gperftools/malloc_extension_c.h',
150 '<(tcmalloc_dir)/src/gperftools/malloc_hook.h',
151 '<(tcmalloc_dir)/src/gperftools/malloc_hook_c.h',
152 '<(tcmalloc_dir)/src/gperftools/profiler.h',
153 '<(tcmalloc_dir)/src/gperftools/stacktrace.h',
154 '<(tcmalloc_dir)/src/gperftools/tcmalloc.h',
155 '<(tcmalloc_dir)/src/heap-checker-bcad.cc',
156 '<(tcmalloc_dir)/src/heap-checker.cc',
157 '<(tcmalloc_dir)/src/heap-profile-table.cc',
158 '<(tcmalloc_dir)/src/heap-profile-table.h',
159 '<(tcmalloc_dir)/src/heap-profiler.cc',
160 '<(tcmalloc_dir)/src/internal_logging.cc',
161 '<(tcmalloc_dir)/src/internal_logging.h',
162 '<(tcmalloc_dir)/src/libc_override.h',
163 '<(tcmalloc_dir)/src/libc_override_gcc_and_weak.h',
164 '<(tcmalloc_dir)/src/libc_override_glibc.h',
165 '<(tcmalloc_dir)/src/libc_override_osx.h',
166 '<(tcmalloc_dir)/src/libc_override_redefine.h',
167 '<(tcmalloc_dir)/src/linked_list.h',
168 '<(tcmalloc_dir)/src/malloc_extension.cc',
169 '<(tcmalloc_dir)/src/malloc_hook-inl.h',
170 '<(tcmalloc_dir)/src/malloc_hook.cc',
171 '<(tcmalloc_dir)/src/malloc_hook_mmap_freebsd.h',
172 '<(tcmalloc_dir)/src/malloc_hook_mmap_linux.h',
366 '<(tcmalloc_dir)/src/maybe_threads.cc', 173 '<(tcmalloc_dir)/src/maybe_threads.cc',
367 '<(tcmalloc_dir)/src/maybe_threads.h', 174 '<(tcmalloc_dir)/src/maybe_threads.h',
175 '<(tcmalloc_dir)/src/memfs_malloc.cc',
176 '<(tcmalloc_dir)/src/memory_region_map.cc',
177 '<(tcmalloc_dir)/src/memory_region_map.h',
178 '<(tcmalloc_dir)/src/packed-cache-inl.h',
179 '<(tcmalloc_dir)/src/page_heap.cc',
180 '<(tcmalloc_dir)/src/page_heap.h',
181 '<(tcmalloc_dir)/src/page_heap_allocator.h',
182 '<(tcmalloc_dir)/src/pagemap.h',
183 '<(tcmalloc_dir)/src/profile-handler.cc',
184 '<(tcmalloc_dir)/src/profile-handler.h',
185 '<(tcmalloc_dir)/src/profiledata.cc',
186 '<(tcmalloc_dir)/src/profiledata.h',
187 '<(tcmalloc_dir)/src/profiler.cc',
188 '<(tcmalloc_dir)/src/raw_printer.cc',
189 '<(tcmalloc_dir)/src/raw_printer.h',
190 '<(tcmalloc_dir)/src/sampler.cc',
191 '<(tcmalloc_dir)/src/sampler.h',
192 '<(tcmalloc_dir)/src/span.cc',
193 '<(tcmalloc_dir)/src/span.h',
194 '<(tcmalloc_dir)/src/stack_trace_table.cc',
195 '<(tcmalloc_dir)/src/stack_trace_table.h',
196 '<(tcmalloc_dir)/src/stacktrace.cc',
197 '<(tcmalloc_dir)/src/stacktrace_arm-inl.h',
198 '<(tcmalloc_dir)/src/stacktrace_config.h',
199 '<(tcmalloc_dir)/src/stacktrace_generic-inl.h',
200 '<(tcmalloc_dir)/src/stacktrace_libunwind-inl.h',
201 '<(tcmalloc_dir)/src/stacktrace_powerpc-inl.h',
202 '<(tcmalloc_dir)/src/stacktrace_win32-inl.h',
203 '<(tcmalloc_dir)/src/stacktrace_with_context.cc',
204 '<(tcmalloc_dir)/src/stacktrace_x86-inl.h',
205 '<(tcmalloc_dir)/src/static_vars.cc',
206 '<(tcmalloc_dir)/src/static_vars.h',
207 '<(tcmalloc_dir)/src/symbolize.cc',
368 '<(tcmalloc_dir)/src/symbolize.h', 208 '<(tcmalloc_dir)/src/symbolize.h',
369 '<(tcmalloc_dir)/src/system-alloc.cc', 209 '<(tcmalloc_dir)/src/system-alloc.cc',
370 '<(tcmalloc_dir)/src/system-alloc.h', 210 '<(tcmalloc_dir)/src/system-alloc.h',
371 211 '<(tcmalloc_dir)/src/tcmalloc.cc',
372 # included by allocator_shim.cc 212 '<(tcmalloc_dir)/src/tcmalloc_guard.h',
373 'debugallocation_shim.cc', 213 '<(tcmalloc_dir)/src/thread_cache.cc',
374 214 '<(tcmalloc_dir)/src/thread_cache.h',
375 # heap-profiler/checker/cpuprofiler 215 '<(tcmalloc_dir)/src/windows/config.h',
376 '<(tcmalloc_dir)/src/base/thread_lister.c', 216 '<(tcmalloc_dir)/src/windows/get_mangled_names.cc',
377 '<(tcmalloc_dir)/src/base/thread_lister.h', 217 '<(tcmalloc_dir)/src/windows/gperftools/tcmalloc.h',
378 '<(tcmalloc_dir)/src/deep-heap-profile.cc', 218 '<(tcmalloc_dir)/src/windows/ia32_modrm_map.cc',
379 '<(tcmalloc_dir)/src/deep-heap-profile.h', 219 '<(tcmalloc_dir)/src/windows/ia32_opcode_map.cc',
380 '<(tcmalloc_dir)/src/heap-checker-bcad.cc', 220 '<(tcmalloc_dir)/src/windows/mingw.h',
381 '<(tcmalloc_dir)/src/heap-checker.cc', 221 '<(tcmalloc_dir)/src/windows/mini_disassembler.cc',
382 '<(tcmalloc_dir)/src/heap-profiler.cc', 222 '<(tcmalloc_dir)/src/windows/mini_disassembler.h',
383 '<(tcmalloc_dir)/src/heap-profile-table.cc', 223 '<(tcmalloc_dir)/src/windows/mini_disassembler_types.h',
384 '<(tcmalloc_dir)/src/heap-profile-table.h', 224 '<(tcmalloc_dir)/src/windows/override_functions.cc',
385 '<(tcmalloc_dir)/src/memory_region_map.cc', 225 '<(tcmalloc_dir)/src/windows/patch_functions.cc',
386 '<(tcmalloc_dir)/src/memory_region_map.h',
387 '<(tcmalloc_dir)/src/profiledata.cc',
388 '<(tcmalloc_dir)/src/profiledata.h',
389 '<(tcmalloc_dir)/src/profile-handler.cc',
390 '<(tcmalloc_dir)/src/profile-handler.h',
391 '<(tcmalloc_dir)/src/profiler.cc',
392 ],
393 }],
394 ['OS=="linux" or OS=="freebsd" or OS=="solaris"', {
395 'sources!': [
396 '<(tcmalloc_dir)/src/system-alloc.h',
397 '<(tcmalloc_dir)/src/windows/port.cc', 226 '<(tcmalloc_dir)/src/windows/port.cc',
398 '<(tcmalloc_dir)/src/windows/port.h', 227 '<(tcmalloc_dir)/src/windows/port.h',
228 '<(tcmalloc_dir)/src/windows/preamble_patcher.cc',
229 '<(tcmalloc_dir)/src/windows/preamble_patcher.h',
230 '<(tcmalloc_dir)/src/windows/preamble_patcher_with_stub.cc',
399 231
400 # TODO(willchan): Support allocator shim later on.
401 'allocator_shim.cc',
402
403 # TODO(willchan): support jemalloc on other platforms
404 # jemalloc files 232 # jemalloc files
405 '<(jemalloc_dir)/jemalloc.c', 233 '<(jemalloc_dir)/jemalloc.c',
406 '<(jemalloc_dir)/jemalloc.h', 234 '<(jemalloc_dir)/jemalloc.h',
407 '<(jemalloc_dir)/ql.h', 235 '<(jemalloc_dir)/ql.h',
408 '<(jemalloc_dir)/qr.h', 236 '<(jemalloc_dir)/qr.h',
409 '<(jemalloc_dir)/rb.h', 237 '<(jemalloc_dir)/rb.h',
410 238
411 ], 239 'allocator_shim.cc',
412 # We enable all warnings by default, but upstream disables a few. 240 'allocator_shim.h',
413 # Keep "-Wno-*" flags in sync with upstream by comparing against: 241 'debugallocation_shim.cc',
414 # http://code.google.com/p/google-perftools/source/browse/trunk/Makefi le.am 242 'generic_allocators.cc',
415 'cflags': [ 243 'win_allocator.cc',
416 '-Wno-sign-compare', 244 ],
417 '-Wno-unused-result', 245 # sources! means that these are not compiled directly.
418 ], 246 'sources!': [
419 'cflags!': [ 247 # Included by allocator_shim.cc for maximal inlining.
420 '-fvisibility=hidden', 248 'generic_allocators.cc',
421 ], 249 'win_allocator.cc',
250
251 # Included by debugallocation_shim.cc.
252 '<(tcmalloc_dir)/src/debugallocation.cc',
253 '<(tcmalloc_dir)/src/tcmalloc.cc',
254
255 # We simply don't use these, but list them above so that IDE
256 # users can view the full available source for reference, etc.
257 '<(tcmalloc_dir)/src/addressmap-inl.h',
258 '<(tcmalloc_dir)/src/base/atomicops-internals-linuxppc.h',
259 '<(tcmalloc_dir)/src/base/atomicops-internals-macosx.h',
260 '<(tcmalloc_dir)/src/base/atomicops-internals-x86-msvc.h',
261 '<(tcmalloc_dir)/src/base/atomicops-internals-x86.cc',
262 '<(tcmalloc_dir)/src/base/atomicops-internals-x86.h',
263 '<(tcmalloc_dir)/src/base/atomicops.h',
264 '<(tcmalloc_dir)/src/base/basictypes.h',
265 '<(tcmalloc_dir)/src/base/commandlineflags.h',
266 '<(tcmalloc_dir)/src/base/cycleclock.h',
267 '<(tcmalloc_dir)/src/base/elf_mem_image.h',
268 '<(tcmalloc_dir)/src/base/elfcore.h',
269 '<(tcmalloc_dir)/src/base/googleinit.h',
270 '<(tcmalloc_dir)/src/base/linux_syscall_support.h',
271 '<(tcmalloc_dir)/src/base/simple_mutex.h',
272 '<(tcmalloc_dir)/src/base/spinlock_linux-inl.h',
273 '<(tcmalloc_dir)/src/base/spinlock_posix-inl.h',
274 '<(tcmalloc_dir)/src/base/spinlock_win32-inl.h',
275 '<(tcmalloc_dir)/src/base/stl_allocator.h',
276 '<(tcmalloc_dir)/src/base/thread_annotations.h',
277 '<(tcmalloc_dir)/src/getpc.h',
278 '<(tcmalloc_dir)/src/gperftools/heap-checker.h',
279 '<(tcmalloc_dir)/src/gperftools/heap-profiler.h',
280 '<(tcmalloc_dir)/src/gperftools/malloc_extension.h',
281 '<(tcmalloc_dir)/src/gperftools/malloc_extension_c.h',
282 '<(tcmalloc_dir)/src/gperftools/malloc_hook.h',
283 '<(tcmalloc_dir)/src/gperftools/malloc_hook_c.h',
284 '<(tcmalloc_dir)/src/gperftools/profiler.h',
285 '<(tcmalloc_dir)/src/gperftools/stacktrace.h',
286 '<(tcmalloc_dir)/src/gperftools/tcmalloc.h',
287 '<(tcmalloc_dir)/src/libc_override.h',
288 '<(tcmalloc_dir)/src/libc_override_gcc_and_weak.h',
289 '<(tcmalloc_dir)/src/libc_override_glibc.h',
290 '<(tcmalloc_dir)/src/libc_override_osx.h',
291 '<(tcmalloc_dir)/src/libc_override_redefine.h',
292 '<(tcmalloc_dir)/src/malloc_hook_mmap_freebsd.h',
293 '<(tcmalloc_dir)/src/malloc_hook_mmap_linux.h',
294 '<(tcmalloc_dir)/src/memfs_malloc.cc',
295 '<(tcmalloc_dir)/src/packed-cache-inl.h',
296 '<(tcmalloc_dir)/src/page_heap_allocator.h',
297 '<(tcmalloc_dir)/src/pagemap.h',
298 '<(tcmalloc_dir)/src/stacktrace_arm-inl.h',
299 '<(tcmalloc_dir)/src/stacktrace_config.h',
300 '<(tcmalloc_dir)/src/stacktrace_generic-inl.h',
301 '<(tcmalloc_dir)/src/stacktrace_libunwind-inl.h',
302 '<(tcmalloc_dir)/src/stacktrace_powerpc-inl.h',
303 '<(tcmalloc_dir)/src/stacktrace_win32-inl.h',
304 '<(tcmalloc_dir)/src/stacktrace_with_context.cc',
305 '<(tcmalloc_dir)/src/stacktrace_x86-inl.h',
306 '<(tcmalloc_dir)/src/tcmalloc_guard.h',
307 '<(tcmalloc_dir)/src/windows/config.h',
308 '<(tcmalloc_dir)/src/windows/gperftools/tcmalloc.h',
309 '<(tcmalloc_dir)/src/windows/get_mangled_names.cc',
310 '<(tcmalloc_dir)/src/windows/ia32_modrm_map.cc',
311 '<(tcmalloc_dir)/src/windows/ia32_opcode_map.cc',
312 '<(tcmalloc_dir)/src/windows/mingw.h',
313 '<(tcmalloc_dir)/src/windows/mini_disassembler.cc',
314 '<(tcmalloc_dir)/src/windows/mini_disassembler.h',
315 '<(tcmalloc_dir)/src/windows/mini_disassembler_types.h',
316 '<(tcmalloc_dir)/src/windows/override_functions.cc',
317 '<(tcmalloc_dir)/src/windows/patch_functions.cc',
318 '<(tcmalloc_dir)/src/windows/preamble_patcher.cc',
319 '<(tcmalloc_dir)/src/windows/preamble_patcher.h',
320 '<(tcmalloc_dir)/src/windows/preamble_patcher_with_stub.cc',
321 ],
322 'dependencies': [
323 '../third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_ annotations',
324 ],
325 'msvs_settings': {
326 # TODO(sgk): merge this with build/common.gypi settings
327 'VCLibrarianTool': {
328 'AdditionalOptions': ['/ignore:4006,4221'],
329 'AdditionalLibraryDirectories':
330 ['<(DEPTH)/third_party/platformsdk_win7/files/Lib'],
331 },
332 'VCLinkerTool': {
333 'AdditionalOptions': ['/ignore:4006'],
334 },
335 },
336 'configurations': {
337 'Debug_Base': {
338 'msvs_settings': {
339 'VCCLCompilerTool': {
340 'RuntimeLibrary': '0',
341 },
342 },
343 'variables': {
344 # Provide a way to force disable debugallocation in Debug builds ,
345 # e.g. for profiling (it's more rare to profile Debug builds,
346 # but people sometimes need to do that).
347 'disable_debugallocation%': 0,
348 },
349 'conditions': [
350 # TODO(phajdan.jr): Also enable on Windows.
351 ['disable_debugallocation==0 and OS!="win"', {
352 'defines': [
353 # Use debugallocation for Debug builds to catch problems ear ly
354 # and cleanly, http://crbug.com/30715 .
355 'TCMALLOC_FOR_DEBUGALLOCATION',
356 ],
357 }],
358 ],
359 },
360 },
361 'conditions': [
362 ['OS=="linux" and clang_type_profiler==1', {
363 'dependencies': [
364 'type_profiler_tcmalloc',
365 ],
366 # It is undoing dependencies and cflags_cc for type_profiler which
367 # build/common.gypi injects into all targets.
368 'dependencies!': [
369 'type_profiler',
370 ],
371 'cflags_cc!': [
372 '-fintercept-allocation-functions',
373 ],
374 }],
375 ['OS=="win"', {
376 'defines': [
377 'PERFTOOLS_DLL_DECL=',
378 ],
379 'defines!': [
380 # tcmalloc source files unconditionally define this, remove it f rom
381 # the list of defines that common.gypi defines globally.
382 'NOMINMAX',
383 ],
384 'dependencies': [
385 'libcmt',
386 ],
387 'include_dirs': [
388 '<(jemalloc_dir)',
389 '<(tcmalloc_dir)/src/windows',
390 ],
391 'sources!': [
392 '<(tcmalloc_dir)/src/base/elf_mem_image.cc',
393 '<(tcmalloc_dir)/src/base/elf_mem_image.h',
394 '<(tcmalloc_dir)/src/base/linuxthreads.cc',
395 '<(tcmalloc_dir)/src/base/linuxthreads.h',
396 '<(tcmalloc_dir)/src/base/vdso_support.cc',
397 '<(tcmalloc_dir)/src/base/vdso_support.h',
398 '<(tcmalloc_dir)/src/maybe_threads.cc',
399 '<(tcmalloc_dir)/src/maybe_threads.h',
400 '<(tcmalloc_dir)/src/symbolize.h',
401 '<(tcmalloc_dir)/src/system-alloc.cc',
402 '<(tcmalloc_dir)/src/system-alloc.h',
403
404 # included by allocator_shim.cc
405 'debugallocation_shim.cc',
406
407 # heap-profiler/checker/cpuprofiler
408 '<(tcmalloc_dir)/src/base/thread_lister.c',
409 '<(tcmalloc_dir)/src/base/thread_lister.h',
410 '<(tcmalloc_dir)/src/deep-heap-profile.cc',
411 '<(tcmalloc_dir)/src/deep-heap-profile.h',
412 '<(tcmalloc_dir)/src/heap-checker-bcad.cc',
413 '<(tcmalloc_dir)/src/heap-checker.cc',
414 '<(tcmalloc_dir)/src/heap-profiler.cc',
415 '<(tcmalloc_dir)/src/heap-profile-table.cc',
416 '<(tcmalloc_dir)/src/heap-profile-table.h',
417 '<(tcmalloc_dir)/src/memory_region_map.cc',
418 '<(tcmalloc_dir)/src/memory_region_map.h',
419 '<(tcmalloc_dir)/src/profiledata.cc',
420 '<(tcmalloc_dir)/src/profiledata.h',
421 '<(tcmalloc_dir)/src/profile-handler.cc',
422 '<(tcmalloc_dir)/src/profile-handler.h',
423 '<(tcmalloc_dir)/src/profiler.cc',
424 ],
425 }],
426 ['OS=="linux" or OS=="freebsd" or OS=="solaris"', {
427 'sources!': [
428 '<(tcmalloc_dir)/src/system-alloc.h',
429 '<(tcmalloc_dir)/src/windows/port.cc',
430 '<(tcmalloc_dir)/src/windows/port.h',
431
432 # TODO(willchan): Support allocator shim later on.
433 'allocator_shim.cc',
434
435 # TODO(willchan): support jemalloc on other platforms
436 # jemalloc files
437 '<(jemalloc_dir)/jemalloc.c',
438 '<(jemalloc_dir)/jemalloc.h',
439 '<(jemalloc_dir)/ql.h',
440 '<(jemalloc_dir)/qr.h',
441 '<(jemalloc_dir)/rb.h',
442
443 ],
444 # We enable all warnings by default, but upstream disables a few.
445 # Keep "-Wno-*" flags in sync with upstream by comparing against:
446 # http://code.google.com/p/google-perftools/source/browse/trunk/Ma kefile.am
447 'cflags': [
448 '-Wno-sign-compare',
449 '-Wno-unused-result',
450 ],
451 'cflags!': [
452 '-fvisibility=hidden',
453 ],
454 'link_settings': {
455 'ldflags': [
456 # Don't let linker rip this symbol out, otherwise the heap&cpu
457 # profilers will not initialize properly on startup.
458 '-Wl,-uIsHeapProfilerRunning,-uProfilerStart',
459 # Do the same for heap leak checker.
460 '-Wl,-u_Z21InitialMallocHook_NewPKvj,-u_Z22InitialMallocHook_M MapPKvS0_jiiix,-u_Z22InitialMallocHook_SbrkPKvi',
461 '-Wl,-u_Z21InitialMallocHook_NewPKvm,-u_Z22InitialMallocHook_M MapPKvS0_miiil,-u_Z22InitialMallocHook_SbrkPKvl',
462 '-Wl,-u_ZN15HeapLeakChecker12IgnoreObjectEPKv,-u_ZN15HeapLeakC hecker14UnIgnoreObjectEPKv',
463 ]},
464 }],
465 [ 'use_vtable_verify==1', {
466 'cflags': [
467 '-fvtable-verify=preinit',
468 ],
469 }],
470 [ 'linux_keep_shadow_stacks==1', {
471 'sources': [
472 '<(tcmalloc_dir)/src/linux_shadow_stacks.cc',
473 '<(tcmalloc_dir)/src/linux_shadow_stacks.h',
474 '<(tcmalloc_dir)/src/stacktrace_shadow-inl.h',
475 ],
476 'cflags': [
477 '-finstrument-functions',
478 ],
479 'defines': [
480 'KEEP_SHADOW_STACKS',
481 ],
482 }],
483 [ 'linux_use_heapchecker==0', {
484 # Do not compile and link the heapchecker source.
485 'sources!': [
486 '<(tcmalloc_dir)/src/heap-checker-bcad.cc',
487 '<(tcmalloc_dir)/src/heap-checker.cc',
488 ],
489 # Disable the heap checker in tcmalloc.
490 'defines': [
491 'NO_HEAP_CHECK',
492 ],
493 }],
494 [ 'clang==1', {
495 'cflags': [
496 '-Wno-non-literal-null-conversion',
497 ],
498 }],
499 ['order_profiling != 0', {
500 'target_conditions' : [
501 ['_toolset=="target"', {
502 'cflags!': [ '-finstrument-functions' ],
503 }],
504 ],
505 }],
506 ],
507 },
508 {
509 # See allocator_headers in use_system_tcmalloc == 1 branch.
510 'target_name': 'allocator_headers',
511 'type': 'none',
512 },
513 ],
514 }, { # use_system_tcmalloc == 1
515 'targets': [
516 # Only executables and not libraries should depend on the
517 # allocator target; only the application (the final executable)
518 # knows what allocator makes sense.
519 {
520 'target_name': 'allocator',
521 'type': 'none',
422 'link_settings': { 522 'link_settings': {
423 'ldflags': [ 523 'ldflags': [
424 # Don't let linker rip this symbol out, otherwise the heap&cpu 524 '<!@(pkg-config --libs-only-L --libs-only-other libtcmalloc)',
425 # profilers will not initialize properly on startup. 525 ],
426 '-Wl,-uIsHeapProfilerRunning,-uProfilerStart', 526 'libraries': [
427 # Do the same for heap leak checker. 527 '<!@(pkg-config --libs-only-l libtcmalloc)',
428 '-Wl,-u_Z21InitialMallocHook_NewPKvj,-u_Z22InitialMallocHook_MMapP KvS0_jiiix,-u_Z22InitialMallocHook_SbrkPKvi', 528 ],
429 '-Wl,-u_Z21InitialMallocHook_NewPKvm,-u_Z22InitialMallocHook_MMapP KvS0_miiil,-u_Z22InitialMallocHook_SbrkPKvl', 529 },
430 '-Wl,-u_ZN15HeapLeakChecker12IgnoreObjectEPKv,-u_ZN15HeapLeakCheck er14UnIgnoreObjectEPKv', 530 },
431 ]}, 531 {
432 }], 532 'target_name': 'allocator_headers',
433 [ 'use_vtable_verify==1', { 533 'type': 'none',
434 'cflags': [ 534 'direct_dependent_settings': {
435 '-fvtable-verify=preinit', 535 'cflags': [
436 ], 536 '<!@(pkg-config --cflags libtcmalloc)',
437 }], 537 ],
438 [ 'linux_keep_shadow_stacks==1', { 538 'defines': [
439 'sources': [ 539 'USE_SYSTEM_TCMALLOC',
440 '<(tcmalloc_dir)/src/linux_shadow_stacks.cc', 540 ],
441 '<(tcmalloc_dir)/src/linux_shadow_stacks.h', 541 },
442 '<(tcmalloc_dir)/src/stacktrace_shadow-inl.h', 542 'variables': {
443 ], 543 'headers_root_path': '<(tcmalloc_dir)/src/gperftools',
444 'cflags': [ 544 'header_filenames': [
445 '-finstrument-functions', 545 'heap-checker.h',
446 ], 546 'heap-profiler.h',
447 'defines': [ 547 'malloc_extension.h',
448 'KEEP_SHADOW_STACKS', 548 'malloc_extension_c.h',
449 ], 549 'malloc_hook.h',
450 }], 550 'malloc_hook_c.h',
451 [ 'linux_use_heapchecker==0', { 551 'profiler.h',
452 # Do not compile and link the heapchecker source. 552 'stacktrace.h',
453 'sources!': [ 553 'tcmalloc.h',
454 '<(tcmalloc_dir)/src/heap-checker-bcad.cc', 554 ],
455 '<(tcmalloc_dir)/src/heap-checker.cc', 555 'shim_generator_additional_args': [
456 ], 556 '--prefix', 'google/',
457 # Disable the heap checker in tcmalloc. 557 ],
458 'defines': [ 558 },
459 'NO_HEAP_CHECK', 559 'includes': [
460 ], 560 '../../build/shim_headers.gypi',
461 }], 561 ],
462 [ 'clang==1', { 562 },
463 'cflags': [
464 '-Wno-non-literal-null-conversion',
465 ],
466 }],
467 ['order_profiling != 0', {
468 'target_conditions' : [
469 ['_toolset=="target"', {
470 'cflags!': [ '-finstrument-functions' ],
471 }],
472 ],
473 }],
474 ], 563 ],
475 }, 564 }],
476 {
477 # This library is linked in to src/base.gypi:base and allocator_unittests
478 # It can't depend on either and nothing else should depend on it - all
479 # other code should use the interfaced provided by base.
480 'target_name': 'allocator_extension_thunks',
481 'type': 'static_library',
482 'sources': [
483 'allocator_extension_thunks.cc',
484 'allocator_extension_thunks.h',
485 ],
486 'toolsets': ['host', 'target'],
487 'include_dirs': [
488 '../../'
489 ],
490 'conditions': [
491 ['OS=="linux" and clang_type_profiler==1', {
492 # It is undoing dependencies and cflags_cc for type_profiler which
493 # build/common.gypi injects into all targets.
494 'dependencies!': [
495 'type_profiler',
496 ],
497 'cflags_cc!': [
498 '-fintercept-allocation-functions',
499 ],
500 }],
501 ],
502 },
503 ],
504 'conditions': [
505 ['OS=="win"', { 565 ['OS=="win"', {
506 'targets': [ 566 'targets': [
507 { 567 {
508 'target_name': 'libcmt', 568 'target_name': 'libcmt',
509 'type': 'none', 569 'type': 'none',
510 'actions': [ 570 'actions': [
511 { 571 {
512 'action_name': 'libcmt', 572 'action_name': 'libcmt',
513 'inputs': [ 573 'inputs': [
514 'prep_libc.py', 574 'prep_libc.py',
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 'sources': [ 727 'sources': [
668 'type_profiler_map_unittests.cc', 728 'type_profiler_map_unittests.cc',
669 '<(tcmalloc_dir)/src/gperftools/type_profiler_map.h', 729 '<(tcmalloc_dir)/src/gperftools/type_profiler_map.h',
670 '<(tcmalloc_dir)/src/type_profiler_map.cc', 730 '<(tcmalloc_dir)/src/type_profiler_map.cc',
671 ], 731 ],
672 }, 732 },
673 ], 733 ],
674 }], 734 }],
675 ], 735 ],
676 } 736 }
OLDNEW
« no previous file with comments | « no previous file | chrome/chrome_renderer.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698