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: [ |
Spandan Das | e6bc026 | 2024-01-02 22:39:00 +0000 | [diff] [blame] | 35 | "com.android.runtime", |
Shikha Panwar | 757f299 | 2022-03-25 19:43:14 +0000 | [diff] [blame] | 36 | "com.android.virt", |
| 37 | "//apex_available:platform", |
Spandan Das | e6bc026 | 2024-01-02 22:39:00 +0000 | [diff] [blame] | 38 | ], |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 39 | } |
| 40 | |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 41 | cc_library_shared { |
Josh Gao | e1aa0ca | 2017-03-01 17:23:22 -0800 | [diff] [blame] | 42 | name: "libtombstoned_client", |
| 43 | defaults: ["debuggerd_defaults"], |
| 44 | srcs: [ |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 45 | "tombstoned/tombstoned_client.cpp", |
| 46 | "util.cpp", |
| 47 | ], |
| 48 | |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 49 | header_libs: ["libdebuggerd_common_headers"], |
| 50 | |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 51 | static_libs: [ |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 52 | "libasync_safe", |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 53 | ], |
| 54 | |
| 55 | shared_libs: [ |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 56 | "libbase", |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 57 | "libcutils", |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 58 | ], |
Shikha Panwar | 757f299 | 2022-03-25 19:43:14 +0000 | [diff] [blame] | 59 | apex_available: [ |
| 60 | "com.android.virt", |
| 61 | "//apex_available:platform", |
| 62 | ], |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 63 | |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 64 | export_header_lib_headers: ["libdebuggerd_common_headers"], |
Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 65 | export_include_dirs: ["tombstoned/include"], |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 66 | } |
| 67 | |
Josh Gao | 9da1f51 | 2018-08-06 15:38:29 -0700 | [diff] [blame] | 68 | // Utility library to talk to tombstoned and get an output fd. |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 69 | cc_library_static { |
| 70 | name: "libtombstoned_client_static", |
| 71 | defaults: ["debuggerd_defaults"], |
Jiyong Park | 011ee12 | 2018-05-29 16:41:30 +0900 | [diff] [blame] | 72 | recovery_available: true, |
Yifan Hong | 2ec92cf | 2020-10-27 16:25:45 -0700 | [diff] [blame] | 73 | vendor_ramdisk_available: true, |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 74 | srcs: [ |
| 75 | "tombstoned/tombstoned_client.cpp", |
Josh Gao | e1aa0ca | 2017-03-01 17:23:22 -0800 | [diff] [blame] | 76 | "util.cpp", |
| 77 | ], |
| 78 | |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 79 | header_libs: ["libdebuggerd_common_headers"], |
| 80 | |
Josh Gao | e1aa0ca | 2017-03-01 17:23:22 -0800 | [diff] [blame] | 81 | whole_static_libs: [ |
Christopher Ferris | ac22578 | 2017-04-25 11:23:10 -0700 | [diff] [blame] | 82 | "libasync_safe", |
Josh Gao | e1aa0ca | 2017-03-01 17:23:22 -0800 | [diff] [blame] | 83 | "libcutils", |
| 84 | "libbase", |
| 85 | ], |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 86 | |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 87 | export_header_lib_headers: ["libdebuggerd_common_headers"], |
Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 88 | export_include_dirs: ["tombstoned/include"], |
Spandan Das | 2e5cfbc | 2024-01-04 01:34:40 +0000 | [diff] [blame^] | 89 | apex_available: ["com.android.runtime"], |
Josh Gao | e1aa0ca | 2017-03-01 17:23:22 -0800 | [diff] [blame] | 90 | } |
| 91 | |
| 92 | // Core implementation, linked into libdebuggerd_handler and the dynamic linker. |
Josh Gao | 9c02dc5 | 2016-06-15 17:29:00 -0700 | [diff] [blame] | 93 | cc_library_static { |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 94 | name: "libdebuggerd_handler_core", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 95 | defaults: ["debuggerd_defaults"], |
Jiyong Park | a0e7504 | 2018-05-24 14:11:00 +0900 | [diff] [blame] | 96 | recovery_available: true, |
Yifan Hong | 2ec92cf | 2020-10-27 16:25:45 -0700 | [diff] [blame] | 97 | vendor_ramdisk_available: true, |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 98 | srcs: ["handler/debuggerd_handler.cpp"], |
Josh Gao | 9c02dc5 | 2016-06-15 17:29:00 -0700 | [diff] [blame] | 99 | |
Josh Gao | fdf832d | 2017-08-25 18:00:18 -0700 | [diff] [blame] | 100 | header_libs: [ |
| 101 | "libbase_headers", |
| 102 | "libdebuggerd_common_headers", |
Josh Gao | a48b41b | 2019-12-13 14:11:04 -0800 | [diff] [blame] | 103 | "bionic_libc_platform_headers", |
Mitch Phillips | 18ce542 | 2023-01-19 14:23:49 -0800 | [diff] [blame] | 104 | "gwp_asan_headers", |
Josh Gao | fdf832d | 2017-08-25 18:00:18 -0700 | [diff] [blame] | 105 | ], |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 106 | |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 107 | whole_static_libs: [ |
Christopher Ferris | ac22578 | 2017-04-25 11:23:10 -0700 | [diff] [blame] | 108 | "libasync_safe", |
Josh Gao | 2b2ae0c | 2017-08-21 14:31:17 -0700 | [diff] [blame] | 109 | "libcutils", |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 110 | "libdebuggerd", |
| 111 | ], |
| 112 | |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 113 | export_header_lib_headers: ["libdebuggerd_common_headers"], |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 114 | export_include_dirs: ["include"], |
Spandan Das | e6bc026 | 2024-01-02 22:39:00 +0000 | [diff] [blame] | 115 | apex_available: [ |
| 116 | "com.android.runtime", |
| 117 | ], |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 118 | } |
| 119 | |
Josh Gao | e1aa0ca | 2017-03-01 17:23:22 -0800 | [diff] [blame] | 120 | // Implementation with a no-op fallback. |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 121 | cc_library_static { |
| 122 | name: "libdebuggerd_handler", |
| 123 | defaults: ["debuggerd_defaults"], |
| 124 | srcs: ["handler/debuggerd_fallback_nop.cpp"], |
| 125 | |
Josh Gao | a48b41b | 2019-12-13 14:11:04 -0800 | [diff] [blame] | 126 | header_libs: ["bionic_libc_platform_headers"], |
| 127 | export_header_lib_headers: ["bionic_libc_platform_headers"], |
| 128 | |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 129 | whole_static_libs: [ |
| 130 | "libdebuggerd_handler_core", |
| 131 | ], |
| 132 | |
| 133 | export_include_dirs: ["include"], |
| 134 | } |
| 135 | |
Martin Stjernholm | a2cc893 | 2019-10-23 21:32:43 +0100 | [diff] [blame] | 136 | // Fallback implementation, for use in the Bionic linker only. |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 137 | cc_library_static { |
| 138 | name: "libdebuggerd_handler_fallback", |
Martin Stjernholm | a2cc893 | 2019-10-23 21:32:43 +0100 | [diff] [blame] | 139 | visibility: ["//bionic/linker"], |
| 140 | apex_available: [ |
| 141 | "com.android.runtime", |
| 142 | "//apex_available:platform", |
| 143 | ], |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 144 | defaults: ["debuggerd_defaults"], |
Jiyong Park | 011ee12 | 2018-05-29 16:41:30 +0900 | [diff] [blame] | 145 | recovery_available: true, |
Yifan Hong | 2ec92cf | 2020-10-27 16:25:45 -0700 | [diff] [blame] | 146 | vendor_ramdisk_available: true, |
Josh Gao | e1aa0ca | 2017-03-01 17:23:22 -0800 | [diff] [blame] | 147 | srcs: [ |
| 148 | "handler/debuggerd_fallback.cpp", |
| 149 | ], |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 150 | |
Josh Gao | e1aa0ca | 2017-03-01 17:23:22 -0800 | [diff] [blame] | 151 | whole_static_libs: [ |
| 152 | "libdebuggerd_handler_core", |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 153 | "libtombstoned_client_static", |
Christopher Ferris | ac22578 | 2017-04-25 11:23:10 -0700 | [diff] [blame] | 154 | "libasync_safe", |
Josh Gao | e1aa0ca | 2017-03-01 17:23:22 -0800 | [diff] [blame] | 155 | "libbase", |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 156 | "libdebuggerd", |
Martin Stjernholm | a2cc893 | 2019-10-23 21:32:43 +0100 | [diff] [blame] | 157 | "libunwindstack_no_dex", |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 158 | "liblzma", |
| 159 | "libcutils", |
| 160 | ], |
Josh Gao | a48b41b | 2019-12-13 14:11:04 -0800 | [diff] [blame] | 161 | |
| 162 | header_libs: ["bionic_libc_platform_headers"], |
| 163 | export_header_lib_headers: ["bionic_libc_platform_headers"], |
| 164 | |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 165 | export_include_dirs: ["include"], |
| 166 | } |
| 167 | |
| 168 | cc_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 Gao | 4175cee | 2019-01-04 13:57:09 -0800 | [diff] [blame] | 179 | "libprocinfo", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 180 | ], |
Josh Gao | e1aa0ca | 2017-03-01 17:23:22 -0800 | [diff] [blame] | 181 | |
Josh Gao | a48b41b | 2019-12-13 14:11:04 -0800 | [diff] [blame] | 182 | 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 Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 191 | export_include_dirs: ["include"], |
| 192 | } |
| 193 | |
Siim Sammul | c08a34e | 2023-11-17 17:06:15 +0000 | [diff] [blame] | 194 | cc_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 Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 229 | cc_library_static { |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 230 | name: "libdebuggerd", |
| 231 | defaults: ["debuggerd_defaults"], |
Christopher Ferris | 48d6e04 | 2023-07-31 14:24:01 -0700 | [diff] [blame] | 232 | ramdisk_available: true, |
Jiyong Park | a0e7504 | 2018-05-24 14:11:00 +0900 | [diff] [blame] | 233 | recovery_available: true, |
Yifan Hong | 2ec92cf | 2020-10-27 16:25:45 -0700 | [diff] [blame] | 234 | vendor_ramdisk_available: true, |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 235 | |
| 236 | srcs: [ |
| 237 | "libdebuggerd/backtrace.cpp", |
Mitch Phillips | e0b4bb1 | 2020-02-14 14:54:31 -0800 | [diff] [blame] | 238 | "libdebuggerd/gwp_asan.cpp", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 239 | "libdebuggerd/open_files_list.cpp", |
| 240 | "libdebuggerd/tombstone.cpp", |
Josh Gao | 76e1e30 | 2021-01-26 15:53:11 -0800 | [diff] [blame] | 241 | "libdebuggerd/tombstone_proto.cpp", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 242 | "libdebuggerd/utility.cpp", |
| 243 | ], |
| 244 | |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 245 | local_include_dirs: ["libdebuggerd/include"], |
| 246 | export_include_dirs: ["libdebuggerd/include"], |
Josh Gao | 9c02dc5 | 2016-06-15 17:29:00 -0700 | [diff] [blame] | 247 | |
Peter Collingbourne | f862252 | 2020-04-07 14:07:32 -0700 | [diff] [blame] | 248 | include_dirs: [ |
| 249 | // Needed for private/bionic_fdsan.h |
| 250 | "bionic/libc", |
Peter Collingbourne | f862252 | 2020-04-07 14:07:32 -0700 | [diff] [blame] | 251 | ], |
Mitch Phillips | e0b4bb1 | 2020-02-14 14:54:31 -0800 | [diff] [blame] | 252 | header_libs: [ |
| 253 | "bionic_libc_platform_headers", |
| 254 | "gwp_asan_headers", |
Jiyong Park | eb769d6 | 2022-08-19 13:21:02 +0900 | [diff] [blame] | 255 | "liblog_headers", |
Mitch Phillips | e0b4bb1 | 2020-02-14 14:54:31 -0800 | [diff] [blame] | 256 | ], |
Josh Gao | ce841d9 | 2018-08-06 18:26:42 -0700 | [diff] [blame] | 257 | |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 258 | static_libs: [ |
Martin Stjernholm | a2cc893 | 2019-10-23 21:32:43 +0100 | [diff] [blame] | 259 | "libdexfile_support", // libunwindstack dependency |
Christopher Ferris | 9a8c855 | 2017-08-11 15:29:19 -0700 | [diff] [blame] | 260 | "libunwindstack", |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 261 | "liblzma", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 262 | "libbase", |
| 263 | "libcutils", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 264 | ], |
Josh Gao | a48b41b | 2019-12-13 14:11:04 -0800 | [diff] [blame] | 265 | |
Peter Collingbourne | f862252 | 2020-04-07 14:07:32 -0700 | [diff] [blame] | 266 | whole_static_libs: [ |
Siim Sammul | c08a34e | 2023-11-17 17:06:15 +0000 | [diff] [blame] | 267 | "libdebuggerd_tombstone_proto_to_text", |
Josh Gao | 618cea3 | 2021-01-26 17:45:43 -0800 | [diff] [blame] | 268 | "libasync_safe", |
Peter Collingbourne | f862252 | 2020-04-07 14:07:32 -0700 | [diff] [blame] | 269 | "gwp_asan_crash_handler", |
Josh Gao | 76e1e30 | 2021-01-26 15:53:11 -0800 | [diff] [blame] | 270 | "libtombstone_proto", |
Josh Gao | dbb83de | 2021-03-01 23:13:13 -0800 | [diff] [blame] | 271 | "libprocinfo", |
Josh Gao | 76e1e30 | 2021-01-26 15:53:11 -0800 | [diff] [blame] | 272 | "libprotobuf-cpp-lite", |
Peter Collingbourne | f862252 | 2020-04-07 14:07:32 -0700 | [diff] [blame] | 273 | ], |
Mitch Phillips | e0b4bb1 | 2020-02-14 14:54:31 -0800 | [diff] [blame] | 274 | |
Martin Stjernholm | bb4f2b4 | 2018-12-19 14:28:33 +0000 | [diff] [blame] | 275 | target: { |
| 276 | recovery: { |
| 277 | exclude_static_libs: [ |
Martin Stjernholm | a2cc893 | 2019-10-23 21:32:43 +0100 | [diff] [blame] | 278 | "libdexfile_support", |
Martin Stjernholm | bb4f2b4 | 2018-12-19 14:28:33 +0000 | [diff] [blame] | 279 | ], |
Martin Stjernholm | 3784b9d | 2021-08-26 21:18:43 +0100 | [diff] [blame] | 280 | exclude_runtime_libs: [ |
| 281 | "libdexfile", |
| 282 | ], |
Martin Stjernholm | bb4f2b4 | 2018-12-19 14:28:33 +0000 | [diff] [blame] | 283 | }, |
Yifan Hong | 2ec92cf | 2020-10-27 16:25:45 -0700 | [diff] [blame] | 284 | vendor_ramdisk: { |
| 285 | exclude_static_libs: [ |
| 286 | "libdexfile_support", |
| 287 | ], |
Martin Stjernholm | 3784b9d | 2021-08-26 21:18:43 +0100 | [diff] [blame] | 288 | exclude_runtime_libs: [ |
| 289 | "libdexfile", |
| 290 | ], |
Yifan Hong | 2ec92cf | 2020-10-27 16:25:45 -0700 | [diff] [blame] | 291 | }, |
Christopher Ferris | 48d6e04 | 2023-07-31 14:24:01 -0700 | [diff] [blame] | 292 | 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 Stjernholm | bb4f2b4 | 2018-12-19 14:28:33 +0000 | [diff] [blame] | 305 | }, |
Christopher Ferris | 4ae266c | 2019-04-03 09:27:12 -0700 | [diff] [blame] | 306 | |
| 307 | product_variables: { |
| 308 | debuggable: { |
| 309 | cflags: ["-DROOT_POSSIBLE"], |
| 310 | }, |
Christopher Ferris | 7aad256 | 2021-09-24 00:06:38 -0700 | [diff] [blame] | 311 | |
| 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 Ferris | 4ae266c | 2019-04-03 09:27:12 -0700 | [diff] [blame] | 318 | }, |
Spandan Das | e6bc026 | 2024-01-02 22:39:00 +0000 | [diff] [blame] | 319 | apex_available: [ |
| 320 | "com.android.runtime", |
| 321 | ], |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 322 | } |
| 323 | |
Josh Gao | 76e1e30 | 2021-01-26 15:53:11 -0800 | [diff] [blame] | 324 | cc_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 Ferris | fe751c5 | 2021-04-16 09:40:40 -0700 | [diff] [blame] | 338 | cc_test_library { |
| 339 | name: "libcrash_test", |
| 340 | defaults: ["debuggerd_defaults"], |
| 341 | srcs: ["crash_test.cpp"], |
| 342 | } |
| 343 | |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 344 | cc_test { |
| 345 | name: "debuggerd_test", |
| 346 | defaults: ["debuggerd_defaults"], |
Josh Gao | 6cad139 | 2019-08-27 16:02:38 -0700 | [diff] [blame] | 347 | require_root: true, |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 348 | |
| 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 Sammul | c08a34e | 2023-11-17 17:06:15 +0000 | [diff] [blame] | 355 | "libdebuggerd/test/tombstone_proto_to_text_test.cpp", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 356 | ], |
| 357 | |
| 358 | target: { |
| 359 | android: { |
| 360 | srcs: [ |
Josh Gao | ae9d767 | 2017-03-24 16:26:03 -0700 | [diff] [blame] | 361 | "client/debuggerd_client_test.cpp", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 362 | "debuggerd_test.cpp", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 363 | ], |
Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 364 | static_libs: [ |
| 365 | "libasync_safe", |
| 366 | "libtombstoned_client_static", |
| 367 | ], |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 368 | }, |
| 369 | }, |
| 370 | |
| 371 | shared_libs: [ |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 372 | "libbase", |
| 373 | "libcutils", |
Josh Gao | ae9d767 | 2017-03-24 16:26:03 -0700 | [diff] [blame] | 374 | "libdebuggerd_client", |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 375 | "liblog", |
Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 376 | "libnativehelper", |
Martin Stjernholm | 852b64e | 2019-02-20 17:01:24 +0000 | [diff] [blame] | 377 | "libunwindstack", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 378 | ], |
| 379 | |
| 380 | static_libs: [ |
Josh Gao | 352a845 | 2017-03-30 16:46:21 -0700 | [diff] [blame] | 381 | "libdebuggerd", |
Mitch Phillips | e0b4bb1 | 2020-02-14 14:54:31 -0800 | [diff] [blame] | 382 | "libgmock", |
Peter Collingbourne | d00a577 | 2020-07-20 23:11:16 -0700 | [diff] [blame] | 383 | "libminijail", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 384 | ], |
| 385 | |
Josh Gao | a48b41b | 2019-12-13 14:11:04 -0800 | [diff] [blame] | 386 | header_libs: [ |
| 387 | "bionic_libc_platform_headers", |
Mitch Phillips | e0b4bb1 | 2020-02-14 14:54:31 -0800 | [diff] [blame] | 388 | "gwp_asan_headers", |
Josh Gao | a48b41b | 2019-12-13 14:11:04 -0800 | [diff] [blame] | 389 | ], |
| 390 | |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 391 | 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 Hughes | 40fdf3f | 2018-04-27 16:12:06 -0700 | [diff] [blame] | 404 | |
Christopher Ferris | fe751c5 | 2021-04-16 09:40:40 -0700 | [diff] [blame] | 405 | data: [ |
| 406 | ":libcrash_test", |
| 407 | ], |
| 408 | |
Elliott Hughes | 40fdf3f | 2018-04-27 16:12:06 -0700 | [diff] [blame] | 409 | test_suites: ["device-tests"], |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 410 | } |
| 411 | |
Josh Gao | a42314e | 2017-12-19 15:08:19 -0800 | [diff] [blame] | 412 | cc_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 Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 422 | cc_binary { |
| 423 | name: "crash_dump", |
| 424 | srcs: [ |
| 425 | "crash_dump.cpp", |
Shikha Panwar | abde59e | 2023-02-03 15:05:18 +0000 | [diff] [blame] | 426 | "tombstone_handler.cpp", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 427 | "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 Gao | a48b41b | 2019-12-13 14:11:04 -0800 | [diff] [blame] | 441 | header_libs: [ |
| 442 | "bionic_libc_platform_headers", |
| 443 | ], |
| 444 | |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 445 | static_libs: [ |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 446 | "libtombstoned_client_static", |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 447 | "libdebuggerd", |
| 448 | "libcutils", |
Josh Gao | 76e1e30 | 2021-01-26 15:53:11 -0800 | [diff] [blame] | 449 | |
| 450 | "libtombstone_proto", |
| 451 | "libprotobuf-cpp-lite", |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 452 | ], |
| 453 | |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 454 | shared_libs: [ |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 455 | "libbase", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 456 | "liblog", |
| 457 | "libprocinfo", |
Josh Gao | 2b2ae0c | 2017-08-21 14:31:17 -0700 | [diff] [blame] | 458 | "libunwindstack", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 459 | ], |
Peter Collingbourne | b72e748 | 2020-03-16 18:14:13 -0700 | [diff] [blame] | 460 | |
| 461 | apex_available: [ |
| 462 | "com.android.runtime", |
| 463 | ], |
Peter Collingbourne | a2739da | 2022-02-02 17:00:42 -0800 | [diff] [blame] | 464 | |
| 465 | // Required for tests. |
| 466 | required: ["crash_dump.policy"], |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 467 | } |
| 468 | |
| 469 | cc_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 Gao | 0915f23 | 2017-06-27 14:08:05 -0700 | [diff] [blame] | 480 | "libprocinfo", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 481 | ], |
| 482 | |
| 483 | local_include_dirs: ["include"], |
| 484 | } |
| 485 | |
Nikita Ioffe | 75be784 | 2022-10-24 15:31:11 +0100 | [diff] [blame] | 486 | cc_defaults { |
| 487 | name: "tombstoned_defaults", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 488 | srcs: [ |
| 489 | "util.cpp", |
| 490 | "tombstoned/intercept_manager.cpp", |
| 491 | "tombstoned/tombstoned.cpp", |
| 492 | ], |
| 493 | defaults: ["debuggerd_defaults"], |
| 494 | |
Josh Gao | a48b41b | 2019-12-13 14:11:04 -0800 | [diff] [blame] | 495 | header_libs: [ |
| 496 | "bionic_libc_platform_headers", |
| 497 | "libdebuggerd_common_headers" |
| 498 | ], |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 499 | |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 500 | static_libs: [ |
| 501 | "libbase", |
| 502 | "libcutils", |
| 503 | "libevent", |
| 504 | "liblog", |
| 505 | ], |
Nikita Ioffe | 75be784 | 2022-10-24 15:31:11 +0100 | [diff] [blame] | 506 | } |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 507 | |
Nikita Ioffe | 75be784 | 2022-10-24 15:31:11 +0100 | [diff] [blame] | 508 | cc_binary { |
| 509 | name: "tombstoned", |
| 510 | defaults: ["tombstoned_defaults"], |
Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 511 | init_rc: ["tombstoned/tombstoned.rc"], |
Josh Gao | 9c02dc5 | 2016-06-15 17:29:00 -0700 | [diff] [blame] | 512 | } |
Ray Essick | bd3ba78 | 2020-01-21 15:21:08 -0800 | [diff] [blame] | 513 | |
Nikita Ioffe | 75be784 | 2022-10-24 15:31:11 +0100 | [diff] [blame] | 514 | cc_binary { |
| 515 | name: "tombstoned.microdroid", |
| 516 | defaults: ["tombstoned_defaults"], |
| 517 | init_rc: ["tombstoned/tombstoned.microdroid.rc"], |
| 518 | } |
| 519 | |
Ray Essick | bd3ba78 | 2020-01-21 15:21:08 -0800 | [diff] [blame] | 520 | prebuilt_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 Hughes | 2f88331 | 2022-11-14 20:02:28 +0000 | [diff] [blame] | 527 | required: [ |
| 528 | "crash_dump.policy_other", |
| 529 | ], |
Ray Essick | bd3ba78 | 2020-01-21 15:21:08 -0800 | [diff] [blame] | 530 | }, |
| 531 | arm64: { |
| 532 | src: "seccomp_policy/crash_dump.arm64.policy", |
Elliott Hughes | 2f88331 | 2022-11-14 20:02:28 +0000 | [diff] [blame] | 533 | required: [ |
| 534 | "crash_dump.policy_other", |
| 535 | ], |
Ray Essick | bd3ba78 | 2020-01-21 15:21:08 -0800 | [diff] [blame] | 536 | }, |
Chen Guoyin | a22af66 | 2022-10-12 22:32:55 +0800 | [diff] [blame] | 537 | riscv64: { |
| 538 | src: "seccomp_policy/crash_dump.riscv64.policy", |
| 539 | }, |
Ray Essick | bd3ba78 | 2020-01-21 15:21:08 -0800 | [diff] [blame] | 540 | x86: { |
| 541 | src: "seccomp_policy/crash_dump.x86.policy", |
Elliott Hughes | 2f88331 | 2022-11-14 20:02:28 +0000 | [diff] [blame] | 542 | required: [ |
| 543 | "crash_dump.policy_other", |
| 544 | ], |
Ray Essick | bd3ba78 | 2020-01-21 15:21:08 -0800 | [diff] [blame] | 545 | }, |
| 546 | x86_64: { |
| 547 | src: "seccomp_policy/crash_dump.x86_64.policy", |
Elliott Hughes | 2f88331 | 2022-11-14 20:02:28 +0000 | [diff] [blame] | 548 | required: [ |
| 549 | "crash_dump.policy_other", |
| 550 | ], |
Ray Essick | bd3ba78 | 2020-01-21 15:21:08 -0800 | [diff] [blame] | 551 | }, |
| 552 | }, |
Ray Essick | bd3ba78 | 2020-01-21 15:21:08 -0800 | [diff] [blame] | 553 | } |
| 554 | |
| 555 | |
Elliott Hughes | 2f88331 | 2022-11-14 20:02:28 +0000 | [diff] [blame] | 556 | // This installs the "other" architecture (so 32-bit on 64-bit device). |
Ray Essick | bd3ba78 | 2020-01-21 15:21:08 -0800 | [diff] [blame] | 557 | prebuilt_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 Hughes | 857e29c | 2023-03-20 15:48:30 -0700 | [diff] [blame] | 568 | riscv64: { |
| 569 | enabled: false, |
| 570 | }, |
Ray Essick | bd3ba78 | 2020-01-21 15:21:08 -0800 | [diff] [blame] | 571 | 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 | } |