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