blob: 6dc6675ac65694b12952342cf3954237f3983d19 [file] [log] [blame]
Josh Gaocbe70cb2016-10-18 18:17:52 -07001cc_defaults {
2 name: "debuggerd_defaults",
3 cflags: [
4 "-Wall",
5 "-Wextra",
6 "-Wno-error",
7 "-Wno-nullability-completeness",
8 "-Os",
9 ],
10
11 local_include_dirs: ["include"],
12}
13
Josh Gao9c02dc52016-06-15 17:29:00 -070014cc_library_static {
Josh Gaocbe70cb2016-10-18 18:17:52 -070015 name: "libdebuggerd_handler",
16 defaults: ["debuggerd_defaults"],
17 srcs: ["handler/debuggerd_handler.cpp"],
Josh Gao9c02dc52016-06-15 17:29:00 -070018
Josh Gaocbe70cb2016-10-18 18:17:52 -070019 // libdebuggerd_handler gets async signal safe logging via libc_logging,
20 // which defines its interface in bionic private headers.
21 include_dirs: ["bionic/libc"],
22 static_libs: ["libc_logging"],
Josh Gao9c02dc52016-06-15 17:29:00 -070023
Josh Gaocbe70cb2016-10-18 18:17:52 -070024 export_include_dirs: ["include"],
25}
26
27cc_library {
28 name: "libdebuggerd_client",
29 defaults: ["debuggerd_defaults"],
30 srcs: [
31 "client/debuggerd_client.cpp",
32 "util.cpp",
33 ],
34
35 shared_libs: [
36 "libbase",
37 "libcutils",
38 ],
39 export_include_dirs: ["include"],
40}
41
42cc_library {
43 name: "libdebuggerd",
44 defaults: ["debuggerd_defaults"],
45
46 srcs: [
47 "libdebuggerd/backtrace.cpp",
48 "libdebuggerd/elf_utils.cpp",
49 "libdebuggerd/open_files_list.cpp",
50 "libdebuggerd/tombstone.cpp",
51 "libdebuggerd/utility.cpp",
52 ],
53
54 target: {
55 android_arm: {
56 srcs: ["libdebuggerd/arm/machine.cpp"],
57 },
58 android_arm64: {
59 srcs: ["libdebuggerd/arm64/machine.cpp"],
60 },
61 android_mips: {
62 srcs: ["libdebuggerd/mips/machine.cpp"],
63 },
64 android_mips64: {
65 srcs: ["libdebuggerd/mips64/machine.cpp"],
66 },
67 android_x86: {
68 srcs: ["libdebuggerd/x86/machine.cpp"],
69 },
70 android_x86_64: {
71 srcs: ["libdebuggerd/x86_64/machine.cpp"],
72 },
Robert Sesek9eb02c92016-08-09 14:04:05 -040073 },
Robert Sesek9eb02c92016-08-09 14:04:05 -040074
Josh Gaocbe70cb2016-10-18 18:17:52 -070075 local_include_dirs: ["libdebuggerd/include"],
76 export_include_dirs: ["libdebuggerd/include"],
Josh Gao9c02dc52016-06-15 17:29:00 -070077
Josh Gaocbe70cb2016-10-18 18:17:52 -070078 shared_libs: [
79 "libbacktrace",
80 "libbase",
81 "libcutils",
82 "liblog",
83 ],
84}
85
86cc_test {
87 name: "debuggerd_test",
88 defaults: ["debuggerd_defaults"],
89
90 cflags: ["-Wno-missing-field-initializers"],
91 srcs: [
92 "libdebuggerd/test/dump_memory_test.cpp",
93 "libdebuggerd/test/elf_fake.cpp",
94 "libdebuggerd/test/log_fake.cpp",
95 "libdebuggerd/test/open_files_list_test.cpp",
96 "libdebuggerd/test/property_fake.cpp",
97 "libdebuggerd/test/ptrace_fake.cpp",
98 "libdebuggerd/test/tombstone_test.cpp",
99 ],
100
101 target: {
102 android: {
103 srcs: [
104 "debuggerd_test.cpp",
105 "util.cpp"
106 ],
107 },
108 },
109
110 shared_libs: [
111 "libbacktrace",
112 "libbase",
113 "libcutils",
114 ],
115
116 static_libs: [
117 "libdebuggerd"
118 ],
119
120 local_include_dirs: [
121 "libdebuggerd",
122 ],
123
124 compile_multilib: "both",
125 multilib: {
126 lib32: {
127 stem: "debuggerd_test32",
128 },
129 lib64: {
130 stem: "debuggerd_test64",
131 },
132 },
133}
134
135cc_binary {
136 name: "crash_dump",
137 srcs: [
138 "crash_dump.cpp",
139 "util.cpp",
140 ],
141 defaults: ["debuggerd_defaults"],
142
143 compile_multilib: "both",
144 multilib: {
145 lib32: {
146 suffix: "32",
147 },
148 lib64: {
149 suffix: "64",
150 },
151 },
152
153 shared_libs: [
154 "libbacktrace",
155 "libbase",
156 "libdebuggerd",
157 "liblog",
158 "libprocinfo",
159 "libselinux",
160 ],
161}
162
163cc_binary {
164 name: "debuggerd",
165 srcs: [
166 "debuggerd.cpp",
167 ],
168 defaults: ["debuggerd_defaults"],
169
170 shared_libs: [
171 "libbase",
172 "libdebuggerd_client",
173 "liblog",
174 "libselinux",
175 ],
176
177 local_include_dirs: ["include"],
178}
179
180cc_binary {
181 name: "tombstoned",
182 srcs: [
183 "util.cpp",
184 "tombstoned/intercept_manager.cpp",
185 "tombstoned/tombstoned.cpp",
186 ],
187 defaults: ["debuggerd_defaults"],
188
189 static_libs: [
190 "libbase",
191 "libcutils",
192 "libevent",
193 "liblog",
194 ],
195
196 init_rc: ["tombstoned/tombstoned.rc"]
Josh Gao9c02dc52016-06-15 17:29:00 -0700197}