[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

re: glibc patch needed on ppc for gcc >= 3.1 builds



Ben,
   Here is the patch again with the sysdeps/powerpc/libgcc-compat.c
from glibc-2-2-branch (which doesn't use the INTUSE macro) in it.
This is essentially what we need for ppc and a template for what
the other arches will need for building glibc with gcc >= 3.1.
                                           Jack
----------------------------------------------------------------------
#! /bin/sh -e

# All lines beginning with `# DP:' are a description of the patch.
# DP: Fix "/usr/include/bits/string2.h:419: 
# DP: warning: pointer of type `void *' used in arithmetic"
if [ $# -ne 2 ]; then
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    exit 1
fi
case "$1" in
    -patch) patch -d "$2" -f --no-backup-if-mismatch -p0 < $0;;
    -unpatch) patch -d "$2" -f --no-backup-if-mismatch -R -p0 < $0;;
    *)
	echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
	exit 1
esac
exit 0

Index: sysdeps/powerpc/Makefile
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/powerpc/Makefile,v
retrieving revision 1.15
diff -u -p -r1.15 Makefile
--- sysdeps/powerpc/Makefile	6 Dec 2001 23:41:32 -0000	1.15
+++ sysdeps/powerpc/Makefile	15 May 2002 14:23:39 -0000
@@ -35,6 +35,11 @@ CFLAGS-initfini.s = -g0 -fpic -O1
 CFLAGS-init.o = -G0
 CFLAGS-gmon-start.o = -G0
 endif
+ifeq (yes,$(build-shared))
+# Compatibility
+sysdep_routines += divdi3 libgcc-compat
+shared-only-routines += divdi3 libgcc-compat
+endif
 endif
 
 ifeq ($(subdir),string)
Index: sysdeps/powerpc/Versions
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/powerpc/Versions,v
retrieving revision 1.2
diff -u -p -r1.2 Versions
--- sysdeps/powerpc/Versions	Wed Jun 19 21:29:49 2002
+++ sysdeps/powerpc/Versions.new	Wed Jun 19 21:32:53 2002
@@ -3,6 +3,17 @@
     _dl_cpuclock_offset;
   }
 }
+libc {
+  GLIBC_2.0 {
+    # Functions from libgcc.
+    __divdi3; __moddi3; __udivdi3; __umoddi3;
+    __cmpdi2; __ucmpdi2;
+    __ashldi3; __ashrdi3; __lshrdi3;
+    __fixdfdi; __fixunsdfdi;
+    __fixsfdi; __fixunssfdi;
+    __floatdidf; __floatdisf;
+  }
+}
 libm {
   GLIBC_2.1 {
     # symbols used in macros from sysdeps/powerpc/bits/fenv.h

--- /dev/null	1969-12-31 19:00:00.000000000 -0500
+++ sysdeps/powerpc/libgcc-compat.c.new	2002-07-27 13:49:16.000000000 -0400
@@ -0,0 +1,113 @@
+/* pre-.hidden libgcc compatibility
+   Copyright (C) 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
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+
+#include <stdint.h>
+#include <shlib-compat.h>
+
+#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_2_6)
+
+extern int64_t __ashldi3 (int64_t, int32_t);
+int64_t __ashldi3_internal (int64_t u, int32_t b)
+{
+  return __ashldi3 (u, b);
+}
+symbol_version (__ashldi3_internal, __ashldi3, GLIBC_2.0);
+
+
+extern int64_t __ashrdi3 (int64_t, int32_t);
+int64_t __ashrdi3_internal (int64_t u, int32_t b)
+{
+  return __ashrdi3 (u, b);
+}
+symbol_version (__ashrdi3_internal, __ashrdi3, GLIBC_2.0);
+
+
+extern int64_t __lshrdi3 (int64_t, int32_t);
+int64_t __lshrdi3_internal (int64_t u, int32_t b)
+{
+  return __lshrdi3 (u, b);
+}
+symbol_version (__lshrdi3_internal, __lshrdi3, GLIBC_2.0);
+
+
+extern int32_t __cmpdi2 (int64_t, int64_t);
+int32_t __cmpdi2_internal (int64_t u, int64_t v)
+{
+  return __cmpdi2 (u, v);
+}
+symbol_version (__cmpdi2_internal, __cmpdi2, GLIBC_2.0);
+
+
+extern int32_t __ucmpdi2 (int64_t, int64_t);
+int32_t __ucmpdi2_internal (int64_t u, int64_t v)
+{
+  return __ucmpdi2 (u, v);
+}
+symbol_version (__ucmpdi2_internal, __ucmpdi2, GLIBC_2.0);
+
+
+extern int64_t __fixdfdi (double);
+int64_t __fixdfdi_internal (double d)
+{
+  return __fixdfdi (d);
+}
+symbol_version (__fixdfdi_internal, __fixdfdi, GLIBC_2.0);
+
+
+extern int64_t __fixunsdfdi (double);
+int64_t __fixunsdfdi_internal (double d)
+{
+  return __fixunsdfdi (d);
+}
+symbol_version (__fixunsdfdi_internal, __fixunsdfdi, GLIBC_2.0);
+
+
+extern int64_t __fixsfdi (float);
+int64_t __fixsfdi_internal (float d)
+{
+  return __fixsfdi (d);
+}
+symbol_version (__fixsfdi_internal, __fixsfdi, GLIBC_2.0);
+
+
+extern int64_t __fixunssfdi (float);
+int64_t __fixunssfdi_internal (float d)
+{
+  return __fixunssfdi (d);
+}
+symbol_version (__fixunssfdi_internal, __fixunssfdi, GLIBC_2.0);
+
+
+extern double __floatdidf (int64_t);
+double __floatdidf_internal (int64_t u)
+{
+  return __floatdidf (u);
+}
+symbol_version (__floatdidf_internal, __floatdidf, GLIBC_2.0);
+
+
+extern float __floatdisf (int64_t);
+float __floatdisf_internal (int64_t u)
+{
+  return __floatdisf (u);
+}
+symbol_version (__floatdisf_internal, __floatdisf, GLIBC_2.0);
+
+#endif
--------------------------------------------------------------------------


-- 
To UNSUBSCRIBE, email to debian-glibc-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: