]> git.ipfire.org Git - thirdparty/glibc.git/blob - sysdeps/unix/sysv/linux/Makefile
Fix tst-sigcontext-get_pc rule name from a43565ac447b1
[thirdparty/glibc.git] / sysdeps / unix / sysv / linux / Makefile
1 ifeq ($(subdir),csu)
2 sysdep_routines += errno-loc
3 endif
4
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
9
10 ifeq ($(subdir),malloc)
11 CFLAGS-malloc.c += -DMORECORE_CLEARS=2
12 endif
13
14 ifeq ($(subdir),misc)
15 include $(firstword $(wildcard $(sysdirs:=/sysctl.mk)))
16
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 mlock2 pkey_mprotect pkey_set pkey_get
22
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))"
30
31 sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h \
32 sys/klog.h \
33 sys/user.h sys/prctl.h \
34 sys/kd.h sys/soundcard.h sys/vt.h \
35 sys/quota.h sys/fsuid.h \
36 scsi/sg.h scsi/scsi.h scsi/scsi_ioctl.h sys/pci.h \
37 sys/raw.h sys/personality.h sys/epoll.h \
38 bits/a.out.h sys/inotify.h sys/signalfd.h sys/eventfd.h \
39 sys/timerfd.h sys/fanotify.h bits/eventfd.h bits/inotify.h \
40 bits/signalfd.h bits/timerfd.h bits/epoll.h \
41 bits/socket_type.h bits/syscall.h bits/sysctl.h \
42 bits/mman-linux.h bits/mman-shared.h bits/ptrace-shared.h \
43 bits/siginfo-arch.h bits/siginfo-consts-arch.h \
44 bits/procfs.h bits/procfs-id.h bits/procfs-extra.h \
45 bits/procfs-prregset.h bits/mman-map-flags-generic.h \
46 bits/msq-pad.h bits/sem-pad.h bits/shmlba.h bits/shm-pad.h \
47 bits/termios-struct.h bits/termios-c_cc.h \
48 bits/termios-c_iflag.h bits/termios-c_oflag.h \
49 bits/termios-baud.h bits/termios-c_cflag.h \
50 bits/termios-c_lflag.h bits/termios-tcflow.h \
51 bits/termios-misc.h
52
53 tests += tst-clone tst-clone2 tst-clone3 tst-fanotify tst-personality \
54 tst-quota tst-sync_file_range tst-sysconf-iov_max tst-ttyname \
55 test-errno-linux tst-memfd_create tst-mlock2 tst-pkey \
56 tst-rlimit-infinity tst-ofdlocks tst-gettid tst-gettid-kill \
57 tst-tgkill
58 tests-internal += tst-ofdlocks-compat tst-sigcontext-get_pc
59
60 CFLAGS-tst-sigcontext-get_pc.c = -fasynchronous-unwind-tables
61
62 # Generate the list of SYS_* macros for the system calls (__NR_*
63 # macros). The file syscall-names.list contains all possible system
64 # call names, and the generated header file produces SYS_* macros for
65 # the __NR_* macros which are actually defined.
66
67 generated += bits/syscall.h
68 $(objpfx)bits/syscall.h: \
69 ../sysdeps/unix/sysv/linux/gen-syscall-h.awk \
70 ../sysdeps/unix/sysv/linux/syscall-names.list
71 $(make-target-directory)
72 LC_ALL=C $(AWK) -f $^ > $@-tmp
73 $(move-if-change) $@-tmp $@
74 before-compile += $(objpfx)bits/syscall.h
75
76 # All macros defined by <sys/syscall.h>. Include <bits/syscall.h>
77 # explicitly because <sys/sycall.h> skips it if _LIBC is defined.
78 $(objpfx)tst-syscall-list-macros.list: \
79 $(objpfx)bits/syscall.h ../sysdeps/unix/sysv/linux/sys/syscall.h
80 printf '#include <linux/version.h>\n\
81 #include <sys/syscall.h>\n#include <bits/syscall.h>\n' | \
82 $(CC) -E -o $@-tmp $(CFLAGS) $(CPPFLAGS) -x c - -dM
83 $(move-if-change) $@-tmp $@
84
85 # __NR_* system call names. Used by the test below.
86 $(objpfx)tst-syscall-list-nr.list: \
87 ../sysdeps/unix/sysv/linux/filter-nr-syscalls.awk \
88 $(objpfx)tst-syscall-list-macros.list
89 LC_ALL=C $(AWK) -f $^ > $@-tmp
90 $(move-if-change) $@-tmp $@
91
92 # SYS_* system call names. Used by the test below.
93 $(objpfx)tst-syscall-list-sys.list: $(objpfx)tst-syscall-list-macros.list
94 LC_ALL=C $(AWK) '/^#define SYS_/ { print substr($$2, 5) }' $< > $@-tmp
95 $(move-if-change) $@-tmp $@
96
97 tests-special += $(objpfx)tst-syscall-list.out
98 $(objpfx)tst-syscall-list.out: \
99 ../sysdeps/unix/sysv/linux/tst-syscall-list.sh \
100 $(objpfx)tst-syscall-list-macros.list \
101 $(objpfx)tst-syscall-list-nr.list \
102 $(objpfx)tst-syscall-list-sys.list
103 $(BASH) $^ $(AWK) > $@; $(evaluate-test)
104
105 # Separate object file for access to the constant from the UAPI header.
106 $(objpfx)tst-sysconf-iov_max: $(objpfx)tst-sysconf-iov_max-uapi.o
107
108 $(objpfx)tst-pkey: $(shared-thread-library)
109
110 tests-special += $(objpfx)tst-mman-consts.out
111 $(objpfx)tst-mman-consts.out: ../sysdeps/unix/sysv/linux/tst-mman-consts.py
112 PYTHONPATH=../scripts \
113 $(PYTHON) ../sysdeps/unix/sysv/linux/tst-mman-consts.py \
114 --cc="$(CC) $(patsubst -DMODULE_NAME=%, \
115 -DMODULE_NAME=testsuite, \
116 $(CPPFLAGS))" \
117 < /dev/null > $@ 2>&1; $(evaluate-test)
118
119 $(objpfx)tst-gettid: $(shared-thread-library)
120 $(objpfx)tst-gettid-kill: $(shared-thread-library)
121 $(objpfx)tst-tgkill: $(shared-thread-library)
122
123 endif # $(subdir) == misc
124
125 ifeq ($(subdir),time)
126 sysdep_headers += sys/timex.h bits/timex.h
127
128 sysdep_routines += ntp_gettime ntp_gettimex
129 endif
130
131 ifeq ($(subdir),signal)
132 tests-special += $(objpfx)tst-signal-numbers.out
133 # Depending on signal.o* is a hack. What we actually want is a dependency
134 # on signal.h and everything it includes. That's impractical to write
135 # in this context, but signal.c includes signal.h and not much else so it'll
136 # be conservatively correct.
137 $(objpfx)tst-signal-numbers.out: \
138 ../sysdeps/unix/sysv/linux/tst-signal-numbers.py \
139 $(objpfx)signal.o*
140 PYTHONPATH=../scripts \
141 $(PYTHON) ../sysdeps/unix/sysv/linux/tst-signal-numbers.py \
142 --cc="$(CC) $(patsubst -DMODULE_NAME=%, \
143 -DMODULE_NAME=testsuite, \
144 $(CPPFLAGS))" \
145 < /dev/null > $@ 2>&1; $(evaluate-test)
146 endif
147
148 ifeq ($(subdir),socket)
149 sysdep_headers += net/if_ppp.h net/ppp-comp.h \
150 net/ppp_defs.h net/if_arp.h net/route.h net/ethernet.h \
151 net/if_slip.h net/if_packet.h net/if_shaper.h \
152 bits/socket-constants.h
153 sysdep_routines += cmsg_nxthdr
154 CFLAGS-recvmmsg.c = -fexceptions -fasynchronous-unwind-tables
155 CFLAGS-sendmmsg.c = -fexceptions -fasynchronous-unwind-tables
156
157 tests-special += $(objpfx)tst-socket-consts.out
158 $(objpfx)tst-socket-consts.out: ../sysdeps/unix/sysv/linux/tst-socket-consts.py
159 PYTHONPATH=../scripts \
160 $(PYTHON) ../sysdeps/unix/sysv/linux/tst-socket-consts.py \
161 --cc="$(CC) $(patsubst -DMODULE_NAME=%, \
162 -DMODULE_NAME=testsuite, \
163 $(CPPFLAGS)) -D_ISOMAC" \
164 < /dev/null > $@ 2>&1; $(evaluate-test)
165 endif # $(subdir) == socket
166
167 ifeq ($(subdir),sunrpc)
168 sysdep_headers += nfs/nfs.h
169 endif
170
171 ifeq ($(subdir),termios)
172 sysdep_headers += termio.h
173 endif
174
175 ifeq ($(subdir),posix)
176 sysdep_headers += bits/initspin.h
177
178 sysdep_routines += sched_getcpu oldglob getcpu
179
180 tests += tst-affinity tst-affinity-pid
181
182 tests-static := tst-affinity-static
183 tests += $(tests-static)
184
185 CFLAGS-fork.c = $(libio-mtsafe)
186 CFLAGS-getpid.o = -fomit-frame-pointer
187 CFLAGS-getpid.os = -fomit-frame-pointer
188 endif
189
190 ifeq ($(subdir),inet)
191 sysdep_headers += netinet/if_fddi.h netinet/if_tr.h \
192 netipx/ipx.h netash/ash.h netax25/ax25.h netatalk/at.h \
193 netrom/netrom.h netpacket/packet.h netrose/rose.h \
194 neteconet/ec.h netiucv/iucv.h
195 sysdep_routines += netlink_assert_response
196 endif
197
198 # Don't compile the ctype glue code, since there is no old non-GNU C library.
199 inhibit-glue = yes
200
201 ifeq ($(subdir),dirent)
202 sysdep_routines += getdirentries getdirentries64
203 tests += tst-getdents64
204 tests-internal += tst-readdir64-compat
205 endif
206
207 ifeq ($(subdir),nis)
208 CFLAGS-ypclnt.c = -DUSE_BINDINGDIR=1
209 endif
210
211 ifeq ($(subdir),io)
212 sysdep_routines += xstatconv internal_statvfs internal_statvfs64 \
213 sync_file_range fallocate fallocate64 \
214 close_nocancel fcntl_nocancel nanosleep_nocancel \
215 open_nocancel open64_nocancel \
216 openat_nocancel openat64_nocancel \
217 pause_nocancel read_nocancel waitpid_nocancel \
218 write_nocancel statx_cp
219
220 sysdep_headers += bits/fcntl-linux.h
221
222 tests += tst-fallocate tst-fallocate64
223 endif
224
225 ifeq ($(subdir),elf)
226 sysdep-rtld-routines += dl-brk dl-sbrk dl-getcwd dl-openat64 dl-opendir \
227 dl-fxstatat64
228
229 libof-lddlibc4 = lddlibc4
230
231 others += pldd
232 install-bin += pldd
233 $(objpfx)pldd: $(objpfx)xmalloc.o
234 endif
235
236 ifeq ($(subdir),rt)
237 CFLAGS-mq_send.c += -fexceptions
238 CFLAGS-mq_receive.c += -fexceptions
239 endif
240
241 ifeq ($(subdir),nscd)
242 sysdep-CFLAGS += -DHAVE_EPOLL -DHAVE_INOTIFY -DHAVE_NETLINK
243 CFLAGS-gai.c += -DNEED_NETLINK
244 endif
245
246 ifeq ($(subdir),nptl)
247 tests += tst-align-clone tst-getpid1 \
248 tst-thread-affinity-pthread tst-thread-affinity-pthread2 \
249 tst-thread-affinity-sched
250 tests-internal += tst-setgetname
251 endif