blob: 7fec47daebeb7eb1a00bd1a2df46cd8ed11c0beb [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",
19 export_include_dirs: ["common/include"]
20}
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"],
Narayan Kamath2d377cd2017-05-10 10:58:59 +010042 export_include_dirs: ["tombstoned/include"]
43}
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"],
Narayan Kamath2d377cd2017-05-10 10:58:59 +010063 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",
Josh Gaoe73c9322017-02-08 16:06:26 -0800117 "liblzma",
118 "libcutils",
119 ],
Josh Gao9c02dc52016-06-15 17:29:00 -0700120
Josh Gaocbe70cb2016-10-18 18:17:52 -0700121 export_include_dirs: ["include"],
122}
123
124cc_library {
125 name: "libdebuggerd_client",
126 defaults: ["debuggerd_defaults"],
127 srcs: [
128 "client/debuggerd_client.cpp",
129 "util.cpp",
130 ],
131
Narayan Kamatha73df602017-05-24 15:07:25 +0100132 header_libs: ["libdebuggerd_common_headers"],
133
Josh Gaocbe70cb2016-10-18 18:17:52 -0700134 shared_libs: [
135 "libbase",
136 "libcutils",
137 ],
Josh Gaoe1aa0ca2017-03-01 17:23:22 -0800138
Narayan Kamatha73df602017-05-24 15:07:25 +0100139 export_header_lib_headers: ["libdebuggerd_common_headers"],
Josh Gaocbe70cb2016-10-18 18:17:52 -0700140 export_include_dirs: ["include"],
141}
142
Josh Gaoe73c9322017-02-08 16:06:26 -0800143cc_library_static {
Josh Gaocbe70cb2016-10-18 18:17:52 -0700144 name: "libdebuggerd",
145 defaults: ["debuggerd_defaults"],
146
147 srcs: [
148 "libdebuggerd/backtrace.cpp",
149 "libdebuggerd/elf_utils.cpp",
150 "libdebuggerd/open_files_list.cpp",
151 "libdebuggerd/tombstone.cpp",
152 "libdebuggerd/utility.cpp",
153 ],
154
Josh Gaocbe70cb2016-10-18 18:17:52 -0700155 local_include_dirs: ["libdebuggerd/include"],
156 export_include_dirs: ["libdebuggerd/include"],
Josh Gao9c02dc52016-06-15 17:29:00 -0700157
Josh Gaoe73c9322017-02-08 16:06:26 -0800158 static_libs: [
Josh Gaocbe70cb2016-10-18 18:17:52 -0700159 "libbacktrace",
Josh Gaoe73c9322017-02-08 16:06:26 -0800160 "libunwind",
Christopher Ferris9a8c8552017-08-11 15:29:19 -0700161 "libunwindstack",
Josh Gaoe73c9322017-02-08 16:06:26 -0800162 "liblzma",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700163 "libbase",
164 "libcutils",
165 "liblog",
166 ],
167}
168
169cc_test {
170 name: "debuggerd_test",
171 defaults: ["debuggerd_defaults"],
172
173 cflags: ["-Wno-missing-field-initializers"],
174 srcs: [
175 "libdebuggerd/test/dump_memory_test.cpp",
176 "libdebuggerd/test/elf_fake.cpp",
177 "libdebuggerd/test/log_fake.cpp",
178 "libdebuggerd/test/open_files_list_test.cpp",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700179 "libdebuggerd/test/tombstone_test.cpp",
180 ],
181
182 target: {
183 android: {
184 srcs: [
Josh Gaoae9d7672017-03-24 16:26:03 -0700185 "client/debuggerd_client_test.cpp",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700186 "debuggerd_test.cpp",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700187 ],
Narayan Kamath2d377cd2017-05-10 10:58:59 +0100188 static_libs: ["libasync_safe", "libtombstoned_client_static"],
Josh Gaocbe70cb2016-10-18 18:17:52 -0700189 },
190 },
191
192 shared_libs: [
193 "libbacktrace",
194 "libbase",
195 "libcutils",
Josh Gaoae9d7672017-03-24 16:26:03 -0700196 "libdebuggerd_client",
Narayan Kamatha73df602017-05-24 15:07:25 +0100197 "liblog",
198 "libnativehelper"
Josh Gaocbe70cb2016-10-18 18:17:52 -0700199 ],
200
201 static_libs: [
Josh Gao352a8452017-03-30 16:46:21 -0700202 "libdebuggerd",
Josh Gao2b2ae0c2017-08-21 14:31:17 -0700203 "libunwindstack",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700204 ],
205
206 local_include_dirs: [
207 "libdebuggerd",
208 ],
209
210 compile_multilib: "both",
211 multilib: {
212 lib32: {
213 stem: "debuggerd_test32",
214 },
215 lib64: {
216 stem: "debuggerd_test64",
217 },
218 },
219}
220
Josh Gaoa42314e2017-12-19 15:08:19 -0800221cc_benchmark {
222 name: "debuggerd_benchmark",
223 defaults: ["debuggerd_defaults"],
224 srcs: ["debuggerd_benchmark.cpp"],
225 shared_libs: [
226 "libbase",
227 "libdebuggerd_client",
228 ],
229}
230
Josh Gaocbe70cb2016-10-18 18:17:52 -0700231cc_binary {
232 name: "crash_dump",
233 srcs: [
234 "crash_dump.cpp",
235 "util.cpp",
236 ],
237 defaults: ["debuggerd_defaults"],
238
239 compile_multilib: "both",
240 multilib: {
241 lib32: {
242 suffix: "32",
243 },
244 lib64: {
245 suffix: "64",
246 },
247 },
248
Josh Gaoe73c9322017-02-08 16:06:26 -0800249 static_libs: [
Narayan Kamath2d377cd2017-05-10 10:58:59 +0100250 "libtombstoned_client_static",
Josh Gaoe73c9322017-02-08 16:06:26 -0800251 "libdebuggerd",
252 "libcutils",
253 ],
254
Josh Gaocbe70cb2016-10-18 18:17:52 -0700255 shared_libs: [
256 "libbacktrace",
257 "libbase",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700258 "liblog",
259 "libprocinfo",
Josh Gao2b2ae0c2017-08-21 14:31:17 -0700260 "libunwindstack",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700261 ],
262}
263
264cc_binary {
265 name: "debuggerd",
266 srcs: [
267 "debuggerd.cpp",
268 ],
269 defaults: ["debuggerd_defaults"],
270
271 shared_libs: [
272 "libbase",
273 "libdebuggerd_client",
274 "liblog",
Josh Gao0915f232017-06-27 14:08:05 -0700275 "libprocinfo",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700276 ],
277
278 local_include_dirs: ["include"],
279}
280
281cc_binary {
282 name: "tombstoned",
283 srcs: [
284 "util.cpp",
285 "tombstoned/intercept_manager.cpp",
286 "tombstoned/tombstoned.cpp",
287 ],
288 defaults: ["debuggerd_defaults"],
289
Narayan Kamatha73df602017-05-24 15:07:25 +0100290 header_libs: ["libdebuggerd_common_headers"],
291
Josh Gaocbe70cb2016-10-18 18:17:52 -0700292 static_libs: [
293 "libbase",
294 "libcutils",
295 "libevent",
296 "liblog",
297 ],
298
299 init_rc: ["tombstoned/tombstoned.rc"]
Josh Gao9c02dc52016-06-15 17:29:00 -0700300}
Elliott Hughes0ba53592017-02-01 16:59:15 -0800301
302subdirs = [
303 "crasher",
304]