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