blob: 7d17cd93152067a9e89a1365c4abe1371518ad65 [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
Narayan Kamatha73df602017-05-24 15:07:25 +010069 header_libs: ["libdebuggerd_common_headers"],
70
Josh Gaoe73c9322017-02-08 16:06:26 -080071 whole_static_libs: [
Christopher Ferrisac225782017-04-25 11:23:10 -070072 "libasync_safe",
Josh Gaoe73c9322017-02-08 16:06:26 -080073 "libdebuggerd",
74 ],
75
Narayan Kamatha73df602017-05-24 15:07:25 +010076 export_header_lib_headers: ["libdebuggerd_common_headers"],
Josh Gaoe73c9322017-02-08 16:06:26 -080077 export_include_dirs: ["include"],
78}
79
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080080// Implementation with a no-op fallback.
Josh Gaoe73c9322017-02-08 16:06:26 -080081cc_library_static {
82 name: "libdebuggerd_handler",
83 defaults: ["debuggerd_defaults"],
84 srcs: ["handler/debuggerd_fallback_nop.cpp"],
85
86 whole_static_libs: [
87 "libdebuggerd_handler_core",
88 ],
89
90 export_include_dirs: ["include"],
91}
92
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080093// Fallback implementation.
Josh Gaoe73c9322017-02-08 16:06:26 -080094cc_library_static {
95 name: "libdebuggerd_handler_fallback",
96 defaults: ["debuggerd_defaults"],
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080097 srcs: [
98 "handler/debuggerd_fallback.cpp",
99 ],
Josh Gaoe73c9322017-02-08 16:06:26 -0800100
Josh Gaoe1aa0ca2017-03-01 17:23:22 -0800101 whole_static_libs: [
102 "libdebuggerd_handler_core",
Narayan Kamath2d377cd2017-05-10 10:58:59 +0100103 "libtombstoned_client_static",
Christopher Ferrisac225782017-04-25 11:23:10 -0700104 "libasync_safe",
Josh Gaoe1aa0ca2017-03-01 17:23:22 -0800105 "libbase",
Josh Gaoe73c9322017-02-08 16:06:26 -0800106 "libdebuggerd",
107 "libbacktrace",
108 "libunwind",
Christopher Ferris9a8c8552017-08-11 15:29:19 -0700109 "libunwindstack",
Josh Gaoe73c9322017-02-08 16:06:26 -0800110 "liblzma",
111 "libcutils",
112 ],
Josh Gao9c02dc52016-06-15 17:29:00 -0700113
Josh Gaocbe70cb2016-10-18 18:17:52 -0700114 export_include_dirs: ["include"],
115}
116
117cc_library {
118 name: "libdebuggerd_client",
119 defaults: ["debuggerd_defaults"],
120 srcs: [
121 "client/debuggerd_client.cpp",
122 "util.cpp",
123 ],
124
Narayan Kamatha73df602017-05-24 15:07:25 +0100125 header_libs: ["libdebuggerd_common_headers"],
126
Josh Gaocbe70cb2016-10-18 18:17:52 -0700127 shared_libs: [
128 "libbase",
129 "libcutils",
130 ],
Josh Gaoe1aa0ca2017-03-01 17:23:22 -0800131
Narayan Kamatha73df602017-05-24 15:07:25 +0100132 export_header_lib_headers: ["libdebuggerd_common_headers"],
Josh Gaocbe70cb2016-10-18 18:17:52 -0700133 export_include_dirs: ["include"],
134}
135
Josh Gaoe73c9322017-02-08 16:06:26 -0800136cc_library_static {
Josh Gaocbe70cb2016-10-18 18:17:52 -0700137 name: "libdebuggerd",
138 defaults: ["debuggerd_defaults"],
139
140 srcs: [
141 "libdebuggerd/backtrace.cpp",
142 "libdebuggerd/elf_utils.cpp",
143 "libdebuggerd/open_files_list.cpp",
144 "libdebuggerd/tombstone.cpp",
145 "libdebuggerd/utility.cpp",
146 ],
147
148 target: {
149 android_arm: {
150 srcs: ["libdebuggerd/arm/machine.cpp"],
151 },
152 android_arm64: {
153 srcs: ["libdebuggerd/arm64/machine.cpp"],
154 },
155 android_mips: {
156 srcs: ["libdebuggerd/mips/machine.cpp"],
157 },
158 android_mips64: {
159 srcs: ["libdebuggerd/mips64/machine.cpp"],
160 },
161 android_x86: {
162 srcs: ["libdebuggerd/x86/machine.cpp"],
163 },
164 android_x86_64: {
165 srcs: ["libdebuggerd/x86_64/machine.cpp"],
166 },
Robert Sesek9eb02c92016-08-09 14:04:05 -0400167 },
Robert Sesek9eb02c92016-08-09 14:04:05 -0400168
Josh Gaocbe70cb2016-10-18 18:17:52 -0700169 local_include_dirs: ["libdebuggerd/include"],
170 export_include_dirs: ["libdebuggerd/include"],
Josh Gao9c02dc52016-06-15 17:29:00 -0700171
Josh Gaoe73c9322017-02-08 16:06:26 -0800172 static_libs: [
Josh Gaocbe70cb2016-10-18 18:17:52 -0700173 "libbacktrace",
Josh Gaoe73c9322017-02-08 16:06:26 -0800174 "libunwind",
Christopher Ferris9a8c8552017-08-11 15:29:19 -0700175 "libunwindstack",
Josh Gaoe73c9322017-02-08 16:06:26 -0800176 "liblzma",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700177 "libbase",
178 "libcutils",
179 "liblog",
180 ],
181}
182
183cc_test {
184 name: "debuggerd_test",
185 defaults: ["debuggerd_defaults"],
186
187 cflags: ["-Wno-missing-field-initializers"],
188 srcs: [
189 "libdebuggerd/test/dump_memory_test.cpp",
190 "libdebuggerd/test/elf_fake.cpp",
191 "libdebuggerd/test/log_fake.cpp",
192 "libdebuggerd/test/open_files_list_test.cpp",
193 "libdebuggerd/test/property_fake.cpp",
194 "libdebuggerd/test/ptrace_fake.cpp",
195 "libdebuggerd/test/tombstone_test.cpp",
196 ],
197
198 target: {
199 android: {
200 srcs: [
Josh Gaoae9d7672017-03-24 16:26:03 -0700201 "client/debuggerd_client_test.cpp",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700202 "debuggerd_test.cpp",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700203 ],
Narayan Kamath2d377cd2017-05-10 10:58:59 +0100204 static_libs: ["libasync_safe", "libtombstoned_client_static"],
Josh Gaocbe70cb2016-10-18 18:17:52 -0700205 },
206 },
207
208 shared_libs: [
209 "libbacktrace",
210 "libbase",
211 "libcutils",
Josh Gaoae9d7672017-03-24 16:26:03 -0700212 "libdebuggerd_client",
Narayan Kamatha73df602017-05-24 15:07:25 +0100213 "liblog",
214 "libnativehelper"
Josh Gaocbe70cb2016-10-18 18:17:52 -0700215 ],
216
217 static_libs: [
Josh Gao352a8452017-03-30 16:46:21 -0700218 "libdebuggerd",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700219 ],
220
221 local_include_dirs: [
222 "libdebuggerd",
223 ],
224
225 compile_multilib: "both",
226 multilib: {
227 lib32: {
228 stem: "debuggerd_test32",
229 },
230 lib64: {
231 stem: "debuggerd_test64",
232 },
233 },
234}
235
236cc_binary {
237 name: "crash_dump",
238 srcs: [
239 "crash_dump.cpp",
240 "util.cpp",
241 ],
242 defaults: ["debuggerd_defaults"],
243
244 compile_multilib: "both",
245 multilib: {
246 lib32: {
247 suffix: "32",
248 },
249 lib64: {
250 suffix: "64",
251 },
252 },
253
Josh Gaoe73c9322017-02-08 16:06:26 -0800254 static_libs: [
Narayan Kamath2d377cd2017-05-10 10:58:59 +0100255 "libtombstoned_client_static",
Josh Gaoe73c9322017-02-08 16:06:26 -0800256 "libdebuggerd",
257 "libcutils",
258 ],
259
Josh Gaocbe70cb2016-10-18 18:17:52 -0700260 shared_libs: [
261 "libbacktrace",
262 "libbase",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700263 "liblog",
264 "libprocinfo",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700265 ],
266}
267
268cc_binary {
269 name: "debuggerd",
270 srcs: [
271 "debuggerd.cpp",
272 ],
273 defaults: ["debuggerd_defaults"],
274
275 shared_libs: [
276 "libbase",
277 "libdebuggerd_client",
278 "liblog",
Josh Gao0915f232017-06-27 14:08:05 -0700279 "libprocinfo",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700280 ],
281
282 local_include_dirs: ["include"],
283}
284
285cc_binary {
286 name: "tombstoned",
287 srcs: [
288 "util.cpp",
289 "tombstoned/intercept_manager.cpp",
290 "tombstoned/tombstoned.cpp",
291 ],
292 defaults: ["debuggerd_defaults"],
293
Narayan Kamatha73df602017-05-24 15:07:25 +0100294 header_libs: ["libdebuggerd_common_headers"],
295
Josh Gaocbe70cb2016-10-18 18:17:52 -0700296 static_libs: [
297 "libbase",
298 "libcutils",
299 "libevent",
300 "liblog",
301 ],
302
303 init_rc: ["tombstoned/tombstoned.rc"]
Josh Gao9c02dc52016-06-15 17:29:00 -0700304}
Elliott Hughes0ba53592017-02-01 16:59:15 -0800305
306subdirs = [
307 "crasher",
308]