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 $(..
)scripts
/glibcextract.py \
10 $(..
)sysdeps
/unix
/sysv
/linux
/glibcsyscalls.py \
11 # sysdeps-linux-python-deps
13 # Invocation of the Python interpreter with the Python search path.
14 sysdeps-linux-python
= \
15 PYTHONPATH
=$(..
)scripts
:$(..
)sysdeps
/unix
/sysv
/linux
$(PYTHON
)
18 # This target performs two actions:
20 # Replace <arch-syscall.h> with a file generated from kernel headers
21 # and <fixup-asm-unistd.h>. Both files are located via the sysdeps
22 # override search path.
24 # Update sysdeps/unix/sysv/linux/syscall-names.list with additional
25 # names found in the generated <arch-syscall.h> file, so that the
26 # global system call names list is a superset of the
27 # architecture-specific system call names.
29 # To bootstrap a new architecture, create an empty file in the right
30 # place and run `make update-syscall-lists' from the top-level of a
31 # configured, but not-yet-built glibc tree.
33 # --lock points to a file not replaced during the update operation, so
34 # that mutual exclusion is achieved.
35 .PHONY
: update-syscall-lists
36 update-syscall-lists
: arch-syscall.h
37 $(sysdeps-linux-python
) \
38 sysdeps
/unix
/sysv
/linux
/update-syscall-lists.py \
39 $(sysdeps-linux-python-cc
) \
40 --lock
=sysdeps
/unix
/sysv
/linux
/update-syscall-lists.py
$< \
41 sysdeps
/unix
/sysv
/linux
/syscall-names.list
50 ifeq ($(subdir
),assert
)
51 CFLAGS-assert.c
+= -DFATAL_PREPARE_INCLUDE
='<fatal-prepare.h>'
52 CFLAGS-assert-perr.c
+= -DFATAL_PREPARE_INCLUDE
='<fatal-prepare.h>'
55 ifeq ($(subdir
),malloc
)
56 CFLAGS-malloc.c
+= -DMORECORE_CLEARS
=2
67 convert_scm_timestamps \
114 CFLAGS-gethostid.c
= -fexceptions
115 CFLAGS-tee.c
= -fexceptions
-fasynchronous-unwind-tables
116 CFLAGS-vmsplice.c
= -fexceptions
-fasynchronous-unwind-tables
117 CFLAGS-splice.c
= -fexceptions
-fasynchronous-unwind-tables
118 CFLAGS-open_by_handle_at.c
= -fexceptions
-fasynchronous-unwind-tables
119 CFLAGS-sync_file_range.c
= -fexceptions
-fasynchronous-unwind-tables
120 CFLAGS-pselect32.c
= -fexceptions
-fasynchronous-unwind-tables
121 CFLAGS-tst-writev.c
+= "-DARTIFICIAL_LIMIT=(0x80000000-sysconf(_SC_PAGESIZE))"
123 # The test triggers FORTIFY abortion due to purposely wrong parameters
124 CFLAGS-test-errno-linux.c
+= $(no-fortify-source
)
132 bits
/mman-map-flags-generic.h \
134 bits
/procfs-extra.h \
136 bits
/procfs-prregset.h \
138 bits
/pthread_stack_min-dynamic.h \
139 bits
/pthread_stack_min.h \
140 bits
/ptrace-shared.h \
143 bits
/siginfo-arch.h \
144 bits
/siginfo-consts-arch.h \
148 bits
/struct_stat_time64_helper.h \
150 bits
/termios-baud.h \
151 bits
/termios-c_cc.h \
152 bits
/termios-c_cflag.h \
153 bits
/termios-c_iflag.h \
154 bits
/termios-c_lflag.h \
155 bits
/termios-c_oflag.h \
156 bits
/termios-misc.h \
157 bits
/termios-struct.h \
158 bits
/termios-tcflow.h \
160 bits
/types
/struct_msqid64_ds.h \
161 bits
/types
/struct_msqid64_ds_helper.h \
162 bits
/types
/struct_semid64_ds.h \
163 bits
/types
/struct_semid64_ds_helper.h \
164 bits
/types
/struct_semid_ds.h \
165 bits
/types
/struct_shmid64_ds.h \
166 bits
/types
/struct_shmid64_ds_helper.h \
218 tst-process_mrelease \
220 tst-rlimit-infinity \
223 tst-sync_file_range \
224 tst-sysconf-iov_max \
231 tst-ttyname-namespace \
234 # process_madvise requires CAP_SYS_ADMIN.
236 tst-process_madvise \
239 # For +depfiles in Makerules.
241 tst-sysconf-iov_max-uapi.o \
244 # Test for the symbol version of fcntl that was replaced in glibc 2.28.
245 ifeq ($(have-GLIBC_2.27
)$(build-shared
),yesyes
)
247 tst-ofdlocks-compat \
253 tst-sigcontext-get_pc \
261 tst-adjtimex-time64 \
262 tst-clock_adjtime-time64 \
264 tst-ntp_adjtime-time64 \
265 tst-ntp_gettime-time64 \
266 tst-ntp_gettimex-time64 \
269 tst-scm_rights-time64 \
270 tst-sigtimedwait-time64 \
274 tests-clone-internal
= \
275 tst-align-clone-internal \
276 tst-clone2-internal \
277 tst-clone3-internal \
279 # tests-clone-internal
281 $(tests-clone-internal
) \
284 $(tests-clone-internal
) \
287 CFLAGS-tst-sigcontext-get_pc.c
= -fasynchronous-unwind-tables
289 # Generate the list of SYS_* macros for the system calls (__NR_*
290 # macros). The file syscall-names.list contains all possible system
291 # call names, and the generated header file produces SYS_* macros for
292 # the __NR_* macros which are actually defined.
294 generated
+= bits
/syscall.h
295 $(objpfx
)bits
/syscall.h
: \
296 ..
/sysdeps
/unix
/sysv
/linux
/gen-syscall-h.awk \
297 ..
/sysdeps
/unix
/sysv
/linux
/syscall-names.list
298 $(make-target-directory
)
299 LC_ALL
=C
$(AWK
) -f
$^
> $@
-tmp
300 $(move-if-change
) $@
-tmp
$@
301 before-compile
+= $(objpfx
)bits
/syscall.h
303 # All macros defined by <sys/syscall.h>. Include <bits/syscall.h>
304 # explicitly because <sys/sycall.h> skips it if _LIBC is defined.
305 $(objpfx
)tst-syscall-list-macros.list
: \
306 $(objpfx
)bits
/syscall.h ..
/sysdeps
/unix
/sysv
/linux
/sys
/syscall.h
307 printf
'#include <linux/version.h>\n\
308 #include <sys/syscall.h>\n#include <bits/syscall.h>\n' | \
309 $(CC
) -E
-o
$@
-tmp
$(CFLAGS
) $(CPPFLAGS
) -x c
- -dM
310 $(move-if-change
) $@
-tmp
$@
312 # __NR_* system call names. Used by the test below.
313 $(objpfx
)tst-syscall-list-nr.list
: \
314 ..
/sysdeps
/unix
/sysv
/linux
/filter-nr-syscalls.awk \
315 $(objpfx
)tst-syscall-list-macros.list
316 LC_ALL
=C
$(AWK
) -f
$^
> $@
-tmp
317 $(move-if-change
) $@
-tmp
$@
319 # SYS_* system call names. Used by the test below.
320 $(objpfx
)tst-syscall-list-sys.list
: $(objpfx
)tst-syscall-list-macros.list
321 LC_ALL
=C
$(AWK
) '/^#define SYS_/ { print substr($$2, 5) }' $< > $@
-tmp
322 $(move-if-change
) $@
-tmp
$@
325 $(objpfx
)tst-syscall-list.out
327 $(objpfx
)tst-syscall-list.out
: \
328 ..
/sysdeps
/unix
/sysv
/linux
/tst-syscall-list.sh \
329 $(objpfx
)tst-syscall-list-macros.list \
330 $(objpfx
)tst-syscall-list-nr.list \
331 $(objpfx
)tst-syscall-list-sys.list
332 $(BASH
) $^
$(AWK
) > $@
; $(evaluate-test
)
335 $(objpfx
)tst-glibcsyscalls.out
337 # arch-syscall.h is located via the sysdeps override search path.
338 $(objpfx
)tst-glibcsyscalls.out
: arch-syscall.h \
339 ..
/sysdeps
/unix
/sysv
/linux
/syscall-names.list
340 $(sysdeps-linux-python
) \
341 ..
/sysdeps
/unix
/sysv
/linux
/tst-glibcsyscalls.py \
342 $(sysdeps-linux-python-cc
) $< \
343 ..
/sysdeps
/unix
/sysv
/linux
/syscall-names.list \
344 < /dev
/null
> $@
2>&1; $(evaluate-test
)
345 $(objpfx
)tst-glibcsyscalls.out
: \
346 ..
/sysdeps
/unix
/sysv
/linux
/tst-glibcsyscalls.py \
347 $(sysdeps-linux-python-deps
)
349 # Separate object file for access to the constant from the UAPI header.
350 $(objpfx
)tst-sysconf-iov_max
: $(objpfx
)tst-sysconf-iov_max-uapi.o
353 $(objpfx
)tst-mman-consts.out \
355 $(objpfx
)tst-mman-consts.out
: ..
/sysdeps
/unix
/sysv
/linux
/tst-mman-consts.py
356 $(sysdeps-linux-python
) \
357 ..
/sysdeps
/unix
/sysv
/linux
/tst-mman-consts.py \
358 $(sysdeps-linux-python-cc
) \
359 < /dev
/null
> $@
2>&1; $(evaluate-test
)
360 $(objpfx
)tst-mman-consts.out
: $(sysdeps-linux-python-deps
)
363 $(objpfx
)tst-pidfd-consts.out \
365 $(objpfx
)tst-pidfd-consts.out
: ..
/sysdeps
/unix
/sysv
/linux
/tst-pidfd-consts.py
366 $(sysdeps-linux-python
) \
367 ..
/sysdeps
/unix
/sysv
/linux
/tst-pidfd-consts.py \
368 $(sysdeps-linux-python-cc
) \
369 < /dev
/null
> $@
2>&1; $(evaluate-test
)
370 $(objpfx
)tst-pidfd-consts.out
: $(sysdeps-linux-python-deps
)
373 $(objpfx
)tst-mount-consts.out \
375 $(objpfx
)tst-mount-consts.out
: ..
/sysdeps
/unix
/sysv
/linux
/tst-mount-consts.py
376 $(sysdeps-linux-python
) \
377 ..
/sysdeps
/unix
/sysv
/linux
/tst-mount-consts.py \
378 $(sysdeps-linux-python-cc
) \
379 < /dev
/null
> $@
2>&1; $(evaluate-test
)
380 $(objpfx
)tst-mount-consts.out
: $(sysdeps-linux-python-deps
)
383 $(objpfx
)tst-mount-compile.out \
385 $(objpfx
)tst-mount-compile.out
: ..
/sysdeps
/unix
/sysv
/linux
/tst-mount-compile.py
386 $(sysdeps-linux-python
) \
387 ..
/sysdeps
/unix
/sysv
/linux
/tst-mount-compile.py \
388 $(sysdeps-linux-python-cc
) \
389 < /dev
/null
> $@
2>&1; $(evaluate-test
)
390 $(objpfx
)tst-mount-compile.out
: $(sysdeps-linux-python-deps
)
392 tst-rseq-disable-ENV
= GLIBC_TUNABLES
=glibc.pthread.rseq
=0
394 endif # $(subdir) == misc
396 ifeq ($(subdir
),time
)
408 tst-clock_gettime-clobber \
409 tst-gettimeofday-clobber \
414 ifeq ($(subdir
),signal
)
416 $(objpfx
)tst-signal-numbers.out \
419 # Depending on signal.o* is a hack. What we actually want is a dependency
420 # on signal.h and everything it includes. That's impractical to write
421 # in this context, but signal.c includes signal.h and not much else so it'll
422 # be conservatively correct.
423 $(objpfx
)tst-signal-numbers.out
: \
424 ..
/sysdeps
/unix
/sysv
/linux
/tst-signal-numbers.py \
426 $(sysdeps-linux-python
) \
427 ..
/sysdeps
/unix
/sysv
/linux
/tst-signal-numbers.py \
428 $(sysdeps-linux-python-cc
) \
429 < /dev
/null
> $@
2>&1; $(evaluate-test
)
430 $(objpfx
)tst-signal-numbers.out
: $(sysdeps-linux-python-deps
)
433 ifeq ($(subdir
),socket
)
435 bits
/socket-constants.h \
451 CFLAGS-recvmmsg.c
= -fexceptions
-fasynchronous-unwind-tables
452 CFLAGS-sendmmsg.c
= -fexceptions
-fasynchronous-unwind-tables
455 tst-socket-timestamp \
456 tst-socket-timestamp-compat \
459 tst-socket-timestamp-compat-time64 \
460 tst-socket-timestamp-time64 \
464 $(objpfx
)tst-socket-consts.out \
466 $(objpfx
)tst-socket-consts.out
: ..
/sysdeps
/unix
/sysv
/linux
/tst-socket-consts.py
467 PYTHONPATH
=..
/scripts \
468 $(PYTHON
) ..
/sysdeps
/unix
/sysv
/linux
/tst-socket-consts.py \
469 --cc="$(CC) $(patsubst -DMODULE_NAME=%, \
470 -DMODULE_NAME=testsuite, \
471 $(CPPFLAGS)) -D_ISOMAC" \
472 < /dev
/null
> $@
2>&1; $(evaluate-test
)
473 endif # $(subdir) == socket
475 ifeq ($(subdir
),sunrpc
)
481 ifeq ($(subdir
),termios
)
487 ifeq ($(subdir
),posix
)
496 spawnattr_getcgroup_np \
497 spawnattr_setcgroup_np \
507 tst-affinity-static \
514 CFLAGS-fork.c
= $(libio-mtsafe
)
515 CFLAGS-getpid.o
= -fomit-frame-pointer
516 CFLAGS-getpid.os
= -fomit-frame-pointer
518 tst-spawn-cgroup-ARGS
= -- $(host-test-program-cmd
)
521 ifeq ($(subdir
),inet
)
537 netlink_assert_response \
540 CFLAGS-check_pf.c
+= -fexceptions
543 # Don't compile the ctype glue code, since there is no old non-GNU C library.
546 ifeq ($(subdir
),dirent
)
554 tst-readdir64-compat \
556 endif # $(subdir) == dirent
559 CFLAGS-ypclnt.c
= -DUSE_BINDINGDIR
=1
589 tst-getcwd-smallbuff \
595 sysdep-rtld-routines
+= \
601 # sysdep-rtld-routines
611 $(objpfx
)pldd
: $(objpfx
)xmalloc.o
615 CFLAGS-mq_send.c
+= -fexceptions
616 CFLAGS-mq_receive.c
+= -fexceptions
619 ifeq ($(subdir
),nscd
)
620 sysdep-CFLAGS
+= -DHAVE_EPOLL
-DHAVE_INOTIFY
-DHAVE_NETLINK
621 CFLAGS-gai.c
+= -DNEED_NETLINK
624 ifeq ($(subdir
),nptl
)
630 # tst-rseq-nptl is an internal test because it requires a definition of
631 # __NR_rseq from the internal system call list.