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 \
116 CFLAGS-gethostid.c
= -fexceptions
117 CFLAGS-tee.c
= -fexceptions
-fasynchronous-unwind-tables
118 CFLAGS-vmsplice.c
= -fexceptions
-fasynchronous-unwind-tables
119 CFLAGS-splice.c
= -fexceptions
-fasynchronous-unwind-tables
120 CFLAGS-open_by_handle_at.c
= -fexceptions
-fasynchronous-unwind-tables
121 CFLAGS-sync_file_range.c
= -fexceptions
-fasynchronous-unwind-tables
122 CFLAGS-pselect32.c
= -fexceptions
-fasynchronous-unwind-tables
123 CFLAGS-tst-writev.c
+= "-DARTIFICIAL_LIMIT=(0x80000000-sysconf(_SC_PAGESIZE))"
125 # The test triggers FORTIFY abortion due to purposely wrong parameters
126 CFLAGS-test-errno-linux.c
+= $(no-fortify-source
)
134 bits
/mman-map-flags-generic.h \
136 bits
/procfs-extra.h \
138 bits
/procfs-prregset.h \
140 bits
/pthread_stack_min-dynamic.h \
141 bits
/pthread_stack_min.h \
142 bits
/ptrace-shared.h \
145 bits
/siginfo-arch.h \
146 bits
/siginfo-consts-arch.h \
150 bits
/struct_stat_time64_helper.h \
152 bits
/termios-baud.h \
153 bits
/termios-c_cc.h \
154 bits
/termios-c_cflag.h \
155 bits
/termios-c_iflag.h \
156 bits
/termios-c_lflag.h \
157 bits
/termios-c_oflag.h \
158 bits
/termios-misc.h \
159 bits
/termios-struct.h \
160 bits
/termios-tcflow.h \
162 bits
/types
/struct_msqid64_ds.h \
163 bits
/types
/struct_msqid64_ds_helper.h \
164 bits
/types
/struct_semid64_ds.h \
165 bits
/types
/struct_semid64_ds_helper.h \
166 bits
/types
/struct_semid_ds.h \
167 bits
/types
/struct_shmid64_ds.h \
168 bits
/types
/struct_shmid64_ds_helper.h \
204 tst-fdopendir-o_path \
222 tst-process_mrelease \
224 tst-rlimit-infinity \
227 tst-sync_file_range \
228 tst-sysconf-iov_max \
235 tst-ttyname-namespace \
238 # process_madvise requires CAP_SYS_ADMIN.
240 tst-process_madvise \
243 # For +depfiles in Makerules.
245 tst-sysconf-iov_max-uapi.o \
248 # Test for the symbol version of fcntl that was replaced in glibc 2.28.
249 ifeq ($(have-GLIBC_2.27
)$(build-shared
),yesyes
)
251 tst-ofdlocks-compat \
257 tst-sigcontext-get_pc \
265 tst-adjtimex-time64 \
266 tst-clock_adjtime-time64 \
268 tst-ntp_adjtime-time64 \
269 tst-ntp_gettime-time64 \
270 tst-ntp_gettimex-time64 \
273 tst-scm_rights-time64 \
274 tst-sigtimedwait-time64 \
278 tests-clone-internal
= \
279 tst-align-clone-internal \
280 tst-clone2-internal \
281 tst-clone3-internal \
283 # tests-clone-internal
285 $(tests-clone-internal
) \
288 $(tests-clone-internal
) \
291 CFLAGS-tst-sigcontext-get_pc.c
= -fasynchronous-unwind-tables
293 # Generate the list of SYS_* macros for the system calls (__NR_*
294 # macros). The file syscall-names.list contains all possible system
295 # call names, and the generated header file produces SYS_* macros for
296 # the __NR_* macros which are actually defined.
298 generated
+= bits
/syscall.h
299 $(objpfx
)bits
/syscall.h
: \
300 ..
/sysdeps
/unix
/sysv
/linux
/gen-syscall-h.awk \
301 ..
/sysdeps
/unix
/sysv
/linux
/syscall-names.list
302 $(make-target-directory
)
303 LC_ALL
=C
$(AWK
) -f
$^
> $@
-tmp
304 $(move-if-change
) $@
-tmp
$@
305 before-compile
+= $(objpfx
)bits
/syscall.h
307 # All macros defined by <sys/syscall.h>. Include <bits/syscall.h>
308 # explicitly because <sys/sycall.h> skips it if _LIBC is defined.
309 $(objpfx
)tst-syscall-list-macros.list
: \
310 $(objpfx
)bits
/syscall.h ..
/sysdeps
/unix
/sysv
/linux
/sys
/syscall.h
311 printf
'#include <linux/version.h>\n\
312 #include <sys/syscall.h>\n#include <bits/syscall.h>\n' | \
313 $(CC
) -E
-o
$@
-tmp
$(CFLAGS
) $(CPPFLAGS
) -x c
- -dM
314 $(move-if-change
) $@
-tmp
$@
316 # __NR_* system call names. Used by the test below.
317 $(objpfx
)tst-syscall-list-nr.list
: \
318 ..
/sysdeps
/unix
/sysv
/linux
/filter-nr-syscalls.awk \
319 $(objpfx
)tst-syscall-list-macros.list
320 LC_ALL
=C
$(AWK
) -f
$^
> $@
-tmp
321 $(move-if-change
) $@
-tmp
$@
323 # SYS_* system call names. Used by the test below.
324 $(objpfx
)tst-syscall-list-sys.list
: $(objpfx
)tst-syscall-list-macros.list
325 LC_ALL
=C
$(AWK
) '/^#define SYS_/ { print substr($$2, 5) }' $< > $@
-tmp
326 $(move-if-change
) $@
-tmp
$@
329 $(objpfx
)tst-syscall-list.out
331 $(objpfx
)tst-syscall-list.out
: \
332 ..
/sysdeps
/unix
/sysv
/linux
/tst-syscall-list.sh \
333 $(objpfx
)tst-syscall-list-macros.list \
334 $(objpfx
)tst-syscall-list-nr.list \
335 $(objpfx
)tst-syscall-list-sys.list
336 $(BASH
) $^
$(AWK
) > $@
; $(evaluate-test
)
339 $(objpfx
)tst-glibcsyscalls.out
341 # arch-syscall.h is located via the sysdeps override search path.
342 $(objpfx
)tst-glibcsyscalls.out
: arch-syscall.h \
343 ..
/sysdeps
/unix
/sysv
/linux
/syscall-names.list
344 $(sysdeps-linux-python
) \
345 ..
/sysdeps
/unix
/sysv
/linux
/tst-glibcsyscalls.py \
346 $(sysdeps-linux-python-cc
) $< \
347 ..
/sysdeps
/unix
/sysv
/linux
/syscall-names.list \
348 < /dev
/null
> $@
2>&1; $(evaluate-test
)
349 $(objpfx
)tst-glibcsyscalls.out
: \
350 ..
/sysdeps
/unix
/sysv
/linux
/tst-glibcsyscalls.py \
351 $(sysdeps-linux-python-deps
)
353 # Separate object file for access to the constant from the UAPI header.
354 $(objpfx
)tst-sysconf-iov_max
: $(objpfx
)tst-sysconf-iov_max-uapi.o
357 $(objpfx
)tst-mman-consts.out \
359 $(objpfx
)tst-mman-consts.out
: ..
/sysdeps
/unix
/sysv
/linux
/tst-mman-consts.py
360 $(sysdeps-linux-python
) \
361 ..
/sysdeps
/unix
/sysv
/linux
/tst-mman-consts.py \
362 $(sysdeps-linux-python-cc
) \
363 < /dev
/null
> $@
2>&1; $(evaluate-test
)
364 $(objpfx
)tst-mman-consts.out
: $(sysdeps-linux-python-deps
)
367 $(objpfx
)tst-pidfd-consts.out \
369 $(objpfx
)tst-pidfd-consts.out
: ..
/sysdeps
/unix
/sysv
/linux
/tst-pidfd-consts.py
370 $(sysdeps-linux-python
) \
371 ..
/sysdeps
/unix
/sysv
/linux
/tst-pidfd-consts.py \
372 $(sysdeps-linux-python-cc
) \
373 < /dev
/null
> $@
2>&1; $(evaluate-test
)
374 $(objpfx
)tst-pidfd-consts.out
: $(sysdeps-linux-python-deps
)
377 $(objpfx
)tst-mount-consts.out \
379 $(objpfx
)tst-mount-consts.out
: ..
/sysdeps
/unix
/sysv
/linux
/tst-mount-consts.py
380 $(sysdeps-linux-python
) \
381 ..
/sysdeps
/unix
/sysv
/linux
/tst-mount-consts.py \
382 $(sysdeps-linux-python-cc
) \
383 < /dev
/null
> $@
2>&1; $(evaluate-test
)
384 $(objpfx
)tst-mount-consts.out
: $(sysdeps-linux-python-deps
)
387 $(objpfx
)tst-mount-compile.out \
389 $(objpfx
)tst-mount-compile.out
: ..
/sysdeps
/unix
/sysv
/linux
/tst-mount-compile.py
390 $(sysdeps-linux-python
) \
391 ..
/sysdeps
/unix
/sysv
/linux
/tst-mount-compile.py \
392 $(sysdeps-linux-python-cc
) \
393 < /dev
/null
> $@
2>&1; $(evaluate-test
)
394 $(objpfx
)tst-mount-compile.out
: $(sysdeps-linux-python-deps
)
396 tst-rseq-disable-ENV
= GLIBC_TUNABLES
=glibc.pthread.rseq
=0
398 endif # $(subdir) == misc
400 ifeq ($(subdir
),time
)
412 tst-clock_gettime-clobber \
413 tst-gettimeofday-clobber \
418 ifeq ($(subdir
),signal
)
420 $(objpfx
)tst-signal-numbers.out \
423 # Depending on signal.o* is a hack. What we actually want is a dependency
424 # on signal.h and everything it includes. That's impractical to write
425 # in this context, but signal.c includes signal.h and not much else so it'll
426 # be conservatively correct.
427 $(objpfx
)tst-signal-numbers.out
: \
428 ..
/sysdeps
/unix
/sysv
/linux
/tst-signal-numbers.py \
430 $(sysdeps-linux-python
) \
431 ..
/sysdeps
/unix
/sysv
/linux
/tst-signal-numbers.py \
432 $(sysdeps-linux-python-cc
) \
433 < /dev
/null
> $@
2>&1; $(evaluate-test
)
434 $(objpfx
)tst-signal-numbers.out
: $(sysdeps-linux-python-deps
)
437 ifeq ($(subdir
),socket
)
439 bits
/socket-constants.h \
455 CFLAGS-recvmmsg.c
= -fexceptions
-fasynchronous-unwind-tables
456 CFLAGS-sendmmsg.c
= -fexceptions
-fasynchronous-unwind-tables
459 tst-socket-timestamp \
460 tst-socket-timestamp-compat \
463 tst-socket-timestamp-compat-time64 \
464 tst-socket-timestamp-time64 \
468 $(objpfx
)tst-socket-consts.out \
470 $(objpfx
)tst-socket-consts.out
: ..
/sysdeps
/unix
/sysv
/linux
/tst-socket-consts.py
471 PYTHONPATH
=..
/scripts \
472 $(PYTHON
) ..
/sysdeps
/unix
/sysv
/linux
/tst-socket-consts.py \
473 --cc="$(CC) $(patsubst -DMODULE_NAME=%, \
474 -DMODULE_NAME=testsuite, \
475 $(CPPFLAGS)) -D_ISOMAC" \
476 < /dev
/null
> $@
2>&1; $(evaluate-test
)
477 endif # $(subdir) == socket
479 ifeq ($(subdir
),sunrpc
)
485 ifeq ($(subdir
),termios
)
491 ifeq ($(subdir
),posix
)
504 spawnattr_getcgroup_np \
505 spawnattr_setcgroup_np \
511 tst-posix_spawn-setsid-pidfd \
513 tst-spawn-chdir-pidfd \
524 tst-affinity-static \
531 CFLAGS-fork.c
= $(libio-mtsafe
)
532 CFLAGS-getpid.o
= -fomit-frame-pointer
533 CFLAGS-getpid.os
= -fomit-frame-pointer
534 CFLAGS-tst-spawn3-pidfd.c
+= -DOBJPFX
=\"$(objpfx
)\"
536 tst-spawn-cgroup-ARGS
= -- $(host-test-program-cmd
)
537 tst-spawn-pidfd-ARGS
= -- $(host-test-program-cmd
)
538 tst-spawn5-pidfd-ARGS
= -- $(host-test-program-cmd
)
539 tst-spawn6-pidfd-ARGS
= -- $(host-test-program-cmd
)
540 tst-spawn7-pidfd-ARGS
= -- $(host-test-program-cmd
)
541 tst-posix_spawn-setsid-pidfd-ARGS
= -- $(host-test-program-cmd
)
544 ifeq ($(subdir
),inet
)
560 netlink_assert_response \
563 CFLAGS-check_pf.c
+= -fexceptions
566 # Don't compile the ctype glue code, since there is no old non-GNU C library.
569 ifeq ($(subdir
),dirent
)
577 tst-readdir64-compat \
579 endif # $(subdir) == dirent
582 CFLAGS-ypclnt.c
= -DUSE_BINDINGDIR
=1
612 tst-getcwd-smallbuff \
618 sysdep-rtld-routines
+= \
624 # sysdep-rtld-routines
634 $(objpfx
)pldd
: $(objpfx
)xmalloc.o
638 CFLAGS-mq_send.c
+= -fexceptions
639 CFLAGS-mq_receive.c
+= -fexceptions
642 ifeq ($(subdir
),nscd
)
643 sysdep-CFLAGS
+= -DHAVE_EPOLL
-DHAVE_INOTIFY
-DHAVE_NETLINK
644 CFLAGS-gai.c
+= -DNEED_NETLINK
647 ifeq ($(subdir
),nptl
)
653 # tst-rseq-nptl is an internal test because it requires a definition of
654 # __NR_rseq from the internal system call list.