blob: 37d54d74f74fd4a1c5816a65b982ec2e1d781df8 [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 Gaocbe70cb2016-10-18 18:17:52 -07007 "-Wno-nullability-completeness",
8 "-Os",
9 ],
10
11 local_include_dirs: ["include"],
12}
13
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080014// Utility library to tombstoned and get an output fd.
15cc_library_static {
16 name: "libtombstoned_client",
17 defaults: ["debuggerd_defaults"],
18 srcs: [
19 "tombstoned_client.cpp",
20 "util.cpp",
21 ],
22
23 whole_static_libs: [
Christopher Ferrisac225782017-04-25 11:23:10 -070024 "libasync_safe",
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080025 "libcutils",
26 "libbase",
27 ],
28}
29
30// Core implementation, linked into libdebuggerd_handler and the dynamic linker.
Josh Gao9c02dc52016-06-15 17:29:00 -070031cc_library_static {
Josh Gaoe73c9322017-02-08 16:06:26 -080032 name: "libdebuggerd_handler_core",
Josh Gaocbe70cb2016-10-18 18:17:52 -070033 defaults: ["debuggerd_defaults"],
34 srcs: ["handler/debuggerd_handler.cpp"],
Josh Gao9c02dc52016-06-15 17:29:00 -070035
Josh Gaoe73c9322017-02-08 16:06:26 -080036 whole_static_libs: [
Christopher Ferrisac225782017-04-25 11:23:10 -070037 "libasync_safe",
Josh Gaoe73c9322017-02-08 16:06:26 -080038 "libdebuggerd",
39 ],
40
41 export_include_dirs: ["include"],
42}
43
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080044// Implementation with a no-op fallback.
Josh Gaoe73c9322017-02-08 16:06:26 -080045cc_library_static {
46 name: "libdebuggerd_handler",
47 defaults: ["debuggerd_defaults"],
48 srcs: ["handler/debuggerd_fallback_nop.cpp"],
49
50 whole_static_libs: [
51 "libdebuggerd_handler_core",
52 ],
53
54 export_include_dirs: ["include"],
55}
56
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080057// Fallback implementation.
Josh Gaoe73c9322017-02-08 16:06:26 -080058cc_library_static {
59 name: "libdebuggerd_handler_fallback",
60 defaults: ["debuggerd_defaults"],
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080061 srcs: [
62 "handler/debuggerd_fallback.cpp",
63 ],
Josh Gaoe73c9322017-02-08 16:06:26 -080064
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080065 whole_static_libs: [
66 "libdebuggerd_handler_core",
67 "libtombstoned_client",
Christopher Ferrisac225782017-04-25 11:23:10 -070068 "libasync_safe",
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080069 "libbase",
Josh Gaoe73c9322017-02-08 16:06:26 -080070 "libdebuggerd",
71 "libbacktrace",
72 "libunwind",
73 "liblzma",
74 "libcutils",
75 ],
Josh Gao9c02dc52016-06-15 17:29:00 -070076
Josh Gaocbe70cb2016-10-18 18:17:52 -070077 export_include_dirs: ["include"],
78}
79
80cc_library {
81 name: "libdebuggerd_client",
82 defaults: ["debuggerd_defaults"],
83 srcs: [
84 "client/debuggerd_client.cpp",
85 "util.cpp",
86 ],
87
88 shared_libs: [
89 "libbase",
90 "libcutils",
91 ],
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080092
Josh Gaocbe70cb2016-10-18 18:17:52 -070093 export_include_dirs: ["include"],
94}
95
Josh Gaoe73c9322017-02-08 16:06:26 -080096cc_library_static {
Josh Gaocbe70cb2016-10-18 18:17:52 -070097 name: "libdebuggerd",
98 defaults: ["debuggerd_defaults"],
99
100 srcs: [
101 "libdebuggerd/backtrace.cpp",
102 "libdebuggerd/elf_utils.cpp",
103 "libdebuggerd/open_files_list.cpp",
104 "libdebuggerd/tombstone.cpp",
105 "libdebuggerd/utility.cpp",
106 ],
107
108 target: {
109 android_arm: {
110 srcs: ["libdebuggerd/arm/machine.cpp"],
111 },
112 android_arm64: {
113 srcs: ["libdebuggerd/arm64/machine.cpp"],
114 },
115 android_mips: {
116 srcs: ["libdebuggerd/mips/machine.cpp"],
117 },
118 android_mips64: {
119 srcs: ["libdebuggerd/mips64/machine.cpp"],
120 },
121 android_x86: {
122 srcs: ["libdebuggerd/x86/machine.cpp"],
123 },
124 android_x86_64: {
125 srcs: ["libdebuggerd/x86_64/machine.cpp"],
126 },
Robert Sesek9eb02c92016-08-09 14:04:05 -0400127 },
Robert Sesek9eb02c92016-08-09 14:04:05 -0400128
Josh Gaocbe70cb2016-10-18 18:17:52 -0700129 local_include_dirs: ["libdebuggerd/include"],
130 export_include_dirs: ["libdebuggerd/include"],
Josh Gao9c02dc52016-06-15 17:29:00 -0700131
Josh Gaoe73c9322017-02-08 16:06:26 -0800132 static_libs: [
Josh Gaocbe70cb2016-10-18 18:17:52 -0700133 "libbacktrace",
Josh Gaoe73c9322017-02-08 16:06:26 -0800134 "libunwind",
135 "liblzma",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700136 "libbase",
137 "libcutils",
138 "liblog",
139 ],
140}
141
142cc_test {
143 name: "debuggerd_test",
144 defaults: ["debuggerd_defaults"],
145
146 cflags: ["-Wno-missing-field-initializers"],
147 srcs: [
148 "libdebuggerd/test/dump_memory_test.cpp",
149 "libdebuggerd/test/elf_fake.cpp",
150 "libdebuggerd/test/log_fake.cpp",
151 "libdebuggerd/test/open_files_list_test.cpp",
152 "libdebuggerd/test/property_fake.cpp",
153 "libdebuggerd/test/ptrace_fake.cpp",
154 "libdebuggerd/test/tombstone_test.cpp",
155 ],
156
157 target: {
158 android: {
159 srcs: [
Josh Gaoae9d7672017-03-24 16:26:03 -0700160 "client/debuggerd_client_test.cpp",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700161 "debuggerd_test.cpp",
Josh Gao352a8452017-03-30 16:46:21 -0700162 "tombstoned_client.cpp",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700163 "util.cpp"
164 ],
Christopher Ferrisac225782017-04-25 11:23:10 -0700165 static_libs: ["libasync_safe"],
Josh Gaocbe70cb2016-10-18 18:17:52 -0700166 },
167 },
168
169 shared_libs: [
170 "libbacktrace",
171 "libbase",
172 "libcutils",
Josh Gaoae9d7672017-03-24 16:26:03 -0700173 "libdebuggerd_client",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700174 ],
175
176 static_libs: [
Josh Gao352a8452017-03-30 16:46:21 -0700177 "libdebuggerd",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700178 ],
179
180 local_include_dirs: [
181 "libdebuggerd",
182 ],
183
184 compile_multilib: "both",
185 multilib: {
186 lib32: {
187 stem: "debuggerd_test32",
188 },
189 lib64: {
190 stem: "debuggerd_test64",
191 },
192 },
193}
194
195cc_binary {
196 name: "crash_dump",
197 srcs: [
198 "crash_dump.cpp",
199 "util.cpp",
200 ],
201 defaults: ["debuggerd_defaults"],
202
203 compile_multilib: "both",
204 multilib: {
205 lib32: {
206 suffix: "32",
207 },
208 lib64: {
209 suffix: "64",
210 },
211 },
212
Josh Gaoe73c9322017-02-08 16:06:26 -0800213 static_libs: [
Josh Gaoe1aa0ca2017-03-01 17:23:22 -0800214 "libtombstoned_client",
Josh Gaoe73c9322017-02-08 16:06:26 -0800215 "libdebuggerd",
216 "libcutils",
217 ],
218
Josh Gaocbe70cb2016-10-18 18:17:52 -0700219 shared_libs: [
220 "libbacktrace",
221 "libbase",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700222 "liblog",
223 "libprocinfo",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700224 ],
225}
226
227cc_binary {
228 name: "debuggerd",
229 srcs: [
230 "debuggerd.cpp",
231 ],
232 defaults: ["debuggerd_defaults"],
233
234 shared_libs: [
235 "libbase",
236 "libdebuggerd_client",
237 "liblog",
238 "libselinux",
239 ],
240
241 local_include_dirs: ["include"],
242}
243
244cc_binary {
245 name: "tombstoned",
246 srcs: [
247 "util.cpp",
248 "tombstoned/intercept_manager.cpp",
249 "tombstoned/tombstoned.cpp",
250 ],
251 defaults: ["debuggerd_defaults"],
252
253 static_libs: [
254 "libbase",
255 "libcutils",
256 "libevent",
257 "liblog",
258 ],
259
260 init_rc: ["tombstoned/tombstoned.rc"]
Josh Gao9c02dc52016-06-15 17:29:00 -0700261}
Elliott Hughes0ba53592017-02-01 16:59:15 -0800262
263subdirs = [
264 "crasher",
265]