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