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