]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - nptl/Makefile
Replace = with += in CFLAGS-xxx.c/CPPFLAGS-xxx.c
[thirdparty/glibc.git] / nptl / Makefile
index 5b34b5c225b90f3f04916279d1a4fba7779cc76a..570a42301ca010096e1377f6464c8612867fc500 100644 (file)
@@ -153,82 +153,86 @@ libpthread-static-only-routines = pthread_atfork
 # even with asynchronous unwind tables.
 
 # nptl-init.c contains sigcancel_handler().
-CFLAGS-nptl-init.c = -fexceptions -fasynchronous-unwind-tables
+CFLAGS-nptl-init.c += -fexceptions -fasynchronous-unwind-tables
 # The unwind code itself,
-CFLAGS-unwind.c = -fexceptions
-CFLAGS-unwind-forcedunwind.c = -fexceptions -fasynchronous-unwind-tables
+CFLAGS-unwind.c += -fexceptions
+CFLAGS-unwind-forcedunwind.c += -fexceptions -fasynchronous-unwind-tables
 
 # The following three functions must be async-cancel safe.
-CFLAGS-pthread_cancel.c = -fexceptions -fasynchronous-unwind-tables
-CFLAGS-pthread_setcancelstate.c = -fexceptions -fasynchronous-unwind-tables
-CFLAGS-pthread_setcanceltype.c = -fexceptions -fasynchronous-unwind-tables
+CFLAGS-pthread_cancel.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-pthread_setcancelstate.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-pthread_setcanceltype.c += -fexceptions -fasynchronous-unwind-tables
 
 # These are internal functions which similar functionality as setcancelstate
 # and setcanceltype.
-CFLAGS-cancellation.c = -fasynchronous-unwind-tables
-CFLAGS-libc-cancellation.c = -fasynchronous-unwind-tables
+CFLAGS-cancellation.c += -fasynchronous-unwind-tables
+CFLAGS-libc-cancellation.c += -fasynchronous-unwind-tables
 
 # Calling pthread_exit() must cause the registered cancel handlers to
 # be executed.  Therefore exceptions have to be thrown through this
 # function.
-CFLAGS-pthread_exit.c = -fexceptions
+CFLAGS-pthread_exit.c += -fexceptions
 
 # Among others, __pthread_unwind is forwarded.  This function must handle
 # exceptions.
-CFLAGS-forward.c = -fexceptions
+CFLAGS-forward.c += -fexceptions
 
 # The following are cancellation points.  Some of the functions can
 # block and therefore temporarily enable asynchronous cancellation.
 # Those must be compiled asynchronous unwind tables.
-CFLAGS-pthread_testcancel.c = -fexceptions
-CFLAGS-pthread_join.c = -fexceptions -fasynchronous-unwind-tables
-CFLAGS-pthread_timedjoin.c = -fexceptions -fasynchronous-unwind-tables
-CFLAGS-pthread_once.c = $(uses-callbacks) -fexceptions \
+CFLAGS-pthread_testcancel.c += -fexceptions
+CFLAGS-pthread_join.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-pthread_timedjoin.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-pthread_once.c += $(uses-callbacks) -fexceptions \
                        -fasynchronous-unwind-tables
-CFLAGS-pthread_cond_wait.c = -fexceptions -fasynchronous-unwind-tables
-CFLAGS-sem_wait.c = -fexceptions -fasynchronous-unwind-tables
-CFLAGS-sem_timedwait.c = -fexceptions -fasynchronous-unwind-tables
+CFLAGS-pthread_cond_wait.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-sem_wait.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-sem_timedwait.c += -fexceptions -fasynchronous-unwind-tables
 
 # These are the function wrappers we have to duplicate here.
