blob: 2d6c7f5995bce1039b3d8ca7bd91f4a1994b27f9 [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
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080012 // util.cpp gets async signal safe logging via libc_logging,
13 // which defines its interface in bionic private headers.
14 include_dirs: ["bionic/libc"],
15
Josh Gaocbe70cb2016-10-18 18:17:52 -070016 local_include_dirs: ["include"],
17}
18
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080019// Utility library to tombstoned and get an output fd.
20cc_library_static {
21 name: "libtombstoned_client",
22 defaults: ["debuggerd_defaults"],
23 srcs: [
24 "tombstoned_client.cpp",
25 "util.cpp",
26 ],
27
28 whole_static_libs: [
29 "libc_logging",
30 "libcutils",
31 "libbase",
32 ],
33}
34
35// Core implementation, linked into libdebuggerd_handler and the dynamic linker.
Josh Gao9c02dc52016-06-15 17:29:00 -070036cc_library_static {
Josh Gaoe73c9322017-02-08 16:06:26 -080037 name: "libdebuggerd_handler_core",
Josh Gaocbe70cb2016-10-18 18:17:52 -070038 defaults: ["debuggerd_defaults"],
39 srcs: ["handler/debuggerd_handler.cpp"],
Josh Gao9c02dc52016-06-15 17:29:00 -070040
Josh Gaoe73c9322017-02-08 16:06:26 -080041 whole_static_libs: [
42 "libc_logging",
43 "libdebuggerd",
44 ],
45
46 export_include_dirs: ["include"],
47}
48
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080049// Implementation with a no-op fallback.
Josh Gaoe73c9322017-02-08 16:06:26 -080050cc_library_static {
51 name: "libdebuggerd_handler",
52 defaults: ["debuggerd_defaults"],
53 srcs: ["handler/debuggerd_fallback_nop.cpp"],
54
55 whole_static_libs: [
56 "libdebuggerd_handler_core",
57 ],
58
59 export_include_dirs: ["include"],
60}
61
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080062// Fallback implementation.
Josh Gaoe73c9322017-02-08 16:06:26 -080063cc_library_static {
64 name: "libdebuggerd_handler_fallback",
65 defaults: ["debuggerd_defaults"],
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080066 srcs: [
67 "handler/debuggerd_fallback.cpp",
68 ],
Josh Gaoe73c9322017-02-08 16:06:26 -080069
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080070 whole_static_libs: [
71 "libdebuggerd_handler_core",
72 "libtombstoned_client",
73 "libbase",
Josh Gaoe73c9322017-02-08 16:06:26 -080074 "libdebuggerd",
75 "libbacktrace",
76 "libunwind",
77 "liblzma",
78 "libcutils",
79 ],
Josh Gao9c02dc52016-06-15 17:29:00 -070080
Josh Gaocbe70cb2016-10-18 18:17:52 -070081 export_include_dirs: ["include"],
82}
83
84cc_library {
85 name: "libdebuggerd_client",
86 defaults: ["debuggerd_defaults"],
87 srcs: [
88 "client/debuggerd_client.cpp",
89 "util.cpp",
90 ],
91
92 shared_libs: [
93 "libbase",
94 "libcutils",
95 ],
Josh Gaoe1aa0ca2017-03-01 17:23:22 -080096
Josh Gaocbe70cb2016-10-18 18:17:52 -070097 export_include_dirs: ["include"],
98}
99
Josh Gaoe73c9322017-02-08 16:06:26 -0800100cc_library_static {
Josh Gaocbe70cb2016-10-18 18:17:52 -0700101 name: "libdebuggerd",
102 defaults: ["debuggerd_defaults"],
103
104 srcs: [
105 "libdebuggerd/backtrace.cpp",
106 "libdebuggerd/elf_utils.cpp",
107 "libdebuggerd/open_files_list.cpp",
108 "libdebuggerd/tombstone.cpp",
109 "libdebuggerd/utility.cpp",
110 ],
111
112 target: {
113 android_arm: {
114 srcs: ["libdebuggerd/arm/machine.cpp"],
115 },
116 android_arm64: {
117 srcs: ["libdebuggerd/arm64/machine.cpp"],
118 },
119 android_mips: {
120 srcs: ["libdebuggerd/mips/machine.cpp"],
121 },
122 android_mips64: {
123 srcs: ["libdebuggerd/mips64/machine.cpp"],
124 },
125 android_x86: {
126 srcs: ["libdebuggerd/x86/machine.cpp"],
127 },
128 android_x86_64: {
129 srcs: ["libdebuggerd/x86_64/machine.cpp"],
130 },
Robert Sesek9eb02c92016-08-09 14:04:05 -0400131 },
Robert Sesek9eb02c92016-08-09 14:04:05 -0400132
Josh Gaocbe70cb2016-10-18 18:17:52 -0700133 local_include_dirs: ["libdebuggerd/include"],
134 export_include_dirs: ["libdebuggerd/include"],
Josh Gao9c02dc52016-06-15 17:29:00 -0700135
Josh Gaoe73c9322017-02-08 16:06:26 -0800136 static_libs: [
Josh Gaocbe70cb2016-10-18 18:17:52 -0700137 "libbacktrace",
Josh Gaoe73c9322017-02-08 16:06:26 -0800138 "libunwind",
139 "liblzma",
Josh Gaocbe70cb2016-10-18 18:17:52 -0700140 "libbase",
141 "libcutils",
142 "liblog",
143 ],
144}
145
146cc_test {
147 name: "debuggerd_test",
148 defaults: ["debuggerd_defaults"],
149
150 cflags: ["-Wno-missing-field-initializers"],
151 srcs: [
152 "libdebuggerd/test/dump_memory_test.cpp",
153 "libdebuggerd/test/elf_fake.cpp",
154 "libdebuggerd/test/log_fake.cpp",
155 "libdebuggerd/test/open_files_list_test.cpp",
156 "libdebuggerd/test/property_fake.cpp",
157 "libdebuggerd/test/ptrace_fake.cpp",
158 "libdebuggerd/test/tombstone_test.cpp",
159 ],
160
161 target: {
162 android: {
163 srcs: [
164 "debuggerd_test.cpp",
165 "util.cpp"
166 ],
167 },
168 },
169
170 shared_libs: [
171 "libbacktrace",
172 "libbase",
173 "libcutils",
174 ],
175
176 static_libs: [
177 "libdebuggerd"
178 ],
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",
224 "libselinux",
225 ],
226}
227
228cc_binary {
229 name: "debuggerd",
230 srcs: [
231 "debuggerd.cpp",
232 ],
233 defaults: ["debuggerd_defaults"],
234
235 shared_libs: [
236 "libbase",
237 "libdebuggerd_client",
238 "liblog",
239 "libselinux",
240 ],
241
242 local_include_dirs: ["include"],
243}
244
245cc_binary {
246 name: "tombstoned",
247 srcs: [
248 "util.cpp",
249 "tombstoned/intercept_manager.cpp",
250 "tombstoned/tombstoned.cpp",
251 ],
252 defaults: ["debuggerd_defaults"],
253
254 static_libs: [
255 "libbase",
256 "libcutils",
257 "libevent",
258 "liblog",
259 ],
260
261 init_rc: ["tombstoned/tombstoned.rc"]
Josh Gao9c02dc52016-06-15 17:29:00 -0700262}
Elliott Hughes0ba53592017-02-01 16:59:15 -0800263
264subdirs = [
265 "crasher",
266]