Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 1 | cc_defaults { |
| 2 | name: "debuggerd_defaults", |
| 3 | cflags: [ |
| 4 | "-Wall", |
| 5 | "-Wextra", |
Josh Gao | c7fe060 | 2017-03-13 14:13:29 -0700 | [diff] [blame] | 6 | "-Werror", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 7 | "-Wno-nullability-completeness", |
| 8 | "-Os", |
| 9 | ], |
| 10 | |
| 11 | local_include_dirs: ["include"], |
| 12 | } |
| 13 | |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 14 | cc_library_headers { |
| 15 | name: "libdebuggerd_common_headers", |
| 16 | export_include_dirs: ["common/include"] |
| 17 | } |
| 18 | |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 19 | cc_library_shared { |
Josh Gao | e1aa0ca | 2017-03-01 17:23:22 -0800 | [diff] [blame] | 20 | name: "libtombstoned_client", |
| 21 | defaults: ["debuggerd_defaults"], |
| 22 | srcs: [ |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 23 | "tombstoned/tombstoned_client.cpp", |
| 24 | "util.cpp", |
| 25 | ], |
| 26 | |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 27 | header_libs: ["libdebuggerd_common_headers"], |
| 28 | |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 29 | static_libs: [ |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 30 | "libasync_safe", |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 31 | ], |
| 32 | |
| 33 | shared_libs: [ |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 34 | "libbase", |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 35 | "libcutils", |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 36 | ], |
| 37 | |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 38 | export_header_lib_headers: ["libdebuggerd_common_headers"], |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 39 | export_include_dirs: ["tombstoned/include"] |
| 40 | } |
| 41 | |
| 42 | // Utility library to tombstoned and get an output fd. |
| 43 | cc_library_static { |
| 44 | name: "libtombstoned_client_static", |
| 45 | defaults: ["debuggerd_defaults"], |
| 46 | srcs: [ |
| 47 | "tombstoned/tombstoned_client.cpp", |
Josh Gao | e1aa0ca | 2017-03-01 17:23:22 -0800 | [diff] [blame] | 48 | "util.cpp", |
| 49 | ], |
| 50 | |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 51 | header_libs: ["libdebuggerd_common_headers"], |
| 52 | |
Josh Gao | e1aa0ca | 2017-03-01 17:23:22 -0800 | [diff] [blame] | 53 | whole_static_libs: [ |
Christopher Ferris | ac22578 | 2017-04-25 11:23:10 -0700 | [diff] [blame] | 54 | "libasync_safe", |
Josh Gao | e1aa0ca | 2017-03-01 17:23:22 -0800 | [diff] [blame] | 55 | "libcutils", |
| 56 | "libbase", |
| 57 | ], |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 58 | |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 59 | export_header_lib_headers: ["libdebuggerd_common_headers"], |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 60 | export_include_dirs: ["tombstoned/include"] |
Josh Gao | e1aa0ca | 2017-03-01 17:23:22 -0800 | [diff] [blame] | 61 | } |
| 62 | |
| 63 | // Core implementation, linked into libdebuggerd_handler and the dynamic linker. |
Josh Gao | 9c02dc5 | 2016-06-15 17:29:00 -0700 | [diff] [blame] | 64 | cc_library_static { |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 65 | name: "libdebuggerd_handler_core", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 66 | defaults: ["debuggerd_defaults"], |
| 67 | srcs: ["handler/debuggerd_handler.cpp"], |
Josh Gao | 9c02dc5 | 2016-06-15 17:29:00 -0700 | [diff] [blame] | 68 | |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 69 | header_libs: ["libdebuggerd_common_headers"], |
| 70 | |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 71 | whole_static_libs: [ |
Christopher Ferris | ac22578 | 2017-04-25 11:23:10 -0700 | [diff] [blame] | 72 | "libasync_safe", |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 73 | "libdebuggerd", |
| 74 | ], |
| 75 | |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 76 | export_header_lib_headers: ["libdebuggerd_common_headers"], |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 77 | export_include_dirs: ["include"], |
| 78 | } |
| 79 | |
Josh Gao | e1aa0ca | 2017-03-01 17:23:22 -0800 | [diff] [blame] | 80 | // Implementation with a no-op fallback. |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 81 | cc_library_static { |
| 82 | name: "libdebuggerd_handler", |
| 83 | defaults: ["debuggerd_defaults"], |
| 84 | srcs: ["handler/debuggerd_fallback_nop.cpp"], |
| 85 | |
| 86 | whole_static_libs: [ |
| 87 | "libdebuggerd_handler_core", |
| 88 | ], |
| 89 | |
| 90 | export_include_dirs: ["include"], |
| 91 | } |
| 92 | |
Josh Gao | e1aa0ca | 2017-03-01 17:23:22 -0800 | [diff] [blame] | 93 | // Fallback implementation. |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 94 | cc_library_static { |
| 95 | name: "libdebuggerd_handler_fallback", |
| 96 | defaults: ["debuggerd_defaults"], |
Josh Gao | e1aa0ca | 2017-03-01 17:23:22 -0800 | [diff] [blame] | 97 | srcs: [ |
| 98 | "handler/debuggerd_fallback.cpp", |
| 99 | ], |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 100 | |
Josh Gao | e1aa0ca | 2017-03-01 17:23:22 -0800 | [diff] [blame] | 101 | whole_static_libs: [ |
| 102 | "libdebuggerd_handler_core", |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 103 | "libtombstoned_client_static", |
Christopher Ferris | ac22578 | 2017-04-25 11:23:10 -0700 | [diff] [blame] | 104 | "libasync_safe", |
Josh Gao | e1aa0ca | 2017-03-01 17:23:22 -0800 | [diff] [blame] | 105 | "libbase", |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 106 | "libdebuggerd", |
| 107 | "libbacktrace", |
| 108 | "libunwind", |
Christopher Ferris | 9a8c855 | 2017-08-11 15:29:19 -0700 | [diff] [blame^] | 109 | "libunwindstack", |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 110 | "liblzma", |
| 111 | "libcutils", |
| 112 | ], |
Josh Gao | 9c02dc5 | 2016-06-15 17:29:00 -0700 | [diff] [blame] | 113 | |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 114 | export_include_dirs: ["include"], |
| 115 | } |
| 116 | |
| 117 | cc_library { |
| 118 | name: "libdebuggerd_client", |
| 119 | defaults: ["debuggerd_defaults"], |
| 120 | srcs: [ |
| 121 | "client/debuggerd_client.cpp", |
| 122 | "util.cpp", |
| 123 | ], |
| 124 | |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 125 | header_libs: ["libdebuggerd_common_headers"], |
| 126 | |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 127 | shared_libs: [ |
| 128 | "libbase", |
| 129 | "libcutils", |
| 130 | ], |
Josh Gao | e1aa0ca | 2017-03-01 17:23:22 -0800 | [diff] [blame] | 131 | |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 132 | export_header_lib_headers: ["libdebuggerd_common_headers"], |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 133 | export_include_dirs: ["include"], |
| 134 | } |
| 135 | |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 136 | cc_library_static { |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 137 | name: "libdebuggerd", |
| 138 | defaults: ["debuggerd_defaults"], |
| 139 | |
| 140 | srcs: [ |
| 141 | "libdebuggerd/backtrace.cpp", |
| 142 | "libdebuggerd/elf_utils.cpp", |
| 143 | "libdebuggerd/open_files_list.cpp", |
| 144 | "libdebuggerd/tombstone.cpp", |
| 145 | "libdebuggerd/utility.cpp", |
| 146 | ], |
| 147 | |
| 148 | target: { |
| 149 | android_arm: { |
| 150 | srcs: ["libdebuggerd/arm/machine.cpp"], |
| 151 | }, |
| 152 | android_arm64: { |
| 153 | srcs: ["libdebuggerd/arm64/machine.cpp"], |
| 154 | }, |
| 155 | android_mips: { |
| 156 | srcs: ["libdebuggerd/mips/machine.cpp"], |
| 157 | }, |
| 158 | android_mips64: { |
| 159 | srcs: ["libdebuggerd/mips64/machine.cpp"], |
| 160 | }, |
| 161 | android_x86: { |
| 162 | srcs: ["libdebuggerd/x86/machine.cpp"], |
| 163 | }, |
| 164 | android_x86_64: { |
| 165 | srcs: ["libdebuggerd/x86_64/machine.cpp"], |
| 166 | }, |
Robert Sesek | 9eb02c9 | 2016-08-09 14:04:05 -0400 | [diff] [blame] | 167 | }, |
Robert Sesek | 9eb02c9 | 2016-08-09 14:04:05 -0400 | [diff] [blame] | 168 | |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 169 | local_include_dirs: ["libdebuggerd/include"], |
| 170 | export_include_dirs: ["libdebuggerd/include"], |
Josh Gao | 9c02dc5 | 2016-06-15 17:29:00 -0700 | [diff] [blame] | 171 | |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 172 | static_libs: [ |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 173 | "libbacktrace", |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 174 | "libunwind", |
Christopher Ferris | 9a8c855 | 2017-08-11 15:29:19 -0700 | [diff] [blame^] | 175 | "libunwindstack", |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 176 | "liblzma", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 177 | "libbase", |
| 178 | "libcutils", |
| 179 | "liblog", |
| 180 | ], |
| 181 | } |
| 182 | |
| 183 | cc_test { |
| 184 | name: "debuggerd_test", |
| 185 | defaults: ["debuggerd_defaults"], |
| 186 | |
| 187 | cflags: ["-Wno-missing-field-initializers"], |
| 188 | srcs: [ |
| 189 | "libdebuggerd/test/dump_memory_test.cpp", |
| 190 | "libdebuggerd/test/elf_fake.cpp", |
| 191 | "libdebuggerd/test/log_fake.cpp", |
| 192 | "libdebuggerd/test/open_files_list_test.cpp", |
| 193 | "libdebuggerd/test/property_fake.cpp", |
| 194 | "libdebuggerd/test/ptrace_fake.cpp", |
| 195 | "libdebuggerd/test/tombstone_test.cpp", |
| 196 | ], |
| 197 | |
| 198 | target: { |
| 199 | android: { |
| 200 | srcs: [ |
Josh Gao | ae9d767 | 2017-03-24 16:26:03 -0700 | [diff] [blame] | 201 | "client/debuggerd_client_test.cpp", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 202 | "debuggerd_test.cpp", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 203 | ], |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 204 | static_libs: ["libasync_safe", "libtombstoned_client_static"], |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 205 | }, |
| 206 | }, |
| 207 | |
| 208 | shared_libs: [ |
| 209 | "libbacktrace", |
| 210 | "libbase", |
| 211 | "libcutils", |
Josh Gao | ae9d767 | 2017-03-24 16:26:03 -0700 | [diff] [blame] | 212 | "libdebuggerd_client", |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 213 | "liblog", |
| 214 | "libnativehelper" |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 215 | ], |
| 216 | |
| 217 | static_libs: [ |
Josh Gao | 352a845 | 2017-03-30 16:46:21 -0700 | [diff] [blame] | 218 | "libdebuggerd", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 219 | ], |
| 220 | |
| 221 | local_include_dirs: [ |
| 222 | "libdebuggerd", |
| 223 | ], |
| 224 | |
| 225 | compile_multilib: "both", |
| 226 | multilib: { |
| 227 | lib32: { |
| 228 | stem: "debuggerd_test32", |
| 229 | }, |
| 230 | lib64: { |
| 231 | stem: "debuggerd_test64", |
| 232 | }, |
| 233 | }, |
| 234 | } |
| 235 | |
| 236 | cc_binary { |
| 237 | name: "crash_dump", |
| 238 | srcs: [ |
| 239 | "crash_dump.cpp", |
| 240 | "util.cpp", |
| 241 | ], |
| 242 | defaults: ["debuggerd_defaults"], |
| 243 | |
| 244 | compile_multilib: "both", |
| 245 | multilib: { |
| 246 | lib32: { |
| 247 | suffix: "32", |
| 248 | }, |
| 249 | lib64: { |
| 250 | suffix: "64", |
| 251 | }, |
| 252 | }, |
| 253 | |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 254 | static_libs: [ |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 255 | "libtombstoned_client_static", |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 256 | "libdebuggerd", |
| 257 | "libcutils", |
| 258 | ], |
| 259 | |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 260 | shared_libs: [ |
| 261 | "libbacktrace", |
| 262 | "libbase", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 263 | "liblog", |
| 264 | "libprocinfo", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 265 | ], |
| 266 | } |
| 267 | |
| 268 | cc_binary { |
| 269 | name: "debuggerd", |
| 270 | srcs: [ |
| 271 | "debuggerd.cpp", |
| 272 | ], |
| 273 | defaults: ["debuggerd_defaults"], |
| 274 | |
| 275 | shared_libs: [ |
| 276 | "libbase", |
| 277 | "libdebuggerd_client", |
| 278 | "liblog", |
Josh Gao | 0915f23 | 2017-06-27 14:08:05 -0700 | [diff] [blame] | 279 | "libprocinfo", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 280 | ], |
| 281 | |
| 282 | local_include_dirs: ["include"], |
| 283 | } |
| 284 | |
| 285 | cc_binary { |
| 286 | name: "tombstoned", |
| 287 | srcs: [ |
| 288 | "util.cpp", |
| 289 | "tombstoned/intercept_manager.cpp", |
| 290 | "tombstoned/tombstoned.cpp", |
| 291 | ], |
| 292 | defaults: ["debuggerd_defaults"], |
| 293 | |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 294 | header_libs: ["libdebuggerd_common_headers"], |
| 295 | |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 296 | static_libs: [ |
| 297 | "libbase", |
| 298 | "libcutils", |
| 299 | "libevent", |
| 300 | "liblog", |
| 301 | ], |
| 302 | |
| 303 | init_rc: ["tombstoned/tombstoned.rc"] |
Josh Gao | 9c02dc5 | 2016-06-15 17:29:00 -0700 | [diff] [blame] | 304 | } |
Elliott Hughes | 0ba5359 | 2017-02-01 16:59:15 -0800 | [diff] [blame] | 305 | |
| 306 | subdirs = [ |
| 307 | "crasher", |
| 308 | ] |