-CFLAGS-fcntl.c = -fexceptions -fasynchronous-unwind-tables
-CFLAGS-lockf.c = -fexceptions
-CFLAGS-pread.c = -fexceptions -fasynchronous-unwind-tables
-CFLAGS-pread64.c = -fexceptions -fasynchronous-unwind-tables
-CFLAGS-pwrite.c = -fexceptions -fasynchronous-unwind-tables
-CFLAGS-pwrite64.c = -fexceptions -fasynchronous-unwind-tables
-CFLAGS-wait.c = -fexceptions -fasynchronous-unwind-tables
-CFLAGS-waitpid.c = -fexceptions -fasynchronous-unwind-tables
-CFLAGS-sigwait.c = -fexceptions -fasynchronous-unwind-tables
-CFLAGS-msgrcv.c = -fexceptions -fasynchronous-unwind-tables
-CFLAGS-msgsnd.c = -fexceptions -fasynchronous-unwind-tables
-CFLAGS-tcdrain.c = -fexceptions -fasynchronous-unwind-tables
-CFLAGS-open.c = -fexceptions -fasynchronous-unwind-tables
-CFLAGS-open64.c = -fexceptions -fasynchronous-unwind-tables
-CFLAGS-pause.c = -fexceptions -fasynchronous-unwind-tables
-CFLAGS-recv.c = -fexceptions -fasynchronous-unwind-tables
-CFLAGS-send.c = -fexceptions -fasynchronous-unwind-tables
-CFLAGS-accept.c = -fexceptions -fasynchronous-unwind-tables
-CFLAGS-sendto.c = -fexceptions -fasynchronous-unwind-tables
-CFLAGS-connect.c = -fexceptions -fasynchronous-unwind-tables
-CFLAGS-recvfrom.c = -fexceptions -fasynchronous-unwind-tables
-CFLAGS-recvmsg.c = -fexceptions -fasynchronous-unwind-tables
-CFLAGS-sendmsg.c = -fexceptions -fasynchronous-unwind-tables
-CFLAGS-close.c = -fexceptions -fasynchronous-unwind-tables
-CFLAGS-read.c = -fexceptions -fasynchronous-unwind-tables
-CFLAGS-write.c = -fexceptions -fasynchronous-unwind-tables
-
-CFLAGS-pt-system.c = -fexceptions
+CFLAGS-fcntl.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-lockf.c += -fexceptions
+CFLAGS-pread.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-pread64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-pwrite.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-pwrite64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-wait.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-waitpid.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-sigwait.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-msgrcv.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-msgsnd.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-tcdrain.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-open.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-open64.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-pause.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-recv.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-send.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-accept.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-sendto.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-connect.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-recvfrom.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-recvmsg.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-sendmsg.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-close.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-read.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-write.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-nanosleep.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-sigsuspend.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-msync.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-fdatasync.c += -fexceptions -fasynchronous-unwind-tables
+CFLAGS-fsync.c += -fexceptions -fasynchronous-unwind-tables
+
+CFLAGS-pt-system.c += -fexceptions
 
 LDLIBS-tst-once5 = -lstdc++
 CFLAGS-tst-thread_local1.o = -std=gnu++11
 LDLIBS-tst-thread_local1 = -lstdc++
 
-tests = tst-typesizes \
-       tst-attr1 tst-attr2 tst-attr3 tst-default-attr \
+tests = tst-attr1 tst-attr2 tst-attr3 tst-default-attr \
        tst-mutex1 tst-mutex2 tst-mutex3 tst-mutex4 tst-mutex5 tst-mutex6 \
-       tst-mutex7 tst-mutex8 tst-mutex9 tst-mutex5a tst-mutex7a \
+       tst-mutex7 tst-mutex9 tst-mutex5a tst-mutex7a tst-mutex7robust \
        tst-mutexpi1 tst-mutexpi2 tst-mutexpi3 tst-mutexpi4 tst-mutexpi5 \
-       tst-mutexpi5a tst-mutexpi6 tst-mutexpi7 tst-mutexpi7a tst-mutexpi8 \
+       tst-mutexpi5a tst-mutexpi6 tst-mutexpi7 tst-mutexpi7a \
        tst-mutexpi9 \
        tst-spin1 tst-spin2 tst-spin3 tst-spin4 \
        tst-cond1 tst-cond2 tst-cond3 tst-cond4 tst-cond5 tst-cond6 tst-cond7 \
