blob: f3ac00e91e39444ed003c3d678bdcbf8f8913309 [file] [log] [blame]
Elliott Hughes77c3ff82017-09-08 17:11:00 -07001//
2// Copyright (C) 2006 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
16
17cc_binary {
18
19 srcs: [
20 "access.c",
21 "affinity.c",
22 "aio.c",
23 "basic_filters.c",
24 "bind.c",
25 "bjm.c",
26 "block.c",
27 "bpf.c",
28 "bpf_filter.c",
29 "bpf_seccomp_filter.c",
30 "bpf_sock_filter.c",
31 "btrfs.c",
32 "cacheflush.c",
33 "capability.c",
34 "chdir.c",
35 "chmod.c",
36 "clone.c",
37 "copy_file_range.c",
38 "count.c",
Elliott Hughes28e98bc2018-06-14 16:59:04 -070039 "delay.c",
Elliott Hughes77c3ff82017-09-08 17:11:00 -070040 "desc.c",
41 "dirent.c",
42 "dirent64.c",
43 "dm.c",
44 "dyxlat.c",
45 "epoll.c",
46 "error_prints.c",
47 "evdev.c",
Elliott Hughes28e98bc2018-06-14 16:59:04 -070048 "evdev_mpers.c",
Elliott Hughes77c3ff82017-09-08 17:11:00 -070049 "eventfd.c",
50 "execve.c",
51 "fadvise.c",
52 "fallocate.c",
53 "fanotify.c",
54 "fchownat.c",
55 "fcntl.c",
56 "fetch_bpf_fprog.c",
Elliott Hughesb7556142018-02-20 17:03:16 -080057 "fetch_indirect_syscall_args.c",
Elliott Hughes77c3ff82017-09-08 17:11:00 -070058 "fetch_struct_flock.c",
59 "fetch_struct_keyctl_kdf_params.c",
60 "fetch_struct_mmsghdr.c",
61 "fetch_struct_msghdr.c",
62 "fetch_struct_stat.c",
63 "fetch_struct_stat64.c",
64 "fetch_struct_statfs.c",
65 "file_handle.c",
66 "file_ioctl.c",
67 "filter_qualify.c",
68 "flock.c",
69 "fstatfs.c",
70 "fstatfs64.c",
71 "fs_x_ioctl.c",
72 "futex.c",
73 "getcpu.c",
74 "getcwd.c",
Elliott Hughesb7556142018-02-20 17:03:16 -080075 "getpagesize.c",
Elliott Hughes77c3ff82017-09-08 17:11:00 -070076 "getrandom.c",
77 "get_robust_list.c",
78 "hdio.c",
79 "hostname.c",
80 "inotify.c",
Elliott Hughes03a418e2018-06-15 13:11:40 -070081 "inotify_ioctl.c",
Elliott Hughes77c3ff82017-09-08 17:11:00 -070082 "io.c",
83 "ioctl.c",
84 "ioperm.c",
85 "iopl.c",
86 "ioprio.c",
87 "ipc.c",
88 "ipc_msg.c",
89 "ipc_msgctl.c",
90 "ipc_sem.c",
91 "ipc_shm.c",
92 "ipc_shmctl.c",
93 "kcmp.c",
94 "kexec.c",
95 "keyctl.c",
Elliott Hughesb7556142018-02-20 17:03:16 -080096 "kvm.c",
Elliott Hughes77c3ff82017-09-08 17:11:00 -070097 "ldt.c",
98 "link.c",
99 "listen.c",
100 "lookup_dcookie.c",
101 "loop.c",
102 "lseek.c",
103 "mem.c",
104 "membarrier.c",
105 "memfd_create.c",
106 "mknod.c",
Elliott Hughes28e98bc2018-06-14 16:59:04 -0700107 "mmap_cache.c",
Elliott Hughes03a418e2018-06-15 13:11:40 -0700108 "mmap_notify.c",
Elliott Hughes77c3ff82017-09-08 17:11:00 -0700109 "mmsghdr.c",
110 "mount.c",
111 "mq.c",
112 "msghdr.c",
113 "mtd.c",
114 "net.c",
115 "netlink.c",
116 "netlink_crypto.c",
117 "netlink_inet_diag.c",
Elliott Hughes03a418e2018-06-15 13:11:40 -0700118 "netlink_kobject_uevent.c",
Elliott Hughes28e98bc2018-06-14 16:59:04 -0700119 "netlink_netfilter.c",
Elliott Hughes77c3ff82017-09-08 17:11:00 -0700120 "netlink_netlink_diag.c",
121 "netlink_packet_diag.c",
122 "netlink_route.c",
123 "netlink_selinux.c",
124 "netlink_smc_diag.c",
125 "netlink_sock_diag.c",
126 "netlink_unix_diag.c",
127 "nlattr.c",
128 "nsfs.c",
129 "numa.c",
130 "number_set.c",
131 "oldstat.c",
132 "open.c",
133 "pathtrace.c",
134 "perf.c",
Elliott Hughes03a418e2018-06-15 13:11:40 -0700135 "perf_ioctl.c",
Elliott Hughes77c3ff82017-09-08 17:11:00 -0700136 "personality.c",
137 "pkeys.c",
138 "poll.c",
139 "prctl.c",
Elliott Hughes03a418e2018-06-15 13:11:40 -0700140 "print_aio_sigset.c",
Elliott Hughes77c3ff82017-09-08 17:11:00 -0700141 "print_dev_t.c",
142 "print_group_req.c",
143 "print_ifindex.c",
Elliott Hughes03a418e2018-06-15 13:11:40 -0700144 "print_mac.c",
Elliott Hughes77c3ff82017-09-08 17:11:00 -0700145 "print_mq_attr.c",
146 "print_msgbuf.c",
147 "print_sigevent.c",
148 "print_sg_req_info.c",
149 "print_statfs.c",
150 "print_struct_stat.c",
151 "print_time.c",
152 "print_timespec.c",
153 "print_timeval.c",
154 "print_timex.c",
155 "printmode.c",
156 "printrusage.c",
157 "printsiginfo.c",
158 "process.c",
159 "process_vm.c",
160 "ptp.c",
161 "quota.c",
162 "readahead.c",
163 "readlink.c",
164 "reboot.c",
165 "renameat.c",
166 "resource.c",
Elliott Hughes28e98bc2018-06-14 16:59:04 -0700167 "retval.c",
Elliott Hughes77c3ff82017-09-08 17:11:00 -0700168 "rtc.c",
169 "rtnl_addr.c",
170 "rtnl_addrlabel.c",
171 "rtnl_dcb.c",
172 "rtnl_link.c",
173 "rtnl_mdb.c",
174 "rtnl_neigh.c",
175 "rtnl_neightbl.c",
176 "rtnl_netconf.c",
177 "rtnl_nsid.c",
178 "rtnl_route.c",
179 "rtnl_rule.c",
180 "rtnl_tc.c",
181 "rtnl_tc_action.c",
182 "rt_sigframe.c",
183 "rt_sigreturn.c",
184 "sched.c",
185 "scsi.c",
186 "seccomp.c",
187 "sendfile.c",
188 "sg_io_v3.c",
189 "sg_io_v4.c",
190 "shutdown.c",
191 "sigaltstack.c",
192 "signal.c",
193 "signalfd.c",
194 "sigreturn.c",
195 "sock.c",
196 "sockaddr.c",
197 "socketcall.c",
198 "socketutils.c",
199 "sram_alloc.c",
200 "stat.c",
201 "stat64.c",
202 "statfs.c",
203 "statfs64.c",
204 "statx.c",
205 "strace.c",
206 "string_to_uint.c",
207 "swapon.c",
208 "sync_file_range.c",
209 "sync_file_range2.c",
210 "syscall.c",
211 "sysctl.c",
212 "sysinfo.c",
213 "syslog.c",
214 "sysmips.c",
215 "term.c",
216 "time.c",
217 "times.c",
218 "truncate.c",
219 "ubi.c",
220 "ucopy.c",
221 "uid16.c",
222 "uid.c",
223 "umask.c",
224 "umount.c",
225 "uname.c",
226 "upeek.c",
227 "upoke.c",
228 "userfaultfd.c",
229 "ustat.c",
230 "util.c",
231 "utime.c",
232 "utimes.c",
233 "v4l2.c",
234 "wait.c",
235 "xattr.c",
236 "xlat.c",
237 "xmalloc.c",
238 ],
239
240 // We have "config.h", but since we're using one file for both LP32 and LP64,
241 // we need to set the hard-coded size #defines here instead.
242 cflags: ["-DHAVE_CONFIG_H"] + [
243 "-DSIZEOF_KERNEL_LONG_T=SIZEOF_LONG",
244 "-DSIZEOF_OFF_T=SIZEOF_LONG",
245 ] + [
246 "-Wall",
247 "-Werror",
Elliott Hughes03a418e2018-06-15 13:11:40 -0700248 "-Wno-initializer-overrides",
Elliott Hughes77c3ff82017-09-08 17:11:00 -0700249 "-Wno-missing-field-initializers",
250 "-Wno-pointer-arith",
251 "-Wno-unused-parameter",
252 "-Wno-sign-compare",
253 "-fno-strict-aliasing",
254 ],
255 multilib: {
256 lib32: {
257 cflags: [
258 "-DSIZEOF_LONG_LONG=8",
259 "-DSIZEOF_LONG=4",
260 "-DSIZEOF_RLIM_T=4",
261 "-DHAVE_STRUCT_STAT64=1",
262 ],
263 },
264 lib64: {
265 cflags: [
266 "-DSIZEOF_LONG_LONG=8",
267 "-DSIZEOF_LONG=8",
268 "-DSIZEOF_RLIM_T=8",
269 ],
270 },
271 },
272
273 arch: {
274 arm: {
275 cflags: ["-DARM=1"] + ["-DHAVE_STRUCT___OLD_KERNEL_STAT=1"],
276
277 local_include_dirs: [
278 "linux/arm",
279 "linux",
280 ],
281 },
282 arm64: {
283 cflags: ["-DAARCH64=1"],
284
285 local_include_dirs: [
286 "linux/aarch64",
287 "linux",
288 ],
289 },
290 mips: {
291 enabled: false,
292 },
293 mips64: {
294 enabled: false,
295 },
296 x86: {
297 cflags: ["-DI386=1"] + ["-DHAVE_STRUCT___OLD_KERNEL_STAT=1"],
298
299 local_include_dirs: [
300 "linux/i386",
301 "linux",
302 ],
303 },
304 x86_64: {
305 cflags: ["-DX86_64=1"],
306
307 local_include_dirs: [
308 "linux/x86_64",
309 "linux",
310 ],
311 },
312 },
313
314 name: "strace",
315
Elliott Hughes77c3ff82017-09-08 17:11:00 -0700316}