Bob Badour | d69ad69 | 2021-02-16 19:02:14 -0800 | [diff] [blame] | 1 | package { |
Elliott Hughes | 813fd6d | 2021-06-25 14:42:51 -0700 | [diff] [blame] | 2 | default_applicable_licenses: ["Android-Apache-2.0"], |
Bob Badour | d69ad69 | 2021-02-16 19:02:14 -0800 | [diff] [blame] | 3 | } |
| 4 | |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 5 | cc_defaults { |
| 6 | name: "debuggerd_defaults", |
| 7 | cflags: [ |
| 8 | "-Wall", |
| 9 | "-Wextra", |
Josh Gao | c7fe060 | 2017-03-13 14:13:29 -0700 | [diff] [blame] | 10 | "-Werror", |
Kalesh Singh | a9ea7e5 | 2021-06-17 15:49:50 -0400 | [diff] [blame] | 11 | "-Wno-gcc-compat", |
Josh Gao | 2b2ae0c | 2017-08-21 14:31:17 -0700 | [diff] [blame] | 12 | "-Wno-unused-argument", |
| 13 | "-Wno-unused-function", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 14 | "-Wno-nullability-completeness", |
| 15 | "-Os", |
Yabin Cui | e90a944 | 2021-08-11 13:21:11 -0700 | [diff] [blame] | 16 | "-fno-finite-loops", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 17 | ], |
| 18 | |
| 19 | local_include_dirs: ["include"], |
| 20 | } |
| 21 | |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 22 | cc_library_headers { |
| 23 | name: "libdebuggerd_common_headers", |
Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 24 | export_include_dirs: ["common/include"], |
Jiyong Park | a0e7504 | 2018-05-24 14:11:00 +0900 | [diff] [blame] | 25 | recovery_available: true, |
Yifan Hong | 2ec92cf | 2020-10-27 16:25:45 -0700 | [diff] [blame] | 26 | vendor_ramdisk_available: true, |
Shikha Panwar | 757f299 | 2022-03-25 19:43:14 +0000 | [diff] [blame] | 27 | apex_available: [ |
| 28 | "com.android.virt", |
| 29 | "//apex_available:platform", |
| 30 | ], |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 31 | } |
| 32 | |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 33 | cc_library_shared { |
Josh Gao | e1aa0ca | 2017-03-01 17:23:22 -0800 | [diff] [blame] | 34 | name: "libtombstoned_client", |
| 35 | defaults: ["debuggerd_defaults"], |
| 36 | srcs: [ |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 37 | "tombstoned/tombstoned_client.cpp", |
| 38 | "util.cpp", |
| 39 | ], |
| 40 | |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 41 | header_libs: ["libdebuggerd_common_headers"], |
| 42 | |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 43 | static_libs: [ |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 44 | "libasync_safe", |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 45 | ], |
| 46 | |
| 47 | shared_libs: [ |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 48 | "libbase", |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 49 | "libcutils", |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 50 | ], |
Shikha Panwar | 757f299 | 2022-03-25 19:43:14 +0000 | [diff] [blame] | 51 | apex_available: [ |
| 52 | "com.android.virt", |
| 53 | "//apex_available:platform", |
| 54 | ], |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 55 | |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 56 | export_header_lib_headers: ["libdebuggerd_common_headers"], |
Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 57 | export_include_dirs: ["tombstoned/include"], |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 58 | } |
| 59 | |
Josh Gao | 9da1f51 | 2018-08-06 15:38:29 -0700 | [diff] [blame] | 60 | // Utility library to talk to tombstoned and get an output fd. |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 61 | cc_library_static { |
| 62 | name: "libtombstoned_client_static", |
| 63 | defaults: ["debuggerd_defaults"], |
Jiyong Park | 011ee12 | 2018-05-29 16:41:30 +0900 | [diff] [blame] | 64 | recovery_available: true, |
Yifan Hong | 2ec92cf | 2020-10-27 16:25:45 -0700 | [diff] [blame] | 65 | vendor_ramdisk_available: true, |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 66 | srcs: [ |
| 67 | "tombstoned/tombstoned_client.cpp", |
Josh Gao | e1aa0ca | 2017-03-01 17:23:22 -0800 | [diff] [blame] | 68 | "util.cpp", |
| 69 | ], |
| 70 | |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 71 | header_libs: ["libdebuggerd_common_headers"], |
| 72 | |
Josh Gao | e1aa0ca | 2017-03-01 17:23:22 -0800 | [diff] [blame] | 73 | whole_static_libs: [ |
Christopher Ferris | ac22578 | 2017-04-25 11:23:10 -0700 | [diff] [blame] | 74 | "libasync_safe", |
Josh Gao | e1aa0ca | 2017-03-01 17:23:22 -0800 | [diff] [blame] | 75 | "libcutils", |
| 76 | "libbase", |
| 77 | ], |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 78 | |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 79 | export_header_lib_headers: ["libdebuggerd_common_headers"], |
Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 80 | export_include_dirs: ["tombstoned/include"], |
Josh Gao | e1aa0ca | 2017-03-01 17:23:22 -0800 | [diff] [blame] | 81 | } |
| 82 | |
| 83 | // Core implementation, linked into libdebuggerd_handler and the dynamic linker. |
Josh Gao | 9c02dc5 | 2016-06-15 17:29:00 -0700 | [diff] [blame] | 84 | cc_library_static { |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 85 | name: "libdebuggerd_handler_core", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 86 | defaults: ["debuggerd_defaults"], |
Jiyong Park | a0e7504 | 2018-05-24 14:11:00 +0900 | [diff] [blame] | 87 | recovery_available: true, |
Yifan Hong | 2ec92cf | 2020-10-27 16:25:45 -0700 | [diff] [blame] | 88 | vendor_ramdisk_available: true, |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 89 | srcs: ["handler/debuggerd_handler.cpp"], |
Josh Gao | 9c02dc5 | 2016-06-15 17:29:00 -0700 | [diff] [blame] | 90 | |
Josh Gao | fdf832d | 2017-08-25 18:00:18 -0700 | [diff] [blame] | 91 | header_libs: [ |
| 92 | "libbase_headers", |
| 93 | "libdebuggerd_common_headers", |
Josh Gao | a48b41b | 2019-12-13 14:11:04 -0800 | [diff] [blame] | 94 | "bionic_libc_platform_headers", |
Josh Gao | fdf832d | 2017-08-25 18:00:18 -0700 | [diff] [blame] | 95 | ], |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 96 | |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 97 | whole_static_libs: [ |
Christopher Ferris | ac22578 | 2017-04-25 11:23:10 -0700 | [diff] [blame] | 98 | "libasync_safe", |
Josh Gao | 2b2ae0c | 2017-08-21 14:31:17 -0700 | [diff] [blame] | 99 | "libcutils", |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 100 | "libdebuggerd", |
| 101 | ], |
| 102 | |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 103 | export_header_lib_headers: ["libdebuggerd_common_headers"], |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 104 | export_include_dirs: ["include"], |
| 105 | } |
| 106 | |
Josh Gao | e1aa0ca | 2017-03-01 17:23:22 -0800 | [diff] [blame] | 107 | // Implementation with a no-op fallback. |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 108 | cc_library_static { |
| 109 | name: "libdebuggerd_handler", |
| 110 | defaults: ["debuggerd_defaults"], |
| 111 | srcs: ["handler/debuggerd_fallback_nop.cpp"], |
| 112 | |
Josh Gao | a48b41b | 2019-12-13 14:11:04 -0800 | [diff] [blame] | 113 | header_libs: ["bionic_libc_platform_headers"], |
| 114 | export_header_lib_headers: ["bionic_libc_platform_headers"], |
| 115 | |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 116 | whole_static_libs: [ |
| 117 | "libdebuggerd_handler_core", |
| 118 | ], |
| 119 | |
| 120 | export_include_dirs: ["include"], |
| 121 | } |
| 122 | |
Martin Stjernholm | a2cc893 | 2019-10-23 21:32:43 +0100 | [diff] [blame] | 123 | // Fallback implementation, for use in the Bionic linker only. |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 124 | cc_library_static { |
| 125 | name: "libdebuggerd_handler_fallback", |
Martin Stjernholm | a2cc893 | 2019-10-23 21:32:43 +0100 | [diff] [blame] | 126 | visibility: ["//bionic/linker"], |
| 127 | apex_available: [ |
| 128 | "com.android.runtime", |
| 129 | "//apex_available:platform", |
| 130 | ], |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 131 | defaults: ["debuggerd_defaults"], |
Jiyong Park | 011ee12 | 2018-05-29 16:41:30 +0900 | [diff] [blame] | 132 | recovery_available: true, |
Yifan Hong | 2ec92cf | 2020-10-27 16:25:45 -0700 | [diff] [blame] | 133 | vendor_ramdisk_available: true, |
Josh Gao | e1aa0ca | 2017-03-01 17:23:22 -0800 | [diff] [blame] | 134 | srcs: [ |
| 135 | "handler/debuggerd_fallback.cpp", |
| 136 | ], |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 137 | |
Josh Gao | e1aa0ca | 2017-03-01 17:23:22 -0800 | [diff] [blame] | 138 | whole_static_libs: [ |
| 139 | "libdebuggerd_handler_core", |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 140 | "libtombstoned_client_static", |
Christopher Ferris | ac22578 | 2017-04-25 11:23:10 -0700 | [diff] [blame] | 141 | "libasync_safe", |
Josh Gao | e1aa0ca | 2017-03-01 17:23:22 -0800 | [diff] [blame] | 142 | "libbase", |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 143 | "libdebuggerd", |
Martin Stjernholm | a2cc893 | 2019-10-23 21:32:43 +0100 | [diff] [blame] | 144 | "libunwindstack_no_dex", |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 145 | "liblzma", |
| 146 | "libcutils", |
| 147 | ], |
Josh Gao | a48b41b | 2019-12-13 14:11:04 -0800 | [diff] [blame] | 148 | |
| 149 | header_libs: ["bionic_libc_platform_headers"], |
| 150 | export_header_lib_headers: ["bionic_libc_platform_headers"], |
| 151 | |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 152 | export_include_dirs: ["include"], |
| 153 | } |
| 154 | |
| 155 | cc_library { |
| 156 | name: "libdebuggerd_client", |
| 157 | defaults: ["debuggerd_defaults"], |
| 158 | srcs: [ |
| 159 | "client/debuggerd_client.cpp", |
| 160 | "util.cpp", |
| 161 | ], |
| 162 | |
| 163 | shared_libs: [ |
| 164 | "libbase", |
| 165 | "libcutils", |
Josh Gao | 4175cee | 2019-01-04 13:57:09 -0800 | [diff] [blame] | 166 | "libprocinfo", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 167 | ], |
Josh Gao | e1aa0ca | 2017-03-01 17:23:22 -0800 | [diff] [blame] | 168 | |
Josh Gao | a48b41b | 2019-12-13 14:11:04 -0800 | [diff] [blame] | 169 | header_libs: [ |
| 170 | "libdebuggerd_common_headers", |
| 171 | "bionic_libc_platform_headers", |
| 172 | ], |
| 173 | export_header_lib_headers: [ |
| 174 | "libdebuggerd_common_headers", |
| 175 | "bionic_libc_platform_headers", |
| 176 | ], |
| 177 | |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 178 | export_include_dirs: ["include"], |
| 179 | } |
| 180 | |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 181 | cc_library_static { |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 182 | name: "libdebuggerd", |
| 183 | defaults: ["debuggerd_defaults"], |
Jiyong Park | a0e7504 | 2018-05-24 14:11:00 +0900 | [diff] [blame] | 184 | recovery_available: true, |
Yifan Hong | 2ec92cf | 2020-10-27 16:25:45 -0700 | [diff] [blame] | 185 | vendor_ramdisk_available: true, |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 186 | |
| 187 | srcs: [ |
| 188 | "libdebuggerd/backtrace.cpp", |
Mitch Phillips | e0b4bb1 | 2020-02-14 14:54:31 -0800 | [diff] [blame] | 189 | "libdebuggerd/gwp_asan.cpp", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 190 | "libdebuggerd/open_files_list.cpp", |
| 191 | "libdebuggerd/tombstone.cpp", |
Josh Gao | 76e1e30 | 2021-01-26 15:53:11 -0800 | [diff] [blame] | 192 | "libdebuggerd/tombstone_proto.cpp", |
| 193 | "libdebuggerd/tombstone_proto_to_text.cpp", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 194 | "libdebuggerd/utility.cpp", |
| 195 | ], |
| 196 | |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 197 | local_include_dirs: ["libdebuggerd/include"], |
| 198 | export_include_dirs: ["libdebuggerd/include"], |
Josh Gao | 9c02dc5 | 2016-06-15 17:29:00 -0700 | [diff] [blame] | 199 | |
Peter Collingbourne | f862252 | 2020-04-07 14:07:32 -0700 | [diff] [blame] | 200 | include_dirs: [ |
| 201 | // Needed for private/bionic_fdsan.h |
| 202 | "bionic/libc", |
Peter Collingbourne | f862252 | 2020-04-07 14:07:32 -0700 | [diff] [blame] | 203 | ], |
Mitch Phillips | e0b4bb1 | 2020-02-14 14:54:31 -0800 | [diff] [blame] | 204 | header_libs: [ |
| 205 | "bionic_libc_platform_headers", |
| 206 | "gwp_asan_headers", |
| 207 | ], |
Josh Gao | ce841d9 | 2018-08-06 18:26:42 -0700 | [diff] [blame] | 208 | |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 209 | static_libs: [ |
Martin Stjernholm | a2cc893 | 2019-10-23 21:32:43 +0100 | [diff] [blame] | 210 | "libdexfile_support", // libunwindstack dependency |
Christopher Ferris | 9a8c855 | 2017-08-11 15:29:19 -0700 | [diff] [blame] | 211 | "libunwindstack", |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 212 | "liblzma", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 213 | "libbase", |
| 214 | "libcutils", |
| 215 | "liblog", |
| 216 | ], |
Martin Stjernholm | 3784b9d | 2021-08-26 21:18:43 +0100 | [diff] [blame] | 217 | runtime_libs: [ |
| 218 | "libdexfile", // libdexfile_support dependency |
| 219 | ], |
Josh Gao | a48b41b | 2019-12-13 14:11:04 -0800 | [diff] [blame] | 220 | |
Peter Collingbourne | f862252 | 2020-04-07 14:07:32 -0700 | [diff] [blame] | 221 | whole_static_libs: [ |
Josh Gao | 618cea3 | 2021-01-26 17:45:43 -0800 | [diff] [blame] | 222 | "libasync_safe", |
Peter Collingbourne | f862252 | 2020-04-07 14:07:32 -0700 | [diff] [blame] | 223 | "gwp_asan_crash_handler", |
Josh Gao | 76e1e30 | 2021-01-26 15:53:11 -0800 | [diff] [blame] | 224 | "libtombstone_proto", |
Josh Gao | dbb83de | 2021-03-01 23:13:13 -0800 | [diff] [blame] | 225 | "libprocinfo", |
Josh Gao | 76e1e30 | 2021-01-26 15:53:11 -0800 | [diff] [blame] | 226 | "libprotobuf-cpp-lite", |
Peter Collingbourne | f862252 | 2020-04-07 14:07:32 -0700 | [diff] [blame] | 227 | ], |
Mitch Phillips | e0b4bb1 | 2020-02-14 14:54:31 -0800 | [diff] [blame] | 228 | |
Martin Stjernholm | bb4f2b4 | 2018-12-19 14:28:33 +0000 | [diff] [blame] | 229 | target: { |
| 230 | recovery: { |
| 231 | exclude_static_libs: [ |
Martin Stjernholm | a2cc893 | 2019-10-23 21:32:43 +0100 | [diff] [blame] | 232 | "libdexfile_support", |
Martin Stjernholm | bb4f2b4 | 2018-12-19 14:28:33 +0000 | [diff] [blame] | 233 | ], |
Martin Stjernholm | 3784b9d | 2021-08-26 21:18:43 +0100 | [diff] [blame] | 234 | exclude_runtime_libs: [ |
| 235 | "libdexfile", |
| 236 | ], |
Martin Stjernholm | bb4f2b4 | 2018-12-19 14:28:33 +0000 | [diff] [blame] | 237 | }, |
Yifan Hong | 2ec92cf | 2020-10-27 16:25:45 -0700 | [diff] [blame] | 238 | vendor_ramdisk: { |
| 239 | exclude_static_libs: [ |
| 240 | "libdexfile_support", |
| 241 | ], |
Martin Stjernholm | 3784b9d | 2021-08-26 21:18:43 +0100 | [diff] [blame] | 242 | exclude_runtime_libs: [ |
| 243 | "libdexfile", |
| 244 | ], |
Yifan Hong | 2ec92cf | 2020-10-27 16:25:45 -0700 | [diff] [blame] | 245 | }, |
Martin Stjernholm | bb4f2b4 | 2018-12-19 14:28:33 +0000 | [diff] [blame] | 246 | }, |
Christopher Ferris | 4ae266c | 2019-04-03 09:27:12 -0700 | [diff] [blame] | 247 | |
| 248 | product_variables: { |
| 249 | debuggable: { |
| 250 | cflags: ["-DROOT_POSSIBLE"], |
| 251 | }, |
Christopher Ferris | 7aad256 | 2021-09-24 00:06:38 -0700 | [diff] [blame] | 252 | |
| 253 | malloc_not_svelte: { |
| 254 | cflags: ["-DUSE_SCUDO"], |
| 255 | whole_static_libs: ["libscudo"], |
| 256 | srcs: ["libdebuggerd/scudo.cpp"], |
| 257 | header_libs: ["scudo_headers"], |
| 258 | }, |
Christopher Ferris | 4ae266c | 2019-04-03 09:27:12 -0700 | [diff] [blame] | 259 | }, |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 260 | } |
| 261 | |
Josh Gao | 76e1e30 | 2021-01-26 15:53:11 -0800 | [diff] [blame] | 262 | cc_binary { |
| 263 | name: "pbtombstone", |
| 264 | defaults: ["debuggerd_defaults"], |
| 265 | srcs: ["pbtombstone.cpp"], |
| 266 | static_libs: [ |
| 267 | "libbase", |
| 268 | "libdebuggerd", |
| 269 | "liblog", |
| 270 | "libprotobuf-cpp-lite", |
| 271 | "libtombstone_proto", |
| 272 | "libunwindstack", |
| 273 | ], |
| 274 | } |
| 275 | |
Christopher Ferris | fe751c5 | 2021-04-16 09:40:40 -0700 | [diff] [blame] | 276 | cc_test_library { |
| 277 | name: "libcrash_test", |
| 278 | defaults: ["debuggerd_defaults"], |
| 279 | srcs: ["crash_test.cpp"], |
| 280 | } |
| 281 | |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 282 | cc_test { |
| 283 | name: "debuggerd_test", |
| 284 | defaults: ["debuggerd_defaults"], |
Josh Gao | 6cad139 | 2019-08-27 16:02:38 -0700 | [diff] [blame] | 285 | require_root: true, |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 286 | |
| 287 | cflags: ["-Wno-missing-field-initializers"], |
| 288 | srcs: [ |
| 289 | "libdebuggerd/test/dump_memory_test.cpp", |
| 290 | "libdebuggerd/test/elf_fake.cpp", |
| 291 | "libdebuggerd/test/log_fake.cpp", |
| 292 | "libdebuggerd/test/open_files_list_test.cpp", |
Peter Collingbourne | 47d784e | 2021-11-05 18:40:52 -0700 | [diff] [blame] | 293 | "libdebuggerd/test/utility_test.cpp", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 294 | ], |
| 295 | |
| 296 | target: { |
| 297 | android: { |
| 298 | srcs: [ |
Josh Gao | ae9d767 | 2017-03-24 16:26:03 -0700 | [diff] [blame] | 299 | "client/debuggerd_client_test.cpp", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 300 | "debuggerd_test.cpp", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 301 | ], |
Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 302 | static_libs: [ |
| 303 | "libasync_safe", |
| 304 | "libtombstoned_client_static", |
| 305 | ], |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 306 | }, |
| 307 | }, |
| 308 | |
| 309 | shared_libs: [ |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 310 | "libbase", |
| 311 | "libcutils", |
Josh Gao | ae9d767 | 2017-03-24 16:26:03 -0700 | [diff] [blame] | 312 | "libdebuggerd_client", |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 313 | "liblog", |
Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 314 | "libnativehelper", |
Martin Stjernholm | 852b64e | 2019-02-20 17:01:24 +0000 | [diff] [blame] | 315 | "libunwindstack", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 316 | ], |
| 317 | |
| 318 | static_libs: [ |
Josh Gao | 352a845 | 2017-03-30 16:46:21 -0700 | [diff] [blame] | 319 | "libdebuggerd", |
Mitch Phillips | e0b4bb1 | 2020-02-14 14:54:31 -0800 | [diff] [blame] | 320 | "libgmock", |
Peter Collingbourne | d00a577 | 2020-07-20 23:11:16 -0700 | [diff] [blame] | 321 | "libminijail", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 322 | ], |
| 323 | |
Josh Gao | a48b41b | 2019-12-13 14:11:04 -0800 | [diff] [blame] | 324 | header_libs: [ |
| 325 | "bionic_libc_platform_headers", |
Mitch Phillips | e0b4bb1 | 2020-02-14 14:54:31 -0800 | [diff] [blame] | 326 | "gwp_asan_headers", |
Josh Gao | a48b41b | 2019-12-13 14:11:04 -0800 | [diff] [blame] | 327 | ], |
| 328 | |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 329 | local_include_dirs: [ |
| 330 | "libdebuggerd", |
| 331 | ], |
| 332 | |
| 333 | compile_multilib: "both", |
| 334 | multilib: { |
| 335 | lib32: { |
| 336 | stem: "debuggerd_test32", |
| 337 | }, |
| 338 | lib64: { |
| 339 | stem: "debuggerd_test64", |
| 340 | }, |
| 341 | }, |
Elliott Hughes | 40fdf3f | 2018-04-27 16:12:06 -0700 | [diff] [blame] | 342 | |
Christopher Ferris | fe751c5 | 2021-04-16 09:40:40 -0700 | [diff] [blame] | 343 | data: [ |
| 344 | ":libcrash_test", |
| 345 | ], |
| 346 | |
Elliott Hughes | 40fdf3f | 2018-04-27 16:12:06 -0700 | [diff] [blame] | 347 | test_suites: ["device-tests"], |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 348 | } |
| 349 | |
Josh Gao | a42314e | 2017-12-19 15:08:19 -0800 | [diff] [blame] | 350 | cc_benchmark { |
| 351 | name: "debuggerd_benchmark", |
| 352 | defaults: ["debuggerd_defaults"], |
| 353 | srcs: ["debuggerd_benchmark.cpp"], |
| 354 | shared_libs: [ |
| 355 | "libbase", |
| 356 | "libdebuggerd_client", |
| 357 | ], |
| 358 | } |
| 359 | |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 360 | cc_binary { |
| 361 | name: "crash_dump", |
| 362 | srcs: [ |
| 363 | "crash_dump.cpp", |
| 364 | "util.cpp", |
| 365 | ], |
| 366 | defaults: ["debuggerd_defaults"], |
| 367 | |
| 368 | compile_multilib: "both", |
| 369 | multilib: { |
| 370 | lib32: { |
| 371 | suffix: "32", |
| 372 | }, |
| 373 | lib64: { |
| 374 | suffix: "64", |
| 375 | }, |
| 376 | }, |
| 377 | |
Josh Gao | a48b41b | 2019-12-13 14:11:04 -0800 | [diff] [blame] | 378 | header_libs: [ |
| 379 | "bionic_libc_platform_headers", |
| 380 | ], |
| 381 | |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 382 | static_libs: [ |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 383 | "libtombstoned_client_static", |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 384 | "libdebuggerd", |
| 385 | "libcutils", |
Josh Gao | 76e1e30 | 2021-01-26 15:53:11 -0800 | [diff] [blame] | 386 | |
| 387 | "libtombstone_proto", |
| 388 | "libprotobuf-cpp-lite", |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 389 | ], |
| 390 | |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 391 | shared_libs: [ |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 392 | "libbase", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 393 | "liblog", |
| 394 | "libprocinfo", |
Josh Gao | 2b2ae0c | 2017-08-21 14:31:17 -0700 | [diff] [blame] | 395 | "libunwindstack", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 396 | ], |
Peter Collingbourne | b72e748 | 2020-03-16 18:14:13 -0700 | [diff] [blame] | 397 | |
| 398 | apex_available: [ |
| 399 | "com.android.runtime", |
| 400 | ], |
Peter Collingbourne | a2739da | 2022-02-02 17:00:42 -0800 | [diff] [blame] | 401 | |
| 402 | // Required for tests. |
| 403 | required: ["crash_dump.policy"], |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 404 | } |
| 405 | |
| 406 | cc_binary { |
| 407 | name: "debuggerd", |
| 408 | srcs: [ |
| 409 | "debuggerd.cpp", |
| 410 | ], |
| 411 | defaults: ["debuggerd_defaults"], |
| 412 | |
| 413 | shared_libs: [ |
| 414 | "libbase", |
| 415 | "libdebuggerd_client", |
| 416 | "liblog", |
Josh Gao | 0915f23 | 2017-06-27 14:08:05 -0700 | [diff] [blame] | 417 | "libprocinfo", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 418 | ], |
| 419 | |
| 420 | local_include_dirs: ["include"], |
| 421 | } |
| 422 | |
| 423 | cc_binary { |
| 424 | name: "tombstoned", |
| 425 | srcs: [ |
| 426 | "util.cpp", |
| 427 | "tombstoned/intercept_manager.cpp", |
| 428 | "tombstoned/tombstoned.cpp", |
| 429 | ], |
| 430 | defaults: ["debuggerd_defaults"], |
| 431 | |
Josh Gao | a48b41b | 2019-12-13 14:11:04 -0800 | [diff] [blame] | 432 | header_libs: [ |
| 433 | "bionic_libc_platform_headers", |
| 434 | "libdebuggerd_common_headers" |
| 435 | ], |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 436 | |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 437 | static_libs: [ |
| 438 | "libbase", |
| 439 | "libcutils", |
| 440 | "libevent", |
| 441 | "liblog", |
| 442 | ], |
| 443 | |
Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 444 | init_rc: ["tombstoned/tombstoned.rc"], |
Josh Gao | 9c02dc5 | 2016-06-15 17:29:00 -0700 | [diff] [blame] | 445 | } |
Ray Essick | bd3ba78 | 2020-01-21 15:21:08 -0800 | [diff] [blame] | 446 | |
| 447 | prebuilt_etc { |
| 448 | name: "crash_dump.policy", |
| 449 | sub_dir: "seccomp_policy", |
| 450 | filename_from_src: true, |
| 451 | arch: { |
| 452 | arm: { |
| 453 | src: "seccomp_policy/crash_dump.arm.policy", |
| 454 | }, |
| 455 | arm64: { |
| 456 | src: "seccomp_policy/crash_dump.arm64.policy", |
| 457 | }, |
| 458 | x86: { |
| 459 | src: "seccomp_policy/crash_dump.x86.policy", |
| 460 | }, |
| 461 | x86_64: { |
| 462 | src: "seccomp_policy/crash_dump.x86_64.policy", |
| 463 | }, |
| 464 | }, |
| 465 | required: [ |
| 466 | "crash_dump.policy_other", |
| 467 | ], |
| 468 | } |
| 469 | |
| 470 | |
| 471 | // NB -- this installs "the other" architecture. (puts 32 bit config in on 64 bit device) |
| 472 | // or at least that is the intention so that we get both of them populated |
| 473 | prebuilt_etc { |
| 474 | name: "crash_dump.policy_other", |
| 475 | sub_dir: "seccomp_policy", |
| 476 | filename_from_src: true, |
| 477 | arch: { |
| 478 | arm: { |
| 479 | src: "seccomp_policy/crash_dump.arm64.policy", |
| 480 | }, |
| 481 | arm64: { |
| 482 | src: "seccomp_policy/crash_dump.arm.policy", |
| 483 | }, |
| 484 | x86: { |
| 485 | src: "seccomp_policy/crash_dump.x86_64.policy", |
| 486 | }, |
| 487 | x86_64: { |
| 488 | src: "seccomp_policy/crash_dump.x86.policy", |
| 489 | }, |
| 490 | }, |
| 491 | } |