@@ -244,13 +248,12 @@ tests = tst-typesizes \
        tst-rwlock4 tst-rwlock5 tst-rwlock6 tst-rwlock7 tst-rwlock8 \
        tst-rwlock9 tst-rwlock10 tst-rwlock11 tst-rwlock12 tst-rwlock13 \
        tst-rwlock14 tst-rwlock15 tst-rwlock16 tst-rwlock17 tst-rwlock18 \
-       tst-rwlock19 \
        tst-once1 tst-once2 tst-once3 tst-once4 tst-once5 \
        tst-key1 tst-key2 tst-key3 tst-key4 \
        tst-sem1 tst-sem2 tst-sem3 tst-sem4 tst-sem5 tst-sem6 tst-sem7 \
-       tst-sem8 tst-sem9 tst-sem10 tst-sem11 tst-sem12 tst-sem13 tst-sem14 \
+       tst-sem8 tst-sem9 tst-sem10 tst-sem14 \
        tst-sem15 tst-sem16 \
-       tst-barrier1 tst-barrier2 tst-barrier3 tst-barrier4 tst-barrier5 \
+       tst-barrier1 tst-barrier2 tst-barrier3 tst-barrier4 \
        tst-align tst-align3 \
        tst-basic1 tst-basic2 tst-basic3 tst-basic4 tst-basic5 tst-basic6 \
        tst-basic7 \
@@ -275,7 +278,7 @@ tests = tst-typesizes \
        tst-cleanup0 tst-cleanup1 tst-cleanup2 tst-cleanup3 tst-cleanup4 \
        tst-flock1 tst-flock2 \
        tst-signal1 tst-signal2 tst-signal3 tst-signal4 tst-signal5 \
-       tst-signal6 tst-signal7 \
+       tst-signal6 \
        tst-exec1 tst-exec2 tst-exec3 tst-exec4 tst-exec5 \
        tst-exit1 tst-exit2 tst-exit3 \
        tst-stdio1 tst-stdio2 \
@@ -299,7 +302,13 @@ tests = tst-typesizes \
                            c89 gnu89 c99 gnu99 c11 gnu11) \
        tst-bad-schedattr \
        tst-thread_local1 tst-mutex-errorcheck tst-robust10 \
-       tst-robust-fork tst-create-detached
+       tst-robust-fork tst-create-detached tst-memstream
+
+tests-internal := tst-rwlock19 tst-rwlock20 \
+                 tst-sem11 tst-sem12 tst-sem13 \
+                 tst-barrier5 tst-signal7 tst-mutex8 tst-mutex8-static \
+                 tst-mutexpi8 tst-mutexpi8-static
+
 xtests = tst-setuid1 tst-setuid1-static tst-setuid2 \
        tst-mutexpp1 tst-mutexpp6 tst-mutexpp10
 test-srcs = tst-oddstacklimit
@@ -347,8 +356,8 @@ endif
 LDFLAGS-pthread.so = -Wl,--enable-new-dtags,-z,nodelete,-z,initfirst
 
 # GCC-4.9 compiles 'sprintf(NULL, ...)' into UD2 on x86_64 without -fno-builtin
-CFLAGS-tst-cleanup2.c = -fno-builtin
-CFLAGS-tst-cleanupx2.c = -fno-builtin
+CFLAGS-tst-cleanup2.c += -fno-builtin
+CFLAGS-tst-cleanupx2.c += -fno-builtin
 
 tests += tst-cancelx2 tst-cancelx3 tst-cancelx4 tst-cancelx5 \
         tst-cancelx6 tst-cancelx7 tst-cancelx8 tst-cancelx9 tst-cancelx10 \
