1 # Copyright (C) 2002-2021 Free Software Foundation, Inc.
2 # This file is part of the GNU C Library.
4 # The GNU C Library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
9 # The GNU C Library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with the GNU C Library; if not, see
16 # <https://www.gnu.org/licenses/>.
19 # Sub-makefile for NPTL portion of the library.
25 headers
:= pthread.h semaphore.h bits
/semaphore.h \
26 bits
/struct_mutex.h bits
/struct_rwlock.h
28 extra-libs
:= libpthread
29 extra-libs-others
:= $(extra-libs
)
42 libc_multiple_threads \
45 old_pthread_cond_destroy \
46 old_pthread_cond_init \
49 pthread_attr_destroy \
50 pthread_attr_extension \
51 pthread_attr_getdetachstate \
52 pthread_attr_getinheritsched \
53 pthread_attr_getschedparam \
54 pthread_attr_getschedpolicy \
55 pthread_attr_getscope \
56 pthread_attr_getsigmask \
58 pthread_attr_setaffinity \
59 pthread_attr_setdetachstate \
60 pthread_attr_setinheritsched \
61 pthread_attr_setschedparam \
62 pthread_attr_setschedpolicy \
63 pthread_attr_setscope \
64 pthread_attr_setsigmask \
65 pthread_attr_setsigmask_internal \
66 pthread_cond_destroy \
68 pthread_condattr_destroy \
69 pthread_condattr_init \
73 pthread_getschedparam \
76 pthread_setschedparam \
79 shared-only-routines
= forward
80 static-only-routines
= pthread_atfork
82 libpthread-routines
= \
87 cleanup_defer_compat \
98 old_pthread_cond_broadcast \
99 old_pthread_cond_signal \
100 old_pthread_cond_timedwait \
101 old_pthread_cond_wait \
105 pthread_attr_getaffinity \
106 pthread_attr_getguardsize \
107 pthread_attr_getstack \
108 pthread_attr_getstackaddr \
109 pthread_attr_getstacksize \
110 pthread_attr_setguardsize \
111 pthread_attr_setstack \
112 pthread_attr_setstackaddr \
113 pthread_attr_setstacksize \
114 pthread_barrier_destroy \
115 pthread_barrier_init \
116 pthread_barrier_wait \
117 pthread_barrierattr_destroy \
118 pthread_barrierattr_getpshared \
119 pthread_barrierattr_init \
120 pthread_barrierattr_setpshared \
123 pthread_cond_broadcast \
124 pthread_cond_signal \
126 pthread_condattr_getclock \
127 pthread_condattr_getpshared \
128 pthread_condattr_setclock \
129 pthread_condattr_setpshared \
133 pthread_getattr_default_np \
134 pthread_getconcurrency \
135 pthread_getcpuclockid \
137 pthread_getspecific \
139 pthread_join_common \
142 pthread_kill_other_threads \
143 pthread_mutex_cond_lock \
145 pthread_mutex_consistent \
146 pthread_mutex_destroy \
147 pthread_mutex_getprioceiling \
150 pthread_mutex_setprioceiling \
151 pthread_mutex_timedlock \
152 pthread_mutex_trylock \
153 pthread_mutex_unlock \
154 pthread_mutexattr_destroy \
155 pthread_mutexattr_getprioceiling \
156 pthread_mutexattr_getprotocol \
157 pthread_mutexattr_getpshared \
158 pthread_mutexattr_getrobust \
159 pthread_mutexattr_gettype \
160 pthread_mutexattr_init \
161 pthread_mutexattr_setprioceiling \
162 pthread_mutexattr_setprotocol \
163 pthread_mutexattr_setpshared \
164 pthread_mutexattr_setrobust \
165 pthread_mutexattr_settype \
167 pthread_rwlock_clockrdlock \
168 pthread_rwlock_clockwrlock \
169 pthread_rwlock_destroy \
170 pthread_rwlock_init \
171 pthread_rwlock_rdlock \
172 pthread_rwlock_timedrdlock \
173 pthread_rwlock_timedwrlock \
174 pthread_rwlock_tryrdlock \
175 pthread_rwlock_trywrlock \
176 pthread_rwlock_unlock \
177 pthread_rwlock_wrlock \
178 pthread_rwlockattr_destroy \
179 pthread_rwlockattr_getkind_np \
180 pthread_rwlockattr_getpshared \
181 pthread_rwlockattr_init \
182 pthread_rwlockattr_setkind_np \
183 pthread_rwlockattr_setpshared \
184 pthread_setaffinity \
185 pthread_setattr_default_np \
186 pthread_setcancelstate \
187 pthread_setcanceltype \
188 pthread_setconcurrency \
190 pthread_setschedprio \
191 pthread_setspecific \
193 pthread_spin_destroy \
196 pthread_spin_trylock \
197 pthread_spin_unlock \
216 unwind-forcedunwind \
220 libpthread-shared-only-routines
= \
223 unwind-forcedunwind \
226 # Since cancellation handling is in large parts handled using exceptions
227 # we have to compile some files with exception handling enabled, some
228 # even with asynchronous unwind tables.
230 # nptl-init.c contains sigcancel_handler().
231 CFLAGS-nptl-init.c
+= -fexceptions
-fasynchronous-unwind-tables
232 # The unwind code itself,
233 CFLAGS-unwind.c
+= -fexceptions
234 CFLAGS-unwind-forcedunwind.c
+= -fexceptions
-fasynchronous-unwind-tables
236 # The following three functions must be async-cancel safe.
237 CFLAGS-pthread_cancel.c
+= -fexceptions
-fasynchronous-unwind-tables
238 CFLAGS-pthread_setcancelstate.c
+= -fexceptions
-fasynchronous-unwind-tables
239 CFLAGS-pthread_setcanceltype.c
+= -fexceptions
-fasynchronous-unwind-tables
241 # These are internal functions which similar functionality as setcancelstate
243 CFLAGS-cancellation.c
+= -fasynchronous-unwind-tables
244 CFLAGS-libc-cancellation.c
+= -fasynchronous-unwind-tables
246 # Calling pthread_exit() must cause the registered cancel handlers to
247 # be executed. Therefore exceptions have to be thrown through this
249 CFLAGS-pthread_exit.c
+= -fexceptions
251 # Among others, __pthread_unwind is forwarded. This function must handle
253 CFLAGS-forward.c
+= -fexceptions
255 # The following are cancellation points. Some of the functions can
256 # block and therefore temporarily enable asynchronous cancellation.
257 # Those must be compiled asynchronous unwind tables.
258 CFLAGS-pthread_testcancel.c
+= -fexceptions
259 CFLAGS-pthread_join.c
+= -fexceptions
-fasynchronous-unwind-tables
260 CFLAGS-pthread_timedjoin.c
+= -fexceptions
-fasynchronous-unwind-tables
261 CFLAGS-pthread_clockjoin.c
+= -fexceptions
-fasynchronous-unwind-tables
262 CFLAGS-pthread_once.c
+= $(uses-callbacks
) -fexceptions \
263 -fasynchronous-unwind-tables
264 CFLAGS-pthread_cond_wait.c
+= -fexceptions
-fasynchronous-unwind-tables
265 CFLAGS-sem_wait.c
+= -fexceptions
-fasynchronous-unwind-tables
266 CFLAGS-sem_timedwait.c
+= -fexceptions
-fasynchronous-unwind-tables
267 CFLAGS-sem_clockwait.c
= -fexceptions
-fasynchronous-unwind-tables
269 CFLAGS-futex-internal.c
+= -fexceptions
-fasynchronous-unwind-tables
271 LDLIBS-tst-once5
= -lstdc
++
272 CFLAGS-tst-thread_local1.o
= -std
=gnu
++11
273 LDLIBS-tst-thread_local1
= -lstdc
++
274 CFLAGS-tst-thread-exit-clobber.o
= -std
=gnu
++11
275 LDLIBS-tst-thread-exit-clobber
= -lstdc
++
276 CFLAGS-tst-minstack-throw.o
= -std
=gnu
++11
277 LDLIBS-tst-minstack-throw
= -lstdc
++
279 tests
= tst-attr2 tst-attr3 tst-default-attr \
280 tst-mutex5a tst-mutex7a \
281 tst-mutexpi1 tst-mutexpi2 tst-mutexpi3 tst-mutexpi4 \
282 tst-mutexpi5 tst-mutexpi5a tst-mutexpi6 tst-mutexpi7 tst-mutexpi7a \
283 tst-mutexpi9 tst-mutexpi10 \
284 tst-cond22 tst-cond26 \
285 tst-robustpi1 tst-robustpi2 tst-robustpi3 tst-robustpi4 tst-robustpi5 \
286 tst-robustpi6 tst-robustpi7 tst-robustpi9 \
287 tst-rwlock2 tst-rwlock2a tst-rwlock2b tst-rwlock3 \
288 tst-rwlock6 tst-rwlock7 tst-rwlock8 \
289 tst-rwlock9 tst-rwlock10 tst-rwlock11 \
290 tst-rwlock15 tst-rwlock17 tst-rwlock18 \
294 tst-cancel4_1 tst-cancel4_2 \
295 tst-cancel7 tst-cancel17 tst-cancel24 \
298 tst-exec4 tst-exec5 \
299 tst-stack2 tst-stack3 tst-stack4 \
300 tst-pthread-attr-affinity \
304 tst-initializers1
$(addprefix tst-initializers1-
,\
305 c89 gnu89 c99 gnu99 c11 gnu11
) \
308 tst-thread-exit-clobber tst-minstack-cancel tst-minstack-exit \
311 tst-thread-affinity-pthread \
312 tst-thread-affinity-pthread2 \
313 tst-thread-affinity-sched \
314 tst-pthread-defaultattr-free \
315 tst-pthread-attr-sigmask \
316 tst-pthread-timedlock-lockloop \
317 tst-pthread-gdb-attach tst-pthread-gdb-attach-static
319 tests-container
= tst-pthread-getattr
321 tests-internal
:= tst-robustpi8 tst-rwlock19 tst-rwlock20 \
322 tst-sem11 tst-sem12 tst-sem13 \
323 tst-barrier5 tst-signal7 tst-mutex8 tst-mutex8-static \
324 tst-mutexpi8 tst-mutexpi8-static \
327 xtests
= tst-setuid1 tst-setuid1-static tst-setuid2 \
328 tst-mutexpp1 tst-mutexpp6 tst-mutexpp10 tst-setgroups \
329 tst-mutexpp5 tst-mutexpp9
331 # This test can run into task limits because of a linux kernel bug
332 # and then cause the make process to fail too, see bug 24537.
335 test-srcs
= tst-oddstacklimit
337 gen-as-const-headers
= unwindbuf.sym \
338 pthread-pi-defines.sym
340 gen-py-const-headers
:= nptl_lock_constants.pysym
341 pretty-printers
:= nptl-printers.py
342 tests-printers
:= test-mutexattr-printers test-mutex-printers \
343 test-condattr-printers test-cond-printers \
344 test-rwlockattr-printers test-rwlock-printers
346 # We must specify both CFLAGS and CPPFLAGS to override any
347 # compiler options the user might have provided that conflict
348 # with what we need e.g. user specifies CPPFLAGS with -O2 and
350 CFLAGS-test-mutexattr-printers.c
:= $(CFLAGS-printers-tests
)
351 CFLAGS-test-mutex-printers.c
:= $(CFLAGS-printers-tests
)
352 CFLAGS-test-condattr-printers.c
:= $(CFLAGS-printers-tests
)
353 CFLAGS-test-cond-printers.c
:= $(CFLAGS-printers-tests
)
354 CFLAGS-test-rwlockattr-printers.c
:= $(CFLAGS-printers-tests
)
355 CFLAGS-test-rwlock-printers.c
:= $(CFLAGS-printers-tests
)
356 CPPFLAGS-test-mutexattr-printers.c
:= $(CFLAGS-printers-tests
)
357 CPPFLAGS-test-mutex-printers.c
:= $(CFLAGS-printers-tests
)
358 CPPFLAGS-test-condattr-printers.c
:= $(CFLAGS-printers-tests
)
359 CPPFLAGS-test-cond-printers.c
:= $(CFLAGS-printers-tests
)
360 CPPFLAGS-test-rwlockattr-printers.c
:= $(CFLAGS-printers-tests
)
361 CPPFLAGS-test-rwlock-printers.c
:= $(CFLAGS-printers-tests
)
363 # Reuse the CFLAGS setting for the GDB attaching test. It needs
364 # debugging information.
365 CFLAGS-tst-pthread-gdb-attach.c
:= $(CFLAGS-printers-tests
)
366 CPPFLAGS-tst-pthread-gdb-attach.c
:= $(CFLAGS-printers-tests
)
367 ifeq ($(build-shared
)$(build-hardcoded-path-in-tests
),yesno
)
368 CPPFLAGS-tst-pthread-gdb-attach.c
+= -DDO_ADD_SYMBOL_FILE
=1
370 CPPFLAGS-tst-pthread-gdb-attach.c
+= -DDO_ADD_SYMBOL_FILE
=0
372 CFLAGS-tst-pthread-gdb-attach-static.c
:= $(CFLAGS-printers-tests
)
373 CPPFLAGS-tst-pthread-gdb-attach-static.c
:= \
374 $(CFLAGS-printers-tests
) -DDO_ADD_SYMBOL_FILE
=0
376 ifeq ($(build-shared
),yes
)
377 tests-printers-libs
:= $(shared-thread-library
)
379 tests-printers-libs
:= $(static-thread-library
)
382 LDFLAGS-pthread.so
= -Wl
,--enable-new-dtags
,-z
,nodelete
,-z
,initfirst
384 tests
+= tst-cancelx7 tst-cancelx17 tst-cleanupx4
386 ifeq ($(build-shared
),yes
)
387 tests
+= tst-compat-forwarder tst-audit-threads
388 tests-internal
+= tst-tls3 tst-tls3-malloc tst-tls5 tst-stackguard1
389 ifeq ($(have-z-execstack
),yes
)
390 tests
+= tst-execstack
394 modules-names
= tst-tls3mod \
395 tst-tls5mod tst-tls5moda tst-tls5modb tst-tls5modc \
396 tst-tls5modd tst-tls5mode tst-tls5modf tst-stack4mod \
398 tst-compat-forwarder-mod tst-audit-threads-mod1 \
399 tst-audit-threads-mod2
400 extra-test-objs
+= $(addsuffix .os
,$(strip $(modules-names
))) \
401 tst-cleanup4aux.o tst-cleanupx4aux.o
402 test-extras
+= tst-cleanup4aux tst-cleanupx4aux
404 tst-tls3mod.so-no-z-defs
= yes
405 tst-tls5mod.so-no-z-defs
= yes
406 tst-tls5moda.so-no-z-defs
= yes
407 tst-tls5modb.so-no-z-defs
= yes
408 tst-tls5modc.so-no-z-defs
= yes
409 tst-tls5modd.so-no-z-defs
= yes
410 tst-tls5mode.so-no-z-defs
= yes
411 tst-tls5modf.so-no-z-defs
= yes
413 ifeq ($(build-shared
),yes
)
415 # Set the `multidir' variable by grabbing the variable from the compiler.
416 # We do it once and save the result in a generated makefile.
417 -include $(objpfx
)multidir.mk
418 $(objpfx
)multidir.mk
: $(common-objpfx
)config.make
419 $(make-target-directory
)
420 dir=`$(CC) $(CFLAGS) $(CPPFLAGS) -print-multi-directory`; \
421 echo
"multidir := $$dir" > $@T
426 ifneq (,$(patsubst .
,,$(multidir
)))
427 generated-dirs
+= $(firstword $(subst /, , $(multidir
)))
428 crti-objs
+= $(multidir
)/crti.o
429 crtn-objs
+= $(multidir
)/crtn.o
430 $(objpfx
)$(multidir
):
433 extra-objs
+= $(crti-objs
) $(crtn-objs
)
434 extra-objs
+= pt-crti.o
437 CFLAGS-flockfile.c
+= $(libio-mtsafe
)
438 CFLAGS-ftrylockfile.c
+= $(libio-mtsafe
)
439 CFLAGS-funlockfile.c
+= $(libio-mtsafe
)
441 link-libc-static
:= $(common-objpfx
)libc.a
$(static-gnulib
) \
442 $(common-objpfx
)libc.a
444 tests-static
+= tst-stackguard1-static \
445 tst-cancel24-static \
446 tst-mutex8-static tst-mutexpi8-static tst-sem11-static \
447 tst-sem12-static tst-cond11-static \
448 tst-pthread-gdb-attach-static
450 tests
+= tst-cancel24-static
452 tests-internal
+= tst-sem11-static tst-sem12-static tst-stackguard1-static
453 xtests-static
+= tst-setuid1-static
455 ifeq ($(run-built-tests
),yes
)
456 tests-special
+= $(objpfx
)tst-stack3-mem.out
$(objpfx
)tst-oddstacklimit.out
457 ifeq ($(build-shared
),yes
)
458 tests-special
+= $(objpfx
)tst-tls6.out
463 # These tests require a C++ compiler and runtime.
464 tests-unsupported
+= tst-cancel24 tst-cancel24-static tst-once5 \
465 tst-thread-exit-clobber tst-minstack-throw
467 # These tests require a C++ compiler and runtime with thread_local support.
468 ifneq ($(have-cxx-thread_local
),yes
)
469 tests-unsupported
+= tst-thread_local1
474 ifeq (yes
,$(build-shared
))
475 # Make sure these things are built in the `make lib' pass so they can be used
476 # to run programs during the `make others' pass.
477 lib-noranlib
: $(addprefix $(objpfx
),$(extra-objs
))
481 # 'pthread_self' is a simple memory or register load. Setting up the
482 # stack frame is more work than the actual operation. Disable the
483 # frame creation entirely. This will help applications which call the
484 # function frequently to get a thread-specific handle.
485 CFLAGS-pthread_self.os
+= -fomit-frame-pointer
487 # Run the cancellation and cleanup tests also for the modern, exception-based
488 # implementation. For this we have to pass the -fexceptions parameter.
489 CFLAGS-tst-cancelx7.c
+= -fexceptions
490 CFLAGS-tst-cancelx17.c
+= -fexceptions
491 CFLAGS-tst-cleanupx4.c
+= -fexceptions
492 CFLAGS-tst-cleanupx4aux.c
+= -fexceptions
493 CFLAGS-tst-initializers1.c
+= -W
-Wall
-Werror
494 CFLAGS-tst-initializers1-
< = $(CFLAGS-tst-initializers1.c
) \
495 $(patsubst tst-initializers1-
%.c
,-std
=%,$<)
496 CFLAGS-tst-initializers1-c89.c
+= $(CFLAGS-tst-initializers1-
<)
497 CFLAGS-tst-initializers1-c99.c
+= $(CFLAGS-tst-initializers1-
<)
498 CFLAGS-tst-initializers1-c11.c
+= $(CFLAGS-tst-initializers1-
<)
499 CFLAGS-tst-initializers1-gnu89.c
+= $(CFLAGS-tst-initializers1-
<)
500 CFLAGS-tst-initializers1-gnu99.c
+= $(CFLAGS-tst-initializers1-
<)
501 CFLAGS-tst-initializers1-gnu11.c
+= $(CFLAGS-tst-initializers1-
<)
503 tst-cancel7-ARGS
= --command
"exec $(host-test-program-cmd)"
504 tst-cancelx7-ARGS
= $(tst-cancel7-ARGS
)
506 tst-stack3-ENV
= MALLOC_TRACE
=$(objpfx
)tst-stack3.mtrace
507 $(objpfx
)tst-stack3-mem.out
: $(objpfx
)tst-stack3.out
508 $(common-objpfx
)malloc
/mtrace
$(objpfx
)tst-stack3.mtrace
> $@
; \
510 generated
+= tst-stack3-mem.out tst-stack3.mtrace
512 $(objpfx
)tst-stack4
: $(libdl
) $(shared-thread-library
)
513 tst-stack4mod.sos
=$(shell for i in
0 1 2 3 4 5 6 7 8 9 10 \
514 11 12 13 14 15 16 17 18 19; do \
515 for j in
0 1 2 3 4 5 6 7 8 9 10 \
516 11 12 13 14 15 16 17 18 19; do \
517 echo
$(objpfx
)tst-stack4mod-
$$i-$$j.so
; \
519 $(objpfx
)tst-stack4.out
: $(tst-stack4mod.sos
)
520 $(tst-stack4mod.sos
): $(objpfx
)tst-stack4mod.so
523 rm -f
$(tst-stack4mod.sos
)
525 $(objpfx
)tst-cleanup4
: $(objpfx
)tst-cleanup4aux.o
$(shared-thread-library
)
526 $(objpfx
)tst-cleanupx4
: $(objpfx
)tst-cleanupx4aux.o
$(shared-thread-library
)
528 $(objpfx
)tst-tls3
: $(libdl
) $(shared-thread-library
)
529 LDFLAGS-tst-tls3
= -rdynamic
530 $(objpfx
)tst-tls3.out
: $(objpfx
)tst-tls3mod.so
531 $(objpfx
)tst-tls3mod.so
: $(shared-thread-library
)
533 $(objpfx
)tst-tls3-malloc
: $(libdl
) $(shared-thread-library
)
534 LDFLAGS-tst-tls3-malloc
= -rdynamic
535 $(objpfx
)tst-tls3-malloc.out
: $(objpfx
)tst-tls3mod.so
537 $(objpfx
)tst-tls5
: $(objpfx
)tst-tls5mod.so
$(shared-thread-library
)
538 LDFLAGS-tst-tls5
= -Wl
,--no-as-needed
539 LDFLAGS-tst-tls5mod.so
= -Wl
,-soname
,tst-tls5mod.so
541 ifeq ($(build-shared
),yes
)
542 $(objpfx
)tst-tls6.out
: tst-tls6.sh
$(objpfx
)tst-tls5 \
543 $(objpfx
)tst-tls5moda.so
$(objpfx
)tst-tls5modb.so \
544 $(objpfx
)tst-tls5modc.so
$(objpfx
)tst-tls5modd.so \
545 $(objpfx
)tst-tls5mode.so
$(objpfx
)tst-tls5modf.so
546 $(BASH
) $< $(common-objpfx
) '$(test-via-rtld-prefix)' \
547 '$(test-wrapper-env)' '$(run-program-env)'; \
551 $(objpfx
)tst-dlsym1
: $(libdl
) $(shared-thread-library
)
553 ifeq (yes
,$(build-shared
))
554 librt
= $(common-objpfx
)rt
/librt.so
556 librt
= $(common-objpfx
)rt
/librt.a
559 # `make check' sometimes triggers a rebuild of librt.so using this Makefile,
560 # which ignores librt's dependence on libpthread
561 $(common-objpfx
)rt
/librt.so
: $(shared-thread-library
)
563 $(objpfx
)tst-cancel17
: $(librt
)
564 $(objpfx
)tst-cancelx17
: $(librt
)
566 LDLIBS-tst-cancel24
= -Wl
,--no-as-needed
-lstdc
++
567 LDLIBS-tst-cancel24-static
= $(LDLIBS-tst-cancel24
)
569 extra-B-pthread.so
= -B
$(common-objpfx
)nptl
/
570 $(objpfx
)libpthread.so
: $(addprefix $(objpfx
),$(crti-objs
) $(crtn-objs
))
571 $(objpfx
)libpthread.so
: +preinit
+= $(addprefix $(objpfx
),$(crti-objs
))
572 $(objpfx
)libpthread.so
: +postinit
+= $(addprefix $(objpfx
),$(crtn-objs
))
574 # Make sure we link with the thread library.
575 ifeq ($(build-shared
),yes
)
576 $(addprefix $(objpfx
), \
577 $(filter-out $(tests-static
) $(xtests-static
) $(tests-reverse
) \
578 $(tests-nolibpthread
), \
579 $(tests
) $(tests-internal
) $(xtests
) $(test-srcs
) $(tests-container
))): \
580 $(objpfx
)libpthread.so
581 $(objpfx
)tst-unload
: $(libdl
)
582 # $(objpfx)../libc.so is used instead of $(common-objpfx)libc.so,
583 # since otherwise libpthread.so comes before libc.so when linking.
584 $(addprefix $(objpfx
), $(tests-reverse
)): \
585 $(objpfx
)..
/libc.so
$(objpfx
)libpthread.so
586 $(objpfx
)..
/libc.so
: $(common-objpfx
)libc.so
;
587 $(addprefix $(objpfx
),$(tests-static
) $(xtests-static
)): $(objpfx
)libpthread.a
589 $(addprefix $(objpfx
),$(tests
) $(test-srcs
)): $(objpfx
)libpthread.a
592 ifeq ($(build-shared
),yes
)
593 $(objpfx
)crti.o
: $(objpfx
)pt-crti.o
596 ifneq ($(multidir
),.
)
597 $(objpfx
)$(multidir
)/crti.o
: $(objpfx
)crti.o
$(objpfx
)$(multidir
)/
600 $(objpfx
)$(multidir
)/crtn.o
: $(objpfx
)crtn.o
$(objpfx
)$(multidir
)/
604 generated
+= multidir.mk tst-tls6.out
606 # Give libpthread.so an entry point and make it directly runnable itself.
607 LDFLAGS-pthread.so
+= -e __nptl_main
608 # pt-interp.c exists just to get the runtime linker path into libpthread.so.
609 $(objpfx
)pt-interp.os
: $(common-objpfx
)runtime-linker.h
612 tst-exec4-ARGS
= $(host-test-program-cmd
)
614 $(objpfx
)tst-execstack
: $(libdl
)
615 $(objpfx
)tst-execstack.out
: $(objpfx
)tst-execstack-mod.so
616 LDFLAGS-tst-execstack
= -Wl
,-z
,noexecstack
617 CFLAGS-tst-execstack-mod.c
+= -Wno-trampolines
619 tst-stackguard1-ARGS
= --command
"$(host-test-program-cmd) --child"
620 tst-stackguard1-static-ARGS
= --command
"$(objpfx)tst-stackguard1-static --child"
622 ifeq ($(run-built-tests
),yes
)
623 $(objpfx
)tst-oddstacklimit.out
: $(objpfx
)tst-oddstacklimit
$(objpfx
)tst-basic1
624 $(test-program-prefix
) $< --command
'$(host-test-program-cmd)' > $@
; \
628 $(objpfx
)tst-compat-forwarder
: $(objpfx
)tst-compat-forwarder-mod.so
630 tst-mutex10-ENV
= GLIBC_TUNABLES
=glibc.elision.enable
=1
632 # Protect against a build using -Wl,-z,now.
633 LDFLAGS-tst-audit-threads-mod1.so
= -Wl
,-z
,lazy
634 LDFLAGS-tst-audit-threads-mod2.so
= -Wl
,-z
,lazy
635 LDFLAGS-tst-audit-threads
= -Wl
,-z
,lazy
636 $(objpfx
)tst-audit-threads
: $(objpfx
)tst-audit-threads-mod2.so
637 $(objpfx
)tst-audit-threads.out
: $(objpfx
)tst-audit-threads-mod1.so
638 tst-audit-threads-ENV
= LD_AUDIT
=$(objpfx
)tst-audit-threads-mod1.so
640 # The test uses dlopen indirectly and would otherwise load system
642 tst-setuid1-static-ENV
= \
643 LD_LIBRARY_PATH
=$(ld-library-path
):$(common-objpfx
)elf
:$(common-objpfx
)nss
645 # The tests here better do not run in parallel.
646 ifeq ($(run-built-tests
),yes
)
647 ifneq ($(filter %tests
,$(MAKECMDGOALS
)),)