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