1 # Option to pass to Python scripts to set the C compiler. Rewriting
2 # MODULE_NAME is required to enable the _ISOMAC verbatim header
4 sysdeps-linux-python-cc
= \
5 --cc="$(CC) $(patsubst -DMODULE_NAME=%,-DMODULE_NAME=testsuite,$(CPPFLAGS))"
7 # Additional dependencies for Python scripts.
8 sysdeps-linux-python-deps
= \
9 $(..
)sysdeps
/unix
/sysv
/linux
/glibcsyscalls.py \
10 $(..
)scripts
/glibcextract.py
12 # Invocation of the Python interpreter with the Python search path.
13 sysdeps-linux-python
= \
14 PYTHONPATH
=$(..
)scripts
:$(..
)sysdeps
/unix
/sysv
/linux
$(PYTHON
)
17 # This target performs two actions:
19 # Replace <arch-syscall.h> with a file generated from kernel headers
20 # and <fixup-asm-unistd.h>. Both files are located via the sysdeps
21 # override search path.
23 # Update sysdeps/unix/sysv/linux/syscall-names.list with additional
24 # names found in the generated <arch-syscall.h> file, so that the
25 # global system call names list is a superset of the
26 # architecture-specific system call names.
28 # To bootstrap a new architecture, create an empty file in the right
29 # place and run `make update-syscall-lists' from the top-level of a
30 # configured, but not-yet-built glibc tree.
32 # --lock points to a file not replaced during the update operation, so
33 # that mutual exclusion is achieved.
34 .PHONY
: update-syscall-lists
35 update-syscall-lists
: arch-syscall.h
36 $(sysdeps-linux-python
) \
37 sysdeps
/unix
/sysv
/linux
/update-syscall-lists.py \
38 $(sysdeps-linux-python-cc
) \
39 --lock
=sysdeps
/unix
/sysv
/linux
/update-syscall-lists.py
$< \
40 sysdeps
/unix
/sysv
/linux
/syscall-names.list
44 sysdep_routines
+= errno-loc
47 ifeq ($(subdir
),assert
)
48 CFLAGS-assert.c
+= -DFATAL_PREPARE_INCLUDE
='<fatal-prepare.h>'
49 CFLAGS-assert-perr.c
+= -DFATAL_PREPARE_INCLUDE
='<fatal-prepare.h>'
52 ifeq ($(subdir
),malloc
)
53 CFLAGS-malloc.c
+= -DMORECORE_CLEARS
=2
57 sysdep_routines
+= adjtimex clone umount umount2 readahead sysctl \
58 setfsuid setfsgid epoll_pwait signalfd \
59 eventfd eventfd_read eventfd_write prlimit prlimit64 \
60 personality epoll_wait tee vmsplice splice \
61 open_by_handle_at mlock2 pkey_mprotect pkey_set pkey_get \
62 timerfd_gettime timerfd_settime prctl \
63 process_vm_readv process_vm_writev clock_adjtime \
65 xstat fxstat lxstat xstat64 fxstat64 lxstat64 \
67 xmknod xmknodat convert_scm_timestamps \
69 clone3 clone-internal \
73 CFLAGS-gethostid.c
= -fexceptions
74 CFLAGS-tee.c
= -fexceptions
-fasynchronous-unwind-tables
75 CFLAGS-vmsplice.c
= -fexceptions
-fasynchronous-unwind-tables
76 CFLAGS-splice.c
= -fexceptions
-fasynchronous-unwind-tables
77 CFLAGS-open_by_handle_at.c
= -fexceptions
-fasynchronous-unwind-tables
78 CFLAGS-sync_file_range.c
= -fexceptions
-fasynchronous-unwind-tables
79 CFLAGS-pselect32.c
= -fexceptions
-fasynchronous-unwind-tables
80 CFLAGS-tst-writev.c
+= "-DARTIFICIAL_LIMIT=(0x80000000-sysconf(_SC_PAGESIZE))"
82 sysdep_headers
+= sys
/mount.h sys
/acct.h \
84 sys
/user.h sys
/prctl.h \
85 sys
/kd.h sys
/soundcard.h sys
/vt.h \
86 sys
/quota.h sys
/fsuid.h \
87 scsi
/sg.h scsi
/scsi.h scsi
/scsi_ioctl.h sys
/pci.h \
88 sys
/raw.h sys
/personality.h sys
/epoll.h \
89 bits
/a.out.h sys
/inotify.h sys
/signalfd.h sys
/eventfd.h \
90 sys
/timerfd.h sys
/fanotify.h bits
/eventfd.h bits
/inotify.h \
91 bits
/signalfd.h bits
/timerfd.h bits
/epoll.h \
92 bits
/socket_type.h bits
/syscall.h \
93 bits
/mman-linux.h bits
/mman-shared.h bits
/ptrace-shared.h \
94 bits
/siginfo-arch.h bits
/siginfo-consts-arch.h \
95 bits
/procfs.h bits
/procfs-id.h bits
/procfs-extra.h \
96 bits
/procfs-prregset.h bits
/mman-map-flags-generic.h \
98 bits
/termios-struct.h bits
/termios-c_cc.h \
99 bits
/termios-c_iflag.h bits
/termios-c_oflag.h \
100 bits
/termios-baud.h bits
/termios-c_cflag.h \
101 bits
/termios-c_lflag.h bits
/termios-tcflow.h \
102 bits
/termios-misc.h \
103 bits
/types
/struct_semid_ds.h \
104 bits
/types
/struct_msqid_ds.h \
105 bits
/types
/struct_shmid_ds.h \
108 bits
/struct_stat_time64_helper.h \
109 bits
/types
/struct_msqid64_ds.h \
110 bits
/types
/struct_msqid64_ds_helper.h \
111 bits
/types
/struct_semid64_ds.h \
112 bits
/types
/struct_semid64_ds_helper.h \
113 bits
/types
/struct_shmid64_ds.h \
114 bits
/types
/struct_shmid64_ds_helper.h \
115 bits
/pthread_stack_min.h bits
/pthread_stack_min-dynamic.h
117 tests
+= tst-clone tst-clone2 tst-clone3 tst-fanotify tst-personality \
118 tst-quota tst-sync_file_range tst-sysconf-iov_max tst-ttyname \
119 test-errno-linux tst-memfd_create tst-mlock2 tst-pkey \
120 tst-rlimit-infinity tst-ofdlocks tst-gettid tst-gettid-kill \
121 tst-tgkill tst-sysvsem-linux tst-sysvmsg-linux tst-sysvshm-linux \
122 tst-timerfd tst-ppoll \
123 tst-clock_adjtime tst-adjtimex tst-ntp_adjtime tst-ntp_gettime \
124 tst-ntp_gettimex tst-sigtimedwait tst-misalign-clone \
129 # Test for the symbol version of fcntl that was replaced in glibc 2.28.
130 ifeq ($(have-GLIBC_2.27
)$(build-shared
),yesyes
)
131 tests
+= tst-ofdlocks-compat
136 tst-sigcontext-get_pc \
139 ifneq (no
,$(have-tunables
))
142 # tests-internal $(have-tunables)
146 tst-adjtimex-time64 \
147 tst-clock_adjtime-time64 \
148 tst-ntp_adjtime-time64 \
149 tst-ntp_gettime-time64 \
150 tst-ntp_gettimex-time64 \
152 tst-sigtimedwait-time64 \
155 tst-scm_rights-time64 \
158 tests-clone-internal
= \
159 tst-align-clone-internal \
160 tst-clone2-internal \
161 tst-clone3-internal \
162 tst-getpid1-internal \
163 tst-misalign-clone-internal
164 tests-internal
+= $(tests-clone-internal
)
165 tests-static
+= $(tests-clone-internal
)
167 CFLAGS-tst-sigcontext-get_pc.c
= -fasynchronous-unwind-tables
169 # Generate the list of SYS_* macros for the system calls (__NR_*
170 # macros). The file syscall-names.list contains all possible system
171 # call names, and the generated header file produces SYS_* macros for
172 # the __NR_* macros which are actually defined.
174 generated
+= bits
/syscall.h
175 $(objpfx
)bits
/syscall.h
: \
176 ..
/sysdeps
/unix
/sysv
/linux
/gen-syscall-h.awk \
177 ..
/sysdeps
/unix
/sysv
/linux
/syscall-names.list
178 $(make-target-directory
)
179 LC_ALL
=C
$(AWK
) -f
$^
> $@
-tmp
180 $(move-if-change
) $@
-tmp
$@
181 before-compile
+= $(objpfx
)bits
/syscall.h
183 # All macros defined by <sys/syscall.h>. Include <bits/syscall.h>
184 # explicitly because <sys/sycall.h> skips it if _LIBC is defined.
185 $(objpfx
)tst-syscall-list-macros.list
: \
186 $(objpfx
)bits
/syscall.h ..
/sysdeps
/unix
/sysv
/linux
/sys
/syscall.h
187 printf
'#include <linux/version.h>\n\
188 #include <sys/syscall.h>\n#include <bits/syscall.h>\n' | \
189 $(CC
) -E
-o
$@
-tmp
$(CFLAGS
) $(CPPFLAGS
) -x c
- -dM
190 $(move-if-change
) $@
-tmp
$@
192 # __NR_* system call names. Used by the test below.
193 $(objpfx
)tst-syscall-list-nr.list
: \
194 ..
/sysdeps
/unix
/sysv
/linux
/filter-nr-syscalls.awk \
195 $(objpfx
)tst-syscall-list-macros.list
196 LC_ALL
=C
$(AWK
) -f
$^
> $@
-tmp
197 $(move-if-change
) $@
-tmp
$@
199 # SYS_* system call names. Used by the test below.
200 $(objpfx
)tst-syscall-list-sys.list
: $(objpfx
)tst-syscall-list-macros.list
201 LC_ALL
=C
$(AWK
) '/^#define SYS_/ { print substr($$2, 5) }' $< > $@
-tmp
202 $(move-if-change
) $@
-tmp
$@
204 tests-special
+= $(objpfx
)tst-syscall-list.out
205 $(objpfx
)tst-syscall-list.out
: \
206 ..
/sysdeps
/unix
/sysv
/linux
/tst-syscall-list.sh \
207 $(objpfx
)tst-syscall-list-macros.list \
208 $(objpfx
)tst-syscall-list-nr.list \
209 $(objpfx
)tst-syscall-list-sys.list
210 $(BASH
) $^
$(AWK
) > $@
; $(evaluate-test
)
212 tests-special
+= $(objpfx
)tst-glibcsyscalls.out
213 # arch-syscall.h is located via the sysdeps override search path.
214 $(objpfx
)tst-glibcsyscalls.out
: arch-syscall.h \
215 ..
/sysdeps
/unix
/sysv
/linux
/syscall-names.list
216 $(sysdeps-linux-python
) \
217 ..
/sysdeps
/unix
/sysv
/linux
/tst-glibcsyscalls.py \
218 $(sysdeps-linux-python-cc
) $< \
219 ..
/sysdeps
/unix
/sysv
/linux
/syscall-names.list \
220 < /dev
/null
> $@
2>&1; $(evaluate-test
)
221 $(objpfx
)tst-glibcsyscalls.out
: \
222 ..
/sysdeps
/unix
/sysv
/linux
/tst-glibcsyscalls.py \
223 $(sysdeps-linux-python-deps
)
225 # Separate object file for access to the constant from the UAPI header.
226 $(objpfx
)tst-sysconf-iov_max
: $(objpfx
)tst-sysconf-iov_max-uapi.o
228 tests-special
+= $(objpfx
)tst-mman-consts.out
229 $(objpfx
)tst-mman-consts.out
: ..
/sysdeps
/unix
/sysv
/linux
/tst-mman-consts.py
230 $(sysdeps-linux-python
) \
231 ..
/sysdeps
/unix
/sysv
/linux
/tst-mman-consts.py \
232 $(sysdeps-linux-python-cc
) \
233 < /dev
/null
> $@
2>&1; $(evaluate-test
)
234 $(objpfx
)tst-mman-consts.out
: $(sysdeps-linux-python-deps
)
236 tst-rseq-disable-ENV
= GLIBC_TUNABLES
=glibc.pthread.rseq
=0
238 endif # $(subdir) == misc
240 ifeq ($(subdir
),time
)
241 sysdep_headers
+= sys
/timex.h bits
/timex.h
243 sysdep_routines
+= ntp_gettime ntp_gettimex
246 tst-clock_gettime-clobber \
247 tst-gettimeofday-clobber \
252 ifeq ($(subdir
),signal
)
253 tests-special
+= $(objpfx
)tst-signal-numbers.out
254 # Depending on signal.o* is a hack. What we actually want is a dependency
255 # on signal.h and everything it includes. That's impractical to write
256 # in this context, but signal.c includes signal.h and not much else so it'll
257 # be conservatively correct.
258 $(objpfx
)tst-signal-numbers.out
: \
259 ..
/sysdeps
/unix
/sysv
/linux
/tst-signal-numbers.py \
261 $(sysdeps-linux-python
) \
262 ..
/sysdeps
/unix
/sysv
/linux
/tst-signal-numbers.py \
263 $(sysdeps-linux-python-cc
) \
264 < /dev
/null
> $@
2>&1; $(evaluate-test
)
265 $(objpfx
)tst-signal-numbers.out
: $(sysdeps-linux-python-deps
)
268 ifeq ($(subdir
),socket
)
269 sysdep_headers
+= net
/if_ppp.h net
/ppp-comp.h \
270 net
/ppp_defs.h net
/if_arp.h net
/route.h net
/ethernet.h \
271 net
/if_slip.h net
/if_packet.h net
/if_shaper.h \
272 bits
/socket-constants.h
273 sysdep_routines
+= cmsg_nxthdr
274 CFLAGS-recvmmsg.c
= -fexceptions
-fasynchronous-unwind-tables
275 CFLAGS-sendmmsg.c
= -fexceptions
-fasynchronous-unwind-tables
277 tests-special
+= $(objpfx
)tst-socket-consts.out
278 $(objpfx
)tst-socket-consts.out
: ..
/sysdeps
/unix
/sysv
/linux
/tst-socket-consts.py
279 PYTHONPATH
=..
/scripts \
280 $(PYTHON
) ..
/sysdeps
/unix
/sysv
/linux
/tst-socket-consts.py \
281 --cc="$(CC) $(patsubst -DMODULE_NAME=%, \
282 -DMODULE_NAME=testsuite, \
283 $(CPPFLAGS)) -D_ISOMAC" \
284 < /dev
/null
> $@
2>&1; $(evaluate-test
)
285 endif # $(subdir) == socket
287 ifeq ($(subdir
),sunrpc
)
288 sysdep_headers
+= nfs
/nfs.h
291 ifeq ($(subdir
),termios
)
292 sysdep_headers
+= termio.h
295 ifeq ($(subdir
),posix
)
296 sysdep_headers
+= bits
/initspin.h
298 sysdep_routines
+= sched_getcpu oldglob getcpu
300 tests
+= tst-affinity tst-affinity-pid
302 tests-static
:= tst-affinity-static
303 tests
+= $(tests-static
)
305 CFLAGS-fork.c
= $(libio-mtsafe
)
306 CFLAGS-getpid.o
= -fomit-frame-pointer
307 CFLAGS-getpid.os
= -fomit-frame-pointer
310 ifeq ($(subdir
),inet
)
311 sysdep_headers
+= netinet
/if_fddi.h netinet
/if_tr.h \
312 netipx
/ipx.h netash
/ash.h netax25
/ax25.h netatalk
/at.h \
313 netrom
/netrom.h netpacket
/packet.h netrose
/rose.h \
314 neteconet
/ec.h netiucv
/iucv.h
315 sysdep_routines
+= netlink_assert_response
318 # Don't compile the ctype glue code, since there is no old non-GNU C library.
321 ifeq ($(subdir
),dirent
)
322 sysdep_routines
+= getdirentries getdirentries64
323 tests
+= tst-getdents64
325 # The tested readdir64 symbol was replaced in glibc 2.2.
326 ifeq ($(have-GLIBC_2.1
.3)$(build-shared
),yesyes
)
327 tests
+= tst-readdir64-compat
329 endif # $(subdir) == dirent
332 CFLAGS-ypclnt.c
= -DUSE_BINDINGDIR
=1
336 sysdep_routines
+= xstatconv internal_statvfs \
337 sync_file_range fallocate fallocate64 \
338 close_nocancel fcntl_nocancel \
339 open_nocancel open64_nocancel \
340 openat_nocancel openat64_nocancel \
341 read_nocancel pread64_nocancel \
342 write_nocancel statx_cp stat_t64_cp
344 sysdep_headers
+= bits
/fcntl-linux.h
346 tests
+= tst-fallocate tst-fallocate64 tst-o_path-locks
350 sysdep-rtld-routines
+= dl-brk dl-sbrk dl-getcwd dl-openat64 dl-opendir
352 libof-lddlibc4
= lddlibc4
356 $(objpfx
)pldd
: $(objpfx
)xmalloc.o
360 CFLAGS-mq_send.c
+= -fexceptions
361 CFLAGS-mq_receive.c
+= -fexceptions
364 ifeq ($(subdir
),nscd
)
365 sysdep-CFLAGS
+= -DHAVE_EPOLL
-DHAVE_INOTIFY
-DHAVE_NETLINK
366 CFLAGS-gai.c
+= -DNEED_NETLINK
369 ifeq ($(subdir
),nptl
)
370 tests
+= tst-align-clone tst-getpid1
372 # tst-rseq-nptl is an internal test because it requires a definition of
373 # __NR_rseq from the internal system call list.
374 tests-internal
+= tst-rseq-nptl