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 | 2b2ae0c | 2017-08-21 14:31:17 -0700 | [diff] [blame] | 7 | "-Wno-unused-argument", |
| 8 | "-Wno-unused-function", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 9 | "-Wno-nullability-completeness", |
| 10 | "-Os", |
| 11 | ], |
| 12 | |
| 13 | local_include_dirs: ["include"], |
| 14 | } |
| 15 | |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 16 | cc_library_headers { |
| 17 | name: "libdebuggerd_common_headers", |
Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 18 | export_include_dirs: ["common/include"], |
Jiyong Park | a0e7504 | 2018-05-24 14:11:00 +0900 | [diff] [blame] | 19 | recovery_available: true, |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 20 | } |
| 21 | |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 22 | cc_library_shared { |
Josh Gao | e1aa0ca | 2017-03-01 17:23:22 -0800 | [diff] [blame] | 23 | name: "libtombstoned_client", |
| 24 | defaults: ["debuggerd_defaults"], |
| 25 | srcs: [ |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 26 | "tombstoned/tombstoned_client.cpp", |
| 27 | "util.cpp", |
| 28 | ], |
| 29 | |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 30 | header_libs: ["libdebuggerd_common_headers"], |
| 31 | |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 32 | static_libs: [ |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 33 | "libasync_safe", |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 34 | ], |
| 35 | |
| 36 | shared_libs: [ |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 37 | "libbase", |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 38 | "libcutils", |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 39 | ], |
| 40 | |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 41 | export_header_lib_headers: ["libdebuggerd_common_headers"], |
Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 42 | export_include_dirs: ["tombstoned/include"], |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 43 | } |
| 44 | |
Josh Gao | 9da1f51 | 2018-08-06 15:38:29 -0700 | [diff] [blame] | 45 | // Utility library to talk to tombstoned and get an output fd. |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 46 | cc_library_static { |
| 47 | name: "libtombstoned_client_static", |
| 48 | defaults: ["debuggerd_defaults"], |
Jiyong Park | 011ee12 | 2018-05-29 16:41:30 +0900 | [diff] [blame] | 49 | recovery_available: true, |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 50 | srcs: [ |
| 51 | "tombstoned/tombstoned_client.cpp", |
Josh Gao | e1aa0ca | 2017-03-01 17:23:22 -0800 | [diff] [blame] | 52 | "util.cpp", |
| 53 | ], |
| 54 | |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 55 | header_libs: ["libdebuggerd_common_headers"], |
| 56 | |
Josh Gao | e1aa0ca | 2017-03-01 17:23:22 -0800 | [diff] [blame] | 57 | whole_static_libs: [ |
Christopher Ferris | ac22578 | 2017-04-25 11:23:10 -0700 | [diff] [blame] | 58 | "libasync_safe", |
Josh Gao | e1aa0ca | 2017-03-01 17:23:22 -0800 | [diff] [blame] | 59 | "libcutils", |
| 60 | "libbase", |
| 61 | ], |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 62 | |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 63 | export_header_lib_headers: ["libdebuggerd_common_headers"], |
Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 64 | export_include_dirs: ["tombstoned/include"], |
Josh Gao | e1aa0ca | 2017-03-01 17:23:22 -0800 | [diff] [blame] | 65 | } |
| 66 | |
| 67 | // Core implementation, linked into libdebuggerd_handler and the dynamic linker. |
Josh Gao | 9c02dc5 | 2016-06-15 17:29:00 -0700 | [diff] [blame] | 68 | cc_library_static { |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 69 | name: "libdebuggerd_handler_core", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 70 | defaults: ["debuggerd_defaults"], |
Jiyong Park | a0e7504 | 2018-05-24 14:11:00 +0900 | [diff] [blame] | 71 | recovery_available: true, |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 72 | srcs: ["handler/debuggerd_handler.cpp"], |
Josh Gao | 9c02dc5 | 2016-06-15 17:29:00 -0700 | [diff] [blame] | 73 | |
Josh Gao | fdf832d | 2017-08-25 18:00:18 -0700 | [diff] [blame] | 74 | header_libs: [ |
| 75 | "libbase_headers", |
| 76 | "libdebuggerd_common_headers", |
| 77 | ], |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 78 | |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 79 | whole_static_libs: [ |
Christopher Ferris | ac22578 | 2017-04-25 11:23:10 -0700 | [diff] [blame] | 80 | "libasync_safe", |
Josh Gao | 2b2ae0c | 2017-08-21 14:31:17 -0700 | [diff] [blame] | 81 | "libcutils", |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 82 | "libdebuggerd", |
| 83 | ], |
| 84 | |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 85 | export_header_lib_headers: ["libdebuggerd_common_headers"], |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 86 | export_include_dirs: ["include"], |
| 87 | } |
| 88 | |
Josh Gao | e1aa0ca | 2017-03-01 17:23:22 -0800 | [diff] [blame] | 89 | // Implementation with a no-op fallback. |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 90 | cc_library_static { |
| 91 | name: "libdebuggerd_handler", |
| 92 | defaults: ["debuggerd_defaults"], |
| 93 | srcs: ["handler/debuggerd_fallback_nop.cpp"], |
| 94 | |
| 95 | whole_static_libs: [ |
| 96 | "libdebuggerd_handler_core", |
| 97 | ], |
| 98 | |
| 99 | export_include_dirs: ["include"], |
| 100 | } |
| 101 | |
Josh Gao | e1aa0ca | 2017-03-01 17:23:22 -0800 | [diff] [blame] | 102 | // Fallback implementation. |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 103 | cc_library_static { |
| 104 | name: "libdebuggerd_handler_fallback", |
| 105 | defaults: ["debuggerd_defaults"], |
Jiyong Park | 011ee12 | 2018-05-29 16:41:30 +0900 | [diff] [blame] | 106 | recovery_available: true, |
Josh Gao | e1aa0ca | 2017-03-01 17:23:22 -0800 | [diff] [blame] | 107 | srcs: [ |
| 108 | "handler/debuggerd_fallback.cpp", |
| 109 | ], |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 110 | |
Josh Gao | e1aa0ca | 2017-03-01 17:23:22 -0800 | [diff] [blame] | 111 | whole_static_libs: [ |
| 112 | "libdebuggerd_handler_core", |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 113 | "libtombstoned_client_static", |
Christopher Ferris | ac22578 | 2017-04-25 11:23:10 -0700 | [diff] [blame] | 114 | "libasync_safe", |
Josh Gao | e1aa0ca | 2017-03-01 17:23:22 -0800 | [diff] [blame] | 115 | "libbase", |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 116 | "libdebuggerd", |
| 117 | "libbacktrace", |
Christopher Ferris | 9a8c855 | 2017-08-11 15:29:19 -0700 | [diff] [blame] | 118 | "libunwindstack", |
Martin Stjernholm | bb4f2b4 | 2018-12-19 14:28:33 +0000 | [diff] [blame^] | 119 | "libdexfile", // libunwindstack dependency |
| 120 | "libdexfile_external", // libunwindstack dependency |
| 121 | "libdexfile_support", // libunwindstack dependency |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 122 | "liblzma", |
| 123 | "libcutils", |
| 124 | ], |
Jiyong Park | 011ee12 | 2018-05-29 16:41:30 +0900 | [diff] [blame] | 125 | target: { |
| 126 | recovery: { |
| 127 | cflags: ["-DNO_LIBDEXFILE_SUPPORT"], |
Martin Stjernholm | bb4f2b4 | 2018-12-19 14:28:33 +0000 | [diff] [blame^] | 128 | exclude_static_libs: [ |
| 129 | "libartbase", |
| 130 | "libdexfile", |
| 131 | "libdexfile_external", |
| 132 | "libdexfile_support", |
| 133 | ], |
Jiyong Park | 011ee12 | 2018-05-29 16:41:30 +0900 | [diff] [blame] | 134 | }, |
| 135 | }, |
Josh Gao | 9c02dc5 | 2016-06-15 17:29:00 -0700 | [diff] [blame] | 136 | |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 137 | export_include_dirs: ["include"], |
| 138 | } |
| 139 | |
| 140 | cc_library { |
| 141 | name: "libdebuggerd_client", |
| 142 | defaults: ["debuggerd_defaults"], |
| 143 | srcs: [ |
| 144 | "client/debuggerd_client.cpp", |
| 145 | "util.cpp", |
| 146 | ], |
| 147 | |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 148 | header_libs: ["libdebuggerd_common_headers"], |
| 149 | |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 150 | shared_libs: [ |
| 151 | "libbase", |
| 152 | "libcutils", |
| 153 | ], |
Josh Gao | e1aa0ca | 2017-03-01 17:23:22 -0800 | [diff] [blame] | 154 | |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 155 | export_header_lib_headers: ["libdebuggerd_common_headers"], |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 156 | export_include_dirs: ["include"], |
| 157 | } |
| 158 | |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 159 | cc_library_static { |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 160 | name: "libdebuggerd", |
| 161 | defaults: ["debuggerd_defaults"], |
Jiyong Park | a0e7504 | 2018-05-24 14:11:00 +0900 | [diff] [blame] | 162 | recovery_available: true, |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 163 | |
| 164 | srcs: [ |
| 165 | "libdebuggerd/backtrace.cpp", |
| 166 | "libdebuggerd/elf_utils.cpp", |
| 167 | "libdebuggerd/open_files_list.cpp", |
| 168 | "libdebuggerd/tombstone.cpp", |
| 169 | "libdebuggerd/utility.cpp", |
| 170 | ], |
| 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 | ce841d9 | 2018-08-06 18:26:42 -0700 | [diff] [blame] | 175 | // Needed for private/bionic_fdsan.h |
| 176 | include_dirs: ["bionic/libc"], |
| 177 | |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 178 | static_libs: [ |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 179 | "libbacktrace", |
Martin Stjernholm | bb4f2b4 | 2018-12-19 14:28:33 +0000 | [diff] [blame^] | 180 | "libdexfile_external", // libunwindstack dependency |
| 181 | "libdexfile_support", // libunwindstack dependency |
Christopher Ferris | 9a8c855 | 2017-08-11 15:29:19 -0700 | [diff] [blame] | 182 | "libunwindstack", |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 183 | "liblzma", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 184 | "libbase", |
| 185 | "libcutils", |
| 186 | "liblog", |
| 187 | ], |
Martin Stjernholm | bb4f2b4 | 2018-12-19 14:28:33 +0000 | [diff] [blame^] | 188 | target: { |
| 189 | recovery: { |
| 190 | exclude_static_libs: [ |
| 191 | "libdexfile_external", |
| 192 | "libdexfile_support", |
| 193 | ], |
| 194 | }, |
| 195 | }, |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 196 | } |
| 197 | |
| 198 | cc_test { |
| 199 | name: "debuggerd_test", |
| 200 | defaults: ["debuggerd_defaults"], |
| 201 | |
| 202 | cflags: ["-Wno-missing-field-initializers"], |
| 203 | srcs: [ |
| 204 | "libdebuggerd/test/dump_memory_test.cpp", |
| 205 | "libdebuggerd/test/elf_fake.cpp", |
| 206 | "libdebuggerd/test/log_fake.cpp", |
| 207 | "libdebuggerd/test/open_files_list_test.cpp", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 208 | "libdebuggerd/test/tombstone_test.cpp", |
| 209 | ], |
| 210 | |
| 211 | target: { |
| 212 | android: { |
| 213 | srcs: [ |
Josh Gao | ae9d767 | 2017-03-24 16:26:03 -0700 | [diff] [blame] | 214 | "client/debuggerd_client_test.cpp", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 215 | "debuggerd_test.cpp", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 216 | ], |
Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 217 | static_libs: [ |
| 218 | "libasync_safe", |
| 219 | "libtombstoned_client_static", |
| 220 | ], |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 221 | }, |
| 222 | }, |
| 223 | |
| 224 | shared_libs: [ |
| 225 | "libbacktrace", |
| 226 | "libbase", |
| 227 | "libcutils", |
Josh Gao | ae9d767 | 2017-03-24 16:26:03 -0700 | [diff] [blame] | 228 | "libdebuggerd_client", |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 229 | "liblog", |
Josh Gao | e04ca27 | 2018-01-16 15:38:17 -0800 | [diff] [blame] | 230 | "libminijail", |
Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 231 | "libnativehelper", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 232 | ], |
| 233 | |
| 234 | static_libs: [ |
Josh Gao | 352a845 | 2017-03-30 16:46:21 -0700 | [diff] [blame] | 235 | "libdebuggerd", |
Martin Stjernholm | bb4f2b4 | 2018-12-19 14:28:33 +0000 | [diff] [blame^] | 236 | "libdexfile_external", // libunwindstack dependency |
| 237 | "libdexfile_support", // libunwindstack dependency |
Josh Gao | 2b2ae0c | 2017-08-21 14:31:17 -0700 | [diff] [blame] | 238 | "libunwindstack", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 239 | ], |
| 240 | |
| 241 | local_include_dirs: [ |
| 242 | "libdebuggerd", |
| 243 | ], |
| 244 | |
| 245 | compile_multilib: "both", |
| 246 | multilib: { |
| 247 | lib32: { |
| 248 | stem: "debuggerd_test32", |
| 249 | }, |
| 250 | lib64: { |
| 251 | stem: "debuggerd_test64", |
| 252 | }, |
| 253 | }, |
Elliott Hughes | 40fdf3f | 2018-04-27 16:12:06 -0700 | [diff] [blame] | 254 | |
| 255 | test_suites: ["device-tests"], |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 256 | } |
| 257 | |
Josh Gao | a42314e | 2017-12-19 15:08:19 -0800 | [diff] [blame] | 258 | cc_benchmark { |
| 259 | name: "debuggerd_benchmark", |
| 260 | defaults: ["debuggerd_defaults"], |
| 261 | srcs: ["debuggerd_benchmark.cpp"], |
| 262 | shared_libs: [ |
| 263 | "libbase", |
| 264 | "libdebuggerd_client", |
| 265 | ], |
| 266 | } |
| 267 | |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 268 | cc_binary { |
| 269 | name: "crash_dump", |
| 270 | srcs: [ |
| 271 | "crash_dump.cpp", |
| 272 | "util.cpp", |
| 273 | ], |
| 274 | defaults: ["debuggerd_defaults"], |
| 275 | |
| 276 | compile_multilib: "both", |
| 277 | multilib: { |
| 278 | lib32: { |
| 279 | suffix: "32", |
| 280 | }, |
| 281 | lib64: { |
| 282 | suffix: "64", |
| 283 | }, |
| 284 | }, |
| 285 | |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 286 | static_libs: [ |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 287 | "libtombstoned_client_static", |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 288 | "libdebuggerd", |
| 289 | "libcutils", |
| 290 | ], |
| 291 | |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 292 | shared_libs: [ |
| 293 | "libbacktrace", |
| 294 | "libbase", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 295 | "liblog", |
| 296 | "libprocinfo", |
Josh Gao | 2b2ae0c | 2017-08-21 14:31:17 -0700 | [diff] [blame] | 297 | "libunwindstack", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 298 | ], |
| 299 | } |
| 300 | |
| 301 | cc_binary { |
| 302 | name: "debuggerd", |
| 303 | srcs: [ |
| 304 | "debuggerd.cpp", |
| 305 | ], |
| 306 | defaults: ["debuggerd_defaults"], |
| 307 | |
| 308 | shared_libs: [ |
| 309 | "libbase", |
| 310 | "libdebuggerd_client", |
| 311 | "liblog", |
Josh Gao | 0915f23 | 2017-06-27 14:08:05 -0700 | [diff] [blame] | 312 | "libprocinfo", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 313 | ], |
| 314 | |
| 315 | local_include_dirs: ["include"], |
| 316 | } |
| 317 | |
| 318 | cc_binary { |
| 319 | name: "tombstoned", |
| 320 | srcs: [ |
| 321 | "util.cpp", |
| 322 | "tombstoned/intercept_manager.cpp", |
| 323 | "tombstoned/tombstoned.cpp", |
| 324 | ], |
| 325 | defaults: ["debuggerd_defaults"], |
| 326 | |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 327 | header_libs: ["libdebuggerd_common_headers"], |
| 328 | |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 329 | static_libs: [ |
| 330 | "libbase", |
| 331 | "libcutils", |
| 332 | "libevent", |
| 333 | "liblog", |
| 334 | ], |
| 335 | |
Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 336 | init_rc: ["tombstoned/tombstoned.rc"], |
Josh Gao | 9c02dc5 | 2016-06-15 17:29:00 -0700 | [diff] [blame] | 337 | } |
Elliott Hughes | 0ba5359 | 2017-02-01 16:59:15 -0800 | [diff] [blame] | 338 | |
| 339 | subdirs = [ |
| 340 | "crasher", |
| 341 | ] |