blob: 8ef0406b8b61bdc8740c3a6a9764a2e9fc4e442d [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",
Elliott Hughesc1873762018-12-19 15:13:36 -080065 "fetch_struct_xfs_quotastat.c",
Elliott Hughes77c3ff82017-09-08 17:11:00 -070066 "file_handle.c",
67 "file_ioctl.c",
68 "filter_qualify.c",
69 "flock.c",
70 "fstatfs.c",
71 "fstatfs64.c",
72 "fs_x_ioctl.c",
73 "futex.c",
74 "getcpu.c",
75 "getcwd.c",
Elliott Hughesb7556142018-02-20 17:03:16 -080076 "getpagesize.c",
Elliott Hughes77c3ff82017-09-08 17:11:00 -070077 "getrandom.c",
78 "get_robust_list.c",
79 "hdio.c",
80 "hostname.c",
81 "inotify.c",
Elliott Hughes03a418e2018-06-15 13:11:40 -070082 "inotify_ioctl.c",
Elliott Hughes77c3ff82017-09-08 17:11:00 -070083 "io.c",
84 "ioctl.c",
85 "ioperm.c",
86 "iopl.c",
87 "ioprio.c",
88 "ipc.c",
89 "ipc_msg.c",
90 "ipc_msgctl.c",
91 "ipc_sem.c",
92 "ipc_shm.c",
93 "ipc_shmctl.c",
94 "kcmp.c",
95 "kexec.c",
96 "keyctl.c",
Elliott Hughesb7556142018-02-20 17:03:16 -080097 "kvm.c",
Elliott Hughes77c3ff82017-09-08 17:11:00 -070098 "ldt.c",
99 "link.c",
100 "listen.c",
101 "lookup_dcookie.c",
102 "loop.c",
103 "lseek.c",
104 "mem.c",
105 "membarrier.c",
106 "memfd_create.c",
107 "mknod.c",
Elliott Hughes28e98bc2018-06-14 16:59:04 -0700108 "mmap_cache.c",
Elliott Hughes03a418e2018-06-15 13:11:40 -0700109 "mmap_notify.c",
Elliott Hughes77c3ff82017-09-08 17:11:00 -0700110 "mmsghdr.c",
111 "mount.c",
112 "mq.c",
113 "msghdr.c",
114 "mtd.c",
Elliott Hughesc1873762018-12-19 15:13:36 -0800115 "nbd_ioctl.c",
Elliott Hughes77c3ff82017-09-08 17:11:00 -0700116 "net.c",
117 "netlink.c",
118 "netlink_crypto.c",
119 "netlink_inet_diag.c",
Elliott Hughes03a418e2018-06-15 13:11:40 -0700120 "netlink_kobject_uevent.c",
Elliott Hughes28e98bc2018-06-14 16:59:04 -0700121 "netlink_netfilter.c",
Elliott Hughes77c3ff82017-09-08 17:11:00 -0700122 "netlink_netlink_diag.c",
123 "netlink_packet_diag.c",
124 "netlink_route.c",
125 "netlink_selinux.c",
126 "netlink_smc_diag.c",
127 "netlink_sock_diag.c",
128 "netlink_unix_diag.c",
129 "nlattr.c",
130 "nsfs.c",
131 "numa.c",
132 "number_set.c",
133 "oldstat.c",
134 "open.c",
135 "pathtrace.c",
136 "perf.c",
Elliott Hughes03a418e2018-06-15 13:11:40 -0700137 "perf_ioctl.c",
Elliott Hughes77c3ff82017-09-08 17:11:00 -0700138 "personality.c",
139 "pkeys.c",
140 "poll.c",
141 "prctl.c",
Elliott Hughes03a418e2018-06-15 13:11:40 -0700142 "print_aio_sigset.c",
Elliott Hughes77c3ff82017-09-08 17:11:00 -0700143 "print_dev_t.c",
144 "print_group_req.c",
145 "print_ifindex.c",
Elliott Hughes03a418e2018-06-15 13:11:40 -0700146 "print_mac.c",
Elliott Hughes77c3ff82017-09-08 17:11:00 -0700147 "print_mq_attr.c",
148 "print_msgbuf.c",
149 "print_sigevent.c",
150 "print_sg_req_info.c",
151 "print_statfs.c",
152 "print_struct_stat.c",
153 "print_time.c",
154 "print_timespec.c",
155 "print_timeval.c",
156 "print_timex.c",
157 "printmode.c",
158 "printrusage.c",
159 "printsiginfo.c",
160 "process.c",
161 "process_vm.c",
162 "ptp.c",
163 "quota.c",
164 "readahead.c",
165 "readlink.c",
166 "reboot.c",
167 "renameat.c",
168 "resource.c",
Elliott Hughes28e98bc2018-06-14 16:59:04 -0700169 "retval.c",
Elliott Hughes77c3ff82017-09-08 17:11:00 -0700170 "rtc.c",
171 "rtnl_addr.c",
172 "rtnl_addrlabel.c",
173 "rtnl_dcb.c",
174 "rtnl_link.c",
175 "rtnl_mdb.c",
176 "rtnl_neigh.c",
177 "rtnl_neightbl.c",
178 "rtnl_netconf.c",
179 "rtnl_nsid.c",
180 "rtnl_route.c",
181 "rtnl_rule.c",
182 "rtnl_tc.c",
183 "rtnl_tc_action.c",
184 "rt_sigframe.c",
185 "rt_sigreturn.c",
186 "sched.c",
187 "scsi.c",
188 "seccomp.c",
189 "sendfile.c",
190 "sg_io_v3.c",
191 "sg_io_v4.c",
192 "shutdown.c",
193 "sigaltstack.c",
194 "signal.c",
195 "signalfd.c",
196 "sigreturn.c",
197 "sock.c",
198 "sockaddr.c",
199 "socketcall.c",
200 "socketutils.c",
201 "sram_alloc.c",
202 "stat.c",
203 "stat64.c",
204 "statfs.c",
205 "statfs64.c",
206 "statx.c",
207 "strace.c",
208 "string_to_uint.c",
209 "swapon.c",
210 "sync_file_range.c",
211 "sync_file_range2.c",
212 "syscall.c",
213 "sysctl.c",
214 "sysinfo.c",
215 "syslog.c",
216 "sysmips.c",
217 "term.c",
218 "time.c",
219 "times.c",
220 "truncate.c",
221 "ubi.c",
222 "ucopy.c",
223 "uid16.c",
224 "uid.c",
225 "umask.c",
226 "umount.c",
227 "uname.c",
228 "upeek.c",
229 "upoke.c",
230 "userfaultfd.c",
231 "ustat.c",
232 "util.c",
233 "utime.c",
234 "utimes.c",
235 "v4l2.c",
236 "wait.c",
237 "xattr.c",
238 "xlat.c",
239 "xmalloc.c",
240 ],
241
242 // We have "config.h", but since we're using one file for both LP32 and LP64,
243 // we need to set the hard-coded size #defines here instead.
244 cflags: ["-DHAVE_CONFIG_H"] + [
245 "-DSIZEOF_KERNEL_LONG_T=SIZEOF_LONG",
246 "-DSIZEOF_OFF_T=SIZEOF_LONG",
247 ] + [
248 "-Wall",
249 "-Werror",
Elliott Hughes03a418e2018-06-15 13:11:40 -0700250 "-Wno-initializer-overrides",
Elliott Hughes77c3ff82017-09-08 17:11:00 -0700251 "-Wno-missing-field-initializers",
252 "-Wno-pointer-arith",
253 "-Wno-unused-parameter",
254 "-Wno-sign-compare",
255 "-fno-strict-aliasing",
256 ],
257 multilib: {
258 lib32: {
259 cflags: [
260 "-DSIZEOF_LONG_LONG=8",
261 "-DSIZEOF_LONG=4",
262 "-DSIZEOF_RLIM_T=4",
263 "-DHAVE_STRUCT_STAT64=1",
264 ],
265 },
266 lib64: {
267 cflags: [
268 "-DSIZEOF_LONG_LONG=8",
269 "-DSIZEOF_LONG=8",
270 "-DSIZEOF_RLIM_T=8",
271 ],
272 },
273 },
274
275 arch: {
276 arm: {
277 cflags: ["-DARM=1"] + ["-DHAVE_STRUCT___OLD_KERNEL_STAT=1"],
278
279 local_include_dirs: [
280 "linux/arm",
281 "linux",
282 ],
283 },
284 arm64: {
285 cflags: ["-DAARCH64=1"],
286
287 local_include_dirs: [
288 "linux/aarch64",
289 "linux",
290 ],
291 },
292 mips: {
293 enabled: false,
294 },
295 mips64: {
296 enabled: false,
297 },
298 x86: {
299 cflags: ["-DI386=1"] + ["-DHAVE_STRUCT___OLD_KERNEL_STAT=1"],
300
301 local_include_dirs: [
302 "linux/i386",
303 "linux",
304 ],
305 },
306 x86_64: {
307 cflags: ["-DX86_64=1"],
308
309 local_include_dirs: [
310 "linux/x86_64",
311 "linux",
312 ],
313 },
314 },
315
316 name: "strace",
317
Elliott Hughes77c3ff82017-09-08 17:11:00 -0700318}