blob: 31e284d4cacb37ddaef412c8fe951ac09c6492ee [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: [
35 "com.android.virt",
36 "//apex_available:platform",
37 ],
Narayan Kamatha73df602017-05-24 15:07:25 +010038}
39
Narayan Kamath2d377cd2017-05-10 10:58:59 +010040cc_library_shared {
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080041 name: "libtombstoned_client",
42 defaults: ["debuggerd_defaults"],
43 srcs: [
Narayan Kamath2d377cd2017-05-10 10:58:59 +010044 "tombstoned/tombstoned_client.cpp",
45 "util.cpp",
46 ],
47
Narayan Kamatha73df602017-05-24 15:07:25 +010048 header_libs: ["libdebuggerd_common_headers"],
49
Narayan Kamath2d377cd2017-05-10 10:58:59 +010050 static_libs: [
Narayan Kamatha73df602017-05-24 15:07:25 +010051 "libasync_safe",
Narayan Kamath2d377cd2017-05-10 10:58:59 +010052 ],
53
54 shared_libs: [
Narayan Kamath2d377cd2017-05-10 10:58:59 +010055 "libbase",
Narayan Kamatha73df602017-05-24 15:07:25 +010056 "libcutils",
Narayan Kamath2d377cd2017-05-10 10:58:59 +010057 ],
Shikha Panwar757f2992022-03-25 19:43:14 +000058 apex_available: [
59 "com.android.virt",
60 "//apex_available:platform",
61 ],
Narayan Kamath2d377cd2017-05-10 10:58:59 +010062
Narayan Kamatha73df602017-05-24 15:07:25 +010063 export_header_lib_headers: ["libdebuggerd_common_headers"],
Elliott Hughesdc699a22018-02-16 17:58:14 -080064 export_include_dirs: ["tombstoned/include"],
Narayan Kamath2d377cd2017-05-10 10:58:59 +010065}
66
Josh Gao9da1f512018-08-06 15:38:29 -070067// Utility library to talk to tombstoned and get an output fd.
Narayan Kamath2d377cd2017-05-10 10:58:59 +010068cc_library_static {
69 name: "libtombstoned_client_static",
70 defaults: ["debuggerd_defaults"],
Jiyong Park011ee122018-05-29 16:41:30 +090071 recovery_available: true,
Yifan Hong2ec92cf2020-10-27 16:25:45 -070072 vendor_ramdisk_available: true,
Narayan Kamath2d377cd2017-05-10 10:58:59 +010073 srcs: [
74 "tombstoned/tombstoned_client.cpp",
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080075 "util.cpp",
76 ],
77
Narayan Kamatha73df602017-05-24 15:07:25 +010078 header_libs: ["libdebuggerd_common_headers"],
79
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080080 whole_static_libs: [
Christopher Ferrisac225782017-04-25 11:23:10 -070081 "libasync_safe",
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080082 "libcutils",
83 "libbase",
84 ],
Narayan Kamath2d377cd2017-05-10 10:58:59 +010085
Narayan Kamatha73df602017-05-24 15:07:25 +010086 export_header_lib_headers: ["libdebuggerd_common_headers"],
Elliott Hughesdc699a22018-02-16 17:58:14 -080087 export_include_dirs: ["tombstoned/include"],
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080088}
89
90// Core implementation, linked into libdebuggerd_handler and the dynamic linker.
Josh Gao9c02dc52016-06-15 17:29:00 -070091cc_library_static {
Josh Gaoe73c9322017-02-08 16:06:26 -080092 name: "libdebuggerd_handler_core",
Josh Gaocbe70cb2016-10-18 18:17:52 -070093 defaults: ["debuggerd_defaults"],
Jiyong Parka0e75042018-05-24 14:11:00 +090094 recovery_available: true,
Yifan Hong2ec92cf2020-10-27 16:25:45 -070095 vendor_ramdisk_available: true,
Josh Gaocbe70cb2016-10-18 18:17:52 -070096 srcs: ["handler/debuggerd_handler.cpp"],
Josh Gao9c02dc52016-06-15 17:29:00 -070097
Josh Gaofdf832d2017-08-25 18:00:18 -070098 header_libs: [
99 "libbase_headers",
100 "libdebuggerd_common_headers",
Josh Gaoa48b41b2019-12-13 14:11:04 -0800101 "bionic_libc_platform_headers",
Mitch Phillips18ce5422023-01-19 14:23:49 -0800102 "gwp_asan_headers",
Josh Gaofdf832d2017-08-25 18:00:18 -0700103 ],
Narayan Kamatha73df602017-05-24 15:07:25 +0100104
Josh Gaoe73c9322017-02-08 16:06:26 -0800105 whole_static_libs: [
Christopher Ferrisac225782017-04-25 11:23:10 -0700106 "libasync_safe",
Josh Gao2b2ae0c2017-08-21 14:31:17 -0700107 "libcutils",
Josh Gaoe73c9322017-02-08 16:06:26 -0800108 "libdebuggerd",
109 ],
110
Narayan Kamatha73df602017-05-24 15:07:25 +0100111 export_header_lib_headers: ["libdebuggerd_common_headers"],
Josh Gaoe73c9322017-02-08 16:06:26 -0800112 export_include_dirs: ["include"],
113}
114
Josh Gaoe1aa0ca2017-03-01 17:23:22 -0800115// Implementation with a no-op fallback.
Josh Gaoe73c9322017-02-08 16:06:26 -0800116cc_library_static {
117 name: "libdebuggerd_handler",
118 defaults: ["debuggerd_defaults"],
119 srcs: ["handler/debuggerd_fallback_nop.cpp"],
120
Josh Gaoa48b41b2019-12-13 14:11:04 -0800121 header_libs: ["bionic_libc_platform_headers"],
122 export_header_lib_headers: ["bionic_libc_platform_headers"],
123
Josh Gaoe73c9322017-02-08 16:06:26 -0800124 whole_static_libs: [
125 "libdebuggerd_handler_core",
126 ],
127
128 export_include_dirs: ["include"],
129}
130
Martin Stjernholma2cc8932019-10-23 21:32:43 +0100131// Fallback implementation, for use in the Bionic linker only.
Josh Gaoe73c9322017-02-08 16:06:26 -0800132cc_library_static {
133 name: "libdebuggerd_handler_fallback",
Martin Stjernholma2cc8932019-10-23 21:32:43 +0100134 visibility: ["//bionic/linker"],
135 apex_available: [
136 "com.android.runtime",
137 "//apex_available:platform",
138 ],
Josh Gaoe73c9322017-02-08 16:06:26 -0800139 defaults: ["debuggerd_defaults"],
Jiyong Park011ee122018-05-29 16:41:30 +0900140 recovery_available: true,
Yifan Hong2ec92cf2020-10-27 16:25:45 -0700141 vendor_ramdisk_available: true,
Josh Gaoe1aa0ca2017-03-01 17:23:22 -0800142 srcs: [
143 "handler/debuggerd_fallback.cpp",
144 ],
Josh Gaoe73c9322017-02-08 16:06:26 -0800145
Josh Gaoe1aa0ca2017-03-01 17:23:22 -0800146 whole_static_libs: [
147 "libdebuggerd_handler_core",
Narayan Kamath2d377cd2017-05-10 10:58:59 +0100148 "libtombstoned_client_static",
Christopher Ferrisac225782017-04-25 11:23:10 -0700149 "libasync_safe",
Josh Gaoe1aa0ca2017-03-01 17:23:22 -0800150 "libbase",
Josh Gaoe73c9322017-02-08 16:06:26 -0800151 "libdebuggerd",
Martin Stjernholma2cc8932019-10-23 21:32:43 +0100152 "libunwindstack_no_dex",
Josh Gaoe73c9322017-02-08 16:06:26 -0800153 "liblzma",
154 "libcutils",
155 ],
Josh Gaoa48b41b2019-12-13 14:11:04 -0800156
157 header_libs: ["bionic_libc_platform_headers"],
158 export_header_lib_headers: ["bionic_libc_platform_headers"],
159
Josh Gaocbe70cb2016-10-18 18:17:52 -0700160 export_include_dirs: ["include"],
161}
162
163cc_library {
164 name: "libdebuggerd_client",
165 defaults: ["debuggerd_defaults"],
166 srcs: [
167 "client/debuggerd_client.cpp",
168 "util.cpp",
169 ],
170
171 shared_libs: [
172 "libbase",
173 "libcutils",
Josh Gao4175cee2019-01-04 13:57:09 -0800174 "libprocinfo",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700175 ],
Josh Gaoe1aa0ca2017-03-01 17:23:22 -0800176
Josh Gaoa48b41b2019-12-13 14:11:04 -0800177 header_libs: [
178 "libdebuggerd_common_headers",
179 "bionic_libc_platform_headers",
180 ],
181 export_header_lib_headers: [
182 "libdebuggerd_common_headers",
183 "bionic_libc_platform_headers",
184 ],
185
Josh Gaocbe70cb2016-10-18 18:17:52 -0700186 export_include_dirs: ["include"],
187}
188
Siim Sammulc08a34e2023-11-17 17:06:15 +0000189cc_library {
190 name: "libdebuggerd_tombstone_proto_to_text",
191 defaults: ["debuggerd_defaults"],
192 ramdisk_available: true,
193 recovery_available: true,
194 vendor_ramdisk_available: true,
195
196 local_include_dirs: ["libdebuggerd/include"],
197 export_include_dirs: ["libdebuggerd/include"],
198
199 srcs: [
200 "libdebuggerd/tombstone_proto_to_text.cpp",
201 ],
202
203 header_libs: [
204 "bionic_libc_platform_headers",
205 ],
206
207 static_libs: [
208 "libbase",
209 "liblog_for_runtime_apex",
210 "libunwindstack",
211 ],
212
213 whole_static_libs: [
214 "libtombstone_proto",
215 "libprotobuf-cpp-lite",
216 ],
217
218 apex_available: [
219 "//apex_available:platform",
220 "com.android.runtime",
221 ],
222}
223
Josh Gaoe73c9322017-02-08 16:06:26 -0800224cc_library_static {
Josh Gaocbe70cb2016-10-18 18:17:52 -0700225 name: "libdebuggerd",
226 defaults: ["debuggerd_defaults"],
Christopher Ferris48d6e042023-07-31 14:24:01 -0700227 ramdisk_available: true,
Jiyong Parka0e75042018-05-24 14:11:00 +0900228 recovery_available: true,
Yifan Hong2ec92cf2020-10-27 16:25:45 -0700229 vendor_ramdisk_available: true,
Josh Gaocbe70cb2016-10-18 18:17:52 -0700230
231 srcs: [
232 "libdebuggerd/backtrace.cpp",
Mitch Phillipse0b4bb12020-02-14 14:54:31 -0800233 "libdebuggerd/gwp_asan.cpp",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700234 "libdebuggerd/open_files_list.cpp",
235 "libdebuggerd/tombstone.cpp",
Josh Gao76e1e302021-01-26 15:53:11 -0800236 "libdebuggerd/tombstone_proto.cpp",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700237 "libdebuggerd/utility.cpp",
238 ],
239
Josh Gaocbe70cb2016-10-18 18:17:52 -0700240 local_include_dirs: ["libdebuggerd/include"],
241 export_include_dirs: ["libdebuggerd/include"],
Josh Gao9c02dc52016-06-15 17:29:00 -0700242
Peter Collingbournef8622522020-04-07 14:07:32 -0700243 include_dirs: [
244 // Needed for private/bionic_fdsan.h
245 "bionic/libc",
Peter Collingbournef8622522020-04-07 14:07:32 -0700246 ],
Mitch Phillipse0b4bb12020-02-14 14:54:31 -0800247 header_libs: [
248 "bionic_libc_platform_headers",
249 "gwp_asan_headers",
Jiyong Parkeb769d62022-08-19 13:21:02 +0900250 "liblog_headers",
Mitch Phillipse0b4bb12020-02-14 14:54:31 -0800251 ],
Josh Gaoce841d92018-08-06 18:26:42 -0700252
Josh Gaoe73c9322017-02-08 16:06:26 -0800253 static_libs: [
Martin Stjernholma2cc8932019-10-23 21:32:43 +0100254 "libdexfile_support", // libunwindstack dependency
Christopher Ferris9a8c8552017-08-11 15:29:19 -0700255 "libunwindstack",
Josh Gaoe73c9322017-02-08 16:06:26 -0800256 "liblzma",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700257 "libbase",
258 "libcutils",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700259 ],
Josh Gaoa48b41b2019-12-13 14:11:04 -0800260
Peter Collingbournef8622522020-04-07 14:07:32 -0700261 whole_static_libs: [
Siim Sammulc08a34e2023-11-17 17:06:15 +0000262 "libdebuggerd_tombstone_proto_to_text",
Josh Gao618cea32021-01-26 17:45:43 -0800263 "libasync_safe",
Peter Collingbournef8622522020-04-07 14:07:32 -0700264 "gwp_asan_crash_handler",
Josh Gao76e1e302021-01-26 15:53:11 -0800265 "libtombstone_proto",
Josh Gaodbb83de2021-03-01 23:13:13 -0800266 "libprocinfo",
Josh Gao76e1e302021-01-26 15:53:11 -0800267 "libprotobuf-cpp-lite",
Peter Collingbournef8622522020-04-07 14:07:32 -0700268 ],
Mitch Phillipse0b4bb12020-02-14 14:54:31 -0800269
Martin Stjernholmbb4f2b42018-12-19 14:28:33 +0000270 target: {
271 recovery: {
272 exclude_static_libs: [
Martin Stjernholma2cc8932019-10-23 21:32:43 +0100273 "libdexfile_support",
Martin Stjernholmbb4f2b42018-12-19 14:28:33 +0000274 ],
Martin Stjernholm3784b9d2021-08-26 21:18:43 +0100275 exclude_runtime_libs: [
276 "libdexfile",
277 ],
Martin Stjernholmbb4f2b42018-12-19 14:28:33 +0000278 },
Yifan Hong2ec92cf2020-10-27 16:25:45 -0700279 vendor_ramdisk: {
280 exclude_static_libs: [
281 "libdexfile_support",
282 ],
Martin Stjernholm3784b9d2021-08-26 21:18:43 +0100283 exclude_runtime_libs: [
284 "libdexfile",
285 ],
Yifan Hong2ec92cf2020-10-27 16:25:45 -0700286 },
Christopher Ferris48d6e042023-07-31 14:24:01 -0700287 ramdisk: {
288 exclude_static_libs: [
289 "libdexfile_support",
290 ],
291 exclude_runtime_libs: [
292 "libdexfile",
293 ],
294 },
295 android: {
296 runtime_libs: [
297 "libdexfile", // libdexfile_support dependency
298 ],
299 },
Martin Stjernholmbb4f2b42018-12-19 14:28:33 +0000300 },
Christopher Ferris4ae266c2019-04-03 09:27:12 -0700301
302 product_variables: {
303 debuggable: {
304 cflags: ["-DROOT_POSSIBLE"],
305 },
Christopher Ferris7aad2562021-09-24 00:06:38 -0700306
307 malloc_not_svelte: {
308 cflags: ["-DUSE_SCUDO"],
309 whole_static_libs: ["libscudo"],
310 srcs: ["libdebuggerd/scudo.cpp"],
311 header_libs: ["scudo_headers"],
312 },
Christopher Ferris4ae266c2019-04-03 09:27:12 -0700313 },
Josh Gaocbe70cb2016-10-18 18:17:52 -0700314}
315
Josh Gao76e1e302021-01-26 15:53:11 -0800316cc_binary {
317 name: "pbtombstone",
318 defaults: ["debuggerd_defaults"],
319 srcs: ["pbtombstone.cpp"],
320 static_libs: [
321 "libbase",
322 "libdebuggerd",
323 "liblog",
324 "libprotobuf-cpp-lite",
325 "libtombstone_proto",
326 "libunwindstack",
327 ],
328}
329
Christopher Ferrisfe751c52021-04-16 09:40:40 -0700330cc_test_library {
331 name: "libcrash_test",
332 defaults: ["debuggerd_defaults"],
333 srcs: ["crash_test.cpp"],
334}
335
Josh Gaocbe70cb2016-10-18 18:17:52 -0700336cc_test {
337 name: "debuggerd_test",
338 defaults: ["debuggerd_defaults"],
Josh Gao6cad1392019-08-27 16:02:38 -0700339 require_root: true,
Josh Gaocbe70cb2016-10-18 18:17:52 -0700340
341 cflags: ["-Wno-missing-field-initializers"],
342 srcs: [
343 "libdebuggerd/test/dump_memory_test.cpp",
344 "libdebuggerd/test/elf_fake.cpp",
345 "libdebuggerd/test/log_fake.cpp",
346 "libdebuggerd/test/open_files_list_test.cpp",
Siim Sammulc08a34e2023-11-17 17:06:15 +0000347 "libdebuggerd/test/tombstone_proto_to_text_test.cpp",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700348 ],
349
350 target: {
351 android: {
352 srcs: [
Josh Gaoae9d7672017-03-24 16:26:03 -0700353 "client/debuggerd_client_test.cpp",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700354 "debuggerd_test.cpp",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700355 ],
Elliott Hughesdc699a22018-02-16 17:58:14 -0800356 static_libs: [
357 "libasync_safe",
358 "libtombstoned_client_static",
359 ],
Josh Gaocbe70cb2016-10-18 18:17:52 -0700360 },
361 },
362
363 shared_libs: [
Josh Gaocbe70cb2016-10-18 18:17:52 -0700364 "libbase",
365 "libcutils",
Josh Gaoae9d7672017-03-24 16:26:03 -0700366 "libdebuggerd_client",
Narayan Kamatha73df602017-05-24 15:07:25 +0100367 "liblog",
Elliott Hughesdc699a22018-02-16 17:58:14 -0800368 "libnativehelper",
Martin Stjernholm852b64e2019-02-20 17:01:24 +0000369 "libunwindstack",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700370 ],
371
372 static_libs: [
Josh Gao352a8452017-03-30 16:46:21 -0700373 "libdebuggerd",
Mitch Phillipse0b4bb12020-02-14 14:54:31 -0800374 "libgmock",
Peter Collingbourned00a5772020-07-20 23:11:16 -0700375 "libminijail",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700376 ],
377
Josh Gaoa48b41b2019-12-13 14:11:04 -0800378 header_libs: [
379 "bionic_libc_platform_headers",
Mitch Phillipse0b4bb12020-02-14 14:54:31 -0800380 "gwp_asan_headers",
Josh Gaoa48b41b2019-12-13 14:11:04 -0800381 ],
382
Josh Gaocbe70cb2016-10-18 18:17:52 -0700383 local_include_dirs: [
384 "libdebuggerd",
385 ],
386
387 compile_multilib: "both",
388 multilib: {
389 lib32: {
390 stem: "debuggerd_test32",
391 },
392 lib64: {
393 stem: "debuggerd_test64",
394 },
395 },
Elliott Hughes40fdf3f2018-04-27 16:12:06 -0700396
Christopher Ferrisfe751c52021-04-16 09:40:40 -0700397 data: [
398 ":libcrash_test",
399 ],
400
Elliott Hughes40fdf3f2018-04-27 16:12:06 -0700401 test_suites: ["device-tests"],
Josh Gaocbe70cb2016-10-18 18:17:52 -0700402}
403
Josh Gaoa42314e2017-12-19 15:08:19 -0800404cc_benchmark {
405 name: "debuggerd_benchmark",
406 defaults: ["debuggerd_defaults"],
407 srcs: ["debuggerd_benchmark.cpp"],
408 shared_libs: [
409 "libbase",
410 "libdebuggerd_client",
411 ],
412}
413
Josh Gaocbe70cb2016-10-18 18:17:52 -0700414cc_binary {
415 name: "crash_dump",
416 srcs: [
417 "crash_dump.cpp",
Shikha Panwarabde59e2023-02-03 15:05:18 +0000418 "tombstone_handler.cpp",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700419 "util.cpp",
420 ],
421 defaults: ["debuggerd_defaults"],
422
423 compile_multilib: "both",
424 multilib: {
425 lib32: {
426 suffix: "32",
427 },
428 lib64: {
429 suffix: "64",
430 },
431 },
432
Josh Gaoa48b41b2019-12-13 14:11:04 -0800433 header_libs: [
434 "bionic_libc_platform_headers",
435 ],
436
Josh Gaoe73c9322017-02-08 16:06:26 -0800437 static_libs: [
Narayan Kamath2d377cd2017-05-10 10:58:59 +0100438 "libtombstoned_client_static",
Josh Gaoe73c9322017-02-08 16:06:26 -0800439 "libdebuggerd",
440 "libcutils",
Josh Gao76e1e302021-01-26 15:53:11 -0800441
442 "libtombstone_proto",
443 "libprotobuf-cpp-lite",
Josh Gaoe73c9322017-02-08 16:06:26 -0800444 ],
445
Josh Gaocbe70cb2016-10-18 18:17:52 -0700446 shared_libs: [
Josh Gaocbe70cb2016-10-18 18:17:52 -0700447 "libbase",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700448 "liblog",
449 "libprocinfo",
Josh Gao2b2ae0c2017-08-21 14:31:17 -0700450 "libunwindstack",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700451 ],
Peter Collingbourneb72e7482020-03-16 18:14:13 -0700452
453 apex_available: [
454 "com.android.runtime",
455 ],
Peter Collingbournea2739da2022-02-02 17:00:42 -0800456
457 // Required for tests.
458 required: ["crash_dump.policy"],
Josh Gaocbe70cb2016-10-18 18:17:52 -0700459}
460
461cc_binary {
462 name: "debuggerd",
463 srcs: [
464 "debuggerd.cpp",
465 ],
466 defaults: ["debuggerd_defaults"],
467
468 shared_libs: [
469 "libbase",
470 "libdebuggerd_client",
471 "liblog",
Josh Gao0915f232017-06-27 14:08:05 -0700472 "libprocinfo",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700473 ],
474
475 local_include_dirs: ["include"],
476}
477
Nikita Ioffe75be7842022-10-24 15:31:11 +0100478cc_defaults {
479 name: "tombstoned_defaults",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700480 srcs: [
481 "util.cpp",
482 "tombstoned/intercept_manager.cpp",
483 "tombstoned/tombstoned.cpp",
484 ],
485 defaults: ["debuggerd_defaults"],
486
Josh Gaoa48b41b2019-12-13 14:11:04 -0800487 header_libs: [
488 "bionic_libc_platform_headers",
489 "libdebuggerd_common_headers"
490 ],
Narayan Kamatha73df602017-05-24 15:07:25 +0100491
Josh Gaocbe70cb2016-10-18 18:17:52 -0700492 static_libs: [
493 "libbase",
494 "libcutils",
495 "libevent",
496 "liblog",
497 ],
Nikita Ioffe75be7842022-10-24 15:31:11 +0100498}
Josh Gaocbe70cb2016-10-18 18:17:52 -0700499
Nikita Ioffe75be7842022-10-24 15:31:11 +0100500cc_binary {
501 name: "tombstoned",
502 defaults: ["tombstoned_defaults"],
Elliott Hughesdc699a22018-02-16 17:58:14 -0800503 init_rc: ["tombstoned/tombstoned.rc"],
Josh Gao9c02dc52016-06-15 17:29:00 -0700504}
Ray Essickbd3ba782020-01-21 15:21:08 -0800505
Nikita Ioffe75be7842022-10-24 15:31:11 +0100506cc_binary {
507 name: "tombstoned.microdroid",
508 defaults: ["tombstoned_defaults"],
509 init_rc: ["tombstoned/tombstoned.microdroid.rc"],
510}
511
Ray Essickbd3ba782020-01-21 15:21:08 -0800512prebuilt_etc {
513 name: "crash_dump.policy",
514 sub_dir: "seccomp_policy",
515 filename_from_src: true,
516 arch: {
517 arm: {
518 src: "seccomp_policy/crash_dump.arm.policy",
Elliott Hughes2f883312022-11-14 20:02:28 +0000519 required: [
520 "crash_dump.policy_other",
521 ],
Ray Essickbd3ba782020-01-21 15:21:08 -0800522 },
523 arm64: {
524 src: "seccomp_policy/crash_dump.arm64.policy",
Elliott Hughes2f883312022-11-14 20:02:28 +0000525 required: [
526 "crash_dump.policy_other",
527 ],
Ray Essickbd3ba782020-01-21 15:21:08 -0800528 },
Chen Guoyina22af662022-10-12 22:32:55 +0800529 riscv64: {
530 src: "seccomp_policy/crash_dump.riscv64.policy",
531 },
Ray Essickbd3ba782020-01-21 15:21:08 -0800532 x86: {
533 src: "seccomp_policy/crash_dump.x86.policy",
Elliott Hughes2f883312022-11-14 20:02:28 +0000534 required: [
535 "crash_dump.policy_other",
536 ],
Ray Essickbd3ba782020-01-21 15:21:08 -0800537 },
538 x86_64: {
539 src: "seccomp_policy/crash_dump.x86_64.policy",
Elliott Hughes2f883312022-11-14 20:02:28 +0000540 required: [
541 "crash_dump.policy_other",
542 ],
Ray Essickbd3ba782020-01-21 15:21:08 -0800543 },
544 },
Ray Essickbd3ba782020-01-21 15:21:08 -0800545}
546
547
Elliott Hughes2f883312022-11-14 20:02:28 +0000548// This installs the "other" architecture (so 32-bit on 64-bit device).
Ray Essickbd3ba782020-01-21 15:21:08 -0800549prebuilt_etc {
550 name: "crash_dump.policy_other",
551 sub_dir: "seccomp_policy",
552 filename_from_src: true,
553 arch: {
554 arm: {
555 src: "seccomp_policy/crash_dump.arm64.policy",
556 },
557 arm64: {
558 src: "seccomp_policy/crash_dump.arm.policy",
559 },
Elliott Hughes857e29c2023-03-20 15:48:30 -0700560 riscv64: {
561 enabled: false,
562 },
Ray Essickbd3ba782020-01-21 15:21:08 -0800563 x86: {
564 src: "seccomp_policy/crash_dump.x86_64.policy",
565 },
566 x86_64: {
567 src: "seccomp_policy/crash_dump.x86.policy",
568 },
569 },
570}