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