From 3bf3f54ed10aec366066d796186eea63c4169ad2 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Mon, 28 Jul 2008 21:08:01 +0000 Subject: Third go at renaming patches to contain neither the package name nor the package version. diff --git a/patches/cygwin/1.5.15-1/100-crossbuild.patch b/patches/cygwin/1.5.15-1/100-crossbuild.patch new file mode 100644 index 0000000..d312403 --- /dev/null +++ b/patches/cygwin/1.5.15-1/100-crossbuild.patch @@ -0,0 +1,40 @@ +Message-ID: <4269173F.7020705@zee2.com> +Date: Fri, 22 Apr 2005 16:24:47 +0100 +From: Steve Papacharalambous +To: "Robert P. J. Day" +CC: crossgcc list +Subject: Re: cygwin source directory has moved +In-Reply-To: + +Hi Robert, + +I've attached two patches: + +1/ For crosstool-0.31 which changes the CYGWIN_URL to one which has the +cygwin source archives. The version of cygwin that is used to build the +cross toolchain has been changed to cygwin-1.5.15-1-src.tar.bz2 since +most of the mirror sites don't seem to have the original archive used. +[created gcc-3.3.2-cygwin-1.5.15-1.dat - dank] + + +2/ The later cygwin source archive fails to cross build with the error: +/opt/crosstool/i686-pc-cygwin/gcc-3.3.2-cygwin-1.5.15-1/lib/gcc-lib/i686-pc-cygwin/bin/ld: +cannot find -luser32 + +unless the second patch is applied, + + +diff -uNr cygwin-1.5.15-1.orig/winsup/mingw/Makefile.in cygwin-1.5.15-1/winsup/mingw/Makefile.in +--- cygwin-1.5.15-1.orig/winsup/mingw/Makefile.in 2005-02-28 22:51:02.000000000 +0000 ++++ cygwin-1.5.15-1/winsup/mingw/Makefile.in 2005-04-22 15:29:18.000000000 +0100 +@@ -71,7 +71,7 @@ + mkinstalldirs = $(SHELL) @MKINSTALLDIRS@ + + CC := @CC@ +-override CC := ${filter-out -L% -B%,${shell echo $(CC) | sed -e 's%\(-isystem\|-iwithprefixbefore\) *[^ ]*\( \|$$\)% %g'}} ++override CC := ${filter-out -B%,${shell echo $(CC) | sed -e 's%\(-isystem\|-iwithprefixbefore\) *[^ ]*\( \|$$\)% %g'}} + # FIXME: Which is it, CC or CC_FOR_TARGET? + CC_FOR_TARGET = $(CC) + AS_FOR_TARGET = $(AS) + + diff --git a/patches/cygwin/1.5.15-1/100-cygwin-1.5.15-1-crossbuild.patch b/patches/cygwin/1.5.15-1/100-cygwin-1.5.15-1-crossbuild.patch deleted file mode 100644 index d312403..0000000 --- a/patches/cygwin/1.5.15-1/100-cygwin-1.5.15-1-crossbuild.patch +++ /dev/null @@ -1,40 +0,0 @@ -Message-ID: <4269173F.7020705@zee2.com> -Date: Fri, 22 Apr 2005 16:24:47 +0100 -From: Steve Papacharalambous -To: "Robert P. J. Day" -CC: crossgcc list -Subject: Re: cygwin source directory has moved -In-Reply-To: - -Hi Robert, - -I've attached two patches: - -1/ For crosstool-0.31 which changes the CYGWIN_URL to one which has the -cygwin source archives. The version of cygwin that is used to build the -cross toolchain has been changed to cygwin-1.5.15-1-src.tar.bz2 since -most of the mirror sites don't seem to have the original archive used. -[created gcc-3.3.2-cygwin-1.5.15-1.dat - dank] - - -2/ The later cygwin source archive fails to cross build with the error: -/opt/crosstool/i686-pc-cygwin/gcc-3.3.2-cygwin-1.5.15-1/lib/gcc-lib/i686-pc-cygwin/bin/ld: -cannot find -luser32 - -unless the second patch is applied, - - -diff -uNr cygwin-1.5.15-1.orig/winsup/mingw/Makefile.in cygwin-1.5.15-1/winsup/mingw/Makefile.in ---- cygwin-1.5.15-1.orig/winsup/mingw/Makefile.in 2005-02-28 22:51:02.000000000 +0000 -+++ cygwin-1.5.15-1/winsup/mingw/Makefile.in 2005-04-22 15:29:18.000000000 +0100 -@@ -71,7 +71,7 @@ - mkinstalldirs = $(SHELL) @MKINSTALLDIRS@ - - CC := @CC@ --override CC := ${filter-out -L% -B%,${shell echo $(CC) | sed -e 's%\(-isystem\|-iwithprefixbefore\) *[^ ]*\( \|$$\)% %g'}} -+override CC := ${filter-out -B%,${shell echo $(CC) | sed -e 's%\(-isystem\|-iwithprefixbefore\) *[^ ]*\( \|$$\)% %g'}} - # FIXME: Which is it, CC or CC_FOR_TARGET? - CC_FOR_TARGET = $(CC) - AS_FOR_TARGET = $(AS) - - diff --git a/patches/gcc/2.95.3/150-cygwin-020611.patch b/patches/gcc/2.95.3/150-cygwin-020611.patch new file mode 100644 index 0000000..fb2b8da --- /dev/null +++ b/patches/gcc/2.95.3/150-cygwin-020611.patch @@ -0,0 +1,33 @@ +[ Building gcc-2.95.3 on cygwin yields a compiler that sticks a .exe + on the end of every executable, even if they're linux executable. + This is highly annoying, and causes glibc build failures that look like this: + mv: `.../bin/makedb.new' and `.../bin/makedb' are the same file + make[2]: *** [.../bin/makedb] Error 1 + make[2]: Leaving directory `.../gcc-2.95.3-glibc-2.1.3/glibc-2.1.3/db2' + + The mainline solves this with http://gcc.gnu.org/ml/gcc-cvs/2001-04/msg00440.html, + but that doesn't apply cleanly to gcc-2.95.3. + + So, I'm using + http://www.uclinux.org/pub/uClinux/uclinux-elf-tools/tools-20030314/gcc-2.95.3-cygwin-020611.patch + This is the only patch in crosstool that *isn't* suitable for the mainline. + I can live with this patch simply because crosstool does not build + compilers that target cygwin or VAX/VMS. + If that ever changes, I might need to try applying the real patch. +] + + + +# +# This patch can be found at http://www.uclinux.org/pub/uClinux/m68k-elf-tools/ +# +--- gcc-2.95.3/gcc/config/i386/xm-cygwin.h 1999-04-22 16:40:56.000000000 +0200 ++++ gcc-2.95.3-cygwin/gcc/config/i386/xm-cygwin.h 2002-06-11 08:23:18.000000000 +0200 +@@ -19,7 +19,6 @@ + the Free Software Foundation, 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +-#define EXECUTABLE_SUFFIX ".exe" + #define NO_SYS_SIGLIST 1 + + /* We support both "/" and "\" since everybody tests both but we diff --git a/patches/gcc/2.95.3/150-gcc-2.95.3-cygwin-020611.patch b/patches/gcc/2.95.3/150-gcc-2.95.3-cygwin-020611.patch deleted file mode 100644 index fb2b8da..0000000 --- a/patches/gcc/2.95.3/150-gcc-2.95.3-cygwin-020611.patch +++ /dev/null @@ -1,33 +0,0 @@ -[ Building gcc-2.95.3 on cygwin yields a compiler that sticks a .exe - on the end of every executable, even if they're linux executable. - This is highly annoying, and causes glibc build failures that look like this: - mv: `.../bin/makedb.new' and `.../bin/makedb' are the same file - make[2]: *** [.../bin/makedb] Error 1 - make[2]: Leaving directory `.../gcc-2.95.3-glibc-2.1.3/glibc-2.1.3/db2' - - The mainline solves this with http://gcc.gnu.org/ml/gcc-cvs/2001-04/msg00440.html, - but that doesn't apply cleanly to gcc-2.95.3. - - So, I'm using - http://www.uclinux.org/pub/uClinux/uclinux-elf-tools/tools-20030314/gcc-2.95.3-cygwin-020611.patch - This is the only patch in crosstool that *isn't* suitable for the mainline. - I can live with this patch simply because crosstool does not build - compilers that target cygwin or VAX/VMS. - If that ever changes, I might need to try applying the real patch. -] - - - -# -# This patch can be found at http://www.uclinux.org/pub/uClinux/m68k-elf-tools/ -# ---- gcc-2.95.3/gcc/config/i386/xm-cygwin.h 1999-04-22 16:40:56.000000000 +0200 -+++ gcc-2.95.3-cygwin/gcc/config/i386/xm-cygwin.h 2002-06-11 08:23:18.000000000 +0200 -@@ -19,7 +19,6 @@ - the Free Software Foundation, 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - --#define EXECUTABLE_SUFFIX ".exe" - #define NO_SYS_SIGLIST 1 - - /* We support both "/" and "\" since everybody tests both but we diff --git a/patches/gcc/2.95.3/160-gcc-2.95.3-trap-posix.patch b/patches/gcc/2.95.3/160-gcc-2.95.3-trap-posix.patch deleted file mode 100644 index 1d18055..0000000 --- a/patches/gcc/2.95.3/160-gcc-2.95.3-trap-posix.patch +++ /dev/null @@ -1,44 +0,0 @@ -# -# Submitted-By: Marc Kleine-Budde , 2005-04-20 -# -# Error: -# -# creating libintl.h -# Configuring etc... -# loading cache ../config.cache -# checking for a BSD compatible install... (cached) /usr/bin/install -c -# creating ./config.status -# creating Makefile -# trap: usage: trap [-lp] [[arg] signal_spec ...] -# -# Description: -# -# non-posix conform usage of trap causes bash >= 3.0 to fail -# e.g.: http://sourceware.org/ml/crossgcc/2004-12/msg00132.html -# -# Status: -# -# fixed in gcc >= 3.3.5 -# backport of gcc-3.3.5 fix -# -diff -ruN gcc-2.95.3-orig/configure gcc-2.95.3/configure ---- gcc-2.95.3-orig/configure 1999-04-02 16:17:40.000000000 +0200 -+++ gcc-2.95.3/configure 2005-04-20 18:25:45.030488235 +0200 -@@ -687,7 +687,7 @@ - if test -f skip-this-dir; then - # Perform the same cleanup as the trap handler, minus the "exit 1" of course, - # and reset the trap handler. -- trap 0 -+ trap '' 0 - rm -f Makefile* ${tmpfile}.com ${tmpfile}.tgt ${tmpfile}.hst ${tmpfile}.pos - # Execute the final clean-up actions - ${config_shell} skip-this-dir -@@ -1599,7 +1599,7 @@ - # Perform the same cleanup as the trap handler, minus the "exit 1" of course, - # and reset the trap handler. - rm -f ${tmpfile}.com ${tmpfile}.tgt ${tmpfile}.hst ${tmpfile}.pos --trap 0 -+trap '' 0 - - exit 0 - diff --git a/patches/gcc/2.95.3/160-trap-posix.patch b/patches/gcc/2.95.3/160-trap-posix.patch new file mode 100644 index 0000000..1d18055 --- /dev/null +++ b/patches/gcc/2.95.3/160-trap-posix.patch @@ -0,0 +1,44 @@ +# +# Submitted-By: Marc Kleine-Budde , 2005-04-20 +# +# Error: +# +# creating libintl.h +# Configuring etc... +# loading cache ../config.cache +# checking for a BSD compatible install... (cached) /usr/bin/install -c +# creating ./config.status +# creating Makefile +# trap: usage: trap [-lp] [[arg] signal_spec ...] +# +# Description: +# +# non-posix conform usage of trap causes bash >= 3.0 to fail +# e.g.: http://sourceware.org/ml/crossgcc/2004-12/msg00132.html +# +# Status: +# +# fixed in gcc >= 3.3.5 +# backport of gcc-3.3.5 fix +# +diff -ruN gcc-2.95.3-orig/configure gcc-2.95.3/configure +--- gcc-2.95.3-orig/configure 1999-04-02 16:17:40.000000000 +0200 ++++ gcc-2.95.3/configure 2005-04-20 18:25:45.030488235 +0200 +@@ -687,7 +687,7 @@ + if test -f skip-this-dir; then + # Perform the same cleanup as the trap handler, minus the "exit 1" of course, + # and reset the trap handler. +- trap 0 ++ trap '' 0 + rm -f Makefile* ${tmpfile}.com ${tmpfile}.tgt ${tmpfile}.hst ${tmpfile}.pos + # Execute the final clean-up actions + ${config_shell} skip-this-dir +@@ -1599,7 +1599,7 @@ + # Perform the same cleanup as the trap handler, minus the "exit 1" of course, + # and reset the trap handler. + rm -f ${tmpfile}.com ${tmpfile}.tgt ${tmpfile}.hst ${tmpfile}.pos +-trap 0 ++trap '' 0 + + exit 0 + diff --git a/patches/gcc/2.95.3/170-gcc-pr3106.patch b/patches/gcc/2.95.3/170-gcc-pr3106.patch deleted file mode 100644 index 0e077ea..0000000 --- a/patches/gcc/2.95.3/170-gcc-pr3106.patch +++ /dev/null @@ -1,28 +0,0 @@ -See http://gcc.gnu.org/PR3106 -Backported from gcc-3.0.x - -Fixes error - .../binutils-2.11.2/libiberty/strerror.c:468: error: conflicting types for `sys_nerr' - /usr/include/stdio.h:258: error: previous declaration of `sys_nerr' - make[1]: *** [strerror.o] Error 1 - make: *** [all-libiberty] Error 2 -on Mac OS X. - ---- gcc-2.95.3/libiberty/strerror.c.old 2004-03-24 16:23:19.000000000 -0800 -+++ gcc-2.95.3/libiberty/strerror.c 2004-03-24 16:23:48.000000000 -0800 -@@ -13,6 +13,7 @@ - incompatible with our later declaration, perhaps by using const - attributes. So we hide the declaration in errno.h (if any) using a - macro. */ -+#define sys_nerr sys_nerr__ - #define sys_errlist sys_errlist__ - #endif - -@@ -20,6 +21,7 @@ - #include - - #ifdef HAVE_SYS_ERRLIST -+#undef sys_nerr - #undef sys_errlist - #endif - diff --git a/patches/gcc/2.95.3/170-pr3106.patch b/patches/gcc/2.95.3/170-pr3106.patch new file mode 100644 index 0000000..0e077ea --- /dev/null +++ b/patches/gcc/2.95.3/170-pr3106.patch @@ -0,0 +1,28 @@ +See http://gcc.gnu.org/PR3106 +Backported from gcc-3.0.x + +Fixes error + .../binutils-2.11.2/libiberty/strerror.c:468: error: conflicting types for `sys_nerr' + /usr/include/stdio.h:258: error: previous declaration of `sys_nerr' + make[1]: *** [strerror.o] Error 1 + make: *** [all-libiberty] Error 2 +on Mac OS X. + +--- gcc-2.95.3/libiberty/strerror.c.old 2004-03-24 16:23:19.000000000 -0800 ++++ gcc-2.95.3/libiberty/strerror.c 2004-03-24 16:23:48.000000000 -0800 +@@ -13,6 +13,7 @@ + incompatible with our later declaration, perhaps by using const + attributes. So we hide the declaration in errno.h (if any) using a + macro. */ ++#define sys_nerr sys_nerr__ + #define sys_errlist sys_errlist__ + #endif + +@@ -20,6 +21,7 @@ + #include + + #ifdef HAVE_SYS_ERRLIST ++#undef sys_nerr + #undef sys_errlist + #endif + diff --git a/patches/gcc/3.2.3/110-gcc-20020722-ppc405erratum77.patch b/patches/gcc/3.2.3/110-gcc-20020722-ppc405erratum77.patch deleted file mode 100644 index bd717f5..0000000 --- a/patches/gcc/3.2.3/110-gcc-20020722-ppc405erratum77.patch +++ /dev/null @@ -1,105 +0,0 @@ -# See http://gcc.gnu.org/PR7383, http://www.kegel.com/xgcc3/ppc405erratum77.html -# Fixed in gcc-3.3 - -diff -aur gcc-20020722.orig/gcc/config/rs6000/rs6000.h gcc-20020722/gcc/config/rs6000/rs6000.h ---- gcc-20020722.orig/gcc/config/rs6000/rs6000.h Thu Jul 25 09:32:21 2002 -+++ gcc-20020722/gcc/config/rs6000/rs6000.h Thu Jul 25 09:34:45 2002 -@@ -66,7 +66,7 @@ - %{mcpu=rsc1: -D_ARCH_PWR} \ - %{mcpu=401: -D_ARCH_PPC} \ - %{mcpu=403: -D_ARCH_PPC} \ --%{mcpu=405: -D_ARCH_PPC} \ -+%{mcpu=405: -D_ARCH_PPC -D__PPC405__} \ - %{mcpu=505: -D_ARCH_PPC} \ - %{mcpu=601: -D_ARCH_PPC -D_ARCH_PWR} \ - %{mcpu=602: -D_ARCH_PPC} \ -diff -aur gcc-20020722.orig/libjava/sysdep/powerpc/locks.h gcc-20020722/libjava/sysdep/powerpc/locks.h ---- gcc-20020722.orig/libjava/sysdep/powerpc/locks.h Thu Jul 25 09:32:30 2002 -+++ gcc-20020722/libjava/sysdep/powerpc/locks.h Thu Jul 25 11:39:13 2002 -@@ -11,6 +11,17 @@ - #ifndef __SYSDEP_LOCKS_H__ - #define __SYSDEP_LOCKS_H__ - -+#ifdef __PPC405__ -+// workaround for PPC405 erratum #77 - 07/18/02 JRO, dank, NN. References: -+// http://www-3.ibm.com/chips/techlib/techlib.nsf/techdocs/89DED00DEBFF54BF87256A8000491BA2/$file/405CR_C_errata_1_2.pdf -+// http://ppc.bkbits.net:8080/linuxppc_2_4_devel/cset@1.489 -+// http://www.kegel.com/xgcc3/ppc405erratum77.html -+// FIXME: using dbct instead of sync would be faster -+#define __LIBGCJ_PPC405_ERR77_SYNC "sync \n\t" -+#else -+#define __LIBGCJ_PPC405_ERR77_SYNC -+#endif -+ - typedef size_t obj_addr_t; /* Integer type big enough for object */ - /* address. */ - -@@ -25,6 +36,7 @@ - "0: lwarx %0,0,%1 ;" - " xor. %0,%3,%0;" - " bne 1f;" -+ __LIBGCJ_PPC405_ERR77_SYNC - " stwcx. %2,0,%1;" - " bne- 0b;" - "1: " -@@ -58,6 +70,7 @@ - "0: lwarx %0,0,%1 ;" - " xor. %0,%3,%0;" - " bne 1f;" -+ __LIBGCJ_PPC405_ERR77_SYNC - " stwcx. %2,0,%1;" - " bne- 0b;" - "1: " -diff -aur gcc-20020722.orig/libstdc++-v3/config/cpu/powerpc/bits/atomicity.h gcc-20020722/libstdc++-v3/config/cpu/powerpc/bits/atomicity.h ---- gcc-20020722.orig/libstdc++-v3/config/cpu/powerpc/bits/atomicity.h Thu Jul 25 09:32:31 2002 -+++ gcc-20020722/libstdc++-v3/config/cpu/powerpc/bits/atomicity.h Thu Jul 25 09:34:45 2002 -@@ -32,6 +32,17 @@ - - typedef int _Atomic_word; - -+#ifdef __PPC405__ -+// workaround for PPC405 erratum #77 - 07/18/02 JRO & dank. References: -+// http://www-3.ibm.com/chips/techlib/techlib.nsf/techdocs/89DED00DEBFF54BF87256A8000491BA2/$file/405CR_C_errata_1_2.pdf -+// http://ppc.bkbits.net:8080/linuxppc_2_4_devel/cset@1.489 -+// http://www.kegel.com/xgcc3/ppc405erratum77.html -+// FIXME: using dbct instead of sync would be faster -+#define __LIBSTDCPP_PPC405_ERR77_SYNC "sync \n\t" -+#else -+#define __LIBSTDCPP_PPC405_ERR77_SYNC -+#endif -+ - static inline _Atomic_word - __attribute__ ((__unused__)) - __exchange_and_add (volatile _Atomic_word* __mem, int __val) -@@ -42,6 +53,7 @@ - "0:\t" - "lwarx %0,0,%2 \n\t" - "add%I3 %1,%0,%3 \n\t" -+ __LIBSTDCPP_PPC405_ERR77_SYNC - "stwcx. %1,0,%2 \n\t" - "bne- 0b \n\t" - "/* End exchange & add */" -@@ -61,6 +73,7 @@ - "0:\t" - "lwarx %0,0,%1 \n\t" - "add%I2 %0,%0,%2 \n\t" -+ __LIBSTDCPP_PPC405_ERR77_SYNC - "stwcx. %0,0,%1 \n\t" - "bne- 0b \n\t" - "/* End atomic add */" -@@ -78,6 +91,7 @@ - "/* Inline always swap */\n" - "0:\t" - "lwarx %0,0,%1 \n\t" -+ __LIBSTDCPP_PPC405_ERR77_SYNC - "stwcx. %2,0,%1 \n\t" - "bne- 0b \n\t" - "/* End always swap */" -@@ -98,6 +112,7 @@ - "lwarx %0,0,%1 \n\t" - "cmpwi %0,0 \n\t" - "bne- 1f \n\t" -+ __LIBSTDCPP_PPC405_ERR77_SYNC - "stwcx. %2,0,%1 \n\t" - "bne- 0b \n" - "1:\n\t" diff --git a/patches/gcc/3.2.3/110-ppc405erratum77.patch b/patches/gcc/3.2.3/110-ppc405erratum77.patch new file mode 100644 index 0000000..bd717f5 --- /dev/null +++ b/patches/gcc/3.2.3/110-ppc405erratum77.patch @@ -0,0 +1,105 @@ +# See http://gcc.gnu.org/PR7383, http://www.kegel.com/xgcc3/ppc405erratum77.html +# Fixed in gcc-3.3 + +diff -aur gcc-20020722.orig/gcc/config/rs6000/rs6000.h gcc-20020722/gcc/config/rs6000/rs6000.h +--- gcc-20020722.orig/gcc/config/rs6000/rs6000.h Thu Jul 25 09:32:21 2002 ++++ gcc-20020722/gcc/config/rs6000/rs6000.h Thu Jul 25 09:34:45 2002 +@@ -66,7 +66,7 @@ + %{mcpu=rsc1: -D_ARCH_PWR} \ + %{mcpu=401: -D_ARCH_PPC} \ + %{mcpu=403: -D_ARCH_PPC} \ +-%{mcpu=405: -D_ARCH_PPC} \ ++%{mcpu=405: -D_ARCH_PPC -D__PPC405__} \ + %{mcpu=505: -D_ARCH_PPC} \ + %{mcpu=601: -D_ARCH_PPC -D_ARCH_PWR} \ + %{mcpu=602: -D_ARCH_PPC} \ +diff -aur gcc-20020722.orig/libjava/sysdep/powerpc/locks.h gcc-20020722/libjava/sysdep/powerpc/locks.h +--- gcc-20020722.orig/libjava/sysdep/powerpc/locks.h Thu Jul 25 09:32:30 2002 ++++ gcc-20020722/libjava/sysdep/powerpc/locks.h Thu Jul 25 11:39:13 2002 +@@ -11,6 +11,17 @@ + #ifndef __SYSDEP_LOCKS_H__ + #define __SYSDEP_LOCKS_H__ + ++#ifdef __PPC405__ ++// workaround for PPC405 erratum #77 - 07/18/02 JRO, dank, NN. References: ++// http://www-3.ibm.com/chips/techlib/techlib.nsf/techdocs/89DED00DEBFF54BF87256A8000491BA2/$file/405CR_C_errata_1_2.pdf ++// http://ppc.bkbits.net:8080/linuxppc_2_4_devel/cset@1.489 ++// http://www.kegel.com/xgcc3/ppc405erratum77.html ++// FIXME: using dbct instead of sync would be faster ++#define __LIBGCJ_PPC405_ERR77_SYNC "sync \n\t" ++#else ++#define __LIBGCJ_PPC405_ERR77_SYNC ++#endif ++ + typedef size_t obj_addr_t; /* Integer type big enough for object */ + /* address. */ + +@@ -25,6 +36,7 @@ + "0: lwarx %0,0,%1 ;" + " xor. %0,%3,%0;" + " bne 1f;" ++ __LIBGCJ_PPC405_ERR77_SYNC + " stwcx. %2,0,%1;" + " bne- 0b;" + "1: " +@@ -58,6 +70,7 @@ + "0: lwarx %0,0,%1 ;" + " xor. %0,%3,%0;" + " bne 1f;" ++ __LIBGCJ_PPC405_ERR77_SYNC + " stwcx. %2,0,%1;" + " bne- 0b;" + "1: " +diff -aur gcc-20020722.orig/libstdc++-v3/config/cpu/powerpc/bits/atomicity.h gcc-20020722/libstdc++-v3/config/cpu/powerpc/bits/atomicity.h +--- gcc-20020722.orig/libstdc++-v3/config/cpu/powerpc/bits/atomicity.h Thu Jul 25 09:32:31 2002 ++++ gcc-20020722/libstdc++-v3/config/cpu/powerpc/bits/atomicity.h Thu Jul 25 09:34:45 2002 +@@ -32,6 +32,17 @@ + + typedef int _Atomic_word; + ++#ifdef __PPC405__ ++// workaround for PPC405 erratum #77 - 07/18/02 JRO & dank. References: ++// http://www-3.ibm.com/chips/techlib/techlib.nsf/techdocs/89DED00DEBFF54BF87256A8000491BA2/$file/405CR_C_errata_1_2.pdf ++// http://ppc.bkbits.net:8080/linuxppc_2_4_devel/cset@1.489 ++// http://www.kegel.com/xgcc3/ppc405erratum77.html ++// FIXME: using dbct instead of sync would be faster ++#define __LIBSTDCPP_PPC405_ERR77_SYNC "sync \n\t" ++#else ++#define __LIBSTDCPP_PPC405_ERR77_SYNC ++#endif ++ + static inline _Atomic_word + __attribute__ ((__unused__)) + __exchange_and_add (volatile _Atomic_word* __mem, int __val) +@@ -42,6 +53,7 @@ + "0:\t" + "lwarx %0,0,%2 \n\t" + "add%I3 %1,%0,%3 \n\t" ++ __LIBSTDCPP_PPC405_ERR77_SYNC + "stwcx. %1,0,%2 \n\t" + "bne- 0b \n\t" + "/* End exchange & add */" +@@ -61,6 +73,7 @@ + "0:\t" + "lwarx %0,0,%1 \n\t" + "add%I2 %0,%0,%2 \n\t" ++ __LIBSTDCPP_PPC405_ERR77_SYNC + "stwcx. %0,0,%1 \n\t" + "bne- 0b \n\t" + "/* End atomic add */" +@@ -78,6 +91,7 @@ + "/* Inline always swap */\n" + "0:\t" + "lwarx %0,0,%1 \n\t" ++ __LIBSTDCPP_PPC405_ERR77_SYNC + "stwcx. %2,0,%1 \n\t" + "bne- 0b \n\t" + "/* End always swap */" +@@ -98,6 +112,7 @@ + "lwarx %0,0,%1 \n\t" + "cmpwi %0,0 \n\t" + "bne- 1f \n\t" ++ __LIBSTDCPP_PPC405_ERR77_SYNC + "stwcx. %2,0,%1 \n\t" + "bne- 0b \n" + "1:\n\t" diff --git a/patches/gcc/3.2.3/120-gcc-20030210-sh-linux-1.patch b/patches/gcc/3.2.3/120-gcc-20030210-sh-linux-1.patch deleted file mode 100644 index 4393078..0000000 --- a/patches/gcc/3.2.3/120-gcc-20030210-sh-linux-1.patch +++ /dev/null @@ -1,1761 +0,0 @@ -diff -ruN gcc-20030210.orig/boehm-gc/configure gcc-20030210/boehm-gc/configure ---- gcc-20030210.orig/boehm-gc/configure Fri Jan 31 19:17:00 2003 -+++ gcc-20030210/boehm-gc/configure Sat Feb 22 01:40:14 2003 -@@ -1922,7 +1922,7 @@ - # This must be Linux ELF. - linux-gnu*) - case $host_cpu in -- alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* ) -+ alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | sh* ) - lt_cv_deplibs_check_method=pass_all ;; - *) - # glibc up to 2.1.1 does not perform some relocations on ARM -diff -ruN gcc-20030210.orig/config-ml.in gcc-20030210/config-ml.in ---- gcc-20030210.orig/config-ml.in Fri Jan 31 19:16:59 2003 -+++ gcc-20030210/config-ml.in Sat Feb 22 01:40:14 2003 -@@ -545,6 +545,7 @@ - if [ -d ../$${dir}/$${lib} ]; then \ - flags=`echo $$i | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; \ - if (cd ../$${dir}/$${lib}; $(MAKE) $(FLAGS_TO_PASS) \ -+ DESTDIR="$(DESTDIR)" \ - CFLAGS="$(CFLAGS) $${flags}" \ - prefix="$(prefix)" \ - exec_prefix="$(exec_prefix)" \ -diff -ruN gcc-20030210.orig/debian/edit-specs.in gcc-20030210/debian/edit-specs.in ---- gcc-20030210.orig/debian/edit-specs.in Thu Jan 1 09:00:00 1970 -+++ gcc-20030210/debian/edit-specs.in Sat Feb 22 01:40:14 2003 -@@ -0,0 +1,45 @@ -+/^*asm:$/ { -+n -+c\ -+@AS_ENDIAN_FLAG@ %{mrelax:-relax} -+} -+/^*cpp:$/ { -+n -+c\ -+%(cpp_default_cpu_spec) %(subtarget_cpp_spec) %(subtarget_cpp_ptr_spec) %(subtarget_cpp_endian_spec) -+} -+/^*cc1:$/ { -+n -+c\ -+-musermode @CC1_CPU_ENDIAN_FLAGS@ %{profile:-p} -+} -+/^*link:$/ { -+n -+c\ -+%{!static:--eh-frame-hdr} @LINKER_CPU_ENDIAN_FLAGS@ @LINKER_RPATH_LINK_FLAG@ %{mrelax:-relax} %{shared:-shared} %{!static: %{rdynamic:-export-dynamic} %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} %{static:-static} -+} -+/^*multilib:$/ { -+n -+c\ -+. ; -+} -+/^*multilib_matches:$/ { -+n -+c\ -+ -+} -+/^*multilib_options:$/ { -+n -+c\ -+ -+} -+/^*subtarget_cpp_endian_spec:$/ { -+n -+c\ -+@CPP_ENDIAN_DEF@ -+} -+/^*cpp_default_cpu_spec:$/ { -+n -+c\ -+@CPP_CPU_DEFS@ -+} -diff -ruN gcc-20030210.orig/debian/install-CPU-linux gcc-20030210/debian/install-CPU-linux ---- gcc-20030210.orig/debian/install-CPU-linux Thu Jan 1 09:00:00 1970 -+++ gcc-20030210/debian/install-CPU-linux Sat Feb 22 01:40:14 2003 -@@ -0,0 +1,111 @@ -+#! /bin/sh -+ -+VERSION=$1; shift -+CPU=$1 -+ -+# literally (binary-ly) same -+PROGS_C="cpp gcc" -+PROGS_ADDITIONAL="c++ g++ g77 gcj" -+ -+DRIVERS_C="cc1 cpp0 tradcpp0" -+DRIVERS_ADDITIONAL="cc1obj cc1plus collect2 f771 jc1 jvgenmain" -+if [ -z "$STEP1_COMPILER_BUILD" ]; then -+ PROGS="$PROGS_C $PROGS_ADDITIONAL" -+ DRIVERS="$DRIVERS_C $DRIVERSADDITIONAL" -+ INITIAL="" -+else -+ PROGS=$PROGS_C -+ DRIVERS=$DRIVERS_C -+ INITIAL="-initial" -+fi -+ -+OBJS="crtbegin.o crtbeginS.o crtend.o crtendS.o" -+LIBS_C="libgcc.a" -+LIBS_1="libgcc_s.so libgcc_s.so.1 libstdc++.so libstdc++.so.3 libstdc++.so.3.0.2" -+LIBS_2="libobjc.a libstdc++.a libsupc++.a" -+INCLUDE="include" -+ -+cd debian/gcc-sh-linux-others${INITIAL} || exit 1 -+ -+# Make directories. -+mkdir -p usr/bin usr/share usr/share/man usr/share/man/man1 usr/lib \ -+ usr/lib/gcc-lib usr/lib/gcc-lib/${CPU}-linux \ -+ usr/lib/gcc-lib/${CPU}-linux/${VERSION} \ -+ usr/${CPU}-linux usr/${CPU}-linux/lib -+ -+# Make symbolic links for include dir. -+(cd usr/${CPU}-linux; ln -s ../sh-linux/include .) -+ -+# Make symbolic links for executables. -+(cd usr/bin; -+ for p in ${PROGS}; do -+ ln -s shCPU-linux-GCC ${CPU}-linux-$p -+ done) -+ -+case "${CPU}" in -+ sh3) -+ MULTILIBDIR= -+ AS_ENDIAN_FLAG="-little" -+ CPP_ENDIAN_DEF="-D__LITTLE_ENDIAN__" -+ CPP_CPU_DEFS="-D__SH3__ -D__sh3__" -+ CC1_CPU_ENDIAN_FLAGS="-ml -m3" -+ LINKER_CPU_ENDIAN_FLAGS="-m shlelf_linux -EL --architecture sh3" -+ LINKER_RPATH_LINK_FLAG="-rpath-link /usr/sh3-linux/lib" -+ ;; -+ sh3eb) -+ MULTILIBDIR=/mb -+ AS_ENDIAN_FLAG="-big" -+ CPP_ENDIAN_DEF="-D__BIG_ENDIAN__" -+ CPP_CPU_DEFS="-D__SH3__ -D__sh3__" -+ CC1_CPU_ENDIAN_FLAGS="-mb -m3" -+ LINKER_CPU_ENDIAN_FLAGS="-m shelf_linux -EB --architecture sh3" -+ LINKER_RPATH_LINK_FLAG="-rpath-link /usr/sh3eb-linux/lib" -+ ;; -+ sh4) -+ MULTILIBDIR=/m4 -+ AS_ENDIAN_FLAG="-little" -+ CPP_ENDIAN_DEF="-D__LITTLE_ENDIAN__" -+ CPP_CPU_DEFS="-D__SH4__" -+ CC1_CPU_ENDIAN_FLAGS="-ml -m4" -+ LINKER_CPU_ENDIAN_FLAGS="-m shlelf_linux -EL --architecture sh4" -+ LINKER_RPATH_LINK_FLAG="-rpath-link /usr/sh4-linux/lib" -+ ;; -+ sh4eb) -+ MULTILIBDIR=/mb/m4 -+ AS_ENDIAN_FLAG="-big" -+ CPP_ENDIAN_DEF="-D__BIG_ENDIAN__" -+ CPP_CPU_DEFS="-D__SH4__" -+ CC1_CPU_ENDIAN_FLAGS="-mb -m4" -+ LINKER_CPU_ENDIAN_FLAGS="-m shelf_linux -EB --architecture sh4" -+ LINKER_RPATH_LINK_FLAG="-rpath-link /usr/sh4eb-linux/lib" -+ ;; -+esac -+ -+# Make symbolic links for GCC drivers, objects, libraries, and include dir. -+(cd usr/lib/gcc-lib/${CPU}-linux/${VERSION}; -+ for f in ${DRIVERS} ${INCLUDE}; do -+ ln -s ../../sh-linux/${VERSION}/$f $f; -+ done -+ for f in ${OBJS} ${LIBS_C}; do -+ ln -s ../../sh-linux/${VERSION}${MULTILIBDIR}/$f $f; -+ done) -+ -+if [ -z "$STEP1_COMPILER_BUILD" ]; then -+ for f in ${LIBS_1} ${LIBS_2}; do -+ mv ../gcc-sh-linux/usr/sh-linux/lib${MULTILIBDIR}/$f usr/${CPU}-linux/lib/; -+ done -+fi -+ -+sed -e "s+@AS_ENDIAN_FLAG@+${AS_ENDIAN_FLAG}+" \ -+ -e "s+@CPP_ENDIAN_DEF@+${CPP_ENDIAN_DEF}+" \ -+ -e "s+@CPP_CPU_DEFS@+${CPP_CPU_DEFS}+" \ -+ -e "s+@CC1_CPU_ENDIAN_FLAGS@+${CC1_CPU_ENDIAN_FLAGS}+" \ -+ -e "s+@LINKER_CPU_ENDIAN_FLAGS@+${LINKER_CPU_ENDIAN_FLAGS}+" \ -+ -e "s+@LINKER_RPATH_LINK_FLAG@+${LINKER_RPATH_LINK_FLAG}+" \ -+ ../edit-specs.in >../edit-specs-${CPU}.sed -+ -+sed -f ../edit-specs-${CPU}.sed \ -+ ../gcc-sh-linux${INITIAL}/usr/lib/gcc-lib/sh-linux/${VERSION}/specs \ -+ > usr/lib/gcc-lib/${CPU}-linux/${VERSION}/specs -+ -+exit 0 -diff -ruN gcc-20030210.orig/debian/multilib-symlink gcc-20030210/debian/multilib-symlink ---- gcc-20030210.orig/debian/multilib-symlink Thu Jan 1 09:00:00 1970 -+++ gcc-20030210/debian/multilib-symlink Sat Feb 22 01:40:14 2003 -@@ -0,0 +1,10 @@ -+#! /bin/sh -+ -+cd /usr/sh-linux/lib -+ln -s ../../sh3-linux/lib/{*.a,*.so*,*.o} . -+cd m4 -+ln -s ../../../sh4-linux/lib/{*.a,*.so*,*.o} . -+cd ../mb -+ln -s ../../../sh3eb-linux/lib/{*.a,*.so*,*.o} . -+cd m4 -+ln -s ../../../../sh4eb-linux/lib/{*.a,*.so*,*.o} . -diff -ruN gcc-20030210.orig/debian/shCPU-linux-GCC gcc-20030210/debian/shCPU-linux-GCC ---- gcc-20030210.orig/debian/shCPU-linux-GCC Thu Jan 1 09:00:00 1970 -+++ gcc-20030210/debian/shCPU-linux-GCC Sat Feb 22 01:40:14 2003 -@@ -0,0 +1,59 @@ -+#! /bin/bash -+ -+BASENAME=${0##*/} -+PROG=${BASENAME##*-} -+CPU=${BASENAME%%-*} -+ -+if [ "$PROG" = gcc ]; then -+ if [ "$1" = "-b" -a "$2" = "i386-linux" ]; then -+ shift 2 -+ exec /usr/bin/gcc "$@" -+ elif [ "$1" = "-print-multi-lib" -o "$1" = "--print-multi-lib" ]; then -+ echo ".;" -+ exit 0 -+ elif [ "$1" = "-print-multi-os-directory" -o "$1" = "--print-multi-os-directory" ]; then -+ echo "." -+ exit 0 -+ elif [ "$1" = "-dumpspecs" ]; then -+ cat /usr/lib/gcc-lib/${CPU}-linux/@@VERSION@@/specs -+ exit 0 -+ fi -+fi -+ -+case "${CPU}" in -+ sh3) -+ ARCH=m3 -+ DEFINES="-D__sh3__ -D__SH3__ -D__LITTLE_ENDIAN__" -+ ENDIAN=ml -+ ;; -+ sh3eb) -+ ARCH=m3 -+ DEFINES="-D__sh3__ -D__SH3__ -D__BIG_ENDIAN__" -+ ENDIAN=mb -+ ;; -+ sh4) -+ ARCH=m4 -+ DEFINES="-D__SH4__ -D__LITTLE_ENDIAN__" -+ ENDIAN=ml -+ ;; -+ sh4eb) -+ ARCH=m4 -+ DEFINES="-D__SH4__ -D__BIG_ENDIAN__" -+ ENDIAN=mb -+ ;; -+esac -+ -+# Prepend the appropriate options -+# If user specifies some options, it will be overridden -+ -+case "${PROG}" in -+ cpp) -+ exec sh-linux-${PROG} $DEFINES "$@" -+ ;; -+ c++|g++|g77|gcc|gcj) -+ exec sh-linux-${PROG} -$ARCH -$ENDIAN "$@" -+ ;; -+esac -+ -+echo "Something wrong..." -+exit 1 -diff -ruN gcc-20030210.orig/gcc/config/sh/elf.h gcc-20030210/gcc/config/sh/elf.h ---- gcc-20030210.orig/gcc/config/sh/elf.h Fri Feb 22 01:42:28 2002 -+++ gcc-20030210/gcc/config/sh/elf.h Sat Feb 22 01:40:14 2003 -@@ -170,3 +170,7 @@ - #undef ENDFILE_SPEC - #define ENDFILE_SPEC \ - "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s" -+ -+/* ASM_OUTPUT_CASE_LABEL is defined in elfos.h. With it, -+ redundant .align will be generated. */ -+#undef ASM_OUTPUT_CASE_LABEL -diff -ruN gcc-20030210.orig/gcc/config/sh/lib1funcs.asm gcc-20030210/gcc/config/sh/lib1funcs.asm ---- gcc-20030210.orig/gcc/config/sh/lib1funcs.asm Fri Feb 22 01:42:28 2002 -+++ gcc-20030210/gcc/config/sh/lib1funcs.asm Sat Feb 22 01:40:14 2003 -@@ -39,8 +39,13 @@ - - #ifdef __ELF__ - #define LOCAL(X) .L_##X -+#define FUNC(X) .type X,@function; .hidden X -+#define _ENDFUNC(X) .Lfe_##X: .size X,.Lfe_##X-X -+#define ENDFUNC(X) _ENDFUNC(X) - #else - #define LOCAL(X) L_##X -+#define FUNC(X) -+#define ENDFUNC(X) - #endif - - #ifdef __linux__ -@@ -91,6 +96,40 @@ - .global GLOBAL(ashiftrt_r4_31) - .global GLOBAL(ashiftrt_r4_32) - -+ FUNC(GLOBAL(ashiftrt_r4_0)) -+ FUNC(GLOBAL(ashiftrt_r4_1)) -+ FUNC(GLOBAL(ashiftrt_r4_2)) -+ FUNC(GLOBAL(ashiftrt_r4_3)) -+ FUNC(GLOBAL(ashiftrt_r4_4)) -+ FUNC(GLOBAL(ashiftrt_r4_5)) -+ FUNC(GLOBAL(ashiftrt_r4_6)) -+ FUNC(GLOBAL(ashiftrt_r4_7)) -+ FUNC(GLOBAL(ashiftrt_r4_8)) -+ FUNC(GLOBAL(ashiftrt_r4_9)) -+ FUNC(GLOBAL(ashiftrt_r4_10)) -+ FUNC(GLOBAL(ashiftrt_r4_11)) -+ FUNC(GLOBAL(ashiftrt_r4_12)) -+ FUNC(GLOBAL(ashiftrt_r4_13)) -+ FUNC(GLOBAL(ashiftrt_r4_14)) -+ FUNC(GLOBAL(ashiftrt_r4_15)) -+ FUNC(GLOBAL(ashiftrt_r4_16)) -+ FUNC(GLOBAL(ashiftrt_r4_17)) -+ FUNC(GLOBAL(ashiftrt_r4_18)) -+ FUNC(GLOBAL(ashiftrt_r4_19)) -+ FUNC(GLOBAL(ashiftrt_r4_20)) -+ FUNC(GLOBAL(ashiftrt_r4_21)) -+ FUNC(GLOBAL(ashiftrt_r4_22)) -+ FUNC(GLOBAL(ashiftrt_r4_23)) -+ FUNC(GLOBAL(ashiftrt_r4_24)) -+ FUNC(GLOBAL(ashiftrt_r4_25)) -+ FUNC(GLOBAL(ashiftrt_r4_26)) -+ FUNC(GLOBAL(ashiftrt_r4_27)) -+ FUNC(GLOBAL(ashiftrt_r4_28)) -+ FUNC(GLOBAL(ashiftrt_r4_29)) -+ FUNC(GLOBAL(ashiftrt_r4_30)) -+ FUNC(GLOBAL(ashiftrt_r4_31)) -+ FUNC(GLOBAL(ashiftrt_r4_32)) -+ - .align 1 - GLOBAL(ashiftrt_r4_32): - GLOBAL(ashiftrt_r4_31): -@@ -170,6 +209,41 @@ - GLOBAL(ashiftrt_r4_0): - rts - nop -+ -+ ENDFUNC(GLOBAL(ashiftrt_r4_0)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_1)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_2)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_3)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_4)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_5)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_6)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_7)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_8)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_9)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_10)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_11)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_12)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_13)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_14)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_15)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_16)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_17)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_18)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_19)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_20)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_21)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_22)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_23)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_24)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_25)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_26)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_27)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_28)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_29)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_30)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_31)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_32)) -+ - #endif - - #ifdef L_ashiftrt_n -@@ -192,6 +266,7 @@ - ! - - .global GLOBAL(ashrsi3) -+ FUNC(GLOBAL(ashrsi3)) - .align 2 - GLOBAL(ashrsi3): - mov #31,r0 -@@ -319,6 +394,8 @@ - rts - nop - -+ ENDFUNC(GLOBAL(ashrsi3)) -+ - #endif - - #ifdef L_ashiftlt -@@ -340,6 +417,7 @@ - ! (none) - ! - .global GLOBAL(ashlsi3) -+ FUNC(GLOBAL(ashlsi3)) - .align 2 - GLOBAL(ashlsi3): - mov #31,r0 -@@ -476,6 +554,8 @@ - rts - nop - -+ ENDFUNC(GLOBAL(ashlsi3)) -+ - #endif - - #ifdef L_lshiftrt -@@ -497,6 +577,7 @@ - ! (none) - ! - .global GLOBAL(lshrsi3) -+ FUNC(GLOBAL(lshrsi3)) - .align 2 - GLOBAL(lshrsi3): - mov #31,r0 -@@ -633,6 +714,8 @@ - rts - nop - -+ ENDFUNC(GLOBAL(lshrsi3)) -+ - #endif - - #ifdef L_movstr -@@ -649,76 +732,113 @@ - add #64,r4 - .align 4 - .global GLOBAL(movstrSI64) -+ FUNC(GLOBAL(movstrSI64)) - GLOBAL(movstrSI64): - mov.l @(60,r5),r0 - mov.l r0,@(60,r4) - .global GLOBAL(movstrSI60) -+ FUNC(GLOBAL(movstrSI60)) - GLOBAL(movstrSI60): - mov.l @(56,r5),r0 - mov.l r0,@(56,r4) - .global GLOBAL(movstrSI56) -+ FUNC(GLOBAL(movstrSI56)) - GLOBAL(movstrSI56): - mov.l @(52,r5),r0 - mov.l r0,@(52,r4) - .global GLOBAL(movstrSI52) -+ FUNC(GLOBAL(movstrSI52)) - GLOBAL(movstrSI52): - mov.l @(48,r5),r0 - mov.l r0,@(48,r4) - .global GLOBAL(movstrSI48) -+ FUNC(GLOBAL(movstrSI48)) - GLOBAL(movstrSI48): - mov.l @(44,r5),r0 - mov.l r0,@(44,r4) - .global GLOBAL(movstrSI44) -+ FUNC(GLOBAL(movstrSI44)) - GLOBAL(movstrSI44): - mov.l @(40,r5),r0 - mov.l r0,@(40,r4) - .global GLOBAL(movstrSI40) -+ FUNC(GLOBAL(movstrSI40)) - GLOBAL(movstrSI40): - mov.l @(36,r5),r0 - mov.l r0,@(36,r4) - .global GLOBAL(movstrSI36) -+ FUNC(GLOBAL(movstrSI36)) - GLOBAL(movstrSI36): - mov.l @(32,r5),r0 - mov.l r0,@(32,r4) - .global GLOBAL(movstrSI32) -+ FUNC(GLOBAL(movstrSI32)) - GLOBAL(movstrSI32): - mov.l @(28,r5),r0 - mov.l r0,@(28,r4) - .global GLOBAL(movstrSI28) -+ FUNC(GLOBAL(movstrSI28)) - GLOBAL(movstrSI28): - mov.l @(24,r5),r0 - mov.l r0,@(24,r4) - .global GLOBAL(movstrSI24) -+ FUNC(GLOBAL(movstrSI24)) - GLOBAL(movstrSI24): - mov.l @(20,r5),r0 - mov.l r0,@(20,r4) - .global GLOBAL(movstrSI20) -+ FUNC(GLOBAL(movstrSI20)) - GLOBAL(movstrSI20): - mov.l @(16,r5),r0 - mov.l r0,@(16,r4) - .global GLOBAL(movstrSI16) -+ FUNC(GLOBAL(movstrSI16)) - GLOBAL(movstrSI16): - mov.l @(12,r5),r0 - mov.l r0,@(12,r4) - .global GLOBAL(movstrSI12) -+ FUNC(GLOBAL(movstrSI12)) - GLOBAL(movstrSI12): - mov.l @(8,r5),r0 - mov.l r0,@(8,r4) - .global GLOBAL(movstrSI8) -+ FUNC(GLOBAL(movstrSI8)) - GLOBAL(movstrSI8): - mov.l @(4,r5),r0 - mov.l r0,@(4,r4) - .global GLOBAL(movstrSI4) -+ FUNC(GLOBAL(movstrSI4)) - GLOBAL(movstrSI4): - mov.l @(0,r5),r0 - mov.l r0,@(0,r4) -+ .global GLOBAL(movstrSI0) -+ FUNC(GLOBAL(movstrSI0)) - GLOBAL(movstrSI0): - rts - nop - -+ ENDFUNC(GLOBAL(movstrSI64)) -+ ENDFUNC(GLOBAL(movstrSI60)) -+ ENDFUNC(GLOBAL(movstrSI56)) -+ ENDFUNC(GLOBAL(movstrSI52)) -+ ENDFUNC(GLOBAL(movstrSI48)) -+ ENDFUNC(GLOBAL(movstrSI44)) -+ ENDFUNC(GLOBAL(movstrSI40)) -+ ENDFUNC(GLOBAL(movstrSI36)) -+ ENDFUNC(GLOBAL(movstrSI32)) -+ ENDFUNC(GLOBAL(movstrSI28)) -+ ENDFUNC(GLOBAL(movstrSI24)) -+ ENDFUNC(GLOBAL(movstrSI20)) -+ ENDFUNC(GLOBAL(movstrSI16)) -+ ENDFUNC(GLOBAL(movstrSI12)) -+ ENDFUNC(GLOBAL(movstrSI8)) -+ ENDFUNC(GLOBAL(movstrSI4)) -+ ENDFUNC(GLOBAL(movstrSI0)) -+ - .align 4 - - .global GLOBAL(movstr) -+ FUNC(GLOBAL(movstr)) - GLOBAL(movstr): - mov.l @(60,r5),r0 - mov.l r0,@(60,r4) -@@ -775,6 +895,8 @@ - add #64,r5 - bra GLOBAL(movstr) - add #64,r4 -+ -+ FUNC(GLOBAL(movstr)) - #endif - - #ifdef L_movstr_i4 -@@ -783,6 +905,10 @@ - .global GLOBAL(movstr_i4_odd) - .global GLOBAL(movstrSI12_i4) - -+ FUNC(GLOBAL(movstr_i4_even)) -+ FUNC(GLOBAL(movstr_i4_odd)) -+ FUNC(GLOBAL(movstrSI12_i4)) -+ - .p2align 5 - L_movstr_2mod4_end: - mov.l r0,@(16,r4) -@@ -791,6 +917,11 @@ - - .p2align 2 - -+GLOBAL(movstr_i4_even): -+ mov.l @r5+,r0 -+ bra L_movstr_start_even -+ mov.l @r5+,r1 -+ - GLOBAL(movstr_i4_odd): - mov.l @r5+,r1 - add #-4,r4 -@@ -817,10 +948,8 @@ - rts - mov.l r3,@(12,r4) - --GLOBAL(movstr_i4_even): -- mov.l @r5+,r0 -- bra L_movstr_start_even -- mov.l @r5+,r1 -+ ENDFUNC(GLOBAL(movstr_i4_even)) -+ ENDFUNC(GLOBAL(movstr_i4_odd)) - - .p2align 4 - GLOBAL(movstrSI12_i4): -@@ -831,12 +960,16 @@ - mov.l r1,@(4,r4) - rts - mov.l r2,@(8,r4) -+ -+ ENDFUNC(GLOBAL(movstrSI12_i4)) -+ - #endif - - #ifdef L_mulsi3 - - - .global GLOBAL(mulsi3) -+ FUNC(GLOBAL(mulsi3)) - - ! r4 = aabb - ! r5 = ccdd -@@ -869,7 +1002,7 @@ - rts - add r2,r0 - -- -+ FUNC(GLOBAL(mulsi3)) - #endif - #endif /* ! __SH5__ */ - #ifdef L_sdivsi3_i4 -@@ -879,6 +1012,7 @@ - !! args in r4 and r5, result in fpul, clobber dr0, dr2 - - .global GLOBAL(sdivsi3_i4) -+ FUNC(GLOBAL(sdivsi3_i4)) - GLOBAL(sdivsi3_i4): - lds r4,fpul - float fpul,dr0 -@@ -888,6 +1022,8 @@ - rts - ftrc dr0,fpul - -+ ENDFUNC(GLOBAL(sdivsi3_i4)) -+ - #elif defined(__SH4_SINGLE__) || defined(__SH4_SINGLE_ONLY__) || (defined (__SH5__) && ! defined __SH4_NOFPU__) - !! args in r4 and r5, result in fpul, clobber r2, dr0, dr2 - -@@ -896,6 +1032,7 @@ - .mode SHcompact - #endif - .global GLOBAL(sdivsi3_i4) -+ FUNC(GLOBAL(sdivsi3_i4)) - GLOBAL(sdivsi3_i4): - sts.l fpscr,@-r15 - mov #8,r2 -@@ -910,6 +1047,8 @@ - rts - lds.l @r15+,fpscr - -+ ENDFUNC(GLOBAL(sdivsi3_i4)) -+ - #endif /* ! __SH5__ || __SH5__ == 32 */ - #endif /* ! __SH4__ */ - #endif -@@ -924,9 +1063,10 @@ - !! - !! - --!! args in r4 and r5, result in r0 clobber r1,r2,r3 -+!! args in r4 and r5, result in r0 clobber r1, r2, r3, and t bit - - .global GLOBAL(sdivsi3) -+ FUNC(GLOBAL(sdivsi3)) - #if __SHMEDIA__ - #if __SH5__ == 32 - .section .text..SHmedia32,"ax" -@@ -1076,6 +1216,7 @@ - div0: rts - mov #0,r0 - -+ ENDFUNC(GLOBAL(sdivsi3)) - #endif /* ! __SHMEDIA__ */ - #endif /* ! __SH4__ */ - #endif -@@ -1084,9 +1225,11 @@ - .title "SH DIVIDE" - !! 4 byte integer Divide code for the Hitachi SH - #ifdef __SH4__ --!! args in r4 and r5, result in fpul, clobber r0, r1, r4, r5, dr0, dr2, dr4 -+!! args in r4 and r5, result in fpul, clobber r0, r1, r4, r5, dr0, dr2, dr4, -+!! and t bit - - .global GLOBAL(udivsi3_i4) -+ FUNC(GLOBAL(udivsi3_i4)) - GLOBAL(udivsi3_i4): - mov #1,r1 - cmp/hi r1,r5 -@@ -1127,6 +1270,8 @@ - L1: - .double 2147483648 - -+ ENDFUNC(GLOBAL(udivsi3_i4)) -+ - #elif defined(__SH4_SINGLE__) || defined(__SH4_SINGLE_ONLY__) || (defined (__SH5__) && ! defined __SH4_NOFPU__) - !! args in r4 and r5, result in fpul, clobber r0, r1, r4, r5, dr0, dr2, dr4 - -@@ -1135,6 +1280,7 @@ - .mode SHcompact - #endif - .global GLOBAL(udivsi3_i4) -+ FUNC(GLOBAL(udivsi3_i4)) - GLOBAL(udivsi3_i4): - mov #1,r1 - cmp/hi r1,r5 -@@ -1183,6 +1329,8 @@ - #endif - .double 2147483648 - -+ ENDFUNC(GLOBAL(udivsi3_i4)) -+ - #endif /* ! __SH5__ || __SH5__ == 32 */ - #endif /* ! __SH4__ */ - #endif -@@ -1199,6 +1347,7 @@ - - !! args in r4 and r5, result in r0, clobbers r4, pr, and t bit - .global GLOBAL(udivsi3) -+ FUNC(GLOBAL(udivsi3)) - - #if __SHMEDIA__ - #if __SH5__ == 32 -@@ -1299,6 +1448,8 @@ - ret: rts - mov r4,r0 - -+ ENDFUNC(GLOBAL(udivsi3)) -+ - #endif /* ! __SHMEDIA__ */ - #endif /* __SH4__ */ - #endif -@@ -1308,6 +1459,7 @@ - .mode SHcompact - #endif - .global GLOBAL(set_fpscr) -+ FUNC(GLOBAL(set_fpscr)) - GLOBAL(set_fpscr): - lds r4,fpscr - mov.l LOCAL(set_fpscr_L1),r1 -@@ -1340,11 +1492,16 @@ - .align 2 - LOCAL(set_fpscr_L1): - .long GLOBAL(fpscr_values) -+ -+ ENDFUNC(GLOBAL(set_fpscr)) -+ -+#ifndef NO_FPSCR_VALUES - #ifdef __ELF__ - .comm GLOBAL(fpscr_values),8,4 - #else - .comm GLOBAL(fpscr_values),8 - #endif /* ELF */ -+#endif /* NO_FPSCR_VALUES */ - #endif /* SH3E / SH4 */ - #endif /* L_set_fpscr */ - #ifdef L_ic_invalidate -@@ -1360,6 +1517,7 @@ - blink tr0, r63 - #elif defined(__SH4_SINGLE__) || defined(__SH4__) || defined(__SH4_SINGLE_ONLY__) - .global GLOBAL(ic_invalidate) -+ FUNC(GLOBAL(ic_invalidate)) - GLOBAL(ic_invalidate): - ocbwb @r4 - mova 0f,r0 -@@ -1382,6 +1540,9 @@ - nop - .endr - .endr -+ -+ ENDFUNC(GLOBAL(ic_invalidate)) -+ - #endif /* SH4 */ - #endif /* L_ic_invalidate */ - -diff -ruN gcc-20030210.orig/gcc/config/sh/libgcc-glibc.ver gcc-20030210/gcc/config/sh/libgcc-glibc.ver ---- gcc-20030210.orig/gcc/config/sh/libgcc-glibc.ver Thu Jan 1 09:00:00 1970 -+++ gcc-20030210/gcc/config/sh/libgcc-glibc.ver Sat Feb 22 01:40:14 2003 -@@ -0,0 +1,21 @@ -+# In order to work around the very problems that force us to now generally -+# create a libgcc.so, glibc reexported a number of routines from libgcc.a. -+# By now choosing the same version tags for these specific routines, we -+# maintain enough binary compatibility to allow future versions of glibc -+# to defer implementation of these routines to libgcc.so via DT_AUXILIARY. -+ -+# Note that we cannot use the default libgcc-glibc.ver file on sh, -+# because GLIBC_2.0 does not exist on this architecture, as the first -+# ever glibc release on the platform was GLIBC_2.2. -+ -+%inherit GCC_3.0 GLIBC_2.2 -+GLIBC_2.2 { -+ __register_frame -+ __register_frame_table -+ __deregister_frame -+ __register_frame_info -+ __deregister_frame_info -+ __frame_state_for -+ __register_frame_info_table -+} -+ -diff -ruN gcc-20030210.orig/gcc/config/sh/linux.h gcc-20030210/gcc/config/sh/linux.h ---- gcc-20030210.orig/gcc/config/sh/linux.h Tue Apr 16 05:27:42 2002 -+++ gcc-20030210/gcc/config/sh/linux.h Sat Feb 22 01:40:14 2003 -@@ -19,6 +19,10 @@ - the Free Software Foundation, 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -+/* We're not SYSVR4, not having /usr/ccs */ -+#undef MD_EXEC_PREFIX -+#undef MD_STARTFILE_PREFIX -+ - /* Run-time Target Specification. */ - #undef TARGET_VERSION - #define TARGET_VERSION fputs (" (SH GNU/Linux with ELF)", stderr); -@@ -39,6 +43,28 @@ - #undef WCHAR_TYPE_SIZE - #define WCHAR_TYPE_SIZE BITS_PER_WORD - -+/* This was defined in linux.h. Define it here also. */ -+#undef DEFAULT_VTABLE_THUNKS -+#define DEFAULT_VTABLE_THUNKS 1 -+ -+/* Likewise. */ -+#define HANDLE_PRAGMA_PACK_PUSH_POP -+ -+/* Pick up the return address upon entry to a procedure. Used for -+ dwarf2 unwind information. This also enables the table driven -+ mechanism. */ -+ -+#define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (Pmode, PR_REG) -+#define DWARF_FRAME_RETURN_COLUMN DWARF_FRAME_REGNUM (PR_REG) -+ -+#undef CPP_SPEC -+#define CPP_SPEC "\ -+ %{m4:-D__SH4__} \ -+ %{!m4:%(cpp_default_cpu_spec)} \ -+ %(subtarget_cpp_spec) \ -+ %(subtarget_cpp_ptr_spec) \ -+ %(subtarget_cpp_endian_spec) " -+ - #undef SUBTARGET_CPP_SPEC - #define SUBTARGET_CPP_SPEC "\ - %{fPIC:-D__PIC__ -D__pic__} \ -@@ -55,36 +81,45 @@ - #undef CPP_DEFAULT_CPU_SPEC - #define CPP_DEFAULT_CPU_SPEC "-D__SH3__ -D__sh3__" - -- - #undef CPP_PREDEFINES - #define CPP_PREDEFINES "-D__ELF__ -Dunix -D__sh__ -D__gnu_linux__ -Dlinux -Asystem=posix" - -+/* The GNU C++ standard library requires that these macros be defined. */ -+#undef CPLUSPLUS_CPP_SPEC -+#define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)" -+ - #undef ASM_SPEC --#define ASM_SPEC "%{!mb:-little} %{mrelax:-relax}" -+#define ASM_SPEC "%{mb:-big} %{!mb:-little} %{mrelax:-relax}" - - #undef CC1_SPEC - #define CC1_SPEC \ -- "-musermode %{!mb:-ml} %{!m3e:%{!m4:-m3}}" -- --#undef CC1PLUS_SPEC --#define CC1PLUS_SPEC \ -- "-musermode %{!mb:-ml} %{!m3e:%{!m4:-m3}}" -+ "-musermode %{!mb:-ml} %{!m4:-m3} %{profile:-p}" - -+/* XXX: It's wrong if prefix != /usr */ - #undef LINK_SPEC - #define LINK_SPEC \ -- "%{!mb:-m shlelf_linux} %{mrelax:-relax} \ -+ "%{!mb:-m shlelf_linux -EL} %{mb:-m shelf_linux -EB} %{mrelax:-relax} \ - %{shared:-shared} \ - %{!static: \ - %{rdynamic:-export-dynamic} \ - %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2} \ -- %{!rpath:-rpath /lib}} \ -+ %{!mb:%{!m4:-rpath-link /usr/sh-linux/lib }} \ -+ %{!mb:%{m4:-rpath-link /usr/sh-linux/lib/m4 }} \ -+ %{mb:%{!m4:-rpath-link /usr/sh-linux/lib/mb }} \ -+ %{mb:%{m4:-rpath-link /usr/sh-linux/lib/mb/m4 }}} \ - %{static:-static}" - - #undef LIB_SPEC -+#undef LIB_SPEC - #define LIB_SPEC \ - "%{shared: -lc} \ -- %{!shared: %{pthread:-lthread} \ -- %{profile:-lc_p} %{!profile: -lc}}" -+ %{!shared: %{mieee:-lieee} %{pthread:-lpthread} \ -+ %{profile:-lc_p} %{!profile: -lc}}" -+ -+#if defined(HAVE_LD_EH_FRAME_HDR) -+#undef LINK_EH_SPEC -+#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} " -+#endif - - #undef STARTFILE_SPEC - #define STARTFILE_SPEC \ -@@ -92,4 +127,40 @@ - %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \ - %{!p:%{profile:gcrt1.o%s} \ - %{!profile:crt1.o%s}}}} \ -- crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}" -+ crti.o%s %{static:crtbeginT.o%s}\ -+ %{!static:%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}}" -+ -+#undef FUNCTION_PROFILER -+#define FUNCTION_PROFILER(STREAM,LABELNO) \ -+do \ -+{ \ -+ if (flag_pic) \ -+ { \ -+ fprintf (STREAM, " mov.l 3f,r1\n"); \ -+ fprintf (STREAM, " mova 3f,r0\n"); \ -+ fprintf (STREAM, " add r1,r0\n"); \ -+ fprintf (STREAM, " mov.l 1f,r1\n"); \ -+ fprintf (STREAM, " mov.l @(r0,r1),r1\n"); \ -+ } \ -+ else \ -+ { \ -+ fprintf (STREAM, " mov.l 1f,r1\n"); \ -+ } \ -+ fprintf (STREAM, " sts.l pr,@-r15\n"); \ -+ fprintf (STREAM, " mova 2f,r0\n"); \ -+ fprintf (STREAM, " jmp @r1\n"); \ -+ fprintf (STREAM, " lds r0,pr\n"); \ -+ fprintf (STREAM, " .align 2\n"); \ -+ if (flag_pic) \ -+ { \ -+ fprintf (STREAM, "1: .long mcount@GOT\n"); \ -+ fprintf (STREAM, "3: .long _GLOBAL_OFFSET_TABLE_\n"); \ -+ } \ -+ else \ -+ { \ -+ fprintf (STREAM, "1: .long mcount\n"); \ -+ } \ -+ fprintf (STREAM, "2: lds.l @r15+,pr\n"); \ -+} while (0) -+ -+#define NO_SHARED_LIBGCC_MULTILIB -diff -ruN gcc-20030210.orig/gcc/config/sh/sh-protos.h gcc-20030210/gcc/config/sh/sh-protos.h ---- gcc-20030210.orig/gcc/config/sh/sh-protos.h Fri Feb 22 01:42:28 2002 -+++ gcc-20030210/gcc/config/sh/sh-protos.h Sat Feb 22 01:40:14 2003 -@@ -74,6 +74,7 @@ - extern int shl_sext_length PARAMS ((rtx)); - extern int gen_shl_sext PARAMS ((rtx, rtx, rtx, rtx)); - extern rtx gen_datalabel_ref PARAMS ((rtx)); -+extern int shl_casesi_worker_length PARAMS ((rtx)); - extern int regs_used PARAMS ((rtx, int)); - extern void fixup_addr_diff_vecs PARAMS ((rtx)); - extern int get_dest_uid PARAMS ((rtx, int)); -diff -ruN gcc-20030210.orig/gcc/config/sh/sh.c gcc-20030210/gcc/config/sh/sh.c ---- gcc-20030210.orig/gcc/config/sh/sh.c Fri Feb 22 01:42:28 2002 -+++ gcc-20030210/gcc/config/sh/sh.c Sat Feb 22 01:40:14 2003 -@@ -2143,6 +2143,48 @@ - return sym; - } - -+ -+/* Function to be used in the length attribute of the casesi_worker -+ instruction. Returns number of instructions, which is half of the -+ length of bytes. */ -+ -+int -+shl_casesi_worker_length (insn) -+ rtx insn; -+{ -+ rtx set_src, label; -+ rtx diff_vec; -+ -+ set_src = SET_SRC (XVECEXP (PATTERN (insn), 0, 0)); -+ if (!(GET_CODE (set_src) == UNSPEC -+ && XINT (set_src, 1) == UNSPEC_CASESI)) -+ abort (); -+ -+ label = XVECEXP (set_src, 0, 2); -+ if (GET_CODE (label) != LABEL_REF) -+ abort (); -+ -+ diff_vec = PATTERN (next_real_insn (XEXP (label, 0))); -+ -+ if (GET_CODE (diff_vec) != ADDR_DIFF_VEC) -+ abort (); -+ -+ switch (GET_MODE (diff_vec)) -+ { -+ case SImode: -+ return 2; -+ case HImode: -+ if (ADDR_DIFF_VEC_FLAGS (diff_vec).offset_unsigned) -+ return 3; -+ return 2; -+ case QImode: -+ if (ADDR_DIFF_VEC_FLAGS (diff_vec).offset_unsigned) -+ return 2; -+ return 1; -+ default: -+ abort (); -+ } -+} - - /* The SH cannot load a large constant into a register, constants have to - come from a pc relative load. The reference of a pc relative load -@@ -3190,7 +3232,7 @@ - vec_lab = XEXP (XEXP (pat, 0), 0); - - /* Search the matching casesi_jump_2. */ -- for (prev = vec_lab; ; prev = PREV_INSN (prev)) -+ for (prev = vec_lab; prev; prev = PREV_INSN (prev)) - { - if (GET_CODE (prev) != JUMP_INSN) - continue; -@@ -3205,6 +3247,13 @@ - break; - } - -+ if (prev == NULL) -+ { /* Switch statement has been optimized out. */ -+ delete_insn (PREV_INSN (insn)); -+ delete_insn (insn); -+ continue; -+ } -+ - /* Emit the reference label of the braf where it belongs, right after - the casesi_jump_2 (i.e. braf). */ - braf_label = XEXP (XEXP (SET_SRC (XVECEXP (prevpat, 0, 0)), 1), 0); -@@ -3223,7 +3272,7 @@ - rtx barrier_or_label; - { - rtx next = next_real_insn (barrier_or_label), pat, prev; -- int slot, credit, jump_to_next; -+ int slot, credit, jump_to_next = 0; - - if (! next) - return 0; -@@ -4507,7 +4556,8 @@ - if (current_function_varargs || current_function_stdarg) - { - /* This is not used by the SH3E calling convention */ -- if (TARGET_SH1 && ! TARGET_SH3E && ! TARGET_SH5 && ! TARGET_HITACHI) -+ if (TARGET_SH1 && ! TARGET_SH3E && ! TARGET_SH5 && ! TARGET_HITACHI -+ || TARGET_NO_IMPLICIT_FP) - { - /* Push arg regs as if they'd been provided by caller in stack. */ - for (i = 0; i < NPARM_REGS(SImode); i++) -@@ -5149,7 +5199,8 @@ - tree f_next_o, f_next_o_limit, f_next_fp, f_next_fp_limit, f_next_stack; - tree record; - -- if (TARGET_SH5 || (! TARGET_SH3E && ! TARGET_SH4) || TARGET_HITACHI) -+ if (TARGET_SH5 || (! TARGET_SH3E && ! TARGET_SH4) || TARGET_HITACHI -+ || TARGET_NO_IMPLICIT_FP) - return ptr_type_node; - - record = make_node (RECORD_TYPE); -@@ -5211,7 +5262,8 @@ - return; - } - -- if ((! TARGET_SH3E && ! TARGET_SH4) || TARGET_HITACHI) -+ if ((! TARGET_SH3E && ! TARGET_SH4) -+ || TARGET_HITACHI || TARGET_NO_IMPLICIT_FP) - { - std_expand_builtin_va_start (stdarg_p, valist, nextarg); - return; -@@ -5289,7 +5341,8 @@ - rsize = (size + UNITS_PER_WORD - 1) & -UNITS_PER_WORD; - pptr_type_node = build_pointer_type (ptr_type_node); - -- if (! TARGET_SH5 && (TARGET_SH3E || TARGET_SH4) && ! TARGET_HITACHI) -+ if (! TARGET_SH5 && (TARGET_SH3E || TARGET_SH4) -+ && ! TARGET_HITACHI && ! TARGET_NO_IMPLICIT_FP) - { - tree f_next_o, f_next_o_limit, f_next_fp, f_next_fp_limit, f_next_stack; - tree next_o, next_o_limit, next_fp, next_fp_limit, next_stack; -diff -ruN gcc-20030210.orig/gcc/config/sh/sh.h gcc-20030210/gcc/config/sh/sh.h ---- gcc-20030210.orig/gcc/config/sh/sh.h Fri Feb 22 01:42:28 2002 -+++ gcc-20030210/gcc/config/sh/sh.h Sat Feb 22 01:40:14 2003 -@@ -147,10 +147,10 @@ - #define HARD_SH4_BIT (1<<5) - #define FPU_SINGLE_BIT (1<<7) - #define SH4_BIT (1<<12) -+#define NO_IMPLICIT_FP_BIT (1<<3) - #define FMOVD_BIT (1<<4) - #define SH5_BIT (1<<0) - #define SPACE_BIT (1<<13) --#define BIGTABLE_BIT (1<<14) - #define RELAX_BIT (1<<15) - #define USERMODE_BIT (1<<16) - #define HITACHI_BIT (1<<22) -@@ -205,6 +205,9 @@ - /* Nonzero if we should generate code for a SH5 CPU (either ISA). */ - #define TARGET_SH5 (target_flags & SH5_BIT) - -+/* Nonzero if we should not use FPU implicitly. */ -+#define TARGET_NO_IMPLICIT_FP (target_flags & NO_IMPLICIT_FP_BIT) -+ - /* Nonzero if we should generate code using the SHcompact instruction - set and 32-bit ABI. */ - #define TARGET_SHCOMPACT (TARGET_SH5 && TARGET_SH1) -@@ -225,6 +228,7 @@ - - /* Nonzero if we should generate code using SHmedia FPU instructions. */ - #define TARGET_SHMEDIA_FPU (TARGET_SHMEDIA && TARGET_FPU_DOUBLE) -+ - /* Nonzero if we should generate fmovd. */ - #define TARGET_FMOVD (target_flags & FMOVD_BIT) - -@@ -234,9 +238,6 @@ - /* Nonzero if we should generate smaller code rather than faster code. */ - #define TARGET_SMALLCODE (target_flags & SPACE_BIT) - --/* Nonzero to use long jump tables. */ --#define TARGET_BIGTABLE (target_flags & BIGTABLE_BIT) -- - /* Nonzero to generate pseudo-ops needed by the assembler and linker - to do function call relaxing. */ - #define TARGET_RELAX (target_flags & RELAX_BIT) -@@ -297,7 +298,6 @@ - {"5-compact-nofpu", TARGET_NONE, "" }, \ - {"5-compact-nofpu", SH5_BIT|SH3_BIT|SH2_BIT|SH1_BIT, "Generate FPU-less SHcompact code" }, \ - {"b", -LITTLE_ENDIAN_BIT, "" }, \ -- {"bigtable", BIGTABLE_BIT, "" }, \ - {"dalign", DALIGN_BIT, "" }, \ - {"fmovd", FMOVD_BIT, "" }, \ - {"hitachi", HITACHI_BIT, "" }, \ -@@ -306,6 +306,7 @@ - {"isize", ISIZE_BIT, "" }, \ - {"l", LITTLE_ENDIAN_BIT, "" }, \ - {"no-ieee", -IEEE_BIT, "" }, \ -+ {"no-implicit-fp", NO_IMPLICIT_FP_BIT, "" }, \ - {"padstruct", PADSTRUCT_BIT, "" }, \ - {"prefergot", PREFERGOT_BIT, "" }, \ - {"relax", RELAX_BIT, "" }, \ -@@ -2493,16 +2494,22 @@ - goto LABEL; \ - } - -+extern int optimize; /* needed for gen_casesi. */ -+extern int optimize_size; -+ - /* Specify the machine mode that this machine uses - for the index in the tablejump instruction. */ --#define CASE_VECTOR_MODE (TARGET_BIGTABLE ? SImode : HImode) -+#define CASE_VECTOR_MODE SImode - - #define CASE_VECTOR_SHORTEN_MODE(MIN_OFFSET, MAX_OFFSET, BODY) \ - ((MIN_OFFSET) >= 0 && (MAX_OFFSET) <= 127 \ - ? (ADDR_DIFF_VEC_FLAGS (BODY).offset_unsigned = 0, QImode) \ - : (MIN_OFFSET) >= 0 && (MAX_OFFSET) <= 255 \ - ? (ADDR_DIFF_VEC_FLAGS (BODY).offset_unsigned = 1, QImode) \ -- : (MIN_OFFSET) >= -32768 && (MAX_OFFSET) <= 32767 ? HImode \ -+ : (MIN_OFFSET) >= -32768 && (MAX_OFFSET) <= 32767 \ -+ ? (ADDR_DIFF_VEC_FLAGS (BODY).offset_unsigned = 0, HImode) \ -+ : optimize_size && (MIN_OFFSET) >= 0 && (MAX_OFFSET) <= 65535 \ -+ ? (ADDR_DIFF_VEC_FLAGS (BODY).offset_unsigned = 1, HImode) \ - : SImode) - - /* Define as C expression which evaluates to nonzero if the tablejump -@@ -3038,10 +3045,7 @@ - /* Output an absolute table element. */ - - #define ASM_OUTPUT_ADDR_VEC_ELT(STREAM,VALUE) \ -- if (TARGET_BIGTABLE) \ -- asm_fprintf ((STREAM), "\t.long\t%LL%d\n", (VALUE)); \ -- else \ -- asm_fprintf ((STREAM), "\t.word\t%LL%d\n", (VALUE)); \ -+ asm_fprintf ((STREAM), "\t.long\t%LL%d\n", (VALUE)) - - /* Output various types of constants. */ - -@@ -3167,8 +3171,6 @@ - #define sh_cpu_attr ((enum attr_cpu)sh_cpu) - extern enum processor_type sh_cpu; - --extern int optimize; /* needed for gen_casesi. */ -- - enum mdep_reorg_phase_e - { - SH_BEFORE_MDEP_REORG, -diff -ruN gcc-20030210.orig/gcc/config/sh/sh.md gcc-20030210/gcc/config/sh/sh.md ---- gcc-20030210.orig/gcc/config/sh/sh.md Sat Nov 23 04:58:06 2002 -+++ gcc-20030210/gcc/config/sh/sh.md Sat Feb 22 01:40:14 2003 -@@ -1242,7 +1242,7 @@ - (clobber (reg:SI PR_REG)) - (clobber (reg:SI R4_REG)) - (use (match_operand:SI 1 "arith_reg_operand" "r"))] -- "TARGET_SH1 && ! TARGET_SH4" -+ "TARGET_SH1 && ! TARGET_SH4 || TARGET_NO_IMPLICIT_FP" - "jsr @%1%#" - [(set_attr "type" "sfunc") - (set_attr "needs_delay_slot" "yes")]) -@@ -1336,7 +1336,7 @@ - - operands[3] = gen_reg_rtx (Pmode); - /* Emit the move of the address to a pseudo outside of the libcall. */ -- if (TARGET_HARD_SH4 && TARGET_SH3E) -+ if (TARGET_HARD_SH4 && TARGET_SH3E && !TARGET_NO_IMPLICIT_FP) - { - emit_move_insn (operands[3], - gen_rtx_SYMBOL_REF (SImode, \"__udivsi3_i4\")); -@@ -1391,7 +1391,7 @@ - (clobber (reg:SI R2_REG)) - (clobber (reg:SI R3_REG)) - (use (match_operand:SI 1 "arith_reg_operand" "r"))] -- "TARGET_SH1 && ! TARGET_SH4" -+ "TARGET_SH1 && ! TARGET_SH4 || TARGET_NO_IMPLICIT_FP" - "jsr @%1%#" - [(set_attr "type" "sfunc") - (set_attr "needs_delay_slot" "yes")]) -@@ -1476,7 +1476,7 @@ - - operands[3] = gen_reg_rtx (Pmode); - /* Emit the move of the address to a pseudo outside of the libcall. */ -- if (TARGET_HARD_SH4 && TARGET_SH3E) -+ if (TARGET_HARD_SH4 && TARGET_SH3E && !TARGET_NO_IMPLICIT_FP) - { - emit_move_insn (operands[3], - gen_rtx_SYMBOL_REF (SImode, \"__sdivsi3_i4\")); -@@ -6446,6 +6446,8 @@ - case SImode: - return \"shll2 %1\;mov.l @(r0,%1),%0\"; - case HImode: -+ if (ADDR_DIFF_VEC_FLAGS (diff_vec).offset_unsigned) -+ return \"add %1,%1\;mov.w @(r0,%1),%0\;extu.w %0,%0\"; - return \"add %1,%1\;mov.w @(r0,%1),%0\"; - case QImode: - if (ADDR_DIFF_VEC_FLAGS (diff_vec).offset_unsigned) -@@ -6455,7 +6457,15 @@ - abort (); - } - }" -- [(set_attr "length" "4")]) -+ [(set (attr "length") -+ (cond [(eq (symbol_ref "shl_casesi_worker_length (insn)") (const_int 1)) -+ (const_string "2") -+ (eq (symbol_ref "shl_casesi_worker_length (insn)") (const_int 2)) -+ (const_string "4") -+ ;; Put "match_dup" here so that insn_variable_length_p return 1. -+ (ne (match_dup 2) (match_dup 2)) -+ (const_string "4")] -+ (const_string "6")))]) - - (define_insn "casesi_shift_media" - [(set (match_operand 0 "arith_reg_operand" "=r") -diff -ruN gcc-20030210.orig/gcc/config/sh/sh3-linux.h gcc-20030210/gcc/config/sh/sh3-linux.h ---- gcc-20030210.orig/gcc/config/sh/sh3-linux.h Thu Jan 1 09:00:00 1970 -+++ gcc-20030210/gcc/config/sh/sh3-linux.h Sat Feb 22 01:40:14 2003 -@@ -0,0 +1,29 @@ -+#undef TARGET_VERSION -+#define TARGET_VERSION fputs (" (SH3 GNU/Linux with ELF)", stderr); -+ -+#undef CPP_SPEC -+#define CPP_SPEC \ -+ "-D__LITTLE_ENDIAN__ \ -+ -D__SH3__ -D__sh3__ \ -+ -D__SIZE_TYPE__=unsigned\\ int \ -+ -D__PTRDIFF_TYPE__=int \ -+ %{fPIC:-D__PIC__ -D__pic__} \ -+ %{fpic:-D__PIC__ -D__pic__} \ -+ %{posix:-D_POSIX_SOURCE} \ -+ %{pthread:-D_REENTRANT -D_PTHREADS}" -+ -+#undef ASM_SPEC -+#define ASM_SPEC "%{mrelax:-relax}" -+ -+#undef CC1_SPEC -+#define CC1_SPEC \ -+ "-musermode -ml -m3 %{profile:-p}" -+ -+#undef LINK_SPEC -+#define LINK_SPEC \ -+ "%{mrelax:-relax} \ -+ %{shared:-shared} \ -+ %{!static: \ -+ %{rdynamic:-export-dynamic} \ -+ %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \ -+ %{static:-static}" -diff -ruN gcc-20030210.orig/gcc/config/sh/sh3eb-linux.h gcc-20030210/gcc/config/sh/sh3eb-linux.h ---- gcc-20030210.orig/gcc/config/sh/sh3eb-linux.h Thu Jan 1 09:00:00 1970 -+++ gcc-20030210/gcc/config/sh/sh3eb-linux.h Sat Feb 22 01:40:14 2003 -@@ -0,0 +1,29 @@ -+#undef TARGET_VERSION -+#define TARGET_VERSION fputs (" (SH3EB GNU/Linux with ELF)", stderr); -+ -+#undef CPP_SPEC -+#define CPP_SPEC \ -+ "-D__BIG_ENDIAN__ \ -+ -D__SH3__ -D__sh3__ \ -+ -D__SIZE_TYPE__=unsigned\\ int \ -+ -D__PTRDIFF_TYPE__=int \ -+ %{fPIC:-D__PIC__ -D__pic__} \ -+ %{fpic:-D__PIC__ -D__pic__} \ -+ %{posix:-D_POSIX_SOURCE} \ -+ %{pthread:-D_REENTRANT -D_PTHREADS}" -+ -+#undef ASM_SPEC -+#define ASM_SPEC "%{mrelax:-relax}" -+ -+#undef CC1_SPEC -+#define CC1_SPEC \ -+ "-musermode -mb -m3 %{profile:-p}" -+ -+#undef LINK_SPEC -+#define LINK_SPEC \ -+ "%{mrelax:-relax} \ -+ %{shared:-shared} \ -+ %{!static: \ -+ %{rdynamic:-export-dynamic} \ -+ %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \ -+ %{static:-static}" -diff -ruN gcc-20030210.orig/gcc/config/sh/sh4-linux.h gcc-20030210/gcc/config/sh/sh4-linux.h ---- gcc-20030210.orig/gcc/config/sh/sh4-linux.h Thu Jan 1 09:00:00 1970 -+++ gcc-20030210/gcc/config/sh/sh4-linux.h Sat Feb 22 01:40:14 2003 -@@ -0,0 +1,29 @@ -+#undef TARGET_VERSION -+#define TARGET_VERSION fputs (" (SH4 GNU/Linux with ELF)", stderr); -+ -+#undef CPP_SPEC -+#define CPP_SPEC \ -+ "-D__LITTLE_ENDIAN__ \ -+ -D__SH4__ \ -+ -D__SIZE_TYPE__=unsigned\\ int \ -+ -D__PTRDIFF_TYPE__=int \ -+ %{fPIC:-D__PIC__ -D__pic__} \ -+ %{fpic:-D__PIC__ -D__pic__} \ -+ %{posix:-D_POSIX_SOURCE} \ -+ %{pthread:-D_REENTRANT -D_PTHREADS}" -+ -+#undef ASM_SPEC -+#define ASM_SPEC "%{mrelax:-relax}" -+ -+#undef CC1_SPEC -+#define CC1_SPEC \ -+ "-musermode -ml -m4 %{profile:-p}" -+ -+#undef LINK_SPEC -+#define LINK_SPEC \ -+ "%{mrelax:-relax} \ -+ %{shared:-shared} \ -+ %{!static: \ -+ %{rdynamic:-export-dynamic} \ -+ %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \ -+ %{static:-static}" -diff -ruN gcc-20030210.orig/gcc/config/sh/sh4eb-linux.h gcc-20030210/gcc/config/sh/sh4eb-linux.h ---- gcc-20030210.orig/gcc/config/sh/sh4eb-linux.h Thu Jan 1 09:00:00 1970 -+++ gcc-20030210/gcc/config/sh/sh4eb-linux.h Sat Feb 22 01:40:14 2003 -@@ -0,0 +1,29 @@ -+#undef TARGET_VERSION -+#define TARGET_VERSION fputs (" (SH4EB GNU/Linux with ELF)", stderr); -+ -+#undef CPP_SPEC -+#define CPP_SPEC \ -+ "-D__BIG_ENDIAN__ \ -+ -D__SH4__ \ -+ -D__SIZE_TYPE__=unsigned\\ int \ -+ -D__PTRDIFF_TYPE__=int \ -+ %{fPIC:-D__PIC__ -D__pic__} \ -+ %{fpic:-D__PIC__ -D__pic__} \ -+ %{posix:-D_POSIX_SOURCE} \ -+ %{pthread:-D_REENTRANT -D_PTHREADS}" -+ -+#undef ASM_SPEC -+#define ASM_SPEC "%{mrelax:-relax}" -+ -+#undef CC1_SPEC -+#define CC1_SPEC \ -+ "-musermode -mb -m4 %{profile:-p}" -+ -+#undef LINK_SPEC -+#define LINK_SPEC \ -+ "%{mrelax:-relax} \ -+ %{shared:-shared} \ -+ %{!static: \ -+ %{rdynamic:-export-dynamic} \ -+ %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \ -+ %{static:-static}" -diff -ruN gcc-20030210.orig/gcc/config/sh/t-linux gcc-20030210/gcc/config/sh/t-linux ---- gcc-20030210.orig/gcc/config/sh/t-linux Thu May 17 12:16:12 2001 -+++ gcc-20030210/gcc/config/sh/t-linux Sat Feb 22 01:40:14 2003 -@@ -1,10 +1,20 @@ --TARGET_LIBGCC2_CFLAGS = -fpic -+TARGET_LIBGCC2_CFLAGS = -fpic -DNO_FPSCR_VALUES -+LIBGCC1 = libgcc1-asm.a -+CROSS_LIBGCC1 = libgcc1-asm.a -+LIBGCC1_TEST = libgcc1-test - LIB1ASMFUNCS = _ashiftrt _ashiftrt_n _ashiftlt _lshiftrt _movstr \ - _movstr_i4 _mulsi3 _sdivsi3 _sdivsi3_i4 _udivsi3 _udivsi3_i4 _set_fpscr \ - _ic_invalidate -+LIB2ADDEH = $(srcdir)/unwind-sjlj.c -+LIB2ADDEHDEP = unwind.inc unwind-sjlj.c - --MULTILIB_OPTIONS= mb m3e/m4 -+MULTILIB_OPTIONS= mb m4 - MULTILIB_DIRNAMES= - MULTILIB_MATCHES = - --EXTRA_MULTILIB_PARTS= crtbegin.o crtend.o crtbeginS.o crtendS.o -+EXTRA_MULTILIB_PARTS= crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o -+ -+# Override t-slibgcc-elf-ver to export some libgcc symbols with -+# the symbol versions that glibc used and SH specific. -+SHLIB_MAPFILES = $(srcdir)/libgcc-std.ver \ -+ $(srcdir)/config/sh/libgcc-glibc.ver -diff -ruN gcc-20030210.orig/gcc/config/sh/t-linux-nomulti gcc-20030210/gcc/config/sh/t-linux-nomulti ---- gcc-20030210.orig/gcc/config/sh/t-linux-nomulti Thu Jan 1 09:00:00 1970 -+++ gcc-20030210/gcc/config/sh/t-linux-nomulti Sat Feb 22 01:40:14 2003 -@@ -0,0 +1,9 @@ -+LIBGCC = libgcc.a -+EXTRA_PARTS = crtbegin.o crtbeginS.o crtend.o crtendS.o crtbeginT.o -+ -+INSTALL_LIBGCC = install-libgcc -+ -+MULTILIB_OPTIONS= -+MULTILIB_DIRNAMES= -+MULTILIB_MATCHES = -+EXTRA_MULTILIB_PARTS= -diff -ruN gcc-20030210.orig/gcc/config.gcc gcc-20030210/gcc/config.gcc ---- gcc-20030210.orig/gcc/config.gcc Fri Jan 31 19:17:13 2003 -+++ gcc-20030210/gcc/config.gcc Sat Feb 22 01:40:14 2003 -@@ -337,9 +337,9 @@ - sparc*-*-*) - cpu_type=sparc - ;; --sh64-*-*) -- cpu_type=sh -- ;; -+sh*-*-*) -+ cpu_type=sh -+ ;; - esac - - tm_file=${cpu_type}/${cpu_type}.h -@@ -3018,9 +3018,31 @@ - thread_file='rtems' - fi - ;; --sh-*-linux*) -+sh*-*-linux*) - tm_file="${tm_file} sh/elf.h sh/linux.h" -- tmake_file="sh/t-sh sh/t-elf sh/t-linux" -+ tmake_file="sh/t-sh sh/t-elf t-slibgcc-elf-ver t-linux sh/t-linux" -+ extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o" -+ case $machine in -+ sh3eb-*) -+ tm_file="${tm_file} sh/sh3eb-linux.h" -+ tmake_file="${tmake_file} sh/t-linux-nomulti" -+ ;; -+ sh4eb-*) -+ tm_file="${tm_file} sh/sh4eb-linux.h" -+ tmake_file="${tmake_file} sh/t-linux-nomulti" -+ ;; -+ sh3-*) -+ tm_file="${tm_file} sh/sh3-linux.h" -+ tmake_file="${tmake_file} sh/t-linux-nomulti" -+ ;; -+ sh4-*) -+ tm_file="${tm_file} sh/sh4-linux.h" -+ tmake_file="${tmake_file} sh/t-linux-nomulti" -+ ;; -+ *) -+ ;; -+ esac -+ xmake_file=x-linux - gas=yes gnu_ld=yes - float_format=sh - ;; -diff -ruN gcc-20030210.orig/gcc/dwarf2out.c gcc-20030210/gcc/dwarf2out.c ---- gcc-20030210.orig/gcc/dwarf2out.c Mon Feb 10 19:36:25 2003 -+++ gcc-20030210/gcc/dwarf2out.c Sat Feb 22 01:40:14 2003 -@@ -10224,7 +10224,9 @@ - /* We can have a normal definition following an inline one in the - case of redefinition of GNU C extern inlines. - It seems reasonable to use AT_specification in this case. */ -- && !get_AT_unsigned (old_die, DW_AT_inline)) -+ && !get_AT_unsigned (old_die, DW_AT_inline) -+ /* Skip the nested function. */ -+ && !decl_function_context (decl)) - { - /* ??? This can happen if there is a bug in the program, for - instance, if it has duplicate function definitions. Ideally, -diff -ruN gcc-20030210.orig/gcc/final.c gcc-20030210/gcc/final.c ---- gcc-20030210.orig/gcc/final.c Fri Jan 31 19:17:20 2003 -+++ gcc-20030210/gcc/final.c Sat Feb 22 01:40:14 2003 -@@ -1128,7 +1128,7 @@ - } - } - -- INSN_ADDRESSES (uid) = insn_current_address; -+ INSN_ADDRESSES (uid) = insn_current_address + insn_lengths[uid]; - - if (GET_CODE (insn) == NOTE || GET_CODE (insn) == BARRIER - || GET_CODE (insn) == CODE_LABEL) -diff -ruN gcc-20030210.orig/gcc/mkmap-symver.awk gcc-20030210/gcc/mkmap-symver.awk ---- gcc-20030210.orig/gcc/mkmap-symver.awk Fri Jan 31 19:17:26 2003 -+++ gcc-20030210/gcc/mkmap-symver.awk Sat Feb 22 01:40:14 2003 -@@ -89,7 +89,11 @@ - output(inherit[lib]); - - printf("%s {\n", lib); -- printf(" global:\n"); -+ for (sym in ver) -+ if ((ver[sym] == lib) && (sym in def)) -+ count++; -+ if (count > 0) -+ printf(" global:\n"); - for (sym in ver) - if ((ver[sym] == lib) && (sym in def)) - { -diff -ruN gcc-20030210.orig/gcc/reload1.c gcc-20030210/gcc/reload1.c ---- gcc-20030210.orig/gcc/reload1.c Fri Jan 31 19:17:29 2003 -+++ gcc-20030210/gcc/reload1.c Sat Feb 22 01:40:14 2003 -@@ -6103,6 +6103,7 @@ - for (j = 0; j < n_reloads; j++) - if (rld[j].in != 0 - && rld[j].when_needed != RELOAD_OTHER -+ && rld[j].when_needed != RELOAD_FOR_OUTPUT_ADDRESS - && reg_overlap_mentioned_for_reload_p (rld[j].in, - rld[i].in)) - rld[j].when_needed -diff -ruN gcc-20030210.orig/gcc/reorg.c gcc-20030210/gcc/reorg.c ---- gcc-20030210.orig/gcc/reorg.c Fri Jan 31 19:17:30 2003 -+++ gcc-20030210/gcc/reorg.c Sat Feb 22 01:40:14 2003 -@@ -3265,6 +3265,14 @@ - || condjump_in_parallel_p (XVECEXP (PATTERN (insn), 0, 0)))) - continue; - -+#ifdef MD_CAN_REDIRECT_BRANCH -+ /* On some targets, branches with delay slots can have a limited -+ displacement. Give the back end a chance to tell us we can't do -+ this. */ -+ if (! MD_CAN_REDIRECT_BRANCH (insn, delay_insn)) -+ continue; -+#endif -+ - target_label = JUMP_LABEL (delay_insn); - - if (target_label) -diff -ruN gcc-20030210.orig/gcc/tree-inline.c gcc-20030210/gcc/tree-inline.c ---- gcc-20030210.orig/gcc/tree-inline.c Fri Jan 31 19:17:33 2003 -+++ gcc-20030210/gcc/tree-inline.c Sat Feb 22 01:40:14 2003 -@@ -836,11 +836,17 @@ - - /* Don't try to inline functions that are not well-suited to - inlining. */ -- if (!inlinable_function_p (fn, id)) -- return NULL_TREE; -+ if (! inlinable_function_p (fn, id) -+ || ! (*lang_hooks.tree_inlining.start_inlining) (fn)) -+ { -+ if (DECL_INLINE (fn) && warn_inline && ! flag_really_no_inline) -+ { -+ warning_with_decl (fn, "inlining failed in call to `%s'"); -+ warning ("called from here"); -+ } - -- if (! (*lang_hooks.tree_inlining.start_inlining) (fn)) -- return NULL_TREE; -+ return NULL_TREE; -+ } - - /* Set the current filename and line number to the function we are - inlining so that when we create new _STMT nodes here they get -diff -ruN gcc-20030210.orig/libjava/Makefile.in gcc-20030210/libjava/Makefile.in ---- gcc-20030210.orig/libjava/Makefile.in Tue Jan 28 10:44:37 2003 -+++ gcc-20030210/libjava/Makefile.in Sat Feb 22 01:40:14 2003 -@@ -1637,6 +1637,7 @@ - "AS=$(AS)" \ - "CC=$(CC)" \ - "CXX=$(CXX)" \ -+ "GCJ=$(GCJ)" \ - "LD=$(LD)" \ - "LIBCFLAGS=$(LIBCFLAGS)" \ - "NM=$(NM)" \ -diff -ruN gcc-20030210.orig/libjava/configure gcc-20030210/libjava/configure ---- gcc-20030210.orig/libjava/configure Tue Jan 28 10:44:37 2003 -+++ gcc-20030210/libjava/configure Sat Feb 22 01:42:11 2003 -@@ -2031,7 +2031,7 @@ - # This must be Linux ELF. - linux-gnu*) - case $host_cpu in -- alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* ) -+ alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | sh* ) - lt_cv_deplibs_check_method=pass_all ;; - *) - # glibc up to 2.1.1 does not perform some relocations on ARM -diff -ruN gcc-20030210.orig/libjava/java/net/natInetAddress.cc gcc-20030210/libjava/java/net/natInetAddress.cc ---- gcc-20030210.orig/libjava/java/net/natInetAddress.cc Tue Mar 5 05:02:19 2002 -+++ gcc-20030210/libjava/java/net/natInetAddress.cc Sat Feb 22 01:40:14 2003 -@@ -56,7 +56,7 @@ - #endif - - #ifndef HAVE_GETHOSTNAME_DECL --extern "C" int gethostname (char *name, int namelen); -+extern "C" int gethostname (char *name, unsigned int namelen); - #endif - - #ifdef DISABLE_JAVA_NET -diff -ruN gcc-20030210.orig/libjava/libltdl/aclocal.m4 gcc-20030210/libjava/libltdl/aclocal.m4 ---- gcc-20030210.orig/libjava/libltdl/aclocal.m4 Sun Sep 10 17:04:40 2000 -+++ gcc-20030210/libjava/libltdl/aclocal.m4 Sat Feb 22 01:40:14 2003 -@@ -573,7 +573,7 @@ - # This must be Linux ELF. - linux-gnu*) - case "$host_cpu" in -- alpha* | i*86 | powerpc* | sparc* | ia64* ) -+ alpha* | i*86 | powerpc* | sparc* | ia64* | sh*) - lt_cv_deplibs_check_method=pass_all ;; - *) - # glibc up to 2.1.1 does not perform some relocations on ARM -diff -ruN gcc-20030210.orig/libjava/sysdep/sh/locks.h gcc-20030210/libjava/sysdep/sh/locks.h ---- gcc-20030210.orig/libjava/sysdep/sh/locks.h Thu Jan 1 09:00:00 1970 -+++ gcc-20030210/libjava/sysdep/sh/locks.h Sat Feb 22 01:40:14 2003 -@@ -0,0 +1,72 @@ -+// locks.h - Thread synchronization primitives. SuperH implementation. -+ -+/* Copyright (C) 2002 Free Software Foundation -+ -+ This file is part of libgcj. -+ -+This software is copyrighted work licensed under the terms of the -+Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -+details. */ -+ -+#ifndef __SYSDEP_LOCKS_H__ -+#define __SYSDEP_LOCKS_H__ -+ -+typedef size_t obj_addr_t; /* Integer type big enough for object */ -+ /* address. */ -+ -+static unsigned char __cas_lock = 0; -+ -+inline static void -+__cas_start_atomic (void) -+{ -+ unsigned int val; -+ -+ do -+ __asm__ __volatile__ ("tas.b @%1; movt %0" -+ : "=r" (val) -+ : "r" (&__cas_lock) -+ : "memory"); -+ while (val == 0); -+} -+ -+inline static void -+__cas_end_atomic (void) -+{ -+ __asm__ __volatile__ (" " : : : "memory"); -+ __cas_lock = 0; -+} -+ -+inline static bool -+compare_and_swap (volatile obj_addr_t *addr, obj_addr_t old, -+ obj_addr_t new_val) -+{ -+ bool ret; -+ -+ __cas_start_atomic (); -+ if (*addr != old) -+ ret = false; -+ else -+ { -+ *addr = new_val; -+ ret = true; -+ } -+ __cas_end_atomic (); -+ -+ return ret; -+} -+ -+inline static void -+release_set (volatile obj_addr_t *addr, obj_addr_t new_val) -+{ -+ __asm__ __volatile__ (" " : : : "memory"); -+ *(addr) = new_val; -+} -+ -+inline static bool -+compare_and_swap_release (volatile obj_addr_t *addr, obj_addr_t old, -+ obj_addr_t new_val) -+{ -+ return compare_and_swap (addr, old, new_val); -+} -+ -+#endif /* ! __SYSDEP_LOCKS_H__ */ -diff -ruN gcc-20030210.orig/libstdc++-v3/acinclude.m4 gcc-20030210/libstdc++-v3/acinclude.m4 ---- gcc-20030210.orig/libstdc++-v3/acinclude.m4 Tue Jan 28 02:30:41 2003 -+++ gcc-20030210/libstdc++-v3/acinclude.m4 Sat Feb 22 01:40:14 2003 -@@ -1828,9 +1828,10 @@ - GLIBCPP_INCLUDES="-I${glibcpp_builddir}/include/${target_alias} -I${glibcpp_builddir}/include" - - # Passed down for canadian crosses. -- if test x"$CANADIAN" = xyes; then -- TOPLEVEL_INCLUDES='-I$(includedir)' -- fi -+ #if test x"$CANADIAN" = xyes; then -+ # TOPLEVEL_INCLUDES='-I$(includedir)' -+ #fi -+ TOPLEVEL_INCLUDES='' - - LIBMATH_INCLUDES='-I$(top_srcdir)/libmath' - -diff -ruN gcc-20030210.orig/libstdc++-v3/aclocal.m4 gcc-20030210/libstdc++-v3/aclocal.m4 ---- gcc-20030210.orig/libstdc++-v3/aclocal.m4 Mon Feb 10 19:36:47 2003 -+++ gcc-20030210/libstdc++-v3/aclocal.m4 Sat Feb 22 01:40:14 2003 -@@ -1840,9 +1840,10 @@ - GLIBCPP_INCLUDES="-I${glibcpp_builddir}/include/${target_alias} -I${glibcpp_builddir}/include" - - # Passed down for canadian crosses. -- if test x"$CANADIAN" = xyes; then -- TOPLEVEL_INCLUDES='-I$(includedir)' -- fi -+ #if test x"$CANADIAN" = xyes; then -+ # TOPLEVEL_INCLUDES='-I$(includedir)' -+ #fi -+ TOPLEVEL_INCLUDES='' - - LIBMATH_INCLUDES='-I$(top_srcdir)/libmath' - -diff -ruN gcc-20030210.orig/libstdc++-v3/configure gcc-20030210/libstdc++-v3/configure ---- gcc-20030210.orig/libstdc++-v3/configure Mon Feb 10 19:37:17 2003 -+++ gcc-20030210/libstdc++-v3/configure Sat Feb 22 01:40:14 2003 -@@ -1982,7 +1982,7 @@ - # This must be Linux ELF. - linux-gnu*) - case $host_cpu in -- alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* ) -+ alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | sh*) - lt_cv_deplibs_check_method=pass_all ;; - *) - # glibc up to 2.1.1 does not perform some relocations on ARM -@@ -22340,9 +22340,10 @@ - GLIBCPP_INCLUDES="-I${glibcpp_builddir}/include/${target_alias} -I${glibcpp_builddir}/include" - - # Passed down for canadian crosses. -- if test x"$CANADIAN" = xyes; then -- TOPLEVEL_INCLUDES='-I$(includedir)' -- fi -+ #if test x"$CANADIAN" = xyes; then -+ # TOPLEVEL_INCLUDES='-I$(includedir)' -+ #fi -+ TOPLEVEL_INCLUDES='' - - LIBMATH_INCLUDES='-I$(top_srcdir)/libmath' - -diff -ruN gcc-20030210.orig/libtool.m4 gcc-20030210/libtool.m4 ---- gcc-20030210.orig/libtool.m4 Fri Jan 31 19:16:59 2003 -+++ gcc-20030210/libtool.m4 Sat Feb 22 01:40:14 2003 -@@ -597,7 +597,7 @@ - # This must be Linux ELF. - linux-gnu*) - case $host_cpu in -- alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* ) -+ alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | sh* ) - lt_cv_deplibs_check_method=pass_all ;; - *) - # glibc up to 2.1.1 does not perform some relocations on ARM -diff -ruN gcc-20030210.orig/zlib/configure gcc-20030210/zlib/configure ---- gcc-20030210.orig/zlib/configure Tue Jan 28 10:44:15 2003 -+++ gcc-20030210/zlib/configure Sat Feb 22 01:40:14 2003 -@@ -1571,7 +1571,7 @@ - # This must be Linux ELF. - linux-gnu*) - case $host_cpu in -- alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* ) -+ alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | sh* ) - lt_cv_deplibs_check_method=pass_all ;; - *) - # glibc up to 2.1.1 does not perform some relocations on ARM diff --git a/patches/gcc/3.2.3/120-sh-linux-1.patch b/patches/gcc/3.2.3/120-sh-linux-1.patch new file mode 100644 index 0000000..4393078 --- /dev/null +++ b/patches/gcc/3.2.3/120-sh-linux-1.patch @@ -0,0 +1,1761 @@ +diff -ruN gcc-20030210.orig/boehm-gc/configure gcc-20030210/boehm-gc/configure +--- gcc-20030210.orig/boehm-gc/configure Fri Jan 31 19:17:00 2003 ++++ gcc-20030210/boehm-gc/configure Sat Feb 22 01:40:14 2003 +@@ -1922,7 +1922,7 @@ + # This must be Linux ELF. + linux-gnu*) + case $host_cpu in +- alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* ) ++ alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | sh* ) + lt_cv_deplibs_check_method=pass_all ;; + *) + # glibc up to 2.1.1 does not perform some relocations on ARM +diff -ruN gcc-20030210.orig/config-ml.in gcc-20030210/config-ml.in +--- gcc-20030210.orig/config-ml.in Fri Jan 31 19:16:59 2003 ++++ gcc-20030210/config-ml.in Sat Feb 22 01:40:14 2003 +@@ -545,6 +545,7 @@ + if [ -d ../$${dir}/$${lib} ]; then \ + flags=`echo $$i | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; \ + if (cd ../$${dir}/$${lib}; $(MAKE) $(FLAGS_TO_PASS) \ ++ DESTDIR="$(DESTDIR)" \ + CFLAGS="$(CFLAGS) $${flags}" \ + prefix="$(prefix)" \ + exec_prefix="$(exec_prefix)" \ +diff -ruN gcc-20030210.orig/debian/edit-specs.in gcc-20030210/debian/edit-specs.in +--- gcc-20030210.orig/debian/edit-specs.in Thu Jan 1 09:00:00 1970 ++++ gcc-20030210/debian/edit-specs.in Sat Feb 22 01:40:14 2003 +@@ -0,0 +1,45 @@ ++/^*asm:$/ { ++n ++c\ ++@AS_ENDIAN_FLAG@ %{mrelax:-relax} ++} ++/^*cpp:$/ { ++n ++c\ ++%(cpp_default_cpu_spec) %(subtarget_cpp_spec) %(subtarget_cpp_ptr_spec) %(subtarget_cpp_endian_spec) ++} ++/^*cc1:$/ { ++n ++c\ ++-musermode @CC1_CPU_ENDIAN_FLAGS@ %{profile:-p} ++} ++/^*link:$/ { ++n ++c\ ++%{!static:--eh-frame-hdr} @LINKER_CPU_ENDIAN_FLAGS@ @LINKER_RPATH_LINK_FLAG@ %{mrelax:-relax} %{shared:-shared} %{!static: %{rdynamic:-export-dynamic} %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} %{static:-static} ++} ++/^*multilib:$/ { ++n ++c\ ++. ; ++} ++/^*multilib_matches:$/ { ++n ++c\ ++ ++} ++/^*multilib_options:$/ { ++n ++c\ ++ ++} ++/^*subtarget_cpp_endian_spec:$/ { ++n ++c\ ++@CPP_ENDIAN_DEF@ ++} ++/^*cpp_default_cpu_spec:$/ { ++n ++c\ ++@CPP_CPU_DEFS@ ++} +diff -ruN gcc-20030210.orig/debian/install-CPU-linux gcc-20030210/debian/install-CPU-linux +--- gcc-20030210.orig/debian/install-CPU-linux Thu Jan 1 09:00:00 1970 ++++ gcc-20030210/debian/install-CPU-linux Sat Feb 22 01:40:14 2003 +@@ -0,0 +1,111 @@ ++#! /bin/sh ++ ++VERSION=$1; shift ++CPU=$1 ++ ++# literally (binary-ly) same ++PROGS_C="cpp gcc" ++PROGS_ADDITIONAL="c++ g++ g77 gcj" ++ ++DRIVERS_C="cc1 cpp0 tradcpp0" ++DRIVERS_ADDITIONAL="cc1obj cc1plus collect2 f771 jc1 jvgenmain" ++if [ -z "$STEP1_COMPILER_BUILD" ]; then ++ PROGS="$PROGS_C $PROGS_ADDITIONAL" ++ DRIVERS="$DRIVERS_C $DRIVERSADDITIONAL" ++ INITIAL="" ++else ++ PROGS=$PROGS_C ++ DRIVERS=$DRIVERS_C ++ INITIAL="-initial" ++fi ++ ++OBJS="crtbegin.o crtbeginS.o crtend.o crtendS.o" ++LIBS_C="libgcc.a" ++LIBS_1="libgcc_s.so libgcc_s.so.1 libstdc++.so libstdc++.so.3 libstdc++.so.3.0.2" ++LIBS_2="libobjc.a libstdc++.a libsupc++.a" ++INCLUDE="include" ++ ++cd debian/gcc-sh-linux-others${INITIAL} || exit 1 ++ ++# Make directories. ++mkdir -p usr/bin usr/share usr/share/man usr/share/man/man1 usr/lib \ ++ usr/lib/gcc-lib usr/lib/gcc-lib/${CPU}-linux \ ++ usr/lib/gcc-lib/${CPU}-linux/${VERSION} \ ++ usr/${CPU}-linux usr/${CPU}-linux/lib ++ ++# Make symbolic links for include dir. ++(cd usr/${CPU}-linux; ln -s ../sh-linux/include .) ++ ++# Make symbolic links for executables. ++(cd usr/bin; ++ for p in ${PROGS}; do ++ ln -s shCPU-linux-GCC ${CPU}-linux-$p ++ done) ++ ++case "${CPU}" in ++ sh3) ++ MULTILIBDIR= ++ AS_ENDIAN_FLAG="-little" ++ CPP_ENDIAN_DEF="-D__LITTLE_ENDIAN__" ++ CPP_CPU_DEFS="-D__SH3__ -D__sh3__" ++ CC1_CPU_ENDIAN_FLAGS="-ml -m3" ++ LINKER_CPU_ENDIAN_FLAGS="-m shlelf_linux -EL --architecture sh3" ++ LINKER_RPATH_LINK_FLAG="-rpath-link /usr/sh3-linux/lib" ++ ;; ++ sh3eb) ++ MULTILIBDIR=/mb ++ AS_ENDIAN_FLAG="-big" ++ CPP_ENDIAN_DEF="-D__BIG_ENDIAN__" ++ CPP_CPU_DEFS="-D__SH3__ -D__sh3__" ++ CC1_CPU_ENDIAN_FLAGS="-mb -m3" ++ LINKER_CPU_ENDIAN_FLAGS="-m shelf_linux -EB --architecture sh3" ++ LINKER_RPATH_LINK_FLAG="-rpath-link /usr/sh3eb-linux/lib" ++ ;; ++ sh4) ++ MULTILIBDIR=/m4 ++ AS_ENDIAN_FLAG="-little" ++ CPP_ENDIAN_DEF="-D__LITTLE_ENDIAN__" ++ CPP_CPU_DEFS="-D__SH4__" ++ CC1_CPU_ENDIAN_FLAGS="-ml -m4" ++ LINKER_CPU_ENDIAN_FLAGS="-m shlelf_linux -EL --architecture sh4" ++ LINKER_RPATH_LINK_FLAG="-rpath-link /usr/sh4-linux/lib" ++ ;; ++ sh4eb) ++ MULTILIBDIR=/mb/m4 ++ AS_ENDIAN_FLAG="-big" ++ CPP_ENDIAN_DEF="-D__BIG_ENDIAN__" ++ CPP_CPU_DEFS="-D__SH4__" ++ CC1_CPU_ENDIAN_FLAGS="-mb -m4" ++ LINKER_CPU_ENDIAN_FLAGS="-m shelf_linux -EB --architecture sh4" ++ LINKER_RPATH_LINK_FLAG="-rpath-link /usr/sh4eb-linux/lib" ++ ;; ++esac ++ ++# Make symbolic links for GCC drivers, objects, libraries, and include dir. ++(cd usr/lib/gcc-lib/${CPU}-linux/${VERSION}; ++ for f in ${DRIVERS} ${INCLUDE}; do ++ ln -s ../../sh-linux/${VERSION}/$f $f; ++ done ++ for f in ${OBJS} ${LIBS_C}; do ++ ln -s ../../sh-linux/${VERSION}${MULTILIBDIR}/$f $f; ++ done) ++ ++if [ -z "$STEP1_COMPILER_BUILD" ]; then ++ for f in ${LIBS_1} ${LIBS_2}; do ++ mv ../gcc-sh-linux/usr/sh-linux/lib${MULTILIBDIR}/$f usr/${CPU}-linux/lib/; ++ done ++fi ++ ++sed -e "s+@AS_ENDIAN_FLAG@+${AS_ENDIAN_FLAG}+" \ ++ -e "s+@CPP_ENDIAN_DEF@+${CPP_ENDIAN_DEF}+" \ ++ -e "s+@CPP_CPU_DEFS@+${CPP_CPU_DEFS}+" \ ++ -e "s+@CC1_CPU_ENDIAN_FLAGS@+${CC1_CPU_ENDIAN_FLAGS}+" \ ++ -e "s+@LINKER_CPU_ENDIAN_FLAGS@+${LINKER_CPU_ENDIAN_FLAGS}+" \ ++ -e "s+@LINKER_RPATH_LINK_FLAG@+${LINKER_RPATH_LINK_FLAG}+" \ ++ ../edit-specs.in >../edit-specs-${CPU}.sed ++ ++sed -f ../edit-specs-${CPU}.sed \ ++ ../gcc-sh-linux${INITIAL}/usr/lib/gcc-lib/sh-linux/${VERSION}/specs \ ++ > usr/lib/gcc-lib/${CPU}-linux/${VERSION}/specs ++ ++exit 0 +diff -ruN gcc-20030210.orig/debian/multilib-symlink gcc-20030210/debian/multilib-symlink +--- gcc-20030210.orig/debian/multilib-symlink Thu Jan 1 09:00:00 1970 ++++ gcc-20030210/debian/multilib-symlink Sat Feb 22 01:40:14 2003 +@@ -0,0 +1,10 @@ ++#! /bin/sh ++ ++cd /usr/sh-linux/lib ++ln -s ../../sh3-linux/lib/{*.a,*.so*,*.o} . ++cd m4 ++ln -s ../../../sh4-linux/lib/{*.a,*.so*,*.o} . ++cd ../mb ++ln -s ../../../sh3eb-linux/lib/{*.a,*.so*,*.o} . ++cd m4 ++ln -s ../../../../sh4eb-linux/lib/{*.a,*.so*,*.o} . +diff -ruN gcc-20030210.orig/debian/shCPU-linux-GCC gcc-20030210/debian/shCPU-linux-GCC +--- gcc-20030210.orig/debian/shCPU-linux-GCC Thu Jan 1 09:00:00 1970 ++++ gcc-20030210/debian/shCPU-linux-GCC Sat Feb 22 01:40:14 2003 +@@ -0,0 +1,59 @@ ++#! /bin/bash ++ ++BASENAME=${0##*/} ++PROG=${BASENAME##*-} ++CPU=${BASENAME%%-*} ++ ++if [ "$PROG" = gcc ]; then ++ if [ "$1" = "-b" -a "$2" = "i386-linux" ]; then ++ shift 2 ++ exec /usr/bin/gcc "$@" ++ elif [ "$1" = "-print-multi-lib" -o "$1" = "--print-multi-lib" ]; then ++ echo ".;" ++ exit 0 ++ elif [ "$1" = "-print-multi-os-directory" -o "$1" = "--print-multi-os-directory" ]; then ++ echo "." ++ exit 0 ++ elif [ "$1" = "-dumpspecs" ]; then ++ cat /usr/lib/gcc-lib/${CPU}-linux/@@VERSION@@/specs ++ exit 0 ++ fi ++fi ++ ++case "${CPU}" in ++ sh3) ++ ARCH=m3 ++ DEFINES="-D__sh3__ -D__SH3__ -D__LITTLE_ENDIAN__" ++ ENDIAN=ml ++ ;; ++ sh3eb) ++ ARCH=m3 ++ DEFINES="-D__sh3__ -D__SH3__ -D__BIG_ENDIAN__" ++ ENDIAN=mb ++ ;; ++ sh4) ++ ARCH=m4 ++ DEFINES="-D__SH4__ -D__LITTLE_ENDIAN__" ++ ENDIAN=ml ++ ;; ++ sh4eb) ++ ARCH=m4 ++ DEFINES="-D__SH4__ -D__BIG_ENDIAN__" ++ ENDIAN=mb ++ ;; ++esac ++ ++# Prepend the appropriate options ++# If user specifies some options, it will be overridden ++ ++case "${PROG}" in ++ cpp) ++ exec sh-linux-${PROG} $DEFINES "$@" ++ ;; ++ c++|g++|g77|gcc|gcj) ++ exec sh-linux-${PROG} -$ARCH -$ENDIAN "$@" ++ ;; ++esac ++ ++echo "Something wrong..." ++exit 1 +diff -ruN gcc-20030210.orig/gcc/config/sh/elf.h gcc-20030210/gcc/config/sh/elf.h +--- gcc-20030210.orig/gcc/config/sh/elf.h Fri Feb 22 01:42:28 2002 ++++ gcc-20030210/gcc/config/sh/elf.h Sat Feb 22 01:40:14 2003 +@@ -170,3 +170,7 @@ + #undef ENDFILE_SPEC + #define ENDFILE_SPEC \ + "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s" ++ ++/* ASM_OUTPUT_CASE_LABEL is defined in elfos.h. With it, ++ redundant .align will be generated. */ ++#undef ASM_OUTPUT_CASE_LABEL +diff -ruN gcc-20030210.orig/gcc/config/sh/lib1funcs.asm gcc-20030210/gcc/config/sh/lib1funcs.asm +--- gcc-20030210.orig/gcc/config/sh/lib1funcs.asm Fri Feb 22 01:42:28 2002 ++++ gcc-20030210/gcc/config/sh/lib1funcs.asm Sat Feb 22 01:40:14 2003 +@@ -39,8 +39,13 @@ + + #ifdef __ELF__ + #define LOCAL(X) .L_##X ++#define FUNC(X) .type X,@function; .hidden X ++#define _ENDFUNC(X) .Lfe_##X: .size X,.Lfe_##X-X ++#define ENDFUNC(X) _ENDFUNC(X) + #else + #define LOCAL(X) L_##X ++#define FUNC(X) ++#define ENDFUNC(X) + #endif + + #ifdef __linux__ +@@ -91,6 +96,40 @@ + .global GLOBAL(ashiftrt_r4_31) + .global GLOBAL(ashiftrt_r4_32) + ++ FUNC(GLOBAL(ashiftrt_r4_0)) ++ FUNC(GLOBAL(ashiftrt_r4_1)) ++ FUNC(GLOBAL(ashiftrt_r4_2)) ++ FUNC(GLOBAL(ashiftrt_r4_3)) ++ FUNC(GLOBAL(ashiftrt_r4_4)) ++ FUNC(GLOBAL(ashiftrt_r4_5)) ++ FUNC(GLOBAL(ashiftrt_r4_6)) ++ FUNC(GLOBAL(ashiftrt_r4_7)) ++ FUNC(GLOBAL(ashiftrt_r4_8)) ++ FUNC(GLOBAL(ashiftrt_r4_9)) ++ FUNC(GLOBAL(ashiftrt_r4_10)) ++ FUNC(GLOBAL(ashiftrt_r4_11)) ++ FUNC(GLOBAL(ashiftrt_r4_12)) ++ FUNC(GLOBAL(ashiftrt_r4_13)) ++ FUNC(GLOBAL(ashiftrt_r4_14)) ++ FUNC(GLOBAL(ashiftrt_r4_15)) ++ FUNC(GLOBAL(ashiftrt_r4_16)) ++ FUNC(GLOBAL(ashiftrt_r4_17)) ++ FUNC(GLOBAL(ashiftrt_r4_18)) ++ FUNC(GLOBAL(ashiftrt_r4_19)) ++ FUNC(GLOBAL(ashiftrt_r4_20)) ++ FUNC(GLOBAL(ashiftrt_r4_21)) ++ FUNC(GLOBAL(ashiftrt_r4_22)) ++ FUNC(GLOBAL(ashiftrt_r4_23)) ++ FUNC(GLOBAL(ashiftrt_r4_24)) ++ FUNC(GLOBAL(ashiftrt_r4_25)) ++ FUNC(GLOBAL(ashiftrt_r4_26)) ++ FUNC(GLOBAL(ashiftrt_r4_27)) ++ FUNC(GLOBAL(ashiftrt_r4_28)) ++ FUNC(GLOBAL(ashiftrt_r4_29)) ++ FUNC(GLOBAL(ashiftrt_r4_30)) ++ FUNC(GLOBAL(ashiftrt_r4_31)) ++ FUNC(GLOBAL(ashiftrt_r4_32)) ++ + .align 1 + GLOBAL(ashiftrt_r4_32): + GLOBAL(ashiftrt_r4_31): +@@ -170,6 +209,41 @@ + GLOBAL(ashiftrt_r4_0): + rts + nop ++ ++ ENDFUNC(GLOBAL(ashiftrt_r4_0)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_1)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_2)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_3)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_4)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_5)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_6)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_7)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_8)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_9)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_10)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_11)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_12)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_13)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_14)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_15)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_16)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_17)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_18)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_19)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_20)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_21)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_22)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_23)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_24)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_25)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_26)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_27)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_28)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_29)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_30)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_31)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_32)) ++ + #endif + + #ifdef L_ashiftrt_n +@@ -192,6 +266,7 @@ + ! + + .global GLOBAL(ashrsi3) ++ FUNC(GLOBAL(ashrsi3)) + .align 2 + GLOBAL(ashrsi3): + mov #31,r0 +@@ -319,6 +394,8 @@ + rts + nop + ++ ENDFUNC(GLOBAL(ashrsi3)) ++ + #endif + + #ifdef L_ashiftlt +@@ -340,6 +417,7 @@ + ! (none) + ! + .global GLOBAL(ashlsi3) ++ FUNC(GLOBAL(ashlsi3)) + .align 2 + GLOBAL(ashlsi3): + mov #31,r0 +@@ -476,6 +554,8 @@ + rts + nop + ++ ENDFUNC(GLOBAL(ashlsi3)) ++ + #endif + + #ifdef L_lshiftrt +@@ -497,6 +577,7 @@ + ! (none) + ! + .global GLOBAL(lshrsi3) ++ FUNC(GLOBAL(lshrsi3)) + .align 2 + GLOBAL(lshrsi3): + mov #31,r0 +@@ -633,6 +714,8 @@ + rts + nop + ++ ENDFUNC(GLOBAL(lshrsi3)) ++ + #endif + + #ifdef L_movstr +@@ -649,76 +732,113 @@ + add #64,r4 + .align 4 + .global GLOBAL(movstrSI64) ++ FUNC(GLOBAL(movstrSI64)) + GLOBAL(movstrSI64): + mov.l @(60,r5),r0 + mov.l r0,@(60,r4) + .global GLOBAL(movstrSI60) ++ FUNC(GLOBAL(movstrSI60)) + GLOBAL(movstrSI60): + mov.l @(56,r5),r0 + mov.l r0,@(56,r4) + .global GLOBAL(movstrSI56) ++ FUNC(GLOBAL(movstrSI56)) + GLOBAL(movstrSI56): + mov.l @(52,r5),r0 + mov.l r0,@(52,r4) + .global GLOBAL(movstrSI52) ++ FUNC(GLOBAL(movstrSI52)) + GLOBAL(movstrSI52): + mov.l @(48,r5),r0 + mov.l r0,@(48,r4) + .global GLOBAL(movstrSI48) ++ FUNC(GLOBAL(movstrSI48)) + GLOBAL(movstrSI48): + mov.l @(44,r5),r0 + mov.l r0,@(44,r4) + .global GLOBAL(movstrSI44) ++ FUNC(GLOBAL(movstrSI44)) + GLOBAL(movstrSI44): + mov.l @(40,r5),r0 + mov.l r0,@(40,r4) + .global GLOBAL(movstrSI40) ++ FUNC(GLOBAL(movstrSI40)) + GLOBAL(movstrSI40): + mov.l @(36,r5),r0 + mov.l r0,@(36,r4) + .global GLOBAL(movstrSI36) ++ FUNC(GLOBAL(movstrSI36)) + GLOBAL(movstrSI36): + mov.l @(32,r5),r0 + mov.l r0,@(32,r4) + .global GLOBAL(movstrSI32) ++ FUNC(GLOBAL(movstrSI32)) + GLOBAL(movstrSI32): + mov.l @(28,r5),r0 + mov.l r0,@(28,r4) + .global GLOBAL(movstrSI28) ++ FUNC(GLOBAL(movstrSI28)) + GLOBAL(movstrSI28): + mov.l @(24,r5),r0 + mov.l r0,@(24,r4) + .global GLOBAL(movstrSI24) ++ FUNC(GLOBAL(movstrSI24)) + GLOBAL(movstrSI24): + mov.l @(20,r5),r0 + mov.l r0,@(20,r4) + .global GLOBAL(movstrSI20) ++ FUNC(GLOBAL(movstrSI20)) + GLOBAL(movstrSI20): + mov.l @(16,r5),r0 + mov.l r0,@(16,r4) + .global GLOBAL(movstrSI16) ++ FUNC(GLOBAL(movstrSI16)) + GLOBAL(movstrSI16): + mov.l @(12,r5),r0 + mov.l r0,@(12,r4) + .global GLOBAL(movstrSI12) ++ FUNC(GLOBAL(movstrSI12)) + GLOBAL(movstrSI12): + mov.l @(8,r5),r0 + mov.l r0,@(8,r4) + .global GLOBAL(movstrSI8) ++ FUNC(GLOBAL(movstrSI8)) + GLOBAL(movstrSI8): + mov.l @(4,r5),r0 + mov.l r0,@(4,r4) + .global GLOBAL(movstrSI4) ++ FUNC(GLOBAL(movstrSI4)) + GLOBAL(movstrSI4): + mov.l @(0,r5),r0 + mov.l r0,@(0,r4) ++ .global GLOBAL(movstrSI0) ++ FUNC(GLOBAL(movstrSI0)) + GLOBAL(movstrSI0): + rts + nop + ++ ENDFUNC(GLOBAL(movstrSI64)) ++ ENDFUNC(GLOBAL(movstrSI60)) ++ ENDFUNC(GLOBAL(movstrSI56)) ++ ENDFUNC(GLOBAL(movstrSI52)) ++ ENDFUNC(GLOBAL(movstrSI48)) ++ ENDFUNC(GLOBAL(movstrSI44)) ++ ENDFUNC(GLOBAL(movstrSI40)) ++ ENDFUNC(GLOBAL(movstrSI36)) ++ ENDFUNC(GLOBAL(movstrSI32)) ++ ENDFUNC(GLOBAL(movstrSI28)) ++ ENDFUNC(GLOBAL(movstrSI24)) ++ ENDFUNC(GLOBAL(movstrSI20)) ++ ENDFUNC(GLOBAL(movstrSI16)) ++ ENDFUNC(GLOBAL(movstrSI12)) ++ ENDFUNC(GLOBAL(movstrSI8)) ++ ENDFUNC(GLOBAL(movstrSI4)) ++ ENDFUNC(GLOBAL(movstrSI0)) ++ + .align 4 + + .global GLOBAL(movstr) ++ FUNC(GLOBAL(movstr)) + GLOBAL(movstr): + mov.l @(60,r5),r0 + mov.l r0,@(60,r4) +@@ -775,6 +895,8 @@ + add #64,r5 + bra GLOBAL(movstr) + add #64,r4 ++ ++ FUNC(GLOBAL(movstr)) + #endif + + #ifdef L_movstr_i4 +@@ -783,6 +905,10 @@ + .global GLOBAL(movstr_i4_odd) + .global GLOBAL(movstrSI12_i4) + ++ FUNC(GLOBAL(movstr_i4_even)) ++ FUNC(GLOBAL(movstr_i4_odd)) ++ FUNC(GLOBAL(movstrSI12_i4)) ++ + .p2align 5 + L_movstr_2mod4_end: + mov.l r0,@(16,r4) +@@ -791,6 +917,11 @@ + + .p2align 2 + ++GLOBAL(movstr_i4_even): ++ mov.l @r5+,r0 ++ bra L_movstr_start_even ++ mov.l @r5+,r1 ++ + GLOBAL(movstr_i4_odd): + mov.l @r5+,r1 + add #-4,r4 +@@ -817,10 +948,8 @@ + rts + mov.l r3,@(12,r4) + +-GLOBAL(movstr_i4_even): +- mov.l @r5+,r0 +- bra L_movstr_start_even +- mov.l @r5+,r1 ++ ENDFUNC(GLOBAL(movstr_i4_even)) ++ ENDFUNC(GLOBAL(movstr_i4_odd)) + + .p2align 4 + GLOBAL(movstrSI12_i4): +@@ -831,12 +960,16 @@ + mov.l r1,@(4,r4) + rts + mov.l r2,@(8,r4) ++ ++ ENDFUNC(GLOBAL(movstrSI12_i4)) ++ + #endif + + #ifdef L_mulsi3 + + + .global GLOBAL(mulsi3) ++ FUNC(GLOBAL(mulsi3)) + + ! r4 = aabb + ! r5 = ccdd +@@ -869,7 +1002,7 @@ + rts + add r2,r0 + +- ++ FUNC(GLOBAL(mulsi3)) + #endif + #endif /* ! __SH5__ */ + #ifdef L_sdivsi3_i4 +@@ -879,6 +1012,7 @@ + !! args in r4 and r5, result in fpul, clobber dr0, dr2 + + .global GLOBAL(sdivsi3_i4) ++ FUNC(GLOBAL(sdivsi3_i4)) + GLOBAL(sdivsi3_i4): + lds r4,fpul + float fpul,dr0 +@@ -888,6 +1022,8 @@ + rts + ftrc dr0,fpul + ++ ENDFUNC(GLOBAL(sdivsi3_i4)) ++ + #elif defined(__SH4_SINGLE__) || defined(__SH4_SINGLE_ONLY__) || (defined (__SH5__) && ! defined __SH4_NOFPU__) + !! args in r4 and r5, result in fpul, clobber r2, dr0, dr2 + +@@ -896,6 +1032,7 @@ + .mode SHcompact + #endif + .global GLOBAL(sdivsi3_i4) ++ FUNC(GLOBAL(sdivsi3_i4)) + GLOBAL(sdivsi3_i4): + sts.l fpscr,@-r15 + mov #8,r2 +@@ -910,6 +1047,8 @@ + rts + lds.l @r15+,fpscr + ++ ENDFUNC(GLOBAL(sdivsi3_i4)) ++ + #endif /* ! __SH5__ || __SH5__ == 32 */ + #endif /* ! __SH4__ */ + #endif +@@ -924,9 +1063,10 @@ + !! + !! + +-!! args in r4 and r5, result in r0 clobber r1,r2,r3 ++!! args in r4 and r5, result in r0 clobber r1, r2, r3, and t bit + + .global GLOBAL(sdivsi3) ++ FUNC(GLOBAL(sdivsi3)) + #if __SHMEDIA__ + #if __SH5__ == 32 + .section .text..SHmedia32,"ax" +@@ -1076,6 +1216,7 @@ + div0: rts + mov #0,r0 + ++ ENDFUNC(GLOBAL(sdivsi3)) + #endif /* ! __SHMEDIA__ */ + #endif /* ! __SH4__ */ + #endif +@@ -1084,9 +1225,11 @@ + .title "SH DIVIDE" + !! 4 byte integer Divide code for the Hitachi SH + #ifdef __SH4__ +-!! args in r4 and r5, result in fpul, clobber r0, r1, r4, r5, dr0, dr2, dr4 ++!! args in r4 and r5, result in fpul, clobber r0, r1, r4, r5, dr0, dr2, dr4, ++!! and t bit + + .global GLOBAL(udivsi3_i4) ++ FUNC(GLOBAL(udivsi3_i4)) + GLOBAL(udivsi3_i4): + mov #1,r1 + cmp/hi r1,r5 +@@ -1127,6 +1270,8 @@ + L1: + .double 2147483648 + ++ ENDFUNC(GLOBAL(udivsi3_i4)) ++ + #elif defined(__SH4_SINGLE__) || defined(__SH4_SINGLE_ONLY__) || (defined (__SH5__) && ! defined __SH4_NOFPU__) + !! args in r4 and r5, result in fpul, clobber r0, r1, r4, r5, dr0, dr2, dr4 + +@@ -1135,6 +1280,7 @@ + .mode SHcompact + #endif + .global GLOBAL(udivsi3_i4) ++ FUNC(GLOBAL(udivsi3_i4)) + GLOBAL(udivsi3_i4): + mov #1,r1 + cmp/hi r1,r5 +@@ -1183,6 +1329,8 @@ + #endif + .double 2147483648 + ++ ENDFUNC(GLOBAL(udivsi3_i4)) ++ + #endif /* ! __SH5__ || __SH5__ == 32 */ + #endif /* ! __SH4__ */ + #endif +@@ -1199,6 +1347,7 @@ + + !! args in r4 and r5, result in r0, clobbers r4, pr, and t bit + .global GLOBAL(udivsi3) ++ FUNC(GLOBAL(udivsi3)) + + #if __SHMEDIA__ + #if __SH5__ == 32 +@@ -1299,6 +1448,8 @@ + ret: rts + mov r4,r0 + ++ ENDFUNC(GLOBAL(udivsi3)) ++ + #endif /* ! __SHMEDIA__ */ + #endif /* __SH4__ */ + #endif +@@ -1308,6 +1459,7 @@ + .mode SHcompact + #endif + .global GLOBAL(set_fpscr) ++ FUNC(GLOBAL(set_fpscr)) + GLOBAL(set_fpscr): + lds r4,fpscr + mov.l LOCAL(set_fpscr_L1),r1 +@@ -1340,11 +1492,16 @@ + .align 2 + LOCAL(set_fpscr_L1): + .long GLOBAL(fpscr_values) ++ ++ ENDFUNC(GLOBAL(set_fpscr)) ++ ++#ifndef NO_FPSCR_VALUES + #ifdef __ELF__ + .comm GLOBAL(fpscr_values),8,4 + #else + .comm GLOBAL(fpscr_values),8 + #endif /* ELF */ ++#endif /* NO_FPSCR_VALUES */ + #endif /* SH3E / SH4 */ + #endif /* L_set_fpscr */ + #ifdef L_ic_invalidate +@@ -1360,6 +1517,7 @@ + blink tr0, r63 + #elif defined(__SH4_SINGLE__) || defined(__SH4__) || defined(__SH4_SINGLE_ONLY__) + .global GLOBAL(ic_invalidate) ++ FUNC(GLOBAL(ic_invalidate)) + GLOBAL(ic_invalidate): + ocbwb @r4 + mova 0f,r0 +@@ -1382,6 +1540,9 @@ + nop + .endr + .endr ++ ++ ENDFUNC(GLOBAL(ic_invalidate)) ++ + #endif /* SH4 */ + #endif /* L_ic_invalidate */ + +diff -ruN gcc-20030210.orig/gcc/config/sh/libgcc-glibc.ver gcc-20030210/gcc/config/sh/libgcc-glibc.ver +--- gcc-20030210.orig/gcc/config/sh/libgcc-glibc.ver Thu Jan 1 09:00:00 1970 ++++ gcc-20030210/gcc/config/sh/libgcc-glibc.ver Sat Feb 22 01:40:14 2003 +@@ -0,0 +1,21 @@ ++# In order to work around the very problems that force us to now generally ++# create a libgcc.so, glibc reexported a number of routines from libgcc.a. ++# By now choosing the same version tags for these specific routines, we ++# maintain enough binary compatibility to allow future versions of glibc ++# to defer implementation of these routines to libgcc.so via DT_AUXILIARY. ++ ++# Note that we cannot use the default libgcc-glibc.ver file on sh, ++# because GLIBC_2.0 does not exist on this architecture, as the first ++# ever glibc release on the platform was GLIBC_2.2. ++ ++%inherit GCC_3.0 GLIBC_2.2 ++GLIBC_2.2 { ++ __register_frame ++ __register_frame_table ++ __deregister_frame ++ __register_frame_info ++ __deregister_frame_info ++ __frame_state_for ++ __register_frame_info_table ++} ++ +diff -ruN gcc-20030210.orig/gcc/config/sh/linux.h gcc-20030210/gcc/config/sh/linux.h +--- gcc-20030210.orig/gcc/config/sh/linux.h Tue Apr 16 05:27:42 2002 ++++ gcc-20030210/gcc/config/sh/linux.h Sat Feb 22 01:40:14 2003 +@@ -19,6 +19,10 @@ + the Free Software Foundation, 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + ++/* We're not SYSVR4, not having /usr/ccs */ ++#undef MD_EXEC_PREFIX ++#undef MD_STARTFILE_PREFIX ++ + /* Run-time Target Specification. */ + #undef TARGET_VERSION + #define TARGET_VERSION fputs (" (SH GNU/Linux with ELF)", stderr); +@@ -39,6 +43,28 @@ + #undef WCHAR_TYPE_SIZE + #define WCHAR_TYPE_SIZE BITS_PER_WORD + ++/* This was defined in linux.h. Define it here also. */ ++#undef DEFAULT_VTABLE_THUNKS ++#define DEFAULT_VTABLE_THUNKS 1 ++ ++/* Likewise. */ ++#define HANDLE_PRAGMA_PACK_PUSH_POP ++ ++/* Pick up the return address upon entry to a procedure. Used for ++ dwarf2 unwind information. This also enables the table driven ++ mechanism. */ ++ ++#define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (Pmode, PR_REG) ++#define DWARF_FRAME_RETURN_COLUMN DWARF_FRAME_REGNUM (PR_REG) ++ ++#undef CPP_SPEC ++#define CPP_SPEC "\ ++ %{m4:-D__SH4__} \ ++ %{!m4:%(cpp_default_cpu_spec)} \ ++ %(subtarget_cpp_spec) \ ++ %(subtarget_cpp_ptr_spec) \ ++ %(subtarget_cpp_endian_spec) " ++ + #undef SUBTARGET_CPP_SPEC + #define SUBTARGET_CPP_SPEC "\ + %{fPIC:-D__PIC__ -D__pic__} \ +@@ -55,36 +81,45 @@ + #undef CPP_DEFAULT_CPU_SPEC + #define CPP_DEFAULT_CPU_SPEC "-D__SH3__ -D__sh3__" + +- + #undef CPP_PREDEFINES + #define CPP_PREDEFINES "-D__ELF__ -Dunix -D__sh__ -D__gnu_linux__ -Dlinux -Asystem=posix" + ++/* The GNU C++ standard library requires that these macros be defined. */ ++#undef CPLUSPLUS_CPP_SPEC ++#define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)" ++ + #undef ASM_SPEC +-#define ASM_SPEC "%{!mb:-little} %{mrelax:-relax}" ++#define ASM_SPEC "%{mb:-big} %{!mb:-little} %{mrelax:-relax}" + + #undef CC1_SPEC + #define CC1_SPEC \ +- "-musermode %{!mb:-ml} %{!m3e:%{!m4:-m3}}" +- +-#undef CC1PLUS_SPEC +-#define CC1PLUS_SPEC \ +- "-musermode %{!mb:-ml} %{!m3e:%{!m4:-m3}}" ++ "-musermode %{!mb:-ml} %{!m4:-m3} %{profile:-p}" + ++/* XXX: It's wrong if prefix != /usr */ + #undef LINK_SPEC + #define LINK_SPEC \ +- "%{!mb:-m shlelf_linux} %{mrelax:-relax} \ ++ "%{!mb:-m shlelf_linux -EL} %{mb:-m shelf_linux -EB} %{mrelax:-relax} \ + %{shared:-shared} \ + %{!static: \ + %{rdynamic:-export-dynamic} \ + %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2} \ +- %{!rpath:-rpath /lib}} \ ++ %{!mb:%{!m4:-rpath-link /usr/sh-linux/lib }} \ ++ %{!mb:%{m4:-rpath-link /usr/sh-linux/lib/m4 }} \ ++ %{mb:%{!m4:-rpath-link /usr/sh-linux/lib/mb }} \ ++ %{mb:%{m4:-rpath-link /usr/sh-linux/lib/mb/m4 }}} \ + %{static:-static}" + + #undef LIB_SPEC ++#undef LIB_SPEC + #define LIB_SPEC \ + "%{shared: -lc} \ +- %{!shared: %{pthread:-lthread} \ +- %{profile:-lc_p} %{!profile: -lc}}" ++ %{!shared: %{mieee:-lieee} %{pthread:-lpthread} \ ++ %{profile:-lc_p} %{!profile: -lc}}" ++ ++#if defined(HAVE_LD_EH_FRAME_HDR) ++#undef LINK_EH_SPEC ++#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} " ++#endif + + #undef STARTFILE_SPEC + #define STARTFILE_SPEC \ +@@ -92,4 +127,40 @@ + %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \ + %{!p:%{profile:gcrt1.o%s} \ + %{!profile:crt1.o%s}}}} \ +- crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}" ++ crti.o%s %{static:crtbeginT.o%s}\ ++ %{!static:%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}}" ++ ++#undef FUNCTION_PROFILER ++#define FUNCTION_PROFILER(STREAM,LABELNO) \ ++do \ ++{ \ ++ if (flag_pic) \ ++ { \ ++ fprintf (STREAM, " mov.l 3f,r1\n"); \ ++ fprintf (STREAM, " mova 3f,r0\n"); \ ++ fprintf (STREAM, " add r1,r0\n"); \ ++ fprintf (STREAM, " mov.l 1f,r1\n"); \ ++ fprintf (STREAM, " mov.l @(r0,r1),r1\n"); \ ++ } \ ++ else \ ++ { \ ++ fprintf (STREAM, " mov.l 1f,r1\n"); \ ++ } \ ++ fprintf (STREAM, " sts.l pr,@-r15\n"); \ ++ fprintf (STREAM, " mova 2f,r0\n"); \ ++ fprintf (STREAM, " jmp @r1\n"); \ ++ fprintf (STREAM, " lds r0,pr\n"); \ ++ fprintf (STREAM, " .align 2\n"); \ ++ if (flag_pic) \ ++ { \ ++ fprintf (STREAM, "1: .long mcount@GOT\n"); \ ++ fprintf (STREAM, "3: .long _GLOBAL_OFFSET_TABLE_\n"); \ ++ } \ ++ else \ ++ { \ ++ fprintf (STREAM, "1: .long mcount\n"); \ ++ } \ ++ fprintf (STREAM, "2: lds.l @r15+,pr\n"); \ ++} while (0) ++ ++#define NO_SHARED_LIBGCC_MULTILIB +diff -ruN gcc-20030210.orig/gcc/config/sh/sh-protos.h gcc-20030210/gcc/config/sh/sh-protos.h +--- gcc-20030210.orig/gcc/config/sh/sh-protos.h Fri Feb 22 01:42:28 2002 ++++ gcc-20030210/gcc/config/sh/sh-protos.h Sat Feb 22 01:40:14 2003 +@@ -74,6 +74,7 @@ + extern int shl_sext_length PARAMS ((rtx)); + extern int gen_shl_sext PARAMS ((rtx, rtx, rtx, rtx)); + extern rtx gen_datalabel_ref PARAMS ((rtx)); ++extern int shl_casesi_worker_length PARAMS ((rtx)); + extern int regs_used PARAMS ((rtx, int)); + extern void fixup_addr_diff_vecs PARAMS ((rtx)); + extern int get_dest_uid PARAMS ((rtx, int)); +diff -ruN gcc-20030210.orig/gcc/config/sh/sh.c gcc-20030210/gcc/config/sh/sh.c +--- gcc-20030210.orig/gcc/config/sh/sh.c Fri Feb 22 01:42:28 2002 ++++ gcc-20030210/gcc/config/sh/sh.c Sat Feb 22 01:40:14 2003 +@@ -2143,6 +2143,48 @@ + return sym; + } + ++ ++/* Function to be used in the length attribute of the casesi_worker ++ instruction. Returns number of instructions, which is half of the ++ length of bytes. */ ++ ++int ++shl_casesi_worker_length (insn) ++ rtx insn; ++{ ++ rtx set_src, label; ++ rtx diff_vec; ++ ++ set_src = SET_SRC (XVECEXP (PATTERN (insn), 0, 0)); ++ if (!(GET_CODE (set_src) == UNSPEC ++ && XINT (set_src, 1) == UNSPEC_CASESI)) ++ abort (); ++ ++ label = XVECEXP (set_src, 0, 2); ++ if (GET_CODE (label) != LABEL_REF) ++ abort (); ++ ++ diff_vec = PATTERN (next_real_insn (XEXP (label, 0))); ++ ++ if (GET_CODE (diff_vec) != ADDR_DIFF_VEC) ++ abort (); ++ ++ switch (GET_MODE (diff_vec)) ++ { ++ case SImode: ++ return 2; ++ case HImode: ++ if (ADDR_DIFF_VEC_FLAGS (diff_vec).offset_unsigned) ++ return 3; ++ return 2; ++ case QImode: ++ if (ADDR_DIFF_VEC_FLAGS (diff_vec).offset_unsigned) ++ return 2; ++ return 1; ++ default: ++ abort (); ++ } ++} + + /* The SH cannot load a large constant into a register, constants have to + come from a pc relative load. The reference of a pc relative load +@@ -3190,7 +3232,7 @@ + vec_lab = XEXP (XEXP (pat, 0), 0); + + /* Search the matching casesi_jump_2. */ +- for (prev = vec_lab; ; prev = PREV_INSN (prev)) ++ for (prev = vec_lab; prev; prev = PREV_INSN (prev)) + { + if (GET_CODE (prev) != JUMP_INSN) + continue; +@@ -3205,6 +3247,13 @@ + break; + } + ++ if (prev == NULL) ++ { /* Switch statement has been optimized out. */ ++ delete_insn (PREV_INSN (insn)); ++ delete_insn (insn); ++ continue; ++ } ++ + /* Emit the reference label of the braf where it belongs, right after + the casesi_jump_2 (i.e. braf). */ + braf_label = XEXP (XEXP (SET_SRC (XVECEXP (prevpat, 0, 0)), 1), 0); +@@ -3223,7 +3272,7 @@ + rtx barrier_or_label; + { + rtx next = next_real_insn (barrier_or_label), pat, prev; +- int slot, credit, jump_to_next; ++ int slot, credit, jump_to_next = 0; + + if (! next) + return 0; +@@ -4507,7 +4556,8 @@ + if (current_function_varargs || current_function_stdarg) + { + /* This is not used by the SH3E calling convention */ +- if (TARGET_SH1 && ! TARGET_SH3E && ! TARGET_SH5 && ! TARGET_HITACHI) ++ if (TARGET_SH1 && ! TARGET_SH3E && ! TARGET_SH5 && ! TARGET_HITACHI ++ || TARGET_NO_IMPLICIT_FP) + { + /* Push arg regs as if they'd been provided by caller in stack. */ + for (i = 0; i < NPARM_REGS(SImode); i++) +@@ -5149,7 +5199,8 @@ + tree f_next_o, f_next_o_limit, f_next_fp, f_next_fp_limit, f_next_stack; + tree record; + +- if (TARGET_SH5 || (! TARGET_SH3E && ! TARGET_SH4) || TARGET_HITACHI) ++ if (TARGET_SH5 || (! TARGET_SH3E && ! TARGET_SH4) || TARGET_HITACHI ++ || TARGET_NO_IMPLICIT_FP) + return ptr_type_node; + + record = make_node (RECORD_TYPE); +@@ -5211,7 +5262,8 @@ + return; + } + +- if ((! TARGET_SH3E && ! TARGET_SH4) || TARGET_HITACHI) ++ if ((! TARGET_SH3E && ! TARGET_SH4) ++ || TARGET_HITACHI || TARGET_NO_IMPLICIT_FP) + { + std_expand_builtin_va_start (stdarg_p, valist, nextarg); + return; +@@ -5289,7 +5341,8 @@ + rsize = (size + UNITS_PER_WORD - 1) & -UNITS_PER_WORD; + pptr_type_node = build_pointer_type (ptr_type_node); + +- if (! TARGET_SH5 && (TARGET_SH3E || TARGET_SH4) && ! TARGET_HITACHI) ++ if (! TARGET_SH5 && (TARGET_SH3E || TARGET_SH4) ++ && ! TARGET_HITACHI && ! TARGET_NO_IMPLICIT_FP) + { + tree f_next_o, f_next_o_limit, f_next_fp, f_next_fp_limit, f_next_stack; + tree next_o, next_o_limit, next_fp, next_fp_limit, next_stack; +diff -ruN gcc-20030210.orig/gcc/config/sh/sh.h gcc-20030210/gcc/config/sh/sh.h +--- gcc-20030210.orig/gcc/config/sh/sh.h Fri Feb 22 01:42:28 2002 ++++ gcc-20030210/gcc/config/sh/sh.h Sat Feb 22 01:40:14 2003 +@@ -147,10 +147,10 @@ + #define HARD_SH4_BIT (1<<5) + #define FPU_SINGLE_BIT (1<<7) + #define SH4_BIT (1<<12) ++#define NO_IMPLICIT_FP_BIT (1<<3) + #define FMOVD_BIT (1<<4) + #define SH5_BIT (1<<0) + #define SPACE_BIT (1<<13) +-#define BIGTABLE_BIT (1<<14) + #define RELAX_BIT (1<<15) + #define USERMODE_BIT (1<<16) + #define HITACHI_BIT (1<<22) +@@ -205,6 +205,9 @@ + /* Nonzero if we should generate code for a SH5 CPU (either ISA). */ + #define TARGET_SH5 (target_flags & SH5_BIT) + ++/* Nonzero if we should not use FPU implicitly. */ ++#define TARGET_NO_IMPLICIT_FP (target_flags & NO_IMPLICIT_FP_BIT) ++ + /* Nonzero if we should generate code using the SHcompact instruction + set and 32-bit ABI. */ + #define TARGET_SHCOMPACT (TARGET_SH5 && TARGET_SH1) +@@ -225,6 +228,7 @@ + + /* Nonzero if we should generate code using SHmedia FPU instructions. */ + #define TARGET_SHMEDIA_FPU (TARGET_SHMEDIA && TARGET_FPU_DOUBLE) ++ + /* Nonzero if we should generate fmovd. */ + #define TARGET_FMOVD (target_flags & FMOVD_BIT) + +@@ -234,9 +238,6 @@ + /* Nonzero if we should generate smaller code rather than faster code. */ + #define TARGET_SMALLCODE (target_flags & SPACE_BIT) + +-/* Nonzero to use long jump tables. */ +-#define TARGET_BIGTABLE (target_flags & BIGTABLE_BIT) +- + /* Nonzero to generate pseudo-ops needed by the assembler and linker + to do function call relaxing. */ + #define TARGET_RELAX (target_flags & RELAX_BIT) +@@ -297,7 +298,6 @@ + {"5-compact-nofpu", TARGET_NONE, "" }, \ + {"5-compact-nofpu", SH5_BIT|SH3_BIT|SH2_BIT|SH1_BIT, "Generate FPU-less SHcompact code" }, \ + {"b", -LITTLE_ENDIAN_BIT, "" }, \ +- {"bigtable", BIGTABLE_BIT, "" }, \ + {"dalign", DALIGN_BIT, "" }, \ + {"fmovd", FMOVD_BIT, "" }, \ + {"hitachi", HITACHI_BIT, "" }, \ +@@ -306,6 +306,7 @@ + {"isize", ISIZE_BIT, "" }, \ + {"l", LITTLE_ENDIAN_BIT, "" }, \ + {"no-ieee", -IEEE_BIT, "" }, \ ++ {"no-implicit-fp", NO_IMPLICIT_FP_BIT, "" }, \ + {"padstruct", PADSTRUCT_BIT, "" }, \ + {"prefergot", PREFERGOT_BIT, "" }, \ + {"relax", RELAX_BIT, "" }, \ +@@ -2493,16 +2494,22 @@ + goto LABEL; \ + } + ++extern int optimize; /* needed for gen_casesi. */ ++extern int optimize_size; ++ + /* Specify the machine mode that this machine uses + for the index in the tablejump instruction. */ +-#define CASE_VECTOR_MODE (TARGET_BIGTABLE ? SImode : HImode) ++#define CASE_VECTOR_MODE SImode + + #define CASE_VECTOR_SHORTEN_MODE(MIN_OFFSET, MAX_OFFSET, BODY) \ + ((MIN_OFFSET) >= 0 && (MAX_OFFSET) <= 127 \ + ? (ADDR_DIFF_VEC_FLAGS (BODY).offset_unsigned = 0, QImode) \ + : (MIN_OFFSET) >= 0 && (MAX_OFFSET) <= 255 \ + ? (ADDR_DIFF_VEC_FLAGS (BODY).offset_unsigned = 1, QImode) \ +- : (MIN_OFFSET) >= -32768 && (MAX_OFFSET) <= 32767 ? HImode \ ++ : (MIN_OFFSET) >= -32768 && (MAX_OFFSET) <= 32767 \ ++ ? (ADDR_DIFF_VEC_FLAGS (BODY).offset_unsigned = 0, HImode) \ ++ : optimize_size && (MIN_OFFSET) >= 0 && (MAX_OFFSET) <= 65535 \ ++ ? (ADDR_DIFF_VEC_FLAGS (BODY).offset_unsigned = 1, HImode) \ + : SImode) + + /* Define as C expression which evaluates to nonzero if the tablejump +@@ -3038,10 +3045,7 @@ + /* Output an absolute table element. */ + + #define ASM_OUTPUT_ADDR_VEC_ELT(STREAM,VALUE) \ +- if (TARGET_BIGTABLE) \ +- asm_fprintf ((STREAM), "\t.long\t%LL%d\n", (VALUE)); \ +- else \ +- asm_fprintf ((STREAM), "\t.word\t%LL%d\n", (VALUE)); \ ++ asm_fprintf ((STREAM), "\t.long\t%LL%d\n", (VALUE)) + + /* Output various types of constants. */ + +@@ -3167,8 +3171,6 @@ + #define sh_cpu_attr ((enum attr_cpu)sh_cpu) + extern enum processor_type sh_cpu; + +-extern int optimize; /* needed for gen_casesi. */ +- + enum mdep_reorg_phase_e + { + SH_BEFORE_MDEP_REORG, +diff -ruN gcc-20030210.orig/gcc/config/sh/sh.md gcc-20030210/gcc/config/sh/sh.md +--- gcc-20030210.orig/gcc/config/sh/sh.md Sat Nov 23 04:58:06 2002 ++++ gcc-20030210/gcc/config/sh/sh.md Sat Feb 22 01:40:14 2003 +@@ -1242,7 +1242,7 @@ + (clobber (reg:SI PR_REG)) + (clobber (reg:SI R4_REG)) + (use (match_operand:SI 1 "arith_reg_operand" "r"))] +- "TARGET_SH1 && ! TARGET_SH4" ++ "TARGET_SH1 && ! TARGET_SH4 || TARGET_NO_IMPLICIT_FP" + "jsr @%1%#" + [(set_attr "type" "sfunc") + (set_attr "needs_delay_slot" "yes")]) +@@ -1336,7 +1336,7 @@ + + operands[3] = gen_reg_rtx (Pmode); + /* Emit the move of the address to a pseudo outside of the libcall. */ +- if (TARGET_HARD_SH4 && TARGET_SH3E) ++ if (TARGET_HARD_SH4 && TARGET_SH3E && !TARGET_NO_IMPLICIT_FP) + { + emit_move_insn (operands[3], + gen_rtx_SYMBOL_REF (SImode, \"__udivsi3_i4\")); +@@ -1391,7 +1391,7 @@ + (clobber (reg:SI R2_REG)) + (clobber (reg:SI R3_REG)) + (use (match_operand:SI 1 "arith_reg_operand" "r"))] +- "TARGET_SH1 && ! TARGET_SH4" ++ "TARGET_SH1 && ! TARGET_SH4 || TARGET_NO_IMPLICIT_FP" + "jsr @%1%#" + [(set_attr "type" "sfunc") + (set_attr "needs_delay_slot" "yes")]) +@@ -1476,7 +1476,7 @@ + + operands[3] = gen_reg_rtx (Pmode); + /* Emit the move of the address to a pseudo outside of the libcall. */ +- if (TARGET_HARD_SH4 && TARGET_SH3E) ++ if (TARGET_HARD_SH4 && TARGET_SH3E && !TARGET_NO_IMPLICIT_FP) + { + emit_move_insn (operands[3], + gen_rtx_SYMBOL_REF (SImode, \"__sdivsi3_i4\")); +@@ -6446,6 +6446,8 @@ + case SImode: + return \"shll2 %1\;mov.l @(r0,%1),%0\"; + case HImode: ++ if (ADDR_DIFF_VEC_FLAGS (diff_vec).offset_unsigned) ++ return \"add %1,%1\;mov.w @(r0,%1),%0\;extu.w %0,%0\"; + return \"add %1,%1\;mov.w @(r0,%1),%0\"; + case QImode: + if (ADDR_DIFF_VEC_FLAGS (diff_vec).offset_unsigned) +@@ -6455,7 +6457,15 @@ + abort (); + } + }" +- [(set_attr "length" "4")]) ++ [(set (attr "length") ++ (cond [(eq (symbol_ref "shl_casesi_worker_length (insn)") (const_int 1)) ++ (const_string "2") ++ (eq (symbol_ref "shl_casesi_worker_length (insn)") (const_int 2)) ++ (const_string "4") ++ ;; Put "match_dup" here so that insn_variable_length_p return 1. ++ (ne (match_dup 2) (match_dup 2)) ++ (const_string "4")] ++ (const_string "6")))]) + + (define_insn "casesi_shift_media" + [(set (match_operand 0 "arith_reg_operand" "=r") +diff -ruN gcc-20030210.orig/gcc/config/sh/sh3-linux.h gcc-20030210/gcc/config/sh/sh3-linux.h +--- gcc-20030210.orig/gcc/config/sh/sh3-linux.h Thu Jan 1 09:00:00 1970 ++++ gcc-20030210/gcc/config/sh/sh3-linux.h Sat Feb 22 01:40:14 2003 +@@ -0,0 +1,29 @@ ++#undef TARGET_VERSION ++#define TARGET_VERSION fputs (" (SH3 GNU/Linux with ELF)", stderr); ++ ++#undef CPP_SPEC ++#define CPP_SPEC \ ++ "-D__LITTLE_ENDIAN__ \ ++ -D__SH3__ -D__sh3__ \ ++ -D__SIZE_TYPE__=unsigned\\ int \ ++ -D__PTRDIFF_TYPE__=int \ ++ %{fPIC:-D__PIC__ -D__pic__} \ ++ %{fpic:-D__PIC__ -D__pic__} \ ++ %{posix:-D_POSIX_SOURCE} \ ++ %{pthread:-D_REENTRANT -D_PTHREADS}" ++ ++#undef ASM_SPEC ++#define ASM_SPEC "%{mrelax:-relax}" ++ ++#undef CC1_SPEC ++#define CC1_SPEC \ ++ "-musermode -ml -m3 %{profile:-p}" ++ ++#undef LINK_SPEC ++#define LINK_SPEC \ ++ "%{mrelax:-relax} \ ++ %{shared:-shared} \ ++ %{!static: \ ++ %{rdynamic:-export-dynamic} \ ++ %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \ ++ %{static:-static}" +diff -ruN gcc-20030210.orig/gcc/config/sh/sh3eb-linux.h gcc-20030210/gcc/config/sh/sh3eb-linux.h +--- gcc-20030210.orig/gcc/config/sh/sh3eb-linux.h Thu Jan 1 09:00:00 1970 ++++ gcc-20030210/gcc/config/sh/sh3eb-linux.h Sat Feb 22 01:40:14 2003 +@@ -0,0 +1,29 @@ ++#undef TARGET_VERSION ++#define TARGET_VERSION fputs (" (SH3EB GNU/Linux with ELF)", stderr); ++ ++#undef CPP_SPEC ++#define CPP_SPEC \ ++ "-D__BIG_ENDIAN__ \ ++ -D__SH3__ -D__sh3__ \ ++ -D__SIZE_TYPE__=unsigned\\ int \ ++ -D__PTRDIFF_TYPE__=int \ ++ %{fPIC:-D__PIC__ -D__pic__} \ ++ %{fpic:-D__PIC__ -D__pic__} \ ++ %{posix:-D_POSIX_SOURCE} \ ++ %{pthread:-D_REENTRANT -D_PTHREADS}" ++ ++#undef ASM_SPEC ++#define ASM_SPEC "%{mrelax:-relax}" ++ ++#undef CC1_SPEC ++#define CC1_SPEC \ ++ "-musermode -mb -m3 %{profile:-p}" ++ ++#undef LINK_SPEC ++#define LINK_SPEC \ ++ "%{mrelax:-relax} \ ++ %{shared:-shared} \ ++ %{!static: \ ++ %{rdynamic:-export-dynamic} \ ++ %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \ ++ %{static:-static}" +diff -ruN gcc-20030210.orig/gcc/config/sh/sh4-linux.h gcc-20030210/gcc/config/sh/sh4-linux.h +--- gcc-20030210.orig/gcc/config/sh/sh4-linux.h Thu Jan 1 09:00:00 1970 ++++ gcc-20030210/gcc/config/sh/sh4-linux.h Sat Feb 22 01:40:14 2003 +@@ -0,0 +1,29 @@ ++#undef TARGET_VERSION ++#define TARGET_VERSION fputs (" (SH4 GNU/Linux with ELF)", stderr); ++ ++#undef CPP_SPEC ++#define CPP_SPEC \ ++ "-D__LITTLE_ENDIAN__ \ ++ -D__SH4__ \ ++ -D__SIZE_TYPE__=unsigned\\ int \ ++ -D__PTRDIFF_TYPE__=int \ ++ %{fPIC:-D__PIC__ -D__pic__} \ ++ %{fpic:-D__PIC__ -D__pic__} \ ++ %{posix:-D_POSIX_SOURCE} \ ++ %{pthread:-D_REENTRANT -D_PTHREADS}" ++ ++#undef ASM_SPEC ++#define ASM_SPEC "%{mrelax:-relax}" ++ ++#undef CC1_SPEC ++#define CC1_SPEC \ ++ "-musermode -ml -m4 %{profile:-p}" ++ ++#undef LINK_SPEC ++#define LINK_SPEC \ ++ "%{mrelax:-relax} \ ++ %{shared:-shared} \ ++ %{!static: \ ++ %{rdynamic:-export-dynamic} \ ++ %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \ ++ %{static:-static}" +diff -ruN gcc-20030210.orig/gcc/config/sh/sh4eb-linux.h gcc-20030210/gcc/config/sh/sh4eb-linux.h +--- gcc-20030210.orig/gcc/config/sh/sh4eb-linux.h Thu Jan 1 09:00:00 1970 ++++ gcc-20030210/gcc/config/sh/sh4eb-linux.h Sat Feb 22 01:40:14 2003 +@@ -0,0 +1,29 @@ ++#undef TARGET_VERSION ++#define TARGET_VERSION fputs (" (SH4EB GNU/Linux with ELF)", stderr); ++ ++#undef CPP_SPEC ++#define CPP_SPEC \ ++ "-D__BIG_ENDIAN__ \ ++ -D__SH4__ \ ++ -D__SIZE_TYPE__=unsigned\\ int \ ++ -D__PTRDIFF_TYPE__=int \ ++ %{fPIC:-D__PIC__ -D__pic__} \ ++ %{fpic:-D__PIC__ -D__pic__} \ ++ %{posix:-D_POSIX_SOURCE} \ ++ %{pthread:-D_REENTRANT -D_PTHREADS}" ++ ++#undef ASM_SPEC ++#define ASM_SPEC "%{mrelax:-relax}" ++ ++#undef CC1_SPEC ++#define CC1_SPEC \ ++ "-musermode -mb -m4 %{profile:-p}" ++ ++#undef LINK_SPEC ++#define LINK_SPEC \ ++ "%{mrelax:-relax} \ ++ %{shared:-shared} \ ++ %{!static: \ ++ %{rdynamic:-export-dynamic} \ ++ %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \ ++ %{static:-static}" +diff -ruN gcc-20030210.orig/gcc/config/sh/t-linux gcc-20030210/gcc/config/sh/t-linux +--- gcc-20030210.orig/gcc/config/sh/t-linux Thu May 17 12:16:12 2001 ++++ gcc-20030210/gcc/config/sh/t-linux Sat Feb 22 01:40:14 2003 +@@ -1,10 +1,20 @@ +-TARGET_LIBGCC2_CFLAGS = -fpic ++TARGET_LIBGCC2_CFLAGS = -fpic -DNO_FPSCR_VALUES ++LIBGCC1 = libgcc1-asm.a ++CROSS_LIBGCC1 = libgcc1-asm.a ++LIBGCC1_TEST = libgcc1-test + LIB1ASMFUNCS = _ashiftrt _ashiftrt_n _ashiftlt _lshiftrt _movstr \ + _movstr_i4 _mulsi3 _sdivsi3 _sdivsi3_i4 _udivsi3 _udivsi3_i4 _set_fpscr \ + _ic_invalidate ++LIB2ADDEH = $(srcdir)/unwind-sjlj.c ++LIB2ADDEHDEP = unwind.inc unwind-sjlj.c + +-MULTILIB_OPTIONS= mb m3e/m4 ++MULTILIB_OPTIONS= mb m4 + MULTILIB_DIRNAMES= + MULTILIB_MATCHES = + +-EXTRA_MULTILIB_PARTS= crtbegin.o crtend.o crtbeginS.o crtendS.o ++EXTRA_MULTILIB_PARTS= crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o ++ ++# Override t-slibgcc-elf-ver to export some libgcc symbols with ++# the symbol versions that glibc used and SH specific. ++SHLIB_MAPFILES = $(srcdir)/libgcc-std.ver \ ++ $(srcdir)/config/sh/libgcc-glibc.ver +diff -ruN gcc-20030210.orig/gcc/config/sh/t-linux-nomulti gcc-20030210/gcc/config/sh/t-linux-nomulti +--- gcc-20030210.orig/gcc/config/sh/t-linux-nomulti Thu Jan 1 09:00:00 1970 ++++ gcc-20030210/gcc/config/sh/t-linux-nomulti Sat Feb 22 01:40:14 2003 +@@ -0,0 +1,9 @@ ++LIBGCC = libgcc.a ++EXTRA_PARTS = crtbegin.o crtbeginS.o crtend.o crtendS.o crtbeginT.o ++ ++INSTALL_LIBGCC = install-libgcc ++ ++MULTILIB_OPTIONS= ++MULTILIB_DIRNAMES= ++MULTILIB_MATCHES = ++EXTRA_MULTILIB_PARTS= +diff -ruN gcc-20030210.orig/gcc/config.gcc gcc-20030210/gcc/config.gcc +--- gcc-20030210.orig/gcc/config.gcc Fri Jan 31 19:17:13 2003 ++++ gcc-20030210/gcc/config.gcc Sat Feb 22 01:40:14 2003 +@@ -337,9 +337,9 @@ + sparc*-*-*) + cpu_type=sparc + ;; +-sh64-*-*) +- cpu_type=sh +- ;; ++sh*-*-*) ++ cpu_type=sh ++ ;; + esac + + tm_file=${cpu_type}/${cpu_type}.h +@@ -3018,9 +3018,31 @@ + thread_file='rtems' + fi + ;; +-sh-*-linux*) ++sh*-*-linux*) + tm_file="${tm_file} sh/elf.h sh/linux.h" +- tmake_file="sh/t-sh sh/t-elf sh/t-linux" ++ tmake_file="sh/t-sh sh/t-elf t-slibgcc-elf-ver t-linux sh/t-linux" ++ extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o" ++ case $machine in ++ sh3eb-*) ++ tm_file="${tm_file} sh/sh3eb-linux.h" ++ tmake_file="${tmake_file} sh/t-linux-nomulti" ++ ;; ++ sh4eb-*) ++ tm_file="${tm_file} sh/sh4eb-linux.h" ++ tmake_file="${tmake_file} sh/t-linux-nomulti" ++ ;; ++ sh3-*) ++ tm_file="${tm_file} sh/sh3-linux.h" ++ tmake_file="${tmake_file} sh/t-linux-nomulti" ++ ;; ++ sh4-*) ++ tm_file="${tm_file} sh/sh4-linux.h" ++ tmake_file="${tmake_file} sh/t-linux-nomulti" ++ ;; ++ *) ++ ;; ++ esac ++ xmake_file=x-linux + gas=yes gnu_ld=yes + float_format=sh + ;; +diff -ruN gcc-20030210.orig/gcc/dwarf2out.c gcc-20030210/gcc/dwarf2out.c +--- gcc-20030210.orig/gcc/dwarf2out.c Mon Feb 10 19:36:25 2003 ++++ gcc-20030210/gcc/dwarf2out.c Sat Feb 22 01:40:14 2003 +@@ -10224,7 +10224,9 @@ + /* We can have a normal definition following an inline one in the + case of redefinition of GNU C extern inlines. + It seems reasonable to use AT_specification in this case. */ +- && !get_AT_unsigned (old_die, DW_AT_inline)) ++ && !get_AT_unsigned (old_die, DW_AT_inline) ++ /* Skip the nested function. */ ++ && !decl_function_context (decl)) + { + /* ??? This can happen if there is a bug in the program, for + instance, if it has duplicate function definitions. Ideally, +diff -ruN gcc-20030210.orig/gcc/final.c gcc-20030210/gcc/final.c +--- gcc-20030210.orig/gcc/final.c Fri Jan 31 19:17:20 2003 ++++ gcc-20030210/gcc/final.c Sat Feb 22 01:40:14 2003 +@@ -1128,7 +1128,7 @@ + } + } + +- INSN_ADDRESSES (uid) = insn_current_address; ++ INSN_ADDRESSES (uid) = insn_current_address + insn_lengths[uid]; + + if (GET_CODE (insn) == NOTE || GET_CODE (insn) == BARRIER + || GET_CODE (insn) == CODE_LABEL) +diff -ruN gcc-20030210.orig/gcc/mkmap-symver.awk gcc-20030210/gcc/mkmap-symver.awk +--- gcc-20030210.orig/gcc/mkmap-symver.awk Fri Jan 31 19:17:26 2003 ++++ gcc-20030210/gcc/mkmap-symver.awk Sat Feb 22 01:40:14 2003 +@@ -89,7 +89,11 @@ + output(inherit[lib]); + + printf("%s {\n", lib); +- printf(" global:\n"); ++ for (sym in ver) ++ if ((ver[sym] == lib) && (sym in def)) ++ count++; ++ if (count > 0) ++ printf(" global:\n"); + for (sym in ver) + if ((ver[sym] == lib) && (sym in def)) + { +diff -ruN gcc-20030210.orig/gcc/reload1.c gcc-20030210/gcc/reload1.c +--- gcc-20030210.orig/gcc/reload1.c Fri Jan 31 19:17:29 2003 ++++ gcc-20030210/gcc/reload1.c Sat Feb 22 01:40:14 2003 +@@ -6103,6 +6103,7 @@ + for (j = 0; j < n_reloads; j++) + if (rld[j].in != 0 + && rld[j].when_needed != RELOAD_OTHER ++ && rld[j].when_needed != RELOAD_FOR_OUTPUT_ADDRESS + && reg_overlap_mentioned_for_reload_p (rld[j].in, + rld[i].in)) + rld[j].when_needed +diff -ruN gcc-20030210.orig/gcc/reorg.c gcc-20030210/gcc/reorg.c +--- gcc-20030210.orig/gcc/reorg.c Fri Jan 31 19:17:30 2003 ++++ gcc-20030210/gcc/reorg.c Sat Feb 22 01:40:14 2003 +@@ -3265,6 +3265,14 @@ + || condjump_in_parallel_p (XVECEXP (PATTERN (insn), 0, 0)))) + continue; + ++#ifdef MD_CAN_REDIRECT_BRANCH ++ /* On some targets, branches with delay slots can have a limited ++ displacement. Give the back end a chance to tell us we can't do ++ this. */ ++ if (! MD_CAN_REDIRECT_BRANCH (insn, delay_insn)) ++ continue; ++#endif ++ + target_label = JUMP_LABEL (delay_insn); + + if (target_label) +diff -ruN gcc-20030210.orig/gcc/tree-inline.c gcc-20030210/gcc/tree-inline.c +--- gcc-20030210.orig/gcc/tree-inline.c Fri Jan 31 19:17:33 2003 ++++ gcc-20030210/gcc/tree-inline.c Sat Feb 22 01:40:14 2003 +@@ -836,11 +836,17 @@ + + /* Don't try to inline functions that are not well-suited to + inlining. */ +- if (!inlinable_function_p (fn, id)) +- return NULL_TREE; ++ if (! inlinable_function_p (fn, id) ++ || ! (*lang_hooks.tree_inlining.start_inlining) (fn)) ++ { ++ if (DECL_INLINE (fn) && warn_inline && ! flag_really_no_inline) ++ { ++ warning_with_decl (fn, "inlining failed in call to `%s'"); ++ warning ("called from here"); ++ } + +- if (! (*lang_hooks.tree_inlining.start_inlining) (fn)) +- return NULL_TREE; ++ return NULL_TREE; ++ } + + /* Set the current filename and line number to the function we are + inlining so that when we create new _STMT nodes here they get +diff -ruN gcc-20030210.orig/libjava/Makefile.in gcc-20030210/libjava/Makefile.in +--- gcc-20030210.orig/libjava/Makefile.in Tue Jan 28 10:44:37 2003 ++++ gcc-20030210/libjava/Makefile.in Sat Feb 22 01:40:14 2003 +@@ -1637,6 +1637,7 @@ + "AS=$(AS)" \ + "CC=$(CC)" \ + "CXX=$(CXX)" \ ++ "GCJ=$(GCJ)" \ + "LD=$(LD)" \ + "LIBCFLAGS=$(LIBCFLAGS)" \ + "NM=$(NM)" \ +diff -ruN gcc-20030210.orig/libjava/configure gcc-20030210/libjava/configure +--- gcc-20030210.orig/libjava/configure Tue Jan 28 10:44:37 2003 ++++ gcc-20030210/libjava/configure Sat Feb 22 01:42:11 2003 +@@ -2031,7 +2031,7 @@ + # This must be Linux ELF. + linux-gnu*) + case $host_cpu in +- alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* ) ++ alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | sh* ) + lt_cv_deplibs_check_method=pass_all ;; + *) + # glibc up to 2.1.1 does not perform some relocations on ARM +diff -ruN gcc-20030210.orig/libjava/java/net/natInetAddress.cc gcc-20030210/libjava/java/net/natInetAddress.cc +--- gcc-20030210.orig/libjava/java/net/natInetAddress.cc Tue Mar 5 05:02:19 2002 ++++ gcc-20030210/libjava/java/net/natInetAddress.cc Sat Feb 22 01:40:14 2003 +@@ -56,7 +56,7 @@ + #endif + + #ifndef HAVE_GETHOSTNAME_DECL +-extern "C" int gethostname (char *name, int namelen); ++extern "C" int gethostname (char *name, unsigned int namelen); + #endif + + #ifdef DISABLE_JAVA_NET +diff -ruN gcc-20030210.orig/libjava/libltdl/aclocal.m4 gcc-20030210/libjava/libltdl/aclocal.m4 +--- gcc-20030210.orig/libjava/libltdl/aclocal.m4 Sun Sep 10 17:04:40 2000 ++++ gcc-20030210/libjava/libltdl/aclocal.m4 Sat Feb 22 01:40:14 2003 +@@ -573,7 +573,7 @@ + # This must be Linux ELF. + linux-gnu*) + case "$host_cpu" in +- alpha* | i*86 | powerpc* | sparc* | ia64* ) ++ alpha* | i*86 | powerpc* | sparc* | ia64* | sh*) + lt_cv_deplibs_check_method=pass_all ;; + *) + # glibc up to 2.1.1 does not perform some relocations on ARM +diff -ruN gcc-20030210.orig/libjava/sysdep/sh/locks.h gcc-20030210/libjava/sysdep/sh/locks.h +--- gcc-20030210.orig/libjava/sysdep/sh/locks.h Thu Jan 1 09:00:00 1970 ++++ gcc-20030210/libjava/sysdep/sh/locks.h Sat Feb 22 01:40:14 2003 +@@ -0,0 +1,72 @@ ++// locks.h - Thread synchronization primitives. SuperH implementation. ++ ++/* Copyright (C) 2002 Free Software Foundation ++ ++ This file is part of libgcj. ++ ++This software is copyrighted work licensed under the terms of the ++Libgcj License. Please consult the file "LIBGCJ_LICENSE" for ++details. */ ++ ++#ifndef __SYSDEP_LOCKS_H__ ++#define __SYSDEP_LOCKS_H__ ++ ++typedef size_t obj_addr_t; /* Integer type big enough for object */ ++ /* address. */ ++ ++static unsigned char __cas_lock = 0; ++ ++inline static void ++__cas_start_atomic (void) ++{ ++ unsigned int val; ++ ++ do ++ __asm__ __volatile__ ("tas.b @%1; movt %0" ++ : "=r" (val) ++ : "r" (&__cas_lock) ++ : "memory"); ++ while (val == 0); ++} ++ ++inline static void ++__cas_end_atomic (void) ++{ ++ __asm__ __volatile__ (" " : : : "memory"); ++ __cas_lock = 0; ++} ++ ++inline static bool ++compare_and_swap (volatile obj_addr_t *addr, obj_addr_t old, ++ obj_addr_t new_val) ++{ ++ bool ret; ++ ++ __cas_start_atomic (); ++ if (*addr != old) ++ ret = false; ++ else ++ { ++ *addr = new_val; ++ ret = true; ++ } ++ __cas_end_atomic (); ++ ++ return ret; ++} ++ ++inline static void ++release_set (volatile obj_addr_t *addr, obj_addr_t new_val) ++{ ++ __asm__ __volatile__ (" " : : : "memory"); ++ *(addr) = new_val; ++} ++ ++inline static bool ++compare_and_swap_release (volatile obj_addr_t *addr, obj_addr_t old, ++ obj_addr_t new_val) ++{ ++ return compare_and_swap (addr, old, new_val); ++} ++ ++#endif /* ! __SYSDEP_LOCKS_H__ */ +diff -ruN gcc-20030210.orig/libstdc++-v3/acinclude.m4 gcc-20030210/libstdc++-v3/acinclude.m4 +--- gcc-20030210.orig/libstdc++-v3/acinclude.m4 Tue Jan 28 02:30:41 2003 ++++ gcc-20030210/libstdc++-v3/acinclude.m4 Sat Feb 22 01:40:14 2003 +@@ -1828,9 +1828,10 @@ + GLIBCPP_INCLUDES="-I${glibcpp_builddir}/include/${target_alias} -I${glibcpp_builddir}/include" + + # Passed down for canadian crosses. +- if test x"$CANADIAN" = xyes; then +- TOPLEVEL_INCLUDES='-I$(includedir)' +- fi ++ #if test x"$CANADIAN" = xyes; then ++ # TOPLEVEL_INCLUDES='-I$(includedir)' ++ #fi ++ TOPLEVEL_INCLUDES='' + + LIBMATH_INCLUDES='-I$(top_srcdir)/libmath' + +diff -ruN gcc-20030210.orig/libstdc++-v3/aclocal.m4 gcc-20030210/libstdc++-v3/aclocal.m4 +--- gcc-20030210.orig/libstdc++-v3/aclocal.m4 Mon Feb 10 19:36:47 2003 ++++ gcc-20030210/libstdc++-v3/aclocal.m4 Sat Feb 22 01:40:14 2003 +@@ -1840,9 +1840,10 @@ + GLIBCPP_INCLUDES="-I${glibcpp_builddir}/include/${target_alias} -I${glibcpp_builddir}/include" + + # Passed down for canadian crosses. +- if test x"$CANADIAN" = xyes; then +- TOPLEVEL_INCLUDES='-I$(includedir)' +- fi ++ #if test x"$CANADIAN" = xyes; then ++ # TOPLEVEL_INCLUDES='-I$(includedir)' ++ #fi ++ TOPLEVEL_INCLUDES='' + + LIBMATH_INCLUDES='-I$(top_srcdir)/libmath' + +diff -ruN gcc-20030210.orig/libstdc++-v3/configure gcc-20030210/libstdc++-v3/configure +--- gcc-20030210.orig/libstdc++-v3/configure Mon Feb 10 19:37:17 2003 ++++ gcc-20030210/libstdc++-v3/configure Sat Feb 22 01:40:14 2003 +@@ -1982,7 +1982,7 @@ + # This must be Linux ELF. + linux-gnu*) + case $host_cpu in +- alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* ) ++ alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | sh*) + lt_cv_deplibs_check_method=pass_all ;; + *) + # glibc up to 2.1.1 does not perform some relocations on ARM +@@ -22340,9 +22340,10 @@ + GLIBCPP_INCLUDES="-I${glibcpp_builddir}/include/${target_alias} -I${glibcpp_builddir}/include" + + # Passed down for canadian crosses. +- if test x"$CANADIAN" = xyes; then +- TOPLEVEL_INCLUDES='-I$(includedir)' +- fi ++ #if test x"$CANADIAN" = xyes; then ++ # TOPLEVEL_INCLUDES='-I$(includedir)' ++ #fi ++ TOPLEVEL_INCLUDES='' + + LIBMATH_INCLUDES='-I$(top_srcdir)/libmath' + +diff -ruN gcc-20030210.orig/libtool.m4 gcc-20030210/libtool.m4 +--- gcc-20030210.orig/libtool.m4 Fri Jan 31 19:16:59 2003 ++++ gcc-20030210/libtool.m4 Sat Feb 22 01:40:14 2003 +@@ -597,7 +597,7 @@ + # This must be Linux ELF. + linux-gnu*) + case $host_cpu in +- alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* ) ++ alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | sh* ) + lt_cv_deplibs_check_method=pass_all ;; + *) + # glibc up to 2.1.1 does not perform some relocations on ARM +diff -ruN gcc-20030210.orig/zlib/configure gcc-20030210/zlib/configure +--- gcc-20030210.orig/zlib/configure Tue Jan 28 10:44:15 2003 ++++ gcc-20030210/zlib/configure Sat Feb 22 01:40:14 2003 +@@ -1571,7 +1571,7 @@ + # This must be Linux ELF. + linux-gnu*) + case $host_cpu in +- alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* ) ++ alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | sh* ) + lt_cv_deplibs_check_method=pass_all ;; + *) + # glibc up to 2.1.1 does not perform some relocations on ARM diff --git a/patches/gcc/3.2.3/130-g++.exp.patch b/patches/gcc/3.2.3/130-g++.exp.patch new file mode 100644 index 0000000..0de46fc --- /dev/null +++ b/patches/gcc/3.2.3/130-g++.exp.patch @@ -0,0 +1,98 @@ +g++ testsuite fixes for cross-compilers, Dan Kegel, Ixia Communications, 12 July 2003 + +The first hunk fixes the error + +/testsuite_flags: /testsuite_flags: No such file or directory + while executing +"exec sh ${odir_v3}/testsuite_flags --build-includes" + (procedure "g++_include_flags" line 21) + invoked from within +"g++_include_flags [get_multilibs] " + (procedure "g++_init" line 63) + invoked from within +"${tool}_init $test_file_name" + (procedure "runtest" line 19) + invoked from within +"runtest $test_name" + ("foreach" body line 42) + invoked from within +... +make[1]: [check-g++] Error 1 (ignored) + +The fix isn't especially pretty, but it worked for me, and can't hurt the +more common native compiler case. Maybe someone who knows the code better +can come up with a better fix. + +The second hunk fixes the error + +sh: error while loading shared libraries: /opt/cegl-2.0/powerpc-405-linux-gnu/gcc-3.2.3-glibc-2.2.5/powerpc-405-linux-gnu/./lib/libdl.so.2: ELF file data encoding not little-endian + +when trying to compile g++ testcases (!); setting up +the shared library environment when running crosstests of g++ +should either be done by a special board file, or by +setting up a remote chroot environment (see http://kegel.com/crosstool), +not by blithely setting LD_LIBRARY_PATH on the local system. + +--- gcc-3.2.3/gcc/testsuite/lib/g++.exp.old Fri Jul 11 15:42:47 2003 ++++ gcc-3.2.3/gcc/testsuite/lib/g++.exp Sat Jul 12 12:57:07 2003 +@@ -72,6 +72,8 @@ + # + proc g++_include_flags { paths } { + global srcdir ++ global objdir ++ global target_triplet + global HAVE_LIBSTDCXX_V3 + global TESTING_IN_BUILD_TREE + +@@ -90,6 +92,20 @@ + + if { ${HAVE_LIBSTDCXX_V3} } { + set odir_v3 [lookfor_file ${gccpath} libstdc++-v3] ++ if { $odir_v3 == "" } { ++ verbose "g++_include_flags: couldn't find libstdc++-v3 on first try, now looking in build directory $objdir" ++ # first assume no multilibs ++ set odir_v3 [lookfor_file ${objdir} "$target_triplet/libstdc++-v3"] ++ } ++ if { $odir_v3 == "" } { ++ verbose "g++_include_flags: couldn't find libstdc++-v3 on second try, trying multilib" ++ # assume multilib only one level deep ++ set multisub [file tail $gccpath] ++ set odir_v3 [lookfor_file ${objdir} "$target_triplet/$multisub/libstdc++-v3"] ++ } ++ if { $odir_v3 == "" } { ++ error "Can't find libstdc++-v3" ++ } + append flags [exec sh ${odir_v3}/testsuite_flags --build-includes] + } else { + set odir_v2 [lookfor_file ${gccpath} libstdc++] +@@ -192,16 +192,20 @@ + } + } + +- # On IRIX 6, we have to set variables akin to LD_LIBRARY_PATH, but +- # called LD_LIBRARYN32_PATH (for the N32 ABI) and LD_LIBRARY64_PATH +- # (for the 64-bit ABI). The right way to do this would be to modify +- # unix.exp -- but that's not an option since it's part of DejaGNU +- # proper, so we do it here. We really only need to do +- # this on IRIX, but it shouldn't hurt to do it anywhere else. +- setenv LD_LIBRARY_PATH $ld_library_path +- setenv SHLIB_PATH $ld_library_path +- setenv LD_LIBRARYN32_PATH $ld_library_path +- setenv LD_LIBRARY64_PATH $ld_library_path ++ if {![is_remote target]} { ++ # On IRIX 6, we have to set variables akin to LD_LIBRARY_PATH, but ++ # called LD_LIBRARYN32_PATH (for the N32 ABI) and LD_LIBRARY64_PATH ++ # (for the 64-bit ABI). The right way to do this would be to modify ++ # unix.exp -- but that's not an option since it's part of DejaGNU ++ # proper, so we do it here. We really only need to do ++ # this on IRIX, but it shouldn't hurt to do it anywhere else. ++ ++ # Doing this causes us to be unable to run cross-compilers. ++ setenv LD_LIBRARY_PATH $ld_library_path ++ setenv SHLIB_PATH $ld_library_path ++ setenv LD_LIBRARYN32_PATH $ld_library_path ++ setenv LD_LIBRARY64_PATH $ld_library_path ++ } + + return "$flags" + } diff --git a/patches/gcc/3.2.3/130-gcc-3.2.3-g++.exp.patch b/patches/gcc/3.2.3/130-gcc-3.2.3-g++.exp.patch deleted file mode 100644 index 0de46fc..0000000 --- a/patches/gcc/3.2.3/130-gcc-3.2.3-g++.exp.patch +++ /dev/null @@ -1,98 +0,0 @@ -g++ testsuite fixes for cross-compilers, Dan Kegel, Ixia Communications, 12 July 2003 - -The first hunk fixes the error - -/testsuite_flags: /testsuite_flags: No such file or directory - while executing -"exec sh ${odir_v3}/testsuite_flags --build-includes" - (procedure "g++_include_flags" line 21) - invoked from within -"g++_include_flags [get_multilibs] " - (procedure "g++_init" line 63) - invoked from within -"${tool}_init $test_file_name" - (procedure "runtest" line 19) - invoked from within -"runtest $test_name" - ("foreach" body line 42) - invoked from within -... -make[1]: [check-g++] Error 1 (ignored) - -The fix isn't especially pretty, but it worked for me, and can't hurt the -more common native compiler case. Maybe someone who knows the code better -can come up with a better fix. - -The second hunk fixes the error - -sh: error while loading shared libraries: /opt/cegl-2.0/powerpc-405-linux-gnu/gcc-3.2.3-glibc-2.2.5/powerpc-405-linux-gnu/./lib/libdl.so.2: ELF file data encoding not little-endian - -when trying to compile g++ testcases (!); setting up -the shared library environment when running crosstests of g++ -should either be done by a special board file, or by -setting up a remote chroot environment (see http://kegel.com/crosstool), -not by blithely setting LD_LIBRARY_PATH on the local system. - ---- gcc-3.2.3/gcc/testsuite/lib/g++.exp.old Fri Jul 11 15:42:47 2003 -+++ gcc-3.2.3/gcc/testsuite/lib/g++.exp Sat Jul 12 12:57:07 2003 -@@ -72,6 +72,8 @@ - # - proc g++_include_flags { paths } { - global srcdir -+ global objdir -+ global target_triplet - global HAVE_LIBSTDCXX_V3 - global TESTING_IN_BUILD_TREE - -@@ -90,6 +92,20 @@ - - if { ${HAVE_LIBSTDCXX_V3} } { - set odir_v3 [lookfor_file ${gccpath} libstdc++-v3] -+ if { $odir_v3 == "" } { -+ verbose "g++_include_flags: couldn't find libstdc++-v3 on first try, now looking in build directory $objdir" -+ # first assume no multilibs -+ set odir_v3 [lookfor_file ${objdir} "$target_triplet/libstdc++-v3"] -+ } -+ if { $odir_v3 == "" } { -+ verbose "g++_include_flags: couldn't find libstdc++-v3 on second try, trying multilib" -+ # assume multilib only one level deep -+ set multisub [file tail $gccpath] -+ set odir_v3 [lookfor_file ${objdir} "$target_triplet/$multisub/libstdc++-v3"] -+ } -+ if { $odir_v3 == "" } { -+ error "Can't find libstdc++-v3" -+ } - append flags [exec sh ${odir_v3}/testsuite_flags --build-includes] - } else { - set odir_v2 [lookfor_file ${gccpath} libstdc++] -@@ -192,16 +192,20 @@ - } - } - -- # On IRIX 6, we have to set variables akin to LD_LIBRARY_PATH, but -- # called LD_LIBRARYN32_PATH (for the N32 ABI) and LD_LIBRARY64_PATH -- # (for the 64-bit ABI). The right way to do this would be to modify -- # unix.exp -- but that's not an option since it's part of DejaGNU -- # proper, so we do it here. We really only need to do -- # this on IRIX, but it shouldn't hurt to do it anywhere else. -- setenv LD_LIBRARY_PATH $ld_library_path -- setenv SHLIB_PATH $ld_library_path -- setenv LD_LIBRARYN32_PATH $ld_library_path -- setenv LD_LIBRARY64_PATH $ld_library_path -+ if {![is_remote target]} { -+ # On IRIX 6, we have to set variables akin to LD_LIBRARY_PATH, but -+ # called LD_LIBRARYN32_PATH (for the N32 ABI) and LD_LIBRARY64_PATH -+ # (for the 64-bit ABI). The right way to do this would be to modify -+ # unix.exp -- but that's not an option since it's part of DejaGNU -+ # proper, so we do it here. We really only need to do -+ # this on IRIX, but it shouldn't hurt to do it anywhere else. -+ -+ # Doing this causes us to be unable to run cross-compilers. -+ setenv LD_LIBRARY_PATH $ld_library_path -+ setenv SHLIB_PATH $ld_library_path -+ setenv LD_LIBRARYN32_PATH $ld_library_path -+ setenv LD_LIBRARY64_PATH $ld_library_path -+ } - - return "$flags" - } diff --git a/patches/gcc/3.2.3/140-gcc-3.2.3-libffi-1.patch b/patches/gcc/3.2.3/140-gcc-3.2.3-libffi-1.patch deleted file mode 100644 index db78ba1..0000000 --- a/patches/gcc/3.2.3/140-gcc-3.2.3-libffi-1.patch +++ /dev/null @@ -1,6864 +0,0 @@ -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/Makefile.am gcc/libffi/Makefile.am ---- gcc-3.2.2.orig/libffi/Makefile.am Tue Jan 28 10:43:56 2003 -+++ gcc/libffi/Makefile.am Tue Jan 28 10:48:33 2003 -@@ -8,14 +8,17 @@ - src/mips/n32.s src/mips/o32.S src/mips/o32.s \ - src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S \ - src/x86/ffi.c src/x86/sysv.S src/x86/win32.S \ -+ src/x86/ffi64.c src/x86/unix64.S \ - src/alpha/ffi.c src/alpha/osf.S \ - src/m68k/ffi.c src/m68k/sysv.S \ - src/powerpc/ffi.c src/powerpc/sysv.S \ - src/powerpc/ppc_closure.S src/powerpc/asm.h \ - src/powerpc/ffi_darwin.c \ - src/powerpc/darwin.S src/powerpc/aix.S \ -- src/powerpc/darwin_closure.S src/powerpc/aix_closures.S \ -- src/arm/ffi.c src/arm/sysv.S -+ src/powerpc/darwin_closure.S src/powerpc/aix_closure.S \ -+ src/arm/ffi.c src/arm/sysv.S \ -+ src/s390/ffi.c src/s390/sysv.S \ -+ src/sh/ffi.c src/sh/sysv.S - - VPATH = @srcdir@:@srcdir@/src:@srcdir@/src/@TARGETDIR@ - -@@ -83,6 +86,7 @@ - ffitest_LDFLAGS = -shared-libgcc - - TARGET_SRC_MIPS_GCC = src/mips/ffi.c src/mips/o32.S src/mips/n32.S -+TARGET_SRC_MIPS_LINUX = src/mips/ffi.c src/mips/o32.S - TARGET_SRC_MIPS_SGI = src/mips/ffi.c src/mips/o32.s src/mips/n32.s - TARGET_SRC_X86 = src/x86/ffi.c src/x86/sysv.S - TARGET_SRC_X86_WIN32 = src/x86/ffi.c src/x86/win32.S -@@ -91,9 +95,12 @@ - TARGET_SRC_IA64 = src/ia64/ffi.c src/ia64/unix.S - TARGET_SRC_M68K = src/m68k/ffi.c src/m68k/sysv.S - TARGET_SRC_POWERPC = src/powerpc/ffi.c src/powerpc/sysv.S src/powerpc/ppc_closure.S --TARGET_SRC_POWERPC_AIX = src/powerpc/ffi_darwin.c src/powerpc/aix.S src/powerpc/aix_closures.S -+TARGET_SRC_POWERPC_AIX = src/powerpc/ffi_darwin.c src/powerpc/aix.S src/powerpc/aix_closure.S - TARGET_SRC_POWERPC_DARWIN = src/powerpc/ffi_darwin.c src/powerpc/darwin.S src/powerpc/darwin_closure.S - TARGET_SRC_ARM = src/arm/sysv.S src/arm/ffi.c -+TARGET_SRC_S390 = src/s390/sysv.S src/s390/ffi.c -+TARGET_SRC_X86_64 = src/x86/ffi64.c src/x86/unix64.S src/x86/ffi.c src/x86/sysv.S -+TARGET_SRC_SH = src/sh/sysv.S src/sh/ffi.c - - ##libffi_la_SOURCES = src/debug.c src/prep_cif.c src/types.c $(TARGET_SRC_@TARGET@) - ## Work around automake deficiency -@@ -103,6 +110,10 @@ - libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_GCC) - libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_GCC) - endif -+if MIPS_LINUX -+libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_LINUX) -+libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_LINUX) -+endif - if MIPS_SGI - libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_SGI) - libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_SGI) -@@ -147,6 +158,18 @@ - libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_ARM) - libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_ARM) - endif -+if S390 -+libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_S390) -+libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_S390) -+endif -+if X86_64 -+libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_X86_64) -+libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_X86_64) -+endif -+if SH -+libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_SH) -+libfficonvenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_SH) -+endif - - AM_CFLAGS = -fexceptions - -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/Makefile.in gcc/libffi/Makefile.in ---- gcc-3.2.2.orig/libffi/Makefile.in Wed Jan 29 07:59:05 2003 -+++ gcc/libffi/Makefile.in Wed Jan 29 07:58:58 2003 -@@ -91,14 +91,17 @@ - src/mips/n32.s src/mips/o32.S src/mips/o32.s \ - src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S \ - src/x86/ffi.c src/x86/sysv.S src/x86/win32.S \ -+ src/x86/ffi64.c src/x86/unix64.S \ - src/alpha/ffi.c src/alpha/osf.S \ - src/m68k/ffi.c src/m68k/sysv.S \ - src/powerpc/ffi.c src/powerpc/sysv.S \ - src/powerpc/ppc_closure.S src/powerpc/asm.h \ - src/powerpc/ffi_darwin.c \ - src/powerpc/darwin.S src/powerpc/aix.S \ -- src/powerpc/darwin_closure.S src/powerpc/aix_closures.S \ -- src/arm/ffi.c src/arm/sysv.S -+ src/powerpc/darwin_closure.S src/powerpc/aix_closure.S \ -+ src/arm/ffi.c src/arm/sysv.S \ -+ src/s390/ffi.c src/s390/sysv.S \ -+ src/sh/ffi.c src/sh/sysv.S - - - VPATH = @srcdir@:@srcdir@/src:@srcdir@/src/@TARGETDIR@ -@@ -162,6 +165,7 @@ - ffitest_LDFLAGS = -shared-libgcc - - TARGET_SRC_MIPS_GCC = src/mips/ffi.c src/mips/o32.S src/mips/n32.S -+TARGET_SRC_MIPS_LINUX = src/mips/ffi.c src/mips/o32.S - TARGET_SRC_MIPS_SGI = src/mips/ffi.c src/mips/o32.s src/mips/n32.s - TARGET_SRC_X86 = src/x86/ffi.c src/x86/sysv.S - TARGET_SRC_X86_WIN32 = src/x86/ffi.c src/x86/win32.S -@@ -170,14 +174,18 @@ - TARGET_SRC_IA64 = src/ia64/ffi.c src/ia64/unix.S - TARGET_SRC_M68K = src/m68k/ffi.c src/m68k/sysv.S - TARGET_SRC_POWERPC = src/powerpc/ffi.c src/powerpc/sysv.S src/powerpc/ppc_closure.S --TARGET_SRC_POWERPC_AIX = src/powerpc/ffi_darwin.c src/powerpc/aix.S src/powerpc/aix_closures.S -+TARGET_SRC_POWERPC_AIX = src/powerpc/ffi_darwin.c src/powerpc/aix.S src/powerpc/aix_closure.S - TARGET_SRC_POWERPC_DARWIN = src/powerpc/ffi_darwin.c src/powerpc/darwin.S src/powerpc/darwin_closure.S - TARGET_SRC_ARM = src/arm/sysv.S src/arm/ffi.c -+TARGET_SRC_S390 = src/s390/sysv.S src/s390/ffi.c -+TARGET_SRC_X86_64 = src/x86/ffi64.c src/x86/unix64.S src/x86/ffi.c src/x86/sysv.S -+TARGET_SRC_SH = src/sh/sysv.S src/sh/ffi.c - - libffi_la_common_SOURCES = src/debug.c src/prep_cif.c src/types.c \ - src/raw_api.c src/java_raw_api.c - - @MIPS_GCC_TRUE@libffi_la_SOURCES = @MIPS_GCC_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_GCC) -+@MIPS_LINUX_TRUE@libffi_la_SOURCES = @MIPS_LINUX_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_LINUX) - @MIPS_SGI_TRUE@libffi_la_SOURCES = @MIPS_SGI_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_SGI) - @X86_TRUE@libffi_la_SOURCES = @X86_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86) - @X86_WIN32_TRUE@libffi_la_SOURCES = @X86_WIN32_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86_WIN32) -@@ -189,7 +197,11 @@ - @POWERPC_AIX_TRUE@libffi_la_SOURCES = @POWERPC_AIX_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_POWERPC_AIX) - @POWERPC_DARWIN_TRUE@libffi_la_SOURCES = @POWERPC_DARWIN_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_POWERPC_DARWIN) - @ARM_TRUE@libffi_la_SOURCES = @ARM_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_ARM) -+@S390_TRUE@libffi_la_SOURCES = @S390_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_S390) -+@X86_64_TRUE@libffi_la_SOURCES = @X86_64_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86_64) -+@SH_TRUE@libffi_la_SOURCES = @SH_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_SH) - @MIPS_GCC_TRUE@libffi_convenience_la_SOURCES = @MIPS_GCC_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_GCC) -+@MIPS_LINUX_TRUE@libffi_convenience_la_SOURCES = @MIPS_LINUX_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_LINUX) - @MIPS_SGI_TRUE@libffi_convenience_la_SOURCES = @MIPS_SGI_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_SGI) - @X86_TRUE@libffi_convenience_la_SOURCES = @X86_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86) - @X86_WIN32_TRUE@libffi_convenience_la_SOURCES = @X86_WIN32_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86_WIN32) -@@ -201,6 +213,9 @@ - @POWERPC_AIX_TRUE@libffi_convenience_la_SOURCES = @POWERPC_AIX_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_POWERPC_AIX) - @POWERPC_DARWIN_TRUE@libffi_convenience_la_SOURCES = @POWERPC_DARWIN_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_POWERPC_DARWIN) - @ARM_TRUE@libffi_convenience_la_SOURCES = @ARM_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_ARM) -+@S390_TRUE@libffi_convenience_la_SOURCES = @S390_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_S390) -+@X86_64_TRUE@libffi_convenience_la_SOURCES = @X86_64_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86_64) -+@SH_TRUE@libfficonvenience_la_SOURCES = @SH_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_SH) - - AM_CFLAGS = -fexceptions - -@@ -208,7 +223,7 @@ - - INCLUDES = -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src - ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 --mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs -+mkinstalldirs = $(SHELL) $(top_srcdir)/${libffi_basedir}/../mkinstalldirs - CONFIG_HEADER = fficonfig.h - CONFIG_CLEAN_FILES = - LTLIBRARIES = $(noinst_LTLIBRARIES) $(toolexeclib_LTLIBRARIES) -@@ -220,10 +235,6 @@ - LIBS = @LIBS@ - libffi_convenience_la_LDFLAGS = - libffi_convenience_la_LIBADD = --@POWERPC_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ --@POWERPC_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ --@POWERPC_TRUE@src/java_raw_api.lo src/powerpc/ffi.lo \ --@POWERPC_TRUE@src/powerpc/sysv.lo src/powerpc/ppc_closure.lo - @ALPHA_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ - @ALPHA_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ - @ALPHA_TRUE@src/java_raw_api.lo src/alpha/ffi.lo src/alpha/osf.lo -@@ -234,12 +245,29 @@ - @MIPS_GCC_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ - @MIPS_GCC_TRUE@src/java_raw_api.lo src/mips/ffi.lo src/mips/o32.lo \ - @MIPS_GCC_TRUE@src/mips/n32.lo --@X86_WIN32_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ --@X86_WIN32_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ --@X86_WIN32_TRUE@src/java_raw_api.lo src/x86/ffi.lo src/x86/win32.lo -+@S390_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \ -+@S390_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ -+@S390_TRUE@src/s390/sysv.lo src/s390/ffi.lo - @M68K_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \ - @M68K_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ - @M68K_TRUE@src/m68k/ffi.lo src/m68k/sysv.lo -+@X86_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \ -+@X86_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ -+@X86_TRUE@src/x86/ffi.lo src/x86/sysv.lo -+@POWERPC_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ -+@POWERPC_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ -+@POWERPC_TRUE@src/java_raw_api.lo src/powerpc/ffi.lo \ -+@POWERPC_TRUE@src/powerpc/sysv.lo src/powerpc/ppc_closure.lo -+@MIPS_LINUX_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ -+@MIPS_LINUX_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ -+@MIPS_LINUX_TRUE@src/java_raw_api.lo src/mips/ffi.lo src/mips/o32.lo -+@X86_WIN32_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ -+@X86_WIN32_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ -+@X86_WIN32_TRUE@src/java_raw_api.lo src/x86/ffi.lo src/x86/win32.lo -+@X86_64_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ -+@X86_64_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ -+@X86_64_TRUE@src/java_raw_api.lo src/x86/ffi64.lo src/x86/unix64.lo \ -+@X86_64_TRUE@src/x86/ffi.lo src/x86/sysv.lo - @SPARC_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ - @SPARC_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ - @SPARC_TRUE@src/java_raw_api.lo src/sparc/ffi.lo src/sparc/v8.lo \ -@@ -247,62 +275,75 @@ - @POWERPC_AIX_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ - @POWERPC_AIX_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ - @POWERPC_AIX_TRUE@src/java_raw_api.lo src/powerpc/ffi_darwin.lo \ --@POWERPC_AIX_TRUE@src/powerpc/aix.lo src/powerpc/aix_closures.lo --@X86_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \ --@X86_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ --@X86_TRUE@src/x86/ffi.lo src/x86/sysv.lo --@ARM_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \ --@ARM_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ --@ARM_TRUE@src/arm/sysv.lo src/arm/ffi.lo -+@POWERPC_AIX_TRUE@src/powerpc/aix.lo src/powerpc/aix_closure.lo -+@MIPS_SGI_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ -+@MIPS_SGI_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ -+@MIPS_SGI_TRUE@src/java_raw_api.lo src/mips/ffi.lo src/mips/o32.lo \ -+@MIPS_SGI_TRUE@src/mips/n32.lo - @POWERPC_DARWIN_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ - @POWERPC_DARWIN_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ - @POWERPC_DARWIN_TRUE@src/java_raw_api.lo src/powerpc/ffi_darwin.lo \ - @POWERPC_DARWIN_TRUE@src/powerpc/darwin.lo \ - @POWERPC_DARWIN_TRUE@src/powerpc/darwin_closure.lo --@MIPS_SGI_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ --@MIPS_SGI_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ --@MIPS_SGI_TRUE@src/java_raw_api.lo src/mips/ffi.lo src/mips/o32.lo \ --@MIPS_SGI_TRUE@src/mips/n32.lo -+@ARM_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \ -+@ARM_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ -+@ARM_TRUE@src/arm/sysv.lo src/arm/ffi.lo -+@SH_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \ -+@SH_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ -+@SH_TRUE@src/sh/sysv.lo src/sh/ffi.lo - libffi_la_LIBADD = -+@SH_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo src/types.lo \ -+@SH_TRUE@src/raw_api.lo src/java_raw_api.lo src/sh/sysv.lo \ -+@SH_TRUE@src/sh/ffi.lo -+@IA64_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ -+@IA64_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ -+@IA64_TRUE@src/ia64/ffi.lo src/ia64/unix.lo -+@X86_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo src/types.lo \ -+@X86_TRUE@src/raw_api.lo src/java_raw_api.lo src/x86/ffi.lo \ -+@X86_TRUE@src/x86/sysv.lo - @POWERPC_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ - @POWERPC_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ - @POWERPC_TRUE@src/powerpc/ffi.lo src/powerpc/sysv.lo \ - @POWERPC_TRUE@src/powerpc/ppc_closure.lo --@ALPHA_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ --@ALPHA_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ --@ALPHA_TRUE@src/alpha/ffi.lo src/alpha/osf.lo --@IA64_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ --@IA64_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ --@IA64_TRUE@src/ia64/ffi.lo src/ia64/unix.lo --@MIPS_GCC_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ --@MIPS_GCC_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ --@MIPS_GCC_TRUE@src/mips/ffi.lo src/mips/o32.lo src/mips/n32.lo --@X86_WIN32_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ --@X86_WIN32_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ --@X86_WIN32_TRUE@src/x86/ffi.lo src/x86/win32.lo --@M68K_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ --@M68K_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ --@M68K_TRUE@src/m68k/ffi.lo src/m68k/sysv.lo -+@MIPS_LINUX_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ -+@MIPS_LINUX_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ -+@MIPS_LINUX_TRUE@src/mips/ffi.lo src/mips/o32.lo - @SPARC_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ - @SPARC_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ - @SPARC_TRUE@src/sparc/ffi.lo src/sparc/v8.lo src/sparc/v9.lo - @POWERPC_AIX_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ - @POWERPC_AIX_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ - @POWERPC_AIX_TRUE@src/powerpc/ffi_darwin.lo src/powerpc/aix.lo \ --@POWERPC_AIX_TRUE@src/powerpc/aix_closures.lo --@X86_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo src/types.lo \ --@X86_TRUE@src/raw_api.lo src/java_raw_api.lo src/x86/ffi.lo \ --@X86_TRUE@src/x86/sysv.lo -+@POWERPC_AIX_TRUE@src/powerpc/aix_closure.lo -+@MIPS_SGI_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ -+@MIPS_SGI_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ -+@MIPS_SGI_TRUE@src/mips/ffi.lo src/mips/o32.lo src/mips/n32.lo - @ARM_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo src/types.lo \ - @ARM_TRUE@src/raw_api.lo src/java_raw_api.lo src/arm/sysv.lo \ - @ARM_TRUE@src/arm/ffi.lo -+@ALPHA_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ -+@ALPHA_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ -+@ALPHA_TRUE@src/alpha/ffi.lo src/alpha/osf.lo -+@MIPS_GCC_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ -+@MIPS_GCC_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ -+@MIPS_GCC_TRUE@src/mips/ffi.lo src/mips/o32.lo src/mips/n32.lo -+@S390_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ -+@S390_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ -+@S390_TRUE@src/s390/sysv.lo src/s390/ffi.lo -+@M68K_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ -+@M68K_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ -+@M68K_TRUE@src/m68k/ffi.lo src/m68k/sysv.lo -+@X86_WIN32_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ -+@X86_WIN32_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ -+@X86_WIN32_TRUE@src/x86/ffi.lo src/x86/win32.lo -+@X86_64_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ -+@X86_64_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ -+@X86_64_TRUE@src/x86/ffi64.lo src/x86/unix64.lo src/x86/ffi.lo \ -+@X86_64_TRUE@src/x86/sysv.lo - @POWERPC_DARWIN_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ - @POWERPC_DARWIN_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ - @POWERPC_DARWIN_TRUE@src/powerpc/ffi_darwin.lo src/powerpc/darwin.lo \ - @POWERPC_DARWIN_TRUE@src/powerpc/darwin_closure.lo --@MIPS_SGI_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ --@MIPS_SGI_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ --@MIPS_SGI_TRUE@src/mips/ffi.lo src/mips/o32.lo src/mips/n32.lo - noinst_PROGRAMS = ffitest$(EXEEXT) - PROGRAMS = $(noinst_PROGRAMS) - -@@ -578,8 +616,8 @@ - -chmod 777 $(distdir) - $(mkinstalldirs) $(distdir)/src/alpha $(distdir)/src/arm \ - $(distdir)/src/m68k $(distdir)/src/mips \ -- $(distdir)/src/powerpc $(distdir)/src/sparc \ -- $(distdir)/src/x86 -+ $(distdir)/src/powerpc $(distdir)/src/s390 $(distdir)/src/sh \ -+ $(distdir)/src/sparc $(distdir)/src/x86 - @for file in $(DISTFILES); do \ - if test -f $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/acinclude.m4 gcc/libffi/acinclude.m4 ---- gcc-3.2.2.orig/libffi/acinclude.m4 Sun Sep 10 16:43:14 2000 -+++ gcc/libffi/acinclude.m4 Tue Dec 17 03:22:47 2002 -@@ -4,5 +4,8 @@ - dnl to add a definition of LIBTOOL to Makefile.in. - ifelse(yes,no,[ - AC_DEFUN([AC_PROG_LIBTOOL],) -+AC_DEFUN([AM_PROG_LIBTOOL],) - AC_SUBST(LIBTOOL) - ]) -+ -+sinclude(../config/accross.m4) -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/aclocal.m4 gcc/libffi/aclocal.m4 ---- gcc-3.2.2.orig/libffi/aclocal.m4 Fri Feb 1 07:25:31 2002 -+++ gcc/libffi/aclocal.m4 Tue Dec 17 03:22:47 2002 -@@ -1,6 +1,6 @@ --dnl aclocal.m4 generated automatically by aclocal 1.4 -+dnl aclocal.m4 generated automatically by aclocal 1.4-p5 - --dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. -+dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. - dnl This file is free software; the Free Software Foundation - dnl gives unlimited permission to copy and/or distribute it, - dnl with or without modifications, as long as this notice is preserved. -@@ -16,108 +16,15 @@ - dnl to add a definition of LIBTOOL to Makefile.in. - ifelse(yes,no,[ - AC_DEFUN([AC_PROG_LIBTOOL],) -+AC_DEFUN([AM_PROG_LIBTOOL],) - AC_SUBST(LIBTOOL) - ]) - --AC_DEFUN([AC_COMPILE_CHECK_SIZEOF], --[changequote(<<, >>)dnl --dnl The name to #define. --define(<>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl --dnl The cache variable name. --define(<>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl --changequote([, ])dnl --AC_MSG_CHECKING(size of $1) --AC_CACHE_VAL(AC_CV_NAME, --[for ac_size in 4 8 1 2 16 12 $2 ; do # List sizes in rough order of prevalence. -- AC_TRY_COMPILE([#include "confdefs.h" --#include --$2 --], [switch (0) case 0: case (sizeof ($1) == $ac_size):;], AC_CV_NAME=$ac_size) -- if test x$AC_CV_NAME != x ; then break; fi --done --]) --if test x$AC_CV_NAME = x ; then -- AC_MSG_ERROR([cannot determine a size for $1]) --fi --AC_MSG_RESULT($AC_CV_NAME) --AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME, [The number of bytes in type $1]) --undefine([AC_TYPE_NAME])dnl --undefine([AC_CV_NAME])dnl --]) -- --AC_DEFUN([AC_C_BIGENDIAN_CROSS], --[AC_CACHE_CHECK(whether byte ordering is bigendian, ac_cv_c_bigendian, --[ac_cv_c_bigendian=unknown --# See if sys/param.h defines the BYTE_ORDER macro. --AC_TRY_COMPILE([#include --#include ], [ --#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN -- bogus endian macros --#endif], [# It does; now see whether it defined to BIG_ENDIAN or not. --AC_TRY_COMPILE([#include --#include ], [ --#if BYTE_ORDER != BIG_ENDIAN -- not big endian --#endif], ac_cv_c_bigendian=yes, ac_cv_c_bigendian=no)]) --if test $ac_cv_c_bigendian = unknown; then --AC_TRY_RUN([main () { -- /* Are we little or big endian? From Harbison&Steele. */ -- union -- { -- long l; -- char c[sizeof (long)]; -- } u; -- u.l = 1; -- exit (u.c[sizeof (long) - 1] == 1); --}], ac_cv_c_bigendian=no, ac_cv_c_bigendian=yes, --[ echo $ac_n "cross-compiling... " 2>&AC_FD_MSG ]) --fi]) --if test $ac_cv_c_bigendian = unknown; then --AC_MSG_CHECKING(to probe for byte ordering) --[ --cat >conftest.c <&AC_FD_MSG -- ac_cv_c_bigendian=yes -- fi -- if test `grep -l LiTTleEnDian conftest.o` ; then -- echo $ac_n ' little endian probe OK, ' 1>&AC_FD_MSG -- if test $ac_cv_c_bigendian = yes ; then -- ac_cv_c_bigendian=unknown; -- else -- ac_cv_c_bigendian=no -- fi -- fi -- echo $ac_n 'guessing bigendian ... ' >&AC_FD_MSG -- fi -- fi --AC_MSG_RESULT($ac_cv_c_bigendian) --fi --if test $ac_cv_c_bigendian = yes; then -- AC_DEFINE(WORDS_BIGENDIAN, 1, [whether byteorder is bigendian]) -- BYTEORDER=4321 --else -- BYTEORDER=1234 --fi --AC_DEFINE_UNQUOTED(BYTEORDER, $BYTEORDER, [1234 = LIL_ENDIAN, 4321 = BIGENDIAN]) --if test $ac_cv_c_bigendian = unknown; then -- AC_MSG_ERROR(unknown endianess - sorry, please pre-set ac_cv_c_bigendian) --fi --]) -+sinclude(../config/accross.m4) - - # Like AC_CONFIG_HEADER, but automatically create stamp file. - --AC_DEFUN(AM_CONFIG_HEADER, -+AC_DEFUN([AM_CONFIG_HEADER], - [AC_PREREQ([2.12]) - AC_CONFIG_HEADER([$1]) - dnl When config.status generates a header, we must update the stamp-h file. -@@ -147,7 +54,7 @@ - dnl Usage: - dnl AM_INIT_AUTOMAKE(package,version, [no-define]) - --AC_DEFUN(AM_INIT_AUTOMAKE, -+AC_DEFUN([AM_INIT_AUTOMAKE], - [AC_REQUIRE([AC_PROG_INSTALL]) - PACKAGE=[$1] - AC_SUBST(PACKAGE) -@@ -175,7 +82,7 @@ - # Check to make sure that the build environment is sane. - # - --AC_DEFUN(AM_SANITY_CHECK, -+AC_DEFUN([AM_SANITY_CHECK], - [AC_MSG_CHECKING([whether build environment is sane]) - # Just in case - sleep 1 -@@ -216,7 +123,7 @@ - - dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) - dnl The program must properly implement --version. --AC_DEFUN(AM_MISSING_PROG, -+AC_DEFUN([AM_MISSING_PROG], - [AC_MSG_CHECKING(for working $2) - # Run test in a subshell; some versions of sh will print an error if - # an executable is not found, even if stderr is redirected. -@@ -235,7 +142,7 @@ - - # serial 1 - --AC_DEFUN(AM_MAINTAINER_MODE, -+AC_DEFUN([AM_MAINTAINER_MODE], - [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) - dnl maintainer-mode is disabled by default - AC_ARG_ENABLE(maintainer-mode, -@@ -252,7 +159,7 @@ - - # Define a conditional. - --AC_DEFUN(AM_CONDITIONAL, -+AC_DEFUN([AM_CONDITIONAL], - [AC_SUBST($1_TRUE) - AC_SUBST($1_FALSE) - if $2; then -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/configure gcc/libffi/configure ---- gcc-3.2.2.orig/libffi/configure Wed Jan 29 07:59:05 2003 -+++ gcc/libffi/configure Sat Feb 1 20:16:19 2003 -@@ -633,17 +633,16 @@ - - if test "${srcdir}" = "."; then - if test "${with_target_subdir}" != "."; then -- libffi_basedir="${srcdir}/${with_multisrctop}.." -+ libffi_basedir="${with_multisrctop}../" - else -- libffi_basedir="${srcdir}/${with_multisrctop}" -+ libffi_basedir="${with_multisrctop}" - fi - else -- libffi_basedir="${srcdir}" -+ libffi_basedir= - fi - -- - ac_aux_dir= --for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do -+for ac_dir in ${libffi_basedir}.. $srcdir/${libffi_basedir}..; do - if test -f $ac_dir/install-sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" -@@ -655,13 +654,14 @@ - fi - done - if test -z "$ac_aux_dir"; then -- { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } -+ { echo "configure: error: can not find install-sh or install.sh in ${libffi_basedir}.. $srcdir/${libffi_basedir}.." 1>&2; exit 1; } - fi - ac_config_guess=$ac_aux_dir/config.guess - ac_config_sub=$ac_aux_dir/config.sub - ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. - - -+ - # Make sure we can run config.sub. - if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : - else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } -@@ -1238,9 +1238,18 @@ - ;; - - hpux10.20*|hpux11*) -- lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' -- lt_cv_file_magic_cmd=/usr/bin/file -- lt_cv_file_magic_test_file=/usr/lib/libc.sl -+ case $host_cpu in -+ hppa*) -+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' -+ lt_cv_file_magic_cmd=/usr/bin/file -+ lt_cv_file_magic_test_file=/usr/lib/libc.sl -+ ;; -+ ia64*) -+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' -+ lt_cv_file_magic_cmd=/usr/bin/file -+ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so -+ ;; -+ esac - ;; - - irix5* | irix6*) -@@ -1267,7 +1276,7 @@ - # This must be Linux ELF. - linux-gnu*) - case $host_cpu in -- alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* ) -+ alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | sh* ) - lt_cv_deplibs_check_method=pass_all ;; - *) - # glibc up to 2.1.1 does not perform some relocations on ARM -@@ -1330,13 +1339,13 @@ - deplibs_check_method=$lt_cv_deplibs_check_method - - echo $ac_n "checking for object suffix""... $ac_c" 1>&6 --echo "configure:1334: checking for object suffix" >&5 -+echo "configure:1343: checking for object suffix" >&5 - if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - rm -f conftest* - echo 'int i = 1;' > conftest.$ac_ext --if { (eval echo configure:1340: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:1349: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - for ac_file in conftest.*; do - case $ac_file in - *.c) ;; -@@ -1356,7 +1365,7 @@ - - - echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 --echo "configure:1360: checking for executable suffix" >&5 -+echo "configure:1369: checking for executable suffix" >&5 - if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -1366,7 +1375,7 @@ - rm -f conftest* - echo 'int main () { return 0; }' > conftest.$ac_ext - ac_cv_exeext= -- if { (eval echo configure:1370: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then -+ if { (eval echo configure:1379: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then - for file in conftest.*; do - case $file in - *.c | *.o | *.obj) ;; -@@ -1399,7 +1408,7 @@ - file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6 --echo "configure:1403: checking for ${ac_tool_prefix}file" >&5 -+echo "configure:1412: checking for ${ac_tool_prefix}file" >&5 - if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -1461,7 +1470,7 @@ - if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - echo $ac_n "checking for file""... $ac_c" 1>&6 --echo "configure:1465: checking for file" >&5 -+echo "configure:1474: checking for file" >&5 - if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -1532,7 +1541,7 @@ - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. - set dummy ${ac_tool_prefix}ranlib; ac_word=$2 - echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 --echo "configure:1536: checking for $ac_word" >&5 -+echo "configure:1545: checking for $ac_word" >&5 - if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -1564,7 +1573,7 @@ - # Extract the first word of "ranlib", so it can be a program name with args. - set dummy ranlib; ac_word=$2 - echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 --echo "configure:1568: checking for $ac_word" >&5 -+echo "configure:1577: checking for $ac_word" >&5 - if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -1599,7 +1608,7 @@ - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. - set dummy ${ac_tool_prefix}strip; ac_word=$2 - echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 --echo "configure:1603: checking for $ac_word" >&5 -+echo "configure:1612: checking for $ac_word" >&5 - if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -1631,7 +1640,7 @@ - # Extract the first word of "strip", so it can be a program name with args. - set dummy strip; ac_word=$2 - echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 --echo "configure:1635: checking for $ac_word" >&5 -+echo "configure:1644: checking for $ac_word" >&5 - if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -1698,8 +1707,8 @@ - case $host in - *-*-irix6*) - # Find out which ABI we are using. -- echo '#line 1702 "configure"' > conftest.$ac_ext -- if { (eval echo configure:1703: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+ echo '#line 1711 "configure"' > conftest.$ac_ext -+ if { (eval echo configure:1712: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" -@@ -1715,12 +1724,70 @@ - rm -rf conftest* - ;; - -+ia64-*-hpux*) -+ # Find out which ABI we are using. -+ echo 'int i;' > conftest.$ac_ext -+ if { (eval echo configure:1731: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+ case "`/usr/bin/file conftest.o`" in -+ *ELF-32*) -+ HPUX_IA64_MODE="32" -+ ;; -+ *ELF-64*) -+ HPUX_IA64_MODE="64" -+ ;; -+ esac -+ fi -+ rm -rf conftest* -+ ;; -+ -+x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) -+ # Find out which ABI we are using. -+ echo 'int i;' > conftest.$ac_ext -+ if { (eval echo configure:1747: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+ case "`/usr/bin/file conftest.o`" in -+ *32-bit*) -+ case $host in -+ x86_64-*linux*) -+ LD="${LD-ld} -m elf_i386" -+ ;; -+ ppc64-*linux*) -+ LD="${LD-ld} -m elf32ppclinux" -+ ;; -+ s390x-*linux*) -+ LD="${LD-ld} -m elf_s390" -+ ;; -+ sparc64-*linux*) -+ LD="${LD-ld} -m elf32_sparc" -+ ;; -+ esac -+ ;; -+ *64-bit*) -+ case $host in -+ x86_64-*linux*) -+ LD="${LD-ld} -m elf_x86_64" -+ ;; -+ ppc*-*linux*|powerpc*-*linux*) -+ LD="${LD-ld} -m elf64ppc" -+ ;; -+ s390*-*linux*) -+ LD="${LD-ld} -m elf64_s390" -+ ;; -+ sparc*-*linux*) -+ LD="${LD-ld} -m elf64_sparc" -+ ;; -+ esac -+ ;; -+ esac -+ fi -+ rm -rf conftest* -+ ;; -+ - *-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -belf" - echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 --echo "configure:1724: checking whether the C compiler needs -belf" >&5 -+echo "configure:1791: checking whether the C compiler needs -belf" >&5 - if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -1733,14 +1800,14 @@ - cross_compiling=$ac_cv_prog_cc_cross - - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:1811: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - lt_cv_cc_needs_belf=yes - else -@@ -1868,7 +1935,7 @@ - # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" - # ./install, which can be erroneously created by make from ./install.sh. - echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 --echo "configure:1872: checking for a BSD compatible install" >&5 -+echo "configure:1939: checking for a BSD compatible install" >&5 - if test -z "$INSTALL"; then - if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -1921,7 +1988,7 @@ - test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - - echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 --echo "configure:1925: checking whether build environment is sane" >&5 -+echo "configure:1992: checking whether build environment is sane" >&5 - # Just in case - sleep 1 - echo timestamp > conftestfile -@@ -1978,7 +2045,7 @@ - test "$program_transform_name" = "" && program_transform_name="s,x,x," - - echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 --echo "configure:1982: checking whether ${MAKE-make} sets \${MAKE}" >&5 -+echo "configure:2049: checking whether ${MAKE-make} sets \${MAKE}" >&5 - set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -2017,7 +2084,7 @@ - - missing_dir=`cd $ac_aux_dir && pwd` - echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 --echo "configure:2021: checking for working aclocal" >&5 -+echo "configure:2088: checking for working aclocal" >&5 - # Run test in a subshell; some versions of sh will print an error if - # an executable is not found, even if stderr is redirected. - # Redirect stdin to placate older versions of autoconf. Sigh. -@@ -2030,7 +2097,7 @@ - fi - - echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 --echo "configure:2034: checking for working autoconf" >&5 -+echo "configure:2101: checking for working autoconf" >&5 - # Run test in a subshell; some versions of sh will print an error if - # an executable is not found, even if stderr is redirected. - # Redirect stdin to placate older versions of autoconf. Sigh. -@@ -2043,7 +2110,7 @@ - fi - - echo $ac_n "checking for working automake""... $ac_c" 1>&6 --echo "configure:2047: checking for working automake" >&5 -+echo "configure:2114: checking for working automake" >&5 - # Run test in a subshell; some versions of sh will print an error if - # an executable is not found, even if stderr is redirected. - # Redirect stdin to placate older versions of autoconf. Sigh. -@@ -2056,7 +2123,7 @@ - fi - - echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 --echo "configure:2060: checking for working autoheader" >&5 -+echo "configure:2127: checking for working autoheader" >&5 - # Run test in a subshell; some versions of sh will print an error if - # an executable is not found, even if stderr is redirected. - # Redirect stdin to placate older versions of autoconf. Sigh. -@@ -2069,7 +2136,7 @@ - fi - - echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 --echo "configure:2073: checking for working makeinfo" >&5 -+echo "configure:2140: checking for working makeinfo" >&5 - # Run test in a subshell; some versions of sh will print an error if - # an executable is not found, even if stderr is redirected. - # Redirect stdin to placate older versions of autoconf. Sigh. -@@ -2086,7 +2153,7 @@ - - - echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 --echo "configure:2090: checking for executable suffix" >&5 -+echo "configure:2157: checking for executable suffix" >&5 - if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -2096,7 +2163,7 @@ - rm -f conftest* - echo 'int main () { return 0; }' > conftest.$ac_ext - ac_cv_exeext= -- if { (eval echo configure:2100: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then -+ if { (eval echo configure:2167: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then - for file in conftest.*; do - case $file in - *.c | *.o | *.obj) ;; -@@ -2117,7 +2184,7 @@ - ac_exeext=$EXEEXT - - echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 --echo "configure:2121: checking whether to enable maintainer-specific portions of Makefiles" >&5 -+echo "configure:2188: checking whether to enable maintainer-specific portions of Makefiles" >&5 - # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. - if test "${enable_maintainer_mode+set}" = set; then - enableval="$enable_maintainer_mode" -@@ -2143,7 +2210,7 @@ - # Extract the first word of "gcc", so it can be a program name with args. - set dummy gcc; ac_word=$2 - echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 --echo "configure:2147: checking for $ac_word" >&5 -+echo "configure:2214: checking for $ac_word" >&5 - if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -2173,7 +2240,7 @@ - # Extract the first word of "cc", so it can be a program name with args. - set dummy cc; ac_word=$2 - echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 --echo "configure:2177: checking for $ac_word" >&5 -+echo "configure:2244: checking for $ac_word" >&5 - if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -2224,7 +2291,7 @@ - # Extract the first word of "cl", so it can be a program name with args. - set dummy cl; ac_word=$2 - echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 --echo "configure:2228: checking for $ac_word" >&5 -+echo "configure:2295: checking for $ac_word" >&5 - if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -2256,7 +2323,7 @@ - fi - - echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 --echo "configure:2260: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 -+echo "configure:2327: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 - - ac_ext=c - # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -@@ -2267,12 +2334,12 @@ - - cat > conftest.$ac_ext << EOF - --#line 2271 "configure" -+#line 2338 "configure" - #include "confdefs.h" - - main(){return(0);} - EOF --if { (eval echo configure:2276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:2343: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - ac_cv_prog_cc_works=yes - # If we can't run a trivial program, we are probably using a cross compiler. - if (./conftest; exit) 2>/dev/null; then -@@ -2298,12 +2365,12 @@ - { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } - fi - echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 --echo "configure:2302: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 -+echo "configure:2369: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 - echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 - cross_compiling=$ac_cv_prog_cc_cross - - echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 --echo "configure:2307: checking whether we are using GNU C" >&5 -+echo "configure:2374: checking whether we are using GNU C" >&5 - if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -2312,7 +2379,7 @@ - yes; - #endif - EOF --if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2316: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then -+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2383: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then - ac_cv_prog_gcc=yes - else - ac_cv_prog_gcc=no -@@ -2331,7 +2398,7 @@ - ac_save_CFLAGS="$CFLAGS" - CFLAGS= - echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 --echo "configure:2335: checking whether ${CC-cc} accepts -g" >&5 -+echo "configure:2402: checking whether ${CC-cc} accepts -g" >&5 - if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -2381,17 +2448,23 @@ - i*86-*-mingw*) TARGET=X86_WIN32; TARGETDIR=x86;; - sparc-sun-4*) TARGET=SPARC; TARGETDIR=sparc;; - sparc*-sun-*) TARGET=SPARC; TARGETDIR=sparc;; --sparc-*-linux*) TARGET=SPARC; TARGETDIR=sparc;; --sparc64-*-linux*) TARGET=SPARC; TARGETDIR=sparc;; --alpha*-*-linux* | alpha*-*-osf* | alpha*-*-freebsd*) TARGET=ALPHA; TARGETDIR=alpha;; -+sparc-*-linux* | sparc-*-netbsdelf*) TARGET=SPARC; TARGETDIR=sparc;; -+sparc64-*-linux* | sparc64-*-netbsd*) TARGET=SPARC; TARGETDIR=sparc;; -+alpha*-*-linux* | alpha*-*-osf* | alpha*-*-freebsd* | alpha*-*-netbsd*) TARGET=ALPHA; TARGETDIR=alpha;; - ia64*-*-*) TARGET=IA64; TARGETDIR=ia64;; - m68k-*-linux*) TARGET=M68K; TARGETDIR=m68k;; -+mips64*-*);; -+mips*-*-linux*) TARGET=MIPS_LINUX; TARGETDIR=mips;; - powerpc-*-linux* | powerpc-*-sysv*) TARGET=POWERPC; TARGETDIR=powerpc;; - powerpc-*-beos*) TARGET=POWERPC; TARGETDIR=powerpc;; - powerpc-*-darwin*) TARGET=POWERPC_DARWIN; TARGETDIR=powerpc;; - powerpc-*-aix*) TARGET=POWERPC_AIX; TARGETDIR=powerpc;; - rs6000-*-aix*) TARGET=POWERPC_AIX; TARGETDIR=powerpc;; - arm*-*-linux-*) TARGET=ARM; TARGETDIR=arm;; -+s390-*-linux-*) TARGET=S390; TARGETDIR=s390;; -+s390x-*-linux-*) TARGET=S390; TARGETDIR=s390;; -+x86_64-*-linux*) TARGET=X86_64; TARGETDIR=x86;; -+sh-*-linux* | sh[34]*-*-linux*) TARGET=SH; TARGETDIR=sh;; - esac - - if test $TARGETDIR = unknown; then -@@ -2418,6 +2491,15 @@ - fi - - -+if test x$TARGET = xMIPS_LINUX; then -+ MIPS_LINUX_TRUE= -+ MIPS_LINUX_FALSE='#' -+else -+ MIPS_LINUX_TRUE='#' -+ MIPS_LINUX_FALSE= -+fi -+ -+ - if test x$TARGET = xSPARC; then - SPARC_TRUE= - SPARC_FALSE='#' -@@ -2507,8 +2589,39 @@ - ARM_FALSE= - fi - -+ -+if test x$TARGET = xS390; then -+ S390_TRUE= -+ S390_FALSE='#' -+else -+ S390_TRUE='#' -+ S390_FALSE= -+fi -+ -+ -+if test x$TARGET = xX86_64; then -+ X86_64_TRUE= -+ X86_64_FALSE='#' -+else -+ X86_64_TRUE='#' -+ X86_64_FALSE= -+fi -+ -+ -+if test x$TARGET = xSH; then -+ SH_TRUE= -+ SH_FALSE='#' -+else -+ SH_TRUE='#' -+ SH_FALSE= -+fi -+ -+if test x$TARGET = xMIPS_LINUX; then -+ TARGET=MIPS -+fi -+ - echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 --echo "configure:2512: checking how to run the C preprocessor" >&5 -+echo "configure:2625: checking how to run the C preprocessor" >&5 - # On Suns, sometimes $CPP names a directory. - if test -n "$CPP" && test -d "$CPP"; then - CPP= -@@ -2523,13 +2636,13 @@ - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. - cat > conftest.$ac_ext < - Syntax Error - EOF - ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" --{ (eval echo configure:2533: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -+{ (eval echo configure:2646: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } - ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` - if test -z "$ac_err"; then - : -@@ -2540,13 +2653,13 @@ - rm -rf conftest* - CPP="${CC-cc} -E -traditional-cpp" - cat > conftest.$ac_ext < - Syntax Error - EOF - ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" --{ (eval echo configure:2550: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -+{ (eval echo configure:2663: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } - ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` - if test -z "$ac_err"; then - : -@@ -2557,13 +2670,13 @@ - rm -rf conftest* - CPP="${CC-cc} -nologo -E" - cat > conftest.$ac_ext < - Syntax Error - EOF - ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" --{ (eval echo configure:2567: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -+{ (eval echo configure:2680: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } - ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` - if test -z "$ac_err"; then - : -@@ -2588,12 +2701,12 @@ - echo "$ac_t""$CPP" 1>&6 - - echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 --echo "configure:2592: checking for ANSI C header files" >&5 -+echo "configure:2705: checking for ANSI C header files" >&5 - if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext < - #include -@@ -2601,7 +2714,7 @@ - #include - EOF - ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" --{ (eval echo configure:2605: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -+{ (eval echo configure:2718: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } - ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` - if test -z "$ac_err"; then - rm -rf conftest* -@@ -2618,7 +2731,7 @@ - if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat > conftest.$ac_ext < - EOF -@@ -2636,7 +2749,7 @@ - if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat > conftest.$ac_ext < - EOF -@@ -2657,7 +2770,7 @@ - : - else - cat > conftest.$ac_ext < - #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -@@ -2668,7 +2781,7 @@ - exit (0); } - - EOF --if { (eval echo configure:2672: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:2785: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then - : - else -@@ -2694,12 +2807,12 @@ - for ac_func in memcpy - do - echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 --echo "configure:2698: checking for $ac_func" >&5 -+echo "configure:2811: checking for $ac_func" >&5 - if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:2839: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" - else -@@ -2749,19 +2862,19 @@ - # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works - # for constant arguments. Useless! - echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 --echo "configure:2753: checking for working alloca.h" >&5 -+echo "configure:2866: checking for working alloca.h" >&5 - if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext < - int main() { - char *p = alloca(2 * sizeof(int)); - ; return 0; } - EOF --if { (eval echo configure:2765: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:2878: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - ac_cv_header_alloca_h=yes - else -@@ -2782,12 +2895,12 @@ - fi - - echo $ac_n "checking for alloca""... $ac_c" 1>&6 --echo "configure:2786: checking for alloca" >&5 -+echo "configure:2899: checking for alloca" >&5 - if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:2932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - ac_cv_func_alloca_works=yes - else -@@ -2847,12 +2960,12 @@ - - - echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 --echo "configure:2851: checking whether alloca needs Cray hooks" >&5 -+echo "configure:2964: checking whether alloca needs Cray hooks" >&5 - if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext <&6 --echo "configure:2881: checking for $ac_func" >&5 -+echo "configure:2994: checking for $ac_func" >&5 - if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:3022: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" - else -@@ -2932,7 +3045,7 @@ - fi - - echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 --echo "configure:2936: checking stack direction for C alloca" >&5 -+echo "configure:3049: checking stack direction for C alloca" >&5 - if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -2940,7 +3053,7 @@ - ac_cv_c_stack_direction=0 - else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:3076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then - ac_cv_c_stack_direction=1 - else -@@ -2982,13 +3095,13 @@ - - - echo $ac_n "checking size of short""... $ac_c" 1>&6 --echo "configure:2986: checking size of short" >&5 -+echo "configure:3099: checking size of short" >&5 - if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. - cat > conftest.$ac_ext < -@@ -2998,7 +3111,7 @@ - switch (0) case 0: case (sizeof (short) == $ac_size):; - ; return 0; } - EOF --if { (eval echo configure:3002: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:3115: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_sizeof_short=$ac_size - else -@@ -3021,13 +3134,13 @@ - - - echo $ac_n "checking size of int""... $ac_c" 1>&6 --echo "configure:3025: checking size of int" >&5 -+echo "configure:3138: checking size of int" >&5 - if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. - cat > conftest.$ac_ext < -@@ -3037,7 +3150,7 @@ - switch (0) case 0: case (sizeof (int) == $ac_size):; - ; return 0; } - EOF --if { (eval echo configure:3041: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:3154: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_sizeof_int=$ac_size - else -@@ -3060,13 +3173,13 @@ - - - echo $ac_n "checking size of long""... $ac_c" 1>&6 --echo "configure:3064: checking size of long" >&5 -+echo "configure:3177: checking size of long" >&5 - if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. - cat > conftest.$ac_ext < -@@ -3076,7 +3189,7 @@ - switch (0) case 0: case (sizeof (long) == $ac_size):; - ; return 0; } - EOF --if { (eval echo configure:3080: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:3193: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_sizeof_long=$ac_size - else -@@ -3099,13 +3212,13 @@ - - - echo $ac_n "checking size of long long""... $ac_c" 1>&6 --echo "configure:3103: checking size of long long" >&5 -+echo "configure:3216: checking size of long long" >&5 - if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. - cat > conftest.$ac_ext < -@@ -3115,7 +3228,7 @@ - switch (0) case 0: case (sizeof (long long) == $ac_size):; - ; return 0; } - EOF --if { (eval echo configure:3119: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:3232: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_sizeof_long_long=$ac_size - else -@@ -3138,13 +3251,13 @@ - - - echo $ac_n "checking size of float""... $ac_c" 1>&6 --echo "configure:3142: checking size of float" >&5 -+echo "configure:3255: checking size of float" >&5 - if eval "test \"`echo '$''{'ac_cv_sizeof_float'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. - cat > conftest.$ac_ext < -@@ -3154,7 +3267,7 @@ - switch (0) case 0: case (sizeof (float) == $ac_size):; - ; return 0; } - EOF --if { (eval echo configure:3158: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:3271: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_sizeof_float=$ac_size - else -@@ -3177,13 +3290,13 @@ - - - echo $ac_n "checking size of double""... $ac_c" 1>&6 --echo "configure:3181: checking size of double" >&5 -+echo "configure:3294: checking size of double" >&5 - if eval "test \"`echo '$''{'ac_cv_sizeof_double'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. - cat > conftest.$ac_ext < -@@ -3193,7 +3306,7 @@ - switch (0) case 0: case (sizeof (double) == $ac_size):; - ; return 0; } - EOF --if { (eval echo configure:3197: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:3310: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_sizeof_double=$ac_size - else -@@ -3216,13 +3329,13 @@ - - - echo $ac_n "checking size of long double""... $ac_c" 1>&6 --echo "configure:3220: checking size of long double" >&5 -+echo "configure:3333: checking size of long double" >&5 - if eval "test \"`echo '$''{'ac_cv_sizeof_long_double'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. - cat > conftest.$ac_ext < -@@ -3232,7 +3345,7 @@ - switch (0) case 0: case (sizeof (long double) == $ac_size):; - ; return 0; } - EOF --if { (eval echo configure:3236: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:3349: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_sizeof_long_double=$ac_size - else -@@ -3256,13 +3369,13 @@ - - - echo $ac_n "checking size of void *""... $ac_c" 1>&6 --echo "configure:3260: checking size of void *" >&5 -+echo "configure:3373: checking size of void *" >&5 - if eval "test \"`echo '$''{'ac_cv_sizeof_void_p'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. - cat > conftest.$ac_ext < -@@ -3272,7 +3385,7 @@ - switch (0) case 0: case (sizeof (void *) == $ac_size):; - ; return 0; } - EOF --if { (eval echo configure:3276: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:3389: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_sizeof_void_p=$ac_size - else -@@ -3295,14 +3408,14 @@ - - - echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 --echo "configure:3299: checking whether byte ordering is bigendian" >&5 -+echo "configure:3412: checking whether byte ordering is bigendian" >&5 - if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - ac_cv_c_bigendian=unknown - # See if sys/param.h defines the BYTE_ORDER macro. - cat > conftest.$ac_ext < - #include -@@ -3313,11 +3426,11 @@ - #endif - ; return 0; } - EOF --if { (eval echo configure:3317: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:3430: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - # It does; now see whether it defined to BIG_ENDIAN or not. - cat > conftest.$ac_ext < - #include -@@ -3328,7 +3441,7 @@ - #endif - ; return 0; } - EOF --if { (eval echo configure:3332: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:3445: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_c_bigendian=yes - else -@@ -3348,7 +3461,7 @@ - echo $ac_n "cross-compiling... " 2>&6 - else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:3478: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then - ac_cv_c_bigendian=no - else -@@ -3379,7 +3492,7 @@ - echo "$ac_t""$ac_cv_c_bigendian" 1>&6 - if test $ac_cv_c_bigendian = unknown; then - echo $ac_n "checking to probe for byte ordering""... $ac_c" 1>&6 --echo "configure:3383: checking to probe for byte ordering" >&5 -+echo "configure:3496: checking to probe for byte ordering" >&5 - - cat >conftest.c <> confdefs.h <<\EOF -+#define HOST_WORDS_BIG_ENDIAN 1 -+EOF -+ - BYTEORDER=4321 - else - BYTEORDER=1234 -@@ -3429,7 +3546,7 @@ - - if test x$TARGET = xSPARC; then - echo $ac_n "checking assembler and linker support unaligned pc related relocs""... $ac_c" 1>&6 --echo "configure:3433: checking assembler and linker support unaligned pc related relocs" >&5 -+echo "configure:3550: checking assembler and linker support unaligned pc related relocs" >&5 - if eval "test \"`echo '$''{'libffi_cv_as_sparc_ua_pcrel'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -3439,14 +3556,14 @@ - CFLAGS="$CFLAGS -fpic" - LDFLAGS="$LDFLAGS -shared" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:3567: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - libffi_cv_as_sparc_ua_pcrel=yes - else -@@ -3709,6 +3826,8 @@ - s%@MIPS_GCC_FALSE@%$MIPS_GCC_FALSE%g - s%@MIPS_SGI_TRUE@%$MIPS_SGI_TRUE%g - s%@MIPS_SGI_FALSE@%$MIPS_SGI_FALSE%g -+s%@MIPS_LINUX_TRUE@%$MIPS_LINUX_TRUE%g -+s%@MIPS_LINUX_FALSE@%$MIPS_LINUX_FALSE%g - s%@SPARC_TRUE@%$SPARC_TRUE%g - s%@SPARC_FALSE@%$SPARC_FALSE%g - s%@X86_TRUE@%$X86_TRUE%g -@@ -3729,6 +3848,12 @@ - s%@POWERPC_DARWIN_FALSE@%$POWERPC_DARWIN_FALSE%g - s%@ARM_TRUE@%$ARM_TRUE%g - s%@ARM_FALSE@%$ARM_FALSE%g -+s%@S390_TRUE@%$S390_TRUE%g -+s%@S390_FALSE@%$S390_FALSE%g -+s%@X86_64_TRUE@%$X86_64_TRUE%g -+s%@X86_64_FALSE@%$X86_64_FALSE%g -+s%@SH_TRUE@%$SH_TRUE%g -+s%@SH_FALSE@%$SH_FALSE%g - s%@CPP@%$CPP%g - s%@ALLOCA@%$ALLOCA%g - s%@TARGET@%$TARGET%g -@@ -3969,7 +4094,7 @@ - - if test -n "$CONFIG_FILES"; then - LD="${ORIGINAL_LD_FOR_MULTILIBS}" -- ac_file=Makefile . ${libffi_basedir}/../config-ml.in -+ ac_file=Makefile . ${srcdir}/${libffi_basedir}../config-ml.in - fi - - exit 0 -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/configure.in gcc/libffi/configure.in ---- gcc-3.2.2.orig/libffi/configure.in Tue Jan 28 10:43:56 2003 -+++ gcc/libffi/configure.in Sat Feb 1 20:16:19 2003 -@@ -22,14 +22,15 @@ - - if test "${srcdir}" = "."; then - if test "${with_target_subdir}" != "."; then -- libffi_basedir="${srcdir}/${with_multisrctop}.." -+ libffi_basedir="${with_multisrctop}../" - else -- libffi_basedir="${srcdir}/${with_multisrctop}" -+ libffi_basedir="${with_multisrctop}" - fi - else -- libffi_basedir="${srcdir}" -+ libffi_basedir= - fi - AC_SUBST(libffi_basedir) -+AC_CONFIG_AUX_DIR(${libffi_basedir}..) - - AC_CANONICAL_HOST - -@@ -56,17 +57,23 @@ - i*86-*-mingw*) TARGET=X86_WIN32; TARGETDIR=x86;; - sparc-sun-4*) TARGET=SPARC; TARGETDIR=sparc;; - sparc*-sun-*) TARGET=SPARC; TARGETDIR=sparc;; --sparc-*-linux*) TARGET=SPARC; TARGETDIR=sparc;; --sparc64-*-linux*) TARGET=SPARC; TARGETDIR=sparc;; --alpha*-*-linux* | alpha*-*-osf* | alpha*-*-freebsd*) TARGET=ALPHA; TARGETDIR=alpha;; -+sparc-*-linux* | sparc-*-netbsdelf*) TARGET=SPARC; TARGETDIR=sparc;; -+sparc64-*-linux* | sparc64-*-netbsd*) TARGET=SPARC; TARGETDIR=sparc;; -+alpha*-*-linux* | alpha*-*-osf* | alpha*-*-freebsd* | alpha*-*-netbsd*) TARGET=ALPHA; TARGETDIR=alpha;; - ia64*-*-*) TARGET=IA64; TARGETDIR=ia64;; - m68k-*-linux*) TARGET=M68K; TARGETDIR=m68k;; -+mips64*-*);; -+mips*-*-linux*) TARGET=MIPS_LINUX; TARGETDIR=mips;; - powerpc-*-linux* | powerpc-*-sysv*) TARGET=POWERPC; TARGETDIR=powerpc;; - powerpc-*-beos*) TARGET=POWERPC; TARGETDIR=powerpc;; - powerpc-*-darwin*) TARGET=POWERPC_DARWIN; TARGETDIR=powerpc;; - powerpc-*-aix*) TARGET=POWERPC_AIX; TARGETDIR=powerpc;; - rs6000-*-aix*) TARGET=POWERPC_AIX; TARGETDIR=powerpc;; - arm*-*-linux-*) TARGET=ARM; TARGETDIR=arm;; -+s390-*-linux-*) TARGET=S390; TARGETDIR=s390;; -+s390x-*-linux-*) TARGET=S390; TARGETDIR=s390;; -+x86_64-*-linux*) TARGET=X86_64; TARGETDIR=x86;; -+sh-*-linux* | sh[[34]]*-*-linux*) TARGET=SH; TARGETDIR=sh;; - esac - - if test $TARGETDIR = unknown; then -@@ -75,6 +82,7 @@ - - AM_CONDITIONAL(MIPS_GCC, test ${TARGET}${ac_cv_prog_gcc} = MIPSyes) - AM_CONDITIONAL(MIPS_SGI, test ${TARGET}${ac_cv_prog_gcc} = MIPSno) -+AM_CONDITIONAL(MIPS_LINUX, test x$TARGET = xMIPS_LINUX) - AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC) - AM_CONDITIONAL(X86, test x$TARGET = xX86) - AM_CONDITIONAL(X86_WIN32, test x$TARGET = xX86_WIN32) -@@ -85,6 +93,13 @@ - AM_CONDITIONAL(POWERPC_AIX, test x$TARGET = xPOWERPC_AIX) - AM_CONDITIONAL(POWERPC_DARWIN, test x$TARGET = xPOWERPC_DARWIN) - AM_CONDITIONAL(ARM, test x$TARGET = xARM) -+AM_CONDITIONAL(S390, test x$TARGET = xS390) -+AM_CONDITIONAL(X86_64, test x$TARGET = xX86_64) -+AM_CONDITIONAL(SH, test x$TARGET = xSH) -+ -+if test x$TARGET = xMIPS_LINUX; then -+ TARGET=MIPS -+fi - - AC_HEADER_STDC - AC_CHECK_FUNCS(memcpy) -@@ -171,7 +186,7 @@ - [ - if test -n "$CONFIG_FILES"; then - LD="${ORIGINAL_LD_FOR_MULTILIBS}" -- ac_file=Makefile . ${libffi_basedir}/../config-ml.in -+ ac_file=Makefile . ${srcdir}/${libffi_basedir}../config-ml.in - fi - ], - srcdir=${srcdir} -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/include/Makefile.in gcc/libffi/include/Makefile.in ---- gcc-3.2.2.orig/libffi/include/Makefile.in Tue Oct 9 14:32:16 2001 -+++ gcc/libffi/include/Makefile.in Mon Apr 29 13:14:44 2002 -@@ -99,7 +99,7 @@ - - DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) - --TAR = gnutar -+TAR = gtar - GZIP_ENV = --best - all: all-redirect - .SUFFIXES: -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/include/ffi.h.in gcc/libffi/include/ffi.h.in ---- gcc-3.2.2.orig/libffi/include/ffi.h.in Wed Mar 13 07:35:56 2002 -+++ gcc/libffi/include/ffi.h.in Wed Jan 29 00:54:28 2003 -@@ -1,5 +1,5 @@ - /* -----------------------------------------------------------------*-C-*- -- libffi @VERSION@ - Copyright (c) 1996-2002 Cygnus Solutions -+ libffi @VERSION@ - Copyright (c) 1996-2003 Cygnus Solutions - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the -@@ -164,6 +164,12 @@ - #endif - #endif - -+#ifdef S390 -+#if defined (__s390x__) -+#define S390X -+#endif -+#endif -+ - #ifndef LIBFFI_ASM - - /* ---- Generic type definitions ----------------------------------------- */ -@@ -189,16 +195,23 @@ - #endif - #endif - -- /* ---- Intel x86 ---------------- */ --#ifdef X86 -+ /* ---- Intel x86 Win32 ---------- */ -+#ifdef X86_WIN32 - FFI_SYSV, -+ FFI_STDCALL, -+ /* TODO: Add fastcall support for the sake of completeness */ - FFI_DEFAULT_ABI = FFI_SYSV, - #endif - -- /* ---- Intel x86 Win32 ---------- */ --#ifdef X86_WIN32 -+ /* ---- Intel x86 and AMD x86-64 - */ -+#if !defined(X86_WIN32) && (defined(__i386__) || defined(__x86_64__)) - FFI_SYSV, -+ FFI_UNIX64, /* Unix variants all use the same ABI for x86-64 */ -+#ifdef __i386__ - FFI_DEFAULT_ABI = FFI_SYSV, -+#else -+ FFI_DEFAULT_ABI = FFI_UNIX64, -+#endif - #endif - - /* ---- Intel ia64 ---------------- */ -@@ -251,6 +264,18 @@ - FFI_DEFAULT_ABI = FFI_SYSV, - #endif - -+ /* ---- S390 --------------------- */ -+#ifdef S390 -+ FFI_SYSV, -+ FFI_DEFAULT_ABI = FFI_SYSV, -+#endif -+ -+ /* ---- SuperH ------------------- */ -+#ifdef SH -+ FFI_SYSV, -+ FFI_DEFAULT_ABI = FFI_SYSV, -+#endif -+ - /* Leave this for debugging purposes */ - FFI_LAST_ABI - -@@ -264,7 +289,7 @@ - /*@null@*/ struct _ffi_type **elements; - } ffi_type; - --/* These are defined in ffi.c */ -+/* These are defined in types.c */ - extern ffi_type ffi_type_void; - extern ffi_type ffi_type_uint8; - extern ffi_type ffi_type_sint8; -@@ -373,13 +398,7 @@ - - /* ---- Definitions for closures ----------------------------------------- */ - --#ifdef X86 -- --#define FFI_CLOSURES 1 /* x86 supports closures */ --#define FFI_TRAMPOLINE_SIZE 10 --#define FFI_NATIVE_RAW_API 1 /* and has native raw api support */ -- --#elif defined(X86_WIN32) -+#ifdef __i386__ - - #define FFI_CLOSURES 1 /* x86 supports closures */ - #define FFI_TRAMPOLINE_SIZE 10 -@@ -424,6 +443,40 @@ - #define FFI_TRAMPOLINE_SIZE 24 /* see struct below */ - #define FFI_NATIVE_RAW_API 0 - -+#elif defined(SPARC64) -+ -+#define FFI_CLOSURES 1 -+#define FFI_TRAMPOLINE_SIZE 24 -+#define FFI_NATIVE_RAW_API 0 -+ -+#elif defined(SPARC) -+ -+#define FFI_CLOSURES 1 -+#define FFI_TRAMPOLINE_SIZE 16 -+#define FFI_NATIVE_RAW_API 0 -+ -+#elif defined(S390) -+ -+#define FFI_CLOSURES 1 -+#ifdef S390X -+#define FFI_TRAMPOLINE_SIZE 32 -+#else -+#define FFI_TRAMPOLINE_SIZE 16 -+#endif -+#define FFI_NATIVE_RAW_API 0 -+ -+#elif defined(SH) -+ -+#define FFI_CLOSURES 1 -+#define FFI_TRAMPOLINE_SIZE 16 -+#define FFI_NATIVE_RAW_API 0 -+ -+#elif defined(__x86_64__) -+ -+#define FFI_CLOSURES 1 -+#define FFI_TRAMPOLINE_SIZE 24 -+#define FFI_NATIVE_RAW_API 0 -+ - #else - - #define FFI_CLOSURES 0 -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/arm/ffi.c gcc/libffi/src/arm/ffi.c ---- gcc-3.2.2.orig/libffi/src/arm/ffi.c Sat Mar 3 07:21:23 2001 -+++ gcc/libffi/src/arm/ffi.c Fri Jul 19 08:08:30 2002 -@@ -36,13 +36,10 @@ - /*@=exportheader@*/ - { - register unsigned int i; -- register int tmp; -- register unsigned int avn; - register void **p_argv; - register char *argp; - register ffi_type **p_arg; - -- tmp = 0; - argp = stack; - - if ( ecif->cif->rtype->type == FFI_TYPE_STRUCT ) { -@@ -50,11 +47,10 @@ - argp += 4; - } - -- avn = ecif->cif->nargs; - p_argv = ecif->avalue; - - for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; -- (i != 0) && (avn != 0); -+ (i != 0); - i--, p_arg++) - { - size_t z; -@@ -64,9 +60,6 @@ - argp = (char *) ALIGN(argp, (*p_arg)->alignment); - } - -- if (avn != 0) -- { -- avn--; - z = (*p_arg)->size; - if (z < sizeof(int)) - { -@@ -107,7 +100,6 @@ - } - p_argv++; - argp += z; -- } - } - - return; -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/arm/sysv.S gcc/libffi/src/arm/sysv.S ---- gcc-3.2.2.orig/libffi/src/arm/sysv.S Sat Mar 3 07:21:23 2001 -+++ gcc/libffi/src/arm/sysv.S Mon Sep 30 03:08:58 2002 -@@ -28,8 +28,15 @@ - #ifdef HAVE_MACHINE_ASM_H - #include - #else --/* XXX these lose for some platforms, I'm sure. */ -+#ifdef __USER_LABEL_PREFIX__ -+#define CONCAT1(a, b) CONCAT2(a, b) -+#define CONCAT2(a, b) a ## b -+ -+/* Use the right prefix for global labels. */ -+#define CNAME(x) CONCAT1 (__USER_LABEL_PREFIX__, x) -+#else - #define CNAME(x) x -+#endif - #define ENTRY(x) .globl CNAME(x); .type CNAME(x),%function; CNAME(x): - #endif - -@@ -96,12 +103,20 @@ - - # return FLOAT - cmp a4, #FFI_TYPE_FLOAT -+#ifdef __SOFTFP__ -+ streq a1, [a3] -+#else - stfeqs f0, [a3] -+#endif - beq epilogue - - # return DOUBLE or LONGDOUBLE - cmp a4, #FFI_TYPE_DOUBLE -+#ifdef __SOFTFP__ -+ stmeqia a3, {a1, a2} -+#else - stfeqd f0, [a3] -+#endif - - epilogue: - ldmfd sp!, {a1-a4, fp, pc} -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/java_raw_api.c gcc/libffi/src/java_raw_api.c ---- gcc-3.2.2.orig/libffi/src/java_raw_api.c Tue Apr 9 07:31:14 2002 -+++ gcc/libffi/src/java_raw_api.c Tue Oct 8 23:55:02 2002 -@@ -81,21 +81,14 @@ - { - case FFI_TYPE_UINT8: - case FFI_TYPE_SINT8: -- *args = (void*) ((char*)(raw++) + SIZEOF_ARG - 1); -+ *args = (void*) ((char*)(raw++) + 3); - break; - - case FFI_TYPE_UINT16: - case FFI_TYPE_SINT16: -- *args = (void*) ((char*)(raw++) + SIZEOF_ARG - 2); -+ *args = (void*) ((char*)(raw++) + 2); - break; - --#if SIZEOF_ARG >= 4 -- case FFI_TYPE_UINT32: -- case FFI_TYPE_SINT32: -- *args = (void*) ((char*)(raw++) + SIZEOF_ARG - 4); -- break; --#endif -- - #if SIZEOF_ARG == 8 - case FFI_TYPE_UINT64: - case FFI_TYPE_SINT64: -@@ -157,31 +150,54 @@ - switch ((*tp)->type) - { - case FFI_TYPE_UINT8: -+#if WORDS_BIGENDIAN -+ *(UINT32*)(raw++) = *(UINT8*) (*args); -+#else - (raw++)->uint = *(UINT8*) (*args); -+#endif - break; - - case FFI_TYPE_SINT8: -+#if WORDS_BIGENDIAN -+ *(SINT32*)(raw++) = *(SINT8*) (*args); -+#else - (raw++)->sint = *(SINT8*) (*args); -+#endif - break; - - case FFI_TYPE_UINT16: -+#if WORDS_BIGENDIAN -+ *(UINT32*)(raw++) = *(UINT16*) (*args); -+#else - (raw++)->uint = *(UINT16*) (*args); -+#endif - break; - - case FFI_TYPE_SINT16: -+#if WORDS_BIGENDIAN -+ *(SINT32*)(raw++) = *(SINT16*) (*args); -+#else - (raw++)->sint = *(SINT16*) (*args); -+#endif - break; - --#if SIZEOF_ARG >= 4 - case FFI_TYPE_UINT32: -+#if WORDS_BIGENDIAN -+ *(UINT32*)(raw++) = *(UINT32*) (*args); -+#else - (raw++)->uint = *(UINT32*) (*args); -+#endif - break; - - case FFI_TYPE_SINT32: -+#if WORDS_BIGENDIAN -+ *(SINT32*)(raw++) = *(SINT32*) (*args); -+#else - (raw++)->sint = *(SINT32*) (*args); -- break; - #endif -- case FFI_TYPE_FLOAT: -+ break; -+ -+ case FFI_TYPE_FLOAT: - (raw++)->flt = *(FLOAT32*) (*args); - break; - -@@ -211,6 +227,55 @@ - - #if !FFI_NATIVE_RAW_API - -+static void -+ffi_java_rvalue_to_raw (ffi_cif *cif, void *rvalue) -+{ -+#if WORDS_BIGENDIAN && SIZEOF_ARG == 8 -+ switch (cif->rtype->type) -+ { -+ case FFI_TYPE_UINT8: -+ case FFI_TYPE_UINT16: -+ case FFI_TYPE_UINT32: -+ *(UINT64 *)rvalue <<= 32; -+ break; -+ -+ case FFI_TYPE_SINT8: -+ case FFI_TYPE_SINT16: -+ case FFI_TYPE_SINT32: -+ case FFI_TYPE_INT: -+ *(SINT64 *)rvalue <<= 32; -+ break; -+ -+ default: -+ break; -+ } -+#endif -+} -+ -+static void -+ffi_java_raw_to_rvalue (ffi_cif *cif, void *rvalue) -+{ -+#if WORDS_BIGENDIAN && SIZEOF_ARG == 8 -+ switch (cif->rtype->type) -+ { -+ case FFI_TYPE_UINT8: -+ case FFI_TYPE_UINT16: -+ case FFI_TYPE_UINT32: -+ *(UINT64 *)rvalue >>= 32; -+ break; -+ -+ case FFI_TYPE_SINT8: -+ case FFI_TYPE_SINT16: -+ case FFI_TYPE_SINT32: -+ case FFI_TYPE_INT: -+ *(SINT64 *)rvalue >>= 32; -+ break; -+ -+ default: -+ break; -+ } -+#endif -+} - - /* This is a generic definition of ffi_raw_call, to be used if the - * native system does not provide a machine-specific implementation. -@@ -227,6 +292,7 @@ - void **avalue = (void**) alloca (cif->nargs * sizeof (void*)); - ffi_java_raw_to_ptrarray (cif, raw, avalue); - ffi_call (cif, fn, rvalue, avalue); -+ ffi_java_rvalue_to_raw (cif, rvalue); - } - - #if FFI_CLOSURES /* base system provides closures */ -@@ -240,6 +306,7 @@ - - ffi_java_ptrarray_to_raw (cif, avalue, raw); - (*cl->fun) (cif, rvalue, raw, cl->user_data); -+ ffi_java_raw_to_rvalue (cif, rvalue); - } - - /* Again, here is the generic version of ffi_prep_raw_closure, which -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/m68k/ffi.c gcc/libffi/src/m68k/ffi.c ---- gcc-3.2.2.orig/libffi/src/m68k/ffi.c Sun Aug 8 22:27:19 1999 -+++ gcc/libffi/src/m68k/ffi.c Fri Jul 19 08:08:30 2002 -@@ -16,14 +16,11 @@ - ffi_prep_args (void *stack, extended_cif *ecif) - { - unsigned int i; -- int tmp; -- unsigned int avn; - void **p_argv; - char *argp; - ffi_type **p_arg; - void *struct_value_ptr; - -- tmp = 0; - argp = stack; - - if (ecif->cif->rtype->type == FFI_TYPE_STRUCT -@@ -32,11 +29,10 @@ - else - struct_value_ptr = NULL; - -- avn = ecif->cif->nargs; - p_argv = ecif->avalue; - - for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; -- i != 0 && avn != 0; -+ i != 0; - i--, p_arg++) - { - size_t z; -@@ -45,9 +41,6 @@ - if (((*p_arg)->alignment - 1) & (unsigned) argp) - argp = (char *) ALIGN (argp, (*p_arg)->alignment); - -- if (avn != 0) -- { -- avn--; - z = (*p_arg)->size; - if (z < sizeof (int)) - { -@@ -82,7 +75,6 @@ - memcpy (argp, *p_argv, z); - p_argv++; - argp += z; -- } - } - - return struct_value_ptr; -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/mips/ffi.c gcc/libffi/src/mips/ffi.c ---- gcc-3.2.2.orig/libffi/src/mips/ffi.c Sat Mar 3 07:21:23 2001 -+++ gcc/libffi/src/mips/ffi.c Fri Jul 19 08:08:31 2002 -@@ -23,6 +23,7 @@ - OTHER DEALINGS IN THE SOFTWARE. - ----------------------------------------------------------------------- */ - -+#include - #include - #include - -@@ -50,7 +51,6 @@ - int flags) - { - register int i; -- register int avn; - register void **p_argv; - register char *argp; - register ffi_type **p_arg; -@@ -80,12 +80,9 @@ - FIX_ARGP; - } - -- avn = ecif->cif->nargs; - p_argv = ecif->avalue; - -- for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; -- i && avn; -- i--, p_arg++) -+ for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; i; i--, p_arg++) - { - size_t z; - -@@ -101,9 +98,6 @@ - #define OFFSET sizeof(int) - #endif - -- if (avn) -- { -- avn--; - z = (*p_arg)->size; - if (z < sizeof(SLOT_TYPE_UNSIGNED)) - { -@@ -179,7 +173,6 @@ - p_argv++; - argp += z; - FIX_ARGP; -- } - } - - return; -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/powerpc/darwin.S gcc/libffi/src/powerpc/darwin.S ---- gcc-3.2.2.orig/libffi/src/powerpc/darwin.S Sat Jan 19 01:22:34 2002 -+++ gcc/libffi/src/powerpc/darwin.S Thu Jan 23 03:21:55 2003 -@@ -3,8 +3,6 @@ - - PowerPC Assembly glue. - -- $Id: darwin.S,v 1.2 2002/01/18 16:22:34 dje Exp $ -- - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - ``Software''), to deal in the Software without restriction, including -@@ -39,30 +37,34 @@ - .text - .align 2 - _ffi_call_DARWIN: -- mr r12,r8 // We only need r12 until the call, so it doesn't have to be saved... -+LFB0: -+ mr r12,r8 /* We only need r12 until the call, -+ so it doesn't have to be saved... */ -+LFB1: - /* Save the old stack pointer as AP. */ - mr r8,r1 -- -+LCFI0: - /* Allocate the stack space we need. */ - stwux r1,r1,r4 - - /* Save registers we use. */ - mflr r9 - -- stw r28,-16(r8) -+ stw r28,-16(r8) - stw r29,-12(r8) - stw r30, -8(r8) - stw r31, -4(r8) -- -- stw r9, 8(r8) -+ -+ stw r9, 8(r8) - stw r2, 20(r1) -+LCFI1: - - /* Save arguments over call... */ -- mr r31,r5 /* flags, */ -- mr r30,r6 /* rvalue, */ -- mr r29,r7 /* function address, */ -- mr r28,r8 /* our AP. */ -- -+ mr r31,r5 /* flags, */ -+ mr r30,r6 /* rvalue, */ -+ mr r29,r7 /* function address, */ -+ mr r28,r8 /* our AP. */ -+LCFI2: - /* Call ffi_prep_args. */ - mr r4,r1 - li r9,0 -@@ -145,7 +147,8 @@ - L(float_return_value): - stfs f1,0(r30) - b L(done_return_value) --//END(_ffi_call_DARWIN) -+LFE1: -+/* END(_ffi_call_DARWIN) */ - - /* Provide a null definition of _ffi_call_AIX. */ - .text -@@ -155,5 +158,61 @@ - .align 2 - _ffi_call_AIX: - blr --//END(_ffi_call_AIX) -+/* END(_ffi_call_AIX) */ - -+.data -+.section __TEXT,__eh_frame -+Lframe1: -+ .set L$set$0,LECIE1-LSCIE1 -+ .long L$set$0 ; Length of Common Information Entry -+LSCIE1: -+ .long 0x0 ; CIE Identifier Tag -+ .byte 0x1 ; CIE Version -+ .ascii "zR\0" ; CIE Augmentation -+ .byte 0x1 ; uleb128 0x1; CIE Code Alignment Factor -+ .byte 0x7c ; sleb128 -4; CIE Data Alignment Factor -+ .byte 0x41 ; CIE RA Column -+ .byte 0x1 ; uleb128 0x1; Augmentation size -+ .byte 0x10 ; FDE Encoding (pcrel) -+ .byte 0xc ; DW_CFA_def_cfa -+ .byte 0x1 ; uleb128 0x1 -+ .byte 0x0 ; uleb128 0x0 -+ .align 2 -+LECIE1: -+LSFDE1: -+ .set L$set$1,LEFDE1-LASFDE1 -+ .long L$set$1 ; FDE Length -+LASFDE1: -+ .set L$set$2,LASFDE1-Lframe1 -+ .long L$set$2 ; FDE CIE offset -+ .long LFB0-. ; FDE initial location -+ .set L$set$3,LFE1-LFB0 -+ .long L$set$3 ; FDE address range -+ .byte 0x0 ; uleb128 0x0; Augmentation size -+ .byte 0x4 ; DW_CFA_advance_loc4 -+ .set L$set$4,LCFI0-LFB1 -+ .long L$set$4 -+ .byte 0xd ; DW_CFA_def_cfa_register -+ .byte 0x08 ; uleb128 0x08 -+ .byte 0x4 ; DW_CFA_advance_loc4 -+ .set L$set$5,LCFI1-LCFI0 -+ .long L$set$5 -+ .byte 0x11 ; DW_CFA_offset_extended_sf -+ .byte 0x41 ; uleb128 0x41 -+ .byte 0x7e ; sleb128 -2 -+ .byte 0x9f ; DW_CFA_offset, column 0x1f -+ .byte 0x1 ; uleb128 0x1 -+ .byte 0x9e ; DW_CFA_offset, column 0x1e -+ .byte 0x2 ; uleb128 0x2 -+ .byte 0x9d ; DW_CFA_offset, column 0x1d -+ .byte 0x3 ; uleb128 0x3 -+ .byte 0x9c ; DW_CFA_offset, column 0x1c -+ .byte 0x4 ; uleb128 0x4 -+ .byte 0x4 ; DW_CFA_advance_loc4 -+ .set L$set$6,LCFI2-LCFI1 -+ .long L$set$6 -+ .byte 0xd ; DW_CFA_def_cfa_register -+ .byte 0x1c ; uleb128 0x1c -+ .align 2 -+LEFDE1: -+ -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/prep_cif.c gcc/libffi/src/prep_cif.c ---- gcc-3.2.2.orig/libffi/src/prep_cif.c Sat Mar 3 07:21:22 2001 -+++ gcc/libffi/src/prep_cif.c Mon Sep 30 20:59:42 2002 -@@ -103,7 +103,8 @@ - /* Perform a sanity check on the return type */ - FFI_ASSERT(ffi_type_test(cif->rtype)); - --#ifndef M68K -+ /* x86-64 and s390 stack space allocation is handled in prep_machdep. */ -+#if !defined M68K && !defined __x86_64__ && !defined S390 - /* Make space for the return structure pointer */ - if (cif->rtype->type == FFI_TYPE_STRUCT - #ifdef SPARC -@@ -122,6 +123,7 @@ - if (((*ptr)->size == 0) && (initialize_aggregate((*ptr)) != FFI_OK)) - return FFI_BAD_TYPEDEF; - -+#if !defined __x86_64__ && !defined S390 - #ifdef SPARC - if (((*ptr)->type == FFI_TYPE_STRUCT - && ((*ptr)->size > 16 || cif->abi != FFI_V9)) -@@ -137,6 +139,7 @@ - - bytes += STACK_ARG_SIZE((*ptr)->size); - } -+#endif - } - - cif->bytes = bytes; -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/s390/ffi.c gcc/libffi/src/s390/ffi.c ---- gcc-3.2.2.orig/libffi/src/s390/ffi.c Thu Jan 1 09:00:00 1970 -+++ gcc/libffi/src/s390/ffi.c Thu Feb 6 08:58:57 2003 -@@ -0,0 +1,753 @@ -+/* ----------------------------------------------------------------------- -+ ffi.c - Copyright (c) 2000 Software AG -+ -+ S390 Foreign Function Interface -+ -+ Permission is hereby granted, free of charge, to any person obtaining -+ a copy of this software and associated documentation files (the -+ ``Software''), to deal in the Software without restriction, including -+ without limitation the rights to use, copy, modify, merge, publish, -+ distribute, sublicense, and/or sell copies of the Software, and to -+ permit persons to whom the Software is furnished to do so, subject to -+ the following conditions: -+ -+ The above copyright notice and this permission notice shall be included -+ in all copies or substantial portions of the Software. -+ -+ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS -+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -+ IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR -+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ OTHER DEALINGS IN THE SOFTWARE. -+ ----------------------------------------------------------------------- */ -+/*====================================================================*/ -+/* Includes */ -+/* -------- */ -+/*====================================================================*/ -+ -+#include -+#include -+ -+#include -+#include -+ -+/*====================== End of Includes =============================*/ -+ -+/*====================================================================*/ -+/* Defines */ -+/* ------- */ -+/*====================================================================*/ -+ -+/* Maximum number of GPRs available for argument passing. */ -+#define MAX_GPRARGS 5 -+ -+/* Maximum number of FPRs available for argument passing. */ -+#ifdef __s390x__ -+#define MAX_FPRARGS 4 -+#else -+#define MAX_FPRARGS 2 -+#endif -+ -+/* Round to multiple of 16. */ -+#define ROUND_SIZE(size) (((size) + 15) & ~15) -+ -+/* If these values change, sysv.S must be adapted! */ -+#define FFI390_RET_VOID 0 -+#define FFI390_RET_STRUCT 1 -+#define FFI390_RET_FLOAT 2 -+#define FFI390_RET_DOUBLE 3 -+#define FFI390_RET_INT32 4 -+#define FFI390_RET_INT64 5 -+ -+/*===================== End of Defines ===============================*/ -+ -+/*====================================================================*/ -+/* Prototypes */ -+/* ---------- */ -+/*====================================================================*/ -+ -+static void ffi_prep_args (unsigned char *, extended_cif *); -+static int ffi_check_float_struct (ffi_type *); -+void -+#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2) -+__attribute__ ((visibility ("hidden"))) -+#endif -+ffi_closure_helper_SYSV (ffi_closure *, unsigned long *, -+ unsigned long long *, unsigned long *); -+ -+/*====================== End of Prototypes ===========================*/ -+ -+/*====================================================================*/ -+/* Externals */ -+/* --------- */ -+/*====================================================================*/ -+ -+extern void ffi_call_SYSV(unsigned, -+ extended_cif *, -+ void (*)(unsigned char *, extended_cif *), -+ unsigned, -+ void *, -+ void (*fn)()); -+ -+extern void ffi_closure_SYSV(void); -+ -+/*====================== End of Externals ============================*/ -+ -+/*====================================================================*/ -+/* */ -+/* Name - ffi_check_struct_type. */ -+/* */ -+/* Function - Determine if a structure can be passed within a */ -+/* general purpose or floating point register. */ -+/* */ -+/*====================================================================*/ -+ -+static int -+ffi_check_struct_type (ffi_type *arg) -+{ -+ size_t size = arg->size; -+ -+ /* If the struct has just one element, look at that element -+ to find out whether to consider the struct as floating point. */ -+ while (arg->type == FFI_TYPE_STRUCT -+ && arg->elements[0] && !arg->elements[1]) -+ arg = arg->elements[0]; -+ -+ /* Structs of size 1, 2, 4, and 8 are passed in registers, -+ just like the corresponding int/float types. */ -+ switch (size) -+ { -+ case 1: -+ return FFI_TYPE_UINT8; -+ -+ case 2: -+ return FFI_TYPE_UINT16; -+ -+ case 4: -+ if (arg->type == FFI_TYPE_FLOAT) -+ return FFI_TYPE_FLOAT; -+ else -+ return FFI_TYPE_UINT32; -+ -+ case 8: -+ if (arg->type == FFI_TYPE_DOUBLE) -+ return FFI_TYPE_DOUBLE; -+ else -+ return FFI_TYPE_UINT64; -+ -+ default: -+ break; -+ } -+ -+ /* Other structs are passed via a pointer to the data. */ -+ return FFI_TYPE_POINTER; -+} -+ -+/*======================== End of Routine ============================*/ -+ -+/*====================================================================*/ -+/* */ -+/* Name - ffi_prep_args. */ -+/* */ -+/* Function - Prepare parameters for call to function. */ -+/* */ -+/* ffi_prep_args is called by the assembly routine once stack space */ -+/* has been allocated for the function's arguments. */ -+/* */ -+/*====================================================================*/ -+ -+static void -+ffi_prep_args (unsigned char *stack, extended_cif *ecif) -+{ -+ /* The stack space will be filled with those areas: -+ -+ FPR argument register save area (highest addresses) -+ GPR argument register save area -+ temporary struct copies -+ overflow argument area (lowest addresses) -+ -+ We set up the following pointers: -+ -+ p_fpr: bottom of the FPR area (growing upwards) -+ p_gpr: bottom of the GPR area (growing upwards) -+ p_ov: bottom of the overflow area (growing upwards) -+ p_struct: top of the struct copy area (growing downwards) -+ -+ All areas are kept aligned to twice the word size. */ -+ -+ int gpr_off = ecif->cif->bytes; -+ int fpr_off = gpr_off + ROUND_SIZE (MAX_GPRARGS * sizeof (long)); -+ -+ unsigned long long *p_fpr = (unsigned long long *)(stack + fpr_off); -+ unsigned long *p_gpr = (unsigned long *)(stack + gpr_off); -+ unsigned char *p_struct = (unsigned char *)p_gpr; -+ unsigned long *p_ov = (unsigned long *)stack; -+ -+ int n_fpr = 0; -+ int n_gpr = 0; -+ int n_ov = 0; -+ -+ ffi_type **ptr; -+ void **p_argv = ecif->avalue; -+ int i; -+ -+ /* If we returning a structure then we set the first parameter register -+ to the address of where we are returning this structure. */ -+ -+ if (ecif->cif->flags == FFI390_RET_STRUCT) -+ p_gpr[n_gpr++] = (unsigned long) ecif->rvalue; -+ -+ /* Now for the arguments. */ -+ -+ for (ptr = ecif->cif->arg_types, i = ecif->cif->nargs; -+ i > 0; -+ i--, ptr++, p_argv++) -+ { -+ void *arg = *p_argv; -+ int type = (*ptr)->type; -+ -+ /* Check how a structure type is passed. */ -+ if (type == FFI_TYPE_STRUCT) -+ { -+ type = ffi_check_struct_type (*ptr); -+ -+ /* If we pass the struct via pointer, copy the data. */ -+ if (type == FFI_TYPE_POINTER) -+ { -+ p_struct -= ROUND_SIZE ((*ptr)->size); -+ memcpy (p_struct, (char *)arg, (*ptr)->size); -+ arg = &p_struct; -+ } -+ } -+ -+ /* Pointers are passed like UINTs of the same size. */ -+ if (type == FFI_TYPE_POINTER) -+#ifdef __s390x__ -+ type = FFI_TYPE_UINT64; -+#else -+ type = FFI_TYPE_UINT32; -+#endif -+ -+ /* Now handle all primitive int/float data types. */ -+ switch (type) -+ { -+ case FFI_TYPE_DOUBLE: -+ if (n_fpr < MAX_FPRARGS) -+ p_fpr[n_fpr++] = *(unsigned long long *) arg; -+ else -+#ifdef __s390x__ -+ p_ov[n_ov++] = *(unsigned long *) arg; -+#else -+ p_ov[n_ov++] = ((unsigned long *) arg)[0], -+ p_ov[n_ov++] = ((unsigned long *) arg)[1]; -+#endif -+ break; -+ -+ case FFI_TYPE_FLOAT: -+ if (n_fpr < MAX_FPRARGS) -+ p_fpr[n_fpr++] = (long long) *(unsigned int *) arg << 32; -+ else -+ p_ov[n_ov++] = *(unsigned int *) arg; -+ break; -+ -+ case FFI_TYPE_UINT64: -+ case FFI_TYPE_SINT64: -+#ifdef __s390x__ -+ if (n_gpr < MAX_GPRARGS) -+ p_gpr[n_gpr++] = *(unsigned long *) arg; -+ else -+ p_ov[n_ov++] = *(unsigned long *) arg; -+#else -+ if (n_gpr == MAX_GPRARGS-1) -+ n_gpr = MAX_GPRARGS; -+ if (n_gpr < MAX_GPRARGS) -+ p_gpr[n_gpr++] = ((unsigned long *) arg)[0], -+ p_gpr[n_gpr++] = ((unsigned long *) arg)[1]; -+ else -+ p_ov[n_ov++] = ((unsigned long *) arg)[0], -+ p_ov[n_ov++] = ((unsigned long *) arg)[1]; -+#endif -+ break; -+ -+ case FFI_TYPE_UINT32: -+ if (n_gpr < MAX_GPRARGS) -+ p_gpr[n_gpr++] = *(unsigned int *) arg; -+ else -+ p_ov[n_ov++] = *(unsigned int *) arg; -+ break; -+ -+ case FFI_TYPE_INT: -+ case FFI_TYPE_SINT32: -+ if (n_gpr < MAX_GPRARGS) -+ p_gpr[n_gpr++] = *(signed int *) arg; -+ else -+ p_ov[n_ov++] = *(signed int *) arg; -+ break; -+ -+ case FFI_TYPE_UINT16: -+ if (n_gpr < MAX_GPRARGS) -+ p_gpr[n_gpr++] = *(unsigned short *) arg; -+ else -+ p_ov[n_ov++] = *(unsigned short *) arg; -+ break; -+ -+ case FFI_TYPE_SINT16: -+ if (n_gpr < MAX_GPRARGS) -+ p_gpr[n_gpr++] = *(signed short *) arg; -+ else -+ p_ov[n_ov++] = *(signed short *) arg; -+ break; -+ -+ case FFI_TYPE_UINT8: -+ if (n_gpr < MAX_GPRARGS) -+ p_gpr[n_gpr++] = *(unsigned char *) arg; -+ else -+ p_ov[n_ov++] = *(unsigned char *) arg; -+ break; -+ -+ case FFI_TYPE_SINT8: -+ if (n_gpr < MAX_GPRARGS) -+ p_gpr[n_gpr++] = *(signed char *) arg; -+ else -+ p_ov[n_ov++] = *(signed char *) arg; -+ break; -+ -+ default: -+ FFI_ASSERT (0); -+ break; -+ } -+ } -+} -+ -+/*======================== End of Routine ============================*/ -+ -+/*====================================================================*/ -+/* */ -+/* Name - ffi_prep_cif_machdep. */ -+/* */ -+/* Function - Perform machine dependent CIF processing. */ -+/* */ -+/*====================================================================*/ -+ -+ffi_status -+ffi_prep_cif_machdep(ffi_cif *cif) -+{ -+ size_t struct_size = 0; -+ int n_gpr = 0; -+ int n_fpr = 0; -+ int n_ov = 0; -+ -+ ffi_type **ptr; -+ int i; -+ -+ /* Determine return value handling. */ -+ -+ switch (cif->rtype->type) -+ { -+ /* Void is easy. */ -+ case FFI_TYPE_VOID: -+ cif->flags = FFI390_RET_VOID; -+ break; -+ -+ /* Structures are returned via a hidden pointer. */ -+ case FFI_TYPE_STRUCT: -+ cif->flags = FFI390_RET_STRUCT; -+ n_gpr++; /* We need one GPR to pass the pointer. */ -+ break; -+ -+ /* Floating point values are returned in fpr 0. */ -+ case FFI_TYPE_FLOAT: -+ cif->flags = FFI390_RET_FLOAT; -+ break; -+ -+ case FFI_TYPE_DOUBLE: -+ cif->flags = FFI390_RET_DOUBLE; -+ break; -+ -+ /* Integer values are returned in gpr 2 (and gpr 3 -+ for 64-bit values on 31-bit machines). */ -+ case FFI_TYPE_UINT64: -+ case FFI_TYPE_SINT64: -+ cif->flags = FFI390_RET_INT64; -+ break; -+ -+ case FFI_TYPE_POINTER: -+ case FFI_TYPE_INT: -+ case FFI_TYPE_UINT32: -+ case FFI_TYPE_SINT32: -+ case FFI_TYPE_UINT16: -+ case FFI_TYPE_SINT16: -+ case FFI_TYPE_UINT8: -+ case FFI_TYPE_SINT8: -+ /* These are to be extended to word size. */ -+#ifdef __s390x__ -+ cif->flags = FFI390_RET_INT64; -+#else -+ cif->flags = FFI390_RET_INT32; -+#endif -+ break; -+ -+ default: -+ FFI_ASSERT (0); -+ break; -+ } -+ -+ /* Now for the arguments. */ -+ -+ for (ptr = cif->arg_types, i = cif->nargs; -+ i > 0; -+ i--, ptr++) -+ { -+ int type = (*ptr)->type; -+ -+ /* Check how a structure type is passed. */ -+ if (type == FFI_TYPE_STRUCT) -+ { -+ type = ffi_check_struct_type (*ptr); -+ -+ /* If we pass the struct via pointer, we must reserve space -+ to copy its data for proper call-by-value semantics. */ -+ if (type == FFI_TYPE_POINTER) -+ struct_size += ROUND_SIZE ((*ptr)->size); -+ } -+ -+ /* Now handle all primitive int/float data types. */ -+ switch (type) -+ { -+ /* The first MAX_FPRARGS floating point arguments -+ go in FPRs, the rest overflow to the stack. */ -+ -+ case FFI_TYPE_DOUBLE: -+ if (n_fpr < MAX_FPRARGS) -+ n_fpr++; -+ else -+ n_ov += sizeof (double) / sizeof (long); -+ break; -+ -+ case FFI_TYPE_FLOAT: -+ if (n_fpr < MAX_FPRARGS) -+ n_fpr++; -+ else -+ n_ov++; -+ break; -+ -+ /* On 31-bit machines, 64-bit integers are passed in GPR pairs, -+ if one is still available, or else on the stack. If only one -+ register is free, skip the register (it won't be used for any -+ subsequent argument either). */ -+ -+#ifndef __s390x__ -+ case FFI_TYPE_UINT64: -+ case FFI_TYPE_SINT64: -+ if (n_gpr == MAX_GPRARGS-1) -+ n_gpr = MAX_GPRARGS; -+ if (n_gpr < MAX_GPRARGS) -+ n_gpr += 2; -+ else -+ n_ov += 2; -+ break; -+#endif -+ -+ /* Everything else is passed in GPRs (until MAX_GPRARGS -+ have been used) or overflows to the stack. */ -+ -+ default: -+ if (n_gpr < MAX_GPRARGS) -+ n_gpr++; -+ else -+ n_ov++; -+ break; -+ } -+ } -+ -+ /* Total stack space as required for overflow arguments -+ and temporary structure copies. */ -+ -+ cif->bytes = ROUND_SIZE (n_ov * sizeof (long)) + struct_size; -+ -+ return FFI_OK; -+} -+ -+/*======================== End of Routine ============================*/ -+ -+/*====================================================================*/ -+/* */ -+/* Name - ffi_call. */ -+/* */ -+/* Function - Call the FFI routine. */ -+/* */ -+/*====================================================================*/ -+ -+void -+ffi_call(ffi_cif *cif, -+ void (*fn)(), -+ void *rvalue, -+ void **avalue) -+{ -+ int ret_type = cif->flags; -+ extended_cif ecif; -+ -+ ecif.cif = cif; -+ ecif.avalue = avalue; -+ ecif.rvalue = rvalue; -+ -+ /* If we don't have a return value, we need to fake one. */ -+ if (rvalue == NULL) -+ { -+ if (ret_type == FFI390_RET_STRUCT) -+ ecif.rvalue = alloca (cif->rtype->size); -+ else -+ ret_type = FFI390_RET_VOID; -+ } -+ -+ switch (cif->abi) -+ { -+ case FFI_SYSV: -+ ffi_call_SYSV (cif->bytes, &ecif, ffi_prep_args, -+ ret_type, ecif.rvalue, fn); -+ break; -+ -+ default: -+ FFI_ASSERT (0); -+ break; -+ } -+} -+ -+/*======================== End of Routine ============================*/ -+ -+/*====================================================================*/ -+/* */ -+/* Name - ffi_closure_helper_SYSV. */ -+/* */ -+/* Function - Call a FFI closure target function. */ -+/* */ -+/*====================================================================*/ -+ -+void -+ffi_closure_helper_SYSV (ffi_closure *closure, -+ unsigned long *p_gpr, -+ unsigned long long *p_fpr, -+ unsigned long *p_ov) -+{ -+ unsigned long long ret_buffer; -+ -+ void *rvalue = &ret_buffer; -+ void **avalue; -+ void **p_arg; -+ -+ int n_gpr = 0; -+ int n_fpr = 0; -+ int n_ov = 0; -+ -+ ffi_type **ptr; -+ int i; -+ -+ /* Allocate buffer for argument list pointers. */ -+ -+ p_arg = avalue = alloca (closure->cif->nargs * sizeof (void *)); -+ -+ /* If we returning a structure, pass the structure address -+ directly to the target function. Otherwise, have the target -+ function store the return value to the GPR save area. */ -+ -+ if (closure->cif->flags == FFI390_RET_STRUCT) -+ rvalue = (void *) p_gpr[n_gpr++]; -+ -+ /* Now for the arguments. */ -+ -+ for (ptr = closure->cif->arg_types, i = closure->cif->nargs; -+ i > 0; -+ i--, p_arg++, ptr++) -+ { -+ int deref_struct_pointer = 0; -+ int type = (*ptr)->type; -+ -+ /* Check how a structure type is passed. */ -+ if (type == FFI_TYPE_STRUCT) -+ { -+ type = ffi_check_struct_type (*ptr); -+ -+ /* If we pass the struct via pointer, remember to -+ retrieve the pointer later. */ -+ if (type == FFI_TYPE_POINTER) -+ deref_struct_pointer = 1; -+ } -+ -+ /* Pointers are passed like UINTs of the same size. */ -+ if (type == FFI_TYPE_POINTER) -+#ifdef __s390x__ -+ type = FFI_TYPE_UINT64; -+#else -+ type = FFI_TYPE_UINT32; -+#endif -+ -+ /* Now handle all primitive int/float data types. */ -+ switch (type) -+ { -+ case FFI_TYPE_DOUBLE: -+ if (n_fpr < MAX_FPRARGS) -+ *p_arg = &p_fpr[n_fpr++]; -+ else -+ *p_arg = &p_ov[n_ov], -+ n_ov += sizeof (double) / sizeof (long); -+ break; -+ -+ case FFI_TYPE_FLOAT: -+ if (n_fpr < MAX_FPRARGS) -+ *p_arg = &p_fpr[n_fpr++]; -+ else -+ *p_arg = (char *)&p_ov[n_ov++] + sizeof (long) - 4; -+ break; -+ -+ case FFI_TYPE_UINT64: -+ case FFI_TYPE_SINT64: -+#ifdef __s390x__ -+ if (n_gpr < MAX_GPRARGS) -+ *p_arg = &p_gpr[n_gpr++]; -+ else -+ *p_arg = &p_ov[n_ov++]; -+#else -+ if (n_gpr == MAX_GPRARGS-1) -+ n_gpr = MAX_GPRARGS; -+ if (n_gpr < MAX_GPRARGS) -+ *p_arg = &p_gpr[n_gpr], n_gpr += 2; -+ else -+ *p_arg = &p_ov[n_ov], n_ov += 2; -+#endif -+ break; -+ -+ case FFI_TYPE_INT: -+ case FFI_TYPE_UINT32: -+ case FFI_TYPE_SINT32: -+ if (n_gpr < MAX_GPRARGS) -+ *p_arg = (char *)&p_gpr[n_gpr++] + sizeof (long) - 4; -+ else -+ *p_arg = (char *)&p_ov[n_ov++] + sizeof (long) - 4; -+ break; -+ -+ case FFI_TYPE_UINT16: -+ case FFI_TYPE_SINT16: -+ if (n_gpr < MAX_GPRARGS) -+ *p_arg = (char *)&p_gpr[n_gpr++] + sizeof (long) - 2; -+ else -+ *p_arg = (char *)&p_ov[n_ov++] + sizeof (long) - 2; -+ break; -+ -+ case FFI_TYPE_UINT8: -+ case FFI_TYPE_SINT8: -+ if (n_gpr < MAX_GPRARGS) -+ *p_arg = (char *)&p_gpr[n_gpr++] + sizeof (long) - 1; -+ else -+ *p_arg = (char *)&p_ov[n_ov++] + sizeof (long) - 1; -+ break; -+ -+ default: -+ FFI_ASSERT (0); -+ break; -+ } -+ -+ /* If this is a struct passed via pointer, we need to -+ actually retrieve that pointer. */ -+ if (deref_struct_pointer) -+ *p_arg = *(void **)*p_arg; -+ } -+ -+ -+ /* Call the target function. */ -+ (closure->fun) (closure->cif, rvalue, avalue, closure->user_data); -+ -+ /* Convert the return value. */ -+ switch (closure->cif->rtype->type) -+ { -+ /* Void is easy, and so is struct. */ -+ case FFI_TYPE_VOID: -+ case FFI_TYPE_STRUCT: -+ break; -+ -+ /* Floating point values are returned in fpr 0. */ -+ case FFI_TYPE_FLOAT: -+ p_fpr[0] = (long long) *(unsigned int *) rvalue << 32; -+ break; -+ -+ case FFI_TYPE_DOUBLE: -+ p_fpr[0] = *(unsigned long long *) rvalue; -+ break; -+ -+ /* Integer values are returned in gpr 2 (and gpr 3 -+ for 64-bit values on 31-bit machines). */ -+ case FFI_TYPE_UINT64: -+ case FFI_TYPE_SINT64: -+#ifdef __s390x__ -+ p_gpr[0] = *(unsigned long *) rvalue; -+#else -+ p_gpr[0] = ((unsigned long *) rvalue)[0], -+ p_gpr[1] = ((unsigned long *) rvalue)[1]; -+#endif -+ break; -+ -+ case FFI_TYPE_POINTER: -+ case FFI_TYPE_UINT32: -+ case FFI_TYPE_UINT16: -+ case FFI_TYPE_UINT8: -+ p_gpr[0] = *(unsigned long *) rvalue; -+ break; -+ -+ case FFI_TYPE_INT: -+ case FFI_TYPE_SINT32: -+ case FFI_TYPE_SINT16: -+ case FFI_TYPE_SINT8: -+ p_gpr[0] = *(signed long *) rvalue; -+ break; -+ -+ default: -+ FFI_ASSERT (0); -+ break; -+ } -+} -+ -+/*======================== End of Routine ============================*/ -+ -+/*====================================================================*/ -+/* */ -+/* Name - ffi_prep_closure. */ -+/* */ -+/* Function - Prepare a FFI closure. */ -+/* */ -+/*====================================================================*/ -+ -+ffi_status -+ffi_prep_closure (ffi_closure *closure, -+ ffi_cif *cif, -+ void (*fun) (ffi_cif *, void *, void **, void *), -+ void *user_data) -+{ -+ FFI_ASSERT (cif->abi == FFI_SYSV); -+ -+#ifndef __s390x__ -+ *(short *)&closure->tramp [0] = 0x0d10; /* basr %r1,0 */ -+ *(short *)&closure->tramp [2] = 0x9801; /* lm %r0,%r1,6(%r1) */ -+ *(short *)&closure->tramp [4] = 0x1006; -+ *(short *)&closure->tramp [6] = 0x07f1; /* br %r1 */ -+ *(long *)&closure->tramp [8] = (long)closure; -+ *(long *)&closure->tramp[12] = (long)&ffi_closure_SYSV; -+#else -+ *(short *)&closure->tramp [0] = 0x0d10; /* basr %r1,0 */ -+ *(short *)&closure->tramp [2] = 0xeb01; /* lmg %r0,%r1,14(%r1) */ -+ *(short *)&closure->tramp [4] = 0x100e; -+ *(short *)&closure->tramp [6] = 0x0004; -+ *(short *)&closure->tramp [8] = 0x07f1; /* br %r1 */ -+ *(long *)&closure->tramp[16] = (long)closure; -+ *(long *)&closure->tramp[24] = (long)&ffi_closure_SYSV; -+#endif -+ -+ closure->cif = cif; -+ closure->user_data = user_data; -+ closure->fun = fun; -+ -+ return FFI_OK; -+} -+ -+/*======================== End of Routine ============================*/ -+ -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/s390/sysv.S gcc/libffi/src/s390/sysv.S ---- gcc-3.2.2.orig/libffi/src/s390/sysv.S Thu Jan 1 09:00:00 1970 -+++ gcc/libffi/src/s390/sysv.S Thu Nov 28 01:44:35 2002 -@@ -0,0 +1,425 @@ -+/* ----------------------------------------------------------------------- -+ sysv.S - Copyright (c) 2000 Software AG -+ -+ S390 Foreign Function Interface -+ -+ Permission is hereby granted, free of charge, to any person obtaining -+ a copy of this software and associated documentation files (the -+ ``Software''), to deal in the Software without restriction, including -+ without limitation the rights to use, copy, modify, merge, publish, -+ distribute, sublicense, and/or sell copies of the Software, and to -+ permit persons to whom the Software is furnished to do so, subject to -+ the following conditions: -+ -+ The above copyright notice and this permission notice shall be included -+ in all copies or substantial portions of the Software. -+ -+ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS -+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -+ IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR -+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ OTHER DEALINGS IN THE SOFTWARE. -+ ----------------------------------------------------------------------- */ -+ -+#ifndef __s390x__ -+ -+.text -+ -+ # r2: cif->bytes -+ # r3: &ecif -+ # r4: ffi_prep_args -+ # r5: ret_type -+ # r6: ecif.rvalue -+ # ov: fn -+ -+ # This assumes we are using gas. -+ .globl ffi_call_SYSV -+ .type ffi_call_SYSV,%function -+ffi_call_SYSV: -+.LFB1: -+ stm %r6,%r15,24(%r15) # Save registers -+.LCFI0: -+ basr %r13,0 # Set up base register -+.Lbase: -+ lr %r11,%r15 # Set up frame pointer -+.LCFI1: -+ sr %r15,%r2 -+ ahi %r15,-96-48 # Allocate stack -+ lr %r8,%r6 # Save ecif.rvalue -+ sr %r9,%r9 -+ ic %r9,.Ltable-.Lbase(%r13,%r5) # Load epilog address -+ l %r7,96(%r11) # Load function address -+ st %r11,0(%r15) # Set up back chain -+ ahi %r11,-48 # Register save area -+.LCFI2: -+ -+ la %r2,96(%r15) # Save area -+ # r3 already holds &ecif -+ basr %r14,%r4 # Call ffi_prep_args -+ -+ lm %r2,%r6,0(%r11) # Load arguments -+ ld %f0,32(%r11) -+ ld %f2,40(%r11) -+ la %r14,0(%r13,%r9) # Set return address -+ br %r7 # ... and call function -+ -+.LretNone: # Return void -+ l %r4,48+56(%r11) -+ lm %r6,%r15,48+24(%r11) -+ br %r4 -+ -+.LretFloat: -+ l %r4,48+56(%r11) -+ ste %f0,0(%r8) # Return float -+ lm %r6,%r15,48+24(%r11) -+ br %r4 -+ -+.LretDouble: -+ l %r4,48+56(%r11) -+ std %f0,0(%r8) # Return double -+ lm %r6,%r15,48+24(%r11) -+ br %r4 -+ -+.LretInt32: -+ l %r4,48+56(%r11) -+ st %r2,0(%r8) # Return int -+ lm %r6,%r15,48+24(%r11) -+ br %r4 -+ -+.LretInt64: -+ l %r4,48+56(%r11) -+ stm %r2,%r3,0(%r8) # Return long long -+ lm %r6,%r15,48+24(%r11) -+ br %r4 -+ -+.Ltable: -+ .byte .LretNone-.Lbase # FFI390_RET_VOID -+ .byte .LretNone-.Lbase # FFI390_RET_STRUCT -+ .byte .LretFloat-.Lbase # FFI390_RET_FLOAT -+ .byte .LretDouble-.Lbase # FFI390_RET_DOUBLE -+ .byte .LretInt32-.Lbase # FFI390_RET_INT32 -+ .byte .LretInt64-.Lbase # FFI390_RET_INT64 -+ -+.LFE1: -+.ffi_call_SYSV_end: -+ .size ffi_call_SYSV,.ffi_call_SYSV_end-ffi_call_SYSV -+ -+ -+ .globl ffi_closure_SYSV -+ .type ffi_closure_SYSV,%function -+ffi_closure_SYSV: -+.LFB2: -+ stm %r12,%r15,48(%r15) # Save registers -+.LCFI10: -+ basr %r13,0 # Set up base register -+.Lcbase: -+ stm %r2,%r6,8(%r15) # Save arguments -+ std %f0,64(%r15) -+ std %f2,72(%r15) -+ lr %r1,%r15 # Set up stack frame -+ ahi %r15,-96 -+.LCFI11: -+ l %r12,.Lchelper-.Lcbase(%r13) # Get helper function -+ lr %r2,%r0 # Closure -+ la %r3,8(%r1) # GPRs -+ la %r4,64(%r1) # FPRs -+ la %r5,96(%r1) # Overflow -+ st %r1,0(%r15) # Set up back chain -+ -+ bas %r14,0(%r12,%r13) # Call helper -+ -+ l %r4,96+56(%r15) -+ ld %f0,96+64(%r15) # Load return registers -+ lm %r2,%r3,96+8(%r15) -+ lm %r12,%r15,96+48(%r15) -+ br %r4 -+ -+ .align 4 -+.Lchelper: -+ .long ffi_closure_helper_SYSV-.Lcbase -+ -+.LFE2: -+ -+.ffi_closure_SYSV_end: -+ .size ffi_closure_SYSV,.ffi_closure_SYSV_end-ffi_closure_SYSV -+ -+ -+ .section .eh_frame,"a",@progbits -+.Lframe1: -+ .4byte .LECIE1-.LSCIE1 # Length of Common Information Entry -+.LSCIE1: -+ .4byte 0x0 # CIE Identifier Tag -+ .byte 0x1 # CIE Version -+ .ascii "zR\0" # CIE Augmentation -+ .uleb128 0x1 # CIE Code Alignment Factor -+ .sleb128 -4 # CIE Data Alignment Factor -+ .byte 0xe # CIE RA Column -+ .uleb128 0x1 # Augmentation size -+ .byte 0x1b # FDE Encoding (pcrel sdata4) -+ .byte 0xc # DW_CFA_def_cfa -+ .uleb128 0xf -+ .uleb128 0x60 -+ .align 4 -+.LECIE1: -+.LSFDE1: -+ .4byte .LEFDE1-.LASFDE1 # FDE Length -+.LASFDE1: -+ .4byte .LASFDE1-.Lframe1 # FDE CIE offset -+ .4byte .LFB1-. # FDE initial location -+ .4byte .LFE1-.LFB1 # FDE address range -+ .uleb128 0x0 # Augmentation size -+ .byte 0x4 # DW_CFA_advance_loc4 -+ .4byte .LCFI0-.LFB1 -+ .byte 0x8f # DW_CFA_offset, column 0xf -+ .uleb128 0x9 -+ .byte 0x8e # DW_CFA_offset, column 0xe -+ .uleb128 0xa -+ .byte 0x8d # DW_CFA_offset, column 0xd -+ .uleb128 0xb -+ .byte 0x8c # DW_CFA_offset, column 0xc -+ .uleb128 0xc -+ .byte 0x8b # DW_CFA_offset, column 0xb -+ .uleb128 0xd -+ .byte 0x8a # DW_CFA_offset, column 0xa -+ .uleb128 0xe -+ .byte 0x89 # DW_CFA_offset, column 0x9 -+ .uleb128 0xf -+ .byte 0x88 # DW_CFA_offset, column 0x8 -+ .uleb128 0x10 -+ .byte 0x87 # DW_CFA_offset, column 0x7 -+ .uleb128 0x11 -+ .byte 0x86 # DW_CFA_offset, column 0x6 -+ .uleb128 0x12 -+ .byte 0x4 # DW_CFA_advance_loc4 -+ .4byte .LCFI1-.LCFI0 -+ .byte 0xd # DW_CFA_def_cfa_register -+ .uleb128 0xb -+ .byte 0x4 # DW_CFA_advance_loc4 -+ .4byte .LCFI2-.LCFI1 -+ .byte 0xe # DW_CFA_def_cfa_offset -+ .uleb128 0x90 -+ .align 4 -+.LEFDE1: -+.LSFDE2: -+ .4byte .LEFDE2-.LASFDE2 # FDE Length -+.LASFDE2: -+ .4byte .LASFDE2-.Lframe1 # FDE CIE offset -+ .4byte .LFB2-. # FDE initial location -+ .4byte .LFE2-.LFB2 # FDE address range -+ .uleb128 0x0 # Augmentation size -+ .byte 0x4 # DW_CFA_advance_loc4 -+ .4byte .LCFI10-.LFB2 -+ .byte 0x8f # DW_CFA_offset, column 0xf -+ .uleb128 0x9 -+ .byte 0x8e # DW_CFA_offset, column 0xe -+ .uleb128 0xa -+ .byte 0x8d # DW_CFA_offset, column 0xd -+ .uleb128 0xb -+ .byte 0x8c # DW_CFA_offset, column 0xc -+ .uleb128 0xc -+ .byte 0x4 # DW_CFA_advance_loc4 -+ .4byte .LCFI11-.LCFI10 -+ .byte 0xe # DW_CFA_def_cfa_offset -+ .uleb128 0xc0 -+ .align 4 -+.LEFDE2: -+ -+#else -+ -+.text -+ -+ # r2: cif->bytes -+ # r3: &ecif -+ # r4: ffi_prep_args -+ # r5: ret_type -+ # r6: ecif.rvalue -+ # ov: fn -+ -+ # This assumes we are using gas. -+ .globl ffi_call_SYSV -+ .type ffi_call_SYSV,%function -+ffi_call_SYSV: -+.LFB1: -+ stmg %r6,%r15,48(%r15) # Save registers -+.LCFI0: -+ larl %r13,.Lbase # Set up base register -+ lgr %r11,%r15 # Set up frame pointer -+.LCFI1: -+ sgr %r15,%r2 -+ aghi %r15,-160-80 # Allocate stack -+ lgr %r8,%r6 # Save ecif.rvalue -+ llgc %r9,.Ltable-.Lbase(%r13,%r5) # Load epilog address -+ lg %r7,160(%r11) # Load function address -+ stg %r11,0(%r15) # Set up back chain -+ aghi %r11,-80 # Register save area -+.LCFI2: -+ -+ la %r2,160(%r15) # Save area -+ # r3 already holds &ecif -+ basr %r14,%r4 # Call ffi_prep_args -+ -+ lmg %r2,%r6,0(%r11) # Load arguments -+ ld %f0,48(%r11) -+ ld %f2,56(%r11) -+ ld %f4,64(%r11) -+ ld %f6,72(%r11) -+ la %r14,0(%r13,%r9) # Set return address -+ br %r7 # ... and call function -+ -+.Lbase: -+.LretNone: # Return void -+ lg %r4,80+112(%r11) -+ lmg %r6,%r15,80+48(%r11) -+ br %r4 -+ -+.LretFloat: -+ lg %r4,80+112(%r11) -+ ste %f0,0(%r8) # Return float -+ lmg %r6,%r15,80+48(%r11) -+ br %r4 -+ -+.LretDouble: -+ lg %r4,80+112(%r11) -+ std %f0,0(%r8) # Return double -+ lmg %r6,%r15,80+48(%r11) -+ br %r4 -+ -+.LretInt32: -+ lg %r4,80+112(%r11) -+ st %r2,0(%r8) # Return int -+ lmg %r6,%r15,80+48(%r11) -+ br %r4 -+ -+.LretInt64: -+ lg %r4,80+112(%r11) -+ stg %r2,0(%r8) # Return long -+ lmg %r6,%r15,80+48(%r11) -+ br %r4 -+ -+.Ltable: -+ .byte .LretNone-.Lbase # FFI390_RET_VOID -+ .byte .LretNone-.Lbase # FFI390_RET_STRUCT -+ .byte .LretFloat-.Lbase # FFI390_RET_FLOAT -+ .byte .LretDouble-.Lbase # FFI390_RET_DOUBLE -+ .byte .LretInt32-.Lbase # FFI390_RET_INT32 -+ .byte .LretInt64-.Lbase # FFI390_RET_INT64 -+ -+.LFE1: -+.ffi_call_SYSV_end: -+ .size ffi_call_SYSV,.ffi_call_SYSV_end-ffi_call_SYSV -+ -+ -+ .globl ffi_closure_SYSV -+ .type ffi_closure_SYSV,%function -+ffi_closure_SYSV: -+.LFB2: -+ stmg %r14,%r15,112(%r15) # Save registers -+.LCFI10: -+ stmg %r2,%r6,16(%r15) # Save arguments -+ std %f0,128(%r15) -+ std %f2,136(%r15) -+ std %f4,144(%r15) -+ std %f6,152(%r15) -+ lgr %r1,%r15 # Set up stack frame -+ aghi %r15,-160 -+.LCFI11: -+ lgr %r2,%r0 # Closure -+ la %r3,16(%r1) # GPRs -+ la %r4,128(%r1) # FPRs -+ la %r5,160(%r1) # Overflow -+ stg %r1,0(%r15) # Set up back chain -+ -+ brasl %r14,ffi_closure_helper_SYSV # Call helper -+ -+ lg %r14,160+112(%r15) -+ ld %f0,160+128(%r15) # Load return registers -+ lg %r2,160+16(%r15) -+ la %r15,160(%r15) -+ br %r14 -+.LFE2: -+ -+.ffi_closure_SYSV_end: -+ .size ffi_closure_SYSV,.ffi_closure_SYSV_end-ffi_closure_SYSV -+ -+ -+ -+ .section .eh_frame,"a",@progbits -+.Lframe1: -+ .4byte .LECIE1-.LSCIE1 # Length of Common Information Entry -+.LSCIE1: -+ .4byte 0x0 # CIE Identifier Tag -+ .byte 0x1 # CIE Version -+ .ascii "zR\0" # CIE Augmentation -+ .uleb128 0x1 # CIE Code Alignment Factor -+ .sleb128 -8 # CIE Data Alignment Factor -+ .byte 0xe # CIE RA Column -+ .uleb128 0x1 # Augmentation size -+ .byte 0x1b # FDE Encoding (pcrel sdata4) -+ .byte 0xc # DW_CFA_def_cfa -+ .uleb128 0xf -+ .uleb128 0xa0 -+ .align 8 -+.LECIE1: -+.LSFDE1: -+ .4byte .LEFDE1-.LASFDE1 # FDE Length -+.LASFDE1: -+ .4byte .LASFDE1-.Lframe1 # FDE CIE offset -+ .4byte .LFB1-. # FDE initial location -+ .4byte .LFE1-.LFB1 # FDE address range -+ .uleb128 0x0 # Augmentation size -+ .byte 0x4 # DW_CFA_advance_loc4 -+ .4byte .LCFI0-.LFB1 -+ .byte 0x8f # DW_CFA_offset, column 0xf -+ .uleb128 0x5 -+ .byte 0x8e # DW_CFA_offset, column 0xe -+ .uleb128 0x6 -+ .byte 0x8d # DW_CFA_offset, column 0xd -+ .uleb128 0x7 -+ .byte 0x8c # DW_CFA_offset, column 0xc -+ .uleb128 0x8 -+ .byte 0x8b # DW_CFA_offset, column 0xb -+ .uleb128 0x9 -+ .byte 0x8a # DW_CFA_offset, column 0xa -+ .uleb128 0xa -+ .byte 0x89 # DW_CFA_offset, column 0x9 -+ .uleb128 0xb -+ .byte 0x88 # DW_CFA_offset, column 0x8 -+ .uleb128 0xc -+ .byte 0x87 # DW_CFA_offset, column 0x7 -+ .uleb128 0xd -+ .byte 0x86 # DW_CFA_offset, column 0x6 -+ .uleb128 0xe -+ .byte 0x4 # DW_CFA_advance_loc4 -+ .4byte .LCFI1-.LCFI0 -+ .byte 0xd # DW_CFA_def_cfa_register -+ .uleb128 0xb -+ .byte 0x4 # DW_CFA_advance_loc4 -+ .4byte .LCFI2-.LCFI1 -+ .byte 0xe # DW_CFA_def_cfa_offset -+ .uleb128 0xf0 -+ .align 8 -+.LEFDE1: -+.LSFDE2: -+ .4byte .LEFDE2-.LASFDE2 # FDE Length -+.LASFDE2: -+ .4byte .LASFDE2-.Lframe1 # FDE CIE offset -+ .4byte .LFB2-. # FDE initial location -+ .4byte .LFE2-.LFB2 # FDE address range -+ .uleb128 0x0 # Augmentation size -+ .byte 0x4 # DW_CFA_advance_loc4 -+ .4byte .LCFI10-.LFB2 -+ .byte 0x8f # DW_CFA_offset, column 0xf -+ .uleb128 0x5 -+ .byte 0x8e # DW_CFA_offset, column 0xe -+ .uleb128 0x6 -+ .byte 0x4 # DW_CFA_advance_loc4 -+ .4byte .LCFI11-.LCFI10 -+ .byte 0xe # DW_CFA_def_cfa_offset -+ .uleb128 0x140 -+ .align 8 -+.LEFDE2: -+ -+#endif -+ -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/sh/ffi.c gcc/libffi/src/sh/ffi.c ---- gcc-3.2.2.orig/libffi/src/sh/ffi.c Thu Jan 1 09:00:00 1970 -+++ gcc/libffi/src/sh/ffi.c Fri Jul 19 10:08:43 2002 -@@ -0,0 +1,722 @@ -+/* ----------------------------------------------------------------------- -+ ffi.c - Copyright (c) 2002 Kaz Kojima -+ -+ SuperH Foreign Function Interface -+ -+ Permission is hereby granted, free of charge, to any person obtaining -+ a copy of this software and associated documentation files (the -+ ``Software''), to deal in the Software without restriction, including -+ without limitation the rights to use, copy, modify, merge, publish, -+ distribute, sublicense, and/or sell copies of the Software, and to -+ permit persons to whom the Software is furnished to do so, subject to -+ the following conditions: -+ -+ The above copyright notice and this permission notice shall be included -+ in all copies or substantial portions of the Software. -+ -+ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS -+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -+ IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR -+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ OTHER DEALINGS IN THE SOFTWARE. -+ ----------------------------------------------------------------------- */ -+ -+#include -+#include -+ -+#include -+ -+#define NGREGARG 4 -+#if defined(__SH4__) -+#define NFREGARG 8 -+#endif -+ -+#if defined(__HITACHI__) -+#define STRUCT_VALUE_ADDRESS_WITH_ARG 1 -+#else -+#define STRUCT_VALUE_ADDRESS_WITH_ARG 0 -+#endif -+ -+/* If the structure has essentialy an unique element, return its type. */ -+static int -+simple_type (ffi_type *arg) -+{ -+ if (arg->type != FFI_TYPE_STRUCT) -+ return arg->type; -+ else if (arg->elements[1]) -+ return FFI_TYPE_STRUCT; -+ -+ return simple_type (arg->elements[0]); -+} -+ -+static int -+return_type (ffi_type *arg) -+{ -+ unsigned short type; -+ -+ if (arg->type != FFI_TYPE_STRUCT) -+ return arg->type; -+ -+ type = simple_type (arg->elements[0]); -+ if (! arg->elements[1]) -+ { -+ switch (type) -+ { -+ case FFI_TYPE_SINT8: -+ case FFI_TYPE_UINT8: -+ case FFI_TYPE_SINT16: -+ case FFI_TYPE_UINT16: -+ case FFI_TYPE_SINT32: -+ case FFI_TYPE_UINT32: -+ return FFI_TYPE_INT; -+ -+ default: -+ return type; -+ } -+ } -+ -+ /* gcc uses r0/r1 pair for some kind of structures. */ -+ if (arg->size <= 2 * sizeof (int)) -+ { -+ int i = 0; -+ ffi_type *e; -+ -+ while ((e = arg->elements[i++])) -+ { -+ type = simple_type (e); -+ switch (type) -+ { -+ case FFI_TYPE_SINT32: -+ case FFI_TYPE_UINT32: -+ case FFI_TYPE_INT: -+ case FFI_TYPE_FLOAT: -+ return FFI_TYPE_UINT64; -+ -+ default: -+ break; -+ } -+ } -+ } -+ -+ return FFI_TYPE_STRUCT; -+} -+ -+/* ffi_prep_args is called by the assembly routine once stack space -+ has been allocated for the function's arguments */ -+ -+/*@-exportheader@*/ -+void ffi_prep_args(char *stack, extended_cif *ecif) -+/*@=exportheader@*/ -+{ -+ register unsigned int i; -+ register int tmp; -+ register unsigned int avn; -+ register void **p_argv; -+ register char *argp; -+ register ffi_type **p_arg; -+ int greg, ireg; -+#if defined(__SH4__) -+ int freg = 0; -+#endif -+ -+ tmp = 0; -+ argp = stack; -+ -+ if (return_type (ecif->cif->rtype) == FFI_TYPE_STRUCT) -+ { -+ *(void **) argp = ecif->rvalue; -+ argp += 4; -+ ireg = STRUCT_VALUE_ADDRESS_WITH_ARG ? 1 : 0; -+ } -+ else -+ ireg = 0; -+ -+ /* Set arguments for registers. */ -+ greg = ireg; -+ avn = ecif->cif->nargs; -+ p_argv = ecif->avalue; -+ -+ for (i = 0, p_arg = ecif->cif->arg_types; i < avn; i++, p_arg++, p_argv++) -+ { -+ size_t z; -+ -+ z = (*p_arg)->size; -+ if (z < sizeof(int)) -+ { -+ if (greg++ >= NGREGARG) -+ continue; -+ -+ z = sizeof(int); -+ switch ((*p_arg)->type) -+ { -+ case FFI_TYPE_SINT8: -+ *(signed int *) argp = (signed int)*(SINT8 *)(* p_argv); -+ break; -+ -+ case FFI_TYPE_UINT8: -+ *(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv); -+ break; -+ -+ case FFI_TYPE_SINT16: -+ *(signed int *) argp = (signed int)*(SINT16 *)(* p_argv); -+ break; -+ -+ case FFI_TYPE_UINT16: -+ *(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv); -+ break; -+ -+ case FFI_TYPE_STRUCT: -+ *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); -+ break; -+ -+ default: -+ FFI_ASSERT(0); -+ } -+ argp += z; -+ } -+ else if (z == sizeof(int)) -+ { -+#if defined(__SH4__) -+ if ((*p_arg)->type == FFI_TYPE_FLOAT) -+ { -+ if (freg++ >= NFREGARG) -+ continue; -+ } -+ else -+#endif -+ { -+ if (greg++ >= NGREGARG) -+ continue; -+ } -+ *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); -+ argp += z; -+ } -+#if defined(__SH4__) -+ else if ((*p_arg)->type == FFI_TYPE_DOUBLE) -+ { -+ if (freg + 1 >= NFREGARG) -+ continue; -+ freg = (freg + 1) & ~1; -+ freg += 2; -+ memcpy (argp, *p_argv, z); -+ argp += z; -+ } -+#endif -+ else -+ { -+ int n = (z + sizeof (int) - 1) / sizeof (int); -+#if defined(__SH4__) -+ if (greg + n - 1 >= NGREGARG) -+ continue; -+ greg += n; -+#else -+ if (greg >= NGREGARG) -+ continue; -+ else if (greg + n - 1 >= NGREGARG) -+ greg = NGREGARG; -+ else -+ greg += n; -+#endif -+ memcpy (argp, *p_argv, z); -+ argp += z; -+ } -+ } -+ -+ /* Set arguments on stack. */ -+ greg = ireg; -+#if defined(__SH4__) -+ freg = 0; -+#endif -+ p_argv = ecif->avalue; -+ -+ for (i = 0, p_arg = ecif->cif->arg_types; i < avn; i++, p_arg++, p_argv++) -+ { -+ size_t z; -+ -+ z = (*p_arg)->size; -+ if (z < sizeof(int)) -+ { -+ if (greg++ < NGREGARG) -+ continue; -+ -+ z = sizeof(int); -+ switch ((*p_arg)->type) -+ { -+ case FFI_TYPE_SINT8: -+ *(signed int *) argp = (signed int)*(SINT8 *)(* p_argv); -+ break; -+ -+ case FFI_TYPE_UINT8: -+ *(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv); -+ break; -+ -+ case FFI_TYPE_SINT16: -+ *(signed int *) argp = (signed int)*(SINT16 *)(* p_argv); -+ break; -+ -+ case FFI_TYPE_UINT16: -+ *(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv); -+ break; -+ -+ case FFI_TYPE_STRUCT: -+ *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); -+ break; -+ -+ default: -+ FFI_ASSERT(0); -+ } -+ argp += z; -+ } -+ else if (z == sizeof(int)) -+ { -+#if defined(__SH4__) -+ if ((*p_arg)->type == FFI_TYPE_FLOAT) -+ { -+ if (freg++ < NFREGARG) -+ continue; -+ } -+ else -+#endif -+ { -+ if (greg++ < NGREGARG) -+ continue; -+ } -+ *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); -+ argp += z; -+ } -+#if defined(__SH4__) -+ else if ((*p_arg)->type == FFI_TYPE_DOUBLE) -+ { -+ if (freg + 1 < NFREGARG) -+ { -+ freg = (freg + 1) & ~1; -+ freg += 2; -+ continue; -+ } -+ memcpy (argp, *p_argv, z); -+ argp += z; -+ } -+#endif -+ else -+ { -+ int n = (z + sizeof (int) - 1) / sizeof (int); -+ if (greg + n - 1 < NGREGARG) -+ { -+ greg += n; -+ continue; -+ } -+#if (! defined(__SH4__)) -+ else if (greg < NGREGARG) -+ { -+ greg = NGREGARG; -+ continue; -+ } -+#endif -+ memcpy (argp, *p_argv, z); -+ argp += z; -+ } -+ } -+ -+ return; -+} -+ -+/* Perform machine dependent cif processing */ -+ffi_status ffi_prep_cif_machdep(ffi_cif *cif) -+{ -+ int i, j; -+ int size, type; -+ int n, m; -+ int greg; -+#if defined(__SH4__) -+ int freg = 0; -+#endif -+ -+ cif->flags = 0; -+ -+ greg = ((return_type (cif->rtype) == FFI_TYPE_STRUCT) && -+ STRUCT_VALUE_ADDRESS_WITH_ARG) ? 1 : 0; -+ -+#if defined(__SH4__) -+ for (i = j = 0; i < cif->nargs && j < 12; i++) -+ { -+ type = (cif->arg_types)[i]->type; -+ switch (type) -+ { -+ case FFI_TYPE_FLOAT: -+ if (freg >= NFREGARG) -+ continue; -+ freg++; -+ cif->flags += ((cif->arg_types)[i]->type) << (2 * j); -+ j++; -+ break; -+ -+ case FFI_TYPE_DOUBLE: -+ if ((freg + 1) >= NFREGARG) -+ continue; -+ freg = (freg + 1) & ~1; -+ freg += 2; -+ cif->flags += ((cif->arg_types)[i]->type) << (2 * j); -+ j++; -+ break; -+ -+ default: -+ size = (cif->arg_types)[i]->size; -+ n = (size + sizeof (int) - 1) / sizeof (int); -+ if (greg + n - 1 >= NGREGARG) -+ continue; -+ greg += n; -+ for (m = 0; m < n; m++) -+ cif->flags += FFI_TYPE_INT << (2 * j++); -+ break; -+ } -+ } -+#else -+ for (i = j = 0; i < cif->nargs && j < 4; i++) -+ { -+ size = (cif->arg_types)[i]->size; -+ n = (size + sizeof (int) - 1) / sizeof (int); -+ if (greg >= NGREGARG) -+ continue; -+ else if (greg + n - 1 >= NGREGARG) -+ greg = NGREGARG; -+ else -+ greg += n; -+ for (m = 0; m < n; m++) -+ cif->flags += FFI_TYPE_INT << (2 * j++); -+ } -+#endif -+ -+ /* Set the return type flag */ -+ switch (cif->rtype->type) -+ { -+ case FFI_TYPE_STRUCT: -+ cif->flags += (unsigned) (return_type (cif->rtype)) << 24; -+ break; -+ -+ case FFI_TYPE_VOID: -+ case FFI_TYPE_FLOAT: -+ case FFI_TYPE_DOUBLE: -+ case FFI_TYPE_SINT64: -+ case FFI_TYPE_UINT64: -+ cif->flags += (unsigned) cif->rtype->type << 24; -+ break; -+ -+ default: -+ cif->flags += FFI_TYPE_INT << 24; -+ break; -+ } -+ -+ return FFI_OK; -+} -+ -+/*@-declundef@*/ -+/*@-exportheader@*/ -+extern void ffi_call_SYSV(void (*)(char *, extended_cif *), -+ /*@out@*/ extended_cif *, -+ unsigned, unsigned, -+ /*@out@*/ unsigned *, -+ void (*fn)()); -+/*@=declundef@*/ -+/*@=exportheader@*/ -+ -+void ffi_call(/*@dependent@*/ ffi_cif *cif, -+ void (*fn)(), -+ /*@out@*/ void *rvalue, -+ /*@dependent@*/ void **avalue) -+{ -+ extended_cif ecif; -+ -+ ecif.cif = cif; -+ ecif.avalue = avalue; -+ -+ /* If the return value is a struct and we don't have a return */ -+ /* value address then we need to make one */ -+ -+ if ((rvalue == NULL) && -+ (cif->rtype->type == FFI_TYPE_STRUCT)) -+ { -+ /*@-sysunrecog@*/ -+ ecif.rvalue = alloca(cif->rtype->size); -+ /*@=sysunrecog@*/ -+ } -+ else -+ ecif.rvalue = rvalue; -+ -+ -+ switch (cif->abi) -+ { -+ case FFI_SYSV: -+ /*@-usedef@*/ -+ ffi_call_SYSV(ffi_prep_args, &ecif, cif->bytes, -+ cif->flags, ecif.rvalue, fn); -+ /*@=usedef@*/ -+ break; -+ default: -+ FFI_ASSERT(0); -+ break; -+ } -+} -+ -+extern void ffi_closure_SYSV (void); -+#if defined(__SH4__) -+extern void __ic_invalidate (void *line); -+#endif -+ -+ffi_status -+ffi_prep_closure (ffi_closure* closure, -+ ffi_cif* cif, -+ void (*fun)(ffi_cif*, void*, void**, void*), -+ void *user_data) -+{ -+ unsigned int *tramp; -+ -+ FFI_ASSERT (cif->abi == FFI_GCC_SYSV); -+ -+ tramp = (unsigned int *) &closure->tramp[0]; -+#ifdef __LITTLE_ENDIAN__ -+ tramp[0] = 0xd301d202; -+ tramp[1] = 0x0009422b; -+#else -+ tramp[0] = 0xd202d301; -+ tramp[1] = 0x422b0009; -+#endif -+ *(void **) &tramp[2] = (void *)closure; /* ctx */ -+ *(void **) &tramp[3] = (void *)ffi_closure_SYSV; /* funaddr */ -+ -+ closure->cif = cif; -+ closure->fun = fun; -+ closure->user_data = user_data; -+ -+#if defined(__SH4__) -+ /* Flush the icache. */ -+ __ic_invalidate(&closure->tramp[0]); -+#endif -+ -+ return FFI_OK; -+} -+ -+/* Basically the trampoline invokes ffi_closure_SYSV, and on -+ * entry, r3 holds the address of the closure. -+ * After storing the registers that could possibly contain -+ * parameters to be passed into the stack frame and setting -+ * up space for a return value, ffi_closure_SYSV invokes the -+ * following helper function to do most of the work. -+ */ -+ -+#ifdef __LITTLE_ENDIAN__ -+#define OFS_INT8 0 -+#define OFS_INT16 2 -+#else -+#define OFS_INT8 3 -+#define OFS_INT16 2 -+#endif -+ -+int -+ffi_closure_helper_SYSV (ffi_closure *closure, void *rvalue, -+ unsigned long *pgr, unsigned long *pfr, -+ unsigned long *pst) -+{ -+ void **avalue; -+ ffi_type **p_arg; -+ int i, avn; -+ int ireg, greg = 0; -+#if defined(__SH4__) -+ int freg = 0; -+#endif -+ ffi_cif *cif; -+ double temp; -+ -+ cif = closure->cif; -+ avalue = alloca(cif->nargs * sizeof(void *)); -+ -+ /* Copy the caller's structure return value address so that the closure -+ returns the data directly to the caller. */ -+ if (cif->rtype->type == FFI_TYPE_STRUCT) -+ { -+ rvalue = *pgr++; -+ ireg = STRUCT_VALUE_ADDRESS_WITH_ARG ? 1 : 0; -+ } -+ else -+ ireg = 0; -+ -+ cif = closure->cif; -+ greg = ireg; -+ avn = cif->nargs; -+ -+ /* Grab the addresses of the arguments from the stack frame. */ -+ for (i = 0, p_arg = cif->arg_types; i < avn; i++, p_arg++) -+ { -+ size_t z; -+ -+ z = (*p_arg)->size; -+ if (z < sizeof(int)) -+ { -+ if (greg++ >= NGREGARG) -+ continue; -+ -+ z = sizeof(int); -+ switch ((*p_arg)->type) -+ { -+ case FFI_TYPE_SINT8: -+ case FFI_TYPE_UINT8: -+ avalue[i] = (((char *)pgr) + OFS_INT8); -+ break; -+ -+ case FFI_TYPE_SINT16: -+ case FFI_TYPE_UINT16: -+ avalue[i] = (((char *)pgr) + OFS_INT16); -+ break; -+ -+ case FFI_TYPE_STRUCT: -+ avalue[i] = pgr; -+ break; -+ -+ default: -+ FFI_ASSERT(0); -+ } -+ pgr++; -+ } -+ else if (z == sizeof(int)) -+ { -+#if defined(__SH4__) -+ if ((*p_arg)->type == FFI_TYPE_FLOAT) -+ { -+ if (freg++ >= NFREGARG) -+ continue; -+ avalue[i] = pfr; -+ pfr++; -+ } -+ else -+#endif -+ { -+ if (greg++ >= NGREGARG) -+ continue; -+ avalue[i] = pgr; -+ pgr++; -+ } -+ } -+#if defined(__SH4__) -+ else if ((*p_arg)->type == FFI_TYPE_DOUBLE) -+ { -+ if (freg + 1 >= NFREGARG) -+ continue; -+ freg = (freg + 1) & ~1; -+ freg += 2; -+ avalue[i] = pfr; -+ pfr += 2; -+ } -+#endif -+ else -+ { -+ int n = (z + sizeof (int) - 1) / sizeof (int); -+#if defined(__SH4__) -+ if (greg + n - 1 >= NGREGARG) -+ continue; -+ greg += n; -+#else -+ if (greg >= NGREGARG) -+ continue; -+ else if (greg + n - 1 >= NGREGARG) -+ greg = NGREGARG; -+ else -+ greg += n; -+#endif -+ avalue[i] = pgr; -+ pgr += n; -+ } -+ } -+ -+ greg = ireg; -+#if defined(__SH4__) -+ freg = 0; -+#endif -+ -+ for (i = 0, p_arg = cif->arg_types; i < avn; i++, p_arg++) -+ { -+ size_t z; -+ -+ z = (*p_arg)->size; -+ if (z < sizeof(int)) -+ { -+ if (greg++ < NGREGARG) -+ continue; -+ -+ z = sizeof(int); -+ switch ((*p_arg)->type) -+ { -+ case FFI_TYPE_SINT8: -+ case FFI_TYPE_UINT8: -+ avalue[i] = (((char *)pst) + OFS_INT8); -+ break; -+ -+ case FFI_TYPE_SINT16: -+ case FFI_TYPE_UINT16: -+ avalue[i] = (((char *)pst) + OFS_INT16); -+ break; -+ -+ case FFI_TYPE_STRUCT: -+ avalue[i] = pst; -+ break; -+ -+ default: -+ FFI_ASSERT(0); -+ } -+ pst++; -+ } -+ else if (z == sizeof(int)) -+ { -+#if defined(__SH4__) -+ if ((*p_arg)->type == FFI_TYPE_FLOAT) -+ { -+ if (freg++ < NFREGARG) -+ continue; -+ } -+ else -+#endif -+ { -+ if (greg++ < NGREGARG) -+ continue; -+ } -+ avalue[i] = pst; -+ pst++; -+ } -+#if defined(__SH4__) -+ else if ((*p_arg)->type == FFI_TYPE_DOUBLE) -+ { -+ if (freg + 1 < NFREGARG) -+ { -+ freg = (freg + 1) & ~1; -+ freg += 2; -+ continue; -+ } -+ avalue[i] = pst; -+ pst += 2; -+ } -+#endif -+ else -+ { -+ int n = (z + sizeof (int) - 1) / sizeof (int); -+ if (greg + n - 1 < NGREGARG) -+ { -+ greg += n; -+ continue; -+ } -+#if (! defined(__SH4__)) -+ else if (greg < NGREGARG) -+ { -+ greg = NGREGARG; -+ continue; -+ } -+#endif -+ avalue[i] = pst; -+ pst += n; -+ } -+ } -+ -+ (closure->fun) (cif, rvalue, avalue, closure->user_data); -+ -+ /* Tell ffi_closure_osf how to perform return type promotions. */ -+ return cif->rtype->type; -+} -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/sh/sysv.S gcc/libffi/src/sh/sysv.S ---- gcc-3.2.2.orig/libffi/src/sh/sysv.S Thu Jan 1 09:00:00 1970 -+++ gcc/libffi/src/sh/sysv.S Tue Dec 17 03:22:48 2002 -@@ -0,0 +1,773 @@ -+/* ----------------------------------------------------------------------- -+ sysv.S - Copyright (c) 2002 Kaz Kojima -+ -+ SuperH Foreign Function Interface -+ -+ Permission is hereby granted, free of charge, to any person obtaining -+ a copy of this software and associated documentation files (the -+ ``Software''), to deal in the Software without restriction, including -+ without limitation the rights to use, copy, modify, merge, publish, -+ distribute, sublicense, and/or sell copies of the Software, and to -+ permit persons to whom the Software is furnished to do so, subject to -+ the following conditions: -+ -+ The above copyright notice and this permission notice shall be included -+ in all copies or substantial portions of the Software. -+ -+ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS -+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -+ IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR -+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ OTHER DEALINGS IN THE SOFTWARE. -+ ----------------------------------------------------------------------- */ -+ -+#define LIBFFI_ASM -+#include -+#ifdef HAVE_MACHINE_ASM_H -+#include -+#else -+/* XXX these lose for some platforms, I'm sure. */ -+#define CNAME(x) x -+#define ENTRY(x) .globl CNAME(x); .type CNAME(x),%function; CNAME(x): -+#endif -+ -+#if defined(__HITACHI__) -+#define STRUCT_VALUE_ADDRESS_WITH_ARG 1 -+#else -+#define STRUCT_VALUE_ADDRESS_WITH_ARG 0 -+#endif -+ -+.text -+ -+ # r4: ffi_prep_args -+ # r5: &ecif -+ # r6: bytes -+ # r7: flags -+ # sp+0: rvalue -+ # sp+4: fn -+ -+ # This assumes we are using gas. -+ENTRY(ffi_call_SYSV) -+ # Save registers -+.LFB1: -+ mov.l r8,@-r15 -+.LCFI0: -+ mov.l r9,@-r15 -+.LCFI1: -+ mov.l r10,@-r15 -+.LCFI2: -+ mov.l r12,@-r15 -+.LCFI3: -+ mov.l r14,@-r15 -+.LCFI4: -+ sts.l pr,@-r15 -+.LCFI5: -+ mov r15,r14 -+.LCFI6: -+#if defined(__SH4__) -+ mov r6,r8 -+ mov r7,r9 -+ -+ sub r6,r15 -+ add #-16,r15 -+ mov #~7,r0 -+ and r0,r15 -+ -+ mov r4,r0 -+ jsr @r0 -+ mov r15,r4 -+ -+ mov r9,r1 -+ shlr8 r9 -+ shlr8 r9 -+ shlr8 r9 -+ -+ mov #FFI_TYPE_STRUCT,r2 -+ cmp/eq r2,r9 -+ bf 1f -+#if STRUCT_VALUE_ADDRESS_WITH_ARG -+ mov.l @r15+,r4 -+ bra 2f -+ mov #5,r2 -+#else -+ mov.l @r15+,r10 -+#endif -+1: -+ mov #4,r2 -+2: -+ mov #4,r3 -+ -+L_pass: -+ cmp/pl r8 -+ bf L_call_it -+ -+ mov r1,r0 -+ and #3,r0 -+ -+L_pass_d: -+ cmp/eq #FFI_TYPE_DOUBLE,r0 -+ bf L_pass_f -+ -+ mov r3,r0 -+ and #1,r0 -+ tst r0,r0 -+ bt 1f -+ add #1,r3 -+1: -+ mov r15,r0 -+ and #7,r0 -+ tst r0,r0 -+ bt 2f -+ add #4,r15 -+2: -+ mov #12,r0 -+ cmp/hs r0,r3 -+ bt/s 3f -+ shlr2 r1 -+ bsr L_pop_d -+ nop -+3: -+ add #2,r3 -+ bra L_pass -+ add #-8,r8 -+ -+L_pop_d: -+ mov r3,r0 -+ add r0,r0 -+ add r3,r0 -+ add #-12,r0 -+ braf r0 -+ nop -+#ifdef __LITTLE_ENDIAN__ -+ fmov.s @r15+,fr5 -+ rts -+ fmov.s @r15+,fr4 -+ fmov.s @r15+,fr7 -+ rts -+ fmov.s @r15+,fr6 -+ fmov.s @r15+,fr9 -+ rts -+ fmov.s @r15+,fr8 -+ fmov.s @r15+,fr11 -+ rts -+ fmov.s @r15+,fr10 -+#else -+ fmov.s @r15+,fr4 -+ rts -+ fmov.s @r15+,fr5 -+ fmov.s @r15+,fr6 -+ rts -+ fmov.s @r15+,fr7 -+ fmov.s @r15+,fr8 -+ rts -+ fmov.s @r15+,fr9 -+ fmov.s @r15+,fr10 -+ rts -+ fmov.s @r15+,fr11 -+#endif -+ -+L_pass_f: -+ cmp/eq #FFI_TYPE_FLOAT,r0 -+ bf L_pass_i -+ -+ mov #12,r0 -+ cmp/hs r0,r3 -+ bt/s 2f -+ shlr2 r1 -+ bsr L_pop_f -+ nop -+2: -+ add #1,r3 -+ bra L_pass -+ add #-4,r8 -+ -+L_pop_f: -+ mov r3,r0 -+ shll2 r0 -+ add #-16,r0 -+ braf r0 -+ nop -+#ifdef __LITTLE_ENDIAN__ -+ rts -+ fmov.s @r15+,fr5 -+ rts -+ fmov.s @r15+,fr4 -+ rts -+ fmov.s @r15+,fr7 -+ rts -+ fmov.s @r15+,fr6 -+ rts -+ fmov.s @r15+,fr9 -+ rts -+ fmov.s @r15+,fr8 -+ rts -+ fmov.s @r15+,fr11 -+ rts -+ fmov.s @r15+,fr10 -+#else -+ rts -+ fmov.s @r15+,fr4 -+ rts -+ fmov.s @r15+,fr5 -+ rts -+ fmov.s @r15+,fr6 -+ rts -+ fmov.s @r15+,fr7 -+ rts -+ fmov.s @r15+,fr8 -+ rts -+ fmov.s @r15+,fr9 -+ rts -+ fmov.s @r15+,fr10 -+ rts -+ fmov.s @r15+,fr11 -+#endif -+ -+L_pass_i: -+ cmp/eq #FFI_TYPE_INT,r0 -+ bf L_call_it -+ -+ mov #8,r0 -+ cmp/hs r0,r2 -+ bt/s 2f -+ shlr2 r1 -+ bsr L_pop_i -+ nop -+2: -+ add #1,r2 -+ bra L_pass -+ add #-4,r8 -+ -+L_pop_i: -+ mov r2,r0 -+ shll2 r0 -+ add #-16,r0 -+ braf r0 -+ nop -+ rts -+ mov.l @r15+,r4 -+ rts -+ mov.l @r15+,r5 -+ rts -+ mov.l @r15+,r6 -+ rts -+ mov.l @r15+,r7 -+ -+L_call_it: -+ # call function -+#if (! STRUCT_VALUE_ADDRESS_WITH_ARG) -+ mov r10, r2 -+#endif -+ mov.l @(28,r14),r1 -+ jsr @r1 -+ nop -+ -+L_ret_d: -+ mov #FFI_TYPE_DOUBLE,r2 -+ cmp/eq r2,r9 -+ bf L_ret_ll -+ -+ mov.l @(24,r14),r1 -+#ifdef __LITTLE_ENDIAN__ -+ fmov.s fr1,@r1 -+ add #4,r1 -+ bra L_epilogue -+ fmov.s fr0,@r1 -+#else -+ fmov.s fr0,@r1 -+ add #4,r1 -+ bra L_epilogue -+ fmov.s fr1,@r1 -+#endif -+ -+L_ret_ll: -+ mov #FFI_TYPE_SINT64,r2 -+ cmp/eq r2,r9 -+ bt/s 1f -+ mov #FFI_TYPE_UINT64,r2 -+ cmp/eq r2,r9 -+ bf L_ret_f -+ -+1: -+ mov.l @(24,r14),r2 -+ mov.l r0,@r2 -+ bra L_epilogue -+ mov.l r1,@(4,r2) -+ -+L_ret_f: -+ mov #FFI_TYPE_FLOAT,r2 -+ cmp/eq r2,r9 -+ bf L_ret_i -+ -+ mov.l @(24,r14),r1 -+ bra L_epilogue -+ fmov.s fr0,@r1 -+ -+L_ret_i: -+ mov #FFI_TYPE_INT,r2 -+ cmp/eq r2,r9 -+ bf L_epilogue -+ -+ mov.l @(24,r14),r1 -+ bra L_epilogue -+ mov.l r0,@r1 -+ -+L_epilogue: -+ # Remove the space we pushed for the args -+ mov r14,r15 -+ -+ lds.l @r15+,pr -+ mov.l @r15+,r14 -+ mov.l @r15+,r12 -+ mov.l @r15+,r10 -+ mov.l @r15+,r9 -+ rts -+ mov.l @r15+,r8 -+#else -+ mov r6,r8 -+ mov r7,r9 -+ -+ sub r6,r15 -+ add #-16,r15 -+ mov #~7,r0 -+ and r0,r15 -+ -+ mov r4,r0 -+ jsr @r0 -+ mov r15,r4 -+ -+ mov r9,r3 -+ shlr8 r9 -+ shlr8 r9 -+ shlr8 r9 -+ -+ mov #FFI_TYPE_STRUCT,r2 -+ cmp/eq r2,r9 -+ bf 1f -+#if STRUCT_VALUE_ADDRESS_WITH_ARG -+ mov.l @r15+,r4 -+ bra 2f -+ mov #5,r2 -+#else -+ mov.l @r15+,r10 -+#endif -+1: -+ mov #4,r2 -+2: -+ -+L_pass: -+ cmp/pl r8 -+ bf L_call_it -+ -+ mov r3,r0 -+ and #3,r0 -+ -+L_pass_d: -+ cmp/eq #FFI_TYPE_DOUBLE,r0 -+ bf L_pass_i -+ -+ mov r15,r0 -+ and #7,r0 -+ tst r0,r0 -+ bt 1f -+ add #4,r15 -+1: -+ mov #8,r0 -+ cmp/hs r0,r2 -+ bt/s 2f -+ shlr2 r3 -+ bsr L_pop_d -+ nop -+2: -+ add #2,r2 -+ bra L_pass -+ add #-8,r8 -+ -+L_pop_d: -+ mov r2,r0 -+ add r0,r0 -+ add r2,r0 -+ add #-12,r0 -+ add r0,r0 -+ braf r0 -+ nop -+ mov.l @r15+,r4 -+ rts -+ mov.l @r15+,r5 -+ mov.l @r15+,r5 -+ rts -+ mov.l @r15+,r6 -+ mov.l @r15+,r6 -+ rts -+ mov.l @r15+,r7 -+ rts -+ mov.l @r15+,r7 -+ -+L_pass_i: -+ mov #8,r0 -+ cmp/hs r0,r2 -+ bt/s 2f -+ shlr2 r3 -+ bsr L_pop_i -+ nop -+2: -+ add #1,r2 -+ bra L_pass -+ add #-4,r8 -+ -+L_pop_i: -+ mov r2,r0 -+ shll2 r0 -+ add #-16,r0 -+ braf r0 -+ nop -+ rts -+ mov.l @r15+,r4 -+ rts -+ mov.l @r15+,r5 -+ rts -+ mov.l @r15+,r6 -+ rts -+ mov.l @r15+,r7 -+ -+L_call_it: -+ # call function -+#if (! STRUCT_VALUE_ADDRESS_WITH_ARG) -+ mov r10, r2 -+#endif -+ mov.l @(28,r14),r1 -+ jsr @r1 -+ nop -+ -+L_ret_d: -+ mov #FFI_TYPE_DOUBLE,r2 -+ cmp/eq r2,r9 -+ bf L_ret_ll -+ -+ mov.l @(24,r14),r2 -+ mov.l r0,@r2 -+ bra L_epilogue -+ mov.l r1,@(4,r2) -+ -+L_ret_ll: -+ mov #FFI_TYPE_SINT64,r2 -+ cmp/eq r2,r9 -+ bt/s 1f -+ mov #FFI_TYPE_UINT64,r2 -+ cmp/eq r2,r9 -+ bf L_ret_i -+ -+1: -+ mov.l @(24,r14),r2 -+ mov.l r0,@r2 -+ bra L_epilogue -+ mov.l r1,@(4,r2) -+ -+L_ret_i: -+ mov #FFI_TYPE_FLOAT,r2 -+ cmp/eq r2,r9 -+ bt 1f -+ mov #FFI_TYPE_INT,r2 -+ cmp/eq r2,r9 -+ bf L_epilogue -+1: -+ mov.l @(24,r14),r1 -+ bra L_epilogue -+ mov.l r0,@r1 -+ -+L_epilogue: -+ # Remove the space we pushed for the args -+ mov r14,r15 -+ -+ lds.l @r15+,pr -+ mov.l @r15+,r14 -+ mov.l @r15+,r12 -+ mov.l @r15+,r10 -+ mov.l @r15+,r9 -+ rts -+ mov.l @r15+,r8 -+#endif -+.LFE1: -+.ffi_call_SYSV_end: -+ .size CNAME(ffi_call_SYSV),.ffi_call_SYSV_end-CNAME(ffi_call_SYSV) -+ -+.globl ffi_closure_helper_SYSV -+ -+ENTRY(ffi_closure_SYSV) -+.LFB2: -+ mov.l r14,@-r15 -+.LCFI7: -+ sts.l pr,@-r15 -+ -+ /* Stack layout: -+ ... -+ 32 bytes (floating register parameters, SH-4 only) -+ 16 bytes (register parameters) -+ 4 bytes (result) -+ 4 bytes (5th arg) -+ <- new stack pointer -+ */ -+.LCFI8: -+#if defined(__SH4__) -+ add #-56,r15 -+#else -+ add #-24,r15 -+#endif -+.LCFI9: -+ mov r15,r14 -+.LCFIA: -+ mov r14,r1 -+ add #24,r1 -+ mov.l r7,@-r1 -+ mov.l r6,@-r1 -+ mov.l r5,@-r1 -+ mov.l r4,@-r1 -+ mov r1,r6 -+ -+#if defined(__SH4__) -+ mov r14,r1 -+ add #56,r1 -+#ifdef __LITTLE_ENDIAN__ -+ fmov.s fr10,@-r1 -+ fmov.s fr11,@-r1 -+ fmov.s fr8,@-r1 -+ fmov.s fr9,@-r1 -+ fmov.s fr6,@-r1 -+ fmov.s fr7,@-r1 -+ fmov.s fr4,@-r1 -+ fmov.s fr5,@-r1 -+#else -+ fmov.s fr11,@-r1 -+ fmov.s fr10,@-r1 -+ fmov.s fr9,@-r1 -+ fmov.s fr8,@-r1 -+ fmov.s fr7,@-r1 -+ fmov.s fr6,@-r1 -+ fmov.s fr5,@-r1 -+ fmov.s fr4,@-r1 -+#endif -+ mov r1,r7 -+#endif -+ -+ mov r14,r1 -+ add #4,r1 -+ mov r1,r5 -+ -+ mov r14,r1 -+#if defined(__SH4__) -+ add #64,r1 -+#else -+ add #32,r1 -+#endif -+ mov.l r1,@r14 -+ -+ mov.l L_helper,r0 -+ jsr @r0 -+ mov r3,r4 -+ -+ shll r0 -+ mov r0,r1 -+ mova L_table,r0 -+ add r1,r0 -+ mov.w @r0,r0 -+ mov r14,r2 -+ braf r0 -+ add #4,r2 -+0: -+ .align 2 -+L_helper: -+ .long ffi_closure_helper_SYSV -+L_table: -+ .short L_case_v - 0b /* FFI_TYPE_VOID */ -+ .short L_case_i - 0b /* FFI_TYPE_INT */ -+#if defined(__SH4__) -+ .short L_case_f - 0b /* FFI_TYPE_FLOAT */ -+ .short L_case_d - 0b /* FFI_TYPE_DOUBLE */ -+ .short L_case_d - 0b /* FFI_TYPE_LONGDOUBLE */ -+#else -+ .short L_case_i - 0b /* FFI_TYPE_FLOAT */ -+ .short L_case_ll - 0b /* FFI_TYPE_DOUBLE */ -+ .short L_case_ll - 0b /* FFI_TYPE_LONGDOUBLE */ -+#endif -+ .short L_case_uq - 0b /* FFI_TYPE_UINT8 */ -+ .short L_case_q - 0b /* FFI_TYPE_SINT8 */ -+ .short L_case_uh - 0b /* FFI_TYPE_UINT16 */ -+ .short L_case_h - 0b /* FFI_TYPE_SINT16 */ -+ .short L_case_i - 0b /* FFI_TYPE_UINT32 */ -+ .short L_case_i - 0b /* FFI_TYPE_SINT32 */ -+ .short L_case_ll - 0b /* FFI_TYPE_UINT64 */ -+ .short L_case_ll - 0b /* FFI_TYPE_SINT64 */ -+ .short L_case_v - 0b /* FFI_TYPE_STRUCT */ -+ .short L_case_i - 0b /* FFI_TYPE_POINTER */ -+ -+#if defined(__SH4__) -+L_case_d: -+#ifdef __LITTLE_ENDIAN__ -+ fmov.s @r2+,fr1 -+ bra L_case_v -+ fmov.s @r2,fr0 -+#else -+ fmov.s @r2+,fr0 -+ bra L_case_v -+ fmov.s @r2,fr1 -+#endif -+ -+L_case_f: -+ bra L_case_v -+ fmov.s @r2,fr0 -+#endif -+ -+L_case_ll: -+ mov.l @r2+,r0 -+ bra L_case_v -+ mov.l @r2,r1 -+ -+L_case_i: -+ bra L_case_v -+ mov.l @r2,r0 -+ -+L_case_q: -+#ifdef __LITTLE_ENDIAN__ -+#else -+ add #3,r2 -+#endif -+ bra L_case_v -+ mov.b @r2,r0 -+ -+L_case_uq: -+#ifdef __LITTLE_ENDIAN__ -+#else -+ add #3,r2 -+#endif -+ mov.b @r2,r0 -+ bra L_case_v -+ extu.b r0,r0 -+ -+L_case_h: -+#ifdef __LITTLE_ENDIAN__ -+#else -+ add #2,r2 -+#endif -+ bra L_case_v -+ mov.w @r2,r0 -+ -+L_case_uh: -+#ifdef __LITTLE_ENDIAN__ -+#else -+ add #2,r2 -+#endif -+ mov.w @r2,r0 -+ extu.w r0,r0 -+ /* fall through */ -+ -+L_case_v: -+#if defined(__SH4__) -+ add #56,r15 -+#else -+ add #24,r15 -+#endif -+ lds.l @r15+,pr -+ rts -+ mov.l @r15+,r14 -+.LFE2: -+.ffi_closure_SYSV_end: -+ .size CNAME(ffi_closure_SYSV),.ffi_closure_SYSV_end-CNAME(ffi_closure_SYSV) -+ -+ .section ".eh_frame","aw",@progbits -+__FRAME_BEGIN__: -+ .4byte .LECIE1-.LSCIE1 /* Length of Common Information Entry */ -+.LSCIE1: -+ .4byte 0x0 /* CIE Identifier Tag */ -+ .byte 0x1 /* CIE Version */ -+ .byte 0x0 /* CIE Augmentation */ -+ .byte 0x1 /* uleb128 0x1; CIE Code Alignment Factor */ -+ .byte 0x7c /* sleb128 -4; CIE Data Alignment Factor */ -+ .byte 0x11 /* CIE RA Column */ -+ .byte 0xc /* DW_CFA_def_cfa */ -+ .byte 0xf /* uleb128 0xf */ -+ .byte 0x0 /* uleb128 0x0 */ -+ .align 2 -+.LECIE1: -+.LSFDE1: -+ .4byte .LEFDE1-.LASFDE1 /* FDE Length */ -+.LASFDE1: -+ .4byte .LASFDE1-__FRAME_BEGIN__ /* FDE CIE offset */ -+ .4byte .LFB1 /* FDE initial location */ -+ .4byte .LFE1-.LFB1 /* FDE address range */ -+ .byte 0x4 /* DW_CFA_advance_loc4 */ -+ .4byte .LCFI0-.LFB1 -+ .byte 0xe /* DW_CFA_def_cfa_offset */ -+ .byte 0x4 /* uleb128 0x4 */ -+ .byte 0x4 /* DW_CFA_advance_loc4 */ -+ .4byte .LCFI1-.LCFI0 -+ .byte 0xe /* DW_CFA_def_cfa_offset */ -+ .byte 0x8 /* uleb128 0x4 */ -+ .byte 0x4 /* DW_CFA_advance_loc4 */ -+ .4byte .LCFI2-.LCFI1 -+ .byte 0xe /* DW_CFA_def_cfa_offset */ -+ .byte 0xc /* uleb128 0x4 */ -+ .byte 0x4 /* DW_CFA_advance_loc4 */ -+ .4byte .LCFI3-.LCFI2 -+ .byte 0xe /* DW_CFA_def_cfa_offset */ -+ .byte 0x10 /* uleb128 0x4 */ -+ .byte 0x4 /* DW_CFA_advance_loc4 */ -+ .4byte .LCFI4-.LCFI3 -+ .byte 0xe /* DW_CFA_def_cfa_offset */ -+ .byte 0x14 /* uleb128 0x4 */ -+ .byte 0x4 /* DW_CFA_advance_loc4 */ -+ .4byte .LCFI5-.LCFI4 -+ .byte 0xe /* DW_CFA_def_cfa_offset */ -+ .byte 0x18 /* uleb128 0x4 */ -+ .byte 0x91 /* DW_CFA_offset, column 0x11 */ -+ .byte 0x6 /* uleb128 0x6 */ -+ .byte 0x8e /* DW_CFA_offset, column 0xe */ -+ .byte 0x5 /* uleb128 0x5 */ -+ .byte 0x8c /* DW_CFA_offset, column 0xc */ -+ .byte 0x4 /* uleb128 0x4 */ -+ .byte 0x8a /* DW_CFA_offset, column 0xa */ -+ .byte 0x3 /* uleb128 0x3 */ -+ .byte 0x89 /* DW_CFA_offset, column 0x9 */ -+ .byte 0x2 /* uleb128 0x2 */ -+ .byte 0x88 /* DW_CFA_offset, column 0x8 */ -+ .byte 0x1 /* uleb128 0x1 */ -+ .byte 0x4 /* DW_CFA_advance_loc4 */ -+ .4byte .LCFI6-.LCFI5 -+ .byte 0xd /* DW_CFA_def_cfa_register */ -+ .byte 0xe /* uleb128 0xe */ -+ .align 2 -+.LEFDE1: -+ -+.LSFDE3: -+ .4byte .LEFDE3-.LASFDE3 /* FDE Length */ -+.LASFDE3: -+ .4byte .LASFDE3-__FRAME_BEGIN__ /* FDE CIE offset */ -+ .4byte .LFB2 /* FDE initial location */ -+ .4byte .LFE2-.LFB2 /* FDE address range */ -+ .byte 0x4 /* DW_CFA_advance_loc4 */ -+ .4byte .LCFI7-.LFB2 -+ .byte 0xe /* DW_CFA_def_cfa_offset */ -+ .byte 0x4 /* uleb128 0x4 */ -+ .byte 0x4 /* DW_CFA_advance_loc4 */ -+ .4byte .LCFI8-.LCFI7 -+ .byte 0xe /* DW_CFA_def_cfa_offset */ -+ .byte 0x8 /* uleb128 0x8 */ -+ .byte 0x4 /* DW_CFA_advance_loc4 */ -+ .4byte .LCFI9-.LCFI8 -+ .byte 0xe /* DW_CFA_def_cfa_offset */ -+#if defined(__SH4__) -+ .byte 8+56 /* uleb128 8+56 */ -+#else -+ .byte 8+24 /* uleb128 8+24 */ -+#endif -+ .byte 0x91 /* DW_CFA_offset, column 0x11 */ -+ .byte 0x2 -+ .byte 0x8e /* DW_CFA_offset, column 0xe */ -+ .byte 0x1 -+ .byte 0x4 /* DW_CFA_advance_loc4 */ -+ .4byte .LCFIA-.LCFI9 -+ .byte 0xd /* DW_CFA_def_cfa_register */ -+ .byte 0xe /* uleb128 0xe */ -+ .align 2 -+.LEFDE3: -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/sparc/ffi.c gcc/libffi/src/sparc/ffi.c ---- gcc-3.2.2.orig/libffi/src/sparc/ffi.c Sat Mar 3 07:21:23 2001 -+++ gcc/libffi/src/sparc/ffi.c Sat Jan 4 08:08:56 2003 -@@ -1,5 +1,5 @@ - /* ----------------------------------------------------------------------- -- ffi.c - Copyright (c) 1996 Cygnus Solutions -+ ffi.c - Copyright (c) 1996, 2003 Cygnus Solutions - - Sparc Foreign Function Interface - -@@ -28,20 +28,22 @@ - - #include - -+#ifdef SPARC64 -+extern void ffi_closure_v9(void); -+#else -+extern void ffi_closure_v8(void); -+#endif -+ - /* ffi_prep_args is called by the assembly routine once stack space - has been allocated for the function's arguments */ - - void ffi_prep_args_v8(char *stack, extended_cif *ecif) - { - int i; -- int tmp; -- int avn; - void **p_argv; - char *argp; - ffi_type **p_arg; - -- tmp = 0; -- - /* Skip 16 words for the window save area */ - argp = stack + 16*sizeof(int); - -@@ -66,18 +68,12 @@ - ((int*)argp)[5] = 0; - #endif - -- avn = ecif->cif->nargs; - p_argv = ecif->avalue; - -- for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; -- i && avn; -- i--, p_arg++) -+ for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; i; i--, p_arg++) - { - size_t z; - -- if (avn) -- { -- avn--; - if ((*p_arg)->type == FFI_TYPE_STRUCT - #if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE - || (*p_arg)->type == FFI_TYPE_LONGDOUBLE -@@ -122,7 +118,6 @@ - } - p_argv++; - argp += z; -- } - } - - return; -@@ -420,3 +415,101 @@ - } - - } -+ -+ffi_status -+ffi_prep_closure (ffi_closure* closure, -+ ffi_cif* cif, -+ void (*fun)(ffi_cif*, void*, void**, void*), -+ void *user_data) -+{ -+ unsigned int *tramp = (unsigned int *) &closure->tramp[0]; -+ unsigned long fn; -+ unsigned long ctx = (unsigned long) closure; -+ -+#ifdef SPARC64 -+ /* Trampoline address is equal to the closure address. We take advantage -+ of that to reduce the trampoline size by 8 bytes. */ -+ FFI_ASSERT (cif->abi == FFI_V9); -+ fn = (unsigned long) ffi_closure_v9; -+ tramp[0] = 0x83414000; /* rd %pc, %g1 */ -+ tramp[1] = 0xca586010; /* ldx [%g1+16], %g5 */ -+ tramp[2] = 0x81c14000; /* jmp %g5 */ -+ tramp[3] = 0x01000000; /* nop */ -+ *((unsigned long *) &tramp[4]) = fn; -+#else -+ FFI_ASSERT (cif->abi == FFI_V8); -+ fn = (unsigned long) ffi_closure_v8; -+ tramp[0] = 0x03000000 | fn >> 10; /* sethi %hi(fn), %g1 */ -+ tramp[1] = 0x05000000 | ctx >> 10; /* sethi %hi(ctx), %g2 */ -+ tramp[2] = 0x81c06000 | (fn & 0x3ff); /* jmp %g1+%lo(fn) */ -+ tramp[3] = 0x8410a000 | (ctx & 0x3ff);/* or %g2, %lo(ctx) */ -+#endif -+ -+ closure->cif = cif; -+ closure->fun = fun; -+ closure->user_data = user_data; -+ -+ /* Flush the Icache. FIXME: alignment isn't certain, assume 8 bytes */ -+#ifdef SPARC64 -+ asm volatile ("flush %0" : : "r" (closure) : "memory"); -+ asm volatile ("flush %0" : : "r" (((char *) closure) + 8) : "memory"); -+#else -+ asm volatile ("iflush %0" : : "r" (closure) : "memory"); -+ asm volatile ("iflush %0" : : "r" (((char *) closure) + 8) : "memory"); -+#endif -+ -+ return FFI_OK; -+} -+ -+int -+ffi_closure_sparc_inner(ffi_closure *closure, -+ void *rvalue, unsigned long *gpr, double *fpr) -+{ -+ ffi_cif *cif; -+ void **avalue; -+ ffi_type **arg_types; -+ int i, avn, argn; -+ -+ cif = closure->cif; -+ avalue = alloca(cif->nargs * sizeof(void *)); -+ -+ argn = 0; -+ -+ /* Copy the caller's structure return address to that the closure -+ returns the data directly to the caller. */ -+ if (cif->flags == FFI_TYPE_STRUCT) -+ { -+ rvalue = (void *) gpr[0]; -+ argn = 1; -+ } -+ -+ i = 0; -+ avn = cif->nargs; -+ arg_types = cif->arg_types; -+ -+ /* Grab the addresses of the arguments from the stack frame. */ -+ while (i < avn) -+ { -+ /* Assume big-endian. FIXME */ -+ argn += ALIGN(arg_types[i]->size, SIZEOF_ARG) / SIZEOF_ARG; -+ -+#ifdef SPARC64 -+ if (i < 6 && (arg_types[i]->type == FFI_TYPE_FLOAT -+ || arg_types[i]->type == FFI_TYPE_DOUBLE -+#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE -+ || arg_types[i]->type == FFI_TYPE_LONGDOUBLE -+#endif -+ )) -+ avalue[i] = ((char *) &fpr[argn]) - arg_types[i]->size; -+ else -+#endif -+ avalue[i] = ((char *) &gpr[argn]) - arg_types[i]->size; -+ i++; -+ } -+ -+ /* Invoke the closure. */ -+ (closure->fun) (cif, rvalue, avalue, closure->user_data); -+ -+ /* Tell ffi_closure_sparc how to perform return type promotions. */ -+ return cif->rtype->type; -+} -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/sparc/v8.S gcc/libffi/src/sparc/v8.S ---- gcc-3.2.2.orig/libffi/src/sparc/v8.S Mon Apr 29 05:12:04 2002 -+++ gcc/libffi/src/sparc/v8.S Sat Jan 4 08:08:56 2003 -@@ -1,5 +1,5 @@ - /* ----------------------------------------------------------------------- -- v8.S - Copyright (c) 1996, 1997 Cygnus Solutions -+ v8.S - Copyright (c) 1996, 1997, 2003 Cygnus Solutions - - Sparc Foreign Function Interface - -@@ -94,6 +94,72 @@ - .ffi_call_V8_end: - .size ffi_call_V8,.ffi_call_V8_end-ffi_call_V8 - -+ -+#define STACKFRAME 104 /* 16*4 register window + -+ 1*4 struct return + -+ 6*4 args backing store + -+ 3*4 locals */ -+ -+/* ffi_closure_v8(...) -+ -+ Receives the closure argument in %g2. */ -+ -+ .text -+ .align 8 -+ .globl ffi_closure_v8 -+ -+ffi_closure_v8: -+ .register %g2, #scratch -+.LLFB2: -+ save %sp, -STACKFRAME, %sp -+.LLCFI1: -+ -+ ! Store all of the potential argument registers in va_list format. -+ st %i0, [%fp+68+0] -+ st %i1, [%fp+68+4] -+ st %i2, [%fp+68+8] -+ st %i3, [%fp+68+12] -+ st %i4, [%fp+68+16] -+ st %i5, [%fp+68+20] -+ -+ ! Call ffi_closure_sparc_inner to do the bulk of the work. -+ mov %g2, %o0 -+ add %fp, -8, %o1 -+ add %fp, 68, %o2 -+ call ffi_closure_sparc_inner -+ mov 0, %o3 -+ -+ ! Load up the return value in the proper type. -+ cmp %o0, FFI_TYPE_VOID -+ be done1 -+ -+ cmp %o0, FFI_TYPE_FLOAT -+ be,a done1 -+ ld [%fp-8], %f0 -+ -+ cmp %o0, FFI_TYPE_DOUBLE -+ be,a done1 -+ ldd [%fp-8], %f0 -+ -+ cmp %o0, FFI_TYPE_SINT64 -+ be,a integer -+ ld [%fp-4], %i1 -+ -+ cmp %o0, FFI_TYPE_UINT64 -+ be,a integer -+ ld [%fp-4], %i1 -+ -+integer: -+ ld [%fp-8], %i0 -+ -+done1: -+ ret -+ restore -+.LLFE2: -+ -+.ffi_closure_v8_end: -+ .size ffi_closure_v8,.ffi_closure_v8_end-ffi_closure_v8 -+ - #ifdef SPARC64 - #define WS 8 - #define nword xword -@@ -148,3 +214,26 @@ - .byte 0x1f ! uleb128 0x1f - .align WS - .LLEFDE1: -+.LLSFDE2: -+ .uaword .LLEFDE2-.LLASFDE2 ! FDE Length -+.LLASFDE2: -+ .uaword .LLASFDE2-.LLframe1 ! FDE CIE offset -+#ifdef HAVE_AS_SPARC_UA_PCREL -+ .uaword %r_disp32(.LLFB2) -+ .uaword .LLFE2-.LLFB2 ! FDE address range -+#else -+ .align WS -+ .nword .LLFB2 -+ .uanword .LLFE2-.LLFB2 ! FDE address range -+#endif -+ .byte 0x0 ! uleb128 0x0; Augmentation size -+ .byte 0x4 ! DW_CFA_advance_loc4 -+ .uaword .LLCFI1-.LLFB2 -+ .byte 0xd ! DW_CFA_def_cfa_register -+ .byte 0x1e ! uleb128 0x1e -+ .byte 0x2d ! DW_CFA_GNU_window_save -+ .byte 0x9 ! DW_CFA_register -+ .byte 0xf ! uleb128 0xf -+ .byte 0x1f ! uleb128 0x1f -+ .align WS -+.LLEFDE2: -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/sparc/v9.S gcc/libffi/src/sparc/v9.S ---- gcc-3.2.2.orig/libffi/src/sparc/v9.S Mon Apr 29 05:12:04 2002 -+++ gcc/libffi/src/sparc/v9.S Sat Jan 4 08:08:56 2003 -@@ -1,5 +1,5 @@ - /* ----------------------------------------------------------------------- -- v9.S - Copyright (c) 2000 Cygnus Solutions -+ v9.S - Copyright (c) 2000, 2003 Cygnus Solutions - - Sparc 64bit Foreign Function Interface - -@@ -99,7 +99,7 @@ - cmp %i3, FFI_TYPE_STRUCT - be,pn %icc, dostruct - -- cmp %i3, FFI_TYPE_LONGDOUBLE -+ cmp %i3, FFI_TYPE_LONGDOUBLE - bne,pt %icc, done - nop - std %f0, [%i4+0] -@@ -125,6 +125,88 @@ - .ffi_call_V9_end: - .size ffi_call_V9,.ffi_call_V9_end-ffi_call_V9 - -+ -+#define STACKFRAME 240 /* 16*8 register window + -+ 6*8 args backing store + -+ 8*8 locals */ -+#define FP %fp+STACK_BIAS -+ -+/* ffi_closure_v9(...) -+ -+ Receives the closure argument in %g1. */ -+ -+ .text -+ .align 8 -+ .globl ffi_closure_v9 -+ -+ffi_closure_v9: -+.LLFB2: -+ save %sp, -STACKFRAME, %sp -+.LLCFI1: -+ -+ ! Store all of the potential argument registers in va_list format. -+ stx %i0, [FP+128+0] -+ stx %i1, [FP+128+8] -+ stx %i2, [FP+128+16] -+ stx %i3, [FP+128+24] -+ stx %i4, [FP+128+32] -+ stx %i5, [FP+128+40] -+ -+ ! Store possible floating point argument registers too. -+ std %f0, [FP-48] -+ std %f2, [FP-40] -+ std %f4, [FP-32] -+ std %f6, [FP-24] -+ std %f8, [FP-16] -+ std %f10, [FP-8] -+ -+ ! Call ffi_closure_sparc_inner to do the bulk of the work. -+ mov %g1, %o0 -+ add %fp, STACK_BIAS-64, %o1 -+ add %fp, STACK_BIAS+128, %o2 -+ call ffi_closure_sparc_inner -+ add %fp, STACK_BIAS-48, %o3 -+ -+ ! Load up the return value in the proper type. -+ cmp %o0, FFI_TYPE_VOID -+ be,pn %icc, done1 -+ -+ cmp %o0, FFI_TYPE_FLOAT -+ be,a,pn %icc, done1 -+ ld [FP-64], %f0 -+ -+ cmp %o0, FFI_TYPE_DOUBLE -+ be,a,pn %icc, done1 -+ ldd [FP-64], %f0 -+ -+ cmp %o0, FFI_TYPE_LONGDOUBLE -+ be,a,pn %icc, longdouble1 -+ ldd [FP-64], %f0 -+ -+ cmp %o0, FFI_TYPE_STRUCT -+ be,pn %icc, struct1 -+ -+ ! FFI_TYPE_UINT64 | FFI_TYPE_SINT64 | FFI_TYPE_POINTER -+ ldx [FP-64], %i0 -+ -+done1: -+ ret -+ restore -+ -+struct1: -+ ldx [FP-56], %i2 -+ ret -+ restore -+ -+longdouble1: -+ ldd [FP-56], %f2 -+ ret -+ restore -+.LLFE2: -+ -+.ffi_closure_v9_end: -+ .size ffi_closure_v9,.ffi_closure_v9_end-ffi_closure_v9 -+ - .section ".eh_frame",#alloc,#write - .LLframe1: - .uaword .LLECIE1-.LLSCIE1 ! Length of Common Information Entry -@@ -169,5 +251,27 @@ - .byte 0x1f ! uleb128 0x1f - .align 8 - .LLEFDE1: -- -+.LLSFDE2: -+ .uaword .LLEFDE2-.LLASFDE2 ! FDE Length -+.LLASFDE2: -+ .uaword .LLASFDE2-.LLframe1 ! FDE CIE offset -+#ifdef HAVE_AS_SPARC_UA_PCREL -+ .uaword %r_disp32(.LLFB2) -+ .uaword .LLFE2-.LLFB2 ! FDE address range -+#else -+ .align 8 -+ .xword .LLFB2 -+ .uaxword .LLFE2-.LLFB2 ! FDE address range -+#endif -+ .byte 0x0 ! uleb128 0x0; Augmentation size -+ .byte 0x4 ! DW_CFA_advance_loc4 -+ .uaword .LLCFI1-.LLFB2 -+ .byte 0xd ! DW_CFA_def_cfa_register -+ .byte 0x1e ! uleb128 0x1e -+ .byte 0x2d ! DW_CFA_GNU_window_save -+ .byte 0x9 ! DW_CFA_register -+ .byte 0xf ! uleb128 0xf -+ .byte 0x1f ! uleb128 0x1f -+ .align 8 -+.LLEFDE2: - #endif -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/types.c gcc/libffi/src/types.c ---- gcc-3.2.2.orig/libffi/src/types.c Tue Mar 27 11:39:16 2001 -+++ gcc/libffi/src/types.c Wed Nov 27 07:24:05 2002 -@@ -42,7 +42,8 @@ - FFI_INTEGRAL_TYPEDEF(sint32, 4, 4, FFI_TYPE_SINT32); - FFI_INTEGRAL_TYPEDEF(float, 4, 4, FFI_TYPE_FLOAT); - --#if defined ALPHA || defined SPARC64 -+#if defined ALPHA || defined SPARC64 || defined X86_64 || defined S390X \ -+ || defined IA64 - - FFI_INTEGRAL_TYPEDEF(pointer, 8, 8, FFI_TYPE_POINTER); - -@@ -52,22 +53,12 @@ - - #endif - --#ifdef X86 -+#if defined X86 || defined X86_WIN32 || defined ARM || defined M68K - - FFI_INTEGRAL_TYPEDEF(uint64, 8, 4, FFI_TYPE_UINT64); - FFI_INTEGRAL_TYPEDEF(sint64, 8, 4, FFI_TYPE_SINT64); - --#elif defined X86_WIN32 -- --FFI_INTEGRAL_TYPEDEF(uint64, 8, 4, FFI_TYPE_UINT64); --FFI_INTEGRAL_TYPEDEF(sint64, 8, 4, FFI_TYPE_SINT64); -- --#elif defined ARM -- --FFI_INTEGRAL_TYPEDEF(uint64, 8, 4, FFI_TYPE_UINT64); --FFI_INTEGRAL_TYPEDEF(sint64, 8, 4, FFI_TYPE_SINT64); -- --#elif defined M68K -+#elif defined SH - - FFI_INTEGRAL_TYPEDEF(uint64, 8, 4, FFI_TYPE_UINT64); - FFI_INTEGRAL_TYPEDEF(sint64, 8, 4, FFI_TYPE_SINT64); -@@ -80,12 +71,7 @@ - #endif - - --#ifdef X86 -- --FFI_INTEGRAL_TYPEDEF(double, 8, 4, FFI_TYPE_DOUBLE); --FFI_INTEGRAL_TYPEDEF(longdouble, 12, 4, FFI_TYPE_LONGDOUBLE); -- --#elif defined X86_WIN32 -+#if defined X86 || defined X86_WIN32 || defined M68K - - FFI_INTEGRAL_TYPEDEF(double, 8, 4, FFI_TYPE_DOUBLE); - FFI_INTEGRAL_TYPEDEF(longdouble, 12, 4, FFI_TYPE_LONGDOUBLE); -@@ -95,25 +81,25 @@ - FFI_INTEGRAL_TYPEDEF(double, 8, 4, FFI_TYPE_DOUBLE); - FFI_INTEGRAL_TYPEDEF(longdouble, 8, 4, FFI_TYPE_LONGDOUBLE); - --#elif defined M68K -+#elif defined SH - - FFI_INTEGRAL_TYPEDEF(double, 8, 4, FFI_TYPE_DOUBLE); --FFI_INTEGRAL_TYPEDEF(longdouble, 12, 4, FFI_TYPE_LONGDOUBLE); -+FFI_INTEGRAL_TYPEDEF(longdouble, 8, 4, FFI_TYPE_LONGDOUBLE); - - #elif defined SPARC - - FFI_INTEGRAL_TYPEDEF(double, 8, 8, FFI_TYPE_DOUBLE); -- - #ifdef SPARC64 -- - FFI_INTEGRAL_TYPEDEF(longdouble, 16, 16, FFI_TYPE_LONGDOUBLE); -- - #else -- - FFI_INTEGRAL_TYPEDEF(longdouble, 16, 8, FFI_TYPE_LONGDOUBLE); -- - #endif - -+#elif defined X86_64 -+ -+FFI_INTEGRAL_TYPEDEF(double, 8, 8, FFI_TYPE_DOUBLE); -+FFI_INTEGRAL_TYPEDEF(longdouble, 16, 16, FFI_TYPE_LONGDOUBLE); -+ - #else - - FFI_INTEGRAL_TYPEDEF(double, 8, 8, FFI_TYPE_DOUBLE); -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/x86/ffi.c gcc/libffi/src/x86/ffi.c ---- gcc-3.2.2.orig/libffi/src/x86/ffi.c Tue May 28 18:22:08 2002 -+++ gcc/libffi/src/x86/ffi.c Fri Dec 6 10:16:45 2002 -@@ -1,5 +1,8 @@ - /* ----------------------------------------------------------------------- -- ffi.c - Copyright (c) 1996, 1998, 1999 Cygnus Solutions -+ ffi.c - Copyright (c) 1996, 1998, 1999, 2001 Red Hat, Inc. -+ Copyright (c) 2002 Ranjit Mathew -+ Copyright (c) 2002 Bo Thorsen -+ Copyright (c) 2002 Roger Sayle - - x86 Foreign Function Interface - -@@ -23,6 +26,8 @@ - OTHER DEALINGS IN THE SOFTWARE. - ----------------------------------------------------------------------- */ - -+#ifndef __x86_64__ -+ - #include - #include - -@@ -36,12 +41,10 @@ - /*@=exportheader@*/ - { - register unsigned int i; -- register int tmp; - register void **p_argv; - register char *argp; - register ffi_type **p_arg; - -- tmp = 0; - argp = stack; - - if (ecif->cif->rtype->type == FFI_TYPE_STRUCT) -@@ -148,6 +151,18 @@ - /*@=declundef@*/ - /*@=exportheader@*/ - -+#ifdef X86_WIN32 -+/*@-declundef@*/ -+/*@-exportheader@*/ -+extern void ffi_call_STDCALL(void (*)(char *, extended_cif *), -+ /*@out@*/ extended_cif *, -+ unsigned, unsigned, -+ /*@out@*/ unsigned *, -+ void (*fn)()); -+/*@=declundef@*/ -+/*@=exportheader@*/ -+#endif /* X86_WIN32 */ -+ - void ffi_call(/*@dependent@*/ ffi_cif *cif, - void (*fn)(), - /*@out@*/ void *rvalue, -@@ -180,6 +195,14 @@ - cif->flags, ecif.rvalue, fn); - /*@=usedef@*/ - break; -+#ifdef X86_WIN32 -+ case FFI_STDCALL: -+ /*@-usedef@*/ -+ ffi_call_STDCALL(ffi_prep_args, &ecif, cif->bytes, -+ cif->flags, ecif.rvalue, fn); -+ /*@=usedef@*/ -+ break; -+#endif /* X86_WIN32 */ - default: - FFI_ASSERT(0); - break; -@@ -266,12 +289,10 @@ - /*@=exportheader@*/ - { - register unsigned int i; -- register int tmp; - register void **p_argv; - register char *argp; - register ffi_type **p_arg; - -- tmp = 0; - argp = stack; - - if ( cif->rtype->type == FFI_TYPE_STRUCT ) { -@@ -281,13 +302,14 @@ - - p_argv = avalue; - -- for (i = cif->nargs, p_arg = cif->arg_types; i != 0; i--, p_arg++) -+ for (i = cif->nargs, p_arg = cif->arg_types; (i != 0); i--, p_arg++) - { - size_t z; - - /* Align if necessary */ -- if (((*p_arg)->alignment - 1) & (unsigned) argp) -+ if (((*p_arg)->alignment - 1) & (unsigned) argp) { - argp = (char *) ALIGN(argp, (*p_arg)->alignment); -+ } - - z = (*p_arg)->size; - -@@ -298,7 +320,7 @@ - p_argv++; - argp += z; - } -- -+ - return; - } - -@@ -449,6 +471,15 @@ - /*@out@*/ unsigned *, - void (*fn)()); - -+#ifdef X86_WIN32 -+extern void -+ffi_call_STDCALL(void (*)(char *, extended_cif *), -+ /*@out@*/ extended_cif *, -+ unsigned, unsigned, -+ /*@out@*/ unsigned *, -+ void (*fn)()); -+#endif /* X86_WIN32 */ -+ - void - ffi_raw_call(/*@dependent@*/ ffi_cif *cif, - void (*fn)(), -@@ -483,6 +514,14 @@ - cif->flags, ecif.rvalue, fn); - /*@=usedef@*/ - break; -+#ifdef X86_WIN32 -+ case FFI_STDCALL: -+ /*@-usedef@*/ -+ ffi_call_STDCALL(ffi_prep_args_raw, &ecif, cif->bytes, -+ cif->flags, ecif.rvalue, fn); -+ /*@=usedef@*/ -+ break; -+#endif /* X86_WIN32 */ - default: - FFI_ASSERT(0); - break; -@@ -490,3 +529,5 @@ - } - - #endif -+ -+#endif /* __x86_64__ */ -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/x86/ffi64.c gcc/libffi/src/x86/ffi64.c ---- gcc-3.2.2.orig/libffi/src/x86/ffi64.c Thu Jan 1 09:00:00 1970 -+++ gcc/libffi/src/x86/ffi64.c Wed Jan 29 00:54:28 2003 -@@ -0,0 +1,706 @@ -+/* ----------------------------------------------------------------------- -+ ffi.c - Copyright (c) 2002 Bo Thorsen -+ -+ x86-64 Foreign Function Interface -+ -+ Permission is hereby granted, free of charge, to any person obtaining -+ a copy of this software and associated documentation files (the -+ ``Software''), to deal in the Software without restriction, including -+ without limitation the rights to use, copy, modify, merge, publish, -+ distribute, sublicense, and/or sell copies of the Software, and to -+ permit persons to whom the Software is furnished to do so, subject to -+ the following conditions: -+ -+ The above copyright notice and this permission notice shall be included -+ in all copies or substantial portions of the Software. -+ -+ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS -+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -+ IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR -+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ OTHER DEALINGS IN THE SOFTWARE. -+ ----------------------------------------------------------------------- */ -+ -+#include -+#include -+ -+#include -+#include -+ -+/* ffi_prep_args is called by the assembly routine once stack space -+ has been allocated for the function's arguments */ -+ -+#ifdef __x86_64__ -+ -+#define MAX_GPR_REGS 6 -+#define MAX_SSE_REGS 8 -+typedef struct -+{ -+ /* Registers for argument passing. */ -+ long gpr[MAX_GPR_REGS]; -+ __int128_t sse[MAX_SSE_REGS]; -+ -+ /* Stack space for arguments. */ -+ char argspace[0]; -+} stackLayout; -+ -+/* All reference to register classes here is identical to the code in -+ gcc/config/i386/i386.c. Do *not* change one without the other. */ -+ -+/* Register class used for passing given 64bit part of the argument. -+ These represent classes as documented by the PS ABI, with the exception -+ of SSESF, SSEDF classes, that are basically SSE class, just gcc will -+ use SF or DFmode move instead of DImode to avoid reformating penalties. -+ -+ Similary we play games with INTEGERSI_CLASS to use cheaper SImode moves -+ whenever possible (upper half does contain padding). -+ */ -+enum x86_64_reg_class -+ { -+ X86_64_NO_CLASS, -+ X86_64_INTEGER_CLASS, -+ X86_64_INTEGERSI_CLASS, -+ X86_64_SSE_CLASS, -+ X86_64_SSESF_CLASS, -+ X86_64_SSEDF_CLASS, -+ X86_64_SSEUP_CLASS, -+ X86_64_X87_CLASS, -+ X86_64_X87UP_CLASS, -+ X86_64_MEMORY_CLASS -+ }; -+ -+#define MAX_CLASSES 4 -+ -+/* x86-64 register passing implementation. See x86-64 ABI for details. Goal -+ of this code is to classify each 8bytes of incoming argument by the register -+ class and assign registers accordingly. */ -+ -+/* Return the union class of CLASS1 and CLASS2. -+ See the x86-64 PS ABI for details. */ -+ -+static enum x86_64_reg_class -+merge_classes (enum x86_64_reg_class class1, enum x86_64_reg_class class2) -+{ -+ /* Rule #1: If both classes are equal, this is the resulting class. */ -+ if (class1 == class2) -+ return class1; -+ -+ /* Rule #2: If one of the classes is NO_CLASS, the resulting class is -+ the other class. */ -+ if (class1 == X86_64_NO_CLASS) -+ return class2; -+ if (class2 == X86_64_NO_CLASS) -+ return class1; -+ -+ /* Rule #3: If one of the classes is MEMORY, the result is MEMORY. */ -+ if (class1 == X86_64_MEMORY_CLASS || class2 == X86_64_MEMORY_CLASS) -+ return X86_64_MEMORY_CLASS; -+ -+ /* Rule #4: If one of the classes is INTEGER, the result is INTEGER. */ -+ if ((class1 == X86_64_INTEGERSI_CLASS && class2 == X86_64_SSESF_CLASS) -+ || (class2 == X86_64_INTEGERSI_CLASS && class1 == X86_64_SSESF_CLASS)) -+ return X86_64_INTEGERSI_CLASS; -+ if (class1 == X86_64_INTEGER_CLASS || class1 == X86_64_INTEGERSI_CLASS -+ || class2 == X86_64_INTEGER_CLASS || class2 == X86_64_INTEGERSI_CLASS) -+ return X86_64_INTEGER_CLASS; -+ -+ /* Rule #5: If one of the classes is X87 or X87UP class, MEMORY is used. */ -+ if (class1 == X86_64_X87_CLASS || class1 == X86_64_X87UP_CLASS -+ || class2 == X86_64_X87_CLASS || class2 == X86_64_X87UP_CLASS) -+ return X86_64_MEMORY_CLASS; -+ -+ /* Rule #6: Otherwise class SSE is used. */ -+ return X86_64_SSE_CLASS; -+} -+ -+/* Classify the argument of type TYPE and mode MODE. -+ CLASSES will be filled by the register class used to pass each word -+ of the operand. The number of words is returned. In case the parameter -+ should be passed in memory, 0 is returned. As a special case for zero -+ sized containers, classes[0] will be NO_CLASS and 1 is returned. -+ -+ See the x86-64 PS ABI for details. -+*/ -+static int -+classify_argument (ffi_type *type, enum x86_64_reg_class classes[], -+ int *byte_offset) -+{ -+ /* First, align to the right place. */ -+ *byte_offset = ALIGN(*byte_offset, type->alignment); -+ -+ switch (type->type) -+ { -+ case FFI_TYPE_UINT8: -+ case FFI_TYPE_SINT8: -+ case FFI_TYPE_UINT16: -+ case FFI_TYPE_SINT16: -+ case FFI_TYPE_UINT32: -+ case FFI_TYPE_SINT32: -+ case FFI_TYPE_UINT64: -+ case FFI_TYPE_SINT64: -+ case FFI_TYPE_POINTER: -+ if (((*byte_offset) % 8 + type->size) <= 4) -+ classes[0] = X86_64_INTEGERSI_CLASS; -+ else -+ classes[0] = X86_64_INTEGER_CLASS; -+ return 1; -+ case FFI_TYPE_FLOAT: -+ if (((*byte_offset) % 8) == 0) -+ classes[0] = X86_64_SSESF_CLASS; -+ else -+ classes[0] = X86_64_SSE_CLASS; -+ return 1; -+ case FFI_TYPE_DOUBLE: -+ classes[0] = X86_64_SSEDF_CLASS; -+ return 1; -+ case FFI_TYPE_LONGDOUBLE: -+ classes[0] = X86_64_X87_CLASS; -+ classes[1] = X86_64_X87UP_CLASS; -+ return 2; -+ case FFI_TYPE_STRUCT: -+ { -+ const int UNITS_PER_WORD = 8; -+ int words = (type->size + UNITS_PER_WORD - 1) / UNITS_PER_WORD; -+ ffi_type **ptr; -+ int i; -+ enum x86_64_reg_class subclasses[MAX_CLASSES]; -+ -+ /* If the struct is larger than 16 bytes, pass it on the stack. */ -+ if (type->size > 16) -+ return 0; -+ -+ for (i = 0; i < words; i++) -+ classes[i] = X86_64_NO_CLASS; -+ -+ /* Merge the fields of structure. */ -+ for (ptr=type->elements; (*ptr)!=NULL; ptr++) -+ { -+ int num; -+ -+ num = classify_argument (*ptr, subclasses, byte_offset); -+ if (num == 0) -+ return 0; -+ for (i = 0; i < num; i++) -+ { -+ int pos = *byte_offset / 8; -+ classes[i + pos] = -+ merge_classes (subclasses[i], classes[i + pos]); -+ } -+ -+ if ((*ptr)->type != FFI_TYPE_STRUCT) -+ *byte_offset += (*ptr)->size; -+ } -+ -+ /* Final merger cleanup. */ -+ for (i = 0; i < words; i++) -+ { -+ /* If one class is MEMORY, everything should be passed in -+ memory. */ -+ if (classes[i] == X86_64_MEMORY_CLASS) -+ return 0; -+ -+ /* The X86_64_SSEUP_CLASS should be always preceded by -+ X86_64_SSE_CLASS. */ -+ if (classes[i] == X86_64_SSEUP_CLASS -+ && (i == 0 || classes[i - 1] != X86_64_SSE_CLASS)) -+ classes[i] = X86_64_SSE_CLASS; -+ -+ /* X86_64_X87UP_CLASS should be preceded by X86_64_X87_CLASS. */ -+ if (classes[i] == X86_64_X87UP_CLASS -+ && (i == 0 || classes[i - 1] != X86_64_X87_CLASS)) -+ classes[i] = X86_64_SSE_CLASS; -+ } -+ return words; -+ } -+ -+ default: -+ FFI_ASSERT(0); -+ } -+ return 0; /* Never reached. */ -+} -+ -+/* Examine the argument and return set number of register required in each -+ class. Return 0 iff parameter should be passed in memory. */ -+static int -+examine_argument (ffi_type *type, int in_return, int *int_nregs,int *sse_nregs) -+{ -+ enum x86_64_reg_class class[MAX_CLASSES]; -+ int offset = 0; -+ int n; -+ -+ n = classify_argument (type, class, &offset); -+ -+ if (n == 0) -+ return 0; -+ -+ *int_nregs = 0; -+ *sse_nregs = 0; -+ for (n--; n>=0; n--) -+ switch (class[n]) -+ { -+ case X86_64_INTEGER_CLASS: -+ case X86_64_INTEGERSI_CLASS: -+ (*int_nregs)++; -+ break; -+ case X86_64_SSE_CLASS: -+ case X86_64_SSESF_CLASS: -+ case X86_64_SSEDF_CLASS: -+ (*sse_nregs)++; -+ break; -+ case X86_64_NO_CLASS: -+ case X86_64_SSEUP_CLASS: -+ break; -+ case X86_64_X87_CLASS: -+ case X86_64_X87UP_CLASS: -+ if (!in_return) -+ return 0; -+ break; -+ default: -+ abort (); -+ } -+ return 1; -+} -+ -+/* Functions to load floats and double to an SSE register placeholder. */ -+extern void float2sse (float, __int128_t *); -+extern void double2sse (double, __int128_t *); -+extern void floatfloat2sse (void *, __int128_t *); -+ -+/* Functions to put the floats and doubles back. */ -+extern float sse2float (__int128_t *); -+extern double sse2double (__int128_t *); -+extern void sse2floatfloat(__int128_t *, void *); -+ -+/*@-exportheader@*/ -+void -+ffi_prep_args (stackLayout *stack, extended_cif *ecif) -+/*@=exportheader@*/ -+{ -+ int gprcount, ssecount, i, g, s; -+ void **p_argv; -+ void *argp = &stack->argspace; -+ ffi_type **p_arg; -+ -+ /* First check if the return value should be passed in memory. If so, -+ pass the pointer as the first argument. */ -+ gprcount = ssecount = 0; -+ if (ecif->cif->rtype->type != FFI_TYPE_VOID -+ && examine_argument (ecif->cif->rtype, 1, &g, &s) == 0) -+ (void *)stack->gpr[gprcount++] = ecif->rvalue; -+ -+ for (i=ecif->cif->nargs, p_arg=ecif->cif->arg_types, p_argv = ecif->avalue; -+ i!=0; i--, p_arg++, p_argv++) -+ { -+ int in_register = 0; -+ -+ switch ((*p_arg)->type) -+ { -+ case FFI_TYPE_SINT8: -+ case FFI_TYPE_SINT16: -+ case FFI_TYPE_SINT32: -+ case FFI_TYPE_SINT64: -+ case FFI_TYPE_UINT8: -+ case FFI_TYPE_UINT16: -+ case FFI_TYPE_UINT32: -+ case FFI_TYPE_UINT64: -+ case FFI_TYPE_POINTER: -+ if (gprcount < MAX_GPR_REGS) -+ { -+ stack->gpr[gprcount] = 0; -+ stack->gpr[gprcount++] = *(long long *)(*p_argv); -+ in_register = 1; -+ } -+ break; -+ -+ case FFI_TYPE_FLOAT: -+ if (ssecount < MAX_SSE_REGS) -+ { -+ float2sse (*(float *)(*p_argv), &stack->sse[ssecount++]); -+ in_register = 1; -+ } -+ break; -+ -+ case FFI_TYPE_DOUBLE: -+ if (ssecount < MAX_SSE_REGS) -+ { -+ double2sse (*(double *)(*p_argv), &stack->sse[ssecount++]); -+ in_register = 1; -+ } -+ break; -+ } -+ -+ if (in_register) -+ continue; -+ -+ /* Either all places in registers where filled, or this is a -+ type that potentially goes into a memory slot. */ -+ if (examine_argument (*p_arg, 0, &g, &s) == 0 -+ || gprcount + g > MAX_GPR_REGS || ssecount + s > MAX_SSE_REGS) -+ { -+ /* Pass this argument in memory. */ -+ argp = (void *)ALIGN(argp, (*p_arg)->alignment); -+ memcpy (argp, *p_argv, (*p_arg)->size); -+ argp += (*p_arg)->size; -+ } -+ else -+ { -+ /* All easy cases are eliminated. Now fire the big guns. */ -+ -+ enum x86_64_reg_class classes[MAX_CLASSES]; -+ int offset = 0, j, num; -+ void *a; -+ -+ num = classify_argument (*p_arg, classes, &offset); -+ for (j=0, a=*p_argv; jgpr[gprcount++] = *(long long *)a; -+ break; -+ case X86_64_SSE_CLASS: -+ floatfloat2sse (a, &stack->sse[ssecount++]); -+ break; -+ case X86_64_SSESF_CLASS: -+ float2sse (*(float *)a, &stack->sse[ssecount++]); -+ break; -+ case X86_64_SSEDF_CLASS: -+ double2sse (*(double *)a, &stack->sse[ssecount++]); -+ break; -+ default: -+ abort(); -+ } -+ } -+ } -+ } -+} -+ -+/* Perform machine dependent cif processing. */ -+ffi_status -+ffi_prep_cif_machdep (ffi_cif *cif) -+{ -+ int gprcount, ssecount, i, g, s; -+ -+ gprcount = ssecount = 0; -+ -+ /* Reset the byte count. We handle this size estimation here. */ -+ cif->bytes = 0; -+ -+ /* If the return value should be passed in memory, pass the pointer -+ as the first argument. The actual memory isn't allocated here. */ -+ if (cif->rtype->type != FFI_TYPE_VOID -+ && examine_argument (cif->rtype, 1, &g, &s) == 0) -+ gprcount = 1; -+ -+ /* Go over all arguments and determine the way they should be passed. -+ If it's in a register and there is space for it, let that be so. If -+ not, add it's size to the stack byte count. */ -+ for (i=0; inargs; i++) -+ { -+ if (examine_argument (cif->arg_types[i], 0, &g, &s) == 0 -+ || gprcount + g > MAX_GPR_REGS || ssecount + s > MAX_SSE_REGS) -+ { -+ /* This is passed in memory. First align to the basic type. */ -+ cif->bytes = ALIGN(cif->bytes, cif->arg_types[i]->alignment); -+ -+ /* Stack arguments are *always* at least 8 byte aligned. */ -+ cif->bytes = ALIGN(cif->bytes, 8); -+ -+ /* Now add the size of this argument. */ -+ cif->bytes += cif->arg_types[i]->size; -+ } -+ else -+ { -+ gprcount += g; -+ ssecount += s; -+ } -+ } -+ -+ /* Set the flag for the closures return. */ -+ switch (cif->rtype->type) -+ { -+ case FFI_TYPE_VOID: -+ case FFI_TYPE_STRUCT: -+ case FFI_TYPE_SINT64: -+ case FFI_TYPE_FLOAT: -+ case FFI_TYPE_DOUBLE: -+ case FFI_TYPE_LONGDOUBLE: -+ cif->flags = (unsigned) cif->rtype->type; -+ break; -+ -+ case FFI_TYPE_UINT64: -+ cif->flags = FFI_TYPE_SINT64; -+ break; -+ -+ default: -+ cif->flags = FFI_TYPE_INT; -+ break; -+ } -+ -+ return FFI_OK; -+} -+ -+typedef struct -+{ -+ long gpr[2]; -+ __int128_t sse[2]; -+ long double st0; -+} return_value; -+ -+void -+ffi_fill_return_value (return_value *rv, extended_cif *ecif) -+{ -+ enum x86_64_reg_class classes[MAX_CLASSES]; -+ int i = 0, num; -+ long *gpr = rv->gpr; -+ __int128_t *sse = rv->sse; -+ signed char sc; -+ signed short ss; -+ -+ /* This is needed because of the way x86-64 handles signed short -+ integers. */ -+ switch (ecif->cif->rtype->type) -+ { -+ case FFI_TYPE_SINT8: -+ sc = *(signed char *)gpr; -+ *(long long *)ecif->rvalue = (long long)sc; -+ return; -+ case FFI_TYPE_SINT16: -+ ss = *(signed short *)gpr; -+ *(long long *)ecif->rvalue = (long long)ss; -+ return; -+ default: -+ /* Just continue. */ -+ ; -+ } -+ -+ num = classify_argument (ecif->cif->rtype, classes, &i); -+ -+ if (num == 0) -+ /* Return in memory. */ -+ ecif->rvalue = (void *) rv->gpr[0]; -+ else if (num == 2 && classes[0] == X86_64_X87_CLASS && -+ classes[1] == X86_64_X87UP_CLASS) -+ /* This is a long double (this is easiest to handle this way instead -+ of an eightbyte at a time as in the loop below. */ -+ *((long double *)ecif->rvalue) = rv->st0; -+ else -+ { -+ void *a; -+ -+ for (i=0, a=ecif->rvalue; irtype, 1, &dummy, &dummy) == 0)) -+ { -+ /*@-sysunrecog@*/ -+ ecif.rvalue = alloca(cif->rtype->size); -+ /*@=sysunrecog@*/ -+ } -+ else -+ ecif.rvalue = rvalue; -+ -+ /* Stack must always be 16byte aligned. Make it so. */ -+ cif->bytes = ALIGN(cif->bytes, 16); -+ -+ switch (cif->abi) -+ { -+ case FFI_SYSV: -+ /* Calling 32bit code from 64bit is not possible */ -+ FFI_ASSERT(0); -+ break; -+ -+ case FFI_UNIX64: -+ /*@-usedef@*/ -+ ffi_call_UNIX64 (ffi_prep_args, ffi_fill_return_value, &ecif, -+ cif->bytes, ecif.rvalue, fn); -+ /*@=usedef@*/ -+ break; -+ -+ default: -+ FFI_ASSERT(0); -+ break; -+ } -+} -+ -+extern void ffi_closure_UNIX64(void); -+ -+ffi_status -+ffi_prep_closure (ffi_closure* closure, -+ ffi_cif* cif, -+ void (*fun)(ffi_cif*, void*, void**, void*), -+ void *user_data) -+{ -+ volatile unsigned short *tramp; -+ -+ /* FFI_ASSERT (cif->abi == FFI_OSF); */ -+ -+ tramp = (volatile unsigned short *) &closure->tramp[0]; -+ tramp[0] = 0xbb49; /* mov , %r11 */ -+ tramp[5] = 0xba49; /* mov , %r10 */ -+ tramp[10] = 0xff49; /* jmp *%r11 */ -+ tramp[11] = 0x00e3; -+ *(void * volatile *) &tramp[1] = ffi_closure_UNIX64; -+ *(void * volatile *) &tramp[6] = closure; -+ -+ closure->cif = cif; -+ closure->fun = fun; -+ closure->user_data = user_data; -+ -+ return FFI_OK; -+} -+ -+int -+ffi_closure_UNIX64_inner(ffi_closure *closure, va_list l, void *rp) -+{ -+ ffi_cif *cif; -+ void **avalue; -+ ffi_type **arg_types; -+ long i, avn, argn; -+ -+ cif = closure->cif; -+ avalue = alloca(cif->nargs * sizeof(void *)); -+ -+ argn = 0; -+ -+ i = 0; -+ avn = cif->nargs; -+ arg_types = cif->arg_types; -+ -+ /* Grab the addresses of the arguments from the stack frame. */ -+ while (i < avn) -+ { -+ switch (arg_types[i]->type) -+ { -+ case FFI_TYPE_SINT8: -+ case FFI_TYPE_UINT8: -+ case FFI_TYPE_SINT16: -+ case FFI_TYPE_UINT16: -+ case FFI_TYPE_SINT32: -+ case FFI_TYPE_UINT32: -+ case FFI_TYPE_SINT64: -+ case FFI_TYPE_UINT64: -+ case FFI_TYPE_POINTER: -+ { -+ if (l->gp_offset > 48-8) -+ { -+ avalue[i] = l->overflow_arg_area; -+ l->overflow_arg_area = (char *)l->overflow_arg_area + 8; -+ } -+ else -+ { -+ avalue[i] = (char *)l->reg_save_area + l->gp_offset; -+ l->gp_offset += 8; -+ } -+ } -+ break; -+ -+ case FFI_TYPE_STRUCT: -+ /* FIXME */ -+ FFI_ASSERT(0); -+ break; -+ -+ case FFI_TYPE_DOUBLE: -+ { -+ if (l->fp_offset > 176-16) -+ { -+ avalue[i] = l->overflow_arg_area; -+ l->overflow_arg_area = (char *)l->overflow_arg_area + 8; -+ } -+ else -+ { -+ avalue[i] = (char *)l->reg_save_area + l->fp_offset; -+ l->fp_offset += 16; -+ } -+ } -+#if DEBUG_FFI -+ fprintf (stderr, "double arg %d = %g\n", i, *(double *)avalue[i]); -+#endif -+ break; -+ -+ case FFI_TYPE_FLOAT: -+ { -+ if (l->fp_offset > 176-16) -+ { -+ avalue[i] = l->overflow_arg_area; -+ l->overflow_arg_area = (char *)l->overflow_arg_area + 8; -+ } -+ else -+ { -+ avalue[i] = (char *)l->reg_save_area + l->fp_offset; -+ l->fp_offset += 16; -+ } -+ } -+#if DEBUG_FFI -+ fprintf (stderr, "float arg %d = %g\n", i, *(float *)avalue[i]); -+#endif -+ break; -+ -+ default: -+ FFI_ASSERT(0); -+ } -+ -+ argn += ALIGN(arg_types[i]->size, SIZEOF_ARG) / SIZEOF_ARG; -+ i++; -+ } -+ -+ /* Invoke the closure. */ -+ (closure->fun) (cif, rp, avalue, closure->user_data); -+ -+ /* FIXME: Structs not supported. */ -+ FFI_ASSERT(cif->rtype->type != FFI_TYPE_STRUCT); -+ -+ /* Tell ffi_closure_UNIX64 how to perform return type promotions. */ -+ -+ return cif->rtype->type; -+} -+#endif /* ifndef __x86_64__ */ -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/x86/sysv.S gcc/libffi/src/x86/sysv.S ---- gcc-3.2.2.orig/libffi/src/x86/sysv.S Tue Jul 17 02:10:53 2001 -+++ gcc/libffi/src/x86/sysv.S Fri Jul 19 08:08:31 2002 -@@ -1,5 +1,5 @@ - /* ----------------------------------------------------------------------- -- sysv.S - Copyright (c) 1996, 1998, 2001 Cygnus Solutions -+ sysv.S - Copyright (c) 1996, 1998, 2001, 2002 Cygnus Solutions - - X86 Foreign Function Interface - -@@ -23,6 +23,8 @@ - OTHER DEALINGS IN THE SOFTWARE. - ----------------------------------------------------------------------- */ - -+#ifndef __x86_64__ -+ - #define LIBFFI_ASM - #include - -@@ -163,3 +165,5 @@ - .align 4 - .LEFDE1: - .set .LLFDE1,.LEFDE1-.LSFDE1 -+ -+#endif /* ifndef __x86_64__ */ -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/x86/unix64.S gcc/libffi/src/x86/unix64.S ---- gcc-3.2.2.orig/libffi/src/x86/unix64.S Thu Jan 1 09:00:00 1970 -+++ gcc/libffi/src/x86/unix64.S Wed Jan 29 00:54:28 2003 -@@ -0,0 +1,302 @@ -+/* ----------------------------------------------------------------------- -+ unix64.S - Copyright (c) 2002 Bo Thorsen -+ -+ x86-64 Foreign Function Interface -+ -+ Permission is hereby granted, free of charge, to any person obtaining -+ a copy of this software and associated documentation files (the -+ ``Software''), to deal in the Software without restriction, including -+ without limitation the rights to use, copy, modify, merge, publish, -+ distribute, sublicense, and/or sell copies of the Software, and to -+ permit persons to whom the Software is furnished to do so, subject to -+ the following conditions: -+ -+ The above copyright notice and this permission notice shall be included -+ in all copies or substantial portions of the Software. -+ -+ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS -+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -+ IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR -+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ OTHER DEALINGS IN THE SOFTWARE. -+ ----------------------------------------------------------------------- */ -+ -+#ifdef __x86_64__ -+#define LIBFFI_ASM -+#include -+ -+ .section .rodata -+.LC0: -+ .string "asm in progress %lld\n" -+.LC1: -+ .string "asm in progress\n" -+.text -+ .align 2 -+.globl ffi_call_UNIX64 -+ .type ffi_call_UNIX64,@function -+ -+ffi_call_UNIX64: -+.LFB1: -+ pushq %rbp -+.LCFI0: -+ movq %rsp, %rbp -+.LCFI1: -+ /* Save all arguments */ -+ subq $48, %rsp -+.LCFI2: -+ movq %rdi, -8(%rbp) /* ffi_prep_args */ -+ movq %rsi, -16(%rbp) /* ffi_fill_return_value */ -+ movq %rdx, -24(%rbp) /* ecif */ -+ movq %rcx, -32(%rbp) /* cif->bytes */ -+ movq %r8, -40(%rbp) /* ecif.rvalue */ -+ movq %r9, -48(%rbp) /* fn */ -+ -+ /* Make room for all of the new args and the register args */ -+ addl $176, %ecx -+.LCFI3: -+ subq %rcx, %rsp -+.LCFI4: -+ /* Setup the call to ffi_prep_args. */ -+ movq %rdi, %rax /* &ffi_prep_args */ -+ movq %rsp, %rdi /* stackLayout */ -+ movq %rdx, %rsi /* ecif */ -+ call *%rax /* ffi_prep_args(stackLayout, ecif);*/ -+ -+ /* ffi_prep_args have put all the register contents into the */ -+ /* stackLayout struct. Now put the register values in place. */ -+ movq (%rsp), %rdi -+ movq 8(%rsp), %rsi -+ movq 16(%rsp), %rdx -+ movq 24(%rsp), %rcx -+ movq 32(%rsp), %r8 -+ movq 40(%rsp), %r9 -+ movaps 48(%rsp), %xmm0 -+ movaps 64(%rsp), %xmm1 -+ movaps 80(%rsp), %xmm2 -+ movaps 96(%rsp), %xmm3 -+ movaps 112(%rsp), %xmm4 -+ movaps 128(%rsp), %xmm5 -+ movaps 144(%rsp), %xmm6 -+ movaps 160(%rsp), %xmm7 -+ -+ /* Remove space for stackLayout so stack arguments are placed -+ correctly for the call. */ -+.LCFI5: -+ addq $176, %rsp -+.LCFI6: -+ /* Call the user function. */ -+ call *-48(%rbp) -+ -+ /* Make stack space for the return_value struct. */ -+ subq $64, %rsp -+ -+ /* Fill in all potential return values to this struct. */ -+ movq %rax, (%rsp) -+ movq %rdx, 8(%rsp) -+ movaps %xmm0, 16(%rsp) -+ movaps %xmm1, 32(%rsp) -+ fstpt 48(%rsp) -+ -+ /* Now call ffi_fill_return_value. */ -+ movq %rsp, %rdi /* struct return_value */ -+ movq -24(%rbp), %rsi /* ecif */ -+ movq -16(%rbp), %rax /* &ffi_fill_return_value */ -+ call *%rax /* call it */ -+ -+ /* And the work is done. */ -+ leave -+ ret -+.LFE1: -+.ffi_call_UNIX64_end: -+ .size ffi_call_UNIX64,.ffi_call_UNIX64_end-ffi_call_UNIX64 -+ -+.text -+ .align 2 -+.globl float2sse -+ .type float2sse,@function -+float2sse: -+ /* Save the contents of this sse-float in a pointer. */ -+ movaps %xmm0, (%rdi) -+ ret -+ -+ .align 2 -+.globl floatfloat2sse -+ .type floatfloat2sse,@function -+floatfloat2sse: -+ /* Save the contents of these two sse-floats in a pointer. */ -+ movq (%rdi), %xmm0 -+ movaps %xmm0, (%rsi) -+ ret -+ -+ .align 2 -+.globl double2sse -+ .type double2sse,@function -+double2sse: -+ /* Save the contents of this sse-double in a pointer. */ -+ movaps %xmm0, (%rdi) -+ ret -+ -+ .align 2 -+.globl sse2float -+ .type sse2float,@function -+sse2float: -+ /* Save the contents of this sse-float in a pointer. */ -+ movaps (%rdi), %xmm0 -+ ret -+ -+ .align 2 -+.globl sse2double -+ .type sse2double,@function -+sse2double: -+ /* Save the contents of this pointer in a sse-double. */ -+ movaps (%rdi), %xmm0 -+ ret -+ -+ .align 2 -+.globl sse2floatfloat -+ .type sse2floatfloat,@function -+sse2floatfloat: -+ /* Save the contents of this pointer in two sse-floats. */ -+ movaps (%rdi), %xmm0 -+ movq %xmm0, (%rsi) -+ ret -+ -+ .align 2 -+.globl ffi_closure_UNIX64 -+ .type ffi_closure_UNIX64,@function -+ -+ffi_closure_UNIX64: -+.LFB2: -+ pushq %rbp -+.LCFI10: -+ movq %rsp, %rbp -+.LCFI11: -+ subq $240, %rsp -+.LCFI12: -+ movq %rdi, -176(%rbp) -+ movq %rsi, -168(%rbp) -+ movq %rdx, -160(%rbp) -+ movq %rcx, -152(%rbp) -+ movq %r8, -144(%rbp) -+ movq %r9, -136(%rbp) -+ /* FIXME: We can avoid all this stashing of XMM registers by -+ (in ffi_prep_closure) computing the number of -+ floating-point args and moving it into %rax before calling -+ this function. Once this is done, uncomment the next few -+ lines and only the essential XMM registers will be written -+ to memory. This is a significant saving. */ -+/* movzbl %al, %eax */ -+/* movq %rax, %rdx */ -+/* leaq 0(,%rdx,4), %rax */ -+/* leaq 2f(%rip), %rdx */ -+/* subq %rax, %rdx */ -+ leaq -1(%rbp), %rax -+/* jmp *%rdx */ -+ movaps %xmm7, -15(%rax) -+ movaps %xmm6, -31(%rax) -+ movaps %xmm5, -47(%rax) -+ movaps %xmm4, -63(%rax) -+ movaps %xmm3, -79(%rax) -+ movaps %xmm2, -95(%rax) -+ movaps %xmm1, -111(%rax) -+ movaps %xmm0, -127(%rax) -+2: -+ movl %edi, -180(%rbp) -+ movl $0, -224(%rbp) -+ movl $48, -220(%rbp) -+ leaq 16(%rbp), %rax -+ movq %rax, -216(%rbp) -+ leaq -176(%rbp), %rdx -+ movq %rdx, -208(%rbp) -+ leaq -224(%rbp), %rsi -+ movq %r10, %rdi -+ movq %rsp, %rdx -+ call ffi_closure_UNIX64_inner@PLT -+ -+ cmpl $FFI_TYPE_FLOAT, %eax -+ je 1f -+ cmpl $FFI_TYPE_DOUBLE, %eax -+ je 2f -+ cmpl $FFI_TYPE_LONGDOUBLE, %eax -+ je 3f -+ cmpl $FFI_TYPE_STRUCT, %eax -+ je 4f -+ popq %rax -+ leave -+ ret -+1: -+2: -+3: -+ movaps -240(%rbp), %xmm0 -+ leave -+ ret -+4: -+ leave -+ ret -+.LFE2: -+ -+ .section .eh_frame,"a",@progbits -+.Lframe0: -+ .long .LECIE1-.LSCIE1 -+.LSCIE1: -+ .long 0x0 -+ .byte 0x1 -+ .string "zR" -+ .uleb128 0x1 -+ .sleb128 -8 -+ .byte 0x10 -+ .uleb128 0x1 -+ .byte 0x1b -+ .byte 0xc -+ .uleb128 0x7 -+ .uleb128 0x8 -+ .byte 0x90 -+ .uleb128 0x1 -+ .align 8 -+.LECIE1: -+.LSFDE1: -+ .long .LEFDE1-.LASFDE1 -+.LASFDE1: -+ .long .LASFDE1-.Lframe0 -+ -+ .long .LFB1-. -+ .long .LFE1-.LFB1 -+ .uleb128 0x0 -+ .byte 0x4 # DW_CFA_advance_loc4 -+ .long .LCFI0-.LFB1 -+ .byte 0xe # DW_CFA_def_cfa_offset -+ .uleb128 0x10 -+ .byte 0x86 # DW_CFA_offset: r6 at cfa-16 -+ .uleb128 0x2 -+ .byte 0x4 # DW_CFA_advance_loc4 -+ .long .LCFI1-.LCFI0 -+ .byte 0x86 # DW_CFA_offset: r6 at cfa-16 -+ .uleb128 0x2 -+ .byte 0xd # DW_CFA_def_cfa_reg: r6 -+ .uleb128 0x6 -+ .align 8 -+.LEFDE1: -+.LSFDE3: -+ .long .LEFDE3-.LASFDE3 # FDE Length -+.LASFDE3: -+ .long .LASFDE3-.Lframe0 # FDE CIE offset -+ -+ .long .LFB2-. # FDE initial location -+ .long .LFE2-.LFB2 # FDE address range -+ .uleb128 0x0 # Augmentation size -+ .byte 0x4 # DW_CFA_advance_loc4 -+ .long .LCFI10-.LFB2 -+ .byte 0xe # DW_CFA_def_cfa_offset -+ .uleb128 0x10 -+ .byte 0x86 # DW_CFA_offset, column 0x6 -+ .uleb128 0x2 -+ .byte 0x4 # DW_CFA_advance_loc4 -+ .long .LCFI11-.LCFI10 -+ .byte 0xd # DW_CFA_def_cfa_register -+ .uleb128 0x6 -+ .align 8 -+.LEFDE3: -+ -+#endif /* __x86_64__ */ -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/x86/win32.S gcc/libffi/src/x86/win32.S ---- gcc-3.2.2.orig/libffi/src/x86/win32.S Tue Mar 27 11:39:16 2001 -+++ gcc/libffi/src/x86/win32.S Fri Dec 6 10:16:45 2002 -@@ -1,5 +1,8 @@ - /* ----------------------------------------------------------------------- -- win32.S - Copyright (c) 1996, 1998, 2001 Cygnus Solutions -+ win32.S - Copyright (c) 1996, 1998, 2001, 2002 Red Hat, Inc. -+ Copyright (c) 2001 John Beniton -+ Copyright (c) 2002 Ranjit Mathew -+ - - X86 Foreign Function Interface - -@@ -52,7 +55,10 @@ - # Return stack to previous state and call the function - addl $8,%esp - -- call *28(%ebp) -+ # FIXME: Align the stack to a 128-bit boundary to avoid -+ # potential performance hits. -+ -+ call *28(%ebp) - - # Remove the space we pushed for the args - movl 16(%ebp),%ecx -@@ -123,3 +129,98 @@ - ret - - .ffi_call_SYSV_end: -+ -+ # This assumes we are using gas. -+ .balign 16 -+.globl _ffi_call_STDCALL -+ -+_ffi_call_STDCALL: -+ pushl %ebp -+ movl %esp,%ebp -+ -+ # Make room for all of the new args. -+ movl 16(%ebp),%ecx -+ subl %ecx,%esp -+ -+ movl %esp,%eax -+ -+ # Place all of the ffi_prep_args in position -+ pushl 12(%ebp) -+ pushl %eax -+ call *8(%ebp) -+ -+ # Return stack to previous state and call the function -+ addl $8,%esp -+ -+ # FIXME: Align the stack to a 128-bit boundary to avoid -+ # potential performance hits. -+ -+ call *28(%ebp) -+ -+ # stdcall functions pop arguments off the stack themselves -+ -+ # Load %ecx with the return type code -+ movl 20(%ebp),%ecx -+ -+ # If the return value pointer is NULL, assume no return value. -+ cmpl $0,24(%ebp) -+ jne sc_retint -+ -+ # Even if there is no space for the return value, we are -+ # obliged to handle floating-point values. -+ cmpl $FFI_TYPE_FLOAT,%ecx -+ jne sc_noretval -+ fstp %st(0) -+ -+ jmp sc_epilogue -+ -+sc_retint: -+ cmpl $FFI_TYPE_INT,%ecx -+ jne sc_retfloat -+ # Load %ecx with the pointer to storage for the return value -+ movl 24(%ebp),%ecx -+ movl %eax,0(%ecx) -+ jmp sc_epilogue -+ -+sc_retfloat: -+ cmpl $FFI_TYPE_FLOAT,%ecx -+ jne sc_retdouble -+ # Load %ecx with the pointer to storage for the return value -+ movl 24(%ebp),%ecx -+ fstps (%ecx) -+ jmp sc_epilogue -+ -+sc_retdouble: -+ cmpl $FFI_TYPE_DOUBLE,%ecx -+ jne sc_retlongdouble -+ # Load %ecx with the pointer to storage for the return value -+ movl 24(%ebp),%ecx -+ fstpl (%ecx) -+ jmp sc_epilogue -+ -+sc_retlongdouble: -+ cmpl $FFI_TYPE_LONGDOUBLE,%ecx -+ jne sc_retint64 -+ # Load %ecx with the pointer to storage for the return value -+ movl 24(%ebp),%ecx -+ fstpt (%ecx) -+ jmp sc_epilogue -+ -+sc_retint64: -+ cmpl $FFI_TYPE_SINT64,%ecx -+ jne sc_retstruct -+ # Load %ecx with the pointer to storage for the return value -+ movl 24(%ebp),%ecx -+ movl %eax,0(%ecx) -+ movl %edx,4(%ecx) -+ -+sc_retstruct: -+ # Nothing to do! -+ -+sc_noretval: -+sc_epilogue: -+ movl %ebp,%esp -+ popl %ebp -+ ret -+ -+.ffi_call_STDCALL_end: ---- gcc-3.2.2.orig/libjava/configure.host Mon Jun 10 13:15:26 2002 -+++ gcc-3.2.2/libjava/configure.host Sat Feb 15 19:57:25 2003 -@@ -115,6 +115,12 @@ - enable_getenv_properties_default=no - enable_main_args_default=no - ;; -+ sh-* | sh[34]*-*) -+ sysdeps_dir=sh -+ libgcj_flags="${libgcj_flags} -mieee" -+ libgcj_interpreter=yes -+ enable_hash_synchronization_default=yes -+ ;; - esac - - # This case statement supports generic port properties and may refine -@@ -126,7 +132,8 @@ - powerpc*-linux* | \ - alpha*-linux* | \ - sparc*-linux* | \ -- ia64-*) -+ ia64-* | \ -+ sh-linux* | sh[34]*-linux*) - can_unwind_signal=yes - ;; - *-*-darwin*) diff --git a/patches/gcc/3.2.3/140-libffi-1.patch b/patches/gcc/3.2.3/140-libffi-1.patch new file mode 100644 index 0000000..db78ba1 --- /dev/null +++ b/patches/gcc/3.2.3/140-libffi-1.patch @@ -0,0 +1,6864 @@ +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/Makefile.am gcc/libffi/Makefile.am +--- gcc-3.2.2.orig/libffi/Makefile.am Tue Jan 28 10:43:56 2003 ++++ gcc/libffi/Makefile.am Tue Jan 28 10:48:33 2003 +@@ -8,14 +8,17 @@ + src/mips/n32.s src/mips/o32.S src/mips/o32.s \ + src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S \ + src/x86/ffi.c src/x86/sysv.S src/x86/win32.S \ ++ src/x86/ffi64.c src/x86/unix64.S \ + src/alpha/ffi.c src/alpha/osf.S \ + src/m68k/ffi.c src/m68k/sysv.S \ + src/powerpc/ffi.c src/powerpc/sysv.S \ + src/powerpc/ppc_closure.S src/powerpc/asm.h \ + src/powerpc/ffi_darwin.c \ + src/powerpc/darwin.S src/powerpc/aix.S \ +- src/powerpc/darwin_closure.S src/powerpc/aix_closures.S \ +- src/arm/ffi.c src/arm/sysv.S ++ src/powerpc/darwin_closure.S src/powerpc/aix_closure.S \ ++ src/arm/ffi.c src/arm/sysv.S \ ++ src/s390/ffi.c src/s390/sysv.S \ ++ src/sh/ffi.c src/sh/sysv.S + + VPATH = @srcdir@:@srcdir@/src:@srcdir@/src/@TARGETDIR@ + +@@ -83,6 +86,7 @@ + ffitest_LDFLAGS = -shared-libgcc + + TARGET_SRC_MIPS_GCC = src/mips/ffi.c src/mips/o32.S src/mips/n32.S ++TARGET_SRC_MIPS_LINUX = src/mips/ffi.c src/mips/o32.S + TARGET_SRC_MIPS_SGI = src/mips/ffi.c src/mips/o32.s src/mips/n32.s + TARGET_SRC_X86 = src/x86/ffi.c src/x86/sysv.S + TARGET_SRC_X86_WIN32 = src/x86/ffi.c src/x86/win32.S +@@ -91,9 +95,12 @@ + TARGET_SRC_IA64 = src/ia64/ffi.c src/ia64/unix.S + TARGET_SRC_M68K = src/m68k/ffi.c src/m68k/sysv.S + TARGET_SRC_POWERPC = src/powerpc/ffi.c src/powerpc/sysv.S src/powerpc/ppc_closure.S +-TARGET_SRC_POWERPC_AIX = src/powerpc/ffi_darwin.c src/powerpc/aix.S src/powerpc/aix_closures.S ++TARGET_SRC_POWERPC_AIX = src/powerpc/ffi_darwin.c src/powerpc/aix.S src/powerpc/aix_closure.S + TARGET_SRC_POWERPC_DARWIN = src/powerpc/ffi_darwin.c src/powerpc/darwin.S src/powerpc/darwin_closure.S + TARGET_SRC_ARM = src/arm/sysv.S src/arm/ffi.c ++TARGET_SRC_S390 = src/s390/sysv.S src/s390/ffi.c ++TARGET_SRC_X86_64 = src/x86/ffi64.c src/x86/unix64.S src/x86/ffi.c src/x86/sysv.S ++TARGET_SRC_SH = src/sh/sysv.S src/sh/ffi.c + + ##libffi_la_SOURCES = src/debug.c src/prep_cif.c src/types.c $(TARGET_SRC_@TARGET@) + ## Work around automake deficiency +@@ -103,6 +110,10 @@ + libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_GCC) + libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_GCC) + endif ++if MIPS_LINUX ++libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_LINUX) ++libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_LINUX) ++endif + if MIPS_SGI + libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_SGI) + libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_SGI) +@@ -147,6 +158,18 @@ + libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_ARM) + libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_ARM) + endif ++if S390 ++libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_S390) ++libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_S390) ++endif ++if X86_64 ++libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_X86_64) ++libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_X86_64) ++endif ++if SH ++libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_SH) ++libfficonvenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_SH) ++endif + + AM_CFLAGS = -fexceptions + +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/Makefile.in gcc/libffi/Makefile.in +--- gcc-3.2.2.orig/libffi/Makefile.in Wed Jan 29 07:59:05 2003 ++++ gcc/libffi/Makefile.in Wed Jan 29 07:58:58 2003 +@@ -91,14 +91,17 @@ + src/mips/n32.s src/mips/o32.S src/mips/o32.s \ + src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S \ + src/x86/ffi.c src/x86/sysv.S src/x86/win32.S \ ++ src/x86/ffi64.c src/x86/unix64.S \ + src/alpha/ffi.c src/alpha/osf.S \ + src/m68k/ffi.c src/m68k/sysv.S \ + src/powerpc/ffi.c src/powerpc/sysv.S \ + src/powerpc/ppc_closure.S src/powerpc/asm.h \ + src/powerpc/ffi_darwin.c \ + src/powerpc/darwin.S src/powerpc/aix.S \ +- src/powerpc/darwin_closure.S src/powerpc/aix_closures.S \ +- src/arm/ffi.c src/arm/sysv.S ++ src/powerpc/darwin_closure.S src/powerpc/aix_closure.S \ ++ src/arm/ffi.c src/arm/sysv.S \ ++ src/s390/ffi.c src/s390/sysv.S \ ++ src/sh/ffi.c src/sh/sysv.S + + + VPATH = @srcdir@:@srcdir@/src:@srcdir@/src/@TARGETDIR@ +@@ -162,6 +165,7 @@ + ffitest_LDFLAGS = -shared-libgcc + + TARGET_SRC_MIPS_GCC = src/mips/ffi.c src/mips/o32.S src/mips/n32.S ++TARGET_SRC_MIPS_LINUX = src/mips/ffi.c src/mips/o32.S + TARGET_SRC_MIPS_SGI = src/mips/ffi.c src/mips/o32.s src/mips/n32.s + TARGET_SRC_X86 = src/x86/ffi.c src/x86/sysv.S + TARGET_SRC_X86_WIN32 = src/x86/ffi.c src/x86/win32.S +@@ -170,14 +174,18 @@ + TARGET_SRC_IA64 = src/ia64/ffi.c src/ia64/unix.S + TARGET_SRC_M68K = src/m68k/ffi.c src/m68k/sysv.S + TARGET_SRC_POWERPC = src/powerpc/ffi.c src/powerpc/sysv.S src/powerpc/ppc_closure.S +-TARGET_SRC_POWERPC_AIX = src/powerpc/ffi_darwin.c src/powerpc/aix.S src/powerpc/aix_closures.S ++TARGET_SRC_POWERPC_AIX = src/powerpc/ffi_darwin.c src/powerpc/aix.S src/powerpc/aix_closure.S + TARGET_SRC_POWERPC_DARWIN = src/powerpc/ffi_darwin.c src/powerpc/darwin.S src/powerpc/darwin_closure.S + TARGET_SRC_ARM = src/arm/sysv.S src/arm/ffi.c ++TARGET_SRC_S390 = src/s390/sysv.S src/s390/ffi.c ++TARGET_SRC_X86_64 = src/x86/ffi64.c src/x86/unix64.S src/x86/ffi.c src/x86/sysv.S ++TARGET_SRC_SH = src/sh/sysv.S src/sh/ffi.c + + libffi_la_common_SOURCES = src/debug.c src/prep_cif.c src/types.c \ + src/raw_api.c src/java_raw_api.c + + @MIPS_GCC_TRUE@libffi_la_SOURCES = @MIPS_GCC_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_GCC) ++@MIPS_LINUX_TRUE@libffi_la_SOURCES = @MIPS_LINUX_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_LINUX) + @MIPS_SGI_TRUE@libffi_la_SOURCES = @MIPS_SGI_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_SGI) + @X86_TRUE@libffi_la_SOURCES = @X86_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86) + @X86_WIN32_TRUE@libffi_la_SOURCES = @X86_WIN32_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86_WIN32) +@@ -189,7 +197,11 @@ + @POWERPC_AIX_TRUE@libffi_la_SOURCES = @POWERPC_AIX_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_POWERPC_AIX) + @POWERPC_DARWIN_TRUE@libffi_la_SOURCES = @POWERPC_DARWIN_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_POWERPC_DARWIN) + @ARM_TRUE@libffi_la_SOURCES = @ARM_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_ARM) ++@S390_TRUE@libffi_la_SOURCES = @S390_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_S390) ++@X86_64_TRUE@libffi_la_SOURCES = @X86_64_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86_64) ++@SH_TRUE@libffi_la_SOURCES = @SH_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_SH) + @MIPS_GCC_TRUE@libffi_convenience_la_SOURCES = @MIPS_GCC_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_GCC) ++@MIPS_LINUX_TRUE@libffi_convenience_la_SOURCES = @MIPS_LINUX_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_LINUX) + @MIPS_SGI_TRUE@libffi_convenience_la_SOURCES = @MIPS_SGI_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_SGI) + @X86_TRUE@libffi_convenience_la_SOURCES = @X86_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86) + @X86_WIN32_TRUE@libffi_convenience_la_SOURCES = @X86_WIN32_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86_WIN32) +@@ -201,6 +213,9 @@ + @POWERPC_AIX_TRUE@libffi_convenience_la_SOURCES = @POWERPC_AIX_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_POWERPC_AIX) + @POWERPC_DARWIN_TRUE@libffi_convenience_la_SOURCES = @POWERPC_DARWIN_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_POWERPC_DARWIN) + @ARM_TRUE@libffi_convenience_la_SOURCES = @ARM_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_ARM) ++@S390_TRUE@libffi_convenience_la_SOURCES = @S390_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_S390) ++@X86_64_TRUE@libffi_convenience_la_SOURCES = @X86_64_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86_64) ++@SH_TRUE@libfficonvenience_la_SOURCES = @SH_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_SH) + + AM_CFLAGS = -fexceptions + +@@ -208,7 +223,7 @@ + + INCLUDES = -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src + ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +-mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs ++mkinstalldirs = $(SHELL) $(top_srcdir)/${libffi_basedir}/../mkinstalldirs + CONFIG_HEADER = fficonfig.h + CONFIG_CLEAN_FILES = + LTLIBRARIES = $(noinst_LTLIBRARIES) $(toolexeclib_LTLIBRARIES) +@@ -220,10 +235,6 @@ + LIBS = @LIBS@ + libffi_convenience_la_LDFLAGS = + libffi_convenience_la_LIBADD = +-@POWERPC_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ +-@POWERPC_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ +-@POWERPC_TRUE@src/java_raw_api.lo src/powerpc/ffi.lo \ +-@POWERPC_TRUE@src/powerpc/sysv.lo src/powerpc/ppc_closure.lo + @ALPHA_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ + @ALPHA_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ + @ALPHA_TRUE@src/java_raw_api.lo src/alpha/ffi.lo src/alpha/osf.lo +@@ -234,12 +245,29 @@ + @MIPS_GCC_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ + @MIPS_GCC_TRUE@src/java_raw_api.lo src/mips/ffi.lo src/mips/o32.lo \ + @MIPS_GCC_TRUE@src/mips/n32.lo +-@X86_WIN32_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ +-@X86_WIN32_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ +-@X86_WIN32_TRUE@src/java_raw_api.lo src/x86/ffi.lo src/x86/win32.lo ++@S390_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \ ++@S390_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ ++@S390_TRUE@src/s390/sysv.lo src/s390/ffi.lo + @M68K_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \ + @M68K_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ + @M68K_TRUE@src/m68k/ffi.lo src/m68k/sysv.lo ++@X86_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \ ++@X86_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ ++@X86_TRUE@src/x86/ffi.lo src/x86/sysv.lo ++@POWERPC_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ ++@POWERPC_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ ++@POWERPC_TRUE@src/java_raw_api.lo src/powerpc/ffi.lo \ ++@POWERPC_TRUE@src/powerpc/sysv.lo src/powerpc/ppc_closure.lo ++@MIPS_LINUX_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ ++@MIPS_LINUX_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ ++@MIPS_LINUX_TRUE@src/java_raw_api.lo src/mips/ffi.lo src/mips/o32.lo ++@X86_WIN32_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ ++@X86_WIN32_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ ++@X86_WIN32_TRUE@src/java_raw_api.lo src/x86/ffi.lo src/x86/win32.lo ++@X86_64_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ ++@X86_64_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ ++@X86_64_TRUE@src/java_raw_api.lo src/x86/ffi64.lo src/x86/unix64.lo \ ++@X86_64_TRUE@src/x86/ffi.lo src/x86/sysv.lo + @SPARC_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ + @SPARC_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ + @SPARC_TRUE@src/java_raw_api.lo src/sparc/ffi.lo src/sparc/v8.lo \ +@@ -247,62 +275,75 @@ + @POWERPC_AIX_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ + @POWERPC_AIX_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ + @POWERPC_AIX_TRUE@src/java_raw_api.lo src/powerpc/ffi_darwin.lo \ +-@POWERPC_AIX_TRUE@src/powerpc/aix.lo src/powerpc/aix_closures.lo +-@X86_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \ +-@X86_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ +-@X86_TRUE@src/x86/ffi.lo src/x86/sysv.lo +-@ARM_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \ +-@ARM_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ +-@ARM_TRUE@src/arm/sysv.lo src/arm/ffi.lo ++@POWERPC_AIX_TRUE@src/powerpc/aix.lo src/powerpc/aix_closure.lo ++@MIPS_SGI_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ ++@MIPS_SGI_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ ++@MIPS_SGI_TRUE@src/java_raw_api.lo src/mips/ffi.lo src/mips/o32.lo \ ++@MIPS_SGI_TRUE@src/mips/n32.lo + @POWERPC_DARWIN_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ + @POWERPC_DARWIN_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ + @POWERPC_DARWIN_TRUE@src/java_raw_api.lo src/powerpc/ffi_darwin.lo \ + @POWERPC_DARWIN_TRUE@src/powerpc/darwin.lo \ + @POWERPC_DARWIN_TRUE@src/powerpc/darwin_closure.lo +-@MIPS_SGI_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ +-@MIPS_SGI_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ +-@MIPS_SGI_TRUE@src/java_raw_api.lo src/mips/ffi.lo src/mips/o32.lo \ +-@MIPS_SGI_TRUE@src/mips/n32.lo ++@ARM_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \ ++@ARM_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ ++@ARM_TRUE@src/arm/sysv.lo src/arm/ffi.lo ++@SH_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \ ++@SH_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ ++@SH_TRUE@src/sh/sysv.lo src/sh/ffi.lo + libffi_la_LIBADD = ++@SH_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo src/types.lo \ ++@SH_TRUE@src/raw_api.lo src/java_raw_api.lo src/sh/sysv.lo \ ++@SH_TRUE@src/sh/ffi.lo ++@IA64_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ ++@IA64_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ ++@IA64_TRUE@src/ia64/ffi.lo src/ia64/unix.lo ++@X86_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo src/types.lo \ ++@X86_TRUE@src/raw_api.lo src/java_raw_api.lo src/x86/ffi.lo \ ++@X86_TRUE@src/x86/sysv.lo + @POWERPC_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ + @POWERPC_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ + @POWERPC_TRUE@src/powerpc/ffi.lo src/powerpc/sysv.lo \ + @POWERPC_TRUE@src/powerpc/ppc_closure.lo +-@ALPHA_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ +-@ALPHA_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ +-@ALPHA_TRUE@src/alpha/ffi.lo src/alpha/osf.lo +-@IA64_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ +-@IA64_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ +-@IA64_TRUE@src/ia64/ffi.lo src/ia64/unix.lo +-@MIPS_GCC_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ +-@MIPS_GCC_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ +-@MIPS_GCC_TRUE@src/mips/ffi.lo src/mips/o32.lo src/mips/n32.lo +-@X86_WIN32_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ +-@X86_WIN32_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ +-@X86_WIN32_TRUE@src/x86/ffi.lo src/x86/win32.lo +-@M68K_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ +-@M68K_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ +-@M68K_TRUE@src/m68k/ffi.lo src/m68k/sysv.lo ++@MIPS_LINUX_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ ++@MIPS_LINUX_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ ++@MIPS_LINUX_TRUE@src/mips/ffi.lo src/mips/o32.lo + @SPARC_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ + @SPARC_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ + @SPARC_TRUE@src/sparc/ffi.lo src/sparc/v8.lo src/sparc/v9.lo + @POWERPC_AIX_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ + @POWERPC_AIX_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ + @POWERPC_AIX_TRUE@src/powerpc/ffi_darwin.lo src/powerpc/aix.lo \ +-@POWERPC_AIX_TRUE@src/powerpc/aix_closures.lo +-@X86_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo src/types.lo \ +-@X86_TRUE@src/raw_api.lo src/java_raw_api.lo src/x86/ffi.lo \ +-@X86_TRUE@src/x86/sysv.lo ++@POWERPC_AIX_TRUE@src/powerpc/aix_closure.lo ++@MIPS_SGI_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ ++@MIPS_SGI_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ ++@MIPS_SGI_TRUE@src/mips/ffi.lo src/mips/o32.lo src/mips/n32.lo + @ARM_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo src/types.lo \ + @ARM_TRUE@src/raw_api.lo src/java_raw_api.lo src/arm/sysv.lo \ + @ARM_TRUE@src/arm/ffi.lo ++@ALPHA_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ ++@ALPHA_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ ++@ALPHA_TRUE@src/alpha/ffi.lo src/alpha/osf.lo ++@MIPS_GCC_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ ++@MIPS_GCC_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ ++@MIPS_GCC_TRUE@src/mips/ffi.lo src/mips/o32.lo src/mips/n32.lo ++@S390_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ ++@S390_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ ++@S390_TRUE@src/s390/sysv.lo src/s390/ffi.lo ++@M68K_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ ++@M68K_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ ++@M68K_TRUE@src/m68k/ffi.lo src/m68k/sysv.lo ++@X86_WIN32_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ ++@X86_WIN32_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ ++@X86_WIN32_TRUE@src/x86/ffi.lo src/x86/win32.lo ++@X86_64_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ ++@X86_64_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ ++@X86_64_TRUE@src/x86/ffi64.lo src/x86/unix64.lo src/x86/ffi.lo \ ++@X86_64_TRUE@src/x86/sysv.lo + @POWERPC_DARWIN_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ + @POWERPC_DARWIN_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ + @POWERPC_DARWIN_TRUE@src/powerpc/ffi_darwin.lo src/powerpc/darwin.lo \ + @POWERPC_DARWIN_TRUE@src/powerpc/darwin_closure.lo +-@MIPS_SGI_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ +-@MIPS_SGI_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ +-@MIPS_SGI_TRUE@src/mips/ffi.lo src/mips/o32.lo src/mips/n32.lo + noinst_PROGRAMS = ffitest$(EXEEXT) + PROGRAMS = $(noinst_PROGRAMS) + +@@ -578,8 +616,8 @@ + -chmod 777 $(distdir) + $(mkinstalldirs) $(distdir)/src/alpha $(distdir)/src/arm \ + $(distdir)/src/m68k $(distdir)/src/mips \ +- $(distdir)/src/powerpc $(distdir)/src/sparc \ +- $(distdir)/src/x86 ++ $(distdir)/src/powerpc $(distdir)/src/s390 $(distdir)/src/sh \ ++ $(distdir)/src/sparc $(distdir)/src/x86 + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/acinclude.m4 gcc/libffi/acinclude.m4 +--- gcc-3.2.2.orig/libffi/acinclude.m4 Sun Sep 10 16:43:14 2000 ++++ gcc/libffi/acinclude.m4 Tue Dec 17 03:22:47 2002 +@@ -4,5 +4,8 @@ + dnl to add a definition of LIBTOOL to Makefile.in. + ifelse(yes,no,[ + AC_DEFUN([AC_PROG_LIBTOOL],) ++AC_DEFUN([AM_PROG_LIBTOOL],) + AC_SUBST(LIBTOOL) + ]) ++ ++sinclude(../config/accross.m4) +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/aclocal.m4 gcc/libffi/aclocal.m4 +--- gcc-3.2.2.orig/libffi/aclocal.m4 Fri Feb 1 07:25:31 2002 ++++ gcc/libffi/aclocal.m4 Tue Dec 17 03:22:47 2002 +@@ -1,6 +1,6 @@ +-dnl aclocal.m4 generated automatically by aclocal 1.4 ++dnl aclocal.m4 generated automatically by aclocal 1.4-p5 + +-dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. ++dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. + dnl This file is free software; the Free Software Foundation + dnl gives unlimited permission to copy and/or distribute it, + dnl with or without modifications, as long as this notice is preserved. +@@ -16,108 +16,15 @@ + dnl to add a definition of LIBTOOL to Makefile.in. + ifelse(yes,no,[ + AC_DEFUN([AC_PROG_LIBTOOL],) ++AC_DEFUN([AM_PROG_LIBTOOL],) + AC_SUBST(LIBTOOL) + ]) + +-AC_DEFUN([AC_COMPILE_CHECK_SIZEOF], +-[changequote(<<, >>)dnl +-dnl The name to #define. +-define(<>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl +-dnl The cache variable name. +-define(<>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl +-changequote([, ])dnl +-AC_MSG_CHECKING(size of $1) +-AC_CACHE_VAL(AC_CV_NAME, +-[for ac_size in 4 8 1 2 16 12 $2 ; do # List sizes in rough order of prevalence. +- AC_TRY_COMPILE([#include "confdefs.h" +-#include +-$2 +-], [switch (0) case 0: case (sizeof ($1) == $ac_size):;], AC_CV_NAME=$ac_size) +- if test x$AC_CV_NAME != x ; then break; fi +-done +-]) +-if test x$AC_CV_NAME = x ; then +- AC_MSG_ERROR([cannot determine a size for $1]) +-fi +-AC_MSG_RESULT($AC_CV_NAME) +-AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME, [The number of bytes in type $1]) +-undefine([AC_TYPE_NAME])dnl +-undefine([AC_CV_NAME])dnl +-]) +- +-AC_DEFUN([AC_C_BIGENDIAN_CROSS], +-[AC_CACHE_CHECK(whether byte ordering is bigendian, ac_cv_c_bigendian, +-[ac_cv_c_bigendian=unknown +-# See if sys/param.h defines the BYTE_ORDER macro. +-AC_TRY_COMPILE([#include +-#include ], [ +-#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN +- bogus endian macros +-#endif], [# It does; now see whether it defined to BIG_ENDIAN or not. +-AC_TRY_COMPILE([#include +-#include ], [ +-#if BYTE_ORDER != BIG_ENDIAN +- not big endian +-#endif], ac_cv_c_bigendian=yes, ac_cv_c_bigendian=no)]) +-if test $ac_cv_c_bigendian = unknown; then +-AC_TRY_RUN([main () { +- /* Are we little or big endian? From Harbison&Steele. */ +- union +- { +- long l; +- char c[sizeof (long)]; +- } u; +- u.l = 1; +- exit (u.c[sizeof (long) - 1] == 1); +-}], ac_cv_c_bigendian=no, ac_cv_c_bigendian=yes, +-[ echo $ac_n "cross-compiling... " 2>&AC_FD_MSG ]) +-fi]) +-if test $ac_cv_c_bigendian = unknown; then +-AC_MSG_CHECKING(to probe for byte ordering) +-[ +-cat >conftest.c <&AC_FD_MSG +- ac_cv_c_bigendian=yes +- fi +- if test `grep -l LiTTleEnDian conftest.o` ; then +- echo $ac_n ' little endian probe OK, ' 1>&AC_FD_MSG +- if test $ac_cv_c_bigendian = yes ; then +- ac_cv_c_bigendian=unknown; +- else +- ac_cv_c_bigendian=no +- fi +- fi +- echo $ac_n 'guessing bigendian ... ' >&AC_FD_MSG +- fi +- fi +-AC_MSG_RESULT($ac_cv_c_bigendian) +-fi +-if test $ac_cv_c_bigendian = yes; then +- AC_DEFINE(WORDS_BIGENDIAN, 1, [whether byteorder is bigendian]) +- BYTEORDER=4321 +-else +- BYTEORDER=1234 +-fi +-AC_DEFINE_UNQUOTED(BYTEORDER, $BYTEORDER, [1234 = LIL_ENDIAN, 4321 = BIGENDIAN]) +-if test $ac_cv_c_bigendian = unknown; then +- AC_MSG_ERROR(unknown endianess - sorry, please pre-set ac_cv_c_bigendian) +-fi +-]) ++sinclude(../config/accross.m4) + + # Like AC_CONFIG_HEADER, but automatically create stamp file. + +-AC_DEFUN(AM_CONFIG_HEADER, ++AC_DEFUN([AM_CONFIG_HEADER], + [AC_PREREQ([2.12]) + AC_CONFIG_HEADER([$1]) + dnl When config.status generates a header, we must update the stamp-h file. +@@ -147,7 +54,7 @@ + dnl Usage: + dnl AM_INIT_AUTOMAKE(package,version, [no-define]) + +-AC_DEFUN(AM_INIT_AUTOMAKE, ++AC_DEFUN([AM_INIT_AUTOMAKE], + [AC_REQUIRE([AC_PROG_INSTALL]) + PACKAGE=[$1] + AC_SUBST(PACKAGE) +@@ -175,7 +82,7 @@ + # Check to make sure that the build environment is sane. + # + +-AC_DEFUN(AM_SANITY_CHECK, ++AC_DEFUN([AM_SANITY_CHECK], + [AC_MSG_CHECKING([whether build environment is sane]) + # Just in case + sleep 1 +@@ -216,7 +123,7 @@ + + dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) + dnl The program must properly implement --version. +-AC_DEFUN(AM_MISSING_PROG, ++AC_DEFUN([AM_MISSING_PROG], + [AC_MSG_CHECKING(for working $2) + # Run test in a subshell; some versions of sh will print an error if + # an executable is not found, even if stderr is redirected. +@@ -235,7 +142,7 @@ + + # serial 1 + +-AC_DEFUN(AM_MAINTAINER_MODE, ++AC_DEFUN([AM_MAINTAINER_MODE], + [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +@@ -252,7 +159,7 @@ + + # Define a conditional. + +-AC_DEFUN(AM_CONDITIONAL, ++AC_DEFUN([AM_CONDITIONAL], + [AC_SUBST($1_TRUE) + AC_SUBST($1_FALSE) + if $2; then +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/configure gcc/libffi/configure +--- gcc-3.2.2.orig/libffi/configure Wed Jan 29 07:59:05 2003 ++++ gcc/libffi/configure Sat Feb 1 20:16:19 2003 +@@ -633,17 +633,16 @@ + + if test "${srcdir}" = "."; then + if test "${with_target_subdir}" != "."; then +- libffi_basedir="${srcdir}/${with_multisrctop}.." ++ libffi_basedir="${with_multisrctop}../" + else +- libffi_basedir="${srcdir}/${with_multisrctop}" ++ libffi_basedir="${with_multisrctop}" + fi + else +- libffi_basedir="${srcdir}" ++ libffi_basedir= + fi + +- + ac_aux_dir= +-for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do ++for ac_dir in ${libffi_basedir}.. $srcdir/${libffi_basedir}..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" +@@ -655,13 +654,14 @@ + fi + done + if test -z "$ac_aux_dir"; then +- { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } ++ { echo "configure: error: can not find install-sh or install.sh in ${libffi_basedir}.. $srcdir/${libffi_basedir}.." 1>&2; exit 1; } + fi + ac_config_guess=$ac_aux_dir/config.guess + ac_config_sub=$ac_aux_dir/config.sub + ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + + ++ + # Make sure we can run config.sub. + if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : + else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +@@ -1238,9 +1238,18 @@ + ;; + + hpux10.20*|hpux11*) +- lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' +- lt_cv_file_magic_cmd=/usr/bin/file +- lt_cv_file_magic_test_file=/usr/lib/libc.sl ++ case $host_cpu in ++ hppa*) ++ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' ++ lt_cv_file_magic_cmd=/usr/bin/file ++ lt_cv_file_magic_test_file=/usr/lib/libc.sl ++ ;; ++ ia64*) ++ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' ++ lt_cv_file_magic_cmd=/usr/bin/file ++ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ++ ;; ++ esac + ;; + + irix5* | irix6*) +@@ -1267,7 +1276,7 @@ + # This must be Linux ELF. + linux-gnu*) + case $host_cpu in +- alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* ) ++ alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | sh* ) + lt_cv_deplibs_check_method=pass_all ;; + *) + # glibc up to 2.1.1 does not perform some relocations on ARM +@@ -1330,13 +1339,13 @@ + deplibs_check_method=$lt_cv_deplibs_check_method + + echo $ac_n "checking for object suffix""... $ac_c" 1>&6 +-echo "configure:1334: checking for object suffix" >&5 ++echo "configure:1343: checking for object suffix" >&5 + if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + rm -f conftest* + echo 'int i = 1;' > conftest.$ac_ext +-if { (eval echo configure:1340: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:1349: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + for ac_file in conftest.*; do + case $ac_file in + *.c) ;; +@@ -1356,7 +1365,7 @@ + + + echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 +-echo "configure:1360: checking for executable suffix" >&5 ++echo "configure:1369: checking for executable suffix" >&5 + if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -1366,7 +1375,7 @@ + rm -f conftest* + echo 'int main () { return 0; }' > conftest.$ac_ext + ac_cv_exeext= +- if { (eval echo configure:1370: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then ++ if { (eval echo configure:1379: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + for file in conftest.*; do + case $file in + *.c | *.o | *.obj) ;; +@@ -1399,7 +1408,7 @@ + file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6 +-echo "configure:1403: checking for ${ac_tool_prefix}file" >&5 ++echo "configure:1412: checking for ${ac_tool_prefix}file" >&5 + if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -1461,7 +1470,7 @@ + if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + echo $ac_n "checking for file""... $ac_c" 1>&6 +-echo "configure:1465: checking for file" >&5 ++echo "configure:1474: checking for file" >&5 + if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -1532,7 +1541,7 @@ + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. + set dummy ${ac_tool_prefix}ranlib; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:1536: checking for $ac_word" >&5 ++echo "configure:1545: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -1564,7 +1573,7 @@ + # Extract the first word of "ranlib", so it can be a program name with args. + set dummy ranlib; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:1568: checking for $ac_word" >&5 ++echo "configure:1577: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -1599,7 +1608,7 @@ + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. + set dummy ${ac_tool_prefix}strip; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:1603: checking for $ac_word" >&5 ++echo "configure:1612: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -1631,7 +1640,7 @@ + # Extract the first word of "strip", so it can be a program name with args. + set dummy strip; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:1635: checking for $ac_word" >&5 ++echo "configure:1644: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -1698,8 +1707,8 @@ + case $host in + *-*-irix6*) + # Find out which ABI we are using. +- echo '#line 1702 "configure"' > conftest.$ac_ext +- if { (eval echo configure:1703: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++ echo '#line 1711 "configure"' > conftest.$ac_ext ++ if { (eval echo configure:1712: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" +@@ -1715,12 +1724,70 @@ + rm -rf conftest* + ;; + ++ia64-*-hpux*) ++ # Find out which ABI we are using. ++ echo 'int i;' > conftest.$ac_ext ++ if { (eval echo configure:1731: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++ case "`/usr/bin/file conftest.o`" in ++ *ELF-32*) ++ HPUX_IA64_MODE="32" ++ ;; ++ *ELF-64*) ++ HPUX_IA64_MODE="64" ++ ;; ++ esac ++ fi ++ rm -rf conftest* ++ ;; ++ ++x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) ++ # Find out which ABI we are using. ++ echo 'int i;' > conftest.$ac_ext ++ if { (eval echo configure:1747: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++ case "`/usr/bin/file conftest.o`" in ++ *32-bit*) ++ case $host in ++ x86_64-*linux*) ++ LD="${LD-ld} -m elf_i386" ++ ;; ++ ppc64-*linux*) ++ LD="${LD-ld} -m elf32ppclinux" ++ ;; ++ s390x-*linux*) ++ LD="${LD-ld} -m elf_s390" ++ ;; ++ sparc64-*linux*) ++ LD="${LD-ld} -m elf32_sparc" ++ ;; ++ esac ++ ;; ++ *64-bit*) ++ case $host in ++ x86_64-*linux*) ++ LD="${LD-ld} -m elf_x86_64" ++ ;; ++ ppc*-*linux*|powerpc*-*linux*) ++ LD="${LD-ld} -m elf64ppc" ++ ;; ++ s390*-*linux*) ++ LD="${LD-ld} -m elf64_s390" ++ ;; ++ sparc*-*linux*) ++ LD="${LD-ld} -m elf64_sparc" ++ ;; ++ esac ++ ;; ++ esac ++ fi ++ rm -rf conftest* ++ ;; ++ + *-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 +-echo "configure:1724: checking whether the C compiler needs -belf" >&5 ++echo "configure:1791: checking whether the C compiler needs -belf" >&5 + if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -1733,14 +1800,14 @@ + cross_compiling=$ac_cv_prog_cc_cross + + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:1811: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + lt_cv_cc_needs_belf=yes + else +@@ -1868,7 +1935,7 @@ + # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" + # ./install, which can be erroneously created by make from ./install.sh. + echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +-echo "configure:1872: checking for a BSD compatible install" >&5 ++echo "configure:1939: checking for a BSD compatible install" >&5 + if test -z "$INSTALL"; then + if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -1921,7 +1988,7 @@ + test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 +-echo "configure:1925: checking whether build environment is sane" >&5 ++echo "configure:1992: checking whether build environment is sane" >&5 + # Just in case + sleep 1 + echo timestamp > conftestfile +@@ -1978,7 +2045,7 @@ + test "$program_transform_name" = "" && program_transform_name="s,x,x," + + echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +-echo "configure:1982: checking whether ${MAKE-make} sets \${MAKE}" >&5 ++echo "configure:2049: checking whether ${MAKE-make} sets \${MAKE}" >&5 + set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -2017,7 +2084,7 @@ + + missing_dir=`cd $ac_aux_dir && pwd` + echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 +-echo "configure:2021: checking for working aclocal" >&5 ++echo "configure:2088: checking for working aclocal" >&5 + # Run test in a subshell; some versions of sh will print an error if + # an executable is not found, even if stderr is redirected. + # Redirect stdin to placate older versions of autoconf. Sigh. +@@ -2030,7 +2097,7 @@ + fi + + echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 +-echo "configure:2034: checking for working autoconf" >&5 ++echo "configure:2101: checking for working autoconf" >&5 + # Run test in a subshell; some versions of sh will print an error if + # an executable is not found, even if stderr is redirected. + # Redirect stdin to placate older versions of autoconf. Sigh. +@@ -2043,7 +2110,7 @@ + fi + + echo $ac_n "checking for working automake""... $ac_c" 1>&6 +-echo "configure:2047: checking for working automake" >&5 ++echo "configure:2114: checking for working automake" >&5 + # Run test in a subshell; some versions of sh will print an error if + # an executable is not found, even if stderr is redirected. + # Redirect stdin to placate older versions of autoconf. Sigh. +@@ -2056,7 +2123,7 @@ + fi + + echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 +-echo "configure:2060: checking for working autoheader" >&5 ++echo "configure:2127: checking for working autoheader" >&5 + # Run test in a subshell; some versions of sh will print an error if + # an executable is not found, even if stderr is redirected. + # Redirect stdin to placate older versions of autoconf. Sigh. +@@ -2069,7 +2136,7 @@ + fi + + echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 +-echo "configure:2073: checking for working makeinfo" >&5 ++echo "configure:2140: checking for working makeinfo" >&5 + # Run test in a subshell; some versions of sh will print an error if + # an executable is not found, even if stderr is redirected. + # Redirect stdin to placate older versions of autoconf. Sigh. +@@ -2086,7 +2153,7 @@ + + + echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 +-echo "configure:2090: checking for executable suffix" >&5 ++echo "configure:2157: checking for executable suffix" >&5 + if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -2096,7 +2163,7 @@ + rm -f conftest* + echo 'int main () { return 0; }' > conftest.$ac_ext + ac_cv_exeext= +- if { (eval echo configure:2100: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then ++ if { (eval echo configure:2167: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + for file in conftest.*; do + case $file in + *.c | *.o | *.obj) ;; +@@ -2117,7 +2184,7 @@ + ac_exeext=$EXEEXT + + echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 +-echo "configure:2121: checking whether to enable maintainer-specific portions of Makefiles" >&5 ++echo "configure:2188: checking whether to enable maintainer-specific portions of Makefiles" >&5 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. + if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" +@@ -2143,7 +2210,7 @@ + # Extract the first word of "gcc", so it can be a program name with args. + set dummy gcc; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:2147: checking for $ac_word" >&5 ++echo "configure:2214: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -2173,7 +2240,7 @@ + # Extract the first word of "cc", so it can be a program name with args. + set dummy cc; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:2177: checking for $ac_word" >&5 ++echo "configure:2244: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -2224,7 +2291,7 @@ + # Extract the first word of "cl", so it can be a program name with args. + set dummy cl; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:2228: checking for $ac_word" >&5 ++echo "configure:2295: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -2256,7 +2323,7 @@ + fi + + echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 +-echo "configure:2260: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ++echo "configure:2327: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 + + ac_ext=c + # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +@@ -2267,12 +2334,12 @@ + + cat > conftest.$ac_ext << EOF + +-#line 2271 "configure" ++#line 2338 "configure" + #include "confdefs.h" + + main(){return(0);} + EOF +-if { (eval echo configure:2276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:2343: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + ac_cv_prog_cc_works=yes + # If we can't run a trivial program, we are probably using a cross compiler. + if (./conftest; exit) 2>/dev/null; then +@@ -2298,12 +2365,12 @@ + { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } + fi + echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 +-echo "configure:2302: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 ++echo "configure:2369: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 + echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 + cross_compiling=$ac_cv_prog_cc_cross + + echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +-echo "configure:2307: checking whether we are using GNU C" >&5 ++echo "configure:2374: checking whether we are using GNU C" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -2312,7 +2379,7 @@ + yes; + #endif + EOF +-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2316: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ++if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2383: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes + else + ac_cv_prog_gcc=no +@@ -2331,7 +2398,7 @@ + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +-echo "configure:2335: checking whether ${CC-cc} accepts -g" >&5 ++echo "configure:2402: checking whether ${CC-cc} accepts -g" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -2381,17 +2448,23 @@ + i*86-*-mingw*) TARGET=X86_WIN32; TARGETDIR=x86;; + sparc-sun-4*) TARGET=SPARC; TARGETDIR=sparc;; + sparc*-sun-*) TARGET=SPARC; TARGETDIR=sparc;; +-sparc-*-linux*) TARGET=SPARC; TARGETDIR=sparc;; +-sparc64-*-linux*) TARGET=SPARC; TARGETDIR=sparc;; +-alpha*-*-linux* | alpha*-*-osf* | alpha*-*-freebsd*) TARGET=ALPHA; TARGETDIR=alpha;; ++sparc-*-linux* | sparc-*-netbsdelf*) TARGET=SPARC; TARGETDIR=sparc;; ++sparc64-*-linux* | sparc64-*-netbsd*) TARGET=SPARC; TARGETDIR=sparc;; ++alpha*-*-linux* | alpha*-*-osf* | alpha*-*-freebsd* | alpha*-*-netbsd*) TARGET=ALPHA; TARGETDIR=alpha;; + ia64*-*-*) TARGET=IA64; TARGETDIR=ia64;; + m68k-*-linux*) TARGET=M68K; TARGETDIR=m68k;; ++mips64*-*);; ++mips*-*-linux*) TARGET=MIPS_LINUX; TARGETDIR=mips;; + powerpc-*-linux* | powerpc-*-sysv*) TARGET=POWERPC; TARGETDIR=powerpc;; + powerpc-*-beos*) TARGET=POWERPC; TARGETDIR=powerpc;; + powerpc-*-darwin*) TARGET=POWERPC_DARWIN; TARGETDIR=powerpc;; + powerpc-*-aix*) TARGET=POWERPC_AIX; TARGETDIR=powerpc;; + rs6000-*-aix*) TARGET=POWERPC_AIX; TARGETDIR=powerpc;; + arm*-*-linux-*) TARGET=ARM; TARGETDIR=arm;; ++s390-*-linux-*) TARGET=S390; TARGETDIR=s390;; ++s390x-*-linux-*) TARGET=S390; TARGETDIR=s390;; ++x86_64-*-linux*) TARGET=X86_64; TARGETDIR=x86;; ++sh-*-linux* | sh[34]*-*-linux*) TARGET=SH; TARGETDIR=sh;; + esac + + if test $TARGETDIR = unknown; then +@@ -2418,6 +2491,15 @@ + fi + + ++if test x$TARGET = xMIPS_LINUX; then ++ MIPS_LINUX_TRUE= ++ MIPS_LINUX_FALSE='#' ++else ++ MIPS_LINUX_TRUE='#' ++ MIPS_LINUX_FALSE= ++fi ++ ++ + if test x$TARGET = xSPARC; then + SPARC_TRUE= + SPARC_FALSE='#' +@@ -2507,8 +2589,39 @@ + ARM_FALSE= + fi + ++ ++if test x$TARGET = xS390; then ++ S390_TRUE= ++ S390_FALSE='#' ++else ++ S390_TRUE='#' ++ S390_FALSE= ++fi ++ ++ ++if test x$TARGET = xX86_64; then ++ X86_64_TRUE= ++ X86_64_FALSE='#' ++else ++ X86_64_TRUE='#' ++ X86_64_FALSE= ++fi ++ ++ ++if test x$TARGET = xSH; then ++ SH_TRUE= ++ SH_FALSE='#' ++else ++ SH_TRUE='#' ++ SH_FALSE= ++fi ++ ++if test x$TARGET = xMIPS_LINUX; then ++ TARGET=MIPS ++fi ++ + echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 +-echo "configure:2512: checking how to run the C preprocessor" >&5 ++echo "configure:2625: checking how to run the C preprocessor" >&5 + # On Suns, sometimes $CPP names a directory. + if test -n "$CPP" && test -d "$CPP"; then + CPP= +@@ -2523,13 +2636,13 @@ + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. + cat > conftest.$ac_ext < + Syntax Error + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:2533: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:2646: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + : +@@ -2540,13 +2653,13 @@ + rm -rf conftest* + CPP="${CC-cc} -E -traditional-cpp" + cat > conftest.$ac_ext < + Syntax Error + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:2550: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:2663: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + : +@@ -2557,13 +2670,13 @@ + rm -rf conftest* + CPP="${CC-cc} -nologo -E" + cat > conftest.$ac_ext < + Syntax Error + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:2567: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:2680: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + : +@@ -2588,12 +2701,12 @@ + echo "$ac_t""$CPP" 1>&6 + + echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 +-echo "configure:2592: checking for ANSI C header files" >&5 ++echo "configure:2705: checking for ANSI C header files" >&5 + if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + #include +@@ -2601,7 +2714,7 @@ + #include + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:2605: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:2718: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + rm -rf conftest* +@@ -2618,7 +2731,7 @@ + if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat > conftest.$ac_ext < + EOF +@@ -2636,7 +2749,7 @@ + if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat > conftest.$ac_ext < + EOF +@@ -2657,7 +2770,7 @@ + : + else + cat > conftest.$ac_ext < + #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +@@ -2668,7 +2781,7 @@ + exit (0); } + + EOF +-if { (eval echo configure:2672: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:2785: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null + then + : + else +@@ -2694,12 +2807,12 @@ + for ac_func in memcpy + do + echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +-echo "configure:2698: checking for $ac_func" >&5 ++echo "configure:2811: checking for $ac_func" >&5 + if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:2839: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" + else +@@ -2749,19 +2862,19 @@ + # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works + # for constant arguments. Useless! + echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 +-echo "configure:2753: checking for working alloca.h" >&5 ++echo "configure:2866: checking for working alloca.h" >&5 + if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + int main() { + char *p = alloca(2 * sizeof(int)); + ; return 0; } + EOF +-if { (eval echo configure:2765: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:2878: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_cv_header_alloca_h=yes + else +@@ -2782,12 +2895,12 @@ + fi + + echo $ac_n "checking for alloca""... $ac_c" 1>&6 +-echo "configure:2786: checking for alloca" >&5 ++echo "configure:2899: checking for alloca" >&5 + if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:2932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_cv_func_alloca_works=yes + else +@@ -2847,12 +2960,12 @@ + + + echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 +-echo "configure:2851: checking whether alloca needs Cray hooks" >&5 ++echo "configure:2964: checking whether alloca needs Cray hooks" >&5 + if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&6 +-echo "configure:2881: checking for $ac_func" >&5 ++echo "configure:2994: checking for $ac_func" >&5 + if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:3022: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" + else +@@ -2932,7 +3045,7 @@ + fi + + echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 +-echo "configure:2936: checking stack direction for C alloca" >&5 ++echo "configure:3049: checking stack direction for C alloca" >&5 + if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -2940,7 +3053,7 @@ + ac_cv_c_stack_direction=0 + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:3076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null + then + ac_cv_c_stack_direction=1 + else +@@ -2982,13 +3095,13 @@ + + + echo $ac_n "checking size of short""... $ac_c" 1>&6 +-echo "configure:2986: checking size of short" >&5 ++echo "configure:3099: checking size of short" >&5 + if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. + cat > conftest.$ac_ext < +@@ -2998,7 +3111,7 @@ + switch (0) case 0: case (sizeof (short) == $ac_size):; + ; return 0; } + EOF +-if { (eval echo configure:3002: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:3115: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_sizeof_short=$ac_size + else +@@ -3021,13 +3134,13 @@ + + + echo $ac_n "checking size of int""... $ac_c" 1>&6 +-echo "configure:3025: checking size of int" >&5 ++echo "configure:3138: checking size of int" >&5 + if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. + cat > conftest.$ac_ext < +@@ -3037,7 +3150,7 @@ + switch (0) case 0: case (sizeof (int) == $ac_size):; + ; return 0; } + EOF +-if { (eval echo configure:3041: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:3154: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_sizeof_int=$ac_size + else +@@ -3060,13 +3173,13 @@ + + + echo $ac_n "checking size of long""... $ac_c" 1>&6 +-echo "configure:3064: checking size of long" >&5 ++echo "configure:3177: checking size of long" >&5 + if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. + cat > conftest.$ac_ext < +@@ -3076,7 +3189,7 @@ + switch (0) case 0: case (sizeof (long) == $ac_size):; + ; return 0; } + EOF +-if { (eval echo configure:3080: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:3193: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_sizeof_long=$ac_size + else +@@ -3099,13 +3212,13 @@ + + + echo $ac_n "checking size of long long""... $ac_c" 1>&6 +-echo "configure:3103: checking size of long long" >&5 ++echo "configure:3216: checking size of long long" >&5 + if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. + cat > conftest.$ac_ext < +@@ -3115,7 +3228,7 @@ + switch (0) case 0: case (sizeof (long long) == $ac_size):; + ; return 0; } + EOF +-if { (eval echo configure:3119: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:3232: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_sizeof_long_long=$ac_size + else +@@ -3138,13 +3251,13 @@ + + + echo $ac_n "checking size of float""... $ac_c" 1>&6 +-echo "configure:3142: checking size of float" >&5 ++echo "configure:3255: checking size of float" >&5 + if eval "test \"`echo '$''{'ac_cv_sizeof_float'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. + cat > conftest.$ac_ext < +@@ -3154,7 +3267,7 @@ + switch (0) case 0: case (sizeof (float) == $ac_size):; + ; return 0; } + EOF +-if { (eval echo configure:3158: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:3271: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_sizeof_float=$ac_size + else +@@ -3177,13 +3290,13 @@ + + + echo $ac_n "checking size of double""... $ac_c" 1>&6 +-echo "configure:3181: checking size of double" >&5 ++echo "configure:3294: checking size of double" >&5 + if eval "test \"`echo '$''{'ac_cv_sizeof_double'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. + cat > conftest.$ac_ext < +@@ -3193,7 +3306,7 @@ + switch (0) case 0: case (sizeof (double) == $ac_size):; + ; return 0; } + EOF +-if { (eval echo configure:3197: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:3310: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_sizeof_double=$ac_size + else +@@ -3216,13 +3329,13 @@ + + + echo $ac_n "checking size of long double""... $ac_c" 1>&6 +-echo "configure:3220: checking size of long double" >&5 ++echo "configure:3333: checking size of long double" >&5 + if eval "test \"`echo '$''{'ac_cv_sizeof_long_double'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. + cat > conftest.$ac_ext < +@@ -3232,7 +3345,7 @@ + switch (0) case 0: case (sizeof (long double) == $ac_size):; + ; return 0; } + EOF +-if { (eval echo configure:3236: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:3349: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_sizeof_long_double=$ac_size + else +@@ -3256,13 +3369,13 @@ + + + echo $ac_n "checking size of void *""... $ac_c" 1>&6 +-echo "configure:3260: checking size of void *" >&5 ++echo "configure:3373: checking size of void *" >&5 + if eval "test \"`echo '$''{'ac_cv_sizeof_void_p'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. + cat > conftest.$ac_ext < +@@ -3272,7 +3385,7 @@ + switch (0) case 0: case (sizeof (void *) == $ac_size):; + ; return 0; } + EOF +-if { (eval echo configure:3276: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:3389: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_sizeof_void_p=$ac_size + else +@@ -3295,14 +3408,14 @@ + + + echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 +-echo "configure:3299: checking whether byte ordering is bigendian" >&5 ++echo "configure:3412: checking whether byte ordering is bigendian" >&5 + if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_cv_c_bigendian=unknown + # See if sys/param.h defines the BYTE_ORDER macro. + cat > conftest.$ac_ext < + #include +@@ -3313,11 +3426,11 @@ + #endif + ; return 0; } + EOF +-if { (eval echo configure:3317: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:3430: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + # It does; now see whether it defined to BIG_ENDIAN or not. + cat > conftest.$ac_ext < + #include +@@ -3328,7 +3441,7 @@ + #endif + ; return 0; } + EOF +-if { (eval echo configure:3332: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:3445: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_c_bigendian=yes + else +@@ -3348,7 +3461,7 @@ + echo $ac_n "cross-compiling... " 2>&6 + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:3478: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null + then + ac_cv_c_bigendian=no + else +@@ -3379,7 +3492,7 @@ + echo "$ac_t""$ac_cv_c_bigendian" 1>&6 + if test $ac_cv_c_bigendian = unknown; then + echo $ac_n "checking to probe for byte ordering""... $ac_c" 1>&6 +-echo "configure:3383: checking to probe for byte ordering" >&5 ++echo "configure:3496: checking to probe for byte ordering" >&5 + + cat >conftest.c <> confdefs.h <<\EOF ++#define HOST_WORDS_BIG_ENDIAN 1 ++EOF ++ + BYTEORDER=4321 + else + BYTEORDER=1234 +@@ -3429,7 +3546,7 @@ + + if test x$TARGET = xSPARC; then + echo $ac_n "checking assembler and linker support unaligned pc related relocs""... $ac_c" 1>&6 +-echo "configure:3433: checking assembler and linker support unaligned pc related relocs" >&5 ++echo "configure:3550: checking assembler and linker support unaligned pc related relocs" >&5 + if eval "test \"`echo '$''{'libffi_cv_as_sparc_ua_pcrel'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -3439,14 +3556,14 @@ + CFLAGS="$CFLAGS -fpic" + LDFLAGS="$LDFLAGS -shared" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:3567: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + libffi_cv_as_sparc_ua_pcrel=yes + else +@@ -3709,6 +3826,8 @@ + s%@MIPS_GCC_FALSE@%$MIPS_GCC_FALSE%g + s%@MIPS_SGI_TRUE@%$MIPS_SGI_TRUE%g + s%@MIPS_SGI_FALSE@%$MIPS_SGI_FALSE%g ++s%@MIPS_LINUX_TRUE@%$MIPS_LINUX_TRUE%g ++s%@MIPS_LINUX_FALSE@%$MIPS_LINUX_FALSE%g + s%@SPARC_TRUE@%$SPARC_TRUE%g + s%@SPARC_FALSE@%$SPARC_FALSE%g + s%@X86_TRUE@%$X86_TRUE%g +@@ -3729,6 +3848,12 @@ + s%@POWERPC_DARWIN_FALSE@%$POWERPC_DARWIN_FALSE%g + s%@ARM_TRUE@%$ARM_TRUE%g + s%@ARM_FALSE@%$ARM_FALSE%g ++s%@S390_TRUE@%$S390_TRUE%g ++s%@S390_FALSE@%$S390_FALSE%g ++s%@X86_64_TRUE@%$X86_64_TRUE%g ++s%@X86_64_FALSE@%$X86_64_FALSE%g ++s%@SH_TRUE@%$SH_TRUE%g ++s%@SH_FALSE@%$SH_FALSE%g + s%@CPP@%$CPP%g + s%@ALLOCA@%$ALLOCA%g + s%@TARGET@%$TARGET%g +@@ -3969,7 +4094,7 @@ + + if test -n "$CONFIG_FILES"; then + LD="${ORIGINAL_LD_FOR_MULTILIBS}" +- ac_file=Makefile . ${libffi_basedir}/../config-ml.in ++ ac_file=Makefile . ${srcdir}/${libffi_basedir}../config-ml.in + fi + + exit 0 +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/configure.in gcc/libffi/configure.in +--- gcc-3.2.2.orig/libffi/configure.in Tue Jan 28 10:43:56 2003 ++++ gcc/libffi/configure.in Sat Feb 1 20:16:19 2003 +@@ -22,14 +22,15 @@ + + if test "${srcdir}" = "."; then + if test "${with_target_subdir}" != "."; then +- libffi_basedir="${srcdir}/${with_multisrctop}.." ++ libffi_basedir="${with_multisrctop}../" + else +- libffi_basedir="${srcdir}/${with_multisrctop}" ++ libffi_basedir="${with_multisrctop}" + fi + else +- libffi_basedir="${srcdir}" ++ libffi_basedir= + fi + AC_SUBST(libffi_basedir) ++AC_CONFIG_AUX_DIR(${libffi_basedir}..) + + AC_CANONICAL_HOST + +@@ -56,17 +57,23 @@ + i*86-*-mingw*) TARGET=X86_WIN32; TARGETDIR=x86;; + sparc-sun-4*) TARGET=SPARC; TARGETDIR=sparc;; + sparc*-sun-*) TARGET=SPARC; TARGETDIR=sparc;; +-sparc-*-linux*) TARGET=SPARC; TARGETDIR=sparc;; +-sparc64-*-linux*) TARGET=SPARC; TARGETDIR=sparc;; +-alpha*-*-linux* | alpha*-*-osf* | alpha*-*-freebsd*) TARGET=ALPHA; TARGETDIR=alpha;; ++sparc-*-linux* | sparc-*-netbsdelf*) TARGET=SPARC; TARGETDIR=sparc;; ++sparc64-*-linux* | sparc64-*-netbsd*) TARGET=SPARC; TARGETDIR=sparc;; ++alpha*-*-linux* | alpha*-*-osf* | alpha*-*-freebsd* | alpha*-*-netbsd*) TARGET=ALPHA; TARGETDIR=alpha;; + ia64*-*-*) TARGET=IA64; TARGETDIR=ia64;; + m68k-*-linux*) TARGET=M68K; TARGETDIR=m68k;; ++mips64*-*);; ++mips*-*-linux*) TARGET=MIPS_LINUX; TARGETDIR=mips;; + powerpc-*-linux* | powerpc-*-sysv*) TARGET=POWERPC; TARGETDIR=powerpc;; + powerpc-*-beos*) TARGET=POWERPC; TARGETDIR=powerpc;; + powerpc-*-darwin*) TARGET=POWERPC_DARWIN; TARGETDIR=powerpc;; + powerpc-*-aix*) TARGET=POWERPC_AIX; TARGETDIR=powerpc;; + rs6000-*-aix*) TARGET=POWERPC_AIX; TARGETDIR=powerpc;; + arm*-*-linux-*) TARGET=ARM; TARGETDIR=arm;; ++s390-*-linux-*) TARGET=S390; TARGETDIR=s390;; ++s390x-*-linux-*) TARGET=S390; TARGETDIR=s390;; ++x86_64-*-linux*) TARGET=X86_64; TARGETDIR=x86;; ++sh-*-linux* | sh[[34]]*-*-linux*) TARGET=SH; TARGETDIR=sh;; + esac + + if test $TARGETDIR = unknown; then +@@ -75,6 +82,7 @@ + + AM_CONDITIONAL(MIPS_GCC, test ${TARGET}${ac_cv_prog_gcc} = MIPSyes) + AM_CONDITIONAL(MIPS_SGI, test ${TARGET}${ac_cv_prog_gcc} = MIPSno) ++AM_CONDITIONAL(MIPS_LINUX, test x$TARGET = xMIPS_LINUX) + AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC) + AM_CONDITIONAL(X86, test x$TARGET = xX86) + AM_CONDITIONAL(X86_WIN32, test x$TARGET = xX86_WIN32) +@@ -85,6 +93,13 @@ + AM_CONDITIONAL(POWERPC_AIX, test x$TARGET = xPOWERPC_AIX) + AM_CONDITIONAL(POWERPC_DARWIN, test x$TARGET = xPOWERPC_DARWIN) + AM_CONDITIONAL(ARM, test x$TARGET = xARM) ++AM_CONDITIONAL(S390, test x$TARGET = xS390) ++AM_CONDITIONAL(X86_64, test x$TARGET = xX86_64) ++AM_CONDITIONAL(SH, test x$TARGET = xSH) ++ ++if test x$TARGET = xMIPS_LINUX; then ++ TARGET=MIPS ++fi + + AC_HEADER_STDC + AC_CHECK_FUNCS(memcpy) +@@ -171,7 +186,7 @@ + [ + if test -n "$CONFIG_FILES"; then + LD="${ORIGINAL_LD_FOR_MULTILIBS}" +- ac_file=Makefile . ${libffi_basedir}/../config-ml.in ++ ac_file=Makefile . ${srcdir}/${libffi_basedir}../config-ml.in + fi + ], + srcdir=${srcdir} +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/include/Makefile.in gcc/libffi/include/Makefile.in +--- gcc-3.2.2.orig/libffi/include/Makefile.in Tue Oct 9 14:32:16 2001 ++++ gcc/libffi/include/Makefile.in Mon Apr 29 13:14:44 2002 +@@ -99,7 +99,7 @@ + + DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +-TAR = gnutar ++TAR = gtar + GZIP_ENV = --best + all: all-redirect + .SUFFIXES: +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/include/ffi.h.in gcc/libffi/include/ffi.h.in +--- gcc-3.2.2.orig/libffi/include/ffi.h.in Wed Mar 13 07:35:56 2002 ++++ gcc/libffi/include/ffi.h.in Wed Jan 29 00:54:28 2003 +@@ -1,5 +1,5 @@ + /* -----------------------------------------------------------------*-C-*- +- libffi @VERSION@ - Copyright (c) 1996-2002 Cygnus Solutions ++ libffi @VERSION@ - Copyright (c) 1996-2003 Cygnus Solutions + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the +@@ -164,6 +164,12 @@ + #endif + #endif + ++#ifdef S390 ++#if defined (__s390x__) ++#define S390X ++#endif ++#endif ++ + #ifndef LIBFFI_ASM + + /* ---- Generic type definitions ----------------------------------------- */ +@@ -189,16 +195,23 @@ + #endif + #endif + +- /* ---- Intel x86 ---------------- */ +-#ifdef X86 ++ /* ---- Intel x86 Win32 ---------- */ ++#ifdef X86_WIN32 + FFI_SYSV, ++ FFI_STDCALL, ++ /* TODO: Add fastcall support for the sake of completeness */ + FFI_DEFAULT_ABI = FFI_SYSV, + #endif + +- /* ---- Intel x86 Win32 ---------- */ +-#ifdef X86_WIN32 ++ /* ---- Intel x86 and AMD x86-64 - */ ++#if !defined(X86_WIN32) && (defined(__i386__) || defined(__x86_64__)) + FFI_SYSV, ++ FFI_UNIX64, /* Unix variants all use the same ABI for x86-64 */ ++#ifdef __i386__ + FFI_DEFAULT_ABI = FFI_SYSV, ++#else ++ FFI_DEFAULT_ABI = FFI_UNIX64, ++#endif + #endif + + /* ---- Intel ia64 ---------------- */ +@@ -251,6 +264,18 @@ + FFI_DEFAULT_ABI = FFI_SYSV, + #endif + ++ /* ---- S390 --------------------- */ ++#ifdef S390 ++ FFI_SYSV, ++ FFI_DEFAULT_ABI = FFI_SYSV, ++#endif ++ ++ /* ---- SuperH ------------------- */ ++#ifdef SH ++ FFI_SYSV, ++ FFI_DEFAULT_ABI = FFI_SYSV, ++#endif ++ + /* Leave this for debugging purposes */ + FFI_LAST_ABI + +@@ -264,7 +289,7 @@ + /*@null@*/ struct _ffi_type **elements; + } ffi_type; + +-/* These are defined in ffi.c */ ++/* These are defined in types.c */ + extern ffi_type ffi_type_void; + extern ffi_type ffi_type_uint8; + extern ffi_type ffi_type_sint8; +@@ -373,13 +398,7 @@ + + /* ---- Definitions for closures ----------------------------------------- */ + +-#ifdef X86 +- +-#define FFI_CLOSURES 1 /* x86 supports closures */ +-#define FFI_TRAMPOLINE_SIZE 10 +-#define FFI_NATIVE_RAW_API 1 /* and has native raw api support */ +- +-#elif defined(X86_WIN32) ++#ifdef __i386__ + + #define FFI_CLOSURES 1 /* x86 supports closures */ + #define FFI_TRAMPOLINE_SIZE 10 +@@ -424,6 +443,40 @@ + #define FFI_TRAMPOLINE_SIZE 24 /* see struct below */ + #define FFI_NATIVE_RAW_API 0 + ++#elif defined(SPARC64) ++ ++#define FFI_CLOSURES 1 ++#define FFI_TRAMPOLINE_SIZE 24 ++#define FFI_NATIVE_RAW_API 0 ++ ++#elif defined(SPARC) ++ ++#define FFI_CLOSURES 1 ++#define FFI_TRAMPOLINE_SIZE 16 ++#define FFI_NATIVE_RAW_API 0 ++ ++#elif defined(S390) ++ ++#define FFI_CLOSURES 1 ++#ifdef S390X ++#define FFI_TRAMPOLINE_SIZE 32 ++#else ++#define FFI_TRAMPOLINE_SIZE 16 ++#endif ++#define FFI_NATIVE_RAW_API 0 ++ ++#elif defined(SH) ++ ++#define FFI_CLOSURES 1 ++#define FFI_TRAMPOLINE_SIZE 16 ++#define FFI_NATIVE_RAW_API 0 ++ ++#elif defined(__x86_64__) ++ ++#define FFI_CLOSURES 1 ++#define FFI_TRAMPOLINE_SIZE 24 ++#define FFI_NATIVE_RAW_API 0 ++ + #else + + #define FFI_CLOSURES 0 +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/arm/ffi.c gcc/libffi/src/arm/ffi.c +--- gcc-3.2.2.orig/libffi/src/arm/ffi.c Sat Mar 3 07:21:23 2001 ++++ gcc/libffi/src/arm/ffi.c Fri Jul 19 08:08:30 2002 +@@ -36,13 +36,10 @@ + /*@=exportheader@*/ + { + register unsigned int i; +- register int tmp; +- register unsigned int avn; + register void **p_argv; + register char *argp; + register ffi_type **p_arg; + +- tmp = 0; + argp = stack; + + if ( ecif->cif->rtype->type == FFI_TYPE_STRUCT ) { +@@ -50,11 +47,10 @@ + argp += 4; + } + +- avn = ecif->cif->nargs; + p_argv = ecif->avalue; + + for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; +- (i != 0) && (avn != 0); ++ (i != 0); + i--, p_arg++) + { + size_t z; +@@ -64,9 +60,6 @@ + argp = (char *) ALIGN(argp, (*p_arg)->alignment); + } + +- if (avn != 0) +- { +- avn--; + z = (*p_arg)->size; + if (z < sizeof(int)) + { +@@ -107,7 +100,6 @@ + } + p_argv++; + argp += z; +- } + } + + return; +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/arm/sysv.S gcc/libffi/src/arm/sysv.S +--- gcc-3.2.2.orig/libffi/src/arm/sysv.S Sat Mar 3 07:21:23 2001 ++++ gcc/libffi/src/arm/sysv.S Mon Sep 30 03:08:58 2002 +@@ -28,8 +28,15 @@ + #ifdef HAVE_MACHINE_ASM_H + #include + #else +-/* XXX these lose for some platforms, I'm sure. */ ++#ifdef __USER_LABEL_PREFIX__ ++#define CONCAT1(a, b) CONCAT2(a, b) ++#define CONCAT2(a, b) a ## b ++ ++/* Use the right prefix for global labels. */ ++#define CNAME(x) CONCAT1 (__USER_LABEL_PREFIX__, x) ++#else + #define CNAME(x) x ++#endif + #define ENTRY(x) .globl CNAME(x); .type CNAME(x),%function; CNAME(x): + #endif + +@@ -96,12 +103,20 @@ + + # return FLOAT + cmp a4, #FFI_TYPE_FLOAT ++#ifdef __SOFTFP__ ++ streq a1, [a3] ++#else + stfeqs f0, [a3] ++#endif + beq epilogue + + # return DOUBLE or LONGDOUBLE + cmp a4, #FFI_TYPE_DOUBLE ++#ifdef __SOFTFP__ ++ stmeqia a3, {a1, a2} ++#else + stfeqd f0, [a3] ++#endif + + epilogue: + ldmfd sp!, {a1-a4, fp, pc} +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/java_raw_api.c gcc/libffi/src/java_raw_api.c +--- gcc-3.2.2.orig/libffi/src/java_raw_api.c Tue Apr 9 07:31:14 2002 ++++ gcc/libffi/src/java_raw_api.c Tue Oct 8 23:55:02 2002 +@@ -81,21 +81,14 @@ + { + case FFI_TYPE_UINT8: + case FFI_TYPE_SINT8: +- *args = (void*) ((char*)(raw++) + SIZEOF_ARG - 1); ++ *args = (void*) ((char*)(raw++) + 3); + break; + + case FFI_TYPE_UINT16: + case FFI_TYPE_SINT16: +- *args = (void*) ((char*)(raw++) + SIZEOF_ARG - 2); ++ *args = (void*) ((char*)(raw++) + 2); + break; + +-#if SIZEOF_ARG >= 4 +- case FFI_TYPE_UINT32: +- case FFI_TYPE_SINT32: +- *args = (void*) ((char*)(raw++) + SIZEOF_ARG - 4); +- break; +-#endif +- + #if SIZEOF_ARG == 8 + case FFI_TYPE_UINT64: + case FFI_TYPE_SINT64: +@@ -157,31 +150,54 @@ + switch ((*tp)->type) + { + case FFI_TYPE_UINT8: ++#if WORDS_BIGENDIAN ++ *(UINT32*)(raw++) = *(UINT8*) (*args); ++#else + (raw++)->uint = *(UINT8*) (*args); ++#endif + break; + + case FFI_TYPE_SINT8: ++#if WORDS_BIGENDIAN ++ *(SINT32*)(raw++) = *(SINT8*) (*args); ++#else + (raw++)->sint = *(SINT8*) (*args); ++#endif + break; + + case FFI_TYPE_UINT16: ++#if WORDS_BIGENDIAN ++ *(UINT32*)(raw++) = *(UINT16*) (*args); ++#else + (raw++)->uint = *(UINT16*) (*args); ++#endif + break; + + case FFI_TYPE_SINT16: ++#if WORDS_BIGENDIAN ++ *(SINT32*)(raw++) = *(SINT16*) (*args); ++#else + (raw++)->sint = *(SINT16*) (*args); ++#endif + break; + +-#if SIZEOF_ARG >= 4 + case FFI_TYPE_UINT32: ++#if WORDS_BIGENDIAN ++ *(UINT32*)(raw++) = *(UINT32*) (*args); ++#else + (raw++)->uint = *(UINT32*) (*args); ++#endif + break; + + case FFI_TYPE_SINT32: ++#if WORDS_BIGENDIAN ++ *(SINT32*)(raw++) = *(SINT32*) (*args); ++#else + (raw++)->sint = *(SINT32*) (*args); +- break; + #endif +- case FFI_TYPE_FLOAT: ++ break; ++ ++ case FFI_TYPE_FLOAT: + (raw++)->flt = *(FLOAT32*) (*args); + break; + +@@ -211,6 +227,55 @@ + + #if !FFI_NATIVE_RAW_API + ++static void ++ffi_java_rvalue_to_raw (ffi_cif *cif, void *rvalue) ++{ ++#if WORDS_BIGENDIAN && SIZEOF_ARG == 8 ++ switch (cif->rtype->type) ++ { ++ case FFI_TYPE_UINT8: ++ case FFI_TYPE_UINT16: ++ case FFI_TYPE_UINT32: ++ *(UINT64 *)rvalue <<= 32; ++ break; ++ ++ case FFI_TYPE_SINT8: ++ case FFI_TYPE_SINT16: ++ case FFI_TYPE_SINT32: ++ case FFI_TYPE_INT: ++ *(SINT64 *)rvalue <<= 32; ++ break; ++ ++ default: ++ break; ++ } ++#endif ++} ++ ++static void ++ffi_java_raw_to_rvalue (ffi_cif *cif, void *rvalue) ++{ ++#if WORDS_BIGENDIAN && SIZEOF_ARG == 8 ++ switch (cif->rtype->type) ++ { ++ case FFI_TYPE_UINT8: ++ case FFI_TYPE_UINT16: ++ case FFI_TYPE_UINT32: ++ *(UINT64 *)rvalue >>= 32; ++ break; ++ ++ case FFI_TYPE_SINT8: ++ case FFI_TYPE_SINT16: ++ case FFI_TYPE_SINT32: ++ case FFI_TYPE_INT: ++ *(SINT64 *)rvalue >>= 32; ++ break; ++ ++ default: ++ break; ++ } ++#endif ++} + + /* This is a generic definition of ffi_raw_call, to be used if the + * native system does not provide a machine-specific implementation. +@@ -227,6 +292,7 @@ + void **avalue = (void**) alloca (cif->nargs * sizeof (void*)); + ffi_java_raw_to_ptrarray (cif, raw, avalue); + ffi_call (cif, fn, rvalue, avalue); ++ ffi_java_rvalue_to_raw (cif, rvalue); + } + + #if FFI_CLOSURES /* base system provides closures */ +@@ -240,6 +306,7 @@ + + ffi_java_ptrarray_to_raw (cif, avalue, raw); + (*cl->fun) (cif, rvalue, raw, cl->user_data); ++ ffi_java_raw_to_rvalue (cif, rvalue); + } + + /* Again, here is the generic version of ffi_prep_raw_closure, which +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/m68k/ffi.c gcc/libffi/src/m68k/ffi.c +--- gcc-3.2.2.orig/libffi/src/m68k/ffi.c Sun Aug 8 22:27:19 1999 ++++ gcc/libffi/src/m68k/ffi.c Fri Jul 19 08:08:30 2002 +@@ -16,14 +16,11 @@ + ffi_prep_args (void *stack, extended_cif *ecif) + { + unsigned int i; +- int tmp; +- unsigned int avn; + void **p_argv; + char *argp; + ffi_type **p_arg; + void *struct_value_ptr; + +- tmp = 0; + argp = stack; + + if (ecif->cif->rtype->type == FFI_TYPE_STRUCT +@@ -32,11 +29,10 @@ + else + struct_value_ptr = NULL; + +- avn = ecif->cif->nargs; + p_argv = ecif->avalue; + + for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; +- i != 0 && avn != 0; ++ i != 0; + i--, p_arg++) + { + size_t z; +@@ -45,9 +41,6 @@ + if (((*p_arg)->alignment - 1) & (unsigned) argp) + argp = (char *) ALIGN (argp, (*p_arg)->alignment); + +- if (avn != 0) +- { +- avn--; + z = (*p_arg)->size; + if (z < sizeof (int)) + { +@@ -82,7 +75,6 @@ + memcpy (argp, *p_argv, z); + p_argv++; + argp += z; +- } + } + + return struct_value_ptr; +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/mips/ffi.c gcc/libffi/src/mips/ffi.c +--- gcc-3.2.2.orig/libffi/src/mips/ffi.c Sat Mar 3 07:21:23 2001 ++++ gcc/libffi/src/mips/ffi.c Fri Jul 19 08:08:31 2002 +@@ -23,6 +23,7 @@ + OTHER DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + ++#include + #include + #include + +@@ -50,7 +51,6 @@ + int flags) + { + register int i; +- register int avn; + register void **p_argv; + register char *argp; + register ffi_type **p_arg; +@@ -80,12 +80,9 @@ + FIX_ARGP; + } + +- avn = ecif->cif->nargs; + p_argv = ecif->avalue; + +- for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; +- i && avn; +- i--, p_arg++) ++ for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; i; i--, p_arg++) + { + size_t z; + +@@ -101,9 +98,6 @@ + #define OFFSET sizeof(int) + #endif + +- if (avn) +- { +- avn--; + z = (*p_arg)->size; + if (z < sizeof(SLOT_TYPE_UNSIGNED)) + { +@@ -179,7 +173,6 @@ + p_argv++; + argp += z; + FIX_ARGP; +- } + } + + return; +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/powerpc/darwin.S gcc/libffi/src/powerpc/darwin.S +--- gcc-3.2.2.orig/libffi/src/powerpc/darwin.S Sat Jan 19 01:22:34 2002 ++++ gcc/libffi/src/powerpc/darwin.S Thu Jan 23 03:21:55 2003 +@@ -3,8 +3,6 @@ + + PowerPC Assembly glue. + +- $Id: darwin.S,v 1.2 2002/01/18 16:22:34 dje Exp $ +- + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including +@@ -39,30 +37,34 @@ + .text + .align 2 + _ffi_call_DARWIN: +- mr r12,r8 // We only need r12 until the call, so it doesn't have to be saved... ++LFB0: ++ mr r12,r8 /* We only need r12 until the call, ++ so it doesn't have to be saved... */ ++LFB1: + /* Save the old stack pointer as AP. */ + mr r8,r1 +- ++LCFI0: + /* Allocate the stack space we need. */ + stwux r1,r1,r4 + + /* Save registers we use. */ + mflr r9 + +- stw r28,-16(r8) ++ stw r28,-16(r8) + stw r29,-12(r8) + stw r30, -8(r8) + stw r31, -4(r8) +- +- stw r9, 8(r8) ++ ++ stw r9, 8(r8) + stw r2, 20(r1) ++LCFI1: + + /* Save arguments over call... */ +- mr r31,r5 /* flags, */ +- mr r30,r6 /* rvalue, */ +- mr r29,r7 /* function address, */ +- mr r28,r8 /* our AP. */ +- ++ mr r31,r5 /* flags, */ ++ mr r30,r6 /* rvalue, */ ++ mr r29,r7 /* function address, */ ++ mr r28,r8 /* our AP. */ ++LCFI2: + /* Call ffi_prep_args. */ + mr r4,r1 + li r9,0 +@@ -145,7 +147,8 @@ + L(float_return_value): + stfs f1,0(r30) + b L(done_return_value) +-//END(_ffi_call_DARWIN) ++LFE1: ++/* END(_ffi_call_DARWIN) */ + + /* Provide a null definition of _ffi_call_AIX. */ + .text +@@ -155,5 +158,61 @@ + .align 2 + _ffi_call_AIX: + blr +-//END(_ffi_call_AIX) ++/* END(_ffi_call_AIX) */ + ++.data ++.section __TEXT,__eh_frame ++Lframe1: ++ .set L$set$0,LECIE1-LSCIE1 ++ .long L$set$0 ; Length of Common Information Entry ++LSCIE1: ++ .long 0x0 ; CIE Identifier Tag ++ .byte 0x1 ; CIE Version ++ .ascii "zR\0" ; CIE Augmentation ++ .byte 0x1 ; uleb128 0x1; CIE Code Alignment Factor ++ .byte 0x7c ; sleb128 -4; CIE Data Alignment Factor ++ .byte 0x41 ; CIE RA Column ++ .byte 0x1 ; uleb128 0x1; Augmentation size ++ .byte 0x10 ; FDE Encoding (pcrel) ++ .byte 0xc ; DW_CFA_def_cfa ++ .byte 0x1 ; uleb128 0x1 ++ .byte 0x0 ; uleb128 0x0 ++ .align 2 ++LECIE1: ++LSFDE1: ++ .set L$set$1,LEFDE1-LASFDE1 ++ .long L$set$1 ; FDE Length ++LASFDE1: ++ .set L$set$2,LASFDE1-Lframe1 ++ .long L$set$2 ; FDE CIE offset ++ .long LFB0-. ; FDE initial location ++ .set L$set$3,LFE1-LFB0 ++ .long L$set$3 ; FDE address range ++ .byte 0x0 ; uleb128 0x0; Augmentation size ++ .byte 0x4 ; DW_CFA_advance_loc4 ++ .set L$set$4,LCFI0-LFB1 ++ .long L$set$4 ++ .byte 0xd ; DW_CFA_def_cfa_register ++ .byte 0x08 ; uleb128 0x08 ++ .byte 0x4 ; DW_CFA_advance_loc4 ++ .set L$set$5,LCFI1-LCFI0 ++ .long L$set$5 ++ .byte 0x11 ; DW_CFA_offset_extended_sf ++ .byte 0x41 ; uleb128 0x41 ++ .byte 0x7e ; sleb128 -2 ++ .byte 0x9f ; DW_CFA_offset, column 0x1f ++ .byte 0x1 ; uleb128 0x1 ++ .byte 0x9e ; DW_CFA_offset, column 0x1e ++ .byte 0x2 ; uleb128 0x2 ++ .byte 0x9d ; DW_CFA_offset, column 0x1d ++ .byte 0x3 ; uleb128 0x3 ++ .byte 0x9c ; DW_CFA_offset, column 0x1c ++ .byte 0x4 ; uleb128 0x4 ++ .byte 0x4 ; DW_CFA_advance_loc4 ++ .set L$set$6,LCFI2-LCFI1 ++ .long L$set$6 ++ .byte 0xd ; DW_CFA_def_cfa_register ++ .byte 0x1c ; uleb128 0x1c ++ .align 2 ++LEFDE1: ++ +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/prep_cif.c gcc/libffi/src/prep_cif.c +--- gcc-3.2.2.orig/libffi/src/prep_cif.c Sat Mar 3 07:21:22 2001 ++++ gcc/libffi/src/prep_cif.c Mon Sep 30 20:59:42 2002 +@@ -103,7 +103,8 @@ + /* Perform a sanity check on the return type */ + FFI_ASSERT(ffi_type_test(cif->rtype)); + +-#ifndef M68K ++ /* x86-64 and s390 stack space allocation is handled in prep_machdep. */ ++#if !defined M68K && !defined __x86_64__ && !defined S390 + /* Make space for the return structure pointer */ + if (cif->rtype->type == FFI_TYPE_STRUCT + #ifdef SPARC +@@ -122,6 +123,7 @@ + if (((*ptr)->size == 0) && (initialize_aggregate((*ptr)) != FFI_OK)) + return FFI_BAD_TYPEDEF; + ++#if !defined __x86_64__ && !defined S390 + #ifdef SPARC + if (((*ptr)->type == FFI_TYPE_STRUCT + && ((*ptr)->size > 16 || cif->abi != FFI_V9)) +@@ -137,6 +139,7 @@ + + bytes += STACK_ARG_SIZE((*ptr)->size); + } ++#endif + } + + cif->bytes = bytes; +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/s390/ffi.c gcc/libffi/src/s390/ffi.c +--- gcc-3.2.2.orig/libffi/src/s390/ffi.c Thu Jan 1 09:00:00 1970 ++++ gcc/libffi/src/s390/ffi.c Thu Feb 6 08:58:57 2003 +@@ -0,0 +1,753 @@ ++/* ----------------------------------------------------------------------- ++ ffi.c - Copyright (c) 2000 Software AG ++ ++ S390 Foreign Function Interface ++ ++ Permission is hereby granted, free of charge, to any person obtaining ++ a copy of this software and associated documentation files (the ++ ``Software''), to deal in the Software without restriction, including ++ without limitation the rights to use, copy, modify, merge, publish, ++ distribute, sublicense, and/or sell copies of the Software, and to ++ permit persons to whom the Software is furnished to do so, subject to ++ the following conditions: ++ ++ The above copyright notice and this permission notice shall be included ++ in all copies or substantial portions of the Software. ++ ++ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS ++ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ++ IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR ++ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ++ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ OTHER DEALINGS IN THE SOFTWARE. ++ ----------------------------------------------------------------------- */ ++/*====================================================================*/ ++/* Includes */ ++/* -------- */ ++/*====================================================================*/ ++ ++#include ++#include ++ ++#include ++#include ++ ++/*====================== End of Includes =============================*/ ++ ++/*====================================================================*/ ++/* Defines */ ++/* ------- */ ++/*====================================================================*/ ++ ++/* Maximum number of GPRs available for argument passing. */ ++#define MAX_GPRARGS 5 ++ ++/* Maximum number of FPRs available for argument passing. */ ++#ifdef __s390x__ ++#define MAX_FPRARGS 4 ++#else ++#define MAX_FPRARGS 2 ++#endif ++ ++/* Round to multiple of 16. */ ++#define ROUND_SIZE(size) (((size) + 15) & ~15) ++ ++/* If these values change, sysv.S must be adapted! */ ++#define FFI390_RET_VOID 0 ++#define FFI390_RET_STRUCT 1 ++#define FFI390_RET_FLOAT 2 ++#define FFI390_RET_DOUBLE 3 ++#define FFI390_RET_INT32 4 ++#define FFI390_RET_INT64 5 ++ ++/*===================== End of Defines ===============================*/ ++ ++/*====================================================================*/ ++/* Prototypes */ ++/* ---------- */ ++/*====================================================================*/ ++ ++static void ffi_prep_args (unsigned char *, extended_cif *); ++static int ffi_check_float_struct (ffi_type *); ++void ++#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2) ++__attribute__ ((visibility ("hidden"))) ++#endif ++ffi_closure_helper_SYSV (ffi_closure *, unsigned long *, ++ unsigned long long *, unsigned long *); ++ ++/*====================== End of Prototypes ===========================*/ ++ ++/*====================================================================*/ ++/* Externals */ ++/* --------- */ ++/*====================================================================*/ ++ ++extern void ffi_call_SYSV(unsigned, ++ extended_cif *, ++ void (*)(unsigned char *, extended_cif *), ++ unsigned, ++ void *, ++ void (*fn)()); ++ ++extern void ffi_closure_SYSV(void); ++ ++/*====================== End of Externals ============================*/ ++ ++/*====================================================================*/ ++/* */ ++/* Name - ffi_check_struct_type. */ ++/* */ ++/* Function - Determine if a structure can be passed within a */ ++/* general purpose or floating point register. */ ++/* */ ++/*====================================================================*/ ++ ++static int ++ffi_check_struct_type (ffi_type *arg) ++{ ++ size_t size = arg->size; ++ ++ /* If the struct has just one element, look at that element ++ to find out whether to consider the struct as floating point. */ ++ while (arg->type == FFI_TYPE_STRUCT ++ && arg->elements[0] && !arg->elements[1]) ++ arg = arg->elements[0]; ++ ++ /* Structs of size 1, 2, 4, and 8 are passed in registers, ++ just like the corresponding int/float types. */ ++ switch (size) ++ { ++ case 1: ++ return FFI_TYPE_UINT8; ++ ++ case 2: ++ return FFI_TYPE_UINT16; ++ ++ case 4: ++ if (arg->type == FFI_TYPE_FLOAT) ++ return FFI_TYPE_FLOAT; ++ else ++ return FFI_TYPE_UINT32; ++ ++ case 8: ++ if (arg->type == FFI_TYPE_DOUBLE) ++ return FFI_TYPE_DOUBLE; ++ else ++ return FFI_TYPE_UINT64; ++ ++ default: ++ break; ++ } ++ ++ /* Other structs are passed via a pointer to the data. */ ++ return FFI_TYPE_POINTER; ++} ++ ++/*======================== End of Routine ============================*/ ++ ++/*====================================================================*/ ++/* */ ++/* Name - ffi_prep_args. */ ++/* */ ++/* Function - Prepare parameters for call to function. */ ++/* */ ++/* ffi_prep_args is called by the assembly routine once stack space */ ++/* has been allocated for the function's arguments. */ ++/* */ ++/*====================================================================*/ ++ ++static void ++ffi_prep_args (unsigned char *stack, extended_cif *ecif) ++{ ++ /* The stack space will be filled with those areas: ++ ++ FPR argument register save area (highest addresses) ++ GPR argument register save area ++ temporary struct copies ++ overflow argument area (lowest addresses) ++ ++ We set up the following pointers: ++ ++ p_fpr: bottom of the FPR area (growing upwards) ++ p_gpr: bottom of the GPR area (growing upwards) ++ p_ov: bottom of the overflow area (growing upwards) ++ p_struct: top of the struct copy area (growing downwards) ++ ++ All areas are kept aligned to twice the word size. */ ++ ++ int gpr_off = ecif->cif->bytes; ++ int fpr_off = gpr_off + ROUND_SIZE (MAX_GPRARGS * sizeof (long)); ++ ++ unsigned long long *p_fpr = (unsigned long long *)(stack + fpr_off); ++ unsigned long *p_gpr = (unsigned long *)(stack + gpr_off); ++ unsigned char *p_struct = (unsigned char *)p_gpr; ++ unsigned long *p_ov = (unsigned long *)stack; ++ ++ int n_fpr = 0; ++ int n_gpr = 0; ++ int n_ov = 0; ++ ++ ffi_type **ptr; ++ void **p_argv = ecif->avalue; ++ int i; ++ ++ /* If we returning a structure then we set the first parameter register ++ to the address of where we are returning this structure. */ ++ ++ if (ecif->cif->flags == FFI390_RET_STRUCT) ++ p_gpr[n_gpr++] = (unsigned long) ecif->rvalue; ++ ++ /* Now for the arguments. */ ++ ++ for (ptr = ecif->cif->arg_types, i = ecif->cif->nargs; ++ i > 0; ++ i--, ptr++, p_argv++) ++ { ++ void *arg = *p_argv; ++ int type = (*ptr)->type; ++ ++ /* Check how a structure type is passed. */ ++ if (type == FFI_TYPE_STRUCT) ++ { ++ type = ffi_check_struct_type (*ptr); ++ ++ /* If we pass the struct via pointer, copy the data. */ ++ if (type == FFI_TYPE_POINTER) ++ { ++ p_struct -= ROUND_SIZE ((*ptr)->size); ++ memcpy (p_struct, (char *)arg, (*ptr)->size); ++ arg = &p_struct; ++ } ++ } ++ ++ /* Pointers are passed like UINTs of the same size. */ ++ if (type == FFI_TYPE_POINTER) ++#ifdef __s390x__ ++ type = FFI_TYPE_UINT64; ++#else ++ type = FFI_TYPE_UINT32; ++#endif ++ ++ /* Now handle all primitive int/float data types. */ ++ switch (type) ++ { ++ case FFI_TYPE_DOUBLE: ++ if (n_fpr < MAX_FPRARGS) ++ p_fpr[n_fpr++] = *(unsigned long long *) arg; ++ else ++#ifdef __s390x__ ++ p_ov[n_ov++] = *(unsigned long *) arg; ++#else ++ p_ov[n_ov++] = ((unsigned long *) arg)[0], ++ p_ov[n_ov++] = ((unsigned long *) arg)[1]; ++#endif ++ break; ++ ++ case FFI_TYPE_FLOAT: ++ if (n_fpr < MAX_FPRARGS) ++ p_fpr[n_fpr++] = (long long) *(unsigned int *) arg << 32; ++ else ++ p_ov[n_ov++] = *(unsigned int *) arg; ++ break; ++ ++ case FFI_TYPE_UINT64: ++ case FFI_TYPE_SINT64: ++#ifdef __s390x__ ++ if (n_gpr < MAX_GPRARGS) ++ p_gpr[n_gpr++] = *(unsigned long *) arg; ++ else ++ p_ov[n_ov++] = *(unsigned long *) arg; ++#else ++ if (n_gpr == MAX_GPRARGS-1) ++ n_gpr = MAX_GPRARGS; ++ if (n_gpr < MAX_GPRARGS) ++ p_gpr[n_gpr++] = ((unsigned long *) arg)[0], ++ p_gpr[n_gpr++] = ((unsigned long *) arg)[1]; ++ else ++ p_ov[n_ov++] = ((unsigned long *) arg)[0], ++ p_ov[n_ov++] = ((unsigned long *) arg)[1]; ++#endif ++ break; ++ ++ case FFI_TYPE_UINT32: ++ if (n_gpr < MAX_GPRARGS) ++ p_gpr[n_gpr++] = *(unsigned int *) arg; ++ else ++ p_ov[n_ov++] = *(unsigned int *) arg; ++ break; ++ ++ case FFI_TYPE_INT: ++ case FFI_TYPE_SINT32: ++ if (n_gpr < MAX_GPRARGS) ++ p_gpr[n_gpr++] = *(signed int *) arg; ++ else ++ p_ov[n_ov++] = *(signed int *) arg; ++ break; ++ ++ case FFI_TYPE_UINT16: ++ if (n_gpr < MAX_GPRARGS) ++ p_gpr[n_gpr++] = *(unsigned short *) arg; ++ else ++ p_ov[n_ov++] = *(unsigned short *) arg; ++ break; ++ ++ case FFI_TYPE_SINT16: ++ if (n_gpr < MAX_GPRARGS) ++ p_gpr[n_gpr++] = *(signed short *) arg; ++ else ++ p_ov[n_ov++] = *(signed short *) arg; ++ break; ++ ++ case FFI_TYPE_UINT8: ++ if (n_gpr < MAX_GPRARGS) ++ p_gpr[n_gpr++] = *(unsigned char *) arg; ++ else ++ p_ov[n_ov++] = *(unsigned char *) arg; ++ break; ++ ++ case FFI_TYPE_SINT8: ++ if (n_gpr < MAX_GPRARGS) ++ p_gpr[n_gpr++] = *(signed char *) arg; ++ else ++ p_ov[n_ov++] = *(signed char *) arg; ++ break; ++ ++ default: ++ FFI_ASSERT (0); ++ break; ++ } ++ } ++} ++ ++/*======================== End of Routine ============================*/ ++ ++/*====================================================================*/ ++/* */ ++/* Name - ffi_prep_cif_machdep. */ ++/* */ ++/* Function - Perform machine dependent CIF processing. */ ++/* */ ++/*====================================================================*/ ++ ++ffi_status ++ffi_prep_cif_machdep(ffi_cif *cif) ++{ ++ size_t struct_size = 0; ++ int n_gpr = 0; ++ int n_fpr = 0; ++ int n_ov = 0; ++ ++ ffi_type **ptr; ++ int i; ++ ++ /* Determine return value handling. */ ++ ++ switch (cif->rtype->type) ++ { ++ /* Void is easy. */ ++ case FFI_TYPE_VOID: ++ cif->flags = FFI390_RET_VOID; ++ break; ++ ++ /* Structures are returned via a hidden pointer. */ ++ case FFI_TYPE_STRUCT: ++ cif->flags = FFI390_RET_STRUCT; ++ n_gpr++; /* We need one GPR to pass the pointer. */ ++ break; ++ ++ /* Floating point values are returned in fpr 0. */ ++ case FFI_TYPE_FLOAT: ++ cif->flags = FFI390_RET_FLOAT; ++ break; ++ ++ case FFI_TYPE_DOUBLE: ++ cif->flags = FFI390_RET_DOUBLE; ++ break; ++ ++ /* Integer values are returned in gpr 2 (and gpr 3 ++ for 64-bit values on 31-bit machines). */ ++ case FFI_TYPE_UINT64: ++ case FFI_TYPE_SINT64: ++ cif->flags = FFI390_RET_INT64; ++ break; ++ ++ case FFI_TYPE_POINTER: ++ case FFI_TYPE_INT: ++ case FFI_TYPE_UINT32: ++ case FFI_TYPE_SINT32: ++ case FFI_TYPE_UINT16: ++ case FFI_TYPE_SINT16: ++ case FFI_TYPE_UINT8: ++ case FFI_TYPE_SINT8: ++ /* These are to be extended to word size. */ ++#ifdef __s390x__ ++ cif->flags = FFI390_RET_INT64; ++#else ++ cif->flags = FFI390_RET_INT32; ++#endif ++ break; ++ ++ default: ++ FFI_ASSERT (0); ++ break; ++ } ++ ++ /* Now for the arguments. */ ++ ++ for (ptr = cif->arg_types, i = cif->nargs; ++ i > 0; ++ i--, ptr++) ++ { ++ int type = (*ptr)->type; ++ ++ /* Check how a structure type is passed. */ ++ if (type == FFI_TYPE_STRUCT) ++ { ++ type = ffi_check_struct_type (*ptr); ++ ++ /* If we pass the struct via pointer, we must reserve space ++ to copy its data for proper call-by-value semantics. */ ++ if (type == FFI_TYPE_POINTER) ++ struct_size += ROUND_SIZE ((*ptr)->size); ++ } ++ ++ /* Now handle all primitive int/float data types. */ ++ switch (type) ++ { ++ /* The first MAX_FPRARGS floating point arguments ++ go in FPRs, the rest overflow to the stack. */ ++ ++ case FFI_TYPE_DOUBLE: ++ if (n_fpr < MAX_FPRARGS) ++ n_fpr++; ++ else ++ n_ov += sizeof (double) / sizeof (long); ++ break; ++ ++ case FFI_TYPE_FLOAT: ++ if (n_fpr < MAX_FPRARGS) ++ n_fpr++; ++ else ++ n_ov++; ++ break; ++ ++ /* On 31-bit machines, 64-bit integers are passed in GPR pairs, ++ if one is still available, or else on the stack. If only one ++ register is free, skip the register (it won't be used for any ++ subsequent argument either). */ ++ ++#ifndef __s390x__ ++ case FFI_TYPE_UINT64: ++ case FFI_TYPE_SINT64: ++ if (n_gpr == MAX_GPRARGS-1) ++ n_gpr = MAX_GPRARGS; ++ if (n_gpr < MAX_GPRARGS) ++ n_gpr += 2; ++ else ++ n_ov += 2; ++ break; ++#endif ++ ++ /* Everything else is passed in GPRs (until MAX_GPRARGS ++ have been used) or overflows to the stack. */ ++ ++ default: ++ if (n_gpr < MAX_GPRARGS) ++ n_gpr++; ++ else ++ n_ov++; ++ break; ++ } ++ } ++ ++ /* Total stack space as required for overflow arguments ++ and temporary structure copies. */ ++ ++ cif->bytes = ROUND_SIZE (n_ov * sizeof (long)) + struct_size; ++ ++ return FFI_OK; ++} ++ ++/*======================== End of Routine ============================*/ ++ ++/*====================================================================*/ ++/* */ ++/* Name - ffi_call. */ ++/* */ ++/* Function - Call the FFI routine. */ ++/* */ ++/*====================================================================*/ ++ ++void ++ffi_call(ffi_cif *cif, ++ void (*fn)(), ++ void *rvalue, ++ void **avalue) ++{ ++ int ret_type = cif->flags; ++ extended_cif ecif; ++ ++ ecif.cif = cif; ++ ecif.avalue = avalue; ++ ecif.rvalue = rvalue; ++ ++ /* If we don't have a return value, we need to fake one. */ ++ if (rvalue == NULL) ++ { ++ if (ret_type == FFI390_RET_STRUCT) ++ ecif.rvalue = alloca (cif->rtype->size); ++ else ++ ret_type = FFI390_RET_VOID; ++ } ++ ++ switch (cif->abi) ++ { ++ case FFI_SYSV: ++ ffi_call_SYSV (cif->bytes, &ecif, ffi_prep_args, ++ ret_type, ecif.rvalue, fn); ++ break; ++ ++ default: ++ FFI_ASSERT (0); ++ break; ++ } ++} ++ ++/*======================== End of Routine ============================*/ ++ ++/*====================================================================*/ ++/* */ ++/* Name - ffi_closure_helper_SYSV. */ ++/* */ ++/* Function - Call a FFI closure target function. */ ++/* */ ++/*====================================================================*/ ++ ++void ++ffi_closure_helper_SYSV (ffi_closure *closure, ++ unsigned long *p_gpr, ++ unsigned long long *p_fpr, ++ unsigned long *p_ov) ++{ ++ unsigned long long ret_buffer; ++ ++ void *rvalue = &ret_buffer; ++ void **avalue; ++ void **p_arg; ++ ++ int n_gpr = 0; ++ int n_fpr = 0; ++ int n_ov = 0; ++ ++ ffi_type **ptr; ++ int i; ++ ++ /* Allocate buffer for argument list pointers. */ ++ ++ p_arg = avalue = alloca (closure->cif->nargs * sizeof (void *)); ++ ++ /* If we returning a structure, pass the structure address ++ directly to the target function. Otherwise, have the target ++ function store the return value to the GPR save area. */ ++ ++ if (closure->cif->flags == FFI390_RET_STRUCT) ++ rvalue = (void *) p_gpr[n_gpr++]; ++ ++ /* Now for the arguments. */ ++ ++ for (ptr = closure->cif->arg_types, i = closure->cif->nargs; ++ i > 0; ++ i--, p_arg++, ptr++) ++ { ++ int deref_struct_pointer = 0; ++ int type = (*ptr)->type; ++ ++ /* Check how a structure type is passed. */ ++ if (type == FFI_TYPE_STRUCT) ++ { ++ type = ffi_check_struct_type (*ptr); ++ ++ /* If we pass the struct via pointer, remember to ++ retrieve the pointer later. */ ++ if (type == FFI_TYPE_POINTER) ++ deref_struct_pointer = 1; ++ } ++ ++ /* Pointers are passed like UINTs of the same size. */ ++ if (type == FFI_TYPE_POINTER) ++#ifdef __s390x__ ++ type = FFI_TYPE_UINT64; ++#else ++ type = FFI_TYPE_UINT32; ++#endif ++ ++ /* Now handle all primitive int/float data types. */ ++ switch (type) ++ { ++ case FFI_TYPE_DOUBLE: ++ if (n_fpr < MAX_FPRARGS) ++ *p_arg = &p_fpr[n_fpr++]; ++ else ++ *p_arg = &p_ov[n_ov], ++ n_ov += sizeof (double) / sizeof (long); ++ break; ++ ++ case FFI_TYPE_FLOAT: ++ if (n_fpr < MAX_FPRARGS) ++ *p_arg = &p_fpr[n_fpr++]; ++ else ++ *p_arg = (char *)&p_ov[n_ov++] + sizeof (long) - 4; ++ break; ++ ++ case FFI_TYPE_UINT64: ++ case FFI_TYPE_SINT64: ++#ifdef __s390x__ ++ if (n_gpr < MAX_GPRARGS) ++ *p_arg = &p_gpr[n_gpr++]; ++ else ++ *p_arg = &p_ov[n_ov++]; ++#else ++ if (n_gpr == MAX_GPRARGS-1) ++ n_gpr = MAX_GPRARGS; ++ if (n_gpr < MAX_GPRARGS) ++ *p_arg = &p_gpr[n_gpr], n_gpr += 2; ++ else ++ *p_arg = &p_ov[n_ov], n_ov += 2; ++#endif ++ break; ++ ++ case FFI_TYPE_INT: ++ case FFI_TYPE_UINT32: ++ case FFI_TYPE_SINT32: ++ if (n_gpr < MAX_GPRARGS) ++ *p_arg = (char *)&p_gpr[n_gpr++] + sizeof (long) - 4; ++ else ++ *p_arg = (char *)&p_ov[n_ov++] + sizeof (long) - 4; ++ break; ++ ++ case FFI_TYPE_UINT16: ++ case FFI_TYPE_SINT16: ++ if (n_gpr < MAX_GPRARGS) ++ *p_arg = (char *)&p_gpr[n_gpr++] + sizeof (long) - 2; ++ else ++ *p_arg = (char *)&p_ov[n_ov++] + sizeof (long) - 2; ++ break; ++ ++ case FFI_TYPE_UINT8: ++ case FFI_TYPE_SINT8: ++ if (n_gpr < MAX_GPRARGS) ++ *p_arg = (char *)&p_gpr[n_gpr++] + sizeof (long) - 1; ++ else ++ *p_arg = (char *)&p_ov[n_ov++] + sizeof (long) - 1; ++ break; ++ ++ default: ++ FFI_ASSERT (0); ++ break; ++ } ++ ++ /* If this is a struct passed via pointer, we need to ++ actually retrieve that pointer. */ ++ if (deref_struct_pointer) ++ *p_arg = *(void **)*p_arg; ++ } ++ ++ ++ /* Call the target function. */ ++ (closure->fun) (closure->cif, rvalue, avalue, closure->user_data); ++ ++ /* Convert the return value. */ ++ switch (closure->cif->rtype->type) ++ { ++ /* Void is easy, and so is struct. */ ++ case FFI_TYPE_VOID: ++ case FFI_TYPE_STRUCT: ++ break; ++ ++ /* Floating point values are returned in fpr 0. */ ++ case FFI_TYPE_FLOAT: ++ p_fpr[0] = (long long) *(unsigned int *) rvalue << 32; ++ break; ++ ++ case FFI_TYPE_DOUBLE: ++ p_fpr[0] = *(unsigned long long *) rvalue; ++ break; ++ ++ /* Integer values are returned in gpr 2 (and gpr 3 ++ for 64-bit values on 31-bit machines). */ ++ case FFI_TYPE_UINT64: ++ case FFI_TYPE_SINT64: ++#ifdef __s390x__ ++ p_gpr[0] = *(unsigned long *) rvalue; ++#else ++ p_gpr[0] = ((unsigned long *) rvalue)[0], ++ p_gpr[1] = ((unsigned long *) rvalue)[1]; ++#endif ++ break; ++ ++ case FFI_TYPE_POINTER: ++ case FFI_TYPE_UINT32: ++ case FFI_TYPE_UINT16: ++ case FFI_TYPE_UINT8: ++ p_gpr[0] = *(unsigned long *) rvalue; ++ break; ++ ++ case FFI_TYPE_INT: ++ case FFI_TYPE_SINT32: ++ case FFI_TYPE_SINT16: ++ case FFI_TYPE_SINT8: ++ p_gpr[0] = *(signed long *) rvalue; ++ break; ++ ++ default: ++ FFI_ASSERT (0); ++ break; ++ } ++} ++ ++/*======================== End of Routine ============================*/ ++ ++/*====================================================================*/ ++/* */ ++/* Name - ffi_prep_closure. */ ++/* */ ++/* Function - Prepare a FFI closure. */ ++/* */ ++/*====================================================================*/ ++ ++ffi_status ++ffi_prep_closure (ffi_closure *closure, ++ ffi_cif *cif, ++ void (*fun) (ffi_cif *, void *, void **, void *), ++ void *user_data) ++{ ++ FFI_ASSERT (cif->abi == FFI_SYSV); ++ ++#ifndef __s390x__ ++ *(short *)&closure->tramp [0] = 0x0d10; /* basr %r1,0 */ ++ *(short *)&closure->tramp [2] = 0x9801; /* lm %r0,%r1,6(%r1) */ ++ *(short *)&closure->tramp [4] = 0x1006; ++ *(short *)&closure->tramp [6] = 0x07f1; /* br %r1 */ ++ *(long *)&closure->tramp [8] = (long)closure; ++ *(long *)&closure->tramp[12] = (long)&ffi_closure_SYSV; ++#else ++ *(short *)&closure->tramp [0] = 0x0d10; /* basr %r1,0 */ ++ *(short *)&closure->tramp [2] = 0xeb01; /* lmg %r0,%r1,14(%r1) */ ++ *(short *)&closure->tramp [4] = 0x100e; ++ *(short *)&closure->tramp [6] = 0x0004; ++ *(short *)&closure->tramp [8] = 0x07f1; /* br %r1 */ ++ *(long *)&closure->tramp[16] = (long)closure; ++ *(long *)&closure->tramp[24] = (long)&ffi_closure_SYSV; ++#endif ++ ++ closure->cif = cif; ++ closure->user_data = user_data; ++ closure->fun = fun; ++ ++ return FFI_OK; ++} ++ ++/*======================== End of Routine ============================*/ ++ +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/s390/sysv.S gcc/libffi/src/s390/sysv.S +--- gcc-3.2.2.orig/libffi/src/s390/sysv.S Thu Jan 1 09:00:00 1970 ++++ gcc/libffi/src/s390/sysv.S Thu Nov 28 01:44:35 2002 +@@ -0,0 +1,425 @@ ++/* ----------------------------------------------------------------------- ++ sysv.S - Copyright (c) 2000 Software AG ++ ++ S390 Foreign Function Interface ++ ++ Permission is hereby granted, free of charge, to any person obtaining ++ a copy of this software and associated documentation files (the ++ ``Software''), to deal in the Software without restriction, including ++ without limitation the rights to use, copy, modify, merge, publish, ++ distribute, sublicense, and/or sell copies of the Software, and to ++ permit persons to whom the Software is furnished to do so, subject to ++ the following conditions: ++ ++ The above copyright notice and this permission notice shall be included ++ in all copies or substantial portions of the Software. ++ ++ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS ++ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ++ IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR ++ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ++ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ OTHER DEALINGS IN THE SOFTWARE. ++ ----------------------------------------------------------------------- */ ++ ++#ifndef __s390x__ ++ ++.text ++ ++ # r2: cif->bytes ++ # r3: &ecif ++ # r4: ffi_prep_args ++ # r5: ret_type ++ # r6: ecif.rvalue ++ # ov: fn ++ ++ # This assumes we are using gas. ++ .globl ffi_call_SYSV ++ .type ffi_call_SYSV,%function ++ffi_call_SYSV: ++.LFB1: ++ stm %r6,%r15,24(%r15) # Save registers ++.LCFI0: ++ basr %r13,0 # Set up base register ++.Lbase: ++ lr %r11,%r15 # Set up frame pointer ++.LCFI1: ++ sr %r15,%r2 ++ ahi %r15,-96-48 # Allocate stack ++ lr %r8,%r6 # Save ecif.rvalue ++ sr %r9,%r9 ++ ic %r9,.Ltable-.Lbase(%r13,%r5) # Load epilog address ++ l %r7,96(%r11) # Load function address ++ st %r11,0(%r15) # Set up back chain ++ ahi %r11,-48 # Register save area ++.LCFI2: ++ ++ la %r2,96(%r15) # Save area ++ # r3 already holds &ecif ++ basr %r14,%r4 # Call ffi_prep_args ++ ++ lm %r2,%r6,0(%r11) # Load arguments ++ ld %f0,32(%r11) ++ ld %f2,40(%r11) ++ la %r14,0(%r13,%r9) # Set return address ++ br %r7 # ... and call function ++ ++.LretNone: # Return void ++ l %r4,48+56(%r11) ++ lm %r6,%r15,48+24(%r11) ++ br %r4 ++ ++.LretFloat: ++ l %r4,48+56(%r11) ++ ste %f0,0(%r8) # Return float ++ lm %r6,%r15,48+24(%r11) ++ br %r4 ++ ++.LretDouble: ++ l %r4,48+56(%r11) ++ std %f0,0(%r8) # Return double ++ lm %r6,%r15,48+24(%r11) ++ br %r4 ++ ++.LretInt32: ++ l %r4,48+56(%r11) ++ st %r2,0(%r8) # Return int ++ lm %r6,%r15,48+24(%r11) ++ br %r4 ++ ++.LretInt64: ++ l %r4,48+56(%r11) ++ stm %r2,%r3,0(%r8) # Return long long ++ lm %r6,%r15,48+24(%r11) ++ br %r4 ++ ++.Ltable: ++ .byte .LretNone-.Lbase # FFI390_RET_VOID ++ .byte .LretNone-.Lbase # FFI390_RET_STRUCT ++ .byte .LretFloat-.Lbase # FFI390_RET_FLOAT ++ .byte .LretDouble-.Lbase # FFI390_RET_DOUBLE ++ .byte .LretInt32-.Lbase # FFI390_RET_INT32 ++ .byte .LretInt64-.Lbase # FFI390_RET_INT64 ++ ++.LFE1: ++.ffi_call_SYSV_end: ++ .size ffi_call_SYSV,.ffi_call_SYSV_end-ffi_call_SYSV ++ ++ ++ .globl ffi_closure_SYSV ++ .type ffi_closure_SYSV,%function ++ffi_closure_SYSV: ++.LFB2: ++ stm %r12,%r15,48(%r15) # Save registers ++.LCFI10: ++ basr %r13,0 # Set up base register ++.Lcbase: ++ stm %r2,%r6,8(%r15) # Save arguments ++ std %f0,64(%r15) ++ std %f2,72(%r15) ++ lr %r1,%r15 # Set up stack frame ++ ahi %r15,-96 ++.LCFI11: ++ l %r12,.Lchelper-.Lcbase(%r13) # Get helper function ++ lr %r2,%r0 # Closure ++ la %r3,8(%r1) # GPRs ++ la %r4,64(%r1) # FPRs ++ la %r5,96(%r1) # Overflow ++ st %r1,0(%r15) # Set up back chain ++ ++ bas %r14,0(%r12,%r13) # Call helper ++ ++ l %r4,96+56(%r15) ++ ld %f0,96+64(%r15) # Load return registers ++ lm %r2,%r3,96+8(%r15) ++ lm %r12,%r15,96+48(%r15) ++ br %r4 ++ ++ .align 4 ++.Lchelper: ++ .long ffi_closure_helper_SYSV-.Lcbase ++ ++.LFE2: ++ ++.ffi_closure_SYSV_end: ++ .size ffi_closure_SYSV,.ffi_closure_SYSV_end-ffi_closure_SYSV ++ ++ ++ .section .eh_frame,"a",@progbits ++.Lframe1: ++ .4byte .LECIE1-.LSCIE1 # Length of Common Information Entry ++.LSCIE1: ++ .4byte 0x0 # CIE Identifier Tag ++ .byte 0x1 # CIE Version ++ .ascii "zR\0" # CIE Augmentation ++ .uleb128 0x1 # CIE Code Alignment Factor ++ .sleb128 -4 # CIE Data Alignment Factor ++ .byte 0xe # CIE RA Column ++ .uleb128 0x1 # Augmentation size ++ .byte 0x1b # FDE Encoding (pcrel sdata4) ++ .byte 0xc # DW_CFA_def_cfa ++ .uleb128 0xf ++ .uleb128 0x60 ++ .align 4 ++.LECIE1: ++.LSFDE1: ++ .4byte .LEFDE1-.LASFDE1 # FDE Length ++.LASFDE1: ++ .4byte .LASFDE1-.Lframe1 # FDE CIE offset ++ .4byte .LFB1-. # FDE initial location ++ .4byte .LFE1-.LFB1 # FDE address range ++ .uleb128 0x0 # Augmentation size ++ .byte 0x4 # DW_CFA_advance_loc4 ++ .4byte .LCFI0-.LFB1 ++ .byte 0x8f # DW_CFA_offset, column 0xf ++ .uleb128 0x9 ++ .byte 0x8e # DW_CFA_offset, column 0xe ++ .uleb128 0xa ++ .byte 0x8d # DW_CFA_offset, column 0xd ++ .uleb128 0xb ++ .byte 0x8c # DW_CFA_offset, column 0xc ++ .uleb128 0xc ++ .byte 0x8b # DW_CFA_offset, column 0xb ++ .uleb128 0xd ++ .byte 0x8a # DW_CFA_offset, column 0xa ++ .uleb128 0xe ++ .byte 0x89 # DW_CFA_offset, column 0x9 ++ .uleb128 0xf ++ .byte 0x88 # DW_CFA_offset, column 0x8 ++ .uleb128 0x10 ++ .byte 0x87 # DW_CFA_offset, column 0x7 ++ .uleb128 0x11 ++ .byte 0x86 # DW_CFA_offset, column 0x6 ++ .uleb128 0x12 ++ .byte 0x4 # DW_CFA_advance_loc4 ++ .4byte .LCFI1-.LCFI0 ++ .byte 0xd # DW_CFA_def_cfa_register ++ .uleb128 0xb ++ .byte 0x4 # DW_CFA_advance_loc4 ++ .4byte .LCFI2-.LCFI1 ++ .byte 0xe # DW_CFA_def_cfa_offset ++ .uleb128 0x90 ++ .align 4 ++.LEFDE1: ++.LSFDE2: ++ .4byte .LEFDE2-.LASFDE2 # FDE Length ++.LASFDE2: ++ .4byte .LASFDE2-.Lframe1 # FDE CIE offset ++ .4byte .LFB2-. # FDE initial location ++ .4byte .LFE2-.LFB2 # FDE address range ++ .uleb128 0x0 # Augmentation size ++ .byte 0x4 # DW_CFA_advance_loc4 ++ .4byte .LCFI10-.LFB2 ++ .byte 0x8f # DW_CFA_offset, column 0xf ++ .uleb128 0x9 ++ .byte 0x8e # DW_CFA_offset, column 0xe ++ .uleb128 0xa ++ .byte 0x8d # DW_CFA_offset, column 0xd ++ .uleb128 0xb ++ .byte 0x8c # DW_CFA_offset, column 0xc ++ .uleb128 0xc ++ .byte 0x4 # DW_CFA_advance_loc4 ++ .4byte .LCFI11-.LCFI10 ++ .byte 0xe # DW_CFA_def_cfa_offset ++ .uleb128 0xc0 ++ .align 4 ++.LEFDE2: ++ ++#else ++ ++.text ++ ++ # r2: cif->bytes ++ # r3: &ecif ++ # r4: ffi_prep_args ++ # r5: ret_type ++ # r6: ecif.rvalue ++ # ov: fn ++ ++ # This assumes we are using gas. ++ .globl ffi_call_SYSV ++ .type ffi_call_SYSV,%function ++ffi_call_SYSV: ++.LFB1: ++ stmg %r6,%r15,48(%r15) # Save registers ++.LCFI0: ++ larl %r13,.Lbase # Set up base register ++ lgr %r11,%r15 # Set up frame pointer ++.LCFI1: ++ sgr %r15,%r2 ++ aghi %r15,-160-80 # Allocate stack ++ lgr %r8,%r6 # Save ecif.rvalue ++ llgc %r9,.Ltable-.Lbase(%r13,%r5) # Load epilog address ++ lg %r7,160(%r11) # Load function address ++ stg %r11,0(%r15) # Set up back chain ++ aghi %r11,-80 # Register save area ++.LCFI2: ++ ++ la %r2,160(%r15) # Save area ++ # r3 already holds &ecif ++ basr %r14,%r4 # Call ffi_prep_args ++ ++ lmg %r2,%r6,0(%r11) # Load arguments ++ ld %f0,48(%r11) ++ ld %f2,56(%r11) ++ ld %f4,64(%r11) ++ ld %f6,72(%r11) ++ la %r14,0(%r13,%r9) # Set return address ++ br %r7 # ... and call function ++ ++.Lbase: ++.LretNone: # Return void ++ lg %r4,80+112(%r11) ++ lmg %r6,%r15,80+48(%r11) ++ br %r4 ++ ++.LretFloat: ++ lg %r4,80+112(%r11) ++ ste %f0,0(%r8) # Return float ++ lmg %r6,%r15,80+48(%r11) ++ br %r4 ++ ++.LretDouble: ++ lg %r4,80+112(%r11) ++ std %f0,0(%r8) # Return double ++ lmg %r6,%r15,80+48(%r11) ++ br %r4 ++ ++.LretInt32: ++ lg %r4,80+112(%r11) ++ st %r2,0(%r8) # Return int ++ lmg %r6,%r15,80+48(%r11) ++ br %r4 ++ ++.LretInt64: ++ lg %r4,80+112(%r11) ++ stg %r2,0(%r8) # Return long ++ lmg %r6,%r15,80+48(%r11) ++ br %r4 ++ ++.Ltable: ++ .byte .LretNone-.Lbase # FFI390_RET_VOID ++ .byte .LretNone-.Lbase # FFI390_RET_STRUCT ++ .byte .LretFloat-.Lbase # FFI390_RET_FLOAT ++ .byte .LretDouble-.Lbase # FFI390_RET_DOUBLE ++ .byte .LretInt32-.Lbase # FFI390_RET_INT32 ++ .byte .LretInt64-.Lbase # FFI390_RET_INT64 ++ ++.LFE1: ++.ffi_call_SYSV_end: ++ .size ffi_call_SYSV,.ffi_call_SYSV_end-ffi_call_SYSV ++ ++ ++ .globl ffi_closure_SYSV ++ .type ffi_closure_SYSV,%function ++ffi_closure_SYSV: ++.LFB2: ++ stmg %r14,%r15,112(%r15) # Save registers ++.LCFI10: ++ stmg %r2,%r6,16(%r15) # Save arguments ++ std %f0,128(%r15) ++ std %f2,136(%r15) ++ std %f4,144(%r15) ++ std %f6,152(%r15) ++ lgr %r1,%r15 # Set up stack frame ++ aghi %r15,-160 ++.LCFI11: ++ lgr %r2,%r0 # Closure ++ la %r3,16(%r1) # GPRs ++ la %r4,128(%r1) # FPRs ++ la %r5,160(%r1) # Overflow ++ stg %r1,0(%r15) # Set up back chain ++ ++ brasl %r14,ffi_closure_helper_SYSV # Call helper ++ ++ lg %r14,160+112(%r15) ++ ld %f0,160+128(%r15) # Load return registers ++ lg %r2,160+16(%r15) ++ la %r15,160(%r15) ++ br %r14 ++.LFE2: ++ ++.ffi_closure_SYSV_end: ++ .size ffi_closure_SYSV,.ffi_closure_SYSV_end-ffi_closure_SYSV ++ ++ ++ ++ .section .eh_frame,"a",@progbits ++.Lframe1: ++ .4byte .LECIE1-.LSCIE1 # Length of Common Information Entry ++.LSCIE1: ++ .4byte 0x0 # CIE Identifier Tag ++ .byte 0x1 # CIE Version ++ .ascii "zR\0" # CIE Augmentation ++ .uleb128 0x1 # CIE Code Alignment Factor ++ .sleb128 -8 # CIE Data Alignment Factor ++ .byte 0xe # CIE RA Column ++ .uleb128 0x1 # Augmentation size ++ .byte 0x1b # FDE Encoding (pcrel sdata4) ++ .byte 0xc # DW_CFA_def_cfa ++ .uleb128 0xf ++ .uleb128 0xa0 ++ .align 8 ++.LECIE1: ++.LSFDE1: ++ .4byte .LEFDE1-.LASFDE1 # FDE Length ++.LASFDE1: ++ .4byte .LASFDE1-.Lframe1 # FDE CIE offset ++ .4byte .LFB1-. # FDE initial location ++ .4byte .LFE1-.LFB1 # FDE address range ++ .uleb128 0x0 # Augmentation size ++ .byte 0x4 # DW_CFA_advance_loc4 ++ .4byte .LCFI0-.LFB1 ++ .byte 0x8f # DW_CFA_offset, column 0xf ++ .uleb128 0x5 ++ .byte 0x8e # DW_CFA_offset, column 0xe ++ .uleb128 0x6 ++ .byte 0x8d # DW_CFA_offset, column 0xd ++ .uleb128 0x7 ++ .byte 0x8c # DW_CFA_offset, column 0xc ++ .uleb128 0x8 ++ .byte 0x8b # DW_CFA_offset, column 0xb ++ .uleb128 0x9 ++ .byte 0x8a # DW_CFA_offset, column 0xa ++ .uleb128 0xa ++ .byte 0x89 # DW_CFA_offset, column 0x9 ++ .uleb128 0xb ++ .byte 0x88 # DW_CFA_offset, column 0x8 ++ .uleb128 0xc ++ .byte 0x87 # DW_CFA_offset, column 0x7 ++ .uleb128 0xd ++ .byte 0x86 # DW_CFA_offset, column 0x6 ++ .uleb128 0xe ++ .byte 0x4 # DW_CFA_advance_loc4 ++ .4byte .LCFI1-.LCFI0 ++ .byte 0xd # DW_CFA_def_cfa_register ++ .uleb128 0xb ++ .byte 0x4 # DW_CFA_advance_loc4 ++ .4byte .LCFI2-.LCFI1 ++ .byte 0xe # DW_CFA_def_cfa_offset ++ .uleb128 0xf0 ++ .align 8 ++.LEFDE1: ++.LSFDE2: ++ .4byte .LEFDE2-.LASFDE2 # FDE Length ++.LASFDE2: ++ .4byte .LASFDE2-.Lframe1 # FDE CIE offset ++ .4byte .LFB2-. # FDE initial location ++ .4byte .LFE2-.LFB2 # FDE address range ++ .uleb128 0x0 # Augmentation size ++ .byte 0x4 # DW_CFA_advance_loc4 ++ .4byte .LCFI10-.LFB2 ++ .byte 0x8f # DW_CFA_offset, column 0xf ++ .uleb128 0x5 ++ .byte 0x8e # DW_CFA_offset, column 0xe ++ .uleb128 0x6 ++ .byte 0x4 # DW_CFA_advance_loc4 ++ .4byte .LCFI11-.LCFI10 ++ .byte 0xe # DW_CFA_def_cfa_offset ++ .uleb128 0x140 ++ .align 8 ++.LEFDE2: ++ ++#endif ++ +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/sh/ffi.c gcc/libffi/src/sh/ffi.c +--- gcc-3.2.2.orig/libffi/src/sh/ffi.c Thu Jan 1 09:00:00 1970 ++++ gcc/libffi/src/sh/ffi.c Fri Jul 19 10:08:43 2002 +@@ -0,0 +1,722 @@ ++/* ----------------------------------------------------------------------- ++ ffi.c - Copyright (c) 2002 Kaz Kojima ++ ++ SuperH Foreign Function Interface ++ ++ Permission is hereby granted, free of charge, to any person obtaining ++ a copy of this software and associated documentation files (the ++ ``Software''), to deal in the Software without restriction, including ++ without limitation the rights to use, copy, modify, merge, publish, ++ distribute, sublicense, and/or sell copies of the Software, and to ++ permit persons to whom the Software is furnished to do so, subject to ++ the following conditions: ++ ++ The above copyright notice and this permission notice shall be included ++ in all copies or substantial portions of the Software. ++ ++ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS ++ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ++ IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR ++ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ++ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ OTHER DEALINGS IN THE SOFTWARE. ++ ----------------------------------------------------------------------- */ ++ ++#include ++#include ++ ++#include ++ ++#define NGREGARG 4 ++#if defined(__SH4__) ++#define NFREGARG 8 ++#endif ++ ++#if defined(__HITACHI__) ++#define STRUCT_VALUE_ADDRESS_WITH_ARG 1 ++#else ++#define STRUCT_VALUE_ADDRESS_WITH_ARG 0 ++#endif ++ ++/* If the structure has essentialy an unique element, return its type. */ ++static int ++simple_type (ffi_type *arg) ++{ ++ if (arg->type != FFI_TYPE_STRUCT) ++ return arg->type; ++ else if (arg->elements[1]) ++ return FFI_TYPE_STRUCT; ++ ++ return simple_type (arg->elements[0]); ++} ++ ++static int ++return_type (ffi_type *arg) ++{ ++ unsigned short type; ++ ++ if (arg->type != FFI_TYPE_STRUCT) ++ return arg->type; ++ ++ type = simple_type (arg->elements[0]); ++ if (! arg->elements[1]) ++ { ++ switch (type) ++ { ++ case FFI_TYPE_SINT8: ++ case FFI_TYPE_UINT8: ++ case FFI_TYPE_SINT16: ++ case FFI_TYPE_UINT16: ++ case FFI_TYPE_SINT32: ++ case FFI_TYPE_UINT32: ++ return FFI_TYPE_INT; ++ ++ default: ++ return type; ++ } ++ } ++ ++ /* gcc uses r0/r1 pair for some kind of structures. */ ++ if (arg->size <= 2 * sizeof (int)) ++ { ++ int i = 0; ++ ffi_type *e; ++ ++ while ((e = arg->elements[i++])) ++ { ++ type = simple_type (e); ++ switch (type) ++ { ++ case FFI_TYPE_SINT32: ++ case FFI_TYPE_UINT32: ++ case FFI_TYPE_INT: ++ case FFI_TYPE_FLOAT: ++ return FFI_TYPE_UINT64; ++ ++ default: ++ break; ++ } ++ } ++ } ++ ++ return FFI_TYPE_STRUCT; ++} ++ ++/* ffi_prep_args is called by the assembly routine once stack space ++ has been allocated for the function's arguments */ ++ ++/*@-exportheader@*/ ++void ffi_prep_args(char *stack, extended_cif *ecif) ++/*@=exportheader@*/ ++{ ++ register unsigned int i; ++ register int tmp; ++ register unsigned int avn; ++ register void **p_argv; ++ register char *argp; ++ register ffi_type **p_arg; ++ int greg, ireg; ++#if defined(__SH4__) ++ int freg = 0; ++#endif ++ ++ tmp = 0; ++ argp = stack; ++ ++ if (return_type (ecif->cif->rtype) == FFI_TYPE_STRUCT) ++ { ++ *(void **) argp = ecif->rvalue; ++ argp += 4; ++ ireg = STRUCT_VALUE_ADDRESS_WITH_ARG ? 1 : 0; ++ } ++ else ++ ireg = 0; ++ ++ /* Set arguments for registers. */ ++ greg = ireg; ++ avn = ecif->cif->nargs; ++ p_argv = ecif->avalue; ++ ++ for (i = 0, p_arg = ecif->cif->arg_types; i < avn; i++, p_arg++, p_argv++) ++ { ++ size_t z; ++ ++ z = (*p_arg)->size; ++ if (z < sizeof(int)) ++ { ++ if (greg++ >= NGREGARG) ++ continue; ++ ++ z = sizeof(int); ++ switch ((*p_arg)->type) ++ { ++ case FFI_TYPE_SINT8: ++ *(signed int *) argp = (signed int)*(SINT8 *)(* p_argv); ++ break; ++ ++ case FFI_TYPE_UINT8: ++ *(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv); ++ break; ++ ++ case FFI_TYPE_SINT16: ++ *(signed int *) argp = (signed int)*(SINT16 *)(* p_argv); ++ break; ++ ++ case FFI_TYPE_UINT16: ++ *(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv); ++ break; ++ ++ case FFI_TYPE_STRUCT: ++ *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); ++ break; ++ ++ default: ++ FFI_ASSERT(0); ++ } ++ argp += z; ++ } ++ else if (z == sizeof(int)) ++ { ++#if defined(__SH4__) ++ if ((*p_arg)->type == FFI_TYPE_FLOAT) ++ { ++ if (freg++ >= NFREGARG) ++ continue; ++ } ++ else ++#endif ++ { ++ if (greg++ >= NGREGARG) ++ continue; ++ } ++ *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); ++ argp += z; ++ } ++#if defined(__SH4__) ++ else if ((*p_arg)->type == FFI_TYPE_DOUBLE) ++ { ++ if (freg + 1 >= NFREGARG) ++ continue; ++ freg = (freg + 1) & ~1; ++ freg += 2; ++ memcpy (argp, *p_argv, z); ++ argp += z; ++ } ++#endif ++ else ++ { ++ int n = (z + sizeof (int) - 1) / sizeof (int); ++#if defined(__SH4__) ++ if (greg + n - 1 >= NGREGARG) ++ continue; ++ greg += n; ++#else ++ if (greg >= NGREGARG) ++ continue; ++ else if (greg + n - 1 >= NGREGARG) ++ greg = NGREGARG; ++ else ++ greg += n; ++#endif ++ memcpy (argp, *p_argv, z); ++ argp += z; ++ } ++ } ++ ++ /* Set arguments on stack. */ ++ greg = ireg; ++#if defined(__SH4__) ++ freg = 0; ++#endif ++ p_argv = ecif->avalue; ++ ++ for (i = 0, p_arg = ecif->cif->arg_types; i < avn; i++, p_arg++, p_argv++) ++ { ++ size_t z; ++ ++ z = (*p_arg)->size; ++ if (z < sizeof(int)) ++ { ++ if (greg++ < NGREGARG) ++ continue; ++ ++ z = sizeof(int); ++ switch ((*p_arg)->type) ++ { ++ case FFI_TYPE_SINT8: ++ *(signed int *) argp = (signed int)*(SINT8 *)(* p_argv); ++ break; ++ ++ case FFI_TYPE_UINT8: ++ *(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv); ++ break; ++ ++ case FFI_TYPE_SINT16: ++ *(signed int *) argp = (signed int)*(SINT16 *)(* p_argv); ++ break; ++ ++ case FFI_TYPE_UINT16: ++ *(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv); ++ break; ++ ++ case FFI_TYPE_STRUCT: ++ *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); ++ break; ++ ++ default: ++ FFI_ASSERT(0); ++ } ++ argp += z; ++ } ++ else if (z == sizeof(int)) ++ { ++#if defined(__SH4__) ++ if ((*p_arg)->type == FFI_TYPE_FLOAT) ++ { ++ if (freg++ < NFREGARG) ++ continue; ++ } ++ else ++#endif ++ { ++ if (greg++ < NGREGARG) ++ continue; ++ } ++ *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); ++ argp += z; ++ } ++#if defined(__SH4__) ++ else if ((*p_arg)->type == FFI_TYPE_DOUBLE) ++ { ++ if (freg + 1 < NFREGARG) ++ { ++ freg = (freg + 1) & ~1; ++ freg += 2; ++ continue; ++ } ++ memcpy (argp, *p_argv, z); ++ argp += z; ++ } ++#endif ++ else ++ { ++ int n = (z + sizeof (int) - 1) / sizeof (int); ++ if (greg + n - 1 < NGREGARG) ++ { ++ greg += n; ++ continue; ++ } ++#if (! defined(__SH4__)) ++ else if (greg < NGREGARG) ++ { ++ greg = NGREGARG; ++ continue; ++ } ++#endif ++ memcpy (argp, *p_argv, z); ++ argp += z; ++ } ++ } ++ ++ return; ++} ++ ++/* Perform machine dependent cif processing */ ++ffi_status ffi_prep_cif_machdep(ffi_cif *cif) ++{ ++ int i, j; ++ int size, type; ++ int n, m; ++ int greg; ++#if defined(__SH4__) ++ int freg = 0; ++#endif ++ ++ cif->flags = 0; ++ ++ greg = ((return_type (cif->rtype) == FFI_TYPE_STRUCT) && ++ STRUCT_VALUE_ADDRESS_WITH_ARG) ? 1 : 0; ++ ++#if defined(__SH4__) ++ for (i = j = 0; i < cif->nargs && j < 12; i++) ++ { ++ type = (cif->arg_types)[i]->type; ++ switch (type) ++ { ++ case FFI_TYPE_FLOAT: ++ if (freg >= NFREGARG) ++ continue; ++ freg++; ++ cif->flags += ((cif->arg_types)[i]->type) << (2 * j); ++ j++; ++ break; ++ ++ case FFI_TYPE_DOUBLE: ++ if ((freg + 1) >= NFREGARG) ++ continue; ++ freg = (freg + 1) & ~1; ++ freg += 2; ++ cif->flags += ((cif->arg_types)[i]->type) << (2 * j); ++ j++; ++ break; ++ ++ default: ++ size = (cif->arg_types)[i]->size; ++ n = (size + sizeof (int) - 1) / sizeof (int); ++ if (greg + n - 1 >= NGREGARG) ++ continue; ++ greg += n; ++ for (m = 0; m < n; m++) ++ cif->flags += FFI_TYPE_INT << (2 * j++); ++ break; ++ } ++ } ++#else ++ for (i = j = 0; i < cif->nargs && j < 4; i++) ++ { ++ size = (cif->arg_types)[i]->size; ++ n = (size + sizeof (int) - 1) / sizeof (int); ++ if (greg >= NGREGARG) ++ continue; ++ else if (greg + n - 1 >= NGREGARG) ++ greg = NGREGARG; ++ else ++ greg += n; ++ for (m = 0; m < n; m++) ++ cif->flags += FFI_TYPE_INT << (2 * j++); ++ } ++#endif ++ ++ /* Set the return type flag */ ++ switch (cif->rtype->type) ++ { ++ case FFI_TYPE_STRUCT: ++ cif->flags += (unsigned) (return_type (cif->rtype)) << 24; ++ break; ++ ++ case FFI_TYPE_VOID: ++ case FFI_TYPE_FLOAT: ++ case FFI_TYPE_DOUBLE: ++ case FFI_TYPE_SINT64: ++ case FFI_TYPE_UINT64: ++ cif->flags += (unsigned) cif->rtype->type << 24; ++ break; ++ ++ default: ++ cif->flags += FFI_TYPE_INT << 24; ++ break; ++ } ++ ++ return FFI_OK; ++} ++ ++/*@-declundef@*/ ++/*@-exportheader@*/ ++extern void ffi_call_SYSV(void (*)(char *, extended_cif *), ++ /*@out@*/ extended_cif *, ++ unsigned, unsigned, ++ /*@out@*/ unsigned *, ++ void (*fn)()); ++/*@=declundef@*/ ++/*@=exportheader@*/ ++ ++void ffi_call(/*@dependent@*/ ffi_cif *cif, ++ void (*fn)(), ++ /*@out@*/ void *rvalue, ++ /*@dependent@*/ void **avalue) ++{ ++ extended_cif ecif; ++ ++ ecif.cif = cif; ++ ecif.avalue = avalue; ++ ++ /* If the return value is a struct and we don't have a return */ ++ /* value address then we need to make one */ ++ ++ if ((rvalue == NULL) && ++ (cif->rtype->type == FFI_TYPE_STRUCT)) ++ { ++ /*@-sysunrecog@*/ ++ ecif.rvalue = alloca(cif->rtype->size); ++ /*@=sysunrecog@*/ ++ } ++ else ++ ecif.rvalue = rvalue; ++ ++ ++ switch (cif->abi) ++ { ++ case FFI_SYSV: ++ /*@-usedef@*/ ++ ffi_call_SYSV(ffi_prep_args, &ecif, cif->bytes, ++ cif->flags, ecif.rvalue, fn); ++ /*@=usedef@*/ ++ break; ++ default: ++ FFI_ASSERT(0); ++ break; ++ } ++} ++ ++extern void ffi_closure_SYSV (void); ++#if defined(__SH4__) ++extern void __ic_invalidate (void *line); ++#endif ++ ++ffi_status ++ffi_prep_closure (ffi_closure* closure, ++ ffi_cif* cif, ++ void (*fun)(ffi_cif*, void*, void**, void*), ++ void *user_data) ++{ ++ unsigned int *tramp; ++ ++ FFI_ASSERT (cif->abi == FFI_GCC_SYSV); ++ ++ tramp = (unsigned int *) &closure->tramp[0]; ++#ifdef __LITTLE_ENDIAN__ ++ tramp[0] = 0xd301d202; ++ tramp[1] = 0x0009422b; ++#else ++ tramp[0] = 0xd202d301; ++ tramp[1] = 0x422b0009; ++#endif ++ *(void **) &tramp[2] = (void *)closure; /* ctx */ ++ *(void **) &tramp[3] = (void *)ffi_closure_SYSV; /* funaddr */ ++ ++ closure->cif = cif; ++ closure->fun = fun; ++ closure->user_data = user_data; ++ ++#if defined(__SH4__) ++ /* Flush the icache. */ ++ __ic_invalidate(&closure->tramp[0]); ++#endif ++ ++ return FFI_OK; ++} ++ ++/* Basically the trampoline invokes ffi_closure_SYSV, and on ++ * entry, r3 holds the address of the closure. ++ * After storing the registers that could possibly contain ++ * parameters to be passed into the stack frame and setting ++ * up space for a return value, ffi_closure_SYSV invokes the ++ * following helper function to do most of the work. ++ */ ++ ++#ifdef __LITTLE_ENDIAN__ ++#define OFS_INT8 0 ++#define OFS_INT16 2 ++#else ++#define OFS_INT8 3 ++#define OFS_INT16 2 ++#endif ++ ++int ++ffi_closure_helper_SYSV (ffi_closure *closure, void *rvalue, ++ unsigned long *pgr, unsigned long *pfr, ++ unsigned long *pst) ++{ ++ void **avalue; ++ ffi_type **p_arg; ++ int i, avn; ++ int ireg, greg = 0; ++#if defined(__SH4__) ++ int freg = 0; ++#endif ++ ffi_cif *cif; ++ double temp; ++ ++ cif = closure->cif; ++ avalue = alloca(cif->nargs * sizeof(void *)); ++ ++ /* Copy the caller's structure return value address so that the closure ++ returns the data directly to the caller. */ ++ if (cif->rtype->type == FFI_TYPE_STRUCT) ++ { ++ rvalue = *pgr++; ++ ireg = STRUCT_VALUE_ADDRESS_WITH_ARG ? 1 : 0; ++ } ++ else ++ ireg = 0; ++ ++ cif = closure->cif; ++ greg = ireg; ++ avn = cif->nargs; ++ ++ /* Grab the addresses of the arguments from the stack frame. */ ++ for (i = 0, p_arg = cif->arg_types; i < avn; i++, p_arg++) ++ { ++ size_t z; ++ ++ z = (*p_arg)->size; ++ if (z < sizeof(int)) ++ { ++ if (greg++ >= NGREGARG) ++ continue; ++ ++ z = sizeof(int); ++ switch ((*p_arg)->type) ++ { ++ case FFI_TYPE_SINT8: ++ case FFI_TYPE_UINT8: ++ avalue[i] = (((char *)pgr) + OFS_INT8); ++ break; ++ ++ case FFI_TYPE_SINT16: ++ case FFI_TYPE_UINT16: ++ avalue[i] = (((char *)pgr) + OFS_INT16); ++ break; ++ ++ case FFI_TYPE_STRUCT: ++ avalue[i] = pgr; ++ break; ++ ++ default: ++ FFI_ASSERT(0); ++ } ++ pgr++; ++ } ++ else if (z == sizeof(int)) ++ { ++#if defined(__SH4__) ++ if ((*p_arg)->type == FFI_TYPE_FLOAT) ++ { ++ if (freg++ >= NFREGARG) ++ continue; ++ avalue[i] = pfr; ++ pfr++; ++ } ++ else ++#endif ++ { ++ if (greg++ >= NGREGARG) ++ continue; ++ avalue[i] = pgr; ++ pgr++; ++ } ++ } ++#if defined(__SH4__) ++ else if ((*p_arg)->type == FFI_TYPE_DOUBLE) ++ { ++ if (freg + 1 >= NFREGARG) ++ continue; ++ freg = (freg + 1) & ~1; ++ freg += 2; ++ avalue[i] = pfr; ++ pfr += 2; ++ } ++#endif ++ else ++ { ++ int n = (z + sizeof (int) - 1) / sizeof (int); ++#if defined(__SH4__) ++ if (greg + n - 1 >= NGREGARG) ++ continue; ++ greg += n; ++#else ++ if (greg >= NGREGARG) ++ continue; ++ else if (greg + n - 1 >= NGREGARG) ++ greg = NGREGARG; ++ else ++ greg += n; ++#endif ++ avalue[i] = pgr; ++ pgr += n; ++ } ++ } ++ ++ greg = ireg; ++#if defined(__SH4__) ++ freg = 0; ++#endif ++ ++ for (i = 0, p_arg = cif->arg_types; i < avn; i++, p_arg++) ++ { ++ size_t z; ++ ++ z = (*p_arg)->size; ++ if (z < sizeof(int)) ++ { ++ if (greg++ < NGREGARG) ++ continue; ++ ++ z = sizeof(int); ++ switch ((*p_arg)->type) ++ { ++ case FFI_TYPE_SINT8: ++ case FFI_TYPE_UINT8: ++ avalue[i] = (((char *)pst) + OFS_INT8); ++ break; ++ ++ case FFI_TYPE_SINT16: ++ case FFI_TYPE_UINT16: ++ avalue[i] = (((char *)pst) + OFS_INT16); ++ break; ++ ++ case FFI_TYPE_STRUCT: ++ avalue[i] = pst; ++ break; ++ ++ default: ++ FFI_ASSERT(0); ++ } ++ pst++; ++ } ++ else if (z == sizeof(int)) ++ { ++#if defined(__SH4__) ++ if ((*p_arg)->type == FFI_TYPE_FLOAT) ++ { ++ if (freg++ < NFREGARG) ++ continue; ++ } ++ else ++#endif ++ { ++ if (greg++ < NGREGARG) ++ continue; ++ } ++ avalue[i] = pst; ++ pst++; ++ } ++#if defined(__SH4__) ++ else if ((*p_arg)->type == FFI_TYPE_DOUBLE) ++ { ++ if (freg + 1 < NFREGARG) ++ { ++ freg = (freg + 1) & ~1; ++ freg += 2; ++ continue; ++ } ++ avalue[i] = pst; ++ pst += 2; ++ } ++#endif ++ else ++ { ++ int n = (z + sizeof (int) - 1) / sizeof (int); ++ if (greg + n - 1 < NGREGARG) ++ { ++ greg += n; ++ continue; ++ } ++#if (! defined(__SH4__)) ++ else if (greg < NGREGARG) ++ { ++ greg = NGREGARG; ++ continue; ++ } ++#endif ++ avalue[i] = pst; ++ pst += n; ++ } ++ } ++ ++ (closure->fun) (cif, rvalue, avalue, closure->user_data); ++ ++ /* Tell ffi_closure_osf how to perform return type promotions. */ ++ return cif->rtype->type; ++} +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/sh/sysv.S gcc/libffi/src/sh/sysv.S +--- gcc-3.2.2.orig/libffi/src/sh/sysv.S Thu Jan 1 09:00:00 1970 ++++ gcc/libffi/src/sh/sysv.S Tue Dec 17 03:22:48 2002 +@@ -0,0 +1,773 @@ ++/* ----------------------------------------------------------------------- ++ sysv.S - Copyright (c) 2002 Kaz Kojima ++ ++ SuperH Foreign Function Interface ++ ++ Permission is hereby granted, free of charge, to any person obtaining ++ a copy of this software and associated documentation files (the ++ ``Software''), to deal in the Software without restriction, including ++ without limitation the rights to use, copy, modify, merge, publish, ++ distribute, sublicense, and/or sell copies of the Software, and to ++ permit persons to whom the Software is furnished to do so, subject to ++ the following conditions: ++ ++ The above copyright notice and this permission notice shall be included ++ in all copies or substantial portions of the Software. ++ ++ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS ++ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ++ IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR ++ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ++ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ OTHER DEALINGS IN THE SOFTWARE. ++ ----------------------------------------------------------------------- */ ++ ++#define LIBFFI_ASM ++#include ++#ifdef HAVE_MACHINE_ASM_H ++#include ++#else ++/* XXX these lose for some platforms, I'm sure. */ ++#define CNAME(x) x ++#define ENTRY(x) .globl CNAME(x); .type CNAME(x),%function; CNAME(x): ++#endif ++ ++#if defined(__HITACHI__) ++#define STRUCT_VALUE_ADDRESS_WITH_ARG 1 ++#else ++#define STRUCT_VALUE_ADDRESS_WITH_ARG 0 ++#endif ++ ++.text ++ ++ # r4: ffi_prep_args ++ # r5: &ecif ++ # r6: bytes ++ # r7: flags ++ # sp+0: rvalue ++ # sp+4: fn ++ ++ # This assumes we are using gas. ++ENTRY(ffi_call_SYSV) ++ # Save registers ++.LFB1: ++ mov.l r8,@-r15 ++.LCFI0: ++ mov.l r9,@-r15 ++.LCFI1: ++ mov.l r10,@-r15 ++.LCFI2: ++ mov.l r12,@-r15 ++.LCFI3: ++ mov.l r14,@-r15 ++.LCFI4: ++ sts.l pr,@-r15 ++.LCFI5: ++ mov r15,r14 ++.LCFI6: ++#if defined(__SH4__) ++ mov r6,r8 ++ mov r7,r9 ++ ++ sub r6,r15 ++ add #-16,r15 ++ mov #~7,r0 ++ and r0,r15 ++ ++ mov r4,r0 ++ jsr @r0 ++ mov r15,r4 ++ ++ mov r9,r1 ++ shlr8 r9 ++ shlr8 r9 ++ shlr8 r9 ++ ++ mov #FFI_TYPE_STRUCT,r2 ++ cmp/eq r2,r9 ++ bf 1f ++#if STRUCT_VALUE_ADDRESS_WITH_ARG ++ mov.l @r15+,r4 ++ bra 2f ++ mov #5,r2 ++#else ++ mov.l @r15+,r10 ++#endif ++1: ++ mov #4,r2 ++2: ++ mov #4,r3 ++ ++L_pass: ++ cmp/pl r8 ++ bf L_call_it ++ ++ mov r1,r0 ++ and #3,r0 ++ ++L_pass_d: ++ cmp/eq #FFI_TYPE_DOUBLE,r0 ++ bf L_pass_f ++ ++ mov r3,r0 ++ and #1,r0 ++ tst r0,r0 ++ bt 1f ++ add #1,r3 ++1: ++ mov r15,r0 ++ and #7,r0 ++ tst r0,r0 ++ bt 2f ++ add #4,r15 ++2: ++ mov #12,r0 ++ cmp/hs r0,r3 ++ bt/s 3f ++ shlr2 r1 ++ bsr L_pop_d ++ nop ++3: ++ add #2,r3 ++ bra L_pass ++ add #-8,r8 ++ ++L_pop_d: ++ mov r3,r0 ++ add r0,r0 ++ add r3,r0 ++ add #-12,r0 ++ braf r0 ++ nop ++#ifdef __LITTLE_ENDIAN__ ++ fmov.s @r15+,fr5 ++ rts ++ fmov.s @r15+,fr4 ++ fmov.s @r15+,fr7 ++ rts ++ fmov.s @r15+,fr6 ++ fmov.s @r15+,fr9 ++ rts ++ fmov.s @r15+,fr8 ++ fmov.s @r15+,fr11 ++ rts ++ fmov.s @r15+,fr10 ++#else ++ fmov.s @r15+,fr4 ++ rts ++ fmov.s @r15+,fr5 ++ fmov.s @r15+,fr6 ++ rts ++ fmov.s @r15+,fr7 ++ fmov.s @r15+,fr8 ++ rts ++ fmov.s @r15+,fr9 ++ fmov.s @r15+,fr10 ++ rts ++ fmov.s @r15+,fr11 ++#endif ++ ++L_pass_f: ++ cmp/eq #FFI_TYPE_FLOAT,r0 ++ bf L_pass_i ++ ++ mov #12,r0 ++ cmp/hs r0,r3 ++ bt/s 2f ++ shlr2 r1 ++ bsr L_pop_f ++ nop ++2: ++ add #1,r3 ++ bra L_pass ++ add #-4,r8 ++ ++L_pop_f: ++ mov r3,r0 ++ shll2 r0 ++ add #-16,r0 ++ braf r0 ++ nop ++#ifdef __LITTLE_ENDIAN__ ++ rts ++ fmov.s @r15+,fr5 ++ rts ++ fmov.s @r15+,fr4 ++ rts ++ fmov.s @r15+,fr7 ++ rts ++ fmov.s @r15+,fr6 ++ rts ++ fmov.s @r15+,fr9 ++ rts ++ fmov.s @r15+,fr8 ++ rts ++ fmov.s @r15+,fr11 ++ rts ++ fmov.s @r15+,fr10 ++#else ++ rts ++ fmov.s @r15+,fr4 ++ rts ++ fmov.s @r15+,fr5 ++ rts ++ fmov.s @r15+,fr6 ++ rts ++ fmov.s @r15+,fr7 ++ rts ++ fmov.s @r15+,fr8 ++ rts ++ fmov.s @r15+,fr9 ++ rts ++ fmov.s @r15+,fr10 ++ rts ++ fmov.s @r15+,fr11 ++#endif ++ ++L_pass_i: ++ cmp/eq #FFI_TYPE_INT,r0 ++ bf L_call_it ++ ++ mov #8,r0 ++ cmp/hs r0,r2 ++ bt/s 2f ++ shlr2 r1 ++ bsr L_pop_i ++ nop ++2: ++ add #1,r2 ++ bra L_pass ++ add #-4,r8 ++ ++L_pop_i: ++ mov r2,r0 ++ shll2 r0 ++ add #-16,r0 ++ braf r0 ++ nop ++ rts ++ mov.l @r15+,r4 ++ rts ++ mov.l @r15+,r5 ++ rts ++ mov.l @r15+,r6 ++ rts ++ mov.l @r15+,r7 ++ ++L_call_it: ++ # call function ++#if (! STRUCT_VALUE_ADDRESS_WITH_ARG) ++ mov r10, r2 ++#endif ++ mov.l @(28,r14),r1 ++ jsr @r1 ++ nop ++ ++L_ret_d: ++ mov #FFI_TYPE_DOUBLE,r2 ++ cmp/eq r2,r9 ++ bf L_ret_ll ++ ++ mov.l @(24,r14),r1 ++#ifdef __LITTLE_ENDIAN__ ++ fmov.s fr1,@r1 ++ add #4,r1 ++ bra L_epilogue ++ fmov.s fr0,@r1 ++#else ++ fmov.s fr0,@r1 ++ add #4,r1 ++ bra L_epilogue ++ fmov.s fr1,@r1 ++#endif ++ ++L_ret_ll: ++ mov #FFI_TYPE_SINT64,r2 ++ cmp/eq r2,r9 ++ bt/s 1f ++ mov #FFI_TYPE_UINT64,r2 ++ cmp/eq r2,r9 ++ bf L_ret_f ++ ++1: ++ mov.l @(24,r14),r2 ++ mov.l r0,@r2 ++ bra L_epilogue ++ mov.l r1,@(4,r2) ++ ++L_ret_f: ++ mov #FFI_TYPE_FLOAT,r2 ++ cmp/eq r2,r9 ++ bf L_ret_i ++ ++ mov.l @(24,r14),r1 ++ bra L_epilogue ++ fmov.s fr0,@r1 ++ ++L_ret_i: ++ mov #FFI_TYPE_INT,r2 ++ cmp/eq r2,r9 ++ bf L_epilogue ++ ++ mov.l @(24,r14),r1 ++ bra L_epilogue ++ mov.l r0,@r1 ++ ++L_epilogue: ++ # Remove the space we pushed for the args ++ mov r14,r15 ++ ++ lds.l @r15+,pr ++ mov.l @r15+,r14 ++ mov.l @r15+,r12 ++ mov.l @r15+,r10 ++ mov.l @r15+,r9 ++ rts ++ mov.l @r15+,r8 ++#else ++ mov r6,r8 ++ mov r7,r9 ++ ++ sub r6,r15 ++ add #-16,r15 ++ mov #~7,r0 ++ and r0,r15 ++ ++ mov r4,r0 ++ jsr @r0 ++ mov r15,r4 ++ ++ mov r9,r3 ++ shlr8 r9 ++ shlr8 r9 ++ shlr8 r9 ++ ++ mov #FFI_TYPE_STRUCT,r2 ++ cmp/eq r2,r9 ++ bf 1f ++#if STRUCT_VALUE_ADDRESS_WITH_ARG ++ mov.l @r15+,r4 ++ bra 2f ++ mov #5,r2 ++#else ++ mov.l @r15+,r10 ++#endif ++1: ++ mov #4,r2 ++2: ++ ++L_pass: ++ cmp/pl r8 ++ bf L_call_it ++ ++ mov r3,r0 ++ and #3,r0 ++ ++L_pass_d: ++ cmp/eq #FFI_TYPE_DOUBLE,r0 ++ bf L_pass_i ++ ++ mov r15,r0 ++ and #7,r0 ++ tst r0,r0 ++ bt 1f ++ add #4,r15 ++1: ++ mov #8,r0 ++ cmp/hs r0,r2 ++ bt/s 2f ++ shlr2 r3 ++ bsr L_pop_d ++ nop ++2: ++ add #2,r2 ++ bra L_pass ++ add #-8,r8 ++ ++L_pop_d: ++ mov r2,r0 ++ add r0,r0 ++ add r2,r0 ++ add #-12,r0 ++ add r0,r0 ++ braf r0 ++ nop ++ mov.l @r15+,r4 ++ rts ++ mov.l @r15+,r5 ++ mov.l @r15+,r5 ++ rts ++ mov.l @r15+,r6 ++ mov.l @r15+,r6 ++ rts ++ mov.l @r15+,r7 ++ rts ++ mov.l @r15+,r7 ++ ++L_pass_i: ++ mov #8,r0 ++ cmp/hs r0,r2 ++ bt/s 2f ++ shlr2 r3 ++ bsr L_pop_i ++ nop ++2: ++ add #1,r2 ++ bra L_pass ++ add #-4,r8 ++ ++L_pop_i: ++ mov r2,r0 ++ shll2 r0 ++ add #-16,r0 ++ braf r0 ++ nop ++ rts ++ mov.l @r15+,r4 ++ rts ++ mov.l @r15+,r5 ++ rts ++ mov.l @r15+,r6 ++ rts ++ mov.l @r15+,r7 ++ ++L_call_it: ++ # call function ++#if (! STRUCT_VALUE_ADDRESS_WITH_ARG) ++ mov r10, r2 ++#endif ++ mov.l @(28,r14),r1 ++ jsr @r1 ++ nop ++ ++L_ret_d: ++ mov #FFI_TYPE_DOUBLE,r2 ++ cmp/eq r2,r9 ++ bf L_ret_ll ++ ++ mov.l @(24,r14),r2 ++ mov.l r0,@r2 ++ bra L_epilogue ++ mov.l r1,@(4,r2) ++ ++L_ret_ll: ++ mov #FFI_TYPE_SINT64,r2 ++ cmp/eq r2,r9 ++ bt/s 1f ++ mov #FFI_TYPE_UINT64,r2 ++ cmp/eq r2,r9 ++ bf L_ret_i ++ ++1: ++ mov.l @(24,r14),r2 ++ mov.l r0,@r2 ++ bra L_epilogue ++ mov.l r1,@(4,r2) ++ ++L_ret_i: ++ mov #FFI_TYPE_FLOAT,r2 ++ cmp/eq r2,r9 ++ bt 1f ++ mov #FFI_TYPE_INT,r2 ++ cmp/eq r2,r9 ++ bf L_epilogue ++1: ++ mov.l @(24,r14),r1 ++ bra L_epilogue ++ mov.l r0,@r1 ++ ++L_epilogue: ++ # Remove the space we pushed for the args ++ mov r14,r15 ++ ++ lds.l @r15+,pr ++ mov.l @r15+,r14 ++ mov.l @r15+,r12 ++ mov.l @r15+,r10 ++ mov.l @r15+,r9 ++ rts ++ mov.l @r15+,r8 ++#endif ++.LFE1: ++.ffi_call_SYSV_end: ++ .size CNAME(ffi_call_SYSV),.ffi_call_SYSV_end-CNAME(ffi_call_SYSV) ++ ++.globl ffi_closure_helper_SYSV ++ ++ENTRY(ffi_closure_SYSV) ++.LFB2: ++ mov.l r14,@-r15 ++.LCFI7: ++ sts.l pr,@-r15 ++ ++ /* Stack layout: ++ ... ++ 32 bytes (floating register parameters, SH-4 only) ++ 16 bytes (register parameters) ++ 4 bytes (result) ++ 4 bytes (5th arg) ++ <- new stack pointer ++ */ ++.LCFI8: ++#if defined(__SH4__) ++ add #-56,r15 ++#else ++ add #-24,r15 ++#endif ++.LCFI9: ++ mov r15,r14 ++.LCFIA: ++ mov r14,r1 ++ add #24,r1 ++ mov.l r7,@-r1 ++ mov.l r6,@-r1 ++ mov.l r5,@-r1 ++ mov.l r4,@-r1 ++ mov r1,r6 ++ ++#if defined(__SH4__) ++ mov r14,r1 ++ add #56,r1 ++#ifdef __LITTLE_ENDIAN__ ++ fmov.s fr10,@-r1 ++ fmov.s fr11,@-r1 ++ fmov.s fr8,@-r1 ++ fmov.s fr9,@-r1 ++ fmov.s fr6,@-r1 ++ fmov.s fr7,@-r1 ++ fmov.s fr4,@-r1 ++ fmov.s fr5,@-r1 ++#else ++ fmov.s fr11,@-r1 ++ fmov.s fr10,@-r1 ++ fmov.s fr9,@-r1 ++ fmov.s fr8,@-r1 ++ fmov.s fr7,@-r1 ++ fmov.s fr6,@-r1 ++ fmov.s fr5,@-r1 ++ fmov.s fr4,@-r1 ++#endif ++ mov r1,r7 ++#endif ++ ++ mov r14,r1 ++ add #4,r1 ++ mov r1,r5 ++ ++ mov r14,r1 ++#if defined(__SH4__) ++ add #64,r1 ++#else ++ add #32,r1 ++#endif ++ mov.l r1,@r14 ++ ++ mov.l L_helper,r0 ++ jsr @r0 ++ mov r3,r4 ++ ++ shll r0 ++ mov r0,r1 ++ mova L_table,r0 ++ add r1,r0 ++ mov.w @r0,r0 ++ mov r14,r2 ++ braf r0 ++ add #4,r2 ++0: ++ .align 2 ++L_helper: ++ .long ffi_closure_helper_SYSV ++L_table: ++ .short L_case_v - 0b /* FFI_TYPE_VOID */ ++ .short L_case_i - 0b /* FFI_TYPE_INT */ ++#if defined(__SH4__) ++ .short L_case_f - 0b /* FFI_TYPE_FLOAT */ ++ .short L_case_d - 0b /* FFI_TYPE_DOUBLE */ ++ .short L_case_d - 0b /* FFI_TYPE_LONGDOUBLE */ ++#else ++ .short L_case_i - 0b /* FFI_TYPE_FLOAT */ ++ .short L_case_ll - 0b /* FFI_TYPE_DOUBLE */ ++ .short L_case_ll - 0b /* FFI_TYPE_LONGDOUBLE */ ++#endif ++ .short L_case_uq - 0b /* FFI_TYPE_UINT8 */ ++ .short L_case_q - 0b /* FFI_TYPE_SINT8 */ ++ .short L_case_uh - 0b /* FFI_TYPE_UINT16 */ ++ .short L_case_h - 0b /* FFI_TYPE_SINT16 */ ++ .short L_case_i - 0b /* FFI_TYPE_UINT32 */ ++ .short L_case_i - 0b /* FFI_TYPE_SINT32 */ ++ .short L_case_ll - 0b /* FFI_TYPE_UINT64 */ ++ .short L_case_ll - 0b /* FFI_TYPE_SINT64 */ ++ .short L_case_v - 0b /* FFI_TYPE_STRUCT */ ++ .short L_case_i - 0b /* FFI_TYPE_POINTER */ ++ ++#if defined(__SH4__) ++L_case_d: ++#ifdef __LITTLE_ENDIAN__ ++ fmov.s @r2+,fr1 ++ bra L_case_v ++ fmov.s @r2,fr0 ++#else ++ fmov.s @r2+,fr0 ++ bra L_case_v ++ fmov.s @r2,fr1 ++#endif ++ ++L_case_f: ++ bra L_case_v ++ fmov.s @r2,fr0 ++#endif ++ ++L_case_ll: ++ mov.l @r2+,r0 ++ bra L_case_v ++ mov.l @r2,r1 ++ ++L_case_i: ++ bra L_case_v ++ mov.l @r2,r0 ++ ++L_case_q: ++#ifdef __LITTLE_ENDIAN__ ++#else ++ add #3,r2 ++#endif ++ bra L_case_v ++ mov.b @r2,r0 ++ ++L_case_uq: ++#ifdef __LITTLE_ENDIAN__ ++#else ++ add #3,r2 ++#endif ++ mov.b @r2,r0 ++ bra L_case_v ++ extu.b r0,r0 ++ ++L_case_h: ++#ifdef __LITTLE_ENDIAN__ ++#else ++ add #2,r2 ++#endif ++ bra L_case_v ++ mov.w @r2,r0 ++ ++L_case_uh: ++#ifdef __LITTLE_ENDIAN__ ++#else ++ add #2,r2 ++#endif ++ mov.w @r2,r0 ++ extu.w r0,r0 ++ /* fall through */ ++ ++L_case_v: ++#if defined(__SH4__) ++ add #56,r15 ++#else ++ add #24,r15 ++#endif ++ lds.l @r15+,pr ++ rts ++ mov.l @r15+,r14 ++.LFE2: ++.ffi_closure_SYSV_end: ++ .size CNAME(ffi_closure_SYSV),.ffi_closure_SYSV_end-CNAME(ffi_closure_SYSV) ++ ++ .section ".eh_frame","aw",@progbits ++__FRAME_BEGIN__: ++ .4byte .LECIE1-.LSCIE1 /* Length of Common Information Entry */ ++.LSCIE1: ++ .4byte 0x0 /* CIE Identifier Tag */ ++ .byte 0x1 /* CIE Version */ ++ .byte 0x0 /* CIE Augmentation */ ++ .byte 0x1 /* uleb128 0x1; CIE Code Alignment Factor */ ++ .byte 0x7c /* sleb128 -4; CIE Data Alignment Factor */ ++ .byte 0x11 /* CIE RA Column */ ++ .byte 0xc /* DW_CFA_def_cfa */ ++ .byte 0xf /* uleb128 0xf */ ++ .byte 0x0 /* uleb128 0x0 */ ++ .align 2 ++.LECIE1: ++.LSFDE1: ++ .4byte .LEFDE1-.LASFDE1 /* FDE Length */ ++.LASFDE1: ++ .4byte .LASFDE1-__FRAME_BEGIN__ /* FDE CIE offset */ ++ .4byte .LFB1 /* FDE initial location */ ++ .4byte .LFE1-.LFB1 /* FDE address range */ ++ .byte 0x4 /* DW_CFA_advance_loc4 */ ++ .4byte .LCFI0-.LFB1 ++ .byte 0xe /* DW_CFA_def_cfa_offset */ ++ .byte 0x4 /* uleb128 0x4 */ ++ .byte 0x4 /* DW_CFA_advance_loc4 */ ++ .4byte .LCFI1-.LCFI0 ++ .byte 0xe /* DW_CFA_def_cfa_offset */ ++ .byte 0x8 /* uleb128 0x4 */ ++ .byte 0x4 /* DW_CFA_advance_loc4 */ ++ .4byte .LCFI2-.LCFI1 ++ .byte 0xe /* DW_CFA_def_cfa_offset */ ++ .byte 0xc /* uleb128 0x4 */ ++ .byte 0x4 /* DW_CFA_advance_loc4 */ ++ .4byte .LCFI3-.LCFI2 ++ .byte 0xe /* DW_CFA_def_cfa_offset */ ++ .byte 0x10 /* uleb128 0x4 */ ++ .byte 0x4 /* DW_CFA_advance_loc4 */ ++ .4byte .LCFI4-.LCFI3 ++ .byte 0xe /* DW_CFA_def_cfa_offset */ ++ .byte 0x14 /* uleb128 0x4 */ ++ .byte 0x4 /* DW_CFA_advance_loc4 */ ++ .4byte .LCFI5-.LCFI4 ++ .byte 0xe /* DW_CFA_def_cfa_offset */ ++ .byte 0x18 /* uleb128 0x4 */ ++ .byte 0x91 /* DW_CFA_offset, column 0x11 */ ++ .byte 0x6 /* uleb128 0x6 */ ++ .byte 0x8e /* DW_CFA_offset, column 0xe */ ++ .byte 0x5 /* uleb128 0x5 */ ++ .byte 0x8c /* DW_CFA_offset, column 0xc */ ++ .byte 0x4 /* uleb128 0x4 */ ++ .byte 0x8a /* DW_CFA_offset, column 0xa */ ++ .byte 0x3 /* uleb128 0x3 */ ++ .byte 0x89 /* DW_CFA_offset, column 0x9 */ ++ .byte 0x2 /* uleb128 0x2 */ ++ .byte 0x88 /* DW_CFA_offset, column 0x8 */ ++ .byte 0x1 /* uleb128 0x1 */ ++ .byte 0x4 /* DW_CFA_advance_loc4 */ ++ .4byte .LCFI6-.LCFI5 ++ .byte 0xd /* DW_CFA_def_cfa_register */ ++ .byte 0xe /* uleb128 0xe */ ++ .align 2 ++.LEFDE1: ++ ++.LSFDE3: ++ .4byte .LEFDE3-.LASFDE3 /* FDE Length */ ++.LASFDE3: ++ .4byte .LASFDE3-__FRAME_BEGIN__ /* FDE CIE offset */ ++ .4byte .LFB2 /* FDE initial location */ ++ .4byte .LFE2-.LFB2 /* FDE address range */ ++ .byte 0x4 /* DW_CFA_advance_loc4 */ ++ .4byte .LCFI7-.LFB2 ++ .byte 0xe /* DW_CFA_def_cfa_offset */ ++ .byte 0x4 /* uleb128 0x4 */ ++ .byte 0x4 /* DW_CFA_advance_loc4 */ ++ .4byte .LCFI8-.LCFI7 ++ .byte 0xe /* DW_CFA_def_cfa_offset */ ++ .byte 0x8 /* uleb128 0x8 */ ++ .byte 0x4 /* DW_CFA_advance_loc4 */ ++ .4byte .LCFI9-.LCFI8 ++ .byte 0xe /* DW_CFA_def_cfa_offset */ ++#if defined(__SH4__) ++ .byte 8+56 /* uleb128 8+56 */ ++#else ++ .byte 8+24 /* uleb128 8+24 */ ++#endif ++ .byte 0x91 /* DW_CFA_offset, column 0x11 */ ++ .byte 0x2 ++ .byte 0x8e /* DW_CFA_offset, column 0xe */ ++ .byte 0x1 ++ .byte 0x4 /* DW_CFA_advance_loc4 */ ++ .4byte .LCFIA-.LCFI9 ++ .byte 0xd /* DW_CFA_def_cfa_register */ ++ .byte 0xe /* uleb128 0xe */ ++ .align 2 ++.LEFDE3: +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/sparc/ffi.c gcc/libffi/src/sparc/ffi.c +--- gcc-3.2.2.orig/libffi/src/sparc/ffi.c Sat Mar 3 07:21:23 2001 ++++ gcc/libffi/src/sparc/ffi.c Sat Jan 4 08:08:56 2003 +@@ -1,5 +1,5 @@ + /* ----------------------------------------------------------------------- +- ffi.c - Copyright (c) 1996 Cygnus Solutions ++ ffi.c - Copyright (c) 1996, 2003 Cygnus Solutions + + Sparc Foreign Function Interface + +@@ -28,20 +28,22 @@ + + #include + ++#ifdef SPARC64 ++extern void ffi_closure_v9(void); ++#else ++extern void ffi_closure_v8(void); ++#endif ++ + /* ffi_prep_args is called by the assembly routine once stack space + has been allocated for the function's arguments */ + + void ffi_prep_args_v8(char *stack, extended_cif *ecif) + { + int i; +- int tmp; +- int avn; + void **p_argv; + char *argp; + ffi_type **p_arg; + +- tmp = 0; +- + /* Skip 16 words for the window save area */ + argp = stack + 16*sizeof(int); + +@@ -66,18 +68,12 @@ + ((int*)argp)[5] = 0; + #endif + +- avn = ecif->cif->nargs; + p_argv = ecif->avalue; + +- for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; +- i && avn; +- i--, p_arg++) ++ for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; i; i--, p_arg++) + { + size_t z; + +- if (avn) +- { +- avn--; + if ((*p_arg)->type == FFI_TYPE_STRUCT + #if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE + || (*p_arg)->type == FFI_TYPE_LONGDOUBLE +@@ -122,7 +118,6 @@ + } + p_argv++; + argp += z; +- } + } + + return; +@@ -420,3 +415,101 @@ + } + + } ++ ++ffi_status ++ffi_prep_closure (ffi_closure* closure, ++ ffi_cif* cif, ++ void (*fun)(ffi_cif*, void*, void**, void*), ++ void *user_data) ++{ ++ unsigned int *tramp = (unsigned int *) &closure->tramp[0]; ++ unsigned long fn; ++ unsigned long ctx = (unsigned long) closure; ++ ++#ifdef SPARC64 ++ /* Trampoline address is equal to the closure address. We take advantage ++ of that to reduce the trampoline size by 8 bytes. */ ++ FFI_ASSERT (cif->abi == FFI_V9); ++ fn = (unsigned long) ffi_closure_v9; ++ tramp[0] = 0x83414000; /* rd %pc, %g1 */ ++ tramp[1] = 0xca586010; /* ldx [%g1+16], %g5 */ ++ tramp[2] = 0x81c14000; /* jmp %g5 */ ++ tramp[3] = 0x01000000; /* nop */ ++ *((unsigned long *) &tramp[4]) = fn; ++#else ++ FFI_ASSERT (cif->abi == FFI_V8); ++ fn = (unsigned long) ffi_closure_v8; ++ tramp[0] = 0x03000000 | fn >> 10; /* sethi %hi(fn), %g1 */ ++ tramp[1] = 0x05000000 | ctx >> 10; /* sethi %hi(ctx), %g2 */ ++ tramp[2] = 0x81c06000 | (fn & 0x3ff); /* jmp %g1+%lo(fn) */ ++ tramp[3] = 0x8410a000 | (ctx & 0x3ff);/* or %g2, %lo(ctx) */ ++#endif ++ ++ closure->cif = cif; ++ closure->fun = fun; ++ closure->user_data = user_data; ++ ++ /* Flush the Icache. FIXME: alignment isn't certain, assume 8 bytes */ ++#ifdef SPARC64 ++ asm volatile ("flush %0" : : "r" (closure) : "memory"); ++ asm volatile ("flush %0" : : "r" (((char *) closure) + 8) : "memory"); ++#else ++ asm volatile ("iflush %0" : : "r" (closure) : "memory"); ++ asm volatile ("iflush %0" : : "r" (((char *) closure) + 8) : "memory"); ++#endif ++ ++ return FFI_OK; ++} ++ ++int ++ffi_closure_sparc_inner(ffi_closure *closure, ++ void *rvalue, unsigned long *gpr, double *fpr) ++{ ++ ffi_cif *cif; ++ void **avalue; ++ ffi_type **arg_types; ++ int i, avn, argn; ++ ++ cif = closure->cif; ++ avalue = alloca(cif->nargs * sizeof(void *)); ++ ++ argn = 0; ++ ++ /* Copy the caller's structure return address to that the closure ++ returns the data directly to the caller. */ ++ if (cif->flags == FFI_TYPE_STRUCT) ++ { ++ rvalue = (void *) gpr[0]; ++ argn = 1; ++ } ++ ++ i = 0; ++ avn = cif->nargs; ++ arg_types = cif->arg_types; ++ ++ /* Grab the addresses of the arguments from the stack frame. */ ++ while (i < avn) ++ { ++ /* Assume big-endian. FIXME */ ++ argn += ALIGN(arg_types[i]->size, SIZEOF_ARG) / SIZEOF_ARG; ++ ++#ifdef SPARC64 ++ if (i < 6 && (arg_types[i]->type == FFI_TYPE_FLOAT ++ || arg_types[i]->type == FFI_TYPE_DOUBLE ++#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE ++ || arg_types[i]->type == FFI_TYPE_LONGDOUBLE ++#endif ++ )) ++ avalue[i] = ((char *) &fpr[argn]) - arg_types[i]->size; ++ else ++#endif ++ avalue[i] = ((char *) &gpr[argn]) - arg_types[i]->size; ++ i++; ++ } ++ ++ /* Invoke the closure. */ ++ (closure->fun) (cif, rvalue, avalue, closure->user_data); ++ ++ /* Tell ffi_closure_sparc how to perform return type promotions. */ ++ return cif->rtype->type; ++} +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/sparc/v8.S gcc/libffi/src/sparc/v8.S +--- gcc-3.2.2.orig/libffi/src/sparc/v8.S Mon Apr 29 05:12:04 2002 ++++ gcc/libffi/src/sparc/v8.S Sat Jan 4 08:08:56 2003 +@@ -1,5 +1,5 @@ + /* ----------------------------------------------------------------------- +- v8.S - Copyright (c) 1996, 1997 Cygnus Solutions ++ v8.S - Copyright (c) 1996, 1997, 2003 Cygnus Solutions + + Sparc Foreign Function Interface + +@@ -94,6 +94,72 @@ + .ffi_call_V8_end: + .size ffi_call_V8,.ffi_call_V8_end-ffi_call_V8 + ++ ++#define STACKFRAME 104 /* 16*4 register window + ++ 1*4 struct return + ++ 6*4 args backing store + ++ 3*4 locals */ ++ ++/* ffi_closure_v8(...) ++ ++ Receives the closure argument in %g2. */ ++ ++ .text ++ .align 8 ++ .globl ffi_closure_v8 ++ ++ffi_closure_v8: ++ .register %g2, #scratch ++.LLFB2: ++ save %sp, -STACKFRAME, %sp ++.LLCFI1: ++ ++ ! Store all of the potential argument registers in va_list format. ++ st %i0, [%fp+68+0] ++ st %i1, [%fp+68+4] ++ st %i2, [%fp+68+8] ++ st %i3, [%fp+68+12] ++ st %i4, [%fp+68+16] ++ st %i5, [%fp+68+20] ++ ++ ! Call ffi_closure_sparc_inner to do the bulk of the work. ++ mov %g2, %o0 ++ add %fp, -8, %o1 ++ add %fp, 68, %o2 ++ call ffi_closure_sparc_inner ++ mov 0, %o3 ++ ++ ! Load up the return value in the proper type. ++ cmp %o0, FFI_TYPE_VOID ++ be done1 ++ ++ cmp %o0, FFI_TYPE_FLOAT ++ be,a done1 ++ ld [%fp-8], %f0 ++ ++ cmp %o0, FFI_TYPE_DOUBLE ++ be,a done1 ++ ldd [%fp-8], %f0 ++ ++ cmp %o0, FFI_TYPE_SINT64 ++ be,a integer ++ ld [%fp-4], %i1 ++ ++ cmp %o0, FFI_TYPE_UINT64 ++ be,a integer ++ ld [%fp-4], %i1 ++ ++integer: ++ ld [%fp-8], %i0 ++ ++done1: ++ ret ++ restore ++.LLFE2: ++ ++.ffi_closure_v8_end: ++ .size ffi_closure_v8,.ffi_closure_v8_end-ffi_closure_v8 ++ + #ifdef SPARC64 + #define WS 8 + #define nword xword +@@ -148,3 +214,26 @@ + .byte 0x1f ! uleb128 0x1f + .align WS + .LLEFDE1: ++.LLSFDE2: ++ .uaword .LLEFDE2-.LLASFDE2 ! FDE Length ++.LLASFDE2: ++ .uaword .LLASFDE2-.LLframe1 ! FDE CIE offset ++#ifdef HAVE_AS_SPARC_UA_PCREL ++ .uaword %r_disp32(.LLFB2) ++ .uaword .LLFE2-.LLFB2 ! FDE address range ++#else ++ .align WS ++ .nword .LLFB2 ++ .uanword .LLFE2-.LLFB2 ! FDE address range ++#endif ++ .byte 0x0 ! uleb128 0x0; Augmentation size ++ .byte 0x4 ! DW_CFA_advance_loc4 ++ .uaword .LLCFI1-.LLFB2 ++ .byte 0xd ! DW_CFA_def_cfa_register ++ .byte 0x1e ! uleb128 0x1e ++ .byte 0x2d ! DW_CFA_GNU_window_save ++ .byte 0x9 ! DW_CFA_register ++ .byte 0xf ! uleb128 0xf ++ .byte 0x1f ! uleb128 0x1f ++ .align WS ++.LLEFDE2: +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/sparc/v9.S gcc/libffi/src/sparc/v9.S +--- gcc-3.2.2.orig/libffi/src/sparc/v9.S Mon Apr 29 05:12:04 2002 ++++ gcc/libffi/src/sparc/v9.S Sat Jan 4 08:08:56 2003 +@@ -1,5 +1,5 @@ + /* ----------------------------------------------------------------------- +- v9.S - Copyright (c) 2000 Cygnus Solutions ++ v9.S - Copyright (c) 2000, 2003 Cygnus Solutions + + Sparc 64bit Foreign Function Interface + +@@ -99,7 +99,7 @@ + cmp %i3, FFI_TYPE_STRUCT + be,pn %icc, dostruct + +- cmp %i3, FFI_TYPE_LONGDOUBLE ++ cmp %i3, FFI_TYPE_LONGDOUBLE + bne,pt %icc, done + nop + std %f0, [%i4+0] +@@ -125,6 +125,88 @@ + .ffi_call_V9_end: + .size ffi_call_V9,.ffi_call_V9_end-ffi_call_V9 + ++ ++#define STACKFRAME 240 /* 16*8 register window + ++ 6*8 args backing store + ++ 8*8 locals */ ++#define FP %fp+STACK_BIAS ++ ++/* ffi_closure_v9(...) ++ ++ Receives the closure argument in %g1. */ ++ ++ .text ++ .align 8 ++ .globl ffi_closure_v9 ++ ++ffi_closure_v9: ++.LLFB2: ++ save %sp, -STACKFRAME, %sp ++.LLCFI1: ++ ++ ! Store all of the potential argument registers in va_list format. ++ stx %i0, [FP+128+0] ++ stx %i1, [FP+128+8] ++ stx %i2, [FP+128+16] ++ stx %i3, [FP+128+24] ++ stx %i4, [FP+128+32] ++ stx %i5, [FP+128+40] ++ ++ ! Store possible floating point argument registers too. ++ std %f0, [FP-48] ++ std %f2, [FP-40] ++ std %f4, [FP-32] ++ std %f6, [FP-24] ++ std %f8, [FP-16] ++ std %f10, [FP-8] ++ ++ ! Call ffi_closure_sparc_inner to do the bulk of the work. ++ mov %g1, %o0 ++ add %fp, STACK_BIAS-64, %o1 ++ add %fp, STACK_BIAS+128, %o2 ++ call ffi_closure_sparc_inner ++ add %fp, STACK_BIAS-48, %o3 ++ ++ ! Load up the return value in the proper type. ++ cmp %o0, FFI_TYPE_VOID ++ be,pn %icc, done1 ++ ++ cmp %o0, FFI_TYPE_FLOAT ++ be,a,pn %icc, done1 ++ ld [FP-64], %f0 ++ ++ cmp %o0, FFI_TYPE_DOUBLE ++ be,a,pn %icc, done1 ++ ldd [FP-64], %f0 ++ ++ cmp %o0, FFI_TYPE_LONGDOUBLE ++ be,a,pn %icc, longdouble1 ++ ldd [FP-64], %f0 ++ ++ cmp %o0, FFI_TYPE_STRUCT ++ be,pn %icc, struct1 ++ ++ ! FFI_TYPE_UINT64 | FFI_TYPE_SINT64 | FFI_TYPE_POINTER ++ ldx [FP-64], %i0 ++ ++done1: ++ ret ++ restore ++ ++struct1: ++ ldx [FP-56], %i2 ++ ret ++ restore ++ ++longdouble1: ++ ldd [FP-56], %f2 ++ ret ++ restore ++.LLFE2: ++ ++.ffi_closure_v9_end: ++ .size ffi_closure_v9,.ffi_closure_v9_end-ffi_closure_v9 ++ + .section ".eh_frame",#alloc,#write + .LLframe1: + .uaword .LLECIE1-.LLSCIE1 ! Length of Common Information Entry +@@ -169,5 +251,27 @@ + .byte 0x1f ! uleb128 0x1f + .align 8 + .LLEFDE1: +- ++.LLSFDE2: ++ .uaword .LLEFDE2-.LLASFDE2 ! FDE Length ++.LLASFDE2: ++ .uaword .LLASFDE2-.LLframe1 ! FDE CIE offset ++#ifdef HAVE_AS_SPARC_UA_PCREL ++ .uaword %r_disp32(.LLFB2) ++ .uaword .LLFE2-.LLFB2 ! FDE address range ++#else ++ .align 8 ++ .xword .LLFB2 ++ .uaxword .LLFE2-.LLFB2 ! FDE address range ++#endif ++ .byte 0x0 ! uleb128 0x0; Augmentation size ++ .byte 0x4 ! DW_CFA_advance_loc4 ++ .uaword .LLCFI1-.LLFB2 ++ .byte 0xd ! DW_CFA_def_cfa_register ++ .byte 0x1e ! uleb128 0x1e ++ .byte 0x2d ! DW_CFA_GNU_window_save ++ .byte 0x9 ! DW_CFA_register ++ .byte 0xf ! uleb128 0xf ++ .byte 0x1f ! uleb128 0x1f ++ .align 8 ++.LLEFDE2: + #endif +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/types.c gcc/libffi/src/types.c +--- gcc-3.2.2.orig/libffi/src/types.c Tue Mar 27 11:39:16 2001 ++++ gcc/libffi/src/types.c Wed Nov 27 07:24:05 2002 +@@ -42,7 +42,8 @@ + FFI_INTEGRAL_TYPEDEF(sint32, 4, 4, FFI_TYPE_SINT32); + FFI_INTEGRAL_TYPEDEF(float, 4, 4, FFI_TYPE_FLOAT); + +-#if defined ALPHA || defined SPARC64 ++#if defined ALPHA || defined SPARC64 || defined X86_64 || defined S390X \ ++ || defined IA64 + + FFI_INTEGRAL_TYPEDEF(pointer, 8, 8, FFI_TYPE_POINTER); + +@@ -52,22 +53,12 @@ + + #endif + +-#ifdef X86 ++#if defined X86 || defined X86_WIN32 || defined ARM || defined M68K + + FFI_INTEGRAL_TYPEDEF(uint64, 8, 4, FFI_TYPE_UINT64); + FFI_INTEGRAL_TYPEDEF(sint64, 8, 4, FFI_TYPE_SINT64); + +-#elif defined X86_WIN32 +- +-FFI_INTEGRAL_TYPEDEF(uint64, 8, 4, FFI_TYPE_UINT64); +-FFI_INTEGRAL_TYPEDEF(sint64, 8, 4, FFI_TYPE_SINT64); +- +-#elif defined ARM +- +-FFI_INTEGRAL_TYPEDEF(uint64, 8, 4, FFI_TYPE_UINT64); +-FFI_INTEGRAL_TYPEDEF(sint64, 8, 4, FFI_TYPE_SINT64); +- +-#elif defined M68K ++#elif defined SH + + FFI_INTEGRAL_TYPEDEF(uint64, 8, 4, FFI_TYPE_UINT64); + FFI_INTEGRAL_TYPEDEF(sint64, 8, 4, FFI_TYPE_SINT64); +@@ -80,12 +71,7 @@ + #endif + + +-#ifdef X86 +- +-FFI_INTEGRAL_TYPEDEF(double, 8, 4, FFI_TYPE_DOUBLE); +-FFI_INTEGRAL_TYPEDEF(longdouble, 12, 4, FFI_TYPE_LONGDOUBLE); +- +-#elif defined X86_WIN32 ++#if defined X86 || defined X86_WIN32 || defined M68K + + FFI_INTEGRAL_TYPEDEF(double, 8, 4, FFI_TYPE_DOUBLE); + FFI_INTEGRAL_TYPEDEF(longdouble, 12, 4, FFI_TYPE_LONGDOUBLE); +@@ -95,25 +81,25 @@ + FFI_INTEGRAL_TYPEDEF(double, 8, 4, FFI_TYPE_DOUBLE); + FFI_INTEGRAL_TYPEDEF(longdouble, 8, 4, FFI_TYPE_LONGDOUBLE); + +-#elif defined M68K ++#elif defined SH + + FFI_INTEGRAL_TYPEDEF(double, 8, 4, FFI_TYPE_DOUBLE); +-FFI_INTEGRAL_TYPEDEF(longdouble, 12, 4, FFI_TYPE_LONGDOUBLE); ++FFI_INTEGRAL_TYPEDEF(longdouble, 8, 4, FFI_TYPE_LONGDOUBLE); + + #elif defined SPARC + + FFI_INTEGRAL_TYPEDEF(double, 8, 8, FFI_TYPE_DOUBLE); +- + #ifdef SPARC64 +- + FFI_INTEGRAL_TYPEDEF(longdouble, 16, 16, FFI_TYPE_LONGDOUBLE); +- + #else +- + FFI_INTEGRAL_TYPEDEF(longdouble, 16, 8, FFI_TYPE_LONGDOUBLE); +- + #endif + ++#elif defined X86_64 ++ ++FFI_INTEGRAL_TYPEDEF(double, 8, 8, FFI_TYPE_DOUBLE); ++FFI_INTEGRAL_TYPEDEF(longdouble, 16, 16, FFI_TYPE_LONGDOUBLE); ++ + #else + + FFI_INTEGRAL_TYPEDEF(double, 8, 8, FFI_TYPE_DOUBLE); +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/x86/ffi.c gcc/libffi/src/x86/ffi.c +--- gcc-3.2.2.orig/libffi/src/x86/ffi.c Tue May 28 18:22:08 2002 ++++ gcc/libffi/src/x86/ffi.c Fri Dec 6 10:16:45 2002 +@@ -1,5 +1,8 @@ + /* ----------------------------------------------------------------------- +- ffi.c - Copyright (c) 1996, 1998, 1999 Cygnus Solutions ++ ffi.c - Copyright (c) 1996, 1998, 1999, 2001 Red Hat, Inc. ++ Copyright (c) 2002 Ranjit Mathew ++ Copyright (c) 2002 Bo Thorsen ++ Copyright (c) 2002 Roger Sayle + + x86 Foreign Function Interface + +@@ -23,6 +26,8 @@ + OTHER DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + ++#ifndef __x86_64__ ++ + #include + #include + +@@ -36,12 +41,10 @@ + /*@=exportheader@*/ + { + register unsigned int i; +- register int tmp; + register void **p_argv; + register char *argp; + register ffi_type **p_arg; + +- tmp = 0; + argp = stack; + + if (ecif->cif->rtype->type == FFI_TYPE_STRUCT) +@@ -148,6 +151,18 @@ + /*@=declundef@*/ + /*@=exportheader@*/ + ++#ifdef X86_WIN32 ++/*@-declundef@*/ ++/*@-exportheader@*/ ++extern void ffi_call_STDCALL(void (*)(char *, extended_cif *), ++ /*@out@*/ extended_cif *, ++ unsigned, unsigned, ++ /*@out@*/ unsigned *, ++ void (*fn)()); ++/*@=declundef@*/ ++/*@=exportheader@*/ ++#endif /* X86_WIN32 */ ++ + void ffi_call(/*@dependent@*/ ffi_cif *cif, + void (*fn)(), + /*@out@*/ void *rvalue, +@@ -180,6 +195,14 @@ + cif->flags, ecif.rvalue, fn); + /*@=usedef@*/ + break; ++#ifdef X86_WIN32 ++ case FFI_STDCALL: ++ /*@-usedef@*/ ++ ffi_call_STDCALL(ffi_prep_args, &ecif, cif->bytes, ++ cif->flags, ecif.rvalue, fn); ++ /*@=usedef@*/ ++ break; ++#endif /* X86_WIN32 */ + default: + FFI_ASSERT(0); + break; +@@ -266,12 +289,10 @@ + /*@=exportheader@*/ + { + register unsigned int i; +- register int tmp; + register void **p_argv; + register char *argp; + register ffi_type **p_arg; + +- tmp = 0; + argp = stack; + + if ( cif->rtype->type == FFI_TYPE_STRUCT ) { +@@ -281,13 +302,14 @@ + + p_argv = avalue; + +- for (i = cif->nargs, p_arg = cif->arg_types; i != 0; i--, p_arg++) ++ for (i = cif->nargs, p_arg = cif->arg_types; (i != 0); i--, p_arg++) + { + size_t z; + + /* Align if necessary */ +- if (((*p_arg)->alignment - 1) & (unsigned) argp) ++ if (((*p_arg)->alignment - 1) & (unsigned) argp) { + argp = (char *) ALIGN(argp, (*p_arg)->alignment); ++ } + + z = (*p_arg)->size; + +@@ -298,7 +320,7 @@ + p_argv++; + argp += z; + } +- ++ + return; + } + +@@ -449,6 +471,15 @@ + /*@out@*/ unsigned *, + void (*fn)()); + ++#ifdef X86_WIN32 ++extern void ++ffi_call_STDCALL(void (*)(char *, extended_cif *), ++ /*@out@*/ extended_cif *, ++ unsigned, unsigned, ++ /*@out@*/ unsigned *, ++ void (*fn)()); ++#endif /* X86_WIN32 */ ++ + void + ffi_raw_call(/*@dependent@*/ ffi_cif *cif, + void (*fn)(), +@@ -483,6 +514,14 @@ + cif->flags, ecif.rvalue, fn); + /*@=usedef@*/ + break; ++#ifdef X86_WIN32 ++ case FFI_STDCALL: ++ /*@-usedef@*/ ++ ffi_call_STDCALL(ffi_prep_args_raw, &ecif, cif->bytes, ++ cif->flags, ecif.rvalue, fn); ++ /*@=usedef@*/ ++ break; ++#endif /* X86_WIN32 */ + default: + FFI_ASSERT(0); + break; +@@ -490,3 +529,5 @@ + } + + #endif ++ ++#endif /* __x86_64__ */ +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/x86/ffi64.c gcc/libffi/src/x86/ffi64.c +--- gcc-3.2.2.orig/libffi/src/x86/ffi64.c Thu Jan 1 09:00:00 1970 ++++ gcc/libffi/src/x86/ffi64.c Wed Jan 29 00:54:28 2003 +@@ -0,0 +1,706 @@ ++/* ----------------------------------------------------------------------- ++ ffi.c - Copyright (c) 2002 Bo Thorsen ++ ++ x86-64 Foreign Function Interface ++ ++ Permission is hereby granted, free of charge, to any person obtaining ++ a copy of this software and associated documentation files (the ++ ``Software''), to deal in the Software without restriction, including ++ without limitation the rights to use, copy, modify, merge, publish, ++ distribute, sublicense, and/or sell copies of the Software, and to ++ permit persons to whom the Software is furnished to do so, subject to ++ the following conditions: ++ ++ The above copyright notice and this permission notice shall be included ++ in all copies or substantial portions of the Software. ++ ++ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS ++ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ++ IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR ++ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ++ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ OTHER DEALINGS IN THE SOFTWARE. ++ ----------------------------------------------------------------------- */ ++ ++#include ++#include ++ ++#include ++#include ++ ++/* ffi_prep_args is called by the assembly routine once stack space ++ has been allocated for the function's arguments */ ++ ++#ifdef __x86_64__ ++ ++#define MAX_GPR_REGS 6 ++#define MAX_SSE_REGS 8 ++typedef struct ++{ ++ /* Registers for argument passing. */ ++ long gpr[MAX_GPR_REGS]; ++ __int128_t sse[MAX_SSE_REGS]; ++ ++ /* Stack space for arguments. */ ++ char argspace[0]; ++} stackLayout; ++ ++/* All reference to register classes here is identical to the code in ++ gcc/config/i386/i386.c. Do *not* change one without the other. */ ++ ++/* Register class used for passing given 64bit part of the argument. ++ These represent classes as documented by the PS ABI, with the exception ++ of SSESF, SSEDF classes, that are basically SSE class, just gcc will ++ use SF or DFmode move instead of DImode to avoid reformating penalties. ++ ++ Similary we play games with INTEGERSI_CLASS to use cheaper SImode moves ++ whenever possible (upper half does contain padding). ++ */ ++enum x86_64_reg_class ++ { ++ X86_64_NO_CLASS, ++ X86_64_INTEGER_CLASS, ++ X86_64_INTEGERSI_CLASS, ++ X86_64_SSE_CLASS, ++ X86_64_SSESF_CLASS, ++ X86_64_SSEDF_CLASS, ++ X86_64_SSEUP_CLASS, ++ X86_64_X87_CLASS, ++ X86_64_X87UP_CLASS, ++ X86_64_MEMORY_CLASS ++ }; ++ ++#define MAX_CLASSES 4 ++ ++/* x86-64 register passing implementation. See x86-64 ABI for details. Goal ++ of this code is to classify each 8bytes of incoming argument by the register ++ class and assign registers accordingly. */ ++ ++/* Return the union class of CLASS1 and CLASS2. ++ See the x86-64 PS ABI for details. */ ++ ++static enum x86_64_reg_class ++merge_classes (enum x86_64_reg_class class1, enum x86_64_reg_class class2) ++{ ++ /* Rule #1: If both classes are equal, this is the resulting class. */ ++ if (class1 == class2) ++ return class1; ++ ++ /* Rule #2: If one of the classes is NO_CLASS, the resulting class is ++ the other class. */ ++ if (class1 == X86_64_NO_CLASS) ++ return class2; ++ if (class2 == X86_64_NO_CLASS) ++ return class1; ++ ++ /* Rule #3: If one of the classes is MEMORY, the result is MEMORY. */ ++ if (class1 == X86_64_MEMORY_CLASS || class2 == X86_64_MEMORY_CLASS) ++ return X86_64_MEMORY_CLASS; ++ ++ /* Rule #4: If one of the classes is INTEGER, the result is INTEGER. */ ++ if ((class1 == X86_64_INTEGERSI_CLASS && class2 == X86_64_SSESF_CLASS) ++ || (class2 == X86_64_INTEGERSI_CLASS && class1 == X86_64_SSESF_CLASS)) ++ return X86_64_INTEGERSI_CLASS; ++ if (class1 == X86_64_INTEGER_CLASS || class1 == X86_64_INTEGERSI_CLASS ++ || class2 == X86_64_INTEGER_CLASS || class2 == X86_64_INTEGERSI_CLASS) ++ return X86_64_INTEGER_CLASS; ++ ++ /* Rule #5: If one of the classes is X87 or X87UP class, MEMORY is used. */ ++ if (class1 == X86_64_X87_CLASS || class1 == X86_64_X87UP_CLASS ++ || class2 == X86_64_X87_CLASS || class2 == X86_64_X87UP_CLASS) ++ return X86_64_MEMORY_CLASS; ++ ++ /* Rule #6: Otherwise class SSE is used. */ ++ return X86_64_SSE_CLASS; ++} ++ ++/* Classify the argument of type TYPE and mode MODE. ++ CLASSES will be filled by the register class used to pass each word ++ of the operand. The number of words is returned. In case the parameter ++ should be passed in memory, 0 is returned. As a special case for zero ++ sized containers, classes[0] will be NO_CLASS and 1 is returned. ++ ++ See the x86-64 PS ABI for details. ++*/ ++static int ++classify_argument (ffi_type *type, enum x86_64_reg_class classes[], ++ int *byte_offset) ++{ ++ /* First, align to the right place. */ ++ *byte_offset = ALIGN(*byte_offset, type->alignment); ++ ++ switch (type->type) ++ { ++ case FFI_TYPE_UINT8: ++ case FFI_TYPE_SINT8: ++ case FFI_TYPE_UINT16: ++ case FFI_TYPE_SINT16: ++ case FFI_TYPE_UINT32: ++ case FFI_TYPE_SINT32: ++ case FFI_TYPE_UINT64: ++ case FFI_TYPE_SINT64: ++ case FFI_TYPE_POINTER: ++ if (((*byte_offset) % 8 + type->size) <= 4) ++ classes[0] = X86_64_INTEGERSI_CLASS; ++ else ++ classes[0] = X86_64_INTEGER_CLASS; ++ return 1; ++ case FFI_TYPE_FLOAT: ++ if (((*byte_offset) % 8) == 0) ++ classes[0] = X86_64_SSESF_CLASS; ++ else ++ classes[0] = X86_64_SSE_CLASS; ++ return 1; ++ case FFI_TYPE_DOUBLE: ++ classes[0] = X86_64_SSEDF_CLASS; ++ return 1; ++ case FFI_TYPE_LONGDOUBLE: ++ classes[0] = X86_64_X87_CLASS; ++ classes[1] = X86_64_X87UP_CLASS; ++ return 2; ++ case FFI_TYPE_STRUCT: ++ { ++ const int UNITS_PER_WORD = 8; ++ int words = (type->size + UNITS_PER_WORD - 1) / UNITS_PER_WORD; ++ ffi_type **ptr; ++ int i; ++ enum x86_64_reg_class subclasses[MAX_CLASSES]; ++ ++ /* If the struct is larger than 16 bytes, pass it on the stack. */ ++ if (type->size > 16) ++ return 0; ++ ++ for (i = 0; i < words; i++) ++ classes[i] = X86_64_NO_CLASS; ++ ++ /* Merge the fields of structure. */ ++ for (ptr=type->elements; (*ptr)!=NULL; ptr++) ++ { ++ int num; ++ ++ num = classify_argument (*ptr, subclasses, byte_offset); ++ if (num == 0) ++ return 0; ++ for (i = 0; i < num; i++) ++ { ++ int pos = *byte_offset / 8; ++ classes[i + pos] = ++ merge_classes (subclasses[i], classes[i + pos]); ++ } ++ ++ if ((*ptr)->type != FFI_TYPE_STRUCT) ++ *byte_offset += (*ptr)->size; ++ } ++ ++ /* Final merger cleanup. */ ++ for (i = 0; i < words; i++) ++ { ++ /* If one class is MEMORY, everything should be passed in ++ memory. */ ++ if (classes[i] == X86_64_MEMORY_CLASS) ++ return 0; ++ ++ /* The X86_64_SSEUP_CLASS should be always preceded by ++ X86_64_SSE_CLASS. */ ++ if (classes[i] == X86_64_SSEUP_CLASS ++ && (i == 0 || classes[i - 1] != X86_64_SSE_CLASS)) ++ classes[i] = X86_64_SSE_CLASS; ++ ++ /* X86_64_X87UP_CLASS should be preceded by X86_64_X87_CLASS. */ ++ if (classes[i] == X86_64_X87UP_CLASS ++ && (i == 0 || classes[i - 1] != X86_64_X87_CLASS)) ++ classes[i] = X86_64_SSE_CLASS; ++ } ++ return words; ++ } ++ ++ default: ++ FFI_ASSERT(0); ++ } ++ return 0; /* Never reached. */ ++} ++ ++/* Examine the argument and return set number of register required in each ++ class. Return 0 iff parameter should be passed in memory. */ ++static int ++examine_argument (ffi_type *type, int in_return, int *int_nregs,int *sse_nregs) ++{ ++ enum x86_64_reg_class class[MAX_CLASSES]; ++ int offset = 0; ++ int n; ++ ++ n = classify_argument (type, class, &offset); ++ ++ if (n == 0) ++ return 0; ++ ++ *int_nregs = 0; ++ *sse_nregs = 0; ++ for (n--; n>=0; n--) ++ switch (class[n]) ++ { ++ case X86_64_INTEGER_CLASS: ++ case X86_64_INTEGERSI_CLASS: ++ (*int_nregs)++; ++ break; ++ case X86_64_SSE_CLASS: ++ case X86_64_SSESF_CLASS: ++ case X86_64_SSEDF_CLASS: ++ (*sse_nregs)++; ++ break; ++ case X86_64_NO_CLASS: ++ case X86_64_SSEUP_CLASS: ++ break; ++ case X86_64_X87_CLASS: ++ case X86_64_X87UP_CLASS: ++ if (!in_return) ++ return 0; ++ break; ++ default: ++ abort (); ++ } ++ return 1; ++} ++ ++/* Functions to load floats and double to an SSE register placeholder. */ ++extern void float2sse (float, __int128_t *); ++extern void double2sse (double, __int128_t *); ++extern void floatfloat2sse (void *, __int128_t *); ++ ++/* Functions to put the floats and doubles back. */ ++extern float sse2float (__int128_t *); ++extern double sse2double (__int128_t *); ++extern void sse2floatfloat(__int128_t *, void *); ++ ++/*@-exportheader@*/ ++void ++ffi_prep_args (stackLayout *stack, extended_cif *ecif) ++/*@=exportheader@*/ ++{ ++ int gprcount, ssecount, i, g, s; ++ void **p_argv; ++ void *argp = &stack->argspace; ++ ffi_type **p_arg; ++ ++ /* First check if the return value should be passed in memory. If so, ++ pass the pointer as the first argument. */ ++ gprcount = ssecount = 0; ++ if (ecif->cif->rtype->type != FFI_TYPE_VOID ++ && examine_argument (ecif->cif->rtype, 1, &g, &s) == 0) ++ (void *)stack->gpr[gprcount++] = ecif->rvalue; ++ ++ for (i=ecif->cif->nargs, p_arg=ecif->cif->arg_types, p_argv = ecif->avalue; ++ i!=0; i--, p_arg++, p_argv++) ++ { ++ int in_register = 0; ++ ++ switch ((*p_arg)->type) ++ { ++ case FFI_TYPE_SINT8: ++ case FFI_TYPE_SINT16: ++ case FFI_TYPE_SINT32: ++ case FFI_TYPE_SINT64: ++ case FFI_TYPE_UINT8: ++ case FFI_TYPE_UINT16: ++ case FFI_TYPE_UINT32: ++ case FFI_TYPE_UINT64: ++ case FFI_TYPE_POINTER: ++ if (gprcount < MAX_GPR_REGS) ++ { ++ stack->gpr[gprcount] = 0; ++ stack->gpr[gprcount++] = *(long long *)(*p_argv); ++ in_register = 1; ++ } ++ break; ++ ++ case FFI_TYPE_FLOAT: ++ if (ssecount < MAX_SSE_REGS) ++ { ++ float2sse (*(float *)(*p_argv), &stack->sse[ssecount++]); ++ in_register = 1; ++ } ++ break; ++ ++ case FFI_TYPE_DOUBLE: ++ if (ssecount < MAX_SSE_REGS) ++ { ++ double2sse (*(double *)(*p_argv), &stack->sse[ssecount++]); ++ in_register = 1; ++ } ++ break; ++ } ++ ++ if (in_register) ++ continue; ++ ++ /* Either all places in registers where filled, or this is a ++ type that potentially goes into a memory slot. */ ++ if (examine_argument (*p_arg, 0, &g, &s) == 0 ++ || gprcount + g > MAX_GPR_REGS || ssecount + s > MAX_SSE_REGS) ++ { ++ /* Pass this argument in memory. */ ++ argp = (void *)ALIGN(argp, (*p_arg)->alignment); ++ memcpy (argp, *p_argv, (*p_arg)->size); ++ argp += (*p_arg)->size; ++ } ++ else ++ { ++ /* All easy cases are eliminated. Now fire the big guns. */ ++ ++ enum x86_64_reg_class classes[MAX_CLASSES]; ++ int offset = 0, j, num; ++ void *a; ++ ++ num = classify_argument (*p_arg, classes, &offset); ++ for (j=0, a=*p_argv; jgpr[gprcount++] = *(long long *)a; ++ break; ++ case X86_64_SSE_CLASS: ++ floatfloat2sse (a, &stack->sse[ssecount++]); ++ break; ++ case X86_64_SSESF_CLASS: ++ float2sse (*(float *)a, &stack->sse[ssecount++]); ++ break; ++ case X86_64_SSEDF_CLASS: ++ double2sse (*(double *)a, &stack->sse[ssecount++]); ++ break; ++ default: ++ abort(); ++ } ++ } ++ } ++ } ++} ++ ++/* Perform machine dependent cif processing. */ ++ffi_status ++ffi_prep_cif_machdep (ffi_cif *cif) ++{ ++ int gprcount, ssecount, i, g, s; ++ ++ gprcount = ssecount = 0; ++ ++ /* Reset the byte count. We handle this size estimation here. */ ++ cif->bytes = 0; ++ ++ /* If the return value should be passed in memory, pass the pointer ++ as the first argument. The actual memory isn't allocated here. */ ++ if (cif->rtype->type != FFI_TYPE_VOID ++ && examine_argument (cif->rtype, 1, &g, &s) == 0) ++ gprcount = 1; ++ ++ /* Go over all arguments and determine the way they should be passed. ++ If it's in a register and there is space for it, let that be so. If ++ not, add it's size to the stack byte count. */ ++ for (i=0; inargs; i++) ++ { ++ if (examine_argument (cif->arg_types[i], 0, &g, &s) == 0 ++ || gprcount + g > MAX_GPR_REGS || ssecount + s > MAX_SSE_REGS) ++ { ++ /* This is passed in memory. First align to the basic type. */ ++ cif->bytes = ALIGN(cif->bytes, cif->arg_types[i]->alignment); ++ ++ /* Stack arguments are *always* at least 8 byte aligned. */ ++ cif->bytes = ALIGN(cif->bytes, 8); ++ ++ /* Now add the size of this argument. */ ++ cif->bytes += cif->arg_types[i]->size; ++ } ++ else ++ { ++ gprcount += g; ++ ssecount += s; ++ } ++ } ++ ++ /* Set the flag for the closures return. */ ++ switch (cif->rtype->type) ++ { ++ case FFI_TYPE_VOID: ++ case FFI_TYPE_STRUCT: ++ case FFI_TYPE_SINT64: ++ case FFI_TYPE_FLOAT: ++ case FFI_TYPE_DOUBLE: ++ case FFI_TYPE_LONGDOUBLE: ++ cif->flags = (unsigned) cif->rtype->type; ++ break; ++ ++ case FFI_TYPE_UINT64: ++ cif->flags = FFI_TYPE_SINT64; ++ break; ++ ++ default: ++ cif->flags = FFI_TYPE_INT; ++ break; ++ } ++ ++ return FFI_OK; ++} ++ ++typedef struct ++{ ++ long gpr[2]; ++ __int128_t sse[2]; ++ long double st0; ++} return_value; ++ ++void ++ffi_fill_return_value (return_value *rv, extended_cif *ecif) ++{ ++ enum x86_64_reg_class classes[MAX_CLASSES]; ++ int i = 0, num; ++ long *gpr = rv->gpr; ++ __int128_t *sse = rv->sse; ++ signed char sc; ++ signed short ss; ++ ++ /* This is needed because of the way x86-64 handles signed short ++ integers. */ ++ switch (ecif->cif->rtype->type) ++ { ++ case FFI_TYPE_SINT8: ++ sc = *(signed char *)gpr; ++ *(long long *)ecif->rvalue = (long long)sc; ++ return; ++ case FFI_TYPE_SINT16: ++ ss = *(signed short *)gpr; ++ *(long long *)ecif->rvalue = (long long)ss; ++ return; ++ default: ++ /* Just continue. */ ++ ; ++ } ++ ++ num = classify_argument (ecif->cif->rtype, classes, &i); ++ ++ if (num == 0) ++ /* Return in memory. */ ++ ecif->rvalue = (void *) rv->gpr[0]; ++ else if (num == 2 && classes[0] == X86_64_X87_CLASS && ++ classes[1] == X86_64_X87UP_CLASS) ++ /* This is a long double (this is easiest to handle this way instead ++ of an eightbyte at a time as in the loop below. */ ++ *((long double *)ecif->rvalue) = rv->st0; ++ else ++ { ++ void *a; ++ ++ for (i=0, a=ecif->rvalue; irtype, 1, &dummy, &dummy) == 0)) ++ { ++ /*@-sysunrecog@*/ ++ ecif.rvalue = alloca(cif->rtype->size); ++ /*@=sysunrecog@*/ ++ } ++ else ++ ecif.rvalue = rvalue; ++ ++ /* Stack must always be 16byte aligned. Make it so. */ ++ cif->bytes = ALIGN(cif->bytes, 16); ++ ++ switch (cif->abi) ++ { ++ case FFI_SYSV: ++ /* Calling 32bit code from 64bit is not possible */ ++ FFI_ASSERT(0); ++ break; ++ ++ case FFI_UNIX64: ++ /*@-usedef@*/ ++ ffi_call_UNIX64 (ffi_prep_args, ffi_fill_return_value, &ecif, ++ cif->bytes, ecif.rvalue, fn); ++ /*@=usedef@*/ ++ break; ++ ++ default: ++ FFI_ASSERT(0); ++ break; ++ } ++} ++ ++extern void ffi_closure_UNIX64(void); ++ ++ffi_status ++ffi_prep_closure (ffi_closure* closure, ++ ffi_cif* cif, ++ void (*fun)(ffi_cif*, void*, void**, void*), ++ void *user_data) ++{ ++ volatile unsigned short *tramp; ++ ++ /* FFI_ASSERT (cif->abi == FFI_OSF); */ ++ ++ tramp = (volatile unsigned short *) &closure->tramp[0]; ++ tramp[0] = 0xbb49; /* mov , %r11 */ ++ tramp[5] = 0xba49; /* mov , %r10 */ ++ tramp[10] = 0xff49; /* jmp *%r11 */ ++ tramp[11] = 0x00e3; ++ *(void * volatile *) &tramp[1] = ffi_closure_UNIX64; ++ *(void * volatile *) &tramp[6] = closure; ++ ++ closure->cif = cif; ++ closure->fun = fun; ++ closure->user_data = user_data; ++ ++ return FFI_OK; ++} ++ ++int ++ffi_closure_UNIX64_inner(ffi_closure *closure, va_list l, void *rp) ++{ ++ ffi_cif *cif; ++ void **avalue; ++ ffi_type **arg_types; ++ long i, avn, argn; ++ ++ cif = closure->cif; ++ avalue = alloca(cif->nargs * sizeof(void *)); ++ ++ argn = 0; ++ ++ i = 0; ++ avn = cif->nargs; ++ arg_types = cif->arg_types; ++ ++ /* Grab the addresses of the arguments from the stack frame. */ ++ while (i < avn) ++ { ++ switch (arg_types[i]->type) ++ { ++ case FFI_TYPE_SINT8: ++ case FFI_TYPE_UINT8: ++ case FFI_TYPE_SINT16: ++ case FFI_TYPE_UINT16: ++ case FFI_TYPE_SINT32: ++ case FFI_TYPE_UINT32: ++ case FFI_TYPE_SINT64: ++ case FFI_TYPE_UINT64: ++ case FFI_TYPE_POINTER: ++ { ++ if (l->gp_offset > 48-8) ++ { ++ avalue[i] = l->overflow_arg_area; ++ l->overflow_arg_area = (char *)l->overflow_arg_area + 8; ++ } ++ else ++ { ++ avalue[i] = (char *)l->reg_save_area + l->gp_offset; ++ l->gp_offset += 8; ++ } ++ } ++ break; ++ ++ case FFI_TYPE_STRUCT: ++ /* FIXME */ ++ FFI_ASSERT(0); ++ break; ++ ++ case FFI_TYPE_DOUBLE: ++ { ++ if (l->fp_offset > 176-16) ++ { ++ avalue[i] = l->overflow_arg_area; ++ l->overflow_arg_area = (char *)l->overflow_arg_area + 8; ++ } ++ else ++ { ++ avalue[i] = (char *)l->reg_save_area + l->fp_offset; ++ l->fp_offset += 16; ++ } ++ } ++#if DEBUG_FFI ++ fprintf (stderr, "double arg %d = %g\n", i, *(double *)avalue[i]); ++#endif ++ break; ++ ++ case FFI_TYPE_FLOAT: ++ { ++ if (l->fp_offset > 176-16) ++ { ++ avalue[i] = l->overflow_arg_area; ++ l->overflow_arg_area = (char *)l->overflow_arg_area + 8; ++ } ++ else ++ { ++ avalue[i] = (char *)l->reg_save_area + l->fp_offset; ++ l->fp_offset += 16; ++ } ++ } ++#if DEBUG_FFI ++ fprintf (stderr, "float arg %d = %g\n", i, *(float *)avalue[i]); ++#endif ++ break; ++ ++ default: ++ FFI_ASSERT(0); ++ } ++ ++ argn += ALIGN(arg_types[i]->size, SIZEOF_ARG) / SIZEOF_ARG; ++ i++; ++ } ++ ++ /* Invoke the closure. */ ++ (closure->fun) (cif, rp, avalue, closure->user_data); ++ ++ /* FIXME: Structs not supported. */ ++ FFI_ASSERT(cif->rtype->type != FFI_TYPE_STRUCT); ++ ++ /* Tell ffi_closure_UNIX64 how to perform return type promotions. */ ++ ++ return cif->rtype->type; ++} ++#endif /* ifndef __x86_64__ */ +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/x86/sysv.S gcc/libffi/src/x86/sysv.S +--- gcc-3.2.2.orig/libffi/src/x86/sysv.S Tue Jul 17 02:10:53 2001 ++++ gcc/libffi/src/x86/sysv.S Fri Jul 19 08:08:31 2002 +@@ -1,5 +1,5 @@ + /* ----------------------------------------------------------------------- +- sysv.S - Copyright (c) 1996, 1998, 2001 Cygnus Solutions ++ sysv.S - Copyright (c) 1996, 1998, 2001, 2002 Cygnus Solutions + + X86 Foreign Function Interface + +@@ -23,6 +23,8 @@ + OTHER DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + ++#ifndef __x86_64__ ++ + #define LIBFFI_ASM + #include + +@@ -163,3 +165,5 @@ + .align 4 + .LEFDE1: + .set .LLFDE1,.LEFDE1-.LSFDE1 ++ ++#endif /* ifndef __x86_64__ */ +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/x86/unix64.S gcc/libffi/src/x86/unix64.S +--- gcc-3.2.2.orig/libffi/src/x86/unix64.S Thu Jan 1 09:00:00 1970 ++++ gcc/libffi/src/x86/unix64.S Wed Jan 29 00:54:28 2003 +@@ -0,0 +1,302 @@ ++/* ----------------------------------------------------------------------- ++ unix64.S - Copyright (c) 2002 Bo Thorsen ++ ++ x86-64 Foreign Function Interface ++ ++ Permission is hereby granted, free of charge, to any person obtaining ++ a copy of this software and associated documentation files (the ++ ``Software''), to deal in the Software without restriction, including ++ without limitation the rights to use, copy, modify, merge, publish, ++ distribute, sublicense, and/or sell copies of the Software, and to ++ permit persons to whom the Software is furnished to do so, subject to ++ the following conditions: ++ ++ The above copyright notice and this permission notice shall be included ++ in all copies or substantial portions of the Software. ++ ++ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS ++ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ++ IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR ++ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ++ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ OTHER DEALINGS IN THE SOFTWARE. ++ ----------------------------------------------------------------------- */ ++ ++#ifdef __x86_64__ ++#define LIBFFI_ASM ++#include ++ ++ .section .rodata ++.LC0: ++ .string "asm in progress %lld\n" ++.LC1: ++ .string "asm in progress\n" ++.text ++ .align 2 ++.globl ffi_call_UNIX64 ++ .type ffi_call_UNIX64,@function ++ ++ffi_call_UNIX64: ++.LFB1: ++ pushq %rbp ++.LCFI0: ++ movq %rsp, %rbp ++.LCFI1: ++ /* Save all arguments */ ++ subq $48, %rsp ++.LCFI2: ++ movq %rdi, -8(%rbp) /* ffi_prep_args */ ++ movq %rsi, -16(%rbp) /* ffi_fill_return_value */ ++ movq %rdx, -24(%rbp) /* ecif */ ++ movq %rcx, -32(%rbp) /* cif->bytes */ ++ movq %r8, -40(%rbp) /* ecif.rvalue */ ++ movq %r9, -48(%rbp) /* fn */ ++ ++ /* Make room for all of the new args and the register args */ ++ addl $176, %ecx ++.LCFI3: ++ subq %rcx, %rsp ++.LCFI4: ++ /* Setup the call to ffi_prep_args. */ ++ movq %rdi, %rax /* &ffi_prep_args */ ++ movq %rsp, %rdi /* stackLayout */ ++ movq %rdx, %rsi /* ecif */ ++ call *%rax /* ffi_prep_args(stackLayout, ecif);*/ ++ ++ /* ffi_prep_args have put all the register contents into the */ ++ /* stackLayout struct. Now put the register values in place. */ ++ movq (%rsp), %rdi ++ movq 8(%rsp), %rsi ++ movq 16(%rsp), %rdx ++ movq 24(%rsp), %rcx ++ movq 32(%rsp), %r8 ++ movq 40(%rsp), %r9 ++ movaps 48(%rsp), %xmm0 ++ movaps 64(%rsp), %xmm1 ++ movaps 80(%rsp), %xmm2 ++ movaps 96(%rsp), %xmm3 ++ movaps 112(%rsp), %xmm4 ++ movaps 128(%rsp), %xmm5 ++ movaps 144(%rsp), %xmm6 ++ movaps 160(%rsp), %xmm7 ++ ++ /* Remove space for stackLayout so stack arguments are placed ++ correctly for the call. */ ++.LCFI5: ++ addq $176, %rsp ++.LCFI6: ++ /* Call the user function. */ ++ call *-48(%rbp) ++ ++ /* Make stack space for the return_value struct. */ ++ subq $64, %rsp ++ ++ /* Fill in all potential return values to this struct. */ ++ movq %rax, (%rsp) ++ movq %rdx, 8(%rsp) ++ movaps %xmm0, 16(%rsp) ++ movaps %xmm1, 32(%rsp) ++ fstpt 48(%rsp) ++ ++ /* Now call ffi_fill_return_value. */ ++ movq %rsp, %rdi /* struct return_value */ ++ movq -24(%rbp), %rsi /* ecif */ ++ movq -16(%rbp), %rax /* &ffi_fill_return_value */ ++ call *%rax /* call it */ ++ ++ /* And the work is done. */ ++ leave ++ ret ++.LFE1: ++.ffi_call_UNIX64_end: ++ .size ffi_call_UNIX64,.ffi_call_UNIX64_end-ffi_call_UNIX64 ++ ++.text ++ .align 2 ++.globl float2sse ++ .type float2sse,@function ++float2sse: ++ /* Save the contents of this sse-float in a pointer. */ ++ movaps %xmm0, (%rdi) ++ ret ++ ++ .align 2 ++.globl floatfloat2sse ++ .type floatfloat2sse,@function ++floatfloat2sse: ++ /* Save the contents of these two sse-floats in a pointer. */ ++ movq (%rdi), %xmm0 ++ movaps %xmm0, (%rsi) ++ ret ++ ++ .align 2 ++.globl double2sse ++ .type double2sse,@function ++double2sse: ++ /* Save the contents of this sse-double in a pointer. */ ++ movaps %xmm0, (%rdi) ++ ret ++ ++ .align 2 ++.globl sse2float ++ .type sse2float,@function ++sse2float: ++ /* Save the contents of this sse-float in a pointer. */ ++ movaps (%rdi), %xmm0 ++ ret ++ ++ .align 2 ++.globl sse2double ++ .type sse2double,@function ++sse2double: ++ /* Save the contents of this pointer in a sse-double. */ ++ movaps (%rdi), %xmm0 ++ ret ++ ++ .align 2 ++.globl sse2floatfloat ++ .type sse2floatfloat,@function ++sse2floatfloat: ++ /* Save the contents of this pointer in two sse-floats. */ ++ movaps (%rdi), %xmm0 ++ movq %xmm0, (%rsi) ++ ret ++ ++ .align 2 ++.globl ffi_closure_UNIX64 ++ .type ffi_closure_UNIX64,@function ++ ++ffi_closure_UNIX64: ++.LFB2: ++ pushq %rbp ++.LCFI10: ++ movq %rsp, %rbp ++.LCFI11: ++ subq $240, %rsp ++.LCFI12: ++ movq %rdi, -176(%rbp) ++ movq %rsi, -168(%rbp) ++ movq %rdx, -160(%rbp) ++ movq %rcx, -152(%rbp) ++ movq %r8, -144(%rbp) ++ movq %r9, -136(%rbp) ++ /* FIXME: We can avoid all this stashing of XMM registers by ++ (in ffi_prep_closure) computing the number of ++ floating-point args and moving it into %rax before calling ++ this function. Once this is done, uncomment the next few ++ lines and only the essential XMM registers will be written ++ to memory. This is a significant saving. */ ++/* movzbl %al, %eax */ ++/* movq %rax, %rdx */ ++/* leaq 0(,%rdx,4), %rax */ ++/* leaq 2f(%rip), %rdx */ ++/* subq %rax, %rdx */ ++ leaq -1(%rbp), %rax ++/* jmp *%rdx */ ++ movaps %xmm7, -15(%rax) ++ movaps %xmm6, -31(%rax) ++ movaps %xmm5, -47(%rax) ++ movaps %xmm4, -63(%rax) ++ movaps %xmm3, -79(%rax) ++ movaps %xmm2, -95(%rax) ++ movaps %xmm1, -111(%rax) ++ movaps %xmm0, -127(%rax) ++2: ++ movl %edi, -180(%rbp) ++ movl $0, -224(%rbp) ++ movl $48, -220(%rbp) ++ leaq 16(%rbp), %rax ++ movq %rax, -216(%rbp) ++ leaq -176(%rbp), %rdx ++ movq %rdx, -208(%rbp) ++ leaq -224(%rbp), %rsi ++ movq %r10, %rdi ++ movq %rsp, %rdx ++ call ffi_closure_UNIX64_inner@PLT ++ ++ cmpl $FFI_TYPE_FLOAT, %eax ++ je 1f ++ cmpl $FFI_TYPE_DOUBLE, %eax ++ je 2f ++ cmpl $FFI_TYPE_LONGDOUBLE, %eax ++ je 3f ++ cmpl $FFI_TYPE_STRUCT, %eax ++ je 4f ++ popq %rax ++ leave ++ ret ++1: ++2: ++3: ++ movaps -240(%rbp), %xmm0 ++ leave ++ ret ++4: ++ leave ++ ret ++.LFE2: ++ ++ .section .eh_frame,"a",@progbits ++.Lframe0: ++ .long .LECIE1-.LSCIE1 ++.LSCIE1: ++ .long 0x0 ++ .byte 0x1 ++ .string "zR" ++ .uleb128 0x1 ++ .sleb128 -8 ++ .byte 0x10 ++ .uleb128 0x1 ++ .byte 0x1b ++ .byte 0xc ++ .uleb128 0x7 ++ .uleb128 0x8 ++ .byte 0x90 ++ .uleb128 0x1 ++ .align 8 ++.LECIE1: ++.LSFDE1: ++ .long .LEFDE1-.LASFDE1 ++.LASFDE1: ++ .long .LASFDE1-.Lframe0 ++ ++ .long .LFB1-. ++ .long .LFE1-.LFB1 ++ .uleb128 0x0 ++ .byte 0x4 # DW_CFA_advance_loc4 ++ .long .LCFI0-.LFB1 ++ .byte 0xe # DW_CFA_def_cfa_offset ++ .uleb128 0x10 ++ .byte 0x86 # DW_CFA_offset: r6 at cfa-16 ++ .uleb128 0x2 ++ .byte 0x4 # DW_CFA_advance_loc4 ++ .long .LCFI1-.LCFI0 ++ .byte 0x86 # DW_CFA_offset: r6 at cfa-16 ++ .uleb128 0x2 ++ .byte 0xd # DW_CFA_def_cfa_reg: r6 ++ .uleb128 0x6 ++ .align 8 ++.LEFDE1: ++.LSFDE3: ++ .long .LEFDE3-.LASFDE3 # FDE Length ++.LASFDE3: ++ .long .LASFDE3-.Lframe0 # FDE CIE offset ++ ++ .long .LFB2-. # FDE initial location ++ .long .LFE2-.LFB2 # FDE address range ++ .uleb128 0x0 # Augmentation size ++ .byte 0x4 # DW_CFA_advance_loc4 ++ .long .LCFI10-.LFB2 ++ .byte 0xe # DW_CFA_def_cfa_offset ++ .uleb128 0x10 ++ .byte 0x86 # DW_CFA_offset, column 0x6 ++ .uleb128 0x2 ++ .byte 0x4 # DW_CFA_advance_loc4 ++ .long .LCFI11-.LCFI10 ++ .byte 0xd # DW_CFA_def_cfa_register ++ .uleb128 0x6 ++ .align 8 ++.LEFDE3: ++ ++#endif /* __x86_64__ */ +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/x86/win32.S gcc/libffi/src/x86/win32.S +--- gcc-3.2.2.orig/libffi/src/x86/win32.S Tue Mar 27 11:39:16 2001 ++++ gcc/libffi/src/x86/win32.S Fri Dec 6 10:16:45 2002 +@@ -1,5 +1,8 @@ + /* ----------------------------------------------------------------------- +- win32.S - Copyright (c) 1996, 1998, 2001 Cygnus Solutions ++ win32.S - Copyright (c) 1996, 1998, 2001, 2002 Red Hat, Inc. ++ Copyright (c) 2001 John Beniton ++ Copyright (c) 2002 Ranjit Mathew ++ + + X86 Foreign Function Interface + +@@ -52,7 +55,10 @@ + # Return stack to previous state and call the function + addl $8,%esp + +- call *28(%ebp) ++ # FIXME: Align the stack to a 128-bit boundary to avoid ++ # potential performance hits. ++ ++ call *28(%ebp) + + # Remove the space we pushed for the args + movl 16(%ebp),%ecx +@@ -123,3 +129,98 @@ + ret + + .ffi_call_SYSV_end: ++ ++ # This assumes we are using gas. ++ .balign 16 ++.globl _ffi_call_STDCALL ++ ++_ffi_call_STDCALL: ++ pushl %ebp ++ movl %esp,%ebp ++ ++ # Make room for all of the new args. ++ movl 16(%ebp),%ecx ++ subl %ecx,%esp ++ ++ movl %esp,%eax ++ ++ # Place all of the ffi_prep_args in position ++ pushl 12(%ebp) ++ pushl %eax ++ call *8(%ebp) ++ ++ # Return stack to previous state and call the function ++ addl $8,%esp ++ ++ # FIXME: Align the stack to a 128-bit boundary to avoid ++ # potential performance hits. ++ ++ call *28(%ebp) ++ ++ # stdcall functions pop arguments off the stack themselves ++ ++ # Load %ecx with the return type code ++ movl 20(%ebp),%ecx ++ ++ # If the return value pointer is NULL, assume no return value. ++ cmpl $0,24(%ebp) ++ jne sc_retint ++ ++ # Even if there is no space for the return value, we are ++ # obliged to handle floating-point values. ++ cmpl $FFI_TYPE_FLOAT,%ecx ++ jne sc_noretval ++ fstp %st(0) ++ ++ jmp sc_epilogue ++ ++sc_retint: ++ cmpl $FFI_TYPE_INT,%ecx ++ jne sc_retfloat ++ # Load %ecx with the pointer to storage for the return value ++ movl 24(%ebp),%ecx ++ movl %eax,0(%ecx) ++ jmp sc_epilogue ++ ++sc_retfloat: ++ cmpl $FFI_TYPE_FLOAT,%ecx ++ jne sc_retdouble ++ # Load %ecx with the pointer to storage for the return value ++ movl 24(%ebp),%ecx ++ fstps (%ecx) ++ jmp sc_epilogue ++ ++sc_retdouble: ++ cmpl $FFI_TYPE_DOUBLE,%ecx ++ jne sc_retlongdouble ++ # Load %ecx with the pointer to storage for the return value ++ movl 24(%ebp),%ecx ++ fstpl (%ecx) ++ jmp sc_epilogue ++ ++sc_retlongdouble: ++ cmpl $FFI_TYPE_LONGDOUBLE,%ecx ++ jne sc_retint64 ++ # Load %ecx with the pointer to storage for the return value ++ movl 24(%ebp),%ecx ++ fstpt (%ecx) ++ jmp sc_epilogue ++ ++sc_retint64: ++ cmpl $FFI_TYPE_SINT64,%ecx ++ jne sc_retstruct ++ # Load %ecx with the pointer to storage for the return value ++ movl 24(%ebp),%ecx ++ movl %eax,0(%ecx) ++ movl %edx,4(%ecx) ++ ++sc_retstruct: ++ # Nothing to do! ++ ++sc_noretval: ++sc_epilogue: ++ movl %ebp,%esp ++ popl %ebp ++ ret ++ ++.ffi_call_STDCALL_end: +--- gcc-3.2.2.orig/libjava/configure.host Mon Jun 10 13:15:26 2002 ++++ gcc-3.2.2/libjava/configure.host Sat Feb 15 19:57:25 2003 +@@ -115,6 +115,12 @@ + enable_getenv_properties_default=no + enable_main_args_default=no + ;; ++ sh-* | sh[34]*-*) ++ sysdeps_dir=sh ++ libgcj_flags="${libgcj_flags} -mieee" ++ libgcj_interpreter=yes ++ enable_hash_synchronization_default=yes ++ ;; + esac + + # This case statement supports generic port properties and may refine +@@ -126,7 +132,8 @@ + powerpc*-linux* | \ + alpha*-linux* | \ + sparc*-linux* | \ +- ia64-*) ++ ia64-* | \ ++ sh-linux* | sh[34]*-linux*) + can_unwind_signal=yes + ;; + *-*-darwin*) diff --git a/patches/gcc/3.2.3/150-gcc-3.2.3-ppc-asm-spec.patch b/patches/gcc/3.2.3/150-gcc-3.2.3-ppc-asm-spec.patch deleted file mode 100644 index e0ccd9f..0000000 --- a/patches/gcc/3.2.3/150-gcc-3.2.3-ppc-asm-spec.patch +++ /dev/null @@ -1,54 +0,0 @@ -Based on gcc-3.4.0/gcc-3.3.3h-ppc-asm-spec.patch - -Fixes the following errors when building gcc for ppc7450: - -/tmp/ccYph3gd.s: Assembler messages: -/tmp/ccYph3gd.s:3823: Error: Unrecognized opcode: `mfvrsave' -/tmp/ccYph3gd.s:3857: Error: Unrecognized opcode: `stvx' -/tmp/ccYph3gd.s:4026: Error: Unrecognized opcode: `lvx' -/tmp/ccYph3gd.s:4027: Error: Unrecognized opcode: `mtvrsave' -make[2]: *** [libgcc/./unwind-dw2.o] Error 1 -make[2]: Leaving directory `/opt/crosstool-0.28-rc35/build/powerpc-7450-linux-gnu/gcc-3.2.3-glibc-2.3.2/build-gcc-core/gcc' -make[1]: *** [stmp-multilib] Error 2 -make[1]: Leaving directory `/opt/crosstool-0.28-rc35/build/powerpc-7450-linux-gnu/gcc-3.2.3-glibc-2.3.2/build-gcc-core/gcc' -make: *** [all-gcc] Error 2 - -Note that the "-mcpu=7450" option must appear on the "gcc" command line in -order for "-maltivec" to be passed to the assembler. Or, "-maltivec" itself -may be passed to the "gcc" command. - -Contributed by Tom Warzeka - -=================================================================== ---- gcc-3.2.3/gcc/config/rs6000/rs6000.h~ 2003-03-29 07:39:20.000000000 -0500 -+++ gcc-3.2.3/gcc/config/rs6000/rs6000.h 2004-08-23 16:33:21.000000000 -0400 -@@ -77,8 +77,8 @@ - %{mcpu=604e: -D_ARCH_PPC} \ - %{mcpu=620: -D_ARCH_PPC} \ - %{mcpu=740: -D_ARCH_PPC} \ --%{mcpu=7400: -D_ARCH_PPC} \ --%{mcpu=7450: -D_ARCH_PPC} \ -+%{mcpu=7400: -D_ARCH_PPC -D__ALTIVEC__} \ -+%{mcpu=7450: -D_ARCH_PPC -D__ALTIVEC__} \ - %{mcpu=750: -D_ARCH_PPC} \ - %{mcpu=801: -D_ARCH_PPC} \ - %{mcpu=821: -D_ARCH_PPC} \ -@@ -117,14 +117,15 @@ - %{mcpu=604e: -mppc} \ - %{mcpu=620: -mppc} \ - %{mcpu=740: -mppc} \ --%{mcpu=7400: -mppc} \ --%{mcpu=7450: -mppc} \ -+%{mcpu=7400: -mppc -maltivec} \ -+%{mcpu=7450: -mppc -maltivec} \ - %{mcpu=750: -mppc} \ - %{mcpu=801: -mppc} \ - %{mcpu=821: -mppc} \ - %{mcpu=823: -mppc} \ - %{mcpu=860: -mppc} \ --%{maltivec: -maltivec}" -+%{maltivec: -maltivec} \ -+-many" - - #define CPP_DEFAULT_SPEC "" - diff --git a/patches/gcc/3.2.3/150-ppc-asm-spec.patch b/patches/gcc/3.2.3/150-ppc-asm-spec.patch new file mode 100644 index 0000000..e0ccd9f --- /dev/null +++ b/patches/gcc/3.2.3/150-ppc-asm-spec.patch @@ -0,0 +1,54 @@ +Based on gcc-3.4.0/gcc-3.3.3h-ppc-asm-spec.patch + +Fixes the following errors when building gcc for ppc7450: + +/tmp/ccYph3gd.s: Assembler messages: +/tmp/ccYph3gd.s:3823: Error: Unrecognized opcode: `mfvrsave' +/tmp/ccYph3gd.s:3857: Error: Unrecognized opcode: `stvx' +/tmp/ccYph3gd.s:4026: Error: Unrecognized opcode: `lvx' +/tmp/ccYph3gd.s:4027: Error: Unrecognized opcode: `mtvrsave' +make[2]: *** [libgcc/./unwind-dw2.o] Error 1 +make[2]: Leaving directory `/opt/crosstool-0.28-rc35/build/powerpc-7450-linux-gnu/gcc-3.2.3-glibc-2.3.2/build-gcc-core/gcc' +make[1]: *** [stmp-multilib] Error 2 +make[1]: Leaving directory `/opt/crosstool-0.28-rc35/build/powerpc-7450-linux-gnu/gcc-3.2.3-glibc-2.3.2/build-gcc-core/gcc' +make: *** [all-gcc] Error 2 + +Note that the "-mcpu=7450" option must appear on the "gcc" command line in +order for "-maltivec" to be passed to the assembler. Or, "-maltivec" itself +may be passed to the "gcc" command. + +Contributed by Tom Warzeka + +=================================================================== +--- gcc-3.2.3/gcc/config/rs6000/rs6000.h~ 2003-03-29 07:39:20.000000000 -0500 ++++ gcc-3.2.3/gcc/config/rs6000/rs6000.h 2004-08-23 16:33:21.000000000 -0400 +@@ -77,8 +77,8 @@ + %{mcpu=604e: -D_ARCH_PPC} \ + %{mcpu=620: -D_ARCH_PPC} \ + %{mcpu=740: -D_ARCH_PPC} \ +-%{mcpu=7400: -D_ARCH_PPC} \ +-%{mcpu=7450: -D_ARCH_PPC} \ ++%{mcpu=7400: -D_ARCH_PPC -D__ALTIVEC__} \ ++%{mcpu=7450: -D_ARCH_PPC -D__ALTIVEC__} \ + %{mcpu=750: -D_ARCH_PPC} \ + %{mcpu=801: -D_ARCH_PPC} \ + %{mcpu=821: -D_ARCH_PPC} \ +@@ -117,14 +117,15 @@ + %{mcpu=604e: -mppc} \ + %{mcpu=620: -mppc} \ + %{mcpu=740: -mppc} \ +-%{mcpu=7400: -mppc} \ +-%{mcpu=7450: -mppc} \ ++%{mcpu=7400: -mppc -maltivec} \ ++%{mcpu=7450: -mppc -maltivec} \ + %{mcpu=750: -mppc} \ + %{mcpu=801: -mppc} \ + %{mcpu=821: -mppc} \ + %{mcpu=823: -mppc} \ + %{mcpu=860: -mppc} \ +-%{maltivec: -maltivec}" ++%{maltivec: -maltivec} \ ++-many" + + #define CPP_DEFAULT_SPEC "" + diff --git a/patches/gcc/3.2.3/160-gcc-3.2.3-trap-posix.patch b/patches/gcc/3.2.3/160-gcc-3.2.3-trap-posix.patch deleted file mode 100644 index 4751e9d..0000000 --- a/patches/gcc/3.2.3/160-gcc-3.2.3-trap-posix.patch +++ /dev/null @@ -1,45 +0,0 @@ -# -# Submitted-By: Marc Kleine-Budde , 2005-04-20 -# -# Error: -# -# creating libintl.h -# Configuring etc... -# loading cache ../config.cache -# checking for a BSD compatible install... (cached) /usr/bin/install -c -# creating ./config.status -# creating Makefile -# trap: usage: trap [-lp] [[arg] signal_spec ...] -# -# Description: -# -# non-posix conform usage of trap causes bash >= 3.0 to fail -# -# e.g.: http://sourceware.org/ml/crossgcc/2004-12/msg00132.html -# -# Status: -# -# fixed in gcc >= 3.3.5 -# backport of gcc-3.3.5 fix -# -diff -ruN gcc-3.2.3-orig/configure gcc-3.2.3/configure ---- gcc-3.2.3-orig/configure 2002-06-24 18:14:28.000000000 +0200 -+++ gcc-3.2.3/configure 2005-04-20 18:42:49.000000000 +0200 -@@ -697,7 +697,7 @@ - if test -f skip-this-dir; then - # Perform the same cleanup as the trap handler, minus the "exit 1" of course, - # and reset the trap handler. -- trap 0 -+ trap '' 0 - rm -rf Makefile* ${tmpdir} - # Execute the final clean-up actions - ${config_shell} skip-this-dir -@@ -1615,7 +1615,7 @@ - # Perform the same cleanup as the trap handler, minus the "exit 1" of course, - # and reset the trap handler. - rm -rf ${tmpdir} --trap 0 -+trap '' 0 - - exit 0 - diff --git a/patches/gcc/3.2.3/160-trap-posix.patch b/patches/gcc/3.2.3/160-trap-posix.patch new file mode 100644 index 0000000..4751e9d --- /dev/null +++ b/patches/gcc/3.2.3/160-trap-posix.patch @@ -0,0 +1,45 @@ +# +# Submitted-By: Marc Kleine-Budde , 2005-04-20 +# +# Error: +# +# creating libintl.h +# Configuring etc... +# loading cache ../config.cache +# checking for a BSD compatible install... (cached) /usr/bin/install -c +# creating ./config.status +# creating Makefile +# trap: usage: trap [-lp] [[arg] signal_spec ...] +# +# Description: +# +# non-posix conform usage of trap causes bash >= 3.0 to fail +# +# e.g.: http://sourceware.org/ml/crossgcc/2004-12/msg00132.html +# +# Status: +# +# fixed in gcc >= 3.3.5 +# backport of gcc-3.3.5 fix +# +diff -ruN gcc-3.2.3-orig/configure gcc-3.2.3/configure +--- gcc-3.2.3-orig/configure 2002-06-24 18:14:28.000000000 +0200 ++++ gcc-3.2.3/configure 2005-04-20 18:42:49.000000000 +0200 +@@ -697,7 +697,7 @@ + if test -f skip-this-dir; then + # Perform the same cleanup as the trap handler, minus the "exit 1" of course, + # and reset the trap handler. +- trap 0 ++ trap '' 0 + rm -rf Makefile* ${tmpdir} + # Execute the final clean-up actions + ${config_shell} skip-this-dir +@@ -1615,7 +1615,7 @@ + # Perform the same cleanup as the trap handler, minus the "exit 1" of course, + # and reset the trap handler. + rm -rf ${tmpdir} +-trap 0 ++trap '' 0 + + exit 0 + diff --git a/patches/gcc/3.2.3/170-gcc-3.3-libstdc++-v3-dg.exp.patch b/patches/gcc/3.2.3/170-gcc-3.3-libstdc++-v3-dg.exp.patch deleted file mode 100644 index aafc130..0000000 --- a/patches/gcc/3.2.3/170-gcc-3.3-libstdc++-v3-dg.exp.patch +++ /dev/null @@ -1,54 +0,0 @@ -Without this patch, the command - -RUNTESTFLAGS=--target=powerpc-750-linux-gnu -v -v -v -v make check-target-libstdc++-v3 - -fails in two ways: -1. the -L option meant to locate the testsuite directory is incorrect, and -2. the wrong compiler is invoked, causing all sorts of havoc, not least of which -is the native compiler is invoked when we really wanted to invoke the cross-compiler -we just built. - -Here's an example log of the problem in action. Every testcase fails, this shows just one: -------------- -Invoking the compiler as g++ -ggdb3 -DDEBUG_ASSERT -I/home3/dank/wk/ixos/dap_interim/linux/3rdParty/crosstool/crosstool-0.12/build/powerpc-750-linux-gnu/gcc-3.3-glibc-2.2.5/gcc-3.3/libstdc++-v3/testsuite /home3/dank/wk/ixos/dap_interim/linux/3rdParty/crosstool/crosstool-0.12/build/powerpc-750-linux-gnu/gcc-3.3-glibc-2.2.5/gcc-3.3/libstdc++-v3/testsuite/20_util/binders.cc -g -O2 -DDEBUG_ASSERT -L/testsuite -lv3test -lm -o ./binders.exe -compiler exited with status 1 -output is: -/usr/lib/gcc-lib/i386-linux/2.95.4/../../../../include/g++-3/stl_function.h: In method `void binder2nd >::operator ()(const Elem &) const':^M -/usr/lib/gcc-lib/i386-linux/2.95.4/../../../../include/g++-3/stl_algo.h:83: instantiated from `for_each > >(Elem *, Elem *, binder2nd >)'^M -/home3/dank/wk/ixos/dap_interim/linux/3rdParty/crosstool/crosstool-0.12/build/powerpc-750-linux-gnu/gcc-3.3-glibc-2.2.5/gcc-3.3/libstdc++-v3/testsuite/20_util/binders.cc:43: instantiated from here^M -/usr/lib/gcc-lib/i386-linux/2.95.4/../../../../include/g++-3/stl_function.h:224: conversion from `const Elem' to `Elem &' discards qualifiers^M -/usr/lib/gcc-lib/i386-linux/2.95.4/../../../../include/g++-3/stl_function.h:622: in passing argument 1 of `mem_fun1_ref_t::operator ()(Elem &, int) const'^M -... -FAIL: 20_util/binders.cc (test for excess errors) -WARNING: 20_util/binders.cc compilation failed to produce executable -------------- - -And here's the patch. I'm not happy with it, and it probably gets some cases wrong, -but it seems to work for the common native case and for my cross-compiler case. - ---- gcc-3.3/libstdc++-v3/testsuite/lib/libstdc++-v3-dg.exp.old Sun Jul 13 10:42:01 2003 -+++ gcc-3.3/libstdc++-v3/testsuite/lib/libstdc++-v3-dg.exp Sun Jul 13 11:39:54 2003 -@@ -46,8 +46,23 @@ - global gluefile wrap_flags - global ld_library_path - global tool_root_dir -+ global target_triplet - - set blddir [lookfor_file [get_multilibs] libstdc++-v3] -+ if { $blddir == "" } { -+ set multilibs [get_multilibs] -+ # FIXME: assume multilib only one level deep -+ set multisub [file tail $multilibs] -+ verbose "libstdc++-v3-init: couldn't find libstdc++-v3 in $multilibs, trying $objdir" -+ set blddir [lookfor_file ${objdir} "$target_triplet/$multisub/libstdc++-v3"] -+ } -+ if { $blddir == "" } { -+ verbose "libstdc++-v3-init: couldn't find libstdc++-v3, trying $objdir without multilibs" -+ set blddir [lookfor_file ${objdir} "$target_triplet/libstdc++-v3"] -+ } -+ if { $blddir == "" } { -+ error "Can't find libstdc++-v3" -+ } - - # By default, we assume we want to run program images. - global dg-do-what-default diff --git a/patches/gcc/3.2.3/170-libstdc++-v3-dg.exp.patch b/patches/gcc/3.2.3/170-libstdc++-v3-dg.exp.patch new file mode 100644 index 0000000..aafc130 --- /dev/null +++ b/patches/gcc/3.2.3/170-libstdc++-v3-dg.exp.patch @@ -0,0 +1,54 @@ +Without this patch, the command + +RUNTESTFLAGS=--target=powerpc-750-linux-gnu -v -v -v -v make check-target-libstdc++-v3 + +fails in two ways: +1. the -L option meant to locate the testsuite directory is incorrect, and +2. the wrong compiler is invoked, causing all sorts of havoc, not least of which +is the native compiler is invoked when we really wanted to invoke the cross-compiler +we just built. + +Here's an example log of the problem in action. Every testcase fails, this shows just one: +------------- +Invoking the compiler as g++ -ggdb3 -DDEBUG_ASSERT -I/home3/dank/wk/ixos/dap_interim/linux/3rdParty/crosstool/crosstool-0.12/build/powerpc-750-linux-gnu/gcc-3.3-glibc-2.2.5/gcc-3.3/libstdc++-v3/testsuite /home3/dank/wk/ixos/dap_interim/linux/3rdParty/crosstool/crosstool-0.12/build/powerpc-750-linux-gnu/gcc-3.3-glibc-2.2.5/gcc-3.3/libstdc++-v3/testsuite/20_util/binders.cc -g -O2 -DDEBUG_ASSERT -L/testsuite -lv3test -lm -o ./binders.exe +compiler exited with status 1 +output is: +/usr/lib/gcc-lib/i386-linux/2.95.4/../../../../include/g++-3/stl_function.h: In method `void binder2nd >::operator ()(const Elem &) const':^M +/usr/lib/gcc-lib/i386-linux/2.95.4/../../../../include/g++-3/stl_algo.h:83: instantiated from `for_each > >(Elem *, Elem *, binder2nd >)'^M +/home3/dank/wk/ixos/dap_interim/linux/3rdParty/crosstool/crosstool-0.12/build/powerpc-750-linux-gnu/gcc-3.3-glibc-2.2.5/gcc-3.3/libstdc++-v3/testsuite/20_util/binders.cc:43: instantiated from here^M +/usr/lib/gcc-lib/i386-linux/2.95.4/../../../../include/g++-3/stl_function.h:224: conversion from `const Elem' to `Elem &' discards qualifiers^M +/usr/lib/gcc-lib/i386-linux/2.95.4/../../../../include/g++-3/stl_function.h:622: in passing argument 1 of `mem_fun1_ref_t::operator ()(Elem &, int) const'^M +... +FAIL: 20_util/binders.cc (test for excess errors) +WARNING: 20_util/binders.cc compilation failed to produce executable +------------- + +And here's the patch. I'm not happy with it, and it probably gets some cases wrong, +but it seems to work for the common native case and for my cross-compiler case. + +--- gcc-3.3/libstdc++-v3/testsuite/lib/libstdc++-v3-dg.exp.old Sun Jul 13 10:42:01 2003 ++++ gcc-3.3/libstdc++-v3/testsuite/lib/libstdc++-v3-dg.exp Sun Jul 13 11:39:54 2003 +@@ -46,8 +46,23 @@ + global gluefile wrap_flags + global ld_library_path + global tool_root_dir ++ global target_triplet + + set blddir [lookfor_file [get_multilibs] libstdc++-v3] ++ if { $blddir == "" } { ++ set multilibs [get_multilibs] ++ # FIXME: assume multilib only one level deep ++ set multisub [file tail $multilibs] ++ verbose "libstdc++-v3-init: couldn't find libstdc++-v3 in $multilibs, trying $objdir" ++ set blddir [lookfor_file ${objdir} "$target_triplet/$multisub/libstdc++-v3"] ++ } ++ if { $blddir == "" } { ++ verbose "libstdc++-v3-init: couldn't find libstdc++-v3, trying $objdir without multilibs" ++ set blddir [lookfor_file ${objdir} "$target_triplet/libstdc++-v3"] ++ } ++ if { $blddir == "" } { ++ error "Can't find libstdc++-v3" ++ } + + # By default, we assume we want to run program images. + global dg-do-what-default diff --git a/patches/gcc/3.3.6/110-arm-bigendian.patch b/patches/gcc/3.3.6/110-arm-bigendian.patch new file mode 100644 index 0000000..0816b83 --- /dev/null +++ b/patches/gcc/3.3.6/110-arm-bigendian.patch @@ -0,0 +1,62 @@ +diff -urN gcc-3.3.4.orig/gcc/config/arm/linux-elf.h gcc-3.3.4/gcc/config/arm/linux-elf.h +--- gcc-3.3.4.orig/gcc/config/arm/linux-elf.h 2004-03-30 22:43:45.000000000 +0200 ++++ gcc-3.3.4/gcc/config/arm/linux-elf.h 2004-08-20 02:13:02.969084177 +0200 +@@ -30,17 +30,31 @@ + /* Do not assume anything about header files. */ + #define NO_IMPLICIT_EXTERN_C + ++/* ++ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-* ++ * (big endian) configurations. ++ */ ++#if TARGET_BIG_ENDIAN_DEFAULT ++#define TARGET_ENDIAN_DEFAULT ARM_FLAG_BIG_END ++#define TARGET_ENDIAN_OPTION "mbig-endian" ++#define TARGET_LINKER_EMULATION "armelfb_linux" ++#else ++#define TARGET_ENDIAN_DEFAULT 0 ++#define TARGET_ENDIAN_OPTION "mlittle-endian" ++#define TARGET_LINKER_EMULATION "armelf_linux" ++#endif ++ + /* Default is to use APCS-32 mode. */ + #undef TARGET_DEFAULT +-#define TARGET_DEFAULT (ARM_FLAG_APCS_32 | ARM_FLAG_MMU_TRAPS) ++#define TARGET_DEFAULT (ARM_FLAG_APCS_32 | ARM_FLAG_MMU_TRAPS | TARGET_ENDIAN_DEFAULT) + + #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6 + +-#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p" ++#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p" + + #undef MULTILIB_DEFAULTS + #define MULTILIB_DEFAULTS \ +- { "marm", "mlittle-endian", "mhard-float", "mapcs-32", "mno-thumb-interwork" } ++ { "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mapcs-32", "mno-thumb-interwork" } + + #define CPP_APCS_PC_DEFAULT_SPEC "-D__APCS_32__" + +@@ -88,7 +102,7 @@ + %{rdynamic:-export-dynamic} \ + %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2} \ + -X \ +- %{mbig-endian:-EB}" \ ++ %{mbig-endian:-EB} %{mlittle-endian:-EL}" \ + SUBTARGET_EXTRA_LINK_SPEC + + #define TARGET_OS_CPP_BUILTINS() \ +diff -urN gcc-3.3.4.orig/gcc/config.gcc gcc-3.3.4/gcc/config.gcc +--- gcc-3.3.4.orig/gcc/config.gcc 2004-04-29 06:42:47.000000000 +0200 ++++ gcc-3.3.4/gcc/config.gcc 2004-08-20 02:11:04.326143343 +0200 +@@ -699,6 +699,11 @@ + ;; + arm*-*-linux*) # ARM GNU/Linux with ELF + tm_file="dbxelf.h elfos.h arm/elf.h arm/linux-gas.h arm/linux-elf.h arm/aout.h arm/arm.h" ++ case $machine in ++ arm*b-*) ++ tm_defines="TARGET_BIG_ENDIAN_DEFAULT=1 $tm_defines" ++ ;; ++ esac + tmake_file="t-slibgcc-elf-ver t-linux arm/t-linux" + extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o" + gnu_ld=yes diff --git a/patches/gcc/3.3.6/110-gcc-3.3.4-arm-bigendian.patch b/patches/gcc/3.3.6/110-gcc-3.3.4-arm-bigendian.patch deleted file mode 100644 index 0816b83..0000000 --- a/patches/gcc/3.3.6/110-gcc-3.3.4-arm-bigendian.patch +++ /dev/null @@ -1,62 +0,0 @@ -diff -urN gcc-3.3.4.orig/gcc/config/arm/linux-elf.h gcc-3.3.4/gcc/config/arm/linux-elf.h ---- gcc-3.3.4.orig/gcc/config/arm/linux-elf.h 2004-03-30 22:43:45.000000000 +0200 -+++ gcc-3.3.4/gcc/config/arm/linux-elf.h 2004-08-20 02:13:02.969084177 +0200 -@@ -30,17 +30,31 @@ - /* Do not assume anything about header files. */ - #define NO_IMPLICIT_EXTERN_C - -+/* -+ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-* -+ * (big endian) configurations. -+ */ -+#if TARGET_BIG_ENDIAN_DEFAULT -+#define TARGET_ENDIAN_DEFAULT ARM_FLAG_BIG_END -+#define TARGET_ENDIAN_OPTION "mbig-endian" -+#define TARGET_LINKER_EMULATION "armelfb_linux" -+#else -+#define TARGET_ENDIAN_DEFAULT 0 -+#define TARGET_ENDIAN_OPTION "mlittle-endian" -+#define TARGET_LINKER_EMULATION "armelf_linux" -+#endif -+ - /* Default is to use APCS-32 mode. */ - #undef TARGET_DEFAULT --#define TARGET_DEFAULT (ARM_FLAG_APCS_32 | ARM_FLAG_MMU_TRAPS) -+#define TARGET_DEFAULT (ARM_FLAG_APCS_32 | ARM_FLAG_MMU_TRAPS | TARGET_ENDIAN_DEFAULT) - - #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6 - --#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p" -+#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p" - - #undef MULTILIB_DEFAULTS - #define MULTILIB_DEFAULTS \ -- { "marm", "mlittle-endian", "mhard-float", "mapcs-32", "mno-thumb-interwork" } -+ { "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mapcs-32", "mno-thumb-interwork" } - - #define CPP_APCS_PC_DEFAULT_SPEC "-D__APCS_32__" - -@@ -88,7 +102,7 @@ - %{rdynamic:-export-dynamic} \ - %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2} \ - -X \ -- %{mbig-endian:-EB}" \ -+ %{mbig-endian:-EB} %{mlittle-endian:-EL}" \ - SUBTARGET_EXTRA_LINK_SPEC - - #define TARGET_OS_CPP_BUILTINS() \ -diff -urN gcc-3.3.4.orig/gcc/config.gcc gcc-3.3.4/gcc/config.gcc ---- gcc-3.3.4.orig/gcc/config.gcc 2004-04-29 06:42:47.000000000 +0200 -+++ gcc-3.3.4/gcc/config.gcc 2004-08-20 02:11:04.326143343 +0200 -@@ -699,6 +699,11 @@ - ;; - arm*-*-linux*) # ARM GNU/Linux with ELF - tm_file="dbxelf.h elfos.h arm/elf.h arm/linux-gas.h arm/linux-elf.h arm/aout.h arm/arm.h" -+ case $machine in -+ arm*b-*) -+ tm_defines="TARGET_BIG_ENDIAN_DEFAULT=1 $tm_defines" -+ ;; -+ esac - tmake_file="t-slibgcc-elf-ver t-linux arm/t-linux" - extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o" - gnu_ld=yes diff --git a/patches/gcc/3.3.6/120-arm-pr22528.patch b/patches/gcc/3.3.6/120-arm-pr22528.patch new file mode 100644 index 0000000..0611e2c --- /dev/null +++ b/patches/gcc/3.3.6/120-arm-pr22528.patch @@ -0,0 +1,71 @@ +From http://gcc.gnu.org/ml/gcc-patches/2003-11/msg00832.html, by +Richard Earnshaw. Fixes http://gcc.gnu.org/PR22528 + +--- gcc-3.3.4/gcc/config/arm/arm.md.orig 2004-03-30 22:43:44.000000000 +0200 ++++ gcc-3.3.4/gcc/config/arm/arm.md 2005-08-15 12:21:55.000000000 +0200 +@@ -4275,7 +4275,7 @@ + (set (match_dup 2) + (ashiftrt:SI (match_operand 0 "" "") (const_int 8))) + ;; store the high byte +- (set (match_dup 4) (subreg:QI (match_dup 2) 0))] ;explicit subreg safe ++ (set (match_dup 4) (match_dup 5))] + "TARGET_ARM" + " + { +@@ -4291,7 +4291,8 @@ + operands[1] = adjust_address (operands[1], QImode, 0); + operands[3] = gen_lowpart (QImode, operands[0]); + operands[0] = gen_lowpart (SImode, operands[0]); +- operands[2] = gen_reg_rtx (SImode); ++ operands[2] = gen_reg_rtx (SImode); ++ operands[5] = gen_lowpart (QImode, operands[2]); + }" + ) + +@@ -4299,7 +4300,7 @@ + [(set (match_dup 4) (match_dup 3)) + (set (match_dup 2) + (ashiftrt:SI (match_operand 0 "" "") (const_int 8))) +- (set (match_operand 1 "" "") (subreg:QI (match_dup 2) 3))] ++ (set (match_operand 1 "" "") (match_dup 5))] + "TARGET_ARM" + " + { +@@ -4316,13 +4317,14 @@ + operands[3] = gen_lowpart (QImode, operands[0]); + operands[0] = gen_lowpart (SImode, operands[0]); + operands[2] = gen_reg_rtx (SImode); ++ operands[5] = gen_lowpart (QImode, operands[2]); + }" + ) + + ;; Subroutine to store a half word integer constant into memory. + (define_expand "storeinthi" + [(set (match_operand 0 "" "") +- (subreg:QI (match_operand 1 "" "") 0)) ++ (match_operand 1 "" "")) + (set (match_dup 3) (match_dup 2))] + "TARGET_ARM" + " +@@ -4363,6 +4365,7 @@ + operands[3] = adjust_address (op0, QImode, 1); + operands[0] = adjust_address (operands[0], QImode, 0); + operands[2] = gen_lowpart (QImode, operands[2]); ++ operands[1] = gen_lowpart (QImode, operands[1]); + }" + ) + +@@ -4682,11 +4685,12 @@ + (set (match_dup 3) + (ashiftrt:SI (match_dup 2) (const_int 16))) + (set (match_operand:HI 0 "s_register_operand" "") +- (subreg:HI (match_dup 3) 0))] ++ (match_dup 4))] + "TARGET_ARM" + " + operands[2] = gen_reg_rtx (SImode); + operands[3] = gen_reg_rtx (SImode); ++ operands[4] = gen_lowpart (HImode, operands[3]); + " + ) + diff --git a/patches/gcc/3.3.6/120-gcc-3.3.4-arm-pr22528.patch b/patches/gcc/3.3.6/120-gcc-3.3.4-arm-pr22528.patch deleted file mode 100644 index 0611e2c..0000000 --- a/patches/gcc/3.3.6/120-gcc-3.3.4-arm-pr22528.patch +++ /dev/null @@ -1,71 +0,0 @@ -From http://gcc.gnu.org/ml/gcc-patches/2003-11/msg00832.html, by -Richard Earnshaw. Fixes http://gcc.gnu.org/PR22528 - ---- gcc-3.3.4/gcc/config/arm/arm.md.orig 2004-03-30 22:43:44.000000000 +0200 -+++ gcc-3.3.4/gcc/config/arm/arm.md 2005-08-15 12:21:55.000000000 +0200 -@@ -4275,7 +4275,7 @@ - (set (match_dup 2) - (ashiftrt:SI (match_operand 0 "" "") (const_int 8))) - ;; store the high byte -- (set (match_dup 4) (subreg:QI (match_dup 2) 0))] ;explicit subreg safe -+ (set (match_dup 4) (match_dup 5))] - "TARGET_ARM" - " - { -@@ -4291,7 +4291,8 @@ - operands[1] = adjust_address (operands[1], QImode, 0); - operands[3] = gen_lowpart (QImode, operands[0]); - operands[0] = gen_lowpart (SImode, operands[0]); -- operands[2] = gen_reg_rtx (SImode); -+ operands[2] = gen_reg_rtx (SImode); -+ operands[5] = gen_lowpart (QImode, operands[2]); - }" - ) - -@@ -4299,7 +4300,7 @@ - [(set (match_dup 4) (match_dup 3)) - (set (match_dup 2) - (ashiftrt:SI (match_operand 0 "" "") (const_int 8))) -- (set (match_operand 1 "" "") (subreg:QI (match_dup 2) 3))] -+ (set (match_operand 1 "" "") (match_dup 5))] - "TARGET_ARM" - " - { -@@ -4316,13 +4317,14 @@ - operands[3] = gen_lowpart (QImode, operands[0]); - operands[0] = gen_lowpart (SImode, operands[0]); - operands[2] = gen_reg_rtx (SImode); -+ operands[5] = gen_lowpart (QImode, operands[2]); - }" - ) - - ;; Subroutine to store a half word integer constant into memory. - (define_expand "storeinthi" - [(set (match_operand 0 "" "") -- (subreg:QI (match_operand 1 "" "") 0)) -+ (match_operand 1 "" "")) - (set (match_dup 3) (match_dup 2))] - "TARGET_ARM" - " -@@ -4363,6 +4365,7 @@ - operands[3] = adjust_address (op0, QImode, 1); - operands[0] = adjust_address (operands[0], QImode, 0); - operands[2] = gen_lowpart (QImode, operands[2]); -+ operands[1] = gen_lowpart (QImode, operands[1]); - }" - ) - -@@ -4682,11 +4685,12 @@ - (set (match_dup 3) - (ashiftrt:SI (match_dup 2) (const_int 16))) - (set (match_operand:HI 0 "s_register_operand" "") -- (subreg:HI (match_dup 3) 0))] -+ (match_dup 4))] - "TARGET_ARM" - " - operands[2] = gen_reg_rtx (SImode); - operands[3] = gen_reg_rtx (SImode); -+ operands[4] = gen_lowpart (HImode, operands[3]); - " - ) - diff --git a/patches/gcc/3.4.6/600-arm-ldm-peephole.patch b/patches/gcc/3.4.6/600-arm-ldm-peephole.patch new file mode 100644 index 0000000..81a0ac8 --- /dev/null +++ b/patches/gcc/3.4.6/600-arm-ldm-peephole.patch @@ -0,0 +1,68 @@ +diff -durN gcc-3.4.6.orig/gcc/config/arm/arm.c gcc-3.4.6/gcc/config/arm/arm.c +--- gcc-3.4.6.orig/gcc/config/arm/arm.c 2005-10-01 15:31:38.000000000 +0200 ++++ gcc-3.4.6/gcc/config/arm/arm.c 2007-08-15 22:54:59.000000000 +0200 +@@ -4857,6 +4857,11 @@ + *load_offset = unsorted_offsets[order[0]]; + } + ++ /* For XScale a two-word LDM is a performance loss, so only do this if ++ size is more important. See comments in arm_gen_load_multiple. */ ++ if (nops == 2 && arm_tune_xscale && !optimize_size) ++ return 0; ++ + if (unsorted_offsets[order[0]] == 0) + return 1; /* ldmia */ + +@@ -5083,6 +5088,11 @@ + *load_offset = unsorted_offsets[order[0]]; + } + ++ /* For XScale a two-word LDM is a performance loss, so only do this if ++ size is more important. See comments in arm_gen_load_multiple. */ ++ if (nops == 2 && arm_tune_xscale && !optimize_size) ++ return 0; ++ + if (unsorted_offsets[order[0]] == 0) + return 1; /* stmia */ + +diff -durN gcc-3.4.6.orig/gcc/config/arm/arm.md gcc-3.4.6/gcc/config/arm/arm.md +--- gcc-3.4.6.orig/gcc/config/arm/arm.md 2005-10-01 15:31:38.000000000 +0200 ++++ gcc-3.4.6/gcc/config/arm/arm.md 2007-08-15 22:54:59.000000000 +0200 +@@ -8811,13 +8811,16 @@ + (set_attr "length" "4,8,8")] + ) + ++; Try to convert LDR+LDR+arith into [add+]LDM+arith ++; On XScale, LDM is always slower than two LDRs, so only do this if ++; optimising for size. + (define_insn "*arith_adjacentmem" + [(set (match_operand:SI 0 "s_register_operand" "=r") + (match_operator:SI 1 "shiftable_operator" + [(match_operand:SI 2 "memory_operand" "m") + (match_operand:SI 3 "memory_operand" "m")])) + (clobber (match_scratch:SI 4 "=r"))] +- "TARGET_ARM && adjacent_mem_locations (operands[2], operands[3])" ++ "TARGET_ARM && (!arm_tune_xscale || optimize_size) && adjacent_mem_locations (operands[2], operands[3])" + "* + { + rtx ldm[3]; +@@ -8852,6 +8855,8 @@ + } + if (val1 && val2) + { ++ /* This would be a loss on a Harvard core, but adjacent_mem_locations() ++ will prevent it from happening. */ + rtx ops[3]; + ldm[0] = ops[0] = operands[4]; + ops[1] = XEXP (XEXP (operands[2], 0), 0); +diff -durN gcc-3.4.6.orig/gcc/genpeep.c gcc-3.4.6/gcc/genpeep.c +--- gcc-3.4.6.orig/gcc/genpeep.c 2003-07-05 07:27:22.000000000 +0200 ++++ gcc-3.4.6/gcc/genpeep.c 2007-08-15 22:54:59.000000000 +0200 +@@ -381,6 +381,7 @@ + printf ("#include \"recog.h\"\n"); + printf ("#include \"except.h\"\n\n"); + printf ("#include \"function.h\"\n\n"); ++ printf ("#include \"flags.h\"\n\n"); + + printf ("#ifdef HAVE_peephole\n"); + printf ("extern rtx peep_operand[];\n\n"); diff --git a/patches/gcc/3.4.6/600-gcc34-arm-ldm-peephole.patch b/patches/gcc/3.4.6/600-gcc34-arm-ldm-peephole.patch deleted file mode 100644 index 81a0ac8..0000000 --- a/patches/gcc/3.4.6/600-gcc34-arm-ldm-peephole.patch +++ /dev/null @@ -1,68 +0,0 @@ -diff -durN gcc-3.4.6.orig/gcc/config/arm/arm.c gcc-3.4.6/gcc/config/arm/arm.c ---- gcc-3.4.6.orig/gcc/config/arm/arm.c 2005-10-01 15:31:38.000000000 +0200 -+++ gcc-3.4.6/gcc/config/arm/arm.c 2007-08-15 22:54:59.000000000 +0200 -@@ -4857,6 +4857,11 @@ - *load_offset = unsorted_offsets[order[0]]; - } - -+ /* For XScale a two-word LDM is a performance loss, so only do this if -+ size is more important. See comments in arm_gen_load_multiple. */ -+ if (nops == 2 && arm_tune_xscale && !optimize_size) -+ return 0; -+ - if (unsorted_offsets[order[0]] == 0) - return 1; /* ldmia */ - -@@ -5083,6 +5088,11 @@ - *load_offset = unsorted_offsets[order[0]]; - } - -+ /* For XScale a two-word LDM is a performance loss, so only do this if -+ size is more important. See comments in arm_gen_load_multiple. */ -+ if (nops == 2 && arm_tune_xscale && !optimize_size) -+ return 0; -+ - if (unsorted_offsets[order[0]] == 0) - return 1; /* stmia */ - -diff -durN gcc-3.4.6.orig/gcc/config/arm/arm.md gcc-3.4.6/gcc/config/arm/arm.md ---- gcc-3.4.6.orig/gcc/config/arm/arm.md 2005-10-01 15:31:38.000000000 +0200 -+++ gcc-3.4.6/gcc/config/arm/arm.md 2007-08-15 22:54:59.000000000 +0200 -@@ -8811,13 +8811,16 @@ - (set_attr "length" "4,8,8")] - ) - -+; Try to convert LDR+LDR+arith into [add+]LDM+arith -+; On XScale, LDM is always slower than two LDRs, so only do this if -+; optimising for size. - (define_insn "*arith_adjacentmem" - [(set (match_operand:SI 0 "s_register_operand" "=r") - (match_operator:SI 1 "shiftable_operator" - [(match_operand:SI 2 "memory_operand" "m") - (match_operand:SI 3 "memory_operand" "m")])) - (clobber (match_scratch:SI 4 "=r"))] -- "TARGET_ARM && adjacent_mem_locations (operands[2], operands[3])" -+ "TARGET_ARM && (!arm_tune_xscale || optimize_size) && adjacent_mem_locations (operands[2], operands[3])" - "* - { - rtx ldm[3]; -@@ -8852,6 +8855,8 @@ - } - if (val1 && val2) - { -+ /* This would be a loss on a Harvard core, but adjacent_mem_locations() -+ will prevent it from happening. */ - rtx ops[3]; - ldm[0] = ops[0] = operands[4]; - ops[1] = XEXP (XEXP (operands[2], 0), 0); -diff -durN gcc-3.4.6.orig/gcc/genpeep.c gcc-3.4.6/gcc/genpeep.c ---- gcc-3.4.6.orig/gcc/genpeep.c 2003-07-05 07:27:22.000000000 +0200 -+++ gcc-3.4.6/gcc/genpeep.c 2007-08-15 22:54:59.000000000 +0200 -@@ -381,6 +381,7 @@ - printf ("#include \"recog.h\"\n"); - printf ("#include \"except.h\"\n\n"); - printf ("#include \"function.h\"\n\n"); -+ printf ("#include \"flags.h\"\n\n"); - - printf ("#ifdef HAVE_peephole\n"); - printf ("extern rtx peep_operand[];\n\n"); diff --git a/patches/gcc/3.4.6/601-arm-ldm.patch b/patches/gcc/3.4.6/601-arm-ldm.patch new file mode 100644 index 0000000..18ea493 --- /dev/null +++ b/patches/gcc/3.4.6/601-arm-ldm.patch @@ -0,0 +1,120 @@ +diff -durN gcc-3.4.6.orig/gcc/config/arm/arm.c gcc-3.4.6/gcc/config/arm/arm.c +--- gcc-3.4.6.orig/gcc/config/arm/arm.c 2007-08-15 22:56:20.000000000 +0200 ++++ gcc-3.4.6/gcc/config/arm/arm.c 2007-08-15 22:56:20.000000000 +0200 +@@ -8524,6 +8524,26 @@ + return_used_this_function = 0; + } + ++/* Return the number (counting from 0) of ++ the least significant set bit in MASK. */ ++ ++#ifdef __GNUC__ ++inline ++#endif ++static int ++number_of_first_bit_set (mask) ++ int mask; ++{ ++ int bit; ++ ++ for (bit = 0; ++ (mask & (1 << bit)) == 0; ++ ++bit) ++ continue; ++ ++ return bit; ++} ++ + const char * + arm_output_epilogue (rtx sibling) + { +@@ -8757,27 +8777,47 @@ + saved_regs_mask |= (1 << PC_REGNUM); + } + +- /* Load the registers off the stack. If we only have one register +- to load use the LDR instruction - it is faster. */ +- if (saved_regs_mask == (1 << LR_REGNUM)) +- { +- /* The exception handler ignores the LR, so we do +- not really need to load it off the stack. */ +- if (eh_ofs) +- asm_fprintf (f, "\tadd\t%r, %r, #4\n", SP_REGNUM, SP_REGNUM); +- else +- asm_fprintf (f, "\tldr\t%r, [%r], #4\n", LR_REGNUM, SP_REGNUM); +- } +- else if (saved_regs_mask) ++ if (saved_regs_mask) + { +- if (saved_regs_mask & (1 << SP_REGNUM)) +- /* Note - write back to the stack register is not enabled +- (ie "ldmfd sp!..."). We know that the stack pointer is +- in the list of registers and if we add writeback the +- instruction becomes UNPREDICTABLE. */ +- print_multi_reg (f, "ldmfd\t%r", SP_REGNUM, saved_regs_mask); ++ /* Load the registers off the stack. If we only have one register ++ to load use the LDR instruction - it is faster. */ ++ if (bit_count (saved_regs_mask) == 1) ++ { ++ int reg = number_of_first_bit_set (saved_regs_mask); ++ ++ switch (reg) ++ { ++ case SP_REGNUM: ++ /* Mustn't use base writeback when loading SP. */ ++ asm_fprintf (f, "\tldr\t%r, [%r]\n", SP_REGNUM, SP_REGNUM); ++ break; ++ ++ case LR_REGNUM: ++ if (eh_ofs) ++ { ++ /* The exception handler ignores the LR, so we do ++ not really need to load it off the stack. */ ++ asm_fprintf (f, "\tadd\t%r, %r, #4\n", SP_REGNUM, SP_REGNUM); ++ break; ++ } ++ /* else fall through */ ++ ++ default: ++ asm_fprintf (f, "\tldr\t%r, [%r], #4\n", reg, SP_REGNUM); ++ break; ++ } ++ } + else +- print_multi_reg (f, "ldmfd\t%r!", SP_REGNUM, saved_regs_mask); ++ { ++ if (saved_regs_mask & (1 << SP_REGNUM)) ++ /* Note - write back to the stack register is not enabled ++ (ie "ldmfd sp!..."). We know that the stack pointer is ++ in the list of registers and if we add writeback the ++ instruction becomes UNPREDICTABLE. */ ++ print_multi_reg (f, "ldmfd\t%r", SP_REGNUM, saved_regs_mask); ++ else ++ print_multi_reg (f, "ldmfd\t%r!", SP_REGNUM, saved_regs_mask); ++ } + } + + if (current_function_pretend_args_size) +@@ -11405,22 +11445,6 @@ + } + } + +-/* Return the number (counting from 0) of +- the least significant set bit in MASK. */ +- +-inline static int +-number_of_first_bit_set (int mask) +-{ +- int bit; +- +- for (bit = 0; +- (mask & (1 << bit)) == 0; +- ++bit) +- continue; +- +- return bit; +-} +- + /* Generate code to return from a thumb function. + If 'reg_containing_return_addr' is -1, then the return address is + actually on the stack, at the stack pointer. */ diff --git a/patches/gcc/3.4.6/601-gcc34-arm-ldm-peephole2.patch b/patches/gcc/3.4.6/601-gcc34-arm-ldm-peephole2.patch deleted file mode 100644 index 395c516..0000000 --- a/patches/gcc/3.4.6/601-gcc34-arm-ldm-peephole2.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff -durN gcc-3.4.6.orig/gcc/config/arm/arm.c gcc-3.4.6/gcc/config/arm/arm.c ---- gcc-3.4.6.orig/gcc/config/arm/arm.c 2007-08-15 22:57:51.000000000 +0200 -+++ gcc-3.4.6/gcc/config/arm/arm.c 2007-08-15 22:57:51.000000000 +0200 -@@ -4572,6 +4572,10 @@ - int - adjacent_mem_locations (rtx a, rtx b) - { -+ /* We don't guarantee to preserve the order of these memory refs. */ -+ if (volatile_refs_p (a) || volatile_refs_p (b)) -+ return 0; -+ - if ((GET_CODE (XEXP (a, 0)) == REG - || (GET_CODE (XEXP (a, 0)) == PLUS - && GET_CODE (XEXP (XEXP (a, 0), 1)) == CONST_INT)) -@@ -4611,6 +4615,17 @@ - return 0; - - val_diff = val1 - val0; -+ -+ if (arm_ld_sched) -+ { -+ /* If the target has load delay slots, then there's no benefit -+ to using an ldm instruction unless the offset is zero and -+ we are optimizing for size. */ -+ return (optimize_size && (REGNO (reg0) == REGNO (reg1)) -+ && (val0 == 0 || val1 == 0 || val0 == 4 || val1 == 4) -+ && (val_diff == 4 || val_diff == -4)); -+ } -+ - return ((REGNO (reg0) == REGNO (reg1)) - && (val_diff == 4 || val_diff == -4)); - } diff --git a/patches/gcc/3.4.6/601-gcc34-arm-ldm.patch b/patches/gcc/3.4.6/601-gcc34-arm-ldm.patch deleted file mode 100644 index 18ea493..0000000 --- a/patches/gcc/3.4.6/601-gcc34-arm-ldm.patch +++ /dev/null @@ -1,120 +0,0 @@ -diff -durN gcc-3.4.6.orig/gcc/config/arm/arm.c gcc-3.4.6/gcc/config/arm/arm.c ---- gcc-3.4.6.orig/gcc/config/arm/arm.c 2007-08-15 22:56:20.000000000 +0200 -+++ gcc-3.4.6/gcc/config/arm/arm.c 2007-08-15 22:56:20.000000000 +0200 -@@ -8524,6 +8524,26 @@ - return_used_this_function = 0; - } - -+/* Return the number (counting from 0) of -+ the least significant set bit in MASK. */ -+ -+#ifdef __GNUC__ -+inline -+#endif -+static int -+number_of_first_bit_set (mask) -+ int mask; -+{ -+ int bit; -+ -+ for (bit = 0; -+ (mask & (1 << bit)) == 0; -+ ++bit) -+ continue; -+ -+ return bit; -+} -+ - const char * - arm_output_epilogue (rtx sibling) - { -@@ -8757,27 +8777,47 @@ - saved_regs_mask |= (1 << PC_REGNUM); - } - -- /* Load the registers off the stack. If we only have one register -- to load use the LDR instruction - it is faster. */ -- if (saved_regs_mask == (1 << LR_REGNUM)) -- { -- /* The exception handler ignores the LR, so we do -- not really need to load it off the stack. */ -- if (eh_ofs) -- asm_fprintf (f, "\tadd\t%r, %r, #4\n", SP_REGNUM, SP_REGNUM); -- else -- asm_fprintf (f, "\tldr\t%r, [%r], #4\n", LR_REGNUM, SP_REGNUM); -- } -- else if (saved_regs_mask) -+ if (saved_regs_mask) - { -- if (saved_regs_mask & (1 << SP_REGNUM)) -- /* Note - write back to the stack register is not enabled -- (ie "ldmfd sp!..."). We know that the stack pointer is -- in the list of registers and if we add writeback the -- instruction becomes UNPREDICTABLE. */ -- print_multi_reg (f, "ldmfd\t%r", SP_REGNUM, saved_regs_mask); -+ /* Load the registers off the stack. If we only have one register -+ to load use the LDR instruction - it is faster. */ -+ if (bit_count (saved_regs_mask) == 1) -+ { -+ int reg = number_of_first_bit_set (saved_regs_mask); -+ -+ switch (reg) -+ { -+ case SP_REGNUM: -+ /* Mustn't use base writeback when loading SP. */ -+ asm_fprintf (f, "\tldr\t%r, [%r]\n", SP_REGNUM, SP_REGNUM); -+ break; -+ -+ case LR_REGNUM: -+ if (eh_ofs) -+ { -+ /* The exception handler ignores the LR, so we do -+ not really need to load it off the stack. */ -+ asm_fprintf (f, "\tadd\t%r, %r, #4\n", SP_REGNUM, SP_REGNUM); -+ break; -+ } -+ /* else fall through */ -+ -+ default: -+ asm_fprintf (f, "\tldr\t%r, [%r], #4\n", reg, SP_REGNUM); -+ break; -+ } -+ } - else -- print_multi_reg (f, "ldmfd\t%r!", SP_REGNUM, saved_regs_mask); -+ { -+ if (saved_regs_mask & (1 << SP_REGNUM)) -+ /* Note - write back to the stack register is not enabled -+ (ie "ldmfd sp!..."). We know that the stack pointer is -+ in the list of registers and if we add writeback the -+ instruction becomes UNPREDICTABLE. */ -+ print_multi_reg (f, "ldmfd\t%r", SP_REGNUM, saved_regs_mask); -+ else -+ print_multi_reg (f, "ldmfd\t%r!", SP_REGNUM, saved_regs_mask); -+ } - } - - if (current_function_pretend_args_size) -@@ -11405,22 +11445,6 @@ - } - } - --/* Return the number (counting from 0) of -- the least significant set bit in MASK. */ -- --inline static int --number_of_first_bit_set (int mask) --{ -- int bit; -- -- for (bit = 0; -- (mask & (1 << bit)) == 0; -- ++bit) -- continue; -- -- return bit; --} -- - /* Generate code to return from a thumb function. - If 'reg_containing_return_addr' is -1, then the return address is - actually on the stack, at the stack pointer. */ diff --git a/patches/gcc/3.4.6/602-arm-ldm-peephole2.patch b/patches/gcc/3.4.6/602-arm-ldm-peephole2.patch new file mode 100644 index 0000000..395c516 --- /dev/null +++ b/patches/gcc/3.4.6/602-arm-ldm-peephole2.patch @@ -0,0 +1,32 @@ +diff -durN gcc-3.4.6.orig/gcc/config/arm/arm.c gcc-3.4.6/gcc/config/arm/arm.c +--- gcc-3.4.6.orig/gcc/config/arm/arm.c 2007-08-15 22:57:51.000000000 +0200 ++++ gcc-3.4.6/gcc/config/arm/arm.c 2007-08-15 22:57:51.000000000 +0200 +@@ -4572,6 +4572,10 @@ + int + adjacent_mem_locations (rtx a, rtx b) + { ++ /* We don't guarantee to preserve the order of these memory refs. */ ++ if (volatile_refs_p (a) || volatile_refs_p (b)) ++ return 0; ++ + if ((GET_CODE (XEXP (a, 0)) == REG + || (GET_CODE (XEXP (a, 0)) == PLUS + && GET_CODE (XEXP (XEXP (a, 0), 1)) == CONST_INT)) +@@ -4611,6 +4615,17 @@ + return 0; + + val_diff = val1 - val0; ++ ++ if (arm_ld_sched) ++ { ++ /* If the target has load delay slots, then there's no benefit ++ to using an ldm instruction unless the offset is zero and ++ we are optimizing for size. */ ++ return (optimize_size && (REGNO (reg0) == REGNO (reg1)) ++ && (val0 == 0 || val1 == 0 || val0 == 4 || val1 == 4) ++ && (val_diff == 4 || val_diff == -4)); ++ } ++ + return ((REGNO (reg0) == REGNO (reg1)) + && (val_diff == 4 || val_diff == -4)); + } diff --git a/patches/gcc/4.0.0/110-arm-bigendian.patch b/patches/gcc/4.0.0/110-arm-bigendian.patch new file mode 100644 index 0000000..d9bcffe --- /dev/null +++ b/patches/gcc/4.0.0/110-arm-bigendian.patch @@ -0,0 +1,79 @@ +By Lennert Buytenhek +Adds support for arm*b-linux* big-endian ARM targets + +Fixes following build error for big-endian ARM targets: + +armeb-unknown-linux-gnu/gcc-4.0.0-20050410-glibc-2.3.4/bin/../lib/gcc/armeb-unknown-linux-gnu/4.0.0/../../../../armeb-unknown-linux-gnu/bin/ld: unrecognised emulation mode: armelf_linux +Supported emulations: armelfb_linux armelfb +collect2: ld returned 1 exit status +make[2]: *** [crosstool-0.32/build/armeb-unknown-linux-gnu/gcc-4.0.0-20050410-glibc-2.3.4/build-glibc/csu/crt1.o] Error 1 +make[2]: Leaving directory `crosstool-0.32/build/armeb-unknown-linux-gnu/gcc-4.0.0-20050410-glibc-2.3.4/glibc-2.3.4/csu' +make[1]: *** [csu/subdir_lib] Error 2 +make[1]: Leaving directory `crosstool-0.32/build/armeb-unknown-linux-gnu/gcc-4.0.0-20050410-glibc-2.3.4/glibc-2.3.4' +make: *** [lib] Error 2 + + +See http://gcc.gnu.org/PR16350 + +--- gcc-4.0-20050305/gcc/config/arm/linux-elf.h.orig 2005-03-23 18:44:54.822707377 +0100 ++++ gcc-4.0-20050305/gcc/config/arm/linux-elf.h 2005-03-23 18:46:18.228560206 +0100 +@@ -31,19 +31,33 @@ + /* Do not assume anything about header files. */ + #define NO_IMPLICIT_EXTERN_C + ++/* ++ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for ++ * arm*b-*-linux* (big endian) configurations. ++ */ ++#if TARGET_BIG_ENDIAN_DEFAULT ++#define TARGET_ENDIAN_DEFAULT ARM_FLAG_BIG_END ++#define TARGET_ENDIAN_OPTION "mbig-endian" ++#define TARGET_LINKER_EMULATION "armelfb_linux" ++#else ++#define TARGET_ENDIAN_DEFAULT 0 ++#define TARGET_ENDIAN_OPTION "mlittle-endian" ++#define TARGET_LINKER_EMULATION "armelf_linux" ++#endif ++ + #undef TARGET_DEFAULT_FLOAT_ABI + #define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD + + #undef TARGET_DEFAULT +-#define TARGET_DEFAULT (0) ++#define TARGET_DEFAULT (TARGET_ENDIAN_DEFAULT) + + #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6 + +-#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p" ++#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p" + + #undef MULTILIB_DEFAULTS + #define MULTILIB_DEFAULTS \ +- { "marm", "mlittle-endian", "mhard-float", "mno-thumb-interwork" } ++ { "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mno-thumb-interwork" } + + /* The GNU C++ standard library requires that these macros be defined. */ + #undef CPLUSPLUS_CPP_SPEC +@@ -90,7 +104,7 @@ + %{rdynamic:-export-dynamic} \ + %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2} \ + -X \ +- %{mbig-endian:-EB}" \ ++ %{mbig-endian:-EB} %{mlittle-endian:-EL}" \ + SUBTARGET_EXTRA_LINK_SPEC + + #define TARGET_OS_CPP_BUILTINS() \ +--- gcc-4.0-20050305/gcc/config.gcc.orig 2005-03-23 18:46:23.318105335 +0100 ++++ gcc-4.0-20050305/gcc/config.gcc 2005-03-23 18:47:41.592546386 +0100 +@@ -650,6 +650,11 @@ + ;; + arm*-*-linux*) # ARM GNU/Linux with ELF + tm_file="dbxelf.h elfos.h linux.h arm/elf.h arm/linux-gas.h arm/linux-elf.h arm/aout.h arm/arm.h" ++ case $target in ++ arm*b-*-linux*) ++ tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1" ++ ;; ++ esac + tmake_file="${tmake_file} arm/t-arm arm/t-linux" + extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o" + gnu_ld=yes diff --git a/patches/gcc/4.0.0/110-gcc-4.0-arm-bigendian.patch b/patches/gcc/4.0.0/110-gcc-4.0-arm-bigendian.patch deleted file mode 100644 index d9bcffe..0000000 --- a/patches/gcc/4.0.0/110-gcc-4.0-arm-bigendian.patch +++ /dev/null @@ -1,79 +0,0 @@ -By Lennert Buytenhek -Adds support for arm*b-linux* big-endian ARM targets - -Fixes following build error for big-endian ARM targets: - -armeb-unknown-linux-gnu/gcc-4.0.0-20050410-glibc-2.3.4/bin/../lib/gcc/armeb-unknown-linux-gnu/4.0.0/../../../../armeb-unknown-linux-gnu/bin/ld: unrecognised emulation mode: armelf_linux -Supported emulations: armelfb_linux armelfb -collect2: ld returned 1 exit status -make[2]: *** [crosstool-0.32/build/armeb-unknown-linux-gnu/gcc-4.0.0-20050410-glibc-2.3.4/build-glibc/csu/crt1.o] Error 1 -make[2]: Leaving directory `crosstool-0.32/build/armeb-unknown-linux-gnu/gcc-4.0.0-20050410-glibc-2.3.4/glibc-2.3.4/csu' -make[1]: *** [csu/subdir_lib] Error 2 -make[1]: Leaving directory `crosstool-0.32/build/armeb-unknown-linux-gnu/gcc-4.0.0-20050410-glibc-2.3.4/glibc-2.3.4' -make: *** [lib] Error 2 - - -See http://gcc.gnu.org/PR16350 - ---- gcc-4.0-20050305/gcc/config/arm/linux-elf.h.orig 2005-03-23 18:44:54.822707377 +0100 -+++ gcc-4.0-20050305/gcc/config/arm/linux-elf.h 2005-03-23 18:46:18.228560206 +0100 -@@ -31,19 +31,33 @@ - /* Do not assume anything about header files. */ - #define NO_IMPLICIT_EXTERN_C - -+/* -+ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for -+ * arm*b-*-linux* (big endian) configurations. -+ */ -+#if TARGET_BIG_ENDIAN_DEFAULT -+#define TARGET_ENDIAN_DEFAULT ARM_FLAG_BIG_END -+#define TARGET_ENDIAN_OPTION "mbig-endian" -+#define TARGET_LINKER_EMULATION "armelfb_linux" -+#else -+#define TARGET_ENDIAN_DEFAULT 0 -+#define TARGET_ENDIAN_OPTION "mlittle-endian" -+#define TARGET_LINKER_EMULATION "armelf_linux" -+#endif -+ - #undef TARGET_DEFAULT_FLOAT_ABI - #define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD - - #undef TARGET_DEFAULT --#define TARGET_DEFAULT (0) -+#define TARGET_DEFAULT (TARGET_ENDIAN_DEFAULT) - - #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6 - --#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p" -+#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p" - - #undef MULTILIB_DEFAULTS - #define MULTILIB_DEFAULTS \ -- { "marm", "mlittle-endian", "mhard-float", "mno-thumb-interwork" } -+ { "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mno-thumb-interwork" } - - /* The GNU C++ standard library requires that these macros be defined. */ - #undef CPLUSPLUS_CPP_SPEC -@@ -90,7 +104,7 @@ - %{rdynamic:-export-dynamic} \ - %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2} \ - -X \ -- %{mbig-endian:-EB}" \ -+ %{mbig-endian:-EB} %{mlittle-endian:-EL}" \ - SUBTARGET_EXTRA_LINK_SPEC - - #define TARGET_OS_CPP_BUILTINS() \ ---- gcc-4.0-20050305/gcc/config.gcc.orig 2005-03-23 18:46:23.318105335 +0100 -+++ gcc-4.0-20050305/gcc/config.gcc 2005-03-23 18:47:41.592546386 +0100 -@@ -650,6 +650,11 @@ - ;; - arm*-*-linux*) # ARM GNU/Linux with ELF - tm_file="dbxelf.h elfos.h linux.h arm/elf.h arm/linux-gas.h arm/linux-elf.h arm/aout.h arm/arm.h" -+ case $target in -+ arm*b-*-linux*) -+ tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1" -+ ;; -+ esac - tmake_file="${tmake_file} arm/t-arm arm/t-linux" - extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o" - gnu_ld=yes diff --git a/patches/gcc/4.1.0/100-fix-fixincl.patch b/patches/gcc/4.1.0/100-fix-fixincl.patch new file mode 100644 index 0000000..3928705 --- /dev/null +++ b/patches/gcc/4.1.0/100-fix-fixincl.patch @@ -0,0 +1,71 @@ +See http://gcc.gnu.org/PR22541 + +From: Dan Kegel + +When building gcc-3.4.3 or gcc-4.x into a clean $PREFIX, +the configure script happily copies the glibc include files from include to sys-include; +here's the line from the log file (with $PREFIX instead of the real prefix): + +Copying $PREFIX/i686-unknown-linux-gnu/include to $PREFIX/i686-unknown-linux-gnu/sys-include + +But later, when running fixincludes, it gives the error message + The directory that should contain system headers does not exist: + $PREFIX/lib/gcc/i686-unknown-linux-gnu/3.4.3/../../../../i686-unknown-linux-gnu/sys-include + +Nevertheless, it continues building; the header files it installs in + $PREFIX/lib/gcc/i686-unknown-linux-gnu/3.4.3/include +do not include the boilerplate that would cause it to #include_next the +glibc headers in the system header directory. +Thus the resulting toolchain can't compile the following program: +#include +int x = PATH_MAX; +because its limits.h doesn't include the glibc header. + +The problem is that gcc/Makefile.in assumes that +it can refer to $PREFIX/i686-unknown-linux-gnu with the path + $PREFIX/lib/../i686-unknown-linux-gnu, but +that fails because the directory $PREFIX/lib doesn't exist during 'make all'; +it is only created later, during 'make install'. (Which makes this problem +confusing, since one only notices the breakage well after 'make install', +at which point the path configure complained about does exist, and has the +right stuff in it.) + +A fix that I've been using for a while is to use sed to canonicalize +the path. The sed syntax is a bit obtuse, but it works. + +(hey, that's the first time I've ever used a label in a sed script; thanks to the sed faq +for explaining the :a ... ta method of looping to repeat a search-and-replace until it doesn't match.) + +[rediffed against gcc-4.1-20060210] + +--- gcc-4.1-20060210/gcc/Makefile.in.old 2006-01-11 06:29:29.000000000 -0800 ++++ gcc-4.1-20060210/gcc/Makefile.in 2006-02-14 16:08:54.000000000 -0800 +@@ -388,7 +388,10 @@ + CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@ + + # autoconf sets SYSTEM_HEADER_DIR to one of the above. +-SYSTEM_HEADER_DIR = @SYSTEM_HEADER_DIR@ ++# Purge it of unneccessary internal relative paths ++# to directories that might not exist yet. ++# The sed idiom for this is to repeat the search-and-replace until it doesn't match, using :a ... ta. ++SYSTEM_HEADER_DIR = `echo @SYSTEM_HEADER_DIR@ | sed -e :a -e "s,[^/]*/\.\.\/,," -e ta` + + # Control whether to run fixproto and fixincludes. + STMP_FIXPROTO = @STMP_FIXPROTO@ +@@ -3167,13 +3170,15 @@ + ../$(build_subdir)/fixincludes/fixincl: ; @ : + + # Build fixed copies of system files. ++# Abort if no system headers available, unless building a crosscompiler. ++# Canonicalize $gcc_tooldir/sys-include in same way as $SYSTEM_HEADER_DIR was canonicalized so test still works + stmp-fixinc: gsyslimits.h macro_list \ + $(build_objdir)/fixincludes/fixincl \ + $(build_objdir)/fixincludes/fixinc.sh + @if ! $(inhibit_libc) && test ! -d ${SYSTEM_HEADER_DIR}; then \ + echo The directory that should contain system headers does not exist: >&2 ; \ + echo " ${SYSTEM_HEADER_DIR}" >&2 ; \ +- if test "x${SYSTEM_HEADER_DIR}" = "x${gcc_tooldir}/sys-include"; \ ++ if test "x${SYSTEM_HEADER_DIR}" = "x`echo "${gcc_tooldir}/sys-include" | sed -e :a -e "s,[^/]*/\.\.\/,," -e ta`"; \ + then sleep 1; else exit 1; fi; \ + fi + rm -rf include; mkdir include diff --git a/patches/gcc/4.1.0/100-gcc-4.1-fix-fixincl.patch b/patches/gcc/4.1.0/100-gcc-4.1-fix-fixincl.patch deleted file mode 100644 index 3928705..0000000 --- a/patches/gcc/4.1.0/100-gcc-4.1-fix-fixincl.patch +++ /dev/null @@ -1,71 +0,0 @@ -See http://gcc.gnu.org/PR22541 - -From: Dan Kegel - -When building gcc-3.4.3 or gcc-4.x into a clean $PREFIX, -the configure script happily copies the glibc include files from include to sys-include; -here's the line from the log file (with $PREFIX instead of the real prefix): - -Copying $PREFIX/i686-unknown-linux-gnu/include to $PREFIX/i686-unknown-linux-gnu/sys-include - -But later, when running fixincludes, it gives the error message - The directory that should contain system headers does not exist: - $PREFIX/lib/gcc/i686-unknown-linux-gnu/3.4.3/../../../../i686-unknown-linux-gnu/sys-include - -Nevertheless, it continues building; the header files it installs in - $PREFIX/lib/gcc/i686-unknown-linux-gnu/3.4.3/include -do not include the boilerplate that would cause it to #include_next the -glibc headers in the system header directory. -Thus the resulting toolchain can't compile the following program: -#include -int x = PATH_MAX; -because its limits.h doesn't include the glibc header. - -The problem is that gcc/Makefile.in assumes that -it can refer to $PREFIX/i686-unknown-linux-gnu with the path - $PREFIX/lib/../i686-unknown-linux-gnu, but -that fails because the directory $PREFIX/lib doesn't exist during 'make all'; -it is only created later, during 'make install'. (Which makes this problem -confusing, since one only notices the breakage well after 'make install', -at which point the path configure complained about does exist, and has the -right stuff in it.) - -A fix that I've been using for a while is to use sed to canonicalize -the path. The sed syntax is a bit obtuse, but it works. - -(hey, that's the first time I've ever used a label in a sed script; thanks to the sed faq -for explaining the :a ... ta method of looping to repeat a search-and-replace until it doesn't match.) - -[rediffed against gcc-4.1-20060210] - ---- gcc-4.1-20060210/gcc/Makefile.in.old 2006-01-11 06:29:29.000000000 -0800 -+++ gcc-4.1-20060210/gcc/Makefile.in 2006-02-14 16:08:54.000000000 -0800 -@@ -388,7 +388,10 @@ - CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@ - - # autoconf sets SYSTEM_HEADER_DIR to one of the above. --SYSTEM_HEADER_DIR = @SYSTEM_HEADER_DIR@ -+# Purge it of unneccessary internal relative paths -+# to directories that might not exist yet. -+# The sed idiom for this is to repeat the search-and-replace until it doesn't match, using :a ... ta. -+SYSTEM_HEADER_DIR = `echo @SYSTEM_HEADER_DIR@ | sed -e :a -e "s,[^/]*/\.\.\/,," -e ta` - - # Control whether to run fixproto and fixincludes. - STMP_FIXPROTO = @STMP_FIXPROTO@ -@@ -3167,13 +3170,15 @@ - ../$(build_subdir)/fixincludes/fixincl: ; @ : - - # Build fixed copies of system files. -+# Abort if no system headers available, unless building a crosscompiler. -+# Canonicalize $gcc_tooldir/sys-include in same way as $SYSTEM_HEADER_DIR was canonicalized so test still works - stmp-fixinc: gsyslimits.h macro_list \ - $(build_objdir)/fixincludes/fixincl \ - $(build_objdir)/fixincludes/fixinc.sh - @if ! $(inhibit_libc) && test ! -d ${SYSTEM_HEADER_DIR}; then \ - echo The directory that should contain system headers does not exist: >&2 ; \ - echo " ${SYSTEM_HEADER_DIR}" >&2 ; \ -- if test "x${SYSTEM_HEADER_DIR}" = "x${gcc_tooldir}/sys-include"; \ -+ if test "x${SYSTEM_HEADER_DIR}" = "x`echo "${gcc_tooldir}/sys-include" | sed -e :a -e "s,[^/]*/\.\.\/,," -e ta`"; \ - then sleep 1; else exit 1; fi; \ - fi - rm -rf include; mkdir include diff --git a/patches/gcc/4.2.0/940-alpha-signal_h.patch b/patches/gcc/4.2.0/940-alpha-signal_h.patch new file mode 100644 index 0000000..d7e1796 --- /dev/null +++ b/patches/gcc/4.2.0/940-alpha-signal_h.patch @@ -0,0 +1,17 @@ +--- gcc-4.2.1-stock/gcc/config/alpha/linux-unwind.h 2005-06-24 20:22:41.000000000 -0500 ++++ gcc-4.2.1/gcc/config/alpha/linux-unwind.h 2007-09-01 20:21:34.000000000 -0500 +@@ -29,6 +29,9 @@ Boston, MA 02110-1301, USA. */ + /* Do code reading to identify a signal frame, and set the frame + state data appropriately. See unwind-dw2.c for the structs. */ + ++/* Don't use this if inhibit_libc is set ++ The build for this target will fail trying to include missing headers */ ++#ifndef inhibit_libc + #include + #include + +@@ -80,3 +83,4 @@ alpha_fallback_frame_state (struct _Unwi + fs->retaddr_column = 64; + return _URC_NO_REASON; + } ++#endif /* inhibit_libc */ diff --git a/patches/gcc/4.2.0/940-gcc-alpha-signal_h.patch b/patches/gcc/4.2.0/940-gcc-alpha-signal_h.patch deleted file mode 100644 index d7e1796..0000000 --- a/patches/gcc/4.2.0/940-gcc-alpha-signal_h.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- gcc-4.2.1-stock/gcc/config/alpha/linux-unwind.h 2005-06-24 20:22:41.000000000 -0500 -+++ gcc-4.2.1/gcc/config/alpha/linux-unwind.h 2007-09-01 20:21:34.000000000 -0500 -@@ -29,6 +29,9 @@ Boston, MA 02110-1301, USA. */ - /* Do code reading to identify a signal frame, and set the frame - state data appropriately. See unwind-dw2.c for the structs. */ - -+/* Don't use this if inhibit_libc is set -+ The build for this target will fail trying to include missing headers */ -+#ifndef inhibit_libc - #include - #include - -@@ -80,3 +83,4 @@ alpha_fallback_frame_state (struct _Unwi - fs->retaddr_column = 64; - return _URC_NO_REASON; - } -+#endif /* inhibit_libc */ diff --git a/patches/gcc/4.2.1/940-alpha-signal_h.patch b/patches/gcc/4.2.1/940-alpha-signal_h.patch new file mode 100644 index 0000000..d7e1796 --- /dev/null +++ b/patches/gcc/4.2.1/940-alpha-signal_h.patch @@ -0,0 +1,17 @@ +--- gcc-4.2.1-stock/gcc/config/alpha/linux-unwind.h 2005-06-24 20:22:41.000000000 -0500 ++++ gcc-4.2.1/gcc/config/alpha/linux-unwind.h 2007-09-01 20:21:34.000000000 -0500 +@@ -29,6 +29,9 @@ Boston, MA 02110-1301, USA. */ + /* Do code reading to identify a signal frame, and set the frame + state data appropriately. See unwind-dw2.c for the structs. */ + ++/* Don't use this if inhibit_libc is set ++ The build for this target will fail trying to include missing headers */ ++#ifndef inhibit_libc + #include + #include + +@@ -80,3 +83,4 @@ alpha_fallback_frame_state (struct _Unwi + fs->retaddr_column = 64; + return _URC_NO_REASON; + } ++#endif /* inhibit_libc */ diff --git a/patches/gcc/4.2.1/940-gcc-alpha-signal_h.patch b/patches/gcc/4.2.1/940-gcc-alpha-signal_h.patch deleted file mode 100644 index d7e1796..0000000 --- a/patches/gcc/4.2.1/940-gcc-alpha-signal_h.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- gcc-4.2.1-stock/gcc/config/alpha/linux-unwind.h 2005-06-24 20:22:41.000000000 -0500 -+++ gcc-4.2.1/gcc/config/alpha/linux-unwind.h 2007-09-01 20:21:34.000000000 -0500 -@@ -29,6 +29,9 @@ Boston, MA 02110-1301, USA. */ - /* Do code reading to identify a signal frame, and set the frame - state data appropriately. See unwind-dw2.c for the structs. */ - -+/* Don't use this if inhibit_libc is set -+ The build for this target will fail trying to include missing headers */ -+#ifndef inhibit_libc - #include - #include - -@@ -80,3 +83,4 @@ alpha_fallback_frame_state (struct _Unwi - fs->retaddr_column = 64; - return _URC_NO_REASON; - } -+#endif /* inhibit_libc */ diff --git a/patches/gcc/4.2.2/940-alpha-signal_h.patch b/patches/gcc/4.2.2/940-alpha-signal_h.patch new file mode 100644 index 0000000..d7e1796 --- /dev/null +++ b/patches/gcc/4.2.2/940-alpha-signal_h.patch @@ -0,0 +1,17 @@ +--- gcc-4.2.1-stock/gcc/config/alpha/linux-unwind.h 2005-06-24 20:22:41.000000000 -0500 ++++ gcc-4.2.1/gcc/config/alpha/linux-unwind.h 2007-09-01 20:21:34.000000000 -0500 +@@ -29,6 +29,9 @@ Boston, MA 02110-1301, USA. */ + /* Do code reading to identify a signal frame, and set the frame + state data appropriately. See unwind-dw2.c for the structs. */ + ++/* Don't use this if inhibit_libc is set ++ The build for this target will fail trying to include missing headers */ ++#ifndef inhibit_libc + #include + #include + +@@ -80,3 +83,4 @@ alpha_fallback_frame_state (struct _Unwi + fs->retaddr_column = 64; + return _URC_NO_REASON; + } ++#endif /* inhibit_libc */ diff --git a/patches/gcc/4.2.2/940-gcc-alpha-signal_h.patch b/patches/gcc/4.2.2/940-gcc-alpha-signal_h.patch deleted file mode 100644 index d7e1796..0000000 --- a/patches/gcc/4.2.2/940-gcc-alpha-signal_h.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- gcc-4.2.1-stock/gcc/config/alpha/linux-unwind.h 2005-06-24 20:22:41.000000000 -0500 -+++ gcc-4.2.1/gcc/config/alpha/linux-unwind.h 2007-09-01 20:21:34.000000000 -0500 -@@ -29,6 +29,9 @@ Boston, MA 02110-1301, USA. */ - /* Do code reading to identify a signal frame, and set the frame - state data appropriately. See unwind-dw2.c for the structs. */ - -+/* Don't use this if inhibit_libc is set -+ The build for this target will fail trying to include missing headers */ -+#ifndef inhibit_libc - #include - #include - -@@ -80,3 +83,4 @@ alpha_fallback_frame_state (struct _Unwi - fs->retaddr_column = 64; - return _URC_NO_REASON; - } -+#endif /* inhibit_libc */ diff --git a/patches/gcc/4.2.3/940-alpha-signal_h.patch b/patches/gcc/4.2.3/940-alpha-signal_h.patch new file mode 100644 index 0000000..d7e1796 --- /dev/null +++ b/patches/gcc/4.2.3/940-alpha-signal_h.patch @@ -0,0 +1,17 @@ +--- gcc-4.2.1-stock/gcc/config/alpha/linux-unwind.h 2005-06-24 20:22:41.000000000 -0500 ++++ gcc-4.2.1/gcc/config/alpha/linux-unwind.h 2007-09-01 20:21:34.000000000 -0500 +@@ -29,6 +29,9 @@ Boston, MA 02110-1301, USA. */ + /* Do code reading to identify a signal frame, and set the frame + state data appropriately. See unwind-dw2.c for the structs. */ + ++/* Don't use this if inhibit_libc is set ++ The build for this target will fail trying to include missing headers */ ++#ifndef inhibit_libc + #include + #include + +@@ -80,3 +83,4 @@ alpha_fallback_frame_state (struct _Unwi + fs->retaddr_column = 64; + return _URC_NO_REASON; + } ++#endif /* inhibit_libc */ diff --git a/patches/gcc/4.2.3/940-gcc-alpha-signal_h.patch b/patches/gcc/4.2.3/940-gcc-alpha-signal_h.patch deleted file mode 100644 index d7e1796..0000000 --- a/patches/gcc/4.2.3/940-gcc-alpha-signal_h.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- gcc-4.2.1-stock/gcc/config/alpha/linux-unwind.h 2005-06-24 20:22:41.000000000 -0500 -+++ gcc-4.2.1/gcc/config/alpha/linux-unwind.h 2007-09-01 20:21:34.000000000 -0500 -@@ -29,6 +29,9 @@ Boston, MA 02110-1301, USA. */ - /* Do code reading to identify a signal frame, and set the frame - state data appropriately. See unwind-dw2.c for the structs. */ - -+/* Don't use this if inhibit_libc is set -+ The build for this target will fail trying to include missing headers */ -+#ifndef inhibit_libc - #include - #include - -@@ -80,3 +83,4 @@ alpha_fallback_frame_state (struct _Unwi - fs->retaddr_column = 64; - return _URC_NO_REASON; - } -+#endif /* inhibit_libc */ diff --git a/patches/gcc/4.2.4/940-alpha-signal_h.patch b/patches/gcc/4.2.4/940-alpha-signal_h.patch new file mode 100644 index 0000000..d7e1796 --- /dev/null +++ b/patches/gcc/4.2.4/940-alpha-signal_h.patch @@ -0,0 +1,17 @@ +--- gcc-4.2.1-stock/gcc/config/alpha/linux-unwind.h 2005-06-24 20:22:41.000000000 -0500 ++++ gcc-4.2.1/gcc/config/alpha/linux-unwind.h 2007-09-01 20:21:34.000000000 -0500 +@@ -29,6 +29,9 @@ Boston, MA 02110-1301, USA. */ + /* Do code reading to identify a signal frame, and set the frame + state data appropriately. See unwind-dw2.c for the structs. */ + ++/* Don't use this if inhibit_libc is set ++ The build for this target will fail trying to include missing headers */ ++#ifndef inhibit_libc + #include + #include + +@@ -80,3 +83,4 @@ alpha_fallback_frame_state (struct _Unwi + fs->retaddr_column = 64; + return _URC_NO_REASON; + } ++#endif /* inhibit_libc */ diff --git a/patches/gcc/4.2.4/940-gcc-alpha-signal_h.patch b/patches/gcc/4.2.4/940-gcc-alpha-signal_h.patch deleted file mode 100644 index d7e1796..0000000 --- a/patches/gcc/4.2.4/940-gcc-alpha-signal_h.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- gcc-4.2.1-stock/gcc/config/alpha/linux-unwind.h 2005-06-24 20:22:41.000000000 -0500 -+++ gcc-4.2.1/gcc/config/alpha/linux-unwind.h 2007-09-01 20:21:34.000000000 -0500 -@@ -29,6 +29,9 @@ Boston, MA 02110-1301, USA. */ - /* Do code reading to identify a signal frame, and set the frame - state data appropriately. See unwind-dw2.c for the structs. */ - -+/* Don't use this if inhibit_libc is set -+ The build for this target will fail trying to include missing headers */ -+#ifndef inhibit_libc - #include - #include - -@@ -80,3 +83,4 @@ alpha_fallback_frame_state (struct _Unwi - fs->retaddr_column = 64; - return _URC_NO_REASON; - } -+#endif /* inhibit_libc */ diff --git a/patches/gcc/4.3.0/100-alpha-mieee-default.patch b/patches/gcc/4.3.0/100-alpha-mieee-default.patch new file mode 100644 index 0000000..1211207 --- /dev/null +++ b/patches/gcc/4.3.0/100-alpha-mieee-default.patch @@ -0,0 +1,34 @@ +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/00_all_gcc-4.1-alpha-mieee-default.patch +Set the default behavior on alpha to use -mieee since the large majority of +time we want this (bad/weird things can happen with packages built without +-mieee). + +To satisfy those people who may not want -mieee forced on them all the time, +we also provide -mno-ieee. + +Patch by Mike Frysinger + +diff -durN gcc-4.3.0.orig/gcc/config/alpha/alpha.h gcc-4.3.0/gcc/config/alpha/alpha.h +--- gcc-4.3.0.orig/gcc/config/alpha/alpha.h 2007-12-06 14:25:37.000000000 +0100 ++++ gcc-4.3.0/gcc/config/alpha/alpha.h 2008-06-10 14:44:06.000000000 +0200 +@@ -95,6 +95,8 @@ + while (0) + #endif + ++#define CPP_SPEC "%{!no-ieee:-mieee}" ++ + #define WORD_SWITCH_TAKES_ARG(STR) \ + (!strcmp (STR, "rpath") || DEFAULT_WORD_SWITCH_TAKES_ARG(STR)) + +diff -durN gcc-4.3.0.orig/gcc/config/alpha/alpha.opt gcc-4.3.0/gcc/config/alpha/alpha.opt +--- gcc-4.3.0.orig/gcc/config/alpha/alpha.opt 2007-08-02 12:49:31.000000000 +0200 ++++ gcc-4.3.0/gcc/config/alpha/alpha.opt 2008-06-10 14:44:06.000000000 +0200 +@@ -39,7 +39,7 @@ + Request IEEE-conformant math library routines (OSF/1) + + mieee +-Target Report RejectNegative Mask(IEEE) ++Target Report Mask(IEEE) + Emit IEEE-conformant code, without inexact exceptions + + mieee-with-inexact diff --git a/patches/gcc/4.3.0/100-gcc-4.1-alpha-mieee-default.patch b/patches/gcc/4.3.0/100-gcc-4.1-alpha-mieee-default.patch deleted file mode 100644 index 1211207..0000000 --- a/patches/gcc/4.3.0/100-gcc-4.1-alpha-mieee-default.patch +++ /dev/null @@ -1,34 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/00_all_gcc-4.1-alpha-mieee-default.patch -Set the default behavior on alpha to use -mieee since the large majority of -time we want this (bad/weird things can happen with packages built without --mieee). - -To satisfy those people who may not want -mieee forced on them all the time, -we also provide -mno-ieee. - -Patch by Mike Frysinger - -diff -durN gcc-4.3.0.orig/gcc/config/alpha/alpha.h gcc-4.3.0/gcc/config/alpha/alpha.h ---- gcc-4.3.0.orig/gcc/config/alpha/alpha.h 2007-12-06 14:25:37.000000000 +0100 -+++ gcc-4.3.0/gcc/config/alpha/alpha.h 2008-06-10 14:44:06.000000000 +0200 -@@ -95,6 +95,8 @@ - while (0) - #endif - -+#define CPP_SPEC "%{!no-ieee:-mieee}" -+ - #define WORD_SWITCH_TAKES_ARG(STR) \ - (!strcmp (STR, "rpath") || DEFAULT_WORD_SWITCH_TAKES_ARG(STR)) - -diff -durN gcc-4.3.0.orig/gcc/config/alpha/alpha.opt gcc-4.3.0/gcc/config/alpha/alpha.opt ---- gcc-4.3.0.orig/gcc/config/alpha/alpha.opt 2007-08-02 12:49:31.000000000 +0200 -+++ gcc-4.3.0/gcc/config/alpha/alpha.opt 2008-06-10 14:44:06.000000000 +0200 -@@ -39,7 +39,7 @@ - Request IEEE-conformant math library routines (OSF/1) - - mieee --Target Report RejectNegative Mask(IEEE) -+Target Report Mask(IEEE) - Emit IEEE-conformant code, without inexact exceptions - - mieee-with-inexact diff --git a/patches/gcc/4.3.0/125-gcc-trampolinewarn.patch b/patches/gcc/4.3.0/125-gcc-trampolinewarn.patch deleted file mode 100644 index 0c14ec3..0000000 --- a/patches/gcc/4.3.0/125-gcc-trampolinewarn.patch +++ /dev/null @@ -1,35 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/00_all_gcc-trampolinewarn.patch - This trivial patch causes gcc to emit a warning whenever - it generates a trampoline. These are otherwise hard to - locate. It is rigged to default ON - to have it default - to OFF remove the text 'Init(1)' from the common.opt - patch, leaving just 'Common Var(warn_trampolines)'. - Kevin F. Quinn 17 Jan 2006 - -diff -durN gcc-4.3.0.orig/gcc/builtins.c gcc-4.3.0/gcc/builtins.c ---- gcc-4.3.0.orig/gcc/builtins.c 2008-02-20 18:27:21.000000000 +0100 -+++ gcc-4.3.0/gcc/builtins.c 2008-06-10 14:44:10.000000000 +0200 -@@ -5659,6 +5659,9 @@ - trampolines_created = 1; - INITIALIZE_TRAMPOLINE (r_tramp, r_func, r_chain); - -+ if (warn_trampolines) -+ warning (OPT_Wtrampolines, "generating trampoline in object (requires executable stack)"); -+ - return const0_rtx; - } - -diff -durN gcc-4.3.0.orig/gcc/common.opt gcc-4.3.0/gcc/common.opt ---- gcc-4.3.0.orig/gcc/common.opt 2008-01-22 15:11:44.000000000 +0100 -+++ gcc-4.3.0/gcc/common.opt 2008-06-10 14:44:10.000000000 +0200 -@@ -182,6 +182,10 @@ - Common Var(warn_system_headers) Warning - Do not suppress warnings from system headers - -+Wtrampolines -+Common Var(warn_trampolines) Init(1) -+Warn whenever a trampoline is generated -+ - Wuninitialized - Common Var(warn_uninitialized) Warning - Warn about uninitialized automatic variables diff --git a/patches/gcc/4.3.0/125-trampolinewarn.patch b/patches/gcc/4.3.0/125-trampolinewarn.patch new file mode 100644 index 0000000..0c14ec3 --- /dev/null +++ b/patches/gcc/4.3.0/125-trampolinewarn.patch @@ -0,0 +1,35 @@ +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/00_all_gcc-trampolinewarn.patch + This trivial patch causes gcc to emit a warning whenever + it generates a trampoline. These are otherwise hard to + locate. It is rigged to default ON - to have it default + to OFF remove the text 'Init(1)' from the common.opt + patch, leaving just 'Common Var(warn_trampolines)'. + Kevin F. Quinn 17 Jan 2006 + +diff -durN gcc-4.3.0.orig/gcc/builtins.c gcc-4.3.0/gcc/builtins.c +--- gcc-4.3.0.orig/gcc/builtins.c 2008-02-20 18:27:21.000000000 +0100 ++++ gcc-4.3.0/gcc/builtins.c 2008-06-10 14:44:10.000000000 +0200 +@@ -5659,6 +5659,9 @@ + trampolines_created = 1; + INITIALIZE_TRAMPOLINE (r_tramp, r_func, r_chain); + ++ if (warn_trampolines) ++ warning (OPT_Wtrampolines, "generating trampoline in object (requires executable stack)"); ++ + return const0_rtx; + } + +diff -durN gcc-4.3.0.orig/gcc/common.opt gcc-4.3.0/gcc/common.opt +--- gcc-4.3.0.orig/gcc/common.opt 2008-01-22 15:11:44.000000000 +0100 ++++ gcc-4.3.0/gcc/common.opt 2008-06-10 14:44:10.000000000 +0200 +@@ -182,6 +182,10 @@ + Common Var(warn_system_headers) Warning + Do not suppress warnings from system headers + ++Wtrampolines ++Common Var(warn_trampolines) Init(1) ++Warn whenever a trampoline is generated ++ + Wuninitialized + Common Var(warn_uninitialized) Warning + Warn about uninitialized automatic variables diff --git a/patches/gcc/4.3.0/150-gcc43-java-nomulti.patch b/patches/gcc/4.3.0/150-gcc43-java-nomulti.patch deleted file mode 100644 index f75fbf6..0000000 --- a/patches/gcc/4.3.0/150-gcc43-java-nomulti.patch +++ /dev/null @@ -1,47 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/03_all_gcc43-java-nomulti.patch -diff -durN gcc-4.3.0.orig/libjava/configure gcc-4.3.0/libjava/configure ---- gcc-4.3.0.orig/libjava/configure 2008-03-05 19:44:25.000000000 +0100 -+++ gcc-4.3.0/libjava/configure 2008-06-10 14:44:13.000000000 +0200 -@@ -1018,6 +1018,8 @@ - --enable-gconf-peer compile GConf native peers for util.preferences - --enable-java-maintainer-mode - allow rebuilding of .class and .h files -+ --enable-libjava-multilib -+ build libjava as multilib - --disable-dependency-tracking speeds up one-time build - --enable-dependency-tracking do not reject slow dependency extractors - --enable-maintainer-mode enable make rules and dependencies not useful -@@ -1850,6 +1852,16 @@ - fi - - -+# Check whether --enable-libjava-multilib was given. -+if test "${enable_libjava_multilib+set}" = set; then -+ enableval=$enable_libjava_multilib; -+fi -+ -+if test "$enable_libjava_multilib" = no; then -+ multilib=no -+ ac_configure_args="$ac_configure_args --disable-multilib" -+fi -+ - # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX. - - -diff -durN gcc-4.3.0.orig/libjava/configure.ac gcc-4.3.0/libjava/configure.ac ---- gcc-4.3.0.orig/libjava/configure.ac 2007-12-22 16:48:46.000000000 +0100 -+++ gcc-4.3.0/libjava/configure.ac 2008-06-10 14:44:13.000000000 +0200 -@@ -82,6 +82,13 @@ - [allow rebuilding of .class and .h files])) - AM_CONDITIONAL(JAVA_MAINTAINER_MODE, test "$enable_java_maintainer_mode" = yes) - -+AC_ARG_ENABLE(libjava-multilib, -+ AS_HELP_STRING([--enable-libjava-multilib], [build libjava as multilib])) -+if test "$enable_libjava_multilib" = no; then -+ multilib=no -+ ac_configure_args="$ac_configure_args --disable-multilib" -+fi -+ - # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX. - GCC_NO_EXECUTABLES - diff --git a/patches/gcc/4.3.0/150-java-nomulti.patch b/patches/gcc/4.3.0/150-java-nomulti.patch new file mode 100644 index 0000000..f75fbf6 --- /dev/null +++ b/patches/gcc/4.3.0/150-java-nomulti.patch @@ -0,0 +1,47 @@ +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/03_all_gcc43-java-nomulti.patch +diff -durN gcc-4.3.0.orig/libjava/configure gcc-4.3.0/libjava/configure +--- gcc-4.3.0.orig/libjava/configure 2008-03-05 19:44:25.000000000 +0100 ++++ gcc-4.3.0/libjava/configure 2008-06-10 14:44:13.000000000 +0200 +@@ -1018,6 +1018,8 @@ + --enable-gconf-peer compile GConf native peers for util.preferences + --enable-java-maintainer-mode + allow rebuilding of .class and .h files ++ --enable-libjava-multilib ++ build libjava as multilib + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + --enable-maintainer-mode enable make rules and dependencies not useful +@@ -1850,6 +1852,16 @@ + fi + + ++# Check whether --enable-libjava-multilib was given. ++if test "${enable_libjava_multilib+set}" = set; then ++ enableval=$enable_libjava_multilib; ++fi ++ ++if test "$enable_libjava_multilib" = no; then ++ multilib=no ++ ac_configure_args="$ac_configure_args --disable-multilib" ++fi ++ + # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX. + + +diff -durN gcc-4.3.0.orig/libjava/configure.ac gcc-4.3.0/libjava/configure.ac +--- gcc-4.3.0.orig/libjava/configure.ac 2007-12-22 16:48:46.000000000 +0100 ++++ gcc-4.3.0/libjava/configure.ac 2008-06-10 14:44:13.000000000 +0200 +@@ -82,6 +82,13 @@ + [allow rebuilding of .class and .h files])) + AM_CONDITIONAL(JAVA_MAINTAINER_MODE, test "$enable_java_maintainer_mode" = yes) + ++AC_ARG_ENABLE(libjava-multilib, ++ AS_HELP_STRING([--enable-libjava-multilib], [build libjava as multilib])) ++if test "$enable_libjava_multilib" = no; then ++ multilib=no ++ ac_configure_args="$ac_configure_args --disable-multilib" ++fi ++ + # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX. + GCC_NO_EXECUTABLES + diff --git a/patches/gcc/4.3.0/175-cross-compile.patch b/patches/gcc/4.3.0/175-cross-compile.patch new file mode 100644 index 0000000..7eddac3 --- /dev/null +++ b/patches/gcc/4.3.0/175-cross-compile.patch @@ -0,0 +1,44 @@ +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/08_all_gcc-4.1-cross-compile.patch +Some notes on the 'bootstrap with or without libc headers' debate: +http://linuxfromscratch.org/pipermail/lfs-dev/2005-July/052409.html +http://gcc.gnu.org/ml/gcc/2005-07/msg01195.html + +diff -durN gcc-4.3.0.orig/gcc/configure gcc-4.3.0/gcc/configure +--- gcc-4.3.0.orig/gcc/configure 2008-03-05 00:39:11.000000000 +0100 ++++ gcc-4.3.0/gcc/configure 2008-06-10 14:44:17.000000000 +0200 +@@ -13274,7 +13274,7 @@ + | powerpc*-*-*,powerpc64*-*-*) + CROSS="$CROSS -DNATIVE_CROSS" ;; + esac +-elif test "x$TARGET_SYSTEM_ROOT" != x; then ++elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then + SYSTEM_HEADER_DIR=$build_system_header_dir + fi + +diff -durN gcc-4.3.0.orig/gcc/configure.ac gcc-4.3.0/gcc/configure.ac +--- gcc-4.3.0.orig/gcc/configure.ac 2008-03-05 00:39:11.000000000 +0100 ++++ gcc-4.3.0/gcc/configure.ac 2008-06-10 14:44:17.000000000 +0200 +@@ -1745,7 +1745,7 @@ + | powerpc*-*-*,powerpc64*-*-*) + CROSS="$CROSS -DNATIVE_CROSS" ;; + esac +-elif test "x$TARGET_SYSTEM_ROOT" != x; then ++elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then + SYSTEM_HEADER_DIR=$build_system_header_dir + fi + +diff -durN gcc-4.3.0.orig/gcc/unwind-dw2.c gcc-4.3.0/gcc/unwind-dw2.c +--- gcc-4.3.0.orig/gcc/unwind-dw2.c 2007-07-25 20:14:57.000000000 +0200 ++++ gcc-4.3.0/gcc/unwind-dw2.c 2008-06-10 14:44:17.000000000 +0200 +@@ -334,9 +334,11 @@ + } + #endif + ++#ifndef inhibit_libc + #ifdef MD_UNWIND_SUPPORT + #include MD_UNWIND_SUPPORT + #endif ++#endif + + /* Extract any interesting information from the CIE for the translation + unit F belongs to. Return a pointer to the byte after the augmentation, diff --git a/patches/gcc/4.3.0/175-gcc-4.1-cross-compile.patch b/patches/gcc/4.3.0/175-gcc-4.1-cross-compile.patch deleted file mode 100644 index 7eddac3..0000000 --- a/patches/gcc/4.3.0/175-gcc-4.1-cross-compile.patch +++ /dev/null @@ -1,44 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/08_all_gcc-4.1-cross-compile.patch -Some notes on the 'bootstrap with or without libc headers' debate: -http://linuxfromscratch.org/pipermail/lfs-dev/2005-July/052409.html -http://gcc.gnu.org/ml/gcc/2005-07/msg01195.html - -diff -durN gcc-4.3.0.orig/gcc/configure gcc-4.3.0/gcc/configure ---- gcc-4.3.0.orig/gcc/configure 2008-03-05 00:39:11.000000000 +0100 -+++ gcc-4.3.0/gcc/configure 2008-06-10 14:44:17.000000000 +0200 -@@ -13274,7 +13274,7 @@ - | powerpc*-*-*,powerpc64*-*-*) - CROSS="$CROSS -DNATIVE_CROSS" ;; - esac --elif test "x$TARGET_SYSTEM_ROOT" != x; then -+elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then - SYSTEM_HEADER_DIR=$build_system_header_dir - fi - -diff -durN gcc-4.3.0.orig/gcc/configure.ac gcc-4.3.0/gcc/configure.ac ---- gcc-4.3.0.orig/gcc/configure.ac 2008-03-05 00:39:11.000000000 +0100 -+++ gcc-4.3.0/gcc/configure.ac 2008-06-10 14:44:17.000000000 +0200 -@@ -1745,7 +1745,7 @@ - | powerpc*-*-*,powerpc64*-*-*) - CROSS="$CROSS -DNATIVE_CROSS" ;; - esac --elif test "x$TARGET_SYSTEM_ROOT" != x; then -+elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then - SYSTEM_HEADER_DIR=$build_system_header_dir - fi - -diff -durN gcc-4.3.0.orig/gcc/unwind-dw2.c gcc-4.3.0/gcc/unwind-dw2.c ---- gcc-4.3.0.orig/gcc/unwind-dw2.c 2007-07-25 20:14:57.000000000 +0200 -+++ gcc-4.3.0/gcc/unwind-dw2.c 2008-06-10 14:44:17.000000000 +0200 -@@ -334,9 +334,11 @@ - } - #endif - -+#ifndef inhibit_libc - #ifdef MD_UNWIND_SUPPORT - #include MD_UNWIND_SUPPORT - #endif -+#endif - - /* Extract any interesting information from the CIE for the translation - unit F belongs to. Return a pointer to the byte after the augmentation, diff --git a/patches/gcc/4.3.0/200-gcc-netbsd-symbolic.patch b/patches/gcc/4.3.0/200-gcc-netbsd-symbolic.patch deleted file mode 100644 index a4e6913..0000000 --- a/patches/gcc/4.3.0/200-gcc-netbsd-symbolic.patch +++ /dev/null @@ -1,14 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/11_all_gcc-netbsd-symbolic.patch -http://bugs.gentoo.org/122698 - -diff -durN gcc-4.3.0.orig/gcc/config/netbsd-elf.h gcc-4.3.0/gcc/config/netbsd-elf.h ---- gcc-4.3.0.orig/gcc/config/netbsd-elf.h 2007-09-03 18:14:04.000000000 +0200 -+++ gcc-4.3.0/gcc/config/netbsd-elf.h 2008-06-10 14:44:21.000000000 +0200 -@@ -82,6 +82,7 @@ - #define NETBSD_LINK_SPEC_ELF \ - "%{assert*} %{R*} %{rpath*} \ - %{shared:-shared} \ -+ %{symbolic:-Bsymbolic} \ - %{!shared: \ - -dc -dp \ - %{!nostdlib: \ diff --git a/patches/gcc/4.3.0/200-netbsd-symbolic.patch b/patches/gcc/4.3.0/200-netbsd-symbolic.patch new file mode 100644 index 0000000..a4e6913 --- /dev/null +++ b/patches/gcc/4.3.0/200-netbsd-symbolic.patch @@ -0,0 +1,14 @@ +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/11_all_gcc-netbsd-symbolic.patch +http://bugs.gentoo.org/122698 + +diff -durN gcc-4.3.0.orig/gcc/config/netbsd-elf.h gcc-4.3.0/gcc/config/netbsd-elf.h +--- gcc-4.3.0.orig/gcc/config/netbsd-elf.h 2007-09-03 18:14:04.000000000 +0200 ++++ gcc-4.3.0/gcc/config/netbsd-elf.h 2008-06-10 14:44:21.000000000 +0200 +@@ -82,6 +82,7 @@ + #define NETBSD_LINK_SPEC_ELF \ + "%{assert*} %{R*} %{rpath*} \ + %{shared:-shared} \ ++ %{symbolic:-Bsymbolic} \ + %{!shared: \ + -dc -dp \ + %{!nostdlib: \ diff --git a/patches/gcc/4.3.0/225-gcc-sparc64-bsd.patch b/patches/gcc/4.3.0/225-gcc-sparc64-bsd.patch deleted file mode 100644 index 7c4fb5d..0000000 --- a/patches/gcc/4.3.0/225-gcc-sparc64-bsd.patch +++ /dev/null @@ -1,30 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/14_all_gcc-sparc64-bsd.patch -diff -durN gcc-4.3.0.orig/gcc/config/sparc/freebsd.h gcc-4.3.0/gcc/config/sparc/freebsd.h ---- gcc-4.3.0.orig/gcc/config/sparc/freebsd.h 2007-08-02 12:49:31.000000000 +0200 -+++ gcc-4.3.0/gcc/config/sparc/freebsd.h 2008-06-10 14:44:26.000000000 +0200 -@@ -25,9 +25,22 @@ - /* FreeBSD needs the platform name (sparc64) defined. - Emacs needs to know if the arch is 64 or 32-bits. */ - --#undef CPP_CPU64_DEFAULT_SPEC --#define CPP_CPU64_DEFAULT_SPEC \ -- "-D__sparc64__ -D__sparc_v9__ -D__sparcv9 -D__arch64__" -+#undef FBSD_TARGET_CPU_CPP_BUILTINS -+#define FBSD_TARGET_CPU_CPP_BUILTINS() \ -+ do \ -+ { \ -+ if (TARGET_ARCH64) \ -+ { \ -+ builtin_define ("__sparc64__"); \ -+ builtin_define ("__sparc_v9__"); \ -+ builtin_define ("__sparcv9"); \ -+ } \ -+ else \ -+ builtin_define ("__sparc"); \ -+ builtin_define ("__sparc__"); \ -+ } \ -+ while (0) -+ - - #define LINK_SPEC "%(link_arch) \ - %{!mno-relax:%{!r:-relax}} \ diff --git a/patches/gcc/4.3.0/225-sparc64-bsd.patch b/patches/gcc/4.3.0/225-sparc64-bsd.patch new file mode 100644 index 0000000..7c4fb5d --- /dev/null +++ b/patches/gcc/4.3.0/225-sparc64-bsd.patch @@ -0,0 +1,30 @@ +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/14_all_gcc-sparc64-bsd.patch +diff -durN gcc-4.3.0.orig/gcc/config/sparc/freebsd.h gcc-4.3.0/gcc/config/sparc/freebsd.h +--- gcc-4.3.0.orig/gcc/config/sparc/freebsd.h 2007-08-02 12:49:31.000000000 +0200 ++++ gcc-4.3.0/gcc/config/sparc/freebsd.h 2008-06-10 14:44:26.000000000 +0200 +@@ -25,9 +25,22 @@ + /* FreeBSD needs the platform name (sparc64) defined. + Emacs needs to know if the arch is 64 or 32-bits. */ + +-#undef CPP_CPU64_DEFAULT_SPEC +-#define CPP_CPU64_DEFAULT_SPEC \ +- "-D__sparc64__ -D__sparc_v9__ -D__sparcv9 -D__arch64__" ++#undef FBSD_TARGET_CPU_CPP_BUILTINS ++#define FBSD_TARGET_CPU_CPP_BUILTINS() \ ++ do \ ++ { \ ++ if (TARGET_ARCH64) \ ++ { \ ++ builtin_define ("__sparc64__"); \ ++ builtin_define ("__sparc_v9__"); \ ++ builtin_define ("__sparcv9"); \ ++ } \ ++ else \ ++ builtin_define ("__sparc"); \ ++ builtin_define ("__sparc__"); \ ++ } \ ++ while (0) ++ + + #define LINK_SPEC "%(link_arch) \ + %{!mno-relax:%{!r:-relax}} \ diff --git a/patches/gcc/4.3.0/250-904-flatten-switch-stmt-00.patch b/patches/gcc/4.3.0/250-904-flatten-switch-stmt-00.patch deleted file mode 100644 index 390f45e..0000000 --- a/patches/gcc/4.3.0/250-904-flatten-switch-stmt-00.patch +++ /dev/null @@ -1,76 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/18_all_904-flatten-switch-stmt-00.patch -http://gcc.gnu.org/ml/gcc-patches/2007-04/msg00927.html - -Hi, - -The attached patch makes sure that we create smaller object code for -simple switch statements. We just make sure to flatten the switch -statement into an if-else chain, basically. - -This fixes a size-regression as compared to gcc-3.4, as can be seen -below. - -2007-04-15 Bernhard Fischer <..> - - * stmt.c (expand_case): Do not create a complex binary tree when - optimizing for size but rather use the simple ordered list. - (emit_case_nodes): do not emit jumps to the default_label when - optimizing for size. - -Not regtested so far. -Comments? - -Attached is the test switch.c mentioned below. - -$ for i in 2.95 3.3 3.4 4.0 4.1 4.2.orig-HEAD 4.3.orig-HEAD 4.3-HEAD;do -gcc-$i -DCHAIN -Os -o switch-CHAIN-$i.o -c switch.c ;done -$ for i in 2.95 3.3 3.4 4.0 4.1 4.2.orig-HEAD 4.3.orig-HEAD 4.3-HEAD;do -gcc-$i -UCHAIN -Os -o switch-$i.o -c switch.c ;done - -$ size switch-*.o - text data bss dec hex filename - 169 0 0 169 a9 switch-2.95.o - 115 0 0 115 73 switch-3.3.o - 103 0 0 103 67 switch-3.4.o - 124 0 0 124 7c switch-4.0.o - 124 0 0 124 7c switch-4.1.o - 124 0 0 124 7c switch-4.2.orig-HEAD.o - 95 0 0 95 5f switch-4.3-HEAD.o - 124 0 0 124 7c switch-4.3.orig-HEAD.o - 166 0 0 166 a6 switch-CHAIN-2.95.o - 111 0 0 111 6f switch-CHAIN-3.3.o - 95 0 0 95 5f switch-CHAIN-3.4.o - 95 0 0 95 5f switch-CHAIN-4.0.o - 95 0 0 95 5f switch-CHAIN-4.1.o - 95 0 0 95 5f switch-CHAIN-4.2.orig-HEAD.o - 95 0 0 95 5f switch-CHAIN-4.3-HEAD.o - 95 0 0 95 5f switch-CHAIN-4.3.orig-HEAD.o - - -Content-Type: text/x-diff; charset=us-ascii -Content-Disposition: attachment; filename="gcc-4.3.gcc-flatten-switch-stmt.00.diff" - -diff -durN gcc-4.3.0.orig/gcc/stmt.c gcc-4.3.0/gcc/stmt.c ---- gcc-4.3.0.orig/gcc/stmt.c 2007-12-04 22:55:32.000000000 +0100 -+++ gcc-4.3.0/gcc/stmt.c 2008-06-10 14:44:33.000000000 +0200 -@@ -2508,7 +2508,11 @@ - use_cost_table - = (TREE_CODE (orig_type) != ENUMERAL_TYPE - && estimate_case_costs (case_list)); -- balance_case_nodes (&case_list, NULL); -+ /* When optimizing for size, we want a straight list to avoid -+ jumps as much as possible. This basically creates an if-else -+ chain. */ -+ if (!optimize_size) -+ balance_case_nodes (&case_list, NULL); - emit_case_nodes (index, case_list, default_label, index_type); - emit_jump (default_label); - } -@@ -3066,6 +3070,7 @@ - { - if (!node_has_low_bound (node, index_type)) - { -+ if (!optimize_size) /* don't jl to the .default_label. */ - emit_cmp_and_jump_insns (index, - convert_modes - (mode, imode, diff --git a/patches/gcc/4.3.0/250-flatten-switch-stmt-00.patch b/patches/gcc/4.3.0/250-flatten-switch-stmt-00.patch new file mode 100644 index 0000000..390f45e --- /dev/null +++ b/patches/gcc/4.3.0/250-flatten-switch-stmt-00.patch @@ -0,0 +1,76 @@ +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/18_all_904-flatten-switch-stmt-00.patch +http://gcc.gnu.org/ml/gcc-patches/2007-04/msg00927.html + +Hi, + +The attached patch makes sure that we create smaller object code for +simple switch statements. We just make sure to flatten the switch +statement into an if-else chain, basically. + +This fixes a size-regression as compared to gcc-3.4, as can be seen +below. + +2007-04-15 Bernhard Fischer <..> + + * stmt.c (expand_case): Do not create a complex binary tree when + optimizing for size but rather use the simple ordered list. + (emit_case_nodes): do not emit jumps to the default_label when + optimizing for size. + +Not regtested so far. +Comments? + +Attached is the test switch.c mentioned below. + +$ for i in 2.95 3.3 3.4 4.0 4.1 4.2.orig-HEAD 4.3.orig-HEAD 4.3-HEAD;do +gcc-$i -DCHAIN -Os -o switch-CHAIN-$i.o -c switch.c ;done +$ for i in 2.95 3.3 3.4 4.0 4.1 4.2.orig-HEAD 4.3.orig-HEAD 4.3-HEAD;do +gcc-$i -UCHAIN -Os -o switch-$i.o -c switch.c ;done + +$ size switch-*.o + text data bss dec hex filename + 169 0 0 169 a9 switch-2.95.o + 115 0 0 115 73 switch-3.3.o + 103 0 0 103 67 switch-3.4.o + 124 0 0 124 7c switch-4.0.o + 124 0 0 124 7c switch-4.1.o + 124 0 0 124 7c switch-4.2.orig-HEAD.o + 95 0 0 95 5f switch-4.3-HEAD.o + 124 0 0 124 7c switch-4.3.orig-HEAD.o + 166 0 0 166 a6 switch-CHAIN-2.95.o + 111 0 0 111 6f switch-CHAIN-3.3.o + 95 0 0 95 5f switch-CHAIN-3.4.o + 95 0 0 95 5f switch-CHAIN-4.0.o + 95 0 0 95 5f switch-CHAIN-4.1.o + 95 0 0 95 5f switch-CHAIN-4.2.orig-HEAD.o + 95 0 0 95 5f switch-CHAIN-4.3-HEAD.o + 95 0 0 95 5f switch-CHAIN-4.3.orig-HEAD.o + + +Content-Type: text/x-diff; charset=us-ascii +Content-Disposition: attachment; filename="gcc-4.3.gcc-flatten-switch-stmt.00.diff" + +diff -durN gcc-4.3.0.orig/gcc/stmt.c gcc-4.3.0/gcc/stmt.c +--- gcc-4.3.0.orig/gcc/stmt.c 2007-12-04 22:55:32.000000000 +0100 ++++ gcc-4.3.0/gcc/stmt.c 2008-06-10 14:44:33.000000000 +0200 +@@ -2508,7 +2508,11 @@ + use_cost_table + = (TREE_CODE (orig_type) != ENUMERAL_TYPE + && estimate_case_costs (case_list)); +- balance_case_nodes (&case_list, NULL); ++ /* When optimizing for size, we want a straight list to avoid ++ jumps as much as possible. This basically creates an if-else ++ chain. */ ++ if (!optimize_size) ++ balance_case_nodes (&case_list, NULL); + emit_case_nodes (index, case_list, default_label, index_type); + emit_jump (default_label); + } +@@ -3066,6 +3070,7 @@ + { + if (!node_has_low_bound (node, index_type)) + { ++ if (!optimize_size) /* don't jl to the .default_label. */ + emit_cmp_and_jump_insns (index, + convert_modes + (mode, imode, diff --git a/patches/gcc/4.3.0/275-gcc-x86-emit-cld.patch b/patches/gcc/4.3.0/275-gcc-x86-emit-cld.patch deleted file mode 100644 index a2b723a..0000000 --- a/patches/gcc/4.3.0/275-gcc-x86-emit-cld.patch +++ /dev/null @@ -1,156 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/20_all_gcc-x86-emit-cld.patch -bandaid for the cld issue. to be dropped when gcc-4.3 goes stable. - -http://gcc.gnu.org/ml/gcc-patches/2008-03/msg00417.html - -2008-03-06 Uros Bizjak - - * config/i386/i386.h (TARGET_CLD): New define. - (struct machine_function): Add needs_cld field. - (ix86_current_function_needs_cld): New define. - * config/i386/i386.md (UNSPEC_CLD): New unspec volatile constant. - ("cld"): New isns pattern. - ("strmov_singleop"): Set ix86_current_function_needs_cld flag. - ("rep_mov"): Ditto. - ("strset_singleop"): Ditto. - ("rep_stos"): Ditto. - ("cmpstrnqi_nz_1"): Ditto. - ("cmpstrnqi_1"): Ditto. - ("strlenqi_1"): Ditto. - * config/i386/i386.c (ix86_expand_prologue): Emit cld insn for - TARGET_CLD when ix86_current_function_needs_cld is set. - -diff -durN gcc-4.3.0.orig/gcc/config/i386/i386.c gcc-4.3.0/gcc/config/i386/i386.c ---- gcc-4.3.0.orig/gcc/config/i386/i386.c 2008-02-21 13:30:00.000000000 +0100 -+++ gcc-4.3.0/gcc/config/i386/i386.c 2008-06-10 14:44:37.000000000 +0200 -@@ -6448,6 +6448,10 @@ - emit_insn (gen_prologue_use (pic_offset_table_rtx)); - emit_insn (gen_blockage ()); - } -+ -+ /* Emit cld instruction if stringops are used in the function. */ -+ if (TARGET_CLD && ix86_current_function_needs_cld) -+ emit_insn (gen_cld ()); - } - - /* Emit code to restore saved registers using MOV insns. First register -diff -durN gcc-4.3.0.orig/gcc/config/i386/i386.h gcc-4.3.0/gcc/config/i386/i386.h ---- gcc-4.3.0.orig/gcc/config/i386/i386.h 2008-02-15 09:12:02.000000000 +0100 -+++ gcc-4.3.0/gcc/config/i386/i386.h 2008-06-10 14:44:37.000000000 +0200 -@@ -388,6 +388,7 @@ - - extern int x86_prefetch_sse; - -+#define TARGET_CLD 1 - #define TARGET_ABM x86_abm - #define TARGET_CMPXCHG16B x86_cmpxchg16b - #define TARGET_POPCNT x86_popcnt -@@ -2443,8 +2444,9 @@ - int save_varrargs_registers; - int accesses_prev_frame; - int optimize_mode_switching[MAX_386_ENTITIES]; -- /* Set by ix86_compute_frame_layout and used by prologue/epilogue expander to -- determine the style used. */ -+ int needs_cld; -+ /* Set by ix86_compute_frame_layout and used by prologue/epilogue -+ expander to determine the style used. */ - int use_fast_prologue_epilogue; - /* Number of saved registers USE_FAST_PROLOGUE_EPILOGUE has been computed - for. */ -@@ -2464,6 +2466,7 @@ - #define ix86_stack_locals (cfun->machine->stack_locals) - #define ix86_save_varrargs_registers (cfun->machine->save_varrargs_registers) - #define ix86_optimize_mode_switching (cfun->machine->optimize_mode_switching) -+#define ix86_current_function_needs_cld (cfun->machine->needs_cld) - #define ix86_tls_descriptor_calls_expanded_in_cfun \ - (cfun->machine->tls_descriptor_call_expanded_p) - /* Since tls_descriptor_call_expanded is not cleared, even if all TLS -diff -durN gcc-4.3.0.orig/gcc/config/i386/i386.md gcc-4.3.0/gcc/config/i386/i386.md ---- gcc-4.3.0.orig/gcc/config/i386/i386.md 2008-02-06 12:34:00.000000000 +0100 -+++ gcc-4.3.0/gcc/config/i386/i386.md 2008-06-10 14:44:37.000000000 +0200 -@@ -205,6 +205,7 @@ - (UNSPECV_XCHG 12) - (UNSPECV_LOCK 13) - (UNSPECV_PROLOGUE_USE 14) -+ (UNSPECV_CLD 15) - ]) - - ;; Constants to represent pcomtrue/pcomfalse variants -@@ -18529,6 +18530,14 @@ - - ;; Block operation instructions - -+(define_insn "cld" -+ [(unspec_volatile [(const_int 0)] UNSPECV_CLD)] -+ "" -+ "cld" -+ [(set_attr "length" "1") -+ (set_attr "length_immediate" "0") -+ (set_attr "modrm" "0")]) -+ - (define_expand "movmemsi" - [(use (match_operand:BLK 0 "memory_operand" "")) - (use (match_operand:BLK 1 "memory_operand" "")) -@@ -18601,7 +18610,7 @@ - (set (match_operand 2 "register_operand" "") - (match_operand 5 "" ""))])] - "TARGET_SINGLE_STRINGOP || optimize_size" -- "") -+ "ix86_current_function_needs_cld = 1;") - - (define_insn "*strmovdi_rex_1" - [(set (mem:DI (match_operand:DI 2 "register_operand" "0")) -@@ -18718,7 +18727,7 @@ - (match_operand 3 "memory_operand" "")) - (use (match_dup 4))])] - "" -- "") -+ "ix86_current_function_needs_cld = 1;") - - (define_insn "*rep_movdi_rex64" - [(set (match_operand:DI 2 "register_operand" "=c") (const_int 0)) -@@ -18878,7 +18887,7 @@ - (set (match_operand 0 "register_operand" "") - (match_operand 3 "" ""))])] - "TARGET_SINGLE_STRINGOP || optimize_size" -- "") -+ "ix86_current_function_needs_cld = 1;") - - (define_insn "*strsetdi_rex_1" - [(set (mem:DI (match_operand:DI 1 "register_operand" "0")) -@@ -18972,7 +18981,7 @@ - (use (match_operand 3 "register_operand" "")) - (use (match_dup 1))])] - "" -- "") -+ "ix86_current_function_needs_cld = 1;") - - (define_insn "*rep_stosdi_rex64" - [(set (match_operand:DI 1 "register_operand" "=c") (const_int 0)) -@@ -19148,7 +19157,7 @@ - (clobber (match_operand 1 "register_operand" "")) - (clobber (match_dup 2))])] - "" -- "") -+ "ix86_current_function_needs_cld = 1;") - - (define_insn "*cmpstrnqi_nz_1" - [(set (reg:CC FLAGS_REG) -@@ -19195,7 +19204,7 @@ - (clobber (match_operand 1 "register_operand" "")) - (clobber (match_dup 2))])] - "" -- "") -+ "ix86_current_function_needs_cld = 1;") - - (define_insn "*cmpstrnqi_1" - [(set (reg:CC FLAGS_REG) -@@ -19264,7 +19273,7 @@ - (clobber (match_operand 1 "register_operand" "")) - (clobber (reg:CC FLAGS_REG))])] - "" -- "") -+ "ix86_current_function_needs_cld = 1;") - - (define_insn "*strlenqi_1" - [(set (match_operand:SI 0 "register_operand" "=&c") diff --git a/patches/gcc/4.3.0/275-x86-emit-cld.patch b/patches/gcc/4.3.0/275-x86-emit-cld.patch new file mode 100644 index 0000000..a2b723a --- /dev/null +++ b/patches/gcc/4.3.0/275-x86-emit-cld.patch @@ -0,0 +1,156 @@ +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/20_all_gcc-x86-emit-cld.patch +bandaid for the cld issue. to be dropped when gcc-4.3 goes stable. + +http://gcc.gnu.org/ml/gcc-patches/2008-03/msg00417.html + +2008-03-06 Uros Bizjak + + * config/i386/i386.h (TARGET_CLD): New define. + (struct machine_function): Add needs_cld field. + (ix86_current_function_needs_cld): New define. + * config/i386/i386.md (UNSPEC_CLD): New unspec volatile constant. + ("cld"): New isns pattern. + ("strmov_singleop"): Set ix86_current_function_needs_cld flag. + ("rep_mov"): Ditto. + ("strset_singleop"): Ditto. + ("rep_stos"): Ditto. + ("cmpstrnqi_nz_1"): Ditto. + ("cmpstrnqi_1"): Ditto. + ("strlenqi_1"): Ditto. + * config/i386/i386.c (ix86_expand_prologue): Emit cld insn for + TARGET_CLD when ix86_current_function_needs_cld is set. + +diff -durN gcc-4.3.0.orig/gcc/config/i386/i386.c gcc-4.3.0/gcc/config/i386/i386.c +--- gcc-4.3.0.orig/gcc/config/i386/i386.c 2008-02-21 13:30:00.000000000 +0100 ++++ gcc-4.3.0/gcc/config/i386/i386.c 2008-06-10 14:44:37.000000000 +0200 +@@ -6448,6 +6448,10 @@ + emit_insn (gen_prologue_use (pic_offset_table_rtx)); + emit_insn (gen_blockage ()); + } ++ ++ /* Emit cld instruction if stringops are used in the function. */ ++ if (TARGET_CLD && ix86_current_function_needs_cld) ++ emit_insn (gen_cld ()); + } + + /* Emit code to restore saved registers using MOV insns. First register +diff -durN gcc-4.3.0.orig/gcc/config/i386/i386.h gcc-4.3.0/gcc/config/i386/i386.h +--- gcc-4.3.0.orig/gcc/config/i386/i386.h 2008-02-15 09:12:02.000000000 +0100 ++++ gcc-4.3.0/gcc/config/i386/i386.h 2008-06-10 14:44:37.000000000 +0200 +@@ -388,6 +388,7 @@ + + extern int x86_prefetch_sse; + ++#define TARGET_CLD 1 + #define TARGET_ABM x86_abm + #define TARGET_CMPXCHG16B x86_cmpxchg16b + #define TARGET_POPCNT x86_popcnt +@@ -2443,8 +2444,9 @@ + int save_varrargs_registers; + int accesses_prev_frame; + int optimize_mode_switching[MAX_386_ENTITIES]; +- /* Set by ix86_compute_frame_layout and used by prologue/epilogue expander to +- determine the style used. */ ++ int needs_cld; ++ /* Set by ix86_compute_frame_layout and used by prologue/epilogue ++ expander to determine the style used. */ + int use_fast_prologue_epilogue; + /* Number of saved registers USE_FAST_PROLOGUE_EPILOGUE has been computed + for. */ +@@ -2464,6 +2466,7 @@ + #define ix86_stack_locals (cfun->machine->stack_locals) + #define ix86_save_varrargs_registers (cfun->machine->save_varrargs_registers) + #define ix86_optimize_mode_switching (cfun->machine->optimize_mode_switching) ++#define ix86_current_function_needs_cld (cfun->machine->needs_cld) + #define ix86_tls_descriptor_calls_expanded_in_cfun \ + (cfun->machine->tls_descriptor_call_expanded_p) + /* Since tls_descriptor_call_expanded is not cleared, even if all TLS +diff -durN gcc-4.3.0.orig/gcc/config/i386/i386.md gcc-4.3.0/gcc/config/i386/i386.md +--- gcc-4.3.0.orig/gcc/config/i386/i386.md 2008-02-06 12:34:00.000000000 +0100 ++++ gcc-4.3.0/gcc/config/i386/i386.md 2008-06-10 14:44:37.000000000 +0200 +@@ -205,6 +205,7 @@ + (UNSPECV_XCHG 12) + (UNSPECV_LOCK 13) + (UNSPECV_PROLOGUE_USE 14) ++ (UNSPECV_CLD 15) + ]) + + ;; Constants to represent pcomtrue/pcomfalse variants +@@ -18529,6 +18530,14 @@ + + ;; Block operation instructions + ++(define_insn "cld" ++ [(unspec_volatile [(const_int 0)] UNSPECV_CLD)] ++ "" ++ "cld" ++ [(set_attr "length" "1") ++ (set_attr "length_immediate" "0") ++ (set_attr "modrm" "0")]) ++ + (define_expand "movmemsi" + [(use (match_operand:BLK 0 "memory_operand" "")) + (use (match_operand:BLK 1 "memory_operand" "")) +@@ -18601,7 +18610,7 @@ + (set (match_operand 2 "register_operand" "") + (match_operand 5 "" ""))])] + "TARGET_SINGLE_STRINGOP || optimize_size" +- "") ++ "ix86_current_function_needs_cld = 1;") + + (define_insn "*strmovdi_rex_1" + [(set (mem:DI (match_operand:DI 2 "register_operand" "0")) +@@ -18718,7 +18727,7 @@ + (match_operand 3 "memory_operand" "")) + (use (match_dup 4))])] + "" +- "") ++ "ix86_current_function_needs_cld = 1;") + + (define_insn "*rep_movdi_rex64" + [(set (match_operand:DI 2 "register_operand" "=c") (const_int 0)) +@@ -18878,7 +18887,7 @@ + (set (match_operand 0 "register_operand" "") + (match_operand 3 "" ""))])] + "TARGET_SINGLE_STRINGOP || optimize_size" +- "") ++ "ix86_current_function_needs_cld = 1;") + + (define_insn "*strsetdi_rex_1" + [(set (mem:DI (match_operand:DI 1 "register_operand" "0")) +@@ -18972,7 +18981,7 @@ + (use (match_operand 3 "register_operand" "")) + (use (match_dup 1))])] + "" +- "") ++ "ix86_current_function_needs_cld = 1;") + + (define_insn "*rep_stosdi_rex64" + [(set (match_operand:DI 1 "register_operand" "=c") (const_int 0)) +@@ -19148,7 +19157,7 @@ + (clobber (match_operand 1 "register_operand" "")) + (clobber (match_dup 2))])] + "" +- "") ++ "ix86_current_function_needs_cld = 1;") + + (define_insn "*cmpstrnqi_nz_1" + [(set (reg:CC FLAGS_REG) +@@ -19195,7 +19204,7 @@ + (clobber (match_operand 1 "register_operand" "")) + (clobber (match_dup 2))])] + "" +- "") ++ "ix86_current_function_needs_cld = 1;") + + (define_insn "*cmpstrnqi_1" + [(set (reg:CC FLAGS_REG) +@@ -19264,7 +19273,7 @@ + (clobber (match_operand 1 "register_operand" "")) + (clobber (reg:CC FLAGS_REG))])] + "" +- "") ++ "ix86_current_function_needs_cld = 1;") + + (define_insn "*strlenqi_1" + [(set (match_operand:SI 0 "register_operand" "=&c") diff --git a/patches/gcc/4.3.0/300-gcc-3.4-libiberty-pic.patch b/patches/gcc/4.3.0/300-gcc-3.4-libiberty-pic.patch deleted file mode 100644 index 844f83a..0000000 --- a/patches/gcc/4.3.0/300-gcc-3.4-libiberty-pic.patch +++ /dev/null @@ -1,12 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/51_all_gcc-3.4-libiberty-pic.patch -diff -durN gcc-4.3.0.orig/libiberty/Makefile.in gcc-4.3.0/libiberty/Makefile.in ---- gcc-4.3.0.orig/libiberty/Makefile.in 2007-07-25 08:26:45.000000000 +0200 -+++ gcc-4.3.0/libiberty/Makefile.in 2008-06-10 14:44:43.000000000 +0200 -@@ -225,6 +225,7 @@ - $(AR) $(AR_FLAGS) $(TARGETLIB) \ - $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \ - $(RANLIB) $(TARGETLIB); \ -+ cp $(TARGETLIB) ../ ; \ - cd ..; \ - else true; fi - diff --git a/patches/gcc/4.3.0/300-libiberty-pic.patch b/patches/gcc/4.3.0/300-libiberty-pic.patch new file mode 100644 index 0000000..844f83a --- /dev/null +++ b/patches/gcc/4.3.0/300-libiberty-pic.patch @@ -0,0 +1,12 @@ +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/51_all_gcc-3.4-libiberty-pic.patch +diff -durN gcc-4.3.0.orig/libiberty/Makefile.in gcc-4.3.0/libiberty/Makefile.in +--- gcc-4.3.0.orig/libiberty/Makefile.in 2007-07-25 08:26:45.000000000 +0200 ++++ gcc-4.3.0/libiberty/Makefile.in 2008-06-10 14:44:43.000000000 +0200 +@@ -225,6 +225,7 @@ + $(AR) $(AR_FLAGS) $(TARGETLIB) \ + $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \ + $(RANLIB) $(TARGETLIB); \ ++ cp $(TARGETLIB) ../ ; \ + cd ..; \ + else true; fi + diff --git a/patches/gcc/4.3.0/325-gcc4-superh-default-multilib.patch b/patches/gcc/4.3.0/325-gcc4-superh-default-multilib.patch deleted file mode 100644 index 4898a36..0000000 --- a/patches/gcc/4.3.0/325-gcc4-superh-default-multilib.patch +++ /dev/null @@ -1,25 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/53_all_gcc4-superh-default-multilib.patch -The gcc-3.x toolchains would contain all the targets by default. With gcc-4, -you have to actually list out the multilibs you want or you will end up with -just one when using targets like 'sh4-linux-gnu'. - -The resulting toolchain can't even build a kernel as the kernel needs to build -with the nofpu flag to be sure that no fpu ops are generated. - -Here we restore the gcc-3.x behavior; the additional overhead of building all -of these multilibs by default is negligible. - -http://bugs.gentoo.org/140205 - -diff -durN gcc-4.3.0.orig/gcc/config.gcc gcc-4.3.0/gcc/config.gcc ---- gcc-4.3.0.orig/gcc/config.gcc 2008-01-29 17:28:10.000000000 +0100 -+++ gcc-4.3.0/gcc/config.gcc 2008-06-10 14:44:47.000000000 +0200 -@@ -2271,7 +2271,7 @@ - if test x${sh_multilibs} = x ; then - case ${target} in - sh64-superh-linux* | \ -- sh[1234]*) sh_multilibs=${sh_cpu_target} ;; -+ sh[1234]*) sh_multilibs=`cd ${srcdir}/config/sh ; echo t-mlib-sh[1-4]* | sed 's:t-mlib-sh:,m:g;s: ::g'` ;; - sh64* | sh5*) sh_multilibs=m5-32media,m5-32media-nofpu,m5-compact,m5-compact-nofpu,m5-64media,m5-64media-nofpu ;; - sh-superh-*) sh_multilibs=m4,m4-single,m4-single-only,m4-nofpu ;; - sh*-*-linux*) sh_multilibs=m1,m3e,m4 ;; diff --git a/patches/gcc/4.3.0/325-superh-default-multilib.patch b/patches/gcc/4.3.0/325-superh-default-multilib.patch new file mode 100644 index 0000000..4898a36 --- /dev/null +++ b/patches/gcc/4.3.0/325-superh-default-multilib.patch @@ -0,0 +1,25 @@ +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/53_all_gcc4-superh-default-multilib.patch +The gcc-3.x toolchains would contain all the targets by default. With gcc-4, +you have to actually list out the multilibs you want or you will end up with +just one when using targets like 'sh4-linux-gnu'. + +The resulting toolchain can't even build a kernel as the kernel needs to build +with the nofpu flag to be sure that no fpu ops are generated. + +Here we restore the gcc-3.x behavior; the additional overhead of building all +of these multilibs by default is negligible. + +http://bugs.gentoo.org/140205 + +diff -durN gcc-4.3.0.orig/gcc/config.gcc gcc-4.3.0/gcc/config.gcc +--- gcc-4.3.0.orig/gcc/config.gcc 2008-01-29 17:28:10.000000000 +0100 ++++ gcc-4.3.0/gcc/config.gcc 2008-06-10 14:44:47.000000000 +0200 +@@ -2271,7 +2271,7 @@ + if test x${sh_multilibs} = x ; then + case ${target} in + sh64-superh-linux* | \ +- sh[1234]*) sh_multilibs=${sh_cpu_target} ;; ++ sh[1234]*) sh_multilibs=`cd ${srcdir}/config/sh ; echo t-mlib-sh[1-4]* | sed 's:t-mlib-sh:,m:g;s: ::g'` ;; + sh64* | sh5*) sh_multilibs=m5-32media,m5-32media-nofpu,m5-compact,m5-compact-nofpu,m5-64media,m5-64media-nofpu ;; + sh-superh-*) sh_multilibs=m4,m4-single,m4-single-only,m4-nofpu ;; + sh*-*-linux*) sh_multilibs=m1,m3e,m4 ;; diff --git a/patches/gcc/4.3.0/350-300-libstdc++-pic.patch b/patches/gcc/4.3.0/350-300-libstdc++-pic.patch deleted file mode 100644 index 21c2245..0000000 --- a/patches/gcc/4.3.0/350-300-libstdc++-pic.patch +++ /dev/null @@ -1,56 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/54_all_300-libstdc++-pic.patch -install libstdc++_pic.a if we have pic objs - -diff -durN gcc-4.3.0.orig/libstdc++-v3/src/Makefile.am gcc-4.3.0/libstdc++-v3/src/Makefile.am ---- gcc-4.3.0.orig/libstdc++-v3/src/Makefile.am 2008-02-29 19:26:50.000000000 +0100 -+++ gcc-4.3.0/libstdc++-v3/src/Makefile.am 2008-06-10 14:44:51.000000000 +0200 -@@ -289,6 +289,13 @@ - $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@ - - -+install-exec-local: -+ pic_objs=`sed -n "s:'::g;s:^pic_object=::p" *.lo | grep -v '^none$$'`; \ -+ if [ x"$$pic_objs" != x ]; then \ -+ $(AR) cru libstdc++_pic.a $$pic_objs $(top_builddir)/libsupc++/*.o || exit 1; \ -+ $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir) || exit 1; \ -+ fi -+ - # Added bits to build debug library. - if GLIBCXX_BUILD_DEBUG - all-local: build_debug -diff -durN gcc-4.3.0.orig/libstdc++-v3/src/Makefile.in gcc-4.3.0/libstdc++-v3/src/Makefile.in ---- gcc-4.3.0.orig/libstdc++-v3/src/Makefile.in 2008-02-29 19:26:50.000000000 +0100 -+++ gcc-4.3.0/libstdc++-v3/src/Makefile.in 2008-06-10 14:44:51.000000000 +0200 -@@ -693,7 +693,7 @@ - - install-data-am: install-data-local - --install-exec-am: install-toolexeclibLTLIBRARIES -+install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local - - install-info: install-info-am - -@@ -732,7 +732,7 @@ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-info-am \ -- uninstall-toolexeclibLTLIBRARIES -+ uninstall-toolexeclibLTLIBRARIES install-exec-local - - - # Symbol versioning for shared libraries. -@@ -858,6 +858,14 @@ - install_debug: - (cd ${debugdir} && $(MAKE) \ - toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install) -+ -+install-exec-local: -+ pic_objs=`sed -n "s:'::g;s:^pic_object=::p" *.lo | grep -v '^none$$'`; \ -+ if [ x"$$pic_objs" != x ]; then \ -+ $(AR) cru libstdc++_pic.a $$pic_objs $(top_builddir)/libsupc++/*.o || exit 1; \ -+ $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir) || exit 1; \ -+ fi -+ - # Tell versions [3.59,3.63) of GNU make to not export all variables. - # Otherwise a system limit (for SysV at least) may be exceeded. - .NOEXPORT: diff --git a/patches/gcc/4.3.0/350-libstdc++-pic.patch b/patches/gcc/4.3.0/350-libstdc++-pic.patch new file mode 100644 index 0000000..21c2245 --- /dev/null +++ b/patches/gcc/4.3.0/350-libstdc++-pic.patch @@ -0,0 +1,56 @@ +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/54_all_300-libstdc++-pic.patch +install libstdc++_pic.a if we have pic objs + +diff -durN gcc-4.3.0.orig/libstdc++-v3/src/Makefile.am gcc-4.3.0/libstdc++-v3/src/Makefile.am +--- gcc-4.3.0.orig/libstdc++-v3/src/Makefile.am 2008-02-29 19:26:50.000000000 +0100 ++++ gcc-4.3.0/libstdc++-v3/src/Makefile.am 2008-06-10 14:44:51.000000000 +0200 +@@ -289,6 +289,13 @@ + $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@ + + ++install-exec-local: ++ pic_objs=`sed -n "s:'::g;s:^pic_object=::p" *.lo | grep -v '^none$$'`; \ ++ if [ x"$$pic_objs" != x ]; then \ ++ $(AR) cru libstdc++_pic.a $$pic_objs $(top_builddir)/libsupc++/*.o || exit 1; \ ++ $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir) || exit 1; \ ++ fi ++ + # Added bits to build debug library. + if GLIBCXX_BUILD_DEBUG + all-local: build_debug +diff -durN gcc-4.3.0.orig/libstdc++-v3/src/Makefile.in gcc-4.3.0/libstdc++-v3/src/Makefile.in +--- gcc-4.3.0.orig/libstdc++-v3/src/Makefile.in 2008-02-29 19:26:50.000000000 +0100 ++++ gcc-4.3.0/libstdc++-v3/src/Makefile.in 2008-06-10 14:44:51.000000000 +0200 +@@ -693,7 +693,7 @@ + + install-data-am: install-data-local + +-install-exec-am: install-toolexeclibLTLIBRARIES ++install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local + + install-info: install-info-am + +@@ -732,7 +732,7 @@ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-info-am \ +- uninstall-toolexeclibLTLIBRARIES ++ uninstall-toolexeclibLTLIBRARIES install-exec-local + + + # Symbol versioning for shared libraries. +@@ -858,6 +858,14 @@ + install_debug: + (cd ${debugdir} && $(MAKE) \ + toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install) ++ ++install-exec-local: ++ pic_objs=`sed -n "s:'::g;s:^pic_object=::p" *.lo | grep -v '^none$$'`; \ ++ if [ x"$$pic_objs" != x ]; then \ ++ $(AR) cru libstdc++_pic.a $$pic_objs $(top_builddir)/libsupc++/*.o || exit 1; \ ++ $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir) || exit 1; \ ++ fi ++ + # Tell versions [3.59,3.63) of GNU make to not export all variables. + # Otherwise a system limit (for SysV at least) may be exceeded. + .NOEXPORT: diff --git a/patches/gcc/4.3.0/375-gcc43-pr35440.patch b/patches/gcc/4.3.0/375-gcc43-pr35440.patch deleted file mode 100644 index 097496b..0000000 --- a/patches/gcc/4.3.0/375-gcc43-pr35440.patch +++ /dev/null @@ -1,59 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/60_all_gcc43-pr35440.patch -2008-03-19 Jakub Jelinek - - PR c/35440 - * c-pretty-print.c (pp_c_initializer_list): Handle CONSTRUCTOR - for all types. - - * gcc.dg/pr35440.c: New test. - -diff -durN gcc-4.3.0.orig/gcc/c-pretty-print.c gcc-4.3.0/gcc/c-pretty-print.c ---- gcc-4.3.0.orig/gcc/c-pretty-print.c 2008-01-29 14:59:59.000000000 +0100 -+++ gcc-4.3.0/gcc/c-pretty-print.c 2008-06-10 14:44:54.000000000 +0200 -@@ -1173,6 +1173,12 @@ - tree type = TREE_TYPE (e); - const enum tree_code code = TREE_CODE (type); - -+ if (TREE_CODE (e) == CONSTRUCTOR) -+ { -+ pp_c_constructor_elts (pp, CONSTRUCTOR_ELTS (e)); -+ return; -+ } -+ - switch (code) - { - case RECORD_TYPE: -@@ -1207,16 +1213,12 @@ - case VECTOR_TYPE: - if (TREE_CODE (e) == VECTOR_CST) - pp_c_expression_list (pp, TREE_VECTOR_CST_ELTS (e)); -- else if (TREE_CODE (e) == CONSTRUCTOR) -- pp_c_constructor_elts (pp, CONSTRUCTOR_ELTS (e)); - else - break; - return; - - case COMPLEX_TYPE: -- if (TREE_CODE (e) == CONSTRUCTOR) -- pp_c_constructor_elts (pp, CONSTRUCTOR_ELTS (e)); -- else if (TREE_CODE (e) == COMPLEX_CST || TREE_CODE (e) == COMPLEX_EXPR) -+ if (TREE_CODE (e) == COMPLEX_CST || TREE_CODE (e) == COMPLEX_EXPR) - { - const bool cst = TREE_CODE (e) == COMPLEX_CST; - pp_expression (pp, cst ? TREE_REALPART (e) : TREE_OPERAND (e, 0)); -diff -durN gcc-4.3.0.orig/gcc/testsuite/gcc.dg/pr35440.c gcc-4.3.0/gcc/testsuite/gcc.dg/pr35440.c ---- gcc-4.3.0.orig/gcc/testsuite/gcc.dg/pr35440.c 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-4.3.0/gcc/testsuite/gcc.dg/pr35440.c 2008-06-10 14:44:54.000000000 +0200 -@@ -0,0 +1,12 @@ -+/* PR c/35440 */ -+/* { dg-do compile } */ -+/* { dg-options "-std=gnu99" } */ -+ -+struct A {}; -+struct B { int i; char j[2]; }; -+ -+void foo (void) -+{ -+ (struct A){}(); /* { dg-error "called object" } */ -+ (struct B){ .i = 2, .j[1] = 1 }(); /* { dg-error "called object" } */ -+} diff --git a/patches/gcc/4.3.0/375-pr35440.patch b/patches/gcc/4.3.0/375-pr35440.patch new file mode 100644 index 0000000..097496b --- /dev/null +++ b/patches/gcc/4.3.0/375-pr35440.patch @@ -0,0 +1,59 @@ +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/60_all_gcc43-pr35440.patch +2008-03-19 Jakub Jelinek + + PR c/35440 + * c-pretty-print.c (pp_c_initializer_list): Handle CONSTRUCTOR + for all types. + + * gcc.dg/pr35440.c: New test. + +diff -durN gcc-4.3.0.orig/gcc/c-pretty-print.c gcc-4.3.0/gcc/c-pretty-print.c +--- gcc-4.3.0.orig/gcc/c-pretty-print.c 2008-01-29 14:59:59.000000000 +0100 ++++ gcc-4.3.0/gcc/c-pretty-print.c 2008-06-10 14:44:54.000000000 +0200 +@@ -1173,6 +1173,12 @@ + tree type = TREE_TYPE (e); + const enum tree_code code = TREE_CODE (type); + ++ if (TREE_CODE (e) == CONSTRUCTOR) ++ { ++ pp_c_constructor_elts (pp, CONSTRUCTOR_ELTS (e)); ++ return; ++ } ++ + switch (code) + { + case RECORD_TYPE: +@@ -1207,16 +1213,12 @@ + case VECTOR_TYPE: + if (TREE_CODE (e) == VECTOR_CST) + pp_c_expression_list (pp, TREE_VECTOR_CST_ELTS (e)); +- else if (TREE_CODE (e) == CONSTRUCTOR) +- pp_c_constructor_elts (pp, CONSTRUCTOR_ELTS (e)); + else + break; + return; + + case COMPLEX_TYPE: +- if (TREE_CODE (e) == CONSTRUCTOR) +- pp_c_constructor_elts (pp, CONSTRUCTOR_ELTS (e)); +- else if (TREE_CODE (e) == COMPLEX_CST || TREE_CODE (e) == COMPLEX_EXPR) ++ if (TREE_CODE (e) == COMPLEX_CST || TREE_CODE (e) == COMPLEX_EXPR) + { + const bool cst = TREE_CODE (e) == COMPLEX_CST; + pp_expression (pp, cst ? TREE_REALPART (e) : TREE_OPERAND (e, 0)); +diff -durN gcc-4.3.0.orig/gcc/testsuite/gcc.dg/pr35440.c gcc-4.3.0/gcc/testsuite/gcc.dg/pr35440.c +--- gcc-4.3.0.orig/gcc/testsuite/gcc.dg/pr35440.c 1970-01-01 01:00:00.000000000 +0100 ++++ gcc-4.3.0/gcc/testsuite/gcc.dg/pr35440.c 2008-06-10 14:44:54.000000000 +0200 +@@ -0,0 +1,12 @@ ++/* PR c/35440 */ ++/* { dg-do compile } */ ++/* { dg-options "-std=gnu99" } */ ++ ++struct A {}; ++struct B { int i; char j[2]; }; ++ ++void foo (void) ++{ ++ (struct A){}(); /* { dg-error "called object" } */ ++ (struct B){ .i = 2, .j[1] = 1 }(); /* { dg-error "called object" } */ ++} diff --git a/patches/gcc/4.3.0/400-gcc43-pr24170.patch b/patches/gcc/4.3.0/400-gcc43-pr24170.patch deleted file mode 100644 index 2ecceb6..0000000 --- a/patches/gcc/4.3.0/400-gcc43-pr24170.patch +++ /dev/null @@ -1,61 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/61_all_gcc43-pr24170.patch -http://gcc.gnu.org/PR24170 - -2008-02-20 Tom Tromey - - PR libgcj/24170: - * java/io/natFilePosix.cc (File::performList): Don't use - readdir_r. - * configure, include/config.h.in: Rebuilt. - * configure.ac: Don't check for readdir_r. - -diff -durN gcc-4.3.0.orig/libjava/configure.ac gcc-4.3.0/libjava/configure.ac ---- gcc-4.3.0.orig/libjava/configure.ac 2008-06-10 14:44:17.000000000 +0200 -+++ gcc-4.3.0/libjava/configure.ac 2008-06-10 14:44:58.000000000 +0200 -@@ -1030,7 +1030,7 @@ - PLATFORMNET=NoNet - else - AC_CHECK_FUNCS([strerror_r select fstat open fsync sleep opendir \ -- localtime_r readdir_r getpwuid_r getcwd \ -+ localtime_r getpwuid_r getcwd \ - access stat lstat mkdir rename rmdir unlink utime chmod readlink \ - nl_langinfo setlocale \ - inet_pton uname inet_ntoa \ -diff -durN gcc-4.3.0.orig/libjava/include/config.h.in gcc-4.3.0/libjava/include/config.h.in ---- gcc-4.3.0.orig/libjava/include/config.h.in 2007-07-31 18:17:21.000000000 +0200 -+++ gcc-4.3.0/libjava/include/config.h.in 2008-06-10 14:44:58.000000000 +0200 -@@ -214,9 +214,6 @@ - /* Define to 1 if you have the header file. */ - #undef HAVE_PWD_H - --/* Define to 1 if you have the `readdir_r' function. */ --#undef HAVE_READDIR_R -- - /* Define to 1 if you have the `readlink' function. */ - #undef HAVE_READLINK - -diff -durN gcc-4.3.0.orig/libjava/java/io/natFilePosix.cc gcc-4.3.0/libjava/java/io/natFilePosix.cc ---- gcc-4.3.0.orig/libjava/java/io/natFilePosix.cc 2007-08-04 23:50:01.000000000 +0200 -+++ gcc-4.3.0/libjava/java/io/natFilePosix.cc 2008-06-10 14:44:58.000000000 +0200 -@@ -1,6 +1,6 @@ - // natFile.cc - Native part of File class for POSIX. - --/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2006 -+/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2006, 2008 - Free Software Foundation - - This file is part of libgcj. -@@ -292,13 +292,7 @@ - - java::util::ArrayList *list = new java::util::ArrayList (); - struct dirent *d; --#if defined(HAVE_READDIR_R) && defined(_POSIX_PTHREAD_SEMANTICS) -- int name_max = pathconf (buf, _PC_NAME_MAX); -- char dbuf[sizeof (struct dirent) + name_max + 1]; -- while (readdir_r (dir, (struct dirent *) dbuf, &d) == 0 && d != NULL) --#else /* HAVE_READDIR_R */ - while ((d = readdir (dir)) != NULL) --#endif /* HAVE_READDIR_R */ - { - // Omit "." and "..". - if (d->d_name[0] == '.' diff --git a/patches/gcc/4.3.0/400-pr24170.patch b/patches/gcc/4.3.0/400-pr24170.patch new file mode 100644 index 0000000..2ecceb6 --- /dev/null +++ b/patches/gcc/4.3.0/400-pr24170.patch @@ -0,0 +1,61 @@ +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/61_all_gcc43-pr24170.patch +http://gcc.gnu.org/PR24170 + +2008-02-20 Tom Tromey + + PR libgcj/24170: + * java/io/natFilePosix.cc (File::performList): Don't use + readdir_r. + * configure, include/config.h.in: Rebuilt. + * configure.ac: Don't check for readdir_r. + +diff -durN gcc-4.3.0.orig/libjava/configure.ac gcc-4.3.0/libjava/configure.ac +--- gcc-4.3.0.orig/libjava/configure.ac 2008-06-10 14:44:17.000000000 +0200 ++++ gcc-4.3.0/libjava/configure.ac 2008-06-10 14:44:58.000000000 +0200 +@@ -1030,7 +1030,7 @@ + PLATFORMNET=NoNet + else + AC_CHECK_FUNCS([strerror_r select fstat open fsync sleep opendir \ +- localtime_r readdir_r getpwuid_r getcwd \ ++ localtime_r getpwuid_r getcwd \ + access stat lstat mkdir rename rmdir unlink utime chmod readlink \ + nl_langinfo setlocale \ + inet_pton uname inet_ntoa \ +diff -durN gcc-4.3.0.orig/libjava/include/config.h.in gcc-4.3.0/libjava/include/config.h.in +--- gcc-4.3.0.orig/libjava/include/config.h.in 2007-07-31 18:17:21.000000000 +0200 ++++ gcc-4.3.0/libjava/include/config.h.in 2008-06-10 14:44:58.000000000 +0200 +@@ -214,9 +214,6 @@ + /* Define to 1 if you have the header file. */ + #undef HAVE_PWD_H + +-/* Define to 1 if you have the `readdir_r' function. */ +-#undef HAVE_READDIR_R +- + /* Define to 1 if you have the `readlink' function. */ + #undef HAVE_READLINK + +diff -durN gcc-4.3.0.orig/libjava/java/io/natFilePosix.cc gcc-4.3.0/libjava/java/io/natFilePosix.cc +--- gcc-4.3.0.orig/libjava/java/io/natFilePosix.cc 2007-08-04 23:50:01.000000000 +0200 ++++ gcc-4.3.0/libjava/java/io/natFilePosix.cc 2008-06-10 14:44:58.000000000 +0200 +@@ -1,6 +1,6 @@ + // natFile.cc - Native part of File class for POSIX. + +-/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2006 ++/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2006, 2008 + Free Software Foundation + + This file is part of libgcj. +@@ -292,13 +292,7 @@ + + java::util::ArrayList *list = new java::util::ArrayList (); + struct dirent *d; +-#if defined(HAVE_READDIR_R) && defined(_POSIX_PTHREAD_SEMANTICS) +- int name_max = pathconf (buf, _PC_NAME_MAX); +- char dbuf[sizeof (struct dirent) + name_max + 1]; +- while (readdir_r (dir, (struct dirent *) dbuf, &d) == 0 && d != NULL) +-#else /* HAVE_READDIR_R */ + while ((d = readdir (dir)) != NULL) +-#endif /* HAVE_READDIR_R */ + { + // Omit "." and "..". + if (d->d_name[0] == '.' diff --git a/patches/gcc/4.3.0/425-gcc4-ia64-noteGNUstack.patch b/patches/gcc/4.3.0/425-gcc4-ia64-noteGNUstack.patch deleted file mode 100644 index 8752070..0000000 --- a/patches/gcc/4.3.0/425-gcc4-ia64-noteGNUstack.patch +++ /dev/null @@ -1,96 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/61_all_gcc4-ia64-noteGNUstack.patch -2004-09-20 Jakub Jelinek - - * config/rs6000/ppc-asm.h: Add .note.GNU-stack section also - on ppc64-linux. - - * config/ia64/lib1funcs.asm: Add .note.GNU-stack section on - ia64-linux. - * config/ia64/crtbegin.asm: Likewise. - * config/ia64/crtend.asm: Likewise. - * config/ia64/crti.asm: Likewise. - * config/ia64/crtn.asm: Likewise. - -2004-05-14 Jakub Jelinek - - * config/ia64/linux.h (TARGET_ASM_FILE_END): Define. - -diff -durN gcc-4.3.0.orig/gcc/config/ia64/crtbegin.asm gcc-4.3.0/gcc/config/ia64/crtbegin.asm ---- gcc-4.3.0.orig/gcc/config/ia64/crtbegin.asm 2005-09-27 02:52:24.000000000 +0200 -+++ gcc-4.3.0/gcc/config/ia64/crtbegin.asm 2008-06-10 14:45:02.000000000 +0200 -@@ -255,3 +255,7 @@ - .weak __cxa_finalize - #endif - .weak _Jv_RegisterClasses -+ -+#ifdef __linux__ -+.section .note.GNU-stack; .previous -+#endif -diff -durN gcc-4.3.0.orig/gcc/config/ia64/crtend.asm gcc-4.3.0/gcc/config/ia64/crtend.asm ---- gcc-4.3.0.orig/gcc/config/ia64/crtend.asm 2005-09-27 02:52:24.000000000 +0200 -+++ gcc-4.3.0/gcc/config/ia64/crtend.asm 2008-06-10 14:45:02.000000000 +0200 -@@ -122,3 +122,7 @@ - - br.ret.sptk.many rp - .endp __do_global_ctors_aux -+ -+#ifdef __linux__ -+.section .note.GNU-stack; .previous -+#endif -diff -durN gcc-4.3.0.orig/gcc/config/ia64/crti.asm gcc-4.3.0/gcc/config/ia64/crti.asm ---- gcc-4.3.0.orig/gcc/config/ia64/crti.asm 2005-06-25 03:22:41.000000000 +0200 -+++ gcc-4.3.0/gcc/config/ia64/crti.asm 2008-06-10 14:45:02.000000000 +0200 -@@ -64,3 +64,7 @@ - .body - - # end of crti.asm -+ -+#ifdef __linux__ -+.section .note.GNU-stack; .previous -+#endif -diff -durN gcc-4.3.0.orig/gcc/config/ia64/crtn.asm gcc-4.3.0/gcc/config/ia64/crtn.asm ---- gcc-4.3.0.orig/gcc/config/ia64/crtn.asm 2005-06-25 03:22:41.000000000 +0200 -+++ gcc-4.3.0/gcc/config/ia64/crtn.asm 2008-06-10 14:45:02.000000000 +0200 -@@ -54,3 +54,7 @@ - br.ret.sptk.many b0 - - # end of crtn.asm -+ -+#ifdef __linux__ -+.section .note.GNU-stack; .previous -+#endif -diff -durN gcc-4.3.0.orig/gcc/config/ia64/lib1funcs.asm gcc-4.3.0/gcc/config/ia64/lib1funcs.asm ---- gcc-4.3.0.orig/gcc/config/ia64/lib1funcs.asm 2005-09-27 02:52:24.000000000 +0200 -+++ gcc-4.3.0/gcc/config/ia64/lib1funcs.asm 2008-06-10 14:45:02.000000000 +0200 -@@ -792,3 +792,7 @@ - } - .endp __floattitf - #endif -+ -+#ifdef __linux__ -+.section .note.GNU-stack; .previous -+#endif -diff -durN gcc-4.3.0.orig/gcc/config/ia64/linux.h gcc-4.3.0/gcc/config/ia64/linux.h ---- gcc-4.3.0.orig/gcc/config/ia64/linux.h 2006-12-12 16:15:19.000000000 +0100 -+++ gcc-4.3.0/gcc/config/ia64/linux.h 2008-06-10 14:45:02.000000000 +0200 -@@ -5,6 +5,8 @@ - - #define TARGET_VERSION fprintf (stderr, " (IA-64) Linux"); - -+#define TARGET_ASM_FILE_END file_end_indicate_exec_stack -+ - /* This is for -profile to use -lc_p instead of -lc. */ - #undef CC1_SPEC - #define CC1_SPEC "%{profile:-p} %{G*}" -diff -durN gcc-4.3.0.orig/gcc/config/rs6000/ppc-asm.h gcc-4.3.0/gcc/config/rs6000/ppc-asm.h ---- gcc-4.3.0.orig/gcc/config/rs6000/ppc-asm.h 2003-06-04 18:44:51.000000000 +0200 -+++ gcc-4.3.0/gcc/config/rs6000/ppc-asm.h 2008-06-10 14:45:02.000000000 +0200 -@@ -158,7 +158,7 @@ - .size FUNC_NAME(name),GLUE(.L,name)-FUNC_NAME(name) - #endif - --#if defined __linux__ && !defined __powerpc64__ -+#if defined __linux__ - .section .note.GNU-stack - .previous - #endif diff --git a/patches/gcc/4.3.0/425-noteGNUstack-00.patch b/patches/gcc/4.3.0/425-noteGNUstack-00.patch new file mode 100644 index 0000000..8752070 --- /dev/null +++ b/patches/gcc/4.3.0/425-noteGNUstack-00.patch @@ -0,0 +1,96 @@ +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/61_all_gcc4-ia64-noteGNUstack.patch +2004-09-20 Jakub Jelinek + + * config/rs6000/ppc-asm.h: Add .note.GNU-stack section also + on ppc64-linux. + + * config/ia64/lib1funcs.asm: Add .note.GNU-stack section on + ia64-linux. + * config/ia64/crtbegin.asm: Likewise. + * config/ia64/crtend.asm: Likewise. + * config/ia64/crti.asm: Likewise. + * config/ia64/crtn.asm: Likewise. + +2004-05-14 Jakub Jelinek + + * config/ia64/linux.h (TARGET_ASM_FILE_END): Define. + +diff -durN gcc-4.3.0.orig/gcc/config/ia64/crtbegin.asm gcc-4.3.0/gcc/config/ia64/crtbegin.asm +--- gcc-4.3.0.orig/gcc/config/ia64/crtbegin.asm 2005-09-27 02:52:24.000000000 +0200 ++++ gcc-4.3.0/gcc/config/ia64/crtbegin.asm 2008-06-10 14:45:02.000000000 +0200 +@@ -255,3 +255,7 @@ + .weak __cxa_finalize + #endif + .weak _Jv_RegisterClasses ++ ++#ifdef __linux__ ++.section .note.GNU-stack; .previous ++#endif +diff -durN gcc-4.3.0.orig/gcc/config/ia64/crtend.asm gcc-4.3.0/gcc/config/ia64/crtend.asm +--- gcc-4.3.0.orig/gcc/config/ia64/crtend.asm 2005-09-27 02:52:24.000000000 +0200 ++++ gcc-4.3.0/gcc/config/ia64/crtend.asm 2008-06-10 14:45:02.000000000 +0200 +@@ -122,3 +122,7 @@ + + br.ret.sptk.many rp + .endp __do_global_ctors_aux ++ ++#ifdef __linux__ ++.section .note.GNU-stack; .previous ++#endif +diff -durN gcc-4.3.0.orig/gcc/config/ia64/crti.asm gcc-4.3.0/gcc/config/ia64/crti.asm +--- gcc-4.3.0.orig/gcc/config/ia64/crti.asm 2005-06-25 03:22:41.000000000 +0200 ++++ gcc-4.3.0/gcc/config/ia64/crti.asm 2008-06-10 14:45:02.000000000 +0200 +@@ -64,3 +64,7 @@ + .body + + # end of crti.asm ++ ++#ifdef __linux__ ++.section .note.GNU-stack; .previous ++#endif +diff -durN gcc-4.3.0.orig/gcc/config/ia64/crtn.asm gcc-4.3.0/gcc/config/ia64/crtn.asm +--- gcc-4.3.0.orig/gcc/config/ia64/crtn.asm 2005-06-25 03:22:41.000000000 +0200 ++++ gcc-4.3.0/gcc/config/ia64/crtn.asm 2008-06-10 14:45:02.000000000 +0200 +@@ -54,3 +54,7 @@ + br.ret.sptk.many b0 + + # end of crtn.asm ++ ++#ifdef __linux__ ++.section .note.GNU-stack; .previous ++#endif +diff -durN gcc-4.3.0.orig/gcc/config/ia64/lib1funcs.asm gcc-4.3.0/gcc/config/ia64/lib1funcs.asm +--- gcc-4.3.0.orig/gcc/config/ia64/lib1funcs.asm 2005-09-27 02:52:24.000000000 +0200 ++++ gcc-4.3.0/gcc/config/ia64/lib1funcs.asm 2008-06-10 14:45:02.000000000 +0200 +@@ -792,3 +792,7 @@ + } + .endp __floattitf + #endif ++ ++#ifdef __linux__ ++.section .note.GNU-stack; .previous ++#endif +diff -durN gcc-4.3.0.orig/gcc/config/ia64/linux.h gcc-4.3.0/gcc/config/ia64/linux.h +--- gcc-4.3.0.orig/gcc/config/ia64/linux.h 2006-12-12 16:15:19.000000000 +0100 ++++ gcc-4.3.0/gcc/config/ia64/linux.h 2008-06-10 14:45:02.000000000 +0200 +@@ -5,6 +5,8 @@ + + #define TARGET_VERSION fprintf (stderr, " (IA-64) Linux"); + ++#define TARGET_ASM_FILE_END file_end_indicate_exec_stack ++ + /* This is for -profile to use -lc_p instead of -lc. */ + #undef CC1_SPEC + #define CC1_SPEC "%{profile:-p} %{G*}" +diff -durN gcc-4.3.0.orig/gcc/config/rs6000/ppc-asm.h gcc-4.3.0/gcc/config/rs6000/ppc-asm.h +--- gcc-4.3.0.orig/gcc/config/rs6000/ppc-asm.h 2003-06-04 18:44:51.000000000 +0200 ++++ gcc-4.3.0/gcc/config/rs6000/ppc-asm.h 2008-06-10 14:45:02.000000000 +0200 +@@ -158,7 +158,7 @@ + .size FUNC_NAME(name),GLUE(.L,name)-FUNC_NAME(name) + #endif + +-#if defined __linux__ && !defined __powerpc64__ ++#if defined __linux__ + .section .note.GNU-stack + .previous + #endif diff --git a/patches/gcc/4.3.0/450-gcc4-noteGNUstack.patch b/patches/gcc/4.3.0/450-gcc4-noteGNUstack.patch deleted file mode 100644 index 1094e08..0000000 --- a/patches/gcc/4.3.0/450-gcc4-noteGNUstack.patch +++ /dev/null @@ -1,198 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/62_all_gcc4-noteGNUstack.patch -2005-02-08 Jakub Jelinek - - * src/alpha/osf.S: Add .note.GNU-stack on Linux. - * src/s390/sysv.S: Likewise. - * src/powerpc/linux64.S: Likewise. - * src/powerpc/linux64_closure.S: Likewise. - * src/powerpc/ppc_closure.S: Likewise. - * src/powerpc/sysv.S: Likewise. - * src/x86/unix64.S: Likewise. - * src/x86/sysv.S: Likewise. - * src/sparc/v8.S: Likewise. - * src/sparc/v9.S: Likewise. - * src/m68k/sysv.S: Likewise. - * src/ia64/unix.S: Likewise. - * src/arm/sysv.S: Likewise. - - * ia64_save_regs_in_stack.s: Moved to... - * ia64_save_regs_in_stack.S: ... this. Add .note.GNU-stack - on Linux. - -diff -durN gcc-4.3.0.orig/boehm-gc/ia64_save_regs_in_stack.S gcc-4.3.0/boehm-gc/ia64_save_regs_in_stack.S ---- gcc-4.3.0.orig/boehm-gc/ia64_save_regs_in_stack.S 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-4.3.0/boehm-gc/ia64_save_regs_in_stack.S 2008-06-10 14:45:05.000000000 +0200 -@@ -0,0 +1,15 @@ -+ .text -+ .align 16 -+ .global GC_save_regs_in_stack -+ .proc GC_save_regs_in_stack -+GC_save_regs_in_stack: -+ .bodyfoo.mpg -+ flushrs -+ ;; -+ mov r8=ar.bsp -+ br.ret.sptk.few rp -+ .endp GC_save_regs_in_stack -+ -+#ifdef __linux__ -+ .section .note.GNU-stack,"",@progbits -+#endif -diff -durN gcc-4.3.0.orig/boehm-gc/ia64_save_regs_in_stack.s gcc-4.3.0/boehm-gc/ia64_save_regs_in_stack.s ---- gcc-4.3.0.orig/boehm-gc/ia64_save_regs_in_stack.s 2001-10-15 06:57:59.000000000 +0200 -+++ gcc-4.3.0/boehm-gc/ia64_save_regs_in_stack.s 2008-06-10 14:45:05.000000000 +0200 -@@ -1,12 +0,0 @@ -- .text -- .align 16 -- .global GC_save_regs_in_stack -- .proc GC_save_regs_in_stack --GC_save_regs_in_stack: -- .body -- flushrs -- ;; -- mov r8=ar.bsp -- br.ret.sptk.few rp -- .endp GC_save_regs_in_stack -- -diff -durN gcc-4.3.0.orig/libffi/src/alpha/osf.S gcc-4.3.0/libffi/src/alpha/osf.S ---- gcc-4.3.0.orig/libffi/src/alpha/osf.S 2007-04-06 18:24:16.000000000 +0200 -+++ gcc-4.3.0/libffi/src/alpha/osf.S 2008-06-10 14:45:05.000000000 +0200 -@@ -358,4 +358,8 @@ - .byte 16 # uleb128 offset 16*-8 - .align 3 - $LEFDE3: -+ -+#ifdef __linux__ -+ .section .note.GNU-stack,"",@progbits -+#endif - #endif -diff -durN gcc-4.3.0.orig/libffi/src/arm/sysv.S gcc-4.3.0/libffi/src/arm/sysv.S ---- gcc-4.3.0.orig/libffi/src/arm/sysv.S 2007-09-04 19:52:45.000000000 +0200 -+++ gcc-4.3.0/libffi/src/arm/sysv.S 2008-06-10 14:45:05.000000000 +0200 -@@ -293,3 +293,6 @@ - UNWIND .fnend - .size CNAME(ffi_closure_SYSV),.ffi_closure_SYSV_end-CNAME(ffi_closure_SYSV) - -+#if defined __ELF__ && defined __linux__ -+ .section .note.GNU-stack,"",%progbits -+#endif -diff -durN gcc-4.3.0.orig/libffi/src/ia64/unix.S gcc-4.3.0/libffi/src/ia64/unix.S ---- gcc-4.3.0.orig/libffi/src/ia64/unix.S 2005-03-30 23:49:19.000000000 +0200 -+++ gcc-4.3.0/libffi/src/ia64/unix.S 2008-06-10 14:45:05.000000000 +0200 -@@ -553,3 +553,7 @@ - data8 @pcrel(.Lld_hfa_float) // FFI_IA64_TYPE_HFA_FLOAT - data8 @pcrel(.Lld_hfa_double) // FFI_IA64_TYPE_HFA_DOUBLE - data8 @pcrel(.Lld_hfa_ldouble) // FFI_IA64_TYPE_HFA_LDOUBLE -+ -+#if defined __ELF__ && defined __linux__ -+ .section .note.GNU-stack,"",@progbits -+#endif -diff -durN gcc-4.3.0.orig/libffi/src/m68k/sysv.S gcc-4.3.0/libffi/src/m68k/sysv.S ---- gcc-4.3.0.orig/libffi/src/m68k/sysv.S 2007-05-10 23:29:04.000000000 +0200 -+++ gcc-4.3.0/libffi/src/m68k/sysv.S 2008-06-10 14:45:05.000000000 +0200 -@@ -207,3 +207,7 @@ - rts - CFI_ENDPROC() - .size ffi_closure_struct_SYSV,.-ffi_closure_struct_SYSV -+ -+#if defined __ELF__ && defined __linux__ -+ .section .note.GNU-stack,"",@progbits -+#endif -diff -durN gcc-4.3.0.orig/libffi/src/powerpc/linux64.S gcc-4.3.0/libffi/src/powerpc/linux64.S ---- gcc-4.3.0.orig/libffi/src/powerpc/linux64.S 2007-11-17 00:24:53.000000000 +0100 -+++ gcc-4.3.0/libffi/src/powerpc/linux64.S 2008-06-10 14:45:05.000000000 +0200 -@@ -179,3 +179,7 @@ - .align 3 - .LEFDE1: - #endif -+ -+#if defined __ELF__ && defined __linux__ -+ .section .note.GNU-stack,"",@progbits -+#endif -diff -durN gcc-4.3.0.orig/libffi/src/powerpc/linux64_closure.S gcc-4.3.0/libffi/src/powerpc/linux64_closure.S ---- gcc-4.3.0.orig/libffi/src/powerpc/linux64_closure.S 2005-08-11 23:18:24.000000000 +0200 -+++ gcc-4.3.0/libffi/src/powerpc/linux64_closure.S 2008-06-10 14:45:05.000000000 +0200 -@@ -204,3 +204,7 @@ - .align 3 - .LEFDE1: - #endif -+ -+#if defined __ELF__ && defined __linux__ -+ .section .note.GNU-stack,"",@progbits -+#endif -diff -durN gcc-4.3.0.orig/libffi/src/powerpc/ppc_closure.S gcc-4.3.0/libffi/src/powerpc/ppc_closure.S ---- gcc-4.3.0.orig/libffi/src/powerpc/ppc_closure.S 2007-12-01 22:00:04.000000000 +0100 -+++ gcc-4.3.0/libffi/src/powerpc/ppc_closure.S 2008-06-10 14:45:05.000000000 +0200 -@@ -295,3 +295,7 @@ - .LEFDE1: - - #endif -+ -+#if defined __ELF__ && defined __linux__ -+ .section .note.GNU-stack,"",@progbits -+#endif -diff -durN gcc-4.3.0.orig/libffi/src/powerpc/sysv.S gcc-4.3.0/libffi/src/powerpc/sysv.S ---- gcc-4.3.0.orig/libffi/src/powerpc/sysv.S 2007-12-01 22:00:04.000000000 +0100 -+++ gcc-4.3.0/libffi/src/powerpc/sysv.S 2008-06-10 14:45:05.000000000 +0200 -@@ -223,3 +223,7 @@ - .align 2 - .LEFDE1: - #endif -+ -+#if defined __ELF__ && defined __linux__ -+ .section .note.GNU-stack,"",@progbits -+#endif -diff -durN gcc-4.3.0.orig/libffi/src/s390/sysv.S gcc-4.3.0/libffi/src/s390/sysv.S ---- gcc-4.3.0.orig/libffi/src/s390/sysv.S 2003-10-21 21:01:58.000000000 +0200 -+++ gcc-4.3.0/libffi/src/s390/sysv.S 2008-06-10 14:45:05.000000000 +0200 -@@ -427,3 +427,6 @@ - - #endif - -+#if defined __ELF__ && defined __linux__ -+ .section .note.GNU-stack,"",@progbits -+#endif -diff -durN gcc-4.3.0.orig/libffi/src/sparc/v8.S gcc-4.3.0/libffi/src/sparc/v8.S ---- gcc-4.3.0.orig/libffi/src/sparc/v8.S 2004-11-22 19:35:16.000000000 +0100 -+++ gcc-4.3.0/libffi/src/sparc/v8.S 2008-06-10 14:45:05.000000000 +0200 -@@ -265,3 +265,7 @@ - .byte 0x1f ! uleb128 0x1f - .align WS - .LLEFDE2: -+ -+#if defined __ELF__ && defined __linux__ -+ .section .note.GNU-stack,"",@progbits -+#endif -diff -durN gcc-4.3.0.orig/libffi/src/sparc/v9.S gcc-4.3.0/libffi/src/sparc/v9.S ---- gcc-4.3.0.orig/libffi/src/sparc/v9.S 2004-01-25 07:58:33.000000000 +0100 -+++ gcc-4.3.0/libffi/src/sparc/v9.S 2008-06-10 14:45:05.000000000 +0200 -@@ -300,3 +300,7 @@ - .align 8 - .LLEFDE2: - #endif -+ -+#ifdef __linux__ -+ .section .note.GNU-stack,"",@progbits -+#endif -diff -durN gcc-4.3.0.orig/libffi/src/x86/sysv.S gcc-4.3.0/libffi/src/x86/sysv.S ---- gcc-4.3.0.orig/libffi/src/x86/sysv.S 2008-01-30 15:36:58.000000000 +0100 -+++ gcc-4.3.0/libffi/src/x86/sysv.S 2008-06-10 14:45:05.000000000 +0200 -@@ -430,3 +430,7 @@ - #endif - - #endif /* ifndef __x86_64__ */ -+ -+#if defined __ELF__ && defined __linux__ -+ .section .note.GNU-stack,"",@progbits -+#endif -diff -durN gcc-4.3.0.orig/libffi/src/x86/unix64.S gcc-4.3.0/libffi/src/x86/unix64.S ---- gcc-4.3.0.orig/libffi/src/x86/unix64.S 2005-05-05 06:06:38.000000000 +0200 -+++ gcc-4.3.0/libffi/src/x86/unix64.S 2008-06-10 14:45:05.000000000 +0200 -@@ -410,3 +410,7 @@ - .LEFDE3: - - #endif /* __x86_64__ */ -+ -+#if defined __ELF__ && defined __linux__ -+ .section .note.GNU-stack,"",@progbits -+#endif diff --git a/patches/gcc/4.3.0/450-noteGNUstack-01.patch b/patches/gcc/4.3.0/450-noteGNUstack-01.patch new file mode 100644 index 0000000..1094e08 --- /dev/null +++ b/patches/gcc/4.3.0/450-noteGNUstack-01.patch @@ -0,0 +1,198 @@ +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/62_all_gcc4-noteGNUstack.patch +2005-02-08 Jakub Jelinek + + * src/alpha/osf.S: Add .note.GNU-stack on Linux. + * src/s390/sysv.S: Likewise. + * src/powerpc/linux64.S: Likewise. + * src/powerpc/linux64_closure.S: Likewise. + * src/powerpc/ppc_closure.S: Likewise. + * src/powerpc/sysv.S: Likewise. + * src/x86/unix64.S: Likewise. + * src/x86/sysv.S: Likewise. + * src/sparc/v8.S: Likewise. + * src/sparc/v9.S: Likewise. + * src/m68k/sysv.S: Likewise. + * src/ia64/unix.S: Likewise. + * src/arm/sysv.S: Likewise. + + * ia64_save_regs_in_stack.s: Moved to... + * ia64_save_regs_in_stack.S: ... this. Add .note.GNU-stack + on Linux. + +diff -durN gcc-4.3.0.orig/boehm-gc/ia64_save_regs_in_stack.S gcc-4.3.0/boehm-gc/ia64_save_regs_in_stack.S +--- gcc-4.3.0.orig/boehm-gc/ia64_save_regs_in_stack.S 1970-01-01 01:00:00.000000000 +0100 ++++ gcc-4.3.0/boehm-gc/ia64_save_regs_in_stack.S 2008-06-10 14:45:05.000000000 +0200 +@@ -0,0 +1,15 @@ ++ .text ++ .align 16 ++ .global GC_save_regs_in_stack ++ .proc GC_save_regs_in_stack ++GC_save_regs_in_stack: ++ .bodyfoo.mpg ++ flushrs ++ ;; ++ mov r8=ar.bsp ++ br.ret.sptk.few rp ++ .endp GC_save_regs_in_stack ++ ++#ifdef __linux__ ++ .section .note.GNU-stack,"",@progbits ++#endif +diff -durN gcc-4.3.0.orig/boehm-gc/ia64_save_regs_in_stack.s gcc-4.3.0/boehm-gc/ia64_save_regs_in_stack.s +--- gcc-4.3.0.orig/boehm-gc/ia64_save_regs_in_stack.s 2001-10-15 06:57:59.000000000 +0200 ++++ gcc-4.3.0/boehm-gc/ia64_save_regs_in_stack.s 2008-06-10 14:45:05.000000000 +0200 +@@ -1,12 +0,0 @@ +- .text +- .align 16 +- .global GC_save_regs_in_stack +- .proc GC_save_regs_in_stack +-GC_save_regs_in_stack: +- .body +- flushrs +- ;; +- mov r8=ar.bsp +- br.ret.sptk.few rp +- .endp GC_save_regs_in_stack +- +diff -durN gcc-4.3.0.orig/libffi/src/alpha/osf.S gcc-4.3.0/libffi/src/alpha/osf.S +--- gcc-4.3.0.orig/libffi/src/alpha/osf.S 2007-04-06 18:24:16.000000000 +0200 ++++ gcc-4.3.0/libffi/src/alpha/osf.S 2008-06-10 14:45:05.000000000 +0200 +@@ -358,4 +358,8 @@ + .byte 16 # uleb128 offset 16*-8 + .align 3 + $LEFDE3: ++ ++#ifdef __linux__ ++ .section .note.GNU-stack,"",@progbits ++#endif + #endif +diff -durN gcc-4.3.0.orig/libffi/src/arm/sysv.S gcc-4.3.0/libffi/src/arm/sysv.S +--- gcc-4.3.0.orig/libffi/src/arm/sysv.S 2007-09-04 19:52:45.000000000 +0200 ++++ gcc-4.3.0/libffi/src/arm/sysv.S 2008-06-10 14:45:05.000000000 +0200 +@@ -293,3 +293,6 @@ + UNWIND .fnend + .size CNAME(ffi_closure_SYSV),.ffi_closure_SYSV_end-CNAME(ffi_closure_SYSV) + ++#if defined __ELF__ && defined __linux__ ++ .section .note.GNU-stack,"",%progbits ++#endif +diff -durN gcc-4.3.0.orig/libffi/src/ia64/unix.S gcc-4.3.0/libffi/src/ia64/unix.S +--- gcc-4.3.0.orig/libffi/src/ia64/unix.S 2005-03-30 23:49:19.000000000 +0200 ++++ gcc-4.3.0/libffi/src/ia64/unix.S 2008-06-10 14:45:05.000000000 +0200 +@@ -553,3 +553,7 @@ + data8 @pcrel(.Lld_hfa_float) // FFI_IA64_TYPE_HFA_FLOAT + data8 @pcrel(.Lld_hfa_double) // FFI_IA64_TYPE_HFA_DOUBLE + data8 @pcrel(.Lld_hfa_ldouble) // FFI_IA64_TYPE_HFA_LDOUBLE ++ ++#if defined __ELF__ && defined __linux__ ++ .section .note.GNU-stack,"",@progbits ++#endif +diff -durN gcc-4.3.0.orig/libffi/src/m68k/sysv.S gcc-4.3.0/libffi/src/m68k/sysv.S +--- gcc-4.3.0.orig/libffi/src/m68k/sysv.S 2007-05-10 23:29:04.000000000 +0200 ++++ gcc-4.3.0/libffi/src/m68k/sysv.S 2008-06-10 14:45:05.000000000 +0200 +@@ -207,3 +207,7 @@ + rts + CFI_ENDPROC() + .size ffi_closure_struct_SYSV,.-ffi_closure_struct_SYSV ++ ++#if defined __ELF__ && defined __linux__ ++ .section .note.GNU-stack,"",@progbits ++#endif +diff -durN gcc-4.3.0.orig/libffi/src/powerpc/linux64.S gcc-4.3.0/libffi/src/powerpc/linux64.S +--- gcc-4.3.0.orig/libffi/src/powerpc/linux64.S 2007-11-17 00:24:53.000000000 +0100 ++++ gcc-4.3.0/libffi/src/powerpc/linux64.S 2008-06-10 14:45:05.000000000 +0200 +@@ -179,3 +179,7 @@ + .align 3 + .LEFDE1: + #endif ++ ++#if defined __ELF__ && defined __linux__ ++ .section .note.GNU-stack,"",@progbits ++#endif +diff -durN gcc-4.3.0.orig/libffi/src/powerpc/linux64_closure.S gcc-4.3.0/libffi/src/powerpc/linux64_closure.S +--- gcc-4.3.0.orig/libffi/src/powerpc/linux64_closure.S 2005-08-11 23:18:24.000000000 +0200 ++++ gcc-4.3.0/libffi/src/powerpc/linux64_closure.S 2008-06-10 14:45:05.000000000 +0200 +@@ -204,3 +204,7 @@ + .align 3 + .LEFDE1: + #endif ++ ++#if defined __ELF__ && defined __linux__ ++ .section .note.GNU-stack,"",@progbits ++#endif +diff -durN gcc-4.3.0.orig/libffi/src/powerpc/ppc_closure.S gcc-4.3.0/libffi/src/powerpc/ppc_closure.S +--- gcc-4.3.0.orig/libffi/src/powerpc/ppc_closure.S 2007-12-01 22:00:04.000000000 +0100 ++++ gcc-4.3.0/libffi/src/powerpc/ppc_closure.S 2008-06-10 14:45:05.000000000 +0200 +@@ -295,3 +295,7 @@ + .LEFDE1: + + #endif ++ ++#if defined __ELF__ && defined __linux__ ++ .section .note.GNU-stack,"",@progbits ++#endif +diff -durN gcc-4.3.0.orig/libffi/src/powerpc/sysv.S gcc-4.3.0/libffi/src/powerpc/sysv.S +--- gcc-4.3.0.orig/libffi/src/powerpc/sysv.S 2007-12-01 22:00:04.000000000 +0100 ++++ gcc-4.3.0/libffi/src/powerpc/sysv.S 2008-06-10 14:45:05.000000000 +0200 +@@ -223,3 +223,7 @@ + .align 2 + .LEFDE1: + #endif ++ ++#if defined __ELF__ && defined __linux__ ++ .section .note.GNU-stack,"",@progbits ++#endif +diff -durN gcc-4.3.0.orig/libffi/src/s390/sysv.S gcc-4.3.0/libffi/src/s390/sysv.S +--- gcc-4.3.0.orig/libffi/src/s390/sysv.S 2003-10-21 21:01:58.000000000 +0200 ++++ gcc-4.3.0/libffi/src/s390/sysv.S 2008-06-10 14:45:05.000000000 +0200 +@@ -427,3 +427,6 @@ + + #endif + ++#if defined __ELF__ && defined __linux__ ++ .section .note.GNU-stack,"",@progbits ++#endif +diff -durN gcc-4.3.0.orig/libffi/src/sparc/v8.S gcc-4.3.0/libffi/src/sparc/v8.S +--- gcc-4.3.0.orig/libffi/src/sparc/v8.S 2004-11-22 19:35:16.000000000 +0100 ++++ gcc-4.3.0/libffi/src/sparc/v8.S 2008-06-10 14:45:05.000000000 +0200 +@@ -265,3 +265,7 @@ + .byte 0x1f ! uleb128 0x1f + .align WS + .LLEFDE2: ++ ++#if defined __ELF__ && defined __linux__ ++ .section .note.GNU-stack,"",@progbits ++#endif +diff -durN gcc-4.3.0.orig/libffi/src/sparc/v9.S gcc-4.3.0/libffi/src/sparc/v9.S +--- gcc-4.3.0.orig/libffi/src/sparc/v9.S 2004-01-25 07:58:33.000000000 +0100 ++++ gcc-4.3.0/libffi/src/sparc/v9.S 2008-06-10 14:45:05.000000000 +0200 +@@ -300,3 +300,7 @@ + .align 8 + .LLEFDE2: + #endif ++ ++#ifdef __linux__ ++ .section .note.GNU-stack,"",@progbits ++#endif +diff -durN gcc-4.3.0.orig/libffi/src/x86/sysv.S gcc-4.3.0/libffi/src/x86/sysv.S +--- gcc-4.3.0.orig/libffi/src/x86/sysv.S 2008-01-30 15:36:58.000000000 +0100 ++++ gcc-4.3.0/libffi/src/x86/sysv.S 2008-06-10 14:45:05.000000000 +0200 +@@ -430,3 +430,7 @@ + #endif + + #endif /* ifndef __x86_64__ */ ++ ++#if defined __ELF__ && defined __linux__ ++ .section .note.GNU-stack,"",@progbits ++#endif +diff -durN gcc-4.3.0.orig/libffi/src/x86/unix64.S gcc-4.3.0/libffi/src/x86/unix64.S +--- gcc-4.3.0.orig/libffi/src/x86/unix64.S 2005-05-05 06:06:38.000000000 +0200 ++++ gcc-4.3.0/libffi/src/x86/unix64.S 2008-06-10 14:45:05.000000000 +0200 +@@ -410,3 +410,7 @@ + .LEFDE3: + + #endif /* __x86_64__ */ ++ ++#if defined __ELF__ && defined __linux__ ++ .section .note.GNU-stack,"",@progbits ++#endif diff --git a/patches/gcc/4.3.0/475-gcc43-pr35705.patch b/patches/gcc/4.3.0/475-gcc43-pr35705.patch deleted file mode 100644 index 5eb4312..0000000 --- a/patches/gcc/4.3.0/475-gcc43-pr35705.patch +++ /dev/null @@ -1,21 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/63_all_gcc43-pr35705.patch -http://gcc.gnu.org/PR35705 - -2008-04-01 John David Anglin - - PR middle-end/35705 - * fold-const.c (get_pointer_modulus_and_residue): Return modulus 1 if - the expression is a function address. - -diff -durN gcc-4.3.0.orig/gcc/fold-const.c gcc-4.3.0/gcc/fold-const.c ---- gcc-4.3.0.orig/gcc/fold-const.c 2008-02-27 15:12:33.000000000 +0100 -+++ gcc-4.3.0/gcc/fold-const.c 2008-06-10 14:45:09.000000000 +0200 -@@ -9357,7 +9357,7 @@ - } - } - -- if (DECL_P (expr)) -+ if (DECL_P (expr) && TREE_CODE (expr) != FUNCTION_DECL) - return DECL_ALIGN_UNIT (expr); - } - else if (code == POINTER_PLUS_EXPR) diff --git a/patches/gcc/4.3.0/475-pr35705.patch b/patches/gcc/4.3.0/475-pr35705.patch new file mode 100644 index 0000000..5eb4312 --- /dev/null +++ b/patches/gcc/4.3.0/475-pr35705.patch @@ -0,0 +1,21 @@ +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/63_all_gcc43-pr35705.patch +http://gcc.gnu.org/PR35705 + +2008-04-01 John David Anglin + + PR middle-end/35705 + * fold-const.c (get_pointer_modulus_and_residue): Return modulus 1 if + the expression is a function address. + +diff -durN gcc-4.3.0.orig/gcc/fold-const.c gcc-4.3.0/gcc/fold-const.c +--- gcc-4.3.0.orig/gcc/fold-const.c 2008-02-27 15:12:33.000000000 +0100 ++++ gcc-4.3.0/gcc/fold-const.c 2008-06-10 14:45:09.000000000 +0200 +@@ -9357,7 +9357,7 @@ + } + } + +- if (DECL_P (expr)) ++ if (DECL_P (expr) && TREE_CODE (expr) != FUNCTION_DECL) + return DECL_ALIGN_UNIT (expr); + } + else if (code == POINTER_PLUS_EXPR) diff --git a/patches/gcc/4.3.0/500-gcc43-pr34571.patch b/patches/gcc/4.3.0/500-gcc43-pr34571.patch deleted file mode 100644 index 44d6f86..0000000 --- a/patches/gcc/4.3.0/500-gcc43-pr34571.patch +++ /dev/null @@ -1,35 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/64_all_gcc43-pr34571.patch -http://gcc.gnu.org/PR34571 - -2007-12-26 Rask Ingemann Lambertsen - - PR target/34571 - * config/alpha/alpha.c (alpha_cannot_force_const_mem): Use - symbolic_operand. - * varasm.c (output_constant_pool_1): Fix typo. - -diff -durN gcc-4.3.0.orig/gcc/config/alpha/alpha.c gcc-4.3.0/gcc/config/alpha/alpha.c ---- gcc-4.3.0.orig/gcc/config/alpha/alpha.c 2008-02-07 18:45:24.000000000 +0100 -+++ gcc-4.3.0/gcc/config/alpha/alpha.c 2008-06-10 14:45:13.000000000 +0200 -@@ -1113,8 +1113,7 @@ - static bool - alpha_cannot_force_const_mem (rtx x) - { -- enum rtx_code code = GET_CODE (x); -- return code == SYMBOL_REF || code == LABEL_REF || code == CONST; -+ return symbolic_operand (x, GET_MODE (x)); - } - - /* We do not allow indirect calls to be optimized into sibling calls, nor -diff -durN gcc-4.3.0.orig/gcc/varasm.c gcc-4.3.0/gcc/varasm.c ---- gcc-4.3.0.orig/gcc/varasm.c 2007-12-05 22:55:10.000000000 +0100 -+++ gcc-4.3.0/gcc/varasm.c 2008-06-10 14:45:13.000000000 +0200 -@@ -3710,7 +3710,7 @@ - /* FALLTHRU */ - - case LABEL_REF: -- tmp = XEXP (x, 0); -+ tmp = XEXP (tmp, 0); - gcc_assert (!INSN_DELETED_P (tmp)); - gcc_assert (!NOTE_P (tmp) - || NOTE_KIND (tmp) != NOTE_INSN_DELETED); diff --git a/patches/gcc/4.3.0/500-pr34571.patch b/patches/gcc/4.3.0/500-pr34571.patch new file mode 100644 index 0000000..44d6f86 --- /dev/null +++ b/patches/gcc/4.3.0/500-pr34571.patch @@ -0,0 +1,35 @@ +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/64_all_gcc43-pr34571.patch +http://gcc.gnu.org/PR34571 + +2007-12-26 Rask Ingemann Lambertsen + + PR target/34571 + * config/alpha/alpha.c (alpha_cannot_force_const_mem): Use + symbolic_operand. + * varasm.c (output_constant_pool_1): Fix typo. + +diff -durN gcc-4.3.0.orig/gcc/config/alpha/alpha.c gcc-4.3.0/gcc/config/alpha/alpha.c +--- gcc-4.3.0.orig/gcc/config/alpha/alpha.c 2008-02-07 18:45:24.000000000 +0100 ++++ gcc-4.3.0/gcc/config/alpha/alpha.c 2008-06-10 14:45:13.000000000 +0200 +@@ -1113,8 +1113,7 @@ + static bool + alpha_cannot_force_const_mem (rtx x) + { +- enum rtx_code code = GET_CODE (x); +- return code == SYMBOL_REF || code == LABEL_REF || code == CONST; ++ return symbolic_operand (x, GET_MODE (x)); + } + + /* We do not allow indirect calls to be optimized into sibling calls, nor +diff -durN gcc-4.3.0.orig/gcc/varasm.c gcc-4.3.0/gcc/varasm.c +--- gcc-4.3.0.orig/gcc/varasm.c 2007-12-05 22:55:10.000000000 +0100 ++++ gcc-4.3.0/gcc/varasm.c 2008-06-10 14:45:13.000000000 +0200 +@@ -3710,7 +3710,7 @@ + /* FALLTHRU */ + + case LABEL_REF: +- tmp = XEXP (x, 0); ++ tmp = XEXP (tmp, 0); + gcc_assert (!INSN_DELETED_P (tmp)); + gcc_assert (!NOTE_P (tmp) + || NOTE_KIND (tmp) != NOTE_INSN_DELETED); diff --git a/patches/gcc/4.3.0/525-gcc43-pr35982.patch b/patches/gcc/4.3.0/525-gcc43-pr35982.patch deleted file mode 100644 index 461fd57..0000000 --- a/patches/gcc/4.3.0/525-gcc43-pr35982.patch +++ /dev/null @@ -1,23 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/65_all_gcc43-pr35982.patch -http://gcc.gnu.org/PR35982 - -2008-04-23 Ira Rosen - - PR tree-optimization/35982 - * tree-vect-analyze.c (vect_check_interleaving): Check that the - interleaved data-refs are of the same type. - -diff -durN gcc-4.3.0.orig/gcc/tree-vect-analyze.c gcc-4.3.0/gcc/tree-vect-analyze.c ---- gcc-4.3.0.orig/gcc/tree-vect-analyze.c 2007-12-06 17:18:55.000000000 +0100 -+++ gcc-4.3.0/gcc/tree-vect-analyze.c 2008-06-10 14:45:17.000000000 +0200 -@@ -1081,7 +1081,9 @@ - type_size_b = TREE_INT_CST_LOW (TYPE_SIZE_UNIT (TREE_TYPE (DR_REF (drb)))); - - if (type_size_a != type_size_b -- || tree_int_cst_compare (DR_STEP (dra), DR_STEP (drb))) -+ || tree_int_cst_compare (DR_STEP (dra), DR_STEP (drb)) -+ || !types_compatible_p (TREE_TYPE (DR_REF (dra)), -+ TREE_TYPE (DR_REF (drb)))) - return; - - init_a = TREE_INT_CST_LOW (DR_INIT (dra)); diff --git a/patches/gcc/4.3.0/525-pr35982.patch b/patches/gcc/4.3.0/525-pr35982.patch new file mode 100644 index 0000000..461fd57 --- /dev/null +++ b/patches/gcc/4.3.0/525-pr35982.patch @@ -0,0 +1,23 @@ +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/65_all_gcc43-pr35982.patch +http://gcc.gnu.org/PR35982 + +2008-04-23 Ira Rosen + + PR tree-optimization/35982 + * tree-vect-analyze.c (vect_check_interleaving): Check that the + interleaved data-refs are of the same type. + +diff -durN gcc-4.3.0.orig/gcc/tree-vect-analyze.c gcc-4.3.0/gcc/tree-vect-analyze.c +--- gcc-4.3.0.orig/gcc/tree-vect-analyze.c 2007-12-06 17:18:55.000000000 +0100 ++++ gcc-4.3.0/gcc/tree-vect-analyze.c 2008-06-10 14:45:17.000000000 +0200 +@@ -1081,7 +1081,9 @@ + type_size_b = TREE_INT_CST_LOW (TYPE_SIZE_UNIT (TREE_TYPE (DR_REF (drb)))); + + if (type_size_a != type_size_b +- || tree_int_cst_compare (DR_STEP (dra), DR_STEP (drb))) ++ || tree_int_cst_compare (DR_STEP (dra), DR_STEP (drb)) ++ || !types_compatible_p (TREE_TYPE (DR_REF (dra)), ++ TREE_TYPE (DR_REF (drb)))) + return; + + init_a = TREE_INT_CST_LOW (DR_INIT (dra)); diff --git a/patches/gcc/4.3.0/550-gcc43-pr25343.patch b/patches/gcc/4.3.0/550-gcc43-pr25343.patch deleted file mode 100644 index eee48d5..0000000 --- a/patches/gcc/4.3.0/550-gcc43-pr25343.patch +++ /dev/null @@ -1,21 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/66_all_gcc43-pr25343.patch -http://gcc.gnu.org/PR25343 - -sniped from Debian - -2008-04-27 Roman Zippel - - * config/host-linux.c (TRY_EMPTY_VM_SPACE): Define for __mc68000__. - -diff -durN gcc-4.3.0.orig/gcc/config/host-linux.c gcc-4.3.0/gcc/config/host-linux.c ---- gcc-4.3.0.orig/gcc/config/host-linux.c 2007-08-02 12:49:31.000000000 +0200 -+++ gcc-4.3.0/gcc/config/host-linux.c 2008-06-10 14:45:20.000000000 +0200 -@@ -84,6 +84,8 @@ - # define TRY_EMPTY_VM_SPACE 0x8000000000 - #elif defined(__sparc__) - # define TRY_EMPTY_VM_SPACE 0x60000000 -+#elif defined(__mc68000__) -+# define TRY_EMPTY_VM_SPACE 0x40000000 - #else - # define TRY_EMPTY_VM_SPACE 0 - #endif diff --git a/patches/gcc/4.3.0/550-pr25343.patch b/patches/gcc/4.3.0/550-pr25343.patch new file mode 100644 index 0000000..eee48d5 --- /dev/null +++ b/patches/gcc/4.3.0/550-pr25343.patch @@ -0,0 +1,21 @@ +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/66_all_gcc43-pr25343.patch +http://gcc.gnu.org/PR25343 + +sniped from Debian + +2008-04-27 Roman Zippel + + * config/host-linux.c (TRY_EMPTY_VM_SPACE): Define for __mc68000__. + +diff -durN gcc-4.3.0.orig/gcc/config/host-linux.c gcc-4.3.0/gcc/config/host-linux.c +--- gcc-4.3.0.orig/gcc/config/host-linux.c 2007-08-02 12:49:31.000000000 +0200 ++++ gcc-4.3.0/gcc/config/host-linux.c 2008-06-10 14:45:20.000000000 +0200 +@@ -84,6 +84,8 @@ + # define TRY_EMPTY_VM_SPACE 0x8000000000 + #elif defined(__sparc__) + # define TRY_EMPTY_VM_SPACE 0x60000000 ++#elif defined(__mc68000__) ++# define TRY_EMPTY_VM_SPACE 0x40000000 + #else + # define TRY_EMPTY_VM_SPACE 0 + #endif diff --git a/patches/gcc/4.3.0/600-ca-translation-typo.patch b/patches/gcc/4.3.0/600-ca-translation-typo.patch new file mode 100644 index 0000000..ae77fe6 --- /dev/null +++ b/patches/gcc/4.3.0/600-ca-translation-typo.patch @@ -0,0 +1,19 @@ +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/85_all_gcc-ca-translation-typo.patch +http://bugs.gentoo.org/127190 + +2006-03-28 Harald van Dijk + + * ca.po: Fix printf flag typo in negative value translation. + +diff -durN gcc-4.3.0.orig/gcc/po/ca.po gcc-4.3.0/gcc/po/ca.po +--- gcc-4.3.0.orig/gcc/po/ca.po 2007-11-10 19:36:27.000000000 +0100 ++++ gcc-4.3.0/gcc/po/ca.po 2008-06-10 14:45:27.000000000 +0200 +@@ -36028,7 +36028,7 @@ + #~ msgstr "passant el valor negatiu `%E' per a %s %P de \"%D\"" + + #~ msgid "%s of negative value `%E' to `%T'" +-#~ msgstr "%s de valor negatiu `%I' a \"%T\"" ++#~ msgstr "%s de valor negatiu `%E' a \"%T\"" + + #~ msgid "initializing array with parameter list" + #~ msgstr "inicialitzant una matriu amb una llista de paràmetres" diff --git a/patches/gcc/4.3.0/600-gcc-ca-translation-typo.patch b/patches/gcc/4.3.0/600-gcc-ca-translation-typo.patch deleted file mode 100644 index ae77fe6..0000000 --- a/patches/gcc/4.3.0/600-gcc-ca-translation-typo.patch +++ /dev/null @@ -1,19 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/85_all_gcc-ca-translation-typo.patch -http://bugs.gentoo.org/127190 - -2006-03-28 Harald van Dijk - - * ca.po: Fix printf flag typo in negative value translation. - -diff -durN gcc-4.3.0.orig/gcc/po/ca.po gcc-4.3.0/gcc/po/ca.po ---- gcc-4.3.0.orig/gcc/po/ca.po 2007-11-10 19:36:27.000000000 +0100 -+++ gcc-4.3.0/gcc/po/ca.po 2008-06-10 14:45:27.000000000 +0200 -@@ -36028,7 +36028,7 @@ - #~ msgstr "passant el valor negatiu `%E' per a %s %P de \"%D\"" - - #~ msgid "%s of negative value `%E' to `%T'" --#~ msgstr "%s de valor negatiu `%I' a \"%T\"" -+#~ msgstr "%s de valor negatiu `%E' a \"%T\"" - - #~ msgid "initializing array with parameter list" - #~ msgstr "inicialitzant una matriu amb una llista de paràmetres" diff --git a/patches/gcc/4.3.0/625-103-uclibc-conf-noupstream.patch b/patches/gcc/4.3.0/625-103-uclibc-conf-noupstream.patch deleted file mode 100644 index 3b93043..0000000 --- a/patches/gcc/4.3.0/625-103-uclibc-conf-noupstream.patch +++ /dev/null @@ -1,13 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_103-uclibc-conf-noupstream.patch -diff -durN gcc-4.3.0.orig/gcc/config.gcc gcc-4.3.0/gcc/config.gcc ---- gcc-4.3.0.orig/gcc/config.gcc 2008-06-10 14:44:51.000000000 +0200 -+++ gcc-4.3.0/gcc/config.gcc 2008-06-10 14:45:31.000000000 +0200 -@@ -2142,7 +2142,7 @@ - ;; - sh-*-elf* | sh[12346l]*-*-elf* | sh*-*-kaos* | \ - sh-*-symbianelf* | sh[12346l]*-*-symbianelf* | \ -- sh-*-linux* | sh[346lbe]*-*-linux* | \ -+ sh*-*-linux* | sh[346lbe]*-*-linux* | \ - sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \ - sh64-*-netbsd* | sh64l*-*-netbsd*) - tmake_file="${tmake_file} sh/t-sh sh/t-elf" diff --git a/patches/gcc/4.3.0/625-uclibc-conf-noupstream.patch b/patches/gcc/4.3.0/625-uclibc-conf-noupstream.patch new file mode 100644 index 0000000..3b93043 --- /dev/null +++ b/patches/gcc/4.3.0/625-uclibc-conf-noupstream.patch @@ -0,0 +1,13 @@ +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_103-uclibc-conf-noupstream.patch +diff -durN gcc-4.3.0.orig/gcc/config.gcc gcc-4.3.0/gcc/config.gcc +--- gcc-4.3.0.orig/gcc/config.gcc 2008-06-10 14:44:51.000000000 +0200 ++++ gcc-4.3.0/gcc/config.gcc 2008-06-10 14:45:31.000000000 +0200 +@@ -2142,7 +2142,7 @@ + ;; + sh-*-elf* | sh[12346l]*-*-elf* | sh*-*-kaos* | \ + sh-*-symbianelf* | sh[12346l]*-*-symbianelf* | \ +- sh-*-linux* | sh[346lbe]*-*-linux* | \ ++ sh*-*-linux* | sh[346lbe]*-*-linux* | \ + sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \ + sh64-*-netbsd* | sh64l*-*-netbsd*) + tmake_file="${tmake_file} sh/t-sh sh/t-elf" diff --git a/patches/gcc/4.3.0/650-200-uclibc-locale.patch b/patches/gcc/4.3.0/650-200-uclibc-locale.patch deleted file mode 100644 index 60e4b90..0000000 --- a/patches/gcc/4.3.0/650-200-uclibc-locale.patch +++ /dev/null @@ -1,2794 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_200-uclibc-locale.patch -diff -durN gcc-4.3.0.orig/libstdc++-v3/acinclude.m4 gcc-4.3.0/libstdc++-v3/acinclude.m4 ---- gcc-4.3.0.orig/libstdc++-v3/acinclude.m4 2008-02-29 01:00:39.000000000 +0100 -+++ gcc-4.3.0/libstdc++-v3/acinclude.m4 2008-06-10 14:45:35.000000000 +0200 -@@ -1349,7 +1349,7 @@ - AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [ - GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@], - [use MODEL for target locale package], -- [permit generic|gnu|ieee_1003.1-2001|yes|no|auto]) -+ [permit generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto]) - - # Deal with gettext issues. Default to not using it (=no) until we detect - # support for it later. Let the user turn it off via --e/d, but let that -@@ -1370,6 +1370,9 @@ - # Default to "generic". - if test $enable_clocale_flag = auto; then - case ${target_os} in -+ *-uclibc*) -+ enable_clocale_flag=uclibc -+ ;; - linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu) - enable_clocale_flag=gnu - ;; -@@ -1541,6 +1544,40 @@ - CTIME_CC=config/locale/generic/time_members.cc - CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h - ;; -+ uclibc) -+ AC_MSG_RESULT(uclibc) -+ -+ # Declare intention to use gettext, and add support for specific -+ # languages. -+ # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT -+ ALL_LINGUAS="de fr" -+ -+ # Don't call AM-GNU-GETTEXT here. Instead, assume glibc. -+ AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no) -+ if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then -+ USE_NLS=yes -+ fi -+ # Export the build objects. -+ for ling in $ALL_LINGUAS; do \ -+ glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \ -+ glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \ -+ done -+ AC_SUBST(glibcxx_MOFILES) -+ AC_SUBST(glibcxx_POFILES) -+ -+ CLOCALE_H=config/locale/uclibc/c_locale.h -+ CLOCALE_CC=config/locale/uclibc/c_locale.cc -+ CCODECVT_CC=config/locale/uclibc/codecvt_members.cc -+ CCOLLATE_CC=config/locale/uclibc/collate_members.cc -+ CCTYPE_CC=config/locale/uclibc/ctype_members.cc -+ CMESSAGES_H=config/locale/uclibc/messages_members.h -+ CMESSAGES_CC=config/locale/uclibc/messages_members.cc -+ CMONEY_CC=config/locale/uclibc/monetary_members.cc -+ CNUMERIC_CC=config/locale/uclibc/numeric_members.cc -+ CTIME_H=config/locale/uclibc/time_members.h -+ CTIME_CC=config/locale/uclibc/time_members.cc -+ CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h -+ ;; - esac - - # This is where the testsuite looks for locale catalogs, using the -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2008-06-10 14:45:35.000000000 +0200 -@@ -0,0 +1,63 @@ -+// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*- -+ -+// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 2, or (at your option) -+// any later version. -+ -+// This 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 General Public License for more details. -+ -+// You should have received a copy of the GNU General Public License along -+// with this library; see the file COPYING. If not, write to the Free -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -+// USA. -+ -+// As a special exception, you may use this file as part of a free software -+// library without restriction. Specifically, if other files instantiate -+// templates or use macros or inline functions from this file, or you compile -+// this file and link it with other files to produce an executable, this -+// file does not by itself cause the resulting executable to be covered by -+// the GNU General Public License. This exception does not however -+// invalidate any other reasons why the executable file might be covered by -+// the GNU General Public License. -+ -+// Written by Jakub Jelinek -+ -+#include -+#include -+ -+#ifdef __UCLIBC_MJN3_ONLY__ -+#warning clean this up -+#endif -+ -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ -+extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l; -+extern "C" __typeof(strcoll_l) __strcoll_l; -+extern "C" __typeof(strftime_l) __strftime_l; -+extern "C" __typeof(strtod_l) __strtod_l; -+extern "C" __typeof(strtof_l) __strtof_l; -+extern "C" __typeof(strtold_l) __strtold_l; -+extern "C" __typeof(strxfrm_l) __strxfrm_l; -+extern "C" __typeof(newlocale) __newlocale; -+extern "C" __typeof(freelocale) __freelocale; -+extern "C" __typeof(duplocale) __duplocale; -+extern "C" __typeof(uselocale) __uselocale; -+ -+#ifdef _GLIBCXX_USE_WCHAR_T -+extern "C" __typeof(iswctype_l) __iswctype_l; -+extern "C" __typeof(towlower_l) __towlower_l; -+extern "C" __typeof(towupper_l) __towupper_l; -+extern "C" __typeof(wcscoll_l) __wcscoll_l; -+extern "C" __typeof(wcsftime_l) __wcsftime_l; -+extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l; -+extern "C" __typeof(wctype_l) __wctype_l; -+#endif -+ -+#endif // GLIBC 2.3 and later -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.cc ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-06-10 14:45:35.000000000 +0200 -@@ -0,0 +1,160 @@ -+// Wrapper for underlying C-language localization -*- C++ -*- -+ -+// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 2, or (at your option) -+// any later version. -+ -+// This 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 General Public License for more details. -+ -+// You should have received a copy of the GNU General Public License along -+// with this library; see the file COPYING. If not, write to the Free -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -+// USA. -+ -+// As a special exception, you may use this file as part of a free software -+// library without restriction. Specifically, if other files instantiate -+// templates or use macros or inline functions from this file, or you compile -+// this file and link it with other files to produce an executable, this -+// file does not by itself cause the resulting executable to be covered by -+// the GNU General Public License. This exception does not however -+// invalidate any other reasons why the executable file might be covered by -+// the GNU General Public License. -+ -+// -+// ISO C++ 14882: 22.8 Standard locale categories. -+// -+ -+// Written by Benjamin Kosnik -+ -+#include // For errno -+#include -+#include -+#include -+#include -+ -+#ifndef __UCLIBC_HAS_XLOCALE__ -+#define __strtol_l(S, E, B, L) strtol((S), (E), (B)) -+#define __strtoul_l(S, E, B, L) strtoul((S), (E), (B)) -+#define __strtoll_l(S, E, B, L) strtoll((S), (E), (B)) -+#define __strtoull_l(S, E, B, L) strtoull((S), (E), (B)) -+#define __strtof_l(S, E, L) strtof((S), (E)) -+#define __strtod_l(S, E, L) strtod((S), (E)) -+#define __strtold_l(S, E, L) strtold((S), (E)) -+#warning should dummy __newlocale check for C|POSIX ? -+#define __newlocale(a, b, c) NULL -+#define __freelocale(a) ((void)0) -+#define __duplocale(a) __c_locale() -+#endif -+ -+namespace std -+{ -+ template<> -+ void -+ __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, -+ const __c_locale& __cloc) -+ { -+ if (!(__err & ios_base::failbit)) -+ { -+ char* __sanity; -+ errno = 0; -+ float __f = __strtof_l(__s, &__sanity, __cloc); -+ if (__sanity != __s && errno != ERANGE) -+ __v = __f; -+ else -+ __err |= ios_base::failbit; -+ } -+ } -+ -+ template<> -+ void -+ __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, -+ const __c_locale& __cloc) -+ { -+ if (!(__err & ios_base::failbit)) -+ { -+ char* __sanity; -+ errno = 0; -+ double __d = __strtod_l(__s, &__sanity, __cloc); -+ if (__sanity != __s && errno != ERANGE) -+ __v = __d; -+ else -+ __err |= ios_base::failbit; -+ } -+ } -+ -+ template<> -+ void -+ __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err, -+ const __c_locale& __cloc) -+ { -+ if (!(__err & ios_base::failbit)) -+ { -+ char* __sanity; -+ errno = 0; -+ long double __ld = __strtold_l(__s, &__sanity, __cloc); -+ if (__sanity != __s && errno != ERANGE) -+ __v = __ld; -+ else -+ __err |= ios_base::failbit; -+ } -+ } -+ -+ void -+ locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s, -+ __c_locale __old) -+ { -+ __cloc = __newlocale(1 << LC_ALL, __s, __old); -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ if (!__cloc) -+ { -+ // This named locale is not supported by the underlying OS. -+ __throw_runtime_error(__N("locale::facet::_S_create_c_locale " -+ "name not valid")); -+ } -+#endif -+ } -+ -+ void -+ locale::facet::_S_destroy_c_locale(__c_locale& __cloc) -+ { -+ if (_S_get_c_locale() != __cloc) -+ __freelocale(__cloc); -+ } -+ -+ __c_locale -+ locale::facet::_S_clone_c_locale(__c_locale& __cloc) -+ { return __duplocale(__cloc); } -+} // namespace std -+ -+namespace __gnu_cxx -+{ -+ const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] = -+ { -+ "LC_CTYPE", -+ "LC_NUMERIC", -+ "LC_TIME", -+ "LC_COLLATE", -+ "LC_MONETARY", -+ "LC_MESSAGES", -+#if _GLIBCXX_NUM_CATEGORIES != 0 -+ "LC_PAPER", -+ "LC_NAME", -+ "LC_ADDRESS", -+ "LC_TELEPHONE", -+ "LC_MEASUREMENT", -+ "LC_IDENTIFICATION" -+#endif -+ }; -+} -+ -+namespace std -+{ -+ const char* const* const locale::_S_categories = __gnu_cxx::category_names; -+} // namespace std -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.h ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.h 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-06-10 14:45:35.000000000 +0200 -@@ -0,0 +1,117 @@ -+// Wrapper for underlying C-language localization -*- C++ -*- -+ -+// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 2, or (at your option) -+// any later version. -+ -+// This 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 General Public License for more details. -+ -+// You should have received a copy of the GNU General Public License along -+// with this library; see the file COPYING. If not, write to the Free -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -+// USA. -+ -+// As a special exception, you may use this file as part of a free software -+// library without restriction. Specifically, if other files instantiate -+// templates or use macros or inline functions from this file, or you compile -+// this file and link it with other files to produce an executable, this -+// file does not by itself cause the resulting executable to be covered by -+// the GNU General Public License. This exception does not however -+// invalidate any other reasons why the executable file might be covered by -+// the GNU General Public License. -+ -+// -+// ISO C++ 14882: 22.8 Standard locale categories. -+// -+ -+// Written by Benjamin Kosnik -+ -+#ifndef _C_LOCALE_H -+#define _C_LOCALE_H 1 -+ -+#pragma GCC system_header -+ -+#include // get std::strlen -+#include // get std::snprintf or std::sprintf -+#include -+#include // For codecvt -+#ifdef __UCLIBC_MJN3_ONLY__ -+#warning fix this -+#endif -+#ifdef __UCLIBC_HAS_LOCALE__ -+#include // For codecvt using iconv, iconv_t -+#endif -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ -+#include // For messages -+#endif -+ -+#ifdef __UCLIBC_MJN3_ONLY__ -+#warning what is _GLIBCXX_C_LOCALE_GNU for -+#endif -+#define _GLIBCXX_C_LOCALE_GNU 1 -+ -+#ifdef __UCLIBC_MJN3_ONLY__ -+#warning fix categories -+#endif -+// #define _GLIBCXX_NUM_CATEGORIES 6 -+#define _GLIBCXX_NUM_CATEGORIES 0 -+ -+#ifdef __UCLIBC_HAS_XLOCALE__ -+namespace __gnu_cxx -+{ -+ extern "C" __typeof(uselocale) __uselocale; -+} -+#endif -+ -+namespace std -+{ -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ typedef __locale_t __c_locale; -+#else -+ typedef int* __c_locale; -+#endif -+ -+ // Convert numeric value of type _Tv to string and return length of -+ // string. If snprintf is available use it, otherwise fall back to -+ // the unsafe sprintf which, in general, can be dangerous and should -+ // be avoided. -+ template -+ int -+ __convert_from_v(char* __out, -+ const int __size __attribute__ ((__unused__)), -+ const char* __fmt, -+#ifdef __UCLIBC_HAS_XCLOCALE__ -+ _Tv __v, const __c_locale& __cloc, int __prec) -+ { -+ __c_locale __old = __gnu_cxx::__uselocale(__cloc); -+#else -+ _Tv __v, const __c_locale&, int __prec) -+ { -+# ifdef __UCLIBC_HAS_LOCALE__ -+ char* __old = std::setlocale(LC_ALL, NULL); -+ char* __sav = new char[std::strlen(__old) + 1]; -+ std::strcpy(__sav, __old); -+ std::setlocale(LC_ALL, "C"); -+# endif -+#endif -+ -+ const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v); -+ -+#ifdef __UCLIBC_HAS_XCLOCALE__ -+ __gnu_cxx::__uselocale(__old); -+#elif defined __UCLIBC_HAS_LOCALE__ -+ std::setlocale(LC_ALL, __sav); -+ delete [] __sav; -+#endif -+ return __ret; -+ } -+} -+ -+#endif -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/codecvt_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/codecvt_members.cc ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/codecvt_members.cc 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/codecvt_members.cc 2008-06-10 14:45:35.000000000 +0200 -@@ -0,0 +1,306 @@ -+// std::codecvt implementation details, GNU version -*- C++ -*- -+ -+// Copyright (C) 2002, 2003 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 2, or (at your option) -+// any later version. -+ -+// This 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 General Public License for more details. -+ -+// You should have received a copy of the GNU General Public License along -+// with this library; see the file COPYING. If not, write to the Free -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -+// USA. -+ -+// As a special exception, you may use this file as part of a free software -+// library without restriction. Specifically, if other files instantiate -+// templates or use macros or inline functions from this file, or you compile -+// this file and link it with other files to produce an executable, this -+// file does not by itself cause the resulting executable to be covered by -+// the GNU General Public License. This exception does not however -+// invalidate any other reasons why the executable file might be covered by -+// the GNU General Public License. -+ -+// -+// ISO C++ 14882: 22.2.1.5 - Template class codecvt -+// -+ -+// Written by Benjamin Kosnik -+ -+#include -+#include -+ -+namespace std -+{ -+ // Specializations. -+#ifdef _GLIBCXX_USE_WCHAR_T -+ codecvt_base::result -+ codecvt:: -+ do_out(state_type& __state, const intern_type* __from, -+ const intern_type* __from_end, const intern_type*& __from_next, -+ extern_type* __to, extern_type* __to_end, -+ extern_type*& __to_next) const -+ { -+ result __ret = ok; -+ state_type __tmp_state(__state); -+ -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __c_locale __old = __uselocale(_M_c_locale_codecvt); -+#endif -+ -+ // wcsnrtombs is *very* fast but stops if encounters NUL characters: -+ // in case we fall back to wcrtomb and then continue, in a loop. -+ // NB: wcsnrtombs is a GNU extension -+ for (__from_next = __from, __to_next = __to; -+ __from_next < __from_end && __to_next < __to_end -+ && __ret == ok;) -+ { -+ const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0', -+ __from_end - __from_next); -+ if (!__from_chunk_end) -+ __from_chunk_end = __from_end; -+ -+ __from = __from_next; -+ const size_t __conv = wcsnrtombs(__to_next, &__from_next, -+ __from_chunk_end - __from_next, -+ __to_end - __to_next, &__state); -+ if (__conv == static_cast(-1)) -+ { -+ // In case of error, in order to stop at the exact place we -+ // have to start again from the beginning with a series of -+ // wcrtomb. -+ for (; __from < __from_next; ++__from) -+ __to_next += wcrtomb(__to_next, *__from, &__tmp_state); -+ __state = __tmp_state; -+ __ret = error; -+ } -+ else if (__from_next && __from_next < __from_chunk_end) -+ { -+ __to_next += __conv; -+ __ret = partial; -+ } -+ else -+ { -+ __from_next = __from_chunk_end; -+ __to_next += __conv; -+ } -+ -+ if (__from_next < __from_end && __ret == ok) -+ { -+ extern_type __buf[MB_LEN_MAX]; -+ __tmp_state = __state; -+ const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state); -+ if (__conv > static_cast(__to_end - __to_next)) -+ __ret = partial; -+ else -+ { -+ memcpy(__to_next, __buf, __conv); -+ __state = __tmp_state; -+ __to_next += __conv; -+ ++__from_next; -+ } -+ } -+ } -+ -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __uselocale(__old); -+#endif -+ -+ return __ret; -+ } -+ -+ codecvt_base::result -+ codecvt:: -+ do_in(state_type& __state, const extern_type* __from, -+ const extern_type* __from_end, const extern_type*& __from_next, -+ intern_type* __to, intern_type* __to_end, -+ intern_type*& __to_next) const -+ { -+ result __ret = ok; -+ state_type __tmp_state(__state); -+ -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __c_locale __old = __uselocale(_M_c_locale_codecvt); -+#endif -+ -+ // mbsnrtowcs is *very* fast but stops if encounters NUL characters: -+ // in case we store a L'\0' and then continue, in a loop. -+ // NB: mbsnrtowcs is a GNU extension -+ for (__from_next = __from, __to_next = __to; -+ __from_next < __from_end && __to_next < __to_end -+ && __ret == ok;) -+ { -+ const extern_type* __from_chunk_end; -+ __from_chunk_end = static_cast(memchr(__from_next, '\0', -+ __from_end -+ - __from_next)); -+ if (!__from_chunk_end) -+ __from_chunk_end = __from_end; -+ -+ __from = __from_next; -+ size_t __conv = mbsnrtowcs(__to_next, &__from_next, -+ __from_chunk_end - __from_next, -+ __to_end - __to_next, &__state); -+ if (__conv == static_cast(-1)) -+ { -+ // In case of error, in order to stop at the exact place we -+ // have to start again from the beginning with a series of -+ // mbrtowc. -+ for (;; ++__to_next, __from += __conv) -+ { -+ __conv = mbrtowc(__to_next, __from, __from_end - __from, -+ &__tmp_state); -+ if (__conv == static_cast(-1) -+ || __conv == static_cast(-2)) -+ break; -+ } -+ __from_next = __from; -+ __state = __tmp_state; -+ __ret = error; -+ } -+ else if (__from_next && __from_next < __from_chunk_end) -+ { -+ // It is unclear what to return in this case (see DR 382). -+ __to_next += __conv; -+ __ret = partial; -+ } -+ else -+ { -+ __from_next = __from_chunk_end; -+ __to_next += __conv; -+ } -+ -+ if (__from_next < __from_end && __ret == ok) -+ { -+ if (__to_next < __to_end) -+ { -+ // XXX Probably wrong for stateful encodings -+ __tmp_state = __state; -+ ++__from_next; -+ *__to_next++ = L'\0'; -+ } -+ else -+ __ret = partial; -+ } -+ } -+ -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __uselocale(__old); -+#endif -+ -+ return __ret; -+ } -+ -+ int -+ codecvt:: -+ do_encoding() const throw() -+ { -+ // XXX This implementation assumes that the encoding is -+ // stateless and is either single-byte or variable-width. -+ int __ret = 0; -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __c_locale __old = __uselocale(_M_c_locale_codecvt); -+#endif -+ if (MB_CUR_MAX == 1) -+ __ret = 1; -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __uselocale(__old); -+#endif -+ return __ret; -+ } -+ -+ int -+ codecvt:: -+ do_max_length() const throw() -+ { -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __c_locale __old = __uselocale(_M_c_locale_codecvt); -+#endif -+ // XXX Probably wrong for stateful encodings. -+ int __ret = MB_CUR_MAX; -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __uselocale(__old); -+#endif -+ return __ret; -+ } -+ -+ int -+ codecvt:: -+ do_length(state_type& __state, const extern_type* __from, -+ const extern_type* __end, size_t __max) const -+ { -+ int __ret = 0; -+ state_type __tmp_state(__state); -+ -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __c_locale __old = __uselocale(_M_c_locale_codecvt); -+#endif -+ -+ // mbsnrtowcs is *very* fast but stops if encounters NUL characters: -+ // in case we advance past it and then continue, in a loop. -+ // NB: mbsnrtowcs is a GNU extension -+ -+ // A dummy internal buffer is needed in order for mbsnrtocws to consider -+ // its fourth parameter (it wouldn't with NULL as first parameter). -+ wchar_t* __to = static_cast(__builtin_alloca(sizeof(wchar_t) -+ * __max)); -+ while (__from < __end && __max) -+ { -+ const extern_type* __from_chunk_end; -+ __from_chunk_end = static_cast(memchr(__from, '\0', -+ __end -+ - __from)); -+ if (!__from_chunk_end) -+ __from_chunk_end = __end; -+ -+ const extern_type* __tmp_from = __from; -+ size_t __conv = mbsnrtowcs(__to, &__from, -+ __from_chunk_end - __from, -+ __max, &__state); -+ if (__conv == static_cast(-1)) -+ { -+ // In case of error, in order to stop at the exact place we -+ // have to start again from the beginning with a series of -+ // mbrtowc. -+ for (__from = __tmp_from;; __from += __conv) -+ { -+ __conv = mbrtowc(NULL, __from, __end - __from, -+ &__tmp_state); -+ if (__conv == static_cast(-1) -+ || __conv == static_cast(-2)) -+ break; -+ } -+ __state = __tmp_state; -+ __ret += __from - __tmp_from; -+ break; -+ } -+ if (!__from) -+ __from = __from_chunk_end; -+ -+ __ret += __from - __tmp_from; -+ __max -= __conv; -+ -+ if (__from < __end && __max) -+ { -+ // XXX Probably wrong for stateful encodings -+ __tmp_state = __state; -+ ++__from; -+ ++__ret; -+ --__max; -+ } -+ } -+ -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __uselocale(__old); -+#endif -+ -+ return __ret; -+ } -+#endif -+} -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/collate_members.cc ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/collate_members.cc 2008-06-10 14:45:35.000000000 +0200 -@@ -0,0 +1,80 @@ -+// std::collate implementation details, GNU version -*- C++ -*- -+ -+// Copyright (C) 2001, 2002 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 2, or (at your option) -+// any later version. -+ -+// This 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 General Public License for more details. -+ -+// You should have received a copy of the GNU General Public License along -+// with this library; see the file COPYING. If not, write to the Free -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -+// USA. -+ -+// As a special exception, you may use this file as part of a free software -+// library without restriction. Specifically, if other files instantiate -+// templates or use macros or inline functions from this file, or you compile -+// this file and link it with other files to produce an executable, this -+// file does not by itself cause the resulting executable to be covered by -+// the GNU General Public License. This exception does not however -+// invalidate any other reasons why the executable file might be covered by -+// the GNU General Public License. -+ -+// -+// ISO C++ 14882: 22.2.4.1.2 collate virtual functions -+// -+ -+// Written by Benjamin Kosnik -+ -+#include -+#include -+ -+#ifndef __UCLIBC_HAS_XLOCALE__ -+#define __strcoll_l(S1, S2, L) strcoll((S1), (S2)) -+#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N)) -+#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2)) -+#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N)) -+#endif -+ -+namespace std -+{ -+ // These are basically extensions to char_traits, and perhaps should -+ // be put there instead of here. -+ template<> -+ int -+ collate::_M_compare(const char* __one, const char* __two) const -+ { -+ int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate); -+ return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0); -+ } -+ -+ template<> -+ size_t -+ collate::_M_transform(char* __to, const char* __from, -+ size_t __n) const -+ { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); } -+ -+#ifdef _GLIBCXX_USE_WCHAR_T -+ template<> -+ int -+ collate::_M_compare(const wchar_t* __one, -+ const wchar_t* __two) const -+ { -+ int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate); -+ return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0); -+ } -+ -+ template<> -+ size_t -+ collate::_M_transform(wchar_t* __to, const wchar_t* __from, -+ size_t __n) const -+ { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); } -+#endif -+} -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-06-10 14:45:35.000000000 +0200 -@@ -0,0 +1,300 @@ -+// std::ctype implementation details, GNU version -*- C++ -*- -+ -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 2, or (at your option) -+// any later version. -+ -+// This 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 General Public License for more details. -+ -+// You should have received a copy of the GNU General Public License along -+// with this library; see the file COPYING. If not, write to the Free -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -+// USA. -+ -+// As a special exception, you may use this file as part of a free software -+// library without restriction. Specifically, if other files instantiate -+// templates or use macros or inline functions from this file, or you compile -+// this file and link it with other files to produce an executable, this -+// file does not by itself cause the resulting executable to be covered by -+// the GNU General Public License. This exception does not however -+// invalidate any other reasons why the executable file might be covered by -+// the GNU General Public License. -+ -+// -+// ISO C++ 14882: 22.2.1.1.2 ctype virtual functions. -+// -+ -+// Written by Benjamin Kosnik -+ -+#define _LIBC -+#include -+#undef _LIBC -+#include -+ -+#ifndef __UCLIBC_HAS_XLOCALE__ -+#define __wctype_l(S, L) wctype((S)) -+#define __towupper_l(C, L) towupper((C)) -+#define __towlower_l(C, L) towlower((C)) -+#define __iswctype_l(C, M, L) iswctype((C), (M)) -+#endif -+ -+namespace std -+{ -+ // NB: The other ctype specializations are in src/locale.cc and -+ // various /config/os/* files. -+ template<> -+ ctype_byname::ctype_byname(const char* __s, size_t __refs) -+ : ctype(0, false, __refs) -+ { -+ if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0) -+ { -+ this->_S_destroy_c_locale(this->_M_c_locale_ctype); -+ this->_S_create_c_locale(this->_M_c_locale_ctype, __s); -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper; -+ this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower; -+ this->_M_table = this->_M_c_locale_ctype->__ctype_b; -+#endif -+ } -+ } -+ -+#ifdef _GLIBCXX_USE_WCHAR_T -+ ctype::__wmask_type -+ ctype::_M_convert_to_wmask(const mask __m) const -+ { -+ __wmask_type __ret; -+ switch (__m) -+ { -+ case space: -+ __ret = __wctype_l("space", _M_c_locale_ctype); -+ break; -+ case print: -+ __ret = __wctype_l("print", _M_c_locale_ctype); -+ break; -+ case cntrl: -+ __ret = __wctype_l("cntrl", _M_c_locale_ctype); -+ break; -+ case upper: -+ __ret = __wctype_l("upper", _M_c_locale_ctype); -+ break; -+ case lower: -+ __ret = __wctype_l("lower", _M_c_locale_ctype); -+ break; -+ case alpha: -+ __ret = __wctype_l("alpha", _M_c_locale_ctype); -+ break; -+ case digit: -+ __ret = __wctype_l("digit", _M_c_locale_ctype); -+ break; -+ case punct: -+ __ret = __wctype_l("punct", _M_c_locale_ctype); -+ break; -+ case xdigit: -+ __ret = __wctype_l("xdigit", _M_c_locale_ctype); -+ break; -+ case alnum: -+ __ret = __wctype_l("alnum", _M_c_locale_ctype); -+ break; -+ case graph: -+ __ret = __wctype_l("graph", _M_c_locale_ctype); -+ break; -+ default: -+ __ret = __wmask_type(); -+ } -+ return __ret; -+ } -+ -+ wchar_t -+ ctype::do_toupper(wchar_t __c) const -+ { return __towupper_l(__c, _M_c_locale_ctype); } -+ -+ const wchar_t* -+ ctype::do_toupper(wchar_t* __lo, const wchar_t* __hi) const -+ { -+ while (__lo < __hi) -+ { -+ *__lo = __towupper_l(*__lo, _M_c_locale_ctype); -+ ++__lo; -+ } -+ return __hi; -+ } -+ -+ wchar_t -+ ctype::do_tolower(wchar_t __c) const -+ { return __towlower_l(__c, _M_c_locale_ctype); } -+ -+ const wchar_t* -+ ctype::do_tolower(wchar_t* __lo, const wchar_t* __hi) const -+ { -+ while (__lo < __hi) -+ { -+ *__lo = __towlower_l(*__lo, _M_c_locale_ctype); -+ ++__lo; -+ } -+ return __hi; -+ } -+ -+ bool -+ ctype:: -+ do_is(mask __m, wchar_t __c) const -+ { -+ // Highest bitmask in ctype_base == 10, but extra in "C" -+ // library for blank. -+ bool __ret = false; -+ const size_t __bitmasksize = 11; -+ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur) -+ if (__m & _M_bit[__bitcur] -+ && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype)) -+ { -+ __ret = true; -+ break; -+ } -+ return __ret; -+ } -+ -+ const wchar_t* -+ ctype:: -+ do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const -+ { -+ for (; __lo < __hi; ++__vec, ++__lo) -+ { -+ // Highest bitmask in ctype_base == 10, but extra in "C" -+ // library for blank. -+ const size_t __bitmasksize = 11; -+ mask __m = 0; -+ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur) -+ if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype)) -+ __m |= _M_bit[__bitcur]; -+ *__vec = __m; -+ } -+ return __hi; -+ } -+ -+ const wchar_t* -+ ctype:: -+ do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const -+ { -+ while (__lo < __hi && !this->do_is(__m, *__lo)) -+ ++__lo; -+ return __lo; -+ } -+ -+ const wchar_t* -+ ctype:: -+ do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const -+ { -+ while (__lo < __hi && this->do_is(__m, *__lo) != 0) -+ ++__lo; -+ return __lo; -+ } -+ -+ wchar_t -+ ctype:: -+ do_widen(char __c) const -+ { return _M_widen[static_cast(__c)]; } -+ -+ const char* -+ ctype:: -+ do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const -+ { -+ while (__lo < __hi) -+ { -+ *__dest = _M_widen[static_cast(*__lo)]; -+ ++__lo; -+ ++__dest; -+ } -+ return __hi; -+ } -+ -+ char -+ ctype:: -+ do_narrow(wchar_t __wc, char __dfault) const -+ { -+ if (__wc >= 0 && __wc < 128 && _M_narrow_ok) -+ return _M_narrow[__wc]; -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __c_locale __old = __uselocale(_M_c_locale_ctype); -+#endif -+ const int __c = wctob(__wc); -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __uselocale(__old); -+#endif -+ return (__c == EOF ? __dfault : static_cast(__c)); -+ } -+ -+ const wchar_t* -+ ctype:: -+ do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault, -+ char* __dest) const -+ { -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __c_locale __old = __uselocale(_M_c_locale_ctype); -+#endif -+ if (_M_narrow_ok) -+ while (__lo < __hi) -+ { -+ if (*__lo >= 0 && *__lo < 128) -+ *__dest = _M_narrow[*__lo]; -+ else -+ { -+ const int __c = wctob(*__lo); -+ *__dest = (__c == EOF ? __dfault : static_cast(__c)); -+ } -+ ++__lo; -+ ++__dest; -+ } -+ else -+ while (__lo < __hi) -+ { -+ const int __c = wctob(*__lo); -+ *__dest = (__c == EOF ? __dfault : static_cast(__c)); -+ ++__lo; -+ ++__dest; -+ } -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __uselocale(__old); -+#endif -+ return __hi; -+ } -+ -+ void -+ ctype::_M_initialize_ctype() -+ { -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __c_locale __old = __uselocale(_M_c_locale_ctype); -+#endif -+ wint_t __i; -+ for (__i = 0; __i < 128; ++__i) -+ { -+ const int __c = wctob(__i); -+ if (__c == EOF) -+ break; -+ else -+ _M_narrow[__i] = static_cast(__c); -+ } -+ if (__i == 128) -+ _M_narrow_ok = true; -+ else -+ _M_narrow_ok = false; -+ for (size_t __j = 0; -+ __j < sizeof(_M_widen) / sizeof(wint_t); ++__j) -+ _M_widen[__j] = btowc(__j); -+ -+ for (size_t __k = 0; __k <= 11; ++__k) -+ { -+ _M_bit[__k] = static_cast(_ISbit(__k)); -+ _M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]); -+ } -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __uselocale(__old); -+#endif -+ } -+#endif // _GLIBCXX_USE_WCHAR_T -+} -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.cc ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.cc 2008-06-10 14:45:35.000000000 +0200 -@@ -0,0 +1,100 @@ -+// std::messages implementation details, GNU version -*- C++ -*- -+ -+// Copyright (C) 2001, 2002 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 2, or (at your option) -+// any later version. -+ -+// This 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 General Public License for more details. -+ -+// You should have received a copy of the GNU General Public License along -+// with this library; see the file COPYING. If not, write to the Free -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -+// USA. -+ -+// As a special exception, you may use this file as part of a free software -+// library without restriction. Specifically, if other files instantiate -+// templates or use macros or inline functions from this file, or you compile -+// this file and link it with other files to produce an executable, this -+// file does not by itself cause the resulting executable to be covered by -+// the GNU General Public License. This exception does not however -+// invalidate any other reasons why the executable file might be covered by -+// the GNU General Public License. -+ -+// -+// ISO C++ 14882: 22.2.7.1.2 messages virtual functions -+// -+ -+// Written by Benjamin Kosnik -+ -+#include -+#include -+ -+#ifdef __UCLIBC_MJN3_ONLY__ -+#warning fix gettext stuff -+#endif -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ -+extern "C" char *__dcgettext(const char *domainname, -+ const char *msgid, int category); -+#undef gettext -+#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES) -+#else -+#undef gettext -+#define gettext(msgid) (msgid) -+#endif -+ -+namespace std -+{ -+ // Specializations. -+ template<> -+ string -+ messages::do_get(catalog, int, int, const string& __dfault) const -+ { -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __c_locale __old = __uselocale(_M_c_locale_messages); -+ const char* __msg = const_cast(gettext(__dfault.c_str())); -+ __uselocale(__old); -+ return string(__msg); -+#elif defined __UCLIBC_HAS_LOCALE__ -+ char* __old = strdup(setlocale(LC_ALL, NULL)); -+ setlocale(LC_ALL, _M_name_messages); -+ const char* __msg = gettext(__dfault.c_str()); -+ setlocale(LC_ALL, __old); -+ free(__old); -+ return string(__msg); -+#else -+ const char* __msg = gettext(__dfault.c_str()); -+ return string(__msg); -+#endif -+ } -+ -+#ifdef _GLIBCXX_USE_WCHAR_T -+ template<> -+ wstring -+ messages::do_get(catalog, int, int, const wstring& __dfault) const -+ { -+# ifdef __UCLIBC_HAS_XLOCALE__ -+ __c_locale __old = __uselocale(_M_c_locale_messages); -+ char* __msg = gettext(_M_convert_to_char(__dfault)); -+ __uselocale(__old); -+ return _M_convert_from_char(__msg); -+# elif defined __UCLIBC_HAS_LOCALE__ -+ char* __old = strdup(setlocale(LC_ALL, NULL)); -+ setlocale(LC_ALL, _M_name_messages); -+ char* __msg = gettext(_M_convert_to_char(__dfault)); -+ setlocale(LC_ALL, __old); -+ free(__old); -+ return _M_convert_from_char(__msg); -+# else -+ char* __msg = gettext(_M_convert_to_char(__dfault)); -+ return _M_convert_from_char(__msg); -+# endif -+ } -+#endif -+} -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:45:35.000000000 +0200 -@@ -0,0 +1,118 @@ -+// std::messages implementation details, GNU version -*- C++ -*- -+ -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 2, or (at your option) -+// any later version. -+ -+// This 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 General Public License for more details. -+ -+// You should have received a copy of the GNU General Public License along -+// with this library; see the file COPYING. If not, write to the Free -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -+// USA. -+ -+// As a special exception, you may use this file as part of a free software -+// library without restriction. Specifically, if other files instantiate -+// templates or use macros or inline functions from this file, or you compile -+// this file and link it with other files to produce an executable, this -+// file does not by itself cause the resulting executable to be covered by -+// the GNU General Public License. This exception does not however -+// invalidate any other reasons why the executable file might be covered by -+// the GNU General Public License. -+ -+// -+// ISO C++ 14882: 22.2.7.1.2 messages functions -+// -+ -+// Written by Benjamin Kosnik -+ -+#ifdef __UCLIBC_MJN3_ONLY__ -+#warning fix prototypes for *textdomain funcs -+#endif -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ -+extern "C" char *__textdomain(const char *domainname); -+extern "C" char *__bindtextdomain(const char *domainname, -+ const char *dirname); -+#else -+#undef __textdomain -+#undef __bindtextdomain -+#define __textdomain(D) ((void)0) -+#define __bindtextdomain(D,P) ((void)0) -+#endif -+ -+ // Non-virtual member functions. -+ template -+ messages<_CharT>::messages(size_t __refs) -+ : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), -+ _M_name_messages(_S_get_c_name()) -+ { } -+ -+ template -+ messages<_CharT>::messages(__c_locale __cloc, const char* __s, -+ size_t __refs) -+ : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)), -+ _M_name_messages(__s) -+ { -+ char* __tmp = new char[std::strlen(__s) + 1]; -+ std::strcpy(__tmp, __s); -+ _M_name_messages = __tmp; -+ } -+ -+ template -+ typename messages<_CharT>::catalog -+ messages<_CharT>::open(const basic_string& __s, const locale& __loc, -+ const char* __dir) const -+ { -+ __bindtextdomain(__s.c_str(), __dir); -+ return this->do_open(__s, __loc); -+ } -+ -+ // Virtual member functions. -+ template -+ messages<_CharT>::~messages() -+ { -+ if (_M_name_messages != _S_get_c_name()) -+ delete [] _M_name_messages; -+ _S_destroy_c_locale(_M_c_locale_messages); -+ } -+ -+ template -+ typename messages<_CharT>::catalog -+ messages<_CharT>::do_open(const basic_string& __s, -+ const locale&) const -+ { -+ // No error checking is done, assume the catalog exists and can -+ // be used. -+ __textdomain(__s.c_str()); -+ return 0; -+ } -+ -+ template -+ void -+ messages<_CharT>::do_close(catalog) const -+ { } -+ -+ // messages_byname -+ template -+ messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs) -+ : messages<_CharT>(__refs) -+ { -+ if (this->_M_name_messages != locale::facet::_S_get_c_name()) -+ delete [] this->_M_name_messages; -+ char* __tmp = new char[std::strlen(__s) + 1]; -+ std::strcpy(__tmp, __s); -+ this->_M_name_messages = __tmp; -+ -+ if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0) -+ { -+ this->_S_destroy_c_locale(this->_M_c_locale_messages); -+ this->_S_create_c_locale(this->_M_c_locale_messages, __s); -+ } -+ } -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:45:35.000000000 +0200 -@@ -0,0 +1,692 @@ -+// std::moneypunct implementation details, GNU version -*- C++ -*- -+ -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 2, or (at your option) -+// any later version. -+ -+// This 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 General Public License for more details. -+ -+// You should have received a copy of the GNU General Public License along -+// with this library; see the file COPYING. If not, write to the Free -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -+// USA. -+ -+// As a special exception, you may use this file as part of a free software -+// library without restriction. Specifically, if other files instantiate -+// templates or use macros or inline functions from this file, or you compile -+// this file and link it with other files to produce an executable, this -+// file does not by itself cause the resulting executable to be covered by -+// the GNU General Public License. This exception does not however -+// invalidate any other reasons why the executable file might be covered by -+// the GNU General Public License. -+ -+// -+// ISO C++ 14882: 22.2.6.3.2 moneypunct virtual functions -+// -+ -+// Written by Benjamin Kosnik -+ -+#define _LIBC -+#include -+#undef _LIBC -+#include -+ -+#ifdef __UCLIBC_MJN3_ONLY__ -+#warning optimize this for uclibc -+#warning tailor for stub locale support -+#endif -+ -+#ifndef __UCLIBC_HAS_XLOCALE__ -+#define __nl_langinfo_l(N, L) nl_langinfo((N)) -+#endif -+ -+namespace std -+{ -+ // Construct and return valid pattern consisting of some combination of: -+ // space none symbol sign value -+ money_base::pattern -+ money_base::_S_construct_pattern(char __precedes, char __space, char __posn) -+ { -+ pattern __ret; -+ -+ // This insanely complicated routine attempts to construct a valid -+ // pattern for use with monyepunct. A couple of invariants: -+ -+ // if (__precedes) symbol -> value -+ // else value -> symbol -+ -+ // if (__space) space -+ // else none -+ -+ // none == never first -+ // space never first or last -+ -+ // Any elegant implementations of this are welcome. -+ switch (__posn) -+ { -+ case 0: -+ case 1: -+ // 1 The sign precedes the value and symbol. -+ __ret.field[0] = sign; -+ if (__space) -+ { -+ // Pattern starts with sign. -+ if (__precedes) -+ { -+ __ret.field[1] = symbol; -+ __ret.field[3] = value; -+ } -+ else -+ { -+ __ret.field[1] = value; -+ __ret.field[3] = symbol; -+ } -+ __ret.field[2] = space; -+ } -+ else -+ { -+ // Pattern starts with sign and ends with none. -+ if (__precedes) -+ { -+ __ret.field[1] = symbol; -+ __ret.field[2] = value; -+ } -+ else -+ { -+ __ret.field[1] = value; -+ __ret.field[2] = symbol; -+ } -+ __ret.field[3] = none; -+ } -+ break; -+ case 2: -+ // 2 The sign follows the value and symbol. -+ if (__space) -+ { -+ // Pattern either ends with sign. -+ if (__precedes) -+ { -+ __ret.field[0] = symbol; -+ __ret.field[2] = value; -+ } -+ else -+ { -+ __ret.field[0] = value; -+ __ret.field[2] = symbol; -+ } -+ __ret.field[1] = space; -+ __ret.field[3] = sign; -+ } -+ else -+ { -+ // Pattern ends with sign then none. -+ if (__precedes) -+ { -+ __ret.field[0] = symbol; -+ __ret.field[1] = value; -+ } -+ else -+ { -+ __ret.field[0] = value; -+ __ret.field[1] = symbol; -+ } -+ __ret.field[2] = sign; -+ __ret.field[3] = none; -+ } -+ break; -+ case 3: -+ // 3 The sign immediately precedes the symbol. -+ if (__precedes) -+ { -+ __ret.field[0] = sign; -+ __ret.field[1] = symbol; -+ if (__space) -+ { -+ __ret.field[2] = space; -+ __ret.field[3] = value; -+ } -+ else -+ { -+ __ret.field[2] = value; -+ __ret.field[3] = none; -+ } -+ } -+ else -+ { -+ __ret.field[0] = value; -+ if (__space) -+ { -+ __ret.field[1] = space; -+ __ret.field[2] = sign; -+ __ret.field[3] = symbol; -+ } -+ else -+ { -+ __ret.field[1] = sign; -+ __ret.field[2] = symbol; -+ __ret.field[3] = none; -+ } -+ } -+ break; -+ case 4: -+ // 4 The sign immediately follows the symbol. -+ if (__precedes) -+ { -+ __ret.field[0] = symbol; -+ __ret.field[1] = sign; -+ if (__space) -+ { -+ __ret.field[2] = space; -+ __ret.field[3] = value; -+ } -+ else -+ { -+ __ret.field[2] = value; -+ __ret.field[3] = none; -+ } -+ } -+ else -+ { -+ __ret.field[0] = value; -+ if (__space) -+ { -+ __ret.field[1] = space; -+ __ret.field[2] = symbol; -+ __ret.field[3] = sign; -+ } -+ else -+ { -+ __ret.field[1] = symbol; -+ __ret.field[2] = sign; -+ __ret.field[3] = none; -+ } -+ } -+ break; -+ default: -+ ; -+ } -+ return __ret; -+ } -+ -+ template<> -+ void -+ moneypunct::_M_initialize_moneypunct(__c_locale __cloc, -+ const char*) -+ { -+ if (!_M_data) -+ _M_data = new __moneypunct_cache; -+ -+ if (!__cloc) -+ { -+ // "C" locale -+ _M_data->_M_decimal_point = '.'; -+ _M_data->_M_thousands_sep = ','; -+ _M_data->_M_grouping = ""; -+ _M_data->_M_grouping_size = 0; -+ _M_data->_M_curr_symbol = ""; -+ _M_data->_M_curr_symbol_size = 0; -+ _M_data->_M_positive_sign = ""; -+ _M_data->_M_positive_sign_size = 0; -+ _M_data->_M_negative_sign = ""; -+ _M_data->_M_negative_sign_size = 0; -+ _M_data->_M_frac_digits = 0; -+ _M_data->_M_pos_format = money_base::_S_default_pattern; -+ _M_data->_M_neg_format = money_base::_S_default_pattern; -+ -+ for (size_t __i = 0; __i < money_base::_S_end; ++__i) -+ _M_data->_M_atoms[__i] = money_base::_S_atoms[__i]; -+ } -+ else -+ { -+ // Named locale. -+ _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, -+ __cloc)); -+ _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, -+ __cloc)); -+ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc); -+ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); -+ _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc); -+ _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign); -+ -+ char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc)); -+ if (!__nposn) -+ _M_data->_M_negative_sign = "()"; -+ else -+ _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, -+ __cloc); -+ _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign); -+ -+ // _Intl == true -+ _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc); -+ _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol); -+ _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, -+ __cloc)); -+ char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc)); -+ char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc)); -+ char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc)); -+ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, -+ __pposn); -+ char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc)); -+ char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc)); -+ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, -+ __nposn); -+ } -+ } -+ -+ template<> -+ void -+ moneypunct::_M_initialize_moneypunct(__c_locale __cloc, -+ const char*) -+ { -+ if (!_M_data) -+ _M_data = new __moneypunct_cache; -+ -+ if (!__cloc) -+ { -+ // "C" locale -+ _M_data->_M_decimal_point = '.'; -+ _M_data->_M_thousands_sep = ','; -+ _M_data->_M_grouping = ""; -+ _M_data->_M_grouping_size = 0; -+ _M_data->_M_curr_symbol = ""; -+ _M_data->_M_curr_symbol_size = 0; -+ _M_data->_M_positive_sign = ""; -+ _M_data->_M_positive_sign_size = 0; -+ _M_data->_M_negative_sign = ""; -+ _M_data->_M_negative_sign_size = 0; -+ _M_data->_M_frac_digits = 0; -+ _M_data->_M_pos_format = money_base::_S_default_pattern; -+ _M_data->_M_neg_format = money_base::_S_default_pattern; -+ -+ for (size_t __i = 0; __i < money_base::_S_end; ++__i) -+ _M_data->_M_atoms[__i] = money_base::_S_atoms[__i]; -+ } -+ else -+ { -+ // Named locale. -+ _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, -+ __cloc)); -+ _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, -+ __cloc)); -+ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc); -+ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); -+ _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc); -+ _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign); -+ -+ char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc)); -+ if (!__nposn) -+ _M_data->_M_negative_sign = "()"; -+ else -+ _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, -+ __cloc); -+ _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign); -+ -+ // _Intl == false -+ _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc); -+ _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol); -+ _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc)); -+ char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc)); -+ char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc)); -+ char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc)); -+ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, -+ __pposn); -+ char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc)); -+ char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc)); -+ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, -+ __nposn); -+ } -+ } -+ -+ template<> -+ moneypunct::~moneypunct() -+ { delete _M_data; } -+ -+ template<> -+ moneypunct::~moneypunct() -+ { delete _M_data; } -+ -+#ifdef _GLIBCXX_USE_WCHAR_T -+ template<> -+ void -+ moneypunct::_M_initialize_moneypunct(__c_locale __cloc, -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ const char*) -+#else -+ const char* __name) -+#endif -+ { -+ if (!_M_data) -+ _M_data = new __moneypunct_cache; -+ -+ if (!__cloc) -+ { -+ // "C" locale -+ _M_data->_M_decimal_point = L'.'; -+ _M_data->_M_thousands_sep = L','; -+ _M_data->_M_grouping = ""; -+ _M_data->_M_grouping_size = 0; -+ _M_data->_M_curr_symbol = L""; -+ _M_data->_M_curr_symbol_size = 0; -+ _M_data->_M_positive_sign = L""; -+ _M_data->_M_positive_sign_size = 0; -+ _M_data->_M_negative_sign = L""; -+ _M_data->_M_negative_sign_size = 0; -+ _M_data->_M_frac_digits = 0; -+ _M_data->_M_pos_format = money_base::_S_default_pattern; -+ _M_data->_M_neg_format = money_base::_S_default_pattern; -+ -+ // Use ctype::widen code without the facet... -+ for (size_t __i = 0; __i < money_base::_S_end; ++__i) -+ _M_data->_M_atoms[__i] = -+ static_cast(money_base::_S_atoms[__i]); -+ } -+ else -+ { -+ // Named locale. -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __c_locale __old = __uselocale(__cloc); -+#else -+ // Switch to named locale so that mbsrtowcs will work. -+ char* __old = strdup(setlocale(LC_ALL, NULL)); -+ setlocale(LC_ALL, __name); -+#endif -+ -+#ifdef __UCLIBC_MJN3_ONLY__ -+#warning fix this... should be monetary -+#endif -+#ifdef __UCLIBC__ -+# ifdef __UCLIBC_HAS_XLOCALE__ -+ _M_data->_M_decimal_point = __cloc->decimal_point_wc; -+ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc; -+# else -+ _M_data->_M_decimal_point = __global_locale->decimal_point_wc; -+ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc; -+# endif -+#else -+ union { char *__s; wchar_t __w; } __u; -+ __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc); -+ _M_data->_M_decimal_point = __u.__w; -+ -+ __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc); -+ _M_data->_M_thousands_sep = __u.__w; -+#endif -+ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc); -+ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); -+ -+ const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc); -+ const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc); -+ const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc); -+ -+ wchar_t* __wcs_ps = 0; -+ wchar_t* __wcs_ns = 0; -+ const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc)); -+ try -+ { -+ mbstate_t __state; -+ size_t __len = strlen(__cpossign); -+ if (__len) -+ { -+ ++__len; -+ memset(&__state, 0, sizeof(mbstate_t)); -+ __wcs_ps = new wchar_t[__len]; -+ mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state); -+ _M_data->_M_positive_sign = __wcs_ps; -+ } -+ else -+ _M_data->_M_positive_sign = L""; -+ _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign); -+ -+ __len = strlen(__cnegsign); -+ if (!__nposn) -+ _M_data->_M_negative_sign = L"()"; -+ else if (__len) -+ { -+ ++__len; -+ memset(&__state, 0, sizeof(mbstate_t)); -+ __wcs_ns = new wchar_t[__len]; -+ mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state); -+ _M_data->_M_negative_sign = __wcs_ns; -+ } -+ else -+ _M_data->_M_negative_sign = L""; -+ _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign); -+ -+ // _Intl == true. -+ __len = strlen(__ccurr); -+ if (__len) -+ { -+ ++__len; -+ memset(&__state, 0, sizeof(mbstate_t)); -+ wchar_t* __wcs = new wchar_t[__len]; -+ mbsrtowcs(__wcs, &__ccurr, __len, &__state); -+ _M_data->_M_curr_symbol = __wcs; -+ } -+ else -+ _M_data->_M_curr_symbol = L""; -+ _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol); -+ } -+ catch (...) -+ { -+ delete _M_data; -+ _M_data = 0; -+ delete __wcs_ps; -+ delete __wcs_ns; -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __uselocale(__old); -+#else -+ setlocale(LC_ALL, __old); -+ free(__old); -+#endif -+ __throw_exception_again; -+ } -+ -+ _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, -+ __cloc)); -+ char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc)); -+ char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc)); -+ char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc)); -+ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, -+ __pposn); -+ char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc)); -+ char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc)); -+ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, -+ __nposn); -+ -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __uselocale(__old); -+#else -+ setlocale(LC_ALL, __old); -+ free(__old); -+#endif -+ } -+ } -+ -+ template<> -+ void -+ moneypunct::_M_initialize_moneypunct(__c_locale __cloc, -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ const char*) -+#else -+ const char* __name) -+#endif -+ { -+ if (!_M_data) -+ _M_data = new __moneypunct_cache; -+ -+ if (!__cloc) -+ { -+ // "C" locale -+ _M_data->_M_decimal_point = L'.'; -+ _M_data->_M_thousands_sep = L','; -+ _M_data->_M_grouping = ""; -+ _M_data->_M_grouping_size = 0; -+ _M_data->_M_curr_symbol = L""; -+ _M_data->_M_curr_symbol_size = 0; -+ _M_data->_M_positive_sign = L""; -+ _M_data->_M_positive_sign_size = 0; -+ _M_data->_M_negative_sign = L""; -+ _M_data->_M_negative_sign_size = 0; -+ _M_data->_M_frac_digits = 0; -+ _M_data->_M_pos_format = money_base::_S_default_pattern; -+ _M_data->_M_neg_format = money_base::_S_default_pattern; -+ -+ // Use ctype::widen code without the facet... -+ for (size_t __i = 0; __i < money_base::_S_end; ++__i) -+ _M_data->_M_atoms[__i] = -+ static_cast(money_base::_S_atoms[__i]); -+ } -+ else -+ { -+ // Named locale. -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __c_locale __old = __uselocale(__cloc); -+#else -+ // Switch to named locale so that mbsrtowcs will work. -+ char* __old = strdup(setlocale(LC_ALL, NULL)); -+ setlocale(LC_ALL, __name); -+#endif -+ -+#ifdef __UCLIBC_MJN3_ONLY__ -+#warning fix this... should be monetary -+#endif -+#ifdef __UCLIBC__ -+# ifdef __UCLIBC_HAS_XLOCALE__ -+ _M_data->_M_decimal_point = __cloc->decimal_point_wc; -+ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc; -+# else -+ _M_data->_M_decimal_point = __global_locale->decimal_point_wc; -+ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc; -+# endif -+#else -+ union { char *__s; wchar_t __w; } __u; -+ __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc); -+ _M_data->_M_decimal_point = __u.__w; -+ -+ __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc); -+ _M_data->_M_thousands_sep = __u.__w; -+#endif -+ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc); -+ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); -+ -+ const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc); -+ const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc); -+ const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc); -+ -+ wchar_t* __wcs_ps = 0; -+ wchar_t* __wcs_ns = 0; -+ const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc)); -+ try -+ { -+ mbstate_t __state; -+ size_t __len; -+ __len = strlen(__cpossign); -+ if (__len) -+ { -+ ++__len; -+ memset(&__state, 0, sizeof(mbstate_t)); -+ __wcs_ps = new wchar_t[__len]; -+ mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state); -+ _M_data->_M_positive_sign = __wcs_ps; -+ } -+ else -+ _M_data->_M_positive_sign = L""; -+ _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign); -+ -+ __len = strlen(__cnegsign); -+ if (!__nposn) -+ _M_data->_M_negative_sign = L"()"; -+ else if (__len) -+ { -+ ++__len; -+ memset(&__state, 0, sizeof(mbstate_t)); -+ __wcs_ns = new wchar_t[__len]; -+ mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state); -+ _M_data->_M_negative_sign = __wcs_ns; -+ } -+ else -+ _M_data->_M_negative_sign = L""; -+ _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign); -+ -+ // _Intl == true. -+ __len = strlen(__ccurr); -+ if (__len) -+ { -+ ++__len; -+ memset(&__state, 0, sizeof(mbstate_t)); -+ wchar_t* __wcs = new wchar_t[__len]; -+ mbsrtowcs(__wcs, &__ccurr, __len, &__state); -+ _M_data->_M_curr_symbol = __wcs; -+ } -+ else -+ _M_data->_M_curr_symbol = L""; -+ _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol); -+ } -+ catch (...) -+ { -+ delete _M_data; -+ _M_data = 0; -+ delete __wcs_ps; -+ delete __wcs_ns; -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __uselocale(__old); -+#else -+ setlocale(LC_ALL, __old); -+ free(__old); -+#endif -+ __throw_exception_again; -+ } -+ -+ _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc)); -+ char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc)); -+ char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc)); -+ char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc)); -+ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, -+ __pposn); -+ char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc)); -+ char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc)); -+ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, -+ __nposn); -+ -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __uselocale(__old); -+#else -+ setlocale(LC_ALL, __old); -+ free(__old); -+#endif -+ } -+ } -+ -+ template<> -+ moneypunct::~moneypunct() -+ { -+ if (_M_data->_M_positive_sign_size) -+ delete [] _M_data->_M_positive_sign; -+ if (_M_data->_M_negative_sign_size -+ && wcscmp(_M_data->_M_negative_sign, L"()") != 0) -+ delete [] _M_data->_M_negative_sign; -+ if (_M_data->_M_curr_symbol_size) -+ delete [] _M_data->_M_curr_symbol; -+ delete _M_data; -+ } -+ -+ template<> -+ moneypunct::~moneypunct() -+ { -+ if (_M_data->_M_positive_sign_size) -+ delete [] _M_data->_M_positive_sign; -+ if (_M_data->_M_negative_sign_size -+ && wcscmp(_M_data->_M_negative_sign, L"()") != 0) -+ delete [] _M_data->_M_negative_sign; -+ if (_M_data->_M_curr_symbol_size) -+ delete [] _M_data->_M_curr_symbol; -+ delete _M_data; -+ } -+#endif -+} -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:45:35.000000000 +0200 -@@ -0,0 +1,160 @@ -+// std::numpunct implementation details, GNU version -*- C++ -*- -+ -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 2, or (at your option) -+// any later version. -+ -+// This 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 General Public License for more details. -+ -+// You should have received a copy of the GNU General Public License along -+// with this library; see the file COPYING. If not, write to the Free -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -+// USA. -+ -+// As a special exception, you may use this file as part of a free software -+// library without restriction. Specifically, if other files instantiate -+// templates or use macros or inline functions from this file, or you compile -+// this file and link it with other files to produce an executable, this -+// file does not by itself cause the resulting executable to be covered by -+// the GNU General Public License. This exception does not however -+// invalidate any other reasons why the executable file might be covered by -+// the GNU General Public License. -+ -+// -+// ISO C++ 14882: 22.2.3.1.2 numpunct virtual functions -+// -+ -+// Written by Benjamin Kosnik -+ -+#define _LIBC -+#include -+#undef _LIBC -+#include -+ -+#ifdef __UCLIBC_MJN3_ONLY__ -+#warning tailor for stub locale support -+#endif -+#ifndef __UCLIBC_HAS_XLOCALE__ -+#define __nl_langinfo_l(N, L) nl_langinfo((N)) -+#endif -+ -+namespace std -+{ -+ template<> -+ void -+ numpunct::_M_initialize_numpunct(__c_locale __cloc) -+ { -+ if (!_M_data) -+ _M_data = new __numpunct_cache; -+ -+ if (!__cloc) -+ { -+ // "C" locale -+ _M_data->_M_grouping = ""; -+ _M_data->_M_grouping_size = 0; -+ _M_data->_M_use_grouping = false; -+ -+ _M_data->_M_decimal_point = '.'; -+ _M_data->_M_thousands_sep = ','; -+ -+ for (size_t __i = 0; __i < __num_base::_S_oend; ++__i) -+ _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i]; -+ -+ for (size_t __j = 0; __j < __num_base::_S_iend; ++__j) -+ _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j]; -+ } -+ else -+ { -+ // Named locale. -+ _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT, -+ __cloc)); -+ _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP, -+ __cloc)); -+ -+ // Check for NULL, which implies no grouping. -+ if (_M_data->_M_thousands_sep == '\0') -+ _M_data->_M_grouping = ""; -+ else -+ _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc); -+ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); -+ } -+ -+ // NB: There is no way to extact this info from posix locales. -+ // _M_truename = __nl_langinfo_l(YESSTR, __cloc); -+ _M_data->_M_truename = "true"; -+ _M_data->_M_truename_size = 4; -+ // _M_falsename = __nl_langinfo_l(NOSTR, __cloc); -+ _M_data->_M_falsename = "false"; -+ _M_data->_M_falsename_size = 5; -+ } -+ -+ template<> -+ numpunct::~numpunct() -+ { delete _M_data; } -+ -+#ifdef _GLIBCXX_USE_WCHAR_T -+ template<> -+ void -+ numpunct::_M_initialize_numpunct(__c_locale __cloc) -+ { -+ if (!_M_data) -+ _M_data = new __numpunct_cache; -+ -+ if (!__cloc) -+ { -+ // "C" locale -+ _M_data->_M_grouping = ""; -+ _M_data->_M_grouping_size = 0; -+ _M_data->_M_use_grouping = false; -+ -+ _M_data->_M_decimal_point = L'.'; -+ _M_data->_M_thousands_sep = L','; -+ -+ // Use ctype::widen code without the facet... -+ for (size_t __i = 0; __i < __num_base::_S_oend; ++__i) -+ _M_data->_M_atoms_out[__i] = -+ static_cast(__num_base::_S_atoms_out[__i]); -+ -+ for (size_t __j = 0; __j < __num_base::_S_iend; ++__j) -+ _M_data->_M_atoms_in[__j] = -+ static_cast(__num_base::_S_atoms_in[__j]); -+ } -+ else -+ { -+ // Named locale. -+ // NB: In the GNU model wchar_t is always 32 bit wide. -+ union { char *__s; wchar_t __w; } __u; -+ __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc); -+ _M_data->_M_decimal_point = __u.__w; -+ -+ __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc); -+ _M_data->_M_thousands_sep = __u.__w; -+ -+ if (_M_data->_M_thousands_sep == L'\0') -+ _M_data->_M_grouping = ""; -+ else -+ _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc); -+ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); -+ } -+ -+ // NB: There is no way to extact this info from posix locales. -+ // _M_truename = __nl_langinfo_l(YESSTR, __cloc); -+ _M_data->_M_truename = L"true"; -+ _M_data->_M_truename_size = 4; -+ // _M_falsename = __nl_langinfo_l(NOSTR, __cloc); -+ _M_data->_M_falsename = L"false"; -+ _M_data->_M_falsename_size = 5; -+ } -+ -+ template<> -+ numpunct::~numpunct() -+ { delete _M_data; } -+ #endif -+} -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.cc ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.cc 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.cc 2008-06-10 14:45:35.000000000 +0200 -@@ -0,0 +1,406 @@ -+// std::time_get, std::time_put implementation, GNU version -*- C++ -*- -+ -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 2, or (at your option) -+// any later version. -+ -+// This 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 General Public License for more details. -+ -+// You should have received a copy of the GNU General Public License along -+// with this library; see the file COPYING. If not, write to the Free -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -+// USA. -+ -+// As a special exception, you may use this file as part of a free software -+// library without restriction. Specifically, if other files instantiate -+// templates or use macros or inline functions from this file, or you compile -+// this file and link it with other files to produce an executable, this -+// file does not by itself cause the resulting executable to be covered by -+// the GNU General Public License. This exception does not however -+// invalidate any other reasons why the executable file might be covered by -+// the GNU General Public License. -+ -+// -+// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions -+// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions -+// -+ -+// Written by Benjamin Kosnik -+ -+#include -+#include -+ -+#ifdef __UCLIBC_MJN3_ONLY__ -+#warning tailor for stub locale support -+#endif -+#ifndef __UCLIBC_HAS_XLOCALE__ -+#define __nl_langinfo_l(N, L) nl_langinfo((N)) -+#endif -+ -+namespace std -+{ -+ template<> -+ void -+ __timepunct:: -+ _M_put(char* __s, size_t __maxlen, const char* __format, -+ const tm* __tm) const -+ { -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ const size_t __len = __strftime_l(__s, __maxlen, __format, __tm, -+ _M_c_locale_timepunct); -+#else -+ char* __old = strdup(setlocale(LC_ALL, NULL)); -+ setlocale(LC_ALL, _M_name_timepunct); -+ const size_t __len = strftime(__s, __maxlen, __format, __tm); -+ setlocale(LC_ALL, __old); -+ free(__old); -+#endif -+ // Make sure __s is null terminated. -+ if (__len == 0) -+ __s[0] = '\0'; -+ } -+ -+ template<> -+ void -+ __timepunct::_M_initialize_timepunct(__c_locale __cloc) -+ { -+ if (!_M_data) -+ _M_data = new __timepunct_cache; -+ -+ if (!__cloc) -+ { -+ // "C" locale -+ _M_c_locale_timepunct = _S_get_c_locale(); -+ -+ _M_data->_M_date_format = "%m/%d/%y"; -+ _M_data->_M_date_era_format = "%m/%d/%y"; -+ _M_data->_M_time_format = "%H:%M:%S"; -+ _M_data->_M_time_era_format = "%H:%M:%S"; -+ _M_data->_M_date_time_format = ""; -+ _M_data->_M_date_time_era_format = ""; -+ _M_data->_M_am = "AM"; -+ _M_data->_M_pm = "PM"; -+ _M_data->_M_am_pm_format = ""; -+ -+ // Day names, starting with "C"'s Sunday. -+ _M_data->_M_day1 = "Sunday"; -+ _M_data->_M_day2 = "Monday"; -+ _M_data->_M_day3 = "Tuesday"; -+ _M_data->_M_day4 = "Wednesday"; -+ _M_data->_M_day5 = "Thursday"; -+ _M_data->_M_day6 = "Friday"; -+ _M_data->_M_day7 = "Saturday"; -+ -+ // Abbreviated day names, starting with "C"'s Sun. -+ _M_data->_M_aday1 = "Sun"; -+ _M_data->_M_aday2 = "Mon"; -+ _M_data->_M_aday3 = "Tue"; -+ _M_data->_M_aday4 = "Wed"; -+ _M_data->_M_aday5 = "Thu"; -+ _M_data->_M_aday6 = "Fri"; -+ _M_data->_M_aday7 = "Sat"; -+ -+ // Month names, starting with "C"'s January. -+ _M_data->_M_month01 = "January"; -+ _M_data->_M_month02 = "February"; -+ _M_data->_M_month03 = "March"; -+ _M_data->_M_month04 = "April"; -+ _M_data->_M_month05 = "May"; -+ _M_data->_M_month06 = "June"; -+ _M_data->_M_month07 = "July"; -+ _M_data->_M_month08 = "August"; -+ _M_data->_M_month09 = "September"; -+ _M_data->_M_month10 = "October"; -+ _M_data->_M_month11 = "November"; -+ _M_data->_M_month12 = "December"; -+ -+ // Abbreviated month names, starting with "C"'s Jan. -+ _M_data->_M_amonth01 = "Jan"; -+ _M_data->_M_amonth02 = "Feb"; -+ _M_data->_M_amonth03 = "Mar"; -+ _M_data->_M_amonth04 = "Apr"; -+ _M_data->_M_amonth05 = "May"; -+ _M_data->_M_amonth06 = "Jun"; -+ _M_data->_M_amonth07 = "Jul"; -+ _M_data->_M_amonth08 = "Aug"; -+ _M_data->_M_amonth09 = "Sep"; -+ _M_data->_M_amonth10 = "Oct"; -+ _M_data->_M_amonth11 = "Nov"; -+ _M_data->_M_amonth12 = "Dec"; -+ } -+ else -+ { -+ _M_c_locale_timepunct = _S_clone_c_locale(__cloc); -+ -+ _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc); -+ _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc); -+ _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc); -+ _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc); -+ _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc); -+ _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT, -+ __cloc); -+ _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc); -+ _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc); -+ _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc); -+ -+ // Day names, starting with "C"'s Sunday. -+ _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc); -+ _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc); -+ _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc); -+ _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc); -+ _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc); -+ _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc); -+ _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc); -+ -+ // Abbreviated day names, starting with "C"'s Sun. -+ _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc); -+ _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc); -+ _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc); -+ _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc); -+ _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc); -+ _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc); -+ _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc); -+ -+ // Month names, starting with "C"'s January. -+ _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc); -+ _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc); -+ _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc); -+ _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc); -+ _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc); -+ _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc); -+ _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc); -+ _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc); -+ _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc); -+ _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc); -+ _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc); -+ _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc); -+ -+ // Abbreviated month names, starting with "C"'s Jan. -+ _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc); -+ _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc); -+ _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc); -+ _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc); -+ _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc); -+ _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc); -+ _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc); -+ _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc); -+ _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc); -+ _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc); -+ _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc); -+ _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc); -+ } -+ } -+ -+#ifdef _GLIBCXX_USE_WCHAR_T -+ template<> -+ void -+ __timepunct:: -+ _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format, -+ const tm* __tm) const -+ { -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct); -+ const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm, -+ _M_c_locale_timepunct); -+#else -+ char* __old = strdup(setlocale(LC_ALL, NULL)); -+ setlocale(LC_ALL, _M_name_timepunct); -+ const size_t __len = wcsftime(__s, __maxlen, __format, __tm); -+ setlocale(LC_ALL, __old); -+ free(__old); -+#endif -+ // Make sure __s is null terminated. -+ if (__len == 0) -+ __s[0] = L'\0'; -+ } -+ -+ template<> -+ void -+ __timepunct::_M_initialize_timepunct(__c_locale __cloc) -+ { -+ if (!_M_data) -+ _M_data = new __timepunct_cache; -+ -+#warning wide time stuff -+// if (!__cloc) -+ { -+ // "C" locale -+ _M_c_locale_timepunct = _S_get_c_locale(); -+ -+ _M_data->_M_date_format = L"%m/%d/%y"; -+ _M_data->_M_date_era_format = L"%m/%d/%y"; -+ _M_data->_M_time_format = L"%H:%M:%S"; -+ _M_data->_M_time_era_format = L"%H:%M:%S"; -+ _M_data->_M_date_time_format = L""; -+ _M_data->_M_date_time_era_format = L""; -+ _M_data->_M_am = L"AM"; -+ _M_data->_M_pm = L"PM"; -+ _M_data->_M_am_pm_format = L""; -+ -+ // Day names, starting with "C"'s Sunday. -+ _M_data->_M_day1 = L"Sunday"; -+ _M_data->_M_day2 = L"Monday"; -+ _M_data->_M_day3 = L"Tuesday"; -+ _M_data->_M_day4 = L"Wednesday"; -+ _M_data->_M_day5 = L"Thursday"; -+ _M_data->_M_day6 = L"Friday"; -+ _M_data->_M_day7 = L"Saturday"; -+ -+ // Abbreviated day names, starting with "C"'s Sun. -+ _M_data->_M_aday1 = L"Sun"; -+ _M_data->_M_aday2 = L"Mon"; -+ _M_data->_M_aday3 = L"Tue"; -+ _M_data->_M_aday4 = L"Wed"; -+ _M_data->_M_aday5 = L"Thu"; -+ _M_data->_M_aday6 = L"Fri"; -+ _M_data->_M_aday7 = L"Sat"; -+ -+ // Month names, starting with "C"'s January. -+ _M_data->_M_month01 = L"January"; -+ _M_data->_M_month02 = L"February"; -+ _M_data->_M_month03 = L"March"; -+ _M_data->_M_month04 = L"April"; -+ _M_data->_M_month05 = L"May"; -+ _M_data->_M_month06 = L"June"; -+ _M_data->_M_month07 = L"July"; -+ _M_data->_M_month08 = L"August"; -+ _M_data->_M_month09 = L"September"; -+ _M_data->_M_month10 = L"October"; -+ _M_data->_M_month11 = L"November"; -+ _M_data->_M_month12 = L"December"; -+ -+ // Abbreviated month names, starting with "C"'s Jan. -+ _M_data->_M_amonth01 = L"Jan"; -+ _M_data->_M_amonth02 = L"Feb"; -+ _M_data->_M_amonth03 = L"Mar"; -+ _M_data->_M_amonth04 = L"Apr"; -+ _M_data->_M_amonth05 = L"May"; -+ _M_data->_M_amonth06 = L"Jun"; -+ _M_data->_M_amonth07 = L"Jul"; -+ _M_data->_M_amonth08 = L"Aug"; -+ _M_data->_M_amonth09 = L"Sep"; -+ _M_data->_M_amonth10 = L"Oct"; -+ _M_data->_M_amonth11 = L"Nov"; -+ _M_data->_M_amonth12 = L"Dec"; -+ } -+#if 0 -+ else -+ { -+ _M_c_locale_timepunct = _S_clone_c_locale(__cloc); -+ -+ union { char *__s; wchar_t *__w; } __u; -+ -+ __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc); -+ _M_data->_M_date_format = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc); -+ _M_data->_M_date_era_format = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc); -+ _M_data->_M_time_format = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc); -+ _M_data->_M_time_era_format = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc); -+ _M_data->_M_date_time_format = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc); -+ _M_data->_M_date_time_era_format = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc); -+ _M_data->_M_am = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc); -+ _M_data->_M_pm = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc); -+ _M_data->_M_am_pm_format = __u.__w; -+ -+ // Day names, starting with "C"'s Sunday. -+ __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc); -+ _M_data->_M_day1 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc); -+ _M_data->_M_day2 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc); -+ _M_data->_M_day3 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc); -+ _M_data->_M_day4 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc); -+ _M_data->_M_day5 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc); -+ _M_data->_M_day6 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc); -+ _M_data->_M_day7 = __u.__w; -+ -+ // Abbreviated day names, starting with "C"'s Sun. -+ __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc); -+ _M_data->_M_aday1 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc); -+ _M_data->_M_aday2 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc); -+ _M_data->_M_aday3 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc); -+ _M_data->_M_aday4 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc); -+ _M_data->_M_aday5 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc); -+ _M_data->_M_aday6 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc); -+ _M_data->_M_aday7 = __u.__w; -+ -+ // Month names, starting with "C"'s January. -+ __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc); -+ _M_data->_M_month01 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc); -+ _M_data->_M_month02 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc); -+ _M_data->_M_month03 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc); -+ _M_data->_M_month04 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc); -+ _M_data->_M_month05 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc); -+ _M_data->_M_month06 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc); -+ _M_data->_M_month07 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc); -+ _M_data->_M_month08 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc); -+ _M_data->_M_month09 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc); -+ _M_data->_M_month10 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc); -+ _M_data->_M_month11 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc); -+ _M_data->_M_month12 = __u.__w; -+ -+ // Abbreviated month names, starting with "C"'s Jan. -+ __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc); -+ _M_data->_M_amonth01 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc); -+ _M_data->_M_amonth02 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc); -+ _M_data->_M_amonth03 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc); -+ _M_data->_M_amonth04 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc); -+ _M_data->_M_amonth05 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc); -+ _M_data->_M_amonth06 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc); -+ _M_data->_M_amonth07 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc); -+ _M_data->_M_amonth08 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc); -+ _M_data->_M_amonth09 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc); -+ _M_data->_M_amonth10 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc); -+ _M_data->_M_amonth11 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc); -+ _M_data->_M_amonth12 = __u.__w; -+ } -+#endif // 0 -+ } -+#endif -+} -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.h ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.h 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.h 2008-06-10 14:45:35.000000000 +0200 -@@ -0,0 +1,68 @@ -+// std::time_get, std::time_put implementation, GNU version -*- C++ -*- -+ -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 2, or (at your option) -+// any later version. -+ -+// This 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 General Public License for more details. -+ -+// You should have received a copy of the GNU General Public License along -+// with this library; see the file COPYING. If not, write to the Free -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -+// USA. -+ -+// As a special exception, you may use this file as part of a free software -+// library without restriction. Specifically, if other files instantiate -+// templates or use macros or inline functions from this file, or you compile -+// this file and link it with other files to produce an executable, this -+// file does not by itself cause the resulting executable to be covered by -+// the GNU General Public License. This exception does not however -+// invalidate any other reasons why the executable file might be covered by -+// the GNU General Public License. -+ -+// -+// ISO C++ 14882: 22.2.5.1.2 - time_get functions -+// ISO C++ 14882: 22.2.5.3.2 - time_put functions -+// -+ -+// Written by Benjamin Kosnik -+ -+ template -+ __timepunct<_CharT>::__timepunct(size_t __refs) -+ : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), -+ _M_name_timepunct(_S_get_c_name()) -+ { _M_initialize_timepunct(); } -+ -+ template -+ __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) -+ : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), -+ _M_name_timepunct(_S_get_c_name()) -+ { _M_initialize_timepunct(); } -+ -+ template -+ __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s, -+ size_t __refs) -+ : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), -+ _M_name_timepunct(__s) -+ { -+ char* __tmp = new char[std::strlen(__s) + 1]; -+ std::strcpy(__tmp, __s); -+ _M_name_timepunct = __tmp; -+ _M_initialize_timepunct(__cloc); -+ } -+ -+ template -+ __timepunct<_CharT>::~__timepunct() -+ { -+ if (_M_name_timepunct != _S_get_c_name()) -+ delete [] _M_name_timepunct; -+ delete _M_data; -+ _S_destroy_c_locale(_M_c_locale_timepunct); -+ } -diff -durN gcc-4.3.0.orig/libstdc++-v3/configure gcc-4.3.0/libstdc++-v3/configure ---- gcc-4.3.0.orig/libstdc++-v3/configure 2008-02-29 01:00:39.000000000 +0100 -+++ gcc-4.3.0/libstdc++-v3/configure 2008-06-10 14:45:35.000000000 +0200 -@@ -14001,7 +14001,7 @@ - enableval="$enable_clocale" - - case "$enableval" in -- generic|gnu|ieee_1003.1-2001|yes|no|auto) ;; -+ generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto) ;; - *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable clocale" >&5 - echo "$as_me: error: Unknown argument to enable/disable clocale" >&2;} - { (exit 1); exit 1; }; } ;; -@@ -14034,6 +14034,9 @@ - # Default to "generic". - if test $enable_clocale_flag = auto; then - case ${target_os} in -+ linux-uclibc*) -+ enable_clocale_flag=uclibc -+ ;; - linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu) - enable_clocale_flag=gnu - ;; -@@ -14422,6 +14425,76 @@ - CTIME_CC=config/locale/generic/time_members.cc - CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h - ;; -+ uclibc) -+ echo "$as_me:$LINENO: result: uclibc" >&5 -+echo "${ECHO_T}uclibc" >&6 -+ -+ # Declare intention to use gettext, and add support for specific -+ # languages. -+ # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT -+ ALL_LINGUAS="de fr" -+ -+ # Don't call AM-GNU-GETTEXT here. Instead, assume glibc. -+ # Extract the first word of "msgfmt", so it can be a program name with args. -+set dummy msgfmt; ac_word=$2 -+echo "$as_me:$LINENO: checking for $ac_word" >&5 -+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -+if test "${ac_cv_prog_check_msgfmt+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ if test -n "$check_msgfmt"; then -+ ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test. -+else -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -+ ac_cv_prog_check_msgfmt="yes" -+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+done -+ -+ test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no" -+fi -+fi -+check_msgfmt=$ac_cv_prog_check_msgfmt -+if test -n "$check_msgfmt"; then -+ echo "$as_me:$LINENO: result: $check_msgfmt" >&5 -+echo "${ECHO_T}$check_msgfmt" >&6 -+else -+ echo "$as_me:$LINENO: result: no" >&5 -+echo "${ECHO_T}no" >&6 -+fi -+ -+ if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then -+ USE_NLS=yes -+ fi -+ # Export the build objects. -+ for ling in $ALL_LINGUAS; do \ -+ glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \ -+ glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \ -+ done -+ -+ -+ -+ CLOCALE_H=config/locale/uclibc/c_locale.h -+ CLOCALE_CC=config/locale/uclibc/c_locale.cc -+ CCODECVT_CC=config/locale/uclibc/codecvt_members.cc -+ CCOLLATE_CC=config/locale/uclibc/collate_members.cc -+ CCTYPE_CC=config/locale/uclibc/ctype_members.cc -+ CMESSAGES_H=config/locale/uclibc/messages_members.h -+ CMESSAGES_CC=config/locale/uclibc/messages_members.cc -+ CMONEY_CC=config/locale/uclibc/monetary_members.cc -+ CNUMERIC_CC=config/locale/uclibc/numeric_members.cc -+ CTIME_H=config/locale/uclibc/time_members.h -+ CTIME_CC=config/locale/uclibc/time_members.cc -+ CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h -+ ;; - esac - - # This is where the testsuite looks for locale catalogs, using the -diff -durN gcc-4.3.0.orig/libstdc++-v3/include/c_compatibility/wchar.h gcc-4.3.0/libstdc++-v3/include/c_compatibility/wchar.h ---- gcc-4.3.0.orig/libstdc++-v3/include/c_compatibility/wchar.h 2007-03-04 23:59:49.000000000 +0100 -+++ gcc-4.3.0/libstdc++-v3/include/c_compatibility/wchar.h 2008-06-10 14:45:35.000000000 +0200 -@@ -106,7 +106,9 @@ - using std::wmemcpy; - using std::wmemmove; - using std::wmemset; -+#if _GLIBCXX_HAVE_WCSFTIME - using std::wcsftime; -+#endif - - #if _GLIBCXX_USE_C99 - using std::wcstold; diff --git a/patches/gcc/4.3.0/650-uclibc-locale.patch b/patches/gcc/4.3.0/650-uclibc-locale.patch new file mode 100644 index 0000000..60e4b90 --- /dev/null +++ b/patches/gcc/4.3.0/650-uclibc-locale.patch @@ -0,0 +1,2794 @@ +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_200-uclibc-locale.patch +diff -durN gcc-4.3.0.orig/libstdc++-v3/acinclude.m4 gcc-4.3.0/libstdc++-v3/acinclude.m4 +--- gcc-4.3.0.orig/libstdc++-v3/acinclude.m4 2008-02-29 01:00:39.000000000 +0100 ++++ gcc-4.3.0/libstdc++-v3/acinclude.m4 2008-06-10 14:45:35.000000000 +0200 +@@ -1349,7 +1349,7 @@ + AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [ + GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@], + [use MODEL for target locale package], +- [permit generic|gnu|ieee_1003.1-2001|yes|no|auto]) ++ [permit generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto]) + + # Deal with gettext issues. Default to not using it (=no) until we detect + # support for it later. Let the user turn it off via --e/d, but let that +@@ -1370,6 +1370,9 @@ + # Default to "generic". + if test $enable_clocale_flag = auto; then + case ${target_os} in ++ *-uclibc*) ++ enable_clocale_flag=uclibc ++ ;; + linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu) + enable_clocale_flag=gnu + ;; +@@ -1541,6 +1544,40 @@ + CTIME_CC=config/locale/generic/time_members.cc + CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h + ;; ++ uclibc) ++ AC_MSG_RESULT(uclibc) ++ ++ # Declare intention to use gettext, and add support for specific ++ # languages. ++ # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT ++ ALL_LINGUAS="de fr" ++ ++ # Don't call AM-GNU-GETTEXT here. Instead, assume glibc. ++ AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no) ++ if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then ++ USE_NLS=yes ++ fi ++ # Export the build objects. ++ for ling in $ALL_LINGUAS; do \ ++ glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \ ++ glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \ ++ done ++ AC_SUBST(glibcxx_MOFILES) ++ AC_SUBST(glibcxx_POFILES) ++ ++ CLOCALE_H=config/locale/uclibc/c_locale.h ++ CLOCALE_CC=config/locale/uclibc/c_locale.cc ++ CCODECVT_CC=config/locale/uclibc/codecvt_members.cc ++ CCOLLATE_CC=config/locale/uclibc/collate_members.cc ++ CCTYPE_CC=config/locale/uclibc/ctype_members.cc ++ CMESSAGES_H=config/locale/uclibc/messages_members.h ++ CMESSAGES_CC=config/locale/uclibc/messages_members.cc ++ CMONEY_CC=config/locale/uclibc/monetary_members.cc ++ CNUMERIC_CC=config/locale/uclibc/numeric_members.cc ++ CTIME_H=config/locale/uclibc/time_members.h ++ CTIME_CC=config/locale/uclibc/time_members.cc ++ CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h ++ ;; + esac + + # This is where the testsuite looks for locale catalogs, using the +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 1970-01-01 01:00:00.000000000 +0100 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2008-06-10 14:45:35.000000000 +0200 +@@ -0,0 +1,63 @@ ++// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*- ++ ++// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library is free ++// software; you can redistribute it and/or modify it under the ++// terms of the GNU General Public License as published by the ++// Free Software Foundation; either version 2, or (at your option) ++// any later version. ++ ++// This 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 General Public License for more details. ++ ++// You should have received a copy of the GNU General Public License along ++// with this library; see the file COPYING. If not, write to the Free ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, ++// USA. ++ ++// As a special exception, you may use this file as part of a free software ++// library without restriction. Specifically, if other files instantiate ++// templates or use macros or inline functions from this file, or you compile ++// this file and link it with other files to produce an executable, this ++// file does not by itself cause the resulting executable to be covered by ++// the GNU General Public License. This exception does not however ++// invalidate any other reasons why the executable file might be covered by ++// the GNU General Public License. ++ ++// Written by Jakub Jelinek ++ ++#include ++#include ++ ++#ifdef __UCLIBC_MJN3_ONLY__ ++#warning clean this up ++#endif ++ ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ ++extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l; ++extern "C" __typeof(strcoll_l) __strcoll_l; ++extern "C" __typeof(strftime_l) __strftime_l; ++extern "C" __typeof(strtod_l) __strtod_l; ++extern "C" __typeof(strtof_l) __strtof_l; ++extern "C" __typeof(strtold_l) __strtold_l; ++extern "C" __typeof(strxfrm_l) __strxfrm_l; ++extern "C" __typeof(newlocale) __newlocale; ++extern "C" __typeof(freelocale) __freelocale; ++extern "C" __typeof(duplocale) __duplocale; ++extern "C" __typeof(uselocale) __uselocale; ++ ++#ifdef _GLIBCXX_USE_WCHAR_T ++extern "C" __typeof(iswctype_l) __iswctype_l; ++extern "C" __typeof(towlower_l) __towlower_l; ++extern "C" __typeof(towupper_l) __towupper_l; ++extern "C" __typeof(wcscoll_l) __wcscoll_l; ++extern "C" __typeof(wcsftime_l) __wcsftime_l; ++extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l; ++extern "C" __typeof(wctype_l) __wctype_l; ++#endif ++ ++#endif // GLIBC 2.3 and later +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.cc +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc 1970-01-01 01:00:00.000000000 +0100 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-06-10 14:45:35.000000000 +0200 +@@ -0,0 +1,160 @@ ++// Wrapper for underlying C-language localization -*- C++ -*- ++ ++// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library is free ++// software; you can redistribute it and/or modify it under the ++// terms of the GNU General Public License as published by the ++// Free Software Foundation; either version 2, or (at your option) ++// any later version. ++ ++// This 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 General Public License for more details. ++ ++// You should have received a copy of the GNU General Public License along ++// with this library; see the file COPYING. If not, write to the Free ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, ++// USA. ++ ++// As a special exception, you may use this file as part of a free software ++// library without restriction. Specifically, if other files instantiate ++// templates or use macros or inline functions from this file, or you compile ++// this file and link it with other files to produce an executable, this ++// file does not by itself cause the resulting executable to be covered by ++// the GNU General Public License. This exception does not however ++// invalidate any other reasons why the executable file might be covered by ++// the GNU General Public License. ++ ++// ++// ISO C++ 14882: 22.8 Standard locale categories. ++// ++ ++// Written by Benjamin Kosnik ++ ++#include // For errno ++#include ++#include ++#include ++#include ++ ++#ifndef __UCLIBC_HAS_XLOCALE__ ++#define __strtol_l(S, E, B, L) strtol((S), (E), (B)) ++#define __strtoul_l(S, E, B, L) strtoul((S), (E), (B)) ++#define __strtoll_l(S, E, B, L) strtoll((S), (E), (B)) ++#define __strtoull_l(S, E, B, L) strtoull((S), (E), (B)) ++#define __strtof_l(S, E, L) strtof((S), (E)) ++#define __strtod_l(S, E, L) strtod((S), (E)) ++#define __strtold_l(S, E, L) strtold((S), (E)) ++#warning should dummy __newlocale check for C|POSIX ? ++#define __newlocale(a, b, c) NULL ++#define __freelocale(a) ((void)0) ++#define __duplocale(a) __c_locale() ++#endif ++ ++namespace std ++{ ++ template<> ++ void ++ __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, ++ const __c_locale& __cloc) ++ { ++ if (!(__err & ios_base::failbit)) ++ { ++ char* __sanity; ++ errno = 0; ++ float __f = __strtof_l(__s, &__sanity, __cloc); ++ if (__sanity != __s && errno != ERANGE) ++ __v = __f; ++ else ++ __err |= ios_base::failbit; ++ } ++ } ++ ++ template<> ++ void ++ __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, ++ const __c_locale& __cloc) ++ { ++ if (!(__err & ios_base::failbit)) ++ { ++ char* __sanity; ++ errno = 0; ++ double __d = __strtod_l(__s, &__sanity, __cloc); ++ if (__sanity != __s && errno != ERANGE) ++ __v = __d; ++ else ++ __err |= ios_base::failbit; ++ } ++ } ++ ++ template<> ++ void ++ __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err, ++ const __c_locale& __cloc) ++ { ++ if (!(__err & ios_base::failbit)) ++ { ++ char* __sanity; ++ errno = 0; ++ long double __ld = __strtold_l(__s, &__sanity, __cloc); ++ if (__sanity != __s && errno != ERANGE) ++ __v = __ld; ++ else ++ __err |= ios_base::failbit; ++ } ++ } ++ ++ void ++ locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s, ++ __c_locale __old) ++ { ++ __cloc = __newlocale(1 << LC_ALL, __s, __old); ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ if (!__cloc) ++ { ++ // This named locale is not supported by the underlying OS. ++ __throw_runtime_error(__N("locale::facet::_S_create_c_locale " ++ "name not valid")); ++ } ++#endif ++ } ++ ++ void ++ locale::facet::_S_destroy_c_locale(__c_locale& __cloc) ++ { ++ if (_S_get_c_locale() != __cloc) ++ __freelocale(__cloc); ++ } ++ ++ __c_locale ++ locale::facet::_S_clone_c_locale(__c_locale& __cloc) ++ { return __duplocale(__cloc); } ++} // namespace std ++ ++namespace __gnu_cxx ++{ ++ const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] = ++ { ++ "LC_CTYPE", ++ "LC_NUMERIC", ++ "LC_TIME", ++ "LC_COLLATE", ++ "LC_MONETARY", ++ "LC_MESSAGES", ++#if _GLIBCXX_NUM_CATEGORIES != 0 ++ "LC_PAPER", ++ "LC_NAME", ++ "LC_ADDRESS", ++ "LC_TELEPHONE", ++ "LC_MEASUREMENT", ++ "LC_IDENTIFICATION" ++#endif ++ }; ++} ++ ++namespace std ++{ ++ const char* const* const locale::_S_categories = __gnu_cxx::category_names; ++} // namespace std +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.h +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.h 1970-01-01 01:00:00.000000000 +0100 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-06-10 14:45:35.000000000 +0200 +@@ -0,0 +1,117 @@ ++// Wrapper for underlying C-language localization -*- C++ -*- ++ ++// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library is free ++// software; you can redistribute it and/or modify it under the ++// terms of the GNU General Public License as published by the ++// Free Software Foundation; either version 2, or (at your option) ++// any later version. ++ ++// This 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 General Public License for more details. ++ ++// You should have received a copy of the GNU General Public License along ++// with this library; see the file COPYING. If not, write to the Free ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, ++// USA. ++ ++// As a special exception, you may use this file as part of a free software ++// library without restriction. Specifically, if other files instantiate ++// templates or use macros or inline functions from this file, or you compile ++// this file and link it with other files to produce an executable, this ++// file does not by itself cause the resulting executable to be covered by ++// the GNU General Public License. This exception does not however ++// invalidate any other reasons why the executable file might be covered by ++// the GNU General Public License. ++ ++// ++// ISO C++ 14882: 22.8 Standard locale categories. ++// ++ ++// Written by Benjamin Kosnik ++ ++#ifndef _C_LOCALE_H ++#define _C_LOCALE_H 1 ++ ++#pragma GCC system_header ++ ++#include // get std::strlen ++#include // get std::snprintf or std::sprintf ++#include ++#include // For codecvt ++#ifdef __UCLIBC_MJN3_ONLY__ ++#warning fix this ++#endif ++#ifdef __UCLIBC_HAS_LOCALE__ ++#include // For codecvt using iconv, iconv_t ++#endif ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ ++#include // For messages ++#endif ++ ++#ifdef __UCLIBC_MJN3_ONLY__ ++#warning what is _GLIBCXX_C_LOCALE_GNU for ++#endif ++#define _GLIBCXX_C_LOCALE_GNU 1 ++ ++#ifdef __UCLIBC_MJN3_ONLY__ ++#warning fix categories ++#endif ++// #define _GLIBCXX_NUM_CATEGORIES 6 ++#define _GLIBCXX_NUM_CATEGORIES 0 ++ ++#ifdef __UCLIBC_HAS_XLOCALE__ ++namespace __gnu_cxx ++{ ++ extern "C" __typeof(uselocale) __uselocale; ++} ++#endif ++ ++namespace std ++{ ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ typedef __locale_t __c_locale; ++#else ++ typedef int* __c_locale; ++#endif ++ ++ // Convert numeric value of type _Tv to string and return length of ++ // string. If snprintf is available use it, otherwise fall back to ++ // the unsafe sprintf which, in general, can be dangerous and should ++ // be avoided. ++ template ++ int ++ __convert_from_v(char* __out, ++ const int __size __attribute__ ((__unused__)), ++ const char* __fmt, ++#ifdef __UCLIBC_HAS_XCLOCALE__ ++ _Tv __v, const __c_locale& __cloc, int __prec) ++ { ++ __c_locale __old = __gnu_cxx::__uselocale(__cloc); ++#else ++ _Tv __v, const __c_locale&, int __prec) ++ { ++# ifdef __UCLIBC_HAS_LOCALE__ ++ char* __old = std::setlocale(LC_ALL, NULL); ++ char* __sav = new char[std::strlen(__old) + 1]; ++ std::strcpy(__sav, __old); ++ std::setlocale(LC_ALL, "C"); ++# endif ++#endif ++ ++ const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v); ++ ++#ifdef __UCLIBC_HAS_XCLOCALE__ ++ __gnu_cxx::__uselocale(__old); ++#elif defined __UCLIBC_HAS_LOCALE__ ++ std::setlocale(LC_ALL, __sav); ++ delete [] __sav; ++#endif ++ return __ret; ++ } ++} ++ ++#endif +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/codecvt_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/codecvt_members.cc +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/codecvt_members.cc 1970-01-01 01:00:00.000000000 +0100 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/codecvt_members.cc 2008-06-10 14:45:35.000000000 +0200 +@@ -0,0 +1,306 @@ ++// std::codecvt implementation details, GNU version -*- C++ -*- ++ ++// Copyright (C) 2002, 2003 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library is free ++// software; you can redistribute it and/or modify it under the ++// terms of the GNU General Public License as published by the ++// Free Software Foundation; either version 2, or (at your option) ++// any later version. ++ ++// This 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 General Public License for more details. ++ ++// You should have received a copy of the GNU General Public License along ++// with this library; see the file COPYING. If not, write to the Free ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, ++// USA. ++ ++// As a special exception, you may use this file as part of a free software ++// library without restriction. Specifically, if other files instantiate ++// templates or use macros or inline functions from this file, or you compile ++// this file and link it with other files to produce an executable, this ++// file does not by itself cause the resulting executable to be covered by ++// the GNU General Public License. This exception does not however ++// invalidate any other reasons why the executable file might be covered by ++// the GNU General Public License. ++ ++// ++// ISO C++ 14882: 22.2.1.5 - Template class codecvt ++// ++ ++// Written by Benjamin Kosnik ++ ++#include ++#include ++ ++namespace std ++{ ++ // Specializations. ++#ifdef _GLIBCXX_USE_WCHAR_T ++ codecvt_base::result ++ codecvt:: ++ do_out(state_type& __state, const intern_type* __from, ++ const intern_type* __from_end, const intern_type*& __from_next, ++ extern_type* __to, extern_type* __to_end, ++ extern_type*& __to_next) const ++ { ++ result __ret = ok; ++ state_type __tmp_state(__state); ++ ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __c_locale __old = __uselocale(_M_c_locale_codecvt); ++#endif ++ ++ // wcsnrtombs is *very* fast but stops if encounters NUL characters: ++ // in case we fall back to wcrtomb and then continue, in a loop. ++ // NB: wcsnrtombs is a GNU extension ++ for (__from_next = __from, __to_next = __to; ++ __from_next < __from_end && __to_next < __to_end ++ && __ret == ok;) ++ { ++ const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0', ++ __from_end - __from_next); ++ if (!__from_chunk_end) ++ __from_chunk_end = __from_end; ++ ++ __from = __from_next; ++ const size_t __conv = wcsnrtombs(__to_next, &__from_next, ++ __from_chunk_end - __from_next, ++ __to_end - __to_next, &__state); ++ if (__conv == static_cast(-1)) ++ { ++ // In case of error, in order to stop at the exact place we ++ // have to start again from the beginning with a series of ++ // wcrtomb. ++ for (; __from < __from_next; ++__from) ++ __to_next += wcrtomb(__to_next, *__from, &__tmp_state); ++ __state = __tmp_state; ++ __ret = error; ++ } ++ else if (__from_next && __from_next < __from_chunk_end) ++ { ++ __to_next += __conv; ++ __ret = partial; ++ } ++ else ++ { ++ __from_next = __from_chunk_end; ++ __to_next += __conv; ++ } ++ ++ if (__from_next < __from_end && __ret == ok) ++ { ++ extern_type __buf[MB_LEN_MAX]; ++ __tmp_state = __state; ++ const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state); ++ if (__conv > static_cast(__to_end - __to_next)) ++ __ret = partial; ++ else ++ { ++ memcpy(__to_next, __buf, __conv); ++ __state = __tmp_state; ++ __to_next += __conv; ++ ++__from_next; ++ } ++ } ++ } ++ ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __uselocale(__old); ++#endif ++ ++ return __ret; ++ } ++ ++ codecvt_base::result ++ codecvt:: ++ do_in(state_type& __state, const extern_type* __from, ++ const extern_type* __from_end, const extern_type*& __from_next, ++ intern_type* __to, intern_type* __to_end, ++ intern_type*& __to_next) const ++ { ++ result __ret = ok; ++ state_type __tmp_state(__state); ++ ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __c_locale __old = __uselocale(_M_c_locale_codecvt); ++#endif ++ ++ // mbsnrtowcs is *very* fast but stops if encounters NUL characters: ++ // in case we store a L'\0' and then continue, in a loop. ++ // NB: mbsnrtowcs is a GNU extension ++ for (__from_next = __from, __to_next = __to; ++ __from_next < __from_end && __to_next < __to_end ++ && __ret == ok;) ++ { ++ const extern_type* __from_chunk_end; ++ __from_chunk_end = static_cast(memchr(__from_next, '\0', ++ __from_end ++ - __from_next)); ++ if (!__from_chunk_end) ++ __from_chunk_end = __from_end; ++ ++ __from = __from_next; ++ size_t __conv = mbsnrtowcs(__to_next, &__from_next, ++ __from_chunk_end - __from_next, ++ __to_end - __to_next, &__state); ++ if (__conv == static_cast(-1)) ++ { ++ // In case of error, in order to stop at the exact place we ++ // have to start again from the beginning with a series of ++ // mbrtowc. ++ for (;; ++__to_next, __from += __conv) ++ { ++ __conv = mbrtowc(__to_next, __from, __from_end - __from, ++ &__tmp_state); ++ if (__conv == static_cast(-1) ++ || __conv == static_cast(-2)) ++ break; ++ } ++ __from_next = __from; ++ __state = __tmp_state; ++ __ret = error; ++ } ++ else if (__from_next && __from_next < __from_chunk_end) ++ { ++ // It is unclear what to return in this case (see DR 382). ++ __to_next += __conv; ++ __ret = partial; ++ } ++ else ++ { ++ __from_next = __from_chunk_end; ++ __to_next += __conv; ++ } ++ ++ if (__from_next < __from_end && __ret == ok) ++ { ++ if (__to_next < __to_end) ++ { ++ // XXX Probably wrong for stateful encodings ++ __tmp_state = __state; ++ ++__from_next; ++ *__to_next++ = L'\0'; ++ } ++ else ++ __ret = partial; ++ } ++ } ++ ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __uselocale(__old); ++#endif ++ ++ return __ret; ++ } ++ ++ int ++ codecvt:: ++ do_encoding() const throw() ++ { ++ // XXX This implementation assumes that the encoding is ++ // stateless and is either single-byte or variable-width. ++ int __ret = 0; ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __c_locale __old = __uselocale(_M_c_locale_codecvt); ++#endif ++ if (MB_CUR_MAX == 1) ++ __ret = 1; ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __uselocale(__old); ++#endif ++ return __ret; ++ } ++ ++ int ++ codecvt:: ++ do_max_length() const throw() ++ { ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __c_locale __old = __uselocale(_M_c_locale_codecvt); ++#endif ++ // XXX Probably wrong for stateful encodings. ++ int __ret = MB_CUR_MAX; ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __uselocale(__old); ++#endif ++ return __ret; ++ } ++ ++ int ++ codecvt:: ++ do_length(state_type& __state, const extern_type* __from, ++ const extern_type* __end, size_t __max) const ++ { ++ int __ret = 0; ++ state_type __tmp_state(__state); ++ ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __c_locale __old = __uselocale(_M_c_locale_codecvt); ++#endif ++ ++ // mbsnrtowcs is *very* fast but stops if encounters NUL characters: ++ // in case we advance past it and then continue, in a loop. ++ // NB: mbsnrtowcs is a GNU extension ++ ++ // A dummy internal buffer is needed in order for mbsnrtocws to consider ++ // its fourth parameter (it wouldn't with NULL as first parameter). ++ wchar_t* __to = static_cast(__builtin_alloca(sizeof(wchar_t) ++ * __max)); ++ while (__from < __end && __max) ++ { ++ const extern_type* __from_chunk_end; ++ __from_chunk_end = static_cast(memchr(__from, '\0', ++ __end ++ - __from)); ++ if (!__from_chunk_end) ++ __from_chunk_end = __end; ++ ++ const extern_type* __tmp_from = __from; ++ size_t __conv = mbsnrtowcs(__to, &__from, ++ __from_chunk_end - __from, ++ __max, &__state); ++ if (__conv == static_cast(-1)) ++ { ++ // In case of error, in order to stop at the exact place we ++ // have to start again from the beginning with a series of ++ // mbrtowc. ++ for (__from = __tmp_from;; __from += __conv) ++ { ++ __conv = mbrtowc(NULL, __from, __end - __from, ++ &__tmp_state); ++ if (__conv == static_cast(-1) ++ || __conv == static_cast(-2)) ++ break; ++ } ++ __state = __tmp_state; ++ __ret += __from - __tmp_from; ++ break; ++ } ++ if (!__from) ++ __from = __from_chunk_end; ++ ++ __ret += __from - __tmp_from; ++ __max -= __conv; ++ ++ if (__from < __end && __max) ++ { ++ // XXX Probably wrong for stateful encodings ++ __tmp_state = __state; ++ ++__from; ++ ++__ret; ++ --__max; ++ } ++ } ++ ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __uselocale(__old); ++#endif ++ ++ return __ret; ++ } ++#endif ++} +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/collate_members.cc +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc 1970-01-01 01:00:00.000000000 +0100 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/collate_members.cc 2008-06-10 14:45:35.000000000 +0200 +@@ -0,0 +1,80 @@ ++// std::collate implementation details, GNU version -*- C++ -*- ++ ++// Copyright (C) 2001, 2002 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library is free ++// software; you can redistribute it and/or modify it under the ++// terms of the GNU General Public License as published by the ++// Free Software Foundation; either version 2, or (at your option) ++// any later version. ++ ++// This 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 General Public License for more details. ++ ++// You should have received a copy of the GNU General Public License along ++// with this library; see the file COPYING. If not, write to the Free ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, ++// USA. ++ ++// As a special exception, you may use this file as part of a free software ++// library without restriction. Specifically, if other files instantiate ++// templates or use macros or inline functions from this file, or you compile ++// this file and link it with other files to produce an executable, this ++// file does not by itself cause the resulting executable to be covered by ++// the GNU General Public License. This exception does not however ++// invalidate any other reasons why the executable file might be covered by ++// the GNU General Public License. ++ ++// ++// ISO C++ 14882: 22.2.4.1.2 collate virtual functions ++// ++ ++// Written by Benjamin Kosnik ++ ++#include ++#include ++ ++#ifndef __UCLIBC_HAS_XLOCALE__ ++#define __strcoll_l(S1, S2, L) strcoll((S1), (S2)) ++#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N)) ++#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2)) ++#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N)) ++#endif ++ ++namespace std ++{ ++ // These are basically extensions to char_traits, and perhaps should ++ // be put there instead of here. ++ template<> ++ int ++ collate::_M_compare(const char* __one, const char* __two) const ++ { ++ int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate); ++ return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0); ++ } ++ ++ template<> ++ size_t ++ collate::_M_transform(char* __to, const char* __from, ++ size_t __n) const ++ { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); } ++ ++#ifdef _GLIBCXX_USE_WCHAR_T ++ template<> ++ int ++ collate::_M_compare(const wchar_t* __one, ++ const wchar_t* __two) const ++ { ++ int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate); ++ return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0); ++ } ++ ++ template<> ++ size_t ++ collate::_M_transform(wchar_t* __to, const wchar_t* __from, ++ size_t __n) const ++ { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); } ++#endif ++} +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc 1970-01-01 01:00:00.000000000 +0100 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-06-10 14:45:35.000000000 +0200 +@@ -0,0 +1,300 @@ ++// std::ctype implementation details, GNU version -*- C++ -*- ++ ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library is free ++// software; you can redistribute it and/or modify it under the ++// terms of the GNU General Public License as published by the ++// Free Software Foundation; either version 2, or (at your option) ++// any later version. ++ ++// This 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 General Public License for more details. ++ ++// You should have received a copy of the GNU General Public License along ++// with this library; see the file COPYING. If not, write to the Free ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, ++// USA. ++ ++// As a special exception, you may use this file as part of a free software ++// library without restriction. Specifically, if other files instantiate ++// templates or use macros or inline functions from this file, or you compile ++// this file and link it with other files to produce an executable, this ++// file does not by itself cause the resulting executable to be covered by ++// the GNU General Public License. This exception does not however ++// invalidate any other reasons why the executable file might be covered by ++// the GNU General Public License. ++ ++// ++// ISO C++ 14882: 22.2.1.1.2 ctype virtual functions. ++// ++ ++// Written by Benjamin Kosnik ++ ++#define _LIBC ++#include ++#undef _LIBC ++#include ++ ++#ifndef __UCLIBC_HAS_XLOCALE__ ++#define __wctype_l(S, L) wctype((S)) ++#define __towupper_l(C, L) towupper((C)) ++#define __towlower_l(C, L) towlower((C)) ++#define __iswctype_l(C, M, L) iswctype((C), (M)) ++#endif ++ ++namespace std ++{ ++ // NB: The other ctype specializations are in src/locale.cc and ++ // various /config/os/* files. ++ template<> ++ ctype_byname::ctype_byname(const char* __s, size_t __refs) ++ : ctype(0, false, __refs) ++ { ++ if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0) ++ { ++ this->_S_destroy_c_locale(this->_M_c_locale_ctype); ++ this->_S_create_c_locale(this->_M_c_locale_ctype, __s); ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper; ++ this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower; ++ this->_M_table = this->_M_c_locale_ctype->__ctype_b; ++#endif ++ } ++ } ++ ++#ifdef _GLIBCXX_USE_WCHAR_T ++ ctype::__wmask_type ++ ctype::_M_convert_to_wmask(const mask __m) const ++ { ++ __wmask_type __ret; ++ switch (__m) ++ { ++ case space: ++ __ret = __wctype_l("space", _M_c_locale_ctype); ++ break; ++ case print: ++ __ret = __wctype_l("print", _M_c_locale_ctype); ++ break; ++ case cntrl: ++ __ret = __wctype_l("cntrl", _M_c_locale_ctype); ++ break; ++ case upper: ++ __ret = __wctype_l("upper", _M_c_locale_ctype); ++ break; ++ case lower: ++ __ret = __wctype_l("lower", _M_c_locale_ctype); ++ break; ++ case alpha: ++ __ret = __wctype_l("alpha", _M_c_locale_ctype); ++ break; ++ case digit: ++ __ret = __wctype_l("digit", _M_c_locale_ctype); ++ break; ++ case punct: ++ __ret = __wctype_l("punct", _M_c_locale_ctype); ++ break; ++ case xdigit: ++ __ret = __wctype_l("xdigit", _M_c_locale_ctype); ++ break; ++ case alnum: ++ __ret = __wctype_l("alnum", _M_c_locale_ctype); ++ break; ++ case graph: ++ __ret = __wctype_l("graph", _M_c_locale_ctype); ++ break; ++ default: ++ __ret = __wmask_type(); ++ } ++ return __ret; ++ } ++ ++ wchar_t ++ ctype::do_toupper(wchar_t __c) const ++ { return __towupper_l(__c, _M_c_locale_ctype); } ++ ++ const wchar_t* ++ ctype::do_toupper(wchar_t* __lo, const wchar_t* __hi) const ++ { ++ while (__lo < __hi) ++ { ++ *__lo = __towupper_l(*__lo, _M_c_locale_ctype); ++ ++__lo; ++ } ++ return __hi; ++ } ++ ++ wchar_t ++ ctype::do_tolower(wchar_t __c) const ++ { return __towlower_l(__c, _M_c_locale_ctype); } ++ ++ const wchar_t* ++ ctype::do_tolower(wchar_t* __lo, const wchar_t* __hi) const ++ { ++ while (__lo < __hi) ++ { ++ *__lo = __towlower_l(*__lo, _M_c_locale_ctype); ++ ++__lo; ++ } ++ return __hi; ++ } ++ ++ bool ++ ctype:: ++ do_is(mask __m, wchar_t __c) const ++ { ++ // Highest bitmask in ctype_base == 10, but extra in "C" ++ // library for blank. ++ bool __ret = false; ++ const size_t __bitmasksize = 11; ++ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur) ++ if (__m & _M_bit[__bitcur] ++ && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype)) ++ { ++ __ret = true; ++ break; ++ } ++ return __ret; ++ } ++ ++ const wchar_t* ++ ctype:: ++ do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const ++ { ++ for (; __lo < __hi; ++__vec, ++__lo) ++ { ++ // Highest bitmask in ctype_base == 10, but extra in "C" ++ // library for blank. ++ const size_t __bitmasksize = 11; ++ mask __m = 0; ++ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur) ++ if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype)) ++ __m |= _M_bit[__bitcur]; ++ *__vec = __m; ++ } ++ return __hi; ++ } ++ ++ const wchar_t* ++ ctype:: ++ do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const ++ { ++ while (__lo < __hi && !this->do_is(__m, *__lo)) ++ ++__lo; ++ return __lo; ++ } ++ ++ const wchar_t* ++ ctype:: ++ do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const ++ { ++ while (__lo < __hi && this->do_is(__m, *__lo) != 0) ++ ++__lo; ++ return __lo; ++ } ++ ++ wchar_t ++ ctype:: ++ do_widen(char __c) const ++ { return _M_widen[static_cast(__c)]; } ++ ++ const char* ++ ctype:: ++ do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const ++ { ++ while (__lo < __hi) ++ { ++ *__dest = _M_widen[static_cast(*__lo)]; ++ ++__lo; ++ ++__dest; ++ } ++ return __hi; ++ } ++ ++ char ++ ctype:: ++ do_narrow(wchar_t __wc, char __dfault) const ++ { ++ if (__wc >= 0 && __wc < 128 && _M_narrow_ok) ++ return _M_narrow[__wc]; ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __c_locale __old = __uselocale(_M_c_locale_ctype); ++#endif ++ const int __c = wctob(__wc); ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __uselocale(__old); ++#endif ++ return (__c == EOF ? __dfault : static_cast(__c)); ++ } ++ ++ const wchar_t* ++ ctype:: ++ do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault, ++ char* __dest) const ++ { ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __c_locale __old = __uselocale(_M_c_locale_ctype); ++#endif ++ if (_M_narrow_ok) ++ while (__lo < __hi) ++ { ++ if (*__lo >= 0 && *__lo < 128) ++ *__dest = _M_narrow[*__lo]; ++ else ++ { ++ const int __c = wctob(*__lo); ++ *__dest = (__c == EOF ? __dfault : static_cast(__c)); ++ } ++ ++__lo; ++ ++__dest; ++ } ++ else ++ while (__lo < __hi) ++ { ++ const int __c = wctob(*__lo); ++ *__dest = (__c == EOF ? __dfault : static_cast(__c)); ++ ++__lo; ++ ++__dest; ++ } ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __uselocale(__old); ++#endif ++ return __hi; ++ } ++ ++ void ++ ctype::_M_initialize_ctype() ++ { ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __c_locale __old = __uselocale(_M_c_locale_ctype); ++#endif ++ wint_t __i; ++ for (__i = 0; __i < 128; ++__i) ++ { ++ const int __c = wctob(__i); ++ if (__c == EOF) ++ break; ++ else ++ _M_narrow[__i] = static_cast(__c); ++ } ++ if (__i == 128) ++ _M_narrow_ok = true; ++ else ++ _M_narrow_ok = false; ++ for (size_t __j = 0; ++ __j < sizeof(_M_widen) / sizeof(wint_t); ++__j) ++ _M_widen[__j] = btowc(__j); ++ ++ for (size_t __k = 0; __k <= 11; ++__k) ++ { ++ _M_bit[__k] = static_cast(_ISbit(__k)); ++ _M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]); ++ } ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __uselocale(__old); ++#endif ++ } ++#endif // _GLIBCXX_USE_WCHAR_T ++} +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.cc +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc 1970-01-01 01:00:00.000000000 +0100 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.cc 2008-06-10 14:45:35.000000000 +0200 +@@ -0,0 +1,100 @@ ++// std::messages implementation details, GNU version -*- C++ -*- ++ ++// Copyright (C) 2001, 2002 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library is free ++// software; you can redistribute it and/or modify it under the ++// terms of the GNU General Public License as published by the ++// Free Software Foundation; either version 2, or (at your option) ++// any later version. ++ ++// This 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 General Public License for more details. ++ ++// You should have received a copy of the GNU General Public License along ++// with this library; see the file COPYING. If not, write to the Free ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, ++// USA. ++ ++// As a special exception, you may use this file as part of a free software ++// library without restriction. Specifically, if other files instantiate ++// templates or use macros or inline functions from this file, or you compile ++// this file and link it with other files to produce an executable, this ++// file does not by itself cause the resulting executable to be covered by ++// the GNU General Public License. This exception does not however ++// invalidate any other reasons why the executable file might be covered by ++// the GNU General Public License. ++ ++// ++// ISO C++ 14882: 22.2.7.1.2 messages virtual functions ++// ++ ++// Written by Benjamin Kosnik ++ ++#include ++#include ++ ++#ifdef __UCLIBC_MJN3_ONLY__ ++#warning fix gettext stuff ++#endif ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ ++extern "C" char *__dcgettext(const char *domainname, ++ const char *msgid, int category); ++#undef gettext ++#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES) ++#else ++#undef gettext ++#define gettext(msgid) (msgid) ++#endif ++ ++namespace std ++{ ++ // Specializations. ++ template<> ++ string ++ messages::do_get(catalog, int, int, const string& __dfault) const ++ { ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __c_locale __old = __uselocale(_M_c_locale_messages); ++ const char* __msg = const_cast(gettext(__dfault.c_str())); ++ __uselocale(__old); ++ return string(__msg); ++#elif defined __UCLIBC_HAS_LOCALE__ ++ char* __old = strdup(setlocale(LC_ALL, NULL)); ++ setlocale(LC_ALL, _M_name_messages); ++ const char* __msg = gettext(__dfault.c_str()); ++ setlocale(LC_ALL, __old); ++ free(__old); ++ return string(__msg); ++#else ++ const char* __msg = gettext(__dfault.c_str()); ++ return string(__msg); ++#endif ++ } ++ ++#ifdef _GLIBCXX_USE_WCHAR_T ++ template<> ++ wstring ++ messages::do_get(catalog, int, int, const wstring& __dfault) const ++ { ++# ifdef __UCLIBC_HAS_XLOCALE__ ++ __c_locale __old = __uselocale(_M_c_locale_messages); ++ char* __msg = gettext(_M_convert_to_char(__dfault)); ++ __uselocale(__old); ++ return _M_convert_from_char(__msg); ++# elif defined __UCLIBC_HAS_LOCALE__ ++ char* __old = strdup(setlocale(LC_ALL, NULL)); ++ setlocale(LC_ALL, _M_name_messages); ++ char* __msg = gettext(_M_convert_to_char(__dfault)); ++ setlocale(LC_ALL, __old); ++ free(__old); ++ return _M_convert_from_char(__msg); ++# else ++ char* __msg = gettext(_M_convert_to_char(__dfault)); ++ return _M_convert_from_char(__msg); ++# endif ++ } ++#endif ++} +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h 1970-01-01 01:00:00.000000000 +0100 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:45:35.000000000 +0200 +@@ -0,0 +1,118 @@ ++// std::messages implementation details, GNU version -*- C++ -*- ++ ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library is free ++// software; you can redistribute it and/or modify it under the ++// terms of the GNU General Public License as published by the ++// Free Software Foundation; either version 2, or (at your option) ++// any later version. ++ ++// This 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 General Public License for more details. ++ ++// You should have received a copy of the GNU General Public License along ++// with this library; see the file COPYING. If not, write to the Free ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, ++// USA. ++ ++// As a special exception, you may use this file as part of a free software ++// library without restriction. Specifically, if other files instantiate ++// templates or use macros or inline functions from this file, or you compile ++// this file and link it with other files to produce an executable, this ++// file does not by itself cause the resulting executable to be covered by ++// the GNU General Public License. This exception does not however ++// invalidate any other reasons why the executable file might be covered by ++// the GNU General Public License. ++ ++// ++// ISO C++ 14882: 22.2.7.1.2 messages functions ++// ++ ++// Written by Benjamin Kosnik ++ ++#ifdef __UCLIBC_MJN3_ONLY__ ++#warning fix prototypes for *textdomain funcs ++#endif ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ ++extern "C" char *__textdomain(const char *domainname); ++extern "C" char *__bindtextdomain(const char *domainname, ++ const char *dirname); ++#else ++#undef __textdomain ++#undef __bindtextdomain ++#define __textdomain(D) ((void)0) ++#define __bindtextdomain(D,P) ((void)0) ++#endif ++ ++ // Non-virtual member functions. ++ template ++ messages<_CharT>::messages(size_t __refs) ++ : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), ++ _M_name_messages(_S_get_c_name()) ++ { } ++ ++ template ++ messages<_CharT>::messages(__c_locale __cloc, const char* __s, ++ size_t __refs) ++ : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)), ++ _M_name_messages(__s) ++ { ++ char* __tmp = new char[std::strlen(__s) + 1]; ++ std::strcpy(__tmp, __s); ++ _M_name_messages = __tmp; ++ } ++ ++ template ++ typename messages<_CharT>::catalog ++ messages<_CharT>::open(const basic_string& __s, const locale& __loc, ++ const char* __dir) const ++ { ++ __bindtextdomain(__s.c_str(), __dir); ++ return this->do_open(__s, __loc); ++ } ++ ++ // Virtual member functions. ++ template ++ messages<_CharT>::~messages() ++ { ++ if (_M_name_messages != _S_get_c_name()) ++ delete [] _M_name_messages; ++ _S_destroy_c_locale(_M_c_locale_messages); ++ } ++ ++ template ++ typename messages<_CharT>::catalog ++ messages<_CharT>::do_open(const basic_string& __s, ++ const locale&) const ++ { ++ // No error checking is done, assume the catalog exists and can ++ // be used. ++ __textdomain(__s.c_str()); ++ return 0; ++ } ++ ++ template ++ void ++ messages<_CharT>::do_close(catalog) const ++ { } ++ ++ // messages_byname ++ template ++ messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs) ++ : messages<_CharT>(__refs) ++ { ++ if (this->_M_name_messages != locale::facet::_S_get_c_name()) ++ delete [] this->_M_name_messages; ++ char* __tmp = new char[std::strlen(__s) + 1]; ++ std::strcpy(__tmp, __s); ++ this->_M_name_messages = __tmp; ++ ++ if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0) ++ { ++ this->_S_destroy_c_locale(this->_M_c_locale_messages); ++ this->_S_create_c_locale(this->_M_c_locale_messages, __s); ++ } ++ } +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc 1970-01-01 01:00:00.000000000 +0100 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:45:35.000000000 +0200 +@@ -0,0 +1,692 @@ ++// std::moneypunct implementation details, GNU version -*- C++ -*- ++ ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library is free ++// software; you can redistribute it and/or modify it under the ++// terms of the GNU General Public License as published by the ++// Free Software Foundation; either version 2, or (at your option) ++// any later version. ++ ++// This 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 General Public License for more details. ++ ++// You should have received a copy of the GNU General Public License along ++// with this library; see the file COPYING. If not, write to the Free ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, ++// USA. ++ ++// As a special exception, you may use this file as part of a free software ++// library without restriction. Specifically, if other files instantiate ++// templates or use macros or inline functions from this file, or you compile ++// this file and link it with other files to produce an executable, this ++// file does not by itself cause the resulting executable to be covered by ++// the GNU General Public License. This exception does not however ++// invalidate any other reasons why the executable file might be covered by ++// the GNU General Public License. ++ ++// ++// ISO C++ 14882: 22.2.6.3.2 moneypunct virtual functions ++// ++ ++// Written by Benjamin Kosnik ++ ++#define _LIBC ++#include ++#undef _LIBC ++#include ++ ++#ifdef __UCLIBC_MJN3_ONLY__ ++#warning optimize this for uclibc ++#warning tailor for stub locale support ++#endif ++ ++#ifndef __UCLIBC_HAS_XLOCALE__ ++#define __nl_langinfo_l(N, L) nl_langinfo((N)) ++#endif ++ ++namespace std ++{ ++ // Construct and return valid pattern consisting of some combination of: ++ // space none symbol sign value ++ money_base::pattern ++ money_base::_S_construct_pattern(char __precedes, char __space, char __posn) ++ { ++ pattern __ret; ++ ++ // This insanely complicated routine attempts to construct a valid ++ // pattern for use with monyepunct. A couple of invariants: ++ ++ // if (__precedes) symbol -> value ++ // else value -> symbol ++ ++ // if (__space) space ++ // else none ++ ++ // none == never first ++ // space never first or last ++ ++ // Any elegant implementations of this are welcome. ++ switch (__posn) ++ { ++ case 0: ++ case 1: ++ // 1 The sign precedes the value and symbol. ++ __ret.field[0] = sign; ++ if (__space) ++ { ++ // Pattern starts with sign. ++ if (__precedes) ++ { ++ __ret.field[1] = symbol; ++ __ret.field[3] = value; ++ } ++ else ++ { ++ __ret.field[1] = value; ++ __ret.field[3] = symbol; ++ } ++ __ret.field[2] = space; ++ } ++ else ++ { ++ // Pattern starts with sign and ends with none. ++ if (__precedes) ++ { ++ __ret.field[1] = symbol; ++ __ret.field[2] = value; ++ } ++ else ++ { ++ __ret.field[1] = value; ++ __ret.field[2] = symbol; ++ } ++ __ret.field[3] = none; ++ } ++ break; ++ case 2: ++ // 2 The sign follows the value and symbol. ++ if (__space) ++ { ++ // Pattern either ends with sign. ++ if (__precedes) ++ { ++ __ret.field[0] = symbol; ++ __ret.field[2] = value; ++ } ++ else ++ { ++ __ret.field[0] = value; ++ __ret.field[2] = symbol; ++ } ++ __ret.field[1] = space; ++ __ret.field[3] = sign; ++ } ++ else ++ { ++ // Pattern ends with sign then none. ++ if (__precedes) ++ { ++ __ret.field[0] = symbol; ++ __ret.field[1] = value; ++ } ++ else ++ { ++ __ret.field[0] = value; ++ __ret.field[1] = symbol; ++ } ++ __ret.field[2] = sign; ++ __ret.field[3] = none; ++ } ++ break; ++ case 3: ++ // 3 The sign immediately precedes the symbol. ++ if (__precedes) ++ { ++ __ret.field[0] = sign; ++ __ret.field[1] = symbol; ++ if (__space) ++ { ++ __ret.field[2] = space; ++ __ret.field[3] = value; ++ } ++ else ++ { ++ __ret.field[2] = value; ++ __ret.field[3] = none; ++ } ++ } ++ else ++ { ++ __ret.field[0] = value; ++ if (__space) ++ { ++ __ret.field[1] = space; ++ __ret.field[2] = sign; ++ __ret.field[3] = symbol; ++ } ++ else ++ { ++ __ret.field[1] = sign; ++ __ret.field[2] = symbol; ++ __ret.field[3] = none; ++ } ++ } ++ break; ++ case 4: ++ // 4 The sign immediately follows the symbol. ++ if (__precedes) ++ { ++ __ret.field[0] = symbol; ++ __ret.field[1] = sign; ++ if (__space) ++ { ++ __ret.field[2] = space; ++ __ret.field[3] = value; ++ } ++ else ++ { ++ __ret.field[2] = value; ++ __ret.field[3] = none; ++ } ++ } ++ else ++ { ++ __ret.field[0] = value; ++ if (__space) ++ { ++ __ret.field[1] = space; ++ __ret.field[2] = symbol; ++ __ret.field[3] = sign; ++ } ++ else ++ { ++ __ret.field[1] = symbol; ++ __ret.field[2] = sign; ++ __ret.field[3] = none; ++ } ++ } ++ break; ++ default: ++ ; ++ } ++ return __ret; ++ } ++ ++ template<> ++ void ++ moneypunct::_M_initialize_moneypunct(__c_locale __cloc, ++ const char*) ++ { ++ if (!_M_data) ++ _M_data = new __moneypunct_cache; ++ ++ if (!__cloc) ++ { ++ // "C" locale ++ _M_data->_M_decimal_point = '.'; ++ _M_data->_M_thousands_sep = ','; ++ _M_data->_M_grouping = ""; ++ _M_data->_M_grouping_size = 0; ++ _M_data->_M_curr_symbol = ""; ++ _M_data->_M_curr_symbol_size = 0; ++ _M_data->_M_positive_sign = ""; ++ _M_data->_M_positive_sign_size = 0; ++ _M_data->_M_negative_sign = ""; ++ _M_data->_M_negative_sign_size = 0; ++ _M_data->_M_frac_digits = 0; ++ _M_data->_M_pos_format = money_base::_S_default_pattern; ++ _M_data->_M_neg_format = money_base::_S_default_pattern; ++ ++ for (size_t __i = 0; __i < money_base::_S_end; ++__i) ++ _M_data->_M_atoms[__i] = money_base::_S_atoms[__i]; ++ } ++ else ++ { ++ // Named locale. ++ _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, ++ __cloc)); ++ _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, ++ __cloc)); ++ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc); ++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); ++ _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc); ++ _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign); ++ ++ char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc)); ++ if (!__nposn) ++ _M_data->_M_negative_sign = "()"; ++ else ++ _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, ++ __cloc); ++ _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign); ++ ++ // _Intl == true ++ _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc); ++ _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol); ++ _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, ++ __cloc)); ++ char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc)); ++ char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc)); ++ char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc)); ++ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, ++ __pposn); ++ char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc)); ++ char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc)); ++ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, ++ __nposn); ++ } ++ } ++ ++ template<> ++ void ++ moneypunct::_M_initialize_moneypunct(__c_locale __cloc, ++ const char*) ++ { ++ if (!_M_data) ++ _M_data = new __moneypunct_cache; ++ ++ if (!__cloc) ++ { ++ // "C" locale ++ _M_data->_M_decimal_point = '.'; ++ _M_data->_M_thousands_sep = ','; ++ _M_data->_M_grouping = ""; ++ _M_data->_M_grouping_size = 0; ++ _M_data->_M_curr_symbol = ""; ++ _M_data->_M_curr_symbol_size = 0; ++ _M_data->_M_positive_sign = ""; ++ _M_data->_M_positive_sign_size = 0; ++ _M_data->_M_negative_sign = ""; ++ _M_data->_M_negative_sign_size = 0; ++ _M_data->_M_frac_digits = 0; ++ _M_data->_M_pos_format = money_base::_S_default_pattern; ++ _M_data->_M_neg_format = money_base::_S_default_pattern; ++ ++ for (size_t __i = 0; __i < money_base::_S_end; ++__i) ++ _M_data->_M_atoms[__i] = money_base::_S_atoms[__i]; ++ } ++ else ++ { ++ // Named locale. ++ _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, ++ __cloc)); ++ _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, ++ __cloc)); ++ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc); ++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); ++ _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc); ++ _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign); ++ ++ char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc)); ++ if (!__nposn) ++ _M_data->_M_negative_sign = "()"; ++ else ++ _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, ++ __cloc); ++ _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign); ++ ++ // _Intl == false ++ _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc); ++ _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol); ++ _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc)); ++ char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc)); ++ char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc)); ++ char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc)); ++ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, ++ __pposn); ++ char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc)); ++ char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc)); ++ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, ++ __nposn); ++ } ++ } ++ ++ template<> ++ moneypunct::~moneypunct() ++ { delete _M_data; } ++ ++ template<> ++ moneypunct::~moneypunct() ++ { delete _M_data; } ++ ++#ifdef _GLIBCXX_USE_WCHAR_T ++ template<> ++ void ++ moneypunct::_M_initialize_moneypunct(__c_locale __cloc, ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ const char*) ++#else ++ const char* __name) ++#endif ++ { ++ if (!_M_data) ++ _M_data = new __moneypunct_cache; ++ ++ if (!__cloc) ++ { ++ // "C" locale ++ _M_data->_M_decimal_point = L'.'; ++ _M_data->_M_thousands_sep = L','; ++ _M_data->_M_grouping = ""; ++ _M_data->_M_grouping_size = 0; ++ _M_data->_M_curr_symbol = L""; ++ _M_data->_M_curr_symbol_size = 0; ++ _M_data->_M_positive_sign = L""; ++ _M_data->_M_positive_sign_size = 0; ++ _M_data->_M_negative_sign = L""; ++ _M_data->_M_negative_sign_size = 0; ++ _M_data->_M_frac_digits = 0; ++ _M_data->_M_pos_format = money_base::_S_default_pattern; ++ _M_data->_M_neg_format = money_base::_S_default_pattern; ++ ++ // Use ctype::widen code without the facet... ++ for (size_t __i = 0; __i < money_base::_S_end; ++__i) ++ _M_data->_M_atoms[__i] = ++ static_cast(money_base::_S_atoms[__i]); ++ } ++ else ++ { ++ // Named locale. ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __c_locale __old = __uselocale(__cloc); ++#else ++ // Switch to named locale so that mbsrtowcs will work. ++ char* __old = strdup(setlocale(LC_ALL, NULL)); ++ setlocale(LC_ALL, __name); ++#endif ++ ++#ifdef __UCLIBC_MJN3_ONLY__ ++#warning fix this... should be monetary ++#endif ++#ifdef __UCLIBC__ ++# ifdef __UCLIBC_HAS_XLOCALE__ ++ _M_data->_M_decimal_point = __cloc->decimal_point_wc; ++ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc; ++# else ++ _M_data->_M_decimal_point = __global_locale->decimal_point_wc; ++ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc; ++# endif ++#else ++ union { char *__s; wchar_t __w; } __u; ++ __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc); ++ _M_data->_M_decimal_point = __u.__w; ++ ++ __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc); ++ _M_data->_M_thousands_sep = __u.__w; ++#endif ++ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc); ++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); ++ ++ const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc); ++ const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc); ++ const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc); ++ ++ wchar_t* __wcs_ps = 0; ++ wchar_t* __wcs_ns = 0; ++ const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc)); ++ try ++ { ++ mbstate_t __state; ++ size_t __len = strlen(__cpossign); ++ if (__len) ++ { ++ ++__len; ++ memset(&__state, 0, sizeof(mbstate_t)); ++ __wcs_ps = new wchar_t[__len]; ++ mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state); ++ _M_data->_M_positive_sign = __wcs_ps; ++ } ++ else ++ _M_data->_M_positive_sign = L""; ++ _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign); ++ ++ __len = strlen(__cnegsign); ++ if (!__nposn) ++ _M_data->_M_negative_sign = L"()"; ++ else if (__len) ++ { ++ ++__len; ++ memset(&__state, 0, sizeof(mbstate_t)); ++ __wcs_ns = new wchar_t[__len]; ++ mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state); ++ _M_data->_M_negative_sign = __wcs_ns; ++ } ++ else ++ _M_data->_M_negative_sign = L""; ++ _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign); ++ ++ // _Intl == true. ++ __len = strlen(__ccurr); ++ if (__len) ++ { ++ ++__len; ++ memset(&__state, 0, sizeof(mbstate_t)); ++ wchar_t* __wcs = new wchar_t[__len]; ++ mbsrtowcs(__wcs, &__ccurr, __len, &__state); ++ _M_data->_M_curr_symbol = __wcs; ++ } ++ else ++ _M_data->_M_curr_symbol = L""; ++ _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol); ++ } ++ catch (...) ++ { ++ delete _M_data; ++ _M_data = 0; ++ delete __wcs_ps; ++ delete __wcs_ns; ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __uselocale(__old); ++#else ++ setlocale(LC_ALL, __old); ++ free(__old); ++#endif ++ __throw_exception_again; ++ } ++ ++ _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, ++ __cloc)); ++ char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc)); ++ char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc)); ++ char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc)); ++ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, ++ __pposn); ++ char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc)); ++ char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc)); ++ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, ++ __nposn); ++ ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __uselocale(__old); ++#else ++ setlocale(LC_ALL, __old); ++ free(__old); ++#endif ++ } ++ } ++ ++ template<> ++ void ++ moneypunct::_M_initialize_moneypunct(__c_locale __cloc, ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ const char*) ++#else ++ const char* __name) ++#endif ++ { ++ if (!_M_data) ++ _M_data = new __moneypunct_cache; ++ ++ if (!__cloc) ++ { ++ // "C" locale ++ _M_data->_M_decimal_point = L'.'; ++ _M_data->_M_thousands_sep = L','; ++ _M_data->_M_grouping = ""; ++ _M_data->_M_grouping_size = 0; ++ _M_data->_M_curr_symbol = L""; ++ _M_data->_M_curr_symbol_size = 0; ++ _M_data->_M_positive_sign = L""; ++ _M_data->_M_positive_sign_size = 0; ++ _M_data->_M_negative_sign = L""; ++ _M_data->_M_negative_sign_size = 0; ++ _M_data->_M_frac_digits = 0; ++ _M_data->_M_pos_format = money_base::_S_default_pattern; ++ _M_data->_M_neg_format = money_base::_S_default_pattern; ++ ++ // Use ctype::widen code without the facet... ++ for (size_t __i = 0; __i < money_base::_S_end; ++__i) ++ _M_data->_M_atoms[__i] = ++ static_cast(money_base::_S_atoms[__i]); ++ } ++ else ++ { ++ // Named locale. ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __c_locale __old = __uselocale(__cloc); ++#else ++ // Switch to named locale so that mbsrtowcs will work. ++ char* __old = strdup(setlocale(LC_ALL, NULL)); ++ setlocale(LC_ALL, __name); ++#endif ++ ++#ifdef __UCLIBC_MJN3_ONLY__ ++#warning fix this... should be monetary ++#endif ++#ifdef __UCLIBC__ ++# ifdef __UCLIBC_HAS_XLOCALE__ ++ _M_data->_M_decimal_point = __cloc->decimal_point_wc; ++ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc; ++# else ++ _M_data->_M_decimal_point = __global_locale->decimal_point_wc; ++ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc; ++# endif ++#else ++ union { char *__s; wchar_t __w; } __u; ++ __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc); ++ _M_data->_M_decimal_point = __u.__w; ++ ++ __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc); ++ _M_data->_M_thousands_sep = __u.__w; ++#endif ++ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc); ++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); ++ ++ const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc); ++ const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc); ++ const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc); ++ ++ wchar_t* __wcs_ps = 0; ++ wchar_t* __wcs_ns = 0; ++ const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc)); ++ try ++ { ++ mbstate_t __state; ++ size_t __len; ++ __len = strlen(__cpossign); ++ if (__len) ++ { ++ ++__len; ++ memset(&__state, 0, sizeof(mbstate_t)); ++ __wcs_ps = new wchar_t[__len]; ++ mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state); ++ _M_data->_M_positive_sign = __wcs_ps; ++ } ++ else ++ _M_data->_M_positive_sign = L""; ++ _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign); ++ ++ __len = strlen(__cnegsign); ++ if (!__nposn) ++ _M_data->_M_negative_sign = L"()"; ++ else if (__len) ++ { ++ ++__len; ++ memset(&__state, 0, sizeof(mbstate_t)); ++ __wcs_ns = new wchar_t[__len]; ++ mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state); ++ _M_data->_M_negative_sign = __wcs_ns; ++ } ++ else ++ _M_data->_M_negative_sign = L""; ++ _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign); ++ ++ // _Intl == true. ++ __len = strlen(__ccurr); ++ if (__len) ++ { ++ ++__len; ++ memset(&__state, 0, sizeof(mbstate_t)); ++ wchar_t* __wcs = new wchar_t[__len]; ++ mbsrtowcs(__wcs, &__ccurr, __len, &__state); ++ _M_data->_M_curr_symbol = __wcs; ++ } ++ else ++ _M_data->_M_curr_symbol = L""; ++ _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol); ++ } ++ catch (...) ++ { ++ delete _M_data; ++ _M_data = 0; ++ delete __wcs_ps; ++ delete __wcs_ns; ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __uselocale(__old); ++#else ++ setlocale(LC_ALL, __old); ++ free(__old); ++#endif ++ __throw_exception_again; ++ } ++ ++ _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc)); ++ char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc)); ++ char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc)); ++ char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc)); ++ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, ++ __pposn); ++ char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc)); ++ char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc)); ++ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, ++ __nposn); ++ ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __uselocale(__old); ++#else ++ setlocale(LC_ALL, __old); ++ free(__old); ++#endif ++ } ++ } ++ ++ template<> ++ moneypunct::~moneypunct() ++ { ++ if (_M_data->_M_positive_sign_size) ++ delete [] _M_data->_M_positive_sign; ++ if (_M_data->_M_negative_sign_size ++ && wcscmp(_M_data->_M_negative_sign, L"()") != 0) ++ delete [] _M_data->_M_negative_sign; ++ if (_M_data->_M_curr_symbol_size) ++ delete [] _M_data->_M_curr_symbol; ++ delete _M_data; ++ } ++ ++ template<> ++ moneypunct::~moneypunct() ++ { ++ if (_M_data->_M_positive_sign_size) ++ delete [] _M_data->_M_positive_sign; ++ if (_M_data->_M_negative_sign_size ++ && wcscmp(_M_data->_M_negative_sign, L"()") != 0) ++ delete [] _M_data->_M_negative_sign; ++ if (_M_data->_M_curr_symbol_size) ++ delete [] _M_data->_M_curr_symbol; ++ delete _M_data; ++ } ++#endif ++} +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc 1970-01-01 01:00:00.000000000 +0100 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:45:35.000000000 +0200 +@@ -0,0 +1,160 @@ ++// std::numpunct implementation details, GNU version -*- C++ -*- ++ ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library is free ++// software; you can redistribute it and/or modify it under the ++// terms of the GNU General Public License as published by the ++// Free Software Foundation; either version 2, or (at your option) ++// any later version. ++ ++// This 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 General Public License for more details. ++ ++// You should have received a copy of the GNU General Public License along ++// with this library; see the file COPYING. If not, write to the Free ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, ++// USA. ++ ++// As a special exception, you may use this file as part of a free software ++// library without restriction. Specifically, if other files instantiate ++// templates or use macros or inline functions from this file, or you compile ++// this file and link it with other files to produce an executable, this ++// file does not by itself cause the resulting executable to be covered by ++// the GNU General Public License. This exception does not however ++// invalidate any other reasons why the executable file might be covered by ++// the GNU General Public License. ++ ++// ++// ISO C++ 14882: 22.2.3.1.2 numpunct virtual functions ++// ++ ++// Written by Benjamin Kosnik ++ ++#define _LIBC ++#include ++#undef _LIBC ++#include ++ ++#ifdef __UCLIBC_MJN3_ONLY__ ++#warning tailor for stub locale support ++#endif ++#ifndef __UCLIBC_HAS_XLOCALE__ ++#define __nl_langinfo_l(N, L) nl_langinfo((N)) ++#endif ++ ++namespace std ++{ ++ template<> ++ void ++ numpunct::_M_initialize_numpunct(__c_locale __cloc) ++ { ++ if (!_M_data) ++ _M_data = new __numpunct_cache; ++ ++ if (!__cloc) ++ { ++ // "C" locale ++ _M_data->_M_grouping = ""; ++ _M_data->_M_grouping_size = 0; ++ _M_data->_M_use_grouping = false; ++ ++ _M_data->_M_decimal_point = '.'; ++ _M_data->_M_thousands_sep = ','; ++ ++ for (size_t __i = 0; __i < __num_base::_S_oend; ++__i) ++ _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i]; ++ ++ for (size_t __j = 0; __j < __num_base::_S_iend; ++__j) ++ _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j]; ++ } ++ else ++ { ++ // Named locale. ++ _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT, ++ __cloc)); ++ _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP, ++ __cloc)); ++ ++ // Check for NULL, which implies no grouping. ++ if (_M_data->_M_thousands_sep == '\0') ++ _M_data->_M_grouping = ""; ++ else ++ _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc); ++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); ++ } ++ ++ // NB: There is no way to extact this info from posix locales. ++ // _M_truename = __nl_langinfo_l(YESSTR, __cloc); ++ _M_data->_M_truename = "true"; ++ _M_data->_M_truename_size = 4; ++ // _M_falsename = __nl_langinfo_l(NOSTR, __cloc); ++ _M_data->_M_falsename = "false"; ++ _M_data->_M_falsename_size = 5; ++ } ++ ++ template<> ++ numpunct::~numpunct() ++ { delete _M_data; } ++ ++#ifdef _GLIBCXX_USE_WCHAR_T ++ template<> ++ void ++ numpunct::_M_initialize_numpunct(__c_locale __cloc) ++ { ++ if (!_M_data) ++ _M_data = new __numpunct_cache; ++ ++ if (!__cloc) ++ { ++ // "C" locale ++ _M_data->_M_grouping = ""; ++ _M_data->_M_grouping_size = 0; ++ _M_data->_M_use_grouping = false; ++ ++ _M_data->_M_decimal_point = L'.'; ++ _M_data->_M_thousands_sep = L','; ++ ++ // Use ctype::widen code without the facet... ++ for (size_t __i = 0; __i < __num_base::_S_oend; ++__i) ++ _M_data->_M_atoms_out[__i] = ++ static_cast(__num_base::_S_atoms_out[__i]); ++ ++ for (size_t __j = 0; __j < __num_base::_S_iend; ++__j) ++ _M_data->_M_atoms_in[__j] = ++ static_cast(__num_base::_S_atoms_in[__j]); ++ } ++ else ++ { ++ // Named locale. ++ // NB: In the GNU model wchar_t is always 32 bit wide. ++ union { char *__s; wchar_t __w; } __u; ++ __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc); ++ _M_data->_M_decimal_point = __u.__w; ++ ++ __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc); ++ _M_data->_M_thousands_sep = __u.__w; ++ ++ if (_M_data->_M_thousands_sep == L'\0') ++ _M_data->_M_grouping = ""; ++ else ++ _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc); ++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); ++ } ++ ++ // NB: There is no way to extact this info from posix locales. ++ // _M_truename = __nl_langinfo_l(YESSTR, __cloc); ++ _M_data->_M_truename = L"true"; ++ _M_data->_M_truename_size = 4; ++ // _M_falsename = __nl_langinfo_l(NOSTR, __cloc); ++ _M_data->_M_falsename = L"false"; ++ _M_data->_M_falsename_size = 5; ++ } ++ ++ template<> ++ numpunct::~numpunct() ++ { delete _M_data; } ++ #endif ++} +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.cc +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.cc 1970-01-01 01:00:00.000000000 +0100 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.cc 2008-06-10 14:45:35.000000000 +0200 +@@ -0,0 +1,406 @@ ++// std::time_get, std::time_put implementation, GNU version -*- C++ -*- ++ ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library is free ++// software; you can redistribute it and/or modify it under the ++// terms of the GNU General Public License as published by the ++// Free Software Foundation; either version 2, or (at your option) ++// any later version. ++ ++// This 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 General Public License for more details. ++ ++// You should have received a copy of the GNU General Public License along ++// with this library; see the file COPYING. If not, write to the Free ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, ++// USA. ++ ++// As a special exception, you may use this file as part of a free software ++// library without restriction. Specifically, if other files instantiate ++// templates or use macros or inline functions from this file, or you compile ++// this file and link it with other files to produce an executable, this ++// file does not by itself cause the resulting executable to be covered by ++// the GNU General Public License. This exception does not however ++// invalidate any other reasons why the executable file might be covered by ++// the GNU General Public License. ++ ++// ++// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions ++// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions ++// ++ ++// Written by Benjamin Kosnik ++ ++#include ++#include ++ ++#ifdef __UCLIBC_MJN3_ONLY__ ++#warning tailor for stub locale support ++#endif ++#ifndef __UCLIBC_HAS_XLOCALE__ ++#define __nl_langinfo_l(N, L) nl_langinfo((N)) ++#endif ++ ++namespace std ++{ ++ template<> ++ void ++ __timepunct:: ++ _M_put(char* __s, size_t __maxlen, const char* __format, ++ const tm* __tm) const ++ { ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ const size_t __len = __strftime_l(__s, __maxlen, __format, __tm, ++ _M_c_locale_timepunct); ++#else ++ char* __old = strdup(setlocale(LC_ALL, NULL)); ++ setlocale(LC_ALL, _M_name_timepunct); ++ const size_t __len = strftime(__s, __maxlen, __format, __tm); ++ setlocale(LC_ALL, __old); ++ free(__old); ++#endif ++ // Make sure __s is null terminated. ++ if (__len == 0) ++ __s[0] = '\0'; ++ } ++ ++ template<> ++ void ++ __timepunct::_M_initialize_timepunct(__c_locale __cloc) ++ { ++ if (!_M_data) ++ _M_data = new __timepunct_cache; ++ ++ if (!__cloc) ++ { ++ // "C" locale ++ _M_c_locale_timepunct = _S_get_c_locale(); ++ ++ _M_data->_M_date_format = "%m/%d/%y"; ++ _M_data->_M_date_era_format = "%m/%d/%y"; ++ _M_data->_M_time_format = "%H:%M:%S"; ++ _M_data->_M_time_era_format = "%H:%M:%S"; ++ _M_data->_M_date_time_format = ""; ++ _M_data->_M_date_time_era_format = ""; ++ _M_data->_M_am = "AM"; ++ _M_data->_M_pm = "PM"; ++ _M_data->_M_am_pm_format = ""; ++ ++ // Day names, starting with "C"'s Sunday. ++ _M_data->_M_day1 = "Sunday"; ++ _M_data->_M_day2 = "Monday"; ++ _M_data->_M_day3 = "Tuesday"; ++ _M_data->_M_day4 = "Wednesday"; ++ _M_data->_M_day5 = "Thursday"; ++ _M_data->_M_day6 = "Friday"; ++ _M_data->_M_day7 = "Saturday"; ++ ++ // Abbreviated day names, starting with "C"'s Sun. ++ _M_data->_M_aday1 = "Sun"; ++ _M_data->_M_aday2 = "Mon"; ++ _M_data->_M_aday3 = "Tue"; ++ _M_data->_M_aday4 = "Wed"; ++ _M_data->_M_aday5 = "Thu"; ++ _M_data->_M_aday6 = "Fri"; ++ _M_data->_M_aday7 = "Sat"; ++ ++ // Month names, starting with "C"'s January. ++ _M_data->_M_month01 = "January"; ++ _M_data->_M_month02 = "February"; ++ _M_data->_M_month03 = "March"; ++ _M_data->_M_month04 = "April"; ++ _M_data->_M_month05 = "May"; ++ _M_data->_M_month06 = "June"; ++ _M_data->_M_month07 = "July"; ++ _M_data->_M_month08 = "August"; ++ _M_data->_M_month09 = "September"; ++ _M_data->_M_month10 = "October"; ++ _M_data->_M_month11 = "November"; ++ _M_data->_M_month12 = "December"; ++ ++ // Abbreviated month names, starting with "C"'s Jan. ++ _M_data->_M_amonth01 = "Jan"; ++ _M_data->_M_amonth02 = "Feb"; ++ _M_data->_M_amonth03 = "Mar"; ++ _M_data->_M_amonth04 = "Apr"; ++ _M_data->_M_amonth05 = "May"; ++ _M_data->_M_amonth06 = "Jun"; ++ _M_data->_M_amonth07 = "Jul"; ++ _M_data->_M_amonth08 = "Aug"; ++ _M_data->_M_amonth09 = "Sep"; ++ _M_data->_M_amonth10 = "Oct"; ++ _M_data->_M_amonth11 = "Nov"; ++ _M_data->_M_amonth12 = "Dec"; ++ } ++ else ++ { ++ _M_c_locale_timepunct = _S_clone_c_locale(__cloc); ++ ++ _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc); ++ _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc); ++ _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc); ++ _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc); ++ _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc); ++ _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT, ++ __cloc); ++ _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc); ++ _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc); ++ _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc); ++ ++ // Day names, starting with "C"'s Sunday. ++ _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc); ++ _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc); ++ _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc); ++ _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc); ++ _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc); ++ _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc); ++ _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc); ++ ++ // Abbreviated day names, starting with "C"'s Sun. ++ _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc); ++ _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc); ++ _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc); ++ _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc); ++ _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc); ++ _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc); ++ _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc); ++ ++ // Month names, starting with "C"'s January. ++ _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc); ++ _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc); ++ _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc); ++ _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc); ++ _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc); ++ _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc); ++ _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc); ++ _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc); ++ _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc); ++ _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc); ++ _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc); ++ _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc); ++ ++ // Abbreviated month names, starting with "C"'s Jan. ++ _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc); ++ _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc); ++ _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc); ++ _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc); ++ _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc); ++ _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc); ++ _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc); ++ _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc); ++ _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc); ++ _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc); ++ _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc); ++ _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc); ++ } ++ } ++ ++#ifdef _GLIBCXX_USE_WCHAR_T ++ template<> ++ void ++ __timepunct:: ++ _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format, ++ const tm* __tm) const ++ { ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct); ++ const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm, ++ _M_c_locale_timepunct); ++#else ++ char* __old = strdup(setlocale(LC_ALL, NULL)); ++ setlocale(LC_ALL, _M_name_timepunct); ++ const size_t __len = wcsftime(__s, __maxlen, __format, __tm); ++ setlocale(LC_ALL, __old); ++ free(__old); ++#endif ++ // Make sure __s is null terminated. ++ if (__len == 0) ++ __s[0] = L'\0'; ++ } ++ ++ template<> ++ void ++ __timepunct::_M_initialize_timepunct(__c_locale __cloc) ++ { ++ if (!_M_data) ++ _M_data = new __timepunct_cache; ++ ++#warning wide time stuff ++// if (!__cloc) ++ { ++ // "C" locale ++ _M_c_locale_timepunct = _S_get_c_locale(); ++ ++ _M_data->_M_date_format = L"%m/%d/%y"; ++ _M_data->_M_date_era_format = L"%m/%d/%y"; ++ _M_data->_M_time_format = L"%H:%M:%S"; ++ _M_data->_M_time_era_format = L"%H:%M:%S"; ++ _M_data->_M_date_time_format = L""; ++ _M_data->_M_date_time_era_format = L""; ++ _M_data->_M_am = L"AM"; ++ _M_data->_M_pm = L"PM"; ++ _M_data->_M_am_pm_format = L""; ++ ++ // Day names, starting with "C"'s Sunday. ++ _M_data->_M_day1 = L"Sunday"; ++ _M_data->_M_day2 = L"Monday"; ++ _M_data->_M_day3 = L"Tuesday"; ++ _M_data->_M_day4 = L"Wednesday"; ++ _M_data->_M_day5 = L"Thursday"; ++ _M_data->_M_day6 = L"Friday"; ++ _M_data->_M_day7 = L"Saturday"; ++ ++ // Abbreviated day names, starting with "C"'s Sun. ++ _M_data->_M_aday1 = L"Sun"; ++ _M_data->_M_aday2 = L"Mon"; ++ _M_data->_M_aday3 = L"Tue"; ++ _M_data->_M_aday4 = L"Wed"; ++ _M_data->_M_aday5 = L"Thu"; ++ _M_data->_M_aday6 = L"Fri"; ++ _M_data->_M_aday7 = L"Sat"; ++ ++ // Month names, starting with "C"'s January. ++ _M_data->_M_month01 = L"January"; ++ _M_data->_M_month02 = L"February"; ++ _M_data->_M_month03 = L"March"; ++ _M_data->_M_month04 = L"April"; ++ _M_data->_M_month05 = L"May"; ++ _M_data->_M_month06 = L"June"; ++ _M_data->_M_month07 = L"July"; ++ _M_data->_M_month08 = L"August"; ++ _M_data->_M_month09 = L"September"; ++ _M_data->_M_month10 = L"October"; ++ _M_data->_M_month11 = L"November"; ++ _M_data->_M_month12 = L"December"; ++ ++ // Abbreviated month names, starting with "C"'s Jan. ++ _M_data->_M_amonth01 = L"Jan"; ++ _M_data->_M_amonth02 = L"Feb"; ++ _M_data->_M_amonth03 = L"Mar"; ++ _M_data->_M_amonth04 = L"Apr"; ++ _M_data->_M_amonth05 = L"May"; ++ _M_data->_M_amonth06 = L"Jun"; ++ _M_data->_M_amonth07 = L"Jul"; ++ _M_data->_M_amonth08 = L"Aug"; ++ _M_data->_M_amonth09 = L"Sep"; ++ _M_data->_M_amonth10 = L"Oct"; ++ _M_data->_M_amonth11 = L"Nov"; ++ _M_data->_M_amonth12 = L"Dec"; ++ } ++#if 0 ++ else ++ { ++ _M_c_locale_timepunct = _S_clone_c_locale(__cloc); ++ ++ union { char *__s; wchar_t *__w; } __u; ++ ++ __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc); ++ _M_data->_M_date_format = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc); ++ _M_data->_M_date_era_format = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc); ++ _M_data->_M_time_format = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc); ++ _M_data->_M_time_era_format = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc); ++ _M_data->_M_date_time_format = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc); ++ _M_data->_M_date_time_era_format = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc); ++ _M_data->_M_am = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc); ++ _M_data->_M_pm = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc); ++ _M_data->_M_am_pm_format = __u.__w; ++ ++ // Day names, starting with "C"'s Sunday. ++ __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc); ++ _M_data->_M_day1 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc); ++ _M_data->_M_day2 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc); ++ _M_data->_M_day3 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc); ++ _M_data->_M_day4 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc); ++ _M_data->_M_day5 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc); ++ _M_data->_M_day6 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc); ++ _M_data->_M_day7 = __u.__w; ++ ++ // Abbreviated day names, starting with "C"'s Sun. ++ __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc); ++ _M_data->_M_aday1 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc); ++ _M_data->_M_aday2 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc); ++ _M_data->_M_aday3 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc); ++ _M_data->_M_aday4 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc); ++ _M_data->_M_aday5 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc); ++ _M_data->_M_aday6 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc); ++ _M_data->_M_aday7 = __u.__w; ++ ++ // Month names, starting with "C"'s January. ++ __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc); ++ _M_data->_M_month01 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc); ++ _M_data->_M_month02 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc); ++ _M_data->_M_month03 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc); ++ _M_data->_M_month04 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc); ++ _M_data->_M_month05 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc); ++ _M_data->_M_month06 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc); ++ _M_data->_M_month07 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc); ++ _M_data->_M_month08 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc); ++ _M_data->_M_month09 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc); ++ _M_data->_M_month10 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc); ++ _M_data->_M_month11 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc); ++ _M_data->_M_month12 = __u.__w; ++ ++ // Abbreviated month names, starting with "C"'s Jan. ++ __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc); ++ _M_data->_M_amonth01 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc); ++ _M_data->_M_amonth02 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc); ++ _M_data->_M_amonth03 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc); ++ _M_data->_M_amonth04 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc); ++ _M_data->_M_amonth05 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc); ++ _M_data->_M_amonth06 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc); ++ _M_data->_M_amonth07 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc); ++ _M_data->_M_amonth08 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc); ++ _M_data->_M_amonth09 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc); ++ _M_data->_M_amonth10 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc); ++ _M_data->_M_amonth11 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc); ++ _M_data->_M_amonth12 = __u.__w; ++ } ++#endif // 0 ++ } ++#endif ++} +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.h +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.h 1970-01-01 01:00:00.000000000 +0100 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.h 2008-06-10 14:45:35.000000000 +0200 +@@ -0,0 +1,68 @@ ++// std::time_get, std::time_put implementation, GNU version -*- C++ -*- ++ ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library is free ++// software; you can redistribute it and/or modify it under the ++// terms of the GNU General Public License as published by the ++// Free Software Foundation; either version 2, or (at your option) ++// any later version. ++ ++// This 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 General Public License for more details. ++ ++// You should have received a copy of the GNU General Public License along ++// with this library; see the file COPYING. If not, write to the Free ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, ++// USA. ++ ++// As a special exception, you may use this file as part of a free software ++// library without restriction. Specifically, if other files instantiate ++// templates or use macros or inline functions from this file, or you compile ++// this file and link it with other files to produce an executable, this ++// file does not by itself cause the resulting executable to be covered by ++// the GNU General Public License. This exception does not however ++// invalidate any other reasons why the executable file might be covered by ++// the GNU General Public License. ++ ++// ++// ISO C++ 14882: 22.2.5.1.2 - time_get functions ++// ISO C++ 14882: 22.2.5.3.2 - time_put functions ++// ++ ++// Written by Benjamin Kosnik ++ ++ template ++ __timepunct<_CharT>::__timepunct(size_t __refs) ++ : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), ++ _M_name_timepunct(_S_get_c_name()) ++ { _M_initialize_timepunct(); } ++ ++ template ++ __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) ++ : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), ++ _M_name_timepunct(_S_get_c_name()) ++ { _M_initialize_timepunct(); } ++ ++ template ++ __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s, ++ size_t __refs) ++ : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), ++ _M_name_timepunct(__s) ++ { ++ char* __tmp = new char[std::strlen(__s) + 1]; ++ std::strcpy(__tmp, __s); ++ _M_name_timepunct = __tmp; ++ _M_initialize_timepunct(__cloc); ++ } ++ ++ template ++ __timepunct<_CharT>::~__timepunct() ++ { ++ if (_M_name_timepunct != _S_get_c_name()) ++ delete [] _M_name_timepunct; ++ delete _M_data; ++ _S_destroy_c_locale(_M_c_locale_timepunct); ++ } +diff -durN gcc-4.3.0.orig/libstdc++-v3/configure gcc-4.3.0/libstdc++-v3/configure +--- gcc-4.3.0.orig/libstdc++-v3/configure 2008-02-29 01:00:39.000000000 +0100 ++++ gcc-4.3.0/libstdc++-v3/configure 2008-06-10 14:45:35.000000000 +0200 +@@ -14001,7 +14001,7 @@ + enableval="$enable_clocale" + + case "$enableval" in +- generic|gnu|ieee_1003.1-2001|yes|no|auto) ;; ++ generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto) ;; + *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable clocale" >&5 + echo "$as_me: error: Unknown argument to enable/disable clocale" >&2;} + { (exit 1); exit 1; }; } ;; +@@ -14034,6 +14034,9 @@ + # Default to "generic". + if test $enable_clocale_flag = auto; then + case ${target_os} in ++ linux-uclibc*) ++ enable_clocale_flag=uclibc ++ ;; + linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu) + enable_clocale_flag=gnu + ;; +@@ -14422,6 +14425,76 @@ + CTIME_CC=config/locale/generic/time_members.cc + CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h + ;; ++ uclibc) ++ echo "$as_me:$LINENO: result: uclibc" >&5 ++echo "${ECHO_T}uclibc" >&6 ++ ++ # Declare intention to use gettext, and add support for specific ++ # languages. ++ # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT ++ ALL_LINGUAS="de fr" ++ ++ # Don't call AM-GNU-GETTEXT here. Instead, assume glibc. ++ # Extract the first word of "msgfmt", so it can be a program name with args. ++set dummy msgfmt; ac_word=$2 ++echo "$as_me:$LINENO: checking for $ac_word" >&5 ++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 ++if test "${ac_cv_prog_check_msgfmt+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ if test -n "$check_msgfmt"; then ++ ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ ac_cv_prog_check_msgfmt="yes" ++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++done ++ ++ test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no" ++fi ++fi ++check_msgfmt=$ac_cv_prog_check_msgfmt ++if test -n "$check_msgfmt"; then ++ echo "$as_me:$LINENO: result: $check_msgfmt" >&5 ++echo "${ECHO_T}$check_msgfmt" >&6 ++else ++ echo "$as_me:$LINENO: result: no" >&5 ++echo "${ECHO_T}no" >&6 ++fi ++ ++ if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then ++ USE_NLS=yes ++ fi ++ # Export the build objects. ++ for ling in $ALL_LINGUAS; do \ ++ glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \ ++ glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \ ++ done ++ ++ ++ ++ CLOCALE_H=config/locale/uclibc/c_locale.h ++ CLOCALE_CC=config/locale/uclibc/c_locale.cc ++ CCODECVT_CC=config/locale/uclibc/codecvt_members.cc ++ CCOLLATE_CC=config/locale/uclibc/collate_members.cc ++ CCTYPE_CC=config/locale/uclibc/ctype_members.cc ++ CMESSAGES_H=config/locale/uclibc/messages_members.h ++ CMESSAGES_CC=config/locale/uclibc/messages_members.cc ++ CMONEY_CC=config/locale/uclibc/monetary_members.cc ++ CNUMERIC_CC=config/locale/uclibc/numeric_members.cc ++ CTIME_H=config/locale/uclibc/time_members.h ++ CTIME_CC=config/locale/uclibc/time_members.cc ++ CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h ++ ;; + esac + + # This is where the testsuite looks for locale catalogs, using the +diff -durN gcc-4.3.0.orig/libstdc++-v3/include/c_compatibility/wchar.h gcc-4.3.0/libstdc++-v3/include/c_compatibility/wchar.h +--- gcc-4.3.0.orig/libstdc++-v3/include/c_compatibility/wchar.h 2007-03-04 23:59:49.000000000 +0100 ++++ gcc-4.3.0/libstdc++-v3/include/c_compatibility/wchar.h 2008-06-10 14:45:35.000000000 +0200 +@@ -106,7 +106,9 @@ + using std::wmemcpy; + using std::wmemmove; + using std::wmemset; ++#if _GLIBCXX_HAVE_WCSFTIME + using std::wcsftime; ++#endif + + #if _GLIBCXX_USE_C99 + using std::wcstold; diff --git a/patches/gcc/4.3.0/675-203-uclibc-locale-no__x.patch b/patches/gcc/4.3.0/675-203-uclibc-locale-no__x.patch deleted file mode 100644 index ff15ed1..0000000 --- a/patches/gcc/4.3.0/675-203-uclibc-locale-no__x.patch +++ /dev/null @@ -1,224 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_203-uclibc-locale-no__x.patch -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2008-06-10 14:45:39.000000000 +0200 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2008-06-10 14:45:39.000000000 +0200 -@@ -60,4 +60,49 @@ - extern "C" __typeof(wctype_l) __wctype_l; - #endif - -+# define __nl_langinfo_l nl_langinfo_l -+# define __strcoll_l strcoll_l -+# define __strftime_l strftime_l -+# define __strtod_l strtod_l -+# define __strtof_l strtof_l -+# define __strtold_l strtold_l -+# define __strxfrm_l strxfrm_l -+# define __newlocale newlocale -+# define __freelocale freelocale -+# define __duplocale duplocale -+# define __uselocale uselocale -+ -+# ifdef _GLIBCXX_USE_WCHAR_T -+# define __iswctype_l iswctype_l -+# define __towlower_l towlower_l -+# define __towupper_l towupper_l -+# define __wcscoll_l wcscoll_l -+# define __wcsftime_l wcsftime_l -+# define __wcsxfrm_l wcsxfrm_l -+# define __wctype_l wctype_l -+# endif -+ -+#else -+# define __nl_langinfo_l(N, L) nl_langinfo((N)) -+# define __strcoll_l(S1, S2, L) strcoll((S1), (S2)) -+# define __strtod_l(S, E, L) strtod((S), (E)) -+# define __strtof_l(S, E, L) strtof((S), (E)) -+# define __strtold_l(S, E, L) strtold((S), (E)) -+# define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N)) -+# warning should dummy __newlocale check for C|POSIX ? -+# define __newlocale(a, b, c) NULL -+# define __freelocale(a) ((void)0) -+# define __duplocale(a) __c_locale() -+//# define __uselocale ? -+// -+# ifdef _GLIBCXX_USE_WCHAR_T -+# define __iswctype_l(C, M, L) iswctype((C), (M)) -+# define __towlower_l(C, L) towlower((C)) -+# define __towupper_l(C, L) towupper((C)) -+# define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2)) -+//# define __wcsftime_l(S, M, F, T, L) wcsftime((S), (M), (F), (T)) -+# define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N)) -+# define __wctype_l(S, L) wctype((S)) -+# endif -+ - #endif // GLIBC 2.3 and later -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.cc ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-06-10 14:45:39.000000000 +0200 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-06-10 14:45:39.000000000 +0200 -@@ -39,20 +39,6 @@ - #include - #include - --#ifndef __UCLIBC_HAS_XLOCALE__ --#define __strtol_l(S, E, B, L) strtol((S), (E), (B)) --#define __strtoul_l(S, E, B, L) strtoul((S), (E), (B)) --#define __strtoll_l(S, E, B, L) strtoll((S), (E), (B)) --#define __strtoull_l(S, E, B, L) strtoull((S), (E), (B)) --#define __strtof_l(S, E, L) strtof((S), (E)) --#define __strtod_l(S, E, L) strtod((S), (E)) --#define __strtold_l(S, E, L) strtold((S), (E)) --#warning should dummy __newlocale check for C|POSIX ? --#define __newlocale(a, b, c) NULL --#define __freelocale(a) ((void)0) --#define __duplocale(a) __c_locale() --#endif -- - namespace std - { - template<> -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.h ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-06-10 14:45:39.000000000 +0200 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-06-10 14:45:39.000000000 +0200 -@@ -68,6 +68,7 @@ - { - extern "C" __typeof(uselocale) __uselocale; - } -+#define __uselocale uselocale - #endif - - namespace std -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/collate_members.cc ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc 2008-06-10 14:45:39.000000000 +0200 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/collate_members.cc 2008-06-10 14:45:39.000000000 +0200 -@@ -36,13 +36,6 @@ - #include - #include - --#ifndef __UCLIBC_HAS_XLOCALE__ --#define __strcoll_l(S1, S2, L) strcoll((S1), (S2)) --#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N)) --#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2)) --#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N)) --#endif -- - namespace std - { - // These are basically extensions to char_traits, and perhaps should -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-06-10 14:45:39.000000000 +0200 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-06-10 14:45:39.000000000 +0200 -@@ -38,13 +38,6 @@ - #undef _LIBC - #include - --#ifndef __UCLIBC_HAS_XLOCALE__ --#define __wctype_l(S, L) wctype((S)) --#define __towupper_l(C, L) towupper((C)) --#define __towlower_l(C, L) towlower((C)) --#define __iswctype_l(C, M, L) iswctype((C), (M)) --#endif -- - namespace std - { - // NB: The other ctype specializations are in src/locale.cc and -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.cc ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc 2008-06-10 14:45:39.000000000 +0200 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.cc 2008-06-10 14:45:39.000000000 +0200 -@@ -39,13 +39,10 @@ - #ifdef __UCLIBC_MJN3_ONLY__ - #warning fix gettext stuff - #endif --#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ --extern "C" char *__dcgettext(const char *domainname, -- const char *msgid, int category); - #undef gettext --#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES) -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ -+#define gettext(msgid) dcgettext(NULL, msgid, LC_MESSAGES) - #else --#undef gettext - #define gettext(msgid) (msgid) - #endif - -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:45:39.000000000 +0200 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:45:39.000000000 +0200 -@@ -36,15 +36,11 @@ - #ifdef __UCLIBC_MJN3_ONLY__ - #warning fix prototypes for *textdomain funcs - #endif --#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ --extern "C" char *__textdomain(const char *domainname); --extern "C" char *__bindtextdomain(const char *domainname, -- const char *dirname); --#else --#undef __textdomain --#undef __bindtextdomain --#define __textdomain(D) ((void)0) --#define __bindtextdomain(D,P) ((void)0) -+#ifndef __UCLIBC_HAS_GETTEXT_AWARENESS__ -+#undef textdomain -+#undef bindtextdomain -+#define textdomain(D) ((void)0) -+#define bindtextdomain(D,P) ((void)0) - #endif - - // Non-virtual member functions. -@@ -70,7 +66,7 @@ - messages<_CharT>::open(const basic_string& __s, const locale& __loc, - const char* __dir) const - { -- __bindtextdomain(__s.c_str(), __dir); -+ bindtextdomain(__s.c_str(), __dir); - return this->do_open(__s, __loc); - } - -@@ -90,7 +86,7 @@ - { - // No error checking is done, assume the catalog exists and can - // be used. -- __textdomain(__s.c_str()); -+ textdomain(__s.c_str()); - return 0; - } - -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:45:39.000000000 +0200 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:45:39.000000000 +0200 -@@ -43,10 +43,6 @@ - #warning tailor for stub locale support - #endif - --#ifndef __UCLIBC_HAS_XLOCALE__ --#define __nl_langinfo_l(N, L) nl_langinfo((N)) --#endif -- - namespace std - { - // Construct and return valid pattern consisting of some combination of: -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:45:39.000000000 +0200 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:45:39.000000000 +0200 -@@ -41,9 +41,6 @@ - #ifdef __UCLIBC_MJN3_ONLY__ - #warning tailor for stub locale support - #endif --#ifndef __UCLIBC_HAS_XLOCALE__ --#define __nl_langinfo_l(N, L) nl_langinfo((N)) --#endif - - namespace std - { -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.cc ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.cc 2008-06-10 14:45:39.000000000 +0200 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.cc 2008-06-10 14:45:39.000000000 +0200 -@@ -40,9 +40,6 @@ - #ifdef __UCLIBC_MJN3_ONLY__ - #warning tailor for stub locale support - #endif --#ifndef __UCLIBC_HAS_XLOCALE__ --#define __nl_langinfo_l(N, L) nl_langinfo((N)) --#endif - - namespace std - { diff --git a/patches/gcc/4.3.0/675-uclibc-locale-no__x.patch b/patches/gcc/4.3.0/675-uclibc-locale-no__x.patch new file mode 100644 index 0000000..ff15ed1 --- /dev/null +++ b/patches/gcc/4.3.0/675-uclibc-locale-no__x.patch @@ -0,0 +1,224 @@ +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_203-uclibc-locale-no__x.patch +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2008-06-10 14:45:39.000000000 +0200 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2008-06-10 14:45:39.000000000 +0200 +@@ -60,4 +60,49 @@ + extern "C" __typeof(wctype_l) __wctype_l; + #endif + ++# define __nl_langinfo_l nl_langinfo_l ++# define __strcoll_l strcoll_l ++# define __strftime_l strftime_l ++# define __strtod_l strtod_l ++# define __strtof_l strtof_l ++# define __strtold_l strtold_l ++# define __strxfrm_l strxfrm_l ++# define __newlocale newlocale ++# define __freelocale freelocale ++# define __duplocale duplocale ++# define __uselocale uselocale ++ ++# ifdef _GLIBCXX_USE_WCHAR_T ++# define __iswctype_l iswctype_l ++# define __towlower_l towlower_l ++# define __towupper_l towupper_l ++# define __wcscoll_l wcscoll_l ++# define __wcsftime_l wcsftime_l ++# define __wcsxfrm_l wcsxfrm_l ++# define __wctype_l wctype_l ++# endif ++ ++#else ++# define __nl_langinfo_l(N, L) nl_langinfo((N)) ++# define __strcoll_l(S1, S2, L) strcoll((S1), (S2)) ++# define __strtod_l(S, E, L) strtod((S), (E)) ++# define __strtof_l(S, E, L) strtof((S), (E)) ++# define __strtold_l(S, E, L) strtold((S), (E)) ++# define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N)) ++# warning should dummy __newlocale check for C|POSIX ? ++# define __newlocale(a, b, c) NULL ++# define __freelocale(a) ((void)0) ++# define __duplocale(a) __c_locale() ++//# define __uselocale ? ++// ++# ifdef _GLIBCXX_USE_WCHAR_T ++# define __iswctype_l(C, M, L) iswctype((C), (M)) ++# define __towlower_l(C, L) towlower((C)) ++# define __towupper_l(C, L) towupper((C)) ++# define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2)) ++//# define __wcsftime_l(S, M, F, T, L) wcsftime((S), (M), (F), (T)) ++# define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N)) ++# define __wctype_l(S, L) wctype((S)) ++# endif ++ + #endif // GLIBC 2.3 and later +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.cc +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-06-10 14:45:39.000000000 +0200 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-06-10 14:45:39.000000000 +0200 +@@ -39,20 +39,6 @@ + #include + #include + +-#ifndef __UCLIBC_HAS_XLOCALE__ +-#define __strtol_l(S, E, B, L) strtol((S), (E), (B)) +-#define __strtoul_l(S, E, B, L) strtoul((S), (E), (B)) +-#define __strtoll_l(S, E, B, L) strtoll((S), (E), (B)) +-#define __strtoull_l(S, E, B, L) strtoull((S), (E), (B)) +-#define __strtof_l(S, E, L) strtof((S), (E)) +-#define __strtod_l(S, E, L) strtod((S), (E)) +-#define __strtold_l(S, E, L) strtold((S), (E)) +-#warning should dummy __newlocale check for C|POSIX ? +-#define __newlocale(a, b, c) NULL +-#define __freelocale(a) ((void)0) +-#define __duplocale(a) __c_locale() +-#endif +- + namespace std + { + template<> +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.h +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-06-10 14:45:39.000000000 +0200 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-06-10 14:45:39.000000000 +0200 +@@ -68,6 +68,7 @@ + { + extern "C" __typeof(uselocale) __uselocale; + } ++#define __uselocale uselocale + #endif + + namespace std +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/collate_members.cc +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc 2008-06-10 14:45:39.000000000 +0200 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/collate_members.cc 2008-06-10 14:45:39.000000000 +0200 +@@ -36,13 +36,6 @@ + #include + #include + +-#ifndef __UCLIBC_HAS_XLOCALE__ +-#define __strcoll_l(S1, S2, L) strcoll((S1), (S2)) +-#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N)) +-#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2)) +-#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N)) +-#endif +- + namespace std + { + // These are basically extensions to char_traits, and perhaps should +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-06-10 14:45:39.000000000 +0200 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-06-10 14:45:39.000000000 +0200 +@@ -38,13 +38,6 @@ + #undef _LIBC + #include + +-#ifndef __UCLIBC_HAS_XLOCALE__ +-#define __wctype_l(S, L) wctype((S)) +-#define __towupper_l(C, L) towupper((C)) +-#define __towlower_l(C, L) towlower((C)) +-#define __iswctype_l(C, M, L) iswctype((C), (M)) +-#endif +- + namespace std + { + // NB: The other ctype specializations are in src/locale.cc and +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.cc +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc 2008-06-10 14:45:39.000000000 +0200 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.cc 2008-06-10 14:45:39.000000000 +0200 +@@ -39,13 +39,10 @@ + #ifdef __UCLIBC_MJN3_ONLY__ + #warning fix gettext stuff + #endif +-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ +-extern "C" char *__dcgettext(const char *domainname, +- const char *msgid, int category); + #undef gettext +-#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES) ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ ++#define gettext(msgid) dcgettext(NULL, msgid, LC_MESSAGES) + #else +-#undef gettext + #define gettext(msgid) (msgid) + #endif + +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:45:39.000000000 +0200 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:45:39.000000000 +0200 +@@ -36,15 +36,11 @@ + #ifdef __UCLIBC_MJN3_ONLY__ + #warning fix prototypes for *textdomain funcs + #endif +-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ +-extern "C" char *__textdomain(const char *domainname); +-extern "C" char *__bindtextdomain(const char *domainname, +- const char *dirname); +-#else +-#undef __textdomain +-#undef __bindtextdomain +-#define __textdomain(D) ((void)0) +-#define __bindtextdomain(D,P) ((void)0) ++#ifndef __UCLIBC_HAS_GETTEXT_AWARENESS__ ++#undef textdomain ++#undef bindtextdomain ++#define textdomain(D) ((void)0) ++#define bindtextdomain(D,P) ((void)0) + #endif + + // Non-virtual member functions. +@@ -70,7 +66,7 @@ + messages<_CharT>::open(const basic_string& __s, const locale& __loc, + const char* __dir) const + { +- __bindtextdomain(__s.c_str(), __dir); ++ bindtextdomain(__s.c_str(), __dir); + return this->do_open(__s, __loc); + } + +@@ -90,7 +86,7 @@ + { + // No error checking is done, assume the catalog exists and can + // be used. +- __textdomain(__s.c_str()); ++ textdomain(__s.c_str()); + return 0; + } + +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:45:39.000000000 +0200 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:45:39.000000000 +0200 +@@ -43,10 +43,6 @@ + #warning tailor for stub locale support + #endif + +-#ifndef __UCLIBC_HAS_XLOCALE__ +-#define __nl_langinfo_l(N, L) nl_langinfo((N)) +-#endif +- + namespace std + { + // Construct and return valid pattern consisting of some combination of: +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:45:39.000000000 +0200 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:45:39.000000000 +0200 +@@ -41,9 +41,6 @@ + #ifdef __UCLIBC_MJN3_ONLY__ + #warning tailor for stub locale support + #endif +-#ifndef __UCLIBC_HAS_XLOCALE__ +-#define __nl_langinfo_l(N, L) nl_langinfo((N)) +-#endif + + namespace std + { +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.cc +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.cc 2008-06-10 14:45:39.000000000 +0200 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.cc 2008-06-10 14:45:39.000000000 +0200 +@@ -40,9 +40,6 @@ + #ifdef __UCLIBC_MJN3_ONLY__ + #warning tailor for stub locale support + #endif +-#ifndef __UCLIBC_HAS_XLOCALE__ +-#define __nl_langinfo_l(N, L) nl_langinfo((N)) +-#endif + + namespace std + { diff --git a/patches/gcc/4.3.0/700-204-uclibc-locale-wchar_fix.patch b/patches/gcc/4.3.0/700-204-uclibc-locale-wchar_fix.patch deleted file mode 100644 index a20ba94..0000000 --- a/patches/gcc/4.3.0/700-204-uclibc-locale-wchar_fix.patch +++ /dev/null @@ -1,51 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_204-uclibc-locale-wchar_fix.patch -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:45:43.000000000 +0200 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:45:43.000000000 +0200 -@@ -401,7 +401,7 @@ - # ifdef __UCLIBC_HAS_XLOCALE__ - _M_data->_M_decimal_point = __cloc->decimal_point_wc; - _M_data->_M_thousands_sep = __cloc->thousands_sep_wc; --# else -+# elif defined __UCLIBC_HAS_LOCALE__ - _M_data->_M_decimal_point = __global_locale->decimal_point_wc; - _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc; - # endif -@@ -556,7 +556,7 @@ - # ifdef __UCLIBC_HAS_XLOCALE__ - _M_data->_M_decimal_point = __cloc->decimal_point_wc; - _M_data->_M_thousands_sep = __cloc->thousands_sep_wc; --# else -+# elif defined __UCLIBC_HAS_LOCALE__ - _M_data->_M_decimal_point = __global_locale->decimal_point_wc; - _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc; - # endif -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:45:43.000000000 +0200 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:45:43.000000000 +0200 -@@ -127,12 +127,25 @@ - { - // Named locale. - // NB: In the GNU model wchar_t is always 32 bit wide. -+#ifdef __UCLIBC_MJN3_ONLY__ -+#warning fix this... should be numeric -+#endif -+#ifdef __UCLIBC__ -+# ifdef __UCLIBC_HAS_XLOCALE__ -+ _M_data->_M_decimal_point = __cloc->decimal_point_wc; -+ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc; -+# elif defined __UCLIBC_HAS_LOCALE__ -+ _M_data->_M_decimal_point = __global_locale->decimal_point_wc; -+ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc; -+# endif -+#else - union { char *__s; wchar_t __w; } __u; - __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc); - _M_data->_M_decimal_point = __u.__w; - - __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc); - _M_data->_M_thousands_sep = __u.__w; -+#endif - - if (_M_data->_M_thousands_sep == L'\0') - _M_data->_M_grouping = ""; diff --git a/patches/gcc/4.3.0/700-uclibc-locale-wchar_fix.patch b/patches/gcc/4.3.0/700-uclibc-locale-wchar_fix.patch new file mode 100644 index 0000000..a20ba94 --- /dev/null +++ b/patches/gcc/4.3.0/700-uclibc-locale-wchar_fix.patch @@ -0,0 +1,51 @@ +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_204-uclibc-locale-wchar_fix.patch +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:45:43.000000000 +0200 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:45:43.000000000 +0200 +@@ -401,7 +401,7 @@ + # ifdef __UCLIBC_HAS_XLOCALE__ + _M_data->_M_decimal_point = __cloc->decimal_point_wc; + _M_data->_M_thousands_sep = __cloc->thousands_sep_wc; +-# else ++# elif defined __UCLIBC_HAS_LOCALE__ + _M_data->_M_decimal_point = __global_locale->decimal_point_wc; + _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc; + # endif +@@ -556,7 +556,7 @@ + # ifdef __UCLIBC_HAS_XLOCALE__ + _M_data->_M_decimal_point = __cloc->decimal_point_wc; + _M_data->_M_thousands_sep = __cloc->thousands_sep_wc; +-# else ++# elif defined __UCLIBC_HAS_LOCALE__ + _M_data->_M_decimal_point = __global_locale->decimal_point_wc; + _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc; + # endif +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:45:43.000000000 +0200 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:45:43.000000000 +0200 +@@ -127,12 +127,25 @@ + { + // Named locale. + // NB: In the GNU model wchar_t is always 32 bit wide. ++#ifdef __UCLIBC_MJN3_ONLY__ ++#warning fix this... should be numeric ++#endif ++#ifdef __UCLIBC__ ++# ifdef __UCLIBC_HAS_XLOCALE__ ++ _M_data->_M_decimal_point = __cloc->decimal_point_wc; ++ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc; ++# elif defined __UCLIBC_HAS_LOCALE__ ++ _M_data->_M_decimal_point = __global_locale->decimal_point_wc; ++ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc; ++# endif ++#else + union { char *__s; wchar_t __w; } __u; + __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc); + _M_data->_M_decimal_point = __u.__w; + + __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc); + _M_data->_M_thousands_sep = __u.__w; ++#endif + + if (_M_data->_M_thousands_sep == L'\0') + _M_data->_M_grouping = ""; diff --git a/patches/gcc/4.3.0/725-205-uclibc-locale-update.patch b/patches/gcc/4.3.0/725-205-uclibc-locale-update.patch deleted file mode 100644 index 7ee6aff..0000000 --- a/patches/gcc/4.3.0/725-205-uclibc-locale-update.patch +++ /dev/null @@ -1,355 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_205-uclibc-locale-update.patch -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.cc ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-06-10 14:45:43.000000000 +0200 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-06-10 14:45:46.000000000 +0200 -@@ -46,16 +46,13 @@ - __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, - const __c_locale& __cloc) - { -- if (!(__err & ios_base::failbit)) -- { -- char* __sanity; -- errno = 0; -- float __f = __strtof_l(__s, &__sanity, __cloc); -- if (__sanity != __s && errno != ERANGE) -- __v = __f; -- else -- __err |= ios_base::failbit; -- } -+ char* __sanity; -+ errno = 0; -+ float __f = __strtof_l(__s, &__sanity, __cloc); -+ if (__sanity != __s && errno != ERANGE) -+ __v = __f; -+ else -+ __err |= ios_base::failbit; - } - - template<> -@@ -63,16 +60,13 @@ - __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, - const __c_locale& __cloc) - { -- if (!(__err & ios_base::failbit)) -- { -- char* __sanity; -- errno = 0; -- double __d = __strtod_l(__s, &__sanity, __cloc); -- if (__sanity != __s && errno != ERANGE) -- __v = __d; -- else -- __err |= ios_base::failbit; -- } -+ char* __sanity; -+ errno = 0; -+ double __d = __strtod_l(__s, &__sanity, __cloc); -+ if (__sanity != __s && errno != ERANGE) -+ __v = __d; -+ else -+ __err |= ios_base::failbit; - } - - template<> -@@ -80,16 +74,13 @@ - __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err, - const __c_locale& __cloc) - { -- if (!(__err & ios_base::failbit)) -- { -- char* __sanity; -- errno = 0; -- long double __ld = __strtold_l(__s, &__sanity, __cloc); -- if (__sanity != __s && errno != ERANGE) -- __v = __ld; -- else -- __err |= ios_base::failbit; -- } -+ char* __sanity; -+ errno = 0; -+ long double __ld = __strtold_l(__s, &__sanity, __cloc); -+ if (__sanity != __s && errno != ERANGE) -+ __v = __ld; -+ else -+ __err |= ios_base::failbit; - } - - void -@@ -110,7 +101,7 @@ - void - locale::facet::_S_destroy_c_locale(__c_locale& __cloc) - { -- if (_S_get_c_locale() != __cloc) -+ if (__cloc && _S_get_c_locale() != __cloc) - __freelocale(__cloc); - } - -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.h ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-06-10 14:45:43.000000000 +0200 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-06-10 14:45:46.000000000 +0200 -@@ -39,21 +39,23 @@ - #pragma GCC system_header - - #include // get std::strlen --#include // get std::snprintf or std::sprintf -+#include // get std::vsnprintf or std::vsprintf - #include - #include // For codecvt - #ifdef __UCLIBC_MJN3_ONLY__ - #warning fix this - #endif --#ifdef __UCLIBC_HAS_LOCALE__ -+#ifdef _GLIBCXX_USE_ICONV - #include // For codecvt using iconv, iconv_t - #endif --#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ --#include // For messages -+#ifdef HAVE_LIBINTL_H -+#include // For messages - #endif -+#include - - #ifdef __UCLIBC_MJN3_ONLY__ - #warning what is _GLIBCXX_C_LOCALE_GNU for -+// psm: used in os/gnu-linux/ctype_noninline.h - #endif - #define _GLIBCXX_C_LOCALE_GNU 1 - -@@ -62,7 +64,7 @@ - #endif - // #define _GLIBCXX_NUM_CATEGORIES 6 - #define _GLIBCXX_NUM_CATEGORIES 0 -- -+ - #ifdef __UCLIBC_HAS_XLOCALE__ - namespace __gnu_cxx - { -@@ -79,22 +81,24 @@ - typedef int* __c_locale; - #endif - -- // Convert numeric value of type _Tv to string and return length of -- // string. If snprintf is available use it, otherwise fall back to -- // the unsafe sprintf which, in general, can be dangerous and should -+ // Convert numeric value of type double to string and return length of -+ // string. If vsnprintf is available use it, otherwise fall back to -+ // the unsafe vsprintf which, in general, can be dangerous and should - // be avoided. -- template -- int -- __convert_from_v(char* __out, -- const int __size __attribute__ ((__unused__)), -- const char* __fmt, --#ifdef __UCLIBC_HAS_XCLOCALE__ -- _Tv __v, const __c_locale& __cloc, int __prec) -+ inline int -+ __convert_from_v(const __c_locale& -+#ifndef __UCLIBC_HAS_XCLOCALE__ -+ __cloc __attribute__ ((__unused__)) -+#endif -+ , -+ char* __out, -+ const int __size, -+ const char* __fmt, ...) - { -+ va_list __args; -+#ifdef __UCLIBC_HAS_XCLOCALE__ - __c_locale __old = __gnu_cxx::__uselocale(__cloc); - #else -- _Tv __v, const __c_locale&, int __prec) -- { - # ifdef __UCLIBC_HAS_LOCALE__ - char* __old = std::setlocale(LC_ALL, NULL); - char* __sav = new char[std::strlen(__old) + 1]; -@@ -103,7 +107,9 @@ - # endif - #endif - -- const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v); -+ va_start(__args, __fmt); -+ const int __ret = std::vsnprintf(__out, __size, __fmt, __args); -+ va_end(__args); - - #ifdef __UCLIBC_HAS_XCLOCALE__ - __gnu_cxx::__uselocale(__old); -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-06-10 14:45:43.000000000 +0200 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-06-10 14:45:46.000000000 +0200 -@@ -33,9 +33,14 @@ - - // Written by Benjamin Kosnik - -+#include -+#ifdef __UCLIBC_HAS_LOCALE__ - #define _LIBC - #include - #undef _LIBC -+#else -+#include -+#endif - #include - - namespace std -@@ -138,20 +143,34 @@ - ctype:: - do_is(mask __m, wchar_t __c) const - { -- // Highest bitmask in ctype_base == 10, but extra in "C" -- // library for blank. -+ // The case of __m == ctype_base::space is particularly important, -+ // due to its use in many istream functions. Therefore we deal with -+ // it first, exploiting the knowledge that on GNU systems _M_bit[5] -+ // is the mask corresponding to ctype_base::space. NB: an encoding -+ // change would not affect correctness! - bool __ret = false; -- const size_t __bitmasksize = 11; -- for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur) -- if (__m & _M_bit[__bitcur] -- && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype)) -- { -- __ret = true; -- break; -- } -+ if (__m == _M_bit[5]) -+ __ret = __iswctype_l(__c, _M_wmask[5], _M_c_locale_ctype); -+ else -+ { -+ // Highest bitmask in ctype_base == 10, but extra in "C" -+ // library for blank. -+ const size_t __bitmasksize = 11; -+ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur) -+ if (__m & _M_bit[__bitcur]) -+ { -+ if (__iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype)) -+ { -+ __ret = true; -+ break; -+ } -+ else if (__m == _M_bit[__bitcur]) -+ break; -+ } -+ } - return __ret; - } -- -+ - const wchar_t* - ctype:: - do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:45:43.000000000 +0200 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:45:46.000000000 +0200 -@@ -47,18 +47,21 @@ - template - messages<_CharT>::messages(size_t __refs) - : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), -- _M_name_messages(_S_get_c_name()) -+ _M_name_messages(_S_get_c_name()) - { } - - template - messages<_CharT>::messages(__c_locale __cloc, const char* __s, - size_t __refs) -- : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)), -- _M_name_messages(__s) -+ : facet(__refs), _M_c_locale_messages(NULL), _M_name_messages(NULL) - { -- char* __tmp = new char[std::strlen(__s) + 1]; -- std::strcpy(__tmp, __s); -+ const size_t __len = std::strlen(__s) + 1; -+ char* __tmp = new char[__len]; -+ std::memcpy(__tmp, __s, __len); - _M_name_messages = __tmp; -+ -+ // Last to avoid leaking memory if new throws. -+ _M_c_locale_messages = _S_clone_c_locale(__cloc); - } - - template -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:45:46.000000000 +0200 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:45:46.000000000 +0200 -@@ -33,9 +33,14 @@ - - // Written by Benjamin Kosnik - -+#include -+#ifdef __UCLIBC_HAS_LOCALE__ - #define _LIBC - #include - #undef _LIBC -+#else -+#include -+#endif - #include - - #ifdef __UCLIBC_MJN3_ONLY__ -@@ -206,7 +211,7 @@ - } - break; - default: -- ; -+ __ret = pattern(); - } - return __ret; - } -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:45:46.000000000 +0200 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:45:46.000000000 +0200 -@@ -33,9 +33,14 @@ - - // Written by Benjamin Kosnik - -+#include -+#ifdef __UCLIBC_HAS_LOCALE__ - #define _LIBC - #include - #undef _LIBC -+#else -+#include -+#endif - #include - - #ifdef __UCLIBC_MJN3_ONLY__ -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.h ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.h 2008-06-10 14:45:39.000000000 +0200 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.h 2008-06-10 14:45:46.000000000 +0200 -@@ -37,25 +37,33 @@ - template - __timepunct<_CharT>::__timepunct(size_t __refs) - : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), -- _M_name_timepunct(_S_get_c_name()) -+ _M_name_timepunct(_S_get_c_name()) - { _M_initialize_timepunct(); } - - template - __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) - : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), -- _M_name_timepunct(_S_get_c_name()) -+ _M_name_timepunct(_S_get_c_name()) - { _M_initialize_timepunct(); } - - template - __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s, - size_t __refs) - : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), -- _M_name_timepunct(__s) -+ _M_name_timepunct(NULL) - { -- char* __tmp = new char[std::strlen(__s) + 1]; -- std::strcpy(__tmp, __s); -+ const size_t __len = std::strlen(__s) + 1; -+ char* __tmp = new char[__len]; -+ std::memcpy(__tmp, __s, __len); - _M_name_timepunct = __tmp; -- _M_initialize_timepunct(__cloc); -+ -+ try -+ { _M_initialize_timepunct(__cloc); } -+ catch(...) -+ { -+ delete [] _M_name_timepunct; -+ __throw_exception_again; -+ } - } - - template diff --git a/patches/gcc/4.3.0/725-uclibc-locale-update.patch b/patches/gcc/4.3.0/725-uclibc-locale-update.patch new file mode 100644 index 0000000..7ee6aff --- /dev/null +++ b/patches/gcc/4.3.0/725-uclibc-locale-update.patch @@ -0,0 +1,355 @@ +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_205-uclibc-locale-update.patch +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.cc +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-06-10 14:45:43.000000000 +0200 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-06-10 14:45:46.000000000 +0200 +@@ -46,16 +46,13 @@ + __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, + const __c_locale& __cloc) + { +- if (!(__err & ios_base::failbit)) +- { +- char* __sanity; +- errno = 0; +- float __f = __strtof_l(__s, &__sanity, __cloc); +- if (__sanity != __s && errno != ERANGE) +- __v = __f; +- else +- __err |= ios_base::failbit; +- } ++ char* __sanity; ++ errno = 0; ++ float __f = __strtof_l(__s, &__sanity, __cloc); ++ if (__sanity != __s && errno != ERANGE) ++ __v = __f; ++ else ++ __err |= ios_base::failbit; + } + + template<> +@@ -63,16 +60,13 @@ + __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, + const __c_locale& __cloc) + { +- if (!(__err & ios_base::failbit)) +- { +- char* __sanity; +- errno = 0; +- double __d = __strtod_l(__s, &__sanity, __cloc); +- if (__sanity != __s && errno != ERANGE) +- __v = __d; +- else +- __err |= ios_base::failbit; +- } ++ char* __sanity; ++ errno = 0; ++ double __d = __strtod_l(__s, &__sanity, __cloc); ++ if (__sanity != __s && errno != ERANGE) ++ __v = __d; ++ else ++ __err |= ios_base::failbit; + } + + template<> +@@ -80,16 +74,13 @@ + __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err, + const __c_locale& __cloc) + { +- if (!(__err & ios_base::failbit)) +- { +- char* __sanity; +- errno = 0; +- long double __ld = __strtold_l(__s, &__sanity, __cloc); +- if (__sanity != __s && errno != ERANGE) +- __v = __ld; +- else +- __err |= ios_base::failbit; +- } ++ char* __sanity; ++ errno = 0; ++ long double __ld = __strtold_l(__s, &__sanity, __cloc); ++ if (__sanity != __s && errno != ERANGE) ++ __v = __ld; ++ else ++ __err |= ios_base::failbit; + } + + void +@@ -110,7 +101,7 @@ + void + locale::facet::_S_destroy_c_locale(__c_locale& __cloc) + { +- if (_S_get_c_locale() != __cloc) ++ if (__cloc && _S_get_c_locale() != __cloc) + __freelocale(__cloc); + } + +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.h +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-06-10 14:45:43.000000000 +0200 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-06-10 14:45:46.000000000 +0200 +@@ -39,21 +39,23 @@ + #pragma GCC system_header + + #include // get std::strlen +-#include // get std::snprintf or std::sprintf ++#include // get std::vsnprintf or std::vsprintf + #include + #include // For codecvt + #ifdef __UCLIBC_MJN3_ONLY__ + #warning fix this + #endif +-#ifdef __UCLIBC_HAS_LOCALE__ ++#ifdef _GLIBCXX_USE_ICONV + #include // For codecvt using iconv, iconv_t + #endif +-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ +-#include // For messages ++#ifdef HAVE_LIBINTL_H ++#include // For messages + #endif ++#include + + #ifdef __UCLIBC_MJN3_ONLY__ + #warning what is _GLIBCXX_C_LOCALE_GNU for ++// psm: used in os/gnu-linux/ctype_noninline.h + #endif + #define _GLIBCXX_C_LOCALE_GNU 1 + +@@ -62,7 +64,7 @@ + #endif + // #define _GLIBCXX_NUM_CATEGORIES 6 + #define _GLIBCXX_NUM_CATEGORIES 0 +- ++ + #ifdef __UCLIBC_HAS_XLOCALE__ + namespace __gnu_cxx + { +@@ -79,22 +81,24 @@ + typedef int* __c_locale; + #endif + +- // Convert numeric value of type _Tv to string and return length of +- // string. If snprintf is available use it, otherwise fall back to +- // the unsafe sprintf which, in general, can be dangerous and should ++ // Convert numeric value of type double to string and return length of ++ // string. If vsnprintf is available use it, otherwise fall back to ++ // the unsafe vsprintf which, in general, can be dangerous and should + // be avoided. +- template +- int +- __convert_from_v(char* __out, +- const int __size __attribute__ ((__unused__)), +- const char* __fmt, +-#ifdef __UCLIBC_HAS_XCLOCALE__ +- _Tv __v, const __c_locale& __cloc, int __prec) ++ inline int ++ __convert_from_v(const __c_locale& ++#ifndef __UCLIBC_HAS_XCLOCALE__ ++ __cloc __attribute__ ((__unused__)) ++#endif ++ , ++ char* __out, ++ const int __size, ++ const char* __fmt, ...) + { ++ va_list __args; ++#ifdef __UCLIBC_HAS_XCLOCALE__ + __c_locale __old = __gnu_cxx::__uselocale(__cloc); + #else +- _Tv __v, const __c_locale&, int __prec) +- { + # ifdef __UCLIBC_HAS_LOCALE__ + char* __old = std::setlocale(LC_ALL, NULL); + char* __sav = new char[std::strlen(__old) + 1]; +@@ -103,7 +107,9 @@ + # endif + #endif + +- const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v); ++ va_start(__args, __fmt); ++ const int __ret = std::vsnprintf(__out, __size, __fmt, __args); ++ va_end(__args); + + #ifdef __UCLIBC_HAS_XCLOCALE__ + __gnu_cxx::__uselocale(__old); +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-06-10 14:45:43.000000000 +0200 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-06-10 14:45:46.000000000 +0200 +@@ -33,9 +33,14 @@ + + // Written by Benjamin Kosnik + ++#include ++#ifdef __UCLIBC_HAS_LOCALE__ + #define _LIBC + #include + #undef _LIBC ++#else ++#include ++#endif + #include + + namespace std +@@ -138,20 +143,34 @@ + ctype:: + do_is(mask __m, wchar_t __c) const + { +- // Highest bitmask in ctype_base == 10, but extra in "C" +- // library for blank. ++ // The case of __m == ctype_base::space is particularly important, ++ // due to its use in many istream functions. Therefore we deal with ++ // it first, exploiting the knowledge that on GNU systems _M_bit[5] ++ // is the mask corresponding to ctype_base::space. NB: an encoding ++ // change would not affect correctness! + bool __ret = false; +- const size_t __bitmasksize = 11; +- for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur) +- if (__m & _M_bit[__bitcur] +- && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype)) +- { +- __ret = true; +- break; +- } ++ if (__m == _M_bit[5]) ++ __ret = __iswctype_l(__c, _M_wmask[5], _M_c_locale_ctype); ++ else ++ { ++ // Highest bitmask in ctype_base == 10, but extra in "C" ++ // library for blank. ++ const size_t __bitmasksize = 11; ++ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur) ++ if (__m & _M_bit[__bitcur]) ++ { ++ if (__iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype)) ++ { ++ __ret = true; ++ break; ++ } ++ else if (__m == _M_bit[__bitcur]) ++ break; ++ } ++ } + return __ret; + } +- ++ + const wchar_t* + ctype:: + do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:45:43.000000000 +0200 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:45:46.000000000 +0200 +@@ -47,18 +47,21 @@ + template + messages<_CharT>::messages(size_t __refs) + : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), +- _M_name_messages(_S_get_c_name()) ++ _M_name_messages(_S_get_c_name()) + { } + + template + messages<_CharT>::messages(__c_locale __cloc, const char* __s, + size_t __refs) +- : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)), +- _M_name_messages(__s) ++ : facet(__refs), _M_c_locale_messages(NULL), _M_name_messages(NULL) + { +- char* __tmp = new char[std::strlen(__s) + 1]; +- std::strcpy(__tmp, __s); ++ const size_t __len = std::strlen(__s) + 1; ++ char* __tmp = new char[__len]; ++ std::memcpy(__tmp, __s, __len); + _M_name_messages = __tmp; ++ ++ // Last to avoid leaking memory if new throws. ++ _M_c_locale_messages = _S_clone_c_locale(__cloc); + } + + template +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:45:46.000000000 +0200 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:45:46.000000000 +0200 +@@ -33,9 +33,14 @@ + + // Written by Benjamin Kosnik + ++#include ++#ifdef __UCLIBC_HAS_LOCALE__ + #define _LIBC + #include + #undef _LIBC ++#else ++#include ++#endif + #include + + #ifdef __UCLIBC_MJN3_ONLY__ +@@ -206,7 +211,7 @@ + } + break; + default: +- ; ++ __ret = pattern(); + } + return __ret; + } +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:45:46.000000000 +0200 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:45:46.000000000 +0200 +@@ -33,9 +33,14 @@ + + // Written by Benjamin Kosnik + ++#include ++#ifdef __UCLIBC_HAS_LOCALE__ + #define _LIBC + #include + #undef _LIBC ++#else ++#include ++#endif + #include + + #ifdef __UCLIBC_MJN3_ONLY__ +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.h +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.h 2008-06-10 14:45:39.000000000 +0200 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.h 2008-06-10 14:45:46.000000000 +0200 +@@ -37,25 +37,33 @@ + template + __timepunct<_CharT>::__timepunct(size_t __refs) + : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), +- _M_name_timepunct(_S_get_c_name()) ++ _M_name_timepunct(_S_get_c_name()) + { _M_initialize_timepunct(); } + + template + __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) + : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), +- _M_name_timepunct(_S_get_c_name()) ++ _M_name_timepunct(_S_get_c_name()) + { _M_initialize_timepunct(); } + + template + __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s, + size_t __refs) + : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), +- _M_name_timepunct(__s) ++ _M_name_timepunct(NULL) + { +- char* __tmp = new char[std::strlen(__s) + 1]; +- std::strcpy(__tmp, __s); ++ const size_t __len = std::strlen(__s) + 1; ++ char* __tmp = new char[__len]; ++ std::memcpy(__tmp, __s, __len); + _M_name_timepunct = __tmp; +- _M_initialize_timepunct(__cloc); ++ ++ try ++ { _M_initialize_timepunct(__cloc); } ++ catch(...) ++ { ++ delete [] _M_name_timepunct; ++ __throw_exception_again; ++ } + } + + template diff --git a/patches/gcc/4.3.0/750-301-missing-execinfo_h.patch b/patches/gcc/4.3.0/750-301-missing-execinfo_h.patch deleted file mode 100644 index d6dcd80..0000000 --- a/patches/gcc/4.3.0/750-301-missing-execinfo_h.patch +++ /dev/null @@ -1,13 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_301-missing-execinfo_h.patch -diff -durN gcc-4.3.0.orig/boehm-gc/include/gc.h gcc-4.3.0/boehm-gc/include/gc.h ---- gcc-4.3.0.orig/boehm-gc/include/gc.h 2007-04-23 23:10:09.000000000 +0200 -+++ gcc-4.3.0/boehm-gc/include/gc.h 2008-06-10 14:45:50.000000000 +0200 -@@ -503,7 +503,7 @@ - #if defined(__linux__) || defined(__GLIBC__) - # include - # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \ -- && !defined(__ia64__) -+ && !defined(__ia64__) && !defined(__UCLIBC__) - # ifndef GC_HAVE_BUILTIN_BACKTRACE - # define GC_HAVE_BUILTIN_BACKTRACE - # endif diff --git a/patches/gcc/4.3.0/750-missing-execinfo_h.patch b/patches/gcc/4.3.0/750-missing-execinfo_h.patch new file mode 100644 index 0000000..d6dcd80 --- /dev/null +++ b/patches/gcc/4.3.0/750-missing-execinfo_h.patch @@ -0,0 +1,13 @@ +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_301-missing-execinfo_h.patch +diff -durN gcc-4.3.0.orig/boehm-gc/include/gc.h gcc-4.3.0/boehm-gc/include/gc.h +--- gcc-4.3.0.orig/boehm-gc/include/gc.h 2007-04-23 23:10:09.000000000 +0200 ++++ gcc-4.3.0/boehm-gc/include/gc.h 2008-06-10 14:45:50.000000000 +0200 +@@ -503,7 +503,7 @@ + #if defined(__linux__) || defined(__GLIBC__) + # include + # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \ +- && !defined(__ia64__) ++ && !defined(__ia64__) && !defined(__UCLIBC__) + # ifndef GC_HAVE_BUILTIN_BACKTRACE + # define GC_HAVE_BUILTIN_BACKTRACE + # endif diff --git a/patches/gcc/4.3.0/775-303-c99-complex-ugly-hack.patch b/patches/gcc/4.3.0/775-303-c99-complex-ugly-hack.patch deleted file mode 100644 index 1ad238b..0000000 --- a/patches/gcc/4.3.0/775-303-c99-complex-ugly-hack.patch +++ /dev/null @@ -1,14 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_303-c99-complex-ugly-hack.patch -diff -durN gcc-4.3.0.orig/libstdc++-v3/configure gcc-4.3.0/libstdc++-v3/configure ---- gcc-4.3.0.orig/libstdc++-v3/configure 2008-06-10 14:45:39.000000000 +0200 -+++ gcc-4.3.0/libstdc++-v3/configure 2008-06-10 14:45:54.000000000 +0200 -@@ -39006,6 +39006,9 @@ - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - #include -+#ifdef __UCLIBC__ -+#error ugly hack to make sure configure test fails here for cross until uClibc supports the complex funcs -+#endif - int - main () - { diff --git a/patches/gcc/4.3.0/775-c99-complex-ugly-hack.patch b/patches/gcc/4.3.0/775-c99-complex-ugly-hack.patch new file mode 100644 index 0000000..1ad238b --- /dev/null +++ b/patches/gcc/4.3.0/775-c99-complex-ugly-hack.patch @@ -0,0 +1,14 @@ +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_303-c99-complex-ugly-hack.patch +diff -durN gcc-4.3.0.orig/libstdc++-v3/configure gcc-4.3.0/libstdc++-v3/configure +--- gcc-4.3.0.orig/libstdc++-v3/configure 2008-06-10 14:45:39.000000000 +0200 ++++ gcc-4.3.0/libstdc++-v3/configure 2008-06-10 14:45:54.000000000 +0200 +@@ -39006,6 +39006,9 @@ + cat >>conftest.$ac_ext <<_ACEOF + /* end confdefs.h. */ + #include ++#ifdef __UCLIBC__ ++#error ugly hack to make sure configure test fails here for cross until uClibc supports the complex funcs ++#endif + int + main () + { diff --git a/patches/gcc/4.3.0/800-304-index_macro.patch b/patches/gcc/4.3.0/800-304-index_macro.patch deleted file mode 100644 index ec42836..0000000 --- a/patches/gcc/4.3.0/800-304-index_macro.patch +++ /dev/null @@ -1,27 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_304-index_macro.patch -diff -durN gcc-4.3.0.orig/libstdc++-v3/include/ext/rope gcc-4.3.0/libstdc++-v3/include/ext/rope ---- gcc-4.3.0.orig/libstdc++-v3/include/ext/rope 2008-01-31 19:44:55.000000000 +0100 -+++ gcc-4.3.0/libstdc++-v3/include/ext/rope 2008-06-10 14:45:58.000000000 +0200 -@@ -59,6 +59,9 @@ - #include - #include - -+/* cope w/ index defined as macro, SuSv3 proposal */ -+#undef index -+ - # ifdef __GC - # define __GC_CONST const - # else -diff -durN gcc-4.3.0.orig/libstdc++-v3/include/ext/ropeimpl.h gcc-4.3.0/libstdc++-v3/include/ext/ropeimpl.h ---- gcc-4.3.0.orig/libstdc++-v3/include/ext/ropeimpl.h 2007-05-04 17:06:46.000000000 +0200 -+++ gcc-4.3.0/libstdc++-v3/include/ext/ropeimpl.h 2008-06-10 14:45:58.000000000 +0200 -@@ -54,6 +54,9 @@ - #include // For uninitialized_copy_n - #include // For power - -+/* cope w/ index defined as macro, SuSv3 proposal */ -+#undef index -+ - _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) - - using std::size_t; diff --git a/patches/gcc/4.3.0/800-index_macro.patch b/patches/gcc/4.3.0/800-index_macro.patch new file mode 100644 index 0000000..ec42836 --- /dev/null +++ b/patches/gcc/4.3.0/800-index_macro.patch @@ -0,0 +1,27 @@ +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_304-index_macro.patch +diff -durN gcc-4.3.0.orig/libstdc++-v3/include/ext/rope gcc-4.3.0/libstdc++-v3/include/ext/rope +--- gcc-4.3.0.orig/libstdc++-v3/include/ext/rope 2008-01-31 19:44:55.000000000 +0100 ++++ gcc-4.3.0/libstdc++-v3/include/ext/rope 2008-06-10 14:45:58.000000000 +0200 +@@ -59,6 +59,9 @@ + #include + #include + ++/* cope w/ index defined as macro, SuSv3 proposal */ ++#undef index ++ + # ifdef __GC + # define __GC_CONST const + # else +diff -durN gcc-4.3.0.orig/libstdc++-v3/include/ext/ropeimpl.h gcc-4.3.0/libstdc++-v3/include/ext/ropeimpl.h +--- gcc-4.3.0.orig/libstdc++-v3/include/ext/ropeimpl.h 2007-05-04 17:06:46.000000000 +0200 ++++ gcc-4.3.0/libstdc++-v3/include/ext/ropeimpl.h 2008-06-10 14:45:58.000000000 +0200 +@@ -54,6 +54,9 @@ + #include // For uninitialized_copy_n + #include // For power + ++/* cope w/ index defined as macro, SuSv3 proposal */ ++#undef index ++ + _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) + + using std::size_t; diff --git a/patches/gcc/4.3.0/825-305-libmudflap-susv3-legacy.patch b/patches/gcc/4.3.0/825-305-libmudflap-susv3-legacy.patch deleted file mode 100644 index 6793375..0000000 --- a/patches/gcc/4.3.0/825-305-libmudflap-susv3-legacy.patch +++ /dev/null @@ -1,49 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_305-libmudflap-susv3-legacy.patch -diff -durN gcc-4.3.0.orig/libmudflap/mf-hooks2.c gcc-4.3.0/libmudflap/mf-hooks2.c ---- gcc-4.3.0.orig/libmudflap/mf-hooks2.c 2005-09-23 23:58:39.000000000 +0200 -+++ gcc-4.3.0/libmudflap/mf-hooks2.c 2008-06-10 14:46:02.000000000 +0200 -@@ -427,7 +427,7 @@ - { - TRACE ("%s\n", __PRETTY_FUNCTION__); - MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region"); -- bzero (s, n); -+ memset (s, 0, n); - } - - -@@ -437,7 +437,7 @@ - TRACE ("%s\n", __PRETTY_FUNCTION__); - MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src"); - MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest"); -- bcopy (src, dest, n); -+ memmove (dest, src, n); - } - - -@@ -447,7 +447,7 @@ - TRACE ("%s\n", __PRETTY_FUNCTION__); - MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg"); - MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg"); -- return bcmp (s1, s2, n); -+ return memcmp (s1, s2, n); - } - - -@@ -456,7 +456,7 @@ - size_t n = strlen (s); - TRACE ("%s\n", __PRETTY_FUNCTION__); - MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region"); -- return index (s, c); -+ return strchr (s, c); - } - - -@@ -465,7 +465,7 @@ - size_t n = strlen (s); - TRACE ("%s\n", __PRETTY_FUNCTION__); - MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region"); -- return rindex (s, c); -+ return strrchr (s, c); - } - - /* XXX: stpcpy, memccpy */ diff --git a/patches/gcc/4.3.0/825-libmudflap-susv3-legacy.patch b/patches/gcc/4.3.0/825-libmudflap-susv3-legacy.patch new file mode 100644 index 0000000..6793375 --- /dev/null +++ b/patches/gcc/4.3.0/825-libmudflap-susv3-legacy.patch @@ -0,0 +1,49 @@ +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_305-libmudflap-susv3-legacy.patch +diff -durN gcc-4.3.0.orig/libmudflap/mf-hooks2.c gcc-4.3.0/libmudflap/mf-hooks2.c +--- gcc-4.3.0.orig/libmudflap/mf-hooks2.c 2005-09-23 23:58:39.000000000 +0200 ++++ gcc-4.3.0/libmudflap/mf-hooks2.c 2008-06-10 14:46:02.000000000 +0200 +@@ -427,7 +427,7 @@ + { + TRACE ("%s\n", __PRETTY_FUNCTION__); + MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region"); +- bzero (s, n); ++ memset (s, 0, n); + } + + +@@ -437,7 +437,7 @@ + TRACE ("%s\n", __PRETTY_FUNCTION__); + MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src"); + MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest"); +- bcopy (src, dest, n); ++ memmove (dest, src, n); + } + + +@@ -447,7 +447,7 @@ + TRACE ("%s\n", __PRETTY_FUNCTION__); + MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg"); + MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg"); +- return bcmp (s1, s2, n); ++ return memcmp (s1, s2, n); + } + + +@@ -456,7 +456,7 @@ + size_t n = strlen (s); + TRACE ("%s\n", __PRETTY_FUNCTION__); + MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region"); +- return index (s, c); ++ return strchr (s, c); + } + + +@@ -465,7 +465,7 @@ + size_t n = strlen (s); + TRACE ("%s\n", __PRETTY_FUNCTION__); + MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region"); +- return rindex (s, c); ++ return strrchr (s, c); + } + + /* XXX: stpcpy, memccpy */ diff --git a/patches/gcc/4.3.0/850-306-libstdc++-namespace.patch b/patches/gcc/4.3.0/850-306-libstdc++-namespace.patch deleted file mode 100644 index 532b50f..0000000 --- a/patches/gcc/4.3.0/850-306-libstdc++-namespace.patch +++ /dev/null @@ -1,38 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_306-libstdc++-namespace.patch -diff -rup gcc-4.2.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.2/libstdc++-v3/config/locale/uclibc/messages_members.h -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:45:50.000000000 +0200 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:46:05.000000000 +0200 -@@ -32,7 +32,8 @@ - // - - // Written by Benjamin Kosnik -- -+namespace std -+{ - #ifdef __UCLIBC_MJN3_ONLY__ - #warning fix prototypes for *textdomain funcs - #endif -@@ -115,3 +116,4 @@ - this->_S_create_c_locale(this->_M_c_locale_messages, __s); - } - } -+} -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.h ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.h 2008-06-10 14:45:50.000000000 +0200 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.h 2008-06-10 14:46:05.000000000 +0200 -@@ -33,7 +33,8 @@ - // - - // Written by Benjamin Kosnik -- -+namespace std -+{ - template - __timepunct<_CharT>::__timepunct(size_t __refs) - : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), -@@ -74,3 +75,4 @@ - delete _M_data; - _S_destroy_c_locale(_M_c_locale_timepunct); - } -+} diff --git a/patches/gcc/4.3.0/850-libstdc++-namespace.patch b/patches/gcc/4.3.0/850-libstdc++-namespace.patch new file mode 100644 index 0000000..532b50f --- /dev/null +++ b/patches/gcc/4.3.0/850-libstdc++-namespace.patch @@ -0,0 +1,38 @@ +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_306-libstdc++-namespace.patch +diff -rup gcc-4.2.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.2/libstdc++-v3/config/locale/uclibc/messages_members.h +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:45:50.000000000 +0200 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:46:05.000000000 +0200 +@@ -32,7 +32,8 @@ + // + + // Written by Benjamin Kosnik +- ++namespace std ++{ + #ifdef __UCLIBC_MJN3_ONLY__ + #warning fix prototypes for *textdomain funcs + #endif +@@ -115,3 +116,4 @@ + this->_S_create_c_locale(this->_M_c_locale_messages, __s); + } + } ++} +diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.h +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.h 2008-06-10 14:45:50.000000000 +0200 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.h 2008-06-10 14:46:05.000000000 +0200 +@@ -33,7 +33,8 @@ + // + + // Written by Benjamin Kosnik +- ++namespace std ++{ + template + __timepunct<_CharT>::__timepunct(size_t __refs) + : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), +@@ -74,3 +75,4 @@ + delete _M_data; + _S_destroy_c_locale(_M_c_locale_timepunct); + } ++} diff --git a/patches/gcc/4.3.0/940-alpha-signal_h.patch b/patches/gcc/4.3.0/940-alpha-signal_h.patch new file mode 100644 index 0000000..d7e1796 --- /dev/null +++ b/patches/gcc/4.3.0/940-alpha-signal_h.patch @@ -0,0 +1,17 @@ +--- gcc-4.2.1-stock/gcc/config/alpha/linux-unwind.h 2005-06-24 20:22:41.000000000 -0500 ++++ gcc-4.2.1/gcc/config/alpha/linux-unwind.h 2007-09-01 20:21:34.000000000 -0500 +@@ -29,6 +29,9 @@ Boston, MA 02110-1301, USA. */ + /* Do code reading to identify a signal frame, and set the frame + state data appropriately. See unwind-dw2.c for the structs. */ + ++/* Don't use this if inhibit_libc is set ++ The build for this target will fail trying to include missing headers */ ++#ifndef inhibit_libc + #include + #include + +@@ -80,3 +83,4 @@ alpha_fallback_frame_state (struct _Unwi + fs->retaddr_column = 64; + return _URC_NO_REASON; + } ++#endif /* inhibit_libc */ diff --git a/patches/gcc/4.3.0/940-gcc-alpha-signal_h.patch b/patches/gcc/4.3.0/940-gcc-alpha-signal_h.patch deleted file mode 100644 index d7e1796..0000000 --- a/patches/gcc/4.3.0/940-gcc-alpha-signal_h.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- gcc-4.2.1-stock/gcc/config/alpha/linux-unwind.h 2005-06-24 20:22:41.000000000 -0500 -+++ gcc-4.2.1/gcc/config/alpha/linux-unwind.h 2007-09-01 20:21:34.000000000 -0500 -@@ -29,6 +29,9 @@ Boston, MA 02110-1301, USA. */ - /* Do code reading to identify a signal frame, and set the frame - state data appropriately. See unwind-dw2.c for the structs. */ - -+/* Don't use this if inhibit_libc is set -+ The build for this target will fail trying to include missing headers */ -+#ifndef inhibit_libc - #include - #include - -@@ -80,3 +83,4 @@ alpha_fallback_frame_state (struct _Unwi - fs->retaddr_column = 64; - return _URC_NO_REASON; - } -+#endif /* inhibit_libc */ diff --git a/patches/gcc/4.3.1/100-alpha-mieee-default.patch b/patches/gcc/4.3.1/100-alpha-mieee-default.patch new file mode 100644 index 0000000..e449669 --- /dev/null +++ b/patches/gcc/4.3.1/100-alpha-mieee-default.patch @@ -0,0 +1,34 @@ +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/00_all_gcc-4.1-alpha-mieee-default.patch +Set the default behavior on alpha to use -mieee since the large majority of +time we want this (bad/weird things can happen with packages built without +-mieee). + +To satisfy those people who may not want -mieee forced on them all the time, +we also provide -mno-ieee. + +Patch by Mike Frysinger + +diff -durN gcc-4.3.1.orig/gcc/config/alpha/alpha.h gcc-4.3.1/gcc/config/alpha/alpha.h +--- gcc-4.3.1.orig/gcc/config/alpha/alpha.h 2007-12-06 14:25:37.000000000 +0100 ++++ gcc-4.3.1/gcc/config/alpha/alpha.h 2008-06-10 14:56:36.000000000 +0200 +@@ -95,6 +95,8 @@ + while (0) + #endif + ++#define CPP_SPEC "%{!no-ieee:-mieee}" ++ + #define WORD_SWITCH_TAKES_ARG(STR) \ + (!strcmp (STR, "rpath") || DEFAULT_WORD_SWITCH_TAKES_ARG(STR)) + +diff -durN gcc-4.3.1.orig/gcc/config/alpha/alpha.opt gcc-4.3.1/gcc/config/alpha/alpha.opt +--- gcc-4.3.1.orig/gcc/config/alpha/alpha.opt 2007-08-02 12:49:31.000000000 +0200 ++++ gcc-4.3.1/gcc/config/alpha/alpha.opt 2008-06-10 14:56:36.000000000 +0200 +@@ -39,7 +39,7 @@ + Request IEEE-conformant math library routines (OSF/1) + + mieee +-Target Report RejectNegative Mask(IEEE) ++Target Report Mask(IEEE) + Emit IEEE-conformant code, without inexact exceptions + + mieee-with-inexact diff --git a/patches/gcc/4.3.1/100-gcc-4.1-alpha-mieee-default.patch b/patches/gcc/4.3.1/100-gcc-4.1-alpha-mieee-default.patch deleted file mode 100644 index e449669..0000000 --- a/patches/gcc/4.3.1/100-gcc-4.1-alpha-mieee-default.patch +++ /dev/null @@ -1,34 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/00_all_gcc-4.1-alpha-mieee-default.patch -Set the default behavior on alpha to use -mieee since the large majority of -time we want this (bad/weird things can happen with packages built without --mieee). - -To satisfy those people who may not want -mieee forced on them all the time, -we also provide -mno-ieee. - -Patch by Mike Frysinger - -diff -durN gcc-4.3.1.orig/gcc/config/alpha/alpha.h gcc-4.3.1/gcc/config/alpha/alpha.h ---- gcc-4.3.1.orig/gcc/config/alpha/alpha.h 2007-12-06 14:25:37.000000000 +0100 -+++ gcc-4.3.1/gcc/config/alpha/alpha.h 2008-06-10 14:56:36.000000000 +0200 -@@ -95,6 +95,8 @@ - while (0) - #endif - -+#define CPP_SPEC "%{!no-ieee:-mieee}" -+ - #define WORD_SWITCH_TAKES_ARG(STR) \ - (!strcmp (STR, "rpath") || DEFAULT_WORD_SWITCH_TAKES_ARG(STR)) - -diff -durN gcc-4.3.1.orig/gcc/config/alpha/alpha.opt gcc-4.3.1/gcc/config/alpha/alpha.opt ---- gcc-4.3.1.orig/gcc/config/alpha/alpha.opt 2007-08-02 12:49:31.000000000 +0200 -+++ gcc-4.3.1/gcc/config/alpha/alpha.opt 2008-06-10 14:56:36.000000000 +0200 -@@ -39,7 +39,7 @@ - Request IEEE-conformant math library routines (OSF/1) - - mieee --Target Report RejectNegative Mask(IEEE) -+Target Report Mask(IEEE) - Emit IEEE-conformant code, without inexact exceptions - - mieee-with-inexact diff --git a/patches/gcc/4.3.1/125-gcc-trampolinewarn.patch b/patches/gcc/4.3.1/125-gcc-trampolinewarn.patch deleted file mode 100644 index 7dcfe4d..0000000 --- a/patches/gcc/4.3.1/125-gcc-trampolinewarn.patch +++ /dev/null @@ -1,35 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/00_all_gcc-trampolinewarn.patch - This trivial patch causes gcc to emit a warning whenever - it generates a trampoline. These are otherwise hard to - locate. It is rigged to default ON - to have it default - to OFF remove the text 'Init(1)' from the common.opt - patch, leaving just 'Common Var(warn_trampolines)'. - Kevin F. Quinn 17 Jan 2006 - -diff -durN gcc-4.3.1.orig/gcc/builtins.c gcc-4.3.1/gcc/builtins.c ---- gcc-4.3.1.orig/gcc/builtins.c 2008-04-23 00:36:27.000000000 +0200 -+++ gcc-4.3.1/gcc/builtins.c 2008-06-10 14:56:54.000000000 +0200 -@@ -5662,6 +5662,9 @@ - trampolines_created = 1; - INITIALIZE_TRAMPOLINE (r_tramp, r_func, r_chain); - -+ if (warn_trampolines) -+ warning (OPT_Wtrampolines, "generating trampoline in object (requires executable stack)"); -+ - return const0_rtx; - } - -diff -durN gcc-4.3.1.orig/gcc/common.opt gcc-4.3.1/gcc/common.opt ---- gcc-4.3.1.orig/gcc/common.opt 2008-01-22 15:11:44.000000000 +0100 -+++ gcc-4.3.1/gcc/common.opt 2008-06-10 14:56:54.000000000 +0200 -@@ -182,6 +182,10 @@ - Common Var(warn_system_headers) Warning - Do not suppress warnings from system headers - -+Wtrampolines -+Common Var(warn_trampolines) Init(1) -+Warn whenever a trampoline is generated -+ - Wuninitialized - Common Var(warn_uninitialized) Warning - Warn about uninitialized automatic variables diff --git a/patches/gcc/4.3.1/125-trampolinewarn.patch b/patches/gcc/4.3.1/125-trampolinewarn.patch new file mode 100644 index 0000000..7dcfe4d --- /dev/null +++ b/patches/gcc/4.3.1/125-trampolinewarn.patch @@ -0,0 +1,35 @@ +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/00_all_gcc-trampolinewarn.patch + This trivial patch causes gcc to emit a warning whenever + it generates a trampoline. These are otherwise hard to + locate. It is rigged to default ON - to have it default + to OFF remove the text 'Init(1)' from the common.opt + patch, leaving just 'Common Var(warn_trampolines)'. + Kevin F. Quinn 17 Jan 2006 + +diff -durN gcc-4.3.1.orig/gcc/builtins.c gcc-4.3.1/gcc/builtins.c +--- gcc-4.3.1.orig/gcc/builtins.c 2008-04-23 00:36:27.000000000 +0200 ++++ gcc-4.3.1/gcc/builtins.c 2008-06-10 14:56:54.000000000 +0200 +@@ -5662,6 +5662,9 @@ + trampolines_created = 1; + INITIALIZE_TRAMPOLINE (r_tramp, r_func, r_chain); + ++ if (warn_trampolines) ++ warning (OPT_Wtrampolines, "generating trampoline in object (requires executable stack)"); ++ + return const0_rtx; + } + +diff -durN gcc-4.3.1.orig/gcc/common.opt gcc-4.3.1/gcc/common.opt +--- gcc-4.3.1.orig/gcc/common.opt 2008-01-22 15:11:44.000000000 +0100 ++++ gcc-4.3.1/gcc/common.opt 2008-06-10 14:56:54.000000000 +0200 +@@ -182,6 +182,10 @@ + Common Var(warn_system_headers) Warning + Do not suppress warnings from system headers + ++Wtrampolines ++Common Var(warn_trampolines) Init(1) ++Warn whenever a trampoline is generated ++ + Wuninitialized + Common Var(warn_uninitialized) Warning + Warn about uninitialized automatic variables diff --git a/patches/gcc/4.3.1/150-gcc43-java-nomulti.patch b/patches/gcc/4.3.1/150-gcc43-java-nomulti.patch deleted file mode 100644 index ad43ce4..0000000 --- a/patches/gcc/4.3.1/150-gcc43-java-nomulti.patch +++ /dev/null @@ -1,47 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/03_all_gcc43-java-nomulti.patch -diff -durN gcc-4.3.1.orig/libjava/configure gcc-4.3.1/libjava/configure ---- gcc-4.3.1.orig/libjava/configure 2008-06-06 16:49:11.000000000 +0200 -+++ gcc-4.3.1/libjava/configure 2008-06-10 14:57:38.000000000 +0200 -@@ -1018,6 +1018,8 @@ - --enable-gconf-peer compile GConf native peers for util.preferences - --enable-java-maintainer-mode - allow rebuilding of .class and .h files -+ --enable-libjava-multilib -+ build libjava as multilib - --disable-dependency-tracking speeds up one-time build - --enable-dependency-tracking do not reject slow dependency extractors - --enable-maintainer-mode enable make rules and dependencies not useful -@@ -1850,6 +1852,16 @@ - fi - - -+# Check whether --enable-libjava-multilib was given. -+if test "${enable_libjava_multilib+set}" = set; then -+ enableval=$enable_libjava_multilib; -+fi -+ -+if test "$enable_libjava_multilib" = no; then -+ multilib=no -+ ac_configure_args="$ac_configure_args --disable-multilib" -+fi -+ - # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX. - - -diff -durN gcc-4.3.1.orig/libjava/configure.ac gcc-4.3.1/libjava/configure.ac ---- gcc-4.3.1.orig/libjava/configure.ac 2007-12-22 16:48:46.000000000 +0100 -+++ gcc-4.3.1/libjava/configure.ac 2008-06-10 14:57:38.000000000 +0200 -@@ -82,6 +82,13 @@ - [allow rebuilding of .class and .h files])) - AM_CONDITIONAL(JAVA_MAINTAINER_MODE, test "$enable_java_maintainer_mode" = yes) - -+AC_ARG_ENABLE(libjava-multilib, -+ AS_HELP_STRING([--enable-libjava-multilib], [build libjava as multilib])) -+if test "$enable_libjava_multilib" = no; then -+ multilib=no -+ ac_configure_args="$ac_configure_args --disable-multilib" -+fi -+ - # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX. - GCC_NO_EXECUTABLES - diff --git a/patches/gcc/4.3.1/150-java-nomulti.patch b/patches/gcc/4.3.1/150-java-nomulti.patch new file mode 100644 index 0000000..ad43ce4 --- /dev/null +++ b/patches/gcc/4.3.1/150-java-nomulti.patch @@ -0,0 +1,47 @@ +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/03_all_gcc43-java-nomulti.patch +diff -durN gcc-4.3.1.orig/libjava/configure gcc-4.3.1/libjava/configure +--- gcc-4.3.1.orig/libjava/configure 2008-06-06 16:49:11.000000000 +0200 ++++ gcc-4.3.1/libjava/configure 2008-06-10 14:57:38.000000000 +0200 +@@ -1018,6 +1018,8 @@ + --enable-gconf-peer compile GConf native peers for util.preferences + --enable-java-maintainer-mode + allow rebuilding of .class and .h files ++ --enable-libjava-multilib ++ build libjava as multilib + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + --enable-maintainer-mode enable make rules and dependencies not useful +@@ -1850,6 +1852,16 @@ + fi + + ++# Check whether --enable-libjava-multilib was given. ++if test "${enable_libjava_multilib+set}" = set; then ++ enableval=$enable_libjava_multilib; ++fi ++ ++if test "$enable_libjava_multilib" = no; then ++ multilib=no ++ ac_configure_args="$ac_configure_args --disable-multilib" ++fi ++ + # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX. + + +diff -durN gcc-4.3.1.orig/libjava/configure.ac gcc-4.3.1/libjava/configure.ac +--- gcc-4.3.1.orig/libjava/configure.ac 2007-12-22 16:48:46.000000000 +0100 ++++ gcc-4.3.1/libjava/configure.ac 2008-06-10 14:57:38.000000000 +0200 +@@ -82,6 +82,13 @@ + [allow rebuilding of .class and .h files])) + AM_CONDITIONAL(JAVA_MAINTAINER_MODE, test "$enable_java_maintainer_mode" = yes) + ++AC_ARG_ENABLE(libjava-multilib, ++ AS_HELP_STRING([--enable-libjava-multilib], [build libjava as multilib])) ++if test "$enable_libjava_multilib" = no; then ++ multilib=no ++ ac_configure_args="$ac_configure_args --disable-multilib" ++fi ++ + # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX. + GCC_NO_EXECUTABLES + diff --git a/patches/gcc/4.3.1/175-cross-compile.patch b/patches/gcc/4.3.1/175-cross-compile.patch new file mode 100644 index 0000000..b6710a3 --- /dev/null +++ b/patches/gcc/4.3.1/175-cross-compile.patch @@ -0,0 +1,44 @@ +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/08_all_gcc-4.1-cross-compile.patch +Some notes on the 'bootstrap with or without libc headers' debate: +http://linuxfromscratch.org/pipermail/lfs-dev/2005-July/052409.html +http://gcc.gnu.org/ml/gcc/2005-07/msg01195.html + +diff -durN gcc-4.3.1.orig/gcc/configure gcc-4.3.1/gcc/configure +--- gcc-4.3.1.orig/gcc/configure 2008-05-21 10:54:15.000000000 +0200 ++++ gcc-4.3.1/gcc/configure 2008-06-10 14:57:42.000000000 +0200 +@@ -13283,7 +13283,7 @@ + | powerpc*-*-*,powerpc64*-*-*) + CROSS="$CROSS -DNATIVE_CROSS" ;; + esac +-elif test "x$TARGET_SYSTEM_ROOT" != x; then ++elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then + SYSTEM_HEADER_DIR=$build_system_header_dir + fi + +diff -durN gcc-4.3.1.orig/gcc/configure.ac gcc-4.3.1/gcc/configure.ac +--- gcc-4.3.1.orig/gcc/configure.ac 2008-05-21 10:54:15.000000000 +0200 ++++ gcc-4.3.1/gcc/configure.ac 2008-06-10 14:57:42.000000000 +0200 +@@ -1749,7 +1749,7 @@ + | powerpc*-*-*,powerpc64*-*-*) + CROSS="$CROSS -DNATIVE_CROSS" ;; + esac +-elif test "x$TARGET_SYSTEM_ROOT" != x; then ++elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then + SYSTEM_HEADER_DIR=$build_system_header_dir + fi + +diff -durN gcc-4.3.1.orig/gcc/unwind-dw2.c gcc-4.3.1/gcc/unwind-dw2.c +--- gcc-4.3.1.orig/gcc/unwind-dw2.c 2007-07-25 20:14:57.000000000 +0200 ++++ gcc-4.3.1/gcc/unwind-dw2.c 2008-06-10 14:57:42.000000000 +0200 +@@ -334,9 +334,11 @@ + } + #endif + ++#ifndef inhibit_libc + #ifdef MD_UNWIND_SUPPORT + #include MD_UNWIND_SUPPORT + #endif ++#endif + + /* Extract any interesting information from the CIE for the translation + unit F belongs to. Return a pointer to the byte after the augmentation, diff --git a/patches/gcc/4.3.1/175-gcc-4.1-cross-compile.patch b/patches/gcc/4.3.1/175-gcc-4.1-cross-compile.patch deleted file mode 100644 index b6710a3..0000000 --- a/patches/gcc/4.3.1/175-gcc-4.1-cross-compile.patch +++ /dev/null @@ -1,44 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/08_all_gcc-4.1-cross-compile.patch -Some notes on the 'bootstrap with or without libc headers' debate: -http://linuxfromscratch.org/pipermail/lfs-dev/2005-July/052409.html -http://gcc.gnu.org/ml/gcc/2005-07/msg01195.html - -diff -durN gcc-4.3.1.orig/gcc/configure gcc-4.3.1/gcc/configure ---- gcc-4.3.1.orig/gcc/configure 2008-05-21 10:54:15.000000000 +0200 -+++ gcc-4.3.1/gcc/configure 2008-06-10 14:57:42.000000000 +0200 -@@ -13283,7 +13283,7 @@ - | powerpc*-*-*,powerpc64*-*-*) - CROSS="$CROSS -DNATIVE_CROSS" ;; - esac --elif test "x$TARGET_SYSTEM_ROOT" != x; then -+elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then - SYSTEM_HEADER_DIR=$build_system_header_dir - fi - -diff -durN gcc-4.3.1.orig/gcc/configure.ac gcc-4.3.1/gcc/configure.ac ---- gcc-4.3.1.orig/gcc/configure.ac 2008-05-21 10:54:15.000000000 +0200 -+++ gcc-4.3.1/gcc/configure.ac 2008-06-10 14:57:42.000000000 +0200 -@@ -1749,7 +1749,7 @@ - | powerpc*-*-*,powerpc64*-*-*) - CROSS="$CROSS -DNATIVE_CROSS" ;; - esac --elif test "x$TARGET_SYSTEM_ROOT" != x; then -+elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then - SYSTEM_HEADER_DIR=$build_system_header_dir - fi - -diff -durN gcc-4.3.1.orig/gcc/unwind-dw2.c gcc-4.3.1/gcc/unwind-dw2.c ---- gcc-4.3.1.orig/gcc/unwind-dw2.c 2007-07-25 20:14:57.000000000 +0200 -+++ gcc-4.3.1/gcc/unwind-dw2.c 2008-06-10 14:57:42.000000000 +0200 -@@ -334,9 +334,11 @@ - } - #endif - -+#ifndef inhibit_libc - #ifdef MD_UNWIND_SUPPORT - #include MD_UNWIND_SUPPORT - #endif -+#endif - - /* Extract any interesting information from the CIE for the translation - unit F belongs to. Return a pointer to the byte after the augmentation, diff --git a/patches/gcc/4.3.1/200-gcc-netbsd-symbolic.patch b/patches/gcc/4.3.1/200-gcc-netbsd-symbolic.patch deleted file mode 100644 index d06a04a..0000000 --- a/patches/gcc/4.3.1/200-gcc-netbsd-symbolic.patch +++ /dev/null @@ -1,14 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/11_all_gcc-netbsd-symbolic.patch -http://bugs.gentoo.org/122698 - -diff -durN gcc-4.3.1.orig/gcc/config/netbsd-elf.h gcc-4.3.1/gcc/config/netbsd-elf.h ---- gcc-4.3.1.orig/gcc/config/netbsd-elf.h 2007-09-03 18:14:04.000000000 +0200 -+++ gcc-4.3.1/gcc/config/netbsd-elf.h 2008-06-10 14:57:48.000000000 +0200 -@@ -82,6 +82,7 @@ - #define NETBSD_LINK_SPEC_ELF \ - "%{assert*} %{R*} %{rpath*} \ - %{shared:-shared} \ -+ %{symbolic:-Bsymbolic} \ - %{!shared: \ - -dc -dp \ - %{!nostdlib: \ diff --git a/patches/gcc/4.3.1/200-netbsd-symbolic.patch b/patches/gcc/4.3.1/200-netbsd-symbolic.patch new file mode 100644 index 0000000..d06a04a --- /dev/null +++ b/patches/gcc/4.3.1/200-netbsd-symbolic.patch @@ -0,0 +1,14 @@ +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/11_all_gcc-netbsd-symbolic.patch +http://bugs.gentoo.org/122698 + +diff -durN gcc-4.3.1.orig/gcc/config/netbsd-elf.h gcc-4.3.1/gcc/config/netbsd-elf.h +--- gcc-4.3.1.orig/gcc/config/netbsd-elf.h 2007-09-03 18:14:04.000000000 +0200 ++++ gcc-4.3.1/gcc/config/netbsd-elf.h 2008-06-10 14:57:48.000000000 +0200 +@@ -82,6 +82,7 @@ + #define NETBSD_LINK_SPEC_ELF \ + "%{assert*} %{R*} %{rpath*} \ + %{shared:-shared} \ ++ %{symbolic:-Bsymbolic} \ + %{!shared: \ + -dc -dp \ + %{!nostdlib: \ diff --git a/patches/gcc/4.3.1/225-gcc-sparc64-bsd.patch b/patches/gcc/4.3.1/225-gcc-sparc64-bsd.patch deleted file mode 100644 index 5ac2b43..0000000 --- a/patches/gcc/4.3.1/225-gcc-sparc64-bsd.patch +++ /dev/null @@ -1,30 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/14_all_gcc-sparc64-bsd.patch -diff -durN gcc-4.3.1.orig/gcc/config/sparc/freebsd.h gcc-4.3.1/gcc/config/sparc/freebsd.h ---- gcc-4.3.1.orig/gcc/config/sparc/freebsd.h 2007-08-02 12:49:31.000000000 +0200 -+++ gcc-4.3.1/gcc/config/sparc/freebsd.h 2008-06-10 14:57:54.000000000 +0200 -@@ -25,9 +25,22 @@ - /* FreeBSD needs the platform name (sparc64) defined. - Emacs needs to know if the arch is 64 or 32-bits. */ - --#undef CPP_CPU64_DEFAULT_SPEC --#define CPP_CPU64_DEFAULT_SPEC \ -- "-D__sparc64__ -D__sparc_v9__ -D__sparcv9 -D__arch64__" -+#undef FBSD_TARGET_CPU_CPP_BUILTINS -+#define FBSD_TARGET_CPU_CPP_BUILTINS() \ -+ do \ -+ { \ -+ if (TARGET_ARCH64) \ -+ { \ -+ builtin_define ("__sparc64__"); \ -+ builtin_define ("__sparc_v9__"); \ -+ builtin_define ("__sparcv9"); \ -+ } \ -+ else \ -+ builtin_define ("__sparc"); \ -+ builtin_define ("__sparc__"); \ -+ } \ -+ while (0) -+ - - #define LINK_SPEC "%(link_arch) \ - %{!mno-relax:%{!r:-relax}} \ diff --git a/patches/gcc/4.3.1/225-sparc64-bsd.patch b/patches/gcc/4.3.1/225-sparc64-bsd.patch new file mode 100644 index 0000000..5ac2b43 --- /dev/null +++ b/patches/gcc/4.3.1/225-sparc64-bsd.patch @@ -0,0 +1,30 @@ +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/14_all_gcc-sparc64-bsd.patch +diff -durN gcc-4.3.1.orig/gcc/config/sparc/freebsd.h gcc-4.3.1/gcc/config/sparc/freebsd.h +--- gcc-4.3.1.orig/gcc/config/sparc/freebsd.h 2007-08-02 12:49:31.000000000 +0200 ++++ gcc-4.3.1/gcc/config/sparc/freebsd.h 2008-06-10 14:57:54.000000000 +0200 +@@ -25,9 +25,22 @@ + /* FreeBSD needs the platform name (sparc64) defined. + Emacs needs to know if the arch is 64 or 32-bits. */ + +-#undef CPP_CPU64_DEFAULT_SPEC +-#define CPP_CPU64_DEFAULT_SPEC \ +- "-D__sparc64__ -D__sparc_v9__ -D__sparcv9 -D__arch64__" ++#undef FBSD_TARGET_CPU_CPP_BUILTINS ++#define FBSD_TARGET_CPU_CPP_BUILTINS() \ ++ do \ ++ { \ ++ if (TARGET_ARCH64) \ ++ { \ ++ builtin_define ("__sparc64__"); \ ++ builtin_define ("__sparc_v9__"); \ ++ builtin_define ("__sparcv9"); \ ++ } \ ++ else \ ++ builtin_define ("__sparc"); \ ++ builtin_define ("__sparc__"); \ ++ } \ ++ while (0) ++ + + #define LINK_SPEC "%(link_arch) \ + %{!mno-relax:%{!r:-relax}} \ diff --git a/patches/gcc/4.3.1/250-904-flatten-switch-stmt-00.patch b/patches/gcc/4.3.1/250-904-flatten-switch-stmt-00.patch deleted file mode 100644 index 55cafcb..0000000 --- a/patches/gcc/4.3.1/250-904-flatten-switch-stmt-00.patch +++ /dev/null @@ -1,76 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/18_all_904-flatten-switch-stmt-00.patch -http://gcc.gnu.org/ml/gcc-patches/2007-04/msg00927.html - -Hi, - -The attached patch makes sure that we create smaller object code for -simple switch statements. We just make sure to flatten the switch -statement into an if-else chain, basically. - -This fixes a size-regression as compared to gcc-3.4, as can be seen -below. - -2007-04-15 Bernhard Fischer <..> - - * stmt.c (expand_case): Do not create a complex binary tree when - optimizing for size but rather use the simple ordered list. - (emit_case_nodes): do not emit jumps to the default_label when - optimizing for size. - -Not regtested so far. -Comments? - -Attached is the test switch.c mentioned below. - -$ for i in 2.95 3.3 3.4 4.0 4.1 4.2.orig-HEAD 4.3.orig-HEAD 4.3-HEAD;do -gcc-$i -DCHAIN -Os -o switch-CHAIN-$i.o -c switch.c ;done -$ for i in 2.95 3.3 3.4 4.0 4.1 4.2.orig-HEAD 4.3.orig-HEAD 4.3-HEAD;do -gcc-$i -UCHAIN -Os -o switch-$i.o -c switch.c ;done - -$ size switch-*.o - text data bss dec hex filename - 169 0 0 169 a9 switch-2.95.o - 115 0 0 115 73 switch-3.3.o - 103 0 0 103 67 switch-3.4.o - 124 0 0 124 7c switch-4.0.o - 124 0 0 124 7c switch-4.1.o - 124 0 0 124 7c switch-4.2.orig-HEAD.o - 95 0 0 95 5f switch-4.3-HEAD.o - 124 0 0 124 7c switch-4.3.orig-HEAD.o - 166 0 0 166 a6 switch-CHAIN-2.95.o - 111 0 0 111 6f switch-CHAIN-3.3.o - 95 0 0 95 5f switch-CHAIN-3.4.o - 95 0 0 95 5f switch-CHAIN-4.0.o - 95 0 0 95 5f switch-CHAIN-4.1.o - 95 0 0 95 5f switch-CHAIN-4.2.orig-HEAD.o - 95 0 0 95 5f switch-CHAIN-4.3-HEAD.o - 95 0 0 95 5f switch-CHAIN-4.3.orig-HEAD.o - - -Content-Type: text/x-diff; charset=us-ascii -Content-Disposition: attachment; filename="gcc-4.3.gcc-flatten-switch-stmt.00.diff" - -diff -durN gcc-4.3.1.orig/gcc/stmt.c gcc-4.3.1/gcc/stmt.c ---- gcc-4.3.1.orig/gcc/stmt.c 2008-05-09 20:12:13.000000000 +0200 -+++ gcc-4.3.1/gcc/stmt.c 2008-06-10 14:57:58.000000000 +0200 -@@ -2509,7 +2509,11 @@ - use_cost_table - = (TREE_CODE (orig_type) != ENUMERAL_TYPE - && estimate_case_costs (case_list)); -- balance_case_nodes (&case_list, NULL); -+ /* When optimizing for size, we want a straight list to avoid -+ jumps as much as possible. This basically creates an if-else -+ chain. */ -+ if (!optimize_size) -+ balance_case_nodes (&case_list, NULL); - emit_case_nodes (index, case_list, default_label, index_type); - emit_jump (default_label); - } -@@ -3067,6 +3071,7 @@ - { - if (!node_has_low_bound (node, index_type)) - { -+ if (!optimize_size) /* don't jl to the .default_label. */ - emit_cmp_and_jump_insns (index, - convert_modes - (mode, imode, diff --git a/patches/gcc/4.3.1/250-flatten-switch-stmt-00.patch b/patches/gcc/4.3.1/250-flatten-switch-stmt-00.patch new file mode 100644 index 0000000..55cafcb --- /dev/null +++ b/patches/gcc/4.3.1/250-flatten-switch-stmt-00.patch @@ -0,0 +1,76 @@ +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/18_all_904-flatten-switch-stmt-00.patch +http://gcc.gnu.org/ml/gcc-patches/2007-04/msg00927.html + +Hi, + +The attached patch makes sure that we create smaller object code for +simple switch statements. We just make sure to flatten the switch +statement into an if-else chain, basically. + +This fixes a size-regression as compared to gcc-3.4, as can be seen +below. + +2007-04-15 Bernhard Fischer <..> + + * stmt.c (expand_case): Do not create a complex binary tree when + optimizing for size but rather use the simple ordered list. + (emit_case_nodes): do not emit jumps to the default_label when + optimizing for size. + +Not regtested so far. +Comments? + +Attached is the test switch.c mentioned below. + +$ for i in 2.95 3.3 3.4 4.0 4.1 4.2.orig-HEAD 4.3.orig-HEAD 4.3-HEAD;do +gcc-$i -DCHAIN -Os -o switch-CHAIN-$i.o -c switch.c ;done +$ for i in 2.95 3.3 3.4 4.0 4.1 4.2.orig-HEAD 4.3.orig-HEAD 4.3-HEAD;do +gcc-$i -UCHAIN -Os -o switch-$i.o -c switch.c ;done + +$ size switch-*.o + text data bss dec hex filename + 169 0 0 169 a9 switch-2.95.o + 115 0 0 115 73 switch-3.3.o + 103 0 0 103 67 switch-3.4.o + 124 0 0 124 7c switch-4.0.o + 124 0 0 124 7c switch-4.1.o + 124 0 0 124 7c switch-4.2.orig-HEAD.o + 95 0 0 95 5f switch-4.3-HEAD.o + 124 0 0 124 7c switch-4.3.orig-HEAD.o + 166 0 0 166 a6 switch-CHAIN-2.95.o + 111 0 0 111 6f switch-CHAIN-3.3.o + 95 0 0 95 5f switch-CHAIN-3.4.o + 95 0 0 95 5f switch-CHAIN-4.0.o + 95 0 0 95 5f switch-CHAIN-4.1.o + 95 0 0 95 5f switch-CHAIN-4.2.orig-HEAD.o + 95 0 0 95 5f switch-CHAIN-4.3-HEAD.o + 95 0 0 95 5f switch-CHAIN-4.3.orig-HEAD.o + + +Content-Type: text/x-diff; charset=us-ascii +Content-Disposition: attachment; filename="gcc-4.3.gcc-flatten-switch-stmt.00.diff" + +diff -durN gcc-4.3.1.orig/gcc/stmt.c gcc-4.3.1/gcc/stmt.c +--- gcc-4.3.1.orig/gcc/stmt.c 2008-05-09 20:12:13.000000000 +0200 ++++ gcc-4.3.1/gcc/stmt.c 2008-06-10 14:57:58.000000000 +0200 +@@ -2509,7 +2509,11 @@ + use_cost_table + = (TREE_CODE (orig_type) != ENUMERAL_TYPE + && estimate_case_costs (case_list)); +- balance_case_nodes (&case_list, NULL); ++ /* When optimizing for size, we want a straight list to avoid ++ jumps as much as possible. This basically creates an if-else ++ chain. */ ++ if (!optimize_size) ++ balance_case_nodes (&case_list, NULL); + emit_case_nodes (index, case_list, default_label, index_type); + emit_jump (default_label); + } +@@ -3067,6 +3071,7 @@ + { + if (!node_has_low_bound (node, index_type)) + { ++ if (!optimize_size) /* don't jl to the .default_label. */ + emit_cmp_and_jump_insns (index, + convert_modes + (mode, imode, diff --git a/patches/gcc/4.3.1/275-gcc-3.4-libiberty-pic.patch b/patches/gcc/4.3.1/275-gcc-3.4-libiberty-pic.patch deleted file mode 100644 index 0b1e6b4..0000000 --- a/patches/gcc/4.3.1/275-gcc-3.4-libiberty-pic.patch +++ /dev/null @@ -1,12 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/51_all_gcc-3.4-libiberty-pic.patch -diff -durN gcc-4.3.1.orig/libiberty/Makefile.in gcc-4.3.1/libiberty/Makefile.in ---- gcc-4.3.1.orig/libiberty/Makefile.in 2007-07-25 08:26:45.000000000 +0200 -+++ gcc-4.3.1/libiberty/Makefile.in 2008-06-10 14:58:02.000000000 +0200 -@@ -225,6 +225,7 @@ - $(AR) $(AR_FLAGS) $(TARGETLIB) \ - $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \ - $(RANLIB) $(TARGETLIB); \ -+ cp $(TARGETLIB) ../ ; \ - cd ..; \ - else true; fi - diff --git a/patches/gcc/4.3.1/275-libiberty-pic.patch b/patches/gcc/4.3.1/275-libiberty-pic.patch new file mode 100644 index 0000000..0b1e6b4 --- /dev/null +++ b/patches/gcc/4.3.1/275-libiberty-pic.patch @@ -0,0 +1,12 @@ +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/51_all_gcc-3.4-libiberty-pic.patch +diff -durN gcc-4.3.1.orig/libiberty/Makefile.in gcc-4.3.1/libiberty/Makefile.in +--- gcc-4.3.1.orig/libiberty/Makefile.in 2007-07-25 08:26:45.000000000 +0200 ++++ gcc-4.3.1/libiberty/Makefile.in 2008-06-10 14:58:02.000000000 +0200 +@@ -225,6 +225,7 @@ + $(AR) $(AR_FLAGS) $(TARGETLIB) \ + $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \ + $(RANLIB) $(TARGETLIB); \ ++ cp $(TARGETLIB) ../ ; \ + cd ..; \ + else true; fi + diff --git a/patches/gcc/4.3.1/300-gcc4-superh-default-multilib.patch b/patches/gcc/4.3.1/300-gcc4-superh-default-multilib.patch deleted file mode 100644 index bc24221..0000000 --- a/patches/gcc/4.3.1/300-gcc4-superh-default-multilib.patch +++ /dev/null @@ -1,25 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/53_all_gcc4-superh-default-multilib.patch -The gcc-3.x toolchains would contain all the targets by default. With gcc-4, -you have to actually list out the multilibs you want or you will end up with -just one when using targets like 'sh4-linux-gnu'. - -The resulting toolchain can't even build a kernel as the kernel needs to build -with the nofpu flag to be sure that no fpu ops are generated. - -Here we restore the gcc-3.x behavior; the additional overhead of building all -of these multilibs by default is negligible. - -http://bugs.gentoo.org/140205 - -diff -durN gcc-4.3.1.orig/gcc/config.gcc gcc-4.3.1/gcc/config.gcc ---- gcc-4.3.1.orig/gcc/config.gcc 2008-05-21 10:54:15.000000000 +0200 -+++ gcc-4.3.1/gcc/config.gcc 2008-06-10 14:58:06.000000000 +0200 -@@ -2278,7 +2278,7 @@ - if test x${sh_multilibs} = x ; then - case ${target} in - sh64-superh-linux* | \ -- sh[1234]*) sh_multilibs=${sh_cpu_target} ;; -+ sh[1234]*) sh_multilibs=`cd ${srcdir}/config/sh ; echo t-mlib-sh[1-4]* | sed 's:t-mlib-sh:,m:g;s: ::g'` ;; - sh64* | sh5*) sh_multilibs=m5-32media,m5-32media-nofpu,m5-compact,m5-compact-nofpu,m5-64media,m5-64media-nofpu ;; - sh-superh-*) sh_multilibs=m4,m4-single,m4-single-only,m4-nofpu ;; - sh*-*-linux*) sh_multilibs=m1,m3e,m4 ;; diff --git a/patches/gcc/4.3.1/300-superh-default-multilib.patch b/patches/gcc/4.3.1/300-superh-default-multilib.patch new file mode 100644 index 0000000..bc24221 --- /dev/null +++ b/patches/gcc/4.3.1/300-superh-default-multilib.patch @@ -0,0 +1,25 @@ +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/53_all_gcc4-superh-default-multilib.patch +The gcc-3.x toolchains would contain all the targets by default. With gcc-4, +you have to actually list out the multilibs you want or you will end up with +just one when using targets like 'sh4-linux-gnu'. + +The resulting toolchain can't even build a kernel as the kernel needs to build +with the nofpu flag to be sure that no fpu ops are generated. + +Here we restore the gcc-3.x behavior; the additional overhead of building all +of these multilibs by default is negligible. + +http://bugs.gentoo.org/140205 + +diff -durN gcc-4.3.1.orig/gcc/config.gcc gcc-4.3.1/gcc/config.gcc +--- gcc-4.3.1.orig/gcc/config.gcc 2008-05-21 10:54:15.000000000 +0200 ++++ gcc-4.3.1/gcc/config.gcc 2008-06-10 14:58:06.000000000 +0200 +@@ -2278,7 +2278,7 @@ + if test x${sh_multilibs} = x ; then + case ${target} in + sh64-superh-linux* | \ +- sh[1234]*) sh_multilibs=${sh_cpu_target} ;; ++ sh[1234]*) sh_multilibs=`cd ${srcdir}/config/sh ; echo t-mlib-sh[1-4]* | sed 's:t-mlib-sh:,m:g;s: ::g'` ;; + sh64* | sh5*) sh_multilibs=m5-32media,m5-32media-nofpu,m5-compact,m5-compact-nofpu,m5-64media,m5-64media-nofpu ;; + sh-superh-*) sh_multilibs=m4,m4-single,m4-single-only,m4-nofpu ;; + sh*-*-linux*) sh_multilibs=m1,m3e,m4 ;; diff --git a/patches/gcc/4.3.1/325-300-libstdc++-pic.patch b/patches/gcc/4.3.1/325-300-libstdc++-pic.patch deleted file mode 100644 index 61cab19..0000000 --- a/patches/gcc/4.3.1/325-300-libstdc++-pic.patch +++ /dev/null @@ -1,56 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/54_all_300-libstdc++-pic.patch -install libstdc++_pic.a if we have pic objs - -diff -durN gcc-4.3.1.orig/libstdc++-v3/src/Makefile.am gcc-4.3.1/libstdc++-v3/src/Makefile.am ---- gcc-4.3.1.orig/libstdc++-v3/src/Makefile.am 2008-02-29 19:26:50.000000000 +0100 -+++ gcc-4.3.1/libstdc++-v3/src/Makefile.am 2008-06-10 14:58:09.000000000 +0200 -@@ -289,6 +289,13 @@ - $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@ - - -+install-exec-local: -+ pic_objs=`sed -n "s:'::g;s:^pic_object=::p" *.lo | grep -v '^none$$'`; \ -+ if [ x"$$pic_objs" != x ]; then \ -+ $(AR) cru libstdc++_pic.a $$pic_objs $(top_builddir)/libsupc++/*.o || exit 1; \ -+ $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir) || exit 1; \ -+ fi -+ - # Added bits to build debug library. - if GLIBCXX_BUILD_DEBUG - all-local: build_debug -diff -durN gcc-4.3.1.orig/libstdc++-v3/src/Makefile.in gcc-4.3.1/libstdc++-v3/src/Makefile.in ---- gcc-4.3.1.orig/libstdc++-v3/src/Makefile.in 2008-02-29 19:26:50.000000000 +0100 -+++ gcc-4.3.1/libstdc++-v3/src/Makefile.in 2008-06-10 14:58:09.000000000 +0200 -@@ -693,7 +693,7 @@ - - install-data-am: install-data-local - --install-exec-am: install-toolexeclibLTLIBRARIES -+install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local - - install-info: install-info-am - -@@ -732,7 +732,7 @@ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-info-am \ -- uninstall-toolexeclibLTLIBRARIES -+ uninstall-toolexeclibLTLIBRARIES install-exec-local - - - # Symbol versioning for shared libraries. -@@ -858,6 +858,14 @@ - install_debug: - (cd ${debugdir} && $(MAKE) \ - toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install) -+ -+install-exec-local: -+ pic_objs=`sed -n "s:'::g;s:^pic_object=::p" *.lo | grep -v '^none$$'`; \ -+ if [ x"$$pic_objs" != x ]; then \ -+ $(AR) cru libstdc++_pic.a $$pic_objs $(top_builddir)/libsupc++/*.o || exit 1; \ -+ $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir) || exit 1; \ -+ fi -+ - # Tell versions [3.59,3.63) of GNU make to not export all variables. - # Otherwise a system limit (for SysV at least) may be exceeded. - .NOEXPORT: diff --git a/patches/gcc/4.3.1/325-libstdc++-pic.patch b/patches/gcc/4.3.1/325-libstdc++-pic.patch new file mode 100644 index 0000000..61cab19 --- /dev/null +++ b/patches/gcc/4.3.1/325-libstdc++-pic.patch @@ -0,0 +1,56 @@ +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/54_all_300-libstdc++-pic.patch +install libstdc++_pic.a if we have pic objs + +diff -durN gcc-4.3.1.orig/libstdc++-v3/src/Makefile.am gcc-4.3.1/libstdc++-v3/src/Makefile.am +--- gcc-4.3.1.orig/libstdc++-v3/src/Makefile.am 2008-02-29 19:26:50.000000000 +0100 ++++ gcc-4.3.1/libstdc++-v3/src/Makefile.am 2008-06-10 14:58:09.000000000 +0200 +@@ -289,6 +289,13 @@ + $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@ + + ++install-exec-local: ++ pic_objs=`sed -n "s:'::g;s:^pic_object=::p" *.lo | grep -v '^none$$'`; \ ++ if [ x"$$pic_objs" != x ]; then \ ++ $(AR) cru libstdc++_pic.a $$pic_objs $(top_builddir)/libsupc++/*.o || exit 1; \ ++ $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir) || exit 1; \ ++ fi ++ + # Added bits to build debug library. + if GLIBCXX_BUILD_DEBUG + all-local: build_debug +diff -durN gcc-4.3.1.orig/libstdc++-v3/src/Makefile.in gcc-4.3.1/libstdc++-v3/src/Makefile.in +--- gcc-4.3.1.orig/libstdc++-v3/src/Makefile.in 2008-02-29 19:26:50.000000000 +0100 ++++ gcc-4.3.1/libstdc++-v3/src/Makefile.in 2008-06-10 14:58:09.000000000 +0200 +@@ -693,7 +693,7 @@ + + install-data-am: install-data-local + +-install-exec-am: install-toolexeclibLTLIBRARIES ++install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local + + install-info: install-info-am + +@@ -732,7 +732,7 @@ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-info-am \ +- uninstall-toolexeclibLTLIBRARIES ++ uninstall-toolexeclibLTLIBRARIES install-exec-local + + + # Symbol versioning for shared libraries. +@@ -858,6 +858,14 @@ + install_debug: + (cd ${debugdir} && $(MAKE) \ + toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install) ++ ++install-exec-local: ++ pic_objs=`sed -n "s:'::g;s:^pic_object=::p" *.lo | grep -v '^none$$'`; \ ++ if [ x"$$pic_objs" != x ]; then \ ++ $(AR) cru libstdc++_pic.a $$pic_objs $(top_builddir)/libsupc++/*.o || exit 1; \ ++ $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir) || exit 1; \ ++ fi ++ + # Tell versions [3.59,3.63) of GNU make to not export all variables. + # Otherwise a system limit (for SysV at least) may be exceeded. + .NOEXPORT: diff --git a/patches/gcc/4.3.1/350-gcc43-pr24170.patch b/patches/gcc/4.3.1/350-gcc43-pr24170.patch deleted file mode 100644 index cd13698..0000000 --- a/patches/gcc/4.3.1/350-gcc43-pr24170.patch +++ /dev/null @@ -1,61 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/61_all_gcc43-pr24170.patch -http://gcc.gnu.org/PR24170 - -2008-02-20 Tom Tromey - - PR libgcj/24170: - * java/io/natFilePosix.cc (File::performList): Don't use - readdir_r. - * configure, include/config.h.in: Rebuilt. - * configure.ac: Don't check for readdir_r. - -diff -durN gcc-4.3.1.orig/libjava/configure.ac gcc-4.3.1/libjava/configure.ac ---- gcc-4.3.1.orig/libjava/configure.ac 2008-06-10 14:57:42.000000000 +0200 -+++ gcc-4.3.1/libjava/configure.ac 2008-06-10 14:58:13.000000000 +0200 -@@ -1030,7 +1030,7 @@ - PLATFORMNET=NoNet - else - AC_CHECK_FUNCS([strerror_r select fstat open fsync sleep opendir \ -- localtime_r readdir_r getpwuid_r getcwd \ -+ localtime_r getpwuid_r getcwd \ - access stat lstat mkdir rename rmdir unlink utime chmod readlink \ - nl_langinfo setlocale \ - inet_pton uname inet_ntoa \ -diff -durN gcc-4.3.1.orig/libjava/include/config.h.in gcc-4.3.1/libjava/include/config.h.in ---- gcc-4.3.1.orig/libjava/include/config.h.in 2007-07-31 18:17:21.000000000 +0200 -+++ gcc-4.3.1/libjava/include/config.h.in 2008-06-10 14:58:13.000000000 +0200 -@@ -214,9 +214,6 @@ - /* Define to 1 if you have the header file. */ - #undef HAVE_PWD_H - --/* Define to 1 if you have the `readdir_r' function. */ --#undef HAVE_READDIR_R -- - /* Define to 1 if you have the `readlink' function. */ - #undef HAVE_READLINK - -diff -durN gcc-4.3.1.orig/libjava/java/io/natFilePosix.cc gcc-4.3.1/libjava/java/io/natFilePosix.cc ---- gcc-4.3.1.orig/libjava/java/io/natFilePosix.cc 2007-08-04 23:50:01.000000000 +0200 -+++ gcc-4.3.1/libjava/java/io/natFilePosix.cc 2008-06-10 14:58:13.000000000 +0200 -@@ -1,6 +1,6 @@ - // natFile.cc - Native part of File class for POSIX. - --/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2006 -+/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2006, 2008 - Free Software Foundation - - This file is part of libgcj. -@@ -292,13 +292,7 @@ - - java::util::ArrayList *list = new java::util::ArrayList (); - struct dirent *d; --#if defined(HAVE_READDIR_R) && defined(_POSIX_PTHREAD_SEMANTICS) -- int name_max = pathconf (buf, _PC_NAME_MAX); -- char dbuf[sizeof (struct dirent) + name_max + 1]; -- while (readdir_r (dir, (struct dirent *) dbuf, &d) == 0 && d != NULL) --#else /* HAVE_READDIR_R */ - while ((d = readdir (dir)) != NULL) --#endif /* HAVE_READDIR_R */ - { - // Omit "." and "..". - if (d->d_name[0] == '.' diff --git a/patches/gcc/4.3.1/350-pr24170.patch b/patches/gcc/4.3.1/350-pr24170.patch new file mode 100644 index 0000000..cd13698 --- /dev/null +++ b/patches/gcc/4.3.1/350-pr24170.patch @@ -0,0 +1,61 @@ +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/61_all_gcc43-pr24170.patch +http://gcc.gnu.org/PR24170 + +2008-02-20 Tom Tromey + + PR libgcj/24170: + * java/io/natFilePosix.cc (File::performList): Don't use + readdir_r. + * configure, include/config.h.in: Rebuilt. + * configure.ac: Don't check for readdir_r. + +diff -durN gcc-4.3.1.orig/libjava/configure.ac gcc-4.3.1/libjava/configure.ac +--- gcc-4.3.1.orig/libjava/configure.ac 2008-06-10 14:57:42.000000000 +0200 ++++ gcc-4.3.1/libjava/configure.ac 2008-06-10 14:58:13.000000000 +0200 +@@ -1030,7 +1030,7 @@ + PLATFORMNET=NoNet + else + AC_CHECK_FUNCS([strerror_r select fstat open fsync sleep opendir \ +- localtime_r readdir_r getpwuid_r getcwd \ ++ localtime_r getpwuid_r getcwd \ + access stat lstat mkdir rename rmdir unlink utime chmod readlink \ + nl_langinfo setlocale \ + inet_pton uname inet_ntoa \ +diff -durN gcc-4.3.1.orig/libjava/include/config.h.in gcc-4.3.1/libjava/include/config.h.in +--- gcc-4.3.1.orig/libjava/include/config.h.in 2007-07-31 18:17:21.000000000 +0200 ++++ gcc-4.3.1/libjava/include/config.h.in 2008-06-10 14:58:13.000000000 +0200 +@@ -214,9 +214,6 @@ + /* Define to 1 if you have the header file. */ + #undef HAVE_PWD_H + +-/* Define to 1 if you have the `readdir_r' function. */ +-#undef HAVE_READDIR_R +- + /* Define to 1 if you have the `readlink' function. */ + #undef HAVE_READLINK + +diff -durN gcc-4.3.1.orig/libjava/java/io/natFilePosix.cc gcc-4.3.1/libjava/java/io/natFilePosix.cc +--- gcc-4.3.1.orig/libjava/java/io/natFilePosix.cc 2007-08-04 23:50:01.000000000 +0200 ++++ gcc-4.3.1/libjava/java/io/natFilePosix.cc 2008-06-10 14:58:13.000000000 +0200 +@@ -1,6 +1,6 @@ + // natFile.cc - Native part of File class for POSIX. + +-/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2006 ++/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2006, 2008 + Free Software Foundation + + This file is part of libgcj. +@@ -292,13 +292,7 @@ + + java::util::ArrayList *list = new java::util::ArrayList (); + struct dirent *d; +-#if defined(HAVE_READDIR_R) && defined(_POSIX_PTHREAD_SEMANTICS) +- int name_max = pathconf (buf, _PC_NAME_MAX); +- char dbuf[sizeof (struct dirent) + name_max + 1]; +- while (readdir_r (dir, (struct dirent *) dbuf, &d) == 0 && d != NULL) +-#else /* HAVE_READDIR_R */ + while ((d = readdir (dir)) != NULL) +-#endif /* HAVE_READDIR_R */ + { + // Omit "." and "..". + if (d->d_name[0] == '.' diff --git a/patches/gcc/4.3.1/375-gcc4-ia64-noteGNUstack.patch b/patches/gcc/4.3.1/375-gcc4-ia64-noteGNUstack.patch deleted file mode 100644 index d656661..0000000 --- a/patches/gcc/4.3.1/375-gcc4-ia64-noteGNUstack.patch +++ /dev/null @@ -1,96 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/61_all_gcc4-ia64-noteGNUstack.patch -2004-09-20 Jakub Jelinek - - * config/rs6000/ppc-asm.h: Add .note.GNU-stack section also - on ppc64-linux. - - * config/ia64/lib1funcs.asm: Add .note.GNU-stack section on - ia64-linux. - * config/ia64/crtbegin.asm: Likewise. - * config/ia64/crtend.asm: Likewise. - * config/ia64/crti.asm: Likewise. - * config/ia64/crtn.asm: Likewise. - -2004-05-14 Jakub Jelinek - - * config/ia64/linux.h (TARGET_ASM_FILE_END): Define. - -diff -durN gcc-4.3.1.orig/gcc/config/ia64/crtbegin.asm gcc-4.3.1/gcc/config/ia64/crtbegin.asm ---- gcc-4.3.1.orig/gcc/config/ia64/crtbegin.asm 2005-09-27 02:52:24.000000000 +0200 -+++ gcc-4.3.1/gcc/config/ia64/crtbegin.asm 2008-06-10 14:58:17.000000000 +0200 -@@ -255,3 +255,7 @@ - .weak __cxa_finalize - #endif - .weak _Jv_RegisterClasses -+ -+#ifdef __linux__ -+.section .note.GNU-stack; .previous -+#endif -diff -durN gcc-4.3.1.orig/gcc/config/ia64/crtend.asm gcc-4.3.1/gcc/config/ia64/crtend.asm ---- gcc-4.3.1.orig/gcc/config/ia64/crtend.asm 2005-09-27 02:52:24.000000000 +0200 -+++ gcc-4.3.1/gcc/config/ia64/crtend.asm 2008-06-10 14:58:17.000000000 +0200 -@@ -122,3 +122,7 @@ - - br.ret.sptk.many rp - .endp __do_global_ctors_aux -+ -+#ifdef __linux__ -+.section .note.GNU-stack; .previous -+#endif -diff -durN gcc-4.3.1.orig/gcc/config/ia64/crti.asm gcc-4.3.1/gcc/config/ia64/crti.asm ---- gcc-4.3.1.orig/gcc/config/ia64/crti.asm 2005-06-25 03:22:41.000000000 +0200 -+++ gcc-4.3.1/gcc/config/ia64/crti.asm 2008-06-10 14:58:17.000000000 +0200 -@@ -64,3 +64,7 @@ - .body - - # end of crti.asm -+ -+#ifdef __linux__ -+.section .note.GNU-stack; .previous -+#endif -diff -durN gcc-4.3.1.orig/gcc/config/ia64/crtn.asm gcc-4.3.1/gcc/config/ia64/crtn.asm ---- gcc-4.3.1.orig/gcc/config/ia64/crtn.asm 2005-06-25 03:22:41.000000000 +0200 -+++ gcc-4.3.1/gcc/config/ia64/crtn.asm 2008-06-10 14:58:17.000000000 +0200 -@@ -54,3 +54,7 @@ - br.ret.sptk.many b0 - - # end of crtn.asm -+ -+#ifdef __linux__ -+.section .note.GNU-stack; .previous -+#endif -diff -durN gcc-4.3.1.orig/gcc/config/ia64/lib1funcs.asm gcc-4.3.1/gcc/config/ia64/lib1funcs.asm ---- gcc-4.3.1.orig/gcc/config/ia64/lib1funcs.asm 2005-09-27 02:52:24.000000000 +0200 -+++ gcc-4.3.1/gcc/config/ia64/lib1funcs.asm 2008-06-10 14:58:17.000000000 +0200 -@@ -792,3 +792,7 @@ - } - .endp __floattitf - #endif -+ -+#ifdef __linux__ -+.section .note.GNU-stack; .previous -+#endif -diff -durN gcc-4.3.1.orig/gcc/config/ia64/linux.h gcc-4.3.1/gcc/config/ia64/linux.h ---- gcc-4.3.1.orig/gcc/config/ia64/linux.h 2006-12-12 16:15:19.000000000 +0100 -+++ gcc-4.3.1/gcc/config/ia64/linux.h 2008-06-10 14:58:17.000000000 +0200 -@@ -5,6 +5,8 @@ - - #define TARGET_VERSION fprintf (stderr, " (IA-64) Linux"); - -+#define TARGET_ASM_FILE_END file_end_indicate_exec_stack -+ - /* This is for -profile to use -lc_p instead of -lc. */ - #undef CC1_SPEC - #define CC1_SPEC "%{profile:-p} %{G*}" -diff -durN gcc-4.3.1.orig/gcc/config/rs6000/ppc-asm.h gcc-4.3.1/gcc/config/rs6000/ppc-asm.h ---- gcc-4.3.1.orig/gcc/config/rs6000/ppc-asm.h 2003-06-04 18:44:51.000000000 +0200 -+++ gcc-4.3.1/gcc/config/rs6000/ppc-asm.h 2008-06-10 14:58:17.000000000 +0200 -@@ -158,7 +158,7 @@ - .size FUNC_NAME(name),GLUE(.L,name)-FUNC_NAME(name) - #endif - --#if defined __linux__ && !defined __powerpc64__ -+#if defined __linux__ - .section .note.GNU-stack - .previous - #endif diff --git a/patches/gcc/4.3.1/375-noteGNUstack-00.patch b/patches/gcc/4.3.1/375-noteGNUstack-00.patch new file mode 100644 index 0000000..d656661 --- /dev/null +++ b/patches/gcc/4.3.1/375-noteGNUstack-00.patch @@ -0,0 +1,96 @@ +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/61_all_gcc4-ia64-noteGNUstack.patch +2004-09-20 Jakub Jelinek + + * config/rs6000/ppc-asm.h: Add .note.GNU-stack section also + on ppc64-linux. + + * config/ia64/lib1funcs.asm: Add .note.GNU-stack section on + ia64-linux. + * config/ia64/crtbegin.asm: Likewise. + * config/ia64/crtend.asm: Likewise. + * config/ia64/crti.asm: Likewise. + * config/ia64/crtn.asm: Likewise. + +2004-05-14 Jakub Jelinek + + * config/ia64/linux.h (TARGET_ASM_FILE_END): Define. + +diff -durN gcc-4.3.1.orig/gcc/config/ia64/crtbegin.asm gcc-4.3.1/gcc/config/ia64/crtbegin.asm +--- gcc-4.3.1.orig/gcc/config/ia64/crtbegin.asm 2005-09-27 02:52:24.000000000 +0200 ++++ gcc-4.3.1/gcc/config/ia64/crtbegin.asm 2008-06-10 14:58:17.000000000 +0200 +@@ -255,3 +255,7 @@ + .weak __cxa_finalize + #endif + .weak _Jv_RegisterClasses ++ ++#ifdef __linux__ ++.section .note.GNU-stack; .previous ++#endif +diff -durN gcc-4.3.1.orig/gcc/config/ia64/crtend.asm gcc-4.3.1/gcc/config/ia64/crtend.asm +--- gcc-4.3.1.orig/gcc/config/ia64/crtend.asm 2005-09-27 02:52:24.000000000 +0200 ++++ gcc-4.3.1/gcc/config/ia64/crtend.asm 2008-06-10 14:58:17.000000000 +0200 +@@ -122,3 +122,7 @@ + + br.ret.sptk.many rp + .endp __do_global_ctors_aux ++ ++#ifdef __linux__ ++.section .note.GNU-stack; .previous ++#endif +diff -durN gcc-4.3.1.orig/gcc/config/ia64/crti.asm gcc-4.3.1/gcc/config/ia64/crti.asm +--- gcc-4.3.1.orig/gcc/config/ia64/crti.asm 2005-06-25 03:22:41.000000000 +0200 ++++ gcc-4.3.1/gcc/config/ia64/crti.asm 2008-06-10 14:58:17.000000000 +0200 +@@ -64,3 +64,7 @@ + .body + + # end of crti.asm ++ ++#ifdef __linux__ ++.section .note.GNU-stack; .previous ++#endif +diff -durN gcc-4.3.1.orig/gcc/config/ia64/crtn.asm gcc-4.3.1/gcc/config/ia64/crtn.asm +--- gcc-4.3.1.orig/gcc/config/ia64/crtn.asm 2005-06-25 03:22:41.000000000 +0200 ++++ gcc-4.3.1/gcc/config/ia64/crtn.asm 2008-06-10 14:58:17.000000000 +0200 +@@ -54,3 +54,7 @@ + br.ret.sptk.many b0 + + # end of crtn.asm ++ ++#ifdef __linux__ ++.section .note.GNU-stack; .previous ++#endif +diff -durN gcc-4.3.1.orig/gcc/config/ia64/lib1funcs.asm gcc-4.3.1/gcc/config/ia64/lib1funcs.asm +--- gcc-4.3.1.orig/gcc/config/ia64/lib1funcs.asm 2005-09-27 02:52:24.000000000 +0200 ++++ gcc-4.3.1/gcc/config/ia64/lib1funcs.asm 2008-06-10 14:58:17.000000000 +0200 +@@ -792,3 +792,7 @@ + } + .endp __floattitf + #endif ++ ++#ifdef __linux__ ++.section .note.GNU-stack; .previous ++#endif +diff -durN gcc-4.3.1.orig/gcc/config/ia64/linux.h gcc-4.3.1/gcc/config/ia64/linux.h +--- gcc-4.3.1.orig/gcc/config/ia64/linux.h 2006-12-12 16:15:19.000000000 +0100 ++++ gcc-4.3.1/gcc/config/ia64/linux.h 2008-06-10 14:58:17.000000000 +0200 +@@ -5,6 +5,8 @@ + + #define TARGET_VERSION fprintf (stderr, " (IA-64) Linux"); + ++#define TARGET_ASM_FILE_END file_end_indicate_exec_stack ++ + /* This is for -profile to use -lc_p instead of -lc. */ + #undef CC1_SPEC + #define CC1_SPEC "%{profile:-p} %{G*}" +diff -durN gcc-4.3.1.orig/gcc/config/rs6000/ppc-asm.h gcc-4.3.1/gcc/config/rs6000/ppc-asm.h +--- gcc-4.3.1.orig/gcc/config/rs6000/ppc-asm.h 2003-06-04 18:44:51.000000000 +0200 ++++ gcc-4.3.1/gcc/config/rs6000/ppc-asm.h 2008-06-10 14:58:17.000000000 +0200 +@@ -158,7 +158,7 @@ + .size FUNC_NAME(name),GLUE(.L,name)-FUNC_NAME(name) + #endif + +-#if defined __linux__ && !defined __powerpc64__ ++#if defined __linux__ + .section .note.GNU-stack + .previous + #endif diff --git a/patches/gcc/4.3.1/400-gcc4-noteGNUstack.patch b/patches/gcc/4.3.1/400-gcc4-noteGNUstack.patch deleted file mode 100644 index a74e5e8..0000000 --- a/patches/gcc/4.3.1/400-gcc4-noteGNUstack.patch +++ /dev/null @@ -1,198 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/62_all_gcc4-noteGNUstack.patch -2005-02-08 Jakub Jelinek - - * src/alpha/osf.S: Add .note.GNU-stack on Linux. - * src/s390/sysv.S: Likewise. - * src/powerpc/linux64.S: Likewise. - * src/powerpc/linux64_closure.S: Likewise. - * src/powerpc/ppc_closure.S: Likewise. - * src/powerpc/sysv.S: Likewise. - * src/x86/unix64.S: Likewise. - * src/x86/sysv.S: Likewise. - * src/sparc/v8.S: Likewise. - * src/sparc/v9.S: Likewise. - * src/m68k/sysv.S: Likewise. - * src/ia64/unix.S: Likewise. - * src/arm/sysv.S: Likewise. - - * ia64_save_regs_in_stack.s: Moved to... - * ia64_save_regs_in_stack.S: ... this. Add .note.GNU-stack - on Linux. - -diff -durN gcc-4.3.1.orig/boehm-gc/ia64_save_regs_in_stack.S gcc-4.3.1/boehm-gc/ia64_save_regs_in_stack.S ---- gcc-4.3.1.orig/boehm-gc/ia64_save_regs_in_stack.S 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-4.3.1/boehm-gc/ia64_save_regs_in_stack.S 2008-06-10 14:58:21.000000000 +0200 -@@ -0,0 +1,15 @@ -+ .text -+ .align 16 -+ .global GC_save_regs_in_stack -+ .proc GC_save_regs_in_stack -+GC_save_regs_in_stack: -+ .bodyfoo.mpg -+ flushrs -+ ;; -+ mov r8=ar.bsp -+ br.ret.sptk.few rp -+ .endp GC_save_regs_in_stack -+ -+#ifdef __linux__ -+ .section .note.GNU-stack,"",@progbits -+#endif -diff -durN gcc-4.3.1.orig/boehm-gc/ia64_save_regs_in_stack.s gcc-4.3.1/boehm-gc/ia64_save_regs_in_stack.s ---- gcc-4.3.1.orig/boehm-gc/ia64_save_regs_in_stack.s 2001-10-15 06:57:59.000000000 +0200 -+++ gcc-4.3.1/boehm-gc/ia64_save_regs_in_stack.s 2008-06-10 14:58:21.000000000 +0200 -@@ -1,12 +0,0 @@ -- .text -- .align 16 -- .global GC_save_regs_in_stack -- .proc GC_save_regs_in_stack --GC_save_regs_in_stack: -- .body -- flushrs -- ;; -- mov r8=ar.bsp -- br.ret.sptk.few rp -- .endp GC_save_regs_in_stack -- -diff -durN gcc-4.3.1.orig/libffi/src/alpha/osf.S gcc-4.3.1/libffi/src/alpha/osf.S ---- gcc-4.3.1.orig/libffi/src/alpha/osf.S 2007-04-06 18:24:16.000000000 +0200 -+++ gcc-4.3.1/libffi/src/alpha/osf.S 2008-06-10 14:58:21.000000000 +0200 -@@ -358,4 +358,8 @@ - .byte 16 # uleb128 offset 16*-8 - .align 3 - $LEFDE3: -+ -+#ifdef __linux__ -+ .section .note.GNU-stack,"",@progbits -+#endif - #endif -diff -durN gcc-4.3.1.orig/libffi/src/arm/sysv.S gcc-4.3.1/libffi/src/arm/sysv.S ---- gcc-4.3.1.orig/libffi/src/arm/sysv.S 2007-09-04 19:52:45.000000000 +0200 -+++ gcc-4.3.1/libffi/src/arm/sysv.S 2008-06-10 14:58:21.000000000 +0200 -@@ -293,3 +293,6 @@ - UNWIND .fnend - .size CNAME(ffi_closure_SYSV),.ffi_closure_SYSV_end-CNAME(ffi_closure_SYSV) - -+#if defined __ELF__ && defined __linux__ -+ .section .note.GNU-stack,"",%progbits -+#endif -diff -durN gcc-4.3.1.orig/libffi/src/ia64/unix.S gcc-4.3.1/libffi/src/ia64/unix.S ---- gcc-4.3.1.orig/libffi/src/ia64/unix.S 2005-03-30 23:49:19.000000000 +0200 -+++ gcc-4.3.1/libffi/src/ia64/unix.S 2008-06-10 14:58:21.000000000 +0200 -@@ -553,3 +553,7 @@ - data8 @pcrel(.Lld_hfa_float) // FFI_IA64_TYPE_HFA_FLOAT - data8 @pcrel(.Lld_hfa_double) // FFI_IA64_TYPE_HFA_DOUBLE - data8 @pcrel(.Lld_hfa_ldouble) // FFI_IA64_TYPE_HFA_LDOUBLE -+ -+#if defined __ELF__ && defined __linux__ -+ .section .note.GNU-stack,"",@progbits -+#endif -diff -durN gcc-4.3.1.orig/libffi/src/m68k/sysv.S gcc-4.3.1/libffi/src/m68k/sysv.S ---- gcc-4.3.1.orig/libffi/src/m68k/sysv.S 2007-05-10 23:29:04.000000000 +0200 -+++ gcc-4.3.1/libffi/src/m68k/sysv.S 2008-06-10 14:58:21.000000000 +0200 -@@ -207,3 +207,7 @@ - rts - CFI_ENDPROC() - .size ffi_closure_struct_SYSV,.-ffi_closure_struct_SYSV -+ -+#if defined __ELF__ && defined __linux__ -+ .section .note.GNU-stack,"",@progbits -+#endif -diff -durN gcc-4.3.1.orig/libffi/src/powerpc/linux64.S gcc-4.3.1/libffi/src/powerpc/linux64.S ---- gcc-4.3.1.orig/libffi/src/powerpc/linux64.S 2007-11-17 00:24:53.000000000 +0100 -+++ gcc-4.3.1/libffi/src/powerpc/linux64.S 2008-06-10 14:58:21.000000000 +0200 -@@ -179,3 +179,7 @@ - .align 3 - .LEFDE1: - #endif -+ -+#if defined __ELF__ && defined __linux__ -+ .section .note.GNU-stack,"",@progbits -+#endif -diff -durN gcc-4.3.1.orig/libffi/src/powerpc/linux64_closure.S gcc-4.3.1/libffi/src/powerpc/linux64_closure.S ---- gcc-4.3.1.orig/libffi/src/powerpc/linux64_closure.S 2005-08-11 23:18:24.000000000 +0200 -+++ gcc-4.3.1/libffi/src/powerpc/linux64_closure.S 2008-06-10 14:58:21.000000000 +0200 -@@ -204,3 +204,7 @@ - .align 3 - .LEFDE1: - #endif -+ -+#if defined __ELF__ && defined __linux__ -+ .section .note.GNU-stack,"",@progbits -+#endif -diff -durN gcc-4.3.1.orig/libffi/src/powerpc/ppc_closure.S gcc-4.3.1/libffi/src/powerpc/ppc_closure.S ---- gcc-4.3.1.orig/libffi/src/powerpc/ppc_closure.S 2007-12-01 22:00:04.000000000 +0100 -+++ gcc-4.3.1/libffi/src/powerpc/ppc_closure.S 2008-06-10 14:58:21.000000000 +0200 -@@ -295,3 +295,7 @@ - .LEFDE1: - - #endif -+ -+#if defined __ELF__ && defined __linux__ -+ .section .note.GNU-stack,"",@progbits -+#endif -diff -durN gcc-4.3.1.orig/libffi/src/powerpc/sysv.S gcc-4.3.1/libffi/src/powerpc/sysv.S ---- gcc-4.3.1.orig/libffi/src/powerpc/sysv.S 2007-12-01 22:00:04.000000000 +0100 -+++ gcc-4.3.1/libffi/src/powerpc/sysv.S 2008-06-10 14:58:21.000000000 +0200 -@@ -223,3 +223,7 @@ - .align 2 - .LEFDE1: - #endif -+ -+#if defined __ELF__ && defined __linux__ -+ .section .note.GNU-stack,"",@progbits -+#endif -diff -durN gcc-4.3.1.orig/libffi/src/s390/sysv.S gcc-4.3.1/libffi/src/s390/sysv.S ---- gcc-4.3.1.orig/libffi/src/s390/sysv.S 2003-10-21 21:01:58.000000000 +0200 -+++ gcc-4.3.1/libffi/src/s390/sysv.S 2008-06-10 14:58:21.000000000 +0200 -@@ -427,3 +427,6 @@ - - #endif - -+#if defined __ELF__ && defined __linux__ -+ .section .note.GNU-stack,"",@progbits -+#endif -diff -durN gcc-4.3.1.orig/libffi/src/sparc/v8.S gcc-4.3.1/libffi/src/sparc/v8.S ---- gcc-4.3.1.orig/libffi/src/sparc/v8.S 2004-11-22 19:35:16.000000000 +0100 -+++ gcc-4.3.1/libffi/src/sparc/v8.S 2008-06-10 14:58:21.000000000 +0200 -@@ -265,3 +265,7 @@ - .byte 0x1f ! uleb128 0x1f - .align WS - .LLEFDE2: -+ -+#if defined __ELF__ && defined __linux__ -+ .section .note.GNU-stack,"",@progbits -+#endif -diff -durN gcc-4.3.1.orig/libffi/src/sparc/v9.S gcc-4.3.1/libffi/src/sparc/v9.S ---- gcc-4.3.1.orig/libffi/src/sparc/v9.S 2004-01-25 07:58:33.000000000 +0100 -+++ gcc-4.3.1/libffi/src/sparc/v9.S 2008-06-10 14:58:21.000000000 +0200 -@@ -300,3 +300,7 @@ - .align 8 - .LLEFDE2: - #endif -+ -+#ifdef __linux__ -+ .section .note.GNU-stack,"",@progbits -+#endif -diff -durN gcc-4.3.1.orig/libffi/src/x86/sysv.S gcc-4.3.1/libffi/src/x86/sysv.S ---- gcc-4.3.1.orig/libffi/src/x86/sysv.S 2008-01-30 15:36:58.000000000 +0100 -+++ gcc-4.3.1/libffi/src/x86/sysv.S 2008-06-10 14:58:21.000000000 +0200 -@@ -430,3 +430,7 @@ - #endif - - #endif /* ifndef __x86_64__ */ -+ -+#if defined __ELF__ && defined __linux__ -+ .section .note.GNU-stack,"",@progbits -+#endif -diff -durN gcc-4.3.1.orig/libffi/src/x86/unix64.S gcc-4.3.1/libffi/src/x86/unix64.S ---- gcc-4.3.1.orig/libffi/src/x86/unix64.S 2005-05-05 06:06:38.000000000 +0200 -+++ gcc-4.3.1/libffi/src/x86/unix64.S 2008-06-10 14:58:21.000000000 +0200 -@@ -410,3 +410,7 @@ - .LEFDE3: - - #endif /* __x86_64__ */ -+ -+#if defined __ELF__ && defined __linux__ -+ .section .note.GNU-stack,"",@progbits -+#endif diff --git a/patches/gcc/4.3.1/400-noteGNUstack-01.patch b/patches/gcc/4.3.1/400-noteGNUstack-01.patch new file mode 100644 index 0000000..a74e5e8 --- /dev/null +++ b/patches/gcc/4.3.1/400-noteGNUstack-01.patch @@ -0,0 +1,198 @@ +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/62_all_gcc4-noteGNUstack.patch +2005-02-08 Jakub Jelinek + + * src/alpha/osf.S: Add .note.GNU-stack on Linux. + * src/s390/sysv.S: Likewise. + * src/powerpc/linux64.S: Likewise. + * src/powerpc/linux64_closure.S: Likewise. + * src/powerpc/ppc_closure.S: Likewise. + * src/powerpc/sysv.S: Likewise. + * src/x86/unix64.S: Likewise. + * src/x86/sysv.S: Likewise. + * src/sparc/v8.S: Likewise. + * src/sparc/v9.S: Likewise. + * src/m68k/sysv.S: Likewise. + * src/ia64/unix.S: Likewise. + * src/arm/sysv.S: Likewise. + + * ia64_save_regs_in_stack.s: Moved to... + * ia64_save_regs_in_stack.S: ... this. Add .note.GNU-stack + on Linux. + +diff -durN gcc-4.3.1.orig/boehm-gc/ia64_save_regs_in_stack.S gcc-4.3.1/boehm-gc/ia64_save_regs_in_stack.S +--- gcc-4.3.1.orig/boehm-gc/ia64_save_regs_in_stack.S 1970-01-01 01:00:00.000000000 +0100 ++++ gcc-4.3.1/boehm-gc/ia64_save_regs_in_stack.S 2008-06-10 14:58:21.000000000 +0200 +@@ -0,0 +1,15 @@ ++ .text ++ .align 16 ++ .global GC_save_regs_in_stack ++ .proc GC_save_regs_in_stack ++GC_save_regs_in_stack: ++ .bodyfoo.mpg ++ flushrs ++ ;; ++ mov r8=ar.bsp ++ br.ret.sptk.few rp ++ .endp GC_save_regs_in_stack ++ ++#ifdef __linux__ ++ .section .note.GNU-stack,"",@progbits ++#endif +diff -durN gcc-4.3.1.orig/boehm-gc/ia64_save_regs_in_stack.s gcc-4.3.1/boehm-gc/ia64_save_regs_in_stack.s +--- gcc-4.3.1.orig/boehm-gc/ia64_save_regs_in_stack.s 2001-10-15 06:57:59.000000000 +0200 ++++ gcc-4.3.1/boehm-gc/ia64_save_regs_in_stack.s 2008-06-10 14:58:21.000000000 +0200 +@@ -1,12 +0,0 @@ +- .text +- .align 16 +- .global GC_save_regs_in_stack +- .proc GC_save_regs_in_stack +-GC_save_regs_in_stack: +- .body +- flushrs +- ;; +- mov r8=ar.bsp +- br.ret.sptk.few rp +- .endp GC_save_regs_in_stack +- +diff -durN gcc-4.3.1.orig/libffi/src/alpha/osf.S gcc-4.3.1/libffi/src/alpha/osf.S +--- gcc-4.3.1.orig/libffi/src/alpha/osf.S 2007-04-06 18:24:16.000000000 +0200 ++++ gcc-4.3.1/libffi/src/alpha/osf.S 2008-06-10 14:58:21.000000000 +0200 +@@ -358,4 +358,8 @@ + .byte 16 # uleb128 offset 16*-8 + .align 3 + $LEFDE3: ++ ++#ifdef __linux__ ++ .section .note.GNU-stack,"",@progbits ++#endif + #endif +diff -durN gcc-4.3.1.orig/libffi/src/arm/sysv.S gcc-4.3.1/libffi/src/arm/sysv.S +--- gcc-4.3.1.orig/libffi/src/arm/sysv.S 2007-09-04 19:52:45.000000000 +0200 ++++ gcc-4.3.1/libffi/src/arm/sysv.S 2008-06-10 14:58:21.000000000 +0200 +@@ -293,3 +293,6 @@ + UNWIND .fnend + .size CNAME(ffi_closure_SYSV),.ffi_closure_SYSV_end-CNAME(ffi_closure_SYSV) + ++#if defined __ELF__ && defined __linux__ ++ .section .note.GNU-stack,"",%progbits ++#endif +diff -durN gcc-4.3.1.orig/libffi/src/ia64/unix.S gcc-4.3.1/libffi/src/ia64/unix.S +--- gcc-4.3.1.orig/libffi/src/ia64/unix.S 2005-03-30 23:49:19.000000000 +0200 ++++ gcc-4.3.1/libffi/src/ia64/unix.S 2008-06-10 14:58:21.000000000 +0200 +@@ -553,3 +553,7 @@ + data8 @pcrel(.Lld_hfa_float) // FFI_IA64_TYPE_HFA_FLOAT + data8 @pcrel(.Lld_hfa_double) // FFI_IA64_TYPE_HFA_DOUBLE + data8 @pcrel(.Lld_hfa_ldouble) // FFI_IA64_TYPE_HFA_LDOUBLE ++ ++#if defined __ELF__ && defined __linux__ ++ .section .note.GNU-stack,"",@progbits ++#endif +diff -durN gcc-4.3.1.orig/libffi/src/m68k/sysv.S gcc-4.3.1/libffi/src/m68k/sysv.S +--- gcc-4.3.1.orig/libffi/src/m68k/sysv.S 2007-05-10 23:29:04.000000000 +0200 ++++ gcc-4.3.1/libffi/src/m68k/sysv.S 2008-06-10 14:58:21.000000000 +0200 +@@ -207,3 +207,7 @@ + rts + CFI_ENDPROC() + .size ffi_closure_struct_SYSV,.-ffi_closure_struct_SYSV ++ ++#if defined __ELF__ && defined __linux__ ++ .section .note.GNU-stack,"",@progbits ++#endif +diff -durN gcc-4.3.1.orig/libffi/src/powerpc/linux64.S gcc-4.3.1/libffi/src/powerpc/linux64.S +--- gcc-4.3.1.orig/libffi/src/powerpc/linux64.S 2007-11-17 00:24:53.000000000 +0100 ++++ gcc-4.3.1/libffi/src/powerpc/linux64.S 2008-06-10 14:58:21.000000000 +0200 +@@ -179,3 +179,7 @@ + .align 3 + .LEFDE1: + #endif ++ ++#if defined __ELF__ && defined __linux__ ++ .section .note.GNU-stack,"",@progbits ++#endif +diff -durN gcc-4.3.1.orig/libffi/src/powerpc/linux64_closure.S gcc-4.3.1/libffi/src/powerpc/linux64_closure.S +--- gcc-4.3.1.orig/libffi/src/powerpc/linux64_closure.S 2005-08-11 23:18:24.000000000 +0200 ++++ gcc-4.3.1/libffi/src/powerpc/linux64_closure.S 2008-06-10 14:58:21.000000000 +0200 +@@ -204,3 +204,7 @@ + .align 3 + .LEFDE1: + #endif ++ ++#if defined __ELF__ && defined __linux__ ++ .section .note.GNU-stack,"",@progbits ++#endif +diff -durN gcc-4.3.1.orig/libffi/src/powerpc/ppc_closure.S gcc-4.3.1/libffi/src/powerpc/ppc_closure.S +--- gcc-4.3.1.orig/libffi/src/powerpc/ppc_closure.S 2007-12-01 22:00:04.000000000 +0100 ++++ gcc-4.3.1/libffi/src/powerpc/ppc_closure.S 2008-06-10 14:58:21.000000000 +0200 +@@ -295,3 +295,7 @@ + .LEFDE1: + + #endif ++ ++#if defined __ELF__ && defined __linux__ ++ .section .note.GNU-stack,"",@progbits ++#endif +diff -durN gcc-4.3.1.orig/libffi/src/powerpc/sysv.S gcc-4.3.1/libffi/src/powerpc/sysv.S +--- gcc-4.3.1.orig/libffi/src/powerpc/sysv.S 2007-12-01 22:00:04.000000000 +0100 ++++ gcc-4.3.1/libffi/src/powerpc/sysv.S 2008-06-10 14:58:21.000000000 +0200 +@@ -223,3 +223,7 @@ + .align 2 + .LEFDE1: + #endif ++ ++#if defined __ELF__ && defined __linux__ ++ .section .note.GNU-stack,"",@progbits ++#endif +diff -durN gcc-4.3.1.orig/libffi/src/s390/sysv.S gcc-4.3.1/libffi/src/s390/sysv.S +--- gcc-4.3.1.orig/libffi/src/s390/sysv.S 2003-10-21 21:01:58.000000000 +0200 ++++ gcc-4.3.1/libffi/src/s390/sysv.S 2008-06-10 14:58:21.000000000 +0200 +@@ -427,3 +427,6 @@ + + #endif + ++#if defined __ELF__ && defined __linux__ ++ .section .note.GNU-stack,"",@progbits ++#endif +diff -durN gcc-4.3.1.orig/libffi/src/sparc/v8.S gcc-4.3.1/libffi/src/sparc/v8.S +--- gcc-4.3.1.orig/libffi/src/sparc/v8.S 2004-11-22 19:35:16.000000000 +0100 ++++ gcc-4.3.1/libffi/src/sparc/v8.S 2008-06-10 14:58:21.000000000 +0200 +@@ -265,3 +265,7 @@ + .byte 0x1f ! uleb128 0x1f + .align WS + .LLEFDE2: ++ ++#if defined __ELF__ && defined __linux__ ++ .section .note.GNU-stack,"",@progbits ++#endif +diff -durN gcc-4.3.1.orig/libffi/src/sparc/v9.S gcc-4.3.1/libffi/src/sparc/v9.S +--- gcc-4.3.1.orig/libffi/src/sparc/v9.S 2004-01-25 07:58:33.000000000 +0100 ++++ gcc-4.3.1/libffi/src/sparc/v9.S 2008-06-10 14:58:21.000000000 +0200 +@@ -300,3 +300,7 @@ + .align 8 + .LLEFDE2: + #endif ++ ++#ifdef __linux__ ++ .section .note.GNU-stack,"",@progbits ++#endif +diff -durN gcc-4.3.1.orig/libffi/src/x86/sysv.S gcc-4.3.1/libffi/src/x86/sysv.S +--- gcc-4.3.1.orig/libffi/src/x86/sysv.S 2008-01-30 15:36:58.000000000 +0100 ++++ gcc-4.3.1/libffi/src/x86/sysv.S 2008-06-10 14:58:21.000000000 +0200 +@@ -430,3 +430,7 @@ + #endif + + #endif /* ifndef __x86_64__ */ ++ ++#if defined __ELF__ && defined __linux__ ++ .section .note.GNU-stack,"",@progbits ++#endif +diff -durN gcc-4.3.1.orig/libffi/src/x86/unix64.S gcc-4.3.1/libffi/src/x86/unix64.S +--- gcc-4.3.1.orig/libffi/src/x86/unix64.S 2005-05-05 06:06:38.000000000 +0200 ++++ gcc-4.3.1/libffi/src/x86/unix64.S 2008-06-10 14:58:21.000000000 +0200 +@@ -410,3 +410,7 @@ + .LEFDE3: + + #endif /* __x86_64__ */ ++ ++#if defined __ELF__ && defined __linux__ ++ .section .note.GNU-stack,"",@progbits ++#endif diff --git a/patches/gcc/4.3.1/425-gcc43-pr34571.patch b/patches/gcc/4.3.1/425-gcc43-pr34571.patch deleted file mode 100644 index 16d0c30..0000000 --- a/patches/gcc/4.3.1/425-gcc43-pr34571.patch +++ /dev/null @@ -1,35 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/64_all_gcc43-pr34571.patch -http://gcc.gnu.org/PR34571 - -2007-12-26 Rask Ingemann Lambertsen - - PR target/34571 - * config/alpha/alpha.c (alpha_cannot_force_const_mem): Use - symbolic_operand. - * varasm.c (output_constant_pool_1): Fix typo. - -diff -durN gcc-4.3.1.orig/gcc/config/alpha/alpha.c gcc-4.3.1/gcc/config/alpha/alpha.c ---- gcc-4.3.1.orig/gcc/config/alpha/alpha.c 2008-02-07 18:45:24.000000000 +0100 -+++ gcc-4.3.1/gcc/config/alpha/alpha.c 2008-06-10 14:58:24.000000000 +0200 -@@ -1113,8 +1113,7 @@ - static bool - alpha_cannot_force_const_mem (rtx x) - { -- enum rtx_code code = GET_CODE (x); -- return code == SYMBOL_REF || code == LABEL_REF || code == CONST; -+ return symbolic_operand (x, GET_MODE (x)); - } - - /* We do not allow indirect calls to be optimized into sibling calls, nor -diff -durN gcc-4.3.1.orig/gcc/varasm.c gcc-4.3.1/gcc/varasm.c ---- gcc-4.3.1.orig/gcc/varasm.c 2007-12-05 22:55:10.000000000 +0100 -+++ gcc-4.3.1/gcc/varasm.c 2008-06-10 14:58:24.000000000 +0200 -@@ -3710,7 +3710,7 @@ - /* FALLTHRU */ - - case LABEL_REF: -- tmp = XEXP (x, 0); -+ tmp = XEXP (tmp, 0); - gcc_assert (!INSN_DELETED_P (tmp)); - gcc_assert (!NOTE_P (tmp) - || NOTE_KIND (tmp) != NOTE_INSN_DELETED); diff --git a/patches/gcc/4.3.1/425-pr34571.patch b/patches/gcc/4.3.1/425-pr34571.patch new file mode 100644 index 0000000..16d0c30 --- /dev/null +++ b/patches/gcc/4.3.1/425-pr34571.patch @@ -0,0 +1,35 @@ +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/64_all_gcc43-pr34571.patch +http://gcc.gnu.org/PR34571 + +2007-12-26 Rask Ingemann Lambertsen + + PR target/34571 + * config/alpha/alpha.c (alpha_cannot_force_const_mem): Use + symbolic_operand. + * varasm.c (output_constant_pool_1): Fix typo. + +diff -durN gcc-4.3.1.orig/gcc/config/alpha/alpha.c gcc-4.3.1/gcc/config/alpha/alpha.c +--- gcc-4.3.1.orig/gcc/config/alpha/alpha.c 2008-02-07 18:45:24.000000000 +0100 ++++ gcc-4.3.1/gcc/config/alpha/alpha.c 2008-06-10 14:58:24.000000000 +0200 +@@ -1113,8 +1113,7 @@ + static bool + alpha_cannot_force_const_mem (rtx x) + { +- enum rtx_code code = GET_CODE (x); +- return code == SYMBOL_REF || code == LABEL_REF || code == CONST; ++ return symbolic_operand (x, GET_MODE (x)); + } + + /* We do not allow indirect calls to be optimized into sibling calls, nor +diff -durN gcc-4.3.1.orig/gcc/varasm.c gcc-4.3.1/gcc/varasm.c +--- gcc-4.3.1.orig/gcc/varasm.c 2007-12-05 22:55:10.000000000 +0100 ++++ gcc-4.3.1/gcc/varasm.c 2008-06-10 14:58:24.000000000 +0200 +@@ -3710,7 +3710,7 @@ + /* FALLTHRU */ + + case LABEL_REF: +- tmp = XEXP (x, 0); ++ tmp = XEXP (tmp, 0); + gcc_assert (!INSN_DELETED_P (tmp)); + gcc_assert (!NOTE_P (tmp) + || NOTE_KIND (tmp) != NOTE_INSN_DELETED); diff --git a/patches/gcc/4.3.1/450-gcc43-pr25343.patch b/patches/gcc/4.3.1/450-gcc43-pr25343.patch deleted file mode 100644 index 776f607..0000000 --- a/patches/gcc/4.3.1/450-gcc43-pr25343.patch +++ /dev/null @@ -1,21 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/66_all_gcc43-pr25343.patch -http://gcc.gnu.org/PR25343 - -sniped from Debian - -2008-04-27 Roman Zippel - - * config/host-linux.c (TRY_EMPTY_VM_SPACE): Define for __mc68000__. - -diff -durN gcc-4.3.1.orig/gcc/config/host-linux.c gcc-4.3.1/gcc/config/host-linux.c ---- gcc-4.3.1.orig/gcc/config/host-linux.c 2007-08-02 12:49:31.000000000 +0200 -+++ gcc-4.3.1/gcc/config/host-linux.c 2008-06-10 14:58:28.000000000 +0200 -@@ -84,6 +84,8 @@ - # define TRY_EMPTY_VM_SPACE 0x8000000000 - #elif defined(__sparc__) - # define TRY_EMPTY_VM_SPACE 0x60000000 -+#elif defined(__mc68000__) -+# define TRY_EMPTY_VM_SPACE 0x40000000 - #else - # define TRY_EMPTY_VM_SPACE 0 - #endif diff --git a/patches/gcc/4.3.1/450-pr25343.patch b/patches/gcc/4.3.1/450-pr25343.patch new file mode 100644 index 0000000..776f607 --- /dev/null +++ b/patches/gcc/4.3.1/450-pr25343.patch @@ -0,0 +1,21 @@ +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/66_all_gcc43-pr25343.patch +http://gcc.gnu.org/PR25343 + +sniped from Debian + +2008-04-27 Roman Zippel + + * config/host-linux.c (TRY_EMPTY_VM_SPACE): Define for __mc68000__. + +diff -durN gcc-4.3.1.orig/gcc/config/host-linux.c gcc-4.3.1/gcc/config/host-linux.c +--- gcc-4.3.1.orig/gcc/config/host-linux.c 2007-08-02 12:49:31.000000000 +0200 ++++ gcc-4.3.1/gcc/config/host-linux.c 2008-06-10 14:58:28.000000000 +0200 +@@ -84,6 +84,8 @@ + # define TRY_EMPTY_VM_SPACE 0x8000000000 + #elif defined(__sparc__) + # define TRY_EMPTY_VM_SPACE 0x60000000 ++#elif defined(__mc68000__) ++# define TRY_EMPTY_VM_SPACE 0x40000000 + #else + # define TRY_EMPTY_VM_SPACE 0 + #endif diff --git a/patches/gcc/4.3.1/500-103-uclibc-conf-noupstream.patch b/patches/gcc/4.3.1/500-103-uclibc-conf-noupstream.patch deleted file mode 100644 index 5176968..0000000 --- a/patches/gcc/4.3.1/500-103-uclibc-conf-noupstream.patch +++ /dev/null @@ -1,13 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_103-uclibc-conf-noupstream.patch -diff -durN gcc-4.3.1.orig/gcc/config.gcc gcc-4.3.1/gcc/config.gcc ---- gcc-4.3.1.orig/gcc/config.gcc 2008-06-10 14:58:09.000000000 +0200 -+++ gcc-4.3.1/gcc/config.gcc 2008-06-10 14:58:36.000000000 +0200 -@@ -2149,7 +2149,7 @@ - ;; - sh-*-elf* | sh[12346l]*-*-elf* | sh*-*-kaos* | \ - sh-*-symbianelf* | sh[12346l]*-*-symbianelf* | \ -- sh-*-linux* | sh[346lbe]*-*-linux* | \ -+ sh*-*-linux* | sh[346lbe]*-*-linux* | \ - sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \ - sh64-*-netbsd* | sh64l*-*-netbsd*) - tmake_file="${tmake_file} sh/t-sh sh/t-elf" diff --git a/patches/gcc/4.3.1/500-uclibc-conf-noupstream.patch b/patches/gcc/4.3.1/500-uclibc-conf-noupstream.patch new file mode 100644 index 0000000..5176968 --- /dev/null +++ b/patches/gcc/4.3.1/500-uclibc-conf-noupstream.patch @@ -0,0 +1,13 @@ +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_103-uclibc-conf-noupstream.patch +diff -durN gcc-4.3.1.orig/gcc/config.gcc gcc-4.3.1/gcc/config.gcc +--- gcc-4.3.1.orig/gcc/config.gcc 2008-06-10 14:58:09.000000000 +0200 ++++ gcc-4.3.1/gcc/config.gcc 2008-06-10 14:58:36.000000000 +0200 +@@ -2149,7 +2149,7 @@ + ;; + sh-*-elf* | sh[12346l]*-*-elf* | sh*-*-kaos* | \ + sh-*-symbianelf* | sh[12346l]*-*-symbianelf* | \ +- sh-*-linux* | sh[346lbe]*-*-linux* | \ ++ sh*-*-linux* | sh[346lbe]*-*-linux* | \ + sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \ + sh64-*-netbsd* | sh64l*-*-netbsd*) + tmake_file="${tmake_file} sh/t-sh sh/t-elf" diff --git a/patches/gcc/4.3.1/525-200-uclibc-locale.patch b/patches/gcc/4.3.1/525-200-uclibc-locale.patch deleted file mode 100644 index 6ba5fd9..0000000 --- a/patches/gcc/4.3.1/525-200-uclibc-locale.patch +++ /dev/null @@ -1,2794 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_200-uclibc-locale.patch -diff -durN gcc-4.3.1.orig/libstdc++-v3/acinclude.m4 gcc-4.3.1/libstdc++-v3/acinclude.m4 ---- gcc-4.3.1.orig/libstdc++-v3/acinclude.m4 2008-04-25 18:52:57.000000000 +0200 -+++ gcc-4.3.1/libstdc++-v3/acinclude.m4 2008-06-10 14:58:39.000000000 +0200 -@@ -1349,7 +1349,7 @@ - AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [ - GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@], - [use MODEL for target locale package], -- [permit generic|gnu|ieee_1003.1-2001|yes|no|auto]) -+ [permit generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto]) - - # Deal with gettext issues. Default to not using it (=no) until we detect - # support for it later. Let the user turn it off via --e/d, but let that -@@ -1370,6 +1370,9 @@ - # Default to "generic". - if test $enable_clocale_flag = auto; then - case ${target_os} in -+ *-uclibc*) -+ enable_clocale_flag=uclibc -+ ;; - linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu) - enable_clocale_flag=gnu - ;; -@@ -1541,6 +1544,40 @@ - CTIME_CC=config/locale/generic/time_members.cc - CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h - ;; -+ uclibc) -+ AC_MSG_RESULT(uclibc) -+ -+ # Declare intention to use gettext, and add support for specific -+ # languages. -+ # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT -+ ALL_LINGUAS="de fr" -+ -+ # Don't call AM-GNU-GETTEXT here. Instead, assume glibc. -+ AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no) -+ if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then -+ USE_NLS=yes -+ fi -+ # Export the build objects. -+ for ling in $ALL_LINGUAS; do \ -+ glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \ -+ glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \ -+ done -+ AC_SUBST(glibcxx_MOFILES) -+ AC_SUBST(glibcxx_POFILES) -+ -+ CLOCALE_H=config/locale/uclibc/c_locale.h -+ CLOCALE_CC=config/locale/uclibc/c_locale.cc -+ CCODECVT_CC=config/locale/uclibc/codecvt_members.cc -+ CCOLLATE_CC=config/locale/uclibc/collate_members.cc -+ CCTYPE_CC=config/locale/uclibc/ctype_members.cc -+ CMESSAGES_H=config/locale/uclibc/messages_members.h -+ CMESSAGES_CC=config/locale/uclibc/messages_members.cc -+ CMONEY_CC=config/locale/uclibc/monetary_members.cc -+ CNUMERIC_CC=config/locale/uclibc/numeric_members.cc -+ CTIME_H=config/locale/uclibc/time_members.h -+ CTIME_CC=config/locale/uclibc/time_members.cc -+ CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h -+ ;; - esac - - # This is where the testsuite looks for locale catalogs, using the -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2008-06-10 14:58:39.000000000 +0200 -@@ -0,0 +1,63 @@ -+// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*- -+ -+// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 2, or (at your option) -+// any later version. -+ -+// This 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 General Public License for more details. -+ -+// You should have received a copy of the GNU General Public License along -+// with this library; see the file COPYING. If not, write to the Free -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -+// USA. -+ -+// As a special exception, you may use this file as part of a free software -+// library without restriction. Specifically, if other files instantiate -+// templates or use macros or inline functions from this file, or you compile -+// this file and link it with other files to produce an executable, this -+// file does not by itself cause the resulting executable to be covered by -+// the GNU General Public License. This exception does not however -+// invalidate any other reasons why the executable file might be covered by -+// the GNU General Public License. -+ -+// Written by Jakub Jelinek -+ -+#include -+#include -+ -+#ifdef __UCLIBC_MJN3_ONLY__ -+#warning clean this up -+#endif -+ -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ -+extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l; -+extern "C" __typeof(strcoll_l) __strcoll_l; -+extern "C" __typeof(strftime_l) __strftime_l; -+extern "C" __typeof(strtod_l) __strtod_l; -+extern "C" __typeof(strtof_l) __strtof_l; -+extern "C" __typeof(strtold_l) __strtold_l; -+extern "C" __typeof(strxfrm_l) __strxfrm_l; -+extern "C" __typeof(newlocale) __newlocale; -+extern "C" __typeof(freelocale) __freelocale; -+extern "C" __typeof(duplocale) __duplocale; -+extern "C" __typeof(uselocale) __uselocale; -+ -+#ifdef _GLIBCXX_USE_WCHAR_T -+extern "C" __typeof(iswctype_l) __iswctype_l; -+extern "C" __typeof(towlower_l) __towlower_l; -+extern "C" __typeof(towupper_l) __towupper_l; -+extern "C" __typeof(wcscoll_l) __wcscoll_l; -+extern "C" __typeof(wcsftime_l) __wcsftime_l; -+extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l; -+extern "C" __typeof(wctype_l) __wctype_l; -+#endif -+ -+#endif // GLIBC 2.3 and later -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.cc ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-06-10 14:58:39.000000000 +0200 -@@ -0,0 +1,160 @@ -+// Wrapper for underlying C-language localization -*- C++ -*- -+ -+// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 2, or (at your option) -+// any later version. -+ -+// This 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 General Public License for more details. -+ -+// You should have received a copy of the GNU General Public License along -+// with this library; see the file COPYING. If not, write to the Free -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -+// USA. -+ -+// As a special exception, you may use this file as part of a free software -+// library without restriction. Specifically, if other files instantiate -+// templates or use macros or inline functions from this file, or you compile -+// this file and link it with other files to produce an executable, this -+// file does not by itself cause the resulting executable to be covered by -+// the GNU General Public License. This exception does not however -+// invalidate any other reasons why the executable file might be covered by -+// the GNU General Public License. -+ -+// -+// ISO C++ 14882: 22.8 Standard locale categories. -+// -+ -+// Written by Benjamin Kosnik -+ -+#include // For errno -+#include -+#include -+#include -+#include -+ -+#ifndef __UCLIBC_HAS_XLOCALE__ -+#define __strtol_l(S, E, B, L) strtol((S), (E), (B)) -+#define __strtoul_l(S, E, B, L) strtoul((S), (E), (B)) -+#define __strtoll_l(S, E, B, L) strtoll((S), (E), (B)) -+#define __strtoull_l(S, E, B, L) strtoull((S), (E), (B)) -+#define __strtof_l(S, E, L) strtof((S), (E)) -+#define __strtod_l(S, E, L) strtod((S), (E)) -+#define __strtold_l(S, E, L) strtold((S), (E)) -+#warning should dummy __newlocale check for C|POSIX ? -+#define __newlocale(a, b, c) NULL -+#define __freelocale(a) ((void)0) -+#define __duplocale(a) __c_locale() -+#endif -+ -+namespace std -+{ -+ template<> -+ void -+ __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, -+ const __c_locale& __cloc) -+ { -+ if (!(__err & ios_base::failbit)) -+ { -+ char* __sanity; -+ errno = 0; -+ float __f = __strtof_l(__s, &__sanity, __cloc); -+ if (__sanity != __s && errno != ERANGE) -+ __v = __f; -+ else -+ __err |= ios_base::failbit; -+ } -+ } -+ -+ template<> -+ void -+ __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, -+ const __c_locale& __cloc) -+ { -+ if (!(__err & ios_base::failbit)) -+ { -+ char* __sanity; -+ errno = 0; -+ double __d = __strtod_l(__s, &__sanity, __cloc); -+ if (__sanity != __s && errno != ERANGE) -+ __v = __d; -+ else -+ __err |= ios_base::failbit; -+ } -+ } -+ -+ template<> -+ void -+ __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err, -+ const __c_locale& __cloc) -+ { -+ if (!(__err & ios_base::failbit)) -+ { -+ char* __sanity; -+ errno = 0; -+ long double __ld = __strtold_l(__s, &__sanity, __cloc); -+ if (__sanity != __s && errno != ERANGE) -+ __v = __ld; -+ else -+ __err |= ios_base::failbit; -+ } -+ } -+ -+ void -+ locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s, -+ __c_locale __old) -+ { -+ __cloc = __newlocale(1 << LC_ALL, __s, __old); -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ if (!__cloc) -+ { -+ // This named locale is not supported by the underlying OS. -+ __throw_runtime_error(__N("locale::facet::_S_create_c_locale " -+ "name not valid")); -+ } -+#endif -+ } -+ -+ void -+ locale::facet::_S_destroy_c_locale(__c_locale& __cloc) -+ { -+ if (_S_get_c_locale() != __cloc) -+ __freelocale(__cloc); -+ } -+ -+ __c_locale -+ locale::facet::_S_clone_c_locale(__c_locale& __cloc) -+ { return __duplocale(__cloc); } -+} // namespace std -+ -+namespace __gnu_cxx -+{ -+ const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] = -+ { -+ "LC_CTYPE", -+ "LC_NUMERIC", -+ "LC_TIME", -+ "LC_COLLATE", -+ "LC_MONETARY", -+ "LC_MESSAGES", -+#if _GLIBCXX_NUM_CATEGORIES != 0 -+ "LC_PAPER", -+ "LC_NAME", -+ "LC_ADDRESS", -+ "LC_TELEPHONE", -+ "LC_MEASUREMENT", -+ "LC_IDENTIFICATION" -+#endif -+ }; -+} -+ -+namespace std -+{ -+ const char* const* const locale::_S_categories = __gnu_cxx::category_names; -+} // namespace std -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.h ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-06-10 14:58:39.000000000 +0200 -@@ -0,0 +1,117 @@ -+// Wrapper for underlying C-language localization -*- C++ -*- -+ -+// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 2, or (at your option) -+// any later version. -+ -+// This 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 General Public License for more details. -+ -+// You should have received a copy of the GNU General Public License along -+// with this library; see the file COPYING. If not, write to the Free -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -+// USA. -+ -+// As a special exception, you may use this file as part of a free software -+// library without restriction. Specifically, if other files instantiate -+// templates or use macros or inline functions from this file, or you compile -+// this file and link it with other files to produce an executable, this -+// file does not by itself cause the resulting executable to be covered by -+// the GNU General Public License. This exception does not however -+// invalidate any other reasons why the executable file might be covered by -+// the GNU General Public License. -+ -+// -+// ISO C++ 14882: 22.8 Standard locale categories. -+// -+ -+// Written by Benjamin Kosnik -+ -+#ifndef _C_LOCALE_H -+#define _C_LOCALE_H 1 -+ -+#pragma GCC system_header -+ -+#include // get std::strlen -+#include // get std::snprintf or std::sprintf -+#include -+#include // For codecvt -+#ifdef __UCLIBC_MJN3_ONLY__ -+#warning fix this -+#endif -+#ifdef __UCLIBC_HAS_LOCALE__ -+#include // For codecvt using iconv, iconv_t -+#endif -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ -+#include // For messages -+#endif -+ -+#ifdef __UCLIBC_MJN3_ONLY__ -+#warning what is _GLIBCXX_C_LOCALE_GNU for -+#endif -+#define _GLIBCXX_C_LOCALE_GNU 1 -+ -+#ifdef __UCLIBC_MJN3_ONLY__ -+#warning fix categories -+#endif -+// #define _GLIBCXX_NUM_CATEGORIES 6 -+#define _GLIBCXX_NUM_CATEGORIES 0 -+ -+#ifdef __UCLIBC_HAS_XLOCALE__ -+namespace __gnu_cxx -+{ -+ extern "C" __typeof(uselocale) __uselocale; -+} -+#endif -+ -+namespace std -+{ -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ typedef __locale_t __c_locale; -+#else -+ typedef int* __c_locale; -+#endif -+ -+ // Convert numeric value of type _Tv to string and return length of -+ // string. If snprintf is available use it, otherwise fall back to -+ // the unsafe sprintf which, in general, can be dangerous and should -+ // be avoided. -+ template -+ int -+ __convert_from_v(char* __out, -+ const int __size __attribute__ ((__unused__)), -+ const char* __fmt, -+#ifdef __UCLIBC_HAS_XCLOCALE__ -+ _Tv __v, const __c_locale& __cloc, int __prec) -+ { -+ __c_locale __old = __gnu_cxx::__uselocale(__cloc); -+#else -+ _Tv __v, const __c_locale&, int __prec) -+ { -+# ifdef __UCLIBC_HAS_LOCALE__ -+ char* __old = std::setlocale(LC_ALL, NULL); -+ char* __sav = new char[std::strlen(__old) + 1]; -+ std::strcpy(__sav, __old); -+ std::setlocale(LC_ALL, "C"); -+# endif -+#endif -+ -+ const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v); -+ -+#ifdef __UCLIBC_HAS_XCLOCALE__ -+ __gnu_cxx::__uselocale(__old); -+#elif defined __UCLIBC_HAS_LOCALE__ -+ std::setlocale(LC_ALL, __sav); -+ delete [] __sav; -+#endif -+ return __ret; -+ } -+} -+ -+#endif -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/codecvt_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/codecvt_members.cc ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/codecvt_members.cc 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/codecvt_members.cc 2008-06-10 14:58:39.000000000 +0200 -@@ -0,0 +1,306 @@ -+// std::codecvt implementation details, GNU version -*- C++ -*- -+ -+// Copyright (C) 2002, 2003 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 2, or (at your option) -+// any later version. -+ -+// This 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 General Public License for more details. -+ -+// You should have received a copy of the GNU General Public License along -+// with this library; see the file COPYING. If not, write to the Free -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -+// USA. -+ -+// As a special exception, you may use this file as part of a free software -+// library without restriction. Specifically, if other files instantiate -+// templates or use macros or inline functions from this file, or you compile -+// this file and link it with other files to produce an executable, this -+// file does not by itself cause the resulting executable to be covered by -+// the GNU General Public License. This exception does not however -+// invalidate any other reasons why the executable file might be covered by -+// the GNU General Public License. -+ -+// -+// ISO C++ 14882: 22.2.1.5 - Template class codecvt -+// -+ -+// Written by Benjamin Kosnik -+ -+#include -+#include -+ -+namespace std -+{ -+ // Specializations. -+#ifdef _GLIBCXX_USE_WCHAR_T -+ codecvt_base::result -+ codecvt:: -+ do_out(state_type& __state, const intern_type* __from, -+ const intern_type* __from_end, const intern_type*& __from_next, -+ extern_type* __to, extern_type* __to_end, -+ extern_type*& __to_next) const -+ { -+ result __ret = ok; -+ state_type __tmp_state(__state); -+ -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __c_locale __old = __uselocale(_M_c_locale_codecvt); -+#endif -+ -+ // wcsnrtombs is *very* fast but stops if encounters NUL characters: -+ // in case we fall back to wcrtomb and then continue, in a loop. -+ // NB: wcsnrtombs is a GNU extension -+ for (__from_next = __from, __to_next = __to; -+ __from_next < __from_end && __to_next < __to_end -+ && __ret == ok;) -+ { -+ const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0', -+ __from_end - __from_next); -+ if (!__from_chunk_end) -+ __from_chunk_end = __from_end; -+ -+ __from = __from_next; -+ const size_t __conv = wcsnrtombs(__to_next, &__from_next, -+ __from_chunk_end - __from_next, -+ __to_end - __to_next, &__state); -+ if (__conv == static_cast(-1)) -+ { -+ // In case of error, in order to stop at the exact place we -+ // have to start again from the beginning with a series of -+ // wcrtomb. -+ for (; __from < __from_next; ++__from) -+ __to_next += wcrtomb(__to_next, *__from, &__tmp_state); -+ __state = __tmp_state; -+ __ret = error; -+ } -+ else if (__from_next && __from_next < __from_chunk_end) -+ { -+ __to_next += __conv; -+ __ret = partial; -+ } -+ else -+ { -+ __from_next = __from_chunk_end; -+ __to_next += __conv; -+ } -+ -+ if (__from_next < __from_end && __ret == ok) -+ { -+ extern_type __buf[MB_LEN_MAX]; -+ __tmp_state = __state; -+ const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state); -+ if (__conv > static_cast(__to_end - __to_next)) -+ __ret = partial; -+ else -+ { -+ memcpy(__to_next, __buf, __conv); -+ __state = __tmp_state; -+ __to_next += __conv; -+ ++__from_next; -+ } -+ } -+ } -+ -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __uselocale(__old); -+#endif -+ -+ return __ret; -+ } -+ -+ codecvt_base::result -+ codecvt:: -+ do_in(state_type& __state, const extern_type* __from, -+ const extern_type* __from_end, const extern_type*& __from_next, -+ intern_type* __to, intern_type* __to_end, -+ intern_type*& __to_next) const -+ { -+ result __ret = ok; -+ state_type __tmp_state(__state); -+ -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __c_locale __old = __uselocale(_M_c_locale_codecvt); -+#endif -+ -+ // mbsnrtowcs is *very* fast but stops if encounters NUL characters: -+ // in case we store a L'\0' and then continue, in a loop. -+ // NB: mbsnrtowcs is a GNU extension -+ for (__from_next = __from, __to_next = __to; -+ __from_next < __from_end && __to_next < __to_end -+ && __ret == ok;) -+ { -+ const extern_type* __from_chunk_end; -+ __from_chunk_end = static_cast(memchr(__from_next, '\0', -+ __from_end -+ - __from_next)); -+ if (!__from_chunk_end) -+ __from_chunk_end = __from_end; -+ -+ __from = __from_next; -+ size_t __conv = mbsnrtowcs(__to_next, &__from_next, -+ __from_chunk_end - __from_next, -+ __to_end - __to_next, &__state); -+ if (__conv == static_cast(-1)) -+ { -+ // In case of error, in order to stop at the exact place we -+ // have to start again from the beginning with a series of -+ // mbrtowc. -+ for (;; ++__to_next, __from += __conv) -+ { -+ __conv = mbrtowc(__to_next, __from, __from_end - __from, -+ &__tmp_state); -+ if (__conv == static_cast(-1) -+ || __conv == static_cast(-2)) -+ break; -+ } -+ __from_next = __from; -+ __state = __tmp_state; -+ __ret = error; -+ } -+ else if (__from_next && __from_next < __from_chunk_end) -+ { -+ // It is unclear what to return in this case (see DR 382). -+ __to_next += __conv; -+ __ret = partial; -+ } -+ else -+ { -+ __from_next = __from_chunk_end; -+ __to_next += __conv; -+ } -+ -+ if (__from_next < __from_end && __ret == ok) -+ { -+ if (__to_next < __to_end) -+ { -+ // XXX Probably wrong for stateful encodings -+ __tmp_state = __state; -+ ++__from_next; -+ *__to_next++ = L'\0'; -+ } -+ else -+ __ret = partial; -+ } -+ } -+ -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __uselocale(__old); -+#endif -+ -+ return __ret; -+ } -+ -+ int -+ codecvt:: -+ do_encoding() const throw() -+ { -+ // XXX This implementation assumes that the encoding is -+ // stateless and is either single-byte or variable-width. -+ int __ret = 0; -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __c_locale __old = __uselocale(_M_c_locale_codecvt); -+#endif -+ if (MB_CUR_MAX == 1) -+ __ret = 1; -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __uselocale(__old); -+#endif -+ return __ret; -+ } -+ -+ int -+ codecvt:: -+ do_max_length() const throw() -+ { -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __c_locale __old = __uselocale(_M_c_locale_codecvt); -+#endif -+ // XXX Probably wrong for stateful encodings. -+ int __ret = MB_CUR_MAX; -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __uselocale(__old); -+#endif -+ return __ret; -+ } -+ -+ int -+ codecvt:: -+ do_length(state_type& __state, const extern_type* __from, -+ const extern_type* __end, size_t __max) const -+ { -+ int __ret = 0; -+ state_type __tmp_state(__state); -+ -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __c_locale __old = __uselocale(_M_c_locale_codecvt); -+#endif -+ -+ // mbsnrtowcs is *very* fast but stops if encounters NUL characters: -+ // in case we advance past it and then continue, in a loop. -+ // NB: mbsnrtowcs is a GNU extension -+ -+ // A dummy internal buffer is needed in order for mbsnrtocws to consider -+ // its fourth parameter (it wouldn't with NULL as first parameter). -+ wchar_t* __to = static_cast(__builtin_alloca(sizeof(wchar_t) -+ * __max)); -+ while (__from < __end && __max) -+ { -+ const extern_type* __from_chunk_end; -+ __from_chunk_end = static_cast(memchr(__from, '\0', -+ __end -+ - __from)); -+ if (!__from_chunk_end) -+ __from_chunk_end = __end; -+ -+ const extern_type* __tmp_from = __from; -+ size_t __conv = mbsnrtowcs(__to, &__from, -+ __from_chunk_end - __from, -+ __max, &__state); -+ if (__conv == static_cast(-1)) -+ { -+ // In case of error, in order to stop at the exact place we -+ // have to start again from the beginning with a series of -+ // mbrtowc. -+ for (__from = __tmp_from;; __from += __conv) -+ { -+ __conv = mbrtowc(NULL, __from, __end - __from, -+ &__tmp_state); -+ if (__conv == static_cast(-1) -+ || __conv == static_cast(-2)) -+ break; -+ } -+ __state = __tmp_state; -+ __ret += __from - __tmp_from; -+ break; -+ } -+ if (!__from) -+ __from = __from_chunk_end; -+ -+ __ret += __from - __tmp_from; -+ __max -= __conv; -+ -+ if (__from < __end && __max) -+ { -+ // XXX Probably wrong for stateful encodings -+ __tmp_state = __state; -+ ++__from; -+ ++__ret; -+ --__max; -+ } -+ } -+ -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __uselocale(__old); -+#endif -+ -+ return __ret; -+ } -+#endif -+} -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/collate_members.cc ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/collate_members.cc 2008-06-10 14:58:39.000000000 +0200 -@@ -0,0 +1,80 @@ -+// std::collate implementation details, GNU version -*- C++ -*- -+ -+// Copyright (C) 2001, 2002 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 2, or (at your option) -+// any later version. -+ -+// This 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 General Public License for more details. -+ -+// You should have received a copy of the GNU General Public License along -+// with this library; see the file COPYING. If not, write to the Free -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -+// USA. -+ -+// As a special exception, you may use this file as part of a free software -+// library without restriction. Specifically, if other files instantiate -+// templates or use macros or inline functions from this file, or you compile -+// this file and link it with other files to produce an executable, this -+// file does not by itself cause the resulting executable to be covered by -+// the GNU General Public License. This exception does not however -+// invalidate any other reasons why the executable file might be covered by -+// the GNU General Public License. -+ -+// -+// ISO C++ 14882: 22.2.4.1.2 collate virtual functions -+// -+ -+// Written by Benjamin Kosnik -+ -+#include -+#include -+ -+#ifndef __UCLIBC_HAS_XLOCALE__ -+#define __strcoll_l(S1, S2, L) strcoll((S1), (S2)) -+#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N)) -+#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2)) -+#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N)) -+#endif -+ -+namespace std -+{ -+ // These are basically extensions to char_traits, and perhaps should -+ // be put there instead of here. -+ template<> -+ int -+ collate::_M_compare(const char* __one, const char* __two) const -+ { -+ int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate); -+ return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0); -+ } -+ -+ template<> -+ size_t -+ collate::_M_transform(char* __to, const char* __from, -+ size_t __n) const -+ { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); } -+ -+#ifdef _GLIBCXX_USE_WCHAR_T -+ template<> -+ int -+ collate::_M_compare(const wchar_t* __one, -+ const wchar_t* __two) const -+ { -+ int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate); -+ return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0); -+ } -+ -+ template<> -+ size_t -+ collate::_M_transform(wchar_t* __to, const wchar_t* __from, -+ size_t __n) const -+ { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); } -+#endif -+} -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-06-10 14:58:39.000000000 +0200 -@@ -0,0 +1,300 @@ -+// std::ctype implementation details, GNU version -*- C++ -*- -+ -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 2, or (at your option) -+// any later version. -+ -+// This 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 General Public License for more details. -+ -+// You should have received a copy of the GNU General Public License along -+// with this library; see the file COPYING. If not, write to the Free -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -+// USA. -+ -+// As a special exception, you may use this file as part of a free software -+// library without restriction. Specifically, if other files instantiate -+// templates or use macros or inline functions from this file, or you compile -+// this file and link it with other files to produce an executable, this -+// file does not by itself cause the resulting executable to be covered by -+// the GNU General Public License. This exception does not however -+// invalidate any other reasons why the executable file might be covered by -+// the GNU General Public License. -+ -+// -+// ISO C++ 14882: 22.2.1.1.2 ctype virtual functions. -+// -+ -+// Written by Benjamin Kosnik -+ -+#define _LIBC -+#include -+#undef _LIBC -+#include -+ -+#ifndef __UCLIBC_HAS_XLOCALE__ -+#define __wctype_l(S, L) wctype((S)) -+#define __towupper_l(C, L) towupper((C)) -+#define __towlower_l(C, L) towlower((C)) -+#define __iswctype_l(C, M, L) iswctype((C), (M)) -+#endif -+ -+namespace std -+{ -+ // NB: The other ctype specializations are in src/locale.cc and -+ // various /config/os/* files. -+ template<> -+ ctype_byname::ctype_byname(const char* __s, size_t __refs) -+ : ctype(0, false, __refs) -+ { -+ if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0) -+ { -+ this->_S_destroy_c_locale(this->_M_c_locale_ctype); -+ this->_S_create_c_locale(this->_M_c_locale_ctype, __s); -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper; -+ this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower; -+ this->_M_table = this->_M_c_locale_ctype->__ctype_b; -+#endif -+ } -+ } -+ -+#ifdef _GLIBCXX_USE_WCHAR_T -+ ctype::__wmask_type -+ ctype::_M_convert_to_wmask(const mask __m) const -+ { -+ __wmask_type __ret; -+ switch (__m) -+ { -+ case space: -+ __ret = __wctype_l("space", _M_c_locale_ctype); -+ break; -+ case print: -+ __ret = __wctype_l("print", _M_c_locale_ctype); -+ break; -+ case cntrl: -+ __ret = __wctype_l("cntrl", _M_c_locale_ctype); -+ break; -+ case upper: -+ __ret = __wctype_l("upper", _M_c_locale_ctype); -+ break; -+ case lower: -+ __ret = __wctype_l("lower", _M_c_locale_ctype); -+ break; -+ case alpha: -+ __ret = __wctype_l("alpha", _M_c_locale_ctype); -+ break; -+ case digit: -+ __ret = __wctype_l("digit", _M_c_locale_ctype); -+ break; -+ case punct: -+ __ret = __wctype_l("punct", _M_c_locale_ctype); -+ break; -+ case xdigit: -+ __ret = __wctype_l("xdigit", _M_c_locale_ctype); -+ break; -+ case alnum: -+ __ret = __wctype_l("alnum", _M_c_locale_ctype); -+ break; -+ case graph: -+ __ret = __wctype_l("graph", _M_c_locale_ctype); -+ break; -+ default: -+ __ret = __wmask_type(); -+ } -+ return __ret; -+ } -+ -+ wchar_t -+ ctype::do_toupper(wchar_t __c) const -+ { return __towupper_l(__c, _M_c_locale_ctype); } -+ -+ const wchar_t* -+ ctype::do_toupper(wchar_t* __lo, const wchar_t* __hi) const -+ { -+ while (__lo < __hi) -+ { -+ *__lo = __towupper_l(*__lo, _M_c_locale_ctype); -+ ++__lo; -+ } -+ return __hi; -+ } -+ -+ wchar_t -+ ctype::do_tolower(wchar_t __c) const -+ { return __towlower_l(__c, _M_c_locale_ctype); } -+ -+ const wchar_t* -+ ctype::do_tolower(wchar_t* __lo, const wchar_t* __hi) const -+ { -+ while (__lo < __hi) -+ { -+ *__lo = __towlower_l(*__lo, _M_c_locale_ctype); -+ ++__lo; -+ } -+ return __hi; -+ } -+ -+ bool -+ ctype:: -+ do_is(mask __m, wchar_t __c) const -+ { -+ // Highest bitmask in ctype_base == 10, but extra in "C" -+ // library for blank. -+ bool __ret = false; -+ const size_t __bitmasksize = 11; -+ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur) -+ if (__m & _M_bit[__bitcur] -+ && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype)) -+ { -+ __ret = true; -+ break; -+ } -+ return __ret; -+ } -+ -+ const wchar_t* -+ ctype:: -+ do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const -+ { -+ for (; __lo < __hi; ++__vec, ++__lo) -+ { -+ // Highest bitmask in ctype_base == 10, but extra in "C" -+ // library for blank. -+ const size_t __bitmasksize = 11; -+ mask __m = 0; -+ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur) -+ if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype)) -+ __m |= _M_bit[__bitcur]; -+ *__vec = __m; -+ } -+ return __hi; -+ } -+ -+ const wchar_t* -+ ctype:: -+ do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const -+ { -+ while (__lo < __hi && !this->do_is(__m, *__lo)) -+ ++__lo; -+ return __lo; -+ } -+ -+ const wchar_t* -+ ctype:: -+ do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const -+ { -+ while (__lo < __hi && this->do_is(__m, *__lo) != 0) -+ ++__lo; -+ return __lo; -+ } -+ -+ wchar_t -+ ctype:: -+ do_widen(char __c) const -+ { return _M_widen[static_cast(__c)]; } -+ -+ const char* -+ ctype:: -+ do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const -+ { -+ while (__lo < __hi) -+ { -+ *__dest = _M_widen[static_cast(*__lo)]; -+ ++__lo; -+ ++__dest; -+ } -+ return __hi; -+ } -+ -+ char -+ ctype:: -+ do_narrow(wchar_t __wc, char __dfault) const -+ { -+ if (__wc >= 0 && __wc < 128 && _M_narrow_ok) -+ return _M_narrow[__wc]; -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __c_locale __old = __uselocale(_M_c_locale_ctype); -+#endif -+ const int __c = wctob(__wc); -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __uselocale(__old); -+#endif -+ return (__c == EOF ? __dfault : static_cast(__c)); -+ } -+ -+ const wchar_t* -+ ctype:: -+ do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault, -+ char* __dest) const -+ { -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __c_locale __old = __uselocale(_M_c_locale_ctype); -+#endif -+ if (_M_narrow_ok) -+ while (__lo < __hi) -+ { -+ if (*__lo >= 0 && *__lo < 128) -+ *__dest = _M_narrow[*__lo]; -+ else -+ { -+ const int __c = wctob(*__lo); -+ *__dest = (__c == EOF ? __dfault : static_cast(__c)); -+ } -+ ++__lo; -+ ++__dest; -+ } -+ else -+ while (__lo < __hi) -+ { -+ const int __c = wctob(*__lo); -+ *__dest = (__c == EOF ? __dfault : static_cast(__c)); -+ ++__lo; -+ ++__dest; -+ } -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __uselocale(__old); -+#endif -+ return __hi; -+ } -+ -+ void -+ ctype::_M_initialize_ctype() -+ { -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __c_locale __old = __uselocale(_M_c_locale_ctype); -+#endif -+ wint_t __i; -+ for (__i = 0; __i < 128; ++__i) -+ { -+ const int __c = wctob(__i); -+ if (__c == EOF) -+ break; -+ else -+ _M_narrow[__i] = static_cast(__c); -+ } -+ if (__i == 128) -+ _M_narrow_ok = true; -+ else -+ _M_narrow_ok = false; -+ for (size_t __j = 0; -+ __j < sizeof(_M_widen) / sizeof(wint_t); ++__j) -+ _M_widen[__j] = btowc(__j); -+ -+ for (size_t __k = 0; __k <= 11; ++__k) -+ { -+ _M_bit[__k] = static_cast(_ISbit(__k)); -+ _M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]); -+ } -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __uselocale(__old); -+#endif -+ } -+#endif // _GLIBCXX_USE_WCHAR_T -+} -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.cc ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.cc 2008-06-10 14:58:39.000000000 +0200 -@@ -0,0 +1,100 @@ -+// std::messages implementation details, GNU version -*- C++ -*- -+ -+// Copyright (C) 2001, 2002 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 2, or (at your option) -+// any later version. -+ -+// This 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 General Public License for more details. -+ -+// You should have received a copy of the GNU General Public License along -+// with this library; see the file COPYING. If not, write to the Free -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -+// USA. -+ -+// As a special exception, you may use this file as part of a free software -+// library without restriction. Specifically, if other files instantiate -+// templates or use macros or inline functions from this file, or you compile -+// this file and link it with other files to produce an executable, this -+// file does not by itself cause the resulting executable to be covered by -+// the GNU General Public License. This exception does not however -+// invalidate any other reasons why the executable file might be covered by -+// the GNU General Public License. -+ -+// -+// ISO C++ 14882: 22.2.7.1.2 messages virtual functions -+// -+ -+// Written by Benjamin Kosnik -+ -+#include -+#include -+ -+#ifdef __UCLIBC_MJN3_ONLY__ -+#warning fix gettext stuff -+#endif -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ -+extern "C" char *__dcgettext(const char *domainname, -+ const char *msgid, int category); -+#undef gettext -+#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES) -+#else -+#undef gettext -+#define gettext(msgid) (msgid) -+#endif -+ -+namespace std -+{ -+ // Specializations. -+ template<> -+ string -+ messages::do_get(catalog, int, int, const string& __dfault) const -+ { -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __c_locale __old = __uselocale(_M_c_locale_messages); -+ const char* __msg = const_cast(gettext(__dfault.c_str())); -+ __uselocale(__old); -+ return string(__msg); -+#elif defined __UCLIBC_HAS_LOCALE__ -+ char* __old = strdup(setlocale(LC_ALL, NULL)); -+ setlocale(LC_ALL, _M_name_messages); -+ const char* __msg = gettext(__dfault.c_str()); -+ setlocale(LC_ALL, __old); -+ free(__old); -+ return string(__msg); -+#else -+ const char* __msg = gettext(__dfault.c_str()); -+ return string(__msg); -+#endif -+ } -+ -+#ifdef _GLIBCXX_USE_WCHAR_T -+ template<> -+ wstring -+ messages::do_get(catalog, int, int, const wstring& __dfault) const -+ { -+# ifdef __UCLIBC_HAS_XLOCALE__ -+ __c_locale __old = __uselocale(_M_c_locale_messages); -+ char* __msg = gettext(_M_convert_to_char(__dfault)); -+ __uselocale(__old); -+ return _M_convert_from_char(__msg); -+# elif defined __UCLIBC_HAS_LOCALE__ -+ char* __old = strdup(setlocale(LC_ALL, NULL)); -+ setlocale(LC_ALL, _M_name_messages); -+ char* __msg = gettext(_M_convert_to_char(__dfault)); -+ setlocale(LC_ALL, __old); -+ free(__old); -+ return _M_convert_from_char(__msg); -+# else -+ char* __msg = gettext(_M_convert_to_char(__dfault)); -+ return _M_convert_from_char(__msg); -+# endif -+ } -+#endif -+} -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:58:39.000000000 +0200 -@@ -0,0 +1,118 @@ -+// std::messages implementation details, GNU version -*- C++ -*- -+ -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 2, or (at your option) -+// any later version. -+ -+// This 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 General Public License for more details. -+ -+// You should have received a copy of the GNU General Public License along -+// with this library; see the file COPYING. If not, write to the Free -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -+// USA. -+ -+// As a special exception, you may use this file as part of a free software -+// library without restriction. Specifically, if other files instantiate -+// templates or use macros or inline functions from this file, or you compile -+// this file and link it with other files to produce an executable, this -+// file does not by itself cause the resulting executable to be covered by -+// the GNU General Public License. This exception does not however -+// invalidate any other reasons why the executable file might be covered by -+// the GNU General Public License. -+ -+// -+// ISO C++ 14882: 22.2.7.1.2 messages functions -+// -+ -+// Written by Benjamin Kosnik -+ -+#ifdef __UCLIBC_MJN3_ONLY__ -+#warning fix prototypes for *textdomain funcs -+#endif -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ -+extern "C" char *__textdomain(const char *domainname); -+extern "C" char *__bindtextdomain(const char *domainname, -+ const char *dirname); -+#else -+#undef __textdomain -+#undef __bindtextdomain -+#define __textdomain(D) ((void)0) -+#define __bindtextdomain(D,P) ((void)0) -+#endif -+ -+ // Non-virtual member functions. -+ template -+ messages<_CharT>::messages(size_t __refs) -+ : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), -+ _M_name_messages(_S_get_c_name()) -+ { } -+ -+ template -+ messages<_CharT>::messages(__c_locale __cloc, const char* __s, -+ size_t __refs) -+ : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)), -+ _M_name_messages(__s) -+ { -+ char* __tmp = new char[std::strlen(__s) + 1]; -+ std::strcpy(__tmp, __s); -+ _M_name_messages = __tmp; -+ } -+ -+ template -+ typename messages<_CharT>::catalog -+ messages<_CharT>::open(const basic_string& __s, const locale& __loc, -+ const char* __dir) const -+ { -+ __bindtextdomain(__s.c_str(), __dir); -+ return this->do_open(__s, __loc); -+ } -+ -+ // Virtual member functions. -+ template -+ messages<_CharT>::~messages() -+ { -+ if (_M_name_messages != _S_get_c_name()) -+ delete [] _M_name_messages; -+ _S_destroy_c_locale(_M_c_locale_messages); -+ } -+ -+ template -+ typename messages<_CharT>::catalog -+ messages<_CharT>::do_open(const basic_string& __s, -+ const locale&) const -+ { -+ // No error checking is done, assume the catalog exists and can -+ // be used. -+ __textdomain(__s.c_str()); -+ return 0; -+ } -+ -+ template -+ void -+ messages<_CharT>::do_close(catalog) const -+ { } -+ -+ // messages_byname -+ template -+ messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs) -+ : messages<_CharT>(__refs) -+ { -+ if (this->_M_name_messages != locale::facet::_S_get_c_name()) -+ delete [] this->_M_name_messages; -+ char* __tmp = new char[std::strlen(__s) + 1]; -+ std::strcpy(__tmp, __s); -+ this->_M_name_messages = __tmp; -+ -+ if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0) -+ { -+ this->_S_destroy_c_locale(this->_M_c_locale_messages); -+ this->_S_create_c_locale(this->_M_c_locale_messages, __s); -+ } -+ } -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:58:39.000000000 +0200 -@@ -0,0 +1,692 @@ -+// std::moneypunct implementation details, GNU version -*- C++ -*- -+ -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 2, or (at your option) -+// any later version. -+ -+// This 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 General Public License for more details. -+ -+// You should have received a copy of the GNU General Public License along -+// with this library; see the file COPYING. If not, write to the Free -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -+// USA. -+ -+// As a special exception, you may use this file as part of a free software -+// library without restriction. Specifically, if other files instantiate -+// templates or use macros or inline functions from this file, or you compile -+// this file and link it with other files to produce an executable, this -+// file does not by itself cause the resulting executable to be covered by -+// the GNU General Public License. This exception does not however -+// invalidate any other reasons why the executable file might be covered by -+// the GNU General Public License. -+ -+// -+// ISO C++ 14882: 22.2.6.3.2 moneypunct virtual functions -+// -+ -+// Written by Benjamin Kosnik -+ -+#define _LIBC -+#include -+#undef _LIBC -+#include -+ -+#ifdef __UCLIBC_MJN3_ONLY__ -+#warning optimize this for uclibc -+#warning tailor for stub locale support -+#endif -+ -+#ifndef __UCLIBC_HAS_XLOCALE__ -+#define __nl_langinfo_l(N, L) nl_langinfo((N)) -+#endif -+ -+namespace std -+{ -+ // Construct and return valid pattern consisting of some combination of: -+ // space none symbol sign value -+ money_base::pattern -+ money_base::_S_construct_pattern(char __precedes, char __space, char __posn) -+ { -+ pattern __ret; -+ -+ // This insanely complicated routine attempts to construct a valid -+ // pattern for use with monyepunct. A couple of invariants: -+ -+ // if (__precedes) symbol -> value -+ // else value -> symbol -+ -+ // if (__space) space -+ // else none -+ -+ // none == never first -+ // space never first or last -+ -+ // Any elegant implementations of this are welcome. -+ switch (__posn) -+ { -+ case 0: -+ case 1: -+ // 1 The sign precedes the value and symbol. -+ __ret.field[0] = sign; -+ if (__space) -+ { -+ // Pattern starts with sign. -+ if (__precedes) -+ { -+ __ret.field[1] = symbol; -+ __ret.field[3] = value; -+ } -+ else -+ { -+ __ret.field[1] = value; -+ __ret.field[3] = symbol; -+ } -+ __ret.field[2] = space; -+ } -+ else -+ { -+ // Pattern starts with sign and ends with none. -+ if (__precedes) -+ { -+ __ret.field[1] = symbol; -+ __ret.field[2] = value; -+ } -+ else -+ { -+ __ret.field[1] = value; -+ __ret.field[2] = symbol; -+ } -+ __ret.field[3] = none; -+ } -+ break; -+ case 2: -+ // 2 The sign follows the value and symbol. -+ if (__space) -+ { -+ // Pattern either ends with sign. -+ if (__precedes) -+ { -+ __ret.field[0] = symbol; -+ __ret.field[2] = value; -+ } -+ else -+ { -+ __ret.field[0] = value; -+ __ret.field[2] = symbol; -+ } -+ __ret.field[1] = space; -+ __ret.field[3] = sign; -+ } -+ else -+ { -+ // Pattern ends with sign then none. -+ if (__precedes) -+ { -+ __ret.field[0] = symbol; -+ __ret.field[1] = value; -+ } -+ else -+ { -+ __ret.field[0] = value; -+ __ret.field[1] = symbol; -+ } -+ __ret.field[2] = sign; -+ __ret.field[3] = none; -+ } -+ break; -+ case 3: -+ // 3 The sign immediately precedes the symbol. -+ if (__precedes) -+ { -+ __ret.field[0] = sign; -+ __ret.field[1] = symbol; -+ if (__space) -+ { -+ __ret.field[2] = space; -+ __ret.field[3] = value; -+ } -+ else -+ { -+ __ret.field[2] = value; -+ __ret.field[3] = none; -+ } -+ } -+ else -+ { -+ __ret.field[0] = value; -+ if (__space) -+ { -+ __ret.field[1] = space; -+ __ret.field[2] = sign; -+ __ret.field[3] = symbol; -+ } -+ else -+ { -+ __ret.field[1] = sign; -+ __ret.field[2] = symbol; -+ __ret.field[3] = none; -+ } -+ } -+ break; -+ case 4: -+ // 4 The sign immediately follows the symbol. -+ if (__precedes) -+ { -+ __ret.field[0] = symbol; -+ __ret.field[1] = sign; -+ if (__space) -+ { -+ __ret.field[2] = space; -+ __ret.field[3] = value; -+ } -+ else -+ { -+ __ret.field[2] = value; -+ __ret.field[3] = none; -+ } -+ } -+ else -+ { -+ __ret.field[0] = value; -+ if (__space) -+ { -+ __ret.field[1] = space; -+ __ret.field[2] = symbol; -+ __ret.field[3] = sign; -+ } -+ else -+ { -+ __ret.field[1] = symbol; -+ __ret.field[2] = sign; -+ __ret.field[3] = none; -+ } -+ } -+ break; -+ default: -+ ; -+ } -+ return __ret; -+ } -+ -+ template<> -+ void -+ moneypunct::_M_initialize_moneypunct(__c_locale __cloc, -+ const char*) -+ { -+ if (!_M_data) -+ _M_data = new __moneypunct_cache; -+ -+ if (!__cloc) -+ { -+ // "C" locale -+ _M_data->_M_decimal_point = '.'; -+ _M_data->_M_thousands_sep = ','; -+ _M_data->_M_grouping = ""; -+ _M_data->_M_grouping_size = 0; -+ _M_data->_M_curr_symbol = ""; -+ _M_data->_M_curr_symbol_size = 0; -+ _M_data->_M_positive_sign = ""; -+ _M_data->_M_positive_sign_size = 0; -+ _M_data->_M_negative_sign = ""; -+ _M_data->_M_negative_sign_size = 0; -+ _M_data->_M_frac_digits = 0; -+ _M_data->_M_pos_format = money_base::_S_default_pattern; -+ _M_data->_M_neg_format = money_base::_S_default_pattern; -+ -+ for (size_t __i = 0; __i < money_base::_S_end; ++__i) -+ _M_data->_M_atoms[__i] = money_base::_S_atoms[__i]; -+ } -+ else -+ { -+ // Named locale. -+ _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, -+ __cloc)); -+ _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, -+ __cloc)); -+ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc); -+ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); -+ _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc); -+ _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign); -+ -+ char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc)); -+ if (!__nposn) -+ _M_data->_M_negative_sign = "()"; -+ else -+ _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, -+ __cloc); -+ _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign); -+ -+ // _Intl == true -+ _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc); -+ _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol); -+ _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, -+ __cloc)); -+ char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc)); -+ char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc)); -+ char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc)); -+ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, -+ __pposn); -+ char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc)); -+ char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc)); -+ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, -+ __nposn); -+ } -+ } -+ -+ template<> -+ void -+ moneypunct::_M_initialize_moneypunct(__c_locale __cloc, -+ const char*) -+ { -+ if (!_M_data) -+ _M_data = new __moneypunct_cache; -+ -+ if (!__cloc) -+ { -+ // "C" locale -+ _M_data->_M_decimal_point = '.'; -+ _M_data->_M_thousands_sep = ','; -+ _M_data->_M_grouping = ""; -+ _M_data->_M_grouping_size = 0; -+ _M_data->_M_curr_symbol = ""; -+ _M_data->_M_curr_symbol_size = 0; -+ _M_data->_M_positive_sign = ""; -+ _M_data->_M_positive_sign_size = 0; -+ _M_data->_M_negative_sign = ""; -+ _M_data->_M_negative_sign_size = 0; -+ _M_data->_M_frac_digits = 0; -+ _M_data->_M_pos_format = money_base::_S_default_pattern; -+ _M_data->_M_neg_format = money_base::_S_default_pattern; -+ -+ for (size_t __i = 0; __i < money_base::_S_end; ++__i) -+ _M_data->_M_atoms[__i] = money_base::_S_atoms[__i]; -+ } -+ else -+ { -+ // Named locale. -+ _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, -+ __cloc)); -+ _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, -+ __cloc)); -+ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc); -+ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); -+ _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc); -+ _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign); -+ -+ char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc)); -+ if (!__nposn) -+ _M_data->_M_negative_sign = "()"; -+ else -+ _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, -+ __cloc); -+ _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign); -+ -+ // _Intl == false -+ _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc); -+ _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol); -+ _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc)); -+ char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc)); -+ char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc)); -+ char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc)); -+ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, -+ __pposn); -+ char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc)); -+ char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc)); -+ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, -+ __nposn); -+ } -+ } -+ -+ template<> -+ moneypunct::~moneypunct() -+ { delete _M_data; } -+ -+ template<> -+ moneypunct::~moneypunct() -+ { delete _M_data; } -+ -+#ifdef _GLIBCXX_USE_WCHAR_T -+ template<> -+ void -+ moneypunct::_M_initialize_moneypunct(__c_locale __cloc, -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ const char*) -+#else -+ const char* __name) -+#endif -+ { -+ if (!_M_data) -+ _M_data = new __moneypunct_cache; -+ -+ if (!__cloc) -+ { -+ // "C" locale -+ _M_data->_M_decimal_point = L'.'; -+ _M_data->_M_thousands_sep = L','; -+ _M_data->_M_grouping = ""; -+ _M_data->_M_grouping_size = 0; -+ _M_data->_M_curr_symbol = L""; -+ _M_data->_M_curr_symbol_size = 0; -+ _M_data->_M_positive_sign = L""; -+ _M_data->_M_positive_sign_size = 0; -+ _M_data->_M_negative_sign = L""; -+ _M_data->_M_negative_sign_size = 0; -+ _M_data->_M_frac_digits = 0; -+ _M_data->_M_pos_format = money_base::_S_default_pattern; -+ _M_data->_M_neg_format = money_base::_S_default_pattern; -+ -+ // Use ctype::widen code without the facet... -+ for (size_t __i = 0; __i < money_base::_S_end; ++__i) -+ _M_data->_M_atoms[__i] = -+ static_cast(money_base::_S_atoms[__i]); -+ } -+ else -+ { -+ // Named locale. -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __c_locale __old = __uselocale(__cloc); -+#else -+ // Switch to named locale so that mbsrtowcs will work. -+ char* __old = strdup(setlocale(LC_ALL, NULL)); -+ setlocale(LC_ALL, __name); -+#endif -+ -+#ifdef __UCLIBC_MJN3_ONLY__ -+#warning fix this... should be monetary -+#endif -+#ifdef __UCLIBC__ -+# ifdef __UCLIBC_HAS_XLOCALE__ -+ _M_data->_M_decimal_point = __cloc->decimal_point_wc; -+ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc; -+# else -+ _M_data->_M_decimal_point = __global_locale->decimal_point_wc; -+ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc; -+# endif -+#else -+ union { char *__s; wchar_t __w; } __u; -+ __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc); -+ _M_data->_M_decimal_point = __u.__w; -+ -+ __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc); -+ _M_data->_M_thousands_sep = __u.__w; -+#endif -+ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc); -+ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); -+ -+ const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc); -+ const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc); -+ const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc); -+ -+ wchar_t* __wcs_ps = 0; -+ wchar_t* __wcs_ns = 0; -+ const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc)); -+ try -+ { -+ mbstate_t __state; -+ size_t __len = strlen(__cpossign); -+ if (__len) -+ { -+ ++__len; -+ memset(&__state, 0, sizeof(mbstate_t)); -+ __wcs_ps = new wchar_t[__len]; -+ mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state); -+ _M_data->_M_positive_sign = __wcs_ps; -+ } -+ else -+ _M_data->_M_positive_sign = L""; -+ _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign); -+ -+ __len = strlen(__cnegsign); -+ if (!__nposn) -+ _M_data->_M_negative_sign = L"()"; -+ else if (__len) -+ { -+ ++__len; -+ memset(&__state, 0, sizeof(mbstate_t)); -+ __wcs_ns = new wchar_t[__len]; -+ mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state); -+ _M_data->_M_negative_sign = __wcs_ns; -+ } -+ else -+ _M_data->_M_negative_sign = L""; -+ _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign); -+ -+ // _Intl == true. -+ __len = strlen(__ccurr); -+ if (__len) -+ { -+ ++__len; -+ memset(&__state, 0, sizeof(mbstate_t)); -+ wchar_t* __wcs = new wchar_t[__len]; -+ mbsrtowcs(__wcs, &__ccurr, __len, &__state); -+ _M_data->_M_curr_symbol = __wcs; -+ } -+ else -+ _M_data->_M_curr_symbol = L""; -+ _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol); -+ } -+ catch (...) -+ { -+ delete _M_data; -+ _M_data = 0; -+ delete __wcs_ps; -+ delete __wcs_ns; -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __uselocale(__old); -+#else -+ setlocale(LC_ALL, __old); -+ free(__old); -+#endif -+ __throw_exception_again; -+ } -+ -+ _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, -+ __cloc)); -+ char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc)); -+ char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc)); -+ char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc)); -+ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, -+ __pposn); -+ char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc)); -+ char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc)); -+ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, -+ __nposn); -+ -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __uselocale(__old); -+#else -+ setlocale(LC_ALL, __old); -+ free(__old); -+#endif -+ } -+ } -+ -+ template<> -+ void -+ moneypunct::_M_initialize_moneypunct(__c_locale __cloc, -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ const char*) -+#else -+ const char* __name) -+#endif -+ { -+ if (!_M_data) -+ _M_data = new __moneypunct_cache; -+ -+ if (!__cloc) -+ { -+ // "C" locale -+ _M_data->_M_decimal_point = L'.'; -+ _M_data->_M_thousands_sep = L','; -+ _M_data->_M_grouping = ""; -+ _M_data->_M_grouping_size = 0; -+ _M_data->_M_curr_symbol = L""; -+ _M_data->_M_curr_symbol_size = 0; -+ _M_data->_M_positive_sign = L""; -+ _M_data->_M_positive_sign_size = 0; -+ _M_data->_M_negative_sign = L""; -+ _M_data->_M_negative_sign_size = 0; -+ _M_data->_M_frac_digits = 0; -+ _M_data->_M_pos_format = money_base::_S_default_pattern; -+ _M_data->_M_neg_format = money_base::_S_default_pattern; -+ -+ // Use ctype::widen code without the facet... -+ for (size_t __i = 0; __i < money_base::_S_end; ++__i) -+ _M_data->_M_atoms[__i] = -+ static_cast(money_base::_S_atoms[__i]); -+ } -+ else -+ { -+ // Named locale. -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __c_locale __old = __uselocale(__cloc); -+#else -+ // Switch to named locale so that mbsrtowcs will work. -+ char* __old = strdup(setlocale(LC_ALL, NULL)); -+ setlocale(LC_ALL, __name); -+#endif -+ -+#ifdef __UCLIBC_MJN3_ONLY__ -+#warning fix this... should be monetary -+#endif -+#ifdef __UCLIBC__ -+# ifdef __UCLIBC_HAS_XLOCALE__ -+ _M_data->_M_decimal_point = __cloc->decimal_point_wc; -+ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc; -+# else -+ _M_data->_M_decimal_point = __global_locale->decimal_point_wc; -+ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc; -+# endif -+#else -+ union { char *__s; wchar_t __w; } __u; -+ __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc); -+ _M_data->_M_decimal_point = __u.__w; -+ -+ __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc); -+ _M_data->_M_thousands_sep = __u.__w; -+#endif -+ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc); -+ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); -+ -+ const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc); -+ const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc); -+ const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc); -+ -+ wchar_t* __wcs_ps = 0; -+ wchar_t* __wcs_ns = 0; -+ const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc)); -+ try -+ { -+ mbstate_t __state; -+ size_t __len; -+ __len = strlen(__cpossign); -+ if (__len) -+ { -+ ++__len; -+ memset(&__state, 0, sizeof(mbstate_t)); -+ __wcs_ps = new wchar_t[__len]; -+ mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state); -+ _M_data->_M_positive_sign = __wcs_ps; -+ } -+ else -+ _M_data->_M_positive_sign = L""; -+ _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign); -+ -+ __len = strlen(__cnegsign); -+ if (!__nposn) -+ _M_data->_M_negative_sign = L"()"; -+ else if (__len) -+ { -+ ++__len; -+ memset(&__state, 0, sizeof(mbstate_t)); -+ __wcs_ns = new wchar_t[__len]; -+ mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state); -+ _M_data->_M_negative_sign = __wcs_ns; -+ } -+ else -+ _M_data->_M_negative_sign = L""; -+ _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign); -+ -+ // _Intl == true. -+ __len = strlen(__ccurr); -+ if (__len) -+ { -+ ++__len; -+ memset(&__state, 0, sizeof(mbstate_t)); -+ wchar_t* __wcs = new wchar_t[__len]; -+ mbsrtowcs(__wcs, &__ccurr, __len, &__state); -+ _M_data->_M_curr_symbol = __wcs; -+ } -+ else -+ _M_data->_M_curr_symbol = L""; -+ _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol); -+ } -+ catch (...) -+ { -+ delete _M_data; -+ _M_data = 0; -+ delete __wcs_ps; -+ delete __wcs_ns; -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __uselocale(__old); -+#else -+ setlocale(LC_ALL, __old); -+ free(__old); -+#endif -+ __throw_exception_again; -+ } -+ -+ _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc)); -+ char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc)); -+ char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc)); -+ char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc)); -+ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, -+ __pposn); -+ char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc)); -+ char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc)); -+ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, -+ __nposn); -+ -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __uselocale(__old); -+#else -+ setlocale(LC_ALL, __old); -+ free(__old); -+#endif -+ } -+ } -+ -+ template<> -+ moneypunct::~moneypunct() -+ { -+ if (_M_data->_M_positive_sign_size) -+ delete [] _M_data->_M_positive_sign; -+ if (_M_data->_M_negative_sign_size -+ && wcscmp(_M_data->_M_negative_sign, L"()") != 0) -+ delete [] _M_data->_M_negative_sign; -+ if (_M_data->_M_curr_symbol_size) -+ delete [] _M_data->_M_curr_symbol; -+ delete _M_data; -+ } -+ -+ template<> -+ moneypunct::~moneypunct() -+ { -+ if (_M_data->_M_positive_sign_size) -+ delete [] _M_data->_M_positive_sign; -+ if (_M_data->_M_negative_sign_size -+ && wcscmp(_M_data->_M_negative_sign, L"()") != 0) -+ delete [] _M_data->_M_negative_sign; -+ if (_M_data->_M_curr_symbol_size) -+ delete [] _M_data->_M_curr_symbol; -+ delete _M_data; -+ } -+#endif -+} -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:58:39.000000000 +0200 -@@ -0,0 +1,160 @@ -+// std::numpunct implementation details, GNU version -*- C++ -*- -+ -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 2, or (at your option) -+// any later version. -+ -+// This 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 General Public License for more details. -+ -+// You should have received a copy of the GNU General Public License along -+// with this library; see the file COPYING. If not, write to the Free -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -+// USA. -+ -+// As a special exception, you may use this file as part of a free software -+// library without restriction. Specifically, if other files instantiate -+// templates or use macros or inline functions from this file, or you compile -+// this file and link it with other files to produce an executable, this -+// file does not by itself cause the resulting executable to be covered by -+// the GNU General Public License. This exception does not however -+// invalidate any other reasons why the executable file might be covered by -+// the GNU General Public License. -+ -+// -+// ISO C++ 14882: 22.2.3.1.2 numpunct virtual functions -+// -+ -+// Written by Benjamin Kosnik -+ -+#define _LIBC -+#include -+#undef _LIBC -+#include -+ -+#ifdef __UCLIBC_MJN3_ONLY__ -+#warning tailor for stub locale support -+#endif -+#ifndef __UCLIBC_HAS_XLOCALE__ -+#define __nl_langinfo_l(N, L) nl_langinfo((N)) -+#endif -+ -+namespace std -+{ -+ template<> -+ void -+ numpunct::_M_initialize_numpunct(__c_locale __cloc) -+ { -+ if (!_M_data) -+ _M_data = new __numpunct_cache; -+ -+ if (!__cloc) -+ { -+ // "C" locale -+ _M_data->_M_grouping = ""; -+ _M_data->_M_grouping_size = 0; -+ _M_data->_M_use_grouping = false; -+ -+ _M_data->_M_decimal_point = '.'; -+ _M_data->_M_thousands_sep = ','; -+ -+ for (size_t __i = 0; __i < __num_base::_S_oend; ++__i) -+ _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i]; -+ -+ for (size_t __j = 0; __j < __num_base::_S_iend; ++__j) -+ _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j]; -+ } -+ else -+ { -+ // Named locale. -+ _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT, -+ __cloc)); -+ _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP, -+ __cloc)); -+ -+ // Check for NULL, which implies no grouping. -+ if (_M_data->_M_thousands_sep == '\0') -+ _M_data->_M_grouping = ""; -+ else -+ _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc); -+ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); -+ } -+ -+ // NB: There is no way to extact this info from posix locales. -+ // _M_truename = __nl_langinfo_l(YESSTR, __cloc); -+ _M_data->_M_truename = "true"; -+ _M_data->_M_truename_size = 4; -+ // _M_falsename = __nl_langinfo_l(NOSTR, __cloc); -+ _M_data->_M_falsename = "false"; -+ _M_data->_M_falsename_size = 5; -+ } -+ -+ template<> -+ numpunct::~numpunct() -+ { delete _M_data; } -+ -+#ifdef _GLIBCXX_USE_WCHAR_T -+ template<> -+ void -+ numpunct::_M_initialize_numpunct(__c_locale __cloc) -+ { -+ if (!_M_data) -+ _M_data = new __numpunct_cache; -+ -+ if (!__cloc) -+ { -+ // "C" locale -+ _M_data->_M_grouping = ""; -+ _M_data->_M_grouping_size = 0; -+ _M_data->_M_use_grouping = false; -+ -+ _M_data->_M_decimal_point = L'.'; -+ _M_data->_M_thousands_sep = L','; -+ -+ // Use ctype::widen code without the facet... -+ for (size_t __i = 0; __i < __num_base::_S_oend; ++__i) -+ _M_data->_M_atoms_out[__i] = -+ static_cast(__num_base::_S_atoms_out[__i]); -+ -+ for (size_t __j = 0; __j < __num_base::_S_iend; ++__j) -+ _M_data->_M_atoms_in[__j] = -+ static_cast(__num_base::_S_atoms_in[__j]); -+ } -+ else -+ { -+ // Named locale. -+ // NB: In the GNU model wchar_t is always 32 bit wide. -+ union { char *__s; wchar_t __w; } __u; -+ __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc); -+ _M_data->_M_decimal_point = __u.__w; -+ -+ __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc); -+ _M_data->_M_thousands_sep = __u.__w; -+ -+ if (_M_data->_M_thousands_sep == L'\0') -+ _M_data->_M_grouping = ""; -+ else -+ _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc); -+ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); -+ } -+ -+ // NB: There is no way to extact this info from posix locales. -+ // _M_truename = __nl_langinfo_l(YESSTR, __cloc); -+ _M_data->_M_truename = L"true"; -+ _M_data->_M_truename_size = 4; -+ // _M_falsename = __nl_langinfo_l(NOSTR, __cloc); -+ _M_data->_M_falsename = L"false"; -+ _M_data->_M_falsename_size = 5; -+ } -+ -+ template<> -+ numpunct::~numpunct() -+ { delete _M_data; } -+ #endif -+} -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.cc ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.cc 2008-06-10 14:58:39.000000000 +0200 -@@ -0,0 +1,406 @@ -+// std::time_get, std::time_put implementation, GNU version -*- C++ -*- -+ -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 2, or (at your option) -+// any later version. -+ -+// This 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 General Public License for more details. -+ -+// You should have received a copy of the GNU General Public License along -+// with this library; see the file COPYING. If not, write to the Free -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -+// USA. -+ -+// As a special exception, you may use this file as part of a free software -+// library without restriction. Specifically, if other files instantiate -+// templates or use macros or inline functions from this file, or you compile -+// this file and link it with other files to produce an executable, this -+// file does not by itself cause the resulting executable to be covered by -+// the GNU General Public License. This exception does not however -+// invalidate any other reasons why the executable file might be covered by -+// the GNU General Public License. -+ -+// -+// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions -+// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions -+// -+ -+// Written by Benjamin Kosnik -+ -+#include -+#include -+ -+#ifdef __UCLIBC_MJN3_ONLY__ -+#warning tailor for stub locale support -+#endif -+#ifndef __UCLIBC_HAS_XLOCALE__ -+#define __nl_langinfo_l(N, L) nl_langinfo((N)) -+#endif -+ -+namespace std -+{ -+ template<> -+ void -+ __timepunct:: -+ _M_put(char* __s, size_t __maxlen, const char* __format, -+ const tm* __tm) const -+ { -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ const size_t __len = __strftime_l(__s, __maxlen, __format, __tm, -+ _M_c_locale_timepunct); -+#else -+ char* __old = strdup(setlocale(LC_ALL, NULL)); -+ setlocale(LC_ALL, _M_name_timepunct); -+ const size_t __len = strftime(__s, __maxlen, __format, __tm); -+ setlocale(LC_ALL, __old); -+ free(__old); -+#endif -+ // Make sure __s is null terminated. -+ if (__len == 0) -+ __s[0] = '\0'; -+ } -+ -+ template<> -+ void -+ __timepunct::_M_initialize_timepunct(__c_locale __cloc) -+ { -+ if (!_M_data) -+ _M_data = new __timepunct_cache; -+ -+ if (!__cloc) -+ { -+ // "C" locale -+ _M_c_locale_timepunct = _S_get_c_locale(); -+ -+ _M_data->_M_date_format = "%m/%d/%y"; -+ _M_data->_M_date_era_format = "%m/%d/%y"; -+ _M_data->_M_time_format = "%H:%M:%S"; -+ _M_data->_M_time_era_format = "%H:%M:%S"; -+ _M_data->_M_date_time_format = ""; -+ _M_data->_M_date_time_era_format = ""; -+ _M_data->_M_am = "AM"; -+ _M_data->_M_pm = "PM"; -+ _M_data->_M_am_pm_format = ""; -+ -+ // Day names, starting with "C"'s Sunday. -+ _M_data->_M_day1 = "Sunday"; -+ _M_data->_M_day2 = "Monday"; -+ _M_data->_M_day3 = "Tuesday"; -+ _M_data->_M_day4 = "Wednesday"; -+ _M_data->_M_day5 = "Thursday"; -+ _M_data->_M_day6 = "Friday"; -+ _M_data->_M_day7 = "Saturday"; -+ -+ // Abbreviated day names, starting with "C"'s Sun. -+ _M_data->_M_aday1 = "Sun"; -+ _M_data->_M_aday2 = "Mon"; -+ _M_data->_M_aday3 = "Tue"; -+ _M_data->_M_aday4 = "Wed"; -+ _M_data->_M_aday5 = "Thu"; -+ _M_data->_M_aday6 = "Fri"; -+ _M_data->_M_aday7 = "Sat"; -+ -+ // Month names, starting with "C"'s January. -+ _M_data->_M_month01 = "January"; -+ _M_data->_M_month02 = "February"; -+ _M_data->_M_month03 = "March"; -+ _M_data->_M_month04 = "April"; -+ _M_data->_M_month05 = "May"; -+ _M_data->_M_month06 = "June"; -+ _M_data->_M_month07 = "July"; -+ _M_data->_M_month08 = "August"; -+ _M_data->_M_month09 = "September"; -+ _M_data->_M_month10 = "October"; -+ _M_data->_M_month11 = "November"; -+ _M_data->_M_month12 = "December"; -+ -+ // Abbreviated month names, starting with "C"'s Jan. -+ _M_data->_M_amonth01 = "Jan"; -+ _M_data->_M_amonth02 = "Feb"; -+ _M_data->_M_amonth03 = "Mar"; -+ _M_data->_M_amonth04 = "Apr"; -+ _M_data->_M_amonth05 = "May"; -+ _M_data->_M_amonth06 = "Jun"; -+ _M_data->_M_amonth07 = "Jul"; -+ _M_data->_M_amonth08 = "Aug"; -+ _M_data->_M_amonth09 = "Sep"; -+ _M_data->_M_amonth10 = "Oct"; -+ _M_data->_M_amonth11 = "Nov"; -+ _M_data->_M_amonth12 = "Dec"; -+ } -+ else -+ { -+ _M_c_locale_timepunct = _S_clone_c_locale(__cloc); -+ -+ _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc); -+ _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc); -+ _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc); -+ _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc); -+ _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc); -+ _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT, -+ __cloc); -+ _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc); -+ _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc); -+ _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc); -+ -+ // Day names, starting with "C"'s Sunday. -+ _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc); -+ _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc); -+ _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc); -+ _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc); -+ _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc); -+ _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc); -+ _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc); -+ -+ // Abbreviated day names, starting with "C"'s Sun. -+ _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc); -+ _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc); -+ _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc); -+ _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc); -+ _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc); -+ _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc); -+ _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc); -+ -+ // Month names, starting with "C"'s January. -+ _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc); -+ _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc); -+ _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc); -+ _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc); -+ _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc); -+ _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc); -+ _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc); -+ _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc); -+ _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc); -+ _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc); -+ _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc); -+ _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc); -+ -+ // Abbreviated month names, starting with "C"'s Jan. -+ _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc); -+ _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc); -+ _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc); -+ _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc); -+ _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc); -+ _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc); -+ _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc); -+ _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc); -+ _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc); -+ _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc); -+ _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc); -+ _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc); -+ } -+ } -+ -+#ifdef _GLIBCXX_USE_WCHAR_T -+ template<> -+ void -+ __timepunct:: -+ _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format, -+ const tm* __tm) const -+ { -+#ifdef __UCLIBC_HAS_XLOCALE__ -+ __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct); -+ const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm, -+ _M_c_locale_timepunct); -+#else -+ char* __old = strdup(setlocale(LC_ALL, NULL)); -+ setlocale(LC_ALL, _M_name_timepunct); -+ const size_t __len = wcsftime(__s, __maxlen, __format, __tm); -+ setlocale(LC_ALL, __old); -+ free(__old); -+#endif -+ // Make sure __s is null terminated. -+ if (__len == 0) -+ __s[0] = L'\0'; -+ } -+ -+ template<> -+ void -+ __timepunct::_M_initialize_timepunct(__c_locale __cloc) -+ { -+ if (!_M_data) -+ _M_data = new __timepunct_cache; -+ -+#warning wide time stuff -+// if (!__cloc) -+ { -+ // "C" locale -+ _M_c_locale_timepunct = _S_get_c_locale(); -+ -+ _M_data->_M_date_format = L"%m/%d/%y"; -+ _M_data->_M_date_era_format = L"%m/%d/%y"; -+ _M_data->_M_time_format = L"%H:%M:%S"; -+ _M_data->_M_time_era_format = L"%H:%M:%S"; -+ _M_data->_M_date_time_format = L""; -+ _M_data->_M_date_time_era_format = L""; -+ _M_data->_M_am = L"AM"; -+ _M_data->_M_pm = L"PM"; -+ _M_data->_M_am_pm_format = L""; -+ -+ // Day names, starting with "C"'s Sunday. -+ _M_data->_M_day1 = L"Sunday"; -+ _M_data->_M_day2 = L"Monday"; -+ _M_data->_M_day3 = L"Tuesday"; -+ _M_data->_M_day4 = L"Wednesday"; -+ _M_data->_M_day5 = L"Thursday"; -+ _M_data->_M_day6 = L"Friday"; -+ _M_data->_M_day7 = L"Saturday"; -+ -+ // Abbreviated day names, starting with "C"'s Sun. -+ _M_data->_M_aday1 = L"Sun"; -+ _M_data->_M_aday2 = L"Mon"; -+ _M_data->_M_aday3 = L"Tue"; -+ _M_data->_M_aday4 = L"Wed"; -+ _M_data->_M_aday5 = L"Thu"; -+ _M_data->_M_aday6 = L"Fri"; -+ _M_data->_M_aday7 = L"Sat"; -+ -+ // Month names, starting with "C"'s January. -+ _M_data->_M_month01 = L"January"; -+ _M_data->_M_month02 = L"February"; -+ _M_data->_M_month03 = L"March"; -+ _M_data->_M_month04 = L"April"; -+ _M_data->_M_month05 = L"May"; -+ _M_data->_M_month06 = L"June"; -+ _M_data->_M_month07 = L"July"; -+ _M_data->_M_month08 = L"August"; -+ _M_data->_M_month09 = L"September"; -+ _M_data->_M_month10 = L"October"; -+ _M_data->_M_month11 = L"November"; -+ _M_data->_M_month12 = L"December"; -+ -+ // Abbreviated month names, starting with "C"'s Jan. -+ _M_data->_M_amonth01 = L"Jan"; -+ _M_data->_M_amonth02 = L"Feb"; -+ _M_data->_M_amonth03 = L"Mar"; -+ _M_data->_M_amonth04 = L"Apr"; -+ _M_data->_M_amonth05 = L"May"; -+ _M_data->_M_amonth06 = L"Jun"; -+ _M_data->_M_amonth07 = L"Jul"; -+ _M_data->_M_amonth08 = L"Aug"; -+ _M_data->_M_amonth09 = L"Sep"; -+ _M_data->_M_amonth10 = L"Oct"; -+ _M_data->_M_amonth11 = L"Nov"; -+ _M_data->_M_amonth12 = L"Dec"; -+ } -+#if 0 -+ else -+ { -+ _M_c_locale_timepunct = _S_clone_c_locale(__cloc); -+ -+ union { char *__s; wchar_t *__w; } __u; -+ -+ __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc); -+ _M_data->_M_date_format = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc); -+ _M_data->_M_date_era_format = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc); -+ _M_data->_M_time_format = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc); -+ _M_data->_M_time_era_format = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc); -+ _M_data->_M_date_time_format = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc); -+ _M_data->_M_date_time_era_format = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc); -+ _M_data->_M_am = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc); -+ _M_data->_M_pm = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc); -+ _M_data->_M_am_pm_format = __u.__w; -+ -+ // Day names, starting with "C"'s Sunday. -+ __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc); -+ _M_data->_M_day1 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc); -+ _M_data->_M_day2 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc); -+ _M_data->_M_day3 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc); -+ _M_data->_M_day4 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc); -+ _M_data->_M_day5 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc); -+ _M_data->_M_day6 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc); -+ _M_data->_M_day7 = __u.__w; -+ -+ // Abbreviated day names, starting with "C"'s Sun. -+ __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc); -+ _M_data->_M_aday1 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc); -+ _M_data->_M_aday2 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc); -+ _M_data->_M_aday3 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc); -+ _M_data->_M_aday4 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc); -+ _M_data->_M_aday5 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc); -+ _M_data->_M_aday6 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc); -+ _M_data->_M_aday7 = __u.__w; -+ -+ // Month names, starting with "C"'s January. -+ __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc); -+ _M_data->_M_month01 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc); -+ _M_data->_M_month02 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc); -+ _M_data->_M_month03 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc); -+ _M_data->_M_month04 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc); -+ _M_data->_M_month05 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc); -+ _M_data->_M_month06 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc); -+ _M_data->_M_month07 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc); -+ _M_data->_M_month08 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc); -+ _M_data->_M_month09 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc); -+ _M_data->_M_month10 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc); -+ _M_data->_M_month11 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc); -+ _M_data->_M_month12 = __u.__w; -+ -+ // Abbreviated month names, starting with "C"'s Jan. -+ __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc); -+ _M_data->_M_amonth01 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc); -+ _M_data->_M_amonth02 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc); -+ _M_data->_M_amonth03 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc); -+ _M_data->_M_amonth04 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc); -+ _M_data->_M_amonth05 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc); -+ _M_data->_M_amonth06 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc); -+ _M_data->_M_amonth07 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc); -+ _M_data->_M_amonth08 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc); -+ _M_data->_M_amonth09 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc); -+ _M_data->_M_amonth10 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc); -+ _M_data->_M_amonth11 = __u.__w; -+ __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc); -+ _M_data->_M_amonth12 = __u.__w; -+ } -+#endif // 0 -+ } -+#endif -+} -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.h ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h 1970-01-01 01:00:00.000000000 +0100 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.h 2008-06-10 14:58:39.000000000 +0200 -@@ -0,0 +1,68 @@ -+// std::time_get, std::time_put implementation, GNU version -*- C++ -*- -+ -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 2, or (at your option) -+// any later version. -+ -+// This 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 General Public License for more details. -+ -+// You should have received a copy of the GNU General Public License along -+// with this library; see the file COPYING. If not, write to the Free -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -+// USA. -+ -+// As a special exception, you may use this file as part of a free software -+// library without restriction. Specifically, if other files instantiate -+// templates or use macros or inline functions from this file, or you compile -+// this file and link it with other files to produce an executable, this -+// file does not by itself cause the resulting executable to be covered by -+// the GNU General Public License. This exception does not however -+// invalidate any other reasons why the executable file might be covered by -+// the GNU General Public License. -+ -+// -+// ISO C++ 14882: 22.2.5.1.2 - time_get functions -+// ISO C++ 14882: 22.2.5.3.2 - time_put functions -+// -+ -+// Written by Benjamin Kosnik -+ -+ template -+ __timepunct<_CharT>::__timepunct(size_t __refs) -+ : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), -+ _M_name_timepunct(_S_get_c_name()) -+ { _M_initialize_timepunct(); } -+ -+ template -+ __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) -+ : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), -+ _M_name_timepunct(_S_get_c_name()) -+ { _M_initialize_timepunct(); } -+ -+ template -+ __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s, -+ size_t __refs) -+ : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), -+ _M_name_timepunct(__s) -+ { -+ char* __tmp = new char[std::strlen(__s) + 1]; -+ std::strcpy(__tmp, __s); -+ _M_name_timepunct = __tmp; -+ _M_initialize_timepunct(__cloc); -+ } -+ -+ template -+ __timepunct<_CharT>::~__timepunct() -+ { -+ if (_M_name_timepunct != _S_get_c_name()) -+ delete [] _M_name_timepunct; -+ delete _M_data; -+ _S_destroy_c_locale(_M_c_locale_timepunct); -+ } -diff -durN gcc-4.3.1.orig/libstdc++-v3/configure gcc-4.3.1/libstdc++-v3/configure ---- gcc-4.3.1.orig/libstdc++-v3/configure 2008-04-25 18:52:57.000000000 +0200 -+++ gcc-4.3.1/libstdc++-v3/configure 2008-06-10 14:58:39.000000000 +0200 -@@ -14001,7 +14001,7 @@ - enableval="$enable_clocale" - - case "$enableval" in -- generic|gnu|ieee_1003.1-2001|yes|no|auto) ;; -+ generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto) ;; - *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable clocale" >&5 - echo "$as_me: error: Unknown argument to enable/disable clocale" >&2;} - { (exit 1); exit 1; }; } ;; -@@ -14034,6 +14034,9 @@ - # Default to "generic". - if test $enable_clocale_flag = auto; then - case ${target_os} in -+ linux-uclibc*) -+ enable_clocale_flag=uclibc -+ ;; - linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu) - enable_clocale_flag=gnu - ;; -@@ -14422,6 +14425,76 @@ - CTIME_CC=config/locale/generic/time_members.cc - CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h - ;; -+ uclibc) -+ echo "$as_me:$LINENO: result: uclibc" >&5 -+echo "${ECHO_T}uclibc" >&6 -+ -+ # Declare intention to use gettext, and add support for specific -+ # languages. -+ # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT -+ ALL_LINGUAS="de fr" -+ -+ # Don't call AM-GNU-GETTEXT here. Instead, assume glibc. -+ # Extract the first word of "msgfmt", so it can be a program name with args. -+set dummy msgfmt; ac_word=$2 -+echo "$as_me:$LINENO: checking for $ac_word" >&5 -+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -+if test "${ac_cv_prog_check_msgfmt+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ if test -n "$check_msgfmt"; then -+ ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test. -+else -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -+ ac_cv_prog_check_msgfmt="yes" -+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+done -+ -+ test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no" -+fi -+fi -+check_msgfmt=$ac_cv_prog_check_msgfmt -+if test -n "$check_msgfmt"; then -+ echo "$as_me:$LINENO: result: $check_msgfmt" >&5 -+echo "${ECHO_T}$check_msgfmt" >&6 -+else -+ echo "$as_me:$LINENO: result: no" >&5 -+echo "${ECHO_T}no" >&6 -+fi -+ -+ if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then -+ USE_NLS=yes -+ fi -+ # Export the build objects. -+ for ling in $ALL_LINGUAS; do \ -+ glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \ -+ glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \ -+ done -+ -+ -+ -+ CLOCALE_H=config/locale/uclibc/c_locale.h -+ CLOCALE_CC=config/locale/uclibc/c_locale.cc -+ CCODECVT_CC=config/locale/uclibc/codecvt_members.cc -+ CCOLLATE_CC=config/locale/uclibc/collate_members.cc -+ CCTYPE_CC=config/locale/uclibc/ctype_members.cc -+ CMESSAGES_H=config/locale/uclibc/messages_members.h -+ CMESSAGES_CC=config/locale/uclibc/messages_members.cc -+ CMONEY_CC=config/locale/uclibc/monetary_members.cc -+ CNUMERIC_CC=config/locale/uclibc/numeric_members.cc -+ CTIME_H=config/locale/uclibc/time_members.h -+ CTIME_CC=config/locale/uclibc/time_members.cc -+ CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h -+ ;; - esac - - # This is where the testsuite looks for locale catalogs, using the -diff -durN gcc-4.3.1.orig/libstdc++-v3/include/c_compatibility/wchar.h gcc-4.3.1/libstdc++-v3/include/c_compatibility/wchar.h ---- gcc-4.3.1.orig/libstdc++-v3/include/c_compatibility/wchar.h 2007-03-04 23:59:49.000000000 +0100 -+++ gcc-4.3.1/libstdc++-v3/include/c_compatibility/wchar.h 2008-06-10 14:58:39.000000000 +0200 -@@ -106,7 +106,9 @@ - using std::wmemcpy; - using std::wmemmove; - using std::wmemset; -+#if _GLIBCXX_HAVE_WCSFTIME - using std::wcsftime; -+#endif - - #if _GLIBCXX_USE_C99 - using std::wcstold; diff --git a/patches/gcc/4.3.1/525-uclibc-locale.patch b/patches/gcc/4.3.1/525-uclibc-locale.patch new file mode 100644 index 0000000..6ba5fd9 --- /dev/null +++ b/patches/gcc/4.3.1/525-uclibc-locale.patch @@ -0,0 +1,2794 @@ +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_200-uclibc-locale.patch +diff -durN gcc-4.3.1.orig/libstdc++-v3/acinclude.m4 gcc-4.3.1/libstdc++-v3/acinclude.m4 +--- gcc-4.3.1.orig/libstdc++-v3/acinclude.m4 2008-04-25 18:52:57.000000000 +0200 ++++ gcc-4.3.1/libstdc++-v3/acinclude.m4 2008-06-10 14:58:39.000000000 +0200 +@@ -1349,7 +1349,7 @@ + AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [ + GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@], + [use MODEL for target locale package], +- [permit generic|gnu|ieee_1003.1-2001|yes|no|auto]) ++ [permit generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto]) + + # Deal with gettext issues. Default to not using it (=no) until we detect + # support for it later. Let the user turn it off via --e/d, but let that +@@ -1370,6 +1370,9 @@ + # Default to "generic". + if test $enable_clocale_flag = auto; then + case ${target_os} in ++ *-uclibc*) ++ enable_clocale_flag=uclibc ++ ;; + linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu) + enable_clocale_flag=gnu + ;; +@@ -1541,6 +1544,40 @@ + CTIME_CC=config/locale/generic/time_members.cc + CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h + ;; ++ uclibc) ++ AC_MSG_RESULT(uclibc) ++ ++ # Declare intention to use gettext, and add support for specific ++ # languages. ++ # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT ++ ALL_LINGUAS="de fr" ++ ++ # Don't call AM-GNU-GETTEXT here. Instead, assume glibc. ++ AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no) ++ if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then ++ USE_NLS=yes ++ fi ++ # Export the build objects. ++ for ling in $ALL_LINGUAS; do \ ++ glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \ ++ glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \ ++ done ++ AC_SUBST(glibcxx_MOFILES) ++ AC_SUBST(glibcxx_POFILES) ++ ++ CLOCALE_H=config/locale/uclibc/c_locale.h ++ CLOCALE_CC=config/locale/uclibc/c_locale.cc ++ CCODECVT_CC=config/locale/uclibc/codecvt_members.cc ++ CCOLLATE_CC=config/locale/uclibc/collate_members.cc ++ CCTYPE_CC=config/locale/uclibc/ctype_members.cc ++ CMESSAGES_H=config/locale/uclibc/messages_members.h ++ CMESSAGES_CC=config/locale/uclibc/messages_members.cc ++ CMONEY_CC=config/locale/uclibc/monetary_members.cc ++ CNUMERIC_CC=config/locale/uclibc/numeric_members.cc ++ CTIME_H=config/locale/uclibc/time_members.h ++ CTIME_CC=config/locale/uclibc/time_members.cc ++ CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h ++ ;; + esac + + # This is where the testsuite looks for locale catalogs, using the +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 1970-01-01 01:00:00.000000000 +0100 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2008-06-10 14:58:39.000000000 +0200 +@@ -0,0 +1,63 @@ ++// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*- ++ ++// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library is free ++// software; you can redistribute it and/or modify it under the ++// terms of the GNU General Public License as published by the ++// Free Software Foundation; either version 2, or (at your option) ++// any later version. ++ ++// This 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 General Public License for more details. ++ ++// You should have received a copy of the GNU General Public License along ++// with this library; see the file COPYING. If not, write to the Free ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, ++// USA. ++ ++// As a special exception, you may use this file as part of a free software ++// library without restriction. Specifically, if other files instantiate ++// templates or use macros or inline functions from this file, or you compile ++// this file and link it with other files to produce an executable, this ++// file does not by itself cause the resulting executable to be covered by ++// the GNU General Public License. This exception does not however ++// invalidate any other reasons why the executable file might be covered by ++// the GNU General Public License. ++ ++// Written by Jakub Jelinek ++ ++#include ++#include ++ ++#ifdef __UCLIBC_MJN3_ONLY__ ++#warning clean this up ++#endif ++ ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ ++extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l; ++extern "C" __typeof(strcoll_l) __strcoll_l; ++extern "C" __typeof(strftime_l) __strftime_l; ++extern "C" __typeof(strtod_l) __strtod_l; ++extern "C" __typeof(strtof_l) __strtof_l; ++extern "C" __typeof(strtold_l) __strtold_l; ++extern "C" __typeof(strxfrm_l) __strxfrm_l; ++extern "C" __typeof(newlocale) __newlocale; ++extern "C" __typeof(freelocale) __freelocale; ++extern "C" __typeof(duplocale) __duplocale; ++extern "C" __typeof(uselocale) __uselocale; ++ ++#ifdef _GLIBCXX_USE_WCHAR_T ++extern "C" __typeof(iswctype_l) __iswctype_l; ++extern "C" __typeof(towlower_l) __towlower_l; ++extern "C" __typeof(towupper_l) __towupper_l; ++extern "C" __typeof(wcscoll_l) __wcscoll_l; ++extern "C" __typeof(wcsftime_l) __wcsftime_l; ++extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l; ++extern "C" __typeof(wctype_l) __wctype_l; ++#endif ++ ++#endif // GLIBC 2.3 and later +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.cc +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc 1970-01-01 01:00:00.000000000 +0100 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-06-10 14:58:39.000000000 +0200 +@@ -0,0 +1,160 @@ ++// Wrapper for underlying C-language localization -*- C++ -*- ++ ++// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library is free ++// software; you can redistribute it and/or modify it under the ++// terms of the GNU General Public License as published by the ++// Free Software Foundation; either version 2, or (at your option) ++// any later version. ++ ++// This 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 General Public License for more details. ++ ++// You should have received a copy of the GNU General Public License along ++// with this library; see the file COPYING. If not, write to the Free ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, ++// USA. ++ ++// As a special exception, you may use this file as part of a free software ++// library without restriction. Specifically, if other files instantiate ++// templates or use macros or inline functions from this file, or you compile ++// this file and link it with other files to produce an executable, this ++// file does not by itself cause the resulting executable to be covered by ++// the GNU General Public License. This exception does not however ++// invalidate any other reasons why the executable file might be covered by ++// the GNU General Public License. ++ ++// ++// ISO C++ 14882: 22.8 Standard locale categories. ++// ++ ++// Written by Benjamin Kosnik ++ ++#include // For errno ++#include ++#include ++#include ++#include ++ ++#ifndef __UCLIBC_HAS_XLOCALE__ ++#define __strtol_l(S, E, B, L) strtol((S), (E), (B)) ++#define __strtoul_l(S, E, B, L) strtoul((S), (E), (B)) ++#define __strtoll_l(S, E, B, L) strtoll((S), (E), (B)) ++#define __strtoull_l(S, E, B, L) strtoull((S), (E), (B)) ++#define __strtof_l(S, E, L) strtof((S), (E)) ++#define __strtod_l(S, E, L) strtod((S), (E)) ++#define __strtold_l(S, E, L) strtold((S), (E)) ++#warning should dummy __newlocale check for C|POSIX ? ++#define __newlocale(a, b, c) NULL ++#define __freelocale(a) ((void)0) ++#define __duplocale(a) __c_locale() ++#endif ++ ++namespace std ++{ ++ template<> ++ void ++ __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, ++ const __c_locale& __cloc) ++ { ++ if (!(__err & ios_base::failbit)) ++ { ++ char* __sanity; ++ errno = 0; ++ float __f = __strtof_l(__s, &__sanity, __cloc); ++ if (__sanity != __s && errno != ERANGE) ++ __v = __f; ++ else ++ __err |= ios_base::failbit; ++ } ++ } ++ ++ template<> ++ void ++ __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, ++ const __c_locale& __cloc) ++ { ++ if (!(__err & ios_base::failbit)) ++ { ++ char* __sanity; ++ errno = 0; ++ double __d = __strtod_l(__s, &__sanity, __cloc); ++ if (__sanity != __s && errno != ERANGE) ++ __v = __d; ++ else ++ __err |= ios_base::failbit; ++ } ++ } ++ ++ template<> ++ void ++ __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err, ++ const __c_locale& __cloc) ++ { ++ if (!(__err & ios_base::failbit)) ++ { ++ char* __sanity; ++ errno = 0; ++ long double __ld = __strtold_l(__s, &__sanity, __cloc); ++ if (__sanity != __s && errno != ERANGE) ++ __v = __ld; ++ else ++ __err |= ios_base::failbit; ++ } ++ } ++ ++ void ++ locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s, ++ __c_locale __old) ++ { ++ __cloc = __newlocale(1 << LC_ALL, __s, __old); ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ if (!__cloc) ++ { ++ // This named locale is not supported by the underlying OS. ++ __throw_runtime_error(__N("locale::facet::_S_create_c_locale " ++ "name not valid")); ++ } ++#endif ++ } ++ ++ void ++ locale::facet::_S_destroy_c_locale(__c_locale& __cloc) ++ { ++ if (_S_get_c_locale() != __cloc) ++ __freelocale(__cloc); ++ } ++ ++ __c_locale ++ locale::facet::_S_clone_c_locale(__c_locale& __cloc) ++ { return __duplocale(__cloc); } ++} // namespace std ++ ++namespace __gnu_cxx ++{ ++ const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] = ++ { ++ "LC_CTYPE", ++ "LC_NUMERIC", ++ "LC_TIME", ++ "LC_COLLATE", ++ "LC_MONETARY", ++ "LC_MESSAGES", ++#if _GLIBCXX_NUM_CATEGORIES != 0 ++ "LC_PAPER", ++ "LC_NAME", ++ "LC_ADDRESS", ++ "LC_TELEPHONE", ++ "LC_MEASUREMENT", ++ "LC_IDENTIFICATION" ++#endif ++ }; ++} ++ ++namespace std ++{ ++ const char* const* const locale::_S_categories = __gnu_cxx::category_names; ++} // namespace std +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.h +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h 1970-01-01 01:00:00.000000000 +0100 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-06-10 14:58:39.000000000 +0200 +@@ -0,0 +1,117 @@ ++// Wrapper for underlying C-language localization -*- C++ -*- ++ ++// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library is free ++// software; you can redistribute it and/or modify it under the ++// terms of the GNU General Public License as published by the ++// Free Software Foundation; either version 2, or (at your option) ++// any later version. ++ ++// This 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 General Public License for more details. ++ ++// You should have received a copy of the GNU General Public License along ++// with this library; see the file COPYING. If not, write to the Free ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, ++// USA. ++ ++// As a special exception, you may use this file as part of a free software ++// library without restriction. Specifically, if other files instantiate ++// templates or use macros or inline functions from this file, or you compile ++// this file and link it with other files to produce an executable, this ++// file does not by itself cause the resulting executable to be covered by ++// the GNU General Public License. This exception does not however ++// invalidate any other reasons why the executable file might be covered by ++// the GNU General Public License. ++ ++// ++// ISO C++ 14882: 22.8 Standard locale categories. ++// ++ ++// Written by Benjamin Kosnik ++ ++#ifndef _C_LOCALE_H ++#define _C_LOCALE_H 1 ++ ++#pragma GCC system_header ++ ++#include // get std::strlen ++#include // get std::snprintf or std::sprintf ++#include ++#include // For codecvt ++#ifdef __UCLIBC_MJN3_ONLY__ ++#warning fix this ++#endif ++#ifdef __UCLIBC_HAS_LOCALE__ ++#include // For codecvt using iconv, iconv_t ++#endif ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ ++#include // For messages ++#endif ++ ++#ifdef __UCLIBC_MJN3_ONLY__ ++#warning what is _GLIBCXX_C_LOCALE_GNU for ++#endif ++#define _GLIBCXX_C_LOCALE_GNU 1 ++ ++#ifdef __UCLIBC_MJN3_ONLY__ ++#warning fix categories ++#endif ++// #define _GLIBCXX_NUM_CATEGORIES 6 ++#define _GLIBCXX_NUM_CATEGORIES 0 ++ ++#ifdef __UCLIBC_HAS_XLOCALE__ ++namespace __gnu_cxx ++{ ++ extern "C" __typeof(uselocale) __uselocale; ++} ++#endif ++ ++namespace std ++{ ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ typedef __locale_t __c_locale; ++#else ++ typedef int* __c_locale; ++#endif ++ ++ // Convert numeric value of type _Tv to string and return length of ++ // string. If snprintf is available use it, otherwise fall back to ++ // the unsafe sprintf which, in general, can be dangerous and should ++ // be avoided. ++ template ++ int ++ __convert_from_v(char* __out, ++ const int __size __attribute__ ((__unused__)), ++ const char* __fmt, ++#ifdef __UCLIBC_HAS_XCLOCALE__ ++ _Tv __v, const __c_locale& __cloc, int __prec) ++ { ++ __c_locale __old = __gnu_cxx::__uselocale(__cloc); ++#else ++ _Tv __v, const __c_locale&, int __prec) ++ { ++# ifdef __UCLIBC_HAS_LOCALE__ ++ char* __old = std::setlocale(LC_ALL, NULL); ++ char* __sav = new char[std::strlen(__old) + 1]; ++ std::strcpy(__sav, __old); ++ std::setlocale(LC_ALL, "C"); ++# endif ++#endif ++ ++ const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v); ++ ++#ifdef __UCLIBC_HAS_XCLOCALE__ ++ __gnu_cxx::__uselocale(__old); ++#elif defined __UCLIBC_HAS_LOCALE__ ++ std::setlocale(LC_ALL, __sav); ++ delete [] __sav; ++#endif ++ return __ret; ++ } ++} ++ ++#endif +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/codecvt_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/codecvt_members.cc +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/codecvt_members.cc 1970-01-01 01:00:00.000000000 +0100 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/codecvt_members.cc 2008-06-10 14:58:39.000000000 +0200 +@@ -0,0 +1,306 @@ ++// std::codecvt implementation details, GNU version -*- C++ -*- ++ ++// Copyright (C) 2002, 2003 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library is free ++// software; you can redistribute it and/or modify it under the ++// terms of the GNU General Public License as published by the ++// Free Software Foundation; either version 2, or (at your option) ++// any later version. ++ ++// This 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 General Public License for more details. ++ ++// You should have received a copy of the GNU General Public License along ++// with this library; see the file COPYING. If not, write to the Free ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, ++// USA. ++ ++// As a special exception, you may use this file as part of a free software ++// library without restriction. Specifically, if other files instantiate ++// templates or use macros or inline functions from this file, or you compile ++// this file and link it with other files to produce an executable, this ++// file does not by itself cause the resulting executable to be covered by ++// the GNU General Public License. This exception does not however ++// invalidate any other reasons why the executable file might be covered by ++// the GNU General Public License. ++ ++// ++// ISO C++ 14882: 22.2.1.5 - Template class codecvt ++// ++ ++// Written by Benjamin Kosnik ++ ++#include ++#include ++ ++namespace std ++{ ++ // Specializations. ++#ifdef _GLIBCXX_USE_WCHAR_T ++ codecvt_base::result ++ codecvt:: ++ do_out(state_type& __state, const intern_type* __from, ++ const intern_type* __from_end, const intern_type*& __from_next, ++ extern_type* __to, extern_type* __to_end, ++ extern_type*& __to_next) const ++ { ++ result __ret = ok; ++ state_type __tmp_state(__state); ++ ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __c_locale __old = __uselocale(_M_c_locale_codecvt); ++#endif ++ ++ // wcsnrtombs is *very* fast but stops if encounters NUL characters: ++ // in case we fall back to wcrtomb and then continue, in a loop. ++ // NB: wcsnrtombs is a GNU extension ++ for (__from_next = __from, __to_next = __to; ++ __from_next < __from_end && __to_next < __to_end ++ && __ret == ok;) ++ { ++ const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0', ++ __from_end - __from_next); ++ if (!__from_chunk_end) ++ __from_chunk_end = __from_end; ++ ++ __from = __from_next; ++ const size_t __conv = wcsnrtombs(__to_next, &__from_next, ++ __from_chunk_end - __from_next, ++ __to_end - __to_next, &__state); ++ if (__conv == static_cast(-1)) ++ { ++ // In case of error, in order to stop at the exact place we ++ // have to start again from the beginning with a series of ++ // wcrtomb. ++ for (; __from < __from_next; ++__from) ++ __to_next += wcrtomb(__to_next, *__from, &__tmp_state); ++ __state = __tmp_state; ++ __ret = error; ++ } ++ else if (__from_next && __from_next < __from_chunk_end) ++ { ++ __to_next += __conv; ++ __ret = partial; ++ } ++ else ++ { ++ __from_next = __from_chunk_end; ++ __to_next += __conv; ++ } ++ ++ if (__from_next < __from_end && __ret == ok) ++ { ++ extern_type __buf[MB_LEN_MAX]; ++ __tmp_state = __state; ++ const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state); ++ if (__conv > static_cast(__to_end - __to_next)) ++ __ret = partial; ++ else ++ { ++ memcpy(__to_next, __buf, __conv); ++ __state = __tmp_state; ++ __to_next += __conv; ++ ++__from_next; ++ } ++ } ++ } ++ ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __uselocale(__old); ++#endif ++ ++ return __ret; ++ } ++ ++ codecvt_base::result ++ codecvt:: ++ do_in(state_type& __state, const extern_type* __from, ++ const extern_type* __from_end, const extern_type*& __from_next, ++ intern_type* __to, intern_type* __to_end, ++ intern_type*& __to_next) const ++ { ++ result __ret = ok; ++ state_type __tmp_state(__state); ++ ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __c_locale __old = __uselocale(_M_c_locale_codecvt); ++#endif ++ ++ // mbsnrtowcs is *very* fast but stops if encounters NUL characters: ++ // in case we store a L'\0' and then continue, in a loop. ++ // NB: mbsnrtowcs is a GNU extension ++ for (__from_next = __from, __to_next = __to; ++ __from_next < __from_end && __to_next < __to_end ++ && __ret == ok;) ++ { ++ const extern_type* __from_chunk_end; ++ __from_chunk_end = static_cast(memchr(__from_next, '\0', ++ __from_end ++ - __from_next)); ++ if (!__from_chunk_end) ++ __from_chunk_end = __from_end; ++ ++ __from = __from_next; ++ size_t __conv = mbsnrtowcs(__to_next, &__from_next, ++ __from_chunk_end - __from_next, ++ __to_end - __to_next, &__state); ++ if (__conv == static_cast(-1)) ++ { ++ // In case of error, in order to stop at the exact place we ++ // have to start again from the beginning with a series of ++ // mbrtowc. ++ for (;; ++__to_next, __from += __conv) ++ { ++ __conv = mbrtowc(__to_next, __from, __from_end - __from, ++ &__tmp_state); ++ if (__conv == static_cast(-1) ++ || __conv == static_cast(-2)) ++ break; ++ } ++ __from_next = __from; ++ __state = __tmp_state; ++ __ret = error; ++ } ++ else if (__from_next && __from_next < __from_chunk_end) ++ { ++ // It is unclear what to return in this case (see DR 382). ++ __to_next += __conv; ++ __ret = partial; ++ } ++ else ++ { ++ __from_next = __from_chunk_end; ++ __to_next += __conv; ++ } ++ ++ if (__from_next < __from_end && __ret == ok) ++ { ++ if (__to_next < __to_end) ++ { ++ // XXX Probably wrong for stateful encodings ++ __tmp_state = __state; ++ ++__from_next; ++ *__to_next++ = L'\0'; ++ } ++ else ++ __ret = partial; ++ } ++ } ++ ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __uselocale(__old); ++#endif ++ ++ return __ret; ++ } ++ ++ int ++ codecvt:: ++ do_encoding() const throw() ++ { ++ // XXX This implementation assumes that the encoding is ++ // stateless and is either single-byte or variable-width. ++ int __ret = 0; ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __c_locale __old = __uselocale(_M_c_locale_codecvt); ++#endif ++ if (MB_CUR_MAX == 1) ++ __ret = 1; ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __uselocale(__old); ++#endif ++ return __ret; ++ } ++ ++ int ++ codecvt:: ++ do_max_length() const throw() ++ { ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __c_locale __old = __uselocale(_M_c_locale_codecvt); ++#endif ++ // XXX Probably wrong for stateful encodings. ++ int __ret = MB_CUR_MAX; ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __uselocale(__old); ++#endif ++ return __ret; ++ } ++ ++ int ++ codecvt:: ++ do_length(state_type& __state, const extern_type* __from, ++ const extern_type* __end, size_t __max) const ++ { ++ int __ret = 0; ++ state_type __tmp_state(__state); ++ ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __c_locale __old = __uselocale(_M_c_locale_codecvt); ++#endif ++ ++ // mbsnrtowcs is *very* fast but stops if encounters NUL characters: ++ // in case we advance past it and then continue, in a loop. ++ // NB: mbsnrtowcs is a GNU extension ++ ++ // A dummy internal buffer is needed in order for mbsnrtocws to consider ++ // its fourth parameter (it wouldn't with NULL as first parameter). ++ wchar_t* __to = static_cast(__builtin_alloca(sizeof(wchar_t) ++ * __max)); ++ while (__from < __end && __max) ++ { ++ const extern_type* __from_chunk_end; ++ __from_chunk_end = static_cast(memchr(__from, '\0', ++ __end ++ - __from)); ++ if (!__from_chunk_end) ++ __from_chunk_end = __end; ++ ++ const extern_type* __tmp_from = __from; ++ size_t __conv = mbsnrtowcs(__to, &__from, ++ __from_chunk_end - __from, ++ __max, &__state); ++ if (__conv == static_cast(-1)) ++ { ++ // In case of error, in order to stop at the exact place we ++ // have to start again from the beginning with a series of ++ // mbrtowc. ++ for (__from = __tmp_from;; __from += __conv) ++ { ++ __conv = mbrtowc(NULL, __from, __end - __from, ++ &__tmp_state); ++ if (__conv == static_cast(-1) ++ || __conv == static_cast(-2)) ++ break; ++ } ++ __state = __tmp_state; ++ __ret += __from - __tmp_from; ++ break; ++ } ++ if (!__from) ++ __from = __from_chunk_end; ++ ++ __ret += __from - __tmp_from; ++ __max -= __conv; ++ ++ if (__from < __end && __max) ++ { ++ // XXX Probably wrong for stateful encodings ++ __tmp_state = __state; ++ ++__from; ++ ++__ret; ++ --__max; ++ } ++ } ++ ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __uselocale(__old); ++#endif ++ ++ return __ret; ++ } ++#endif ++} +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/collate_members.cc +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc 1970-01-01 01:00:00.000000000 +0100 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/collate_members.cc 2008-06-10 14:58:39.000000000 +0200 +@@ -0,0 +1,80 @@ ++// std::collate implementation details, GNU version -*- C++ -*- ++ ++// Copyright (C) 2001, 2002 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library is free ++// software; you can redistribute it and/or modify it under the ++// terms of the GNU General Public License as published by the ++// Free Software Foundation; either version 2, or (at your option) ++// any later version. ++ ++// This 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 General Public License for more details. ++ ++// You should have received a copy of the GNU General Public License along ++// with this library; see the file COPYING. If not, write to the Free ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, ++// USA. ++ ++// As a special exception, you may use this file as part of a free software ++// library without restriction. Specifically, if other files instantiate ++// templates or use macros or inline functions from this file, or you compile ++// this file and link it with other files to produce an executable, this ++// file does not by itself cause the resulting executable to be covered by ++// the GNU General Public License. This exception does not however ++// invalidate any other reasons why the executable file might be covered by ++// the GNU General Public License. ++ ++// ++// ISO C++ 14882: 22.2.4.1.2 collate virtual functions ++// ++ ++// Written by Benjamin Kosnik ++ ++#include ++#include ++ ++#ifndef __UCLIBC_HAS_XLOCALE__ ++#define __strcoll_l(S1, S2, L) strcoll((S1), (S2)) ++#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N)) ++#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2)) ++#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N)) ++#endif ++ ++namespace std ++{ ++ // These are basically extensions to char_traits, and perhaps should ++ // be put there instead of here. ++ template<> ++ int ++ collate::_M_compare(const char* __one, const char* __two) const ++ { ++ int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate); ++ return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0); ++ } ++ ++ template<> ++ size_t ++ collate::_M_transform(char* __to, const char* __from, ++ size_t __n) const ++ { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); } ++ ++#ifdef _GLIBCXX_USE_WCHAR_T ++ template<> ++ int ++ collate::_M_compare(const wchar_t* __one, ++ const wchar_t* __two) const ++ { ++ int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate); ++ return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0); ++ } ++ ++ template<> ++ size_t ++ collate::_M_transform(wchar_t* __to, const wchar_t* __from, ++ size_t __n) const ++ { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); } ++#endif ++} +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc 1970-01-01 01:00:00.000000000 +0100 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-06-10 14:58:39.000000000 +0200 +@@ -0,0 +1,300 @@ ++// std::ctype implementation details, GNU version -*- C++ -*- ++ ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library is free ++// software; you can redistribute it and/or modify it under the ++// terms of the GNU General Public License as published by the ++// Free Software Foundation; either version 2, or (at your option) ++// any later version. ++ ++// This 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 General Public License for more details. ++ ++// You should have received a copy of the GNU General Public License along ++// with this library; see the file COPYING. If not, write to the Free ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, ++// USA. ++ ++// As a special exception, you may use this file as part of a free software ++// library without restriction. Specifically, if other files instantiate ++// templates or use macros or inline functions from this file, or you compile ++// this file and link it with other files to produce an executable, this ++// file does not by itself cause the resulting executable to be covered by ++// the GNU General Public License. This exception does not however ++// invalidate any other reasons why the executable file might be covered by ++// the GNU General Public License. ++ ++// ++// ISO C++ 14882: 22.2.1.1.2 ctype virtual functions. ++// ++ ++// Written by Benjamin Kosnik ++ ++#define _LIBC ++#include ++#undef _LIBC ++#include ++ ++#ifndef __UCLIBC_HAS_XLOCALE__ ++#define __wctype_l(S, L) wctype((S)) ++#define __towupper_l(C, L) towupper((C)) ++#define __towlower_l(C, L) towlower((C)) ++#define __iswctype_l(C, M, L) iswctype((C), (M)) ++#endif ++ ++namespace std ++{ ++ // NB: The other ctype specializations are in src/locale.cc and ++ // various /config/os/* files. ++ template<> ++ ctype_byname::ctype_byname(const char* __s, size_t __refs) ++ : ctype(0, false, __refs) ++ { ++ if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0) ++ { ++ this->_S_destroy_c_locale(this->_M_c_locale_ctype); ++ this->_S_create_c_locale(this->_M_c_locale_ctype, __s); ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper; ++ this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower; ++ this->_M_table = this->_M_c_locale_ctype->__ctype_b; ++#endif ++ } ++ } ++ ++#ifdef _GLIBCXX_USE_WCHAR_T ++ ctype::__wmask_type ++ ctype::_M_convert_to_wmask(const mask __m) const ++ { ++ __wmask_type __ret; ++ switch (__m) ++ { ++ case space: ++ __ret = __wctype_l("space", _M_c_locale_ctype); ++ break; ++ case print: ++ __ret = __wctype_l("print", _M_c_locale_ctype); ++ break; ++ case cntrl: ++ __ret = __wctype_l("cntrl", _M_c_locale_ctype); ++ break; ++ case upper: ++ __ret = __wctype_l("upper", _M_c_locale_ctype); ++ break; ++ case lower: ++ __ret = __wctype_l("lower", _M_c_locale_ctype); ++ break; ++ case alpha: ++ __ret = __wctype_l("alpha", _M_c_locale_ctype); ++ break; ++ case digit: ++ __ret = __wctype_l("digit", _M_c_locale_ctype); ++ break; ++ case punct: ++ __ret = __wctype_l("punct", _M_c_locale_ctype); ++ break; ++ case xdigit: ++ __ret = __wctype_l("xdigit", _M_c_locale_ctype); ++ break; ++ case alnum: ++ __ret = __wctype_l("alnum", _M_c_locale_ctype); ++ break; ++ case graph: ++ __ret = __wctype_l("graph", _M_c_locale_ctype); ++ break; ++ default: ++ __ret = __wmask_type(); ++ } ++ return __ret; ++ } ++ ++ wchar_t ++ ctype::do_toupper(wchar_t __c) const ++ { return __towupper_l(__c, _M_c_locale_ctype); } ++ ++ const wchar_t* ++ ctype::do_toupper(wchar_t* __lo, const wchar_t* __hi) const ++ { ++ while (__lo < __hi) ++ { ++ *__lo = __towupper_l(*__lo, _M_c_locale_ctype); ++ ++__lo; ++ } ++ return __hi; ++ } ++ ++ wchar_t ++ ctype::do_tolower(wchar_t __c) const ++ { return __towlower_l(__c, _M_c_locale_ctype); } ++ ++ const wchar_t* ++ ctype::do_tolower(wchar_t* __lo, const wchar_t* __hi) const ++ { ++ while (__lo < __hi) ++ { ++ *__lo = __towlower_l(*__lo, _M_c_locale_ctype); ++ ++__lo; ++ } ++ return __hi; ++ } ++ ++ bool ++ ctype:: ++ do_is(mask __m, wchar_t __c) const ++ { ++ // Highest bitmask in ctype_base == 10, but extra in "C" ++ // library for blank. ++ bool __ret = false; ++ const size_t __bitmasksize = 11; ++ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur) ++ if (__m & _M_bit[__bitcur] ++ && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype)) ++ { ++ __ret = true; ++ break; ++ } ++ return __ret; ++ } ++ ++ const wchar_t* ++ ctype:: ++ do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const ++ { ++ for (; __lo < __hi; ++__vec, ++__lo) ++ { ++ // Highest bitmask in ctype_base == 10, but extra in "C" ++ // library for blank. ++ const size_t __bitmasksize = 11; ++ mask __m = 0; ++ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur) ++ if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype)) ++ __m |= _M_bit[__bitcur]; ++ *__vec = __m; ++ } ++ return __hi; ++ } ++ ++ const wchar_t* ++ ctype:: ++ do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const ++ { ++ while (__lo < __hi && !this->do_is(__m, *__lo)) ++ ++__lo; ++ return __lo; ++ } ++ ++ const wchar_t* ++ ctype:: ++ do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const ++ { ++ while (__lo < __hi && this->do_is(__m, *__lo) != 0) ++ ++__lo; ++ return __lo; ++ } ++ ++ wchar_t ++ ctype:: ++ do_widen(char __c) const ++ { return _M_widen[static_cast(__c)]; } ++ ++ const char* ++ ctype:: ++ do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const ++ { ++ while (__lo < __hi) ++ { ++ *__dest = _M_widen[static_cast(*__lo)]; ++ ++__lo; ++ ++__dest; ++ } ++ return __hi; ++ } ++ ++ char ++ ctype:: ++ do_narrow(wchar_t __wc, char __dfault) const ++ { ++ if (__wc >= 0 && __wc < 128 && _M_narrow_ok) ++ return _M_narrow[__wc]; ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __c_locale __old = __uselocale(_M_c_locale_ctype); ++#endif ++ const int __c = wctob(__wc); ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __uselocale(__old); ++#endif ++ return (__c == EOF ? __dfault : static_cast(__c)); ++ } ++ ++ const wchar_t* ++ ctype:: ++ do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault, ++ char* __dest) const ++ { ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __c_locale __old = __uselocale(_M_c_locale_ctype); ++#endif ++ if (_M_narrow_ok) ++ while (__lo < __hi) ++ { ++ if (*__lo >= 0 && *__lo < 128) ++ *__dest = _M_narrow[*__lo]; ++ else ++ { ++ const int __c = wctob(*__lo); ++ *__dest = (__c == EOF ? __dfault : static_cast(__c)); ++ } ++ ++__lo; ++ ++__dest; ++ } ++ else ++ while (__lo < __hi) ++ { ++ const int __c = wctob(*__lo); ++ *__dest = (__c == EOF ? __dfault : static_cast(__c)); ++ ++__lo; ++ ++__dest; ++ } ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __uselocale(__old); ++#endif ++ return __hi; ++ } ++ ++ void ++ ctype::_M_initialize_ctype() ++ { ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __c_locale __old = __uselocale(_M_c_locale_ctype); ++#endif ++ wint_t __i; ++ for (__i = 0; __i < 128; ++__i) ++ { ++ const int __c = wctob(__i); ++ if (__c == EOF) ++ break; ++ else ++ _M_narrow[__i] = static_cast(__c); ++ } ++ if (__i == 128) ++ _M_narrow_ok = true; ++ else ++ _M_narrow_ok = false; ++ for (size_t __j = 0; ++ __j < sizeof(_M_widen) / sizeof(wint_t); ++__j) ++ _M_widen[__j] = btowc(__j); ++ ++ for (size_t __k = 0; __k <= 11; ++__k) ++ { ++ _M_bit[__k] = static_cast(_ISbit(__k)); ++ _M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]); ++ } ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __uselocale(__old); ++#endif ++ } ++#endif // _GLIBCXX_USE_WCHAR_T ++} +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.cc +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc 1970-01-01 01:00:00.000000000 +0100 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.cc 2008-06-10 14:58:39.000000000 +0200 +@@ -0,0 +1,100 @@ ++// std::messages implementation details, GNU version -*- C++ -*- ++ ++// Copyright (C) 2001, 2002 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library is free ++// software; you can redistribute it and/or modify it under the ++// terms of the GNU General Public License as published by the ++// Free Software Foundation; either version 2, or (at your option) ++// any later version. ++ ++// This 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 General Public License for more details. ++ ++// You should have received a copy of the GNU General Public License along ++// with this library; see the file COPYING. If not, write to the Free ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, ++// USA. ++ ++// As a special exception, you may use this file as part of a free software ++// library without restriction. Specifically, if other files instantiate ++// templates or use macros or inline functions from this file, or you compile ++// this file and link it with other files to produce an executable, this ++// file does not by itself cause the resulting executable to be covered by ++// the GNU General Public License. This exception does not however ++// invalidate any other reasons why the executable file might be covered by ++// the GNU General Public License. ++ ++// ++// ISO C++ 14882: 22.2.7.1.2 messages virtual functions ++// ++ ++// Written by Benjamin Kosnik ++ ++#include ++#include ++ ++#ifdef __UCLIBC_MJN3_ONLY__ ++#warning fix gettext stuff ++#endif ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ ++extern "C" char *__dcgettext(const char *domainname, ++ const char *msgid, int category); ++#undef gettext ++#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES) ++#else ++#undef gettext ++#define gettext(msgid) (msgid) ++#endif ++ ++namespace std ++{ ++ // Specializations. ++ template<> ++ string ++ messages::do_get(catalog, int, int, const string& __dfault) const ++ { ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __c_locale __old = __uselocale(_M_c_locale_messages); ++ const char* __msg = const_cast(gettext(__dfault.c_str())); ++ __uselocale(__old); ++ return string(__msg); ++#elif defined __UCLIBC_HAS_LOCALE__ ++ char* __old = strdup(setlocale(LC_ALL, NULL)); ++ setlocale(LC_ALL, _M_name_messages); ++ const char* __msg = gettext(__dfault.c_str()); ++ setlocale(LC_ALL, __old); ++ free(__old); ++ return string(__msg); ++#else ++ const char* __msg = gettext(__dfault.c_str()); ++ return string(__msg); ++#endif ++ } ++ ++#ifdef _GLIBCXX_USE_WCHAR_T ++ template<> ++ wstring ++ messages::do_get(catalog, int, int, const wstring& __dfault) const ++ { ++# ifdef __UCLIBC_HAS_XLOCALE__ ++ __c_locale __old = __uselocale(_M_c_locale_messages); ++ char* __msg = gettext(_M_convert_to_char(__dfault)); ++ __uselocale(__old); ++ return _M_convert_from_char(__msg); ++# elif defined __UCLIBC_HAS_LOCALE__ ++ char* __old = strdup(setlocale(LC_ALL, NULL)); ++ setlocale(LC_ALL, _M_name_messages); ++ char* __msg = gettext(_M_convert_to_char(__dfault)); ++ setlocale(LC_ALL, __old); ++ free(__old); ++ return _M_convert_from_char(__msg); ++# else ++ char* __msg = gettext(_M_convert_to_char(__dfault)); ++ return _M_convert_from_char(__msg); ++# endif ++ } ++#endif ++} +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h 1970-01-01 01:00:00.000000000 +0100 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:58:39.000000000 +0200 +@@ -0,0 +1,118 @@ ++// std::messages implementation details, GNU version -*- C++ -*- ++ ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library is free ++// software; you can redistribute it and/or modify it under the ++// terms of the GNU General Public License as published by the ++// Free Software Foundation; either version 2, or (at your option) ++// any later version. ++ ++// This 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 General Public License for more details. ++ ++// You should have received a copy of the GNU General Public License along ++// with this library; see the file COPYING. If not, write to the Free ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, ++// USA. ++ ++// As a special exception, you may use this file as part of a free software ++// library without restriction. Specifically, if other files instantiate ++// templates or use macros or inline functions from this file, or you compile ++// this file and link it with other files to produce an executable, this ++// file does not by itself cause the resulting executable to be covered by ++// the GNU General Public License. This exception does not however ++// invalidate any other reasons why the executable file might be covered by ++// the GNU General Public License. ++ ++// ++// ISO C++ 14882: 22.2.7.1.2 messages functions ++// ++ ++// Written by Benjamin Kosnik ++ ++#ifdef __UCLIBC_MJN3_ONLY__ ++#warning fix prototypes for *textdomain funcs ++#endif ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ ++extern "C" char *__textdomain(const char *domainname); ++extern "C" char *__bindtextdomain(const char *domainname, ++ const char *dirname); ++#else ++#undef __textdomain ++#undef __bindtextdomain ++#define __textdomain(D) ((void)0) ++#define __bindtextdomain(D,P) ((void)0) ++#endif ++ ++ // Non-virtual member functions. ++ template ++ messages<_CharT>::messages(size_t __refs) ++ : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), ++ _M_name_messages(_S_get_c_name()) ++ { } ++ ++ template ++ messages<_CharT>::messages(__c_locale __cloc, const char* __s, ++ size_t __refs) ++ : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)), ++ _M_name_messages(__s) ++ { ++ char* __tmp = new char[std::strlen(__s) + 1]; ++ std::strcpy(__tmp, __s); ++ _M_name_messages = __tmp; ++ } ++ ++ template ++ typename messages<_CharT>::catalog ++ messages<_CharT>::open(const basic_string& __s, const locale& __loc, ++ const char* __dir) const ++ { ++ __bindtextdomain(__s.c_str(), __dir); ++ return this->do_open(__s, __loc); ++ } ++ ++ // Virtual member functions. ++ template ++ messages<_CharT>::~messages() ++ { ++ if (_M_name_messages != _S_get_c_name()) ++ delete [] _M_name_messages; ++ _S_destroy_c_locale(_M_c_locale_messages); ++ } ++ ++ template ++ typename messages<_CharT>::catalog ++ messages<_CharT>::do_open(const basic_string& __s, ++ const locale&) const ++ { ++ // No error checking is done, assume the catalog exists and can ++ // be used. ++ __textdomain(__s.c_str()); ++ return 0; ++ } ++ ++ template ++ void ++ messages<_CharT>::do_close(catalog) const ++ { } ++ ++ // messages_byname ++ template ++ messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs) ++ : messages<_CharT>(__refs) ++ { ++ if (this->_M_name_messages != locale::facet::_S_get_c_name()) ++ delete [] this->_M_name_messages; ++ char* __tmp = new char[std::strlen(__s) + 1]; ++ std::strcpy(__tmp, __s); ++ this->_M_name_messages = __tmp; ++ ++ if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0) ++ { ++ this->_S_destroy_c_locale(this->_M_c_locale_messages); ++ this->_S_create_c_locale(this->_M_c_locale_messages, __s); ++ } ++ } +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc 1970-01-01 01:00:00.000000000 +0100 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:58:39.000000000 +0200 +@@ -0,0 +1,692 @@ ++// std::moneypunct implementation details, GNU version -*- C++ -*- ++ ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library is free ++// software; you can redistribute it and/or modify it under the ++// terms of the GNU General Public License as published by the ++// Free Software Foundation; either version 2, or (at your option) ++// any later version. ++ ++// This 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 General Public License for more details. ++ ++// You should have received a copy of the GNU General Public License along ++// with this library; see the file COPYING. If not, write to the Free ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, ++// USA. ++ ++// As a special exception, you may use this file as part of a free software ++// library without restriction. Specifically, if other files instantiate ++// templates or use macros or inline functions from this file, or you compile ++// this file and link it with other files to produce an executable, this ++// file does not by itself cause the resulting executable to be covered by ++// the GNU General Public License. This exception does not however ++// invalidate any other reasons why the executable file might be covered by ++// the GNU General Public License. ++ ++// ++// ISO C++ 14882: 22.2.6.3.2 moneypunct virtual functions ++// ++ ++// Written by Benjamin Kosnik ++ ++#define _LIBC ++#include ++#undef _LIBC ++#include ++ ++#ifdef __UCLIBC_MJN3_ONLY__ ++#warning optimize this for uclibc ++#warning tailor for stub locale support ++#endif ++ ++#ifndef __UCLIBC_HAS_XLOCALE__ ++#define __nl_langinfo_l(N, L) nl_langinfo((N)) ++#endif ++ ++namespace std ++{ ++ // Construct and return valid pattern consisting of some combination of: ++ // space none symbol sign value ++ money_base::pattern ++ money_base::_S_construct_pattern(char __precedes, char __space, char __posn) ++ { ++ pattern __ret; ++ ++ // This insanely complicated routine attempts to construct a valid ++ // pattern for use with monyepunct. A couple of invariants: ++ ++ // if (__precedes) symbol -> value ++ // else value -> symbol ++ ++ // if (__space) space ++ // else none ++ ++ // none == never first ++ // space never first or last ++ ++ // Any elegant implementations of this are welcome. ++ switch (__posn) ++ { ++ case 0: ++ case 1: ++ // 1 The sign precedes the value and symbol. ++ __ret.field[0] = sign; ++ if (__space) ++ { ++ // Pattern starts with sign. ++ if (__precedes) ++ { ++ __ret.field[1] = symbol; ++ __ret.field[3] = value; ++ } ++ else ++ { ++ __ret.field[1] = value; ++ __ret.field[3] = symbol; ++ } ++ __ret.field[2] = space; ++ } ++ else ++ { ++ // Pattern starts with sign and ends with none. ++ if (__precedes) ++ { ++ __ret.field[1] = symbol; ++ __ret.field[2] = value; ++ } ++ else ++ { ++ __ret.field[1] = value; ++ __ret.field[2] = symbol; ++ } ++ __ret.field[3] = none; ++ } ++ break; ++ case 2: ++ // 2 The sign follows the value and symbol. ++ if (__space) ++ { ++ // Pattern either ends with sign. ++ if (__precedes) ++ { ++ __ret.field[0] = symbol; ++ __ret.field[2] = value; ++ } ++ else ++ { ++ __ret.field[0] = value; ++ __ret.field[2] = symbol; ++ } ++ __ret.field[1] = space; ++ __ret.field[3] = sign; ++ } ++ else ++ { ++ // Pattern ends with sign then none. ++ if (__precedes) ++ { ++ __ret.field[0] = symbol; ++ __ret.field[1] = value; ++ } ++ else ++ { ++ __ret.field[0] = value; ++ __ret.field[1] = symbol; ++ } ++ __ret.field[2] = sign; ++ __ret.field[3] = none; ++ } ++ break; ++ case 3: ++ // 3 The sign immediately precedes the symbol. ++ if (__precedes) ++ { ++ __ret.field[0] = sign; ++ __ret.field[1] = symbol; ++ if (__space) ++ { ++ __ret.field[2] = space; ++ __ret.field[3] = value; ++ } ++ else ++ { ++ __ret.field[2] = value; ++ __ret.field[3] = none; ++ } ++ } ++ else ++ { ++ __ret.field[0] = value; ++ if (__space) ++ { ++ __ret.field[1] = space; ++ __ret.field[2] = sign; ++ __ret.field[3] = symbol; ++ } ++ else ++ { ++ __ret.field[1] = sign; ++ __ret.field[2] = symbol; ++ __ret.field[3] = none; ++ } ++ } ++ break; ++ case 4: ++ // 4 The sign immediately follows the symbol. ++ if (__precedes) ++ { ++ __ret.field[0] = symbol; ++ __ret.field[1] = sign; ++ if (__space) ++ { ++ __ret.field[2] = space; ++ __ret.field[3] = value; ++ } ++ else ++ { ++ __ret.field[2] = value; ++ __ret.field[3] = none; ++ } ++ } ++ else ++ { ++ __ret.field[0] = value; ++ if (__space) ++ { ++ __ret.field[1] = space; ++ __ret.field[2] = symbol; ++ __ret.field[3] = sign; ++ } ++ else ++ { ++ __ret.field[1] = symbol; ++ __ret.field[2] = sign; ++ __ret.field[3] = none; ++ } ++ } ++ break; ++ default: ++ ; ++ } ++ return __ret; ++ } ++ ++ template<> ++ void ++ moneypunct::_M_initialize_moneypunct(__c_locale __cloc, ++ const char*) ++ { ++ if (!_M_data) ++ _M_data = new __moneypunct_cache; ++ ++ if (!__cloc) ++ { ++ // "C" locale ++ _M_data->_M_decimal_point = '.'; ++ _M_data->_M_thousands_sep = ','; ++ _M_data->_M_grouping = ""; ++ _M_data->_M_grouping_size = 0; ++ _M_data->_M_curr_symbol = ""; ++ _M_data->_M_curr_symbol_size = 0; ++ _M_data->_M_positive_sign = ""; ++ _M_data->_M_positive_sign_size = 0; ++ _M_data->_M_negative_sign = ""; ++ _M_data->_M_negative_sign_size = 0; ++ _M_data->_M_frac_digits = 0; ++ _M_data->_M_pos_format = money_base::_S_default_pattern; ++ _M_data->_M_neg_format = money_base::_S_default_pattern; ++ ++ for (size_t __i = 0; __i < money_base::_S_end; ++__i) ++ _M_data->_M_atoms[__i] = money_base::_S_atoms[__i]; ++ } ++ else ++ { ++ // Named locale. ++ _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, ++ __cloc)); ++ _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, ++ __cloc)); ++ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc); ++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); ++ _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc); ++ _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign); ++ ++ char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc)); ++ if (!__nposn) ++ _M_data->_M_negative_sign = "()"; ++ else ++ _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, ++ __cloc); ++ _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign); ++ ++ // _Intl == true ++ _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc); ++ _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol); ++ _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, ++ __cloc)); ++ char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc)); ++ char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc)); ++ char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc)); ++ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, ++ __pposn); ++ char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc)); ++ char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc)); ++ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, ++ __nposn); ++ } ++ } ++ ++ template<> ++ void ++ moneypunct::_M_initialize_moneypunct(__c_locale __cloc, ++ const char*) ++ { ++ if (!_M_data) ++ _M_data = new __moneypunct_cache; ++ ++ if (!__cloc) ++ { ++ // "C" locale ++ _M_data->_M_decimal_point = '.'; ++ _M_data->_M_thousands_sep = ','; ++ _M_data->_M_grouping = ""; ++ _M_data->_M_grouping_size = 0; ++ _M_data->_M_curr_symbol = ""; ++ _M_data->_M_curr_symbol_size = 0; ++ _M_data->_M_positive_sign = ""; ++ _M_data->_M_positive_sign_size = 0; ++ _M_data->_M_negative_sign = ""; ++ _M_data->_M_negative_sign_size = 0; ++ _M_data->_M_frac_digits = 0; ++ _M_data->_M_pos_format = money_base::_S_default_pattern; ++ _M_data->_M_neg_format = money_base::_S_default_pattern; ++ ++ for (size_t __i = 0; __i < money_base::_S_end; ++__i) ++ _M_data->_M_atoms[__i] = money_base::_S_atoms[__i]; ++ } ++ else ++ { ++ // Named locale. ++ _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, ++ __cloc)); ++ _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, ++ __cloc)); ++ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc); ++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); ++ _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc); ++ _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign); ++ ++ char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc)); ++ if (!__nposn) ++ _M_data->_M_negative_sign = "()"; ++ else ++ _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, ++ __cloc); ++ _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign); ++ ++ // _Intl == false ++ _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc); ++ _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol); ++ _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc)); ++ char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc)); ++ char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc)); ++ char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc)); ++ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, ++ __pposn); ++ char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc)); ++ char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc)); ++ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, ++ __nposn); ++ } ++ } ++ ++ template<> ++ moneypunct::~moneypunct() ++ { delete _M_data; } ++ ++ template<> ++ moneypunct::~moneypunct() ++ { delete _M_data; } ++ ++#ifdef _GLIBCXX_USE_WCHAR_T ++ template<> ++ void ++ moneypunct::_M_initialize_moneypunct(__c_locale __cloc, ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ const char*) ++#else ++ const char* __name) ++#endif ++ { ++ if (!_M_data) ++ _M_data = new __moneypunct_cache; ++ ++ if (!__cloc) ++ { ++ // "C" locale ++ _M_data->_M_decimal_point = L'.'; ++ _M_data->_M_thousands_sep = L','; ++ _M_data->_M_grouping = ""; ++ _M_data->_M_grouping_size = 0; ++ _M_data->_M_curr_symbol = L""; ++ _M_data->_M_curr_symbol_size = 0; ++ _M_data->_M_positive_sign = L""; ++ _M_data->_M_positive_sign_size = 0; ++ _M_data->_M_negative_sign = L""; ++ _M_data->_M_negative_sign_size = 0; ++ _M_data->_M_frac_digits = 0; ++ _M_data->_M_pos_format = money_base::_S_default_pattern; ++ _M_data->_M_neg_format = money_base::_S_default_pattern; ++ ++ // Use ctype::widen code without the facet... ++ for (size_t __i = 0; __i < money_base::_S_end; ++__i) ++ _M_data->_M_atoms[__i] = ++ static_cast(money_base::_S_atoms[__i]); ++ } ++ else ++ { ++ // Named locale. ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __c_locale __old = __uselocale(__cloc); ++#else ++ // Switch to named locale so that mbsrtowcs will work. ++ char* __old = strdup(setlocale(LC_ALL, NULL)); ++ setlocale(LC_ALL, __name); ++#endif ++ ++#ifdef __UCLIBC_MJN3_ONLY__ ++#warning fix this... should be monetary ++#endif ++#ifdef __UCLIBC__ ++# ifdef __UCLIBC_HAS_XLOCALE__ ++ _M_data->_M_decimal_point = __cloc->decimal_point_wc; ++ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc; ++# else ++ _M_data->_M_decimal_point = __global_locale->decimal_point_wc; ++ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc; ++# endif ++#else ++ union { char *__s; wchar_t __w; } __u; ++ __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc); ++ _M_data->_M_decimal_point = __u.__w; ++ ++ __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc); ++ _M_data->_M_thousands_sep = __u.__w; ++#endif ++ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc); ++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); ++ ++ const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc); ++ const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc); ++ const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc); ++ ++ wchar_t* __wcs_ps = 0; ++ wchar_t* __wcs_ns = 0; ++ const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc)); ++ try ++ { ++ mbstate_t __state; ++ size_t __len = strlen(__cpossign); ++ if (__len) ++ { ++ ++__len; ++ memset(&__state, 0, sizeof(mbstate_t)); ++ __wcs_ps = new wchar_t[__len]; ++ mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state); ++ _M_data->_M_positive_sign = __wcs_ps; ++ } ++ else ++ _M_data->_M_positive_sign = L""; ++ _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign); ++ ++ __len = strlen(__cnegsign); ++ if (!__nposn) ++ _M_data->_M_negative_sign = L"()"; ++ else if (__len) ++ { ++ ++__len; ++ memset(&__state, 0, sizeof(mbstate_t)); ++ __wcs_ns = new wchar_t[__len]; ++ mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state); ++ _M_data->_M_negative_sign = __wcs_ns; ++ } ++ else ++ _M_data->_M_negative_sign = L""; ++ _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign); ++ ++ // _Intl == true. ++ __len = strlen(__ccurr); ++ if (__len) ++ { ++ ++__len; ++ memset(&__state, 0, sizeof(mbstate_t)); ++ wchar_t* __wcs = new wchar_t[__len]; ++ mbsrtowcs(__wcs, &__ccurr, __len, &__state); ++ _M_data->_M_curr_symbol = __wcs; ++ } ++ else ++ _M_data->_M_curr_symbol = L""; ++ _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol); ++ } ++ catch (...) ++ { ++ delete _M_data; ++ _M_data = 0; ++ delete __wcs_ps; ++ delete __wcs_ns; ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __uselocale(__old); ++#else ++ setlocale(LC_ALL, __old); ++ free(__old); ++#endif ++ __throw_exception_again; ++ } ++ ++ _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, ++ __cloc)); ++ char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc)); ++ char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc)); ++ char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc)); ++ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, ++ __pposn); ++ char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc)); ++ char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc)); ++ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, ++ __nposn); ++ ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __uselocale(__old); ++#else ++ setlocale(LC_ALL, __old); ++ free(__old); ++#endif ++ } ++ } ++ ++ template<> ++ void ++ moneypunct::_M_initialize_moneypunct(__c_locale __cloc, ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ const char*) ++#else ++ const char* __name) ++#endif ++ { ++ if (!_M_data) ++ _M_data = new __moneypunct_cache; ++ ++ if (!__cloc) ++ { ++ // "C" locale ++ _M_data->_M_decimal_point = L'.'; ++ _M_data->_M_thousands_sep = L','; ++ _M_data->_M_grouping = ""; ++ _M_data->_M_grouping_size = 0; ++ _M_data->_M_curr_symbol = L""; ++ _M_data->_M_curr_symbol_size = 0; ++ _M_data->_M_positive_sign = L""; ++ _M_data->_M_positive_sign_size = 0; ++ _M_data->_M_negative_sign = L""; ++ _M_data->_M_negative_sign_size = 0; ++ _M_data->_M_frac_digits = 0; ++ _M_data->_M_pos_format = money_base::_S_default_pattern; ++ _M_data->_M_neg_format = money_base::_S_default_pattern; ++ ++ // Use ctype::widen code without the facet... ++ for (size_t __i = 0; __i < money_base::_S_end; ++__i) ++ _M_data->_M_atoms[__i] = ++ static_cast(money_base::_S_atoms[__i]); ++ } ++ else ++ { ++ // Named locale. ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __c_locale __old = __uselocale(__cloc); ++#else ++ // Switch to named locale so that mbsrtowcs will work. ++ char* __old = strdup(setlocale(LC_ALL, NULL)); ++ setlocale(LC_ALL, __name); ++#endif ++ ++#ifdef __UCLIBC_MJN3_ONLY__ ++#warning fix this... should be monetary ++#endif ++#ifdef __UCLIBC__ ++# ifdef __UCLIBC_HAS_XLOCALE__ ++ _M_data->_M_decimal_point = __cloc->decimal_point_wc; ++ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc; ++# else ++ _M_data->_M_decimal_point = __global_locale->decimal_point_wc; ++ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc; ++# endif ++#else ++ union { char *__s; wchar_t __w; } __u; ++ __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc); ++ _M_data->_M_decimal_point = __u.__w; ++ ++ __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc); ++ _M_data->_M_thousands_sep = __u.__w; ++#endif ++ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc); ++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); ++ ++ const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc); ++ const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc); ++ const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc); ++ ++ wchar_t* __wcs_ps = 0; ++ wchar_t* __wcs_ns = 0; ++ const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc)); ++ try ++ { ++ mbstate_t __state; ++ size_t __len; ++ __len = strlen(__cpossign); ++ if (__len) ++ { ++ ++__len; ++ memset(&__state, 0, sizeof(mbstate_t)); ++ __wcs_ps = new wchar_t[__len]; ++ mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state); ++ _M_data->_M_positive_sign = __wcs_ps; ++ } ++ else ++ _M_data->_M_positive_sign = L""; ++ _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign); ++ ++ __len = strlen(__cnegsign); ++ if (!__nposn) ++ _M_data->_M_negative_sign = L"()"; ++ else if (__len) ++ { ++ ++__len; ++ memset(&__state, 0, sizeof(mbstate_t)); ++ __wcs_ns = new wchar_t[__len]; ++ mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state); ++ _M_data->_M_negative_sign = __wcs_ns; ++ } ++ else ++ _M_data->_M_negative_sign = L""; ++ _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign); ++ ++ // _Intl == true. ++ __len = strlen(__ccurr); ++ if (__len) ++ { ++ ++__len; ++ memset(&__state, 0, sizeof(mbstate_t)); ++ wchar_t* __wcs = new wchar_t[__len]; ++ mbsrtowcs(__wcs, &__ccurr, __len, &__state); ++ _M_data->_M_curr_symbol = __wcs; ++ } ++ else ++ _M_data->_M_curr_symbol = L""; ++ _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol); ++ } ++ catch (...) ++ { ++ delete _M_data; ++ _M_data = 0; ++ delete __wcs_ps; ++ delete __wcs_ns; ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __uselocale(__old); ++#else ++ setlocale(LC_ALL, __old); ++ free(__old); ++#endif ++ __throw_exception_again; ++ } ++ ++ _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc)); ++ char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc)); ++ char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc)); ++ char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc)); ++ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, ++ __pposn); ++ char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc)); ++ char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc)); ++ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, ++ __nposn); ++ ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __uselocale(__old); ++#else ++ setlocale(LC_ALL, __old); ++ free(__old); ++#endif ++ } ++ } ++ ++ template<> ++ moneypunct::~moneypunct() ++ { ++ if (_M_data->_M_positive_sign_size) ++ delete [] _M_data->_M_positive_sign; ++ if (_M_data->_M_negative_sign_size ++ && wcscmp(_M_data->_M_negative_sign, L"()") != 0) ++ delete [] _M_data->_M_negative_sign; ++ if (_M_data->_M_curr_symbol_size) ++ delete [] _M_data->_M_curr_symbol; ++ delete _M_data; ++ } ++ ++ template<> ++ moneypunct::~moneypunct() ++ { ++ if (_M_data->_M_positive_sign_size) ++ delete [] _M_data->_M_positive_sign; ++ if (_M_data->_M_negative_sign_size ++ && wcscmp(_M_data->_M_negative_sign, L"()") != 0) ++ delete [] _M_data->_M_negative_sign; ++ if (_M_data->_M_curr_symbol_size) ++ delete [] _M_data->_M_curr_symbol; ++ delete _M_data; ++ } ++#endif ++} +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc 1970-01-01 01:00:00.000000000 +0100 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:58:39.000000000 +0200 +@@ -0,0 +1,160 @@ ++// std::numpunct implementation details, GNU version -*- C++ -*- ++ ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library is free ++// software; you can redistribute it and/or modify it under the ++// terms of the GNU General Public License as published by the ++// Free Software Foundation; either version 2, or (at your option) ++// any later version. ++ ++// This 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 General Public License for more details. ++ ++// You should have received a copy of the GNU General Public License along ++// with this library; see the file COPYING. If not, write to the Free ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, ++// USA. ++ ++// As a special exception, you may use this file as part of a free software ++// library without restriction. Specifically, if other files instantiate ++// templates or use macros or inline functions from this file, or you compile ++// this file and link it with other files to produce an executable, this ++// file does not by itself cause the resulting executable to be covered by ++// the GNU General Public License. This exception does not however ++// invalidate any other reasons why the executable file might be covered by ++// the GNU General Public License. ++ ++// ++// ISO C++ 14882: 22.2.3.1.2 numpunct virtual functions ++// ++ ++// Written by Benjamin Kosnik ++ ++#define _LIBC ++#include ++#undef _LIBC ++#include ++ ++#ifdef __UCLIBC_MJN3_ONLY__ ++#warning tailor for stub locale support ++#endif ++#ifndef __UCLIBC_HAS_XLOCALE__ ++#define __nl_langinfo_l(N, L) nl_langinfo((N)) ++#endif ++ ++namespace std ++{ ++ template<> ++ void ++ numpunct::_M_initialize_numpunct(__c_locale __cloc) ++ { ++ if (!_M_data) ++ _M_data = new __numpunct_cache; ++ ++ if (!__cloc) ++ { ++ // "C" locale ++ _M_data->_M_grouping = ""; ++ _M_data->_M_grouping_size = 0; ++ _M_data->_M_use_grouping = false; ++ ++ _M_data->_M_decimal_point = '.'; ++ _M_data->_M_thousands_sep = ','; ++ ++ for (size_t __i = 0; __i < __num_base::_S_oend; ++__i) ++ _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i]; ++ ++ for (size_t __j = 0; __j < __num_base::_S_iend; ++__j) ++ _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j]; ++ } ++ else ++ { ++ // Named locale. ++ _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT, ++ __cloc)); ++ _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP, ++ __cloc)); ++ ++ // Check for NULL, which implies no grouping. ++ if (_M_data->_M_thousands_sep == '\0') ++ _M_data->_M_grouping = ""; ++ else ++ _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc); ++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); ++ } ++ ++ // NB: There is no way to extact this info from posix locales. ++ // _M_truename = __nl_langinfo_l(YESSTR, __cloc); ++ _M_data->_M_truename = "true"; ++ _M_data->_M_truename_size = 4; ++ // _M_falsename = __nl_langinfo_l(NOSTR, __cloc); ++ _M_data->_M_falsename = "false"; ++ _M_data->_M_falsename_size = 5; ++ } ++ ++ template<> ++ numpunct::~numpunct() ++ { delete _M_data; } ++ ++#ifdef _GLIBCXX_USE_WCHAR_T ++ template<> ++ void ++ numpunct::_M_initialize_numpunct(__c_locale __cloc) ++ { ++ if (!_M_data) ++ _M_data = new __numpunct_cache; ++ ++ if (!__cloc) ++ { ++ // "C" locale ++ _M_data->_M_grouping = ""; ++ _M_data->_M_grouping_size = 0; ++ _M_data->_M_use_grouping = false; ++ ++ _M_data->_M_decimal_point = L'.'; ++ _M_data->_M_thousands_sep = L','; ++ ++ // Use ctype::widen code without the facet... ++ for (size_t __i = 0; __i < __num_base::_S_oend; ++__i) ++ _M_data->_M_atoms_out[__i] = ++ static_cast(__num_base::_S_atoms_out[__i]); ++ ++ for (size_t __j = 0; __j < __num_base::_S_iend; ++__j) ++ _M_data->_M_atoms_in[__j] = ++ static_cast(__num_base::_S_atoms_in[__j]); ++ } ++ else ++ { ++ // Named locale. ++ // NB: In the GNU model wchar_t is always 32 bit wide. ++ union { char *__s; wchar_t __w; } __u; ++ __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc); ++ _M_data->_M_decimal_point = __u.__w; ++ ++ __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc); ++ _M_data->_M_thousands_sep = __u.__w; ++ ++ if (_M_data->_M_thousands_sep == L'\0') ++ _M_data->_M_grouping = ""; ++ else ++ _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc); ++ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); ++ } ++ ++ // NB: There is no way to extact this info from posix locales. ++ // _M_truename = __nl_langinfo_l(YESSTR, __cloc); ++ _M_data->_M_truename = L"true"; ++ _M_data->_M_truename_size = 4; ++ // _M_falsename = __nl_langinfo_l(NOSTR, __cloc); ++ _M_data->_M_falsename = L"false"; ++ _M_data->_M_falsename_size = 5; ++ } ++ ++ template<> ++ numpunct::~numpunct() ++ { delete _M_data; } ++ #endif ++} +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.cc +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc 1970-01-01 01:00:00.000000000 +0100 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.cc 2008-06-10 14:58:39.000000000 +0200 +@@ -0,0 +1,406 @@ ++// std::time_get, std::time_put implementation, GNU version -*- C++ -*- ++ ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library is free ++// software; you can redistribute it and/or modify it under the ++// terms of the GNU General Public License as published by the ++// Free Software Foundation; either version 2, or (at your option) ++// any later version. ++ ++// This 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 General Public License for more details. ++ ++// You should have received a copy of the GNU General Public License along ++// with this library; see the file COPYING. If not, write to the Free ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, ++// USA. ++ ++// As a special exception, you may use this file as part of a free software ++// library without restriction. Specifically, if other files instantiate ++// templates or use macros or inline functions from this file, or you compile ++// this file and link it with other files to produce an executable, this ++// file does not by itself cause the resulting executable to be covered by ++// the GNU General Public License. This exception does not however ++// invalidate any other reasons why the executable file might be covered by ++// the GNU General Public License. ++ ++// ++// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions ++// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions ++// ++ ++// Written by Benjamin Kosnik ++ ++#include ++#include ++ ++#ifdef __UCLIBC_MJN3_ONLY__ ++#warning tailor for stub locale support ++#endif ++#ifndef __UCLIBC_HAS_XLOCALE__ ++#define __nl_langinfo_l(N, L) nl_langinfo((N)) ++#endif ++ ++namespace std ++{ ++ template<> ++ void ++ __timepunct:: ++ _M_put(char* __s, size_t __maxlen, const char* __format, ++ const tm* __tm) const ++ { ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ const size_t __len = __strftime_l(__s, __maxlen, __format, __tm, ++ _M_c_locale_timepunct); ++#else ++ char* __old = strdup(setlocale(LC_ALL, NULL)); ++ setlocale(LC_ALL, _M_name_timepunct); ++ const size_t __len = strftime(__s, __maxlen, __format, __tm); ++ setlocale(LC_ALL, __old); ++ free(__old); ++#endif ++ // Make sure __s is null terminated. ++ if (__len == 0) ++ __s[0] = '\0'; ++ } ++ ++ template<> ++ void ++ __timepunct::_M_initialize_timepunct(__c_locale __cloc) ++ { ++ if (!_M_data) ++ _M_data = new __timepunct_cache; ++ ++ if (!__cloc) ++ { ++ // "C" locale ++ _M_c_locale_timepunct = _S_get_c_locale(); ++ ++ _M_data->_M_date_format = "%m/%d/%y"; ++ _M_data->_M_date_era_format = "%m/%d/%y"; ++ _M_data->_M_time_format = "%H:%M:%S"; ++ _M_data->_M_time_era_format = "%H:%M:%S"; ++ _M_data->_M_date_time_format = ""; ++ _M_data->_M_date_time_era_format = ""; ++ _M_data->_M_am = "AM"; ++ _M_data->_M_pm = "PM"; ++ _M_data->_M_am_pm_format = ""; ++ ++ // Day names, starting with "C"'s Sunday. ++ _M_data->_M_day1 = "Sunday"; ++ _M_data->_M_day2 = "Monday"; ++ _M_data->_M_day3 = "Tuesday"; ++ _M_data->_M_day4 = "Wednesday"; ++ _M_data->_M_day5 = "Thursday"; ++ _M_data->_M_day6 = "Friday"; ++ _M_data->_M_day7 = "Saturday"; ++ ++ // Abbreviated day names, starting with "C"'s Sun. ++ _M_data->_M_aday1 = "Sun"; ++ _M_data->_M_aday2 = "Mon"; ++ _M_data->_M_aday3 = "Tue"; ++ _M_data->_M_aday4 = "Wed"; ++ _M_data->_M_aday5 = "Thu"; ++ _M_data->_M_aday6 = "Fri"; ++ _M_data->_M_aday7 = "Sat"; ++ ++ // Month names, starting with "C"'s January. ++ _M_data->_M_month01 = "January"; ++ _M_data->_M_month02 = "February"; ++ _M_data->_M_month03 = "March"; ++ _M_data->_M_month04 = "April"; ++ _M_data->_M_month05 = "May"; ++ _M_data->_M_month06 = "June"; ++ _M_data->_M_month07 = "July"; ++ _M_data->_M_month08 = "August"; ++ _M_data->_M_month09 = "September"; ++ _M_data->_M_month10 = "October"; ++ _M_data->_M_month11 = "November"; ++ _M_data->_M_month12 = "December"; ++ ++ // Abbreviated month names, starting with "C"'s Jan. ++ _M_data->_M_amonth01 = "Jan"; ++ _M_data->_M_amonth02 = "Feb"; ++ _M_data->_M_amonth03 = "Mar"; ++ _M_data->_M_amonth04 = "Apr"; ++ _M_data->_M_amonth05 = "May"; ++ _M_data->_M_amonth06 = "Jun"; ++ _M_data->_M_amonth07 = "Jul"; ++ _M_data->_M_amonth08 = "Aug"; ++ _M_data->_M_amonth09 = "Sep"; ++ _M_data->_M_amonth10 = "Oct"; ++ _M_data->_M_amonth11 = "Nov"; ++ _M_data->_M_amonth12 = "Dec"; ++ } ++ else ++ { ++ _M_c_locale_timepunct = _S_clone_c_locale(__cloc); ++ ++ _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc); ++ _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc); ++ _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc); ++ _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc); ++ _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc); ++ _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT, ++ __cloc); ++ _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc); ++ _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc); ++ _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc); ++ ++ // Day names, starting with "C"'s Sunday. ++ _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc); ++ _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc); ++ _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc); ++ _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc); ++ _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc); ++ _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc); ++ _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc); ++ ++ // Abbreviated day names, starting with "C"'s Sun. ++ _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc); ++ _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc); ++ _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc); ++ _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc); ++ _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc); ++ _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc); ++ _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc); ++ ++ // Month names, starting with "C"'s January. ++ _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc); ++ _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc); ++ _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc); ++ _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc); ++ _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc); ++ _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc); ++ _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc); ++ _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc); ++ _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc); ++ _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc); ++ _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc); ++ _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc); ++ ++ // Abbreviated month names, starting with "C"'s Jan. ++ _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc); ++ _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc); ++ _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc); ++ _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc); ++ _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc); ++ _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc); ++ _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc); ++ _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc); ++ _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc); ++ _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc); ++ _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc); ++ _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc); ++ } ++ } ++ ++#ifdef _GLIBCXX_USE_WCHAR_T ++ template<> ++ void ++ __timepunct:: ++ _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format, ++ const tm* __tm) const ++ { ++#ifdef __UCLIBC_HAS_XLOCALE__ ++ __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct); ++ const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm, ++ _M_c_locale_timepunct); ++#else ++ char* __old = strdup(setlocale(LC_ALL, NULL)); ++ setlocale(LC_ALL, _M_name_timepunct); ++ const size_t __len = wcsftime(__s, __maxlen, __format, __tm); ++ setlocale(LC_ALL, __old); ++ free(__old); ++#endif ++ // Make sure __s is null terminated. ++ if (__len == 0) ++ __s[0] = L'\0'; ++ } ++ ++ template<> ++ void ++ __timepunct::_M_initialize_timepunct(__c_locale __cloc) ++ { ++ if (!_M_data) ++ _M_data = new __timepunct_cache; ++ ++#warning wide time stuff ++// if (!__cloc) ++ { ++ // "C" locale ++ _M_c_locale_timepunct = _S_get_c_locale(); ++ ++ _M_data->_M_date_format = L"%m/%d/%y"; ++ _M_data->_M_date_era_format = L"%m/%d/%y"; ++ _M_data->_M_time_format = L"%H:%M:%S"; ++ _M_data->_M_time_era_format = L"%H:%M:%S"; ++ _M_data->_M_date_time_format = L""; ++ _M_data->_M_date_time_era_format = L""; ++ _M_data->_M_am = L"AM"; ++ _M_data->_M_pm = L"PM"; ++ _M_data->_M_am_pm_format = L""; ++ ++ // Day names, starting with "C"'s Sunday. ++ _M_data->_M_day1 = L"Sunday"; ++ _M_data->_M_day2 = L"Monday"; ++ _M_data->_M_day3 = L"Tuesday"; ++ _M_data->_M_day4 = L"Wednesday"; ++ _M_data->_M_day5 = L"Thursday"; ++ _M_data->_M_day6 = L"Friday"; ++ _M_data->_M_day7 = L"Saturday"; ++ ++ // Abbreviated day names, starting with "C"'s Sun. ++ _M_data->_M_aday1 = L"Sun"; ++ _M_data->_M_aday2 = L"Mon"; ++ _M_data->_M_aday3 = L"Tue"; ++ _M_data->_M_aday4 = L"Wed"; ++ _M_data->_M_aday5 = L"Thu"; ++ _M_data->_M_aday6 = L"Fri"; ++ _M_data->_M_aday7 = L"Sat"; ++ ++ // Month names, starting with "C"'s January. ++ _M_data->_M_month01 = L"January"; ++ _M_data->_M_month02 = L"February"; ++ _M_data->_M_month03 = L"March"; ++ _M_data->_M_month04 = L"April"; ++ _M_data->_M_month05 = L"May"; ++ _M_data->_M_month06 = L"June"; ++ _M_data->_M_month07 = L"July"; ++ _M_data->_M_month08 = L"August"; ++ _M_data->_M_month09 = L"September"; ++ _M_data->_M_month10 = L"October"; ++ _M_data->_M_month11 = L"November"; ++ _M_data->_M_month12 = L"December"; ++ ++ // Abbreviated month names, starting with "C"'s Jan. ++ _M_data->_M_amonth01 = L"Jan"; ++ _M_data->_M_amonth02 = L"Feb"; ++ _M_data->_M_amonth03 = L"Mar"; ++ _M_data->_M_amonth04 = L"Apr"; ++ _M_data->_M_amonth05 = L"May"; ++ _M_data->_M_amonth06 = L"Jun"; ++ _M_data->_M_amonth07 = L"Jul"; ++ _M_data->_M_amonth08 = L"Aug"; ++ _M_data->_M_amonth09 = L"Sep"; ++ _M_data->_M_amonth10 = L"Oct"; ++ _M_data->_M_amonth11 = L"Nov"; ++ _M_data->_M_amonth12 = L"Dec"; ++ } ++#if 0 ++ else ++ { ++ _M_c_locale_timepunct = _S_clone_c_locale(__cloc); ++ ++ union { char *__s; wchar_t *__w; } __u; ++ ++ __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc); ++ _M_data->_M_date_format = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc); ++ _M_data->_M_date_era_format = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc); ++ _M_data->_M_time_format = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc); ++ _M_data->_M_time_era_format = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc); ++ _M_data->_M_date_time_format = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc); ++ _M_data->_M_date_time_era_format = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc); ++ _M_data->_M_am = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc); ++ _M_data->_M_pm = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc); ++ _M_data->_M_am_pm_format = __u.__w; ++ ++ // Day names, starting with "C"'s Sunday. ++ __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc); ++ _M_data->_M_day1 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc); ++ _M_data->_M_day2 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc); ++ _M_data->_M_day3 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc); ++ _M_data->_M_day4 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc); ++ _M_data->_M_day5 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc); ++ _M_data->_M_day6 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc); ++ _M_data->_M_day7 = __u.__w; ++ ++ // Abbreviated day names, starting with "C"'s Sun. ++ __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc); ++ _M_data->_M_aday1 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc); ++ _M_data->_M_aday2 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc); ++ _M_data->_M_aday3 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc); ++ _M_data->_M_aday4 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc); ++ _M_data->_M_aday5 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc); ++ _M_data->_M_aday6 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc); ++ _M_data->_M_aday7 = __u.__w; ++ ++ // Month names, starting with "C"'s January. ++ __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc); ++ _M_data->_M_month01 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc); ++ _M_data->_M_month02 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc); ++ _M_data->_M_month03 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc); ++ _M_data->_M_month04 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc); ++ _M_data->_M_month05 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc); ++ _M_data->_M_month06 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc); ++ _M_data->_M_month07 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc); ++ _M_data->_M_month08 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc); ++ _M_data->_M_month09 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc); ++ _M_data->_M_month10 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc); ++ _M_data->_M_month11 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc); ++ _M_data->_M_month12 = __u.__w; ++ ++ // Abbreviated month names, starting with "C"'s Jan. ++ __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc); ++ _M_data->_M_amonth01 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc); ++ _M_data->_M_amonth02 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc); ++ _M_data->_M_amonth03 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc); ++ _M_data->_M_amonth04 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc); ++ _M_data->_M_amonth05 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc); ++ _M_data->_M_amonth06 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc); ++ _M_data->_M_amonth07 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc); ++ _M_data->_M_amonth08 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc); ++ _M_data->_M_amonth09 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc); ++ _M_data->_M_amonth10 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc); ++ _M_data->_M_amonth11 = __u.__w; ++ __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc); ++ _M_data->_M_amonth12 = __u.__w; ++ } ++#endif // 0 ++ } ++#endif ++} +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.h +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h 1970-01-01 01:00:00.000000000 +0100 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.h 2008-06-10 14:58:39.000000000 +0200 +@@ -0,0 +1,68 @@ ++// std::time_get, std::time_put implementation, GNU version -*- C++ -*- ++ ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library is free ++// software; you can redistribute it and/or modify it under the ++// terms of the GNU General Public License as published by the ++// Free Software Foundation; either version 2, or (at your option) ++// any later version. ++ ++// This 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 General Public License for more details. ++ ++// You should have received a copy of the GNU General Public License along ++// with this library; see the file COPYING. If not, write to the Free ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, ++// USA. ++ ++// As a special exception, you may use this file as part of a free software ++// library without restriction. Specifically, if other files instantiate ++// templates or use macros or inline functions from this file, or you compile ++// this file and link it with other files to produce an executable, this ++// file does not by itself cause the resulting executable to be covered by ++// the GNU General Public License. This exception does not however ++// invalidate any other reasons why the executable file might be covered by ++// the GNU General Public License. ++ ++// ++// ISO C++ 14882: 22.2.5.1.2 - time_get functions ++// ISO C++ 14882: 22.2.5.3.2 - time_put functions ++// ++ ++// Written by Benjamin Kosnik ++ ++ template ++ __timepunct<_CharT>::__timepunct(size_t __refs) ++ : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), ++ _M_name_timepunct(_S_get_c_name()) ++ { _M_initialize_timepunct(); } ++ ++ template ++ __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) ++ : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), ++ _M_name_timepunct(_S_get_c_name()) ++ { _M_initialize_timepunct(); } ++ ++ template ++ __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s, ++ size_t __refs) ++ : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), ++ _M_name_timepunct(__s) ++ { ++ char* __tmp = new char[std::strlen(__s) + 1]; ++ std::strcpy(__tmp, __s); ++ _M_name_timepunct = __tmp; ++ _M_initialize_timepunct(__cloc); ++ } ++ ++ template ++ __timepunct<_CharT>::~__timepunct() ++ { ++ if (_M_name_timepunct != _S_get_c_name()) ++ delete [] _M_name_timepunct; ++ delete _M_data; ++ _S_destroy_c_locale(_M_c_locale_timepunct); ++ } +diff -durN gcc-4.3.1.orig/libstdc++-v3/configure gcc-4.3.1/libstdc++-v3/configure +--- gcc-4.3.1.orig/libstdc++-v3/configure 2008-04-25 18:52:57.000000000 +0200 ++++ gcc-4.3.1/libstdc++-v3/configure 2008-06-10 14:58:39.000000000 +0200 +@@ -14001,7 +14001,7 @@ + enableval="$enable_clocale" + + case "$enableval" in +- generic|gnu|ieee_1003.1-2001|yes|no|auto) ;; ++ generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto) ;; + *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable clocale" >&5 + echo "$as_me: error: Unknown argument to enable/disable clocale" >&2;} + { (exit 1); exit 1; }; } ;; +@@ -14034,6 +14034,9 @@ + # Default to "generic". + if test $enable_clocale_flag = auto; then + case ${target_os} in ++ linux-uclibc*) ++ enable_clocale_flag=uclibc ++ ;; + linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu) + enable_clocale_flag=gnu + ;; +@@ -14422,6 +14425,76 @@ + CTIME_CC=config/locale/generic/time_members.cc + CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h + ;; ++ uclibc) ++ echo "$as_me:$LINENO: result: uclibc" >&5 ++echo "${ECHO_T}uclibc" >&6 ++ ++ # Declare intention to use gettext, and add support for specific ++ # languages. ++ # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT ++ ALL_LINGUAS="de fr" ++ ++ # Don't call AM-GNU-GETTEXT here. Instead, assume glibc. ++ # Extract the first word of "msgfmt", so it can be a program name with args. ++set dummy msgfmt; ac_word=$2 ++echo "$as_me:$LINENO: checking for $ac_word" >&5 ++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 ++if test "${ac_cv_prog_check_msgfmt+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ if test -n "$check_msgfmt"; then ++ ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ ac_cv_prog_check_msgfmt="yes" ++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++done ++ ++ test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no" ++fi ++fi ++check_msgfmt=$ac_cv_prog_check_msgfmt ++if test -n "$check_msgfmt"; then ++ echo "$as_me:$LINENO: result: $check_msgfmt" >&5 ++echo "${ECHO_T}$check_msgfmt" >&6 ++else ++ echo "$as_me:$LINENO: result: no" >&5 ++echo "${ECHO_T}no" >&6 ++fi ++ ++ if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then ++ USE_NLS=yes ++ fi ++ # Export the build objects. ++ for ling in $ALL_LINGUAS; do \ ++ glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \ ++ glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \ ++ done ++ ++ ++ ++ CLOCALE_H=config/locale/uclibc/c_locale.h ++ CLOCALE_CC=config/locale/uclibc/c_locale.cc ++ CCODECVT_CC=config/locale/uclibc/codecvt_members.cc ++ CCOLLATE_CC=config/locale/uclibc/collate_members.cc ++ CCTYPE_CC=config/locale/uclibc/ctype_members.cc ++ CMESSAGES_H=config/locale/uclibc/messages_members.h ++ CMESSAGES_CC=config/locale/uclibc/messages_members.cc ++ CMONEY_CC=config/locale/uclibc/monetary_members.cc ++ CNUMERIC_CC=config/locale/uclibc/numeric_members.cc ++ CTIME_H=config/locale/uclibc/time_members.h ++ CTIME_CC=config/locale/uclibc/time_members.cc ++ CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h ++ ;; + esac + + # This is where the testsuite looks for locale catalogs, using the +diff -durN gcc-4.3.1.orig/libstdc++-v3/include/c_compatibility/wchar.h gcc-4.3.1/libstdc++-v3/include/c_compatibility/wchar.h +--- gcc-4.3.1.orig/libstdc++-v3/include/c_compatibility/wchar.h 2007-03-04 23:59:49.000000000 +0100 ++++ gcc-4.3.1/libstdc++-v3/include/c_compatibility/wchar.h 2008-06-10 14:58:39.000000000 +0200 +@@ -106,7 +106,9 @@ + using std::wmemcpy; + using std::wmemmove; + using std::wmemset; ++#if _GLIBCXX_HAVE_WCSFTIME + using std::wcsftime; ++#endif + + #if _GLIBCXX_USE_C99 + using std::wcstold; diff --git a/patches/gcc/4.3.1/550-203-uclibc-locale-no__x.patch b/patches/gcc/4.3.1/550-203-uclibc-locale-no__x.patch deleted file mode 100644 index 68c6e31..0000000 --- a/patches/gcc/4.3.1/550-203-uclibc-locale-no__x.patch +++ /dev/null @@ -1,224 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_203-uclibc-locale-no__x.patch -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2008-06-10 14:58:43.000000000 +0200 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2008-06-10 14:58:43.000000000 +0200 -@@ -60,4 +60,49 @@ - extern "C" __typeof(wctype_l) __wctype_l; - #endif - -+# define __nl_langinfo_l nl_langinfo_l -+# define __strcoll_l strcoll_l -+# define __strftime_l strftime_l -+# define __strtod_l strtod_l -+# define __strtof_l strtof_l -+# define __strtold_l strtold_l -+# define __strxfrm_l strxfrm_l -+# define __newlocale newlocale -+# define __freelocale freelocale -+# define __duplocale duplocale -+# define __uselocale uselocale -+ -+# ifdef _GLIBCXX_USE_WCHAR_T -+# define __iswctype_l iswctype_l -+# define __towlower_l towlower_l -+# define __towupper_l towupper_l -+# define __wcscoll_l wcscoll_l -+# define __wcsftime_l wcsftime_l -+# define __wcsxfrm_l wcsxfrm_l -+# define __wctype_l wctype_l -+# endif -+ -+#else -+# define __nl_langinfo_l(N, L) nl_langinfo((N)) -+# define __strcoll_l(S1, S2, L) strcoll((S1), (S2)) -+# define __strtod_l(S, E, L) strtod((S), (E)) -+# define __strtof_l(S, E, L) strtof((S), (E)) -+# define __strtold_l(S, E, L) strtold((S), (E)) -+# define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N)) -+# warning should dummy __newlocale check for C|POSIX ? -+# define __newlocale(a, b, c) NULL -+# define __freelocale(a) ((void)0) -+# define __duplocale(a) __c_locale() -+//# define __uselocale ? -+// -+# ifdef _GLIBCXX_USE_WCHAR_T -+# define __iswctype_l(C, M, L) iswctype((C), (M)) -+# define __towlower_l(C, L) towlower((C)) -+# define __towupper_l(C, L) towupper((C)) -+# define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2)) -+//# define __wcsftime_l(S, M, F, T, L) wcsftime((S), (M), (F), (T)) -+# define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N)) -+# define __wctype_l(S, L) wctype((S)) -+# endif -+ - #endif // GLIBC 2.3 and later -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.cc ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-06-10 14:58:43.000000000 +0200 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-06-10 14:58:43.000000000 +0200 -@@ -39,20 +39,6 @@ - #include - #include - --#ifndef __UCLIBC_HAS_XLOCALE__ --#define __strtol_l(S, E, B, L) strtol((S), (E), (B)) --#define __strtoul_l(S, E, B, L) strtoul((S), (E), (B)) --#define __strtoll_l(S, E, B, L) strtoll((S), (E), (B)) --#define __strtoull_l(S, E, B, L) strtoull((S), (E), (B)) --#define __strtof_l(S, E, L) strtof((S), (E)) --#define __strtod_l(S, E, L) strtod((S), (E)) --#define __strtold_l(S, E, L) strtold((S), (E)) --#warning should dummy __newlocale check for C|POSIX ? --#define __newlocale(a, b, c) NULL --#define __freelocale(a) ((void)0) --#define __duplocale(a) __c_locale() --#endif -- - namespace std - { - template<> -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.h ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-06-10 14:58:43.000000000 +0200 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-06-10 14:58:43.000000000 +0200 -@@ -68,6 +68,7 @@ - { - extern "C" __typeof(uselocale) __uselocale; - } -+#define __uselocale uselocale - #endif - - namespace std -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/collate_members.cc ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc 2008-06-10 14:58:43.000000000 +0200 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/collate_members.cc 2008-06-10 14:58:43.000000000 +0200 -@@ -36,13 +36,6 @@ - #include - #include - --#ifndef __UCLIBC_HAS_XLOCALE__ --#define __strcoll_l(S1, S2, L) strcoll((S1), (S2)) --#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N)) --#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2)) --#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N)) --#endif -- - namespace std - { - // These are basically extensions to char_traits, and perhaps should -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-06-10 14:58:43.000000000 +0200 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-06-10 14:58:43.000000000 +0200 -@@ -38,13 +38,6 @@ - #undef _LIBC - #include - --#ifndef __UCLIBC_HAS_XLOCALE__ --#define __wctype_l(S, L) wctype((S)) --#define __towupper_l(C, L) towupper((C)) --#define __towlower_l(C, L) towlower((C)) --#define __iswctype_l(C, M, L) iswctype((C), (M)) --#endif -- - namespace std - { - // NB: The other ctype specializations are in src/locale.cc and -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.cc ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc 2008-06-10 14:58:43.000000000 +0200 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.cc 2008-06-10 14:58:43.000000000 +0200 -@@ -39,13 +39,10 @@ - #ifdef __UCLIBC_MJN3_ONLY__ - #warning fix gettext stuff - #endif --#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ --extern "C" char *__dcgettext(const char *domainname, -- const char *msgid, int category); - #undef gettext --#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES) -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ -+#define gettext(msgid) dcgettext(NULL, msgid, LC_MESSAGES) - #else --#undef gettext - #define gettext(msgid) (msgid) - #endif - -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:58:43.000000000 +0200 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:58:43.000000000 +0200 -@@ -36,15 +36,11 @@ - #ifdef __UCLIBC_MJN3_ONLY__ - #warning fix prototypes for *textdomain funcs - #endif --#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ --extern "C" char *__textdomain(const char *domainname); --extern "C" char *__bindtextdomain(const char *domainname, -- const char *dirname); --#else --#undef __textdomain --#undef __bindtextdomain --#define __textdomain(D) ((void)0) --#define __bindtextdomain(D,P) ((void)0) -+#ifndef __UCLIBC_HAS_GETTEXT_AWARENESS__ -+#undef textdomain -+#undef bindtextdomain -+#define textdomain(D) ((void)0) -+#define bindtextdomain(D,P) ((void)0) - #endif - - // Non-virtual member functions. -@@ -70,7 +66,7 @@ - messages<_CharT>::open(const basic_string& __s, const locale& __loc, - const char* __dir) const - { -- __bindtextdomain(__s.c_str(), __dir); -+ bindtextdomain(__s.c_str(), __dir); - return this->do_open(__s, __loc); - } - -@@ -90,7 +86,7 @@ - { - // No error checking is done, assume the catalog exists and can - // be used. -- __textdomain(__s.c_str()); -+ textdomain(__s.c_str()); - return 0; - } - -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:58:43.000000000 +0200 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:58:43.000000000 +0200 -@@ -43,10 +43,6 @@ - #warning tailor for stub locale support - #endif - --#ifndef __UCLIBC_HAS_XLOCALE__ --#define __nl_langinfo_l(N, L) nl_langinfo((N)) --#endif -- - namespace std - { - // Construct and return valid pattern consisting of some combination of: -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:58:43.000000000 +0200 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:58:43.000000000 +0200 -@@ -41,9 +41,6 @@ - #ifdef __UCLIBC_MJN3_ONLY__ - #warning tailor for stub locale support - #endif --#ifndef __UCLIBC_HAS_XLOCALE__ --#define __nl_langinfo_l(N, L) nl_langinfo((N)) --#endif - - namespace std - { -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.cc ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc 2008-06-10 14:58:43.000000000 +0200 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.cc 2008-06-10 14:58:43.000000000 +0200 -@@ -40,9 +40,6 @@ - #ifdef __UCLIBC_MJN3_ONLY__ - #warning tailor for stub locale support - #endif --#ifndef __UCLIBC_HAS_XLOCALE__ --#define __nl_langinfo_l(N, L) nl_langinfo((N)) --#endif - - namespace std - { diff --git a/patches/gcc/4.3.1/550-uclibc-locale-no__x.patch b/patches/gcc/4.3.1/550-uclibc-locale-no__x.patch new file mode 100644 index 0000000..68c6e31 --- /dev/null +++ b/patches/gcc/4.3.1/550-uclibc-locale-no__x.patch @@ -0,0 +1,224 @@ +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_203-uclibc-locale-no__x.patch +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2008-06-10 14:58:43.000000000 +0200 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2008-06-10 14:58:43.000000000 +0200 +@@ -60,4 +60,49 @@ + extern "C" __typeof(wctype_l) __wctype_l; + #endif + ++# define __nl_langinfo_l nl_langinfo_l ++# define __strcoll_l strcoll_l ++# define __strftime_l strftime_l ++# define __strtod_l strtod_l ++# define __strtof_l strtof_l ++# define __strtold_l strtold_l ++# define __strxfrm_l strxfrm_l ++# define __newlocale newlocale ++# define __freelocale freelocale ++# define __duplocale duplocale ++# define __uselocale uselocale ++ ++# ifdef _GLIBCXX_USE_WCHAR_T ++# define __iswctype_l iswctype_l ++# define __towlower_l towlower_l ++# define __towupper_l towupper_l ++# define __wcscoll_l wcscoll_l ++# define __wcsftime_l wcsftime_l ++# define __wcsxfrm_l wcsxfrm_l ++# define __wctype_l wctype_l ++# endif ++ ++#else ++# define __nl_langinfo_l(N, L) nl_langinfo((N)) ++# define __strcoll_l(S1, S2, L) strcoll((S1), (S2)) ++# define __strtod_l(S, E, L) strtod((S), (E)) ++# define __strtof_l(S, E, L) strtof((S), (E)) ++# define __strtold_l(S, E, L) strtold((S), (E)) ++# define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N)) ++# warning should dummy __newlocale check for C|POSIX ? ++# define __newlocale(a, b, c) NULL ++# define __freelocale(a) ((void)0) ++# define __duplocale(a) __c_locale() ++//# define __uselocale ? ++// ++# ifdef _GLIBCXX_USE_WCHAR_T ++# define __iswctype_l(C, M, L) iswctype((C), (M)) ++# define __towlower_l(C, L) towlower((C)) ++# define __towupper_l(C, L) towupper((C)) ++# define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2)) ++//# define __wcsftime_l(S, M, F, T, L) wcsftime((S), (M), (F), (T)) ++# define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N)) ++# define __wctype_l(S, L) wctype((S)) ++# endif ++ + #endif // GLIBC 2.3 and later +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.cc +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-06-10 14:58:43.000000000 +0200 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-06-10 14:58:43.000000000 +0200 +@@ -39,20 +39,6 @@ + #include + #include + +-#ifndef __UCLIBC_HAS_XLOCALE__ +-#define __strtol_l(S, E, B, L) strtol((S), (E), (B)) +-#define __strtoul_l(S, E, B, L) strtoul((S), (E), (B)) +-#define __strtoll_l(S, E, B, L) strtoll((S), (E), (B)) +-#define __strtoull_l(S, E, B, L) strtoull((S), (E), (B)) +-#define __strtof_l(S, E, L) strtof((S), (E)) +-#define __strtod_l(S, E, L) strtod((S), (E)) +-#define __strtold_l(S, E, L) strtold((S), (E)) +-#warning should dummy __newlocale check for C|POSIX ? +-#define __newlocale(a, b, c) NULL +-#define __freelocale(a) ((void)0) +-#define __duplocale(a) __c_locale() +-#endif +- + namespace std + { + template<> +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.h +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-06-10 14:58:43.000000000 +0200 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-06-10 14:58:43.000000000 +0200 +@@ -68,6 +68,7 @@ + { + extern "C" __typeof(uselocale) __uselocale; + } ++#define __uselocale uselocale + #endif + + namespace std +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/collate_members.cc +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc 2008-06-10 14:58:43.000000000 +0200 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/collate_members.cc 2008-06-10 14:58:43.000000000 +0200 +@@ -36,13 +36,6 @@ + #include + #include + +-#ifndef __UCLIBC_HAS_XLOCALE__ +-#define __strcoll_l(S1, S2, L) strcoll((S1), (S2)) +-#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N)) +-#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2)) +-#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N)) +-#endif +- + namespace std + { + // These are basically extensions to char_traits, and perhaps should +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-06-10 14:58:43.000000000 +0200 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-06-10 14:58:43.000000000 +0200 +@@ -38,13 +38,6 @@ + #undef _LIBC + #include + +-#ifndef __UCLIBC_HAS_XLOCALE__ +-#define __wctype_l(S, L) wctype((S)) +-#define __towupper_l(C, L) towupper((C)) +-#define __towlower_l(C, L) towlower((C)) +-#define __iswctype_l(C, M, L) iswctype((C), (M)) +-#endif +- + namespace std + { + // NB: The other ctype specializations are in src/locale.cc and +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.cc +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc 2008-06-10 14:58:43.000000000 +0200 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.cc 2008-06-10 14:58:43.000000000 +0200 +@@ -39,13 +39,10 @@ + #ifdef __UCLIBC_MJN3_ONLY__ + #warning fix gettext stuff + #endif +-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ +-extern "C" char *__dcgettext(const char *domainname, +- const char *msgid, int category); + #undef gettext +-#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES) ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ ++#define gettext(msgid) dcgettext(NULL, msgid, LC_MESSAGES) + #else +-#undef gettext + #define gettext(msgid) (msgid) + #endif + +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:58:43.000000000 +0200 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:58:43.000000000 +0200 +@@ -36,15 +36,11 @@ + #ifdef __UCLIBC_MJN3_ONLY__ + #warning fix prototypes for *textdomain funcs + #endif +-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ +-extern "C" char *__textdomain(const char *domainname); +-extern "C" char *__bindtextdomain(const char *domainname, +- const char *dirname); +-#else +-#undef __textdomain +-#undef __bindtextdomain +-#define __textdomain(D) ((void)0) +-#define __bindtextdomain(D,P) ((void)0) ++#ifndef __UCLIBC_HAS_GETTEXT_AWARENESS__ ++#undef textdomain ++#undef bindtextdomain ++#define textdomain(D) ((void)0) ++#define bindtextdomain(D,P) ((void)0) + #endif + + // Non-virtual member functions. +@@ -70,7 +66,7 @@ + messages<_CharT>::open(const basic_string& __s, const locale& __loc, + const char* __dir) const + { +- __bindtextdomain(__s.c_str(), __dir); ++ bindtextdomain(__s.c_str(), __dir); + return this->do_open(__s, __loc); + } + +@@ -90,7 +86,7 @@ + { + // No error checking is done, assume the catalog exists and can + // be used. +- __textdomain(__s.c_str()); ++ textdomain(__s.c_str()); + return 0; + } + +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:58:43.000000000 +0200 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:58:43.000000000 +0200 +@@ -43,10 +43,6 @@ + #warning tailor for stub locale support + #endif + +-#ifndef __UCLIBC_HAS_XLOCALE__ +-#define __nl_langinfo_l(N, L) nl_langinfo((N)) +-#endif +- + namespace std + { + // Construct and return valid pattern consisting of some combination of: +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:58:43.000000000 +0200 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:58:43.000000000 +0200 +@@ -41,9 +41,6 @@ + #ifdef __UCLIBC_MJN3_ONLY__ + #warning tailor for stub locale support + #endif +-#ifndef __UCLIBC_HAS_XLOCALE__ +-#define __nl_langinfo_l(N, L) nl_langinfo((N)) +-#endif + + namespace std + { +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.cc +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc 2008-06-10 14:58:43.000000000 +0200 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.cc 2008-06-10 14:58:43.000000000 +0200 +@@ -40,9 +40,6 @@ + #ifdef __UCLIBC_MJN3_ONLY__ + #warning tailor for stub locale support + #endif +-#ifndef __UCLIBC_HAS_XLOCALE__ +-#define __nl_langinfo_l(N, L) nl_langinfo((N)) +-#endif + + namespace std + { diff --git a/patches/gcc/4.3.1/575-204-uclibc-locale-wchar_fix.patch b/patches/gcc/4.3.1/575-204-uclibc-locale-wchar_fix.patch deleted file mode 100644 index af26649..0000000 --- a/patches/gcc/4.3.1/575-204-uclibc-locale-wchar_fix.patch +++ /dev/null @@ -1,51 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_204-uclibc-locale-wchar_fix.patch -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:58:47.000000000 +0200 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:58:47.000000000 +0200 -@@ -401,7 +401,7 @@ - # ifdef __UCLIBC_HAS_XLOCALE__ - _M_data->_M_decimal_point = __cloc->decimal_point_wc; - _M_data->_M_thousands_sep = __cloc->thousands_sep_wc; --# else -+# elif defined __UCLIBC_HAS_LOCALE__ - _M_data->_M_decimal_point = __global_locale->decimal_point_wc; - _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc; - # endif -@@ -556,7 +556,7 @@ - # ifdef __UCLIBC_HAS_XLOCALE__ - _M_data->_M_decimal_point = __cloc->decimal_point_wc; - _M_data->_M_thousands_sep = __cloc->thousands_sep_wc; --# else -+# elif defined __UCLIBC_HAS_LOCALE__ - _M_data->_M_decimal_point = __global_locale->decimal_point_wc; - _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc; - # endif -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:58:47.000000000 +0200 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:58:47.000000000 +0200 -@@ -127,12 +127,25 @@ - { - // Named locale. - // NB: In the GNU model wchar_t is always 32 bit wide. -+#ifdef __UCLIBC_MJN3_ONLY__ -+#warning fix this... should be numeric -+#endif -+#ifdef __UCLIBC__ -+# ifdef __UCLIBC_HAS_XLOCALE__ -+ _M_data->_M_decimal_point = __cloc->decimal_point_wc; -+ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc; -+# elif defined __UCLIBC_HAS_LOCALE__ -+ _M_data->_M_decimal_point = __global_locale->decimal_point_wc; -+ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc; -+# endif -+#else - union { char *__s; wchar_t __w; } __u; - __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc); - _M_data->_M_decimal_point = __u.__w; - - __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc); - _M_data->_M_thousands_sep = __u.__w; -+#endif - - if (_M_data->_M_thousands_sep == L'\0') - _M_data->_M_grouping = ""; diff --git a/patches/gcc/4.3.1/575-uclibc-locale-wchar_fix.patch b/patches/gcc/4.3.1/575-uclibc-locale-wchar_fix.patch new file mode 100644 index 0000000..af26649 --- /dev/null +++ b/patches/gcc/4.3.1/575-uclibc-locale-wchar_fix.patch @@ -0,0 +1,51 @@ +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_204-uclibc-locale-wchar_fix.patch +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:58:47.000000000 +0200 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:58:47.000000000 +0200 +@@ -401,7 +401,7 @@ + # ifdef __UCLIBC_HAS_XLOCALE__ + _M_data->_M_decimal_point = __cloc->decimal_point_wc; + _M_data->_M_thousands_sep = __cloc->thousands_sep_wc; +-# else ++# elif defined __UCLIBC_HAS_LOCALE__ + _M_data->_M_decimal_point = __global_locale->decimal_point_wc; + _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc; + # endif +@@ -556,7 +556,7 @@ + # ifdef __UCLIBC_HAS_XLOCALE__ + _M_data->_M_decimal_point = __cloc->decimal_point_wc; + _M_data->_M_thousands_sep = __cloc->thousands_sep_wc; +-# else ++# elif defined __UCLIBC_HAS_LOCALE__ + _M_data->_M_decimal_point = __global_locale->decimal_point_wc; + _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc; + # endif +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:58:47.000000000 +0200 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:58:47.000000000 +0200 +@@ -127,12 +127,25 @@ + { + // Named locale. + // NB: In the GNU model wchar_t is always 32 bit wide. ++#ifdef __UCLIBC_MJN3_ONLY__ ++#warning fix this... should be numeric ++#endif ++#ifdef __UCLIBC__ ++# ifdef __UCLIBC_HAS_XLOCALE__ ++ _M_data->_M_decimal_point = __cloc->decimal_point_wc; ++ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc; ++# elif defined __UCLIBC_HAS_LOCALE__ ++ _M_data->_M_decimal_point = __global_locale->decimal_point_wc; ++ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc; ++# endif ++#else + union { char *__s; wchar_t __w; } __u; + __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc); + _M_data->_M_decimal_point = __u.__w; + + __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc); + _M_data->_M_thousands_sep = __u.__w; ++#endif + + if (_M_data->_M_thousands_sep == L'\0') + _M_data->_M_grouping = ""; diff --git a/patches/gcc/4.3.1/600-205-uclibc-locale-update.patch b/patches/gcc/4.3.1/600-205-uclibc-locale-update.patch deleted file mode 100644 index 8fef5e4..0000000 --- a/patches/gcc/4.3.1/600-205-uclibc-locale-update.patch +++ /dev/null @@ -1,355 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_205-uclibc-locale-update.patch -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.cc ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-06-10 14:58:47.000000000 +0200 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-06-10 14:58:51.000000000 +0200 -@@ -46,16 +46,13 @@ - __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, - const __c_locale& __cloc) - { -- if (!(__err & ios_base::failbit)) -- { -- char* __sanity; -- errno = 0; -- float __f = __strtof_l(__s, &__sanity, __cloc); -- if (__sanity != __s && errno != ERANGE) -- __v = __f; -- else -- __err |= ios_base::failbit; -- } -+ char* __sanity; -+ errno = 0; -+ float __f = __strtof_l(__s, &__sanity, __cloc); -+ if (__sanity != __s && errno != ERANGE) -+ __v = __f; -+ else -+ __err |= ios_base::failbit; - } - - template<> -@@ -63,16 +60,13 @@ - __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, - const __c_locale& __cloc) - { -- if (!(__err & ios_base::failbit)) -- { -- char* __sanity; -- errno = 0; -- double __d = __strtod_l(__s, &__sanity, __cloc); -- if (__sanity != __s && errno != ERANGE) -- __v = __d; -- else -- __err |= ios_base::failbit; -- } -+ char* __sanity; -+ errno = 0; -+ double __d = __strtod_l(__s, &__sanity, __cloc); -+ if (__sanity != __s && errno != ERANGE) -+ __v = __d; -+ else -+ __err |= ios_base::failbit; - } - - template<> -@@ -80,16 +74,13 @@ - __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err, - const __c_locale& __cloc) - { -- if (!(__err & ios_base::failbit)) -- { -- char* __sanity; -- errno = 0; -- long double __ld = __strtold_l(__s, &__sanity, __cloc); -- if (__sanity != __s && errno != ERANGE) -- __v = __ld; -- else -- __err |= ios_base::failbit; -- } -+ char* __sanity; -+ errno = 0; -+ long double __ld = __strtold_l(__s, &__sanity, __cloc); -+ if (__sanity != __s && errno != ERANGE) -+ __v = __ld; -+ else -+ __err |= ios_base::failbit; - } - - void -@@ -110,7 +101,7 @@ - void - locale::facet::_S_destroy_c_locale(__c_locale& __cloc) - { -- if (_S_get_c_locale() != __cloc) -+ if (__cloc && _S_get_c_locale() != __cloc) - __freelocale(__cloc); - } - -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.h ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-06-10 14:58:47.000000000 +0200 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-06-10 14:58:51.000000000 +0200 -@@ -39,21 +39,23 @@ - #pragma GCC system_header - - #include // get std::strlen --#include // get std::snprintf or std::sprintf -+#include // get std::vsnprintf or std::vsprintf - #include - #include // For codecvt - #ifdef __UCLIBC_MJN3_ONLY__ - #warning fix this - #endif --#ifdef __UCLIBC_HAS_LOCALE__ -+#ifdef _GLIBCXX_USE_ICONV - #include // For codecvt using iconv, iconv_t - #endif --#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ --#include // For messages -+#ifdef HAVE_LIBINTL_H -+#include // For messages - #endif -+#include - - #ifdef __UCLIBC_MJN3_ONLY__ - #warning what is _GLIBCXX_C_LOCALE_GNU for -+// psm: used in os/gnu-linux/ctype_noninline.h - #endif - #define _GLIBCXX_C_LOCALE_GNU 1 - -@@ -62,7 +64,7 @@ - #endif - // #define _GLIBCXX_NUM_CATEGORIES 6 - #define _GLIBCXX_NUM_CATEGORIES 0 -- -+ - #ifdef __UCLIBC_HAS_XLOCALE__ - namespace __gnu_cxx - { -@@ -79,22 +81,24 @@ - typedef int* __c_locale; - #endif - -- // Convert numeric value of type _Tv to string and return length of -- // string. If snprintf is available use it, otherwise fall back to -- // the unsafe sprintf which, in general, can be dangerous and should -+ // Convert numeric value of type double to string and return length of -+ // string. If vsnprintf is available use it, otherwise fall back to -+ // the unsafe vsprintf which, in general, can be dangerous and should - // be avoided. -- template -- int -- __convert_from_v(char* __out, -- const int __size __attribute__ ((__unused__)), -- const char* __fmt, --#ifdef __UCLIBC_HAS_XCLOCALE__ -- _Tv __v, const __c_locale& __cloc, int __prec) -+ inline int -+ __convert_from_v(const __c_locale& -+#ifndef __UCLIBC_HAS_XCLOCALE__ -+ __cloc __attribute__ ((__unused__)) -+#endif -+ , -+ char* __out, -+ const int __size, -+ const char* __fmt, ...) - { -+ va_list __args; -+#ifdef __UCLIBC_HAS_XCLOCALE__ - __c_locale __old = __gnu_cxx::__uselocale(__cloc); - #else -- _Tv __v, const __c_locale&, int __prec) -- { - # ifdef __UCLIBC_HAS_LOCALE__ - char* __old = std::setlocale(LC_ALL, NULL); - char* __sav = new char[std::strlen(__old) + 1]; -@@ -103,7 +107,9 @@ - # endif - #endif - -- const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v); -+ va_start(__args, __fmt); -+ const int __ret = std::vsnprintf(__out, __size, __fmt, __args); -+ va_end(__args); - - #ifdef __UCLIBC_HAS_XCLOCALE__ - __gnu_cxx::__uselocale(__old); -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-06-10 14:58:47.000000000 +0200 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-06-10 14:58:51.000000000 +0200 -@@ -33,9 +33,14 @@ - - // Written by Benjamin Kosnik - -+#include -+#ifdef __UCLIBC_HAS_LOCALE__ - #define _LIBC - #include - #undef _LIBC -+#else -+#include -+#endif - #include - - namespace std -@@ -138,20 +143,34 @@ - ctype:: - do_is(mask __m, wchar_t __c) const - { -- // Highest bitmask in ctype_base == 10, but extra in "C" -- // library for blank. -+ // The case of __m == ctype_base::space is particularly important, -+ // due to its use in many istream functions. Therefore we deal with -+ // it first, exploiting the knowledge that on GNU systems _M_bit[5] -+ // is the mask corresponding to ctype_base::space. NB: an encoding -+ // change would not affect correctness! - bool __ret = false; -- const size_t __bitmasksize = 11; -- for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur) -- if (__m & _M_bit[__bitcur] -- && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype)) -- { -- __ret = true; -- break; -- } -+ if (__m == _M_bit[5]) -+ __ret = __iswctype_l(__c, _M_wmask[5], _M_c_locale_ctype); -+ else -+ { -+ // Highest bitmask in ctype_base == 10, but extra in "C" -+ // library for blank. -+ const size_t __bitmasksize = 11; -+ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur) -+ if (__m & _M_bit[__bitcur]) -+ { -+ if (__iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype)) -+ { -+ __ret = true; -+ break; -+ } -+ else if (__m == _M_bit[__bitcur]) -+ break; -+ } -+ } - return __ret; - } -- -+ - const wchar_t* - ctype:: - do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:58:47.000000000 +0200 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:58:51.000000000 +0200 -@@ -47,18 +47,21 @@ - template - messages<_CharT>::messages(size_t __refs) - : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), -- _M_name_messages(_S_get_c_name()) -+ _M_name_messages(_S_get_c_name()) - { } - - template - messages<_CharT>::messages(__c_locale __cloc, const char* __s, - size_t __refs) -- : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)), -- _M_name_messages(__s) -+ : facet(__refs), _M_c_locale_messages(NULL), _M_name_messages(NULL) - { -- char* __tmp = new char[std::strlen(__s) + 1]; -- std::strcpy(__tmp, __s); -+ const size_t __len = std::strlen(__s) + 1; -+ char* __tmp = new char[__len]; -+ std::memcpy(__tmp, __s, __len); - _M_name_messages = __tmp; -+ -+ // Last to avoid leaking memory if new throws. -+ _M_c_locale_messages = _S_clone_c_locale(__cloc); - } - - template -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:58:51.000000000 +0200 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:58:51.000000000 +0200 -@@ -33,9 +33,14 @@ - - // Written by Benjamin Kosnik - -+#include -+#ifdef __UCLIBC_HAS_LOCALE__ - #define _LIBC - #include - #undef _LIBC -+#else -+#include -+#endif - #include - - #ifdef __UCLIBC_MJN3_ONLY__ -@@ -206,7 +211,7 @@ - } - break; - default: -- ; -+ __ret = pattern(); - } - return __ret; - } -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:58:51.000000000 +0200 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:58:51.000000000 +0200 -@@ -33,9 +33,14 @@ - - // Written by Benjamin Kosnik - -+#include -+#ifdef __UCLIBC_HAS_LOCALE__ - #define _LIBC - #include - #undef _LIBC -+#else -+#include -+#endif - #include - - #ifdef __UCLIBC_MJN3_ONLY__ -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.h ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h 2008-06-10 14:58:43.000000000 +0200 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.h 2008-06-10 14:58:51.000000000 +0200 -@@ -37,25 +37,33 @@ - template - __timepunct<_CharT>::__timepunct(size_t __refs) - : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), -- _M_name_timepunct(_S_get_c_name()) -+ _M_name_timepunct(_S_get_c_name()) - { _M_initialize_timepunct(); } - - template - __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) - : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), -- _M_name_timepunct(_S_get_c_name()) -+ _M_name_timepunct(_S_get_c_name()) - { _M_initialize_timepunct(); } - - template - __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s, - size_t __refs) - : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), -- _M_name_timepunct(__s) -+ _M_name_timepunct(NULL) - { -- char* __tmp = new char[std::strlen(__s) + 1]; -- std::strcpy(__tmp, __s); -+ const size_t __len = std::strlen(__s) + 1; -+ char* __tmp = new char[__len]; -+ std::memcpy(__tmp, __s, __len); - _M_name_timepunct = __tmp; -- _M_initialize_timepunct(__cloc); -+ -+ try -+ { _M_initialize_timepunct(__cloc); } -+ catch(...) -+ { -+ delete [] _M_name_timepunct; -+ __throw_exception_again; -+ } - } - - template diff --git a/patches/gcc/4.3.1/600-uclibc-locale-update.patch b/patches/gcc/4.3.1/600-uclibc-locale-update.patch new file mode 100644 index 0000000..8fef5e4 --- /dev/null +++ b/patches/gcc/4.3.1/600-uclibc-locale-update.patch @@ -0,0 +1,355 @@ +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_205-uclibc-locale-update.patch +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.cc +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-06-10 14:58:47.000000000 +0200 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-06-10 14:58:51.000000000 +0200 +@@ -46,16 +46,13 @@ + __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, + const __c_locale& __cloc) + { +- if (!(__err & ios_base::failbit)) +- { +- char* __sanity; +- errno = 0; +- float __f = __strtof_l(__s, &__sanity, __cloc); +- if (__sanity != __s && errno != ERANGE) +- __v = __f; +- else +- __err |= ios_base::failbit; +- } ++ char* __sanity; ++ errno = 0; ++ float __f = __strtof_l(__s, &__sanity, __cloc); ++ if (__sanity != __s && errno != ERANGE) ++ __v = __f; ++ else ++ __err |= ios_base::failbit; + } + + template<> +@@ -63,16 +60,13 @@ + __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, + const __c_locale& __cloc) + { +- if (!(__err & ios_base::failbit)) +- { +- char* __sanity; +- errno = 0; +- double __d = __strtod_l(__s, &__sanity, __cloc); +- if (__sanity != __s && errno != ERANGE) +- __v = __d; +- else +- __err |= ios_base::failbit; +- } ++ char* __sanity; ++ errno = 0; ++ double __d = __strtod_l(__s, &__sanity, __cloc); ++ if (__sanity != __s && errno != ERANGE) ++ __v = __d; ++ else ++ __err |= ios_base::failbit; + } + + template<> +@@ -80,16 +74,13 @@ + __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err, + const __c_locale& __cloc) + { +- if (!(__err & ios_base::failbit)) +- { +- char* __sanity; +- errno = 0; +- long double __ld = __strtold_l(__s, &__sanity, __cloc); +- if (__sanity != __s && errno != ERANGE) +- __v = __ld; +- else +- __err |= ios_base::failbit; +- } ++ char* __sanity; ++ errno = 0; ++ long double __ld = __strtold_l(__s, &__sanity, __cloc); ++ if (__sanity != __s && errno != ERANGE) ++ __v = __ld; ++ else ++ __err |= ios_base::failbit; + } + + void +@@ -110,7 +101,7 @@ + void + locale::facet::_S_destroy_c_locale(__c_locale& __cloc) + { +- if (_S_get_c_locale() != __cloc) ++ if (__cloc && _S_get_c_locale() != __cloc) + __freelocale(__cloc); + } + +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.h +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-06-10 14:58:47.000000000 +0200 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-06-10 14:58:51.000000000 +0200 +@@ -39,21 +39,23 @@ + #pragma GCC system_header + + #include // get std::strlen +-#include // get std::snprintf or std::sprintf ++#include // get std::vsnprintf or std::vsprintf + #include + #include // For codecvt + #ifdef __UCLIBC_MJN3_ONLY__ + #warning fix this + #endif +-#ifdef __UCLIBC_HAS_LOCALE__ ++#ifdef _GLIBCXX_USE_ICONV + #include // For codecvt using iconv, iconv_t + #endif +-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ +-#include // For messages ++#ifdef HAVE_LIBINTL_H ++#include // For messages + #endif ++#include + + #ifdef __UCLIBC_MJN3_ONLY__ + #warning what is _GLIBCXX_C_LOCALE_GNU for ++// psm: used in os/gnu-linux/ctype_noninline.h + #endif + #define _GLIBCXX_C_LOCALE_GNU 1 + +@@ -62,7 +64,7 @@ + #endif + // #define _GLIBCXX_NUM_CATEGORIES 6 + #define _GLIBCXX_NUM_CATEGORIES 0 +- ++ + #ifdef __UCLIBC_HAS_XLOCALE__ + namespace __gnu_cxx + { +@@ -79,22 +81,24 @@ + typedef int* __c_locale; + #endif + +- // Convert numeric value of type _Tv to string and return length of +- // string. If snprintf is available use it, otherwise fall back to +- // the unsafe sprintf which, in general, can be dangerous and should ++ // Convert numeric value of type double to string and return length of ++ // string. If vsnprintf is available use it, otherwise fall back to ++ // the unsafe vsprintf which, in general, can be dangerous and should + // be avoided. +- template +- int +- __convert_from_v(char* __out, +- const int __size __attribute__ ((__unused__)), +- const char* __fmt, +-#ifdef __UCLIBC_HAS_XCLOCALE__ +- _Tv __v, const __c_locale& __cloc, int __prec) ++ inline int ++ __convert_from_v(const __c_locale& ++#ifndef __UCLIBC_HAS_XCLOCALE__ ++ __cloc __attribute__ ((__unused__)) ++#endif ++ , ++ char* __out, ++ const int __size, ++ const char* __fmt, ...) + { ++ va_list __args; ++#ifdef __UCLIBC_HAS_XCLOCALE__ + __c_locale __old = __gnu_cxx::__uselocale(__cloc); + #else +- _Tv __v, const __c_locale&, int __prec) +- { + # ifdef __UCLIBC_HAS_LOCALE__ + char* __old = std::setlocale(LC_ALL, NULL); + char* __sav = new char[std::strlen(__old) + 1]; +@@ -103,7 +107,9 @@ + # endif + #endif + +- const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v); ++ va_start(__args, __fmt); ++ const int __ret = std::vsnprintf(__out, __size, __fmt, __args); ++ va_end(__args); + + #ifdef __UCLIBC_HAS_XCLOCALE__ + __gnu_cxx::__uselocale(__old); +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-06-10 14:58:47.000000000 +0200 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-06-10 14:58:51.000000000 +0200 +@@ -33,9 +33,14 @@ + + // Written by Benjamin Kosnik + ++#include ++#ifdef __UCLIBC_HAS_LOCALE__ + #define _LIBC + #include + #undef _LIBC ++#else ++#include ++#endif + #include + + namespace std +@@ -138,20 +143,34 @@ + ctype:: + do_is(mask __m, wchar_t __c) const + { +- // Highest bitmask in ctype_base == 10, but extra in "C" +- // library for blank. ++ // The case of __m == ctype_base::space is particularly important, ++ // due to its use in many istream functions. Therefore we deal with ++ // it first, exploiting the knowledge that on GNU systems _M_bit[5] ++ // is the mask corresponding to ctype_base::space. NB: an encoding ++ // change would not affect correctness! + bool __ret = false; +- const size_t __bitmasksize = 11; +- for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur) +- if (__m & _M_bit[__bitcur] +- && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype)) +- { +- __ret = true; +- break; +- } ++ if (__m == _M_bit[5]) ++ __ret = __iswctype_l(__c, _M_wmask[5], _M_c_locale_ctype); ++ else ++ { ++ // Highest bitmask in ctype_base == 10, but extra in "C" ++ // library for blank. ++ const size_t __bitmasksize = 11; ++ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur) ++ if (__m & _M_bit[__bitcur]) ++ { ++ if (__iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype)) ++ { ++ __ret = true; ++ break; ++ } ++ else if (__m == _M_bit[__bitcur]) ++ break; ++ } ++ } + return __ret; + } +- ++ + const wchar_t* + ctype:: + do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:58:47.000000000 +0200 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:58:51.000000000 +0200 +@@ -47,18 +47,21 @@ + template + messages<_CharT>::messages(size_t __refs) + : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), +- _M_name_messages(_S_get_c_name()) ++ _M_name_messages(_S_get_c_name()) + { } + + template + messages<_CharT>::messages(__c_locale __cloc, const char* __s, + size_t __refs) +- : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)), +- _M_name_messages(__s) ++ : facet(__refs), _M_c_locale_messages(NULL), _M_name_messages(NULL) + { +- char* __tmp = new char[std::strlen(__s) + 1]; +- std::strcpy(__tmp, __s); ++ const size_t __len = std::strlen(__s) + 1; ++ char* __tmp = new char[__len]; ++ std::memcpy(__tmp, __s, __len); + _M_name_messages = __tmp; ++ ++ // Last to avoid leaking memory if new throws. ++ _M_c_locale_messages = _S_clone_c_locale(__cloc); + } + + template +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:58:51.000000000 +0200 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:58:51.000000000 +0200 +@@ -33,9 +33,14 @@ + + // Written by Benjamin Kosnik + ++#include ++#ifdef __UCLIBC_HAS_LOCALE__ + #define _LIBC + #include + #undef _LIBC ++#else ++#include ++#endif + #include + + #ifdef __UCLIBC_MJN3_ONLY__ +@@ -206,7 +211,7 @@ + } + break; + default: +- ; ++ __ret = pattern(); + } + return __ret; + } +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:58:51.000000000 +0200 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:58:51.000000000 +0200 +@@ -33,9 +33,14 @@ + + // Written by Benjamin Kosnik + ++#include ++#ifdef __UCLIBC_HAS_LOCALE__ + #define _LIBC + #include + #undef _LIBC ++#else ++#include ++#endif + #include + + #ifdef __UCLIBC_MJN3_ONLY__ +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.h +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h 2008-06-10 14:58:43.000000000 +0200 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.h 2008-06-10 14:58:51.000000000 +0200 +@@ -37,25 +37,33 @@ + template + __timepunct<_CharT>::__timepunct(size_t __refs) + : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), +- _M_name_timepunct(_S_get_c_name()) ++ _M_name_timepunct(_S_get_c_name()) + { _M_initialize_timepunct(); } + + template + __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) + : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), +- _M_name_timepunct(_S_get_c_name()) ++ _M_name_timepunct(_S_get_c_name()) + { _M_initialize_timepunct(); } + + template + __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s, + size_t __refs) + : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), +- _M_name_timepunct(__s) ++ _M_name_timepunct(NULL) + { +- char* __tmp = new char[std::strlen(__s) + 1]; +- std::strcpy(__tmp, __s); ++ const size_t __len = std::strlen(__s) + 1; ++ char* __tmp = new char[__len]; ++ std::memcpy(__tmp, __s, __len); + _M_name_timepunct = __tmp; +- _M_initialize_timepunct(__cloc); ++ ++ try ++ { _M_initialize_timepunct(__cloc); } ++ catch(...) ++ { ++ delete [] _M_name_timepunct; ++ __throw_exception_again; ++ } + } + + template diff --git a/patches/gcc/4.3.1/625-301-missing-execinfo_h.patch b/patches/gcc/4.3.1/625-301-missing-execinfo_h.patch deleted file mode 100644 index fa749b2..0000000 --- a/patches/gcc/4.3.1/625-301-missing-execinfo_h.patch +++ /dev/null @@ -1,13 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_301-missing-execinfo_h.patch -diff -durN gcc-4.3.1.orig/boehm-gc/include/gc.h gcc-4.3.1/boehm-gc/include/gc.h ---- gcc-4.3.1.orig/boehm-gc/include/gc.h 2007-04-23 23:10:09.000000000 +0200 -+++ gcc-4.3.1/boehm-gc/include/gc.h 2008-06-10 14:58:54.000000000 +0200 -@@ -503,7 +503,7 @@ - #if defined(__linux__) || defined(__GLIBC__) - # include - # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \ -- && !defined(__ia64__) -+ && !defined(__ia64__) && !defined(__UCLIBC__) - # ifndef GC_HAVE_BUILTIN_BACKTRACE - # define GC_HAVE_BUILTIN_BACKTRACE - # endif diff --git a/patches/gcc/4.3.1/625-missing-execinfo_h.patch b/patches/gcc/4.3.1/625-missing-execinfo_h.patch new file mode 100644 index 0000000..fa749b2 --- /dev/null +++ b/patches/gcc/4.3.1/625-missing-execinfo_h.patch @@ -0,0 +1,13 @@ +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_301-missing-execinfo_h.patch +diff -durN gcc-4.3.1.orig/boehm-gc/include/gc.h gcc-4.3.1/boehm-gc/include/gc.h +--- gcc-4.3.1.orig/boehm-gc/include/gc.h 2007-04-23 23:10:09.000000000 +0200 ++++ gcc-4.3.1/boehm-gc/include/gc.h 2008-06-10 14:58:54.000000000 +0200 +@@ -503,7 +503,7 @@ + #if defined(__linux__) || defined(__GLIBC__) + # include + # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \ +- && !defined(__ia64__) ++ && !defined(__ia64__) && !defined(__UCLIBC__) + # ifndef GC_HAVE_BUILTIN_BACKTRACE + # define GC_HAVE_BUILTIN_BACKTRACE + # endif diff --git a/patches/gcc/4.3.1/650-303-c99-complex-ugly-hack.patch b/patches/gcc/4.3.1/650-303-c99-complex-ugly-hack.patch deleted file mode 100644 index 7aa36f8..0000000 --- a/patches/gcc/4.3.1/650-303-c99-complex-ugly-hack.patch +++ /dev/null @@ -1,14 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_303-c99-complex-ugly-hack.patch -diff -durN gcc-4.3.1.orig/libstdc++-v3/configure gcc-4.3.1/libstdc++-v3/configure ---- gcc-4.3.1.orig/libstdc++-v3/configure 2008-06-10 14:58:43.000000000 +0200 -+++ gcc-4.3.1/libstdc++-v3/configure 2008-06-10 14:58:58.000000000 +0200 -@@ -39006,6 +39006,9 @@ - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - #include -+#ifdef __UCLIBC__ -+#error ugly hack to make sure configure test fails here for cross until uClibc supports the complex funcs -+#endif - int - main () - { diff --git a/patches/gcc/4.3.1/650-c99-complex-ugly-hack.patch b/patches/gcc/4.3.1/650-c99-complex-ugly-hack.patch new file mode 100644 index 0000000..7aa36f8 --- /dev/null +++ b/patches/gcc/4.3.1/650-c99-complex-ugly-hack.patch @@ -0,0 +1,14 @@ +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_303-c99-complex-ugly-hack.patch +diff -durN gcc-4.3.1.orig/libstdc++-v3/configure gcc-4.3.1/libstdc++-v3/configure +--- gcc-4.3.1.orig/libstdc++-v3/configure 2008-06-10 14:58:43.000000000 +0200 ++++ gcc-4.3.1/libstdc++-v3/configure 2008-06-10 14:58:58.000000000 +0200 +@@ -39006,6 +39006,9 @@ + cat >>conftest.$ac_ext <<_ACEOF + /* end confdefs.h. */ + #include ++#ifdef __UCLIBC__ ++#error ugly hack to make sure configure test fails here for cross until uClibc supports the complex funcs ++#endif + int + main () + { diff --git a/patches/gcc/4.3.1/675-304-index_macro.patch b/patches/gcc/4.3.1/675-304-index_macro.patch deleted file mode 100644 index 65794aa..0000000 --- a/patches/gcc/4.3.1/675-304-index_macro.patch +++ /dev/null @@ -1,27 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_304-index_macro.patch -diff -durN gcc-4.3.1.orig/libstdc++-v3/include/ext/rope gcc-4.3.1/libstdc++-v3/include/ext/rope ---- gcc-4.3.1.orig/libstdc++-v3/include/ext/rope 2008-01-31 19:44:55.000000000 +0100 -+++ gcc-4.3.1/libstdc++-v3/include/ext/rope 2008-06-10 14:59:02.000000000 +0200 -@@ -59,6 +59,9 @@ - #include - #include - -+/* cope w/ index defined as macro, SuSv3 proposal */ -+#undef index -+ - # ifdef __GC - # define __GC_CONST const - # else -diff -durN gcc-4.3.1.orig/libstdc++-v3/include/ext/ropeimpl.h gcc-4.3.1/libstdc++-v3/include/ext/ropeimpl.h ---- gcc-4.3.1.orig/libstdc++-v3/include/ext/ropeimpl.h 2007-05-04 17:06:46.000000000 +0200 -+++ gcc-4.3.1/libstdc++-v3/include/ext/ropeimpl.h 2008-06-10 14:59:02.000000000 +0200 -@@ -54,6 +54,9 @@ - #include // For uninitialized_copy_n - #include // For power - -+/* cope w/ index defined as macro, SuSv3 proposal */ -+#undef index -+ - _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) - - using std::size_t; diff --git a/patches/gcc/4.3.1/675-index_macro.patch b/patches/gcc/4.3.1/675-index_macro.patch new file mode 100644 index 0000000..65794aa --- /dev/null +++ b/patches/gcc/4.3.1/675-index_macro.patch @@ -0,0 +1,27 @@ +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_304-index_macro.patch +diff -durN gcc-4.3.1.orig/libstdc++-v3/include/ext/rope gcc-4.3.1/libstdc++-v3/include/ext/rope +--- gcc-4.3.1.orig/libstdc++-v3/include/ext/rope 2008-01-31 19:44:55.000000000 +0100 ++++ gcc-4.3.1/libstdc++-v3/include/ext/rope 2008-06-10 14:59:02.000000000 +0200 +@@ -59,6 +59,9 @@ + #include + #include + ++/* cope w/ index defined as macro, SuSv3 proposal */ ++#undef index ++ + # ifdef __GC + # define __GC_CONST const + # else +diff -durN gcc-4.3.1.orig/libstdc++-v3/include/ext/ropeimpl.h gcc-4.3.1/libstdc++-v3/include/ext/ropeimpl.h +--- gcc-4.3.1.orig/libstdc++-v3/include/ext/ropeimpl.h 2007-05-04 17:06:46.000000000 +0200 ++++ gcc-4.3.1/libstdc++-v3/include/ext/ropeimpl.h 2008-06-10 14:59:02.000000000 +0200 +@@ -54,6 +54,9 @@ + #include // For uninitialized_copy_n + #include // For power + ++/* cope w/ index defined as macro, SuSv3 proposal */ ++#undef index ++ + _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) + + using std::size_t; diff --git a/patches/gcc/4.3.1/700-305-libmudflap-susv3-legacy.patch b/patches/gcc/4.3.1/700-305-libmudflap-susv3-legacy.patch deleted file mode 100644 index 9672fc4..0000000 --- a/patches/gcc/4.3.1/700-305-libmudflap-susv3-legacy.patch +++ /dev/null @@ -1,49 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_305-libmudflap-susv3-legacy.patch -diff -durN gcc-4.3.1.orig/libmudflap/mf-hooks2.c gcc-4.3.1/libmudflap/mf-hooks2.c ---- gcc-4.3.1.orig/libmudflap/mf-hooks2.c 2005-09-23 23:58:39.000000000 +0200 -+++ gcc-4.3.1/libmudflap/mf-hooks2.c 2008-06-10 14:59:05.000000000 +0200 -@@ -427,7 +427,7 @@ - { - TRACE ("%s\n", __PRETTY_FUNCTION__); - MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region"); -- bzero (s, n); -+ memset (s, 0, n); - } - - -@@ -437,7 +437,7 @@ - TRACE ("%s\n", __PRETTY_FUNCTION__); - MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src"); - MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest"); -- bcopy (src, dest, n); -+ memmove (dest, src, n); - } - - -@@ -447,7 +447,7 @@ - TRACE ("%s\n", __PRETTY_FUNCTION__); - MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg"); - MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg"); -- return bcmp (s1, s2, n); -+ return memcmp (s1, s2, n); - } - - -@@ -456,7 +456,7 @@ - size_t n = strlen (s); - TRACE ("%s\n", __PRETTY_FUNCTION__); - MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region"); -- return index (s, c); -+ return strchr (s, c); - } - - -@@ -465,7 +465,7 @@ - size_t n = strlen (s); - TRACE ("%s\n", __PRETTY_FUNCTION__); - MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region"); -- return rindex (s, c); -+ return strrchr (s, c); - } - - /* XXX: stpcpy, memccpy */ diff --git a/patches/gcc/4.3.1/700-libmudflap-susv3-legacy.patch b/patches/gcc/4.3.1/700-libmudflap-susv3-legacy.patch new file mode 100644 index 0000000..9672fc4 --- /dev/null +++ b/patches/gcc/4.3.1/700-libmudflap-susv3-legacy.patch @@ -0,0 +1,49 @@ +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_305-libmudflap-susv3-legacy.patch +diff -durN gcc-4.3.1.orig/libmudflap/mf-hooks2.c gcc-4.3.1/libmudflap/mf-hooks2.c +--- gcc-4.3.1.orig/libmudflap/mf-hooks2.c 2005-09-23 23:58:39.000000000 +0200 ++++ gcc-4.3.1/libmudflap/mf-hooks2.c 2008-06-10 14:59:05.000000000 +0200 +@@ -427,7 +427,7 @@ + { + TRACE ("%s\n", __PRETTY_FUNCTION__); + MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region"); +- bzero (s, n); ++ memset (s, 0, n); + } + + +@@ -437,7 +437,7 @@ + TRACE ("%s\n", __PRETTY_FUNCTION__); + MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src"); + MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest"); +- bcopy (src, dest, n); ++ memmove (dest, src, n); + } + + +@@ -447,7 +447,7 @@ + TRACE ("%s\n", __PRETTY_FUNCTION__); + MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg"); + MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg"); +- return bcmp (s1, s2, n); ++ return memcmp (s1, s2, n); + } + + +@@ -456,7 +456,7 @@ + size_t n = strlen (s); + TRACE ("%s\n", __PRETTY_FUNCTION__); + MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region"); +- return index (s, c); ++ return strchr (s, c); + } + + +@@ -465,7 +465,7 @@ + size_t n = strlen (s); + TRACE ("%s\n", __PRETTY_FUNCTION__); + MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region"); +- return rindex (s, c); ++ return strrchr (s, c); + } + + /* XXX: stpcpy, memccpy */ diff --git a/patches/gcc/4.3.1/725-306-libstdc++-namespace.patch b/patches/gcc/4.3.1/725-306-libstdc++-namespace.patch deleted file mode 100644 index eee4e50..0000000 --- a/patches/gcc/4.3.1/725-306-libstdc++-namespace.patch +++ /dev/null @@ -1,38 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_306-libstdc++-namespace.patch -diff -rup gcc-4.2.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.2/libstdc++-v3/config/locale/uclibc/messages_members.h -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:58:54.000000000 +0200 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:59:09.000000000 +0200 -@@ -32,7 +32,8 @@ - // - - // Written by Benjamin Kosnik -- -+namespace std -+{ - #ifdef __UCLIBC_MJN3_ONLY__ - #warning fix prototypes for *textdomain funcs - #endif -@@ -115,3 +116,4 @@ - this->_S_create_c_locale(this->_M_c_locale_messages, __s); - } - } -+} -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.h ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h 2008-06-10 14:58:54.000000000 +0200 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.h 2008-06-10 14:59:09.000000000 +0200 -@@ -33,7 +33,8 @@ - // - - // Written by Benjamin Kosnik -- -+namespace std -+{ - template - __timepunct<_CharT>::__timepunct(size_t __refs) - : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), -@@ -74,3 +75,4 @@ - delete _M_data; - _S_destroy_c_locale(_M_c_locale_timepunct); - } -+} diff --git a/patches/gcc/4.3.1/725-libstdc++-namespace.patch b/patches/gcc/4.3.1/725-libstdc++-namespace.patch new file mode 100644 index 0000000..eee4e50 --- /dev/null +++ b/patches/gcc/4.3.1/725-libstdc++-namespace.patch @@ -0,0 +1,38 @@ +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_306-libstdc++-namespace.patch +diff -rup gcc-4.2.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.2/libstdc++-v3/config/locale/uclibc/messages_members.h +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:58:54.000000000 +0200 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:59:09.000000000 +0200 +@@ -32,7 +32,8 @@ + // + + // Written by Benjamin Kosnik +- ++namespace std ++{ + #ifdef __UCLIBC_MJN3_ONLY__ + #warning fix prototypes for *textdomain funcs + #endif +@@ -115,3 +116,4 @@ + this->_S_create_c_locale(this->_M_c_locale_messages, __s); + } + } ++} +diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.h +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h 2008-06-10 14:58:54.000000000 +0200 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.h 2008-06-10 14:59:09.000000000 +0200 +@@ -33,7 +33,8 @@ + // + + // Written by Benjamin Kosnik +- ++namespace std ++{ + template + __timepunct<_CharT>::__timepunct(size_t __refs) + : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), +@@ -74,3 +75,4 @@ + delete _M_data; + _S_destroy_c_locale(_M_c_locale_timepunct); + } ++} diff --git a/patches/gcc/4.3.1/940-alpha-signal_h.patch b/patches/gcc/4.3.1/940-alpha-signal_h.patch new file mode 100644 index 0000000..d7e1796 --- /dev/null +++ b/patches/gcc/4.3.1/940-alpha-signal_h.patch @@ -0,0 +1,17 @@ +--- gcc-4.2.1-stock/gcc/config/alpha/linux-unwind.h 2005-06-24 20:22:41.000000000 -0500 ++++ gcc-4.2.1/gcc/config/alpha/linux-unwind.h 2007-09-01 20:21:34.000000000 -0500 +@@ -29,6 +29,9 @@ Boston, MA 02110-1301, USA. */ + /* Do code reading to identify a signal frame, and set the frame + state data appropriately. See unwind-dw2.c for the structs. */ + ++/* Don't use this if inhibit_libc is set ++ The build for this target will fail trying to include missing headers */ ++#ifndef inhibit_libc + #include + #include + +@@ -80,3 +83,4 @@ alpha_fallback_frame_state (struct _Unwi + fs->retaddr_column = 64; + return _URC_NO_REASON; + } ++#endif /* inhibit_libc */ diff --git a/patches/gcc/4.3.1/940-gcc-alpha-signal_h.patch b/patches/gcc/4.3.1/940-gcc-alpha-signal_h.patch deleted file mode 100644 index d7e1796..0000000 --- a/patches/gcc/4.3.1/940-gcc-alpha-signal_h.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- gcc-4.2.1-stock/gcc/config/alpha/linux-unwind.h 2005-06-24 20:22:41.000000000 -0500 -+++ gcc-4.2.1/gcc/config/alpha/linux-unwind.h 2007-09-01 20:21:34.000000000 -0500 -@@ -29,6 +29,9 @@ Boston, MA 02110-1301, USA. */ - /* Do code reading to identify a signal frame, and set the frame - state data appropriately. See unwind-dw2.c for the structs. */ - -+/* Don't use this if inhibit_libc is set -+ The build for this target will fail trying to include missing headers */ -+#ifndef inhibit_libc - #include - #include - -@@ -80,3 +83,4 @@ alpha_fallback_frame_state (struct _Unwi - fs->retaddr_column = 64; - return _URC_NO_REASON; - } -+#endif /* inhibit_libc */ diff --git a/patches/gdb/6.7.1/150-gdb-6.3-security-errata-20050610.patch b/patches/gdb/6.7.1/150-gdb-6.3-security-errata-20050610.patch deleted file mode 100644 index 30c7f26..0000000 --- a/patches/gdb/6.7.1/150-gdb-6.3-security-errata-20050610.patch +++ /dev/null @@ -1,205 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gdb/6.7.1/35_all_gdb-6.3-security-errata-20050610.patch --= BEGIN original header =- -2005-06-09 Jeff Johnston - - * gdb.base/gdbinit.exp: New testcase. - * gdb.base/gdbinit.sample: Sample .gdbinit for gdbinit.exp. - -2005-06-08 Daniel Jacobowitz - Jeff Johnston - - * Makefile.in (cli-cmds.o): Update. - * configure.in: Add check for getuid. - * configure: Regenerated. - * config.in: Ditto. - * main.c (captured_main): Pass -1 to source_command when loading - gdbinit files. - * cli/cli-cmds.c: Include "gdb_stat.h" and . - (source_command): Update documentation. Check permissions if - FROM_TTY is -1. - --= END original header =- -diff -durN gdb-6.7.1.orig/gdb/cli/cli-cmds.c gdb-6.7.1/gdb/cli/cli-cmds.c ---- gdb-6.7.1.orig/gdb/cli/cli-cmds.c 2007-08-23 20:08:47.000000000 +0200 -+++ gdb-6.7.1/gdb/cli/cli-cmds.c 2008-06-17 23:27:44.000000000 +0200 -@@ -36,6 +36,7 @@ - #include "objfiles.h" - #include "source.h" - #include "disasm.h" -+#include "gdb_stat.h" - - #include "ui-out.h" - -@@ -459,12 +460,31 @@ - - if (fd == -1) - { -- if (from_tty) -+ if (from_tty > 0) - perror_with_name (file); - else - return; - } - -+#ifdef HAVE_GETUID -+ if (from_tty == -1) -+ { -+ struct stat statbuf; -+ if (fstat (fd, &statbuf) < 0) -+ { -+ perror_with_name (file); -+ close (fd); -+ return; -+ } -+ if (statbuf.st_uid != getuid () || (statbuf.st_mode & S_IWOTH)) -+ { -+ warning (_("not using untrusted file \"%s\""), file); -+ close (fd); -+ return; -+ } -+ } -+#endif -+ - stream = fdopen (fd, FOPEN_RT); - script_from_file (stream, file); - -diff -durN gdb-6.7.1.orig/gdb/main.c gdb-6.7.1/gdb/main.c ---- gdb-6.7.1.orig/gdb/main.c 2007-08-23 20:08:36.000000000 +0200 -+++ gdb-6.7.1/gdb/main.c 2008-06-17 23:27:44.000000000 +0200 -@@ -688,7 +688,7 @@ - - if (!inhibit_gdbinit) - { -- catch_command_errors (source_script, homeinit, 0, RETURN_MASK_ALL); -+ catch_command_errors (source_script, homeinit, -1, RETURN_MASK_ALL); - } - - /* Do stats; no need to do them elsewhere since we'll only -@@ -766,7 +766,7 @@ - || memcmp ((char *) &homebuf, (char *) &cwdbuf, sizeof (struct stat))) - if (!inhibit_gdbinit) - { -- catch_command_errors (source_script, gdbinit, 0, RETURN_MASK_ALL); -+ catch_command_errors (source_script, gdbinit, -1, RETURN_MASK_ALL); - } - - for (i = 0; i < ncmd; i++) -diff -durN gdb-6.7.1.orig/gdb/Makefile.in gdb-6.7.1/gdb/Makefile.in ---- gdb-6.7.1.orig/gdb/Makefile.in 2008-06-17 23:27:44.000000000 +0200 -+++ gdb-6.7.1/gdb/Makefile.in 2008-06-17 23:27:44.000000000 +0200 -@@ -2885,7 +2885,7 @@ - $(expression_h) $(frame_h) $(value_h) $(language_h) $(filenames_h) \ - $(objfiles_h) $(source_h) $(disasm_h) $(ui_out_h) $(top_h) \ - $(cli_decode_h) $(cli_script_h) $(cli_setshow_h) $(cli_cmds_h) \ -- $(tui_h) -+ $(tui_h) $(gdb_stat_h) - $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-cmds.c - cli-decode.o: $(srcdir)/cli/cli-decode.c $(defs_h) $(symtab_h) \ - $(gdb_regex_h) $(gdb_string_h) $(completer_h) $(ui_out_h) \ -diff -durN gdb-6.7.1.orig/gdb/testsuite/gdb.base/gdbinit.exp gdb-6.7.1/gdb/testsuite/gdb.base/gdbinit.exp ---- gdb-6.7.1.orig/gdb/testsuite/gdb.base/gdbinit.exp 1970-01-01 01:00:00.000000000 +0100 -+++ gdb-6.7.1/gdb/testsuite/gdb.base/gdbinit.exp 2008-06-17 23:27:44.000000000 +0200 -@@ -0,0 +1,98 @@ -+# Copyright 2005 -+# Free Software Foundation, Inc. -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 2 of the License, or -+# (at your option) any later version. -+# -+# This program 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 General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program; if not, write to the Free Software -+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -+ -+# Please email any bugs, comments, and/or additions to this file to: -+# bug-gdb@prep.ai.mit.edu -+ -+# This file was written by Jeff Johnston . -+ -+if $tracelevel then { -+ strace $tracelevel -+} -+ -+set prms_id 0 -+set bug_id 0 -+ -+# are we on a target board -+if [is_remote target] { -+ return -+} -+ -+ -+global verbose -+global GDB -+global GDBFLAGS -+global gdb_prompt -+global timeout -+global gdb_spawn_id; -+ -+gdb_stop_suppressing_tests; -+ -+verbose "Spawning $GDB -nw" -+ -+if [info exists gdb_spawn_id] { -+ return 0; -+} -+ -+if ![is_remote host] { -+ if { [which $GDB] == 0 } then { -+ perror "$GDB does not exist." -+ exit 1 -+ } -+} -+ -+set env(HOME) [pwd] -+remote_exec build "rm .gdbinit" -+remote_exec build "cp ${srcdir}/${subdir}/gdbinit.sample .gdbinit" -+remote_exec build "chmod 646 .gdbinit" -+ -+set res [remote_spawn host "$GDB -nw [host_info gdb_opts]"]; -+if { $res < 0 || $res == "" } { -+ perror "Spawning $GDB failed." -+ return 1; -+} -+gdb_expect 360 { -+ -re "warning: not using untrusted file.*\.gdbinit.*\[\r\n\]$gdb_prompt $" { -+ pass "untrusted .gdbinit caught." -+ } -+ -re "$gdb_prompt $" { -+ fail "untrusted .gdbinit caught." -+ } -+ timeout { -+ fail "(timeout) untrusted .gdbinit caught." -+ } -+} -+ -+remote_exec build "chmod 644 .gdbinit" -+set res [remote_spawn host "$GDB -nw [host_info gdb_opts]"]; -+if { $res < 0 || $res == "" } { -+ perror "Spawning $GDB failed." -+ return 1; -+} -+gdb_expect 360 { -+ -re "warning: not using untrusted file.*\.gdbinit.*\[\r\n\]$gdb_prompt $" { -+ fail "trusted .gdbinit allowed." -+ } -+ -re "in gdbinit.*$gdb_prompt $" { -+ pass "trusted .gdbinit allowed." -+ } -+ timeout { -+ fail "(timeout) trusted .gdbinit allowed." -+ } -+} -+ -+remote_exec build "rm .gdbinit" -diff -durN gdb-6.7.1.orig/gdb/testsuite/gdb.base/gdbinit.sample gdb-6.7.1/gdb/testsuite/gdb.base/gdbinit.sample ---- gdb-6.7.1.orig/gdb/testsuite/gdb.base/gdbinit.sample 1970-01-01 01:00:00.000000000 +0100 -+++ gdb-6.7.1/gdb/testsuite/gdb.base/gdbinit.sample 2008-06-17 23:27:44.000000000 +0200 -@@ -0,0 +1 @@ -+echo "\nin gdbinit" diff --git a/patches/gdb/6.7.1/150-security-errata-20050610.patch b/patches/gdb/6.7.1/150-security-errata-20050610.patch new file mode 100644 index 0000000..30c7f26 --- /dev/null +++ b/patches/gdb/6.7.1/150-security-errata-20050610.patch @@ -0,0 +1,205 @@ +Original patch from gentoo: gentoo/src/patchsets/gdb/6.7.1/35_all_gdb-6.3-security-errata-20050610.patch +-= BEGIN original header =- +2005-06-09 Jeff Johnston + + * gdb.base/gdbinit.exp: New testcase. + * gdb.base/gdbinit.sample: Sample .gdbinit for gdbinit.exp. + +2005-06-08 Daniel Jacobowitz + Jeff Johnston + + * Makefile.in (cli-cmds.o): Update. + * configure.in: Add check for getuid. + * configure: Regenerated. + * config.in: Ditto. + * main.c (captured_main): Pass -1 to source_command when loading + gdbinit files. + * cli/cli-cmds.c: Include "gdb_stat.h" and . + (source_command): Update documentation. Check permissions if + FROM_TTY is -1. + +-= END original header =- +diff -durN gdb-6.7.1.orig/gdb/cli/cli-cmds.c gdb-6.7.1/gdb/cli/cli-cmds.c +--- gdb-6.7.1.orig/gdb/cli/cli-cmds.c 2007-08-23 20:08:47.000000000 +0200 ++++ gdb-6.7.1/gdb/cli/cli-cmds.c 2008-06-17 23:27:44.000000000 +0200 +@@ -36,6 +36,7 @@ + #include "objfiles.h" + #include "source.h" + #include "disasm.h" ++#include "gdb_stat.h" + + #include "ui-out.h" + +@@ -459,12 +460,31 @@ + + if (fd == -1) + { +- if (from_tty) ++ if (from_tty > 0) + perror_with_name (file); + else + return; + } + ++#ifdef HAVE_GETUID ++ if (from_tty == -1) ++ { ++ struct stat statbuf; ++ if (fstat (fd, &statbuf) < 0) ++ { ++ perror_with_name (file); ++ close (fd); ++ return; ++ } ++ if (statbuf.st_uid != getuid () || (statbuf.st_mode & S_IWOTH)) ++ { ++ warning (_("not using untrusted file \"%s\""), file); ++ close (fd); ++ return; ++ } ++ } ++#endif ++ + stream = fdopen (fd, FOPEN_RT); + script_from_file (stream, file); + +diff -durN gdb-6.7.1.orig/gdb/main.c gdb-6.7.1/gdb/main.c +--- gdb-6.7.1.orig/gdb/main.c 2007-08-23 20:08:36.000000000 +0200 ++++ gdb-6.7.1/gdb/main.c 2008-06-17 23:27:44.000000000 +0200 +@@ -688,7 +688,7 @@ + + if (!inhibit_gdbinit) + { +- catch_command_errors (source_script, homeinit, 0, RETURN_MASK_ALL); ++ catch_command_errors (source_script, homeinit, -1, RETURN_MASK_ALL); + } + + /* Do stats; no need to do them elsewhere since we'll only +@@ -766,7 +766,7 @@ + || memcmp ((char *) &homebuf, (char *) &cwdbuf, sizeof (struct stat))) + if (!inhibit_gdbinit) + { +- catch_command_errors (source_script, gdbinit, 0, RETURN_MASK_ALL); ++ catch_command_errors (source_script, gdbinit, -1, RETURN_MASK_ALL); + } + + for (i = 0; i < ncmd; i++) +diff -durN gdb-6.7.1.orig/gdb/Makefile.in gdb-6.7.1/gdb/Makefile.in +--- gdb-6.7.1.orig/gdb/Makefile.in 2008-06-17 23:27:44.000000000 +0200 ++++ gdb-6.7.1/gdb/Makefile.in 2008-06-17 23:27:44.000000000 +0200 +@@ -2885,7 +2885,7 @@ + $(expression_h) $(frame_h) $(value_h) $(language_h) $(filenames_h) \ + $(objfiles_h) $(source_h) $(disasm_h) $(ui_out_h) $(top_h) \ + $(cli_decode_h) $(cli_script_h) $(cli_setshow_h) $(cli_cmds_h) \ +- $(tui_h) ++ $(tui_h) $(gdb_stat_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-cmds.c + cli-decode.o: $(srcdir)/cli/cli-decode.c $(defs_h) $(symtab_h) \ + $(gdb_regex_h) $(gdb_string_h) $(completer_h) $(ui_out_h) \ +diff -durN gdb-6.7.1.orig/gdb/testsuite/gdb.base/gdbinit.exp gdb-6.7.1/gdb/testsuite/gdb.base/gdbinit.exp +--- gdb-6.7.1.orig/gdb/testsuite/gdb.base/gdbinit.exp 1970-01-01 01:00:00.000000000 +0100 ++++ gdb-6.7.1/gdb/testsuite/gdb.base/gdbinit.exp 2008-06-17 23:27:44.000000000 +0200 +@@ -0,0 +1,98 @@ ++# Copyright 2005 ++# Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 2 of the License, or ++# (at your option) any later version. ++# ++# This program 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 General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++ ++# Please email any bugs, comments, and/or additions to this file to: ++# bug-gdb@prep.ai.mit.edu ++ ++# This file was written by Jeff Johnston . ++ ++if $tracelevel then { ++ strace $tracelevel ++} ++ ++set prms_id 0 ++set bug_id 0 ++ ++# are we on a target board ++if [is_remote target] { ++ return ++} ++ ++ ++global verbose ++global GDB ++global GDBFLAGS ++global gdb_prompt ++global timeout ++global gdb_spawn_id; ++ ++gdb_stop_suppressing_tests; ++ ++verbose "Spawning $GDB -nw" ++ ++if [info exists gdb_spawn_id] { ++ return 0; ++} ++ ++if ![is_remote host] { ++ if { [which $GDB] == 0 } then { ++ perror "$GDB does not exist." ++ exit 1 ++ } ++} ++ ++set env(HOME) [pwd] ++remote_exec build "rm .gdbinit" ++remote_exec build "cp ${srcdir}/${subdir}/gdbinit.sample .gdbinit" ++remote_exec build "chmod 646 .gdbinit" ++ ++set res [remote_spawn host "$GDB -nw [host_info gdb_opts]"]; ++if { $res < 0 || $res == "" } { ++ perror "Spawning $GDB failed." ++ return 1; ++} ++gdb_expect 360 { ++ -re "warning: not using untrusted file.*\.gdbinit.*\[\r\n\]$gdb_prompt $" { ++ pass "untrusted .gdbinit caught." ++ } ++ -re "$gdb_prompt $" { ++ fail "untrusted .gdbinit caught." ++ } ++ timeout { ++ fail "(timeout) untrusted .gdbinit caught." ++ } ++} ++ ++remote_exec build "chmod 644 .gdbinit" ++set res [remote_spawn host "$GDB -nw [host_info gdb_opts]"]; ++if { $res < 0 || $res == "" } { ++ perror "Spawning $GDB failed." ++ return 1; ++} ++gdb_expect 360 { ++ -re "warning: not using untrusted file.*\.gdbinit.*\[\r\n\]$gdb_prompt $" { ++ fail "trusted .gdbinit allowed." ++ } ++ -re "in gdbinit.*$gdb_prompt $" { ++ pass "trusted .gdbinit allowed." ++ } ++ timeout { ++ fail "(timeout) trusted .gdbinit allowed." ++ } ++} ++ ++remote_exec build "rm .gdbinit" +diff -durN gdb-6.7.1.orig/gdb/testsuite/gdb.base/gdbinit.sample gdb-6.7.1/gdb/testsuite/gdb.base/gdbinit.sample +--- gdb-6.7.1.orig/gdb/testsuite/gdb.base/gdbinit.sample 1970-01-01 01:00:00.000000000 +0100 ++++ gdb-6.7.1/gdb/testsuite/gdb.base/gdbinit.sample 2008-06-17 23:27:44.000000000 +0200 +@@ -0,0 +1 @@ ++echo "\nin gdbinit" diff --git a/patches/gdb/6.7.1/175-gdb-hppa-offsets.patch b/patches/gdb/6.7.1/175-gdb-hppa-offsets.patch deleted file mode 100644 index 06e1e74..0000000 --- a/patches/gdb/6.7.1/175-gdb-hppa-offsets.patch +++ /dev/null @@ -1,272 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gdb/6.7.1/45_all_gdb-hppa-offsets.patch --= BEGIN original header =- -sanitized headers dont include asm/offsets.h, so cache a local copy - -http://bugs.gentoo.org/180476 -http://lists.parisc-linux.org/pipermail/parisc-linux/2007-February/031162.html - --= END original header =- -diff -durN gdb-6.7.1.orig/gdb/hppa-linux-nat.c gdb-6.7.1/gdb/hppa-linux-nat.c ---- gdb-6.7.1.orig/gdb/hppa-linux-nat.c 2007-08-23 20:08:33.000000000 +0200 -+++ gdb-6.7.1/gdb/hppa-linux-nat.c 2008-06-17 23:27:45.000000000 +0200 -@@ -32,7 +32,7 @@ - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,43) - #include - #else --#include -+#include - #endif - - #include "hppa-tdep.h" -diff -durN gdb-6.7.1.orig/gdb/hppa-offsets.h gdb-6.7.1/gdb/hppa-offsets.h ---- gdb-6.7.1.orig/gdb/hppa-offsets.h 1970-01-01 01:00:00.000000000 +0100 -+++ gdb-6.7.1/gdb/hppa-offsets.h 2008-06-17 23:27:45.000000000 +0200 -@@ -0,0 +1,248 @@ -+#ifndef __ASM_OFFSETS_H__ -+#define __ASM_OFFSETS_H__ -+/* -+ * DO NOT MODIFY. -+ * -+ * This file was generated by arch/parisc/Makefile -+ * -+ */ -+ -+#define TASK_THREAD_INFO 4 /* offsetof(struct task_struct, thread_info) */ -+#define TASK_STATE 0 /* offsetof(struct task_struct, state) */ -+#define TASK_FLAGS 12 /* offsetof(struct task_struct, flags) */ -+#define TASK_SIGPENDING 1188 /* offsetof(struct task_struct, pending) */ -+#define TASK_PTRACE 16 /* offsetof(struct task_struct, ptrace) */ -+#define TASK_MM 108 /* offsetof(struct task_struct, mm) */ -+#define TASK_PERSONALITY 132 /* offsetof(struct task_struct, personality) */ -+#define TASK_PID 140 /* offsetof(struct task_struct, pid) */ -+ -+#define TASK_REGS 664 /* offsetof(struct task_struct, thread.regs) */ -+#define TASK_PT_PSW 664 /* offsetof(struct task_struct, thread.regs.gr[ 0]) */ -+#define TASK_PT_GR1 668 /* offsetof(struct task_struct, thread.regs.gr[ 1]) */ -+#define TASK_PT_GR2 672 /* offsetof(struct task_struct, thread.regs.gr[ 2]) */ -+#define TASK_PT_GR3 676 /* offsetof(struct task_struct, thread.regs.gr[ 3]) */ -+#define TASK_PT_GR4 680 /* offsetof(struct task_struct, thread.regs.gr[ 4]) */ -+#define TASK_PT_GR5 684 /* offsetof(struct task_struct, thread.regs.gr[ 5]) */ -+#define TASK_PT_GR6 688 /* offsetof(struct task_struct, thread.regs.gr[ 6]) */ -+#define TASK_PT_GR7 692 /* offsetof(struct task_struct, thread.regs.gr[ 7]) */ -+#define TASK_PT_GR8 696 /* offsetof(struct task_struct, thread.regs.gr[ 8]) */ -+#define TASK_PT_GR9 700 /* offsetof(struct task_struct, thread.regs.gr[ 9]) */ -+#define TASK_PT_GR10 704 /* offsetof(struct task_struct, thread.regs.gr[10]) */ -+#define TASK_PT_GR11 708 /* offsetof(struct task_struct, thread.regs.gr[11]) */ -+#define TASK_PT_GR12 712 /* offsetof(struct task_struct, thread.regs.gr[12]) */ -+#define TASK_PT_GR13 716 /* offsetof(struct task_struct, thread.regs.gr[13]) */ -+#define TASK_PT_GR14 720 /* offsetof(struct task_struct, thread.regs.gr[14]) */ -+#define TASK_PT_GR15 724 /* offsetof(struct task_struct, thread.regs.gr[15]) */ -+#define TASK_PT_GR16 728 /* offsetof(struct task_struct, thread.regs.gr[16]) */ -+#define TASK_PT_GR17 732 /* offsetof(struct task_struct, thread.regs.gr[17]) */ -+#define TASK_PT_GR18 736 /* offsetof(struct task_struct, thread.regs.gr[18]) */ -+#define TASK_PT_GR19 740 /* offsetof(struct task_struct, thread.regs.gr[19]) */ -+#define TASK_PT_GR20 744 /* offsetof(struct task_struct, thread.regs.gr[20]) */ -+#define TASK_PT_GR21 748 /* offsetof(struct task_struct, thread.regs.gr[21]) */ -+#define TASK_PT_GR22 752 /* offsetof(struct task_struct, thread.regs.gr[22]) */ -+#define TASK_PT_GR23 756 /* offsetof(struct task_struct, thread.regs.gr[23]) */ -+#define TASK_PT_GR24 760 /* offsetof(struct task_struct, thread.regs.gr[24]) */ -+#define TASK_PT_GR25 764 /* offsetof(struct task_struct, thread.regs.gr[25]) */ -+#define TASK_PT_GR26 768 /* offsetof(struct task_struct, thread.regs.gr[26]) */ -+#define TASK_PT_GR27 772 /* offsetof(struct task_struct, thread.regs.gr[27]) */ -+#define TASK_PT_GR28 776 /* offsetof(struct task_struct, thread.regs.gr[28]) */ -+#define TASK_PT_GR29 780 /* offsetof(struct task_struct, thread.regs.gr[29]) */ -+#define TASK_PT_GR30 784 /* offsetof(struct task_struct, thread.regs.gr[30]) */ -+#define TASK_PT_GR31 788 /* offsetof(struct task_struct, thread.regs.gr[31]) */ -+#define TASK_PT_FR0 792 /* offsetof(struct task_struct, thread.regs.fr[ 0]) */ -+#define TASK_PT_FR1 800 /* offsetof(struct task_struct, thread.regs.fr[ 1]) */ -+#define TASK_PT_FR2 808 /* offsetof(struct task_struct, thread.regs.fr[ 2]) */ -+#define TASK_PT_FR3 816 /* offsetof(struct task_struct, thread.regs.fr[ 3]) */ -+#define TASK_PT_FR4 824 /* offsetof(struct task_struct, thread.regs.fr[ 4]) */ -+#define TASK_PT_FR5 832 /* offsetof(struct task_struct, thread.regs.fr[ 5]) */ -+#define TASK_PT_FR6 840 /* offsetof(struct task_struct, thread.regs.fr[ 6]) */ -+#define TASK_PT_FR7 848 /* offsetof(struct task_struct, thread.regs.fr[ 7]) */ -+#define TASK_PT_FR8 856 /* offsetof(struct task_struct, thread.regs.fr[ 8]) */ -+#define TASK_PT_FR9 864 /* offsetof(struct task_struct, thread.regs.fr[ 9]) */ -+#define TASK_PT_FR10 872 /* offsetof(struct task_struct, thread.regs.fr[10]) */ -+#define TASK_PT_FR11 880 /* offsetof(struct task_struct, thread.regs.fr[11]) */ -+#define TASK_PT_FR12 888 /* offsetof(struct task_struct, thread.regs.fr[12]) */ -+#define TASK_PT_FR13 896 /* offsetof(struct task_struct, thread.regs.fr[13]) */ -+#define TASK_PT_FR14 904 /* offsetof(struct task_struct, thread.regs.fr[14]) */ -+#define TASK_PT_FR15 912 /* offsetof(struct task_struct, thread.regs.fr[15]) */ -+#define TASK_PT_FR16 920 /* offsetof(struct task_struct, thread.regs.fr[16]) */ -+#define TASK_PT_FR17 928 /* offsetof(struct task_struct, thread.regs.fr[17]) */ -+#define TASK_PT_FR18 936 /* offsetof(struct task_struct, thread.regs.fr[18]) */ -+#define TASK_PT_FR19 944 /* offsetof(struct task_struct, thread.regs.fr[19]) */ -+#define TASK_PT_FR20 952 /* offsetof(struct task_struct, thread.regs.fr[20]) */ -+#define TASK_PT_FR21 960 /* offsetof(struct task_struct, thread.regs.fr[21]) */ -+#define TASK_PT_FR22 968 /* offsetof(struct task_struct, thread.regs.fr[22]) */ -+#define TASK_PT_FR23 976 /* offsetof(struct task_struct, thread.regs.fr[23]) */ -+#define TASK_PT_FR24 984 /* offsetof(struct task_struct, thread.regs.fr[24]) */ -+#define TASK_PT_FR25 992 /* offsetof(struct task_struct, thread.regs.fr[25]) */ -+#define TASK_PT_FR26 1000 /* offsetof(struct task_struct, thread.regs.fr[26]) */ -+#define TASK_PT_FR27 1008 /* offsetof(struct task_struct, thread.regs.fr[27]) */ -+#define TASK_PT_FR28 1016 /* offsetof(struct task_struct, thread.regs.fr[28]) */ -+#define TASK_PT_FR29 1024 /* offsetof(struct task_struct, thread.regs.fr[29]) */ -+#define TASK_PT_FR30 1032 /* offsetof(struct task_struct, thread.regs.fr[30]) */ -+#define TASK_PT_FR31 1040 /* offsetof(struct task_struct, thread.regs.fr[31]) */ -+#define TASK_PT_SR0 1048 /* offsetof(struct task_struct, thread.regs.sr[ 0]) */ -+#define TASK_PT_SR1 1052 /* offsetof(struct task_struct, thread.regs.sr[ 1]) */ -+#define TASK_PT_SR2 1056 /* offsetof(struct task_struct, thread.regs.sr[ 2]) */ -+#define TASK_PT_SR3 1060 /* offsetof(struct task_struct, thread.regs.sr[ 3]) */ -+#define TASK_PT_SR4 1064 /* offsetof(struct task_struct, thread.regs.sr[ 4]) */ -+#define TASK_PT_SR5 1068 /* offsetof(struct task_struct, thread.regs.sr[ 5]) */ -+#define TASK_PT_SR6 1072 /* offsetof(struct task_struct, thread.regs.sr[ 6]) */ -+#define TASK_PT_SR7 1076 /* offsetof(struct task_struct, thread.regs.sr[ 7]) */ -+#define TASK_PT_IASQ0 1080 /* offsetof(struct task_struct, thread.regs.iasq[0]) */ -+#define TASK_PT_IASQ1 1084 /* offsetof(struct task_struct, thread.regs.iasq[1]) */ -+#define TASK_PT_IAOQ0 1088 /* offsetof(struct task_struct, thread.regs.iaoq[0]) */ -+#define TASK_PT_IAOQ1 1092 /* offsetof(struct task_struct, thread.regs.iaoq[1]) */ -+#define TASK_PT_CR27 1096 /* offsetof(struct task_struct, thread.regs.cr27) */ -+#define TASK_PT_ORIG_R28 1104 /* offsetof(struct task_struct, thread.regs.orig_r28) */ -+#define TASK_PT_KSP 1108 /* offsetof(struct task_struct, thread.regs.ksp) */ -+#define TASK_PT_KPC 1112 /* offsetof(struct task_struct, thread.regs.kpc) */ -+#define TASK_PT_SAR 1116 /* offsetof(struct task_struct, thread.regs.sar) */ -+#define TASK_PT_IIR 1120 /* offsetof(struct task_struct, thread.regs.iir) */ -+#define TASK_PT_ISR 1124 /* offsetof(struct task_struct, thread.regs.isr) */ -+#define TASK_PT_IOR 1128 /* offsetof(struct task_struct, thread.regs.ior) */ -+ -+#define TASK_SZ 1272 /* sizeof(struct task_struct) */ -+#define TASK_SZ_ALGN 1344 /* align(sizeof(struct task_struct), 64) */ -+ -+#define PT_PSW 0 /* offsetof(struct pt_regs, gr[ 0]) */ -+#define PT_GR1 4 /* offsetof(struct pt_regs, gr[ 1]) */ -+#define PT_GR2 8 /* offsetof(struct pt_regs, gr[ 2]) */ -+#define PT_GR3 12 /* offsetof(struct pt_regs, gr[ 3]) */ -+#define PT_GR4 16 /* offsetof(struct pt_regs, gr[ 4]) */ -+#define PT_GR5 20 /* offsetof(struct pt_regs, gr[ 5]) */ -+#define PT_GR6 24 /* offsetof(struct pt_regs, gr[ 6]) */ -+#define PT_GR7 28 /* offsetof(struct pt_regs, gr[ 7]) */ -+#define PT_GR8 32 /* offsetof(struct pt_regs, gr[ 8]) */ -+#define PT_GR9 36 /* offsetof(struct pt_regs, gr[ 9]) */ -+#define PT_GR10 40 /* offsetof(struct pt_regs, gr[10]) */ -+#define PT_GR11 44 /* offsetof(struct pt_regs, gr[11]) */ -+#define PT_GR12 48 /* offsetof(struct pt_regs, gr[12]) */ -+#define PT_GR13 52 /* offsetof(struct pt_regs, gr[13]) */ -+#define PT_GR14 56 /* offsetof(struct pt_regs, gr[14]) */ -+#define PT_GR15 60 /* offsetof(struct pt_regs, gr[15]) */ -+#define PT_GR16 64 /* offsetof(struct pt_regs, gr[16]) */ -+#define PT_GR17 68 /* offsetof(struct pt_regs, gr[17]) */ -+#define PT_GR18 72 /* offsetof(struct pt_regs, gr[18]) */ -+#define PT_GR19 76 /* offsetof(struct pt_regs, gr[19]) */ -+#define PT_GR20 80 /* offsetof(struct pt_regs, gr[20]) */ -+#define PT_GR21 84 /* offsetof(struct pt_regs, gr[21]) */ -+#define PT_GR22 88 /* offsetof(struct pt_regs, gr[22]) */ -+#define PT_GR23 92 /* offsetof(struct pt_regs, gr[23]) */ -+#define PT_GR24 96 /* offsetof(struct pt_regs, gr[24]) */ -+#define PT_GR25 100 /* offsetof(struct pt_regs, gr[25]) */ -+#define PT_GR26 104 /* offsetof(struct pt_regs, gr[26]) */ -+#define PT_GR27 108 /* offsetof(struct pt_regs, gr[27]) */ -+#define PT_GR28 112 /* offsetof(struct pt_regs, gr[28]) */ -+#define PT_GR29 116 /* offsetof(struct pt_regs, gr[29]) */ -+#define PT_GR30 120 /* offsetof(struct pt_regs, gr[30]) */ -+#define PT_GR31 124 /* offsetof(struct pt_regs, gr[31]) */ -+#define PT_FR0 128 /* offsetof(struct pt_regs, fr[ 0]) */ -+#define PT_FR1 136 /* offsetof(struct pt_regs, fr[ 1]) */ -+#define PT_FR2 144 /* offsetof(struct pt_regs, fr[ 2]) */ -+#define PT_FR3 152 /* offsetof(struct pt_regs, fr[ 3]) */ -+#define PT_FR4 160 /* offsetof(struct pt_regs, fr[ 4]) */ -+#define PT_FR5 168 /* offsetof(struct pt_regs, fr[ 5]) */ -+#define PT_FR6 176 /* offsetof(struct pt_regs, fr[ 6]) */ -+#define PT_FR7 184 /* offsetof(struct pt_regs, fr[ 7]) */ -+#define PT_FR8 192 /* offsetof(struct pt_regs, fr[ 8]) */ -+#define PT_FR9 200 /* offsetof(struct pt_regs, fr[ 9]) */ -+#define PT_FR10 208 /* offsetof(struct pt_regs, fr[10]) */ -+#define PT_FR11 216 /* offsetof(struct pt_regs, fr[11]) */ -+#define PT_FR12 224 /* offsetof(struct pt_regs, fr[12]) */ -+#define PT_FR13 232 /* offsetof(struct pt_regs, fr[13]) */ -+#define PT_FR14 240 /* offsetof(struct pt_regs, fr[14]) */ -+#define PT_FR15 248 /* offsetof(struct pt_regs, fr[15]) */ -+#define PT_FR16 256 /* offsetof(struct pt_regs, fr[16]) */ -+#define PT_FR17 264 /* offsetof(struct pt_regs, fr[17]) */ -+#define PT_FR18 272 /* offsetof(struct pt_regs, fr[18]) */ -+#define PT_FR19 280 /* offsetof(struct pt_regs, fr[19]) */ -+#define PT_FR20 288 /* offsetof(struct pt_regs, fr[20]) */ -+#define PT_FR21 296 /* offsetof(struct pt_regs, fr[21]) */ -+#define PT_FR22 304 /* offsetof(struct pt_regs, fr[22]) */ -+#define PT_FR23 312 /* offsetof(struct pt_regs, fr[23]) */ -+#define PT_FR24 320 /* offsetof(struct pt_regs, fr[24]) */ -+#define PT_FR25 328 /* offsetof(struct pt_regs, fr[25]) */ -+#define PT_FR26 336 /* offsetof(struct pt_regs, fr[26]) */ -+#define PT_FR27 344 /* offsetof(struct pt_regs, fr[27]) */ -+#define PT_FR28 352 /* offsetof(struct pt_regs, fr[28]) */ -+#define PT_FR29 360 /* offsetof(struct pt_regs, fr[29]) */ -+#define PT_FR30 368 /* offsetof(struct pt_regs, fr[30]) */ -+#define PT_FR31 376 /* offsetof(struct pt_regs, fr[31]) */ -+#define PT_SR0 384 /* offsetof(struct pt_regs, sr[ 0]) */ -+#define PT_SR1 388 /* offsetof(struct pt_regs, sr[ 1]) */ -+#define PT_SR2 392 /* offsetof(struct pt_regs, sr[ 2]) */ -+#define PT_SR3 396 /* offsetof(struct pt_regs, sr[ 3]) */ -+#define PT_SR4 400 /* offsetof(struct pt_regs, sr[ 4]) */ -+#define PT_SR5 404 /* offsetof(struct pt_regs, sr[ 5]) */ -+#define PT_SR6 408 /* offsetof(struct pt_regs, sr[ 6]) */ -+#define PT_SR7 412 /* offsetof(struct pt_regs, sr[ 7]) */ -+#define PT_IASQ0 416 /* offsetof(struct pt_regs, iasq[0]) */ -+#define PT_IASQ1 420 /* offsetof(struct pt_regs, iasq[1]) */ -+#define PT_IAOQ0 424 /* offsetof(struct pt_regs, iaoq[0]) */ -+#define PT_IAOQ1 428 /* offsetof(struct pt_regs, iaoq[1]) */ -+#define PT_CR27 432 /* offsetof(struct pt_regs, cr27) */ -+#define PT_ORIG_R28 440 /* offsetof(struct pt_regs, orig_r28) */ -+#define PT_KSP 444 /* offsetof(struct pt_regs, ksp) */ -+#define PT_KPC 448 /* offsetof(struct pt_regs, kpc) */ -+#define PT_SAR 452 /* offsetof(struct pt_regs, sar) */ -+#define PT_IIR 456 /* offsetof(struct pt_regs, iir) */ -+#define PT_ISR 460 /* offsetof(struct pt_regs, isr) */ -+#define PT_IOR 464 /* offsetof(struct pt_regs, ior) */ -+#define PT_SIZE 472 /* sizeof(struct pt_regs) */ -+#define PT_SZ_ALGN 576 /* align(sizeof(struct pt_regs), 64) */ -+ -+#define TI_TASK 0 /* offsetof(struct thread_info, task) */ -+#define TI_EXEC_DOMAIN 4 /* offsetof(struct thread_info, exec_domain) */ -+#define TI_FLAGS 8 /* offsetof(struct thread_info, flags) */ -+#define TI_CPU 16 /* offsetof(struct thread_info, cpu) */ -+#define TI_SEGMENT 12 /* offsetof(struct thread_info, addr_limit) */ -+#define TI_PRE_COUNT 20 /* offsetof(struct thread_info, preempt_count) */ -+#define THREAD_SZ 44 /* sizeof(struct thread_info) */ -+#define THREAD_SZ_ALGN 128 /* align(sizeof(struct thread_info), 64) */ -+ -+#define IRQSTAT_SIRQ_PEND 0 /* offsetof(irq_cpustat_t, __softirq_pending) */ -+#define IRQSTAT_SZ 64 /* sizeof(irq_cpustat_t) */ -+ -+#define ICACHE_BASE 8 /* offsetof(struct pdc_cache_info, ic_base) */ -+#define ICACHE_STRIDE 12 /* offsetof(struct pdc_cache_info, ic_stride) */ -+#define ICACHE_COUNT 16 /* offsetof(struct pdc_cache_info, ic_count) */ -+#define ICACHE_LOOP 20 /* offsetof(struct pdc_cache_info, ic_loop) */ -+#define DCACHE_BASE 32 /* offsetof(struct pdc_cache_info, dc_base) */ -+#define DCACHE_STRIDE 36 /* offsetof(struct pdc_cache_info, dc_stride) */ -+#define DCACHE_COUNT 40 /* offsetof(struct pdc_cache_info, dc_count) */ -+#define DCACHE_LOOP 44 /* offsetof(struct pdc_cache_info, dc_loop) */ -+#define ITLB_SID_BASE 56 /* offsetof(struct pdc_cache_info, it_sp_base) */ -+#define ITLB_SID_STRIDE 60 /* offsetof(struct pdc_cache_info, it_sp_stride) */ -+#define ITLB_SID_COUNT 64 /* offsetof(struct pdc_cache_info, it_sp_count) */ -+#define ITLB_OFF_BASE 68 /* offsetof(struct pdc_cache_info, it_off_base) */ -+#define ITLB_OFF_STRIDE 72 /* offsetof(struct pdc_cache_info, it_off_stride) */ -+#define ITLB_OFF_COUNT 76 /* offsetof(struct pdc_cache_info, it_off_count) */ -+#define ITLB_LOOP 80 /* offsetof(struct pdc_cache_info, it_loop) */ -+#define DTLB_SID_BASE 92 /* offsetof(struct pdc_cache_info, dt_sp_base) */ -+#define DTLB_SID_STRIDE 96 /* offsetof(struct pdc_cache_info, dt_sp_stride) */ -+#define DTLB_SID_COUNT 100 /* offsetof(struct pdc_cache_info, dt_sp_count) */ -+#define DTLB_OFF_BASE 104 /* offsetof(struct pdc_cache_info, dt_off_base) */ -+#define DTLB_OFF_STRIDE 108 /* offsetof(struct pdc_cache_info, dt_off_stride) */ -+#define DTLB_OFF_COUNT 112 /* offsetof(struct pdc_cache_info, dt_off_count) */ -+#define DTLB_LOOP 116 /* offsetof(struct pdc_cache_info, dt_loop) */ -+ -+#define PA_BLOCKSTEP_BIT 1 /* 31-PT_BLOCKSTEP_BIT */ -+#define PA_SINGLESTEP_BIT 0 /* 31-PT_SINGLESTEP_BIT */ -+ -+#define ASM_PMD_SHIFT 21 /* PMD_SHIFT */ -+#define ASM_PGDIR_SHIFT 21 /* PGDIR_SHIFT */ -+#define ASM_BITS_PER_PGD 11 /* BITS_PER_PGD */ -+#define ASM_BITS_PER_PMD 0 /* BITS_PER_PMD */ -+#define ASM_BITS_PER_PTE 9 /* BITS_PER_PTE */ -+#define ASM_PGD_PMD_OFFSET -8192 /* -(PAGE_SIZE << PGD_ORDER) */ -+#define ASM_PMD_ENTRY 128 /* ((PAGE_OFFSET & PMD_MASK) >> PMD_SHIFT) */ -+#define ASM_PGD_ENTRY 128 /* PAGE_OFFSET >> PGDIR_SHIFT */ -+#define ASM_PGD_ENTRY_SIZE 4 /* PGD_ENTRY_SIZE */ -+#define ASM_PMD_ENTRY_SIZE 4 /* PMD_ENTRY_SIZE */ -+#define ASM_PTE_ENTRY_SIZE 8 /* PTE_ENTRY_SIZE */ -+#define ASM_PT_INITIAL 4 /* PT_INITIAL */ -+#define ASM_PAGE_SIZE 4096 /* PAGE_SIZE */ -+ -+ -+#endif diff --git a/patches/gdb/6.7.1/175-hppa-offsets.patch b/patches/gdb/6.7.1/175-hppa-offsets.patch new file mode 100644 index 0000000..06e1e74 --- /dev/null +++ b/patches/gdb/6.7.1/175-hppa-offsets.patch @@ -0,0 +1,272 @@ +Original patch from gentoo: gentoo/src/patchsets/gdb/6.7.1/45_all_gdb-hppa-offsets.patch +-= BEGIN original header =- +sanitized headers dont include asm/offsets.h, so cache a local copy + +http://bugs.gentoo.org/180476 +http://lists.parisc-linux.org/pipermail/parisc-linux/2007-February/031162.html + +-= END original header =- +diff -durN gdb-6.7.1.orig/gdb/hppa-linux-nat.c gdb-6.7.1/gdb/hppa-linux-nat.c +--- gdb-6.7.1.orig/gdb/hppa-linux-nat.c 2007-08-23 20:08:33.000000000 +0200 ++++ gdb-6.7.1/gdb/hppa-linux-nat.c 2008-06-17 23:27:45.000000000 +0200 +@@ -32,7 +32,7 @@ + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,43) + #include + #else +-#include ++#include + #endif + + #include "hppa-tdep.h" +diff -durN gdb-6.7.1.orig/gdb/hppa-offsets.h gdb-6.7.1/gdb/hppa-offsets.h +--- gdb-6.7.1.orig/gdb/hppa-offsets.h 1970-01-01 01:00:00.000000000 +0100 ++++ gdb-6.7.1/gdb/hppa-offsets.h 2008-06-17 23:27:45.000000000 +0200 +@@ -0,0 +1,248 @@ ++#ifndef __ASM_OFFSETS_H__ ++#define __ASM_OFFSETS_H__ ++/* ++ * DO NOT MODIFY. ++ * ++ * This file was generated by arch/parisc/Makefile ++ * ++ */ ++ ++#define TASK_THREAD_INFO 4 /* offsetof(struct task_struct, thread_info) */ ++#define TASK_STATE 0 /* offsetof(struct task_struct, state) */ ++#define TASK_FLAGS 12 /* offsetof(struct task_struct, flags) */ ++#define TASK_SIGPENDING 1188 /* offsetof(struct task_struct, pending) */ ++#define TASK_PTRACE 16 /* offsetof(struct task_struct, ptrace) */ ++#define TASK_MM 108 /* offsetof(struct task_struct, mm) */ ++#define TASK_PERSONALITY 132 /* offsetof(struct task_struct, personality) */ ++#define TASK_PID 140 /* offsetof(struct task_struct, pid) */ ++ ++#define TASK_REGS 664 /* offsetof(struct task_struct, thread.regs) */ ++#define TASK_PT_PSW 664 /* offsetof(struct task_struct, thread.regs.gr[ 0]) */ ++#define TASK_PT_GR1 668 /* offsetof(struct task_struct, thread.regs.gr[ 1]) */ ++#define TASK_PT_GR2 672 /* offsetof(struct task_struct, thread.regs.gr[ 2]) */ ++#define TASK_PT_GR3 676 /* offsetof(struct task_struct, thread.regs.gr[ 3]) */ ++#define TASK_PT_GR4 680 /* offsetof(struct task_struct, thread.regs.gr[ 4]) */ ++#define TASK_PT_GR5 684 /* offsetof(struct task_struct, thread.regs.gr[ 5]) */ ++#define TASK_PT_GR6 688 /* offsetof(struct task_struct, thread.regs.gr[ 6]) */ ++#define TASK_PT_GR7 692 /* offsetof(struct task_struct, thread.regs.gr[ 7]) */ ++#define TASK_PT_GR8 696 /* offsetof(struct task_struct, thread.regs.gr[ 8]) */ ++#define TASK_PT_GR9 700 /* offsetof(struct task_struct, thread.regs.gr[ 9]) */ ++#define TASK_PT_GR10 704 /* offsetof(struct task_struct, thread.regs.gr[10]) */ ++#define TASK_PT_GR11 708 /* offsetof(struct task_struct, thread.regs.gr[11]) */ ++#define TASK_PT_GR12 712 /* offsetof(struct task_struct, thread.regs.gr[12]) */ ++#define TASK_PT_GR13 716 /* offsetof(struct task_struct, thread.regs.gr[13]) */ ++#define TASK_PT_GR14 720 /* offsetof(struct task_struct, thread.regs.gr[14]) */ ++#define TASK_PT_GR15 724 /* offsetof(struct task_struct, thread.regs.gr[15]) */ ++#define TASK_PT_GR16 728 /* offsetof(struct task_struct, thread.regs.gr[16]) */ ++#define TASK_PT_GR17 732 /* offsetof(struct task_struct, thread.regs.gr[17]) */ ++#define TASK_PT_GR18 736 /* offsetof(struct task_struct, thread.regs.gr[18]) */ ++#define TASK_PT_GR19 740 /* offsetof(struct task_struct, thread.regs.gr[19]) */ ++#define TASK_PT_GR20 744 /* offsetof(struct task_struct, thread.regs.gr[20]) */ ++#define TASK_PT_GR21 748 /* offsetof(struct task_struct, thread.regs.gr[21]) */ ++#define TASK_PT_GR22 752 /* offsetof(struct task_struct, thread.regs.gr[22]) */ ++#define TASK_PT_GR23 756 /* offsetof(struct task_struct, thread.regs.gr[23]) */ ++#define TASK_PT_GR24 760 /* offsetof(struct task_struct, thread.regs.gr[24]) */ ++#define TASK_PT_GR25 764 /* offsetof(struct task_struct, thread.regs.gr[25]) */ ++#define TASK_PT_GR26 768 /* offsetof(struct task_struct, thread.regs.gr[26]) */ ++#define TASK_PT_GR27 772 /* offsetof(struct task_struct, thread.regs.gr[27]) */ ++#define TASK_PT_GR28 776 /* offsetof(struct task_struct, thread.regs.gr[28]) */ ++#define TASK_PT_GR29 780 /* offsetof(struct task_struct, thread.regs.gr[29]) */ ++#define TASK_PT_GR30 784 /* offsetof(struct task_struct, thread.regs.gr[30]) */ ++#define TASK_PT_GR31 788 /* offsetof(struct task_struct, thread.regs.gr[31]) */ ++#define TASK_PT_FR0 792 /* offsetof(struct task_struct, thread.regs.fr[ 0]) */ ++#define TASK_PT_FR1 800 /* offsetof(struct task_struct, thread.regs.fr[ 1]) */ ++#define TASK_PT_FR2 808 /* offsetof(struct task_struct, thread.regs.fr[ 2]) */ ++#define TASK_PT_FR3 816 /* offsetof(struct task_struct, thread.regs.fr[ 3]) */ ++#define TASK_PT_FR4 824 /* offsetof(struct task_struct, thread.regs.fr[ 4]) */ ++#define TASK_PT_FR5 832 /* offsetof(struct task_struct, thread.regs.fr[ 5]) */ ++#define TASK_PT_FR6 840 /* offsetof(struct task_struct, thread.regs.fr[ 6]) */ ++#define TASK_PT_FR7 848 /* offsetof(struct task_struct, thread.regs.fr[ 7]) */ ++#define TASK_PT_FR8 856 /* offsetof(struct task_struct, thread.regs.fr[ 8]) */ ++#define TASK_PT_FR9 864 /* offsetof(struct task_struct, thread.regs.fr[ 9]) */ ++#define TASK_PT_FR10 872 /* offsetof(struct task_struct, thread.regs.fr[10]) */ ++#define TASK_PT_FR11 880 /* offsetof(struct task_struct, thread.regs.fr[11]) */ ++#define TASK_PT_FR12 888 /* offsetof(struct task_struct, thread.regs.fr[12]) */ ++#define TASK_PT_FR13 896 /* offsetof(struct task_struct, thread.regs.fr[13]) */ ++#define TASK_PT_FR14 904 /* offsetof(struct task_struct, thread.regs.fr[14]) */ ++#define TASK_PT_FR15 912 /* offsetof(struct task_struct, thread.regs.fr[15]) */ ++#define TASK_PT_FR16 920 /* offsetof(struct task_struct, thread.regs.fr[16]) */ ++#define TASK_PT_FR17 928 /* offsetof(struct task_struct, thread.regs.fr[17]) */ ++#define TASK_PT_FR18 936 /* offsetof(struct task_struct, thread.regs.fr[18]) */ ++#define TASK_PT_FR19 944 /* offsetof(struct task_struct, thread.regs.fr[19]) */ ++#define TASK_PT_FR20 952 /* offsetof(struct task_struct, thread.regs.fr[20]) */ ++#define TASK_PT_FR21 960 /* offsetof(struct task_struct, thread.regs.fr[21]) */ ++#define TASK_PT_FR22 968 /* offsetof(struct task_struct, thread.regs.fr[22]) */ ++#define TASK_PT_FR23 976 /* offsetof(struct task_struct, thread.regs.fr[23]) */ ++#define TASK_PT_FR24 984 /* offsetof(struct task_struct, thread.regs.fr[24]) */ ++#define TASK_PT_FR25 992 /* offsetof(struct task_struct, thread.regs.fr[25]) */ ++#define TASK_PT_FR26 1000 /* offsetof(struct task_struct, thread.regs.fr[26]) */ ++#define TASK_PT_FR27 1008 /* offsetof(struct task_struct, thread.regs.fr[27]) */ ++#define TASK_PT_FR28 1016 /* offsetof(struct task_struct, thread.regs.fr[28]) */ ++#define TASK_PT_FR29 1024 /* offsetof(struct task_struct, thread.regs.fr[29]) */ ++#define TASK_PT_FR30 1032 /* offsetof(struct task_struct, thread.regs.fr[30]) */ ++#define TASK_PT_FR31 1040 /* offsetof(struct task_struct, thread.regs.fr[31]) */ ++#define TASK_PT_SR0 1048 /* offsetof(struct task_struct, thread.regs.sr[ 0]) */ ++#define TASK_PT_SR1 1052 /* offsetof(struct task_struct, thread.regs.sr[ 1]) */ ++#define TASK_PT_SR2 1056 /* offsetof(struct task_struct, thread.regs.sr[ 2]) */ ++#define TASK_PT_SR3 1060 /* offsetof(struct task_struct, thread.regs.sr[ 3]) */ ++#define TASK_PT_SR4 1064 /* offsetof(struct task_struct, thread.regs.sr[ 4]) */ ++#define TASK_PT_SR5 1068 /* offsetof(struct task_struct, thread.regs.sr[ 5]) */ ++#define TASK_PT_SR6 1072 /* offsetof(struct task_struct, thread.regs.sr[ 6]) */ ++#define TASK_PT_SR7 1076 /* offsetof(struct task_struct, thread.regs.sr[ 7]) */ ++#define TASK_PT_IASQ0 1080 /* offsetof(struct task_struct, thread.regs.iasq[0]) */ ++#define TASK_PT_IASQ1 1084 /* offsetof(struct task_struct, thread.regs.iasq[1]) */ ++#define TASK_PT_IAOQ0 1088 /* offsetof(struct task_struct, thread.regs.iaoq[0]) */ ++#define TASK_PT_IAOQ1 1092 /* offsetof(struct task_struct, thread.regs.iaoq[1]) */ ++#define TASK_PT_CR27 1096 /* offsetof(struct task_struct, thread.regs.cr27) */ ++#define TASK_PT_ORIG_R28 1104 /* offsetof(struct task_struct, thread.regs.orig_r28) */ ++#define TASK_PT_KSP 1108 /* offsetof(struct task_struct, thread.regs.ksp) */ ++#define TASK_PT_KPC 1112 /* offsetof(struct task_struct, thread.regs.kpc) */ ++#define TASK_PT_SAR 1116 /* offsetof(struct task_struct, thread.regs.sar) */ ++#define TASK_PT_IIR 1120 /* offsetof(struct task_struct, thread.regs.iir) */ ++#define TASK_PT_ISR 1124 /* offsetof(struct task_struct, thread.regs.isr) */ ++#define TASK_PT_IOR 1128 /* offsetof(struct task_struct, thread.regs.ior) */ ++ ++#define TASK_SZ 1272 /* sizeof(struct task_struct) */ ++#define TASK_SZ_ALGN 1344 /* align(sizeof(struct task_struct), 64) */ ++ ++#define PT_PSW 0 /* offsetof(struct pt_regs, gr[ 0]) */ ++#define PT_GR1 4 /* offsetof(struct pt_regs, gr[ 1]) */ ++#define PT_GR2 8 /* offsetof(struct pt_regs, gr[ 2]) */ ++#define PT_GR3 12 /* offsetof(struct pt_regs, gr[ 3]) */ ++#define PT_GR4 16 /* offsetof(struct pt_regs, gr[ 4]) */ ++#define PT_GR5 20 /* offsetof(struct pt_regs, gr[ 5]) */ ++#define PT_GR6 24 /* offsetof(struct pt_regs, gr[ 6]) */ ++#define PT_GR7 28 /* offsetof(struct pt_regs, gr[ 7]) */ ++#define PT_GR8 32 /* offsetof(struct pt_regs, gr[ 8]) */ ++#define PT_GR9 36 /* offsetof(struct pt_regs, gr[ 9]) */ ++#define PT_GR10 40 /* offsetof(struct pt_regs, gr[10]) */ ++#define PT_GR11 44 /* offsetof(struct pt_regs, gr[11]) */ ++#define PT_GR12 48 /* offsetof(struct pt_regs, gr[12]) */ ++#define PT_GR13 52 /* offsetof(struct pt_regs, gr[13]) */ ++#define PT_GR14 56 /* offsetof(struct pt_regs, gr[14]) */ ++#define PT_GR15 60 /* offsetof(struct pt_regs, gr[15]) */ ++#define PT_GR16 64 /* offsetof(struct pt_regs, gr[16]) */ ++#define PT_GR17 68 /* offsetof(struct pt_regs, gr[17]) */ ++#define PT_GR18 72 /* offsetof(struct pt_regs, gr[18]) */ ++#define PT_GR19 76 /* offsetof(struct pt_regs, gr[19]) */ ++#define PT_GR20 80 /* offsetof(struct pt_regs, gr[20]) */ ++#define PT_GR21 84 /* offsetof(struct pt_regs, gr[21]) */ ++#define PT_GR22 88 /* offsetof(struct pt_regs, gr[22]) */ ++#define PT_GR23 92 /* offsetof(struct pt_regs, gr[23]) */ ++#define PT_GR24 96 /* offsetof(struct pt_regs, gr[24]) */ ++#define PT_GR25 100 /* offsetof(struct pt_regs, gr[25]) */ ++#define PT_GR26 104 /* offsetof(struct pt_regs, gr[26]) */ ++#define PT_GR27 108 /* offsetof(struct pt_regs, gr[27]) */ ++#define PT_GR28 112 /* offsetof(struct pt_regs, gr[28]) */ ++#define PT_GR29 116 /* offsetof(struct pt_regs, gr[29]) */ ++#define PT_GR30 120 /* offsetof(struct pt_regs, gr[30]) */ ++#define PT_GR31 124 /* offsetof(struct pt_regs, gr[31]) */ ++#define PT_FR0 128 /* offsetof(struct pt_regs, fr[ 0]) */ ++#define PT_FR1 136 /* offsetof(struct pt_regs, fr[ 1]) */ ++#define PT_FR2 144 /* offsetof(struct pt_regs, fr[ 2]) */ ++#define PT_FR3 152 /* offsetof(struct pt_regs, fr[ 3]) */ ++#define PT_FR4 160 /* offsetof(struct pt_regs, fr[ 4]) */ ++#define PT_FR5 168 /* offsetof(struct pt_regs, fr[ 5]) */ ++#define PT_FR6 176 /* offsetof(struct pt_regs, fr[ 6]) */ ++#define PT_FR7 184 /* offsetof(struct pt_regs, fr[ 7]) */ ++#define PT_FR8 192 /* offsetof(struct pt_regs, fr[ 8]) */ ++#define PT_FR9 200 /* offsetof(struct pt_regs, fr[ 9]) */ ++#define PT_FR10 208 /* offsetof(struct pt_regs, fr[10]) */ ++#define PT_FR11 216 /* offsetof(struct pt_regs, fr[11]) */ ++#define PT_FR12 224 /* offsetof(struct pt_regs, fr[12]) */ ++#define PT_FR13 232 /* offsetof(struct pt_regs, fr[13]) */ ++#define PT_FR14 240 /* offsetof(struct pt_regs, fr[14]) */ ++#define PT_FR15 248 /* offsetof(struct pt_regs, fr[15]) */ ++#define PT_FR16 256 /* offsetof(struct pt_regs, fr[16]) */ ++#define PT_FR17 264 /* offsetof(struct pt_regs, fr[17]) */ ++#define PT_FR18 272 /* offsetof(struct pt_regs, fr[18]) */ ++#define PT_FR19 280 /* offsetof(struct pt_regs, fr[19]) */ ++#define PT_FR20 288 /* offsetof(struct pt_regs, fr[20]) */ ++#define PT_FR21 296 /* offsetof(struct pt_regs, fr[21]) */ ++#define PT_FR22 304 /* offsetof(struct pt_regs, fr[22]) */ ++#define PT_FR23 312 /* offsetof(struct pt_regs, fr[23]) */ ++#define PT_FR24 320 /* offsetof(struct pt_regs, fr[24]) */ ++#define PT_FR25 328 /* offsetof(struct pt_regs, fr[25]) */ ++#define PT_FR26 336 /* offsetof(struct pt_regs, fr[26]) */ ++#define PT_FR27 344 /* offsetof(struct pt_regs, fr[27]) */ ++#define PT_FR28 352 /* offsetof(struct pt_regs, fr[28]) */ ++#define PT_FR29 360 /* offsetof(struct pt_regs, fr[29]) */ ++#define PT_FR30 368 /* offsetof(struct pt_regs, fr[30]) */ ++#define PT_FR31 376 /* offsetof(struct pt_regs, fr[31]) */ ++#define PT_SR0 384 /* offsetof(struct pt_regs, sr[ 0]) */ ++#define PT_SR1 388 /* offsetof(struct pt_regs, sr[ 1]) */ ++#define PT_SR2 392 /* offsetof(struct pt_regs, sr[ 2]) */ ++#define PT_SR3 396 /* offsetof(struct pt_regs, sr[ 3]) */ ++#define PT_SR4 400 /* offsetof(struct pt_regs, sr[ 4]) */ ++#define PT_SR5 404 /* offsetof(struct pt_regs, sr[ 5]) */ ++#define PT_SR6 408 /* offsetof(struct pt_regs, sr[ 6]) */ ++#define PT_SR7 412 /* offsetof(struct pt_regs, sr[ 7]) */ ++#define PT_IASQ0 416 /* offsetof(struct pt_regs, iasq[0]) */ ++#define PT_IASQ1 420 /* offsetof(struct pt_regs, iasq[1]) */ ++#define PT_IAOQ0 424 /* offsetof(struct pt_regs, iaoq[0]) */ ++#define PT_IAOQ1 428 /* offsetof(struct pt_regs, iaoq[1]) */ ++#define PT_CR27 432 /* offsetof(struct pt_regs, cr27) */ ++#define PT_ORIG_R28 440 /* offsetof(struct pt_regs, orig_r28) */ ++#define PT_KSP 444 /* offsetof(struct pt_regs, ksp) */ ++#define PT_KPC 448 /* offsetof(struct pt_regs, kpc) */ ++#define PT_SAR 452 /* offsetof(struct pt_regs, sar) */ ++#define PT_IIR 456 /* offsetof(struct pt_regs, iir) */ ++#define PT_ISR 460 /* offsetof(struct pt_regs, isr) */ ++#define PT_IOR 464 /* offsetof(struct pt_regs, ior) */ ++#define PT_SIZE 472 /* sizeof(struct pt_regs) */ ++#define PT_SZ_ALGN 576 /* align(sizeof(struct pt_regs), 64) */ ++ ++#define TI_TASK 0 /* offsetof(struct thread_info, task) */ ++#define TI_EXEC_DOMAIN 4 /* offsetof(struct thread_info, exec_domain) */ ++#define TI_FLAGS 8 /* offsetof(struct thread_info, flags) */ ++#define TI_CPU 16 /* offsetof(struct thread_info, cpu) */ ++#define TI_SEGMENT 12 /* offsetof(struct thread_info, addr_limit) */ ++#define TI_PRE_COUNT 20 /* offsetof(struct thread_info, preempt_count) */ ++#define THREAD_SZ 44 /* sizeof(struct thread_info) */ ++#define THREAD_SZ_ALGN 128 /* align(sizeof(struct thread_info), 64) */ ++ ++#define IRQSTAT_SIRQ_PEND 0 /* offsetof(irq_cpustat_t, __softirq_pending) */ ++#define IRQSTAT_SZ 64 /* sizeof(irq_cpustat_t) */ ++ ++#define ICACHE_BASE 8 /* offsetof(struct pdc_cache_info, ic_base) */ ++#define ICACHE_STRIDE 12 /* offsetof(struct pdc_cache_info, ic_stride) */ ++#define ICACHE_COUNT 16 /* offsetof(struct pdc_cache_info, ic_count) */ ++#define ICACHE_LOOP 20 /* offsetof(struct pdc_cache_info, ic_loop) */ ++#define DCACHE_BASE 32 /* offsetof(struct pdc_cache_info, dc_base) */ ++#define DCACHE_STRIDE 36 /* offsetof(struct pdc_cache_info, dc_stride) */ ++#define DCACHE_COUNT 40 /* offsetof(struct pdc_cache_info, dc_count) */ ++#define DCACHE_LOOP 44 /* offsetof(struct pdc_cache_info, dc_loop) */ ++#define ITLB_SID_BASE 56 /* offsetof(struct pdc_cache_info, it_sp_base) */ ++#define ITLB_SID_STRIDE 60 /* offsetof(struct pdc_cache_info, it_sp_stride) */ ++#define ITLB_SID_COUNT 64 /* offsetof(struct pdc_cache_info, it_sp_count) */ ++#define ITLB_OFF_BASE 68 /* offsetof(struct pdc_cache_info, it_off_base) */ ++#define ITLB_OFF_STRIDE 72 /* offsetof(struct pdc_cache_info, it_off_stride) */ ++#define ITLB_OFF_COUNT 76 /* offsetof(struct pdc_cache_info, it_off_count) */ ++#define ITLB_LOOP 80 /* offsetof(struct pdc_cache_info, it_loop) */ ++#define DTLB_SID_BASE 92 /* offsetof(struct pdc_cache_info, dt_sp_base) */ ++#define DTLB_SID_STRIDE 96 /* offsetof(struct pdc_cache_info, dt_sp_stride) */ ++#define DTLB_SID_COUNT 100 /* offsetof(struct pdc_cache_info, dt_sp_count) */ ++#define DTLB_OFF_BASE 104 /* offsetof(struct pdc_cache_info, dt_off_base) */ ++#define DTLB_OFF_STRIDE 108 /* offsetof(struct pdc_cache_info, dt_off_stride) */ ++#define DTLB_OFF_COUNT 112 /* offsetof(struct pdc_cache_info, dt_off_count) */ ++#define DTLB_LOOP 116 /* offsetof(struct pdc_cache_info, dt_loop) */ ++ ++#define PA_BLOCKSTEP_BIT 1 /* 31-PT_BLOCKSTEP_BIT */ ++#define PA_SINGLESTEP_BIT 0 /* 31-PT_SINGLESTEP_BIT */ ++ ++#define ASM_PMD_SHIFT 21 /* PMD_SHIFT */ ++#define ASM_PGDIR_SHIFT 21 /* PGDIR_SHIFT */ ++#define ASM_BITS_PER_PGD 11 /* BITS_PER_PGD */ ++#define ASM_BITS_PER_PMD 0 /* BITS_PER_PMD */ ++#define ASM_BITS_PER_PTE 9 /* BITS_PER_PTE */ ++#define ASM_PGD_PMD_OFFSET -8192 /* -(PAGE_SIZE << PGD_ORDER) */ ++#define ASM_PMD_ENTRY 128 /* ((PAGE_OFFSET & PMD_MASK) >> PMD_SHIFT) */ ++#define ASM_PGD_ENTRY 128 /* PAGE_OFFSET >> PGDIR_SHIFT */ ++#define ASM_PGD_ENTRY_SIZE 4 /* PGD_ENTRY_SIZE */ ++#define ASM_PMD_ENTRY_SIZE 4 /* PMD_ENTRY_SIZE */ ++#define ASM_PTE_ENTRY_SIZE 8 /* PTE_ENTRY_SIZE */ ++#define ASM_PT_INITIAL 4 /* PT_INITIAL */ ++#define ASM_PAGE_SIZE 4096 /* PAGE_SIZE */ ++ ++ ++#endif diff --git a/patches/gdb/6.7.1/200-deleted-children.patch b/patches/gdb/6.7.1/200-deleted-children.patch new file mode 100644 index 0000000..08bbba9 --- /dev/null +++ b/patches/gdb/6.7.1/200-deleted-children.patch @@ -0,0 +1,26 @@ +Original patch from gentoo: gentoo/src/patchsets/gdb/6.7.1/50_all_gdb-deleted-children.patch +-= BEGIN original header =- +http://bugs.gentoo.org/210636 +http://sourceware.org/ml/gdb-patches/2007-11/msg00136.html + +2007-11-07 Vladimir Prus + + Fix crash when a variable object being deleted + has any of its children deleted previously. + + * varobj.c (delete_variable_1): Don't recurse + into deleted children. + +-= END original header =- +diff -durN gdb-6.7.1.orig/gdb/varobj.c gdb-6.7.1/gdb/varobj.c +--- gdb-6.7.1.orig/gdb/varobj.c 2007-08-31 21:01:17.000000000 +0200 ++++ gdb-6.7.1/gdb/varobj.c 2008-06-17 23:27:45.000000000 +0200 +@@ -1295,6 +1295,8 @@ + for (i = 0; i < VEC_length (varobj_p, var->children); ++i) + { + varobj_p child = VEC_index (varobj_p, var->children, i); ++ if (!child) ++ continue; + if (!remove_from_parent_p) + child->parent = NULL; + delete_variable_1 (resultp, delcountp, child, 0, only_children_p); diff --git a/patches/gdb/6.7.1/200-gdb-deleted-children.patch b/patches/gdb/6.7.1/200-gdb-deleted-children.patch deleted file mode 100644 index 08bbba9..0000000 --- a/patches/gdb/6.7.1/200-gdb-deleted-children.patch +++ /dev/null @@ -1,26 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gdb/6.7.1/50_all_gdb-deleted-children.patch --= BEGIN original header =- -http://bugs.gentoo.org/210636 -http://sourceware.org/ml/gdb-patches/2007-11/msg00136.html - -2007-11-07 Vladimir Prus - - Fix crash when a variable object being deleted - has any of its children deleted previously. - - * varobj.c (delete_variable_1): Don't recurse - into deleted children. - --= END original header =- -diff -durN gdb-6.7.1.orig/gdb/varobj.c gdb-6.7.1/gdb/varobj.c ---- gdb-6.7.1.orig/gdb/varobj.c 2007-08-31 21:01:17.000000000 +0200 -+++ gdb-6.7.1/gdb/varobj.c 2008-06-17 23:27:45.000000000 +0200 -@@ -1295,6 +1295,8 @@ - for (i = 0; i < VEC_length (varobj_p, var->children); ++i) - { - varobj_p child = VEC_index (varobj_p, var->children, i); -+ if (!child) -+ continue; - if (!remove_from_parent_p) - child->parent = NULL; - delete_variable_1 (resultp, delcountp, child, 0, only_children_p); diff --git a/patches/gdb/6.7.1/225-dwarf-stack-overflow.patch b/patches/gdb/6.7.1/225-dwarf-stack-overflow.patch new file mode 100644 index 0000000..764ec65 --- /dev/null +++ b/patches/gdb/6.7.1/225-dwarf-stack-overflow.patch @@ -0,0 +1,52 @@ +Original patch from gentoo: gentoo/src/patchsets/gdb/6.7.1/80_all_gdb-6.5-dwarf-stack-overflow.patch +-= BEGIN original header =- +http://bugs.gentoo.org/144833 + +for gdb/ChangeLog: +2006-08-22 Will Drewry + Tavis Ormandy + + * dwarf2read.c (decode_locdesc): Enforce location description stack + boundaries. + * dwarfread.c (locval): Likewise. + +-= END original header =- +diff -durN gdb-6.7.1.orig/gdb/dwarf2read.c gdb-6.7.1/gdb/dwarf2read.c +--- gdb-6.7.1.orig/gdb/dwarf2read.c 2007-09-05 02:51:48.000000000 +0200 ++++ gdb-6.7.1/gdb/dwarf2read.c 2008-06-17 23:27:46.000000000 +0200 +@@ -9061,8 +9061,7 @@ + callers will only want a very basic result and this can become a + complaint. + +- Note that stack[0] is unused except as a default error return. +- Note that stack overflow is not yet handled. */ ++ Note that stack[0] is unused except as a default error return. */ + + static CORE_ADDR + decode_locdesc (struct dwarf_block *blk, struct dwarf2_cu *cu) +@@ -9079,7 +9078,7 @@ + + i = 0; + stacki = 0; +- stack[stacki] = 0; ++ stack[++stacki] = 0; + + while (i < size) + { +@@ -9261,6 +9260,16 @@ + dwarf_stack_op_name (op)); + return (stack[stacki]); + } ++ /* Enforce maximum stack depth of size-1 to avoid ++stacki writing ++ outside of the allocated space. Also enforce minimum > 0. ++ -- wad@google.com 14 Aug 2006 */ ++ if (stacki >= sizeof (stack) / sizeof (*stack) - 1) ++ internal_error (__FILE__, __LINE__, ++ _("location description stack too deep: %d"), ++ stacki); ++ if (stacki <= 0) ++ internal_error (__FILE__, __LINE__, ++ _("location description stack too shallow")); + } + return (stack[stacki]); + } diff --git a/patches/gdb/6.7.1/225-gdb-6.5-dwarf-stack-overflow.patch b/patches/gdb/6.7.1/225-gdb-6.5-dwarf-stack-overflow.patch deleted file mode 100644 index 764ec65..0000000 --- a/patches/gdb/6.7.1/225-gdb-6.5-dwarf-stack-overflow.patch +++ /dev/null @@ -1,52 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gdb/6.7.1/80_all_gdb-6.5-dwarf-stack-overflow.patch --= BEGIN original header =- -http://bugs.gentoo.org/144833 - -for gdb/ChangeLog: -2006-08-22 Will Drewry - Tavis Ormandy - - * dwarf2read.c (decode_locdesc): Enforce location description stack - boundaries. - * dwarfread.c (locval): Likewise. - --= END original header =- -diff -durN gdb-6.7.1.orig/gdb/dwarf2read.c gdb-6.7.1/gdb/dwarf2read.c ---- gdb-6.7.1.orig/gdb/dwarf2read.c 2007-09-05 02:51:48.000000000 +0200 -+++ gdb-6.7.1/gdb/dwarf2read.c 2008-06-17 23:27:46.000000000 +0200 -@@ -9061,8 +9061,7 @@ - callers will only want a very basic result and this can become a - complaint. - -- Note that stack[0] is unused except as a default error return. -- Note that stack overflow is not yet handled. */ -+ Note that stack[0] is unused except as a default error return. */ - - static CORE_ADDR - decode_locdesc (struct dwarf_block *blk, struct dwarf2_cu *cu) -@@ -9079,7 +9078,7 @@ - - i = 0; - stacki = 0; -- stack[stacki] = 0; -+ stack[++stacki] = 0; - - while (i < size) - { -@@ -9261,6 +9260,16 @@ - dwarf_stack_op_name (op)); - return (stack[stacki]); - } -+ /* Enforce maximum stack depth of size-1 to avoid ++stacki writing -+ outside of the allocated space. Also enforce minimum > 0. -+ -- wad@google.com 14 Aug 2006 */ -+ if (stacki >= sizeof (stack) / sizeof (*stack) - 1) -+ internal_error (__FILE__, __LINE__, -+ _("location description stack too deep: %d"), -+ stacki); -+ if (stacki <= 0) -+ internal_error (__FILE__, __LINE__, -+ _("location description stack too shallow")); - } - return (stack[stacki]); - } diff --git a/patches/gdb/6.7/100-gdb-6.3-security-errata-20050610.patch b/patches/gdb/6.7/100-gdb-6.3-security-errata-20050610.patch deleted file mode 100644 index a0307ad..0000000 --- a/patches/gdb/6.7/100-gdb-6.3-security-errata-20050610.patch +++ /dev/null @@ -1,205 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gdb/6.7/35_all_gdb-6.3-security-errata-20050610.patch --= BEGIN original header =- -2005-06-09 Jeff Johnston - - * gdb.base/gdbinit.exp: New testcase. - * gdb.base/gdbinit.sample: Sample .gdbinit for gdbinit.exp. - -2005-06-08 Daniel Jacobowitz - Jeff Johnston - - * Makefile.in (cli-cmds.o): Update. - * configure.in: Add check for getuid. - * configure: Regenerated. - * config.in: Ditto. - * main.c (captured_main): Pass -1 to source_command when loading - gdbinit files. - * cli/cli-cmds.c: Include "gdb_stat.h" and . - (source_command): Update documentation. Check permissions if - FROM_TTY is -1. - --= END original header =- -diff -durN gdb-6.7.orig/gdb/cli/cli-cmds.c gdb-6.7/gdb/cli/cli-cmds.c ---- gdb-6.7.orig/gdb/cli/cli-cmds.c 2007-08-23 20:08:47.000000000 +0200 -+++ gdb-6.7/gdb/cli/cli-cmds.c 2008-06-17 23:25:23.000000000 +0200 -@@ -36,6 +36,7 @@ - #include "objfiles.h" - #include "source.h" - #include "disasm.h" -+#include "gdb_stat.h" - - #include "ui-out.h" - -@@ -459,12 +460,31 @@ - - if (fd == -1) - { -- if (from_tty) -+ if (from_tty > 0) - perror_with_name (file); - else - return; - } - -+#ifdef HAVE_GETUID -+ if (from_tty == -1) -+ { -+ struct stat statbuf; -+ if (fstat (fd, &statbuf) < 0) -+ { -+ perror_with_name (file); -+ close (fd); -+ return; -+ } -+ if (statbuf.st_uid != getuid () || (statbuf.st_mode & S_IWOTH)) -+ { -+ warning (_("not using untrusted file \"%s\""), file); -+ close (fd); -+ return; -+ } -+ } -+#endif -+ - stream = fdopen (fd, FOPEN_RT); - script_from_file (stream, file); - -diff -durN gdb-6.7.orig/gdb/main.c gdb-6.7/gdb/main.c ---- gdb-6.7.orig/gdb/main.c 2007-08-23 20:08:36.000000000 +0200 -+++ gdb-6.7/gdb/main.c 2008-06-17 23:25:23.000000000 +0200 -@@ -688,7 +688,7 @@ - - if (!inhibit_gdbinit) - { -- catch_command_errors (source_script, homeinit, 0, RETURN_MASK_ALL); -+ catch_command_errors (source_script, homeinit, -1, RETURN_MASK_ALL); - } - - /* Do stats; no need to do them elsewhere since we'll only -@@ -766,7 +766,7 @@ - || memcmp ((char *) &homebuf, (char *) &cwdbuf, sizeof (struct stat))) - if (!inhibit_gdbinit) - { -- catch_command_errors (source_script, gdbinit, 0, RETURN_MASK_ALL); -+ catch_command_errors (source_script, gdbinit, -1, RETURN_MASK_ALL); - } - - for (i = 0; i < ncmd; i++) -diff -durN gdb-6.7.orig/gdb/Makefile.in gdb-6.7/gdb/Makefile.in ---- gdb-6.7.orig/gdb/Makefile.in 2007-09-05 02:14:02.000000000 +0200 -+++ gdb-6.7/gdb/Makefile.in 2008-06-17 23:25:23.000000000 +0200 -@@ -2882,7 +2882,7 @@ - $(expression_h) $(frame_h) $(value_h) $(language_h) $(filenames_h) \ - $(objfiles_h) $(source_h) $(disasm_h) $(ui_out_h) $(top_h) \ - $(cli_decode_h) $(cli_script_h) $(cli_setshow_h) $(cli_cmds_h) \ -- $(tui_h) -+ $(tui_h) $(gdb_stat_h) - $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-cmds.c - cli-decode.o: $(srcdir)/cli/cli-decode.c $(defs_h) $(symtab_h) \ - $(gdb_regex_h) $(gdb_string_h) $(completer_h) $(ui_out_h) \ -diff -durN gdb-6.7.orig/gdb/testsuite/gdb.base/gdbinit.exp gdb-6.7/gdb/testsuite/gdb.base/gdbinit.exp ---- gdb-6.7.orig/gdb/testsuite/gdb.base/gdbinit.exp 1970-01-01 01:00:00.000000000 +0100 -+++ gdb-6.7/gdb/testsuite/gdb.base/gdbinit.exp 2008-06-17 23:25:23.000000000 +0200 -@@ -0,0 +1,98 @@ -+# Copyright 2005 -+# Free Software Foundation, Inc. -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 2 of the License, or -+# (at your option) any later version. -+# -+# This program 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 General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program; if not, write to the Free Software -+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -+ -+# Please email any bugs, comments, and/or additions to this file to: -+# bug-gdb@prep.ai.mit.edu -+ -+# This file was written by Jeff Johnston . -+ -+if $tracelevel then { -+ strace $tracelevel -+} -+ -+set prms_id 0 -+set bug_id 0 -+ -+# are we on a target board -+if [is_remote target] { -+ return -+} -+ -+ -+global verbose -+global GDB -+global GDBFLAGS -+global gdb_prompt -+global timeout -+global gdb_spawn_id; -+ -+gdb_stop_suppressing_tests; -+ -+verbose "Spawning $GDB -nw" -+ -+if [info exists gdb_spawn_id] { -+ return 0; -+} -+ -+if ![is_remote host] { -+ if { [which $GDB] == 0 } then { -+ perror "$GDB does not exist." -+ exit 1 -+ } -+} -+ -+set env(HOME) [pwd] -+remote_exec build "rm .gdbinit" -+remote_exec build "cp ${srcdir}/${subdir}/gdbinit.sample .gdbinit" -+remote_exec build "chmod 646 .gdbinit" -+ -+set res [remote_spawn host "$GDB -nw [host_info gdb_opts]"]; -+if { $res < 0 || $res == "" } { -+ perror "Spawning $GDB failed." -+ return 1; -+} -+gdb_expect 360 { -+ -re "warning: not using untrusted file.*\.gdbinit.*\[\r\n\]$gdb_prompt $" { -+ pass "untrusted .gdbinit caught." -+ } -+ -re "$gdb_prompt $" { -+ fail "untrusted .gdbinit caught." -+ } -+ timeout { -+ fail "(timeout) untrusted .gdbinit caught." -+ } -+} -+ -+remote_exec build "chmod 644 .gdbinit" -+set res [remote_spawn host "$GDB -nw [host_info gdb_opts]"]; -+if { $res < 0 || $res == "" } { -+ perror "Spawning $GDB failed." -+ return 1; -+} -+gdb_expect 360 { -+ -re "warning: not using untrusted file.*\.gdbinit.*\[\r\n\]$gdb_prompt $" { -+ fail "trusted .gdbinit allowed." -+ } -+ -re "in gdbinit.*$gdb_prompt $" { -+ pass "trusted .gdbinit allowed." -+ } -+ timeout { -+ fail "(timeout) trusted .gdbinit allowed." -+ } -+} -+ -+remote_exec build "rm .gdbinit" -diff -durN gdb-6.7.orig/gdb/testsuite/gdb.base/gdbinit.sample gdb-6.7/gdb/testsuite/gdb.base/gdbinit.sample ---- gdb-6.7.orig/gdb/testsuite/gdb.base/gdbinit.sample 1970-01-01 01:00:00.000000000 +0100 -+++ gdb-6.7/gdb/testsuite/gdb.base/gdbinit.sample 2008-06-17 23:25:23.000000000 +0200 -@@ -0,0 +1 @@ -+echo "\nin gdbinit" diff --git a/patches/gdb/6.7/100-security-errata-20050610.patch b/patches/gdb/6.7/100-security-errata-20050610.patch new file mode 100644 index 0000000..a0307ad --- /dev/null +++ b/patches/gdb/6.7/100-security-errata-20050610.patch @@ -0,0 +1,205 @@ +Original patch from gentoo: gentoo/src/patchsets/gdb/6.7/35_all_gdb-6.3-security-errata-20050610.patch +-= BEGIN original header =- +2005-06-09 Jeff Johnston + + * gdb.base/gdbinit.exp: New testcase. + * gdb.base/gdbinit.sample: Sample .gdbinit for gdbinit.exp. + +2005-06-08 Daniel Jacobowitz + Jeff Johnston + + * Makefile.in (cli-cmds.o): Update. + * configure.in: Add check for getuid. + * configure: Regenerated. + * config.in: Ditto. + * main.c (captured_main): Pass -1 to source_command when loading + gdbinit files. + * cli/cli-cmds.c: Include "gdb_stat.h" and . + (source_command): Update documentation. Check permissions if + FROM_TTY is -1. + +-= END original header =- +diff -durN gdb-6.7.orig/gdb/cli/cli-cmds.c gdb-6.7/gdb/cli/cli-cmds.c +--- gdb-6.7.orig/gdb/cli/cli-cmds.c 2007-08-23 20:08:47.000000000 +0200 ++++ gdb-6.7/gdb/cli/cli-cmds.c 2008-06-17 23:25:23.000000000 +0200 +@@ -36,6 +36,7 @@ + #include "objfiles.h" + #include "source.h" + #include "disasm.h" ++#include "gdb_stat.h" + + #include "ui-out.h" + +@@ -459,12 +460,31 @@ + + if (fd == -1) + { +- if (from_tty) ++ if (from_tty > 0) + perror_with_name (file); + else + return; + } + ++#ifdef HAVE_GETUID ++ if (from_tty == -1) ++ { ++ struct stat statbuf; ++ if (fstat (fd, &statbuf) < 0) ++ { ++ perror_with_name (file); ++ close (fd); ++ return; ++ } ++ if (statbuf.st_uid != getuid () || (statbuf.st_mode & S_IWOTH)) ++ { ++ warning (_("not using untrusted file \"%s\""), file); ++ close (fd); ++ return; ++ } ++ } ++#endif ++ + stream = fdopen (fd, FOPEN_RT); + script_from_file (stream, file); + +diff -durN gdb-6.7.orig/gdb/main.c gdb-6.7/gdb/main.c +--- gdb-6.7.orig/gdb/main.c 2007-08-23 20:08:36.000000000 +0200 ++++ gdb-6.7/gdb/main.c 2008-06-17 23:25:23.000000000 +0200 +@@ -688,7 +688,7 @@ + + if (!inhibit_gdbinit) + { +- catch_command_errors (source_script, homeinit, 0, RETURN_MASK_ALL); ++ catch_command_errors (source_script, homeinit, -1, RETURN_MASK_ALL); + } + + /* Do stats; no need to do them elsewhere since we'll only +@@ -766,7 +766,7 @@ + || memcmp ((char *) &homebuf, (char *) &cwdbuf, sizeof (struct stat))) + if (!inhibit_gdbinit) + { +- catch_command_errors (source_script, gdbinit, 0, RETURN_MASK_ALL); ++ catch_command_errors (source_script, gdbinit, -1, RETURN_MASK_ALL); + } + + for (i = 0; i < ncmd; i++) +diff -durN gdb-6.7.orig/gdb/Makefile.in gdb-6.7/gdb/Makefile.in +--- gdb-6.7.orig/gdb/Makefile.in 2007-09-05 02:14:02.000000000 +0200 ++++ gdb-6.7/gdb/Makefile.in 2008-06-17 23:25:23.000000000 +0200 +@@ -2882,7 +2882,7 @@ + $(expression_h) $(frame_h) $(value_h) $(language_h) $(filenames_h) \ + $(objfiles_h) $(source_h) $(disasm_h) $(ui_out_h) $(top_h) \ + $(cli_decode_h) $(cli_script_h) $(cli_setshow_h) $(cli_cmds_h) \ +- $(tui_h) ++ $(tui_h) $(gdb_stat_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-cmds.c + cli-decode.o: $(srcdir)/cli/cli-decode.c $(defs_h) $(symtab_h) \ + $(gdb_regex_h) $(gdb_string_h) $(completer_h) $(ui_out_h) \ +diff -durN gdb-6.7.orig/gdb/testsuite/gdb.base/gdbinit.exp gdb-6.7/gdb/testsuite/gdb.base/gdbinit.exp +--- gdb-6.7.orig/gdb/testsuite/gdb.base/gdbinit.exp 1970-01-01 01:00:00.000000000 +0100 ++++ gdb-6.7/gdb/testsuite/gdb.base/gdbinit.exp 2008-06-17 23:25:23.000000000 +0200 +@@ -0,0 +1,98 @@ ++# Copyright 2005 ++# Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 2 of the License, or ++# (at your option) any later version. ++# ++# This program 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 General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++ ++# Please email any bugs, comments, and/or additions to this file to: ++# bug-gdb@prep.ai.mit.edu ++ ++# This file was written by Jeff Johnston . ++ ++if $tracelevel then { ++ strace $tracelevel ++} ++ ++set prms_id 0 ++set bug_id 0 ++ ++# are we on a target board ++if [is_remote target] { ++ return ++} ++ ++ ++global verbose ++global GDB ++global GDBFLAGS ++global gdb_prompt ++global timeout ++global gdb_spawn_id; ++ ++gdb_stop_suppressing_tests; ++ ++verbose "Spawning $GDB -nw" ++ ++if [info exists gdb_spawn_id] { ++ return 0; ++} ++ ++if ![is_remote host] { ++ if { [which $GDB] == 0 } then { ++ perror "$GDB does not exist." ++ exit 1 ++ } ++} ++ ++set env(HOME) [pwd] ++remote_exec build "rm .gdbinit" ++remote_exec build "cp ${srcdir}/${subdir}/gdbinit.sample .gdbinit" ++remote_exec build "chmod 646 .gdbinit" ++ ++set res [remote_spawn host "$GDB -nw [host_info gdb_opts]"]; ++if { $res < 0 || $res == "" } { ++ perror "Spawning $GDB failed." ++ return 1; ++} ++gdb_expect 360 { ++ -re "warning: not using untrusted file.*\.gdbinit.*\[\r\n\]$gdb_prompt $" { ++ pass "untrusted .gdbinit caught." ++ } ++ -re "$gdb_prompt $" { ++ fail "untrusted .gdbinit caught." ++ } ++ timeout { ++ fail "(timeout) untrusted .gdbinit caught." ++ } ++} ++ ++remote_exec build "chmod 644 .gdbinit" ++set res [remote_spawn host "$GDB -nw [host_info gdb_opts]"]; ++if { $res < 0 || $res == "" } { ++ perror "Spawning $GDB failed." ++ return 1; ++} ++gdb_expect 360 { ++ -re "warning: not using untrusted file.*\.gdbinit.*\[\r\n\]$gdb_prompt $" { ++ fail "trusted .gdbinit allowed." ++ } ++ -re "in gdbinit.*$gdb_prompt $" { ++ pass "trusted .gdbinit allowed." ++ } ++ timeout { ++ fail "(timeout) trusted .gdbinit allowed." ++ } ++} ++ ++remote_exec build "rm .gdbinit" +diff -durN gdb-6.7.orig/gdb/testsuite/gdb.base/gdbinit.sample gdb-6.7/gdb/testsuite/gdb.base/gdbinit.sample +--- gdb-6.7.orig/gdb/testsuite/gdb.base/gdbinit.sample 1970-01-01 01:00:00.000000000 +0100 ++++ gdb-6.7/gdb/testsuite/gdb.base/gdbinit.sample 2008-06-17 23:25:23.000000000 +0200 +@@ -0,0 +1 @@ ++echo "\nin gdbinit" diff --git a/patches/gdb/6.7/125-gdb-hppa-offsets.patch b/patches/gdb/6.7/125-gdb-hppa-offsets.patch deleted file mode 100644 index 9de831b..0000000 --- a/patches/gdb/6.7/125-gdb-hppa-offsets.patch +++ /dev/null @@ -1,272 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gdb/6.7/45_all_gdb-hppa-offsets.patch --= BEGIN original header =- -sanitized headers dont include asm/offsets.h, so cache a local copy - -http://bugs.gentoo.org/180476 -http://lists.parisc-linux.org/pipermail/parisc-linux/2007-February/031162.html - --= END original header =- -diff -durN gdb-6.7.orig/gdb/hppa-linux-nat.c gdb-6.7/gdb/hppa-linux-nat.c ---- gdb-6.7.orig/gdb/hppa-linux-nat.c 2007-08-23 20:08:33.000000000 +0200 -+++ gdb-6.7/gdb/hppa-linux-nat.c 2008-06-17 23:25:28.000000000 +0200 -@@ -32,7 +32,7 @@ - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,43) - #include - #else --#include -+#include - #endif - - #include "hppa-tdep.h" -diff -durN gdb-6.7.orig/gdb/hppa-offsets.h gdb-6.7/gdb/hppa-offsets.h ---- gdb-6.7.orig/gdb/hppa-offsets.h 1970-01-01 01:00:00.000000000 +0100 -+++ gdb-6.7/gdb/hppa-offsets.h 2008-06-17 23:25:28.000000000 +0200 -@@ -0,0 +1,248 @@ -+#ifndef __ASM_OFFSETS_H__ -+#define __ASM_OFFSETS_H__ -+/* -+ * DO NOT MODIFY. -+ * -+ * This file was generated by arch/parisc/Makefile -+ * -+ */ -+ -+#define TASK_THREAD_INFO 4 /* offsetof(struct task_struct, thread_info) */ -+#define TASK_STATE 0 /* offsetof(struct task_struct, state) */ -+#define TASK_FLAGS 12 /* offsetof(struct task_struct, flags) */ -+#define TASK_SIGPENDING 1188 /* offsetof(struct task_struct, pending) */ -+#define TASK_PTRACE 16 /* offsetof(struct task_struct, ptrace) */ -+#define TASK_MM 108 /* offsetof(struct task_struct, mm) */ -+#define TASK_PERSONALITY 132 /* offsetof(struct task_struct, personality) */ -+#define TASK_PID 140 /* offsetof(struct task_struct, pid) */ -+ -+#define TASK_REGS 664 /* offsetof(struct task_struct, thread.regs) */ -+#define TASK_PT_PSW 664 /* offsetof(struct task_struct, thread.regs.gr[ 0]) */ -+#define TASK_PT_GR1 668 /* offsetof(struct task_struct, thread.regs.gr[ 1]) */ -+#define TASK_PT_GR2 672 /* offsetof(struct task_struct, thread.regs.gr[ 2]) */ -+#define TASK_PT_GR3 676 /* offsetof(struct task_struct, thread.regs.gr[ 3]) */ -+#define TASK_PT_GR4 680 /* offsetof(struct task_struct, thread.regs.gr[ 4]) */ -+#define TASK_PT_GR5 684 /* offsetof(struct task_struct, thread.regs.gr[ 5]) */ -+#define TASK_PT_GR6 688 /* offsetof(struct task_struct, thread.regs.gr[ 6]) */ -+#define TASK_PT_GR7 692 /* offsetof(struct task_struct, thread.regs.gr[ 7]) */ -+#define TASK_PT_GR8 696 /* offsetof(struct task_struct, thread.regs.gr[ 8]) */ -+#define TASK_PT_GR9 700 /* offsetof(struct task_struct, thread.regs.gr[ 9]) */ -+#define TASK_PT_GR10 704 /* offsetof(struct task_struct, thread.regs.gr[10]) */ -+#define TASK_PT_GR11 708 /* offsetof(struct task_struct, thread.regs.gr[11]) */ -+#define TASK_PT_GR12 712 /* offsetof(struct task_struct, thread.regs.gr[12]) */ -+#define TASK_PT_GR13 716 /* offsetof(struct task_struct, thread.regs.gr[13]) */ -+#define TASK_PT_GR14 720 /* offsetof(struct task_struct, thread.regs.gr[14]) */ -+#define TASK_PT_GR15 724 /* offsetof(struct task_struct, thread.regs.gr[15]) */ -+#define TASK_PT_GR16 728 /* offsetof(struct task_struct, thread.regs.gr[16]) */ -+#define TASK_PT_GR17 732 /* offsetof(struct task_struct, thread.regs.gr[17]) */ -+#define TASK_PT_GR18 736 /* offsetof(struct task_struct, thread.regs.gr[18]) */ -+#define TASK_PT_GR19 740 /* offsetof(struct task_struct, thread.regs.gr[19]) */ -+#define TASK_PT_GR20 744 /* offsetof(struct task_struct, thread.regs.gr[20]) */ -+#define TASK_PT_GR21 748 /* offsetof(struct task_struct, thread.regs.gr[21]) */ -+#define TASK_PT_GR22 752 /* offsetof(struct task_struct, thread.regs.gr[22]) */ -+#define TASK_PT_GR23 756 /* offsetof(struct task_struct, thread.regs.gr[23]) */ -+#define TASK_PT_GR24 760 /* offsetof(struct task_struct, thread.regs.gr[24]) */ -+#define TASK_PT_GR25 764 /* offsetof(struct task_struct, thread.regs.gr[25]) */ -+#define TASK_PT_GR26 768 /* offsetof(struct task_struct, thread.regs.gr[26]) */ -+#define TASK_PT_GR27 772 /* offsetof(struct task_struct, thread.regs.gr[27]) */ -+#define TASK_PT_GR28 776 /* offsetof(struct task_struct, thread.regs.gr[28]) */ -+#define TASK_PT_GR29 780 /* offsetof(struct task_struct, thread.regs.gr[29]) */ -+#define TASK_PT_GR30 784 /* offsetof(struct task_struct, thread.regs.gr[30]) */ -+#define TASK_PT_GR31 788 /* offsetof(struct task_struct, thread.regs.gr[31]) */ -+#define TASK_PT_FR0 792 /* offsetof(struct task_struct, thread.regs.fr[ 0]) */ -+#define TASK_PT_FR1 800 /* offsetof(struct task_struct, thread.regs.fr[ 1]) */ -+#define TASK_PT_FR2 808 /* offsetof(struct task_struct, thread.regs.fr[ 2]) */ -+#define TASK_PT_FR3 816 /* offsetof(struct task_struct, thread.regs.fr[ 3]) */ -+#define TASK_PT_FR4 824 /* offsetof(struct task_struct, thread.regs.fr[ 4]) */ -+#define TASK_PT_FR5 832 /* offsetof(struct task_struct, thread.regs.fr[ 5]) */ -+#define TASK_PT_FR6 840 /* offsetof(struct task_struct, thread.regs.fr[ 6]) */ -+#define TASK_PT_FR7 848 /* offsetof(struct task_struct, thread.regs.fr[ 7]) */ -+#define TASK_PT_FR8 856 /* offsetof(struct task_struct, thread.regs.fr[ 8]) */ -+#define TASK_PT_FR9 864 /* offsetof(struct task_struct, thread.regs.fr[ 9]) */ -+#define TASK_PT_FR10 872 /* offsetof(struct task_struct, thread.regs.fr[10]) */ -+#define TASK_PT_FR11 880 /* offsetof(struct task_struct, thread.regs.fr[11]) */ -+#define TASK_PT_FR12 888 /* offsetof(struct task_struct, thread.regs.fr[12]) */ -+#define TASK_PT_FR13 896 /* offsetof(struct task_struct, thread.regs.fr[13]) */ -+#define TASK_PT_FR14 904 /* offsetof(struct task_struct, thread.regs.fr[14]) */ -+#define TASK_PT_FR15 912 /* offsetof(struct task_struct, thread.regs.fr[15]) */ -+#define TASK_PT_FR16 920 /* offsetof(struct task_struct, thread.regs.fr[16]) */ -+#define TASK_PT_FR17 928 /* offsetof(struct task_struct, thread.regs.fr[17]) */ -+#define TASK_PT_FR18 936 /* offsetof(struct task_struct, thread.regs.fr[18]) */ -+#define TASK_PT_FR19 944 /* offsetof(struct task_struct, thread.regs.fr[19]) */ -+#define TASK_PT_FR20 952 /* offsetof(struct task_struct, thread.regs.fr[20]) */ -+#define TASK_PT_FR21 960 /* offsetof(struct task_struct, thread.regs.fr[21]) */ -+#define TASK_PT_FR22 968 /* offsetof(struct task_struct, thread.regs.fr[22]) */ -+#define TASK_PT_FR23 976 /* offsetof(struct task_struct, thread.regs.fr[23]) */ -+#define TASK_PT_FR24 984 /* offsetof(struct task_struct, thread.regs.fr[24]) */ -+#define TASK_PT_FR25 992 /* offsetof(struct task_struct, thread.regs.fr[25]) */ -+#define TASK_PT_FR26 1000 /* offsetof(struct task_struct, thread.regs.fr[26]) */ -+#define TASK_PT_FR27 1008 /* offsetof(struct task_struct, thread.regs.fr[27]) */ -+#define TASK_PT_FR28 1016 /* offsetof(struct task_struct, thread.regs.fr[28]) */ -+#define TASK_PT_FR29 1024 /* offsetof(struct task_struct, thread.regs.fr[29]) */ -+#define TASK_PT_FR30 1032 /* offsetof(struct task_struct, thread.regs.fr[30]) */ -+#define TASK_PT_FR31 1040 /* offsetof(struct task_struct, thread.regs.fr[31]) */ -+#define TASK_PT_SR0 1048 /* offsetof(struct task_struct, thread.regs.sr[ 0]) */ -+#define TASK_PT_SR1 1052 /* offsetof(struct task_struct, thread.regs.sr[ 1]) */ -+#define TASK_PT_SR2 1056 /* offsetof(struct task_struct, thread.regs.sr[ 2]) */ -+#define TASK_PT_SR3 1060 /* offsetof(struct task_struct, thread.regs.sr[ 3]) */ -+#define TASK_PT_SR4 1064 /* offsetof(struct task_struct, thread.regs.sr[ 4]) */ -+#define TASK_PT_SR5 1068 /* offsetof(struct task_struct, thread.regs.sr[ 5]) */ -+#define TASK_PT_SR6 1072 /* offsetof(struct task_struct, thread.regs.sr[ 6]) */ -+#define TASK_PT_SR7 1076 /* offsetof(struct task_struct, thread.regs.sr[ 7]) */ -+#define TASK_PT_IASQ0 1080 /* offsetof(struct task_struct, thread.regs.iasq[0]) */ -+#define TASK_PT_IASQ1 1084 /* offsetof(struct task_struct, thread.regs.iasq[1]) */ -+#define TASK_PT_IAOQ0 1088 /* offsetof(struct task_struct, thread.regs.iaoq[0]) */ -+#define TASK_PT_IAOQ1 1092 /* offsetof(struct task_struct, thread.regs.iaoq[1]) */ -+#define TASK_PT_CR27 1096 /* offsetof(struct task_struct, thread.regs.cr27) */ -+#define TASK_PT_ORIG_R28 1104 /* offsetof(struct task_struct, thread.regs.orig_r28) */ -+#define TASK_PT_KSP 1108 /* offsetof(struct task_struct, thread.regs.ksp) */ -+#define TASK_PT_KPC 1112 /* offsetof(struct task_struct, thread.regs.kpc) */ -+#define TASK_PT_SAR 1116 /* offsetof(struct task_struct, thread.regs.sar) */ -+#define TASK_PT_IIR 1120 /* offsetof(struct task_struct, thread.regs.iir) */ -+#define TASK_PT_ISR 1124 /* offsetof(struct task_struct, thread.regs.isr) */ -+#define TASK_PT_IOR 1128 /* offsetof(struct task_struct, thread.regs.ior) */ -+ -+#define TASK_SZ 1272 /* sizeof(struct task_struct) */ -+#define TASK_SZ_ALGN 1344 /* align(sizeof(struct task_struct), 64) */ -+ -+#define PT_PSW 0 /* offsetof(struct pt_regs, gr[ 0]) */ -+#define PT_GR1 4 /* offsetof(struct pt_regs, gr[ 1]) */ -+#define PT_GR2 8 /* offsetof(struct pt_regs, gr[ 2]) */ -+#define PT_GR3 12 /* offsetof(struct pt_regs, gr[ 3]) */ -+#define PT_GR4 16 /* offsetof(struct pt_regs, gr[ 4]) */ -+#define PT_GR5 20 /* offsetof(struct pt_regs, gr[ 5]) */ -+#define PT_GR6 24 /* offsetof(struct pt_regs, gr[ 6]) */ -+#define PT_GR7 28 /* offsetof(struct pt_regs, gr[ 7]) */ -+#define PT_GR8 32 /* offsetof(struct pt_regs, gr[ 8]) */ -+#define PT_GR9 36 /* offsetof(struct pt_regs, gr[ 9]) */ -+#define PT_GR10 40 /* offsetof(struct pt_regs, gr[10]) */ -+#define PT_GR11 44 /* offsetof(struct pt_regs, gr[11]) */ -+#define PT_GR12 48 /* offsetof(struct pt_regs, gr[12]) */ -+#define PT_GR13 52 /* offsetof(struct pt_regs, gr[13]) */ -+#define PT_GR14 56 /* offsetof(struct pt_regs, gr[14]) */ -+#define PT_GR15 60 /* offsetof(struct pt_regs, gr[15]) */ -+#define PT_GR16 64 /* offsetof(struct pt_regs, gr[16]) */ -+#define PT_GR17 68 /* offsetof(struct pt_regs, gr[17]) */ -+#define PT_GR18 72 /* offsetof(struct pt_regs, gr[18]) */ -+#define PT_GR19 76 /* offsetof(struct pt_regs, gr[19]) */ -+#define PT_GR20 80 /* offsetof(struct pt_regs, gr[20]) */ -+#define PT_GR21 84 /* offsetof(struct pt_regs, gr[21]) */ -+#define PT_GR22 88 /* offsetof(struct pt_regs, gr[22]) */ -+#define PT_GR23 92 /* offsetof(struct pt_regs, gr[23]) */ -+#define PT_GR24 96 /* offsetof(struct pt_regs, gr[24]) */ -+#define PT_GR25 100 /* offsetof(struct pt_regs, gr[25]) */ -+#define PT_GR26 104 /* offsetof(struct pt_regs, gr[26]) */ -+#define PT_GR27 108 /* offsetof(struct pt_regs, gr[27]) */ -+#define PT_GR28 112 /* offsetof(struct pt_regs, gr[28]) */ -+#define PT_GR29 116 /* offsetof(struct pt_regs, gr[29]) */ -+#define PT_GR30 120 /* offsetof(struct pt_regs, gr[30]) */ -+#define PT_GR31 124 /* offsetof(struct pt_regs, gr[31]) */ -+#define PT_FR0 128 /* offsetof(struct pt_regs, fr[ 0]) */ -+#define PT_FR1 136 /* offsetof(struct pt_regs, fr[ 1]) */ -+#define PT_FR2 144 /* offsetof(struct pt_regs, fr[ 2]) */ -+#define PT_FR3 152 /* offsetof(struct pt_regs, fr[ 3]) */ -+#define PT_FR4 160 /* offsetof(struct pt_regs, fr[ 4]) */ -+#define PT_FR5 168 /* offsetof(struct pt_regs, fr[ 5]) */ -+#define PT_FR6 176 /* offsetof(struct pt_regs, fr[ 6]) */ -+#define PT_FR7 184 /* offsetof(struct pt_regs, fr[ 7]) */ -+#define PT_FR8 192 /* offsetof(struct pt_regs, fr[ 8]) */ -+#define PT_FR9 200 /* offsetof(struct pt_regs, fr[ 9]) */ -+#define PT_FR10 208 /* offsetof(struct pt_regs, fr[10]) */ -+#define PT_FR11 216 /* offsetof(struct pt_regs, fr[11]) */ -+#define PT_FR12 224 /* offsetof(struct pt_regs, fr[12]) */ -+#define PT_FR13 232 /* offsetof(struct pt_regs, fr[13]) */ -+#define PT_FR14 240 /* offsetof(struct pt_regs, fr[14]) */ -+#define PT_FR15 248 /* offsetof(struct pt_regs, fr[15]) */ -+#define PT_FR16 256 /* offsetof(struct pt_regs, fr[16]) */ -+#define PT_FR17 264 /* offsetof(struct pt_regs, fr[17]) */ -+#define PT_FR18 272 /* offsetof(struct pt_regs, fr[18]) */ -+#define PT_FR19 280 /* offsetof(struct pt_regs, fr[19]) */ -+#define PT_FR20 288 /* offsetof(struct pt_regs, fr[20]) */ -+#define PT_FR21 296 /* offsetof(struct pt_regs, fr[21]) */ -+#define PT_FR22 304 /* offsetof(struct pt_regs, fr[22]) */ -+#define PT_FR23 312 /* offsetof(struct pt_regs, fr[23]) */ -+#define PT_FR24 320 /* offsetof(struct pt_regs, fr[24]) */ -+#define PT_FR25 328 /* offsetof(struct pt_regs, fr[25]) */ -+#define PT_FR26 336 /* offsetof(struct pt_regs, fr[26]) */ -+#define PT_FR27 344 /* offsetof(struct pt_regs, fr[27]) */ -+#define PT_FR28 352 /* offsetof(struct pt_regs, fr[28]) */ -+#define PT_FR29 360 /* offsetof(struct pt_regs, fr[29]) */ -+#define PT_FR30 368 /* offsetof(struct pt_regs, fr[30]) */ -+#define PT_FR31 376 /* offsetof(struct pt_regs, fr[31]) */ -+#define PT_SR0 384 /* offsetof(struct pt_regs, sr[ 0]) */ -+#define PT_SR1 388 /* offsetof(struct pt_regs, sr[ 1]) */ -+#define PT_SR2 392 /* offsetof(struct pt_regs, sr[ 2]) */ -+#define PT_SR3 396 /* offsetof(struct pt_regs, sr[ 3]) */ -+#define PT_SR4 400 /* offsetof(struct pt_regs, sr[ 4]) */ -+#define PT_SR5 404 /* offsetof(struct pt_regs, sr[ 5]) */ -+#define PT_SR6 408 /* offsetof(struct pt_regs, sr[ 6]) */ -+#define PT_SR7 412 /* offsetof(struct pt_regs, sr[ 7]) */ -+#define PT_IASQ0 416 /* offsetof(struct pt_regs, iasq[0]) */ -+#define PT_IASQ1 420 /* offsetof(struct pt_regs, iasq[1]) */ -+#define PT_IAOQ0 424 /* offsetof(struct pt_regs, iaoq[0]) */ -+#define PT_IAOQ1 428 /* offsetof(struct pt_regs, iaoq[1]) */ -+#define PT_CR27 432 /* offsetof(struct pt_regs, cr27) */ -+#define PT_ORIG_R28 440 /* offsetof(struct pt_regs, orig_r28) */ -+#define PT_KSP 444 /* offsetof(struct pt_regs, ksp) */ -+#define PT_KPC 448 /* offsetof(struct pt_regs, kpc) */ -+#define PT_SAR 452 /* offsetof(struct pt_regs, sar) */ -+#define PT_IIR 456 /* offsetof(struct pt_regs, iir) */ -+#define PT_ISR 460 /* offsetof(struct pt_regs, isr) */ -+#define PT_IOR 464 /* offsetof(struct pt_regs, ior) */ -+#define PT_SIZE 472 /* sizeof(struct pt_regs) */ -+#define PT_SZ_ALGN 576 /* align(sizeof(struct pt_regs), 64) */ -+ -+#define TI_TASK 0 /* offsetof(struct thread_info, task) */ -+#define TI_EXEC_DOMAIN 4 /* offsetof(struct thread_info, exec_domain) */ -+#define TI_FLAGS 8 /* offsetof(struct thread_info, flags) */ -+#define TI_CPU 16 /* offsetof(struct thread_info, cpu) */ -+#define TI_SEGMENT 12 /* offsetof(struct thread_info, addr_limit) */ -+#define TI_PRE_COUNT 20 /* offsetof(struct thread_info, preempt_count) */ -+#define THREAD_SZ 44 /* sizeof(struct thread_info) */ -+#define THREAD_SZ_ALGN 128 /* align(sizeof(struct thread_info), 64) */ -+ -+#define IRQSTAT_SIRQ_PEND 0 /* offsetof(irq_cpustat_t, __softirq_pending) */ -+#define IRQSTAT_SZ 64 /* sizeof(irq_cpustat_t) */ -+ -+#define ICACHE_BASE 8 /* offsetof(struct pdc_cache_info, ic_base) */ -+#define ICACHE_STRIDE 12 /* offsetof(struct pdc_cache_info, ic_stride) */ -+#define ICACHE_COUNT 16 /* offsetof(struct pdc_cache_info, ic_count) */ -+#define ICACHE_LOOP 20 /* offsetof(struct pdc_cache_info, ic_loop) */ -+#define DCACHE_BASE 32 /* offsetof(struct pdc_cache_info, dc_base) */ -+#define DCACHE_STRIDE 36 /* offsetof(struct pdc_cache_info, dc_stride) */ -+#define DCACHE_COUNT 40 /* offsetof(struct pdc_cache_info, dc_count) */ -+#define DCACHE_LOOP 44 /* offsetof(struct pdc_cache_info, dc_loop) */ -+#define ITLB_SID_BASE 56 /* offsetof(struct pdc_cache_info, it_sp_base) */ -+#define ITLB_SID_STRIDE 60 /* offsetof(struct pdc_cache_info, it_sp_stride) */ -+#define ITLB_SID_COUNT 64 /* offsetof(struct pdc_cache_info, it_sp_count) */ -+#define ITLB_OFF_BASE 68 /* offsetof(struct pdc_cache_info, it_off_base) */ -+#define ITLB_OFF_STRIDE 72 /* offsetof(struct pdc_cache_info, it_off_stride) */ -+#define ITLB_OFF_COUNT 76 /* offsetof(struct pdc_cache_info, it_off_count) */ -+#define ITLB_LOOP 80 /* offsetof(struct pdc_cache_info, it_loop) */ -+#define DTLB_SID_BASE 92 /* offsetof(struct pdc_cache_info, dt_sp_base) */ -+#define DTLB_SID_STRIDE 96 /* offsetof(struct pdc_cache_info, dt_sp_stride) */ -+#define DTLB_SID_COUNT 100 /* offsetof(struct pdc_cache_info, dt_sp_count) */ -+#define DTLB_OFF_BASE 104 /* offsetof(struct pdc_cache_info, dt_off_base) */ -+#define DTLB_OFF_STRIDE 108 /* offsetof(struct pdc_cache_info, dt_off_stride) */ -+#define DTLB_OFF_COUNT 112 /* offsetof(struct pdc_cache_info, dt_off_count) */ -+#define DTLB_LOOP 116 /* offsetof(struct pdc_cache_info, dt_loop) */ -+ -+#define PA_BLOCKSTEP_BIT 1 /* 31-PT_BLOCKSTEP_BIT */ -+#define PA_SINGLESTEP_BIT 0 /* 31-PT_SINGLESTEP_BIT */ -+ -+#define ASM_PMD_SHIFT 21 /* PMD_SHIFT */ -+#define ASM_PGDIR_SHIFT 21 /* PGDIR_SHIFT */ -+#define ASM_BITS_PER_PGD 11 /* BITS_PER_PGD */ -+#define ASM_BITS_PER_PMD 0 /* BITS_PER_PMD */ -+#define ASM_BITS_PER_PTE 9 /* BITS_PER_PTE */ -+#define ASM_PGD_PMD_OFFSET -8192 /* -(PAGE_SIZE << PGD_ORDER) */ -+#define ASM_PMD_ENTRY 128 /* ((PAGE_OFFSET & PMD_MASK) >> PMD_SHIFT) */ -+#define ASM_PGD_ENTRY 128 /* PAGE_OFFSET >> PGDIR_SHIFT */ -+#define ASM_PGD_ENTRY_SIZE 4 /* PGD_ENTRY_SIZE */ -+#define ASM_PMD_ENTRY_SIZE 4 /* PMD_ENTRY_SIZE */ -+#define ASM_PTE_ENTRY_SIZE 8 /* PTE_ENTRY_SIZE */ -+#define ASM_PT_INITIAL 4 /* PT_INITIAL */ -+#define ASM_PAGE_SIZE 4096 /* PAGE_SIZE */ -+ -+ -+#endif diff --git a/patches/gdb/6.7/125-hppa-offsets.patch b/patches/gdb/6.7/125-hppa-offsets.patch new file mode 100644 index 0000000..9de831b --- /dev/null +++ b/patches/gdb/6.7/125-hppa-offsets.patch @@ -0,0 +1,272 @@ +Original patch from gentoo: gentoo/src/patchsets/gdb/6.7/45_all_gdb-hppa-offsets.patch +-= BEGIN original header =- +sanitized headers dont include asm/offsets.h, so cache a local copy + +http://bugs.gentoo.org/180476 +http://lists.parisc-linux.org/pipermail/parisc-linux/2007-February/031162.html + +-= END original header =- +diff -durN gdb-6.7.orig/gdb/hppa-linux-nat.c gdb-6.7/gdb/hppa-linux-nat.c +--- gdb-6.7.orig/gdb/hppa-linux-nat.c 2007-08-23 20:08:33.000000000 +0200 ++++ gdb-6.7/gdb/hppa-linux-nat.c 2008-06-17 23:25:28.000000000 +0200 +@@ -32,7 +32,7 @@ + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,43) + #include + #else +-#include ++#include + #endif + + #include "hppa-tdep.h" +diff -durN gdb-6.7.orig/gdb/hppa-offsets.h gdb-6.7/gdb/hppa-offsets.h +--- gdb-6.7.orig/gdb/hppa-offsets.h 1970-01-01 01:00:00.000000000 +0100 ++++ gdb-6.7/gdb/hppa-offsets.h 2008-06-17 23:25:28.000000000 +0200 +@@ -0,0 +1,248 @@ ++#ifndef __ASM_OFFSETS_H__ ++#define __ASM_OFFSETS_H__ ++/* ++ * DO NOT MODIFY. ++ * ++ * This file was generated by arch/parisc/Makefile ++ * ++ */ ++ ++#define TASK_THREAD_INFO 4 /* offsetof(struct task_struct, thread_info) */ ++#define TASK_STATE 0 /* offsetof(struct task_struct, state) */ ++#define TASK_FLAGS 12 /* offsetof(struct task_struct, flags) */ ++#define TASK_SIGPENDING 1188 /* offsetof(struct task_struct, pending) */ ++#define TASK_PTRACE 16 /* offsetof(struct task_struct, ptrace) */ ++#define TASK_MM 108 /* offsetof(struct task_struct, mm) */ ++#define TASK_PERSONALITY 132 /* offsetof(struct task_struct, personality) */ ++#define TASK_PID 140 /* offsetof(struct task_struct, pid) */ ++ ++#define TASK_REGS 664 /* offsetof(struct task_struct, thread.regs) */ ++#define TASK_PT_PSW 664 /* offsetof(struct task_struct, thread.regs.gr[ 0]) */ ++#define TASK_PT_GR1 668 /* offsetof(struct task_struct, thread.regs.gr[ 1]) */ ++#define TASK_PT_GR2 672 /* offsetof(struct task_struct, thread.regs.gr[ 2]) */ ++#define TASK_PT_GR3 676 /* offsetof(struct task_struct, thread.regs.gr[ 3]) */ ++#define TASK_PT_GR4 680 /* offsetof(struct task_struct, thread.regs.gr[ 4]) */ ++#define TASK_PT_GR5 684 /* offsetof(struct task_struct, thread.regs.gr[ 5]) */ ++#define TASK_PT_GR6 688 /* offsetof(struct task_struct, thread.regs.gr[ 6]) */ ++#define TASK_PT_GR7 692 /* offsetof(struct task_struct, thread.regs.gr[ 7]) */ ++#define TASK_PT_GR8 696 /* offsetof(struct task_struct, thread.regs.gr[ 8]) */ ++#define TASK_PT_GR9 700 /* offsetof(struct task_struct, thread.regs.gr[ 9]) */ ++#define TASK_PT_GR10 704 /* offsetof(struct task_struct, thread.regs.gr[10]) */ ++#define TASK_PT_GR11 708 /* offsetof(struct task_struct, thread.regs.gr[11]) */ ++#define TASK_PT_GR12 712 /* offsetof(struct task_struct, thread.regs.gr[12]) */ ++#define TASK_PT_GR13 716 /* offsetof(struct task_struct, thread.regs.gr[13]) */ ++#define TASK_PT_GR14 720 /* offsetof(struct task_struct, thread.regs.gr[14]) */ ++#define TASK_PT_GR15 724 /* offsetof(struct task_struct, thread.regs.gr[15]) */ ++#define TASK_PT_GR16 728 /* offsetof(struct task_struct, thread.regs.gr[16]) */ ++#define TASK_PT_GR17 732 /* offsetof(struct task_struct, thread.regs.gr[17]) */ ++#define TASK_PT_GR18 736 /* offsetof(struct task_struct, thread.regs.gr[18]) */ ++#define TASK_PT_GR19 740 /* offsetof(struct task_struct, thread.regs.gr[19]) */ ++#define TASK_PT_GR20 744 /* offsetof(struct task_struct, thread.regs.gr[20]) */ ++#define TASK_PT_GR21 748 /* offsetof(struct task_struct, thread.regs.gr[21]) */ ++#define TASK_PT_GR22 752 /* offsetof(struct task_struct, thread.regs.gr[22]) */ ++#define TASK_PT_GR23 756 /* offsetof(struct task_struct, thread.regs.gr[23]) */ ++#define TASK_PT_GR24 760 /* offsetof(struct task_struct, thread.regs.gr[24]) */ ++#define TASK_PT_GR25 764 /* offsetof(struct task_struct, thread.regs.gr[25]) */ ++#define TASK_PT_GR26 768 /* offsetof(struct task_struct, thread.regs.gr[26]) */ ++#define TASK_PT_GR27 772 /* offsetof(struct task_struct, thread.regs.gr[27]) */ ++#define TASK_PT_GR28 776 /* offsetof(struct task_struct, thread.regs.gr[28]) */ ++#define TASK_PT_GR29 780 /* offsetof(struct task_struct, thread.regs.gr[29]) */ ++#define TASK_PT_GR30 784 /* offsetof(struct task_struct, thread.regs.gr[30]) */ ++#define TASK_PT_GR31 788 /* offsetof(struct task_struct, thread.regs.gr[31]) */ ++#define TASK_PT_FR0 792 /* offsetof(struct task_struct, thread.regs.fr[ 0]) */ ++#define TASK_PT_FR1 800 /* offsetof(struct task_struct, thread.regs.fr[ 1]) */ ++#define TASK_PT_FR2 808 /* offsetof(struct task_struct, thread.regs.fr[ 2]) */ ++#define TASK_PT_FR3 816 /* offsetof(struct task_struct, thread.regs.fr[ 3]) */ ++#define TASK_PT_FR4 824 /* offsetof(struct task_struct, thread.regs.fr[ 4]) */ ++#define TASK_PT_FR5 832 /* offsetof(struct task_struct, thread.regs.fr[ 5]) */ ++#define TASK_PT_FR6 840 /* offsetof(struct task_struct, thread.regs.fr[ 6]) */ ++#define TASK_PT_FR7 848 /* offsetof(struct task_struct, thread.regs.fr[ 7]) */ ++#define TASK_PT_FR8 856 /* offsetof(struct task_struct, thread.regs.fr[ 8]) */ ++#define TASK_PT_FR9 864 /* offsetof(struct task_struct, thread.regs.fr[ 9]) */ ++#define TASK_PT_FR10 872 /* offsetof(struct task_struct, thread.regs.fr[10]) */ ++#define TASK_PT_FR11 880 /* offsetof(struct task_struct, thread.regs.fr[11]) */ ++#define TASK_PT_FR12 888 /* offsetof(struct task_struct, thread.regs.fr[12]) */ ++#define TASK_PT_FR13 896 /* offsetof(struct task_struct, thread.regs.fr[13]) */ ++#define TASK_PT_FR14 904 /* offsetof(struct task_struct, thread.regs.fr[14]) */ ++#define TASK_PT_FR15 912 /* offsetof(struct task_struct, thread.regs.fr[15]) */ ++#define TASK_PT_FR16 920 /* offsetof(struct task_struct, thread.regs.fr[16]) */ ++#define TASK_PT_FR17 928 /* offsetof(struct task_struct, thread.regs.fr[17]) */ ++#define TASK_PT_FR18 936 /* offsetof(struct task_struct, thread.regs.fr[18]) */ ++#define TASK_PT_FR19 944 /* offsetof(struct task_struct, thread.regs.fr[19]) */ ++#define TASK_PT_FR20 952 /* offsetof(struct task_struct, thread.regs.fr[20]) */ ++#define TASK_PT_FR21 960 /* offsetof(struct task_struct, thread.regs.fr[21]) */ ++#define TASK_PT_FR22 968 /* offsetof(struct task_struct, thread.regs.fr[22]) */ ++#define TASK_PT_FR23 976 /* offsetof(struct task_struct, thread.regs.fr[23]) */ ++#define TASK_PT_FR24 984 /* offsetof(struct task_struct, thread.regs.fr[24]) */ ++#define TASK_PT_FR25 992 /* offsetof(struct task_struct, thread.regs.fr[25]) */ ++#define TASK_PT_FR26 1000 /* offsetof(struct task_struct, thread.regs.fr[26]) */ ++#define TASK_PT_FR27 1008 /* offsetof(struct task_struct, thread.regs.fr[27]) */ ++#define TASK_PT_FR28 1016 /* offsetof(struct task_struct, thread.regs.fr[28]) */ ++#define TASK_PT_FR29 1024 /* offsetof(struct task_struct, thread.regs.fr[29]) */ ++#define TASK_PT_FR30 1032 /* offsetof(struct task_struct, thread.regs.fr[30]) */ ++#define TASK_PT_FR31 1040 /* offsetof(struct task_struct, thread.regs.fr[31]) */ ++#define TASK_PT_SR0 1048 /* offsetof(struct task_struct, thread.regs.sr[ 0]) */ ++#define TASK_PT_SR1 1052 /* offsetof(struct task_struct, thread.regs.sr[ 1]) */ ++#define TASK_PT_SR2 1056 /* offsetof(struct task_struct, thread.regs.sr[ 2]) */ ++#define TASK_PT_SR3 1060 /* offsetof(struct task_struct, thread.regs.sr[ 3]) */ ++#define TASK_PT_SR4 1064 /* offsetof(struct task_struct, thread.regs.sr[ 4]) */ ++#define TASK_PT_SR5 1068 /* offsetof(struct task_struct, thread.regs.sr[ 5]) */ ++#define TASK_PT_SR6 1072 /* offsetof(struct task_struct, thread.regs.sr[ 6]) */ ++#define TASK_PT_SR7 1076 /* offsetof(struct task_struct, thread.regs.sr[ 7]) */ ++#define TASK_PT_IASQ0 1080 /* offsetof(struct task_struct, thread.regs.iasq[0]) */ ++#define TASK_PT_IASQ1 1084 /* offsetof(struct task_struct, thread.regs.iasq[1]) */ ++#define TASK_PT_IAOQ0 1088 /* offsetof(struct task_struct, thread.regs.iaoq[0]) */ ++#define TASK_PT_IAOQ1 1092 /* offsetof(struct task_struct, thread.regs.iaoq[1]) */ ++#define TASK_PT_CR27 1096 /* offsetof(struct task_struct, thread.regs.cr27) */ ++#define TASK_PT_ORIG_R28 1104 /* offsetof(struct task_struct, thread.regs.orig_r28) */ ++#define TASK_PT_KSP 1108 /* offsetof(struct task_struct, thread.regs.ksp) */ ++#define TASK_PT_KPC 1112 /* offsetof(struct task_struct, thread.regs.kpc) */ ++#define TASK_PT_SAR 1116 /* offsetof(struct task_struct, thread.regs.sar) */ ++#define TASK_PT_IIR 1120 /* offsetof(struct task_struct, thread.regs.iir) */ ++#define TASK_PT_ISR 1124 /* offsetof(struct task_struct, thread.regs.isr) */ ++#define TASK_PT_IOR 1128 /* offsetof(struct task_struct, thread.regs.ior) */ ++ ++#define TASK_SZ 1272 /* sizeof(struct task_struct) */ ++#define TASK_SZ_ALGN 1344 /* align(sizeof(struct task_struct), 64) */ ++ ++#define PT_PSW 0 /* offsetof(struct pt_regs, gr[ 0]) */ ++#define PT_GR1 4 /* offsetof(struct pt_regs, gr[ 1]) */ ++#define PT_GR2 8 /* offsetof(struct pt_regs, gr[ 2]) */ ++#define PT_GR3 12 /* offsetof(struct pt_regs, gr[ 3]) */ ++#define PT_GR4 16 /* offsetof(struct pt_regs, gr[ 4]) */ ++#define PT_GR5 20 /* offsetof(struct pt_regs, gr[ 5]) */ ++#define PT_GR6 24 /* offsetof(struct pt_regs, gr[ 6]) */ ++#define PT_GR7 28 /* offsetof(struct pt_regs, gr[ 7]) */ ++#define PT_GR8 32 /* offsetof(struct pt_regs, gr[ 8]) */ ++#define PT_GR9 36 /* offsetof(struct pt_regs, gr[ 9]) */ ++#define PT_GR10 40 /* offsetof(struct pt_regs, gr[10]) */ ++#define PT_GR11 44 /* offsetof(struct pt_regs, gr[11]) */ ++#define PT_GR12 48 /* offsetof(struct pt_regs, gr[12]) */ ++#define PT_GR13 52 /* offsetof(struct pt_regs, gr[13]) */ ++#define PT_GR14 56 /* offsetof(struct pt_regs, gr[14]) */ ++#define PT_GR15 60 /* offsetof(struct pt_regs, gr[15]) */ ++#define PT_GR16 64 /* offsetof(struct pt_regs, gr[16]) */ ++#define PT_GR17 68 /* offsetof(struct pt_regs, gr[17]) */ ++#define PT_GR18 72 /* offsetof(struct pt_regs, gr[18]) */ ++#define PT_GR19 76 /* offsetof(struct pt_regs, gr[19]) */ ++#define PT_GR20 80 /* offsetof(struct pt_regs, gr[20]) */ ++#define PT_GR21 84 /* offsetof(struct pt_regs, gr[21]) */ ++#define PT_GR22 88 /* offsetof(struct pt_regs, gr[22]) */ ++#define PT_GR23 92 /* offsetof(struct pt_regs, gr[23]) */ ++#define PT_GR24 96 /* offsetof(struct pt_regs, gr[24]) */ ++#define PT_GR25 100 /* offsetof(struct pt_regs, gr[25]) */ ++#define PT_GR26 104 /* offsetof(struct pt_regs, gr[26]) */ ++#define PT_GR27 108 /* offsetof(struct pt_regs, gr[27]) */ ++#define PT_GR28 112 /* offsetof(struct pt_regs, gr[28]) */ ++#define PT_GR29 116 /* offsetof(struct pt_regs, gr[29]) */ ++#define PT_GR30 120 /* offsetof(struct pt_regs, gr[30]) */ ++#define PT_GR31 124 /* offsetof(struct pt_regs, gr[31]) */ ++#define PT_FR0 128 /* offsetof(struct pt_regs, fr[ 0]) */ ++#define PT_FR1 136 /* offsetof(struct pt_regs, fr[ 1]) */ ++#define PT_FR2 144 /* offsetof(struct pt_regs, fr[ 2]) */ ++#define PT_FR3 152 /* offsetof(struct pt_regs, fr[ 3]) */ ++#define PT_FR4 160 /* offsetof(struct pt_regs, fr[ 4]) */ ++#define PT_FR5 168 /* offsetof(struct pt_regs, fr[ 5]) */ ++#define PT_FR6 176 /* offsetof(struct pt_regs, fr[ 6]) */ ++#define PT_FR7 184 /* offsetof(struct pt_regs, fr[ 7]) */ ++#define PT_FR8 192 /* offsetof(struct pt_regs, fr[ 8]) */ ++#define PT_FR9 200 /* offsetof(struct pt_regs, fr[ 9]) */ ++#define PT_FR10 208 /* offsetof(struct pt_regs, fr[10]) */ ++#define PT_FR11 216 /* offsetof(struct pt_regs, fr[11]) */ ++#define PT_FR12 224 /* offsetof(struct pt_regs, fr[12]) */ ++#define PT_FR13 232 /* offsetof(struct pt_regs, fr[13]) */ ++#define PT_FR14 240 /* offsetof(struct pt_regs, fr[14]) */ ++#define PT_FR15 248 /* offsetof(struct pt_regs, fr[15]) */ ++#define PT_FR16 256 /* offsetof(struct pt_regs, fr[16]) */ ++#define PT_FR17 264 /* offsetof(struct pt_regs, fr[17]) */ ++#define PT_FR18 272 /* offsetof(struct pt_regs, fr[18]) */ ++#define PT_FR19 280 /* offsetof(struct pt_regs, fr[19]) */ ++#define PT_FR20 288 /* offsetof(struct pt_regs, fr[20]) */ ++#define PT_FR21 296 /* offsetof(struct pt_regs, fr[21]) */ ++#define PT_FR22 304 /* offsetof(struct pt_regs, fr[22]) */ ++#define PT_FR23 312 /* offsetof(struct pt_regs, fr[23]) */ ++#define PT_FR24 320 /* offsetof(struct pt_regs, fr[24]) */ ++#define PT_FR25 328 /* offsetof(struct pt_regs, fr[25]) */ ++#define PT_FR26 336 /* offsetof(struct pt_regs, fr[26]) */ ++#define PT_FR27 344 /* offsetof(struct pt_regs, fr[27]) */ ++#define PT_FR28 352 /* offsetof(struct pt_regs, fr[28]) */ ++#define PT_FR29 360 /* offsetof(struct pt_regs, fr[29]) */ ++#define PT_FR30 368 /* offsetof(struct pt_regs, fr[30]) */ ++#define PT_FR31 376 /* offsetof(struct pt_regs, fr[31]) */ ++#define PT_SR0 384 /* offsetof(struct pt_regs, sr[ 0]) */ ++#define PT_SR1 388 /* offsetof(struct pt_regs, sr[ 1]) */ ++#define PT_SR2 392 /* offsetof(struct pt_regs, sr[ 2]) */ ++#define PT_SR3 396 /* offsetof(struct pt_regs, sr[ 3]) */ ++#define PT_SR4 400 /* offsetof(struct pt_regs, sr[ 4]) */ ++#define PT_SR5 404 /* offsetof(struct pt_regs, sr[ 5]) */ ++#define PT_SR6 408 /* offsetof(struct pt_regs, sr[ 6]) */ ++#define PT_SR7 412 /* offsetof(struct pt_regs, sr[ 7]) */ ++#define PT_IASQ0 416 /* offsetof(struct pt_regs, iasq[0]) */ ++#define PT_IASQ1 420 /* offsetof(struct pt_regs, iasq[1]) */ ++#define PT_IAOQ0 424 /* offsetof(struct pt_regs, iaoq[0]) */ ++#define PT_IAOQ1 428 /* offsetof(struct pt_regs, iaoq[1]) */ ++#define PT_CR27 432 /* offsetof(struct pt_regs, cr27) */ ++#define PT_ORIG_R28 440 /* offsetof(struct pt_regs, orig_r28) */ ++#define PT_KSP 444 /* offsetof(struct pt_regs, ksp) */ ++#define PT_KPC 448 /* offsetof(struct pt_regs, kpc) */ ++#define PT_SAR 452 /* offsetof(struct pt_regs, sar) */ ++#define PT_IIR 456 /* offsetof(struct pt_regs, iir) */ ++#define PT_ISR 460 /* offsetof(struct pt_regs, isr) */ ++#define PT_IOR 464 /* offsetof(struct pt_regs, ior) */ ++#define PT_SIZE 472 /* sizeof(struct pt_regs) */ ++#define PT_SZ_ALGN 576 /* align(sizeof(struct pt_regs), 64) */ ++ ++#define TI_TASK 0 /* offsetof(struct thread_info, task) */ ++#define TI_EXEC_DOMAIN 4 /* offsetof(struct thread_info, exec_domain) */ ++#define TI_FLAGS 8 /* offsetof(struct thread_info, flags) */ ++#define TI_CPU 16 /* offsetof(struct thread_info, cpu) */ ++#define TI_SEGMENT 12 /* offsetof(struct thread_info, addr_limit) */ ++#define TI_PRE_COUNT 20 /* offsetof(struct thread_info, preempt_count) */ ++#define THREAD_SZ 44 /* sizeof(struct thread_info) */ ++#define THREAD_SZ_ALGN 128 /* align(sizeof(struct thread_info), 64) */ ++ ++#define IRQSTAT_SIRQ_PEND 0 /* offsetof(irq_cpustat_t, __softirq_pending) */ ++#define IRQSTAT_SZ 64 /* sizeof(irq_cpustat_t) */ ++ ++#define ICACHE_BASE 8 /* offsetof(struct pdc_cache_info, ic_base) */ ++#define ICACHE_STRIDE 12 /* offsetof(struct pdc_cache_info, ic_stride) */ ++#define ICACHE_COUNT 16 /* offsetof(struct pdc_cache_info, ic_count) */ ++#define ICACHE_LOOP 20 /* offsetof(struct pdc_cache_info, ic_loop) */ ++#define DCACHE_BASE 32 /* offsetof(struct pdc_cache_info, dc_base) */ ++#define DCACHE_STRIDE 36 /* offsetof(struct pdc_cache_info, dc_stride) */ ++#define DCACHE_COUNT 40 /* offsetof(struct pdc_cache_info, dc_count) */ ++#define DCACHE_LOOP 44 /* offsetof(struct pdc_cache_info, dc_loop) */ ++#define ITLB_SID_BASE 56 /* offsetof(struct pdc_cache_info, it_sp_base) */ ++#define ITLB_SID_STRIDE 60 /* offsetof(struct pdc_cache_info, it_sp_stride) */ ++#define ITLB_SID_COUNT 64 /* offsetof(struct pdc_cache_info, it_sp_count) */ ++#define ITLB_OFF_BASE 68 /* offsetof(struct pdc_cache_info, it_off_base) */ ++#define ITLB_OFF_STRIDE 72 /* offsetof(struct pdc_cache_info, it_off_stride) */ ++#define ITLB_OFF_COUNT 76 /* offsetof(struct pdc_cache_info, it_off_count) */ ++#define ITLB_LOOP 80 /* offsetof(struct pdc_cache_info, it_loop) */ ++#define DTLB_SID_BASE 92 /* offsetof(struct pdc_cache_info, dt_sp_base) */ ++#define DTLB_SID_STRIDE 96 /* offsetof(struct pdc_cache_info, dt_sp_stride) */ ++#define DTLB_SID_COUNT 100 /* offsetof(struct pdc_cache_info, dt_sp_count) */ ++#define DTLB_OFF_BASE 104 /* offsetof(struct pdc_cache_info, dt_off_base) */ ++#define DTLB_OFF_STRIDE 108 /* offsetof(struct pdc_cache_info, dt_off_stride) */ ++#define DTLB_OFF_COUNT 112 /* offsetof(struct pdc_cache_info, dt_off_count) */ ++#define DTLB_LOOP 116 /* offsetof(struct pdc_cache_info, dt_loop) */ ++ ++#define PA_BLOCKSTEP_BIT 1 /* 31-PT_BLOCKSTEP_BIT */ ++#define PA_SINGLESTEP_BIT 0 /* 31-PT_SINGLESTEP_BIT */ ++ ++#define ASM_PMD_SHIFT 21 /* PMD_SHIFT */ ++#define ASM_PGDIR_SHIFT 21 /* PGDIR_SHIFT */ ++#define ASM_BITS_PER_PGD 11 /* BITS_PER_PGD */ ++#define ASM_BITS_PER_PMD 0 /* BITS_PER_PMD */ ++#define ASM_BITS_PER_PTE 9 /* BITS_PER_PTE */ ++#define ASM_PGD_PMD_OFFSET -8192 /* -(PAGE_SIZE << PGD_ORDER) */ ++#define ASM_PMD_ENTRY 128 /* ((PAGE_OFFSET & PMD_MASK) >> PMD_SHIFT) */ ++#define ASM_PGD_ENTRY 128 /* PAGE_OFFSET >> PGDIR_SHIFT */ ++#define ASM_PGD_ENTRY_SIZE 4 /* PGD_ENTRY_SIZE */ ++#define ASM_PMD_ENTRY_SIZE 4 /* PMD_ENTRY_SIZE */ ++#define ASM_PTE_ENTRY_SIZE 8 /* PTE_ENTRY_SIZE */ ++#define ASM_PT_INITIAL 4 /* PT_INITIAL */ ++#define ASM_PAGE_SIZE 4096 /* PAGE_SIZE */ ++ ++ ++#endif diff --git a/patches/gdb/6.7/150-dwarf-stack-overflow.patch b/patches/gdb/6.7/150-dwarf-stack-overflow.patch new file mode 100644 index 0000000..171e64e --- /dev/null +++ b/patches/gdb/6.7/150-dwarf-stack-overflow.patch @@ -0,0 +1,52 @@ +Original patch from gentoo: gentoo/src/patchsets/gdb/6.7/80_all_gdb-6.5-dwarf-stack-overflow.patch +-= BEGIN original header =- +http://bugs.gentoo.org/144833 + +for gdb/ChangeLog: +2006-08-22 Will Drewry + Tavis Ormandy + + * dwarf2read.c (decode_locdesc): Enforce location description stack + boundaries. + * dwarfread.c (locval): Likewise. + +-= END original header =- +diff -durN gdb-6.7.orig/gdb/dwarf2read.c gdb-6.7/gdb/dwarf2read.c +--- gdb-6.7.orig/gdb/dwarf2read.c 2007-09-05 02:51:48.000000000 +0200 ++++ gdb-6.7/gdb/dwarf2read.c 2008-06-17 23:25:38.000000000 +0200 +@@ -9061,8 +9061,7 @@ + callers will only want a very basic result and this can become a + complaint. + +- Note that stack[0] is unused except as a default error return. +- Note that stack overflow is not yet handled. */ ++ Note that stack[0] is unused except as a default error return. */ + + static CORE_ADDR + decode_locdesc (struct dwarf_block *blk, struct dwarf2_cu *cu) +@@ -9079,7 +9078,7 @@ + + i = 0; + stacki = 0; +- stack[stacki] = 0; ++ stack[++stacki] = 0; + + while (i < size) + { +@@ -9261,6 +9260,16 @@ + dwarf_stack_op_name (op)); + return (stack[stacki]); + } ++ /* Enforce maximum stack depth of size-1 to avoid ++stacki writing ++ outside of the allocated space. Also enforce minimum > 0. ++ -- wad@google.com 14 Aug 2006 */ ++ if (stacki >= sizeof (stack) / sizeof (*stack) - 1) ++ internal_error (__FILE__, __LINE__, ++ _("location description stack too deep: %d"), ++ stacki); ++ if (stacki <= 0) ++ internal_error (__FILE__, __LINE__, ++ _("location description stack too shallow")); + } + return (stack[stacki]); + } diff --git a/patches/gdb/6.7/150-gdb-6.5-dwarf-stack-overflow.patch b/patches/gdb/6.7/150-gdb-6.5-dwarf-stack-overflow.patch deleted file mode 100644 index 171e64e..0000000 --- a/patches/gdb/6.7/150-gdb-6.5-dwarf-stack-overflow.patch +++ /dev/null @@ -1,52 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gdb/6.7/80_all_gdb-6.5-dwarf-stack-overflow.patch --= BEGIN original header =- -http://bugs.gentoo.org/144833 - -for gdb/ChangeLog: -2006-08-22 Will Drewry - Tavis Ormandy - - * dwarf2read.c (decode_locdesc): Enforce location description stack - boundaries. - * dwarfread.c (locval): Likewise. - --= END original header =- -diff -durN gdb-6.7.orig/gdb/dwarf2read.c gdb-6.7/gdb/dwarf2read.c ---- gdb-6.7.orig/gdb/dwarf2read.c 2007-09-05 02:51:48.000000000 +0200 -+++ gdb-6.7/gdb/dwarf2read.c 2008-06-17 23:25:38.000000000 +0200 -@@ -9061,8 +9061,7 @@ - callers will only want a very basic result and this can become a - complaint. - -- Note that stack[0] is unused except as a default error return. -- Note that stack overflow is not yet handled. */ -+ Note that stack[0] is unused except as a default error return. */ - - static CORE_ADDR - decode_locdesc (struct dwarf_block *blk, struct dwarf2_cu *cu) -@@ -9079,7 +9078,7 @@ - - i = 0; - stacki = 0; -- stack[stacki] = 0; -+ stack[++stacki] = 0; - - while (i < size) - { -@@ -9261,6 +9260,16 @@ - dwarf_stack_op_name (op)); - return (stack[stacki]); - } -+ /* Enforce maximum stack depth of size-1 to avoid ++stacki writing -+ outside of the allocated space. Also enforce minimum > 0. -+ -- wad@google.com 14 Aug 2006 */ -+ if (stacki >= sizeof (stack) / sizeof (*stack) - 1) -+ internal_error (__FILE__, __LINE__, -+ _("location description stack too deep: %d"), -+ stacki); -+ if (stacki <= 0) -+ internal_error (__FILE__, __LINE__, -+ _("location description stack too shallow")); - } - return (stack[stacki]); - } diff --git a/patches/gdb/6.8/100-dwarf-stack-overflow.patch b/patches/gdb/6.8/100-dwarf-stack-overflow.patch new file mode 100644 index 0000000..344d5a3 --- /dev/null +++ b/patches/gdb/6.8/100-dwarf-stack-overflow.patch @@ -0,0 +1,52 @@ +Original patch from gentoo: gentoo/src/patchsets/gdb/6.8/80_all_gdb-6.5-dwarf-stack-overflow.patch +-= BEGIN original header =- +http://bugs.gentoo.org/144833 + +for gdb/ChangeLog: +2006-08-22 Will Drewry + Tavis Ormandy + + * dwarf2read.c (decode_locdesc): Enforce location description stack + boundaries. + * dwarfread.c (locval): Likewise. + +-= END original header =- +diff -durN gdb-6.8.orig/gdb/dwarf2read.c gdb-6.8/gdb/dwarf2read.c +--- gdb-6.8.orig/gdb/dwarf2read.c 2008-03-10 15:18:10.000000000 +0100 ++++ gdb-6.8/gdb/dwarf2read.c 2008-06-17 16:07:31.000000000 +0200 +@@ -9124,8 +9124,7 @@ + callers will only want a very basic result and this can become a + complaint. + +- Note that stack[0] is unused except as a default error return. +- Note that stack overflow is not yet handled. */ ++ Note that stack[0] is unused except as a default error return. */ + + static CORE_ADDR + decode_locdesc (struct dwarf_block *blk, struct dwarf2_cu *cu) +@@ -9142,7 +9141,7 @@ + + i = 0; + stacki = 0; +- stack[stacki] = 0; ++ stack[++stacki] = 0; + + while (i < size) + { +@@ -9324,6 +9323,16 @@ + dwarf_stack_op_name (op)); + return (stack[stacki]); + } ++ /* Enforce maximum stack depth of size-1 to avoid ++stacki writing ++ outside of the allocated space. Also enforce minimum > 0. ++ -- wad@google.com 14 Aug 2006 */ ++ if (stacki >= sizeof (stack) / sizeof (*stack) - 1) ++ internal_error (__FILE__, __LINE__, ++ _("location description stack too deep: %d"), ++ stacki); ++ if (stacki <= 0) ++ internal_error (__FILE__, __LINE__, ++ _("location description stack too shallow")); + } + return (stack[stacki]); + } diff --git a/patches/gdb/6.8/100-gdb-6.5-dwarf-stack-overflow.patch b/patches/gdb/6.8/100-gdb-6.5-dwarf-stack-overflow.patch deleted file mode 100644 index 344d5a3..0000000 --- a/patches/gdb/6.8/100-gdb-6.5-dwarf-stack-overflow.patch +++ /dev/null @@ -1,52 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gdb/6.8/80_all_gdb-6.5-dwarf-stack-overflow.patch --= BEGIN original header =- -http://bugs.gentoo.org/144833 - -for gdb/ChangeLog: -2006-08-22 Will Drewry - Tavis Ormandy - - * dwarf2read.c (decode_locdesc): Enforce location description stack - boundaries. - * dwarfread.c (locval): Likewise. - --= END original header =- -diff -durN gdb-6.8.orig/gdb/dwarf2read.c gdb-6.8/gdb/dwarf2read.c ---- gdb-6.8.orig/gdb/dwarf2read.c 2008-03-10 15:18:10.000000000 +0100 -+++ gdb-6.8/gdb/dwarf2read.c 2008-06-17 16:07:31.000000000 +0200 -@@ -9124,8 +9124,7 @@ - callers will only want a very basic result and this can become a - complaint. - -- Note that stack[0] is unused except as a default error return. -- Note that stack overflow is not yet handled. */ -+ Note that stack[0] is unused except as a default error return. */ - - static CORE_ADDR - decode_locdesc (struct dwarf_block *blk, struct dwarf2_cu *cu) -@@ -9142,7 +9141,7 @@ - - i = 0; - stacki = 0; -- stack[stacki] = 0; -+ stack[++stacki] = 0; - - while (i < size) - { -@@ -9324,6 +9323,16 @@ - dwarf_stack_op_name (op)); - return (stack[stacki]); - } -+ /* Enforce maximum stack depth of size-1 to avoid ++stacki writing -+ outside of the allocated space. Also enforce minimum > 0. -+ -- wad@google.com 14 Aug 2006 */ -+ if (stacki >= sizeof (stack) / sizeof (*stack) - 1) -+ internal_error (__FILE__, __LINE__, -+ _("location description stack too deep: %d"), -+ stacki); -+ if (stacki <= 0) -+ internal_error (__FILE__, __LINE__, -+ _("location description stack too shallow")); - } - return (stack[stacki]); - } diff --git a/patches/gdb/6.8/150-gdb-6.3-security-errata-20050610.patch b/patches/gdb/6.8/150-gdb-6.3-security-errata-20050610.patch deleted file mode 100644 index 27e8174..0000000 --- a/patches/gdb/6.8/150-gdb-6.3-security-errata-20050610.patch +++ /dev/null @@ -1,205 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gdb/6.8/35_all_gdb-6.3-security-errata-20050610.patch --= BEGIN original header =- -2005-06-09 Jeff Johnston - - * gdb.base/gdbinit.exp: New testcase. - * gdb.base/gdbinit.sample: Sample .gdbinit for gdbinit.exp. - -2005-06-08 Daniel Jacobowitz - Jeff Johnston - - * Makefile.in (cli-cmds.o): Update. - * configure.in: Add check for getuid. - * configure: Regenerated. - * config.in: Ditto. - * main.c (captured_main): Pass -1 to source_command when loading - gdbinit files. - * cli/cli-cmds.c: Include "gdb_stat.h" and . - (source_command): Update documentation. Check permissions if - FROM_TTY is -1. - --= END original header =- -diff -durN gdb-6.8.orig/gdb/Makefile.in gdb-6.8/gdb/Makefile.in ---- gdb-6.8.orig/gdb/Makefile.in 2008-03-17 13:15:08.000000000 +0100 -+++ gdb-6.8/gdb/Makefile.in 2008-06-17 16:07:33.000000000 +0200 -@@ -3004,7 +3004,7 @@ - $(expression_h) $(frame_h) $(value_h) $(language_h) $(filenames_h) \ - $(objfiles_h) $(source_h) $(disasm_h) $(ui_out_h) $(top_h) \ - $(cli_decode_h) $(cli_script_h) $(cli_setshow_h) $(cli_cmds_h) \ -- $(tui_h) -+ $(tui_h) $(gdb_stat_h) - $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-cmds.c - cli-decode.o: $(srcdir)/cli/cli-decode.c $(defs_h) $(symtab_h) \ - $(gdb_regex_h) $(gdb_string_h) $(completer_h) $(ui_out_h) \ -diff -durN gdb-6.8.orig/gdb/cli/cli-cmds.c gdb-6.8/gdb/cli/cli-cmds.c ---- gdb-6.8.orig/gdb/cli/cli-cmds.c 2008-01-01 23:53:14.000000000 +0100 -+++ gdb-6.8/gdb/cli/cli-cmds.c 2008-06-17 16:07:33.000000000 +0200 -@@ -36,6 +36,7 @@ - #include "objfiles.h" - #include "source.h" - #include "disasm.h" -+#include "gdb_stat.h" - - #include "ui-out.h" - -@@ -459,12 +460,31 @@ - - if (fd == -1) - { -- if (from_tty) -+ if (from_tty > 0) - perror_with_name (file); - else - return; - } - -+#ifdef HAVE_GETUID -+ if (from_tty == -1) -+ { -+ struct stat statbuf; -+ if (fstat (fd, &statbuf) < 0) -+ { -+ perror_with_name (file); -+ close (fd); -+ return; -+ } -+ if (statbuf.st_uid != getuid () || (statbuf.st_mode & S_IWOTH)) -+ { -+ warning (_("not using untrusted file \"%s\""), file); -+ close (fd); -+ return; -+ } -+ } -+#endif -+ - stream = fdopen (fd, FOPEN_RT); - script_from_file (stream, file); - -diff -durN gdb-6.8.orig/gdb/main.c gdb-6.8/gdb/main.c ---- gdb-6.8.orig/gdb/main.c 2008-01-05 17:49:53.000000000 +0100 -+++ gdb-6.8/gdb/main.c 2008-06-17 16:07:33.000000000 +0200 -@@ -690,7 +690,7 @@ - - if (!inhibit_gdbinit) - { -- catch_command_errors (source_script, homeinit, 0, RETURN_MASK_ALL); -+ catch_command_errors (source_script, homeinit, -1, RETURN_MASK_ALL); - } - - /* Do stats; no need to do them elsewhere since we'll only -@@ -778,7 +778,7 @@ - || memcmp ((char *) &homebuf, (char *) &cwdbuf, sizeof (struct stat))) - if (!inhibit_gdbinit) - { -- catch_command_errors (source_script, gdbinit, 0, RETURN_MASK_ALL); -+ catch_command_errors (source_script, gdbinit, -1, RETURN_MASK_ALL); - } - - for (i = 0; i < ncmd; i++) -diff -durN gdb-6.8.orig/gdb/testsuite/gdb.base/gdbinit.exp gdb-6.8/gdb/testsuite/gdb.base/gdbinit.exp ---- gdb-6.8.orig/gdb/testsuite/gdb.base/gdbinit.exp 1970-01-01 01:00:00.000000000 +0100 -+++ gdb-6.8/gdb/testsuite/gdb.base/gdbinit.exp 2008-06-17 16:07:33.000000000 +0200 -@@ -0,0 +1,98 @@ -+# Copyright 2005 -+# Free Software Foundation, Inc. -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 2 of the License, or -+# (at your option) any later version. -+# -+# This program 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 General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program; if not, write to the Free Software -+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -+ -+# Please email any bugs, comments, and/or additions to this file to: -+# bug-gdb@prep.ai.mit.edu -+ -+# This file was written by Jeff Johnston . -+ -+if $tracelevel then { -+ strace $tracelevel -+} -+ -+set prms_id 0 -+set bug_id 0 -+ -+# are we on a target board -+if [is_remote target] { -+ return -+} -+ -+ -+global verbose -+global GDB -+global GDBFLAGS -+global gdb_prompt -+global timeout -+global gdb_spawn_id; -+ -+gdb_stop_suppressing_tests; -+ -+verbose "Spawning $GDB -nw" -+ -+if [info exists gdb_spawn_id] { -+ return 0; -+} -+ -+if ![is_remote host] { -+ if { [which $GDB] == 0 } then { -+ perror "$GDB does not exist." -+ exit 1 -+ } -+} -+ -+set env(HOME) [pwd] -+remote_exec build "rm .gdbinit" -+remote_exec build "cp ${srcdir}/${subdir}/gdbinit.sample .gdbinit" -+remote_exec build "chmod 646 .gdbinit" -+ -+set res [remote_spawn host "$GDB -nw [host_info gdb_opts]"]; -+if { $res < 0 || $res == "" } { -+ perror "Spawning $GDB failed." -+ return 1; -+} -+gdb_expect 360 { -+ -re "warning: not using untrusted file.*\.gdbinit.*\[\r\n\]$gdb_prompt $" { -+ pass "untrusted .gdbinit caught." -+ } -+ -re "$gdb_prompt $" { -+ fail "untrusted .gdbinit caught." -+ } -+ timeout { -+ fail "(timeout) untrusted .gdbinit caught." -+ } -+} -+ -+remote_exec build "chmod 644 .gdbinit" -+set res [remote_spawn host "$GDB -nw [host_info gdb_opts]"]; -+if { $res < 0 || $res == "" } { -+ perror "Spawning $GDB failed." -+ return 1; -+} -+gdb_expect 360 { -+ -re "warning: not using untrusted file.*\.gdbinit.*\[\r\n\]$gdb_prompt $" { -+ fail "trusted .gdbinit allowed." -+ } -+ -re "in gdbinit.*$gdb_prompt $" { -+ pass "trusted .gdbinit allowed." -+ } -+ timeout { -+ fail "(timeout) trusted .gdbinit allowed." -+ } -+} -+ -+remote_exec build "rm .gdbinit" -diff -durN gdb-6.8.orig/gdb/testsuite/gdb.base/gdbinit.sample gdb-6.8/gdb/testsuite/gdb.base/gdbinit.sample ---- gdb-6.8.orig/gdb/testsuite/gdb.base/gdbinit.sample 1970-01-01 01:00:00.000000000 +0100 -+++ gdb-6.8/gdb/testsuite/gdb.base/gdbinit.sample 2008-06-17 16:07:33.000000000 +0200 -@@ -0,0 +1 @@ -+echo "\nin gdbinit" diff --git a/patches/gdb/6.8/150-security-errata-20050610.patch b/patches/gdb/6.8/150-security-errata-20050610.patch new file mode 100644 index 0000000..27e8174 --- /dev/null +++ b/patches/gdb/6.8/150-security-errata-20050610.patch @@ -0,0 +1,205 @@ +Original patch from gentoo: gentoo/src/patchsets/gdb/6.8/35_all_gdb-6.3-security-errata-20050610.patch +-= BEGIN original header =- +2005-06-09 Jeff Johnston + + * gdb.base/gdbinit.exp: New testcase. + * gdb.base/gdbinit.sample: Sample .gdbinit for gdbinit.exp. + +2005-06-08 Daniel Jacobowitz + Jeff Johnston + + * Makefile.in (cli-cmds.o): Update. + * configure.in: Add check for getuid. + * configure: Regenerated. + * config.in: Ditto. + * main.c (captured_main): Pass -1 to source_command when loading + gdbinit files. + * cli/cli-cmds.c: Include "gdb_stat.h" and . + (source_command): Update documentation. Check permissions if + FROM_TTY is -1. + +-= END original header =- +diff -durN gdb-6.8.orig/gdb/Makefile.in gdb-6.8/gdb/Makefile.in +--- gdb-6.8.orig/gdb/Makefile.in 2008-03-17 13:15:08.000000000 +0100 ++++ gdb-6.8/gdb/Makefile.in 2008-06-17 16:07:33.000000000 +0200 +@@ -3004,7 +3004,7 @@ + $(expression_h) $(frame_h) $(value_h) $(language_h) $(filenames_h) \ + $(objfiles_h) $(source_h) $(disasm_h) $(ui_out_h) $(top_h) \ + $(cli_decode_h) $(cli_script_h) $(cli_setshow_h) $(cli_cmds_h) \ +- $(tui_h) ++ $(tui_h) $(gdb_stat_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-cmds.c + cli-decode.o: $(srcdir)/cli/cli-decode.c $(defs_h) $(symtab_h) \ + $(gdb_regex_h) $(gdb_string_h) $(completer_h) $(ui_out_h) \ +diff -durN gdb-6.8.orig/gdb/cli/cli-cmds.c gdb-6.8/gdb/cli/cli-cmds.c +--- gdb-6.8.orig/gdb/cli/cli-cmds.c 2008-01-01 23:53:14.000000000 +0100 ++++ gdb-6.8/gdb/cli/cli-cmds.c 2008-06-17 16:07:33.000000000 +0200 +@@ -36,6 +36,7 @@ + #include "objfiles.h" + #include "source.h" + #include "disasm.h" ++#include "gdb_stat.h" + + #include "ui-out.h" + +@@ -459,12 +460,31 @@ + + if (fd == -1) + { +- if (from_tty) ++ if (from_tty > 0) + perror_with_name (file); + else + return; + } + ++#ifdef HAVE_GETUID ++ if (from_tty == -1) ++ { ++ struct stat statbuf; ++ if (fstat (fd, &statbuf) < 0) ++ { ++ perror_with_name (file); ++ close (fd); ++ return; ++ } ++ if (statbuf.st_uid != getuid () || (statbuf.st_mode & S_IWOTH)) ++ { ++ warning (_("not using untrusted file \"%s\""), file); ++ close (fd); ++ return; ++ } ++ } ++#endif ++ + stream = fdopen (fd, FOPEN_RT); + script_from_file (stream, file); + +diff -durN gdb-6.8.orig/gdb/main.c gdb-6.8/gdb/main.c +--- gdb-6.8.orig/gdb/main.c 2008-01-05 17:49:53.000000000 +0100 ++++ gdb-6.8/gdb/main.c 2008-06-17 16:07:33.000000000 +0200 +@@ -690,7 +690,7 @@ + + if (!inhibit_gdbinit) + { +- catch_command_errors (source_script, homeinit, 0, RETURN_MASK_ALL); ++ catch_command_errors (source_script, homeinit, -1, RETURN_MASK_ALL); + } + + /* Do stats; no need to do them elsewhere since we'll only +@@ -778,7 +778,7 @@ + || memcmp ((char *) &homebuf, (char *) &cwdbuf, sizeof (struct stat))) + if (!inhibit_gdbinit) + { +- catch_command_errors (source_script, gdbinit, 0, RETURN_MASK_ALL); ++ catch_command_errors (source_script, gdbinit, -1, RETURN_MASK_ALL); + } + + for (i = 0; i < ncmd; i++) +diff -durN gdb-6.8.orig/gdb/testsuite/gdb.base/gdbinit.exp gdb-6.8/gdb/testsuite/gdb.base/gdbinit.exp +--- gdb-6.8.orig/gdb/testsuite/gdb.base/gdbinit.exp 1970-01-01 01:00:00.000000000 +0100 ++++ gdb-6.8/gdb/testsuite/gdb.base/gdbinit.exp 2008-06-17 16:07:33.000000000 +0200 +@@ -0,0 +1,98 @@ ++# Copyright 2005 ++# Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 2 of the License, or ++# (at your option) any later version. ++# ++# This program 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 General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++ ++# Please email any bugs, comments, and/or additions to this file to: ++# bug-gdb@prep.ai.mit.edu ++ ++# This file was written by Jeff Johnston . ++ ++if $tracelevel then { ++ strace $tracelevel ++} ++ ++set prms_id 0 ++set bug_id 0 ++ ++# are we on a target board ++if [is_remote target] { ++ return ++} ++ ++ ++global verbose ++global GDB ++global GDBFLAGS ++global gdb_prompt ++global timeout ++global gdb_spawn_id; ++ ++gdb_stop_suppressing_tests; ++ ++verbose "Spawning $GDB -nw" ++ ++if [info exists gdb_spawn_id] { ++ return 0; ++} ++ ++if ![is_remote host] { ++ if { [which $GDB] == 0 } then { ++ perror "$GDB does not exist." ++ exit 1 ++ } ++} ++ ++set env(HOME) [pwd] ++remote_exec build "rm .gdbinit" ++remote_exec build "cp ${srcdir}/${subdir}/gdbinit.sample .gdbinit" ++remote_exec build "chmod 646 .gdbinit" ++ ++set res [remote_spawn host "$GDB -nw [host_info gdb_opts]"]; ++if { $res < 0 || $res == "" } { ++ perror "Spawning $GDB failed." ++ return 1; ++} ++gdb_expect 360 { ++ -re "warning: not using untrusted file.*\.gdbinit.*\[\r\n\]$gdb_prompt $" { ++ pass "untrusted .gdbinit caught." ++ } ++ -re "$gdb_prompt $" { ++ fail "untrusted .gdbinit caught." ++ } ++ timeout { ++ fail "(timeout) untrusted .gdbinit caught." ++ } ++} ++ ++remote_exec build "chmod 644 .gdbinit" ++set res [remote_spawn host "$GDB -nw [host_info gdb_opts]"]; ++if { $res < 0 || $res == "" } { ++ perror "Spawning $GDB failed." ++ return 1; ++} ++gdb_expect 360 { ++ -re "warning: not using untrusted file.*\.gdbinit.*\[\r\n\]$gdb_prompt $" { ++ fail "trusted .gdbinit allowed." ++ } ++ -re "in gdbinit.*$gdb_prompt $" { ++ pass "trusted .gdbinit allowed." ++ } ++ timeout { ++ fail "(timeout) trusted .gdbinit allowed." ++ } ++} ++ ++remote_exec build "rm .gdbinit" +diff -durN gdb-6.8.orig/gdb/testsuite/gdb.base/gdbinit.sample gdb-6.8/gdb/testsuite/gdb.base/gdbinit.sample +--- gdb-6.8.orig/gdb/testsuite/gdb.base/gdbinit.sample 1970-01-01 01:00:00.000000000 +0100 ++++ gdb-6.8/gdb/testsuite/gdb.base/gdbinit.sample 2008-06-17 16:07:33.000000000 +0200 +@@ -0,0 +1 @@ ++echo "\nin gdbinit" diff --git a/patches/gdb/6.8/200-gdb-tdep-opcode-include-workaround.patch b/patches/gdb/6.8/200-gdb-tdep-opcode-include-workaround.patch deleted file mode 100644 index 61fdef4..0000000 --- a/patches/gdb/6.8/200-gdb-tdep-opcode-include-workaround.patch +++ /dev/null @@ -1,33 +0,0 @@ -Original patch from gentoo: gentoo/src/patchsets/gdb/6.8/20_all_gdb-tdep-opcode-include-workaround.patch --= BEGIN original header =- -workaround build failure - -http://bugs.gentoo.org/216368 - --= END original header =- -diff -durN gdb-6.8.orig/gdb/frv-tdep.c gdb-6.8/gdb/frv-tdep.c ---- gdb-6.8.orig/gdb/frv-tdep.c 2008-01-11 14:19:59.000000000 +0100 -+++ gdb-6.8/gdb/frv-tdep.c 2008-06-17 16:07:34.000000000 +0200 -@@ -32,7 +32,7 @@ - #include "gdb_assert.h" - #include "sim-regno.h" - #include "gdb/sim-frv.h" --#include "opcodes/frv-desc.h" /* for the H_SPR_... enums */ -+#include "../opcodes/frv-desc.h" /* for the H_SPR_... enums */ - #include "symtab.h" - #include "elf-bfd.h" - #include "elf/frv.h" -diff -durN gdb-6.8.orig/gdb/mep-tdep.c gdb-6.8/gdb/mep-tdep.c ---- gdb-6.8.orig/gdb/mep-tdep.c 2008-01-11 14:20:02.000000000 +0100 -+++ gdb-6.8/gdb/mep-tdep.c 2008-06-17 16:07:34.000000000 +0200 -@@ -53,8 +53,8 @@ - - /* Get the user's customized MeP coprocessor register names from - libopcodes. */ --#include "opcodes/mep-desc.h" --#include "opcodes/mep-opc.h" -+#include "../opcodes/mep-desc.h" -+#include "../opcodes/mep-opc.h" - - - /* The gdbarch_tdep structure. */ diff --git a/patches/gdb/6.8/200-tdep-opcode-include-workaround.patch b/patches/gdb/6.8/200-tdep-opcode-include-workaround.patch new file mode 100644 index 0000000..61fdef4 --- /dev/null +++ b/patches/gdb/6.8/200-tdep-opcode-include-workaround.patch @@ -0,0 +1,33 @@ +Original patch from gentoo: gentoo/src/patchsets/gdb/6.8/20_all_gdb-tdep-opcode-include-workaround.patch +-= BEGIN original header =- +workaround build failure + +http://bugs.gentoo.org/216368 + +-= END original header =- +diff -durN gdb-6.8.orig/gdb/frv-tdep.c gdb-6.8/gdb/frv-tdep.c +--- gdb-6.8.orig/gdb/frv-tdep.c 2008-01-11 14:19:59.000000000 +0100 ++++ gdb-6.8/gdb/frv-tdep.c 2008-06-17 16:07:34.000000000 +0200 +@@ -32,7 +32,7 @@ + #include "gdb_assert.h" + #include "sim-regno.h" + #include "gdb/sim-frv.h" +-#include "opcodes/frv-desc.h" /* for the H_SPR_... enums */ ++#include "../opcodes/frv-desc.h" /* for the H_SPR_... enums */ + #include "symtab.h" + #include "elf-bfd.h" + #include "elf/frv.h" +diff -durN gdb-6.8.orig/gdb/mep-tdep.c gdb-6.8/gdb/mep-tdep.c +--- gdb-6.8.orig/gdb/mep-tdep.c 2008-01-11 14:20:02.000000000 +0100 ++++ gdb-6.8/gdb/mep-tdep.c 2008-06-17 16:07:34.000000000 +0200 +@@ -53,8 +53,8 @@ + + /* Get the user's customized MeP coprocessor register names from + libopcodes. */ +-#include "opcodes/mep-desc.h" +-#include "opcodes/mep-opc.h" ++#include "../opcodes/mep-desc.h" ++#include "../opcodes/mep-opc.h" + + + /* The gdbarch_tdep structure. */ diff --git a/patches/strace/4.5.15/100-autoreconf.patch b/patches/strace/4.5.15/100-autoreconf.patch new file mode 100644 index 0000000..5ffda82 --- /dev/null +++ b/patches/strace/4.5.15/100-autoreconf.patch @@ -0,0 +1,761 @@ +diff -dur strace-4.5.15.orig/configure strace-4.5.15/configure +--- strace-4.5.15.orig/configure 2007-01-11 23:23:33.000000000 +0100 ++++ strace-4.5.15/configure 2007-07-14 19:18:43.000000000 +0200 +@@ -956,7 +956,7 @@ + else + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi +- cd $ac_popdir ++ cd "$ac_popdir" + done + fi + +@@ -2660,8 +2660,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -2719,8 +2718,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -2836,8 +2834,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -2891,8 +2888,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -2937,8 +2933,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -2982,8 +2977,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -3721,8 +3715,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -3786,8 +3779,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -3959,8 +3951,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -4032,8 +4023,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -4087,8 +4077,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -4159,8 +4148,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -4214,8 +4202,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -4345,8 +4332,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -4410,8 +4396,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -4454,8 +4439,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -4519,8 +4503,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -4563,8 +4546,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -4628,8 +4610,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -4672,8 +4653,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -4737,8 +4717,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -4781,8 +4760,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -4846,8 +4824,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -4890,8 +4867,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -4955,8 +4931,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -4999,8 +4974,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -5064,8 +5038,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -5108,8 +5081,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -5173,8 +5145,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -5217,8 +5188,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -5286,8 +5256,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -5320,6 +5289,73 @@ + + fi + ++echo "$as_me:$LINENO: checking for statfs64 in sys/(statfs|vfs).h" >&5 ++echo $ECHO_N "checking for statfs64 in sys/(statfs|vfs).h... $ECHO_C" >&6 ++if test "${ac_cv_type_statfs64+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++#ifdef LINUX ++#include ++#include ++#else ++#include ++#endif ++int ++main () ++{ ++struct statfs64 st; ++ ; ++ return 0; ++} ++_ACEOF ++rm -f conftest.$ac_objext ++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ++ (eval $ac_compile) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ ac_cv_type_statfs64=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ac_cv_type_statfs64=no ++fi ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++ ++echo "$as_me:$LINENO: result: $ac_cv_type_statfs64" >&5 ++echo "${ECHO_T}$ac_cv_type_statfs64" >&6 ++if test "$ac_cv_type_statfs64" = yes ++then ++ ++cat >>confdefs.h <<\_ACEOF ++#define HAVE_STATFS64 1 ++_ACEOF ++ ++fi ++ + + echo "$as_me:$LINENO: checking return type of signal handlers" >&5 + echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6 +@@ -5360,8 +5396,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -5460,8 +5495,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -5610,8 +5644,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -5668,8 +5701,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -5816,8 +5848,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -5968,8 +5999,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -6033,8 +6063,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -6100,8 +6129,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -6147,8 +6175,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -6214,8 +6241,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -6466,8 +6492,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -6532,8 +6557,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -6600,8 +6624,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -6717,8 +6740,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -6812,8 +6834,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -6959,8 +6980,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -7020,8 +7040,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -7082,8 +7101,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -7356,8 +7374,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -7401,8 +7418,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -7471,8 +7487,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -7539,8 +7554,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -7585,8 +7599,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -7652,8 +7665,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -7698,8 +7710,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -7767,8 +7778,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -7834,8 +7844,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -7899,8 +7908,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -7966,8 +7974,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -8032,8 +8039,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -8077,8 +8083,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -8145,8 +8150,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -8218,8 +8222,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -8289,8 +8292,7 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -9293,11 +9295,6 @@ + *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + esac + +- if test x"$ac_file" != x-; then +- { echo "$as_me:$LINENO: creating $ac_file" >&5 +-echo "$as_me: creating $ac_file" >&6;} +- rm -f "$ac_file" +- fi + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ +@@ -9336,6 +9333,12 @@ + fi;; + esac + done` || { (exit 1); exit 1; } ++ ++ if test x"$ac_file" != x-; then ++ { echo "$as_me:$LINENO: creating $ac_file" >&5 ++echo "$as_me: creating $ac_file" >&6;} ++ rm -f "$ac_file" ++ fi + _ACEOF + cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub diff --git a/patches/strace/4.5.15/100-strace-autoreconf.patch b/patches/strace/4.5.15/100-strace-autoreconf.patch deleted file mode 100644 index 5ffda82..0000000 --- a/patches/strace/4.5.15/100-strace-autoreconf.patch +++ /dev/null @@ -1,761 +0,0 @@ -diff -dur strace-4.5.15.orig/configure strace-4.5.15/configure ---- strace-4.5.15.orig/configure 2007-01-11 23:23:33.000000000 +0100 -+++ strace-4.5.15/configure 2007-07-14 19:18:43.000000000 +0200 -@@ -956,7 +956,7 @@ - else - echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi -- cd $ac_popdir -+ cd "$ac_popdir" - done - fi - -@@ -2660,8 +2660,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -2719,8 +2718,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -2836,8 +2834,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -2891,8 +2888,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -2937,8 +2933,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -2982,8 +2977,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -3721,8 +3715,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -3786,8 +3779,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -3959,8 +3951,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -4032,8 +4023,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -4087,8 +4077,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -4159,8 +4148,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -4214,8 +4202,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -4345,8 +4332,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -4410,8 +4396,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -4454,8 +4439,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -4519,8 +4503,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -4563,8 +4546,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -4628,8 +4610,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -4672,8 +4653,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -4737,8 +4717,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -4781,8 +4760,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -4846,8 +4824,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -4890,8 +4867,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -4955,8 +4931,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -4999,8 +4974,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -5064,8 +5038,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -5108,8 +5081,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -5173,8 +5145,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -5217,8 +5188,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -5286,8 +5256,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -5320,6 +5289,73 @@ - - fi - -+echo "$as_me:$LINENO: checking for statfs64 in sys/(statfs|vfs).h" >&5 -+echo $ECHO_N "checking for statfs64 in sys/(statfs|vfs).h... $ECHO_C" >&6 -+if test "${ac_cv_type_statfs64+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#ifdef LINUX -+#include -+#include -+#else -+#include -+#endif -+int -+main () -+{ -+struct statfs64 st; -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_cv_type_statfs64=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ac_cv_type_statfs64=no -+fi -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+ -+echo "$as_me:$LINENO: result: $ac_cv_type_statfs64" >&5 -+echo "${ECHO_T}$ac_cv_type_statfs64" >&6 -+if test "$ac_cv_type_statfs64" = yes -+then -+ -+cat >>confdefs.h <<\_ACEOF -+#define HAVE_STATFS64 1 -+_ACEOF -+ -+fi -+ - - echo "$as_me:$LINENO: checking return type of signal handlers" >&5 - echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6 -@@ -5360,8 +5396,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -5460,8 +5495,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -5610,8 +5644,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -5668,8 +5701,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -5816,8 +5848,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -5968,8 +5999,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -6033,8 +6063,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -6100,8 +6129,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -6147,8 +6175,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -6214,8 +6241,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -6466,8 +6492,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -6532,8 +6557,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -6600,8 +6624,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -6717,8 +6740,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -6812,8 +6834,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -6959,8 +6980,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -7020,8 +7040,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -7082,8 +7101,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -7356,8 +7374,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -7401,8 +7418,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -7471,8 +7487,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -7539,8 +7554,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -7585,8 +7599,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -7652,8 +7665,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -7698,8 +7710,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -7767,8 +7778,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -7834,8 +7844,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -7899,8 +7908,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -7966,8 +7974,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -8032,8 +8039,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -8077,8 +8083,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -8145,8 +8150,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -8218,8 +8222,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -8289,8 +8292,7 @@ - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -- { ac_try='test -z "$ac_c_werror_flag" -- || test ! -s conftest.err' -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? -@@ -9293,11 +9295,6 @@ - *) ac_INSTALL=$ac_top_builddir$INSTALL ;; - esac - -- if test x"$ac_file" != x-; then -- { echo "$as_me:$LINENO: creating $ac_file" >&5 --echo "$as_me: creating $ac_file" >&6;} -- rm -f "$ac_file" -- fi - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ -@@ -9336,6 +9333,12 @@ - fi;; - esac - done` || { (exit 1); exit 1; } -+ -+ if test x"$ac_file" != x-; then -+ { echo "$as_me:$LINENO: creating $ac_file" >&5 -+echo "$as_me: creating $ac_file" >&6;} -+ rm -f "$ac_file" -+ fi - _ACEOF - cat >>$CONFIG_STATUS <<_ACEOF - sed "$ac_vpsub diff --git a/patches/strace/4.5.15/150-dont-use-REG_SYSCALL-for-sh.patch b/patches/strace/4.5.15/150-dont-use-REG_SYSCALL-for-sh.patch new file mode 100644 index 0000000..8add445 --- /dev/null +++ b/patches/strace/4.5.15/150-dont-use-REG_SYSCALL-for-sh.patch @@ -0,0 +1,11 @@ +diff -dur strace-4.5.15.orig/process.c strace-4.5.15/process.c +--- strace-4.5.15.orig/process.c 2007-01-11 23:08:38.000000000 +0100 ++++ strace-4.5.15/process.c 2007-07-14 19:19:58.000000000 +0200 +@@ -2679,7 +2679,6 @@ + { 4*REG_GBR, "4*REG_GBR" }, + { 4*REG_MACH, "4*REG_MACH" }, + { 4*REG_MACL, "4*REG_MACL" }, +- { 4*REG_SYSCALL, "4*REG_SYSCALL" }, + { 4*REG_FPUL, "4*REG_FPUL" }, + { 4*REG_FPREG0, "4*REG_FPREG0" }, + { 4*(REG_FPREG0+1), "4*REG_FPREG1" }, diff --git a/patches/strace/4.5.15/150-strace-dont-use-REG_SYSCALL-for-sh.patch b/patches/strace/4.5.15/150-strace-dont-use-REG_SYSCALL-for-sh.patch deleted file mode 100644 index 8add445..0000000 --- a/patches/strace/4.5.15/150-strace-dont-use-REG_SYSCALL-for-sh.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -dur strace-4.5.15.orig/process.c strace-4.5.15/process.c ---- strace-4.5.15.orig/process.c 2007-01-11 23:08:38.000000000 +0100 -+++ strace-4.5.15/process.c 2007-07-14 19:19:58.000000000 +0200 -@@ -2679,7 +2679,6 @@ - { 4*REG_GBR, "4*REG_GBR" }, - { 4*REG_MACH, "4*REG_MACH" }, - { 4*REG_MACL, "4*REG_MACL" }, -- { 4*REG_SYSCALL, "4*REG_SYSCALL" }, - { 4*REG_FPUL, "4*REG_FPUL" }, - { 4*REG_FPREG0, "4*REG_FPREG0" }, - { 4*(REG_FPREG0+1), "4*REG_FPREG1" }, diff --git a/patches/strace/4.5.15/200-fix-arm-bad-syscall.patch b/patches/strace/4.5.15/200-fix-arm-bad-syscall.patch new file mode 100644 index 0000000..aa4c5c4 --- /dev/null +++ b/patches/strace/4.5.15/200-fix-arm-bad-syscall.patch @@ -0,0 +1,19 @@ +diff -dur strace-4.5.15.orig/syscall.c strace-4.5.15/syscall.c +--- strace-4.5.15.orig/syscall.c 2006-12-21 23:13:33.000000000 +0100 ++++ strace-4.5.15/syscall.c 2007-07-14 19:21:44.000000000 +0200 +@@ -1045,6 +1045,15 @@ + /* + * Note: we only deal with only 32-bit CPUs here. + */ ++ ++ if (!(tcp->flags & TCB_INSYSCALL) && ++ (tcp->flags & TCB_WAITEXECVE)) { ++ /* caught a fake syscall from the execve's exit */ ++ tcp->flags &= ~TCB_WAITEXECVE; ++ return 0; ++ } ++ ++ + if (regs.ARM_cpsr & 0x20) { + /* + * Get the Thumb-mode system call number diff --git a/patches/strace/4.5.15/200-strace-fix-arm-bad-syscall.patch b/patches/strace/4.5.15/200-strace-fix-arm-bad-syscall.patch deleted file mode 100644 index aa4c5c4..0000000 --- a/patches/strace/4.5.15/200-strace-fix-arm-bad-syscall.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff -dur strace-4.5.15.orig/syscall.c strace-4.5.15/syscall.c ---- strace-4.5.15.orig/syscall.c 2006-12-21 23:13:33.000000000 +0100 -+++ strace-4.5.15/syscall.c 2007-07-14 19:21:44.000000000 +0200 -@@ -1045,6 +1045,15 @@ - /* - * Note: we only deal with only 32-bit CPUs here. - */ -+ -+ if (!(tcp->flags & TCB_INSYSCALL) && -+ (tcp->flags & TCB_WAITEXECVE)) { -+ /* caught a fake syscall from the execve's exit */ -+ tcp->flags &= ~TCB_WAITEXECVE; -+ return 0; -+ } -+ -+ - if (regs.ARM_cpsr & 0x20) { - /* - * Get the Thumb-mode system call number diff --git a/patches/strace/4.5.15/250-fix-disabled-largefile-syscalls.patch b/patches/strace/4.5.15/250-fix-disabled-largefile-syscalls.patch new file mode 100644 index 0000000..22903cd --- /dev/null +++ b/patches/strace/4.5.15/250-fix-disabled-largefile-syscalls.patch @@ -0,0 +1,22 @@ +diff -dur strace-4.5.15.orig/syscall.c strace-4.5.15/syscall.c +--- strace-4.5.15.orig/syscall.c 2007-07-14 19:21:44.000000000 +0200 ++++ strace-4.5.15/syscall.c 2007-07-14 19:22:49.000000000 +0200 +@@ -125,6 +125,18 @@ + #define TP TRACE_PROCESS + #define TS TRACE_SIGNAL + ++#ifndef HAVE_STATFS64 ++/* ++ * Ugly hacks for systems that do not have LFS ++ */ ++ ++#define sys_truncate64 sys_truncate ++#define sys_ftruncate64 sys_ftruncate ++#define sys_getdents64 sys_getdents ++#define sys_statfs64 sys_statfs ++#define sys_fstatfs64 sys_fstatfs ++#endif ++ + static const struct sysent sysent0[] = { + #include "syscallent.h" + }; diff --git a/patches/strace/4.5.15/250-strace-fix-disabled-largefile-syscalls.patch b/patches/strace/4.5.15/250-strace-fix-disabled-largefile-syscalls.patch deleted file mode 100644 index 22903cd..0000000 --- a/patches/strace/4.5.15/250-strace-fix-disabled-largefile-syscalls.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff -dur strace-4.5.15.orig/syscall.c strace-4.5.15/syscall.c ---- strace-4.5.15.orig/syscall.c 2007-07-14 19:21:44.000000000 +0200 -+++ strace-4.5.15/syscall.c 2007-07-14 19:22:49.000000000 +0200 -@@ -125,6 +125,18 @@ - #define TP TRACE_PROCESS - #define TS TRACE_SIGNAL - -+#ifndef HAVE_STATFS64 -+/* -+ * Ugly hacks for systems that do not have LFS -+ */ -+ -+#define sys_truncate64 sys_truncate -+#define sys_ftruncate64 sys_ftruncate -+#define sys_getdents64 sys_getdents -+#define sys_statfs64 sys_statfs -+#define sys_fstatfs64 sys_fstatfs -+#endif -+ - static const struct sysent sysent0[] = { - #include "syscallent.h" - }; diff --git a/patches/strace/4.5.15/300-mips-sprintsigmask-fix.patch b/patches/strace/4.5.15/300-mips-sprintsigmask-fix.patch new file mode 100644 index 0000000..e2aaa40 --- /dev/null +++ b/patches/strace/4.5.15/300-mips-sprintsigmask-fix.patch @@ -0,0 +1,12 @@ +diff -dur strace-4.5.15.orig/signal.c strace-4.5.15/signal.c +--- strace-4.5.15.orig/signal.c 2007-01-11 23:08:38.000000000 +0100 ++++ strace-4.5.15/signal.c 2007-07-14 19:24:43.000000000 +0200 +@@ -1440,7 +1440,7 @@ + tcp->u_rval = tcp->u_error = 0; + if(tcp->u_arg[0] == 0) + return 0; +- tcp->auxstr = sprintsigmask("mask now ", tcp->u_arg[1]); ++ tcp->auxstr = sprintsigmask("mask now ", tcp->u_arg[1], 0); + return RVAL_NONE | RVAL_STR; + } + return 0; diff --git a/patches/strace/4.5.15/300-strace-mips-sprintsigmask-fix.patch b/patches/strace/4.5.15/300-strace-mips-sprintsigmask-fix.patch deleted file mode 100644 index e2aaa40..0000000 --- a/patches/strace/4.5.15/300-strace-mips-sprintsigmask-fix.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -dur strace-4.5.15.orig/signal.c strace-4.5.15/signal.c ---- strace-4.5.15.orig/signal.c 2007-01-11 23:08:38.000000000 +0100 -+++ strace-4.5.15/signal.c 2007-07-14 19:24:43.000000000 +0200 -@@ -1440,7 +1440,7 @@ - tcp->u_rval = tcp->u_error = 0; - if(tcp->u_arg[0] == 0) - return 0; -- tcp->auxstr = sprintsigmask("mask now ", tcp->u_arg[1]); -+ tcp->auxstr = sprintsigmask("mask now ", tcp->u_arg[1], 0); - return RVAL_NONE | RVAL_STR; - } - return 0; diff --git a/patches/strace/4.5.15/350-statfs64-check.patch b/patches/strace/4.5.15/350-statfs64-check.patch new file mode 100644 index 0000000..a1d8e5f --- /dev/null +++ b/patches/strace/4.5.15/350-statfs64-check.patch @@ -0,0 +1,53 @@ +diff -dur strace-4.5.15.orig/acinclude.m4 strace-4.5.15/acinclude.m4 +--- strace-4.5.15.orig/acinclude.m4 2004-04-14 04:21:01.000000000 +0200 ++++ strace-4.5.15/acinclude.m4 2007-07-14 19:25:25.000000000 +0200 +@@ -210,6 +210,26 @@ + fi + ]) + ++dnl ### A macro to determine whether statfs64 is defined. ++AC_DEFUN([AC_STATFS64], ++[AC_MSG_CHECKING(for statfs64 in sys/(statfs|vfs).h) ++AC_CACHE_VAL(ac_cv_type_statfs64, ++[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef LINUX ++#include ++#include ++#else ++#include ++#endif]], [[struct statfs64 st;]])],[ac_cv_type_statfs64=yes],[ac_cv_type_statfs64=no])]) ++AC_MSG_RESULT($ac_cv_type_statfs64) ++if test "$ac_cv_type_statfs64" = yes ++then ++ AC_DEFINE([HAVE_STATFS64], 1, ++[Define if statfs64 is available in sys/statfs.h or sys/vfs.h.]) ++fi ++]) ++ ++ ++ + dnl ### A macro to determine if off_t is a long long + AC_DEFUN([AC_OFF_T_IS_LONG_LONG], + [AC_MSG_CHECKING(for long long off_t) +diff -dur strace-4.5.15.orig/configure.ac strace-4.5.15/configure.ac +--- strace-4.5.15.orig/configure.ac 2007-01-11 12:37:55.000000000 +0100 ++++ strace-4.5.15/configure.ac 2007-07-14 19:25:25.000000000 +0200 +@@ -169,6 +169,7 @@ + struct stat.st_level, + struct stat.st_rdev]) + AC_STAT64 ++AC_STATFS64 + + AC_TYPE_SIGNAL + AC_TYPE_UID_T +diff -dur strace-4.5.15.orig/file.c strace-4.5.15/file.c +--- strace-4.5.15.orig/file.c 2007-01-15 21:25:52.000000000 +0100 ++++ strace-4.5.15/file.c 2007-07-14 19:25:25.000000000 +0200 +@@ -1635,7 +1635,7 @@ + return 0; + } + +-#ifdef LINUX ++#ifdef HAVE_STATFS64 + static void + printstatfs64(tcp, addr) + struct tcb *tcp; diff --git a/patches/strace/4.5.15/350-strace-statfs64-check.patch b/patches/strace/4.5.15/350-strace-statfs64-check.patch deleted file mode 100644 index a1d8e5f..0000000 --- a/patches/strace/4.5.15/350-strace-statfs64-check.patch +++ /dev/null @@ -1,53 +0,0 @@ -diff -dur strace-4.5.15.orig/acinclude.m4 strace-4.5.15/acinclude.m4 ---- strace-4.5.15.orig/acinclude.m4 2004-04-14 04:21:01.000000000 +0200 -+++ strace-4.5.15/acinclude.m4 2007-07-14 19:25:25.000000000 +0200 -@@ -210,6 +210,26 @@ - fi - ]) - -+dnl ### A macro to determine whether statfs64 is defined. -+AC_DEFUN([AC_STATFS64], -+[AC_MSG_CHECKING(for statfs64 in sys/(statfs|vfs).h) -+AC_CACHE_VAL(ac_cv_type_statfs64, -+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef LINUX -+#include -+#include -+#else -+#include -+#endif]], [[struct statfs64 st;]])],[ac_cv_type_statfs64=yes],[ac_cv_type_statfs64=no])]) -+AC_MSG_RESULT($ac_cv_type_statfs64) -+if test "$ac_cv_type_statfs64" = yes -+then -+ AC_DEFINE([HAVE_STATFS64], 1, -+[Define if statfs64 is available in sys/statfs.h or sys/vfs.h.]) -+fi -+]) -+ -+ -+ - dnl ### A macro to determine if off_t is a long long - AC_DEFUN([AC_OFF_T_IS_LONG_LONG], - [AC_MSG_CHECKING(for long long off_t) -diff -dur strace-4.5.15.orig/configure.ac strace-4.5.15/configure.ac ---- strace-4.5.15.orig/configure.ac 2007-01-11 12:37:55.000000000 +0100 -+++ strace-4.5.15/configure.ac 2007-07-14 19:25:25.000000000 +0200 -@@ -169,6 +169,7 @@ - struct stat.st_level, - struct stat.st_rdev]) - AC_STAT64 -+AC_STATFS64 - - AC_TYPE_SIGNAL - AC_TYPE_UID_T -diff -dur strace-4.5.15.orig/file.c strace-4.5.15/file.c ---- strace-4.5.15.orig/file.c 2007-01-15 21:25:52.000000000 +0100 -+++ strace-4.5.15/file.c 2007-07-14 19:25:25.000000000 +0200 -@@ -1635,7 +1635,7 @@ - return 0; - } - --#ifdef LINUX -+#ifdef HAVE_STATFS64 - static void - printstatfs64(tcp, addr) - struct tcb *tcp; diff --git a/patches/strace/4.5.15/400-strace-superh-update.ac.patch b/patches/strace/4.5.15/400-strace-superh-update.ac.patch deleted file mode 100644 index 75e2cd4..0000000 --- a/patches/strace/4.5.15/400-strace-superh-update.ac.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff -dur strace-4.5.15.orig/configure.ac strace-4.5.15/configure.ac ---- strace-4.5.15.orig/configure.ac 2007-07-14 19:25:25.000000000 +0200 -+++ strace-4.5.15/configure.ac 2007-07-14 19:27:35.000000000 +0200 -@@ -91,14 +91,14 @@ - arch=hppa - AC_DEFINE([HPPA], 1, [Define for the HPPA architecture.]) - ;; --sh) -- arch=sh -- AC_DEFINE([SH], 1, [Define for the SH architecture.]) -- ;; - sh64) - arch=sh64 - AC_DEFINE([SH64], 1, [Define for the SH64 architecture.]) - ;; -+sh*) -+ arch=sh -+ AC_DEFINE([SH], 1, [Define for the SH architecture.]) -+ ;; - x86?64*) - arch=x86_64 - AC_DEFINE([X86_64], 1, [Define for the AMD x86-64 architecture.]) diff --git a/patches/strace/4.5.15/400-superh-update.ac.patch b/patches/strace/4.5.15/400-superh-update.ac.patch new file mode 100644 index 0000000..75e2cd4 --- /dev/null +++ b/patches/strace/4.5.15/400-superh-update.ac.patch @@ -0,0 +1,22 @@ +diff -dur strace-4.5.15.orig/configure.ac strace-4.5.15/configure.ac +--- strace-4.5.15.orig/configure.ac 2007-07-14 19:25:25.000000000 +0200 ++++ strace-4.5.15/configure.ac 2007-07-14 19:27:35.000000000 +0200 +@@ -91,14 +91,14 @@ + arch=hppa + AC_DEFINE([HPPA], 1, [Define for the HPPA architecture.]) + ;; +-sh) +- arch=sh +- AC_DEFINE([SH], 1, [Define for the SH architecture.]) +- ;; + sh64) + arch=sh64 + AC_DEFINE([SH64], 1, [Define for the SH64 architecture.]) + ;; ++sh*) ++ arch=sh ++ AC_DEFINE([SH], 1, [Define for the SH architecture.]) ++ ;; + x86?64*) + arch=x86_64 + AC_DEFINE([X86_64], 1, [Define for the AMD x86-64 architecture.]) diff --git a/patches/strace/4.5.15/450-strace-undef-CTL_PROC.patch b/patches/strace/4.5.15/450-strace-undef-CTL_PROC.patch deleted file mode 100644 index cfb8752..0000000 --- a/patches/strace/4.5.15/450-strace-undef-CTL_PROC.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -dur strace-4.5.15.orig/system.c strace-4.5.15/system.c ---- strace-4.5.15.orig/system.c 2007-01-17 00:22:36.000000000 +0100 -+++ strace-4.5.15/system.c 2007-07-14 19:28:41.000000000 +0200 -@@ -1612,7 +1612,9 @@ - { CTL_KERN, "CTL_KERN" }, - { CTL_VM, "CTL_VM" }, - { CTL_NET, "CTL_NET" }, -+#ifdef CTL_PROC - { CTL_PROC, "CTL_PROC" }, -+#endif - { CTL_FS, "CTL_FS" }, - { CTL_DEBUG, "CTL_DEBUG" }, - { CTL_DEV, "CTL_DEV" }, diff --git a/patches/strace/4.5.15/450-undef-CTL_PROC.patch b/patches/strace/4.5.15/450-undef-CTL_PROC.patch new file mode 100644 index 0000000..cfb8752 --- /dev/null +++ b/patches/strace/4.5.15/450-undef-CTL_PROC.patch @@ -0,0 +1,13 @@ +diff -dur strace-4.5.15.orig/system.c strace-4.5.15/system.c +--- strace-4.5.15.orig/system.c 2007-01-17 00:22:36.000000000 +0100 ++++ strace-4.5.15/system.c 2007-07-14 19:28:41.000000000 +0200 +@@ -1612,7 +1612,9 @@ + { CTL_KERN, "CTL_KERN" }, + { CTL_VM, "CTL_VM" }, + { CTL_NET, "CTL_NET" }, ++#ifdef CTL_PROC + { CTL_PROC, "CTL_PROC" }, ++#endif + { CTL_FS, "CTL_FS" }, + { CTL_DEBUG, "CTL_DEBUG" }, + { CTL_DEV, "CTL_DEV" }, diff --git a/patches/strace/4.5.15/500-strace-undef-PACKET_MEMBERSHIP.patch b/patches/strace/4.5.15/500-strace-undef-PACKET_MEMBERSHIP.patch deleted file mode 100644 index d7a100e..0000000 --- a/patches/strace/4.5.15/500-strace-undef-PACKET_MEMBERSHIP.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff -dur strace-4.5.15.orig/net.c strace-4.5.15/net.c ---- strace-4.5.15.orig/net.c 2006-12-13 20:57:23.000000000 +0100 -+++ strace-4.5.15/net.c 2007-07-14 19:29:36.000000000 +0200 -@@ -800,8 +800,12 @@ - - #ifdef SOL_PACKET - static const struct xlat sockpacketoptions[] = { -+#if defined(PACKET_ADD_MEMBERSHIP) - { PACKET_ADD_MEMBERSHIP, "PACKET_ADD_MEMBERSHIP" }, -+#endif -+#if defined(PACKET_DROP_MEMBERSHIP) - { PACKET_DROP_MEMBERSHIP, "PACKET_DROP_MEMBERSHIP"}, -+#endif - #if defined(PACKET_RECV_OUTPUT) - { PACKET_RECV_OUTPUT, "PACKET_RECV_OUTPUT" }, - #endif diff --git a/patches/strace/4.5.15/500-undef-PACKET_MEMBERSHIP.patch b/patches/strace/4.5.15/500-undef-PACKET_MEMBERSHIP.patch new file mode 100644 index 0000000..d7a100e --- /dev/null +++ b/patches/strace/4.5.15/500-undef-PACKET_MEMBERSHIP.patch @@ -0,0 +1,16 @@ +diff -dur strace-4.5.15.orig/net.c strace-4.5.15/net.c +--- strace-4.5.15.orig/net.c 2006-12-13 20:57:23.000000000 +0100 ++++ strace-4.5.15/net.c 2007-07-14 19:29:36.000000000 +0200 +@@ -800,8 +800,12 @@ + + #ifdef SOL_PACKET + static const struct xlat sockpacketoptions[] = { ++#if defined(PACKET_ADD_MEMBERSHIP) + { PACKET_ADD_MEMBERSHIP, "PACKET_ADD_MEMBERSHIP" }, ++#endif ++#if defined(PACKET_DROP_MEMBERSHIP) + { PACKET_DROP_MEMBERSHIP, "PACKET_DROP_MEMBERSHIP"}, ++#endif + #if defined(PACKET_RECV_OUTPUT) + { PACKET_RECV_OUTPUT, "PACKET_RECV_OUTPUT" }, + #endif diff --git a/patches/strace/4.5.15/550-strace-undef-syscall.patch b/patches/strace/4.5.15/550-strace-undef-syscall.patch deleted file mode 100644 index 7123f04..0000000 --- a/patches/strace/4.5.15/550-strace-undef-syscall.patch +++ /dev/null @@ -1,64 +0,0 @@ -diff -dur strace-4.5.15.orig/linux/syscallent.h strace-4.5.15/linux/syscallent.h ---- strace-4.5.15.orig/linux/syscallent.h 2006-10-16 03:17:52.000000000 +0200 -+++ strace-4.5.15/linux/syscallent.h 2007-07-14 19:30:16.000000000 +0200 -@@ -130,7 +130,11 @@ - { 2, TF, sys_statfs, "statfs" }, /* 99 */ - { 2, TD, sys_fstatfs, "fstatfs" }, /* 100 */ - { 3, 0, sys_ioperm, "ioperm" }, /* 101 */ -- { 2, TD, sys_socketcall, "socketcall", SYS_socketcall }, /* 102 */ -+ { 2, TD, sys_socketcall, "socketcall" -+#ifdef __NR_socketcall -+ , SYS_socketcall -+#endif -+ }, /* 102 */ - { 3, 0, sys_syslog, "syslog" }, /* 103 */ - { 3, 0, sys_setitimer, "setitimer" }, /* 104 */ - { 2, 0, sys_getitimer, "getitimer" }, /* 105 */ -@@ -145,7 +149,11 @@ - { 4, TP, sys_wait4, "wait4", SYS_wait4 }, /* 114 */ - { 1, 0, sys_swapoff, "swapoff" }, /* 115 */ - { 1, 0, sys_sysinfo, "sysinfo" }, /* 116 */ -- { 6, 0, sys_ipc, "ipc", SYS_ipc }, /* 117 */ -+ { 6, 0, sys_ipc, "ipc" -+#ifdef __NR_ipc -+ , SYS_ipc -+#endif -+ }, /* 117 */ - { 1, TD, sys_fsync, "fsync" }, /* 118 */ - { 1, TS, sys_sigreturn, "sigreturn" }, /* 119 */ - { 5, TP, sys_clone, "clone", SYS_clone }, /* 120 */ -@@ -282,7 +290,11 @@ - { 3, 0, sys_io_cancel, "io_cancel" }, /* 249 */ - { 5, 0, sys_fadvise64, "fadvise64" }, /* 250 */ - { 5, 0, printargs, "SYS_251" }, /* 251 */ -- { 1, TP, sys_exit, "exit_group", __NR_exit_group }, /* 252 */ -+ { 1, TP, sys_exit, "exit_group" -+#ifdef __NR_exit_group -+ , __NR_exit_group -+#endif -+ }, /* 252 */ - { 4, 0, printargs, "lookup_dcookie"}, /* 253 */ - { 1, 0, sys_epoll_create, "epoll_create" }, /* 254 */ - { 4, TD, sys_epoll_ctl, "epoll_ctl" }, /* 255 */ -diff -dur strace-4.5.15.orig/syscall.c strace-4.5.15/syscall.c ---- strace-4.5.15.orig/syscall.c 2007-07-14 19:22:49.000000000 +0200 -+++ strace-4.5.15/syscall.c 2007-07-14 19:30:16.000000000 +0200 -@@ -2404,14 +2404,18 @@ - switch (known_scno(tcp)) { - #ifdef LINUX - #if !defined (ALPHA) && !defined(SPARC) && !defined(SPARC64) && !defined(MIPS) && !defined(HPPA) -+#ifdef __NR_socketcall - case SYS_socketcall: - decode_subcall(tcp, SYS_socket_subcall, - SYS_socket_nsubcalls, deref_style); - break; -+#endif -+#ifdef __NR_ipc - case SYS_ipc: - decode_subcall(tcp, SYS_ipc_subcall, - SYS_ipc_nsubcalls, shift_style); - break; -+#endif - #endif /* !ALPHA && !MIPS && !SPARC && !SPARC64 && !HPPA */ - #if defined (SPARC) || defined (SPARC64) - case SYS_socketcall: diff --git a/patches/strace/4.5.15/550-undef-syscall.patch b/patches/strace/4.5.15/550-undef-syscall.patch new file mode 100644 index 0000000..7123f04 --- /dev/null +++ b/patches/strace/4.5.15/550-undef-syscall.patch @@ -0,0 +1,64 @@ +diff -dur strace-4.5.15.orig/linux/syscallent.h strace-4.5.15/linux/syscallent.h +--- strace-4.5.15.orig/linux/syscallent.h 2006-10-16 03:17:52.000000000 +0200 ++++ strace-4.5.15/linux/syscallent.h 2007-07-14 19:30:16.000000000 +0200 +@@ -130,7 +130,11 @@ + { 2, TF, sys_statfs, "statfs" }, /* 99 */ + { 2, TD, sys_fstatfs, "fstatfs" }, /* 100 */ + { 3, 0, sys_ioperm, "ioperm" }, /* 101 */ +- { 2, TD, sys_socketcall, "socketcall", SYS_socketcall }, /* 102 */ ++ { 2, TD, sys_socketcall, "socketcall" ++#ifdef __NR_socketcall ++ , SYS_socketcall ++#endif ++ }, /* 102 */ + { 3, 0, sys_syslog, "syslog" }, /* 103 */ + { 3, 0, sys_setitimer, "setitimer" }, /* 104 */ + { 2, 0, sys_getitimer, "getitimer" }, /* 105 */ +@@ -145,7 +149,11 @@ + { 4, TP, sys_wait4, "wait4", SYS_wait4 }, /* 114 */ + { 1, 0, sys_swapoff, "swapoff" }, /* 115 */ + { 1, 0, sys_sysinfo, "sysinfo" }, /* 116 */ +- { 6, 0, sys_ipc, "ipc", SYS_ipc }, /* 117 */ ++ { 6, 0, sys_ipc, "ipc" ++#ifdef __NR_ipc ++ , SYS_ipc ++#endif ++ }, /* 117 */ + { 1, TD, sys_fsync, "fsync" }, /* 118 */ + { 1, TS, sys_sigreturn, "sigreturn" }, /* 119 */ + { 5, TP, sys_clone, "clone", SYS_clone }, /* 120 */ +@@ -282,7 +290,11 @@ + { 3, 0, sys_io_cancel, "io_cancel" }, /* 249 */ + { 5, 0, sys_fadvise64, "fadvise64" }, /* 250 */ + { 5, 0, printargs, "SYS_251" }, /* 251 */ +- { 1, TP, sys_exit, "exit_group", __NR_exit_group }, /* 252 */ ++ { 1, TP, sys_exit, "exit_group" ++#ifdef __NR_exit_group ++ , __NR_exit_group ++#endif ++ }, /* 252 */ + { 4, 0, printargs, "lookup_dcookie"}, /* 253 */ + { 1, 0, sys_epoll_create, "epoll_create" }, /* 254 */ + { 4, TD, sys_epoll_ctl, "epoll_ctl" }, /* 255 */ +diff -dur strace-4.5.15.orig/syscall.c strace-4.5.15/syscall.c +--- strace-4.5.15.orig/syscall.c 2007-07-14 19:22:49.000000000 +0200 ++++ strace-4.5.15/syscall.c 2007-07-14 19:30:16.000000000 +0200 +@@ -2404,14 +2404,18 @@ + switch (known_scno(tcp)) { + #ifdef LINUX + #if !defined (ALPHA) && !defined(SPARC) && !defined(SPARC64) && !defined(MIPS) && !defined(HPPA) ++#ifdef __NR_socketcall + case SYS_socketcall: + decode_subcall(tcp, SYS_socket_subcall, + SYS_socket_nsubcalls, deref_style); + break; ++#endif ++#ifdef __NR_ipc + case SYS_ipc: + decode_subcall(tcp, SYS_ipc_subcall, + SYS_ipc_nsubcalls, shift_style); + break; ++#endif + #endif /* !ALPHA && !MIPS && !SPARC && !SPARC64 && !HPPA */ + #if defined (SPARC) || defined (SPARC64) + case SYS_socketcall: diff --git a/patches/strace/4.5.16/100-autoreconf.patch b/patches/strace/4.5.16/100-autoreconf.patch new file mode 100644 index 0000000..666ef43 --- /dev/null +++ b/patches/strace/4.5.16/100-autoreconf.patch @@ -0,0 +1,77 @@ +diff -dur strace-4.5.16.orig/configure strace-4.5.16/configure +--- strace-4.5.16.orig/configure 2007-01-11 23:23:33.000000000 +0100 ++++ strace-4.5.16/configure 2007-07-14 19:18:43.000000000 +0200 +@@ -5808,6 +5777,73 @@ + + fi + ++echo "$as_me:$LINENO: checking for statfs64 in sys/(statfs|vfs).h" >&5 ++echo $ECHO_N "checking for statfs64 in sys/(statfs|vfs).h... $ECHO_C" >&6 ++if test "${ac_cv_type_statfs64+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++#ifdef LINUX ++#include ++#include ++#else ++#include ++#endif ++int ++main () ++{ ++struct statfs64 st; ++ ; ++ return 0; ++} ++_ACEOF ++rm -f conftest.$ac_objext ++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ++ (eval $ac_compile) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ ac_cv_type_statfs64=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ac_cv_type_statfs64=no ++fi ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++ ++echo "$as_me:$LINENO: result: $ac_cv_type_statfs64" >&5 ++echo "${ECHO_T}$ac_cv_type_statfs64" >&6 ++if test "$ac_cv_type_statfs64" = yes ++then ++ ++cat >>confdefs.h <<\_ACEOF ++#define HAVE_STATFS64 1 ++_ACEOF ++ ++fi ++ + + { echo "$as_me:$LINENO: checking return type of signal handlers" >&5 + echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6; } diff --git a/patches/strace/4.5.16/100-strace-autoreconf.patch b/patches/strace/4.5.16/100-strace-autoreconf.patch deleted file mode 100644 index 666ef43..0000000 --- a/patches/strace/4.5.16/100-strace-autoreconf.patch +++ /dev/null @@ -1,77 +0,0 @@ -diff -dur strace-4.5.16.orig/configure strace-4.5.16/configure ---- strace-4.5.16.orig/configure 2007-01-11 23:23:33.000000000 +0100 -+++ strace-4.5.16/configure 2007-07-14 19:18:43.000000000 +0200 -@@ -5808,6 +5777,73 @@ - - fi - -+echo "$as_me:$LINENO: checking for statfs64 in sys/(statfs|vfs).h" >&5 -+echo $ECHO_N "checking for statfs64 in sys/(statfs|vfs).h... $ECHO_C" >&6 -+if test "${ac_cv_type_statfs64+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#ifdef LINUX -+#include -+#include -+#else -+#include -+#endif -+int -+main () -+{ -+struct statfs64 st; -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_cv_type_statfs64=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ac_cv_type_statfs64=no -+fi -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+ -+echo "$as_me:$LINENO: result: $ac_cv_type_statfs64" >&5 -+echo "${ECHO_T}$ac_cv_type_statfs64" >&6 -+if test "$ac_cv_type_statfs64" = yes -+then -+ -+cat >>confdefs.h <<\_ACEOF -+#define HAVE_STATFS64 1 -+_ACEOF -+ -+fi -+ - - { echo "$as_me:$LINENO: checking return type of signal handlers" >&5 - echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6; } diff --git a/patches/strace/4.5.16/150-dont-use-REG_SYSCALL-for-sh.patch b/patches/strace/4.5.16/150-dont-use-REG_SYSCALL-for-sh.patch new file mode 100644 index 0000000..ebbf69a --- /dev/null +++ b/patches/strace/4.5.16/150-dont-use-REG_SYSCALL-for-sh.patch @@ -0,0 +1,11 @@ +diff -dur strace-4.5.16.orig/process.c strace-4.5.16/process.c +--- strace-4.5.16.orig/process.c 2007-01-11 23:08:38.000000000 +0100 ++++ strace-4.5.16/process.c 2007-07-14 19:19:58.000000000 +0200 +@@ -2685,7 +2685,6 @@ + { 4*REG_GBR, "4*REG_GBR" }, + { 4*REG_MACH, "4*REG_MACH" }, + { 4*REG_MACL, "4*REG_MACL" }, +- { 4*REG_SYSCALL, "4*REG_SYSCALL" }, + { 4*REG_FPUL, "4*REG_FPUL" }, + { 4*REG_FPREG0, "4*REG_FPREG0" }, + { 4*(REG_FPREG0+1), "4*REG_FPREG1" }, diff --git a/patches/strace/4.5.16/150-strace-dont-use-REG_SYSCALL-for-sh.patch b/patches/strace/4.5.16/150-strace-dont-use-REG_SYSCALL-for-sh.patch deleted file mode 100644 index ebbf69a..0000000 --- a/patches/strace/4.5.16/150-strace-dont-use-REG_SYSCALL-for-sh.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -dur strace-4.5.16.orig/process.c strace-4.5.16/process.c ---- strace-4.5.16.orig/process.c 2007-01-11 23:08:38.000000000 +0100 -+++ strace-4.5.16/process.c 2007-07-14 19:19:58.000000000 +0200 -@@ -2685,7 +2685,6 @@ - { 4*REG_GBR, "4*REG_GBR" }, - { 4*REG_MACH, "4*REG_MACH" }, - { 4*REG_MACL, "4*REG_MACL" }, -- { 4*REG_SYSCALL, "4*REG_SYSCALL" }, - { 4*REG_FPUL, "4*REG_FPUL" }, - { 4*REG_FPREG0, "4*REG_FPREG0" }, - { 4*(REG_FPREG0+1), "4*REG_FPREG1" }, diff --git a/patches/strace/4.5.16/200-fix-arm-bad-syscall.patch b/patches/strace/4.5.16/200-fix-arm-bad-syscall.patch new file mode 100644 index 0000000..d31b9da --- /dev/null +++ b/patches/strace/4.5.16/200-fix-arm-bad-syscall.patch @@ -0,0 +1,19 @@ +diff -dur strace-4.5.16.orig/syscall.c strace-4.5.16/syscall.c +--- strace-4.5.16.orig/syscall.c 2006-12-21 23:13:33.000000000 +0100 ++++ strace-4.5.16/syscall.c 2007-07-14 19:21:44.000000000 +0200 +@@ -1045,6 +1045,15 @@ + /* + * Note: we only deal with only 32-bit CPUs here. + */ ++ ++ if (!(tcp->flags & TCB_INSYSCALL) && ++ (tcp->flags & TCB_WAITEXECVE)) { ++ /* caught a fake syscall from the execve's exit */ ++ tcp->flags &= ~TCB_WAITEXECVE; ++ return 0; ++ } ++ ++ + if (regs.ARM_cpsr & 0x20) { + /* + * Get the Thumb-mode system call number diff --git a/patches/strace/4.5.16/200-strace-fix-arm-bad-syscall.patch b/patches/strace/4.5.16/200-strace-fix-arm-bad-syscall.patch deleted file mode 100644 index d31b9da..0000000 --- a/patches/strace/4.5.16/200-strace-fix-arm-bad-syscall.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff -dur strace-4.5.16.orig/syscall.c strace-4.5.16/syscall.c ---- strace-4.5.16.orig/syscall.c 2006-12-21 23:13:33.000000000 +0100 -+++ strace-4.5.16/syscall.c 2007-07-14 19:21:44.000000000 +0200 -@@ -1045,6 +1045,15 @@ - /* - * Note: we only deal with only 32-bit CPUs here. - */ -+ -+ if (!(tcp->flags & TCB_INSYSCALL) && -+ (tcp->flags & TCB_WAITEXECVE)) { -+ /* caught a fake syscall from the execve's exit */ -+ tcp->flags &= ~TCB_WAITEXECVE; -+ return 0; -+ } -+ -+ - if (regs.ARM_cpsr & 0x20) { - /* - * Get the Thumb-mode system call number diff --git a/patches/strace/4.5.16/250-fix-disabled-largefile-syscalls.patch b/patches/strace/4.5.16/250-fix-disabled-largefile-syscalls.patch new file mode 100644 index 0000000..2f47dc9 --- /dev/null +++ b/patches/strace/4.5.16/250-fix-disabled-largefile-syscalls.patch @@ -0,0 +1,22 @@ +diff -dur strace-4.5.16.orig/syscall.c strace-4.5.16/syscall.c +--- strace-4.5.16.orig/syscall.c 2007-07-14 19:21:44.000000000 +0200 ++++ strace-4.5.16/syscall.c 2007-07-14 19:22:49.000000000 +0200 +@@ -125,6 +125,18 @@ + #define TP TRACE_PROCESS + #define TS TRACE_SIGNAL + ++#ifndef HAVE_STATFS64 ++/* ++ * Ugly hacks for systems that do not have LFS ++ */ ++ ++#define sys_truncate64 sys_truncate ++#define sys_ftruncate64 sys_ftruncate ++#define sys_getdents64 sys_getdents ++#define sys_statfs64 sys_statfs ++#define sys_fstatfs64 sys_fstatfs ++#endif ++ + static const struct sysent sysent0[] = { + #include "syscallent.h" + }; diff --git a/patches/strace/4.5.16/250-strace-fix-disabled-largefile-syscalls.patch b/patches/strace/4.5.16/250-strace-fix-disabled-largefile-syscalls.patch deleted file mode 100644 index 2f47dc9..0000000 --- a/patches/strace/4.5.16/250-strace-fix-disabled-largefile-syscalls.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff -dur strace-4.5.16.orig/syscall.c strace-4.5.16/syscall.c ---- strace-4.5.16.orig/syscall.c 2007-07-14 19:21:44.000000000 +0200 -+++ strace-4.5.16/syscall.c 2007-07-14 19:22:49.000000000 +0200 -@@ -125,6 +125,18 @@ - #define TP TRACE_PROCESS - #define TS TRACE_SIGNAL - -+#ifndef HAVE_STATFS64 -+/* -+ * Ugly hacks for systems that do not have LFS -+ */ -+ -+#define sys_truncate64 sys_truncate -+#define sys_ftruncate64 sys_ftruncate -+#define sys_getdents64 sys_getdents -+#define sys_statfs64 sys_statfs -+#define sys_fstatfs64 sys_fstatfs -+#endif -+ - static const struct sysent sysent0[] = { - #include "syscallent.h" - }; diff --git a/patches/strace/4.5.16/350-statfs64-check.patch b/patches/strace/4.5.16/350-statfs64-check.patch new file mode 100644 index 0000000..758966b --- /dev/null +++ b/patches/strace/4.5.16/350-statfs64-check.patch @@ -0,0 +1,53 @@ +diff -dur strace-4.5.16.orig/acinclude.m4 strace-4.5.16/acinclude.m4 +--- strace-4.5.16.orig/acinclude.m4 2004-04-14 04:21:01.000000000 +0200 ++++ strace-4.5.16/acinclude.m4 2007-07-14 19:25:25.000000000 +0200 +@@ -210,6 +210,26 @@ + fi + ]) + ++dnl ### A macro to determine whether statfs64 is defined. ++AC_DEFUN([AC_STATFS64], ++[AC_MSG_CHECKING(for statfs64 in sys/(statfs|vfs).h) ++AC_CACHE_VAL(ac_cv_type_statfs64, ++[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef LINUX ++#include ++#include ++#else ++#include ++#endif]], [[struct statfs64 st;]])],[ac_cv_type_statfs64=yes],[ac_cv_type_statfs64=no])]) ++AC_MSG_RESULT($ac_cv_type_statfs64) ++if test "$ac_cv_type_statfs64" = yes ++then ++ AC_DEFINE([HAVE_STATFS64], 1, ++[Define if statfs64 is available in sys/statfs.h or sys/vfs.h.]) ++fi ++]) ++ ++ ++ + dnl ### A macro to determine if off_t is a long long + AC_DEFUN([AC_OFF_T_IS_LONG_LONG], + [AC_MSG_CHECKING(for long long off_t) +diff -dur strace-4.5.16.orig/configure.ac strace-4.5.16/configure.ac +--- strace-4.5.16.orig/configure.ac 2007-01-11 12:37:55.000000000 +0100 ++++ strace-4.5.16/configure.ac 2007-07-14 19:25:25.000000000 +0200 +@@ -169,6 +169,7 @@ + struct stat.st_level, + struct stat.st_rdev]) + AC_STAT64 ++AC_STATFS64 + + AC_TYPE_SIGNAL + AC_TYPE_UID_T +diff -dur strace-4.5.16.orig/file.c strace-4.5.16/file.c +--- strace-4.5.16.orig/file.c 2007-01-15 21:25:52.000000000 +0100 ++++ strace-4.5.16/file.c 2007-07-14 19:25:25.000000000 +0200 +@@ -1636,7 +1636,7 @@ + return 0; + } + +-#ifdef LINUX ++#ifdef HAVE_STATFS64 + static void + printstatfs64(tcp, addr) + struct tcb *tcp; diff --git a/patches/strace/4.5.16/350-strace-statfs64-check.patch b/patches/strace/4.5.16/350-strace-statfs64-check.patch deleted file mode 100644 index 758966b..0000000 --- a/patches/strace/4.5.16/350-strace-statfs64-check.patch +++ /dev/null @@ -1,53 +0,0 @@ -diff -dur strace-4.5.16.orig/acinclude.m4 strace-4.5.16/acinclude.m4 ---- strace-4.5.16.orig/acinclude.m4 2004-04-14 04:21:01.000000000 +0200 -+++ strace-4.5.16/acinclude.m4 2007-07-14 19:25:25.000000000 +0200 -@@ -210,6 +210,26 @@ - fi - ]) - -+dnl ### A macro to determine whether statfs64 is defined. -+AC_DEFUN([AC_STATFS64], -+[AC_MSG_CHECKING(for statfs64 in sys/(statfs|vfs).h) -+AC_CACHE_VAL(ac_cv_type_statfs64, -+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef LINUX -+#include -+#include -+#else -+#include -+#endif]], [[struct statfs64 st;]])],[ac_cv_type_statfs64=yes],[ac_cv_type_statfs64=no])]) -+AC_MSG_RESULT($ac_cv_type_statfs64) -+if test "$ac_cv_type_statfs64" = yes -+then -+ AC_DEFINE([HAVE_STATFS64], 1, -+[Define if statfs64 is available in sys/statfs.h or sys/vfs.h.]) -+fi -+]) -+ -+ -+ - dnl ### A macro to determine if off_t is a long long - AC_DEFUN([AC_OFF_T_IS_LONG_LONG], - [AC_MSG_CHECKING(for long long off_t) -diff -dur strace-4.5.16.orig/configure.ac strace-4.5.16/configure.ac ---- strace-4.5.16.orig/configure.ac 2007-01-11 12:37:55.000000000 +0100 -+++ strace-4.5.16/configure.ac 2007-07-14 19:25:25.000000000 +0200 -@@ -169,6 +169,7 @@ - struct stat.st_level, - struct stat.st_rdev]) - AC_STAT64 -+AC_STATFS64 - - AC_TYPE_SIGNAL - AC_TYPE_UID_T -diff -dur strace-4.5.16.orig/file.c strace-4.5.16/file.c ---- strace-4.5.16.orig/file.c 2007-01-15 21:25:52.000000000 +0100 -+++ strace-4.5.16/file.c 2007-07-14 19:25:25.000000000 +0200 -@@ -1636,7 +1636,7 @@ - return 0; - } - --#ifdef LINUX -+#ifdef HAVE_STATFS64 - static void - printstatfs64(tcp, addr) - struct tcb *tcp; diff --git a/patches/strace/4.5.16/400-strace-superh-update.ac.patch b/patches/strace/4.5.16/400-strace-superh-update.ac.patch deleted file mode 100644 index 4129315..0000000 --- a/patches/strace/4.5.16/400-strace-superh-update.ac.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff -dur strace-4.5.16.orig/configure.ac strace-4.5.16/configure.ac ---- strace-4.5.16.orig/configure.ac 2007-07-14 19:25:25.000000000 +0200 -+++ strace-4.5.16/configure.ac 2007-07-14 19:27:35.000000000 +0200 -@@ -91,14 +91,14 @@ - arch=hppa - AC_DEFINE([HPPA], 1, [Define for the HPPA architecture.]) - ;; --sh) -- arch=sh -- AC_DEFINE([SH], 1, [Define for the SH architecture.]) -- ;; - sh64) - arch=sh64 - AC_DEFINE([SH64], 1, [Define for the SH64 architecture.]) - ;; -+sh*) -+ arch=sh -+ AC_DEFINE([SH], 1, [Define for the SH architecture.]) -+ ;; - x86?64*) - arch=x86_64 - AC_DEFINE([X86_64], 1, [Define for the AMD x86-64 architecture.]) diff --git a/patches/strace/4.5.16/400-superh-update.ac.patch b/patches/strace/4.5.16/400-superh-update.ac.patch new file mode 100644 index 0000000..4129315 --- /dev/null +++ b/patches/strace/4.5.16/400-superh-update.ac.patch @@ -0,0 +1,22 @@ +diff -dur strace-4.5.16.orig/configure.ac strace-4.5.16/configure.ac +--- strace-4.5.16.orig/configure.ac 2007-07-14 19:25:25.000000000 +0200 ++++ strace-4.5.16/configure.ac 2007-07-14 19:27:35.000000000 +0200 +@@ -91,14 +91,14 @@ + arch=hppa + AC_DEFINE([HPPA], 1, [Define for the HPPA architecture.]) + ;; +-sh) +- arch=sh +- AC_DEFINE([SH], 1, [Define for the SH architecture.]) +- ;; + sh64) + arch=sh64 + AC_DEFINE([SH64], 1, [Define for the SH64 architecture.]) + ;; ++sh*) ++ arch=sh ++ AC_DEFINE([SH], 1, [Define for the SH architecture.]) ++ ;; + x86?64*) + arch=x86_64 + AC_DEFINE([X86_64], 1, [Define for the AMD x86-64 architecture.]) diff --git a/patches/strace/4.5.16/450-strace-undef-CTL_PROC.patch b/patches/strace/4.5.16/450-strace-undef-CTL_PROC.patch deleted file mode 100644 index 9bbd78c..0000000 --- a/patches/strace/4.5.16/450-strace-undef-CTL_PROC.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -dur strace-4.5.16.orig/system.c strace-4.5.16/system.c ---- strace-4.5.16.orig/system.c 2007-01-17 00:22:36.000000000 +0100 -+++ strace-4.5.16/system.c 2007-07-14 19:28:41.000000000 +0200 -@@ -1612,7 +1612,9 @@ - { CTL_KERN, "CTL_KERN" }, - { CTL_VM, "CTL_VM" }, - { CTL_NET, "CTL_NET" }, -+#ifdef CTL_PROC - { CTL_PROC, "CTL_PROC" }, -+#endif - { CTL_FS, "CTL_FS" }, - { CTL_DEBUG, "CTL_DEBUG" }, - { CTL_DEV, "CTL_DEV" }, diff --git a/patches/strace/4.5.16/450-undef-CTL_PROC.patch b/patches/strace/4.5.16/450-undef-CTL_PROC.patch new file mode 100644 index 0000000..9bbd78c --- /dev/null +++ b/patches/strace/4.5.16/450-undef-CTL_PROC.patch @@ -0,0 +1,13 @@ +diff -dur strace-4.5.16.orig/system.c strace-4.5.16/system.c +--- strace-4.5.16.orig/system.c 2007-01-17 00:22:36.000000000 +0100 ++++ strace-4.5.16/system.c 2007-07-14 19:28:41.000000000 +0200 +@@ -1612,7 +1612,9 @@ + { CTL_KERN, "CTL_KERN" }, + { CTL_VM, "CTL_VM" }, + { CTL_NET, "CTL_NET" }, ++#ifdef CTL_PROC + { CTL_PROC, "CTL_PROC" }, ++#endif + { CTL_FS, "CTL_FS" }, + { CTL_DEBUG, "CTL_DEBUG" }, + { CTL_DEV, "CTL_DEV" }, diff --git a/patches/strace/4.5.16/500-strace-undef-PACKET_MEMBERSHIP.patch b/patches/strace/4.5.16/500-strace-undef-PACKET_MEMBERSHIP.patch deleted file mode 100644 index 3098f80..0000000 --- a/patches/strace/4.5.16/500-strace-undef-PACKET_MEMBERSHIP.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff -dur strace-4.5.16.orig/net.c strace-4.5.16/net.c ---- strace-4.5.16.orig/net.c 2006-12-13 20:57:23.000000000 +0100 -+++ strace-4.5.16/net.c 2007-07-14 19:29:36.000000000 +0200 -@@ -800,8 +800,12 @@ - - #ifdef SOL_PACKET - static const struct xlat sockpacketoptions[] = { -+#if defined(PACKET_ADD_MEMBERSHIP) - { PACKET_ADD_MEMBERSHIP, "PACKET_ADD_MEMBERSHIP" }, -+#endif -+#if defined(PACKET_DROP_MEMBERSHIP) - { PACKET_DROP_MEMBERSHIP, "PACKET_DROP_MEMBERSHIP"}, -+#endif - #if defined(PACKET_RECV_OUTPUT) - { PACKET_RECV_OUTPUT, "PACKET_RECV_OUTPUT" }, - #endif diff --git a/patches/strace/4.5.16/500-undef-PACKET_MEMBERSHIP.patch b/patches/strace/4.5.16/500-undef-PACKET_MEMBERSHIP.patch new file mode 100644 index 0000000..3098f80 --- /dev/null +++ b/patches/strace/4.5.16/500-undef-PACKET_MEMBERSHIP.patch @@ -0,0 +1,16 @@ +diff -dur strace-4.5.16.orig/net.c strace-4.5.16/net.c +--- strace-4.5.16.orig/net.c 2006-12-13 20:57:23.000000000 +0100 ++++ strace-4.5.16/net.c 2007-07-14 19:29:36.000000000 +0200 +@@ -800,8 +800,12 @@ + + #ifdef SOL_PACKET + static const struct xlat sockpacketoptions[] = { ++#if defined(PACKET_ADD_MEMBERSHIP) + { PACKET_ADD_MEMBERSHIP, "PACKET_ADD_MEMBERSHIP" }, ++#endif ++#if defined(PACKET_DROP_MEMBERSHIP) + { PACKET_DROP_MEMBERSHIP, "PACKET_DROP_MEMBERSHIP"}, ++#endif + #if defined(PACKET_RECV_OUTPUT) + { PACKET_RECV_OUTPUT, "PACKET_RECV_OUTPUT" }, + #endif diff --git a/patches/strace/4.5.16/550-strace-undef-syscall.patch b/patches/strace/4.5.16/550-strace-undef-syscall.patch deleted file mode 100644 index 6194429..0000000 --- a/patches/strace/4.5.16/550-strace-undef-syscall.patch +++ /dev/null @@ -1,64 +0,0 @@ -diff -dur strace-4.5.16.orig/linux/syscallent.h strace-4.5.16/linux/syscallent.h ---- strace-4.5.16.orig/linux/syscallent.h 2006-10-16 03:17:52.000000000 +0200 -+++ strace-4.5.16/linux/syscallent.h 2007-07-14 19:30:16.000000000 +0200 -@@ -130,7 +130,11 @@ - { 2, TF, sys_statfs, "statfs" }, /* 99 */ - { 2, TD, sys_fstatfs, "fstatfs" }, /* 100 */ - { 3, 0, sys_ioperm, "ioperm" }, /* 101 */ -- { 2, TD, sys_socketcall, "socketcall", SYS_socketcall }, /* 102 */ -+ { 2, TD, sys_socketcall, "socketcall" -+#ifdef __NR_socketcall -+ , SYS_socketcall -+#endif -+ }, /* 102 */ - { 3, 0, sys_syslog, "syslog" }, /* 103 */ - { 3, 0, sys_setitimer, "setitimer" }, /* 104 */ - { 2, 0, sys_getitimer, "getitimer" }, /* 105 */ -@@ -145,7 +149,11 @@ - { 4, TP, sys_wait4, "wait4", SYS_wait4 }, /* 114 */ - { 1, 0, sys_swapoff, "swapoff" }, /* 115 */ - { 1, 0, sys_sysinfo, "sysinfo" }, /* 116 */ -- { 6, 0, sys_ipc, "ipc", SYS_ipc }, /* 117 */ -+ { 6, 0, sys_ipc, "ipc" -+#ifdef __NR_ipc -+ , SYS_ipc -+#endif -+ }, /* 117 */ - { 1, TD, sys_fsync, "fsync" }, /* 118 */ - { 1, TS, sys_sigreturn, "sigreturn" }, /* 119 */ - { 5, TP, sys_clone, "clone", SYS_clone }, /* 120 */ -@@ -282,7 +290,11 @@ - { 3, 0, sys_io_cancel, "io_cancel" }, /* 249 */ - { 5, 0, sys_fadvise64, "fadvise64" }, /* 250 */ - { 5, 0, printargs, "SYS_251" }, /* 251 */ -- { 1, TP, sys_exit, "exit_group", __NR_exit_group }, /* 252 */ -+ { 1, TP, sys_exit, "exit_group" -+#ifdef __NR_exit_group -+ , __NR_exit_group -+#endif -+ }, /* 252 */ - { 4, 0, printargs, "lookup_dcookie"}, /* 253 */ - { 1, 0, sys_epoll_create, "epoll_create" }, /* 254 */ - { 4, TD, sys_epoll_ctl, "epoll_ctl" }, /* 255 */ -diff -dur strace-4.5.16.orig/syscall.c strace-4.5.16/syscall.c ---- strace-4.5.16.orig/syscall.c 2007-07-14 19:22:49.000000000 +0200 -+++ strace-4.5.16/syscall.c 2007-07-14 19:30:16.000000000 +0200 -@@ -2383,14 +2383,18 @@ - switch (known_scno(tcp)) { - #ifdef LINUX - #if !defined (ALPHA) && !defined(SPARC) && !defined(SPARC64) && !defined(MIPS) && !defined(HPPA) -+#ifdef __NR_socketcall - case SYS_socketcall: - decode_subcall(tcp, SYS_socket_subcall, - SYS_socket_nsubcalls, deref_style); - break; -+#endif -+#ifdef __NR_ipc - case SYS_ipc: - decode_subcall(tcp, SYS_ipc_subcall, - SYS_ipc_nsubcalls, shift_style); - break; -+#endif - #endif /* !ALPHA && !MIPS && !SPARC && !SPARC64 && !HPPA */ - #if defined (SPARC) || defined (SPARC64) - case SYS_socketcall: diff --git a/patches/strace/4.5.16/550-undef-syscall.patch b/patches/strace/4.5.16/550-undef-syscall.patch new file mode 100644 index 0000000..6194429 --- /dev/null +++ b/patches/strace/4.5.16/550-undef-syscall.patch @@ -0,0 +1,64 @@ +diff -dur strace-4.5.16.orig/linux/syscallent.h strace-4.5.16/linux/syscallent.h +--- strace-4.5.16.orig/linux/syscallent.h 2006-10-16 03:17:52.000000000 +0200 ++++ strace-4.5.16/linux/syscallent.h 2007-07-14 19:30:16.000000000 +0200 +@@ -130,7 +130,11 @@ + { 2, TF, sys_statfs, "statfs" }, /* 99 */ + { 2, TD, sys_fstatfs, "fstatfs" }, /* 100 */ + { 3, 0, sys_ioperm, "ioperm" }, /* 101 */ +- { 2, TD, sys_socketcall, "socketcall", SYS_socketcall }, /* 102 */ ++ { 2, TD, sys_socketcall, "socketcall" ++#ifdef __NR_socketcall ++ , SYS_socketcall ++#endif ++ }, /* 102 */ + { 3, 0, sys_syslog, "syslog" }, /* 103 */ + { 3, 0, sys_setitimer, "setitimer" }, /* 104 */ + { 2, 0, sys_getitimer, "getitimer" }, /* 105 */ +@@ -145,7 +149,11 @@ + { 4, TP, sys_wait4, "wait4", SYS_wait4 }, /* 114 */ + { 1, 0, sys_swapoff, "swapoff" }, /* 115 */ + { 1, 0, sys_sysinfo, "sysinfo" }, /* 116 */ +- { 6, 0, sys_ipc, "ipc", SYS_ipc }, /* 117 */ ++ { 6, 0, sys_ipc, "ipc" ++#ifdef __NR_ipc ++ , SYS_ipc ++#endif ++ }, /* 117 */ + { 1, TD, sys_fsync, "fsync" }, /* 118 */ + { 1, TS, sys_sigreturn, "sigreturn" }, /* 119 */ + { 5, TP, sys_clone, "clone", SYS_clone }, /* 120 */ +@@ -282,7 +290,11 @@ + { 3, 0, sys_io_cancel, "io_cancel" }, /* 249 */ + { 5, 0, sys_fadvise64, "fadvise64" }, /* 250 */ + { 5, 0, printargs, "SYS_251" }, /* 251 */ +- { 1, TP, sys_exit, "exit_group", __NR_exit_group }, /* 252 */ ++ { 1, TP, sys_exit, "exit_group" ++#ifdef __NR_exit_group ++ , __NR_exit_group ++#endif ++ }, /* 252 */ + { 4, 0, printargs, "lookup_dcookie"}, /* 253 */ + { 1, 0, sys_epoll_create, "epoll_create" }, /* 254 */ + { 4, TD, sys_epoll_ctl, "epoll_ctl" }, /* 255 */ +diff -dur strace-4.5.16.orig/syscall.c strace-4.5.16/syscall.c +--- strace-4.5.16.orig/syscall.c 2007-07-14 19:22:49.000000000 +0200 ++++ strace-4.5.16/syscall.c 2007-07-14 19:30:16.000000000 +0200 +@@ -2383,14 +2383,18 @@ + switch (known_scno(tcp)) { + #ifdef LINUX + #if !defined (ALPHA) && !defined(SPARC) && !defined(SPARC64) && !defined(MIPS) && !defined(HPPA) ++#ifdef __NR_socketcall + case SYS_socketcall: + decode_subcall(tcp, SYS_socket_subcall, + SYS_socket_nsubcalls, deref_style); + break; ++#endif ++#ifdef __NR_ipc + case SYS_ipc: + decode_subcall(tcp, SYS_ipc_subcall, + SYS_ipc_nsubcalls, shift_style); + break; ++#endif + #endif /* !ALPHA && !MIPS && !SPARC && !SPARC64 && !HPPA */ + #if defined (SPARC) || defined (SPARC64) + case SYS_socketcall: diff --git a/patches/uClibc/0.9.28.1/004-ctype.patch b/patches/uClibc/0.9.28.1/004-ctype.patch new file mode 100644 index 0000000..b07ccdb --- /dev/null +++ b/patches/uClibc/0.9.28.1/004-ctype.patch @@ -0,0 +1,17 @@ +diff -urN uClibc-dist/libc/sysdeps/linux/common/bits/uClibc_touplow.h uClibc/libc/sysdeps/linux/common/bits/uClibc_touplow.h +--- uClibc-dist/libc/sysdeps/linux/common/bits/uClibc_touplow.h Fri Jun 3 13:30:25 2005 ++++ uClibc/libc/sysdeps/linux/common/bits/uClibc_touplow.h Fri Jun 3 13:30:39 2005 +@@ -34,11 +34,11 @@ + + /* glibc uses the equivalent of - typedef __int32_t __ctype_touplow_t; */ + +-typedef __uint16_t __ctype_mask_t; ++typedef __uint32_t __ctype_mask_t; + + #ifdef __UCLIBC_HAS_CTYPE_SIGNED__ + +-typedef __int16_t __ctype_touplow_t; ++typedef __int32_t __ctype_touplow_t; + #define __UCLIBC_CTYPE_B_TBL_OFFSET 128 + #define __UCLIBC_CTYPE_TO_TBL_OFFSET 128 + diff --git a/patches/uClibc/0.9.28.1/004-uClibc_ctype.patch b/patches/uClibc/0.9.28.1/004-uClibc_ctype.patch deleted file mode 100644 index b07ccdb..0000000 --- a/patches/uClibc/0.9.28.1/004-uClibc_ctype.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff -urN uClibc-dist/libc/sysdeps/linux/common/bits/uClibc_touplow.h uClibc/libc/sysdeps/linux/common/bits/uClibc_touplow.h ---- uClibc-dist/libc/sysdeps/linux/common/bits/uClibc_touplow.h Fri Jun 3 13:30:25 2005 -+++ uClibc/libc/sysdeps/linux/common/bits/uClibc_touplow.h Fri Jun 3 13:30:39 2005 -@@ -34,11 +34,11 @@ - - /* glibc uses the equivalent of - typedef __int32_t __ctype_touplow_t; */ - --typedef __uint16_t __ctype_mask_t; -+typedef __uint32_t __ctype_mask_t; - - #ifdef __UCLIBC_HAS_CTYPE_SIGNED__ - --typedef __int16_t __ctype_touplow_t; -+typedef __int32_t __ctype_touplow_t; - #define __UCLIBC_CTYPE_B_TBL_OFFSET 128 - #define __UCLIBC_CTYPE_TO_TBL_OFFSET 128 - diff --git a/patches/uClibc/0.9.28.2/004-ctype.patch b/patches/uClibc/0.9.28.2/004-ctype.patch new file mode 100644 index 0000000..b07ccdb --- /dev/null +++ b/patches/uClibc/0.9.28.2/004-ctype.patch @@ -0,0 +1,17 @@ +diff -urN uClibc-dist/libc/sysdeps/linux/common/bits/uClibc_touplow.h uClibc/libc/sysdeps/linux/common/bits/uClibc_touplow.h +--- uClibc-dist/libc/sysdeps/linux/common/bits/uClibc_touplow.h Fri Jun 3 13:30:25 2005 ++++ uClibc/libc/sysdeps/linux/common/bits/uClibc_touplow.h Fri Jun 3 13:30:39 2005 +@@ -34,11 +34,11 @@ + + /* glibc uses the equivalent of - typedef __int32_t __ctype_touplow_t; */ + +-typedef __uint16_t __ctype_mask_t; ++typedef __uint32_t __ctype_mask_t; + + #ifdef __UCLIBC_HAS_CTYPE_SIGNED__ + +-typedef __int16_t __ctype_touplow_t; ++typedef __int32_t __ctype_touplow_t; + #define __UCLIBC_CTYPE_B_TBL_OFFSET 128 + #define __UCLIBC_CTYPE_TO_TBL_OFFSET 128 + diff --git a/patches/uClibc/0.9.28.2/004-uClibc_ctype.patch b/patches/uClibc/0.9.28.2/004-uClibc_ctype.patch deleted file mode 100644 index b07ccdb..0000000 --- a/patches/uClibc/0.9.28.2/004-uClibc_ctype.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff -urN uClibc-dist/libc/sysdeps/linux/common/bits/uClibc_touplow.h uClibc/libc/sysdeps/linux/common/bits/uClibc_touplow.h ---- uClibc-dist/libc/sysdeps/linux/common/bits/uClibc_touplow.h Fri Jun 3 13:30:25 2005 -+++ uClibc/libc/sysdeps/linux/common/bits/uClibc_touplow.h Fri Jun 3 13:30:39 2005 -@@ -34,11 +34,11 @@ - - /* glibc uses the equivalent of - typedef __int32_t __ctype_touplow_t; */ - --typedef __uint16_t __ctype_mask_t; -+typedef __uint32_t __ctype_mask_t; - - #ifdef __UCLIBC_HAS_CTYPE_SIGNED__ - --typedef __int16_t __ctype_touplow_t; -+typedef __int32_t __ctype_touplow_t; - #define __UCLIBC_CTYPE_B_TBL_OFFSET 128 - #define __UCLIBC_CTYPE_TO_TBL_OFFSET 128 - diff --git a/patches/uClibc/0.9.28.3/004-ctype.patch b/patches/uClibc/0.9.28.3/004-ctype.patch new file mode 100644 index 0000000..b07ccdb --- /dev/null +++ b/patches/uClibc/0.9.28.3/004-ctype.patch @@ -0,0 +1,17 @@ +diff -urN uClibc-dist/libc/sysdeps/linux/common/bits/uClibc_touplow.h uClibc/libc/sysdeps/linux/common/bits/uClibc_touplow.h +--- uClibc-dist/libc/sysdeps/linux/common/bits/uClibc_touplow.h Fri Jun 3 13:30:25 2005 ++++ uClibc/libc/sysdeps/linux/common/bits/uClibc_touplow.h Fri Jun 3 13:30:39 2005 +@@ -34,11 +34,11 @@ + + /* glibc uses the equivalent of - typedef __int32_t __ctype_touplow_t; */ + +-typedef __uint16_t __ctype_mask_t; ++typedef __uint32_t __ctype_mask_t; + + #ifdef __UCLIBC_HAS_CTYPE_SIGNED__ + +-typedef __int16_t __ctype_touplow_t; ++typedef __int32_t __ctype_touplow_t; + #define __UCLIBC_CTYPE_B_TBL_OFFSET 128 + #define __UCLIBC_CTYPE_TO_TBL_OFFSET 128 + diff --git a/patches/uClibc/0.9.28.3/004-uClibc_ctype.patch b/patches/uClibc/0.9.28.3/004-uClibc_ctype.patch deleted file mode 100644 index b07ccdb..0000000 --- a/patches/uClibc/0.9.28.3/004-uClibc_ctype.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff -urN uClibc-dist/libc/sysdeps/linux/common/bits/uClibc_touplow.h uClibc/libc/sysdeps/linux/common/bits/uClibc_touplow.h ---- uClibc-dist/libc/sysdeps/linux/common/bits/uClibc_touplow.h Fri Jun 3 13:30:25 2005 -+++ uClibc/libc/sysdeps/linux/common/bits/uClibc_touplow.h Fri Jun 3 13:30:39 2005 -@@ -34,11 +34,11 @@ - - /* glibc uses the equivalent of - typedef __int32_t __ctype_touplow_t; */ - --typedef __uint16_t __ctype_mask_t; -+typedef __uint32_t __ctype_mask_t; - - #ifdef __UCLIBC_HAS_CTYPE_SIGNED__ - --typedef __int16_t __ctype_touplow_t; -+typedef __int32_t __ctype_touplow_t; - #define __UCLIBC_CTYPE_B_TBL_OFFSET 128 - #define __UCLIBC_CTYPE_TO_TBL_OFFSET 128 - diff --git a/patches/uClibc/0.9.28/004-ctype.patch b/patches/uClibc/0.9.28/004-ctype.patch new file mode 100644 index 0000000..b07ccdb --- /dev/null +++ b/patches/uClibc/0.9.28/004-ctype.patch @@ -0,0 +1,17 @@ +diff -urN uClibc-dist/libc/sysdeps/linux/common/bits/uClibc_touplow.h uClibc/libc/sysdeps/linux/common/bits/uClibc_touplow.h +--- uClibc-dist/libc/sysdeps/linux/common/bits/uClibc_touplow.h Fri Jun 3 13:30:25 2005 ++++ uClibc/libc/sysdeps/linux/common/bits/uClibc_touplow.h Fri Jun 3 13:30:39 2005 +@@ -34,11 +34,11 @@ + + /* glibc uses the equivalent of - typedef __int32_t __ctype_touplow_t; */ + +-typedef __uint16_t __ctype_mask_t; ++typedef __uint32_t __ctype_mask_t; + + #ifdef __UCLIBC_HAS_CTYPE_SIGNED__ + +-typedef __int16_t __ctype_touplow_t; ++typedef __int32_t __ctype_touplow_t; + #define __UCLIBC_CTYPE_B_TBL_OFFSET 128 + #define __UCLIBC_CTYPE_TO_TBL_OFFSET 128 + diff --git a/patches/uClibc/0.9.28/004-uClibc_ctype.patch b/patches/uClibc/0.9.28/004-uClibc_ctype.patch deleted file mode 100644 index b07ccdb..0000000 --- a/patches/uClibc/0.9.28/004-uClibc_ctype.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff -urN uClibc-dist/libc/sysdeps/linux/common/bits/uClibc_touplow.h uClibc/libc/sysdeps/linux/common/bits/uClibc_touplow.h ---- uClibc-dist/libc/sysdeps/linux/common/bits/uClibc_touplow.h Fri Jun 3 13:30:25 2005 -+++ uClibc/libc/sysdeps/linux/common/bits/uClibc_touplow.h Fri Jun 3 13:30:39 2005 -@@ -34,11 +34,11 @@ - - /* glibc uses the equivalent of - typedef __int32_t __ctype_touplow_t; */ - --typedef __uint16_t __ctype_mask_t; -+typedef __uint32_t __ctype_mask_t; - - #ifdef __UCLIBC_HAS_CTYPE_SIGNED__ - --typedef __int16_t __ctype_touplow_t; -+typedef __int32_t __ctype_touplow_t; - #define __UCLIBC_CTYPE_B_TBL_OFFSET 128 - #define __UCLIBC_CTYPE_TO_TBL_OFFSET 128 - -- cgit v0.10.2-6-g49f6