1 # sysdeps makefile fragment for all pthread-supporting configurations.
2 # Copyright (C) 2014-2023 Free Software Foundation, Inc.
3 # This file is part of the GNU C Library.
5 # The GNU C Library is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public
7 # License as published by the Free Software Foundation; either
8 # version 2.1 of the License, or (at your option) any later version.
10 # The GNU C Library is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # Lesser General Public License for more details.
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with the GNU C Library; if not, see
17 # <https://www.gnu.org/licenses/>.
20 $(objpfx
)tst-timer
: $(librt
)
23 ifneq (,$(filter $(subdir
),htl nptl
))
36 $(libpthread-routines-var
) += \
50 pthread_atfork_compat \
59 # $(libpthread-routines-var)
80 tst-cancel-self-cancelstate \
81 tst-cancel-self-canceltype \
82 tst-cancel-self-testcancel \
143 tst-create-detached \
193 tst-mutex-errorcheck \
216 tst-pthread-exit-signal \
217 tst-pthread-mutexattr \
218 tst-pthread-raise-blocked-self \
219 tst-pthread-setuid-loop \
220 tst-pthread_cancel-exited \
221 tst-pthread_cancel-select-loop \
222 tst-pthread_kill-exited \
223 tst-pthread_kill-exiting \
235 tst-rwlock-tryrdlock-stall \
236 tst-rwlock-trywrlock-stall \
287 tst-cnd-timedwait-time64 \
290 tst-mtx-timedlock-time64 \
291 tst-rwlock14-time64 \
293 tst-thrd-sleep-time64 \
296 static-only-routines
= pthread_atfork
298 # Files which must not be linked with libpthread.
299 tests-nolibpthread
+= \
303 # GCC-4.9 compiles 'sprintf(NULL, ...)' into UD2 on x86_64 without -fno-builtin
304 CFLAGS-tst-cleanup2.c
+= -fno-builtin
305 CFLAGS-tst-cleanupx2.c
+= -fno-builtin
331 ifeq ($(build-shared
),yes
)
342 tests-nolibpthread
+= \
359 test-modules
= $(addprefix $(objpfx
),$(addsuffix .so
,$(modules-names
)))
361 tst-atfork2mod.so-no-z-defs
= yes
362 tst-atfork3mod.so-no-z-defs
= yes
363 tst-atfork4mod.so-no-z-defs
= yes
364 tst-create1mod.so-no-z-defs
= yes
366 ifeq ($(build-shared
),yes
)
367 # Build all the modules even when not actually running test programs.
368 tests
: $(test-modules
)
372 tst-cancel21-static \
378 tst-cancel21-static \
382 # These tests are linked with libc before libpthread
390 ifeq ($(run-built-tests
),yes
)
391 ifeq ($(build-shared
),yes
)
393 $(objpfx
)tst-cleanup0-cmp.out \
398 # The sigmask macro is deprecated and triggers are compiler warning
399 # which cannot be suppressed (as of GCC 9).
400 CFLAGS-tst-cancel4.c
+= -Wno-error
401 CFLAGS-tst-cancel5.c
+= -Wno-error
402 CFLAGS-tst-cancelx4.c
+= -Wno-error
403 CFLAGS-tst-cancelx5.c
+= -Wno-error
405 # Run the cancellation and cleanup tests also for the modern, exception-based
406 # implementation. For this we have to pass the -fexceptions parameter.
407 CFLAGS-tst-cancelx2.c
+= -fexceptions
408 CFLAGS-tst-cancelx3.c
+= -fexceptions
409 CFLAGS-tst-cancelx4.c
+= -fexceptions
410 CFLAGS-tst-cancelx5.c
+= -fexceptions
411 CFLAGS-tst-cancelx6.c
+= -fexceptions
412 CFLAGS-tst-cancelx8.c
+= -fexceptions
413 CFLAGS-tst-cancelx9.c
+= -fexceptions
414 CFLAGS-tst-cancelx10.c
+= -fexceptions
415 CFLAGS-tst-cancelx11.c
+= -fexceptions
416 CFLAGS-tst-cancelx12.c
+= -fexceptions
417 CFLAGS-tst-cancelx13.c
+= -fexceptions
418 CFLAGS-tst-cancelx14.c
+= -fexceptions
419 CFLAGS-tst-cancelx15.c
+= -fexceptions
420 CFLAGS-tst-cancelx16.c
+= -fexceptions
421 CFLAGS-tst-cancelx18.c
+= -fexceptions
422 CFLAGS-tst-cancelx20.c
+= -fexceptions
-fasynchronous-unwind-tables
423 CFLAGS-tst-cancelx21.c
+= -fexceptions
-fasynchronous-unwind-tables
424 CFLAGS-tst-cleanupx0.c
+= -fexceptions
-fasynchronous-unwind-tables
425 CFLAGS-tst-cleanupx1.c
+= -fexceptions
-fasynchronous-unwind-tables
426 CFLAGS-tst-cleanupx2.c
+= -fexceptions
427 CFLAGS-tst-cleanupx3.c
+= -fexceptions
428 CFLAGS-tst-pt-align.c
+= $(stack-align-test-flags
)
429 CFLAGS-tst-pt-align3.c
+= $(stack-align-test-flags
)
431 tst-umask1-ARGS
= $(objpfx
)tst-umask1.temp
433 $(objpfx
)tst-atfork2
: $(shared-thread-library
)
434 LDFLAGS-tst-atfork2
= -rdynamic
435 tst-atfork2-ENV
= MALLOC_TRACE
=$(objpfx
)tst-atfork2.mtrace \
436 LD_PRELOAD
=$(common-objpfx
)/malloc
/libc_malloc_debug.so
437 $(objpfx
)tst-atfork2mod.so
: $(shared-thread-library
)
439 $(objpfx
)tst-atfork3
: $(shared-thread-library
)
440 LDFLAGS-tst-atfork3
= -rdynamic
441 $(objpfx
)tst-atfork3mod.so
: $(shared-thread-library
)
443 $(objpfx
)tst-atfork4
: $(shared-thread-library
)
444 LDFLAGS-tst-atfork4
= -rdynamic
445 $(objpfx
)tst-atfork4mod.so
: $(shared-thread-library
)
447 ifeq ($(build-shared
),yes
)
448 $(objpfx
)tst-atfork2.out
: $(objpfx
)tst-atfork2mod.so
449 $(objpfx
)tst-atfork3.out
: $(objpfx
)tst-atfork3mod.so
450 $(objpfx
)tst-atfork4.out
: $(objpfx
)tst-atfork4mod.so
453 ifeq ($(build-shared
),yes
)
454 $(objpfx
)tst-cleanup0.out
: /dev
/null
$(objpfx
)tst-cleanup0
455 $(make-test-out
) > $@
2>&1; \
458 $(objpfx
)tst-cleanup0-cmp.out
: $(..
)sysdeps
/pthread
/tst-cleanup0.expect
$(objpfx
)tst-cleanup0.out
463 $(objpfx
)tst-cancel28
: $(librt
)
465 $(objpfx
)tst-fini1
: $(shared-thread-library
) $(objpfx
)tst-fini1mod.so
467 $(objpfx
)tst-fini1mod.so
: $(libsupport
) $(shared-thread-library
)
469 $(objpfx
)tst-_res1mod2.so
: $(objpfx
)tst-_res1mod1.so
470 LDFLAGS-tst-_res1mod1.so
= -Wl
,-soname
,tst-_res1mod1.so
471 LDFLAGS-tst-_res1mod2.so
= -Wl
,-soname
,tst-_res1mod2.so
472 $(objpfx
)tst-_res1
: $(objpfx
)tst-_res1mod1.so
$(objpfx
)tst-_res1mod2.so \
473 $(shared-thread-library
)
475 $(objpfx
)tst-pt-tls4
: $(shared-thread-library
)
476 $(objpfx
)tst-pt-tls4.out
: $(objpfx
)tst-tls4moda.so
$(objpfx
)tst-tls4modb.so
483 $(addsuffix .so
,$(strip $(modules-names
))) \
484 $(objpfx
)tst-atfork2.mtrace \
503 ifeq ($(build-shared
),yes
)
512 CFLAGS-tst-oncex3.c
+= -fexceptions
513 CFLAGS-tst-oncex4.c
+= -fexceptions
514 CFLAGS-tst-oncey3.c
+= -fno-exceptions
-fno-asynchronous-unwind-tables
515 CFLAGS-tst-oncey4.c
+= -fno-exceptions
-fno-asynchronous-unwind-tables
517 $(objpfx
)tst-join7
: $(shared-thread-library
)
518 $(objpfx
)tst-join7.out
: $(objpfx
)tst-join7mod.so
519 $(objpfx
)tst-join7mod.so
: $(shared-thread-library
)
520 LDFLAGS-tst-join7mod.so
= -Wl
,-soname
,tst-join7mod.so
522 CFLAGS-tst-unwind-thread.c
+= -funwind-tables
524 LDFLAGS-tst-create1
= -Wl
,-export-dynamic
525 $(objpfx
)tst-create1
: $(shared-thread-library
)
526 $(objpfx
)tst-create1.out
: $(objpfx
)tst-create1mod.so