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", |
| 183 | "libdebuggerd/tombstone.cpp", |
Josh Gao | 76e1e30 | 2021-01-26 15:53:11 -0800 | [diff] [blame] | 184 | "libdebuggerd/tombstone_proto.cpp", |
| 185 | "libdebuggerd/tombstone_proto_to_text.cpp", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 186 | "libdebuggerd/utility.cpp", |
| 187 | ], |
| 188 | |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 189 | local_include_dirs: ["libdebuggerd/include"], |
| 190 | export_include_dirs: ["libdebuggerd/include"], |
Josh Gao | 9c02dc5 | 2016-06-15 17:29:00 -0700 | [diff] [blame] | 191 | |
Peter Collingbourne | f862252 | 2020-04-07 14:07:32 -0700 | [diff] [blame] | 192 | include_dirs: [ |
| 193 | // Needed for private/bionic_fdsan.h |
| 194 | "bionic/libc", |
Peter Collingbourne | f862252 | 2020-04-07 14:07:32 -0700 | [diff] [blame] | 195 | ], |
Mitch Phillips | e0b4bb1 | 2020-02-14 14:54:31 -0800 | [diff] [blame] | 196 | header_libs: [ |
| 197 | "bionic_libc_platform_headers", |
| 198 | "gwp_asan_headers", |
| 199 | ], |
Josh Gao | ce841d9 | 2018-08-06 18:26:42 -0700 | [diff] [blame] | 200 | |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 201 | static_libs: [ |
Martin Stjernholm | a2cc893 | 2019-10-23 21:32:43 +0100 | [diff] [blame] | 202 | "libdexfile_support", // libunwindstack dependency |
Christopher Ferris | 9a8c855 | 2017-08-11 15:29:19 -0700 | [diff] [blame] | 203 | "libunwindstack", |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 204 | "liblzma", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 205 | "libbase", |
| 206 | "libcutils", |
| 207 | "liblog", |
| 208 | ], |
Martin Stjernholm | 3784b9d | 2021-08-26 21:18:43 +0100 | [diff] [blame] | 209 | runtime_libs: [ |
| 210 | "libdexfile", // libdexfile_support dependency |
| 211 | ], |
Josh Gao | a48b41b | 2019-12-13 14:11:04 -0800 | [diff] [blame] | 212 | |
Peter Collingbourne | f862252 | 2020-04-07 14:07:32 -0700 | [diff] [blame] | 213 | whole_static_libs: [ |
Josh Gao | 618cea3 | 2021-01-26 17:45:43 -0800 | [diff] [blame] | 214 | "libasync_safe", |
Peter Collingbourne | f862252 | 2020-04-07 14:07:32 -0700 | [diff] [blame] | 215 | "gwp_asan_crash_handler", |
Josh Gao | 76e1e30 | 2021-01-26 15:53:11 -0800 | [diff] [blame] | 216 | "libtombstone_proto", |
Josh Gao | dbb83de | 2021-03-01 23:13:13 -0800 | [diff] [blame] | 217 | "libprocinfo", |
Josh Gao | 76e1e30 | 2021-01-26 15:53:11 -0800 | [diff] [blame] | 218 | "libprotobuf-cpp-lite", |
Peter Collingbourne | f862252 | 2020-04-07 14:07:32 -0700 | [diff] [blame] | 219 | ], |
Mitch Phillips | e0b4bb1 | 2020-02-14 14:54:31 -0800 | [diff] [blame] | 220 | |
Martin Stjernholm | bb4f2b4 | 2018-12-19 14:28:33 +0000 | [diff] [blame] | 221 | target: { |
| 222 | recovery: { |
| 223 | exclude_static_libs: [ |
Martin Stjernholm | a2cc893 | 2019-10-23 21:32:43 +0100 | [diff] [blame] | 224 | "libdexfile_support", |
Martin Stjernholm | bb4f2b4 | 2018-12-19 14:28:33 +0000 | [diff] [blame] | 225 | ], |
Martin Stjernholm | 3784b9d | 2021-08-26 21:18:43 +0100 | [diff] [blame] | 226 | exclude_runtime_libs: [ |
| 227 | "libdexfile", |
| 228 | ], |
Martin Stjernholm | bb4f2b4 | 2018-12-19 14:28:33 +0000 | [diff] [blame] | 229 | }, |
Yifan Hong | 2ec92cf | 2020-10-27 16:25:45 -0700 | [diff] [blame] | 230 | vendor_ramdisk: { |
| 231 | exclude_static_libs: [ |
| 232 | "libdexfile_support", |
| 233 | ], |
Martin Stjernholm | 3784b9d | 2021-08-26 21:18:43 +0100 | [diff] [blame] | 234 | exclude_runtime_libs: [ |
| 235 | "libdexfile", |
| 236 | ], |
Yifan Hong | 2ec92cf | 2020-10-27 16:25:45 -0700 | [diff] [blame] | 237 | }, |
Martin Stjernholm | bb4f2b4 | 2018-12-19 14:28:33 +0000 | [diff] [blame] | 238 | }, |
Christopher Ferris | 4ae266c | 2019-04-03 09:27:12 -0700 | [diff] [blame] | 239 | |
| 240 | product_variables: { |
| 241 | debuggable: { |
| 242 | cflags: ["-DROOT_POSSIBLE"], |
| 243 | }, |
Christopher Ferris | 7aad256 | 2021-09-24 00:06:38 -0700 | [diff] [blame] | 244 | |
| 245 | malloc_not_svelte: { |
| 246 | cflags: ["-DUSE_SCUDO"], |
| 247 | whole_static_libs: ["libscudo"], |
| 248 | srcs: ["libdebuggerd/scudo.cpp"], |
| 249 | header_libs: ["scudo_headers"], |
| 250 | }, |
Christopher Ferris | 4ae266c | 2019-04-03 09:27:12 -0700 | [diff] [blame] | 251 | }, |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 252 | } |
| 253 | |
Josh Gao | 76e1e30 | 2021-01-26 15:53:11 -0800 | [diff] [blame] | 254 | cc_binary { |
| 255 | name: "pbtombstone", |
| 256 | defaults: ["debuggerd_defaults"], |
| 257 | srcs: ["pbtombstone.cpp"], |
| 258 | static_libs: [ |
| 259 | "libbase", |
| 260 | "libdebuggerd", |
| 261 | "liblog", |
| 262 | "libprotobuf-cpp-lite", |
| 263 | "libtombstone_proto", |
| 264 | "libunwindstack", |
| 265 | ], |
| 266 | } |
| 267 | |
Christopher Ferris | fe751c5 | 2021-04-16 09:40:40 -0700 | [diff] [blame] | 268 | cc_test_library { |
| 269 | name: "libcrash_test", |
| 270 | defaults: ["debuggerd_defaults"], |
| 271 | srcs: ["crash_test.cpp"], |
| 272 | } |
| 273 | |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 274 | cc_test { |
| 275 | name: "debuggerd_test", |
| 276 | defaults: ["debuggerd_defaults"], |
Josh Gao | 6cad139 | 2019-08-27 16:02:38 -0700 | [diff] [blame] | 277 | require_root: true, |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 278 | |
| 279 | cflags: ["-Wno-missing-field-initializers"], |
| 280 | srcs: [ |
| 281 | "libdebuggerd/test/dump_memory_test.cpp", |
| 282 | "libdebuggerd/test/elf_fake.cpp", |
| 283 | "libdebuggerd/test/log_fake.cpp", |
| 284 | "libdebuggerd/test/open_files_list_test.cpp", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 285 | "libdebuggerd/test/tombstone_test.cpp", |
Peter Collingbourne | 47d784e | 2021-11-05 18:40:52 -0700 | [diff] [blame] | 286 | "libdebuggerd/test/utility_test.cpp", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 287 | ], |
| 288 | |
| 289 | target: { |
| 290 | android: { |
| 291 | srcs: [ |
Josh Gao | ae9d767 | 2017-03-24 16:26:03 -0700 | [diff] [blame] | 292 | "client/debuggerd_client_test.cpp", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 293 | "debuggerd_test.cpp", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 294 | ], |
Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 295 | static_libs: [ |
| 296 | "libasync_safe", |
| 297 | "libtombstoned_client_static", |
| 298 | ], |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 299 | }, |
| 300 | }, |
| 301 | |
| 302 | shared_libs: [ |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 303 | "libbase", |
| 304 | "libcutils", |
Josh Gao | ae9d767 | 2017-03-24 16:26:03 -0700 | [diff] [blame] | 305 | "libdebuggerd_client", |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 306 | "liblog", |
Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 307 | "libnativehelper", |
Martin Stjernholm | 852b64e | 2019-02-20 17:01:24 +0000 | [diff] [blame] | 308 | "libunwindstack", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 309 | ], |
| 310 | |
| 311 | static_libs: [ |
Josh Gao | 352a845 | 2017-03-30 16:46:21 -0700 | [diff] [blame] | 312 | "libdebuggerd", |
Mitch Phillips | e0b4bb1 | 2020-02-14 14:54:31 -0800 | [diff] [blame] | 313 | "libgmock", |
Peter Collingbourne | d00a577 | 2020-07-20 23:11:16 -0700 | [diff] [blame] | 314 | "libminijail", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 315 | ], |
| 316 | |
Josh Gao | a48b41b | 2019-12-13 14:11:04 -0800 | [diff] [blame] | 317 | header_libs: [ |
| 318 | "bionic_libc_platform_headers", |
Mitch Phillips | e0b4bb1 | 2020-02-14 14:54:31 -0800 | [diff] [blame] | 319 | "gwp_asan_headers", |
Josh Gao | a48b41b | 2019-12-13 14:11:04 -0800 | [diff] [blame] | 320 | ], |
| 321 | |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 322 | local_include_dirs: [ |
| 323 | "libdebuggerd", |
| 324 | ], |
| 325 | |
| 326 | compile_multilib: "both", |
| 327 | multilib: { |
| 328 | lib32: { |
| 329 | stem: "debuggerd_test32", |
| 330 | }, |
| 331 | lib64: { |
| 332 | stem: "debuggerd_test64", |
| 333 | }, |
| 334 | }, |
Elliott Hughes | 40fdf3f | 2018-04-27 16:12:06 -0700 | [diff] [blame] | 335 | |
Christopher Ferris | fe751c5 | 2021-04-16 09:40:40 -0700 | [diff] [blame] | 336 | data: [ |
| 337 | ":libcrash_test", |
| 338 | ], |
| 339 | |
Elliott Hughes | 40fdf3f | 2018-04-27 16:12:06 -0700 | [diff] [blame] | 340 | test_suites: ["device-tests"], |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 341 | } |
| 342 | |
Josh Gao | a42314e | 2017-12-19 15:08:19 -0800 | [diff] [blame] | 343 | cc_benchmark { |
| 344 | name: "debuggerd_benchmark", |
| 345 | defaults: ["debuggerd_defaults"], |
| 346 | srcs: ["debuggerd_benchmark.cpp"], |
| 347 | shared_libs: [ |
| 348 | "libbase", |
| 349 | "libdebuggerd_client", |
| 350 | ], |
| 351 | } |
| 352 | |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 353 | cc_binary { |
| 354 | name: "crash_dump", |
| 355 | srcs: [ |
| 356 | "crash_dump.cpp", |
| 357 | "util.cpp", |
| 358 | ], |
| 359 | defaults: ["debuggerd_defaults"], |
| 360 | |
| 361 | compile_multilib: "both", |
| 362 | multilib: { |
| 363 | lib32: { |
| 364 | suffix: "32", |
| 365 | }, |
| 366 | lib64: { |
| 367 | suffix: "64", |
| 368 | }, |
| 369 | }, |
| 370 | |
Josh Gao | a48b41b | 2019-12-13 14:11:04 -0800 | [diff] [blame] | 371 | header_libs: [ |
| 372 | "bionic_libc_platform_headers", |
| 373 | ], |
| 374 | |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 375 | static_libs: [ |
Narayan Kamath | 2d377cd | 2017-05-10 10:58:59 +0100 | [diff] [blame] | 376 | "libtombstoned_client_static", |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 377 | "libdebuggerd", |
| 378 | "libcutils", |
Josh Gao | 76e1e30 | 2021-01-26 15:53:11 -0800 | [diff] [blame] | 379 | |
| 380 | "libtombstone_proto", |
| 381 | "libprotobuf-cpp-lite", |
Josh Gao | e73c932 | 2017-02-08 16:06:26 -0800 | [diff] [blame] | 382 | ], |
| 383 | |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 384 | shared_libs: [ |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 385 | "libbase", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 386 | "liblog", |
| 387 | "libprocinfo", |
Josh Gao | 2b2ae0c | 2017-08-21 14:31:17 -0700 | [diff] [blame] | 388 | "libunwindstack", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 389 | ], |
Peter Collingbourne | b72e748 | 2020-03-16 18:14:13 -0700 | [diff] [blame] | 390 | |
| 391 | apex_available: [ |
| 392 | "com.android.runtime", |
| 393 | ], |
Peter Collingbourne | a2739da | 2022-02-02 17:00:42 -0800 | [diff] [blame^] | 394 | |
| 395 | // Required for tests. |
| 396 | required: ["crash_dump.policy"], |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 397 | } |
| 398 | |
| 399 | cc_binary { |
| 400 | name: "debuggerd", |
| 401 | srcs: [ |
| 402 | "debuggerd.cpp", |
| 403 | ], |
| 404 | defaults: ["debuggerd_defaults"], |
| 405 | |
| 406 | shared_libs: [ |
| 407 | "libbase", |
| 408 | "libdebuggerd_client", |
| 409 | "liblog", |
Josh Gao | 0915f23 | 2017-06-27 14:08:05 -0700 | [diff] [blame] | 410 | "libprocinfo", |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 411 | ], |
| 412 | |
| 413 | local_include_dirs: ["include"], |
| 414 | } |
| 415 | |
| 416 | cc_binary { |
| 417 | name: "tombstoned", |
| 418 | srcs: [ |
| 419 | "util.cpp", |
| 420 | "tombstoned/intercept_manager.cpp", |
| 421 | "tombstoned/tombstoned.cpp", |
| 422 | ], |
| 423 | defaults: ["debuggerd_defaults"], |
| 424 | |
Josh Gao | a48b41b | 2019-12-13 14:11:04 -0800 | [diff] [blame] | 425 | header_libs: [ |
| 426 | "bionic_libc_platform_headers", |
| 427 | "libdebuggerd_common_headers" |
| 428 | ], |
Narayan Kamath | a73df60 | 2017-05-24 15:07:25 +0100 | [diff] [blame] | 429 | |
Josh Gao | cbe70cb | 2016-10-18 18:17:52 -0700 | [diff] [blame] | 430 | static_libs: [ |
| 431 | "libbase", |
| 432 | "libcutils", |
| 433 | "libevent", |
| 434 | "liblog", |
| 435 | ], |
| 436 | |
Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 437 | init_rc: ["tombstoned/tombstoned.rc"], |
Josh Gao | 9c02dc5 | 2016-06-15 17:29:00 -0700 | [diff] [blame] | 438 | } |
Ray Essick | bd3ba78 | 2020-01-21 15:21:08 -0800 | [diff] [blame] | 439 | |
| 440 | prebuilt_etc { |
| 441 | name: "crash_dump.policy", |
| 442 | sub_dir: "seccomp_policy", |
| 443 | filename_from_src: true, |
| 444 | arch: { |
| 445 | arm: { |
| 446 | src: "seccomp_policy/crash_dump.arm.policy", |
| 447 | }, |
| 448 | arm64: { |
| 449 | src: "seccomp_policy/crash_dump.arm64.policy", |
| 450 | }, |
| 451 | x86: { |
| 452 | src: "seccomp_policy/crash_dump.x86.policy", |
| 453 | }, |
| 454 | x86_64: { |
| 455 | src: "seccomp_policy/crash_dump.x86_64.policy", |
| 456 | }, |
| 457 | }, |
| 458 | required: [ |
| 459 | "crash_dump.policy_other", |
| 460 | ], |
| 461 | } |
| 462 | |
| 463 | |
| 464 | // NB -- this installs "the other" architecture. (puts 32 bit config in on 64 bit device) |
| 465 | // or at least that is the intention so that we get both of them populated |
| 466 | prebuilt_etc { |
| 467 | name: "crash_dump.policy_other", |
| 468 | sub_dir: "seccomp_policy", |
| 469 | filename_from_src: true, |
| 470 | arch: { |
| 471 | arm: { |
| 472 | src: "seccomp_policy/crash_dump.arm64.policy", |
| 473 | }, |
| 474 | arm64: { |
| 475 | src: "seccomp_policy/crash_dump.arm.policy", |
| 476 | }, |
| 477 | x86: { |
| 478 | src: "seccomp_policy/crash_dump.x86_64.policy", |
| 479 | }, |
| 480 | x86_64: { |
| 481 | src: "seccomp_policy/crash_dump.x86.policy", |
| 482 | }, |
| 483 | }, |
| 484 | } |