This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
[PATCH] PowerPC64 port part 7 of 7
- From: Steven Munroe <sjmunroe at vnet dot ibm dot com>
- To: libc-alpha at sources dot redhat dot com
- Cc: aj at suse dot de
- Date: Mon, 19 Aug 2002 13:53:03 -0500
- Subject: [PATCH] PowerPC64 port part 7 of 7
PowerPC64 part 7 of 7 follows:
2002-04-24 Steven Munroe <sjmunroe@us.ibm.com>
* spinlock.c (__pthread_lock & __pthread_unlock)
Fixed a race condition in __pthread_lock related to "spurious_wakeups"
generated by timed rwlocks. This fixes a hang in Examples/ex11.
2002-04-24 Steven Munroe <sjmunroe@us.ibm.com>
* Examples/ex17.c (main): Attribute stacksize is a size_t which is a long. Fix printf format to print
stacksize as a long (%xl).
2002-02-20 Steven Munroe <sjmunroe@us.ibm.com>
* Makefile: If configured with "build-static-nss" then copy tests to
tests-static and explicitly add libraries via "LDLIBS-xyz" symbols.
Allow configure with --enable-static-nss and --disable-shared,
otherwise make check will fail.
>>>>>>>> linuxthreads-glibc.patch
diff -rc2PN -x *.orig libc23-cvstip-20020815/linuxthreads/Examples/ex17.c libc23/linuxthreads/Examples/ex17.c
*** libc23-cvstip-20020815/linuxthreads/Examples/ex17.c Tue Jul 31 14:43:34 2001
--- libc23/linuxthreads/Examples/ex17.c Thu Aug 15 16:54:50 2002
***************
*** 54,58 ****
if (stack2 != stack || stacksize != STACKSIZE)
{
! printf ("first pthread_attr_getstack returned different stack (%p,%x)\n"
"than was set by setstack (%p,%x)\n",
stack2, stacksize, stack, STACKSIZE);
--- 54,58 ----
if (stack2 != stack || stacksize != STACKSIZE)
{
! printf ("first pthread_attr_getstack returned different stack (%p,%lx)\n"
"than was set by setstack (%p,%x)\n",
stack2, stacksize, stack, STACKSIZE);
***************
*** 90,94 ****
if (stack2 != stack || stacksize != STACKSIZE)
{
! printf ("second pthread_attr_getstack returned different stack (%p,%x)\n"
"than was set by setstack (%p,%x)\n",
stack2, stacksize, stack, STACKSIZE);
--- 90,94 ----
if (stack2 != stack || stacksize != STACKSIZE)
{
! printf ("second pthread_attr_getstack returned different stack (%p,%lx)\n"
"than was set by setstack (%p,%x)\n",
stack2, stacksize, stack, STACKSIZE);
diff -rc2PN -x *.orig libc23-cvstip-20020815/linuxthreads/Makefile libc23/linuxthreads/Makefile
*** libc23-cvstip-20020815/linuxthreads/Makefile Mon Jul 22 19:36:39 2002
--- libc23/linuxthreads/Makefile Thu Aug 15 16:54:50 2002
***************
*** 69,72 ****
--- 69,99 ----
endif
+ # for static links
+ ifeq (yes,$(build-static-nss))
+ tests-static = $(tests)
+ LDLIBS-ex1 += libc nss/libnss_files resolv/libnss_dns resolv/libresolv
+ LDLIBS-ex2 += libc nss/libnss_files resolv/libnss_dns resolv/libresolv
+ LDLIBS-ex3 += libc nss/libnss_files resolv/libnss_dns resolv/libresolv
+ LDLIBS-ex4 += libc nss/libnss_files resolv/libnss_dns resolv/libresolv
+ LDLIBS-ex5 += libc nss/libnss_files resolv/libnss_dns resolv/libresolv
+ LDLIBS-ex6 += libc nss/libnss_files resolv/libnss_dns resolv/libresolv
+ LDLIBS-ex7 += libc nss/libnss_files resolv/libnss_dns resolv/libresolv
+ LDLIBS-ex8 += libc nss/libnss_files resolv/libnss_dns resolv/libresolv
+ LDLIBS-ex9 += libc nss/libnss_files resolv/libnss_dns resolv/libresolv
+ LDLIBS-ex10 += libc nss/libnss_files resolv/libnss_dns resolv/libresolv
+ LDLIBS-ex11 += libc nss/libnss_files resolv/libnss_dns resolv/libresolv
+ LDLIBS-ex12 += libc nss/libnss_files resolv/libnss_dns resolv/libresolv
+ LDLIBS-ex13 += libc nss/libnss_files resolv/libnss_dns resolv/libresolv
+ LDLIBS-ex14 += libc nss/libnss_files resolv/libnss_dns resolv/libresolv
+ LDLIBS-ex15 += libc nss/libnss_files resolv/libnss_dns resolv/libresolv
+ LDLIBS-ex16 += libc nss/libnss_files resolv/libnss_dns resolv/libresolv
+ LDLIBS-ex17 += libc nss/libnss_files resolv/libnss_dns resolv/libresolv
+ LDLIBS-ex18 += libc nss/libnss_files resolv/libnss_dns resolv/libresolv
+ LDLIBS-joinrace += libc nss/libnss_files resolv/libnss_dns resolv/libresolv
+ LDLIBS-tststack += libc nss/libnss_files resolv/libnss_dns resolv/libresolv
+ LDLIBS-ecmutex += libc nss/libnss_files resolv/libnss_dns resolv/libresolv
+ LDLIBS-tst-cancel += libc nss/libnss_files resolv/libnss_dns resolv/libresolv
+ endif
+
ifeq (yes,$(build-shared))
tests-nodelete-yes = unload
diff -rc2PN -x *.orig libc23-cvstip-20020815/linuxthreads/spinlock.c libc23/linuxthreads/spinlock.c
*** libc23-cvstip-20020815/linuxthreads/spinlock.c Thu Jun 20 19:51:19 2002
--- libc23/linuxthreads/spinlock.c Thu Aug 15 16:54:50 2002
***************
*** 86,91 ****
spin_count = 0;
- again:
-
/* On SMP, try spinning to get the lock. */
--- 86,89 ----
***************
*** 115,118 ****
--- 113,118 ----
}
+ again:
+
/* No luck, try once more or suspend. */
***************
*** 131,135 ****
if (self != NULL) {
! THREAD_SETMEM(self, p_nextlock, (pthread_descr) (oldstatus & ~1L));
/* Make sure the store in p_nextlock completes before performing
the compare-and-swap */
--- 131,135 ----
if (self != NULL) {
! THREAD_SETMEM(self, p_nextlock, (pthread_descr) (oldstatus));
/* Make sure the store in p_nextlock completes before performing
the compare-and-swap */
***************
*** 215,219 ****
}
ptr = &(thr->p_nextlock);
! thr = *ptr;
}
--- 215,219 ----
}
ptr = &(thr->p_nextlock);
! thr = (pthread_descr)((long)(thr->p_nextlock) & ~1L);
}
***************
*** 227,231 ****
thr = (pthread_descr) (oldstatus & ~1L);
if (! __compare_and_swap_with_release_semantics
! (&lock->__status, oldstatus, (long)(thr->p_nextlock)))
goto again;
} else {
--- 227,231 ----
thr = (pthread_descr) (oldstatus & ~1L);
if (! __compare_and_swap_with_release_semantics
! (&lock->__status, oldstatus, (long)(thr->p_nextlock) & ~1L))
goto again;
} else {
***************
*** 233,237 ****
But in this case we must also flip the least significant bit
of the status to mark the lock as released. */
! thr = *maxptr;
*maxptr = thr->p_nextlock;
--- 233,237 ----
But in this case we must also flip the least significant bit
of the status to mark the lock as released. */
! thr = (pthread_descr)((long)*maxptr & ~1L);
*maxptr = thr->p_nextlock;
<<<<<<<< linuxthreads-glibc.patch