blob: 79d5c08622a93bd048e64b6eaa13150b3620b5d0 [file] [log] [blame]
Josh Gaocbe70cb2016-10-18 18:17:52 -07001cc_defaults {
2 name: "debuggerd_defaults",
Dan Willemsene0cd1e02017-03-15 15:23:36 -07003 defaults: ["linux_bionic_supported"],
Josh Gaocbe70cb2016-10-18 18:17:52 -07004 cflags: [
5 "-Wall",
6 "-Wextra",
Josh Gaoc7fe0602017-03-13 14:13:29 -07007 "-Werror",
Josh Gaocbe70cb2016-10-18 18:17:52 -07008 "-Wno-nullability-completeness",
9 "-Os",
10 ],
11
12 local_include_dirs: ["include"],
13}
14
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080015// Utility library to tombstoned and get an output fd.
16cc_library_static {
17 name: "libtombstoned_client",
18 defaults: ["debuggerd_defaults"],
19 srcs: [
20 "tombstoned_client.cpp",
21 "util.cpp",
22 ],
23
24 whole_static_libs: [
Christopher Ferrisac225782017-04-25 11:23:10 -070025 "libasync_safe",
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080026 "libcutils",
27 "libbase",
28 ],
29}
30
31// Core implementation, linked into libdebuggerd_handler and the dynamic linker.
Josh Gao9c02dc52016-06-15 17:29:00 -070032cc_library_static {
Josh Gaoe73c9322017-02-08 16:06:26 -080033 name: "libdebuggerd_handler_core",
Josh Gaocbe70cb2016-10-18 18:17:52 -070034 defaults: ["debuggerd_defaults"],
35 srcs: ["handler/debuggerd_handler.cpp"],
Josh Gao9c02dc52016-06-15 17:29:00 -070036
Josh Gaoe73c9322017-02-08 16:06:26 -080037 whole_static_libs: [
Christopher Ferrisac225782017-04-25 11:23:10 -070038 "libasync_safe",
Josh Gaoe73c9322017-02-08 16:06:26 -080039 "libdebuggerd",
40 ],
41
42 export_include_dirs: ["include"],
43}
44
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080045// Implementation with a no-op fallback.
Josh Gaoe73c9322017-02-08 16:06:26 -080046cc_library_static {
47 name: "libdebuggerd_handler",
48 defaults: ["debuggerd_defaults"],
49 srcs: ["handler/debuggerd_fallback_nop.cpp"],
50
51 whole_static_libs: [
52 "libdebuggerd_handler_core",
53 ],
54
55 export_include_dirs: ["include"],
56}
57
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080058// Fallback implementation.
Josh Gaoe73c9322017-02-08 16:06:26 -080059cc_library_static {
60 name: "libdebuggerd_handler_fallback",
61 defaults: ["debuggerd_defaults"],
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080062 srcs: [
63 "handler/debuggerd_fallback.cpp",
64 ],
Josh Gaoe73c9322017-02-08 16:06:26 -080065
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080066 whole_static_libs: [
67 "libdebuggerd_handler_core",
68 "libtombstoned_client",
Christopher Ferrisac225782017-04-25 11:23:10 -070069 "libasync_safe",
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080070 "libbase",
Josh Gaoe73c9322017-02-08 16:06:26 -080071 "libdebuggerd",
72 "libbacktrace",
73 "libunwind",
74 "liblzma",
75 "libcutils",
76 ],
Josh Gao9c02dc52016-06-15 17:29:00 -070077
Josh Gaocbe70cb2016-10-18 18:17:52 -070078 export_include_dirs: ["include"],
79}
80
81cc_library {
82 name: "libdebuggerd_client",
83 defaults: ["debuggerd_defaults"],
84 srcs: [
85 "client/debuggerd_client.cpp",
86 "util.cpp",
87 ],
88
89 shared_libs: [
90 "libbase",
91 "libcutils",
92 ],
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080093
Josh Gaocbe70cb2016-10-18 18:17:52 -070094 export_include_dirs: ["include"],
95}
96
Josh Gaoe73c9322017-02-08 16:06:26 -080097cc_library_static {
Josh Gaocbe70cb2016-10-18 18:17:52 -070098 name: "libdebuggerd",
99 defaults: ["debuggerd_defaults"],
100
101 srcs: [
102 "libdebuggerd/backtrace.cpp",
103 "libdebuggerd/elf_utils.cpp",
104 "libdebuggerd/open_files_list.cpp",
105 "libdebuggerd/tombstone.cpp",
106 "libdebuggerd/utility.cpp",
107 ],
108
109 target: {
110 android_arm: {
111 srcs: ["libdebuggerd/arm/machine.cpp"],
112 },
113 android_arm64: {
114 srcs: ["libdebuggerd/arm64/machine.cpp"],
115 },
116 android_mips: {
117 srcs: ["libdebuggerd/mips/machine.cpp"],
118 },
119 android_mips64: {
120 srcs: ["libdebuggerd/mips64/machine.cpp"],
121 },
122 android_x86: {
123 srcs: ["libdebuggerd/x86/machine.cpp"],
124 },
125 android_x86_64: {
126 srcs: ["libdebuggerd/x86_64/machine.cpp"],
127 },
Robert Sesek9eb02c92016-08-09 14:04:05 -0400128 },
Robert Sesek9eb02c92016-08-09 14:04:05 -0400129
Josh Gaocbe70cb2016-10-18 18:17:52 -0700130 local_include_dirs: ["libdebuggerd/include"],
131 export_include_dirs: ["libdebuggerd/include"],
Josh Gao9c02dc52016-06-15 17:29:00 -0700132
Josh Gaoe73c9322017-02-08 16:06:26 -0800133 static_libs: [
Josh Gaocbe70cb2016-10-18 18:17:52 -0700134 "libbacktrace",
Josh Gaoe73c9322017-02-08 16:06:26 -0800135 "libunwind",
136 "liblzma",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700137 "libbase",
138 "libcutils",
139 "liblog",
140 ],
141}
142
143cc_test {
144 name: "debuggerd_test",
145 defaults: ["debuggerd_defaults"],
146
147 cflags: ["-Wno-missing-field-initializers"],
148 srcs: [
149 "libdebuggerd/test/dump_memory_test.cpp",
150 "libdebuggerd/test/elf_fake.cpp",
151 "libdebuggerd/test/log_fake.cpp",
152 "libdebuggerd/test/open_files_list_test.cpp",
153 "libdebuggerd/test/property_fake.cpp",
154 "libdebuggerd/test/ptrace_fake.cpp",
155 "libdebuggerd/test/tombstone_test.cpp",
156 ],
157
158 target: {
159 android: {
160 srcs: [
Josh Gaoae9d7672017-03-24 16:26:03 -0700161 "client/debuggerd_client_test.cpp",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700162 "debuggerd_test.cpp",
Josh Gao352a8452017-03-30 16:46:21 -0700163 "tombstoned_client.cpp",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700164 "util.cpp"
165 ],
Christopher Ferrisac225782017-04-25 11:23:10 -0700166 static_libs: ["libasync_safe"],
Josh Gaocbe70cb2016-10-18 18:17:52 -0700167 },
168 },
169
170 shared_libs: [
171 "libbacktrace",
172 "libbase",
173 "libcutils",
Josh Gaoae9d7672017-03-24 16:26:03 -0700174 "libdebuggerd_client",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700175 ],
176
177 static_libs: [
Josh Gao352a8452017-03-30 16:46:21 -0700178 "libdebuggerd",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700179 ],
180
181 local_include_dirs: [
182 "libdebuggerd",
183 ],
184
185 compile_multilib: "both",
186 multilib: {
187 lib32: {
188 stem: "debuggerd_test32",
189 },
190 lib64: {
191 stem: "debuggerd_test64",
192 },
193 },
194}
195
196cc_binary {
197 name: "crash_dump",
198 srcs: [
199 "crash_dump.cpp",
200 "util.cpp",
201 ],
202 defaults: ["debuggerd_defaults"],
203
204 compile_multilib: "both",
205 multilib: {
206 lib32: {
207 suffix: "32",
208 },
209 lib64: {
210 suffix: "64",
211 },
212 },
213
Josh Gaoe73c9322017-02-08 16:06:26 -0800214 static_libs: [
Josh Gaoe1aa0ca2017-03-01 17:23:22 -0800215 "libtombstoned_client",
Josh Gaoe73c9322017-02-08 16:06:26 -0800216 "libdebuggerd",
217 "libcutils",
218 ],
219
Josh Gaocbe70cb2016-10-18 18:17:52 -0700220 shared_libs: [
221 "libbacktrace",
222 "libbase",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700223 "liblog",
224 "libprocinfo",
225 "libselinux",
226 ],
227}
228
229cc_binary {
230 name: "debuggerd",
231 srcs: [
232 "debuggerd.cpp",
233 ],
234 defaults: ["debuggerd_defaults"],
235
236 shared_libs: [
237 "libbase",
238 "libdebuggerd_client",
239 "liblog",
240 "libselinux",
241 ],
242
243 local_include_dirs: ["include"],
244}
245
246cc_binary {
247 name: "tombstoned",
248 srcs: [
249 "util.cpp",
250 "tombstoned/intercept_manager.cpp",
251 "tombstoned/tombstoned.cpp",
252 ],
253 defaults: ["debuggerd_defaults"],
254
255 static_libs: [
256 "libbase",
257 "libcutils",
258 "libevent",
259 "liblog",
260 ],
261
262 init_rc: ["tombstoned/tombstoned.rc"]
Josh Gao9c02dc52016-06-15 17:29:00 -0700263}
Elliott Hughes0ba53592017-02-01 16:59:15 -0800264
265subdirs = [
266 "crasher",
267]