1 # Copyright 2014 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.
5 config("tools_config") {
6 include_dirs = [ "src", "src/third_party" ]
8 defines = [ "__ANDROID__" ]
11 cflags = [ "-Wno-tautological-constant-out-of-range-compare" ]
15 config("internal_config") {
16 include_dirs = [ "src" ]
19 # This is needed for GTMLogger to work correctly.
20 defines += [ "DEBUG" ]
23 defines += [ "__ANDROID__" ]
27 config("client_config") {
28 include_dirs = [ "src" ]
30 include_dirs += [ "src/common/android/include" ]
35 # minidump_stackwalk and minidump_dump are tool-type executables that do
37 if (current_toolchain == host_toolchain && !is_win) {
38 executable("minidump_stackwalk") {
40 "src/processor/basic_code_module.h",
41 "src/processor/basic_code_modules.cc",
42 "src/processor/basic_code_modules.h",
43 "src/processor/basic_source_line_resolver.cc",
44 "src/processor/binarystream.cc",
45 "src/processor/binarystream.h",
46 "src/processor/call_stack.cc",
47 "src/processor/cfi_frame_info.cc",
48 "src/processor/cfi_frame_info.h",
49 "src/processor/disassembler_x86.cc",
50 "src/processor/disassembler_x86.h",
51 "src/processor/exploitability.cc",
52 "src/processor/logging.cc",
53 "src/processor/logging.h",
54 "src/processor/minidump.cc",
55 "src/processor/minidump_processor.cc",
56 "src/processor/minidump_stackwalk.cc",
57 "src/processor/pathname_stripper.cc",
58 "src/processor/pathname_stripper.h",
59 "src/processor/process_state.cc",
60 "src/processor/simple_symbol_supplier.cc",
61 "src/processor/simple_symbol_supplier.h",
62 "src/processor/source_line_resolver_base.cc",
63 "src/processor/stack_frame_cpu.cc",
64 "src/processor/stack_frame_symbolizer.cc",
65 "src/processor/stackwalker.cc",
66 "src/processor/stackwalker_amd64.cc",
67 "src/processor/stackwalker_amd64.h",
68 "src/processor/stackwalker_arm.cc",
69 "src/processor/stackwalker_arm.h",
70 "src/processor/stackwalker_arm64.cc",
71 "src/processor/stackwalker_arm64.h",
72 "src/processor/stackwalker_mips.cc",
73 "src/processor/stackwalker_mips.h",
74 "src/processor/stackwalker_ppc.cc",
75 "src/processor/stackwalker_ppc.h",
76 "src/processor/stackwalker_ppc64.cc",
77 "src/processor/stackwalker_ppc64.h",
78 "src/processor/stackwalker_sparc.cc",
79 "src/processor/stackwalker_sparc.h",
80 "src/processor/stackwalker_x86.cc",
81 "src/processor/stackwalker_x86.h",
82 "src/processor/tokenize.cc",
83 "src/processor/tokenize.h",
85 "src/third_party/libdisasm/ia32_implicit.c",
86 "src/third_party/libdisasm/ia32_implicit.h",
87 "src/third_party/libdisasm/ia32_insn.c",
88 "src/third_party/libdisasm/ia32_insn.h",
89 "src/third_party/libdisasm/ia32_invariant.c",
90 "src/third_party/libdisasm/ia32_invariant.h",
91 "src/third_party/libdisasm/ia32_modrm.c",
92 "src/third_party/libdisasm/ia32_modrm.h",
93 "src/third_party/libdisasm/ia32_opcode_tables.c",
94 "src/third_party/libdisasm/ia32_opcode_tables.h",
95 "src/third_party/libdisasm/ia32_operand.c",
96 "src/third_party/libdisasm/ia32_operand.h",
97 "src/third_party/libdisasm/ia32_reg.c",
98 "src/third_party/libdisasm/ia32_reg.h",
99 "src/third_party/libdisasm/ia32_settings.c",
100 "src/third_party/libdisasm/ia32_settings.h",
101 "src/third_party/libdisasm/libdis.h",
102 "src/third_party/libdisasm/qword.h",
103 "src/third_party/libdisasm/x86_disasm.c",
104 "src/third_party/libdisasm/x86_format.c",
105 "src/third_party/libdisasm/x86_imm.c",
106 "src/third_party/libdisasm/x86_imm.h",
107 "src/third_party/libdisasm/x86_insn.c",
108 "src/third_party/libdisasm/x86_misc.c",
109 "src/third_party/libdisasm/x86_operand_list.c",
110 "src/third_party/libdisasm/x86_operand_list.h",
113 defines = [ "BPLOG_MINIMUM_SEVERITY=SEVERITY_ERROR" ]
115 configs -= [ "//build/config/compiler:chromium_code" ]
116 configs += [ "//build/config/compiler:no_chromium_code" ]
117 configs += [ ":tools_config" ]
119 # Always want these files included regardless of platform.
120 set_sources_assignment_filter([])
122 "src/processor/exploitability_linux.cc",
123 "src/processor/exploitability_linux.h",
124 "src/processor/exploitability_win.cc",
125 "src/processor/exploitability_win.h",
129 executable("minidump_dump") {
131 "src/processor/basic_code_module.h",
132 "src/processor/basic_code_modules.cc",
133 "src/processor/basic_code_modules.h",
134 "src/processor/logging.cc",
135 "src/processor/logging.h",
136 "src/processor/minidump.cc",
137 "src/processor/minidump_dump.cc",
138 "src/processor/pathname_stripper.cc",
139 "src/processor/pathname_stripper.h",
142 configs += [ ":tools_config" ]
146 # Mac --------------------------------------------------------------------------
148 if (current_toolchain == host_toolchain && is_mac) {
149 # TODO(GYP) This should be only 64-bit on Mac. From .gypi:
150 # Like ld, dump_syms needs to operate on enough data that it may
151 # actually need to be able to address more than 4GB. Use x86_64.
152 # Don't worry! An x86_64 dump_syms is perfectly able to dump
154 executable("dump_syms") {
156 "src/common/dwarf/bytereader.cc",
157 "src/common/dwarf_cfi_to_module.cc",
158 "src/common/dwarf_cu_to_module.cc",
159 "src/common/dwarf/dwarf2diehandler.cc",
160 "src/common/dwarf/dwarf2reader.cc",
161 "src/common/dwarf_line_to_module.cc",
162 "src/common/language.cc",
163 "src/common/mac/arch_utilities.cc",
164 "src/common/mac/arch_utilities.h",
165 "src/common/mac/dump_syms.mm",
166 "src/common/mac/file_id.cc",
167 "src/common/mac/macho_id.cc",
168 "src/common/mac/macho_reader.cc",
169 "src/common/mac/macho_utilities.cc",
170 "src/common/mac/macho_walker.cc",
172 "src/common/module.cc",
173 "src/common/stabs_reader.cc",
174 "src/common/stabs_to_module.cc",
175 "src/tools/mac/dump_syms/dump_syms_tool.mm",
178 # For src/common/stabs_reader.h.
179 defines = [ "HAVE_MACH_O_NLIST_H" ]
180 include_dirs = [ "src/common/mac" ]
182 # The DWARF utilities require -funsigned-char.
183 cflags = [ "-funsigned-char" ]
185 configs += [ ":internal_config" ]
187 configs -= [ "//build/config/compiler:chromium_code" ]
188 configs += [ "//build/config/compiler:no_chromium_code" ]
190 # dwarf2reader.cc uses dynamic_cast.
191 configs -= [ "//build/config/compiler:no_rtti" ]
192 configs += [ "//build/config/compiler:rtti" ]
194 libs = [ "Foundation.framework" ]
197 # dump_syms crashes when built at -O1, -O2, and -O3. It does
198 # not crash at -Os. To play it safe, dump_syms is always built
199 # at -O0 until this can be sorted out.
200 # http://code.google.com/p/google-breakpad/issues/detail?id=329
201 configs -= [ "//build/config/compiler:optimize" ]
206 executable("symupload") {
208 "src/common/mac/HTTPMultipartUpload.m",
209 "src/tools/mac/symupload/symupload.m",
212 libs = [ "Foundaction.framework" ]
217 static_library("utilities") {
219 "src/client/mac/handler/breakpad_nlist_64.cc",
220 "src/client/mac/handler/dynamic_images.cc",
221 "src/client/mac/handler/minidump_generator.cc",
222 "src/client/minidump_file_writer.cc",
223 "src/common/convert_UTF.c",
224 "src/common/mac/MachIPC.mm",
225 "src/common/mac/arch_utilities.cc",
226 "src/common/mac/bootstrap_compat.cc",
227 "src/common/mac/file_id.cc",
228 "src/common/mac/macho_id.cc",
229 "src/common/mac/macho_utilities.cc",
230 "src/common/mac/macho_walker.cc",
231 "src/common/mac/string_utilities.cc",
233 "src/common/simple_string_dictionary.cc",
234 "src/common/string_conversion.cc",
237 configs += [ ":internal_config" ]
240 executable("crash_inspector") {
242 "src/client/mac/crash_generation/ConfigFile.mm",
243 "src/client/mac/crash_generation/Inspector.mm",
244 "src/client/mac/crash_generation/InspectorMain.mm",
247 # TODO(GYP): 'mac_real_dsym': 1,
250 "src/client/apple/Framework",
255 "CoreServices.framework",
256 "Foundation.framework",
264 executable("crash_report_sender") {
265 # TODO(GYP) this target has some mac_bundle_resources stuff.
268 config("breakpad_config") {
269 include_dirs = [ "src/client/apple/Framework" ]
272 static_library("breakpad") {
274 "src/client/mac/crash_generation/crash_generation_client.cc",
275 "src/client/mac/crash_generation/crash_generation_client.h",
276 "src/client/mac/handler/protected_memory_allocator.cc",
277 "src/client/mac/handler/exception_handler.cc",
278 "src/client/mac/Framework/Breakpad.mm",
279 "src/client/mac/Framework/OnDemandServer.mm",
282 configs += [ ":internal_config" ]
283 direct_dependent_configs = [ ":breakpad_config" ]
285 defines = [ "USE_PROTECTED_ALLOCATIONS=1" ]
287 "src/client/apple/Framework",
293 # TODO(GYP): Make this link
294 #":crash_report_sender",
299 direct_dependent_configs = [ ":client_config" ]
303 if (is_linux || is_android) {
304 executable("symupload") {
306 "src/tools/linux/symupload/sym_upload.cc",
307 "src/common/linux/http_upload.cc",
308 "src/common/linux/http_upload.h",
316 configs += [ ":tools_config" ]
322 if (is_linux && current_toolchain == host_toolchain) {
323 executable("dump_syms") {
325 "src/common/dwarf/bytereader.cc",
326 "src/common/dwarf_cfi_to_module.cc",
327 "src/common/dwarf_cfi_to_module.h",
328 "src/common/dwarf_cu_to_module.cc",
329 "src/common/dwarf_cu_to_module.h",
330 "src/common/dwarf/dwarf2diehandler.cc",
331 "src/common/dwarf/dwarf2reader.cc",
332 "src/common/dwarf_line_to_module.cc",
333 "src/common/dwarf_line_to_module.h",
334 "src/common/language.cc",
335 "src/common/language.h",
336 "src/common/linux/crc32.cc",
337 "src/common/linux/crc32.h",
338 "src/common/linux/dump_symbols.cc",
339 "src/common/linux/dump_symbols.h",
340 "src/common/linux/elf_symbols_to_module.cc",
341 "src/common/linux/elf_symbols_to_module.h",
342 "src/common/linux/elfutils.cc",
343 "src/common/linux/elfutils.h",
344 "src/common/linux/file_id.cc",
345 "src/common/linux/file_id.h",
346 "src/common/linux/linux_libc_support.cc",
347 "src/common/linux/linux_libc_support.h",
348 "src/common/linux/memory_mapped_file.cc",
349 "src/common/linux/memory_mapped_file.h",
350 "src/common/linux/guid_creator.h",
351 "src/common/module.cc",
352 "src/common/module.h",
353 "src/common/stabs_reader.cc",
354 "src/common/stabs_reader.h",
355 "src/common/stabs_to_module.cc",
356 "src/common/stabs_to_module.h",
357 "src/tools/linux/dump_syms/dump_syms.cc",
360 # There are some warnings in this code.
361 configs -= [ "//build/config/compiler:chromium_code" ]
362 configs += [ "//build/config/compiler:no_chromium_code" ]
364 # dwarf2reader.cc uses dynamic_cast. Because we don't typically
365 # don't support RTTI, we enable it for this single target. Since
366 # dump_syms doesn't share any object files with anything else,
367 # this doesn't end up polluting Chrome itself.
368 configs -= [ "//build/config/compiler:no_rtti" ]
369 configs += [ "//build/config/compiler:rtti" ]
371 # Breakpad rev 583 introduced this flag.
372 # Using this define, stabs_reader.h will include a.out.h to
374 defines = [ "HAVE_A_OUT_H" ]
376 include_dirs = [ "src" ]
379 static_library("client") {
381 "src/client/linux/crash_generation/crash_generation_client.cc",
382 "src/client/linux/crash_generation/crash_generation_client.h",
383 "src/client/linux/handler/exception_handler.cc",
384 "src/client/linux/handler/exception_handler.h",
385 "src/client/linux/handler/minidump_descriptor.cc",
386 "src/client/linux/handler/minidump_descriptor.h",
387 "src/client/linux/log/log.cc",
388 "src/client/linux/log/log.h",
389 "src/client/linux/minidump_writer/cpu_set.h",
390 "src/client/linux/minidump_writer/directory_reader.h",
391 "src/client/linux/minidump_writer/line_reader.h",
392 "src/client/linux/minidump_writer/linux_core_dumper.cc",
393 "src/client/linux/minidump_writer/linux_core_dumper.h",
394 "src/client/linux/minidump_writer/linux_dumper.cc",
395 "src/client/linux/minidump_writer/linux_dumper.h",
396 "src/client/linux/minidump_writer/linux_ptrace_dumper.cc",
397 "src/client/linux/minidump_writer/linux_ptrace_dumper.h",
398 "src/client/linux/minidump_writer/minidump_writer.cc",
399 "src/client/linux/minidump_writer/minidump_writer.h",
400 "src/client/linux/minidump_writer/proc_cpuinfo_reader.h",
401 "src/client/minidump_file_writer-inl.h",
402 "src/client/minidump_file_writer.cc",
403 "src/client/minidump_file_writer.h",
404 "src/common/convert_UTF.c",
405 "src/common/convert_UTF.h",
406 "src/common/linux/elf_core_dump.cc",
407 "src/common/linux/elf_core_dump.h",
408 "src/common/linux/elfutils.cc",
409 "src/common/linux/elfutils.h",
410 "src/common/linux/file_id.cc",
411 "src/common/linux/file_id.h",
412 "src/common/linux/google_crashdump_uploader.cc",
413 "src/common/linux/google_crashdump_uploader.h",
414 "src/common/linux/guid_creator.cc",
415 "src/common/linux/guid_creator.h",
416 "src/common/linux/libcurl_wrapper.cc",
417 "src/common/linux/libcurl_wrapper.h",
418 "src/common/linux/linux_libc_support.cc",
419 "src/common/linux/linux_libc_support.h",
420 "src/common/linux/memory_mapped_file.cc",
421 "src/common/linux/memory_mapped_file.h",
422 "src/common/linux/safe_readlink.cc",
423 "src/common/linux/safe_readlink.h",
424 "src/common/memory.h",
425 "src/common/simple_string_dictionary.cc",
426 "src/common/simple_string_dictionary.h",
427 "src/common/string_conversion.cc",
428 "src/common/string_conversion.h",
431 configs -= [ "//build/config/compiler:chromium_code" ]
432 configs += [ "//build/config/compiler:no_chromium_code" ]
433 direct_dependent_configs = [ ":client_config" ]
435 # Android NDK toolchain doesn't support -mimplicit-it=always
436 if (cpu_arch == "arm" && !is_android) {
437 cflags = [ "-Wa,-mimplicit-it=always" ]
439 if (cpu_arch == "arm" && is_chromeos) {
440 # Avoid running out of registers in
441 # linux_syscall_support.h:sys_clone()'s inline assembly.
446 sources += [ "src/common/android/breakpad_getcontext.S" ]
455 "src/third_party/linux/include",
459 static_library("processor_support") {
461 "src/common/scoped_ptr.h",
462 "src/processor/basic_code_modules.cc",
463 "src/processor/basic_code_modules.h",
464 "src/processor/logging.cc",
465 "src/processor/logging.h",
466 "src/processor/minidump.cc",
467 "src/processor/pathname_stripper.cc",
468 "src/processor/pathname_stripper.h",
474 "src/third_party/linux/include",
479 executable("breakpad_unittests") {
481 "linux/breakpad_googletest_includes.h",
482 "src/client/linux/handler/exception_handler_unittest.cc",
483 "src/client/linux/minidump_writer/cpu_set_unittest.cc",
484 "src/client/linux/minidump_writer/directory_reader_unittest.cc",
485 "src/client/linux/minidump_writer/line_reader_unittest.cc",
486 "src/client/linux/minidump_writer/linux_core_dumper_unittest.cc",
487 "src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc",
488 "src/client/linux/minidump_writer/minidump_writer_unittest.cc",
489 "src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc",
490 "src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc",
491 "src/common/linux/elf_core_dump_unittest.cc",
492 "src/common/linux/file_id_unittest.cc",
493 "src/common/linux/linux_libc_support_unittest.cc",
494 "src/common/linux/synth_elf.cc",
495 "src/common/linux/tests/auto_testfile.h",
496 "src/common/linux/tests/crash_generator.cc",
497 "src/common/linux/tests/crash_generator.h",
498 "src/common/memory_range.h",
499 "src/common/memory_unittest.cc",
500 "src/common/simple_string_dictionary_unittest.cc",
501 "src/common/test_assembler.cc",
502 "src/common/tests/file_utils.cc",
503 "src/common/tests/file_utils.h",
504 "src/tools/linux/md2core/minidump_memory_range.h",
505 "src/tools/linux/md2core/minidump_memory_range_unittest.cc",
510 ":processor_support",
511 ":linux_dumper_unittest_helper",
513 "//testing/gtest:gtest_main",
518 "linux", # Use our copy of breakpad_googletest_includes.h
523 # There are some warnings in this code.
524 configs -= [ "//build/config/compiler:chromium_code" ]
525 configs += [ "//build/config/compiler:no_chromium_code" ]
528 # See http://crbug.com/138571#c18
529 cflags = [ "-Wno-unused-value" ]
534 sources += [ "src/common/android/breakpad_getcontext_unittest.cc" ]
536 include_dirs = [ "src/common/android/include" ]
540 executable("linux_dumper_unittest_helper") {
542 "src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc",
545 ":processor_support",
552 if (cpu_arch == "mipsel" && is_android) {
553 include_dirs += [ "src/common/android/include" ]
558 executable("generate_test_dump") {
560 "linux/generate-test-dump.cc",
563 # This file has an unused variable warning.
564 configs -= [ "//build/config/compiler:chromium_code" ]
565 configs += [ "//build/config/compiler:no_chromium_code" ]
569 include_dirs = [ "src" ]
573 include_dirs += [ "src/common/android/include" ]
577 executable("minidump-2-core") {
578 sources = [ "src/tools/linux/md2core/minidump-2-core.cc" ]
580 include_dirs = [ "src" ]
585 executable("core-2-minidump") {
587 "src/tools/linux/core2md/core2md.cc",
594 include_dirs = [ "src" ]
599 static_library("client") {
601 "src/client/ios/Breakpad.h",
602 "src/client/ios/Breakpad.mm",
603 "src/client/ios/BreakpadController.h",
604 "src/client/ios/BreakpadController.mm",
605 "src/client/ios/handler/ios_exception_minidump_generator.mm",
606 "src/client/ios/handler/ios_exception_minidump_generator.h",
607 "src/client/mac/crash_generation/ConfigFile.h",
608 "src/client/mac/crash_generation/ConfigFile.mm",
609 "src/client/mac/handler/breakpad_nlist_64.cc",
610 "src/client/mac/handler/breakpad_nlist_64.h",
611 "src/client/mac/handler/dynamic_images.cc",
612 "src/client/mac/handler/dynamic_images.h",
613 "src/client/mac/handler/protected_memory_allocator.cc",
614 "src/client/mac/handler/protected_memory_allocator.h",
615 "src/client/mac/handler/exception_handler.cc",
616 "src/client/mac/handler/exception_handler.h",
617 "src/client/mac/handler/minidump_generator.cc",
618 "src/client/mac/handler/minidump_generator.h",
619 "src/client/mac/sender/uploader.h",
620 "src/client/mac/sender/uploader.mm",
621 "src/client/minidump_file_writer.cc",
622 "src/client/minidump_file_writer.h",
623 "src/client/minidump_file_writer-inl.h",
624 "src/common/convert_UTF.c",
625 "src/common/convert_UTF.h",
626 "src/common/mac/file_id.cc",
627 "src/common/mac/file_id.h",
628 "src/common/mac/HTTPMultipartUpload.m",
629 "src/common/mac/macho_id.cc",
630 "src/common/mac/macho_id.h",
631 "src/common/mac/macho_utilities.cc",
632 "src/common/mac/macho_utilities.h",
633 "src/common/mac/macho_walker.cc",
634 "src/common/mac/macho_walker.h",
635 "src/common/mac/string_utilities.cc",
636 "src/common/mac/string_utilities.h",
639 "src/common/simple_string_dictionary.cc",
640 "src/common/simple_string_dictionary.h",
641 "src/common/string_conversion.cc",
642 "src/common/string_conversion.h",
643 "src/google_breakpad/common/minidump_format.h",
648 "src/client/mac/Framework",
653 # TODO(GYP) There is some XCode-only targets like ninja-breakpad.
658 direct_dependent_configs = [ ":client_config" ]