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