blob: 2b5f4f6469059c0c893c3e10cb9cd50c2954028a [file] [log] [blame]
Josh Gaocbe70cb2016-10-18 18:17:52 -07001cc_defaults {
2 name: "debuggerd_defaults",
3 cflags: [
4 "-Wall",
5 "-Wextra",
Josh Gaoc7fe0602017-03-13 14:13:29 -07006 "-Werror",
Josh Gaocbe70cb2016-10-18 18:17:52 -07007 "-Wno-nullability-completeness",
8 "-Os",
9 ],
10
11 local_include_dirs: ["include"],
12}
13
Narayan Kamatha73df602017-05-24 15:07:25 +010014cc_library_headers {
15 name: "libdebuggerd_common_headers",
16 export_include_dirs: ["common/include"]
17}
18
Narayan Kamath2d377cd2017-05-10 10:58:59 +010019cc_library_shared {
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080020 name: "libtombstoned_client",
21 defaults: ["debuggerd_defaults"],
22 srcs: [
Narayan Kamath2d377cd2017-05-10 10:58:59 +010023 "tombstoned/tombstoned_client.cpp",
24 "util.cpp",
25 ],
26
Narayan Kamatha73df602017-05-24 15:07:25 +010027 header_libs: ["libdebuggerd_common_headers"],
28
Narayan Kamath2d377cd2017-05-10 10:58:59 +010029 static_libs: [
Narayan Kamatha73df602017-05-24 15:07:25 +010030 "libasync_safe",
Narayan Kamath2d377cd2017-05-10 10:58:59 +010031 ],
32
33 shared_libs: [
Narayan Kamath2d377cd2017-05-10 10:58:59 +010034 "libbase",
Narayan Kamatha73df602017-05-24 15:07:25 +010035 "libcutils",
Narayan Kamath2d377cd2017-05-10 10:58:59 +010036 ],
37
Narayan Kamatha73df602017-05-24 15:07:25 +010038 export_header_lib_headers: ["libdebuggerd_common_headers"],
Narayan Kamath2d377cd2017-05-10 10:58:59 +010039 export_include_dirs: ["tombstoned/include"]
40}
41
42// Utility library to tombstoned and get an output fd.
43cc_library_static {
44 name: "libtombstoned_client_static",
45 defaults: ["debuggerd_defaults"],
46 srcs: [
47 "tombstoned/tombstoned_client.cpp",
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080048 "util.cpp",
49 ],
50
Narayan Kamatha73df602017-05-24 15:07:25 +010051 header_libs: ["libdebuggerd_common_headers"],
52
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080053 whole_static_libs: [
Christopher Ferrisac225782017-04-25 11:23:10 -070054 "libasync_safe",
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080055 "libcutils",
56 "libbase",
57 ],
Narayan Kamath2d377cd2017-05-10 10:58:59 +010058
Narayan Kamatha73df602017-05-24 15:07:25 +010059 export_header_lib_headers: ["libdebuggerd_common_headers"],
Narayan Kamath2d377cd2017-05-10 10:58:59 +010060 export_include_dirs: ["tombstoned/include"]
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080061}
62
63// Core implementation, linked into libdebuggerd_handler and the dynamic linker.
Josh Gao9c02dc52016-06-15 17:29:00 -070064cc_library_static {
Josh Gaoe73c9322017-02-08 16:06:26 -080065 name: "libdebuggerd_handler_core",
Josh Gaocbe70cb2016-10-18 18:17:52 -070066 defaults: ["debuggerd_defaults"],
67 srcs: ["handler/debuggerd_handler.cpp"],
Josh Gao9c02dc52016-06-15 17:29:00 -070068
Josh Gaofdf832d2017-08-25 18:00:18 -070069 header_libs: [
70 "libbase_headers",
71 "libdebuggerd_common_headers",
72 ],
Narayan Kamatha73df602017-05-24 15:07:25 +010073
Josh Gaoe73c9322017-02-08 16:06:26 -080074 whole_static_libs: [
Christopher Ferrisac225782017-04-25 11:23:10 -070075 "libasync_safe",
Josh Gaoe73c9322017-02-08 16:06:26 -080076 "libdebuggerd",
77 ],
78
Narayan Kamatha73df602017-05-24 15:07:25 +010079 export_header_lib_headers: ["libdebuggerd_common_headers"],
Josh Gaoe73c9322017-02-08 16:06:26 -080080 export_include_dirs: ["include"],
81}
82
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080083// Implementation with a no-op fallback.
Josh Gaoe73c9322017-02-08 16:06:26 -080084cc_library_static {
85 name: "libdebuggerd_handler",
86 defaults: ["debuggerd_defaults"],
87 srcs: ["handler/debuggerd_fallback_nop.cpp"],
88
89 whole_static_libs: [
90 "libdebuggerd_handler_core",
91 ],
92
93 export_include_dirs: ["include"],
94}
95
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080096// Fallback implementation.
Josh Gaoe73c9322017-02-08 16:06:26 -080097cc_library_static {
98 name: "libdebuggerd_handler_fallback",
99 defaults: ["debuggerd_defaults"],
Josh Gaoe1aa0ca2017-03-01 17:23:22 -0800100 srcs: [
101 "handler/debuggerd_fallback.cpp",
102 ],
Josh Gaoe73c9322017-02-08 16:06:26 -0800103
Josh Gaoe1aa0ca2017-03-01 17:23:22 -0800104 whole_static_libs: [
105 "libdebuggerd_handler_core",
Narayan Kamath2d377cd2017-05-10 10:58:59 +0100106 "libtombstoned_client_static",
Christopher Ferrisac225782017-04-25 11:23:10 -0700107 "libasync_safe",
Josh Gaoe1aa0ca2017-03-01 17:23:22 -0800108 "libbase",
Josh Gaoe73c9322017-02-08 16:06:26 -0800109 "libdebuggerd",
110 "libbacktrace",
111 "libunwind",
Christopher Ferris9a8c8552017-08-11 15:29:19 -0700112 "libunwindstack",
Josh Gaoe73c9322017-02-08 16:06:26 -0800113 "liblzma",
114 "libcutils",
115 ],
Josh Gao9c02dc52016-06-15 17:29:00 -0700116
Josh Gaocbe70cb2016-10-18 18:17:52 -0700117 export_include_dirs: ["include"],
118}
119
120cc_library {
121 name: "libdebuggerd_client",
122 defaults: ["debuggerd_defaults"],
123 srcs: [
124 "client/debuggerd_client.cpp",
125 "util.cpp",
126 ],
127
Narayan Kamatha73df602017-05-24 15:07:25 +0100128 header_libs: ["libdebuggerd_common_headers"],
129
Josh Gaocbe70cb2016-10-18 18:17:52 -0700130 shared_libs: [
131 "libbase",
132 "libcutils",
133 ],
Josh Gaoe1aa0ca2017-03-01 17:23:22 -0800134
Narayan Kamatha73df602017-05-24 15:07:25 +0100135 export_header_lib_headers: ["libdebuggerd_common_headers"],
Josh Gaocbe70cb2016-10-18 18:17:52 -0700136 export_include_dirs: ["include"],
137}
138
Josh Gaoe73c9322017-02-08 16:06:26 -0800139cc_library_static {
Josh Gaocbe70cb2016-10-18 18:17:52 -0700140 name: "libdebuggerd",
141 defaults: ["debuggerd_defaults"],
142
143 srcs: [
144 "libdebuggerd/backtrace.cpp",
145 "libdebuggerd/elf_utils.cpp",
146 "libdebuggerd/open_files_list.cpp",
147 "libdebuggerd/tombstone.cpp",
148 "libdebuggerd/utility.cpp",
149 ],
150
151 target: {
152 android_arm: {
153 srcs: ["libdebuggerd/arm/machine.cpp"],
154 },
155 android_arm64: {
156 srcs: ["libdebuggerd/arm64/machine.cpp"],
157 },
158 android_mips: {
159 srcs: ["libdebuggerd/mips/machine.cpp"],
160 },
161 android_mips64: {
162 srcs: ["libdebuggerd/mips64/machine.cpp"],
163 },
164 android_x86: {
165 srcs: ["libdebuggerd/x86/machine.cpp"],
166 },
167 android_x86_64: {
168 srcs: ["libdebuggerd/x86_64/machine.cpp"],
169 },
Robert Sesek9eb02c92016-08-09 14:04:05 -0400170 },
Robert Sesek9eb02c92016-08-09 14:04:05 -0400171
Josh Gaocbe70cb2016-10-18 18:17:52 -0700172 local_include_dirs: ["libdebuggerd/include"],
173 export_include_dirs: ["libdebuggerd/include"],
Josh Gao9c02dc52016-06-15 17:29:00 -0700174
Josh Gaoe73c9322017-02-08 16:06:26 -0800175 static_libs: [
Josh Gaocbe70cb2016-10-18 18:17:52 -0700176 "libbacktrace",
Josh Gaoe73c9322017-02-08 16:06:26 -0800177 "libunwind",
Christopher Ferris9a8c8552017-08-11 15:29:19 -0700178 "libunwindstack",
Josh Gaoe73c9322017-02-08 16:06:26 -0800179 "liblzma",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700180 "libbase",
181 "libcutils",
182 "liblog",
183 ],
184}
185
186cc_test {
187 name: "debuggerd_test",
188 defaults: ["debuggerd_defaults"],
189
190 cflags: ["-Wno-missing-field-initializers"],
191 srcs: [
192 "libdebuggerd/test/dump_memory_test.cpp",
193 "libdebuggerd/test/elf_fake.cpp",
194 "libdebuggerd/test/log_fake.cpp",
195 "libdebuggerd/test/open_files_list_test.cpp",
196 "libdebuggerd/test/property_fake.cpp",
197 "libdebuggerd/test/ptrace_fake.cpp",
198 "libdebuggerd/test/tombstone_test.cpp",
199 ],
200
201 target: {
202 android: {
203 srcs: [
Josh Gaoae9d7672017-03-24 16:26:03 -0700204 "client/debuggerd_client_test.cpp",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700205 "debuggerd_test.cpp",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700206 ],
Narayan Kamath2d377cd2017-05-10 10:58:59 +0100207 static_libs: ["libasync_safe", "libtombstoned_client_static"],
Josh Gaocbe70cb2016-10-18 18:17:52 -0700208 },
209 },
210
211 shared_libs: [
212 "libbacktrace",
213 "libbase",
214 "libcutils",
Josh Gaoae9d7672017-03-24 16:26:03 -0700215 "libdebuggerd_client",
Narayan Kamatha73df602017-05-24 15:07:25 +0100216 "liblog",
217 "libnativehelper"
Josh Gaocbe70cb2016-10-18 18:17:52 -0700218 ],
219
220 static_libs: [
Josh Gao352a8452017-03-30 16:46:21 -0700221 "libdebuggerd",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700222 ],
223
224 local_include_dirs: [
225 "libdebuggerd",
226 ],
227
228 compile_multilib: "both",
229 multilib: {
230 lib32: {
231 stem: "debuggerd_test32",
232 },
233 lib64: {
234 stem: "debuggerd_test64",
235 },
236 },
237}
238
239cc_binary {
240 name: "crash_dump",
241 srcs: [
242 "crash_dump.cpp",
243 "util.cpp",
244 ],
245 defaults: ["debuggerd_defaults"],
246
247 compile_multilib: "both",
248 multilib: {
249 lib32: {
250 suffix: "32",
251 },
252 lib64: {
253 suffix: "64",
254 },
255 },
256
Josh Gaoe73c9322017-02-08 16:06:26 -0800257 static_libs: [
Narayan Kamath2d377cd2017-05-10 10:58:59 +0100258 "libtombstoned_client_static",
Josh Gaoe73c9322017-02-08 16:06:26 -0800259 "libdebuggerd",
260 "libcutils",
261 ],
262
Josh Gaocbe70cb2016-10-18 18:17:52 -0700263 shared_libs: [
264 "libbacktrace",
265 "libbase",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700266 "liblog",
267 "libprocinfo",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700268 ],
269}
270
271cc_binary {
272 name: "debuggerd",
273 srcs: [
274 "debuggerd.cpp",
275 ],
276 defaults: ["debuggerd_defaults"],
277
278 shared_libs: [
279 "libbase",
280 "libdebuggerd_client",
281 "liblog",
Josh Gao0915f232017-06-27 14:08:05 -0700282 "libprocinfo",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700283 ],
284
285 local_include_dirs: ["include"],
286}
287
288cc_binary {
289 name: "tombstoned",
290 srcs: [
291 "util.cpp",
292 "tombstoned/intercept_manager.cpp",
293 "tombstoned/tombstoned.cpp",
294 ],
295 defaults: ["debuggerd_defaults"],
296
Narayan Kamatha73df602017-05-24 15:07:25 +0100297 header_libs: ["libdebuggerd_common_headers"],
298
Josh Gaocbe70cb2016-10-18 18:17:52 -0700299 static_libs: [
300 "libbase",
301 "libcutils",
302 "libevent",
303 "liblog",
304 ],
305
306 init_rc: ["tombstoned/tombstoned.rc"]
Josh Gao9c02dc52016-06-15 17:29:00 -0700307}
Elliott Hughes0ba53592017-02-01 16:59:15 -0800308
309subdirs = [
310 "crasher",
311]