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