]> git.ipfire.org Git - thirdparty/glibc.git/blob - nptl/Makefile
y2038: Add test coverage
[thirdparty/glibc.git] / nptl / Makefile
1 # Copyright (C) 2002-2021 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 := pthread.h semaphore.h bits/semaphore.h \
26 bits/struct_mutex.h bits/struct_rwlock.h
27
28 extra-libs := libpthread
29 extra-libs-others := $(extra-libs)
30
31 routines = \
32 alloca_cutoff \
33 cancellation \
34 cleanup \
35 cleanup_compat \
36 cleanup_defer \
37 cleanup_defer_compat \
38 cleanup_routine \
39 elision-conf \
40 elision-lock \
41 elision-timed \
42 elision-trylock \
43 elision-unlock \
44 events \
45 futex-internal \
46 libc-cleanup \
47 libc_multiple_threads \
48 lowlevellock \
49 nptl-stack \
50 nptl_deallocate_tsd \
51 nptl_free_tcb \
52 nptl_nthreads \
53 nptl_setxid \
54 nptlfreeres \
55 old_pthread_atfork \
56 old_pthread_cond_broadcast \
57 old_pthread_cond_destroy \
58 old_pthread_cond_init \
59 old_pthread_cond_signal \
60 old_pthread_cond_timedwait \
61 old_pthread_cond_wait \
62 pthread_atfork \
63 pthread_attr_copy \
64 pthread_attr_destroy \
65 pthread_attr_extension \
66 pthread_attr_getaffinity \
67 pthread_attr_getdetachstate \
68 pthread_attr_getguardsize \
69 pthread_attr_getinheritsched \
70 pthread_attr_getschedparam \
71 pthread_attr_getschedpolicy \
72 pthread_attr_getscope \
73 pthread_attr_getsigmask \
74 pthread_attr_getstack \
75 pthread_attr_getstackaddr \
76 pthread_attr_getstacksize \
77 pthread_attr_init \
78 pthread_attr_setaffinity \
79 pthread_attr_setdetachstate \
80 pthread_attr_setguardsize \
81 pthread_attr_setinheritsched \
82 pthread_attr_setschedparam \
83 pthread_attr_setschedpolicy \
84 pthread_attr_setscope \
85 pthread_attr_setsigmask \
86 pthread_attr_setsigmask_internal \
87 pthread_attr_setstack \
88 pthread_attr_setstackaddr \
89 pthread_attr_setstacksize \
90 pthread_barrier_destroy \
91 pthread_barrier_init \
92 pthread_barrier_wait \
93 pthread_barrierattr_destroy \
94 pthread_barrierattr_getpshared \
95 pthread_barrierattr_init \
96 pthread_barrierattr_setpshared \
97 pthread_cancel \
98 pthread_cleanup_upto \
99 pthread_clockjoin \
100 pthread_cond_broadcast \
101 pthread_cond_destroy \
102 pthread_cond_init \
103 pthread_cond_signal \
104 pthread_cond_wait \
105 pthread_condattr_destroy \
106 pthread_condattr_getclock \
107 pthread_condattr_getpshared \
108 pthread_condattr_init \
109 pthread_condattr_setclock \
110 pthread_condattr_setpshared \
111 pthread_create \
112 pthread_detach \
113 pthread_equal \
114 pthread_exit \
115 pthread_getaffinity \
116 pthread_getattr_default_np \
117 pthread_getattr_np \
118 pthread_getconcurrency \
119 pthread_getcpuclockid \
120 pthread_getname \
121 pthread_getschedparam \
122 pthread_getspecific \
123 pthread_join \
124 pthread_join_common \
125 pthread_key_create \
126 pthread_key_delete \
127 pthread_keys \
128 pthread_kill \
129 pthread_kill_other_threads \
130 pthread_mutex_cond_lock \
131 pthread_mutex_conf \
132 pthread_mutex_consistent \
133 pthread_mutex_destroy \
134 pthread_mutex_getprioceiling \
135 pthread_mutex_init \
136 pthread_mutex_lock \
137 pthread_mutex_setprioceiling \
138 pthread_mutex_timedlock \
139 pthread_mutex_trylock \
140 pthread_mutex_unlock \
141 pthread_mutexattr_destroy \
142 pthread_mutexattr_getprioceiling \
143 pthread_mutexattr_getprotocol \
144 pthread_mutexattr_getpshared \
145 pthread_mutexattr_getrobust \
146 pthread_mutexattr_gettype \
147 pthread_mutexattr_init \
148 pthread_mutexattr_setprioceiling \
149 pthread_mutexattr_setprotocol \
150 pthread_mutexattr_setpshared \
151 pthread_mutexattr_setrobust \
152 pthread_mutexattr_settype \
153 pthread_once \
154 pthread_rwlock_clockrdlock \
155 pthread_rwlock_clockwrlock \
156 pthread_rwlock_destroy \
157 pthread_rwlock_init \
158 pthread_rwlock_rdlock \
159 pthread_rwlock_timedrdlock \
160 pthread_rwlock_timedwrlock \
161 pthread_rwlock_tryrdlock \
162 pthread_rwlock_trywrlock \
163 pthread_rwlock_unlock \
164 pthread_rwlock_wrlock \
165 pthread_rwlockattr_destroy \
166 pthread_rwlockattr_getkind_np \
167 pthread_rwlockattr_getpshared \
168 pthread_rwlockattr_init \
169 pthread_rwlockattr_setkind_np \
170 pthread_rwlockattr_setpshared \
171 pthread_self \
172 pthread_setaffinity \
173 pthread_setattr_default_np \
174 pthread_setcancelstate \
175 pthread_setcanceltype \
176 pthread_setconcurrency \
177 pthread_setname \
178 pthread_setschedparam \
179 pthread_setschedprio \
180 pthread_setspecific \
181 pthread_sigmask \
182 pthread_sigqueue \
183 pthread_spin_destroy \
184 pthread_spin_init \
185 pthread_spin_lock \
186 pthread_spin_trylock \
187 pthread_spin_unlock \
188 pthread_testcancel \
189 pthread_timedjoin \
190 pthread_tryjoin \
191 pthread_yield \
192 sem_clockwait \
193 sem_close \
194 sem_destroy \
195 sem_getvalue \
196 sem_init \
197 sem_open \
198 sem_post \
199 sem_routines \
200 sem_timedwait \
201 sem_unlink \
202 sem_wait \
203 tpp \
204 unwind \
205 vars \
206
207 static-only-routines = pthread_atfork
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 += -fasynchronous-unwind-tables
234
235 # Calling pthread_exit() must cause the registered cancel handlers to
236 # be executed. Therefore exceptions have to be thrown through this
237 # function.
238 CFLAGS-pthread_exit.c += -fexceptions
239
240 # Among others, __pthread_unwind is forwarded. This function must handle
241 # exceptions.
242 CFLAGS-forward.c += -fexceptions
243
244 # The following are cancellation points. Some of the functions can
245 # block and therefore temporarily enable asynchronous cancellation.
246 # Those must be compiled asynchronous unwind tables.
247 CFLAGS-pthread_testcancel.c += -fexceptions
248 CFLAGS-pthread_join.c += -fexceptions -fasynchronous-unwind-tables
249 CFLAGS-pthread_timedjoin.c += -fexceptions -fasynchronous-unwind-tables
250 CFLAGS-pthread_clockjoin.c += -fexceptions -fasynchronous-unwind-tables
251 CFLAGS-pthread_once.c += $(uses-callbacks) -fexceptions \
252 -fasynchronous-unwind-tables
253 CFLAGS-pthread_cond_wait.c += -fexceptions -fasynchronous-unwind-tables
254 CFLAGS-pthread_kill.c = -fexceptions -fasynchronous-unwind-tables
255 CFLAGS-sem_wait.c += -fexceptions -fasynchronous-unwind-tables
256 CFLAGS-sem_timedwait.c += -fexceptions -fasynchronous-unwind-tables
257 CFLAGS-sem_clockwait.c = -fexceptions -fasynchronous-unwind-tables
258
259 CFLAGS-futex-internal.c += -fexceptions -fasynchronous-unwind-tables
260
261 LDLIBS-tst-once5 = -lstdc++
262 CFLAGS-tst-thread_local1.o = -std=gnu++11
263 LDLIBS-tst-thread_local1 = -lstdc++
264 CFLAGS-tst-thread-exit-clobber.o = -std=gnu++11
265 LDLIBS-tst-thread-exit-clobber = -lstdc++
266 CFLAGS-tst-minstack-throw.o = -std=gnu++11
267 LDLIBS-tst-minstack-throw = -lstdc++
268
269 tests = tst-attr2 tst-attr3 tst-default-attr \
270 tst-mutex5a tst-mutex7a \
271 tst-mutexpi1 tst-mutexpi2 tst-mutexpi3 tst-mutexpi4 \
272 tst-mutexpi5 tst-mutexpi5a tst-mutexpi6 tst-mutexpi7 tst-mutexpi7a \
273 tst-mutexpi9 tst-mutexpi10 \
274 tst-cond22 tst-cond26 \
275 tst-robustpi1 tst-robustpi2 tst-robustpi3 tst-robustpi4 tst-robustpi5 \
276 tst-robustpi6 tst-robustpi7 tst-robustpi9 \
277 tst-rwlock2 tst-rwlock2a tst-rwlock2b tst-rwlock3 \
278 tst-rwlock6 tst-rwlock7 tst-rwlock8 \
279 tst-rwlock9 tst-rwlock10 tst-rwlock11 \
280 tst-rwlock15 tst-rwlock17 tst-rwlock18 \
281 tst-once5 \
282 tst-sem17 \
283 tst-tsd3 tst-tsd4 \
284 tst-cancel4_1 tst-cancel4_2 \
285 tst-cancel7 tst-cancel17 tst-cancel24 \
286 tst-signal3 \
287 tst-exec4 tst-exec5 \
288 tst-stack2 tst-stack3 tst-stack4 \
289 tst-pthread-attr-affinity \
290 tst-pthread-attr-affinity-fail \
291 tst-dlsym1 \
292 tst-context1 \
293 tst-sched1 \
294 tst-initializers1 $(addprefix tst-initializers1-,\
295 c89 gnu89 c99 gnu99 c11 gnu11) \
296 tst-thread_local1 \
297 tst-robust-fork \
298 tst-thread-exit-clobber tst-minstack-cancel tst-minstack-exit \
299 tst-minstack-throw \
300 tst-rwlock-pwn \
301 tst-thread-affinity-pthread \
302 tst-thread-affinity-pthread2 \
303 tst-thread-affinity-sched \
304 tst-pthread-defaultattr-free \
305 tst-pthread-attr-sigmask \
306 tst-pthread-timedlock-lockloop \
307 tst-pthread-gdb-attach tst-pthread-gdb-attach-static \
308 tst-pthread_exit-nothreads \
309 tst-pthread_exit-nothreads-static \
310 tst-thread-setspecific
311
312 tests-nolibpthread = \
313 tst-pthread_exit-nothreads \
314 tst-pthread_exit-nothreads-static \
315
316 tests-container = tst-pthread-getattr
317
318 tests-internal := tst-robustpi8 tst-rwlock19 tst-rwlock20 \
319 tst-sem11 tst-sem12 tst-sem13 \
320 tst-barrier5 tst-signal7 tst-mutex8 tst-mutex8-static \
321 tst-mutexpi8 tst-mutexpi8-static \
322 tst-setgetname \
323
324 xtests = tst-setuid1 tst-setuid1-static tst-setuid2 \
325 tst-mutexpp1 tst-mutexpp6 tst-mutexpp10 tst-setgroups \
326 tst-mutexpp5 tst-mutexpp9
327
328 tests-time64 := \
329 tst-cancel4_2-time64
330
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.
333 xtests += tst-eintr1
334
335 test-srcs = tst-oddstacklimit
336
337 gen-as-const-headers = unwindbuf.sym \
338 pthread-pi-defines.sym
339
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
345
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
349 # we need -O0.
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)
362
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
369 else
370 CPPFLAGS-tst-pthread-gdb-attach.c += -DDO_ADD_SYMBOL_FILE=0
371 endif
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
375 # As of version 9.2, GDB cannot attach properly to PIE programs that
376 # were launched with an explicit ld.so invocation.
377 tst-pthread-gdb-attach-no-pie = yes
378
379 tests += tst-cancelx7 tst-cancelx17
380
381 ifeq ($(build-shared),yes)
382 tests += tst-compat-forwarder tst-audit-threads
383 tests-internal += tst-tls3 tst-tls3-malloc tst-tls5 tst-stackguard1
384 ifeq ($(have-z-execstack),yes)
385 tests += tst-execstack
386 endif
387 endif
388
389 modules-names = tst-tls3mod \
390 tst-tls5mod tst-tls5moda tst-tls5modb tst-tls5modc \
391 tst-tls5modd tst-tls5mode tst-tls5modf tst-stack4mod \
392 tst-execstack-mod \
393 tst-compat-forwarder-mod tst-audit-threads-mod1 \
394 tst-audit-threads-mod2
395 extra-test-objs += $(addsuffix .os,$(strip $(modules-names))) \
396 tst-cleanup4aux.o tst-cleanupx4aux.o
397 test-extras += tst-cleanup4aux tst-cleanupx4aux
398
399 # This test exercises compat symbols removed in glibc 2.34.
400 ifdef have-GLIBC_2.33
401 tests += tst-cleanup4
402 ifeq ($(build-shared),yes)
403 tests += tst-cleanupx4
404 endif
405 endif
406
407 tst-tls3mod.so-no-z-defs = yes
408 tst-tls5mod.so-no-z-defs = yes
409 tst-tls5moda.so-no-z-defs = yes
410 tst-tls5modb.so-no-z-defs = yes
411 tst-tls5modc.so-no-z-defs = yes
412 tst-tls5modd.so-no-z-defs = yes
413 tst-tls5mode.so-no-z-defs = yes
414 tst-tls5modf.so-no-z-defs = yes
415
416 ifeq ($(build-shared),yes)
417
418 # Set the `multidir' variable by grabbing the variable from the compiler.
419 # We do it once and save the result in a generated makefile.
420 -include $(objpfx)multidir.mk
421 $(objpfx)multidir.mk: $(common-objpfx)config.make
422 $(make-target-directory)
423 dir=`$(CC) $(CFLAGS) $(CPPFLAGS) -print-multi-directory`; \
424 echo "multidir := $$dir" > $@T
425 mv -f $@T $@
426
427 endif
428
429 CFLAGS-ftrylockfile.c += $(libio-mtsafe)
430 CFLAGS-funlockfile.c += $(libio-mtsafe)
431
432 link-libc-static := $(common-objpfx)libc.a $(static-gnulib) \
433 $(common-objpfx)libc.a
434
435 tests-static += tst-stackguard1-static \
436 tst-cancel24-static \
437 tst-mutex8-static tst-mutexpi8-static tst-sem11-static \
438 tst-sem12-static tst-cond11-static \
439 tst-pthread-gdb-attach-static \
440 tst-pthread_exit-nothreads-static
441
442 tests += tst-cancel24-static
443
444 tests-internal += tst-sem11-static tst-sem12-static tst-stackguard1-static
445 xtests-static += tst-setuid1-static
446
447 ifeq ($(run-built-tests),yes)
448 tests-special += $(objpfx)tst-stack3-mem.out $(objpfx)tst-oddstacklimit.out
449 ifeq ($(build-shared),yes)
450 tests-special += $(objpfx)tst-tls6.out
451 endif
452 endif
453
454 ifeq (,$(CXX))
455 # These tests require a C++ compiler and runtime.
456 tests-unsupported += tst-cancel24 tst-cancel24-static tst-once5 \
457 tst-thread-exit-clobber tst-minstack-throw
458 endif
459 # These tests require a C++ compiler and runtime with thread_local support.
460 ifneq ($(have-cxx-thread_local),yes)
461 tests-unsupported += tst-thread_local1
462 endif
463
464 include ../Rules
465
466 ifeq (yes,$(build-shared))
467 # Make sure these things are built in the `make lib' pass so they can be used
468 # to run programs during the `make others' pass.
469 lib-noranlib: $(addprefix $(objpfx),$(extra-objs))
470 endif
471
472
473 # 'pthread_self' is a simple memory or register load. Setting up the
474 # stack frame is more work than the actual operation. Disable the
475 # frame creation entirely. This will help applications which call the
476 # function frequently to get a thread-specific handle.
477 CFLAGS-pthread_self.os += -fomit-frame-pointer
478
479 # Run the cancellation and cleanup tests also for the modern, exception-based
480 # implementation. For this we have to pass the -fexceptions parameter.
481 CFLAGS-tst-cancelx7.c += -fexceptions
482 CFLAGS-tst-cancelx17.c += -fexceptions
483 CFLAGS-tst-cleanupx4.c += -fexceptions
484 CFLAGS-tst-cleanupx4aux.c += -fexceptions
485 CFLAGS-tst-initializers1.c += -W -Wall -Werror
486 CFLAGS-tst-initializers1-< = $(CFLAGS-tst-initializers1.c) \
487 $(patsubst tst-initializers1-%.c,-std=%,$<)
488 CFLAGS-tst-initializers1-c89.c += $(CFLAGS-tst-initializers1-<)
489 CFLAGS-tst-initializers1-c99.c += $(CFLAGS-tst-initializers1-<)
490 CFLAGS-tst-initializers1-c11.c += $(CFLAGS-tst-initializers1-<)
491 CFLAGS-tst-initializers1-gnu89.c += $(CFLAGS-tst-initializers1-<)
492 CFLAGS-tst-initializers1-gnu99.c += $(CFLAGS-tst-initializers1-<)
493 CFLAGS-tst-initializers1-gnu11.c += $(CFLAGS-tst-initializers1-<)
494
495 tst-cancel7-ARGS = --command "exec $(host-test-program-cmd)"
496 tst-cancelx7-ARGS = $(tst-cancel7-ARGS)
497
498 tst-stack3-ENV = MALLOC_TRACE=$(objpfx)tst-stack3.mtrace
499 $(objpfx)tst-stack3-mem.out: $(objpfx)tst-stack3.out
500 $(common-objpfx)malloc/mtrace $(objpfx)tst-stack3.mtrace > $@; \
501 $(evaluate-test)
502 generated += tst-stack3-mem.out tst-stack3.mtrace
503
504 tst-stack4mod.sos=$(shell for i in 0 1 2 3 4 5 6 7 8 9 10 \
505 11 12 13 14 15 16 17 18 19; do \
506 for j in 0 1 2 3 4 5 6 7 8 9 10 \
507 11 12 13 14 15 16 17 18 19; do \
508 echo $(objpfx)tst-stack4mod-$$i-$$j.so; \
509 done; done)
510 $(objpfx)tst-stack4.out: $(tst-stack4mod.sos)
511 $(tst-stack4mod.sos): $(objpfx)tst-stack4mod.so
512 cp -f $< $@
513 clean:
514 rm -f $(tst-stack4mod.sos)
515
516 $(objpfx)tst-cleanup4: $(objpfx)tst-cleanup4aux.o
517 $(objpfx)tst-cleanupx4: $(objpfx)tst-cleanupx4aux.o
518
519 LDFLAGS-tst-tls3 = -rdynamic
520 $(objpfx)tst-tls3.out: $(objpfx)tst-tls3mod.so
521
522 LDFLAGS-tst-tls3-malloc = -rdynamic
523 $(objpfx)tst-tls3-malloc.out: $(objpfx)tst-tls3mod.so
524
525 $(objpfx)tst-tls5: $(objpfx)tst-tls5mod.so
526 LDFLAGS-tst-tls5 = -Wl,--no-as-needed
527 LDFLAGS-tst-tls5mod.so = -Wl,-soname,tst-tls5mod.so
528
529 ifeq ($(build-shared),yes)
530 $(objpfx)tst-tls6.out: tst-tls6.sh $(objpfx)tst-tls5 \
531 $(objpfx)tst-tls5moda.so $(objpfx)tst-tls5modb.so \
532 $(objpfx)tst-tls5modc.so $(objpfx)tst-tls5modd.so \
533 $(objpfx)tst-tls5mode.so $(objpfx)tst-tls5modf.so
534 $(BASH) $< $(common-objpfx) '$(test-via-rtld-prefix)' \
535 '$(test-wrapper-env)' '$(run-program-env)'; \
536 $(evaluate-test)
537 endif
538
539 ifeq (yes,$(build-shared))
540 librt = $(common-objpfx)rt/librt.so
541 else
542 librt = $(common-objpfx)rt/librt.a
543 endif
544
545 $(objpfx)tst-cancel17: $(librt)
546 $(objpfx)tst-cancelx17: $(librt)
547
548 LDLIBS-tst-cancel24 = -Wl,--no-as-needed -lstdc++
549 LDLIBS-tst-cancel24-static = $(LDLIBS-tst-cancel24)
550
551 ifeq ($(build-shared),yes)
552
553 generated += multidir.mk tst-tls6.out
554 endif
555
556 tst-exec4-ARGS = $(host-test-program-cmd)
557
558 $(objpfx)tst-execstack.out: $(objpfx)tst-execstack-mod.so
559 LDFLAGS-tst-execstack = -Wl,-z,noexecstack
560 CFLAGS-tst-execstack-mod.c += -Wno-trampolines
561
562 tst-stackguard1-ARGS = --command "$(host-test-program-cmd) --child"
563 tst-stackguard1-static-ARGS = --command "$(objpfx)tst-stackguard1-static --child"
564
565 ifeq ($(run-built-tests),yes)
566 $(objpfx)tst-oddstacklimit.out: $(objpfx)tst-oddstacklimit $(objpfx)tst-basic1
567 $(test-program-prefix) $< --command '$(host-test-program-cmd)' > $@; \
568 $(evaluate-test)
569 endif
570
571 $(objpfx)tst-compat-forwarder: $(objpfx)tst-compat-forwarder-mod.so
572
573 tst-mutex10-ENV = GLIBC_TUNABLES=glibc.elision.enable=1
574
575 # Protect against a build using -Wl,-z,now.
576 LDFLAGS-tst-audit-threads-mod1.so = -Wl,-z,lazy
577 LDFLAGS-tst-audit-threads-mod2.so = -Wl,-z,lazy
578 LDFLAGS-tst-audit-threads = -Wl,-z,lazy
579 $(objpfx)tst-audit-threads: $(objpfx)tst-audit-threads-mod2.so
580 $(objpfx)tst-audit-threads.out: $(objpfx)tst-audit-threads-mod1.so
581 tst-audit-threads-ENV = LD_AUDIT=$(objpfx)tst-audit-threads-mod1.so
582
583 # The test uses dlopen indirectly and would otherwise load system
584 # objects.
585 tst-setuid1-static-ENV = \
586 LD_LIBRARY_PATH=$(ld-library-path):$(common-objpfx)elf:$(common-objpfx)nss
587
588 # The tests here better do not run in parallel.
589 ifeq ($(run-built-tests),yes)
590 ifneq ($(filter %tests,$(MAKECMDGOALS)),)
591 .NOTPARALLEL:
592 endif
593 endif