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 \
115 CFLAGS-gethostid.c
= -fexceptions
116 CFLAGS-tee.c
= -fexceptions
-fasynchronous-unwind-tables
117 CFLAGS-vmsplice.c
= -fexceptions
-fasynchronous-unwind-tables
118 CFLAGS-splice.c
= -fexceptions
-fasynchronous-unwind-tables
119 CFLAGS-open_by_handle_at.c
= -fexceptions
-fasynchronous-unwind-tables
120 CFLAGS-sync_file_range.c
= -fexceptions
-fasynchronous-unwind-tables
121 CFLAGS-pselect32.c
= -fexceptions
-fasynchronous-unwind-tables
122 CFLAGS-tst-writev.c
+= "-DARTIFICIAL_LIMIT=(0x80000000-sysconf(_SC_PAGESIZE))"
124 # The test triggers FORTIFY abortion due to purposely wrong parameters
125 CFLAGS-test-errno-linux.c
+= $(no-fortify-source
)
133 bits
/mman-map-flags-generic.h \
135 bits
/procfs-extra.h \
137 bits
/procfs-prregset.h \
139 bits
/pthread_stack_min-dynamic.h \
140 bits
/pthread_stack_min.h \
141 bits
/ptrace-shared.h \
144 bits
/siginfo-arch.h \
145 bits
/siginfo-consts-arch.h \
149 bits
/struct_stat_time64_helper.h \
151 bits
/termios-baud.h \
152 bits
/termios-c_cc.h \
153 bits
/termios-c_cflag.h \
154 bits
/termios-c_iflag.h \
155 bits
/termios-c_lflag.h \
156 bits
/termios-c_oflag.h \
157 bits
/termios-misc.h \
158 bits
/termios-struct.h \
159 bits
/termios-tcflow.h \
161 bits
/types
/struct_msqid64_ds.h \
162 bits
/types
/struct_msqid64_ds_helper.h \
163 bits
/types
/struct_semid64_ds.h \
164 bits
/types
/struct_semid64_ds_helper.h \
165 bits
/types
/struct_semid_ds.h \
166 bits
/types
/struct_shmid64_ds.h \
167 bits
/types
/struct_shmid64_ds_helper.h \
220 tst-process_mrelease \
222 tst-rlimit-infinity \
225 tst-sync_file_range \
226 tst-sysconf-iov_max \
233 tst-ttyname-namespace \
236 # process_madvise requires CAP_SYS_ADMIN.
238 tst-process_madvise \
241 # For +depfiles in Makerules.
243 tst-sysconf-iov_max-uapi.o \
246 # Test for the symbol version of fcntl that was replaced in glibc 2.28.
247 ifeq ($(have-GLIBC_2.27
)$(build-shared
),yesyes
)
249 tst-ofdlocks-compat \
255 tst-sigcontext-get_pc \
263 tst-adjtimex-time64 \
264 tst-clock_adjtime-time64 \
266 tst-ntp_adjtime-time64 \
267 tst-ntp_gettime-time64 \
268 tst-ntp_gettimex-time64 \
271 tst-scm_rights-time64 \
272 tst-sigtimedwait-time64 \
276 tests-clone-internal
= \
277 tst-align-clone-internal \
278 tst-clone2-internal \
279 tst-clone3-internal \
281 # tests-clone-internal
283 $(tests-clone-internal
) \
286 $(tests-clone-internal
) \
289 CFLAGS-tst-sigcontext-get_pc.c
= -fasynchronous-unwind-tables
291 # Generate the list of SYS_* macros for the system calls (__NR_*
292 # macros). The file syscall-names.list contains all possible system
293 # call names, and the generated header file produces SYS_* macros for
294 # the __NR_* macros which are actually defined.
296 generated
+= bits
/syscall.h
297 $(objpfx
)bits
/syscall.h
: \
298 ..
/sysdeps
/unix
/sysv
/linux
/gen-syscall-h.awk \
299 ..
/sysdeps
/unix
/sysv
/linux
/syscall-names.list
300 $(make-target-directory
)
301 LC_ALL
=C
$(AWK
) -f
$^
> $@
-tmp
302 $(move-if-change
) $@
-tmp
$@
303 before-compile
+= $(objpfx
)bits
/syscall.h
305 # All macros defined by <sys/syscall.h>. Include <bits/syscall.h>
306 # explicitly because <sys/sycall.h> skips it if _LIBC is defined.
307 $(objpfx
)tst-syscall-list-macros.list
: \
308 $(objpfx
)bits
/syscall.h ..
/sysdeps
/unix
/sysv
/linux
/sys
/syscall.h
309 printf
'#include <linux/version.h>\n\
310 #include <sys/syscall.h>\n#include <bits/syscall.h>\n' | \
311 $(CC
) -E
-o
$@
-tmp
$(CFLAGS
) $(CPPFLAGS
) -x c
- -dM
312 $(move-if-change
) $@
-tmp
$@
314 # __NR_* system call names. Used by the test below.
315 $(objpfx
)tst-syscall-list-nr.list
: \
316 ..
/sysdeps
/unix
/sysv
/linux
/filter-nr-syscalls.awk \
317 $(objpfx
)tst-syscall-list-macros.list
318 LC_ALL
=C
$(AWK
) -f
$^
> $@
-tmp
319 $(move-if-change
) $@
-tmp
$@
321 # SYS_* system call names. Used by the test below.
322 $(objpfx
)tst-syscall-list-sys.list
: $(objpfx
)tst-syscall-list-macros.list
323 LC_ALL
=C
$(AWK
) '/^#define SYS_/ { print substr($$2, 5) }' $< > $@
-tmp
324 $(move-if-change
) $@
-tmp
$@
327 $(objpfx
)tst-syscall-list.out
329 $(objpfx
)tst-syscall-list.out
: \
330 ..
/sysdeps
/unix
/sysv
/linux
/tst-syscall-list.sh \
331 $(objpfx
)tst-syscall-list-macros.list \
332 $(objpfx
)tst-syscall-list-nr.list \
333 $(objpfx
)tst-syscall-list-sys.list
334 $(BASH
) $^
$(AWK
) > $@
; $(evaluate-test
)
337 $(objpfx
)tst-glibcsyscalls.out
339 # arch-syscall.h is located via the sysdeps override search path.
340 $(objpfx
)tst-glibcsyscalls.out
: arch-syscall.h \
341 ..
/sysdeps
/unix
/sysv
/linux
/syscall-names.list
342 $(sysdeps-linux-python
) \
343 ..
/sysdeps
/unix
/sysv
/linux
/tst-glibcsyscalls.py \
344 $(sysdeps-linux-python-cc
) $< \
345 ..
/sysdeps
/unix
/sysv
/linux
/syscall-names.list \
346 < /dev
/null
> $@
2>&1; $(evaluate-test
)
347 $(objpfx
)tst-glibcsyscalls.out
: \
348 ..
/sysdeps
/unix
/sysv
/linux
/tst-glibcsyscalls.py \
349 $(sysdeps-linux-python-deps
)
351 # Separate object file for access to the constant from the UAPI header.
352 $(objpfx
)tst-sysconf-iov_max
: $(objpfx
)tst-sysconf-iov_max-uapi.o
355 $(objpfx
)tst-mman-consts.out \
357 $(objpfx
)tst-mman-consts.out
: ..
/sysdeps
/unix
/sysv
/linux
/tst-mman-consts.py
358 $(sysdeps-linux-python
) \
359 ..
/sysdeps
/unix
/sysv
/linux
/tst-mman-consts.py \
360 $(sysdeps-linux-python-cc
) \
361 < /dev
/null
> $@
2>&1; $(evaluate-test
)
362 $(objpfx
)tst-mman-consts.out
: $(sysdeps-linux-python-deps
)
365 $(objpfx
)tst-pidfd-consts.out \
367 $(objpfx
)tst-pidfd-consts.out
: ..
/sysdeps
/unix
/sysv
/linux
/tst-pidfd-consts.py
368 $(sysdeps-linux-python
) \
369 ..
/sysdeps
/unix
/sysv
/linux
/tst-pidfd-consts.py \
370 $(sysdeps-linux-python-cc
) \
371 < /dev
/null
> $@
2>&1; $(evaluate-test
)
372 $(objpfx
)tst-pidfd-consts.out
: $(sysdeps-linux-python-deps
)
375 $(objpfx
)tst-mount-consts.out \
377 $(objpfx
)tst-mount-consts.out
: ..
/sysdeps
/unix
/sysv
/linux
/tst-mount-consts.py
378 $(sysdeps-linux-python
) \
379 ..
/sysdeps
/unix
/sysv
/linux
/tst-mount-consts.py \
380 $(sysdeps-linux-python-cc
) \
381 < /dev
/null
> $@
2>&1; $(evaluate-test
)
382 $(objpfx
)tst-mount-consts.out
: $(sysdeps-linux-python-deps
)
385 $(objpfx
)tst-mount-compile.out \
387 $(objpfx
)tst-mount-compile.out
: ..
/sysdeps
/unix
/sysv
/linux
/tst-mount-compile.py
388 $(sysdeps-linux-python
) \
389 ..
/sysdeps
/unix
/sysv
/linux
/tst-mount-compile.py \
390 $(sysdeps-linux-python-cc
) \
391 < /dev
/null
> $@
2>&1; $(evaluate-test
)
392 $(objpfx
)tst-mount-compile.out
: $(sysdeps-linux-python-deps
)
394 tst-rseq-disable-ENV
= GLIBC_TUNABLES
=glibc.pthread.rseq
=0
396 endif # $(subdir) == misc
398 ifeq ($(subdir
),time
)
410 tst-clock_gettime-clobber \
411 tst-gettimeofday-clobber \
416 ifeq ($(subdir
),signal
)
418 $(objpfx
)tst-signal-numbers.out \
421 # Depending on signal.o* is a hack. What we actually want is a dependency
422 # on signal.h and everything it includes. That's impractical to write
423 # in this context, but signal.c includes signal.h and not much else so it'll
424 # be conservatively correct.
425 $(objpfx
)tst-signal-numbers.out
: \
426 ..
/sysdeps
/unix
/sysv
/linux
/tst-signal-numbers.py \
428 $(sysdeps-linux-python
) \
429 ..
/sysdeps
/unix
/sysv
/linux
/tst-signal-numbers.py \
430 $(sysdeps-linux-python-cc
) \
431 < /dev
/null
> $@
2>&1; $(evaluate-test
)
432 $(objpfx
)tst-signal-numbers.out
: $(sysdeps-linux-python-deps
)
435 ifeq ($(subdir
),socket
)
437 bits
/socket-constants.h \
453 CFLAGS-recvmmsg.c
= -fexceptions
-fasynchronous-unwind-tables
454 CFLAGS-sendmmsg.c
= -fexceptions
-fasynchronous-unwind-tables
457 tst-socket-timestamp \
458 tst-socket-timestamp-compat \
461 tst-socket-timestamp-compat-time64 \
462 tst-socket-timestamp-time64 \
466 $(objpfx
)tst-socket-consts.out \
468 $(objpfx
)tst-socket-consts.out
: ..
/sysdeps
/unix
/sysv
/linux
/tst-socket-consts.py
469 PYTHONPATH
=..
/scripts \
470 $(PYTHON
) ..
/sysdeps
/unix
/sysv
/linux
/tst-socket-consts.py \
471 --cc="$(CC) $(patsubst -DMODULE_NAME=%, \
472 -DMODULE_NAME=testsuite, \
473 $(CPPFLAGS)) -D_ISOMAC" \
474 < /dev
/null
> $@
2>&1; $(evaluate-test
)
475 endif # $(subdir) == socket
477 ifeq ($(subdir
),sunrpc
)
483 ifeq ($(subdir
),termios
)
489 ifeq ($(subdir
),posix
)
502 spawnattr_getcgroup_np \
503 spawnattr_setcgroup_np \
509 tst-posix_spawn-setsid-pidfd \
511 tst-spawn-chdir-pidfd \
522 tst-affinity-static \
529 CFLAGS-fork.c
= $(libio-mtsafe
)
530 CFLAGS-getpid.o
= -fomit-frame-pointer
531 CFLAGS-getpid.os
= -fomit-frame-pointer
532 CFLAGS-tst-spawn3-pidfd.c
+= -DOBJPFX
=\"$(objpfx
)\"
534 tst-spawn-cgroup-ARGS
= -- $(host-test-program-cmd
)
535 tst-spawn-pidfd-ARGS
= -- $(host-test-program-cmd
)
536 tst-spawn5-pidfd-ARGS
= -- $(host-test-program-cmd
)
537 tst-spawn6-pidfd-ARGS
= -- $(host-test-program-cmd
)
538 tst-spawn7-pidfd-ARGS
= -- $(host-test-program-cmd
)
539 tst-posix_spawn-setsid-pidfd-ARGS
= -- $(host-test-program-cmd
)
542 ifeq ($(subdir
),inet
)
558 netlink_assert_response \
561 CFLAGS-check_pf.c
+= -fexceptions
564 # Don't compile the ctype glue code, since there is no old non-GNU C library.
567 ifeq ($(subdir
),dirent
)
575 tst-readdir64-compat \
577 endif # $(subdir) == dirent
580 CFLAGS-ypclnt.c
= -DUSE_BINDINGDIR
=1
610 tst-getcwd-smallbuff \
616 sysdep-rtld-routines
+= \
622 # sysdep-rtld-routines
632 $(objpfx
)pldd
: $(objpfx
)xmalloc.o
636 CFLAGS-mq_send.c
+= -fexceptions
637 CFLAGS-mq_receive.c
+= -fexceptions
640 ifeq ($(subdir
),nscd
)
641 sysdep-CFLAGS
+= -DHAVE_EPOLL
-DHAVE_INOTIFY
-DHAVE_NETLINK
642 CFLAGS-gai.c
+= -DNEED_NETLINK
645 ifeq ($(subdir
),nptl
)
651 # tst-rseq-nptl is an internal test because it requires a definition of
652 # __NR_rseq from the internal system call list.