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