1 cc_defaults { 2 name: "debuggerd_defaults", 3 cflags: [ 4 "-Wall", 5 "-Wextra", 6 "-Werror", 7 "-Wno-unused-argument", 8 "-Wno-unused-function", 9 "-Wno-nullability-completeness", 10 "-Os", 11 ], 12 cpp_std: "gnu++17", 13 14 local_include_dirs: ["include"], 15 } 16 17 cc_library_headers { 18 name: "libdebuggerd_common_headers", 19 export_include_dirs: ["common/include"], 20 } 21 22 cc_library_shared { 23 name: "libtombstoned_client", 24 defaults: ["debuggerd_defaults"], 25 srcs: [ 26 "tombstoned/tombstoned_client.cpp", 27 "util.cpp", 28 ], 29 30 header_libs: ["libdebuggerd_common_headers"], 31 32 static_libs: [ 33 "libasync_safe", 34 ], 35 36 shared_libs: [ 37 "libbase", 38 "libcutils", 39 ], 40 41 export_header_lib_headers: ["libdebuggerd_common_headers"], 42 export_include_dirs: ["tombstoned/include"], 43 } 44 45 // Utility library to tombstoned and get an output fd. 46 cc_library_static { 47 name: "libtombstoned_client_static", 48 defaults: ["debuggerd_defaults"], 49 srcs: [ 50 "tombstoned/tombstoned_client.cpp", 51 "util.cpp", 52 ], 53 54 header_libs: ["libdebuggerd_common_headers"], 55 56 whole_static_libs: [ 57 "libasync_safe", 58 "libcutils", 59 "libbase", 60 ], 61 62 export_header_lib_headers: ["libdebuggerd_common_headers"], 63 export_include_dirs: ["tombstoned/include"], 64 } 65 66 // Core implementation, linked into libdebuggerd_handler and the dynamic linker. 67 cc_library_static { 68 name: "libdebuggerd_handler_core", 69 defaults: ["debuggerd_defaults"], 70 srcs: ["handler/debuggerd_handler.cpp"], 71 72 header_libs: [ 73 "libbase_headers", 74 "libdebuggerd_common_headers", 75 ], 76 77 whole_static_libs: [ 78 "libasync_safe", 79 "libcutils", 80 "libdebuggerd", 81 ], 82 83 export_header_lib_headers: ["libdebuggerd_common_headers"], 84 export_include_dirs: ["include"], 85 } 86 87 // Implementation with a no-op fallback. 88 cc_library_static { 89 name: "libdebuggerd_handler", 90 defaults: ["debuggerd_defaults"], 91 srcs: ["handler/debuggerd_fallback_nop.cpp"], 92 93 whole_static_libs: [ 94 "libdebuggerd_handler_core", 95 ], 96 97 export_include_dirs: ["include"], 98 } 99 100 // Fallback implementation. 101 cc_library_static { 102 name: "libdebuggerd_handler_fallback", 103 defaults: ["debuggerd_defaults"], 104 srcs: [ 105 "handler/debuggerd_fallback.cpp", 106 ], 107 108 whole_static_libs: [ 109 "libdebuggerd_handler_core", 110 "libtombstoned_client_static", 111 "libasync_safe", 112 "libbase", 113 "libdebuggerd", 114 "libbacktrace", 115 "libunwind", 116 "libunwindstack", 117 "libdexfile", 118 "liblzma", 119 "libcutils", 120 ], 121 122 export_include_dirs: ["include"], 123 } 124 125 cc_library { 126 name: "libdebuggerd_client", 127 defaults: ["debuggerd_defaults"], 128 srcs: [ 129 "client/debuggerd_client.cpp", 130 "util.cpp", 131 ], 132 133 header_libs: ["libdebuggerd_common_headers"], 134 135 shared_libs: [ 136 "libbase", 137 "libcutils", 138 ], 139 140 export_header_lib_headers: ["libdebuggerd_common_headers"], 141 export_include_dirs: ["include"], 142 } 143 144 cc_library_static { 145 name: "libdebuggerd", 146 defaults: ["debuggerd_defaults"], 147 148 srcs: [ 149 "libdebuggerd/backtrace.cpp", 150 "libdebuggerd/elf_utils.cpp", 151 "libdebuggerd/open_files_list.cpp", 152 "libdebuggerd/tombstone.cpp", 153 "libdebuggerd/utility.cpp", 154 ], 155 156 local_include_dirs: ["libdebuggerd/include"], 157 export_include_dirs: ["libdebuggerd/include"], 158 159 static_libs: [ 160 "libbacktrace", 161 "libunwind", 162 "libunwindstack", 163 "liblzma", 164 "libbase", 165 "libcutils", 166 "liblog", 167 ], 168 } 169 170 cc_test { 171 name: "debuggerd_test", 172 defaults: ["debuggerd_defaults"], 173 174 cflags: ["-Wno-missing-field-initializers"], 175 srcs: [ 176 "libdebuggerd/test/dump_memory_test.cpp", 177 "libdebuggerd/test/elf_fake.cpp", 178 "libdebuggerd/test/log_fake.cpp", 179 "libdebuggerd/test/open_files_list_test.cpp", 180 "libdebuggerd/test/tombstone_test.cpp", 181 ], 182 183 target: { 184 android: { 185 srcs: [ 186 "client/debuggerd_client_test.cpp", 187 "debuggerd_test.cpp", 188 ], 189 static_libs: [ 190 "libasync_safe", 191 "libtombstoned_client_static", 192 ], 193 }, 194 }, 195 196 shared_libs: [ 197 "libbacktrace", 198 "libbase", 199 "libcutils", 200 "libdebuggerd_client", 201 "liblog", 202 "libminijail", 203 "libnativehelper", 204 ], 205 206 static_libs: [ 207 "libdebuggerd", 208 "libunwindstack", 209 ], 210 211 local_include_dirs: [ 212 "libdebuggerd", 213 ], 214 215 compile_multilib: "both", 216 multilib: { 217 lib32: { 218 stem: "debuggerd_test32", 219 }, 220 lib64: { 221 stem: "debuggerd_test64", 222 }, 223 }, 224 } 225 226 cc_benchmark { 227 name: "debuggerd_benchmark", 228 defaults: ["debuggerd_defaults"], 229 srcs: ["debuggerd_benchmark.cpp"], 230 shared_libs: [ 231 "libbase", 232 "libdebuggerd_client", 233 ], 234 } 235 236 cc_binary { 237 name: "crash_dump", 238 srcs: [ 239 "crash_dump.cpp", 240 "util.cpp", 241 ], 242 defaults: ["debuggerd_defaults"], 243 244 compile_multilib: "both", 245 multilib: { 246 lib32: { 247 suffix: "32", 248 }, 249 lib64: { 250 suffix: "64", 251 }, 252 }, 253 254 static_libs: [ 255 "libtombstoned_client_static", 256 "libdebuggerd", 257 "libcutils", 258 ], 259 260 shared_libs: [ 261 "libbacktrace", 262 "libbase", 263 "liblog", 264 "libprocinfo", 265 "libunwindstack", 266 ], 267 } 268 269 cc_binary { 270 name: "debuggerd", 271 srcs: [ 272 "debuggerd.cpp", 273 ], 274 defaults: ["debuggerd_defaults"], 275 276 shared_libs: [ 277 "libbase", 278 "libdebuggerd_client", 279 "liblog", 280 "libprocinfo", 281 ], 282 283 local_include_dirs: ["include"], 284 } 285 286 cc_binary { 287 name: "tombstoned", 288 srcs: [ 289 "util.cpp", 290 "tombstoned/intercept_manager.cpp", 291 "tombstoned/tombstoned.cpp", 292 ], 293 defaults: ["debuggerd_defaults"], 294 295 header_libs: ["libdebuggerd_common_headers"], 296 297 static_libs: [ 298 "libbase", 299 "libcutils", 300 "libevent", 301 "liblog", 302 ], 303 304 init_rc: ["tombstoned/tombstoned.rc"], 305 } 306 307 subdirs = [ 308 "crasher", 309 ] 310