blob: ad1eeb30d4212a73282961e4a5337341d13698ff [file] [log] [blame]
Bob Badourd69ad692021-02-16 19:02:14 -08001package {
Elliott Hughes813fd6d2021-06-25 14:42:51 -07002 default_applicable_licenses: ["Android-Apache-2.0"],
Bob Badourd69ad692021-02-16 19:02:14 -08003}
4
Josh Gaocbe70cb2016-10-18 18:17:52 -07005cc_defaults {
6 name: "debuggerd_defaults",
7 cflags: [
8 "-Wall",
9 "-Wextra",
Josh Gaoc7fe0602017-03-13 14:13:29 -070010 "-Werror",
Kalesh Singha9ea7e52021-06-17 15:49:50 -040011 "-Wno-gcc-compat",
Josh Gao2b2ae0c2017-08-21 14:31:17 -070012 "-Wno-unused-argument",
13 "-Wno-unused-function",
Josh Gaocbe70cb2016-10-18 18:17:52 -070014 "-Wno-nullability-completeness",
Christopher Ferrisf58b0092023-09-12 13:01:10 -070015 "-Wno-reorder-init-list",
Josh Gaocbe70cb2016-10-18 18:17:52 -070016 "-Os",
Yabin Cuie90a9442021-08-11 13:21:11 -070017 "-fno-finite-loops",
Alessandra Loro7bd6dca2022-09-01 10:33:35 +000018 "-DANDROID_DEBUGGABLE=0",
Josh Gaocbe70cb2016-10-18 18:17:52 -070019 ],
20
21 local_include_dirs: ["include"],
Alessandra Loro7bd6dca2022-09-01 10:33:35 +000022 product_variables: {
23 debuggable: {
24 cflags: ["-UANDROID_DEBUGGABLE", "-DANDROID_DEBUGGABLE=1"],
25 }
26 },
Josh Gaocbe70cb2016-10-18 18:17:52 -070027}
28
Narayan Kamatha73df602017-05-24 15:07:25 +010029cc_library_headers {
30 name: "libdebuggerd_common_headers",
Elliott Hughesdc699a22018-02-16 17:58:14 -080031 export_include_dirs: ["common/include"],
Jiyong Parka0e75042018-05-24 14:11:00 +090032 recovery_available: true,
Yifan Hong2ec92cf2020-10-27 16:25:45 -070033 vendor_ramdisk_available: true,
Shikha Panwar757f2992022-03-25 19:43:14 +000034 apex_available: [
Spandan Dase6bc0262024-01-02 22:39:00 +000035 "com.android.runtime",
Shikha Panwar757f2992022-03-25 19:43:14 +000036 "com.android.virt",
37 "//apex_available:platform",
Spandan Dase6bc0262024-01-02 22:39:00 +000038 ],
Narayan Kamatha73df602017-05-24 15:07:25 +010039}
40
Narayan Kamath2d377cd2017-05-10 10:58:59 +010041cc_library_shared {
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080042 name: "libtombstoned_client",
43 defaults: ["debuggerd_defaults"],
44 srcs: [
Narayan Kamath2d377cd2017-05-10 10:58:59 +010045 "tombstoned/tombstoned_client.cpp",
46 "util.cpp",
47 ],
48
Narayan Kamatha73df602017-05-24 15:07:25 +010049 header_libs: ["libdebuggerd_common_headers"],
50
Narayan Kamath2d377cd2017-05-10 10:58:59 +010051 static_libs: [
Narayan Kamatha73df602017-05-24 15:07:25 +010052 "libasync_safe",
Narayan Kamath2d377cd2017-05-10 10:58:59 +010053 ],
54
55 shared_libs: [
Narayan Kamath2d377cd2017-05-10 10:58:59 +010056 "libbase",
Narayan Kamatha73df602017-05-24 15:07:25 +010057 "libcutils",
Narayan Kamath2d377cd2017-05-10 10:58:59 +010058 ],
Shikha Panwar757f2992022-03-25 19:43:14 +000059 apex_available: [
60 "com.android.virt",
61 "//apex_available:platform",
62 ],
Narayan Kamath2d377cd2017-05-10 10:58:59 +010063
Narayan Kamatha73df602017-05-24 15:07:25 +010064 export_header_lib_headers: ["libdebuggerd_common_headers"],
Elliott Hughesdc699a22018-02-16 17:58:14 -080065 export_include_dirs: ["tombstoned/include"],
Narayan Kamath2d377cd2017-05-10 10:58:59 +010066}
67
Josh Gao9da1f512018-08-06 15:38:29 -070068// Utility library to talk to tombstoned and get an output fd.
Narayan Kamath2d377cd2017-05-10 10:58:59 +010069cc_library_static {
70 name: "libtombstoned_client_static",
71 defaults: ["debuggerd_defaults"],
Jiyong Park011ee122018-05-29 16:41:30 +090072 recovery_available: true,
Yifan Hong2ec92cf2020-10-27 16:25:45 -070073 vendor_ramdisk_available: true,
Narayan Kamath2d377cd2017-05-10 10:58:59 +010074 srcs: [
75 "tombstoned/tombstoned_client.cpp",
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080076 "util.cpp",
77 ],
78
Narayan Kamatha73df602017-05-24 15:07:25 +010079 header_libs: ["libdebuggerd_common_headers"],
80
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080081 whole_static_libs: [
Christopher Ferrisac225782017-04-25 11:23:10 -070082 "libasync_safe",
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080083 "libcutils",
84 "libbase",
85 ],
Narayan Kamath2d377cd2017-05-10 10:58:59 +010086
Narayan Kamatha73df602017-05-24 15:07:25 +010087 export_header_lib_headers: ["libdebuggerd_common_headers"],
Elliott Hughesdc699a22018-02-16 17:58:14 -080088 export_include_dirs: ["tombstoned/include"],
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080089}
90
91// Core implementation, linked into libdebuggerd_handler and the dynamic linker.
Josh Gao9c02dc52016-06-15 17:29:00 -070092cc_library_static {
Josh Gaoe73c9322017-02-08 16:06:26 -080093 name: "libdebuggerd_handler_core",
Josh Gaocbe70cb2016-10-18 18:17:52 -070094 defaults: ["debuggerd_defaults"],
Jiyong Parka0e75042018-05-24 14:11:00 +090095 recovery_available: true,
Yifan Hong2ec92cf2020-10-27 16:25:45 -070096 vendor_ramdisk_available: true,
Josh Gaocbe70cb2016-10-18 18:17:52 -070097 srcs: ["handler/debuggerd_handler.cpp"],
Josh Gao9c02dc52016-06-15 17:29:00 -070098
Josh Gaofdf832d2017-08-25 18:00:18 -070099 header_libs: [
100 "libbase_headers",
101 "libdebuggerd_common_headers",
Josh Gaoa48b41b2019-12-13 14:11:04 -0800102 "bionic_libc_platform_headers",
Mitch Phillips18ce5422023-01-19 14:23:49 -0800103 "gwp_asan_headers",
Josh Gaofdf832d2017-08-25 18:00:18 -0700104 ],
Narayan Kamatha73df602017-05-24 15:07:25 +0100105
Josh Gaoe73c9322017-02-08 16:06:26 -0800106 whole_static_libs: [
Christopher Ferrisac225782017-04-25 11:23:10 -0700107 "libasync_safe",
Josh Gao2b2ae0c2017-08-21 14:31:17 -0700108 "libcutils",
Josh Gaoe73c9322017-02-08 16:06:26 -0800109 "libdebuggerd",
110 ],
111
Narayan Kamatha73df602017-05-24 15:07:25 +0100112 export_header_lib_headers: ["libdebuggerd_common_headers"],
Josh Gaoe73c9322017-02-08 16:06:26 -0800113 export_include_dirs: ["include"],
Spandan Dase6bc0262024-01-02 22:39:00 +0000114 apex_available: [
115 "com.android.runtime",
116 ],
Josh Gaoe73c9322017-02-08 16:06:26 -0800117}
118
Josh Gaoe1aa0ca2017-03-01 17:23:22 -0800119// Implementation with a no-op fallback.
Josh Gaoe73c9322017-02-08 16:06:26 -0800120cc_library_static {
121 name: "libdebuggerd_handler",
122 defaults: ["debuggerd_defaults"],
123 srcs: ["handler/debuggerd_fallback_nop.cpp"],
124
Josh Gaoa48b41b2019-12-13 14:11:04 -0800125 header_libs: ["bionic_libc_platform_headers"],
126 export_header_lib_headers: ["bionic_libc_platform_headers"],
127
Josh Gaoe73c9322017-02-08 16:06:26 -0800128 whole_static_libs: [
129 "libdebuggerd_handler_core",
130 ],
131
132 export_include_dirs: ["include"],
133}
134
Martin Stjernholma2cc8932019-10-23 21:32:43 +0100135// Fallback implementation, for use in the Bionic linker only.
Josh Gaoe73c9322017-02-08 16:06:26 -0800136cc_library_static {
137 name: "libdebuggerd_handler_fallback",
Martin Stjernholma2cc8932019-10-23 21:32:43 +0100138 visibility: ["//bionic/linker"],
139 apex_available: [
140 "com.android.runtime",
141 "//apex_available:platform",
142 ],
Josh Gaoe73c9322017-02-08 16:06:26 -0800143 defaults: ["debuggerd_defaults"],
Jiyong Park011ee122018-05-29 16:41:30 +0900144 recovery_available: true,
Yifan Hong2ec92cf2020-10-27 16:25:45 -0700145 vendor_ramdisk_available: true,
Josh Gaoe1aa0ca2017-03-01 17:23:22 -0800146 srcs: [
147 "handler/debuggerd_fallback.cpp",
148 ],
Josh Gaoe73c9322017-02-08 16:06:26 -0800149
Josh Gaoe1aa0ca2017-03-01 17:23:22 -0800150 whole_static_libs: [
151 "libdebuggerd_handler_core",
Narayan Kamath2d377cd2017-05-10 10:58:59 +0100152 "libtombstoned_client_static",
Christopher Ferrisac225782017-04-25 11:23:10 -0700153 "libasync_safe",
Josh Gaoe1aa0ca2017-03-01 17:23:22 -0800154 "libbase",
Josh Gaoe73c9322017-02-08 16:06:26 -0800155 "libdebuggerd",
Martin Stjernholma2cc8932019-10-23 21:32:43 +0100156 "libunwindstack_no_dex",
Josh Gaoe73c9322017-02-08 16:06:26 -0800157 "liblzma",
158 "libcutils",
159 ],
Josh Gaoa48b41b2019-12-13 14:11:04 -0800160
161 header_libs: ["bionic_libc_platform_headers"],
162 export_header_lib_headers: ["bionic_libc_platform_headers"],
163
Josh Gaocbe70cb2016-10-18 18:17:52 -0700164 export_include_dirs: ["include"],
165}
166
167cc_library {
168 name: "libdebuggerd_client",
169 defaults: ["debuggerd_defaults"],
170 srcs: [
171 "client/debuggerd_client.cpp",
172 "util.cpp",
173 ],
174
175 shared_libs: [
176 "libbase",
177 "libcutils",
Josh Gao4175cee2019-01-04 13:57:09 -0800178 "libprocinfo",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700179 ],
Josh Gaoe1aa0ca2017-03-01 17:23:22 -0800180
Josh Gaoa48b41b2019-12-13 14:11:04 -0800181 header_libs: [
182 "libdebuggerd_common_headers",
183 "bionic_libc_platform_headers",
184 ],
185 export_header_lib_headers: [
186 "libdebuggerd_common_headers",
187 "bionic_libc_platform_headers",
188 ],
189
Josh Gaocbe70cb2016-10-18 18:17:52 -0700190 export_include_dirs: ["include"],
191}
192
Siim Sammulc08a34e2023-11-17 17:06:15 +0000193cc_library {
194 name: "libdebuggerd_tombstone_proto_to_text",
195 defaults: ["debuggerd_defaults"],
196 ramdisk_available: true,
197 recovery_available: true,
198 vendor_ramdisk_available: true,
199
200 local_include_dirs: ["libdebuggerd/include"],
201 export_include_dirs: ["libdebuggerd/include"],
202
203 srcs: [
204 "libdebuggerd/tombstone_proto_to_text.cpp",
205 ],
206
207 header_libs: [
208 "bionic_libc_platform_headers",
209 ],
210
211 static_libs: [
212 "libbase",
213 "liblog_for_runtime_apex",
214 "libunwindstack",
215 ],
216
217 whole_static_libs: [
218 "libtombstone_proto",
219 "libprotobuf-cpp-lite",
220 ],
221
222 apex_available: [
223 "//apex_available:platform",
224 "com.android.runtime",
225 ],
226}
227
Josh Gaoe73c9322017-02-08 16:06:26 -0800228cc_library_static {
Josh Gaocbe70cb2016-10-18 18:17:52 -0700229 name: "libdebuggerd",
230 defaults: ["debuggerd_defaults"],
Christopher Ferris48d6e042023-07-31 14:24:01 -0700231 ramdisk_available: true,
Jiyong Parka0e75042018-05-24 14:11:00 +0900232 recovery_available: true,
Yifan Hong2ec92cf2020-10-27 16:25:45 -0700233 vendor_ramdisk_available: true,
Josh Gaocbe70cb2016-10-18 18:17:52 -0700234
235 srcs: [
236 "libdebuggerd/backtrace.cpp",
Mitch Phillipse0b4bb12020-02-14 14:54:31 -0800237 "libdebuggerd/gwp_asan.cpp",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700238 "libdebuggerd/open_files_list.cpp",
239 "libdebuggerd/tombstone.cpp",
Josh Gao76e1e302021-01-26 15:53:11 -0800240 "libdebuggerd/tombstone_proto.cpp",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700241 "libdebuggerd/utility.cpp",
242 ],
243
Josh Gaocbe70cb2016-10-18 18:17:52 -0700244 local_include_dirs: ["libdebuggerd/include"],
245 export_include_dirs: ["libdebuggerd/include"],
Josh Gao9c02dc52016-06-15 17:29:00 -0700246
Peter Collingbournef8622522020-04-07 14:07:32 -0700247 include_dirs: [
248 // Needed for private/bionic_fdsan.h
249 "bionic/libc",
Peter Collingbournef8622522020-04-07 14:07:32 -0700250 ],
Mitch Phillipse0b4bb12020-02-14 14:54:31 -0800251 header_libs: [
252 "bionic_libc_platform_headers",
253 "gwp_asan_headers",
Jiyong Parkeb769d62022-08-19 13:21:02 +0900254 "liblog_headers",
Mitch Phillipse0b4bb12020-02-14 14:54:31 -0800255 ],
Josh Gaoce841d92018-08-06 18:26:42 -0700256
Josh Gaoe73c9322017-02-08 16:06:26 -0800257 static_libs: [
Martin Stjernholma2cc8932019-10-23 21:32:43 +0100258 "libdexfile_support", // libunwindstack dependency
Christopher Ferris9a8c8552017-08-11 15:29:19 -0700259 "libunwindstack",
Josh Gaoe73c9322017-02-08 16:06:26 -0800260 "liblzma",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700261 "libbase",
262 "libcutils",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700263 ],
Josh Gaoa48b41b2019-12-13 14:11:04 -0800264
Peter Collingbournef8622522020-04-07 14:07:32 -0700265 whole_static_libs: [
Siim Sammulc08a34e2023-11-17 17:06:15 +0000266 "libdebuggerd_tombstone_proto_to_text",
Josh Gao618cea32021-01-26 17:45:43 -0800267 "libasync_safe",
Peter Collingbournef8622522020-04-07 14:07:32 -0700268 "gwp_asan_crash_handler",
Josh Gao76e1e302021-01-26 15:53:11 -0800269 "libtombstone_proto",
Josh Gaodbb83de2021-03-01 23:13:13 -0800270 "libprocinfo",
Josh Gao76e1e302021-01-26 15:53:11 -0800271 "libprotobuf-cpp-lite",
Peter Collingbournef8622522020-04-07 14:07:32 -0700272 ],
Mitch Phillipse0b4bb12020-02-14 14:54:31 -0800273
Martin Stjernholmbb4f2b42018-12-19 14:28:33 +0000274 target: {
275 recovery: {
276 exclude_static_libs: [
Martin Stjernholma2cc8932019-10-23 21:32:43 +0100277 "libdexfile_support",
Martin Stjernholmbb4f2b42018-12-19 14:28:33 +0000278 ],
Martin Stjernholm3784b9d2021-08-26 21:18:43 +0100279 exclude_runtime_libs: [
280 "libdexfile",
281 ],
Martin Stjernholmbb4f2b42018-12-19 14:28:33 +0000282 },
Yifan Hong2ec92cf2020-10-27 16:25:45 -0700283 vendor_ramdisk: {
284 exclude_static_libs: [
285 "libdexfile_support",
286 ],
Martin Stjernholm3784b9d2021-08-26 21:18:43 +0100287 exclude_runtime_libs: [
288 "libdexfile",
289 ],
Yifan Hong2ec92cf2020-10-27 16:25:45 -0700290 },
Christopher Ferris48d6e042023-07-31 14:24:01 -0700291 ramdisk: {
292 exclude_static_libs: [
293 "libdexfile_support",
294 ],
295 exclude_runtime_libs: [
296 "libdexfile",
297 ],
298 },
299 android: {
300 runtime_libs: [
301 "libdexfile", // libdexfile_support dependency
302 ],
303 },
Martin Stjernholmbb4f2b42018-12-19 14:28:33 +0000304 },
Christopher Ferris4ae266c2019-04-03 09:27:12 -0700305
306 product_variables: {
307 debuggable: {
308 cflags: ["-DROOT_POSSIBLE"],
309 },
Christopher Ferris7aad2562021-09-24 00:06:38 -0700310
311 malloc_not_svelte: {
312 cflags: ["-DUSE_SCUDO"],
313 whole_static_libs: ["libscudo"],
314 srcs: ["libdebuggerd/scudo.cpp"],
315 header_libs: ["scudo_headers"],
316 },
Christopher Ferris4ae266c2019-04-03 09:27:12 -0700317 },
Spandan Dase6bc0262024-01-02 22:39:00 +0000318 apex_available: [
319 "com.android.runtime",
320 ],
Josh Gaocbe70cb2016-10-18 18:17:52 -0700321}
322
Josh Gao76e1e302021-01-26 15:53:11 -0800323cc_binary {
324 name: "pbtombstone",
325 defaults: ["debuggerd_defaults"],
326 srcs: ["pbtombstone.cpp"],
327 static_libs: [
328 "libbase",
329 "libdebuggerd",
330 "liblog",
331 "libprotobuf-cpp-lite",
332 "libtombstone_proto",
333 "libunwindstack",
334 ],
335}
336
Christopher Ferrisfe751c52021-04-16 09:40:40 -0700337cc_test_library {
338 name: "libcrash_test",
339 defaults: ["debuggerd_defaults"],
340 srcs: ["crash_test.cpp"],
341}
342
Josh Gaocbe70cb2016-10-18 18:17:52 -0700343cc_test {
344 name: "debuggerd_test",
345 defaults: ["debuggerd_defaults"],
Josh Gao6cad1392019-08-27 16:02:38 -0700346 require_root: true,
Josh Gaocbe70cb2016-10-18 18:17:52 -0700347
348 cflags: ["-Wno-missing-field-initializers"],
349 srcs: [
350 "libdebuggerd/test/dump_memory_test.cpp",
351 "libdebuggerd/test/elf_fake.cpp",
352 "libdebuggerd/test/log_fake.cpp",
353 "libdebuggerd/test/open_files_list_test.cpp",
Siim Sammulc08a34e2023-11-17 17:06:15 +0000354 "libdebuggerd/test/tombstone_proto_to_text_test.cpp",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700355 ],
356
357 target: {
358 android: {
359 srcs: [
Josh Gaoae9d7672017-03-24 16:26:03 -0700360 "client/debuggerd_client_test.cpp",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700361 "debuggerd_test.cpp",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700362 ],
Elliott Hughesdc699a22018-02-16 17:58:14 -0800363 static_libs: [
364 "libasync_safe",
365 "libtombstoned_client_static",
366 ],
Josh Gaocbe70cb2016-10-18 18:17:52 -0700367 },
368 },
369
370 shared_libs: [
Josh Gaocbe70cb2016-10-18 18:17:52 -0700371 "libbase",
372 "libcutils",
Josh Gaoae9d7672017-03-24 16:26:03 -0700373 "libdebuggerd_client",
Narayan Kamatha73df602017-05-24 15:07:25 +0100374 "liblog",
Elliott Hughesdc699a22018-02-16 17:58:14 -0800375 "libnativehelper",
Martin Stjernholm852b64e2019-02-20 17:01:24 +0000376 "libunwindstack",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700377 ],
378
379 static_libs: [
Josh Gao352a8452017-03-30 16:46:21 -0700380 "libdebuggerd",
Mitch Phillipse0b4bb12020-02-14 14:54:31 -0800381 "libgmock",
Peter Collingbourned00a5772020-07-20 23:11:16 -0700382 "libminijail",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700383 ],
384
Josh Gaoa48b41b2019-12-13 14:11:04 -0800385 header_libs: [
386 "bionic_libc_platform_headers",
Mitch Phillipse0b4bb12020-02-14 14:54:31 -0800387 "gwp_asan_headers",
Josh Gaoa48b41b2019-12-13 14:11:04 -0800388 ],
389
Josh Gaocbe70cb2016-10-18 18:17:52 -0700390 local_include_dirs: [
391 "libdebuggerd",
392 ],
393
394 compile_multilib: "both",
395 multilib: {
396 lib32: {
397 stem: "debuggerd_test32",
398 },
399 lib64: {
400 stem: "debuggerd_test64",
401 },
402 },
Elliott Hughes40fdf3f2018-04-27 16:12:06 -0700403
Christopher Ferrisfe751c52021-04-16 09:40:40 -0700404 data: [
405 ":libcrash_test",
406 ],
407
Elliott Hughes40fdf3f2018-04-27 16:12:06 -0700408 test_suites: ["device-tests"],
Josh Gaocbe70cb2016-10-18 18:17:52 -0700409}
410
Josh Gaoa42314e2017-12-19 15:08:19 -0800411cc_benchmark {
412 name: "debuggerd_benchmark",
413 defaults: ["debuggerd_defaults"],
414 srcs: ["debuggerd_benchmark.cpp"],
415 shared_libs: [
416 "libbase",
417 "libdebuggerd_client",
418 ],
419}
420
Josh Gaocbe70cb2016-10-18 18:17:52 -0700421cc_binary {
422 name: "crash_dump",
423 srcs: [
424 "crash_dump.cpp",
Shikha Panwarabde59e2023-02-03 15:05:18 +0000425 "tombstone_handler.cpp",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700426 "util.cpp",
427 ],
428 defaults: ["debuggerd_defaults"],
429
430 compile_multilib: "both",
431 multilib: {
432 lib32: {
433 suffix: "32",
434 },
435 lib64: {
436 suffix: "64",
437 },
438 },
439
Josh Gaoa48b41b2019-12-13 14:11:04 -0800440 header_libs: [
441 "bionic_libc_platform_headers",
442 ],
443
Josh Gaoe73c9322017-02-08 16:06:26 -0800444 static_libs: [
Narayan Kamath2d377cd2017-05-10 10:58:59 +0100445 "libtombstoned_client_static",
Josh Gaoe73c9322017-02-08 16:06:26 -0800446 "libdebuggerd",
447 "libcutils",
Josh Gao76e1e302021-01-26 15:53:11 -0800448
449 "libtombstone_proto",
450 "libprotobuf-cpp-lite",
Josh Gaoe73c9322017-02-08 16:06:26 -0800451 ],
452
Josh Gaocbe70cb2016-10-18 18:17:52 -0700453 shared_libs: [
Josh Gaocbe70cb2016-10-18 18:17:52 -0700454 "libbase",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700455 "liblog",
456 "libprocinfo",
Josh Gao2b2ae0c2017-08-21 14:31:17 -0700457 "libunwindstack",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700458 ],
Peter Collingbourneb72e7482020-03-16 18:14:13 -0700459
460 apex_available: [
461 "com.android.runtime",
462 ],
Peter Collingbournea2739da2022-02-02 17:00:42 -0800463
464 // Required for tests.
465 required: ["crash_dump.policy"],
Josh Gaocbe70cb2016-10-18 18:17:52 -0700466}
467
468cc_binary {
469 name: "debuggerd",
470 srcs: [
471 "debuggerd.cpp",
472 ],
473 defaults: ["debuggerd_defaults"],
474
475 shared_libs: [
476 "libbase",
477 "libdebuggerd_client",
478 "liblog",
Josh Gao0915f232017-06-27 14:08:05 -0700479 "libprocinfo",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700480 ],
481
482 local_include_dirs: ["include"],
483}
484
Nikita Ioffe75be7842022-10-24 15:31:11 +0100485cc_defaults {
486 name: "tombstoned_defaults",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700487 srcs: [
488 "util.cpp",
489 "tombstoned/intercept_manager.cpp",
490 "tombstoned/tombstoned.cpp",
491 ],
492 defaults: ["debuggerd_defaults"],
493
Josh Gaoa48b41b2019-12-13 14:11:04 -0800494 header_libs: [
495 "bionic_libc_platform_headers",
496 "libdebuggerd_common_headers"
497 ],
Narayan Kamatha73df602017-05-24 15:07:25 +0100498
Josh Gaocbe70cb2016-10-18 18:17:52 -0700499 static_libs: [
500 "libbase",
501 "libcutils",
502 "libevent",
503 "liblog",
504 ],
Nikita Ioffe75be7842022-10-24 15:31:11 +0100505}
Josh Gaocbe70cb2016-10-18 18:17:52 -0700506
Nikita Ioffe75be7842022-10-24 15:31:11 +0100507cc_binary {
508 name: "tombstoned",
509 defaults: ["tombstoned_defaults"],
Elliott Hughesdc699a22018-02-16 17:58:14 -0800510 init_rc: ["tombstoned/tombstoned.rc"],
Josh Gao9c02dc52016-06-15 17:29:00 -0700511}
Ray Essickbd3ba782020-01-21 15:21:08 -0800512
Nikita Ioffe75be7842022-10-24 15:31:11 +0100513cc_binary {
514 name: "tombstoned.microdroid",
515 defaults: ["tombstoned_defaults"],
516 init_rc: ["tombstoned/tombstoned.microdroid.rc"],
517}
518
Ray Essickbd3ba782020-01-21 15:21:08 -0800519prebuilt_etc {
520 name: "crash_dump.policy",
521 sub_dir: "seccomp_policy",
522 filename_from_src: true,
523 arch: {
524 arm: {
525 src: "seccomp_policy/crash_dump.arm.policy",
Elliott Hughes2f883312022-11-14 20:02:28 +0000526 required: [
527 "crash_dump.policy_other",
528 ],
Ray Essickbd3ba782020-01-21 15:21:08 -0800529 },
530 arm64: {
531 src: "seccomp_policy/crash_dump.arm64.policy",
Elliott Hughes2f883312022-11-14 20:02:28 +0000532 required: [
533 "crash_dump.policy_other",
534 ],
Ray Essickbd3ba782020-01-21 15:21:08 -0800535 },
Chen Guoyina22af662022-10-12 22:32:55 +0800536 riscv64: {
537 src: "seccomp_policy/crash_dump.riscv64.policy",
538 },
Ray Essickbd3ba782020-01-21 15:21:08 -0800539 x86: {
540 src: "seccomp_policy/crash_dump.x86.policy",
Elliott Hughes2f883312022-11-14 20:02:28 +0000541 required: [
542 "crash_dump.policy_other",
543 ],
Ray Essickbd3ba782020-01-21 15:21:08 -0800544 },
545 x86_64: {
546 src: "seccomp_policy/crash_dump.x86_64.policy",
Elliott Hughes2f883312022-11-14 20:02:28 +0000547 required: [
548 "crash_dump.policy_other",
549 ],
Ray Essickbd3ba782020-01-21 15:21:08 -0800550 },
551 },
Ray Essickbd3ba782020-01-21 15:21:08 -0800552}
553
554
Elliott Hughes2f883312022-11-14 20:02:28 +0000555// This installs the "other" architecture (so 32-bit on 64-bit device).
Ray Essickbd3ba782020-01-21 15:21:08 -0800556prebuilt_etc {
557 name: "crash_dump.policy_other",
558 sub_dir: "seccomp_policy",
559 filename_from_src: true,
560 arch: {
561 arm: {
562 src: "seccomp_policy/crash_dump.arm64.policy",
563 },
564 arm64: {
565 src: "seccomp_policy/crash_dump.arm.policy",
566 },
Elliott Hughes857e29c2023-03-20 15:48:30 -0700567 riscv64: {
568 enabled: false,
569 },
Ray Essickbd3ba782020-01-21 15:21:08 -0800570 x86: {
571 src: "seccomp_policy/crash_dump.x86_64.policy",
572 },
573 x86_64: {
574 src: "seccomp_policy/crash_dump.x86.policy",
575 },
576 },
577}