[hurd,commited] pthread: Move robust mutex tests from nptl to sysdeps/pthread

Message ID 20200216144553.404073-1-samuel.thibault@ens-lyon.org
State Committed, archived
Headers

Commit Message

Samuel Thibault Feb. 16, 2020, 2:45 p.m. UTC
  tst-robust8.c prints some mutex internals for nptl debugging, this
needed to be made conditioned by getting built with nptl.
---
 nptl/Makefile                            |  4 +---
 nptl/pthreadP.h                          |  2 ++
 sysdeps/htl/pthreadP.h                   |  2 ++
 sysdeps/mach/hurd/i386/Makefile          | 16 +++++++++++-----
 sysdeps/pthread/Makefile                 |  2 ++
 {nptl => sysdeps/pthread}/tst-robust1.c  |  0
 {nptl => sysdeps/pthread}/tst-robust10.c |  0
 {nptl => sysdeps/pthread}/tst-robust2.c  |  0
 {nptl => sysdeps/pthread}/tst-robust3.c  |  0
 {nptl => sysdeps/pthread}/tst-robust4.c  |  0
 {nptl => sysdeps/pthread}/tst-robust5.c  |  0
 {nptl => sysdeps/pthread}/tst-robust6.c  |  0
 {nptl => sysdeps/pthread}/tst-robust7.c  |  0
 {nptl => sysdeps/pthread}/tst-robust8.c  |  3 +++
 {nptl => sysdeps/pthread}/tst-robust9.c  |  0
 15 files changed, 21 insertions(+), 8 deletions(-)
 rename {nptl => sysdeps/pthread}/tst-robust1.c (100%)
 rename {nptl => sysdeps/pthread}/tst-robust10.c (100%)
 rename {nptl => sysdeps/pthread}/tst-robust2.c (100%)
 rename {nptl => sysdeps/pthread}/tst-robust3.c (100%)
 rename {nptl => sysdeps/pthread}/tst-robust4.c (100%)
 rename {nptl => sysdeps/pthread}/tst-robust5.c (100%)
 rename {nptl => sysdeps/pthread}/tst-robust6.c (100%)
 rename {nptl => sysdeps/pthread}/tst-robust7.c (100%)
 rename {nptl => sysdeps/pthread}/tst-robust8.c (99%)
 rename {nptl => sysdeps/pthread}/tst-robust9.c (100%)
  

Patch

diff --git a/nptl/Makefile b/nptl/Makefile
index fcdc72adfe..b25d34bd71 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -240,8 +240,6 @@  tests = tst-attr2 tst-attr3 tst-default-attr \
 	tst-mutexpi5 tst-mutexpi5a tst-mutexpi6 tst-mutexpi7 tst-mutexpi7a \
 	tst-mutexpi9 \
 	tst-cond11 tst-cond20 tst-cond21 tst-cond22 tst-cond26 tst-cond27 \
-	tst-robust1 tst-robust2 tst-robust3 tst-robust4 tst-robust5 \
-	tst-robust6 tst-robust7 tst-robust8 tst-robust9 \
 	tst-robustpi1 tst-robustpi2 tst-robustpi3 tst-robustpi4 tst-robustpi5 \
 	tst-robustpi6 tst-robustpi7 tst-robustpi8 tst-robustpi9 \
 	tst-rwlock2 tst-rwlock2a tst-rwlock2b tst-rwlock3 \
@@ -297,7 +295,7 @@  tests = tst-attr2 tst-attr3 tst-default-attr \
 	tst-initializers1 $(addprefix tst-initializers1-,\
 			    c89 gnu89 c99 gnu99 c11 gnu11) \
 	tst-bad-schedattr \
-	tst-thread_local1 tst-mutex-errorcheck tst-robust10 \
+	tst-thread_local1 tst-mutex-errorcheck \
 	tst-robust-fork tst-create-detached tst-memstream \
 	tst-thread-exit-clobber tst-minstack-cancel tst-minstack-exit \
 	tst-minstack-throw \
diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
index 7e0ab8ef42..df4b1a0cda 100644
--- a/nptl/pthreadP.h
+++ b/nptl/pthreadP.h
@@ -19,6 +19,8 @@ 
 #ifndef _PTHREADP_H
 #define _PTHREADP_H	1
 
+#define __PTHREAD_NPTL
+
 #include <pthread.h>
 #include <setjmp.h>
 #include <stdbool.h>
diff --git a/sysdeps/htl/pthreadP.h b/sysdeps/htl/pthreadP.h
index 2bb4baa249..1726ebb122 100644
--- a/sysdeps/htl/pthreadP.h
+++ b/sysdeps/htl/pthreadP.h
@@ -19,6 +19,8 @@ 
 #ifndef _PTHREADP_H
 #define _PTHREADP_H	1
 
+#define __PTHREAD_HTL
+
 #include <pthread.h>
 
 /* Attribute to indicate thread creation was issued from C11 thrd_create.  */
diff --git a/sysdeps/mach/hurd/i386/Makefile b/sysdeps/mach/hurd/i386/Makefile
index e6e665b5fe..068f7d0419 100644
--- a/sysdeps/mach/hurd/i386/Makefile
+++ b/sysdeps/mach/hurd/i386/Makefile
@@ -97,8 +97,8 @@  ifeq ($(subdir),mach)
 test-xfail-check-abi-libmachuser = yes
 endif
 
