blob: 385f3850a6f408acabcab0736b9f16009353e979 [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 ],
Josh Gao2b2ae0c2017-08-21 14:31:17 -070012 cpp_std: "gnu++17",
Josh Gaocbe70cb2016-10-18 18:17:52 -070013
14 local_include_dirs: ["include"],
15}
16
Narayan Kamatha73df602017-05-24 15:07:25 +010017cc_library_headers {
18 name: "libdebuggerd_common_headers",
Elliott Hughesdc699a22018-02-16 17:58:14 -080019 export_include_dirs: ["common/include"],
Jiyong Parka0e75042018-05-24 14:11:00 +090020 recovery_available: true,
Narayan Kamatha73df602017-05-24 15:07:25 +010021}
22
Narayan Kamath2d377cd2017-05-10 10:58:59 +010023cc_library_shared {
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080024 name: "libtombstoned_client",
25 defaults: ["debuggerd_defaults"],
26 srcs: [
Narayan Kamath2d377cd2017-05-10 10:58:59 +010027 "tombstoned/tombstoned_client.cpp",
28 "util.cpp",
29 ],
30
Narayan Kamatha73df602017-05-24 15:07:25 +010031 header_libs: ["libdebuggerd_common_headers"],
32
Narayan Kamath2d377cd2017-05-10 10:58:59 +010033 static_libs: [
Narayan Kamatha73df602017-05-24 15:07:25 +010034 "libasync_safe",
Narayan Kamath2d377cd2017-05-10 10:58:59 +010035 ],
36
37 shared_libs: [
Narayan Kamath2d377cd2017-05-10 10:58:59 +010038 "libbase",
Narayan Kamatha73df602017-05-24 15:07:25 +010039 "libcutils",
Narayan Kamath2d377cd2017-05-10 10:58:59 +010040 ],
41
Narayan Kamatha73df602017-05-24 15:07:25 +010042 export_header_lib_headers: ["libdebuggerd_common_headers"],
Elliott Hughesdc699a22018-02-16 17:58:14 -080043 export_include_dirs: ["tombstoned/include"],
Narayan Kamath2d377cd2017-05-10 10:58:59 +010044}
45
Josh Gao9da1f512018-08-06 15:38:29 -070046// Utility library to talk to tombstoned and get an output fd.
Narayan Kamath2d377cd2017-05-10 10:58:59 +010047cc_library_static {
48 name: "libtombstoned_client_static",
49 defaults: ["debuggerd_defaults"],
Jiyong Park011ee122018-05-29 16:41:30 +090050 recovery_available: true,
Narayan Kamath2d377cd2017-05-10 10:58:59 +010051 srcs: [
52 "tombstoned/tombstoned_client.cpp",
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080053 "util.cpp",
54 ],
55
Narayan Kamatha73df602017-05-24 15:07:25 +010056 header_libs: ["libdebuggerd_common_headers"],
57
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080058 whole_static_libs: [
Christopher Ferrisac225782017-04-25 11:23:10 -070059 "libasync_safe",
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080060 "libcutils",
61 "libbase",
62 ],
Narayan Kamath2d377cd2017-05-10 10:58:59 +010063
Narayan Kamatha73df602017-05-24 15:07:25 +010064 export_header_lib_headers: ["libdebuggerd_common_headers"],
Elliott Hughesdc699a22018-02-16 17:58:14 -080065 export_include_dirs: ["tombstoned/include"],
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080066}
67
68// Core implementation, linked into libdebuggerd_handler and the dynamic linker.
Josh Gao9c02dc52016-06-15 17:29:00 -070069cc_library_static {
Josh Gaoe73c9322017-02-08 16:06:26 -080070 name: "libdebuggerd_handler_core",
Josh Gaocbe70cb2016-10-18 18:17:52 -070071 defaults: ["debuggerd_defaults"],
Jiyong Parka0e75042018-05-24 14:11:00 +090072 recovery_available: true,
Josh Gaocbe70cb2016-10-18 18:17:52 -070073 srcs: ["handler/debuggerd_handler.cpp"],
Josh Gao9c02dc52016-06-15 17:29:00 -070074
Josh Gaofdf832d2017-08-25 18:00:18 -070075 header_libs: [
76 "libbase_headers",
77 "libdebuggerd_common_headers",
78 ],
Narayan Kamatha73df602017-05-24 15:07:25 +010079
Josh Gaoe73c9322017-02-08 16:06:26 -080080 whole_static_libs: [
Christopher Ferrisac225782017-04-25 11:23:10 -070081 "libasync_safe",
Josh Gao2b2ae0c2017-08-21 14:31:17 -070082 "libcutils",
Josh Gaoe73c9322017-02-08 16:06:26 -080083 "libdebuggerd",
84 ],
85
Narayan Kamatha73df602017-05-24 15:07:25 +010086 export_header_lib_headers: ["libdebuggerd_common_headers"],
Josh Gaoe73c9322017-02-08 16:06:26 -080087 export_include_dirs: ["include"],
88}
89
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080090// Implementation with a no-op fallback.
Josh Gaoe73c9322017-02-08 16:06:26 -080091cc_library_static {
92 name: "libdebuggerd_handler",
93 defaults: ["debuggerd_defaults"],
94 srcs: ["handler/debuggerd_fallback_nop.cpp"],
95
96 whole_static_libs: [
97 "libdebuggerd_handler_core",
98 ],
99
100 export_include_dirs: ["include"],
101}
102
Josh Gaoe1aa0ca2017-03-01 17:23:22 -0800103// Fallback implementation.
Josh Gaoe73c9322017-02-08 16:06:26 -0800104cc_library_static {
105 name: "libdebuggerd_handler_fallback",
106 defaults: ["debuggerd_defaults"],
Jiyong Park011ee122018-05-29 16:41:30 +0900107 recovery_available: true,
Josh Gaoe1aa0ca2017-03-01 17:23:22 -0800108 srcs: [
109 "handler/debuggerd_fallback.cpp",
110 ],
Josh Gaoe73c9322017-02-08 16:06:26 -0800111
Josh Gaoe1aa0ca2017-03-01 17:23:22 -0800112 whole_static_libs: [
113 "libdebuggerd_handler_core",
Narayan Kamath2d377cd2017-05-10 10:58:59 +0100114 "libtombstoned_client_static",
Christopher Ferrisac225782017-04-25 11:23:10 -0700115 "libasync_safe",
Josh Gaoe1aa0ca2017-03-01 17:23:22 -0800116 "libbase",
Josh Gaoe73c9322017-02-08 16:06:26 -0800117 "libdebuggerd",
118 "libbacktrace",
Christopher Ferris9a8c8552017-08-11 15:29:19 -0700119 "libunwindstack",
Christopher Ferris0b06a592018-01-19 10:26:36 -0800120 "libdexfile",
Josh Gaoe73c9322017-02-08 16:06:26 -0800121 "liblzma",
122 "libcutils",
123 ],
Jiyong Park011ee122018-05-29 16:41:30 +0900124 target: {
125 recovery: {
126 cflags: ["-DNO_LIBDEXFILE_SUPPORT"],
127 exclude_static_libs: ["libdexfile"],
128 },
129 },
Josh Gao9c02dc52016-06-15 17:29:00 -0700130
Josh Gaocbe70cb2016-10-18 18:17:52 -0700131 export_include_dirs: ["include"],
132}
133
134cc_library {
135 name: "libdebuggerd_client",
136 defaults: ["debuggerd_defaults"],
137 srcs: [
138 "client/debuggerd_client.cpp",
139 "util.cpp",
140 ],
141
Narayan Kamatha73df602017-05-24 15:07:25 +0100142 header_libs: ["libdebuggerd_common_headers"],
143
Josh Gaocbe70cb2016-10-18 18:17:52 -0700144 shared_libs: [
145 "libbase",
146 "libcutils",
147 ],
Josh Gaoe1aa0ca2017-03-01 17:23:22 -0800148
Narayan Kamatha73df602017-05-24 15:07:25 +0100149 export_header_lib_headers: ["libdebuggerd_common_headers"],
Josh Gaocbe70cb2016-10-18 18:17:52 -0700150 export_include_dirs: ["include"],
151}
152
Josh Gaoe73c9322017-02-08 16:06:26 -0800153cc_library_static {
Josh Gaocbe70cb2016-10-18 18:17:52 -0700154 name: "libdebuggerd",
155 defaults: ["debuggerd_defaults"],
Jiyong Parka0e75042018-05-24 14:11:00 +0900156 recovery_available: true,
Josh Gaocbe70cb2016-10-18 18:17:52 -0700157
158 srcs: [
159 "libdebuggerd/backtrace.cpp",
160 "libdebuggerd/elf_utils.cpp",
161 "libdebuggerd/open_files_list.cpp",
162 "libdebuggerd/tombstone.cpp",
163 "libdebuggerd/utility.cpp",
164 ],
165
Josh Gaocbe70cb2016-10-18 18:17:52 -0700166 local_include_dirs: ["libdebuggerd/include"],
167 export_include_dirs: ["libdebuggerd/include"],
Josh Gao9c02dc52016-06-15 17:29:00 -0700168
Josh Gaoe73c9322017-02-08 16:06:26 -0800169 static_libs: [
Josh Gaocbe70cb2016-10-18 18:17:52 -0700170 "libbacktrace",
Christopher Ferris9a8c8552017-08-11 15:29:19 -0700171 "libunwindstack",
Josh Gaoe73c9322017-02-08 16:06:26 -0800172 "liblzma",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700173 "libbase",
174 "libcutils",
175 "liblog",
176 ],
177}
178
179cc_test {
180 name: "debuggerd_test",
181 defaults: ["debuggerd_defaults"],
182
183 cflags: ["-Wno-missing-field-initializers"],
184 srcs: [
185 "libdebuggerd/test/dump_memory_test.cpp",
186 "libdebuggerd/test/elf_fake.cpp",
187 "libdebuggerd/test/log_fake.cpp",
188 "libdebuggerd/test/open_files_list_test.cpp",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700189 "libdebuggerd/test/tombstone_test.cpp",
190 ],
191
192 target: {
193 android: {
194 srcs: [
Josh Gaoae9d7672017-03-24 16:26:03 -0700195 "client/debuggerd_client_test.cpp",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700196 "debuggerd_test.cpp",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700197 ],
Elliott Hughesdc699a22018-02-16 17:58:14 -0800198 static_libs: [
199 "libasync_safe",
200 "libtombstoned_client_static",
201 ],
Josh Gaocbe70cb2016-10-18 18:17:52 -0700202 },
203 },
204
205 shared_libs: [
206 "libbacktrace",
207 "libbase",
208 "libcutils",
Josh Gaoae9d7672017-03-24 16:26:03 -0700209 "libdebuggerd_client",
Narayan Kamatha73df602017-05-24 15:07:25 +0100210 "liblog",
Josh Gaoe04ca272018-01-16 15:38:17 -0800211 "libminijail",
Elliott Hughesdc699a22018-02-16 17:58:14 -0800212 "libnativehelper",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700213 ],
214
215 static_libs: [
Josh Gao352a8452017-03-30 16:46:21 -0700216 "libdebuggerd",
Josh Gao2b2ae0c2017-08-21 14:31:17 -0700217 "libunwindstack",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700218 ],
219
220 local_include_dirs: [
221 "libdebuggerd",
222 ],
223
224 compile_multilib: "both",
225 multilib: {
226 lib32: {
227 stem: "debuggerd_test32",
228 },
229 lib64: {
230 stem: "debuggerd_test64",
231 },
232 },
Elliott Hughes40fdf3f2018-04-27 16:12:06 -0700233
234 test_suites: ["device-tests"],
Josh Gaocbe70cb2016-10-18 18:17:52 -0700235}
236
Josh Gaoa42314e2017-12-19 15:08:19 -0800237cc_benchmark {
238 name: "debuggerd_benchmark",
239 defaults: ["debuggerd_defaults"],
240 srcs: ["debuggerd_benchmark.cpp"],
241 shared_libs: [
242 "libbase",
243 "libdebuggerd_client",
244 ],
245}
246
Josh Gaocbe70cb2016-10-18 18:17:52 -0700247cc_binary {
248 name: "crash_dump",
249 srcs: [
250 "crash_dump.cpp",
251 "util.cpp",
252 ],
253 defaults: ["debuggerd_defaults"],
254
255 compile_multilib: "both",
256 multilib: {
257 lib32: {
258 suffix: "32",
259 },
260 lib64: {
261 suffix: "64",
262 },
263 },
264
Josh Gaoe73c9322017-02-08 16:06:26 -0800265 static_libs: [
Narayan Kamath2d377cd2017-05-10 10:58:59 +0100266 "libtombstoned_client_static",
Josh Gaoe73c9322017-02-08 16:06:26 -0800267 "libdebuggerd",
268 "libcutils",
269 ],
270
Josh Gaocbe70cb2016-10-18 18:17:52 -0700271 shared_libs: [
272 "libbacktrace",
273 "libbase",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700274 "liblog",
275 "libprocinfo",
Josh Gao2b2ae0c2017-08-21 14:31:17 -0700276 "libunwindstack",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700277 ],
278}
279
280cc_binary {
281 name: "debuggerd",
282 srcs: [
283 "debuggerd.cpp",
284 ],
285 defaults: ["debuggerd_defaults"],
286
287 shared_libs: [
288 "libbase",
289 "libdebuggerd_client",
290 "liblog",
Josh Gao0915f232017-06-27 14:08:05 -0700291 "libprocinfo",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700292 ],
293
294 local_include_dirs: ["include"],
295}
296
297cc_binary {
298 name: "tombstoned",
299 srcs: [
300 "util.cpp",
301 "tombstoned/intercept_manager.cpp",
302 "tombstoned/tombstoned.cpp",
303 ],
304 defaults: ["debuggerd_defaults"],
305
Narayan Kamatha73df602017-05-24 15:07:25 +0100306 header_libs: ["libdebuggerd_common_headers"],
307
Josh Gaocbe70cb2016-10-18 18:17:52 -0700308 static_libs: [
309 "libbase",
310 "libcutils",
311 "libevent",
312 "liblog",
313 ],
314
Elliott Hughesdc699a22018-02-16 17:58:14 -0800315 init_rc: ["tombstoned/tombstoned.rc"],
Josh Gao9c02dc52016-06-15 17:29:00 -0700316}
Elliott Hughes0ba53592017-02-01 16:59:15 -0800317
318subdirs = [
319 "crasher",
320]