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