blob: d9fae5275b5157b1d2c9cc8cef4c4389d8a6912c [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 Gao2b2ae0c2017-08-21 14:31:17 -07007 "-Wno-unused-argument",
8 "-Wno-unused-function",
Josh Gaocbe70cb2016-10-18 18:17:52 -07009 "-Wno-nullability-completeness",
10 "-Os",
11 ],
12
13 local_include_dirs: ["include"],
14}
15
Narayan Kamatha73df602017-05-24 15:07:25 +010016cc_library_headers {
17 name: "libdebuggerd_common_headers",
Elliott Hughesdc699a22018-02-16 17:58:14 -080018 export_include_dirs: ["common/include"],
Jiyong Parka0e75042018-05-24 14:11:00 +090019 recovery_available: true,
Narayan Kamatha73df602017-05-24 15:07:25 +010020}
21
Narayan Kamath2d377cd2017-05-10 10:58:59 +010022cc_library_shared {
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080023 name: "libtombstoned_client",
24 defaults: ["debuggerd_defaults"],
25 srcs: [
Narayan Kamath2d377cd2017-05-10 10:58:59 +010026 "tombstoned/tombstoned_client.cpp",
27 "util.cpp",
28 ],
29
Narayan Kamatha73df602017-05-24 15:07:25 +010030 header_libs: ["libdebuggerd_common_headers"],
31
Narayan Kamath2d377cd2017-05-10 10:58:59 +010032 static_libs: [
Narayan Kamatha73df602017-05-24 15:07:25 +010033 "libasync_safe",
Narayan Kamath2d377cd2017-05-10 10:58:59 +010034 ],
35
36 shared_libs: [
Narayan Kamath2d377cd2017-05-10 10:58:59 +010037 "libbase",
Narayan Kamatha73df602017-05-24 15:07:25 +010038 "libcutils",
Narayan Kamath2d377cd2017-05-10 10:58:59 +010039 ],
40
Narayan Kamatha73df602017-05-24 15:07:25 +010041 export_header_lib_headers: ["libdebuggerd_common_headers"],
Elliott Hughesdc699a22018-02-16 17:58:14 -080042 export_include_dirs: ["tombstoned/include"],
Narayan Kamath2d377cd2017-05-10 10:58:59 +010043}
44
Josh Gao9da1f512018-08-06 15:38:29 -070045// Utility library to talk to tombstoned and get an output fd.
Narayan Kamath2d377cd2017-05-10 10:58:59 +010046cc_library_static {
47 name: "libtombstoned_client_static",
48 defaults: ["debuggerd_defaults"],
Jiyong Park011ee122018-05-29 16:41:30 +090049 recovery_available: true,
Narayan Kamath2d377cd2017-05-10 10:58:59 +010050 srcs: [
51 "tombstoned/tombstoned_client.cpp",
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080052 "util.cpp",
53 ],
54
Narayan Kamatha73df602017-05-24 15:07:25 +010055 header_libs: ["libdebuggerd_common_headers"],
56
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080057 whole_static_libs: [
Christopher Ferrisac225782017-04-25 11:23:10 -070058 "libasync_safe",
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080059 "libcutils",
60 "libbase",
61 ],
Narayan Kamath2d377cd2017-05-10 10:58:59 +010062
Narayan Kamatha73df602017-05-24 15:07:25 +010063 export_header_lib_headers: ["libdebuggerd_common_headers"],
Elliott Hughesdc699a22018-02-16 17:58:14 -080064 export_include_dirs: ["tombstoned/include"],
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080065}
66
67// Core implementation, linked into libdebuggerd_handler and the dynamic linker.
Josh Gao9c02dc52016-06-15 17:29:00 -070068cc_library_static {
Josh Gaoe73c9322017-02-08 16:06:26 -080069 name: "libdebuggerd_handler_core",
Josh Gaocbe70cb2016-10-18 18:17:52 -070070 defaults: ["debuggerd_defaults"],
Jiyong Parka0e75042018-05-24 14:11:00 +090071 recovery_available: true,
Josh Gaocbe70cb2016-10-18 18:17:52 -070072 srcs: ["handler/debuggerd_handler.cpp"],
Josh Gao9c02dc52016-06-15 17:29:00 -070073
Josh Gaofdf832d2017-08-25 18:00:18 -070074 header_libs: [
75 "libbase_headers",
76 "libdebuggerd_common_headers",
77 ],
Narayan Kamatha73df602017-05-24 15:07:25 +010078
Josh Gaoe73c9322017-02-08 16:06:26 -080079 whole_static_libs: [
Christopher Ferrisac225782017-04-25 11:23:10 -070080 "libasync_safe",
Josh Gao2b2ae0c2017-08-21 14:31:17 -070081 "libcutils",
Josh Gaoe73c9322017-02-08 16:06:26 -080082 "libdebuggerd",
83 ],
84
Narayan Kamatha73df602017-05-24 15:07:25 +010085 export_header_lib_headers: ["libdebuggerd_common_headers"],
Josh Gaoe73c9322017-02-08 16:06:26 -080086 export_include_dirs: ["include"],
87}
88
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080089// Implementation with a no-op fallback.
Josh Gaoe73c9322017-02-08 16:06:26 -080090cc_library_static {
91 name: "libdebuggerd_handler",
92 defaults: ["debuggerd_defaults"],
93 srcs: ["handler/debuggerd_fallback_nop.cpp"],
94
95 whole_static_libs: [
96 "libdebuggerd_handler_core",
97 ],
98
99 export_include_dirs: ["include"],
100}
101
Josh Gaoe1aa0ca2017-03-01 17:23:22 -0800102// Fallback implementation.
Josh Gaoe73c9322017-02-08 16:06:26 -0800103cc_library_static {
104 name: "libdebuggerd_handler_fallback",
105 defaults: ["debuggerd_defaults"],
Jiyong Park011ee122018-05-29 16:41:30 +0900106 recovery_available: true,
Josh Gaoe1aa0ca2017-03-01 17:23:22 -0800107 srcs: [
108 "handler/debuggerd_fallback.cpp",
109 ],
Josh Gaoe73c9322017-02-08 16:06:26 -0800110
Josh Gaoe1aa0ca2017-03-01 17:23:22 -0800111 whole_static_libs: [
112 "libdebuggerd_handler_core",
Narayan Kamath2d377cd2017-05-10 10:58:59 +0100113 "libtombstoned_client_static",
Christopher Ferrisac225782017-04-25 11:23:10 -0700114 "libasync_safe",
Josh Gaoe1aa0ca2017-03-01 17:23:22 -0800115 "libbase",
Josh Gaoe73c9322017-02-08 16:06:26 -0800116 "libdebuggerd",
117 "libbacktrace",
Christopher Ferris9a8c8552017-08-11 15:29:19 -0700118 "libunwindstack",
Martin Stjernholmcacf5bf2018-12-19 00:09:41 +0000119 "libdexfile",
Josh Gaoe73c9322017-02-08 16:06:26 -0800120 "liblzma",
121 "libcutils",
122 ],
Jiyong Park011ee122018-05-29 16:41:30 +0900123 target: {
124 recovery: {
125 cflags: ["-DNO_LIBDEXFILE_SUPPORT"],
Martin Stjernholmcacf5bf2018-12-19 00:09:41 +0000126 exclude_static_libs: ["libdexfile"],
Jiyong Park011ee122018-05-29 16:41:30 +0900127 },
128 },
Josh Gao9c02dc52016-06-15 17:29:00 -0700129
Josh Gaocbe70cb2016-10-18 18:17:52 -0700130 export_include_dirs: ["include"],
131}
132
133cc_library {
134 name: "libdebuggerd_client",
135 defaults: ["debuggerd_defaults"],
136 srcs: [
137 "client/debuggerd_client.cpp",
138 "util.cpp",
139 ],
140
Narayan Kamatha73df602017-05-24 15:07:25 +0100141 header_libs: ["libdebuggerd_common_headers"],
142
Josh Gaocbe70cb2016-10-18 18:17:52 -0700143 shared_libs: [
144 "libbase",
145 "libcutils",
146 ],
Josh Gaoe1aa0ca2017-03-01 17:23:22 -0800147
Narayan Kamatha73df602017-05-24 15:07:25 +0100148 export_header_lib_headers: ["libdebuggerd_common_headers"],
Josh Gaocbe70cb2016-10-18 18:17:52 -0700149 export_include_dirs: ["include"],
150}
151
Josh Gaoe73c9322017-02-08 16:06:26 -0800152cc_library_static {
Josh Gaocbe70cb2016-10-18 18:17:52 -0700153 name: "libdebuggerd",
154 defaults: ["debuggerd_defaults"],
Jiyong Parka0e75042018-05-24 14:11:00 +0900155 recovery_available: true,
Josh Gaocbe70cb2016-10-18 18:17:52 -0700156
157 srcs: [
158 "libdebuggerd/backtrace.cpp",
159 "libdebuggerd/elf_utils.cpp",
160 "libdebuggerd/open_files_list.cpp",
161 "libdebuggerd/tombstone.cpp",
162 "libdebuggerd/utility.cpp",
163 ],
164
Josh Gaocbe70cb2016-10-18 18:17:52 -0700165 local_include_dirs: ["libdebuggerd/include"],
166 export_include_dirs: ["libdebuggerd/include"],
Josh Gao9c02dc52016-06-15 17:29:00 -0700167
Josh Gaoce841d92018-08-06 18:26:42 -0700168 // Needed for private/bionic_fdsan.h
169 include_dirs: ["bionic/libc"],
170
Josh Gaoe73c9322017-02-08 16:06:26 -0800171 static_libs: [
Josh Gaocbe70cb2016-10-18 18:17:52 -0700172 "libbacktrace",
Christopher Ferris9a8c8552017-08-11 15:29:19 -0700173 "libunwindstack",
Josh Gaoe73c9322017-02-08 16:06:26 -0800174 "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",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700191 "libdebuggerd/test/tombstone_test.cpp",
192 ],
193
194 target: {
195 android: {
196 srcs: [
Josh Gaoae9d7672017-03-24 16:26:03 -0700197 "client/debuggerd_client_test.cpp",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700198 "debuggerd_test.cpp",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700199 ],
Elliott Hughesdc699a22018-02-16 17:58:14 -0800200 static_libs: [
201 "libasync_safe",
202 "libtombstoned_client_static",
203 ],
Josh Gaocbe70cb2016-10-18 18:17:52 -0700204 },
205 },
206
207 shared_libs: [
208 "libbacktrace",
209 "libbase",
210 "libcutils",
Josh Gaoae9d7672017-03-24 16:26:03 -0700211 "libdebuggerd_client",
Narayan Kamatha73df602017-05-24 15:07:25 +0100212 "liblog",
Josh Gaoe04ca272018-01-16 15:38:17 -0800213 "libminijail",
Elliott Hughesdc699a22018-02-16 17:58:14 -0800214 "libnativehelper",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700215 ],
216
217 static_libs: [
Josh Gao352a8452017-03-30 16:46:21 -0700218 "libdebuggerd",
Josh Gao2b2ae0c2017-08-21 14:31:17 -0700219 "libunwindstack",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700220 ],
221
222 local_include_dirs: [
223 "libdebuggerd",
224 ],
225
226 compile_multilib: "both",
227 multilib: {
228 lib32: {
229 stem: "debuggerd_test32",
230 },
231 lib64: {
232 stem: "debuggerd_test64",
233 },
234 },
Elliott Hughes40fdf3f2018-04-27 16:12:06 -0700235
236 test_suites: ["device-tests"],
Josh Gaocbe70cb2016-10-18 18:17:52 -0700237}
238
Josh Gaoa42314e2017-12-19 15:08:19 -0800239cc_benchmark {
240 name: "debuggerd_benchmark",
241 defaults: ["debuggerd_defaults"],
242 srcs: ["debuggerd_benchmark.cpp"],
243 shared_libs: [
244 "libbase",
245 "libdebuggerd_client",
246 ],
247}
248
Josh Gaocbe70cb2016-10-18 18:17:52 -0700249cc_binary {
250 name: "crash_dump",
251 srcs: [
252 "crash_dump.cpp",
253 "util.cpp",
254 ],
255 defaults: ["debuggerd_defaults"],
256
257 compile_multilib: "both",
258 multilib: {
259 lib32: {
260 suffix: "32",
261 },
262 lib64: {
263 suffix: "64",
264 },
265 },
266
Josh Gaoe73c9322017-02-08 16:06:26 -0800267 static_libs: [
Narayan Kamath2d377cd2017-05-10 10:58:59 +0100268 "libtombstoned_client_static",
Josh Gaoe73c9322017-02-08 16:06:26 -0800269 "libdebuggerd",
270 "libcutils",
271 ],
272
Josh Gaocbe70cb2016-10-18 18:17:52 -0700273 shared_libs: [
274 "libbacktrace",
275 "libbase",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700276 "liblog",
277 "libprocinfo",
Josh Gao2b2ae0c2017-08-21 14:31:17 -0700278 "libunwindstack",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700279 ],
280}
281
282cc_binary {
283 name: "debuggerd",
284 srcs: [
285 "debuggerd.cpp",
286 ],
287 defaults: ["debuggerd_defaults"],
288
289 shared_libs: [
290 "libbase",
291 "libdebuggerd_client",
292 "liblog",
Josh Gao0915f232017-06-27 14:08:05 -0700293 "libprocinfo",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700294 ],
295
296 local_include_dirs: ["include"],
297}
298
299cc_binary {
300 name: "tombstoned",
301 srcs: [
302 "util.cpp",
303 "tombstoned/intercept_manager.cpp",
304 "tombstoned/tombstoned.cpp",
305 ],
306 defaults: ["debuggerd_defaults"],
307
Narayan Kamatha73df602017-05-24 15:07:25 +0100308 header_libs: ["libdebuggerd_common_headers"],
309
Josh Gaocbe70cb2016-10-18 18:17:52 -0700310 static_libs: [
311 "libbase",
312 "libcutils",
313 "libevent",
314 "liblog",
315 ],
316
Elliott Hughesdc699a22018-02-16 17:58:14 -0800317 init_rc: ["tombstoned/tombstoned.rc"],
Josh Gao9c02dc52016-06-15 17:29:00 -0700318}
Elliott Hughes0ba53592017-02-01 16:59:15 -0800319
320subdirs = [
321 "crasher",
322]