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", |
Christopher Ferris | f58b009 | 2023-09-12 13:01:10 -0700 | [diff] [blame] | 15 | "-Wno-reorder-init-list", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 16 | "-Os", |
Yabin Cui | e90a944 | 2021-08-11 13:21:11 -0700 | [diff] [blame] | 17 | "-fno-finite-loops", |
Alessandra Loro | 7bd6dca | 2022-09-01 10:33:35 +0000 | [diff] [blame] | 18 | "-DANDROID_DEBUGGABLE=0", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 19 | ], |
| 20 | |
| 21 | local_include_dirs: ["include"], |
Alessandra Loro | 7bd6dca | 2022-09-01 10:33:35 +0000 | [diff] [blame] | 22 | product_variables: { |
| 23 | debuggable: { |
| 24 | cflags: ["-UANDROID_DEBUGGABLE", "-DANDROID_DEBUGGABLE=1"], |
| 25 | } |
| 26 | }, |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 27 | } |
| 28 | |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 29 | cc_library_headers { |
| 30 | name: "libdebuggerd_common_headers", |
Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 31 | export_include_dirs: ["common/include"], |
Jiyong Park | a0e7504 | 2018-05-24 14:11:00 +0900 | [diff] [blame] | 32 | recovery_available: true, |
Yifan Hong | 2ec92cf | 2020-10-27 16:25:45 -0700 | [diff] [blame] | 33 | vendor_ramdisk_available: true, |
Shikha Panwar | 757f299 | 2022-03-25 19:43:14 +0000 | [diff] [blame] | 34 | apex_available: [ |
| 35 | "com.android.virt", |
| 36 | "//apex_available:platform", |
| 37 | ], |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 38 | } |
| 39 | |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 40 | cc_library_shared { |
Josh Gao | e1aa0ca | 2017-03-01 17:23:22 -0800 | [diff] [blame] | 41 | name: "libtombstoned_client", |
| 42 | defaults: ["debuggerd_defaults"], |
| 43 | srcs: [ |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 44 | "tombstoned/tombstoned_client.cpp", |
| 45 | "util.cpp", |
| 46 | ], |
| 47 | |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 48 | header_libs: ["libdebuggerd_common_headers"], |
| 49 | |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 50 | static_libs: [ |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 51 | "libasync_safe", |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 52 | ], |
| 53 | |
| 54 | shared_libs: [ |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 55 | "libbase", |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 56 | "libcutils", |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 57 | ], |
Shikha Panwar | 757f299 | 2022-03-25 19:43:14 +0000 | [diff] [blame] | 58 | apex_available: [ |
| 59 | "com.android.virt", |
| 60 | "//apex_available:platform", |
| 61 | ], |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 62 | |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 63 | export_header_lib_headers: ["libdebuggerd_common_headers"], |
Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 64 | export_include_dirs: ["tombstoned/include"], |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 65 | } |
| 66 | |
Josh Gao | 9da1f51 | 2018-08-06 15:38:29 -0700 | [diff] [blame] | 67 | // Utility library to talk to tombstoned and get an output fd. |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 68 | cc_library_static { |
| 69 | name: "libtombstoned_client_static", |
| 70 | defaults: ["debuggerd_defaults"], |
Jiyong Park | 011ee12 | 2018-05-29 16:41:30 +0900 | [diff] [blame] | 71 | recovery_available: true, |
Yifan Hong | 2ec92cf | 2020-10-27 16:25:45 -0700 | [diff] [blame] | 72 | vendor_ramdisk_available: true, |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 73 | srcs: [ |
| 74 | "tombstoned/tombstoned_client.cpp", |
Josh Gao | e1aa0ca | 2017-03-01 17:23:22 -0800 | [diff] [blame] | 75 | "util.cpp", |
| 76 | ], |
| 77 | |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 78 | header_libs: ["libdebuggerd_common_headers"], |
| 79 | |
Josh Gao | e1aa0ca | 2017-03-01 17:23:22 -0800 | [diff] [blame] | 80 | whole_static_libs: [ |
Christopher Ferris | ac22578 | 2017-04-25 11:23:10 -0700 | [diff] [blame] | 81 | "libasync_safe", |
Josh Gao | e1aa0ca | 2017-03-01 17:23:22 -0800 | [diff] [blame] | 82 | "libcutils", |
| 83 | "libbase", |
| 84 | ], |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 85 | |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 86 | export_header_lib_headers: ["libdebuggerd_common_headers"], |
Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 87 | export_include_dirs: ["tombstoned/include"], |
Josh Gao | e1aa0ca | 2017-03-01 17:23:22 -0800 | [diff] [blame] | 88 | } |
| 89 | |
| 90 | // Core implementation, linked into libdebuggerd_handler and the dynamic linker. |
Josh Gao | 9c02dc5 | 2016-06-15 17:29:00 -0700 | [diff] [blame] | 91 | cc_library_static { |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 92 | name: "libdebuggerd_handler_core", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 93 | defaults: ["debuggerd_defaults"], |
Jiyong Park | a0e7504 | 2018-05-24 14:11:00 +0900 | [diff] [blame] | 94 | recovery_available: true, |
Yifan Hong | 2ec92cf | 2020-10-27 16:25:45 -0700 | [diff] [blame] | 95 | vendor_ramdisk_available: true, |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 96 | srcs: ["handler/debuggerd_handler.cpp"], |
Josh Gao | 9c02dc5 | 2016-06-15 17:29:00 -0700 | [diff] [blame] | 97 | |
Josh Gao | fdf832d | 2017-08-25 18:00:18 -0700 | [diff] [blame] | 98 | header_libs: [ |
| 99 | "libbase_headers", |
| 100 | "libdebuggerd_common_headers", |
Josh Gao | a48b41b | 2019-12-13 14:11:04 -0800 | [diff] [blame] | 101 | "bionic_libc_platform_headers", |
Mitch Phillips | 18ce542 | 2023-01-19 14:23:49 -0800 | [diff] [blame] | 102 | "gwp_asan_headers", |
Josh Gao | fdf832d | 2017-08-25 18:00:18 -0700 | [diff] [blame] | 103 | ], |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 104 | |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 105 | whole_static_libs: [ |
Christopher Ferris | ac22578 | 2017-04-25 11:23:10 -0700 | [diff] [blame] | 106 | "libasync_safe", |
Josh Gao | 2b2ae0c | 2017-08-21 14:31:17 -0700 | [diff] [blame] | 107 | "libcutils", |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 108 | "libdebuggerd", |
| 109 | ], |
| 110 | |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 111 | export_header_lib_headers: ["libdebuggerd_common_headers"], |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 112 | export_include_dirs: ["include"], |
| 113 | } |
| 114 | |
Josh Gao | e1aa0ca | 2017-03-01 17:23:22 -0800 | [diff] [blame] | 115 | // Implementation with a no-op fallback. |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 116 | cc_library_static { |
| 117 | name: "libdebuggerd_handler", |
| 118 | defaults: ["debuggerd_defaults"], |
| 119 | srcs: ["handler/debuggerd_fallback_nop.cpp"], |
| 120 | |
Josh Gao | a48b41b | 2019-12-13 14:11:04 -0800 | [diff] [blame] | 121 | header_libs: ["bionic_libc_platform_headers"], |
| 122 | export_header_lib_headers: ["bionic_libc_platform_headers"], |
| 123 | |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 124 | whole_static_libs: [ |
| 125 | "libdebuggerd_handler_core", |
| 126 | ], |
| 127 | |
| 128 | export_include_dirs: ["include"], |
| 129 | } |
| 130 | |
Martin Stjernholm | a2cc893 | 2019-10-23 21:32:43 +0100 | [diff] [blame] | 131 | // Fallback implementation, for use in the Bionic linker only. |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 132 | cc_library_static { |
| 133 | name: "libdebuggerd_handler_fallback", |
Martin Stjernholm | a2cc893 | 2019-10-23 21:32:43 +0100 | [diff] [blame] | 134 | visibility: ["//bionic/linker"], |
| 135 | apex_available: [ |
| 136 | "com.android.runtime", |
| 137 | "//apex_available:platform", |
| 138 | ], |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 139 | defaults: ["debuggerd_defaults"], |
Jiyong Park | 011ee12 | 2018-05-29 16:41:30 +0900 | [diff] [blame] | 140 | recovery_available: true, |
Yifan Hong | 2ec92cf | 2020-10-27 16:25:45 -0700 | [diff] [blame] | 141 | vendor_ramdisk_available: true, |
Josh Gao | e1aa0ca | 2017-03-01 17:23:22 -0800 | [diff] [blame] | 142 | srcs: [ |
| 143 | "handler/debuggerd_fallback.cpp", |
| 144 | ], |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 145 | |
Josh Gao | e1aa0ca | 2017-03-01 17:23:22 -0800 | [diff] [blame] | 146 | whole_static_libs: [ |
| 147 | "libdebuggerd_handler_core", |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 148 | "libtombstoned_client_static", |
Christopher Ferris | ac22578 | 2017-04-25 11:23:10 -0700 | [diff] [blame] | 149 | "libasync_safe", |
Josh Gao | e1aa0ca | 2017-03-01 17:23:22 -0800 | [diff] [blame] | 150 | "libbase", |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 151 | "libdebuggerd", |
Martin Stjernholm | a2cc893 | 2019-10-23 21:32:43 +0100 | [diff] [blame] | 152 | "libunwindstack_no_dex", |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 153 | "liblzma", |
| 154 | "libcutils", |
| 155 | ], |
Josh Gao | a48b41b | 2019-12-13 14:11:04 -0800 | [diff] [blame] | 156 | |
| 157 | header_libs: ["bionic_libc_platform_headers"], |
| 158 | export_header_lib_headers: ["bionic_libc_platform_headers"], |
| 159 | |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 160 | export_include_dirs: ["include"], |
| 161 | } |
| 162 | |
| 163 | cc_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 Gao | 4175cee | 2019-01-04 13:57:09 -0800 | [diff] [blame] | 174 | "libprocinfo", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 175 | ], |
Josh Gao | e1aa0ca | 2017-03-01 17:23:22 -0800 | [diff] [blame] | 176 | |
Josh Gao | a48b41b | 2019-12-13 14:11:04 -0800 | [diff] [blame] | 177 | 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 Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 186 | export_include_dirs: ["include"], |
| 187 | } |
| 188 | |
Siim Sammul | c08a34e | 2023-11-17 17:06:15 +0000 | [diff] [blame^] | 189 | cc_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 Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 224 | cc_library_static { |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 225 | name: "libdebuggerd", |
| 226 | defaults: ["debuggerd_defaults"], |
Christopher Ferris | 48d6e04 | 2023-07-31 14:24:01 -0700 | [diff] [blame] | 227 | ramdisk_available: true, |
Jiyong Park | a0e7504 | 2018-05-24 14:11:00 +0900 | [diff] [blame] | 228 | recovery_available: true, |
Yifan Hong | 2ec92cf | 2020-10-27 16:25:45 -0700 | [diff] [blame] | 229 | vendor_ramdisk_available: true, |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 230 | |
| 231 | srcs: [ |
| 232 | "libdebuggerd/backtrace.cpp", |
Mitch Phillips | e0b4bb1 | 2020-02-14 14:54:31 -0800 | [diff] [blame] | 233 | "libdebuggerd/gwp_asan.cpp", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 234 | "libdebuggerd/open_files_list.cpp", |
| 235 | "libdebuggerd/tombstone.cpp", |
Josh Gao | 76e1e30 | 2021-01-26 15:53:11 -0800 | [diff] [blame] | 236 | "libdebuggerd/tombstone_proto.cpp", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 237 | "libdebuggerd/utility.cpp", |
| 238 | ], |
| 239 | |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 240 | local_include_dirs: ["libdebuggerd/include"], |
| 241 | export_include_dirs: ["libdebuggerd/include"], |
Josh Gao | 9c02dc5 | 2016-06-15 17:29:00 -0700 | [diff] [blame] | 242 | |
Peter Collingbourne | f862252 | 2020-04-07 14:07:32 -0700 | [diff] [blame] | 243 | include_dirs: [ |
| 244 | // Needed for private/bionic_fdsan.h |
| 245 | "bionic/libc", |
Peter Collingbourne | f862252 | 2020-04-07 14:07:32 -0700 | [diff] [blame] | 246 | ], |
Mitch Phillips | e0b4bb1 | 2020-02-14 14:54:31 -0800 | [diff] [blame] | 247 | header_libs: [ |
| 248 | "bionic_libc_platform_headers", |
| 249 | "gwp_asan_headers", |
Jiyong Park | eb769d6 | 2022-08-19 13:21:02 +0900 | [diff] [blame] | 250 | "liblog_headers", |
Mitch Phillips | e0b4bb1 | 2020-02-14 14:54:31 -0800 | [diff] [blame] | 251 | ], |
Josh Gao | ce841d9 | 2018-08-06 18:26:42 -0700 | [diff] [blame] | 252 | |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 253 | static_libs: [ |
Martin Stjernholm | a2cc893 | 2019-10-23 21:32:43 +0100 | [diff] [blame] | 254 | "libdexfile_support", // libunwindstack dependency |
Christopher Ferris | 9a8c855 | 2017-08-11 15:29:19 -0700 | [diff] [blame] | 255 | "libunwindstack", |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 256 | "liblzma", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 257 | "libbase", |
| 258 | "libcutils", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 259 | ], |
Josh Gao | a48b41b | 2019-12-13 14:11:04 -0800 | [diff] [blame] | 260 | |
Peter Collingbourne | f862252 | 2020-04-07 14:07:32 -0700 | [diff] [blame] | 261 | whole_static_libs: [ |
Siim Sammul | c08a34e | 2023-11-17 17:06:15 +0000 | [diff] [blame^] | 262 | "libdebuggerd_tombstone_proto_to_text", |
Josh Gao | 618cea3 | 2021-01-26 17:45:43 -0800 | [diff] [blame] | 263 | "libasync_safe", |
Peter Collingbourne | f862252 | 2020-04-07 14:07:32 -0700 | [diff] [blame] | 264 | "gwp_asan_crash_handler", |
Josh Gao | 76e1e30 | 2021-01-26 15:53:11 -0800 | [diff] [blame] | 265 | "libtombstone_proto", |
Josh Gao | dbb83de | 2021-03-01 23:13:13 -0800 | [diff] [blame] | 266 | "libprocinfo", |
Josh Gao | 76e1e30 | 2021-01-26 15:53:11 -0800 | [diff] [blame] | 267 | "libprotobuf-cpp-lite", |
Peter Collingbourne | f862252 | 2020-04-07 14:07:32 -0700 | [diff] [blame] | 268 | ], |
Mitch Phillips | e0b4bb1 | 2020-02-14 14:54:31 -0800 | [diff] [blame] | 269 | |
Martin Stjernholm | bb4f2b4 | 2018-12-19 14:28:33 +0000 | [diff] [blame] | 270 | target: { |
| 271 | recovery: { |
| 272 | exclude_static_libs: [ |
Martin Stjernholm | a2cc893 | 2019-10-23 21:32:43 +0100 | [diff] [blame] | 273 | "libdexfile_support", |
Martin Stjernholm | bb4f2b4 | 2018-12-19 14:28:33 +0000 | [diff] [blame] | 274 | ], |
Martin Stjernholm | 3784b9d | 2021-08-26 21:18:43 +0100 | [diff] [blame] | 275 | exclude_runtime_libs: [ |
| 276 | "libdexfile", |
| 277 | ], |
Martin Stjernholm | bb4f2b4 | 2018-12-19 14:28:33 +0000 | [diff] [blame] | 278 | }, |
Yifan Hong | 2ec92cf | 2020-10-27 16:25:45 -0700 | [diff] [blame] | 279 | vendor_ramdisk: { |
| 280 | exclude_static_libs: [ |
| 281 | "libdexfile_support", |
| 282 | ], |
Martin Stjernholm | 3784b9d | 2021-08-26 21:18:43 +0100 | [diff] [blame] | 283 | exclude_runtime_libs: [ |
| 284 | "libdexfile", |
| 285 | ], |
Yifan Hong | 2ec92cf | 2020-10-27 16:25:45 -0700 | [diff] [blame] | 286 | }, |
Christopher Ferris | 48d6e04 | 2023-07-31 14:24:01 -0700 | [diff] [blame] | 287 | 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 Stjernholm | bb4f2b4 | 2018-12-19 14:28:33 +0000 | [diff] [blame] | 300 | }, |
Christopher Ferris | 4ae266c | 2019-04-03 09:27:12 -0700 | [diff] [blame] | 301 | |
| 302 | product_variables: { |
| 303 | debuggable: { |
| 304 | cflags: ["-DROOT_POSSIBLE"], |
| 305 | }, |
Christopher Ferris | 7aad256 | 2021-09-24 00:06:38 -0700 | [diff] [blame] | 306 | |
| 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 Ferris | 4ae266c | 2019-04-03 09:27:12 -0700 | [diff] [blame] | 313 | }, |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 314 | } |
| 315 | |
Josh Gao | 76e1e30 | 2021-01-26 15:53:11 -0800 | [diff] [blame] | 316 | cc_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 Ferris | fe751c5 | 2021-04-16 09:40:40 -0700 | [diff] [blame] | 330 | cc_test_library { |
| 331 | name: "libcrash_test", |
| 332 | defaults: ["debuggerd_defaults"], |
| 333 | srcs: ["crash_test.cpp"], |
| 334 | } |
| 335 | |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 336 | cc_test { |
| 337 | name: "debuggerd_test", |
| 338 | defaults: ["debuggerd_defaults"], |
Josh Gao | 6cad139 | 2019-08-27 16:02:38 -0700 | [diff] [blame] | 339 | require_root: true, |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 340 | |
| 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 Sammul | c08a34e | 2023-11-17 17:06:15 +0000 | [diff] [blame^] | 347 | "libdebuggerd/test/tombstone_proto_to_text_test.cpp", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 348 | ], |
| 349 | |
| 350 | target: { |
| 351 | android: { |
| 352 | srcs: [ |
Josh Gao | ae9d767 | 2017-03-24 16:26:03 -0700 | [diff] [blame] | 353 | "client/debuggerd_client_test.cpp", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 354 | "debuggerd_test.cpp", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 355 | ], |
Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 356 | static_libs: [ |
| 357 | "libasync_safe", |
| 358 | "libtombstoned_client_static", |
| 359 | ], |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 360 | }, |
| 361 | }, |
| 362 | |
| 363 | shared_libs: [ |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 364 | "libbase", |
| 365 | "libcutils", |
Josh Gao | ae9d767 | 2017-03-24 16:26:03 -0700 | [diff] [blame] | 366 | "libdebuggerd_client", |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 367 | "liblog", |
Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 368 | "libnativehelper", |
Martin Stjernholm | 852b64e | 2019-02-20 17:01:24 +0000 | [diff] [blame] | 369 | "libunwindstack", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 370 | ], |
| 371 | |
| 372 | static_libs: [ |
Josh Gao | 352a845 | 2017-03-30 16:46:21 -0700 | [diff] [blame] | 373 | "libdebuggerd", |
Mitch Phillips | e0b4bb1 | 2020-02-14 14:54:31 -0800 | [diff] [blame] | 374 | "libgmock", |
Peter Collingbourne | d00a577 | 2020-07-20 23:11:16 -0700 | [diff] [blame] | 375 | "libminijail", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 376 | ], |
| 377 | |
Josh Gao | a48b41b | 2019-12-13 14:11:04 -0800 | [diff] [blame] | 378 | header_libs: [ |
| 379 | "bionic_libc_platform_headers", |
Mitch Phillips | e0b4bb1 | 2020-02-14 14:54:31 -0800 | [diff] [blame] | 380 | "gwp_asan_headers", |
Josh Gao | a48b41b | 2019-12-13 14:11:04 -0800 | [diff] [blame] | 381 | ], |
| 382 | |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 383 | 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 Hughes | 40fdf3f | 2018-04-27 16:12:06 -0700 | [diff] [blame] | 396 | |
Christopher Ferris | fe751c5 | 2021-04-16 09:40:40 -0700 | [diff] [blame] | 397 | data: [ |
| 398 | ":libcrash_test", |
| 399 | ], |
| 400 | |
Elliott Hughes | 40fdf3f | 2018-04-27 16:12:06 -0700 | [diff] [blame] | 401 | test_suites: ["device-tests"], |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 402 | } |
| 403 | |
Josh Gao | a42314e | 2017-12-19 15:08:19 -0800 | [diff] [blame] | 404 | cc_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 Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 414 | cc_binary { |
| 415 | name: "crash_dump", |
| 416 | srcs: [ |
| 417 | "crash_dump.cpp", |
Shikha Panwar | abde59e | 2023-02-03 15:05:18 +0000 | [diff] [blame] | 418 | "tombstone_handler.cpp", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 419 | "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 Gao | a48b41b | 2019-12-13 14:11:04 -0800 | [diff] [blame] | 433 | header_libs: [ |
| 434 | "bionic_libc_platform_headers", |
| 435 | ], |
| 436 | |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 437 | static_libs: [ |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 438 | "libtombstoned_client_static", |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 439 | "libdebuggerd", |
| 440 | "libcutils", |
Josh Gao | 76e1e30 | 2021-01-26 15:53:11 -0800 | [diff] [blame] | 441 | |
| 442 | "libtombstone_proto", |
| 443 | "libprotobuf-cpp-lite", |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 444 | ], |
| 445 | |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 446 | shared_libs: [ |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 447 | "libbase", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 448 | "liblog", |
| 449 | "libprocinfo", |
Josh Gao | 2b2ae0c | 2017-08-21 14:31:17 -0700 | [diff] [blame] | 450 | "libunwindstack", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 451 | ], |
Peter Collingbourne | b72e748 | 2020-03-16 18:14:13 -0700 | [diff] [blame] | 452 | |
| 453 | apex_available: [ |
| 454 | "com.android.runtime", |
| 455 | ], |
Peter Collingbourne | a2739da | 2022-02-02 17:00:42 -0800 | [diff] [blame] | 456 | |
| 457 | // Required for tests. |
| 458 | required: ["crash_dump.policy"], |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 459 | } |
| 460 | |
| 461 | cc_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 Gao | 0915f23 | 2017-06-27 14:08:05 -0700 | [diff] [blame] | 472 | "libprocinfo", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 473 | ], |
| 474 | |
| 475 | local_include_dirs: ["include"], |
| 476 | } |
| 477 | |
Nikita Ioffe | 75be784 | 2022-10-24 15:31:11 +0100 | [diff] [blame] | 478 | cc_defaults { |
| 479 | name: "tombstoned_defaults", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 480 | srcs: [ |
| 481 | "util.cpp", |
| 482 | "tombstoned/intercept_manager.cpp", |
| 483 | "tombstoned/tombstoned.cpp", |
| 484 | ], |
| 485 | defaults: ["debuggerd_defaults"], |
| 486 | |
Josh Gao | a48b41b | 2019-12-13 14:11:04 -0800 | [diff] [blame] | 487 | header_libs: [ |
| 488 | "bionic_libc_platform_headers", |
| 489 | "libdebuggerd_common_headers" |
| 490 | ], |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 491 | |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 492 | static_libs: [ |
| 493 | "libbase", |
| 494 | "libcutils", |
| 495 | "libevent", |
| 496 | "liblog", |
| 497 | ], |
Nikita Ioffe | 75be784 | 2022-10-24 15:31:11 +0100 | [diff] [blame] | 498 | } |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 499 | |
Nikita Ioffe | 75be784 | 2022-10-24 15:31:11 +0100 | [diff] [blame] | 500 | cc_binary { |
| 501 | name: "tombstoned", |
| 502 | defaults: ["tombstoned_defaults"], |
Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 503 | init_rc: ["tombstoned/tombstoned.rc"], |
Josh Gao | 9c02dc5 | 2016-06-15 17:29:00 -0700 | [diff] [blame] | 504 | } |
Ray Essick | bd3ba78 | 2020-01-21 15:21:08 -0800 | [diff] [blame] | 505 | |
Nikita Ioffe | 75be784 | 2022-10-24 15:31:11 +0100 | [diff] [blame] | 506 | cc_binary { |
| 507 | name: "tombstoned.microdroid", |
| 508 | defaults: ["tombstoned_defaults"], |
| 509 | init_rc: ["tombstoned/tombstoned.microdroid.rc"], |
| 510 | } |
| 511 | |
Ray Essick | bd3ba78 | 2020-01-21 15:21:08 -0800 | [diff] [blame] | 512 | prebuilt_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 Hughes | 2f88331 | 2022-11-14 20:02:28 +0000 | [diff] [blame] | 519 | required: [ |
| 520 | "crash_dump.policy_other", |
| 521 | ], |
Ray Essick | bd3ba78 | 2020-01-21 15:21:08 -0800 | [diff] [blame] | 522 | }, |
| 523 | arm64: { |
| 524 | src: "seccomp_policy/crash_dump.arm64.policy", |
Elliott Hughes | 2f88331 | 2022-11-14 20:02:28 +0000 | [diff] [blame] | 525 | required: [ |
| 526 | "crash_dump.policy_other", |
| 527 | ], |
Ray Essick | bd3ba78 | 2020-01-21 15:21:08 -0800 | [diff] [blame] | 528 | }, |
Chen Guoyin | a22af66 | 2022-10-12 22:32:55 +0800 | [diff] [blame] | 529 | riscv64: { |
| 530 | src: "seccomp_policy/crash_dump.riscv64.policy", |
| 531 | }, |
Ray Essick | bd3ba78 | 2020-01-21 15:21:08 -0800 | [diff] [blame] | 532 | x86: { |
| 533 | src: "seccomp_policy/crash_dump.x86.policy", |
Elliott Hughes | 2f88331 | 2022-11-14 20:02:28 +0000 | [diff] [blame] | 534 | required: [ |
| 535 | "crash_dump.policy_other", |
| 536 | ], |
Ray Essick | bd3ba78 | 2020-01-21 15:21:08 -0800 | [diff] [blame] | 537 | }, |
| 538 | x86_64: { |
| 539 | src: "seccomp_policy/crash_dump.x86_64.policy", |
Elliott Hughes | 2f88331 | 2022-11-14 20:02:28 +0000 | [diff] [blame] | 540 | required: [ |
| 541 | "crash_dump.policy_other", |
| 542 | ], |
Ray Essick | bd3ba78 | 2020-01-21 15:21:08 -0800 | [diff] [blame] | 543 | }, |
| 544 | }, |
Ray Essick | bd3ba78 | 2020-01-21 15:21:08 -0800 | [diff] [blame] | 545 | } |
| 546 | |
| 547 | |
Elliott Hughes | 2f88331 | 2022-11-14 20:02:28 +0000 | [diff] [blame] | 548 | // This installs the "other" architecture (so 32-bit on 64-bit device). |
Ray Essick | bd3ba78 | 2020-01-21 15:21:08 -0800 | [diff] [blame] | 549 | prebuilt_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 Hughes | 857e29c | 2023-03-20 15:48:30 -0700 | [diff] [blame] | 560 | riscv64: { |
| 561 | enabled: false, |
| 562 | }, |
Ray Essick | bd3ba78 | 2020-01-21 15:21:08 -0800 | [diff] [blame] | 563 | 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 | } |