-# For bug 25521
 ifeq ($(subdir),htl)
+# For bug 25521
 test-xfail-tst-mutex4 = yes
 test-xfail-tst-cond4 = yes
 test-xfail-tst-cond6 = yes
@@ -109,20 +109,26 @@  test-xfail-tst-rwlock4 = yes
 test-xfail-tst-rwlock12 = yes
 test-xfail-tst-sem3 = yes
 test-xfail-tst-barrier2 = yes
-endif
 
 # For bug 25522
-ifeq ($(subdir),htl)
 test-xfail-tst-cond24 = yes
 test-xfail-tst-cond25 = yes
-endif
 
 # For bug 25524
-ifeq ($(subdir),htl)
 test-xfail-tst-sem4 = yes
 test-xfail-tst-sem7 = yes
 test-xfail-tst-sem8 = yes
 test-xfail-tst-sem9 = yes
+
+# For bug 25563
+test-xfail-tst-robust1 = yes
+test-xfail-tst-robust2 = yes
+test-xfail-tst-robust3 = yes
+test-xfail-tst-robust4 = yes
+test-xfail-tst-robust5 = yes
+test-xfail-tst-robust6 = yes
+test-xfail-tst-robust7 = yes
+test-xfail-tst-robust9 = yes
 endif
 
 ifeq ($(subdir),elf)
diff --git a/sysdeps/pthread/Makefile b/sysdeps/pthread/Makefile
index 396f2b18bf..b6491d6309 100644
--- a/sysdeps/pthread/Makefile
+++ b/sysdeps/pthread/Makefile
@@ -55,6 +55,8 @@  tests += tst-cnd-basic tst-mtx-trylock tst-cnd-broadcast \
 	 tst-key1 tst-key2 tst-key3 tst-key4 \
 	 tst-mutex1 tst-mutex2 tst-mutex3 tst-mutex4 tst-mutex6 tst-mutex10 \
 	 tst-once1 tst-once2 tst-once3 tst-once4 \
+	 tst-robust1 tst-robust2 tst-robust3 tst-robust4 tst-robust5 \
+	 tst-robust6 tst-robust7 tst-robust8 tst-robust9 tst-robust10 \
 	 tst-rwlock1 tst-rwlock4 tst-rwlock5 tst-rwlock13 tst-rwlock16 \
 	 tst-rwlock-tryrdlock-stall tst-rwlock-trywrlock-stall \
 	 tst-sem1 tst-sem2 tst-sem3 tst-sem4 tst-sem6 tst-sem7 \
diff --git a/nptl/tst-robust1.c b/sysdeps/pthread/tst-robust1.c
similarity index 100%
rename from nptl/tst-robust1.c
rename to sysdeps/pthread/tst-robust1.c
diff --git a/nptl/tst-robust10.c b/sysdeps/pthread/tst-robust10.c
similarity index 100%
rename from nptl/tst-robust10.c
rename to sysdeps/pthread/tst-robust10.c
diff --git a/nptl/tst-robust2.c b/sysdeps/pthread/tst-robust2.c
similarity index 100%
rename from nptl/tst-robust2.c
rename to sysdeps/pthread/tst-robust2.c
diff --git a/nptl/tst-robust3.c b/sysdeps/pthread/tst-robust3.c
similarity index 100%
rename from nptl/tst-robust3.c
rename to sysdeps/pthread/tst-robust3.c
diff --git a/nptl/tst-robust4.c b/sysdeps/pthread/tst-robust4.c
similarity index 100%
rename from nptl/tst-robust4.c
rename to sysdeps/pthread/tst-robust4.c
diff --git a/nptl/tst-robust5.c b/sysdeps/pthread/tst-robust5.c
similarity index 100%
rename from nptl/tst-robust5.c
rename to sysdeps/pthread/tst-robust5.c
diff --git a/nptl/tst-robust6.c b/sysdeps/pthread/tst-robust6.c
similarity index 100%
rename from nptl/tst-robust6.c
rename to sysdeps/pthread/tst-robust6.c
diff --git a/nptl/tst-robust7.c b/sysdeps/pthread/tst-robust7.c
similarity index 100%
rename from nptl/tst-robust7.c
rename to sysdeps/pthread/tst-robust7.c
diff --git a/nptl/tst-robust8.c b/sysdeps/pthread/tst-robust8.c
similarity index 99%
rename from nptl/tst-robust8.c
rename to sysdeps/pthread/tst-robust8.c
index f6969a4b84..27dd53d2c3 100644
--- a/nptl/tst-robust8.c
+++ b/sysdeps/pthread/tst-robust8.c
@@ -8,6 +8,7 @@ 
 #include <sys/mman.h>
 #include <sys/wait.h>
 
+#include <pthreadP.h>
 
 
 
@@ -252,7 +253,9 @@  do_test (void)
 	    {
 	      printf ("mutex_destroy %d in round %d failed with %d\n",
 		      n + 1, round, e);
+#ifdef __PTHREAD_NPTL
 	      printf("nusers = %d\n", (int) map[n].__data.__nusers);
+#endif
 	      return 1;
 	    }
 	}
diff --git a/nptl/tst-robust9.c b/sysdeps/pthread/tst-robust9.c
similarity index 100%
rename from nptl/tst-robust9.c
rename to sysdeps/pthread/tst-robust9.c