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

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

Issue 12298019: Revert 183089 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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,
10 'use_vtable_verify%': 0, 9 'use_vtable_verify%': 0,
11 }, 10 },
12 'targets': [ 11 '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.
13 { 15 {
14 # This library is linked in to src/base.gypi:base and allocator_unittests 16 'target_name': 'allocator',
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',
18 'type': 'static_library', 17 'type': 'static_library',
18 # Make sure the allocation library is optimized to
19 # the hilt in official builds.
20 'variables': {
21 'optimize': 'max',
22 },
23 'include_dirs': [
24 '.',
25 '<(tcmalloc_dir)/src/base',
26 '<(tcmalloc_dir)/src',
27 '../..',
28 ],
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 },
19 'sources': [ 50 'sources': [
20 'allocator_extension_thunks.cc', 51 # Generated for our configuration from tcmalloc's build
21 'allocator_extension_thunks.h', 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',
22 ], 212 ],
23 'toolsets': ['host', 'target'], 213 # sources! means that these are not compiled directly.
24 'include_dirs': [ 214 'sources!': [
25 '../../' 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',
26 ], 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 },
27 'conditions': [ 329 'conditions': [
28 ['OS=="linux" and clang_type_profiler==1', { 330 ['OS=="linux" and clang_type_profiler==1', {
331 'dependencies': [
332 'type_profiler_tcmalloc',
333 ],
29 # It is undoing dependencies and cflags_cc for type_profiler which 334 # It is undoing dependencies and cflags_cc for type_profiler which
30 # build/common.gypi injects into all targets. 335 # build/common.gypi injects into all targets.
31 'dependencies!': [ 336 'dependencies!': [
32 'type_profiler', 337 'type_profiler',
33 ], 338 ],
34 'cflags_cc!': [ 339 'cflags_cc!': [
35 '-fintercept-allocation-functions', 340 '-fintercept-allocation-functions',
36 ], 341 ],
37 }], 342 }],
38 ], 343 ['OS=="win"', {
39 }, 344 'defines': [
40 ], 345 'PERFTOOLS_DLL_DECL=',
41 'conditions': [ 346 ],
42 ['use_system_tcmalloc == 0', { 347 'defines!': [
43 'targets': [ 348 # tcmalloc source files unconditionally define this, remove it from
44 # Only executables and not libraries should depend on the 349 # the list of defines that common.gypi defines globally.
45 # allocator target; only the application (the final executable) 350 'NOMINMAX',
46 # knows what allocator makes sense. 351 ],
47 { 352 'dependencies': [
48 'target_name': 'allocator', 353 'libcmt',
49 'type': 'static_library', 354 ],
50 # Make sure the allocation library is optimized to
51 # the hilt in official builds.
52 'variables': {
53 'optimize': 'max',
54 },
55 'include_dirs': [ 355 'include_dirs': [
56 '.', 356 '<(jemalloc_dir)',
57 '<(tcmalloc_dir)/src/base', 357 '<(tcmalloc_dir)/src/windows',
58 '<(tcmalloc_dir)/src',
59 '../..',
60 ], 358 ],
61 'direct_dependent_settings': { 359 'sources!': [
62 'configurations': {
63 'Common_Base': {
64 'msvs_settings': {
65 'VCLinkerTool': {
66 'IgnoreDefaultLibraryNames': ['libcmtd.lib', 'libcmt.lib'],
67 'AdditionalDependencies': [
68 '<(SHARED_INTERMEDIATE_DIR)/allocator/libcmt.lib'
69 ],
70 },
71 },
72 },
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',
108 '<(tcmalloc_dir)/src/base/elf_mem_image.cc', 360 '<(tcmalloc_dir)/src/base/elf_mem_image.cc',
109 '<(tcmalloc_dir)/src/base/elf_mem_image.h', 361 '<(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',
113 '<(tcmalloc_dir)/src/base/linuxthreads.cc', 362 '<(tcmalloc_dir)/src/base/linuxthreads.cc',
114 '<(tcmalloc_dir)/src/base/linuxthreads.h', 363 '<(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',
134 '<(tcmalloc_dir)/src/base/vdso_support.cc', 364 '<(tcmalloc_dir)/src/base/vdso_support.cc',
135 '<(tcmalloc_dir)/src/base/vdso_support.h', 365 '<(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',
173 '<(tcmalloc_dir)/src/maybe_threads.cc', 366 '<(tcmalloc_dir)/src/maybe_threads.cc',
174 '<(tcmalloc_dir)/src/maybe_threads.h', 367 '<(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',
208 '<(tcmalloc_dir)/src/symbolize.h', 368 '<(tcmalloc_dir)/src/symbolize.h',
209 '<(tcmalloc_dir)/src/system-alloc.cc', 369 '<(tcmalloc_dir)/src/system-alloc.cc',
210 '<(tcmalloc_dir)/src/system-alloc.h', 370 '<(tcmalloc_dir)/src/system-alloc.h',
211 '<(tcmalloc_dir)/src/tcmalloc.cc', 371
212 '<(tcmalloc_dir)/src/tcmalloc_guard.h', 372 # included by allocator_shim.cc
213 '<(tcmalloc_dir)/src/thread_cache.cc', 373 'debugallocation_shim.cc',
214 '<(tcmalloc_dir)/src/thread_cache.h', 374
215 '<(tcmalloc_dir)/src/windows/config.h', 375 # heap-profiler/checker/cpuprofiler
216 '<(tcmalloc_dir)/src/windows/get_mangled_names.cc', 376 '<(tcmalloc_dir)/src/base/thread_lister.c',
217 '<(tcmalloc_dir)/src/windows/gperftools/tcmalloc.h', 377 '<(tcmalloc_dir)/src/base/thread_lister.h',
218 '<(tcmalloc_dir)/src/windows/ia32_modrm_map.cc', 378 '<(tcmalloc_dir)/src/deep-heap-profile.cc',
219 '<(tcmalloc_dir)/src/windows/ia32_opcode_map.cc', 379 '<(tcmalloc_dir)/src/deep-heap-profile.h',
220 '<(tcmalloc_dir)/src/windows/mingw.h', 380 '<(tcmalloc_dir)/src/heap-checker-bcad.cc',
221 '<(tcmalloc_dir)/src/windows/mini_disassembler.cc', 381 '<(tcmalloc_dir)/src/heap-checker.cc',
222 '<(tcmalloc_dir)/src/windows/mini_disassembler.h', 382 '<(tcmalloc_dir)/src/heap-profiler.cc',
223 '<(tcmalloc_dir)/src/windows/mini_disassembler_types.h', 383 '<(tcmalloc_dir)/src/heap-profile-table.cc',
224 '<(tcmalloc_dir)/src/windows/override_functions.cc', 384 '<(tcmalloc_dir)/src/heap-profile-table.h',
225 '<(tcmalloc_dir)/src/windows/patch_functions.cc', 385 '<(tcmalloc_dir)/src/memory_region_map.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',
226 '<(tcmalloc_dir)/src/windows/port.cc', 397 '<(tcmalloc_dir)/src/windows/port.cc',
227 '<(tcmalloc_dir)/src/windows/port.h', 398 '<(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',
231 399
400 # TODO(willchan): Support allocator shim later on.
401 'allocator_shim.cc',
402
403 # TODO(willchan): support jemalloc on other platforms
232 # jemalloc files 404 # jemalloc files
233 '<(jemalloc_dir)/jemalloc.c', 405 '<(jemalloc_dir)/jemalloc.c',
234 '<(jemalloc_dir)/jemalloc.h', 406 '<(jemalloc_dir)/jemalloc.h',
235 '<(jemalloc_dir)/ql.h', 407 '<(jemalloc_dir)/ql.h',
236 '<(jemalloc_dir)/qr.h', 408 '<(jemalloc_dir)/qr.h',
237 '<(jemalloc_dir)/rb.h', 409 '<(jemalloc_dir)/rb.h',
238 410
239 'allocator_shim.cc',
240 'allocator_shim.h',
241 'debugallocation_shim.cc',
242 'generic_allocators.cc',
243 'win_allocator.cc',
244 ], 411 ],
245 # sources! means that these are not compiled directly. 412 # We enable all warnings by default, but upstream disables a few.
413 # Keep "-Wno-*" flags in sync with upstream by comparing against:
414 # http://code.google.com/p/google-perftools/source/browse/trunk/Makefi le.am
415 'cflags': [
416 '-Wno-sign-compare',
417 '-Wno-unused-result',
418 ],
419 'cflags!': [
420 '-fvisibility=hidden',
421 ],
422 'link_settings': {
423 'ldflags': [
424 # Don't let linker rip this symbol out, otherwise the heap&cpu
425 # profilers will not initialize properly on startup.
426 '-Wl,-uIsHeapProfilerRunning,-uProfilerStart',
427 # Do the same for heap leak checker.
428 '-Wl,-u_Z21InitialMallocHook_NewPKvj,-u_Z22InitialMallocHook_MMapP KvS0_jiiix,-u_Z22InitialMallocHook_SbrkPKvi',
429 '-Wl,-u_Z21InitialMallocHook_NewPKvm,-u_Z22InitialMallocHook_MMapP KvS0_miiil,-u_Z22InitialMallocHook_SbrkPKvl',
430 '-Wl,-u_ZN15HeapLeakChecker12IgnoreObjectEPKv,-u_ZN15HeapLeakCheck er14UnIgnoreObjectEPKv',
431 ]},
432 }],
433 [ 'use_vtable_verify==1', {
434 'cflags': [
435 '-fvtable-verify=preinit',
436 ],
437 }],
438 [ 'linux_keep_shadow_stacks==1', {
439 'sources': [
440 '<(tcmalloc_dir)/src/linux_shadow_stacks.cc',
441 '<(tcmalloc_dir)/src/linux_shadow_stacks.h',
442 '<(tcmalloc_dir)/src/stacktrace_shadow-inl.h',
443 ],
444 'cflags': [
445 '-finstrument-functions',
446 ],
447 'defines': [
448 'KEEP_SHADOW_STACKS',
449 ],
450 }],
451 [ 'linux_use_heapchecker==0', {
452 # Do not compile and link the heapchecker source.
246 'sources!': [ 453 'sources!': [
247 # Included by allocator_shim.cc for maximal inlining. 454 '<(tcmalloc_dir)/src/heap-checker-bcad.cc',
248 'generic_allocators.cc', 455 '<(tcmalloc_dir)/src/heap-checker.cc',
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 ], 456 ],
322 'dependencies': [ 457 # Disable the heap checker in tcmalloc.
323 '../third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_ annotations', 458 'defines': [
459 'NO_HEAP_CHECK',
460 ],
461 }],
462 [ 'clang==1', {
463 'cflags': [
464 '-Wno-non-literal-null-conversion',
324 ], 465 ],
325 'msvs_settings': { 466 }],
326 # TODO(sgk): merge this with build/common.gypi settings 467 ['order_profiling != 0', {
327 'VCLibrarianTool': { 468 'target_conditions' : [
328 'AdditionalOptions': ['/ignore:4006,4221'], 469 ['_toolset=="target"', {
329 'AdditionalLibraryDirectories': 470 'cflags!': [ '-finstrument-functions' ],
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 }], 471 }],
506 ], 472 ],
507 }, 473 }],
508 {
509 # See allocator_headers in use_system_tcmalloc == 1 branch.
510 'target_name': 'allocator_headers',
511 'type': 'none',
512 },
513 ], 474 ],
514 }, { # use_system_tcmalloc == 1 475 },
515 'targets': [ 476 {
516 # Only executables and not libraries should depend on the 477 # This library is linked in to src/base.gypi:base and allocator_unittests
517 # allocator target; only the application (the final executable) 478 # It can't depend on either and nothing else should depend on it - all
518 # knows what allocator makes sense. 479 # other code should use the interfaced provided by base.
519 { 480 'target_name': 'allocator_extension_thunks',
520 'target_name': 'allocator', 481 'type': 'static_library',
521 'type': 'none', 482 'sources': [
522 'link_settings': { 483 'allocator_extension_thunks.cc',
523 'ldflags': [ 484 'allocator_extension_thunks.h',
524 '<!@(pkg-config --libs-only-L --libs-only-other libtcmalloc)', 485 ],
525 ], 486 'toolsets': ['host', 'target'],
526 'libraries': [ 487 'include_dirs': [
527 '<!@(pkg-config --libs-only-l libtcmalloc)', 488 '../../'
528 ], 489 ],
529 }, 490 'conditions': [
530 }, 491 ['OS=="linux" and clang_type_profiler==1', {
531 { 492 # It is undoing dependencies and cflags_cc for type_profiler which
532 'target_name': 'allocator_headers', 493 # build/common.gypi injects into all targets.
533 'type': 'none', 494 'dependencies!': [
534 'direct_dependent_settings': { 495 'type_profiler',
535 'cflags': [
536 '<!@(pkg-config --cflags libtcmalloc)',
537 ],
538 'defines': [
539 'USE_SYSTEM_TCMALLOC',
540 ],
541 },
542 'variables': {
543 'headers_root_path': '<(tcmalloc_dir)/src/gperftools',
544 'header_filenames': [
545 'heap-checker.h',
546 'heap-profiler.h',
547 'malloc_extension.h',
548 'malloc_extension_c.h',
549 'malloc_hook.h',
550 'malloc_hook_c.h',
551 'profiler.h',
552 'stacktrace.h',
553 'tcmalloc.h',
554 ],
555 'shim_generator_additional_args': [
556 '--prefix', 'google/',
557 ],
558 },
559 'includes': [
560 '../../build/shim_headers.gypi',
561 ], 496 ],
562 }, 497 'cflags_cc!': [
498 '-fintercept-allocation-functions',
499 ],
500 }],
563 ], 501 ],
564 }], 502 },
503 ],
504 'conditions': [
565 ['OS=="win"', { 505 ['OS=="win"', {
566 'targets': [ 506 'targets': [
567 { 507 {
568 'target_name': 'libcmt', 508 'target_name': 'libcmt',
569 'type': 'none', 509 'type': 'none',
570 'actions': [ 510 'actions': [
571 { 511 {
572 'action_name': 'libcmt', 512 'action_name': 'libcmt',
573 'inputs': [ 513 'inputs': [
574 'prep_libc.py', 514 'prep_libc.py',
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
727 'sources': [ 667 'sources': [
728 'type_profiler_map_unittests.cc', 668 'type_profiler_map_unittests.cc',
729 '<(tcmalloc_dir)/src/gperftools/type_profiler_map.h', 669 '<(tcmalloc_dir)/src/gperftools/type_profiler_map.h',
730 '<(tcmalloc_dir)/src/type_profiler_map.cc', 670 '<(tcmalloc_dir)/src/type_profiler_map.cc',
731 ], 671 ],
732 }, 672 },
733 ], 673 ],
734 }], 674 }],
735 ], 675 ],
736 } 676 }
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