blob: 3a80b50bbaaee758f4693c729a2ad5aed0f836aa [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 Kamath2d377cd2017-05-10 10:58:59 +010014cc_library_shared {
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080015 name: "libtombstoned_client",
16 defaults: ["debuggerd_defaults"],
17 srcs: [
Narayan Kamath2d377cd2017-05-10 10:58:59 +010018 "tombstoned/tombstoned_client.cpp",
19 "util.cpp",
20 ],
21
22 static_libs: [
23 "libasync_safe"
24 ],
25
26 shared_libs: [
27 "libcutils",
28 "libbase",
29 ],
30
31 export_include_dirs: ["tombstoned/include"]
32}
33
34// Utility library to tombstoned and get an output fd.
35cc_library_static {
36 name: "libtombstoned_client_static",
37 defaults: ["debuggerd_defaults"],
38 srcs: [
39 "tombstoned/tombstoned_client.cpp",
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080040 "util.cpp",
41 ],
42
43 whole_static_libs: [
Christopher Ferrisac225782017-04-25 11:23:10 -070044 "libasync_safe",
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080045 "libcutils",
46 "libbase",
47 ],
Narayan Kamath2d377cd2017-05-10 10:58:59 +010048
49 export_include_dirs: ["tombstoned/include"]
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080050}
51
52// Core implementation, linked into libdebuggerd_handler and the dynamic linker.
Josh Gao9c02dc52016-06-15 17:29:00 -070053cc_library_static {
Josh Gaoe73c9322017-02-08 16:06:26 -080054 name: "libdebuggerd_handler_core",
Josh Gaocbe70cb2016-10-18 18:17:52 -070055 defaults: ["debuggerd_defaults"],
56 srcs: ["handler/debuggerd_handler.cpp"],
Josh Gao9c02dc52016-06-15 17:29:00 -070057
Josh Gaoe73c9322017-02-08 16:06:26 -080058 whole_static_libs: [
Christopher Ferrisac225782017-04-25 11:23:10 -070059 "libasync_safe",
Josh Gaoe73c9322017-02-08 16:06:26 -080060 "libdebuggerd",
61 ],
62
63 export_include_dirs: ["include"],
64}
65
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080066// Implementation with a no-op fallback.
Josh Gaoe73c9322017-02-08 16:06:26 -080067cc_library_static {
68 name: "libdebuggerd_handler",
69 defaults: ["debuggerd_defaults"],
70 srcs: ["handler/debuggerd_fallback_nop.cpp"],
71
72 whole_static_libs: [
73 "libdebuggerd_handler_core",
74 ],
75
76 export_include_dirs: ["include"],
77}
78
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080079// Fallback implementation.
Josh Gaoe73c9322017-02-08 16:06:26 -080080cc_library_static {
81 name: "libdebuggerd_handler_fallback",
82 defaults: ["debuggerd_defaults"],
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080083 srcs: [
84 "handler/debuggerd_fallback.cpp",
85 ],
Josh Gaoe73c9322017-02-08 16:06:26 -080086
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080087 whole_static_libs: [
88 "libdebuggerd_handler_core",
Narayan Kamath2d377cd2017-05-10 10:58:59 +010089 "libtombstoned_client_static",
Christopher Ferrisac225782017-04-25 11:23:10 -070090 "libasync_safe",
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080091 "libbase",
Josh Gaoe73c9322017-02-08 16:06:26 -080092 "libdebuggerd",
93 "libbacktrace",
94 "libunwind",
95 "liblzma",
96 "libcutils",
97 ],
Josh Gao9c02dc52016-06-15 17:29:00 -070098
Josh Gaocbe70cb2016-10-18 18:17:52 -070099 export_include_dirs: ["include"],
100}
101
102cc_library {
103 name: "libdebuggerd_client",
104 defaults: ["debuggerd_defaults"],
105 srcs: [
106 "client/debuggerd_client.cpp",
107 "util.cpp",
108 ],
109
110 shared_libs: [
111 "libbase",
112 "libcutils",
113 ],
Josh Gaoe1aa0ca2017-03-01 17:23:22 -0800114
Josh Gaocbe70cb2016-10-18 18:17:52 -0700115 export_include_dirs: ["include"],
116}
117
Josh Gaoe73c9322017-02-08 16:06:26 -0800118cc_library_static {
Josh Gaocbe70cb2016-10-18 18:17:52 -0700119 name: "libdebuggerd",
120 defaults: ["debuggerd_defaults"],
121
122 srcs: [
123 "libdebuggerd/backtrace.cpp",
124 "libdebuggerd/elf_utils.cpp",
125 "libdebuggerd/open_files_list.cpp",
126 "libdebuggerd/tombstone.cpp",
127 "libdebuggerd/utility.cpp",
128 ],
129
130 target: {
131 android_arm: {
132 srcs: ["libdebuggerd/arm/machine.cpp"],
133 },
134 android_arm64: {
135 srcs: ["libdebuggerd/arm64/machine.cpp"],
136 },
137 android_mips: {
138 srcs: ["libdebuggerd/mips/machine.cpp"],
139 },
140 android_mips64: {
141 srcs: ["libdebuggerd/mips64/machine.cpp"],
142 },
143 android_x86: {
144 srcs: ["libdebuggerd/x86/machine.cpp"],
145 },
146 android_x86_64: {
147 srcs: ["libdebuggerd/x86_64/machine.cpp"],
148 },
Robert Sesek9eb02c92016-08-09 14:04:05 -0400149 },
Robert Sesek9eb02c92016-08-09 14:04:05 -0400150
Josh Gaocbe70cb2016-10-18 18:17:52 -0700151 local_include_dirs: ["libdebuggerd/include"],
152 export_include_dirs: ["libdebuggerd/include"],
Josh Gao9c02dc52016-06-15 17:29:00 -0700153
Josh Gaoe73c9322017-02-08 16:06:26 -0800154 static_libs: [
Josh Gaocbe70cb2016-10-18 18:17:52 -0700155 "libbacktrace",
Josh Gaoe73c9322017-02-08 16:06:26 -0800156 "libunwind",
157 "liblzma",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700158 "libbase",
159 "libcutils",
160 "liblog",
161 ],
162}
163
164cc_test {
165 name: "debuggerd_test",
166 defaults: ["debuggerd_defaults"],
167
168 cflags: ["-Wno-missing-field-initializers"],
169 srcs: [
170 "libdebuggerd/test/dump_memory_test.cpp",
171 "libdebuggerd/test/elf_fake.cpp",
172 "libdebuggerd/test/log_fake.cpp",
173 "libdebuggerd/test/open_files_list_test.cpp",
174 "libdebuggerd/test/property_fake.cpp",
175 "libdebuggerd/test/ptrace_fake.cpp",
176 "libdebuggerd/test/tombstone_test.cpp",
177 ],
178
179 target: {
180 android: {
181 srcs: [
Josh Gaoae9d7672017-03-24 16:26:03 -0700182 "client/debuggerd_client_test.cpp",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700183 "debuggerd_test.cpp",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700184 ],
Narayan Kamath2d377cd2017-05-10 10:58:59 +0100185 static_libs: ["libasync_safe", "libtombstoned_client_static"],
Josh Gaocbe70cb2016-10-18 18:17:52 -0700186 },
187 },
188
189 shared_libs: [
190 "libbacktrace",
191 "libbase",
192 "libcutils",
Josh Gaoae9d7672017-03-24 16:26:03 -0700193 "libdebuggerd_client",
Narayan Kamath2d377cd2017-05-10 10:58:59 +0100194 "liblog"
Josh Gaocbe70cb2016-10-18 18:17:52 -0700195 ],
196
197 static_libs: [
Josh Gao352a8452017-03-30 16:46:21 -0700198 "libdebuggerd",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700199 ],
200
201 local_include_dirs: [
202 "libdebuggerd",
203 ],
204
205 compile_multilib: "both",
206 multilib: {
207 lib32: {
208 stem: "debuggerd_test32",
209 },
210 lib64: {
211 stem: "debuggerd_test64",
212 },
213 },
214}
215
216cc_binary {
217 name: "crash_dump",
218 srcs: [
219 "crash_dump.cpp",
220 "util.cpp",
221 ],
222 defaults: ["debuggerd_defaults"],
223
224 compile_multilib: "both",
225 multilib: {
226 lib32: {
227 suffix: "32",
228 },
229 lib64: {
230 suffix: "64",
231 },
232 },
233
Josh Gaoe73c9322017-02-08 16:06:26 -0800234 static_libs: [
Narayan Kamath2d377cd2017-05-10 10:58:59 +0100235 "libtombstoned_client_static",
Josh Gaoe73c9322017-02-08 16:06:26 -0800236 "libdebuggerd",
237 "libcutils",
238 ],
239
Josh Gaocbe70cb2016-10-18 18:17:52 -0700240 shared_libs: [
241 "libbacktrace",
242 "libbase",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700243 "liblog",
244 "libprocinfo",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700245 ],
246}
247
248cc_binary {
249 name: "debuggerd",
250 srcs: [
251 "debuggerd.cpp",
252 ],
253 defaults: ["debuggerd_defaults"],
254
255 shared_libs: [
256 "libbase",
257 "libdebuggerd_client",
258 "liblog",
259 "libselinux",
260 ],
261
262 local_include_dirs: ["include"],
263}
264
265cc_binary {
266 name: "tombstoned",
267 srcs: [
268 "util.cpp",
269 "tombstoned/intercept_manager.cpp",
270 "tombstoned/tombstoned.cpp",
271 ],
272 defaults: ["debuggerd_defaults"],
273
274 static_libs: [
275 "libbase",
276 "libcutils",
277 "libevent",
278 "liblog",
279 ],
280
281 init_rc: ["tombstoned/tombstoned.rc"]
Josh Gao9c02dc52016-06-15 17:29:00 -0700282}
Elliott Hughes0ba53592017-02-01 16:59:15 -0800283
284subdirs = [
285 "crasher",
286]