This is the mail archive of the libc-alpha@cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: glibc 2.0.106


On Mon, Dec 07, 1998 at 07:02:21PM -0800, Ulrich Drepper wrote:
> Hi,
> 
> The next and one of the last test releases of glibc is available at
> 
> 	ftp://sourceware.cygnus.com/pub/glibc
> and
> 	ftp://alpha.gnu.org/gnu
> 
> The libc tarball itself and the LinuxThreads add-on are available.
> Old crypt add-ons can be used.
> 
> We've mainly fixed details accept for Hurd where glibc 2.1 is
> hopefully becoming usable now.
> 
> Please give it a try and send some feedback.  I usually give one or
> two replies which I don't think corresponds to the number of people
> using the library.


I finally remembered that I had the attached patch from Corey Minyard
lying around.  I've been using it for a while, and it works fine;
whether it is necessary or not I'm not entirely sure.  Any comments?

Dan

/--------------------------------\  /--------------------------------\
|       Daniel Jacobowitz        |__|     CMU, CS class of 2002      |
|   Debian GNU/Linux Developer    __   Part-Time Systems Programmer  |
|         dan@debian.org         |  |        drow@cs.cmu.edu         |
\--------------------------------/  \--------------------------------/
Date: 07 Oct 1998 00:04:55 -0500
From: Corey Minyard <minyard@acm.org>
To: linux-ppc@meetpoint.mcu.motsps.com
Subject: [linux-ppc] Fixes for linuxthreads

I've just joined this list, but I've been using LinuxPPC for a little
while.  I discovered a bug in the DR4 linuxthreads package that was
causing general trouble with threads.  It turns out a little more
stack padding is required that was provided.  The patch at the end
fixes the problem.  This patch is for the standard glibc that comes
with LinuxPPC DR4.

With this patch, GNAT (the GNU Ada95 compiler) seems to handle threads
well.  Without it, wierd things happened.

I'm curious how to get this into the standard release.  I can't
completely compile glibc-0.961212-1g because it locks up running
rpcgen with the new loader, but I could compile the linuxthreads part
fine.

Also, I'm looking for anyone working on getting the new versions of
glibc working on LinuxPPC.

Thanks,

-- 
Corey Minyard               Internet:  minyard@acm.org
  Work: minyard@nortel.ca       UUCP:  minyard@wf-rch.cirr.com

[[ This message was sent via the linux-ppc mailing list. Replies are not ]]
[[ forced back to the list,  so be sure to Cc linux-ppc if your reply is ]]
[[ of general interest.  To unsubscribe from linux-ppc, send the message ]]
[[ 'unsubscribe' to linux-ppc-request@meetpoint.mcu.motsps.com.          ]]

[Note from Daniel Jacobowitz <dan@debian.org>: This isn't his patch.  This
 is his patch merged on to glibc 2.0.97.  Not too many changes.]

--- glibc-pre2.1-2.0.100.orig/linuxthreads/internals.h	Thu Oct  8 21:11:28 1998
+++ glibc-pre2.1-2.0.100/linuxthreads/internals.h	Thu Oct  8 21:11:50 1998
@@ -258,6 +258,12 @@
 #define CURRENT_STACK_FRAME  ({ char __csf; &__csf; })
 #endif
 
+/* Some architectures need some extra stack padding, set it to zero
+   if not declared */
+#ifndef EXTRA_STACK_PADDING
+#define EXTRA_STACK_PADDING 0
+#endif
+
 /* Recover thread descriptor for the current thread */
 
 extern pthread_descr __pthread_find_self (void) __attribute__ ((const));
--- glibc-pre2.1-2.0.100.orig/linuxthreads/manager.c	Thu Oct  8 21:11:28 1998
+++ glibc-pre2.1-2.0.100/linuxthreads/manager.c	Thu Oct  8 21:14:11 1998
@@ -373,7 +373,8 @@
   /* Raise priority of thread manager if needed */
   __pthread_manager_adjust_prio(new_thread->p_priority);
   /* Do the cloning */
-  pid = __clone(pthread_start_thread, (void **) new_thread,
+  pid = __clone(pthread_start_thread,
+                (void **) ((unsigned long)new_thread - EXTRA_STACK_PADDING),
                 CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND |
 #ifdef CLONE_PTRACE
                 CLONE_PTRACE |
--- glibc-pre2.1-2.0.100.orig/linuxthreads/pthread.c	Thu Oct  8 21:11:28 1998
+++ glibc-pre2.1-2.0.100/linuxthreads/pthread.c	Thu Oct  8 21:13:52 1998
@@ -278,7 +278,8 @@
     return -1;
   }
   /* Start the thread manager */
-  pid = __clone(__pthread_manager, (void **) __pthread_manager_thread_tos,
+  pid = __clone(__pthread_manager,
+                (void **) ((unsigned long)__pthread_manager_thread_tos - EXTRA_STACK_PADDING),
                 CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND
 #ifdef CLONE_PTRACE
 		| CLONE_PTRACE
--- glibc-pre2.1-2.0.100.orig/linuxthreads/sysdeps/powerpc/pt-machine.h	Thu Oct  8 21:11:28 1998
+++ glibc-pre2.1-2.0.100/linuxthreads/sysdeps/powerpc/pt-machine.h	Thu Oct  8 21:14:57 1998
@@ -39,6 +39,10 @@
 #define CURRENT_STACK_FRAME  stack_pointer
 register char * stack_pointer __asm__ ("r1");
 
+/* We need to pad the stack some because of the setting of the return
+   address on the stack by PowerPC. */
+#define EXTRA_STACK_PADDING 8
+
 /* Compare-and-swap for semaphores. */
 /* note that test-and-set(x) is the same as compare-and-swap(x, 0, 1) */
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]