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