blob: 17a9f3a7cfb53092f505ade9d7f1df3f170a48c5 [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",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700196 "libdebuggerd/test/ptrace_fake.cpp",
197 "libdebuggerd/test/tombstone_test.cpp",
198 ],
199
200 target: {
201 android: {
202 srcs: [
Josh Gaoae9d7672017-03-24 16:26:03 -0700203 "client/debuggerd_client_test.cpp",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700204 "debuggerd_test.cpp",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700205 ],
Narayan Kamath2d377cd2017-05-10 10:58:59 +0100206 static_libs: ["libasync_safe", "libtombstoned_client_static"],
Josh Gaocbe70cb2016-10-18 18:17:52 -0700207 },
208 },
209
210 shared_libs: [
211 "libbacktrace",
212 "libbase",
213 "libcutils",
Josh Gaoae9d7672017-03-24 16:26:03 -0700214 "libdebuggerd_client",
Narayan Kamatha73df602017-05-24 15:07:25 +0100215 "liblog",
216 "libnativehelper"
Josh Gaocbe70cb2016-10-18 18:17:52 -0700217 ],
218
219 static_libs: [
Josh Gao352a8452017-03-30 16:46:21 -0700220 "libdebuggerd",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700221 ],
222
223 local_include_dirs: [
224 "libdebuggerd",
225 ],
226
227 compile_multilib: "both",
228 multilib: {
229 lib32: {
230 stem: "debuggerd_test32",
231 },
232 lib64: {
233 stem: "debuggerd_test64",
234 },
235 },
236}
237
238cc_binary {
239 name: "crash_dump",
240 srcs: [
241 "crash_dump.cpp",
242 "util.cpp",
243 ],
244 defaults: ["debuggerd_defaults"],
245
246 compile_multilib: "both",
247 multilib: {
248 lib32: {
249 suffix: "32",
250 },
251 lib64: {
252 suffix: "64",
253 },
254 },
255
Josh Gaoe73c9322017-02-08 16:06:26 -0800256 static_libs: [
Narayan Kamath2d377cd2017-05-10 10:58:59 +0100257 "libtombstoned_client_static",
Josh Gaoe73c9322017-02-08 16:06:26 -0800258 "libdebuggerd",
259 "libcutils",
260 ],
261
Josh Gaocbe70cb2016-10-18 18:17:52 -0700262 shared_libs: [
263 "libbacktrace",
264 "libbase",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700265 "liblog",
266 "libprocinfo",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700267 ],
268}
269
270cc_binary {
271 name: "debuggerd",
272 srcs: [
273 "debuggerd.cpp",
274 ],
275 defaults: ["debuggerd_defaults"],
276
277 shared_libs: [
278 "libbase",
279 "libdebuggerd_client",
280 "liblog",
Josh Gao0915f232017-06-27 14:08:05 -0700281 "libprocinfo",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700282 ],
283
284 local_include_dirs: ["include"],
285}
286
287cc_binary {
288 name: "tombstoned",
289 srcs: [
290 "util.cpp",
291 "tombstoned/intercept_manager.cpp",
292 "tombstoned/tombstoned.cpp",
293 ],
294 defaults: ["debuggerd_defaults"],
295
Narayan Kamatha73df602017-05-24 15:07:25 +0100296 header_libs: ["libdebuggerd_common_headers"],
297
Josh Gaocbe70cb2016-10-18 18:17:52 -0700298 static_libs: [
299 "libbase",
300 "libcutils",
301 "libevent",
302 "liblog",
303 ],
304
305 init_rc: ["tombstoned/tombstoned.rc"]
Josh Gao9c02dc52016-06-15 17:29:00 -0700306}
Elliott Hughes0ba53592017-02-01 16:59:15 -0800307
308subdirs = [
309 "crasher",
310]