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