Debian Codegraph @

nptl/Makefile

raw symbols SCIP
1 # Copyright (C) 2002-2026 Free Software Foundation, Inc.
2 # This file is part of the GNU C Library.
3
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.
8
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.
13
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/>.
17
18 #
19 # Sub-makefile for NPTL portion of the library.
20 #
21 subdir := nptl
22
23 include ../Makeconfig
24
25 headers := \
26 bits/atomic_wide_counter.h \
27 bits/semaphore.h \
28 bits/struct_mutex.h \
29 bits/struct_rwlock.h \
30 pthread.h \
31 semaphore.h \
32 # headers
33
34 extra-libs := libpthread
35 extra-libs-others := $(extra-libs)
36
37 routines = \
38 alloca_cutoff \
39 cancellation \
40 cleanup \
41 cleanup_compat \
42 cleanup_defer \
43 cleanup_defer_compat \
44 cleanup_routine \
45 events \
46 futex-internal \
47 libc-cleanup \
48 lowlevellock \
49 nptl-stack \
50 nptl_deallocate_tsd \
51 nptl_free_tcb \
52 nptl_nthreads \
53 nptl_setxid \
54 nptlfreeres \
55 old_pthread_cond_broadcast \
56 old_pthread_cond_destroy \
57 old_pthread_cond_init \
58 old_pthread_cond_signal \
59 old_pthread_cond_timedwait \
60 old_pthread_cond_wait \
61 pthread_attr_copy \
62 pthread_attr_destroy \
63 pthread_attr_extension \
64 pthread_attr_getaffinity \
65 pthread_attr_getdetachstate \
66 pthread_attr_getguardsize \
67 pthread_attr_getinheritsched \
68 pthread_attr_getschedparam \
69 pthread_attr_getschedpolicy \
70 pthread_attr_getscope \
71 pthread_attr_getsigmask \
72 pthread_attr_getstack \
73 pthread_attr_getstackaddr \
74 pthread_attr_getstacksize \
75 pthread_attr_init \
76 pthread_attr_setaffinity \
77 pthread_attr_setdetachstate \
78 pthread_attr_setguardsize \
79 pthread_attr_setinheritsched \
80 pthread_attr_setschedparam \
81 pthread_attr_setschedpolicy \
82 pthread_attr_setscope \
83 pthread_attr_setsigmask \
84 pthread_attr_setsigmask_internal \
85 pthread_attr_setstack \
86 pthread_attr_setstackaddr \
87 pthread_attr_setstacksize \
88 pthread_barrier_destroy \
89 pthread_barrier_init \
90 pthread_barrier_wait \
91 pthread_barrierattr_destroy \
92 pthread_barrierattr_getpshared \
93 pthread_barrierattr_init \
94 pthread_barrierattr_setpshared \
95 pthread_cancel \
96 pthread_cleanup_upto \
97 pthread_clockjoin \
98 pthread_cond_broadcast \
99 pthread_cond_destroy \
100 pthread_cond_init \
101 pthread_cond_signal \
102 pthread_cond_wait \
103 pthread_condattr_destroy \
104 pthread_condattr_getclock \
105 pthread_condattr_getpshared \
106 pthread_condattr_init \
107 pthread_condattr_setclock \
108 pthread_condattr_setpshared \
109 pthread_create \
110 pthread_detach \
111 pthread_equal \
112 pthread_exit \
113 pthread_getaffinity \
114 pthread_getattr_default_np \
115 pthread_getattr_np \
116 pthread_getconcurrency \
117 pthread_getcpuclockid \
118 pthread_getname \
119 pthread_getschedparam \
120 pthread_getspecific \
121 pthread_gettid_np \
122 pthread_join \
123 pthread_join_common \
124 pthread_key_create \
125 pthread_key_delete \
126 pthread_keys \
127 pthread_kill \
128 pthread_kill_other_threads \
129 pthread_mutex_cond_lock \
130 pthread_mutex_conf \
131 pthread_mutex_consistent \
132 pthread_mutex_destroy \
133 pthread_mutex_getprioceiling \
134 pthread_mutex_init \
135 pthread_mutex_lock \
136 pthread_mutex_setprioceiling \
137 pthread_mutex_timedlock \
138 pthread_mutex_trylock \
139 pthread_mutex_unlock \
140 pthread_mutexattr_destroy \
141 pthread_mutexattr_getprioceiling \
142 pthread_mutexattr_getprotocol \
143 pthread_mutexattr_getpshared \
144 pthread_mutexattr_getrobust \
145 pthread_mutexattr_gettype \
146 pthread_mutexattr_init \
147 pthread_mutexattr_setprioceiling \
148 pthread_mutexattr_setprotocol \
149 pthread_mutexattr_setpshared \
150 pthread_mutexattr_setrobust \
151 pthread_mutexattr_settype \
152 pthread_once \
153 pthread_rwlock_clockrdlock \
154 pthread_rwlock_clockwrlock \
155 pthread_rwlock_destroy \
156 pthread_rwlock_init \
157 pthread_rwlock_rdlock \
158 pthread_rwlock_timedrdlock \
159 pthread_rwlock_timedwrlock \
160 pthread_rwlock_tryrdlock \
161 pthread_rwlock_trywrlock \
162 pthread_rwlock_unlock \
163 pthread_rwlock_wrlock \
164 pthread_rwlockattr_destroy \
165 pthread_rwlockattr_getkind_np \
166 pthread_rwlockattr_getpshared \
167 pthread_rwlockattr_init \
168 pthread_rwlockattr_setkind_np \
169 pthread_rwlockattr_setpshared \
170 pthread_self \
171 pthread_setaffinity \
172 pthread_setattr_default_np \
173 pthread_setcancelstate \
174 pthread_setcanceltype \
175 pthread_setconcurrency \
176 pthread_setname \
177 pthread_setschedparam \
178 pthread_setschedprio \
179 pthread_setspecific \
180 pthread_sigmask \
181 pthread_sigqueue \
182 pthread_spin_destroy \
183 pthread_spin_init \
184 pthread_spin_lock \
185 pthread_spin_trylock \
186 pthread_spin_unlock \
187 pthread_testcancel \
188 pthread_timedjoin \
189 pthread_tryjoin \
190 pthread_yield \
191 sem_clockwait \
192 sem_close \
193 sem_destroy \
194 sem_getvalue \
195 sem_init \
196 sem_open \
197 sem_post \
198 sem_routines \
199 sem_timedwait \
200 sem_unlink \
201 sem_wait \
202 syscall_cancel \
203 tpp \
204 unwind \
205 vars \
206 # routines
207
208 libpthread-routines = libpthread-compat
209 libpthread-shared-only-routines = libpthread-compat
210
211 # Pretend that libpthread.so is a linker script, so that the symbolic
212 # link is not installed.
213 install-lib-ldscripts = libpthread.so
214 $(inst_libdir)/libpthread.so:
215
216 # Since cancellation handling is in large parts handled using exceptions
217 # we have to compile some files with exception handling enabled, some
218 # even with asynchronous unwind tables.
219
220 # nptl-init.c contains sigcancel_handler().
221 CFLAGS-nptl-init.c += -fexceptions -fasynchronous-unwind-tables
222 # The unwind code itself,
223 CFLAGS-unwind.c += -fexceptions
224 CFLAGS-unwind-forcedunwind.c += -fexceptions -fasynchronous-unwind-tables
225
226 # The following three functions must be async-cancel safe.
227 CFLAGS-pthread_cancel.c += -fexceptions -fasynchronous-unwind-tables
228 CFLAGS-pthread_setcancelstate.c += -fexceptions -fasynchronous-unwind-tables
229 CFLAGS-pthread_setcanceltype.c += -fexceptions -fasynchronous-unwind-tables
230
231 # These are internal functions which similar functionality as setcancelstate
232 # and setcanceltype.
233 CFLAGS-cancellation.c += -fexceptions -fasynchronous-unwind-tables
234 CFLAGS-syscall_cancel.c += -fexceptions -fasynchronous-unwind-tables
235
236 # Calling pthread_exit() must cause the registered cancel handlers to
237 # be executed. Therefore exceptions have to be thrown through this
238 # function.
239 CFLAGS-pthread_exit.c += -fexceptions
240
241 # Among others, __pthread_unwind is forwarded. This function must handle
242 # exceptions.
243 CFLAGS-forward.c += -fexceptions
244
245 # The following are cancellation points. Some of the functions can
246 # block and therefore temporarily enable asynchronous cancellation.
247 # Those must be compiled asynchronous unwind tables.
248 CFLAGS-pthread_testcancel.c += -fexceptions
249 CFLAGS-pthread_join.c += -fexceptions -fasynchronous-unwind-tables
250 CFLAGS-pthread_timedjoin.c += -fexceptions -fasynchronous-unwind-tables
251 CFLAGS-pthread_clockjoin.c += -fexceptions -fasynchronous-unwind-tables
252 CFLAGS-pthread_once.c += $(uses-callbacks) -fexceptions \
253 -fasynchronous-unwind-tables
254 CFLAGS-pthread_cond_wait.c += -fexceptions -fasynchronous-unwind-tables
255 CFLAGS-pthread_kill.c = -fexceptions -fasynchronous-unwind-tables
256 CFLAGS-sem_wait.c += -fexceptions -fasynchronous-unwind-tables
257 CFLAGS-sem_timedwait.c += -fexceptions -fasynchronous-unwind-tables
258 CFLAGS-sem_clockwait.c = -fexceptions -fasynchronous-unwind-tables
259
260 CFLAGS-futex-internal.c += -fexceptions -fasynchronous-unwind-tables
261
262 LDLIBS-tst-once5 = -lstdc++
263 CFLAGS-tst-thread_local1.o = -std=gnu++11
264 LDLIBS-tst-thread_local1 = -lstdc++
265 CFLAGS-tst-thread-exit-clobber.o = -std=gnu++11
266 LDLIBS-tst-thread-exit-clobber = -lstdc++
267 CFLAGS-tst-minstack-throw.o = -std=gnu++11
268 LDLIBS-tst-minstack-throw = -lstdc++
269
270 tests = \
271 tst-attr2 \
272 tst-attr3 \
273 tst-attr4 \
274 tst-cancel4_1 \
275 tst-cancel4_2 \
276 tst-cancel7 \
277 tst-cancel17 \
278 tst-cancel24 \
279 tst-cancel31 \
280 tst-cancel33 \
281 tst-cancel34 \
282 tst-cleanup5 \
283 tst-cond26 \
284 tst-context1 \
285 tst-default-attr \
286 tst-dlsym1 \
287 tst-exec4 \
288 tst-exec5 \
289 tst-guard1 \
290 tst-initializers1 \
291 tst-initializers1-c11 \
292 tst-initializers1-c89 \
293 tst-initializers1-c99 \
294 tst-initializers1-gnu11 \
295 tst-initializers1-gnu89 \
296 tst-initializers1-gnu99 \
297 tst-minstack-cancel \
298 tst-minstack-exit \
299 tst-minstack-throw \
300 tst-mutex5a \
301 tst-mutex7a \
302 tst-mutexpi1 \
303 tst-mutexpi2 \
304 tst-mutexpi3 \
305 tst-mutexpi4 \
306 tst-mutexpi5 \
307 tst-mutexpi6 \
308 tst-mutexpi7 \
309 tst-mutexpi9 \
310 tst-mutexpi10 \
311 tst-mutexpi11 \
312 tst-mutexpi12 \
313 tst-once5 \
314 tst-pthread-affinity-inheritance \
315 tst-pthread-attr-affinity \
316 tst-pthread-attr-affinity-fail \
317 tst-pthread-attr-sigmask \
318 tst-pthread-defaultattr-free \
319 tst-pthread-gdb-attach \
320 tst-pthread-gdb-attach-static \
321 tst-pthread-getcpuclockid-invalid \
322 tst-pthread-key1-static \
323 tst-pthread-timedlock-lockloop \
324 tst-pthread_exit-nothreads \
325 tst-pthread_exit-nothreads-static \
326 tst-pthread_gettid_np \
327 tst-robust-fork \
328 tst-robustpi1 \
329 tst-robustpi2 \
330 tst-robustpi3 \
331 tst-robustpi4 \
332 tst-robustpi5 \
333 tst-robustpi6 \
334 tst-robustpi7 \
335 tst-robustpi9 \
336 tst-rwlock-pwn \
337 tst-rwlock2 \
338 tst-rwlock3 \
339 tst-rwlock6 \
340 tst-rwlock7 \
341 tst-rwlock8 \
342 tst-rwlock9 \
343 tst-rwlock10 \
344 tst-rwlock11 \
345 tst-rwlock15 \
346 tst-rwlock17 \
347 tst-rwlock18 \
348 tst-rwlock21 \
349 tst-rwlock22 \
350 tst-sched1 \
351 tst-sem17 \
352 tst-signal3 \
353 tst-stack2 \
354 tst-stack3 \
355 tst-stack4 \
356 tst-thread-affinity-pthread \
357 tst-thread-affinity-pthread2 \
358 tst-thread-affinity-sched \
359 tst-thread-exit-clobber \
360 tst-thread-setspecific \
361 tst-thread_local1 \
362 tst-tsd3 \
363 tst-tsd4 \
364 # tests
365
366 tests-nolibpthread = \
367 tst-pthread_exit-nothreads \
368 tst-pthread_exit-nothreads-static \
369 # tests-nolibpthread
370
371 tests-container = tst-pthread-getattr
372
373 tests-internal := \
374 tst-barrier5 \
375 tst-cond22 \
376 tst-dl-debug-tid \
377 tst-mutex8 \
378 tst-mutex8-static \
379 tst-mutexpi8 \
380 tst-mutexpi8-static \
381 tst-robustpi8 \
382 tst-rwlock19 \
383 tst-rwlock20 \
384 tst-sem11 \
385 tst-sem12 \
386 tst-sem13 \
387 tst-setgetname \
388 tst-signal7 \
389 # tests-internal
390
391 xtests = \
392 tst-mutexpp1 \
393 tst-mutexpp5 \
394 tst-mutexpp6 \
395 tst-mutexpp9 \
396 tst-mutexpp10 \
397 tst-setgroups \
398 tst-setuid1 \
399 tst-setuid1-static \
400 tst-setuid2 \
401 # xtests
402
403 tests-time64 := \
404 tst-cancel4_2-time64
405 # tests-time64
406
407 # This test can run into task limits because of a linux kernel bug
408 # and then cause the make process to fail too, see bug 24537.
409 xtests += tst-eintr1
410
411 test-srcs = tst-oddstacklimit
412
413 gen-as-const-headers = \
414 descr-const.sym \
415 unwindbuf.sym \
416 # gen-as-const-headers
417
418 gen-py-const-headers := nptl_lock_constants.pysym
419 pretty-printers := nptl-printers.py
420 tests-printers := \
421 test-cond-printers \
422 test-condattr-printers \
423 test-mutex-printers \
424 test-mutexattr-printers \
425 test-rwlock-printers \
426 test-rwlockattr-printers \
427 # tests-printers
428
429 # We must specify both CFLAGS and CPPFLAGS to override any
430 # compiler options the user might have provided that conflict
431 # with what we need e.g. user specifies CPPFLAGS with -O2 and
432 # we need -O0.
433 CFLAGS-test-mutexattr-printers.c := $(CFLAGS-printers-tests)
434 CFLAGS-test-mutex-printers.c := $(CFLAGS-printers-tests)
435 CFLAGS-test-condattr-printers.c := $(CFLAGS-printers-tests)
436 CFLAGS-test-cond-printers.c := $(CFLAGS-printers-tests)
437 CFLAGS-test-rwlockattr-printers.c := $(CFLAGS-printers-tests)
438 CFLAGS-test-rwlock-printers.c := $(CFLAGS-printers-tests)
439 CPPFLAGS-test-mutexattr-printers.c := $(CFLAGS-printers-tests)
440 CPPFLAGS-test-mutex-printers.c := $(CFLAGS-printers-tests)
441 CPPFLAGS-test-condattr-printers.c := $(CFLAGS-printers-tests)
442 CPPFLAGS-test-cond-printers.c := $(CFLAGS-printers-tests)
443 CPPFLAGS-test-rwlockattr-printers.c := $(CFLAGS-printers-tests)
444 CPPFLAGS-test-rwlock-printers.c := $(CFLAGS-printers-tests)
445
446 # Reuse the CFLAGS setting for the GDB attaching test. It needs
447 # debugging information.
448 CFLAGS-tst-pthread-gdb-attach.c := $(CFLAGS-printers-tests)
449 CPPFLAGS-tst-pthread-gdb-attach.c := $(CFLAGS-printers-tests)
450 ifeq ($(build-shared)$(build-hardcoded-path-in-tests),yesno)
451 CPPFLAGS-tst-pthread-gdb-attach.c += -DDO_ADD_SYMBOL_FILE=1
452 else
453 CPPFLAGS-tst-pthread-gdb-attach.c += -DDO_ADD_SYMBOL_FILE=0
454 endif
455 CFLAGS-tst-pthread-gdb-attach-static.c := $(CFLAGS-printers-tests)
456 CPPFLAGS-tst-pthread-gdb-attach-static.c := \
457 $(CFLAGS-printers-tests) -DDO_ADD_SYMBOL_FILE=0
458 # As of version 9.2, GDB cannot attach properly to PIE programs that
459 # were launched with an explicit ld.so invocation.
460 tst-pthread-gdb-attach-no-pie = yes
461
462 tests += \
463 tst-cancelx7 \
464 tst-cancelx17 \
465 # tests
466
467 ifeq ($(build-shared),yes)
468 tests += \
469 tst-audit-threads \
470 tst-compat-forwarder \
471 # tests
472 tests-internal += \
473 tst-stackguard1 \
474 tst-tls3 \
475 tst-tls3-malloc \
476 tst-tls5 \
477 # tests-internal
478 ifeq ($(have-z-execstack)$(have-test-cc-trampoline),yesyes)
479 tests += tst-execstack-threads
480 endif
481 endif
482
483 modules-names = \
484 tst-audit-threads-mod1 \
485 tst-audit-threads-mod2 \
486 tst-compat-forwarder-mod \
487 tst-stack4mod \
488 tst-tls3mod \
489 tst-tls5mod \
490 tst-tls5moda \
491 tst-tls5modb \
492 tst-tls5modc \
493 tst-tls5modd \
494 tst-tls5mode \
495 tst-tls5modf \
496 # modules-names
497 extra-test-objs += \
498 $(addsuffix .os,$(strip $(modules-names))) \
499 tst-cleanup4aux.o \
500 tst-cleanupx4aux.o \
501 # extra-test-objs
502 test-extras += \
503 tst-cleanup4aux \
504 tst-cleanupx4aux \
505 # test-extras
506
507 ifneq ($(have-test-clang),yes)
508 modules-names += \
509 tst-execstack-threads-mod \
510 # modules-names
511 endif
512
513 # This test exercises compat symbols removed in glibc 2.34.
514 ifdef have-GLIBC_2.33
515 tests += tst-cleanup4
516 ifeq ($(build-shared),yes)
517 tests += tst-cleanupx4
518 endif
519 endif
520
521 tst-tls3mod.so-no-z-defs = yes
522 tst-tls5mod.so-no-z-defs = yes
523 tst-tls5moda.so-no-z-defs = yes
524 tst-tls5modb.so-no-z-defs = yes
525 tst-tls5modc.so-no-z-defs = yes
526 tst-tls5modd.so-no-z-defs = yes
527 tst-tls5mode.so-no-z-defs = yes
528 tst-tls5modf.so-no-z-defs = yes
529
530 ifeq ($(build-shared),yes)
531
532 # Set the `multidir' variable by grabbing the variable from the compiler.
533 # We do it once and save the result in a generated makefile.
534 -include $(objpfx)multidir.mk
535 $(objpfx)multidir.mk: $(common-objpfx)config.make
536 $(make-target-directory)
537 dir=`$(CC) $(CFLAGS) $(CPPFLAGS) -print-multi-directory`; \
538 echo "multidir := $$dir" > $@T
539 mv -f $@T $@
540
541 endif
542
543 CFLAGS-ftrylockfile.c += $(libio-mtsafe)
544 CFLAGS-funlockfile.c += $(libio-mtsafe)
545
546 link-libc-static := $(common-objpfx)libc.a $(static-gnulib) \
547 $(common-objpfx)libc.a
548
549 tests-static += \
550 tst-cancel24-static \
551 tst-mutex8-static \
552 tst-mutexpi8-static \
553 tst-pthread-gdb-attach-static \
554 tst-pthread-key1-static \
555 tst-pthread_exit-nothreads-static \
556 tst-sem11-static \
557 tst-sem12-static tst-cond11-static \
558 tst-stackguard1-static \
559 # tests-static
560
561 tests += tst-cancel24-static
562 ifeq ($(static-cxx-tests),no)
563 tests-unsupported += tst-cancel24-static
564 endif
565
566 tests-internal += \
567 tst-sem11-static \
568 tst-sem12-static \
569 tst-stackguard1-static \
570 # tests-internal
571 xtests-static += tst-setuid1-static
572
573 ifeq ($(run-built-tests),yes)
574 tests-special += \
575 $(objpfx)tst-dl-debug-tid.out \
576 $(objpfx)tst-oddstacklimit.out \
577 # tests-special
578 ifeq ($(build-shared),yes)
579 tests-special += $(objpfx)tst-tls6.out
580 ifneq ($(PERL),no)
581 tests-special += $(objpfx)tst-stack3-mem.out
582 endif
583 endif
584 endif
585
586 ifeq (,$(CXX))
587 # These tests require a C++ compiler and runtime.
588 tests-unsupported += \
589 tst-cancel24 \
590 tst-cancel24-static \
591 tst-minstack-throw \
592 tst-once5 \
593 tst-thread-exit-clobber \
594 # tests-unsupported
595 endif
596 # These tests require a C++ compiler and runtime with thread_local support.
597 ifneq ($(have-cxx-thread_local),yes)
598 tests-unsupported += tst-thread_local1
599 endif
600
601 include ../Rules
602
603 ifeq (yes,$(build-shared))
604 # Make sure these things are built in the `make lib' pass so they can be used
605 # to run programs during the `make others' pass.
606 lib-noranlib: $(addprefix $(objpfx),$(extra-objs))
607 endif
608
609
610 # 'pthread_self' is a simple memory or register load. Setting up the
611 # stack frame is more work than the actual operation. Disable the
612 # frame creation entirely. This will help applications which call the
613 # function frequently to get a thread-specific handle.
614 CFLAGS-pthread_self.os += -fomit-frame-pointer
615
616 # Run the cancellation and cleanup tests also for the modern, exception-based
617 # implementation. For this we have to pass the -fexceptions parameter.
618 CFLAGS-tst-cancelx7.c += -fexceptions
619 CFLAGS-tst-cancelx17.c += -fexceptions
620 CFLAGS-tst-cleanupx4.c += -fexceptions
621 CFLAGS-tst-cleanupx4aux.c += -fexceptions
622 CFLAGS-tst-initializers1.c += -W -Wall -Werror
623 CFLAGS-tst-initializers1-< = $(CFLAGS-tst-initializers1.c) \
624 $(patsubst tst-initializers1-%.c,-std=%,$<)
625 CFLAGS-tst-initializers1-c89.c += $(CFLAGS-tst-initializers1-<)
626 CFLAGS-tst-initializers1-c99.c += $(CFLAGS-tst-initializers1-<)
627 CFLAGS-tst-initializers1-c11.c += $(CFLAGS-tst-initializers1-<)
628 CFLAGS-tst-initializers1-gnu89.c += $(CFLAGS-tst-initializers1-<)
629 CFLAGS-tst-initializers1-gnu99.c += $(CFLAGS-tst-initializers1-<)
630 CFLAGS-tst-initializers1-gnu11.c += $(CFLAGS-tst-initializers1-<)
631
632 tst-cancel7-ARGS = --command "exec $(host-test-program-cmd)"
633 tst-cancelx7-ARGS = $(tst-cancel7-ARGS)
634
635 tst-stack3-ENV = MALLOC_TRACE=$(objpfx)tst-stack3.mtrace \
636 LD_PRELOAD=$(common-objpfx)/malloc/libc_malloc_debug.so
637 $(objpfx)tst-stack3-mem.out: $(objpfx)tst-stack3.out
638 $(common-objpfx)malloc/mtrace $(objpfx)tst-stack3.mtrace > $@; \
639 $(evaluate-test)
640
641 ifeq ($(run-built-tests),yes)
642 ifeq (yes,$(build-shared))
643 ifneq ($(PERL),no)
644 generated += \
645 tst-stack3-mem.out \
646 tst-stack3.mtrace \
647 # generated
648 endif
649 endif
650 endif
651
652 tst-stack4mod.sos=$(shell for i in 0 1 2 3 4 5 6 7 8 9 10 \
653 11 12 13 14 15 16 17 18 19; do \
654 for j in 0 1 2 3 4 5 6 7 8 9 10 \
655 11 12 13 14 15 16 17 18 19; do \
656 echo $(objpfx)tst-stack4mod-$$i-$$j.so; \
657 done; done)
658 $(objpfx)tst-stack4.out: $(tst-stack4mod.sos)
659 $(tst-stack4mod.sos): $(objpfx)tst-stack4mod.so
660 cp -f $< $@
661 clean:
662 rm -f $(tst-stack4mod.sos)
663
664 $(objpfx)tst-cleanup4: $(objpfx)tst-cleanup4aux.o
665 $(objpfx)tst-cleanupx4: $(objpfx)tst-cleanupx4aux.o
666
667 LDFLAGS-tst-tls3 = -rdynamic
668 LDFLAGS-tst-tls3mod.so = -Wl,-z,lazy
669 $(objpfx)tst-tls3.out: $(objpfx)tst-tls3mod.so
670
671 LDFLAGS-tst-tls3-malloc = -rdynamic
672 $(objpfx)tst-tls3-malloc.out: $(objpfx)tst-tls3mod.so
673
674 $(objpfx)tst-tls5: $(objpfx)tst-tls5mod.so
675 LDFLAGS-tst-tls5 = -Wl,--no-as-needed
676 LDFLAGS-tst-tls5mod.so = -Wl,-soname,tst-tls5mod.so
677
678 ifeq ($(build-shared),yes)
679 $(objpfx)tst-tls6.out: tst-tls6.sh $(objpfx)tst-tls5 \
680 $(objpfx)tst-tls5moda.so $(objpfx)tst-tls5modb.so \
681 $(objpfx)tst-tls5modc.so $(objpfx)tst-tls5modd.so \
682 $(objpfx)tst-tls5mode.so $(objpfx)tst-tls5modf.so
683 $(BASH) $< $(common-objpfx) '$(test-via-rtld-prefix)' \
684 '$(test-wrapper-env)' '$(run-program-env)'; \
685 $(evaluate-test)
686 endif
687
688 LDLIBS-tst-cancel24 = -Wl,--no-as-needed -lstdc++
689 LDLIBS-tst-cancel24-static = $(LDLIBS-tst-cancel24)
690
691 ifeq ($(build-shared),yes)
692
693 generated += \
694 multidir.mk \
695 tst-tls6.out \
696 # generated
697 endif
698
699 tst-exec4-ARGS = $(host-test-program-cmd)
700
701 $(objpfx)tst-execstack-threads.out: $(objpfx)tst-execstack-threads-mod.so
702 LDFLAGS-tst-execstack-threads = -Wl,-z,noexecstack
703 LDFLAGS-tst-execstack-threads-mod.so = -Wl,-z,execstack
704 CFLAGS-tst-execstack-threads-mod.c += -Wno-trampolines
705 ifeq ($(have-no-error-execstack),yes)
706 LDFLAGS-tst-execstack-threads-mod.so += -Wl,--no-error-execstack
707 endif
708
709 tst-stackguard1-ARGS = --command "$(host-test-program-cmd) --child"
710 tst-stackguard1-static-ARGS = --command "$(objpfx)tst-stackguard1-static --child"
711
712 ifeq ($(run-built-tests),yes)
713 $(objpfx)tst-dl-debug-tid.out: tst-dl-debug-tid.sh $(objpfx)tst-dl-debug-tid
714 $(SHELL) $< $(common-objpfx) '$(test-wrapper-env)' '$(rtld-prefix)' \
715 '$(run-program-env)' \
716 $(objpfx)tst-dl-debug-tid > $@; $(evaluate-test)
717
718 $(objpfx)tst-oddstacklimit.out: $(objpfx)tst-oddstacklimit $(objpfx)tst-basic1
719 $(test-program-prefix) $< --command '$(host-test-program-cmd)' > $@; \
720 $(evaluate-test)
721 endif
722
723 $(objpfx)tst-compat-forwarder: $(objpfx)tst-compat-forwarder-mod.so
724
725 # Protect against a build using -Wl,-z,now.
726 LDFLAGS-tst-audit-threads-mod1.so = -Wl,-z,lazy
727 LDFLAGS-tst-audit-threads-mod2.so = -Wl,-z,lazy
728 LDFLAGS-tst-audit-threads = -Wl,-z,lazy
729 $(objpfx)tst-audit-threads: $(objpfx)tst-audit-threads-mod2.so
730 $(objpfx)tst-audit-threads.out: $(objpfx)tst-audit-threads-mod1.so
731 tst-audit-threads-ENV = LD_AUDIT=$(objpfx)tst-audit-threads-mod1.so
732
733 # The test uses dlopen indirectly and would otherwise load system
734 # objects.
735 tst-setuid1-static-ENV = \
736 LD_LIBRARY_PATH=$(ld-library-path):$(common-objpfx)elf:$(common-objpfx)nss
737
738 tst-pthread-proc-maps-ENV = \
739 GLIBC_TUNABLES=glibc.malloc.arena_max=8:glibc.malloc.mmap_threshold=1024
740 tst-pthread-proc-maps-ARGS = 8
741
742 # The tests here better do not run in parallel.
743 ifeq ($(run-built-tests),yes)
744 ifneq ($(filter %tests,$(MAKECMDGOALS)),)
745 .NOTPARALLEL:
746 endif
747 endif