@@ -357,8 +366,8 @@ tests += tst-cancelx2 tst-cancelx3 tst-cancelx4 tst-cancelx5 \
         tst-cleanupx0 tst-cleanupx1 tst-cleanupx2 tst-cleanupx3 tst-cleanupx4 \
         tst-oncex3 tst-oncex4
 ifeq ($(build-shared),yes)
-tests += tst-atfork2 tst-tls3 tst-tls3-malloc tst-tls4 tst-tls5 tst-_res1 \
-        tst-fini1 tst-stackguard1
+tests += tst-atfork2 tst-tls4 tst-_res1 tst-fini1 tst-compat-forwarder
+tests-internal += tst-tls3 tst-tls3-malloc tst-tls5 tst-stackguard1
 tests-nolibpthread += tst-fini1
 ifeq ($(have-z-execstack),yes)
 tests += tst-execstack
@@ -369,10 +378,10 @@ modules-names = tst-atfork2mod tst-tls3mod tst-tls4moda tst-tls4modb \
                tst-tls5mod tst-tls5moda tst-tls5modb tst-tls5modc \
                tst-tls5modd tst-tls5mode tst-tls5modf tst-stack4mod \
                tst-_res1mod1 tst-_res1mod2 tst-execstack-mod tst-fini1mod \
-               tst-join7mod
+               tst-join7mod tst-compat-forwarder-mod
 extra-test-objs += $(addsuffix .os,$(strip $(modules-names))) \
                   tst-cleanup4aux.o tst-cleanupx4aux.o
-test-extras += $(modules-names) tst-cleanup4aux tst-cleanupx4aux
+test-extras += tst-cleanup4aux tst-cleanupx4aux
 test-modules = $(addprefix $(objpfx),$(addsuffix .so,$(modules-names)))
 
 tst-atfork2mod.so-no-z-defs = yes
@@ -414,9 +423,9 @@ extra-objs += $(crti-objs) $(crtn-objs)
 extra-objs += pt-crti.o
 endif
 
-CFLAGS-flockfile.c = $(libio-mtsafe)
-CFLAGS-ftrylockfile.c = $(libio-mtsafe)
-CFLAGS-funlockfile.c = $(libio-mtsafe)
+CFLAGS-flockfile.c += $(libio-mtsafe)
+CFLAGS-ftrylockfile.c += $(libio-mtsafe)
+CFLAGS-funlockfile.c += $(libio-mtsafe)
 
 link-libc-static := $(common-objpfx)libc.a $(static-gnulib) \
                    $(common-objpfx)libc.a
@@ -425,9 +434,9 @@ tests-static += tst-locale1 tst-locale2 tst-stackguard1-static \
                tst-cancel21-static tst-cancel24-static tst-cond8-static \
                tst-mutex8-static tst-mutexpi8-static tst-sem11-static \
                tst-sem12-static
-tests += tst-stackguard1-static tst-cancel21-static tst-cancel24-static \
-        tst-cond8-static tst-mutex8-static tst-mutexpi8-static \
-        tst-sem11-static tst-sem12-static
+tests += tst-cancel21-static tst-cancel24-static \
+        tst-cond8-static
+tests-internal += tst-sem11-static tst-sem12-static tst-stackguard1-static
 xtests-static += tst-setuid1-static
 
 # These tests are linked with libc before libpthread
@@ -519,15 +528,15 @@ CFLAGS-tst-oncex3.c += -fexceptions
 CFLAGS-tst-oncex4.c += -fexceptions
 CFLAGS-tst-align.c += $(stack-align-test-flags)
 CFLAGS-tst-align3.c += $(stack-align-test-flags)
-CFLAGS-tst-initializers1.c = -W -Wall -Werror
+CFLAGS-tst-initializers1.c += -W -Wall -Werror
 CFLAGS-tst-initializers1-< = $(CFLAGS-tst-initializers1.c) \
                             $(patsubst tst-initializers1-%.c,-std=%,$<)
