Added patches for sqrtl and semctl on PPC. The former closes bug #9796
authorJon Nall <nall@gentoo.org>
Wed, 30 Oct 2002 02:44:58 +0000 (02:44 +0000)
committerJon Nall <nall@gentoo.org>
Wed, 30 Oct 2002 02:44:58 +0000 (02:44 +0000)
sys-libs/glibc/ChangeLog
sys-libs/glibc/files/2.2.5/glibc-2.2.5-ppc-semctl.diff [new file with mode: 0644]
sys-libs/glibc/files/2.2.5/glibc-2.2.5-ppc-sqrtl.diff [new file with mode: 0644]
sys-libs/glibc/glibc-2.2.5-r7.ebuild

index 31fcf3e13379b2c5b1036a2539e1b7bd7b4c15b1..f7967c28de984915ba726eb041cdd2fa1090956e 100644 (file)
@@ -1,6 +1,6 @@
 # ChangeLog for sys-libs/glibc
 # Copyright 2002 Gentoo Technologies, Inc.; Distributed under the GPL
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/ChangeLog,v 1.22 2002/10/29 09:17:34 seemant Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/ChangeLog,v 1.23 2002/10/30 02:44:58 nall Exp $
 
 *glibc-2.3.1-r1 (26 Oct 2002)
 
 
 *glibc-2.2.5-r7 (13 Oct 2002)
 
+  29 Oct 2002; Jon Nall <nall@gentoo.org> glibc-2.2.5-r7.ebuild :
+
+  Added sqrtl patch for ppc. This closes bug #9796. Also added semctl
+  patch for ppc.
+
   29 Oct 2002; Seemant Kulleen <seemant@gentoo.org> glibc-2.2.5-r7.ebuild :
 
   Added semctl patch for sparc.  Thanks to nall <nall@gentoo.org> for
diff --git a/sys-libs/glibc/files/2.2.5/glibc-2.2.5-ppc-semctl.diff b/sys-libs/glibc/files/2.2.5/glibc-2.2.5-ppc-semctl.diff
new file mode 100644 (file)
index 0000000..3e42db9
--- /dev/null
@@ -0,0 +1,56 @@
+--- sysdeps/unix/sysv/linux/semctl.c   6 Jul 2001 04:56:13 -0000       1.12
++++ sysdeps/unix/sysv/linux/semctl.c   28 Apr 2002 21:03:16 -0000
+@@ -69,8 +69,23 @@ __old_semctl (int semid, int semnum, int
+ 
+   va_start (ap, cmd);
+ 
+-  /* Get the argument.  */
+-  arg = va_arg (ap, union semun);
++  /* Get the argument only if required.  */
++  arg.buf = NULL;
++  switch (cmd)
++    {
++    case SETVAL:        /* arg.val */
++    case GETALL:        /* arg.array */
++    case SETALL:
++    case IPC_STAT:      /* arg.buf */
++    case IPC_SET:
++    case SEM_STAT:
++    case IPC_INFO:      /* arg.__buf */
++    case SEM_INFO:
++      va_start (ap, cmd);
++      arg = va_arg (ap, union semun);
++      va_end (ap);
++      break;
++    }
+ 
+   va_end (ap);
+ 
+@@ -88,8 +103,23 @@ __new_semctl (int semid, int semnum, int
+ 
+   va_start (ap, cmd);
+ 
+-  /* Get the argument.  */
+-  arg = va_arg (ap, union semun);
++  /* Get the argument only if required.  */
++  arg.buf = NULL;
++  switch (cmd)
++    {
++    case SETVAL:        /* arg.val */
++    case GETALL:        /* arg.array */
++    case SETALL:
++    case IPC_STAT:      /* arg.buf */
++    case IPC_SET:
++    case SEM_STAT:
++    case IPC_INFO:      /* arg.__buf */
++    case SEM_INFO:
++      va_start (ap, cmd);
++      arg = va_arg (ap, union semun);
++      va_end (ap);
++      break;
++    }
+ 
+   va_end (ap);
+ 
+
+
diff --git a/sys-libs/glibc/files/2.2.5/glibc-2.2.5-ppc-sqrtl.diff b/sys-libs/glibc/files/2.2.5/glibc-2.2.5-ppc-sqrtl.diff
new file mode 100644 (file)
index 0000000..ed8c3b4
--- /dev/null
@@ -0,0 +1,19 @@
+--- sysdeps/powerpc/fpu/w_sqrt.c       6 Jul 2001 04:56:02 -0000       1.2
++++ sysdeps/powerpc/fpu/w_sqrt.c       10 May 2002 08:40:46 -0000
+@@ -1,5 +1,5 @@
+ /* Single-precision floating point square root.
+-   Copyright (C) 1997 Free Software Foundation, Inc.
++   Copyright (C) 1997, 2002 Free Software Foundation, Inc.
+    This file is part of the GNU C Library.
+ 
+    The GNU C Library is free software; you can redistribute it and/or
+@@ -139,3 +139,8 @@ weak_alias (__sqrt, sqrt)
+ /* Strictly, this is wrong, but the only places where _ieee754_sqrt is
+    used will not pass in a negative result.  */
+ strong_alias(__sqrt,__ieee754_sqrt)
++
++#ifdef NO_LONG_DOUBLE
++weak_alias (__sqrt, __sqrtl)
++weak_alias (__sqrt, sqrtl)
++#endif
+
index c8b3d4987d58554fa68ebcaa1eb2a1503f180bc6..39fcc529a8c6cc556be54a516d1be153c419fd61 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2002 Gentoo Technologies, Inc.
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/glibc-2.2.5-r7.ebuild,v 1.19 2002/10/29 09:17:34 seemant Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/glibc-2.2.5-r7.ebuild,v 1.20 2002/10/30 02:44:58 nall Exp $
 
 IUSE="nls pic build"
 
@@ -99,6 +99,19 @@ src_unpack() {
                einfo "Applying divdi3 patch..."
                cd ${S}; patch -p1 < ${FILESDIR}/${PV}/${P}-divdi3.diff > /dev/null || die
        fi
+
+       if [ "${ARCH}" = "ppc" ]; then
+               # This patch fixes the absence of sqrtl on PPC
+               # http://sources.redhat.com/ml/libc-hacker/2002-05/msg00012.html
+               einfo "Applying ppc-sqrtl patch..."
+               cd ${S}; patch -p0 < ${FILESDIR}/${PV}/${P}-ppc-sqrtl.diff > /dev/null || die
+       
+               # This patch fixes a SIGSEGV in semctl's va_arg processing
+               # http://sources.redhat.com/ml/libc-alpha/2002-05/msg00065.html
+               einfo "Applying ppc-semctl patch..."
+               cd ${S}; patch -p0 < ${FILESDIR}/${PV}/${P}-ppc-semctl.diff > /dev/null || die
+       fi
+
        
        # Some gcc-3.1.1 fixes.  This works fine for other versions of gcc as well,
        # and should generally be ok, as it just fixes define order that causes scope