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