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
68 convert_scm_timestamps \
118 CFLAGS-gethostid.c
= -fexceptions
119 CFLAGS-tee.c
= -fexceptions
-fasynchronous-unwind-tables
120 CFLAGS-vmsplice.c
= -fexceptions
-fasynchronous-unwind-tables
121 CFLAGS-splice.c
= -fexceptions
-fasynchronous-unwind-tables
122 CFLAGS-open_by_handle_at.c
= -fexceptions
-fasynchronous-unwind-tables
123 CFLAGS-sync_file_range.c
= -fexceptions
-fasynchronous-unwind-tables
124 CFLAGS-pselect32.c
= -fexceptions
-fasynchronous-unwind-tables
125 CFLAGS-tst-writev.c
+= "-DARTIFICIAL_LIMIT=(0x80000000-sysconf(_SC_PAGESIZE))"
127 # The test triggers FORTIFY abortion due to purposely wrong parameters
128 CFLAGS-test-errno-linux.c
+= $(no-fortify-source
)
136 bits
/mman-map-flags-generic.h \
138 bits
/procfs-extra.h \
140 bits
/procfs-prregset.h \
142 bits
/pthread_stack_min-dynamic.h \
143 bits
/pthread_stack_min.h \
144 bits
/ptrace-shared.h \
147 bits
/siginfo-arch.h \
148 bits
/siginfo-consts-arch.h \
152 bits
/struct_stat_time64_helper.h \
154 bits
/termios-baud.h \
155 bits
/termios-c_cc.h \
156 bits
/termios-c_cflag.h \
157 bits
/termios-c_iflag.h \
158 bits
/termios-c_lflag.h \
159 bits
/termios-c_oflag.h \
160 bits
/termios-misc.h \
161 bits
/termios-struct.h \
162 bits
/termios-tcflow.h \
164 bits
/types
/struct_msqid64_ds.h \
165 bits
/types
/struct_msqid64_ds_helper.h \
166 bits
/types
/struct_semid64_ds.h \
167 bits
/types
/struct_semid64_ds_helper.h \
168 bits
/types
/struct_semid_ds.h \
169 bits
/types
/struct_shmid64_ds.h \
170 bits
/types
/struct_shmid64_ds_helper.h \
207 tst-fdopendir-o_path \
226 tst-process_mrelease \
228 tst-rlimit-infinity \
232 tst-sync_file_range \
233 tst-sysconf-iov_max \
240 tst-ttyname-namespace \
243 # process_madvise requires CAP_SYS_ADMIN.
245 tst-process_madvise \
248 # For +depfiles in Makerules.
250 tst-sysconf-iov_max-uapi.o \
253 # Test for the symbol version of fcntl that was replaced in glibc 2.28.
254 ifeq ($(have-GLIBC_2.27
)$(build-shared
),yesyes
)
256 tst-ofdlocks-compat \
262 tst-sigcontext-get_pc \
270 tst-adjtimex-time64 \
271 tst-clock_adjtime-time64 \
273 tst-ntp_adjtime-time64 \
274 tst-ntp_gettime-time64 \
275 tst-ntp_gettimex-time64 \
278 tst-scm_rights-time64 \
279 tst-sigtimedwait-time64 \
283 tests-clone-internal
= \
284 tst-align-clone-internal \
285 tst-clone2-internal \
286 tst-clone3-internal \
288 # tests-clone-internal
290 $(tests-clone-internal
) \
293 $(tests-clone-internal
) \
296 CFLAGS-tst-sigcontext-get_pc.c
= -fasynchronous-unwind-tables
298 # Generate the list of SYS_* macros for the system calls (__NR_*
299 # macros). The file syscall-names.list contains all possible system
300 # call names, and the generated header file produces SYS_* macros for
301 # the __NR_* macros which are actually defined.
303 generated
+= bits
/syscall.h
304 $(objpfx
)bits
/syscall.h
: \
305 ..
/sysdeps
/unix
/sysv
/linux
/gen-syscall-h.awk \
306 ..
/sysdeps
/unix
/sysv
/linux
/syscall-names.list
307 $(make-target-directory
)
308 LC_ALL
=C
$(AWK
) -f
$^
> $@
-tmp
309 $(move-if-change
) $@
-tmp
$@
310 before-compile
+= $(objpfx
)bits
/syscall.h
312 # All macros defined by <sys/syscall.h>. Include <bits/syscall.h>
313 # explicitly because <sys/sycall.h> skips it if _LIBC is defined.
314 $(objpfx
)tst-syscall-list-macros.list
: \
315 $(objpfx
)bits
/syscall.h ..
/sysdeps
/unix
/sysv
/linux
/sys
/syscall.h
316 printf
'#include <linux/version.h>\n\
317 #include <sys/syscall.h>\n#include <bits/syscall.h>\n' | \
318 $(CC
) -E
-o
$@
-tmp
$(CFLAGS
) $(CPPFLAGS
) -x c
- -dM
319 $(move-if-change
) $@
-tmp
$@
321 # __NR_* system call names. Used by the test below.
322 $(objpfx
)tst-syscall-list-nr.list
: \
323 ..
/sysdeps
/unix
/sysv
/linux
/filter-nr-syscalls.awk \
324 $(objpfx
)tst-syscall-list-macros.list
325 LC_ALL
=C
$(AWK
) -f
$^
> $@
-tmp
326 $(move-if-change
) $@
-tmp
$@
328 # SYS_* system call names. Used by the test below.
329 $(objpfx
)tst-syscall-list-sys.list
: $(objpfx
)tst-syscall-list-macros.list
330 LC_ALL
=C
$(AWK
) '/^#define SYS_/ { print substr($$2, 5) }' $< > $@
-tmp
331 $(move-if-change
) $@
-tmp
$@
334 $(objpfx
)tst-syscall-list.out
336 $(objpfx
)tst-syscall-list.out
: \
337 ..
/sysdeps
/unix
/sysv
/linux
/tst-syscall-list.sh \
338 $(objpfx
)tst-syscall-list-macros.list \
339 $(objpfx
)tst-syscall-list-nr.list \
340 $(objpfx
)tst-syscall-list-sys.list
341 $(BASH
) $^
$(AWK
) > $@
; $(evaluate-test
)
344 $(objpfx
)tst-glibcsyscalls.out
346 # arch-syscall.h is located via the sysdeps override search path.
347 $(objpfx
)tst-glibcsyscalls.out
: arch-syscall.h \
348 ..
/sysdeps
/unix
/sysv
/linux
/syscall-names.list
349 $(sysdeps-linux-python
) \
350 ..
/sysdeps
/unix
/sysv
/linux
/tst-glibcsyscalls.py \
351 $(sysdeps-linux-python-cc
) $< \
352 ..
/sysdeps
/unix
/sysv
/linux
/syscall-names.list \
353 < /dev
/null
> $@
2>&1; $(evaluate-test
)
354 $(objpfx
)tst-glibcsyscalls.out
: \
355 ..
/sysdeps
/unix
/sysv
/linux
/tst-glibcsyscalls.py \
356 $(sysdeps-linux-python-deps
)
358 # Separate object file for access to the constant from the UAPI header.
359 $(objpfx
)tst-sysconf-iov_max
: $(objpfx
)tst-sysconf-iov_max-uapi.o
362 $(objpfx
)tst-mman-consts.out \
364 $(objpfx
)tst-mman-consts.out
: ..
/sysdeps
/unix
/sysv
/linux
/tst-mman-consts.py
365 $(sysdeps-linux-python
) \
366 ..
/sysdeps
/unix
/sysv
/linux
/tst-mman-consts.py \
367 $(sysdeps-linux-python-cc
) \
368 < /dev
/null
> $@
2>&1; $(evaluate-test
)
369 $(objpfx
)tst-mman-consts.out
: $(sysdeps-linux-python-deps
)
372 $(objpfx
)tst-pidfd-consts.out \
374 $(objpfx
)tst-pidfd-consts.out
: ..
/sysdeps
/unix
/sysv
/linux
/tst-pidfd-consts.py
375 $(sysdeps-linux-python
) \
376 ..
/sysdeps
/unix
/sysv
/linux
/tst-pidfd-consts.py \
377 $(sysdeps-linux-python-cc
) \
378 < /dev
/null
> $@
2>&1; $(evaluate-test
)
379 $(objpfx
)tst-pidfd-consts.out
: $(sysdeps-linux-python-deps
)
382 $(objpfx
)tst-mount-consts.out \
384 $(objpfx
)tst-mount-consts.out
: ..
/sysdeps
/unix
/sysv
/linux
/tst-mount-consts.py
385 $(sysdeps-linux-python
) \
386 ..
/sysdeps
/unix
/sysv
/linux
/tst-mount-consts.py \
387 $(sysdeps-linux-python-cc
) \
388 < /dev
/null
> $@
2>&1; $(evaluate-test
)
389 $(objpfx
)tst-mount-consts.out
: $(sysdeps-linux-python-deps
)
392 $(objpfx
)tst-mount-compile.out \
394 $(objpfx
)tst-mount-compile.out
: ..
/sysdeps
/unix
/sysv
/linux
/tst-mount-compile.py
395 $(sysdeps-linux-python
) \
396 ..
/sysdeps
/unix
/sysv
/linux
/tst-mount-compile.py \
397 $(sysdeps-linux-python-cc
) \
398 < /dev
/null
> $@
2>&1; $(evaluate-test
)
399 $(objpfx
)tst-mount-compile.out
: $(sysdeps-linux-python-deps
)
402 $(objpfx
)tst-sched-consts.out \
404 $(objpfx
)tst-sched-consts.out
: ..
/sysdeps
/unix
/sysv
/linux
/tst-sched-consts.py
405 $(sysdeps-linux-python
) \
406 ..
/sysdeps
/unix
/sysv
/linux
/tst-sched-consts.py \
407 $(sysdeps-linux-python-cc
) \
408 < /dev
/null
> $@
2>&1; $(evaluate-test
)
409 $(objpfx
)tst-sched-consts.out
: $(sysdeps-linux-python-deps
)
411 tst-rseq-disable-ENV
= GLIBC_TUNABLES
=glibc.pthread.rseq
=0
413 endif # $(subdir) == misc
415 ifeq ($(subdir
),time
)
427 tst-clock_gettime-clobber \
428 tst-gettimeofday-clobber \
433 ifeq ($(subdir
),signal
)
435 $(objpfx
)tst-signal-numbers.out \
438 # Depending on signal.o* is a hack. What we actually want is a dependency
439 # on signal.h and everything it includes. That's impractical to write
440 # in this context, but signal.c includes signal.h and not much else so it'll
441 # be conservatively correct.
442 $(objpfx
)tst-signal-numbers.out
: \
443 ..
/sysdeps
/unix
/sysv
/linux
/tst-signal-numbers.py \
445 $(sysdeps-linux-python
) \
446 ..
/sysdeps
/unix
/sysv
/linux
/tst-signal-numbers.py \
447 $(sysdeps-linux-python-cc
) \
448 < /dev
/null
> $@
2>&1; $(evaluate-test
)
449 $(objpfx
)tst-signal-numbers.out
: $(sysdeps-linux-python-deps
)
452 ifeq ($(subdir
),socket
)
454 bits
/socket-constants.h \
470 CFLAGS-recvmmsg.c
= -fexceptions
-fasynchronous-unwind-tables
471 CFLAGS-sendmmsg.c
= -fexceptions
-fasynchronous-unwind-tables
474 tst-socket-timestamp \
475 tst-socket-timestamp-compat \
478 tst-socket-timestamp-compat-time64 \
479 tst-socket-timestamp-time64 \
483 $(objpfx
)tst-socket-consts.out \
485 $(objpfx
)tst-socket-consts.out
: ..
/sysdeps
/unix
/sysv
/linux
/tst-socket-consts.py
486 PYTHONPATH
=..
/scripts \
487 $(PYTHON
) ..
/sysdeps
/unix
/sysv
/linux
/tst-socket-consts.py \
488 --cc="$(CC) $(patsubst -DMODULE_NAME=%, \
489 -DMODULE_NAME=testsuite, \
490 $(CPPFLAGS)) -D_ISOMAC" \
491 < /dev
/null
> $@
2>&1; $(evaluate-test
)
492 endif # $(subdir) == socket
494 ifeq ($(subdir
),sunrpc
)
500 ifeq ($(subdir
),termios
)
506 ifeq ($(subdir
),posix
)
519 spawnattr_getcgroup_np \
520 spawnattr_setcgroup_np \
526 tst-posix_spawn-setsid-pidfd \
528 tst-spawn-chdir-pidfd \
539 tst-affinity-static \
546 CFLAGS-fork.c
= $(libio-mtsafe
)
547 CFLAGS-getpid.o
= -fomit-frame-pointer
548 CFLAGS-getpid.os
= -fomit-frame-pointer
549 CFLAGS-tst-spawn3-pidfd.c
+= -DOBJPFX
=\"$(objpfx
)\"
551 tst-spawn-cgroup-ARGS
= -- $(host-test-program-cmd
)
552 tst-spawn-pidfd-ARGS
= -- $(host-test-program-cmd
)
553 tst-spawn5-pidfd-ARGS
= -- $(host-test-program-cmd
)
554 tst-spawn6-pidfd-ARGS
= -- $(host-test-program-cmd
)
555 tst-spawn7-pidfd-ARGS
= -- $(host-test-program-cmd
)
556 tst-posix_spawn-setsid-pidfd-ARGS
= -- $(host-test-program-cmd
)
559 ifeq ($(subdir
),inet
)
575 netlink_assert_response \
578 CFLAGS-check_pf.c
+= -fexceptions
581 # Don't compile the ctype glue code, since there is no old non-GNU C library.
584 ifeq ($(subdir
),dirent
)
592 tst-readdir64-compat \
594 endif # $(subdir) == dirent
597 CFLAGS-ypclnt.c
= -DUSE_BINDINGDIR
=1
627 tst-getcwd-smallbuff \
637 sysdep-rtld-routines
+= \
643 # sysdep-rtld-routines
653 $(objpfx
)pldd
: $(objpfx
)xmalloc.o
657 CFLAGS-mq_send.c
+= -fexceptions
658 CFLAGS-mq_receive.c
+= -fexceptions
661 ifeq ($(subdir
),nscd
)
662 sysdep-CFLAGS
+= -DHAVE_EPOLL
-DHAVE_INOTIFY
-DHAVE_NETLINK
663 CFLAGS-gai.c
+= -DNEED_NETLINK
666 ifeq ($(subdir
),nptl
)
672 # tst-rseq-nptl is an internal test because it requires a definition of
673 # __NR_rseq from the internal system call list.