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