Colin Cross | bf7382d | 2018-09-05 13:35:51 -0700 | [diff] [blame] | 1 | // Copyright (C) 2015 The Android Open Source Project |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
| 15 | // Static library. |
| 16 | // ================================================= |
| 17 | cc_library_static { |
| 18 | name: "breakpad_client", |
| 19 | |
| 20 | srcs: [ |
| 21 | "src/client/linux/dump_writer_common/seccomp_unwinder.cc", |
| 22 | "src/client/linux/dump_writer_common/thread_info.cc", |
| 23 | "src/client/linux/dump_writer_common/ucontext_reader.cc", |
| 24 | "src/client/linux/handler/minidump_descriptor.cc", |
| 25 | "src/client/linux/minidump_writer/linux_core_dumper.cc", |
| 26 | "src/client/linux/minidump_writer/linux_dumper.cc", |
| 27 | "src/client/linux/minidump_writer/linux_ptrace_dumper.cc", |
| 28 | "src/client/linux/minidump_writer/minidump_writer.cc", |
| 29 | "src/client/minidump_file_writer.cc", |
| 30 | "src/common/convert_UTF.c", |
| 31 | "src/common/linux/elf_core_dump.cc", |
| 32 | "src/common/linux/elfutils.cc", |
| 33 | "src/common/linux/file_id.cc", |
| 34 | "src/common/linux/guid_creator.cc", |
| 35 | "src/common/linux/linux_libc_support.cc", |
| 36 | "src/common/linux/memory_mapped_file.cc", |
| 37 | "src/common/linux/safe_readlink.cc", |
| 38 | "src/common/string_conversion.cc", |
| 39 | ], |
| 40 | |
| 41 | export_include_dirs: [ |
| 42 | "src/common/android/include", |
| 43 | "src", |
| 44 | ], |
| 45 | |
| 46 | cflags: [ |
| 47 | "-Wall", |
| 48 | "-Werror", |
| 49 | "-Wno-unused-parameter", |
| 50 | "-Wno-tautological-compare", |
| 51 | ], |
| 52 | |
| 53 | // Work around b/25435766 core2md segfault. |
| 54 | arch: { |
| 55 | x86: { |
| 56 | clang_cflags: ["-mno-stackrealign"], |
| 57 | }, |
| 58 | }, |
| 59 | } |
| 60 | |
| 61 | // core2md binary. |
| 62 | // ================================================= |
| 63 | cc_binary { |
| 64 | name: "core2md", |
| 65 | |
| 66 | srcs: ["src/tools/linux/core2md/core2md.cc"], |
| 67 | |
| 68 | static_libs: ["breakpad_client"], |
| 69 | |
| 70 | // Work around b/25435766 core2md segfault. |
| 71 | arch: { |
| 72 | x86: { |
| 73 | clang_cflags: ["-mno-stackrealign"], |
| 74 | }, |
| 75 | }, |
| 76 | |
| 77 | cflags: [ |
| 78 | "-Wall", |
| 79 | "-Werror", |
| 80 | ], |
| 81 | } |
| 82 | |
| 83 | // dump_syms host tool. |
| 84 | // ================================================= |
| 85 | cc_binary_host { |
| 86 | name: "dump_syms", |
| 87 | target: { |
| 88 | darwin: { |
| 89 | enabled: false, |
| 90 | }, |
| 91 | |
| 92 | linux_glibc: { |
| 93 | cppflags: [ |
| 94 | "-DHAVE_A_OUT_H", |
| 95 | "-Wno-unused-parameter", |
| 96 | ], |
| 97 | |
| 98 | srcs: [ |
| 99 | "src/common/linux/crc32.cc", |
| 100 | "src/common/linux/dump_symbols.cc", |
| 101 | "src/common/linux/elfutils.cc", |
| 102 | "src/common/linux/elf_symbols_to_module.cc", |
| 103 | "src/common/linux/file_id.cc", |
| 104 | "src/common/linux/linux_libc_support.cc", |
| 105 | "src/common/linux/memory_mapped_file.cc", |
| 106 | "src/tools/linux/dump_syms/dump_syms.cc", |
| 107 | ], |
| 108 | }, |
| 109 | }, |
| 110 | |
| 111 | local_include_dirs: ["src"], |
| 112 | srcs: [ |
| 113 | "src/common/dwarf/bytereader.cc", |
| 114 | "src/common/dwarf/dwarf2diehandler.cc", |
| 115 | "src/common/dwarf/dwarf2reader.cc", |
| 116 | "src/common/dwarf_cfi_to_module.cc", |
| 117 | "src/common/dwarf_cu_to_module.cc", |
| 118 | "src/common/dwarf_line_to_module.cc", |
| 119 | "src/common/language.cc", |
| 120 | "src/common/module.cc", |
| 121 | "src/common/stabs_reader.cc", |
| 122 | "src/common/stabs_to_module.cc", |
| 123 | ], |
| 124 | |
| 125 | cflags: [ |
| 126 | "-Wall", |
| 127 | "-Werror", |
| 128 | "-Wno-unused-local-typedef", |
| 129 | "-Wno-unused-private-field", |
| 130 | "-Wno-unused-result", |
| 131 | ], |
| 132 | } |
| 133 | |
| 134 | // sym_upload host tool. |
| 135 | // ================================================= |
| 136 | cc_binary_host { |
| 137 | name: "sym_upload", |
| 138 | target: { |
| 139 | darwin: { |
| 140 | enabled: false, |
| 141 | }, |
| 142 | |
| 143 | linux_glibc: { |
| 144 | srcs: [ |
| 145 | "src/common/linux/http_upload.cc", |
| 146 | "src/tools/linux/symupload/sym_upload.cc", |
| 147 | ], |
| 148 | }, |
| 149 | }, |
| 150 | |
| 151 | local_include_dirs: ["src"], |
| 152 | |
| 153 | cflags: [ |
| 154 | "-Wall", |
| 155 | "-Werror", |
| 156 | "-Wno-unused-parameter", |
| 157 | ], |
| 158 | } |
| 159 | |
| 160 | // libdisasm static library. |
| 161 | // ================================================= |
| 162 | cc_library_host_static { |
| 163 | name: "libdisasm", |
| 164 | target: { |
| 165 | darwin: { |
| 166 | enabled: false, |
| 167 | }, |
| 168 | |
| 169 | linux_glibc: { |
| 170 | cflags: [ |
| 171 | "-Wno-missing-field-initializers", |
| 172 | "-Wno-pointer-arith", |
| 173 | "-Wno-tautological-constant-out-of-range-compare", |
| 174 | "-Wno-unused-parameter", |
| 175 | ], |
| 176 | }, |
| 177 | }, |
| 178 | |
| 179 | export_include_dirs: ["src/third_party/libdisasm"], |
| 180 | srcs: [ |
| 181 | "src/third_party/libdisasm/ia32_implicit.c", |
| 182 | "src/third_party/libdisasm/ia32_insn.c", |
| 183 | "src/third_party/libdisasm/ia32_invariant.c", |
| 184 | "src/third_party/libdisasm/ia32_modrm.c", |
| 185 | "src/third_party/libdisasm/ia32_opcode_tables.c", |
| 186 | "src/third_party/libdisasm/ia32_operand.c", |
| 187 | "src/third_party/libdisasm/ia32_reg.c", |
| 188 | "src/third_party/libdisasm/ia32_settings.c", |
| 189 | "src/third_party/libdisasm/x86_disasm.c", |
| 190 | "src/third_party/libdisasm/x86_format.c", |
| 191 | "src/third_party/libdisasm/x86_imm.c", |
| 192 | "src/third_party/libdisasm/x86_insn.c", |
| 193 | "src/third_party/libdisasm/x86_misc.c", |
| 194 | "src/third_party/libdisasm/x86_operand_list.c", |
| 195 | ], |
| 196 | } |
| 197 | |
| 198 | // minidump_stackwalk host tool. |
| 199 | // ================================================= |
| 200 | cc_binary_host { |
| 201 | name: "minidump_stackwalk", |
| 202 | target: { |
| 203 | darwin: { |
| 204 | enabled: false, |
| 205 | }, |
| 206 | |
| 207 | linux_glibc: { |
| 208 | cppflags: [ |
| 209 | "-DHAVE_A_OUT_H", |
Chih-Hung Hsieh | b5474aa | 2018-09-06 13:29:17 -0700 | [diff] [blame] | 210 | "-Wno-implicit-fallthrough", |
| 211 | // minidump_processor.cc:853, minidump.cc:4228 have fallthrough. |
Colin Cross | bf7382d | 2018-09-05 13:35:51 -0700 | [diff] [blame] | 212 | "-Wno-unused-function", |
| 213 | "-Wno-unused-parameter", |
| 214 | ], |
| 215 | |
| 216 | srcs: [ |
| 217 | "src/processor/basic_code_modules.cc", |
| 218 | "src/processor/basic_source_line_resolver.cc", |
| 219 | "src/processor/call_stack.cc", |
| 220 | "src/processor/cfi_frame_info.cc", |
| 221 | "src/processor/disassembler_x86.cc", |
| 222 | "src/processor/dump_context.cc", |
| 223 | "src/processor/dump_object.cc", |
| 224 | "src/processor/exploitability.cc", |
| 225 | "src/processor/exploitability_linux.cc", |
| 226 | "src/processor/exploitability_win.cc", |
| 227 | "src/processor/logging.cc", |
| 228 | "src/processor/microdump.cc", |
| 229 | "src/processor/microdump_processor.cc", |
| 230 | "src/processor/minidump.cc", |
| 231 | "src/processor/minidump_processor.cc", |
| 232 | "src/processor/minidump_stackwalk.cc", |
| 233 | "src/processor/pathname_stripper.cc", |
| 234 | "src/processor/process_state.cc", |
| 235 | "src/processor/simple_symbol_supplier.cc", |
| 236 | "src/processor/source_line_resolver_base.cc", |
| 237 | "src/processor/stack_frame_symbolizer.cc", |
| 238 | "src/processor/stackwalk_common.cc", |
| 239 | "src/processor/stackwalker.cc", |
| 240 | "src/processor/stackwalker_amd64.cc", |
| 241 | "src/processor/stackwalker_arm.cc", |
| 242 | "src/processor/stackwalker_arm64.cc", |
| 243 | "src/processor/stackwalker_mips.cc", |
| 244 | "src/processor/stackwalker_ppc.cc", |
| 245 | "src/processor/stackwalker_ppc64.cc", |
| 246 | "src/processor/stackwalker_sparc.cc", |
| 247 | "src/processor/stackwalker_x86.cc", |
| 248 | "src/processor/symbolic_constants_win.cc", |
| 249 | "src/processor/tokenize.cc", |
| 250 | ], |
| 251 | }, |
| 252 | }, |
| 253 | |
| 254 | local_include_dirs: ["src"], |
| 255 | |
| 256 | static_libs: ["libdisasm"], |
| 257 | } |