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