blob: 9c556c30f5bf7f2009b04b5892fe7839c51b06d2 [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"],
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
45// Utility library to tombstoned and get an output fd.
46cc_library_static {
47 name: "libtombstoned_client_static",
48 defaults: ["debuggerd_defaults"],
49 srcs: [
50 "tombstoned/tombstoned_client.cpp",
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080051 "util.cpp",
52 ],
53
Narayan Kamatha73df602017-05-24 15:07:25 +010054 header_libs: ["libdebuggerd_common_headers"],
55
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080056 whole_static_libs: [
Christopher Ferrisac225782017-04-25 11:23:10 -070057 "libasync_safe",
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080058 "libcutils",
59 "libbase",
60 ],
Narayan Kamath2d377cd2017-05-10 10:58:59 +010061
Narayan Kamatha73df602017-05-24 15:07:25 +010062 export_header_lib_headers: ["libdebuggerd_common_headers"],
Elliott Hughesdc699a22018-02-16 17:58:14 -080063 export_include_dirs: ["tombstoned/include"],
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080064}
65
66// Core implementation, linked into libdebuggerd_handler and the dynamic linker.
Josh Gao9c02dc52016-06-15 17:29:00 -070067cc_library_static {
Josh Gaoe73c9322017-02-08 16:06:26 -080068 name: "libdebuggerd_handler_core",
Josh Gaocbe70cb2016-10-18 18:17:52 -070069 defaults: ["debuggerd_defaults"],
70 srcs: ["handler/debuggerd_handler.cpp"],
Josh Gao9c02dc52016-06-15 17:29:00 -070071
Josh Gaofdf832d2017-08-25 18:00:18 -070072 header_libs: [
73 "libbase_headers",
74 "libdebuggerd_common_headers",
75 ],
Narayan Kamatha73df602017-05-24 15:07:25 +010076
Josh Gaoe73c9322017-02-08 16:06:26 -080077 whole_static_libs: [
Christopher Ferrisac225782017-04-25 11:23:10 -070078 "libasync_safe",
Josh Gao2b2ae0c2017-08-21 14:31:17 -070079 "libcutils",
Josh Gaoe73c9322017-02-08 16:06:26 -080080 "libdebuggerd",
81 ],
82
Narayan Kamatha73df602017-05-24 15:07:25 +010083 export_header_lib_headers: ["libdebuggerd_common_headers"],
Josh Gaoe73c9322017-02-08 16:06:26 -080084 export_include_dirs: ["include"],
85}
86
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080087// Implementation with a no-op fallback.
Josh Gaoe73c9322017-02-08 16:06:26 -080088cc_library_static {
89 name: "libdebuggerd_handler",
90 defaults: ["debuggerd_defaults"],
91 srcs: ["handler/debuggerd_fallback_nop.cpp"],
92
93 whole_static_libs: [
94 "libdebuggerd_handler_core",
95 ],
96
97 export_include_dirs: ["include"],
98}
99
Josh Gaoe1aa0ca2017-03-01 17:23:22 -0800100// Fallback implementation.
Josh Gaoe73c9322017-02-08 16:06:26 -0800101cc_library_static {
102 name: "libdebuggerd_handler_fallback",
103 defaults: ["debuggerd_defaults"],
Josh Gaoe1aa0ca2017-03-01 17:23:22 -0800104 srcs: [
105 "handler/debuggerd_fallback.cpp",
106 ],
Josh Gaoe73c9322017-02-08 16:06:26 -0800107
Josh Gaoe1aa0ca2017-03-01 17:23:22 -0800108 whole_static_libs: [
109 "libdebuggerd_handler_core",
Narayan Kamath2d377cd2017-05-10 10:58:59 +0100110 "libtombstoned_client_static",
Christopher Ferrisac225782017-04-25 11:23:10 -0700111 "libasync_safe",
Josh Gaoe1aa0ca2017-03-01 17:23:22 -0800112 "libbase",
Josh Gaoe73c9322017-02-08 16:06:26 -0800113 "libdebuggerd",
114 "libbacktrace",
115 "libunwind",
Christopher Ferris9a8c8552017-08-11 15:29:19 -0700116 "libunwindstack",
Christopher Ferris0b06a592018-01-19 10:26:36 -0800117 "libdexfile",
Josh Gaoe73c9322017-02-08 16:06:26 -0800118 "liblzma",
119 "libcutils",
120 ],
Josh Gao9c02dc52016-06-15 17:29:00 -0700121
Josh Gaocbe70cb2016-10-18 18:17:52 -0700122 export_include_dirs: ["include"],
123}
124
125cc_library {
126 name: "libdebuggerd_client",
127 defaults: ["debuggerd_defaults"],
128 srcs: [
129 "client/debuggerd_client.cpp",
130 "util.cpp",
131 ],
132
Narayan Kamatha73df602017-05-24 15:07:25 +0100133 header_libs: ["libdebuggerd_common_headers"],
134
Josh Gaocbe70cb2016-10-18 18:17:52 -0700135 shared_libs: [
136 "libbase",
137 "libcutils",
138 ],
Josh Gaoe1aa0ca2017-03-01 17:23:22 -0800139
Narayan Kamatha73df602017-05-24 15:07:25 +0100140 export_header_lib_headers: ["libdebuggerd_common_headers"],
Josh Gaocbe70cb2016-10-18 18:17:52 -0700141 export_include_dirs: ["include"],
142}
143
Josh Gaoe73c9322017-02-08 16:06:26 -0800144cc_library_static {
Josh Gaocbe70cb2016-10-18 18:17:52 -0700145 name: "libdebuggerd",
146 defaults: ["debuggerd_defaults"],
147
148 srcs: [
149 "libdebuggerd/backtrace.cpp",
150 "libdebuggerd/elf_utils.cpp",
151 "libdebuggerd/open_files_list.cpp",
152 "libdebuggerd/tombstone.cpp",
153 "libdebuggerd/utility.cpp",
154 ],
155
Josh Gaocbe70cb2016-10-18 18:17:52 -0700156 local_include_dirs: ["libdebuggerd/include"],
157 export_include_dirs: ["libdebuggerd/include"],
Josh Gao9c02dc52016-06-15 17:29:00 -0700158
Josh Gaoe73c9322017-02-08 16:06:26 -0800159 static_libs: [
Josh Gaocbe70cb2016-10-18 18:17:52 -0700160 "libbacktrace",
Josh Gaoe73c9322017-02-08 16:06:26 -0800161 "libunwind",
Christopher Ferris9a8c8552017-08-11 15:29:19 -0700162 "libunwindstack",
Josh Gaoe73c9322017-02-08 16:06:26 -0800163 "liblzma",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700164 "libbase",
165 "libcutils",
166 "liblog",
167 ],
168}
169
170cc_test {
171 name: "debuggerd_test",
172 defaults: ["debuggerd_defaults"],
173
174 cflags: ["-Wno-missing-field-initializers"],
175 srcs: [
176 "libdebuggerd/test/dump_memory_test.cpp",
177 "libdebuggerd/test/elf_fake.cpp",
178 "libdebuggerd/test/log_fake.cpp",
179 "libdebuggerd/test/open_files_list_test.cpp",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700180 "libdebuggerd/test/tombstone_test.cpp",
181 ],
182
183 target: {
184 android: {
185 srcs: [
Josh Gaoae9d7672017-03-24 16:26:03 -0700186 "client/debuggerd_client_test.cpp",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700187 "debuggerd_test.cpp",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700188 ],
Elliott Hughesdc699a22018-02-16 17:58:14 -0800189 static_libs: [
190 "libasync_safe",
191 "libtombstoned_client_static",
192 ],
Josh Gaocbe70cb2016-10-18 18:17:52 -0700193 },
194 },
195
196 shared_libs: [
197 "libbacktrace",
198 "libbase",
199 "libcutils",
Josh Gaoae9d7672017-03-24 16:26:03 -0700200 "libdebuggerd_client",
Narayan Kamatha73df602017-05-24 15:07:25 +0100201 "liblog",
Josh Gaoe04ca272018-01-16 15:38:17 -0800202 "libminijail",
Elliott Hughesdc699a22018-02-16 17:58:14 -0800203 "libnativehelper",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700204 ],
205
206 static_libs: [
Josh Gao352a8452017-03-30 16:46:21 -0700207 "libdebuggerd",
Josh Gao2b2ae0c2017-08-21 14:31:17 -0700208 "libunwindstack",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700209 ],
210
211 local_include_dirs: [
212 "libdebuggerd",
213 ],
214
215 compile_multilib: "both",
216 multilib: {
217 lib32: {
218 stem: "debuggerd_test32",
219 },
220 lib64: {
221 stem: "debuggerd_test64",
222 },
223 },
Elliott Hughes40fdf3f2018-04-27 16:12:06 -0700224
225 test_suites: ["device-tests"],
Josh Gaocbe70cb2016-10-18 18:17:52 -0700226}
227
Josh Gaoa42314e2017-12-19 15:08:19 -0800228cc_benchmark {
229 name: "debuggerd_benchmark",
230 defaults: ["debuggerd_defaults"],
231 srcs: ["debuggerd_benchmark.cpp"],
232 shared_libs: [
233 "libbase",
234 "libdebuggerd_client",
235 ],
236}
237
Josh Gaocbe70cb2016-10-18 18:17:52 -0700238cc_binary {
239 name: "crash_dump",
240 srcs: [
241 "crash_dump.cpp",
242 "util.cpp",
243 ],
244 defaults: ["debuggerd_defaults"],
245
246 compile_multilib: "both",
247 multilib: {
248 lib32: {
249 suffix: "32",
250 },
251 lib64: {
252 suffix: "64",
253 },
254 },
255
Josh Gaoe73c9322017-02-08 16:06:26 -0800256 static_libs: [
Narayan Kamath2d377cd2017-05-10 10:58:59 +0100257 "libtombstoned_client_static",
Josh Gaoe73c9322017-02-08 16:06:26 -0800258 "libdebuggerd",
259 "libcutils",
260 ],
261
Josh Gaocbe70cb2016-10-18 18:17:52 -0700262 shared_libs: [
263 "libbacktrace",
264 "libbase",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700265 "liblog",
266 "libprocinfo",
Josh Gao2b2ae0c2017-08-21 14:31:17 -0700267 "libunwindstack",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700268 ],
269}
270
271cc_binary {
272 name: "debuggerd",
273 srcs: [
274 "debuggerd.cpp",
275 ],
276 defaults: ["debuggerd_defaults"],
277
278 shared_libs: [
279 "libbase",
280 "libdebuggerd_client",
281 "liblog",
Josh Gao0915f232017-06-27 14:08:05 -0700282 "libprocinfo",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700283 ],
284
285 local_include_dirs: ["include"],
286}
287
288cc_binary {
289 name: "tombstoned",
290 srcs: [
291 "util.cpp",
292 "tombstoned/intercept_manager.cpp",
293 "tombstoned/tombstoned.cpp",
294 ],
295 defaults: ["debuggerd_defaults"],
296
Narayan Kamatha73df602017-05-24 15:07:25 +0100297 header_libs: ["libdebuggerd_common_headers"],
298
Josh Gaocbe70cb2016-10-18 18:17:52 -0700299 static_libs: [
300 "libbase",
301 "libcutils",
302 "libevent",
303 "liblog",
304 ],
305
Elliott Hughesdc699a22018-02-16 17:58:14 -0800306 init_rc: ["tombstoned/tombstoned.rc"],
Josh Gao9c02dc52016-06-15 17:29:00 -0700307}
Elliott Hughes0ba53592017-02-01 16:59:15 -0800308
309subdirs = [
310 "crasher",
311]