-CFLAGS-tst-initializers1-c89.c = $(CFLAGS-tst-initializers1-<)
-CFLAGS-tst-initializers1-c99.c = $(CFLAGS-tst-initializers1-<)
-CFLAGS-tst-initializers1-c11.c = $(CFLAGS-tst-initializers1-<)
-CFLAGS-tst-initializers1-gnu89.c = $(CFLAGS-tst-initializers1-<)
-CFLAGS-tst-initializers1-gnu99.c = $(CFLAGS-tst-initializers1-<)
-CFLAGS-tst-initializers1-gnu11.c = $(CFLAGS-tst-initializers1-<)
+CFLAGS-tst-initializers1-c89.c += $(CFLAGS-tst-initializers1-<)
+CFLAGS-tst-initializers1-c99.c += $(CFLAGS-tst-initializers1-<)
+CFLAGS-tst-initializers1-c11.c += $(CFLAGS-tst-initializers1-<)
+CFLAGS-tst-initializers1-gnu89.c += $(CFLAGS-tst-initializers1-<)
+CFLAGS-tst-initializers1-gnu99.c += $(CFLAGS-tst-initializers1-<)
+CFLAGS-tst-initializers1-gnu11.c += $(CFLAGS-tst-initializers1-<)
 
 tst-cancel7-ARGS = --command "exec $(host-test-program-cmd)"
 tst-cancelx7-ARGS = $(tst-cancel7-ARGS)
@@ -582,7 +591,7 @@ $(objpfx)tst-tls6.out: tst-tls6.sh $(objpfx)tst-tls5 \
                       $(objpfx)tst-tls5modc.so $(objpfx)tst-tls5modd.so \
                       $(objpfx)tst-tls5mode.so $(objpfx)tst-tls5modf.so
        $(BASH) $< $(common-objpfx) '$(test-via-rtld-prefix)' \
-         '$(test-wrapper-env)' '$(run-program-env)'; \
+         '$(test-wrapper-env)' '$(run-program-env)' > $@; \
        $(evaluate-test)
 endif
 
@@ -622,8 +631,9 @@ ifeq ($(build-shared),yes)
 $(addprefix $(objpfx), \
   $(filter-out $(tests-static) $(xtests-static) $(tests-reverse) \
     $(tests-nolibpthread), \
-    $(tests) $(xtests) $(test-srcs))): $(objpfx)libpthread.so \
-                                      $(objpfx)libpthread_nonshared.a
+    $(tests) $(tests-internal) $(xtests) $(test-srcs))): \
+       $(objpfx)libpthread.so \
+       $(objpfx)libpthread_nonshared.a
 $(objpfx)tst-unload: $(libdl)
 # $(objpfx)../libc.so is used instead of $(common-objpfx)libc.so,
 # since otherwise libpthread.so comes before libc.so when linking.
@@ -666,11 +676,6 @@ generated += libpthread_nonshared.a \
 generated += $(objpfx)tst-atfork2.mtrace \
             $(addsuffix .so,$(strip $(modules-names)))
 
-$(objpfx)version.d: $(objpfx)banner.h
-$(objpfx)version.os: $(objpfx)banner.h
-$(objpfx)banner.h: Banner
-       sed 's/\(.*\)/"\1\\n"/' $< > $@
-generated += banner.h
 # Give libpthread.so an entry point and make it directly runnable itself.
 LDFLAGS-pthread.so += -e __nptl_main
 # pt-interp.c exists just to get the runtime linker path into libpthread.so.
@@ -707,6 +712,12 @@ $(objpfx)tst-oddstacklimit.out: $(objpfx)tst-oddstacklimit $(objpfx)tst-basic1
        $(evaluate-test)
 endif
 
+$(objpfx)tst-compat-forwarder: $(objpfx)tst-compat-forwarder-mod.so
+
+# Disable elision for tst-mutex8 so it can verify error case for
+# destroying a mutex.
+tst-mutex8-ENV = GLIBC_TUNABLES=glibc.elision.enable=0
+
 # The tests here better do not run in parallel
 ifneq ($(filter %tests,$(MAKECMDGOALS)),)
 .NOTPARALLEL: