blob: 7d20995d7950c92af1e41d2c49fd47959b0ec865 [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"],
Spandan Das2e5cfbc2024-01-04 01:34:40 +000089 apex_available: ["com.android.runtime"],
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080090}
91
92// Core implementation, linked into libdebuggerd_handler and the dynamic linker.
Josh Gao9c02dc52016-06-15 17:29:00 -070093cc_library_static {
Josh Gaoe73c9322017-02-08 16:06:26 -080094 name: "libdebuggerd_handler_core",
Josh Gaocbe70cb2016-10-18 18:17:52 -070095 defaults: ["debuggerd_defaults"],
Jiyong Parka0e75042018-05-24 14:11:00 +090096 recovery_available: true,
Yifan Hong2ec92cf2020-10-27 16:25:45 -070097 vendor_ramdisk_available: true,
Josh Gaocbe70cb2016-10-18 18:17:52 -070098 srcs: ["handler/debuggerd_handler.cpp"],
Josh Gao9c02dc52016-06-15 17:29:00 -070099
Josh Gaofdf832d2017-08-25 18:00:18 -0700100 header_libs: [
101 "libbase_headers",
102 "libdebuggerd_common_headers",
Josh Gaoa48b41b2019-12-13 14:11:04 -0800103 "bionic_libc_platform_headers",
Mitch Phillips18ce5422023-01-19 14:23:49 -0800104 "gwp_asan_headers",
Josh Gaofdf832d2017-08-25 18:00:18 -0700105 ],
Narayan Kamatha73df602017-05-24 15:07:25 +0100106
Josh Gaoe73c9322017-02-08 16:06:26 -0800107 whole_static_libs: [
Christopher Ferrisac225782017-04-25 11:23:10 -0700108 "libasync_safe",
Josh Gao2b2ae0c2017-08-21 14:31:17 -0700109 "libcutils",
Josh Gaoe73c9322017-02-08 16:06:26 -0800110 "libdebuggerd",
111 ],
112
Narayan Kamatha73df602017-05-24 15:07:25 +0100113 export_header_lib_headers: ["libdebuggerd_common_headers"],
Josh Gaoe73c9322017-02-08 16:06:26 -0800114 export_include_dirs: ["include"],
Spandan Dase6bc0262024-01-02 22:39:00 +0000115 apex_available: [
116 "com.android.runtime",
117 ],
Josh Gaoe73c9322017-02-08 16:06:26 -0800118}
119
Josh Gaoe1aa0ca2017-03-01 17:23:22 -0800120// Implementation with a no-op fallback.
Josh Gaoe73c9322017-02-08 16:06:26 -0800121cc_library_static {
122 name: "libdebuggerd_handler",
123 defaults: ["debuggerd_defaults"],
124 srcs: ["handler/debuggerd_fallback_nop.cpp"],
125
Josh Gaoa48b41b2019-12-13 14:11:04 -0800126 header_libs: ["bionic_libc_platform_headers"],
127 export_header_lib_headers: ["bionic_libc_platform_headers"],
128
Josh Gaoe73c9322017-02-08 16:06:26 -0800129 whole_static_libs: [
130 "libdebuggerd_handler_core",
131 ],
132
133 export_include_dirs: ["include"],
134}
135
Martin Stjernholma2cc8932019-10-23 21:32:43 +0100136// Fallback implementation, for use in the Bionic linker only.
Josh Gaoe73c9322017-02-08 16:06:26 -0800137cc_library_static {
138 name: "libdebuggerd_handler_fallback",
Martin Stjernholma2cc8932019-10-23 21:32:43 +0100139 visibility: ["//bionic/linker"],
140 apex_available: [
141 "com.android.runtime",
142 "//apex_available:platform",
143 ],
Josh Gaoe73c9322017-02-08 16:06:26 -0800144 defaults: ["debuggerd_defaults"],
Jiyong Park011ee122018-05-29 16:41:30 +0900145 recovery_available: true,
Yifan Hong2ec92cf2020-10-27 16:25:45 -0700146 vendor_ramdisk_available: true,
Josh Gaoe1aa0ca2017-03-01 17:23:22 -0800147 srcs: [
148 "handler/debuggerd_fallback.cpp",
149 ],
Josh Gaoe73c9322017-02-08 16:06:26 -0800150
Josh Gaoe1aa0ca2017-03-01 17:23:22 -0800151 whole_static_libs: [
152 "libdebuggerd_handler_core",
Narayan Kamath2d377cd2017-05-10 10:58:59 +0100153 "libtombstoned_client_static",
Christopher Ferrisac225782017-04-25 11:23:10 -0700154 "libasync_safe",
Josh Gaoe1aa0ca2017-03-01 17:23:22 -0800155 "libbase",
Josh Gaoe73c9322017-02-08 16:06:26 -0800156 "libdebuggerd",
Martin Stjernholma2cc8932019-10-23 21:32:43 +0100157 "libunwindstack_no_dex",
Josh Gaoe73c9322017-02-08 16:06:26 -0800158 "liblzma",
159 "libcutils",
160 ],
Josh Gaoa48b41b2019-12-13 14:11:04 -0800161
162 header_libs: ["bionic_libc_platform_headers"],
163 export_header_lib_headers: ["bionic_libc_platform_headers"],
164
Josh Gaocbe70cb2016-10-18 18:17:52 -0700165 export_include_dirs: ["include"],
166}
167
168cc_library {
169 name: "libdebuggerd_client",
170 defaults: ["debuggerd_defaults"],
171 srcs: [
172 "client/debuggerd_client.cpp",
173 "util.cpp",
174 ],
175
176 shared_libs: [
177 "libbase",
178 "libcutils",
Josh Gao4175cee2019-01-04 13:57:09 -0800179 "libprocinfo",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700180 ],
Josh Gaoe1aa0ca2017-03-01 17:23:22 -0800181
Josh Gaoa48b41b2019-12-13 14:11:04 -0800182 header_libs: [
183 "libdebuggerd_common_headers",
184 "bionic_libc_platform_headers",
185 ],
186 export_header_lib_headers: [
187 "libdebuggerd_common_headers",
188 "bionic_libc_platform_headers",
189 ],
190
Josh Gaocbe70cb2016-10-18 18:17:52 -0700191 export_include_dirs: ["include"],
192}
193
Siim Sammulc08a34e2023-11-17 17:06:15 +0000194cc_library {
195 name: "libdebuggerd_tombstone_proto_to_text",
196 defaults: ["debuggerd_defaults"],
197 ramdisk_available: true,
198 recovery_available: true,
199 vendor_ramdisk_available: true,
200
201 local_include_dirs: ["libdebuggerd/include"],
202 export_include_dirs: ["libdebuggerd/include"],
203
204 srcs: [
205 "libdebuggerd/tombstone_proto_to_text.cpp",
206 ],
207
208 header_libs: [
209 "bionic_libc_platform_headers",
210 ],
211
212 static_libs: [
213 "libbase",
214 "liblog_for_runtime_apex",
215 "libunwindstack",
216 ],
217
218 whole_static_libs: [
219 "libtombstone_proto",
220 "libprotobuf-cpp-lite",
221 ],
222
223 apex_available: [
224 "//apex_available:platform",
225 "com.android.runtime",
226 ],
227}
228
Josh Gaoe73c9322017-02-08 16:06:26 -0800229cc_library_static {
Josh Gaocbe70cb2016-10-18 18:17:52 -0700230 name: "libdebuggerd",
231 defaults: ["debuggerd_defaults"],
Christopher Ferris48d6e042023-07-31 14:24:01 -0700232 ramdisk_available: true,
Jiyong Parka0e75042018-05-24 14:11:00 +0900233 recovery_available: true,
Yifan Hong2ec92cf2020-10-27 16:25:45 -0700234 vendor_ramdisk_available: true,
Josh Gaocbe70cb2016-10-18 18:17:52 -0700235
236 srcs: [
237 "libdebuggerd/backtrace.cpp",
Mitch Phillipse0b4bb12020-02-14 14:54:31 -0800238 "libdebuggerd/gwp_asan.cpp",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700239 "libdebuggerd/open_files_list.cpp",
240 "libdebuggerd/tombstone.cpp",
Josh Gao76e1e302021-01-26 15:53:11 -0800241 "libdebuggerd/tombstone_proto.cpp",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700242 "libdebuggerd/utility.cpp",
243 ],
244
Josh Gaocbe70cb2016-10-18 18:17:52 -0700245 local_include_dirs: ["libdebuggerd/include"],
246 export_include_dirs: ["libdebuggerd/include"],
Josh Gao9c02dc52016-06-15 17:29:00 -0700247
Peter Collingbournef8622522020-04-07 14:07:32 -0700248 include_dirs: [
249 // Needed for private/bionic_fdsan.h
250 "bionic/libc",
Peter Collingbournef8622522020-04-07 14:07:32 -0700251 ],
Mitch Phillipse0b4bb12020-02-14 14:54:31 -0800252 header_libs: [
253 "bionic_libc_platform_headers",
254 "gwp_asan_headers",
Jiyong Parkeb769d62022-08-19 13:21:02 +0900255 "liblog_headers",
Mitch Phillipse0b4bb12020-02-14 14:54:31 -0800256 ],
Josh Gaoce841d92018-08-06 18:26:42 -0700257
Josh Gaoe73c9322017-02-08 16:06:26 -0800258 static_libs: [
Martin Stjernholma2cc8932019-10-23 21:32:43 +0100259 "libdexfile_support", // libunwindstack dependency
Christopher Ferris9a8c8552017-08-11 15:29:19 -0700260 "libunwindstack",
Josh Gaoe73c9322017-02-08 16:06:26 -0800261 "liblzma",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700262 "libbase",
263 "libcutils",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700264 ],
Josh Gaoa48b41b2019-12-13 14:11:04 -0800265
Peter Collingbournef8622522020-04-07 14:07:32 -0700266 whole_static_libs: [
Siim Sammulc08a34e2023-11-17 17:06:15 +0000267 "libdebuggerd_tombstone_proto_to_text",
Josh Gao618cea32021-01-26 17:45:43 -0800268 "libasync_safe",
Peter Collingbournef8622522020-04-07 14:07:32 -0700269 "gwp_asan_crash_handler",
Josh Gao76e1e302021-01-26 15:53:11 -0800270 "libtombstone_proto",
Josh Gaodbb83de2021-03-01 23:13:13 -0800271 "libprocinfo",
Josh Gao76e1e302021-01-26 15:53:11 -0800272 "libprotobuf-cpp-lite",
Peter Collingbournef8622522020-04-07 14:07:32 -0700273 ],
Mitch Phillipse0b4bb12020-02-14 14:54:31 -0800274
Martin Stjernholmbb4f2b42018-12-19 14:28:33 +0000275 target: {
276 recovery: {
277 exclude_static_libs: [
Martin Stjernholma2cc8932019-10-23 21:32:43 +0100278 "libdexfile_support",
Martin Stjernholmbb4f2b42018-12-19 14:28:33 +0000279 ],
Martin Stjernholm3784b9d2021-08-26 21:18:43 +0100280 exclude_runtime_libs: [
281 "libdexfile",
282 ],
Martin Stjernholmbb4f2b42018-12-19 14:28:33 +0000283 },
Yifan Hong2ec92cf2020-10-27 16:25:45 -0700284 vendor_ramdisk: {
285 exclude_static_libs: [
286 "libdexfile_support",
287 ],
Martin Stjernholm3784b9d2021-08-26 21:18:43 +0100288 exclude_runtime_libs: [
289 "libdexfile",
290 ],
Yifan Hong2ec92cf2020-10-27 16:25:45 -0700291 },
Christopher Ferris48d6e042023-07-31 14:24:01 -0700292 ramdisk: {
293 exclude_static_libs: [
294 "libdexfile_support",
295 ],
296 exclude_runtime_libs: [
297 "libdexfile",
298 ],
299 },
300 android: {
301 runtime_libs: [
302 "libdexfile", // libdexfile_support dependency
303 ],
304 },
Martin Stjernholmbb4f2b42018-12-19 14:28:33 +0000305 },
Christopher Ferris4ae266c2019-04-03 09:27:12 -0700306
307 product_variables: {
308 debuggable: {
309 cflags: ["-DROOT_POSSIBLE"],
310 },
Christopher Ferris7aad2562021-09-24 00:06:38 -0700311
312 malloc_not_svelte: {
313 cflags: ["-DUSE_SCUDO"],
314 whole_static_libs: ["libscudo"],
315 srcs: ["libdebuggerd/scudo.cpp"],
316 header_libs: ["scudo_headers"],
317 },
Christopher Ferris4ae266c2019-04-03 09:27:12 -0700318 },
Spandan Dase6bc0262024-01-02 22:39:00 +0000319 apex_available: [
320 "com.android.runtime",
321 ],
Josh Gaocbe70cb2016-10-18 18:17:52 -0700322}
323
Josh Gao76e1e302021-01-26 15:53:11 -0800324cc_binary {
325 name: "pbtombstone",
326 defaults: ["debuggerd_defaults"],
327 srcs: ["pbtombstone.cpp"],
328 static_libs: [
329 "libbase",
330 "libdebuggerd",
331 "liblog",
332 "libprotobuf-cpp-lite",
333 "libtombstone_proto",
334 "libunwindstack",
335 ],
336}
337
Christopher Ferrisfe751c52021-04-16 09:40:40 -0700338cc_test_library {
339 name: "libcrash_test",
340 defaults: ["debuggerd_defaults"],
341 srcs: ["crash_test.cpp"],
342}
343
Josh Gaocbe70cb2016-10-18 18:17:52 -0700344cc_test {
345 name: "debuggerd_test",
346 defaults: ["debuggerd_defaults"],
Josh Gao6cad1392019-08-27 16:02:38 -0700347 require_root: true,
Josh Gaocbe70cb2016-10-18 18:17:52 -0700348
349 cflags: ["-Wno-missing-field-initializers"],
350 srcs: [
351 "libdebuggerd/test/dump_memory_test.cpp",
352 "libdebuggerd/test/elf_fake.cpp",
353 "libdebuggerd/test/log_fake.cpp",
354 "libdebuggerd/test/open_files_list_test.cpp",
Siim Sammulc08a34e2023-11-17 17:06:15 +0000355 "libdebuggerd/test/tombstone_proto_to_text_test.cpp",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700356 ],
357
358 target: {
359 android: {
360 srcs: [
Josh Gaoae9d7672017-03-24 16:26:03 -0700361 "client/debuggerd_client_test.cpp",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700362 "debuggerd_test.cpp",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700363 ],
Elliott Hughesdc699a22018-02-16 17:58:14 -0800364 static_libs: [
365 "libasync_safe",
366 "libtombstoned_client_static",
367 ],
Josh Gaocbe70cb2016-10-18 18:17:52 -0700368 },
369 },
370
371 shared_libs: [
Josh Gaocbe70cb2016-10-18 18:17:52 -0700372 "libbase",
373 "libcutils",
Josh Gaoae9d7672017-03-24 16:26:03 -0700374 "libdebuggerd_client",
Narayan Kamatha73df602017-05-24 15:07:25 +0100375 "liblog",
Elliott Hughesdc699a22018-02-16 17:58:14 -0800376 "libnativehelper",
Martin Stjernholm852b64e2019-02-20 17:01:24 +0000377 "libunwindstack",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700378 ],
379
380 static_libs: [
Josh Gao352a8452017-03-30 16:46:21 -0700381 "libdebuggerd",
Mitch Phillipse0b4bb12020-02-14 14:54:31 -0800382 "libgmock",
Peter Collingbourned00a5772020-07-20 23:11:16 -0700383 "libminijail",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700384 ],
385
Josh Gaoa48b41b2019-12-13 14:11:04 -0800386 header_libs: [
387 "bionic_libc_platform_headers",
Mitch Phillipse0b4bb12020-02-14 14:54:31 -0800388 "gwp_asan_headers",
Josh Gaoa48b41b2019-12-13 14:11:04 -0800389 ],
390
Josh Gaocbe70cb2016-10-18 18:17:52 -0700391 local_include_dirs: [
392 "libdebuggerd",
393 ],
394
395 compile_multilib: "both",
396 multilib: {
397 lib32: {
398 stem: "debuggerd_test32",
399 },
400 lib64: {
401 stem: "debuggerd_test64",
402 },
403 },
Elliott Hughes40fdf3f2018-04-27 16:12:06 -0700404
Christopher Ferrisfe751c52021-04-16 09:40:40 -0700405 data: [
406 ":libcrash_test",
407 ],
408
Elliott Hughes40fdf3f2018-04-27 16:12:06 -0700409 test_suites: ["device-tests"],
Josh Gaocbe70cb2016-10-18 18:17:52 -0700410}
411
Josh Gaoa42314e2017-12-19 15:08:19 -0800412cc_benchmark {
413 name: "debuggerd_benchmark",
414 defaults: ["debuggerd_defaults"],
415 srcs: ["debuggerd_benchmark.cpp"],
416 shared_libs: [
417 "libbase",
418 "libdebuggerd_client",
419 ],
420}
421
Josh Gaocbe70cb2016-10-18 18:17:52 -0700422cc_binary {
423 name: "crash_dump",
424 srcs: [
425 "crash_dump.cpp",
Shikha Panwarabde59e2023-02-03 15:05:18 +0000426 "tombstone_handler.cpp",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700427 "util.cpp",
428 ],
429 defaults: ["debuggerd_defaults"],
430
431 compile_multilib: "both",
432 multilib: {
433 lib32: {
434 suffix: "32",
435 },
436 lib64: {
437 suffix: "64",
438 },
439 },
440
Josh Gaoa48b41b2019-12-13 14:11:04 -0800441 header_libs: [
442 "bionic_libc_platform_headers",
443 ],
444
Josh Gaoe73c9322017-02-08 16:06:26 -0800445 static_libs: [
Narayan Kamath2d377cd2017-05-10 10:58:59 +0100446 "libtombstoned_client_static",
Josh Gaoe73c9322017-02-08 16:06:26 -0800447 "libdebuggerd",
448 "libcutils",
Josh Gao76e1e302021-01-26 15:53:11 -0800449
450 "libtombstone_proto",
451 "libprotobuf-cpp-lite",
Josh Gaoe73c9322017-02-08 16:06:26 -0800452 ],
453
Josh Gaocbe70cb2016-10-18 18:17:52 -0700454 shared_libs: [
Josh Gaocbe70cb2016-10-18 18:17:52 -0700455 "libbase",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700456 "liblog",
457 "libprocinfo",
Josh Gao2b2ae0c2017-08-21 14:31:17 -0700458 "libunwindstack",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700459 ],
Peter Collingbourneb72e7482020-03-16 18:14:13 -0700460
461 apex_available: [
462 "com.android.runtime",
463 ],
Peter Collingbournea2739da2022-02-02 17:00:42 -0800464
465 // Required for tests.
466 required: ["crash_dump.policy"],
Josh Gaocbe70cb2016-10-18 18:17:52 -0700467}
468
469cc_binary {
470 name: "debuggerd",
471 srcs: [
472 "debuggerd.cpp",
473 ],
474 defaults: ["debuggerd_defaults"],
475
476 shared_libs: [
477 "libbase",
478 "libdebuggerd_client",
479 "liblog",
Josh Gao0915f232017-06-27 14:08:05 -0700480 "libprocinfo",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700481 ],
482
483 local_include_dirs: ["include"],
484}
485
Nikita Ioffe75be7842022-10-24 15:31:11 +0100486cc_defaults {
487 name: "tombstoned_defaults",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700488 srcs: [
489 "util.cpp",
490 "tombstoned/intercept_manager.cpp",
491 "tombstoned/tombstoned.cpp",
492 ],
493 defaults: ["debuggerd_defaults"],
494
Josh Gaoa48b41b2019-12-13 14:11:04 -0800495 header_libs: [
496 "bionic_libc_platform_headers",
497 "libdebuggerd_common_headers"
498 ],
Narayan Kamatha73df602017-05-24 15:07:25 +0100499
Josh Gaocbe70cb2016-10-18 18:17:52 -0700500 static_libs: [
501 "libbase",
502 "libcutils",
503 "libevent",
504 "liblog",
505 ],
Nikita Ioffe75be7842022-10-24 15:31:11 +0100506}
Josh Gaocbe70cb2016-10-18 18:17:52 -0700507
Nikita Ioffe75be7842022-10-24 15:31:11 +0100508cc_binary {
509 name: "tombstoned",
510 defaults: ["tombstoned_defaults"],
Elliott Hughesdc699a22018-02-16 17:58:14 -0800511 init_rc: ["tombstoned/tombstoned.rc"],
Josh Gao9c02dc52016-06-15 17:29:00 -0700512}
Ray Essickbd3ba782020-01-21 15:21:08 -0800513
Nikita Ioffe75be7842022-10-24 15:31:11 +0100514cc_binary {
515 name: "tombstoned.microdroid",
516 defaults: ["tombstoned_defaults"],
517 init_rc: ["tombstoned/tombstoned.microdroid.rc"],
518}
519
Ray Essickbd3ba782020-01-21 15:21:08 -0800520prebuilt_etc {
521 name: "crash_dump.policy",
522 sub_dir: "seccomp_policy",
523 filename_from_src: true,
524 arch: {
525 arm: {
526 src: "seccomp_policy/crash_dump.arm.policy",
Elliott Hughes2f883312022-11-14 20:02:28 +0000527 required: [
528 "crash_dump.policy_other",
529 ],
Ray Essickbd3ba782020-01-21 15:21:08 -0800530 },
531 arm64: {
532 src: "seccomp_policy/crash_dump.arm64.policy",
Elliott Hughes2f883312022-11-14 20:02:28 +0000533 required: [
534 "crash_dump.policy_other",
535 ],
Ray Essickbd3ba782020-01-21 15:21:08 -0800536 },
Chen Guoyina22af662022-10-12 22:32:55 +0800537 riscv64: {
538 src: "seccomp_policy/crash_dump.riscv64.policy",
539 },
Ray Essickbd3ba782020-01-21 15:21:08 -0800540 x86: {
541 src: "seccomp_policy/crash_dump.x86.policy",
Elliott Hughes2f883312022-11-14 20:02:28 +0000542 required: [
543 "crash_dump.policy_other",
544 ],
Ray Essickbd3ba782020-01-21 15:21:08 -0800545 },
546 x86_64: {
547 src: "seccomp_policy/crash_dump.x86_64.policy",
Elliott Hughes2f883312022-11-14 20:02:28 +0000548 required: [
549 "crash_dump.policy_other",
550 ],
Ray Essickbd3ba782020-01-21 15:21:08 -0800551 },
552 },
Ray Essickbd3ba782020-01-21 15:21:08 -0800553}
554
555
Elliott Hughes2f883312022-11-14 20:02:28 +0000556// This installs the "other" architecture (so 32-bit on 64-bit device).
Ray Essickbd3ba782020-01-21 15:21:08 -0800557prebuilt_etc {
558 name: "crash_dump.policy_other",
559 sub_dir: "seccomp_policy",
560 filename_from_src: true,
561 arch: {
562 arm: {
563 src: "seccomp_policy/crash_dump.arm64.policy",
564 },
565 arm64: {
566 src: "seccomp_policy/crash_dump.arm.policy",
567 },
Elliott Hughes857e29c2023-03-20 15:48:30 -0700568 riscv64: {
569 enabled: false,
570 },
Ray Essickbd3ba782020-01-21 15:21:08 -0800571 x86: {
572 src: "seccomp_policy/crash_dump.x86_64.policy",
573 },
574 x86_64: {
575 src: "seccomp_policy/crash_dump.x86.policy",
576 },
577 },
578}