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