1//
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",
39        "delay.c",
40        "desc.c",
41        "dirent.c",
42        "dirent64.c",
43        "dm.c",
44        "dyxlat.c",
45        "epoll.c",
46        "error_prints.c",
47        "evdev.c",
48        "evdev_mpers.c",
49        "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",
57        "fetch_indirect_syscall_args.c",
58        "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        "fetch_struct_xfs_quotastat.c",
66        "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",
76        "getpagesize.c",
77        "getrandom.c",
78        "get_robust_list.c",
79        "hdio.c",
80        "hostname.c",
81        "inotify.c",
82        "inotify_ioctl.c",
83        "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",
97        "kvm.c",
98        "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",
108        "mmap_cache.c",
109        "mmap_notify.c",
110        "mmsghdr.c",
111        "mount.c",
112        "mq.c",
113        "msghdr.c",
114        "mtd.c",
115        "nbd_ioctl.c",
116        "net.c",
117        "netlink.c",
118        "netlink_crypto.c",
119        "netlink_inet_diag.c",
120        "netlink_kobject_uevent.c",
121        "netlink_netfilter.c",
122        "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",
137        "perf_ioctl.c",
138        "personality.c",
139        "pkeys.c",
140        "poll.c",
141        "prctl.c",
142        "print_aio_sigset.c",
143        "print_dev_t.c",
144        "print_group_req.c",
145        "print_ifindex.c",
146        "print_mac.c",
147        "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",
169        "retval.c",
170        "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",
250        "-Wno-initializer-overrides",
251        "-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
318}
319