blob: f86aaa014aa632e1f6771d040512759aa749949c [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",
109 "liblzma",
110 "libcutils",
111 ],
Josh Gao9c02dc52016-06-15 17:29:00 -0700112
Josh Gaocbe70cb2016-10-18 18:17:52 -0700113 export_include_dirs: ["include"],
114}
115
116cc_library {
117 name: "libdebuggerd_client",
118 defaults: ["debuggerd_defaults"],
119 srcs: [
120 "client/debuggerd_client.cpp",
121 "util.cpp",
122 ],
123
Narayan Kamatha73df602017-05-24 15:07:25 +0100124 header_libs: ["libdebuggerd_common_headers"],
125
Josh Gaocbe70cb2016-10-18 18:17:52 -0700126 shared_libs: [
127 "libbase",
128 "libcutils",
129 ],
Josh Gaoe1aa0ca2017-03-01 17:23:22 -0800130
Narayan Kamatha73df602017-05-24 15:07:25 +0100131 export_header_lib_headers: ["libdebuggerd_common_headers"],
Josh Gaocbe70cb2016-10-18 18:17:52 -0700132 export_include_dirs: ["include"],
133}
134
Josh Gaoe73c9322017-02-08 16:06:26 -0800135cc_library_static {
Josh Gaocbe70cb2016-10-18 18:17:52 -0700136 name: "libdebuggerd",
137 defaults: ["debuggerd_defaults"],
138
139 srcs: [
140 "libdebuggerd/backtrace.cpp",
141 "libdebuggerd/elf_utils.cpp",
142 "libdebuggerd/open_files_list.cpp",
143 "libdebuggerd/tombstone.cpp",
144 "libdebuggerd/utility.cpp",
145 ],
146
147 target: {
148 android_arm: {
149 srcs: ["libdebuggerd/arm/machine.cpp"],
150 },
151 android_arm64: {
152 srcs: ["libdebuggerd/arm64/machine.cpp"],
153 },
154 android_mips: {
155 srcs: ["libdebuggerd/mips/machine.cpp"],
156 },
157 android_mips64: {
158 srcs: ["libdebuggerd/mips64/machine.cpp"],
159 },
160 android_x86: {
161 srcs: ["libdebuggerd/x86/machine.cpp"],
162 },
163 android_x86_64: {
164 srcs: ["libdebuggerd/x86_64/machine.cpp"],
165 },
Robert Sesek9eb02c92016-08-09 14:04:05 -0400166 },
Robert Sesek9eb02c92016-08-09 14:04:05 -0400167
Josh Gaocbe70cb2016-10-18 18:17:52 -0700168 local_include_dirs: ["libdebuggerd/include"],
169 export_include_dirs: ["libdebuggerd/include"],
Josh Gao9c02dc52016-06-15 17:29:00 -0700170
Josh Gaoe73c9322017-02-08 16:06:26 -0800171 static_libs: [
Josh Gaocbe70cb2016-10-18 18:17:52 -0700172 "libbacktrace",
Josh Gaoe73c9322017-02-08 16:06:26 -0800173 "libunwind",
174 "liblzma",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700175 "libbase",
176 "libcutils",
177 "liblog",
178 ],
179}
180
181cc_test {
182 name: "debuggerd_test",
183 defaults: ["debuggerd_defaults"],
184
185 cflags: ["-Wno-missing-field-initializers"],
186 srcs: [
187 "libdebuggerd/test/dump_memory_test.cpp",
188 "libdebuggerd/test/elf_fake.cpp",
189 "libdebuggerd/test/log_fake.cpp",
190 "libdebuggerd/test/open_files_list_test.cpp",
191 "libdebuggerd/test/property_fake.cpp",
192 "libdebuggerd/test/ptrace_fake.cpp",
193 "libdebuggerd/test/tombstone_test.cpp",
194 ],
195
196 target: {
197 android: {
198 srcs: [
Josh Gaoae9d7672017-03-24 16:26:03 -0700199 "client/debuggerd_client_test.cpp",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700200 "debuggerd_test.cpp",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700201 ],
Narayan Kamath2d377cd2017-05-10 10:58:59 +0100202 static_libs: ["libasync_safe", "libtombstoned_client_static"],
Josh Gaocbe70cb2016-10-18 18:17:52 -0700203 },
204 },
205
206 shared_libs: [
207 "libbacktrace",
208 "libbase",
209 "libcutils",
Josh Gaoae9d7672017-03-24 16:26:03 -0700210 "libdebuggerd_client",
Narayan Kamatha73df602017-05-24 15:07:25 +0100211 "liblog",
212 "libnativehelper"
Josh Gaocbe70cb2016-10-18 18:17:52 -0700213 ],
214
215 static_libs: [
Josh Gao352a8452017-03-30 16:46:21 -0700216 "libdebuggerd",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700217 ],
218
219 local_include_dirs: [
220 "libdebuggerd",
221 ],
222
223 compile_multilib: "both",
224 multilib: {
225 lib32: {
226 stem: "debuggerd_test32",
227 },
228 lib64: {
229 stem: "debuggerd_test64",
230 },
231 },
232}
233
234cc_binary {
235 name: "crash_dump",
236 srcs: [
237 "crash_dump.cpp",
238 "util.cpp",
239 ],
240 defaults: ["debuggerd_defaults"],
241
242 compile_multilib: "both",
243 multilib: {
244 lib32: {
245 suffix: "32",
246 },
247 lib64: {
248 suffix: "64",
249 },
250 },
251
Josh Gaoe73c9322017-02-08 16:06:26 -0800252 static_libs: [
Narayan Kamath2d377cd2017-05-10 10:58:59 +0100253 "libtombstoned_client_static",
Josh Gaoe73c9322017-02-08 16:06:26 -0800254 "libdebuggerd",
255 "libcutils",
256 ],
257
Josh Gaocbe70cb2016-10-18 18:17:52 -0700258 shared_libs: [
259 "libbacktrace",
260 "libbase",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700261 "liblog",
262 "libprocinfo",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700263 ],
264}
265
266cc_binary {
267 name: "debuggerd",
268 srcs: [
269 "debuggerd.cpp",
270 ],
271 defaults: ["debuggerd_defaults"],
272
273 shared_libs: [
274 "libbase",
275 "libdebuggerd_client",
276 "liblog",
Josh Gao0915f232017-06-27 14:08:05 -0700277 "libprocinfo",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700278 ],
279
280 local_include_dirs: ["include"],
281}
282
283cc_binary {
284 name: "tombstoned",
285 srcs: [
286 "util.cpp",
287 "tombstoned/intercept_manager.cpp",
288 "tombstoned/tombstoned.cpp",
289 ],
290 defaults: ["debuggerd_defaults"],
291
Narayan Kamatha73df602017-05-24 15:07:25 +0100292 header_libs: ["libdebuggerd_common_headers"],
293
Josh Gaocbe70cb2016-10-18 18:17:52 -0700294 static_libs: [
295 "libbase",
296 "libcutils",
297 "libevent",
298 "liblog",
299 ],
300
301 init_rc: ["tombstoned/tombstoned.rc"]
Josh Gao9c02dc52016-06-15 17:29:00 -0700302}
Elliott Hughes0ba53592017-02-01 16:59:15 -0800303
304subdirs = [
305 "crasher",
306]