Use execveat syscall in fexecve (bug 22134)
[glibc.git] / sysdeps / unix / sysv / linux / Makefile
blob30bd167bae784f58c0a56fbed66f1fe751bb7c63
1 ifeq ($(subdir),csu)
2 sysdep_routines += errno-loc
3 endif
5 ifeq ($(subdir),assert)
6 CFLAGS-assert.c += -DFATAL_PREPARE_INCLUDE='<fatal-prepare.h>'
7 CFLAGS-assert-perr.c += -DFATAL_PREPARE_INCLUDE='<fatal-prepare.h>'
8 endif
10 ifeq ($(subdir),malloc)
11 CFLAGS-malloc.c += -DMORECORE_CLEARS=2
12 endif
14 ifeq ($(subdir),misc)
15 include $(firstword $(wildcard $(sysdirs:=/sysctl.mk)))
17 sysdep_routines += clone umount umount2 readahead \
18 setfsuid setfsgid epoll_pwait signalfd \
19 eventfd eventfd_read eventfd_write prlimit \
20 personality epoll_wait tee vmsplice splice \
21 open_by_handle_at
23 CFLAGS-gethostid.c = -fexceptions
24 CFLAGS-tee.c = -fexceptions -fasynchronous-unwind-tables
25 CFLAGS-vmsplice.c = -fexceptions -fasynchronous-unwind-tables
26 CFLAGS-splice.c = -fexceptions -fasynchronous-unwind-tables
27 CFLAGS-open_by_handle_at.c = -fexceptions -fasynchronous-unwind-tables
28 CFLAGS-sync_file_range.c = -fexceptions -fasynchronous-unwind-tables
29 CFLAGS-tst-writev.c += "-DARTIFICIAL_LIMIT=(0x80000000-sysconf(_SC_PAGESIZE))"
31 # Note that bits/mman-linux.h is listed here though the file lives in the
32 # top-level bits/ subdirectory instead of here in sysdeps/.../linux/bits/.
33 # That is just so that other (non-Linux) configurations for whom the
34 # bits/mman-linux.h definitions work well do not have to duplicate the
35 # contents of the file. The file must still be listed in sysdep_headers
36 # here and in any non-Linux configuration that uses it; other
37 # configurations will not install the file.
38 sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h \
39 sys/klog.h \
40 sys/user.h sys/prctl.h \
41 sys/kd.h sys/soundcard.h sys/vt.h \
42 sys/quota.h sys/fsuid.h \
43 scsi/sg.h scsi/scsi.h scsi/scsi_ioctl.h sys/pci.h \
44 sys/raw.h sys/personality.h sys/epoll.h \
45 bits/a.out.h sys/inotify.h sys/signalfd.h sys/eventfd.h \
46 sys/timerfd.h sys/fanotify.h bits/eventfd.h bits/inotify.h \
47 bits/signalfd.h bits/timerfd.h bits/epoll.h \
48 bits/socket_type.h bits/syscall.h bits/sysctl.h \
49 bits/mman-linux.h \
50 bits/siginfo-arch.h bits/siginfo-consts-arch.h
52 tests += tst-clone tst-clone2 tst-clone3 tst-fanotify tst-personality \
53 tst-quota tst-sync_file_range test-errno-linux
55 # Generate the list of SYS_* macros for the system calls (__NR_*
56 # macros). The file syscall-names.list contains all possible system
57 # call names, and the generated header file produces SYS_* macros for
58 # the __NR_* macros which are actually defined.
60 generated += bits/syscall.h
61 $(objpfx)bits/syscall.h: \
62 ../sysdeps/unix/sysv/linux/gen-syscall-h.awk \
63 ../sysdeps/unix/sysv/linux/syscall-names.list
64 $(make-target-directory)
65 LC_ALL=C $(AWK) -f $^ > $@-tmp
66 $(move-if-change) $@-tmp $@
67 before-compile += $(objpfx)bits/syscall.h
69 # All macros defined by <sys/syscall.h>. Include <bits/syscall.h>
70 # explicitly because <sys/sycall.h> skips it if _LIBC is defined.
71 $(objpfx)tst-syscall-list-macros.list: \
72 $(objpfx)bits/syscall.h ../sysdeps/unix/sysv/linux/sys/syscall.h
73 printf '#include <linux/version.h>\n\
74 #include <sys/syscall.h>\n#include <bits/syscall.h>\n' | \
75 $(CC) -E -o $@-tmp $(CFLAGS) $(CPPFLAGS) -x c - -dM
76 $(move-if-change) $@-tmp $@
78 # __NR_* system call names. Used by the test below.
79 $(objpfx)tst-syscall-list-nr.list: \
80 ../sysdeps/unix/sysv/linux/filter-nr-syscalls.awk \
81 $(objpfx)tst-syscall-list-macros.list
82 LC_ALL=C $(AWK) -f $^ > $@-tmp
83 $(move-if-change) $@-tmp $@
85 # SYS_* system call names. Used by the test below.
86 $(objpfx)tst-syscall-list-sys.list: $(objpfx)tst-syscall-list-macros.list
87 LC_ALL=C $(AWK) '/^#define SYS_/ { print substr($$2, 5) }' $< > $@-tmp
88 $(move-if-change) $@-tmp $@
90 tests-special += $(objpfx)tst-syscall-list.out
91 $(objpfx)tst-syscall-list.out: \
92 ../sysdeps/unix/sysv/linux/tst-syscall-list.sh \
93 $(objpfx)tst-syscall-list-macros.list \
94 $(objpfx)tst-syscall-list-nr.list \
95 $(objpfx)tst-syscall-list-sys.list
96 $(BASH) $^ $(AWK) > $@; $(evaluate-test)
98 endif # $(subdir) == misc
100 ifeq ($(subdir),time)
101 sysdep_headers += sys/timex.h bits/timex.h
103 sysdep_routines += ntp_gettime ntp_gettimex
104 endif
106 ifeq ($(subdir),signal)
107 tests-special += $(objpfx)tst-signal-numbers.out
108 # Depending on signal.o* is a hack. What we actually want is a dependency
109 # on signal.h and everything it includes. That's impractical to write
110 # in this context, but signal.c includes signal.h and not much else so it'll
111 # be conservatively correct.
112 $(objpfx)tst-signal-numbers.out: \
113 ../sysdeps/unix/sysv/linux/tst-signal-numbers.sh \
114 $(objpfx)signal.o*
115 AWK=$(AWK) $(SHELL) ../sysdeps/unix/sysv/linux/tst-signal-numbers.sh \
116 $(CC) $(patsubst -DMODULE_NAME=%,-DMODULE_NAME=testsuite,$(CPPFLAGS)) \
117 < /dev/null > $@; $(evaluate-test)
118 endif
120 ifeq ($(subdir),socket)
121 sysdep_headers += net/if_ppp.h net/ppp-comp.h \
122 net/ppp_defs.h net/if_arp.h net/route.h net/ethernet.h \
123 net/if_slip.h net/if_packet.h net/if_shaper.h
124 sysdep_routines += cmsg_nxthdr
125 CFLAGS-recvmmsg.c = -fexceptions -fasynchronous-unwind-tables
126 CFLAGS-sendmmsg.c = -fexceptions -fasynchronous-unwind-tables
127 endif
129 ifeq ($(subdir),sunrpc)
130 sysdep_headers += nfs/nfs.h
131 endif
133 ifeq ($(subdir),termios)
134 sysdep_headers += termio.h
135 endif
137 ifeq ($(subdir),posix)
138 sysdep_headers += bits/initspin.h
140 sysdep_routines += sched_getcpu oldglob
142 tests += tst-affinity tst-affinity-pid
144 CFLAGS-fork.c = $(libio-mtsafe)
145 CFLAGS-getpid.o = -fomit-frame-pointer
146 CFLAGS-getpid.os = -fomit-frame-pointer
147 endif
149 ifeq ($(subdir),inet)
150 sysdep_headers += netinet/if_fddi.h netinet/if_tr.h \
151 netipx/ipx.h netash/ash.h netax25/ax25.h netatalk/at.h \
152 netrom/netrom.h netpacket/packet.h netrose/rose.h \
153 neteconet/ec.h netiucv/iucv.h
154 sysdep_routines += netlink_assert_response
155 endif
157 # Don't compile the ctype glue code, since there is no old non-GNU C library.
158 inhibit-glue = yes
160 ifeq ($(subdir),dirent)
161 sysdep_routines += getdirentries getdirentries64
162 endif
164 ifeq ($(subdir),nis)
165 CFLAGS-ypclnt.c = -DUSE_BINDINGDIR=1
166 endif
168 ifeq ($(subdir),io)
169 sysdep_routines += xstatconv internal_statvfs internal_statvfs64 \
170 sync_file_range fallocate fallocate64
171 sysdep_headers += bits/fcntl-linux.h
173 tests += tst-fallocate tst-fallocate64
174 endif
176 ifeq ($(subdir),elf)
177 sysdep-rtld-routines += dl-brk dl-sbrk dl-getcwd dl-openat64 dl-opendir \
178 dl-fxstatat64
180 libof-lddlibc4 = lddlibc4
182 others += pldd
183 install-bin += pldd
184 $(objpfx)pldd: $(objpfx)xmalloc.o
185 endif
187 ifeq ($(subdir),rt)
188 CFLAGS-mq_send.c += -fexceptions
189 CFLAGS-mq_receive.c += -fexceptions
190 endif
192 ifeq ($(subdir),nscd)
193 sysdep-CFLAGS += -DHAVE_EPOLL -DHAVE_SENDFILE -DHAVE_INOTIFY -DHAVE_NETLINK
194 CFLAGS-gai.c += -DNEED_NETLINK
195 endif
197 ifeq ($(subdir),nptl)
198 tests += tst-align-clone tst-getpid1 \
199 tst-thread-affinity-pthread tst-thread-affinity-pthread2 \
200 tst-thread-affinity-sched
201 tests-internal += tst-setgetname
202 endif