Third go at renaming patches to contain neither the package name nor the package version.
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Mon Jul 28 21:08:01 2008 +0000 (2008-07-28)
changeset 746b150d6f590fc
parent 745 e445c00d134d
child 747 d3e603e7c17c
Third go at renaming patches to contain neither the package name nor the package version.
patches/cygwin/1.5.15-1/100-crossbuild.patch
patches/cygwin/1.5.15-1/100-cygwin-1.5.15-1-crossbuild.patch
patches/gcc/2.95.3/150-cygwin-020611.patch
patches/gcc/2.95.3/150-gcc-2.95.3-cygwin-020611.patch
patches/gcc/2.95.3/160-gcc-2.95.3-trap-posix.patch
patches/gcc/2.95.3/160-trap-posix.patch
patches/gcc/2.95.3/170-gcc-pr3106.patch
patches/gcc/2.95.3/170-pr3106.patch
patches/gcc/3.2.3/110-gcc-20020722-ppc405erratum77.patch
patches/gcc/3.2.3/110-ppc405erratum77.patch
patches/gcc/3.2.3/120-gcc-20030210-sh-linux-1.patch
patches/gcc/3.2.3/120-sh-linux-1.patch
patches/gcc/3.2.3/130-g++.exp.patch
patches/gcc/3.2.3/130-gcc-3.2.3-g++.exp.patch
patches/gcc/3.2.3/140-gcc-3.2.3-libffi-1.patch
patches/gcc/3.2.3/140-libffi-1.patch
patches/gcc/3.2.3/150-gcc-3.2.3-ppc-asm-spec.patch
patches/gcc/3.2.3/150-ppc-asm-spec.patch
patches/gcc/3.2.3/160-gcc-3.2.3-trap-posix.patch
patches/gcc/3.2.3/160-trap-posix.patch
patches/gcc/3.2.3/170-gcc-3.3-libstdc++-v3-dg.exp.patch
patches/gcc/3.2.3/170-libstdc++-v3-dg.exp.patch
patches/gcc/3.3.6/110-arm-bigendian.patch
patches/gcc/3.3.6/110-gcc-3.3.4-arm-bigendian.patch
patches/gcc/3.3.6/120-arm-pr22528.patch
patches/gcc/3.3.6/120-gcc-3.3.4-arm-pr22528.patch
patches/gcc/3.4.6/600-arm-ldm-peephole.patch
patches/gcc/3.4.6/600-gcc34-arm-ldm-peephole.patch
patches/gcc/3.4.6/601-arm-ldm.patch
patches/gcc/3.4.6/601-gcc34-arm-ldm-peephole2.patch
patches/gcc/3.4.6/601-gcc34-arm-ldm.patch
patches/gcc/3.4.6/602-arm-ldm-peephole2.patch
patches/gcc/4.0.0/110-arm-bigendian.patch
patches/gcc/4.0.0/110-gcc-4.0-arm-bigendian.patch
patches/gcc/4.1.0/100-fix-fixincl.patch
patches/gcc/4.1.0/100-gcc-4.1-fix-fixincl.patch
patches/gcc/4.2.0/940-alpha-signal_h.patch
patches/gcc/4.2.0/940-gcc-alpha-signal_h.patch
patches/gcc/4.2.1/940-alpha-signal_h.patch
patches/gcc/4.2.1/940-gcc-alpha-signal_h.patch
patches/gcc/4.2.2/940-alpha-signal_h.patch
patches/gcc/4.2.2/940-gcc-alpha-signal_h.patch
patches/gcc/4.2.3/940-alpha-signal_h.patch
patches/gcc/4.2.3/940-gcc-alpha-signal_h.patch
patches/gcc/4.2.4/940-alpha-signal_h.patch
patches/gcc/4.2.4/940-gcc-alpha-signal_h.patch
patches/gcc/4.3.0/100-alpha-mieee-default.patch
patches/gcc/4.3.0/100-gcc-4.1-alpha-mieee-default.patch
patches/gcc/4.3.0/125-gcc-trampolinewarn.patch
patches/gcc/4.3.0/125-trampolinewarn.patch
patches/gcc/4.3.0/150-gcc43-java-nomulti.patch
patches/gcc/4.3.0/150-java-nomulti.patch
patches/gcc/4.3.0/175-cross-compile.patch
patches/gcc/4.3.0/175-gcc-4.1-cross-compile.patch
patches/gcc/4.3.0/200-gcc-netbsd-symbolic.patch
patches/gcc/4.3.0/200-netbsd-symbolic.patch
patches/gcc/4.3.0/225-gcc-sparc64-bsd.patch
patches/gcc/4.3.0/225-sparc64-bsd.patch
patches/gcc/4.3.0/250-904-flatten-switch-stmt-00.patch
patches/gcc/4.3.0/250-flatten-switch-stmt-00.patch
patches/gcc/4.3.0/275-gcc-x86-emit-cld.patch
patches/gcc/4.3.0/275-x86-emit-cld.patch
patches/gcc/4.3.0/300-gcc-3.4-libiberty-pic.patch
patches/gcc/4.3.0/300-libiberty-pic.patch
patches/gcc/4.3.0/325-gcc4-superh-default-multilib.patch
patches/gcc/4.3.0/325-superh-default-multilib.patch
patches/gcc/4.3.0/350-300-libstdc++-pic.patch
patches/gcc/4.3.0/350-libstdc++-pic.patch
patches/gcc/4.3.0/375-gcc43-pr35440.patch
patches/gcc/4.3.0/375-pr35440.patch
patches/gcc/4.3.0/400-gcc43-pr24170.patch
patches/gcc/4.3.0/400-pr24170.patch
patches/gcc/4.3.0/425-gcc4-ia64-noteGNUstack.patch
patches/gcc/4.3.0/425-noteGNUstack-00.patch
patches/gcc/4.3.0/450-gcc4-noteGNUstack.patch
patches/gcc/4.3.0/450-noteGNUstack-01.patch
patches/gcc/4.3.0/475-gcc43-pr35705.patch
patches/gcc/4.3.0/475-pr35705.patch
patches/gcc/4.3.0/500-gcc43-pr34571.patch
patches/gcc/4.3.0/500-pr34571.patch
patches/gcc/4.3.0/525-gcc43-pr35982.patch
patches/gcc/4.3.0/525-pr35982.patch
patches/gcc/4.3.0/550-gcc43-pr25343.patch
patches/gcc/4.3.0/550-pr25343.patch
patches/gcc/4.3.0/600-ca-translation-typo.patch
patches/gcc/4.3.0/600-gcc-ca-translation-typo.patch
patches/gcc/4.3.0/625-103-uclibc-conf-noupstream.patch
patches/gcc/4.3.0/625-uclibc-conf-noupstream.patch
patches/gcc/4.3.0/650-200-uclibc-locale.patch
patches/gcc/4.3.0/650-uclibc-locale.patch
patches/gcc/4.3.0/675-203-uclibc-locale-no__x.patch
patches/gcc/4.3.0/675-uclibc-locale-no__x.patch
patches/gcc/4.3.0/700-204-uclibc-locale-wchar_fix.patch
patches/gcc/4.3.0/700-uclibc-locale-wchar_fix.patch
patches/gcc/4.3.0/725-205-uclibc-locale-update.patch
patches/gcc/4.3.0/725-uclibc-locale-update.patch
patches/gcc/4.3.0/750-301-missing-execinfo_h.patch
patches/gcc/4.3.0/750-missing-execinfo_h.patch
patches/gcc/4.3.0/775-303-c99-complex-ugly-hack.patch
patches/gcc/4.3.0/775-c99-complex-ugly-hack.patch
patches/gcc/4.3.0/800-304-index_macro.patch
patches/gcc/4.3.0/800-index_macro.patch
patches/gcc/4.3.0/825-305-libmudflap-susv3-legacy.patch
patches/gcc/4.3.0/825-libmudflap-susv3-legacy.patch
patches/gcc/4.3.0/850-306-libstdc++-namespace.patch
patches/gcc/4.3.0/850-libstdc++-namespace.patch
patches/gcc/4.3.0/940-alpha-signal_h.patch
patches/gcc/4.3.0/940-gcc-alpha-signal_h.patch
patches/gcc/4.3.1/100-alpha-mieee-default.patch
patches/gcc/4.3.1/100-gcc-4.1-alpha-mieee-default.patch
patches/gcc/4.3.1/125-gcc-trampolinewarn.patch
patches/gcc/4.3.1/125-trampolinewarn.patch
patches/gcc/4.3.1/150-gcc43-java-nomulti.patch
patches/gcc/4.3.1/150-java-nomulti.patch
patches/gcc/4.3.1/175-cross-compile.patch
patches/gcc/4.3.1/175-gcc-4.1-cross-compile.patch
patches/gcc/4.3.1/200-gcc-netbsd-symbolic.patch
patches/gcc/4.3.1/200-netbsd-symbolic.patch
patches/gcc/4.3.1/225-gcc-sparc64-bsd.patch
patches/gcc/4.3.1/225-sparc64-bsd.patch
patches/gcc/4.3.1/250-904-flatten-switch-stmt-00.patch
patches/gcc/4.3.1/250-flatten-switch-stmt-00.patch
patches/gcc/4.3.1/275-gcc-3.4-libiberty-pic.patch
patches/gcc/4.3.1/275-libiberty-pic.patch
patches/gcc/4.3.1/300-gcc4-superh-default-multilib.patch
patches/gcc/4.3.1/300-superh-default-multilib.patch
patches/gcc/4.3.1/325-300-libstdc++-pic.patch
patches/gcc/4.3.1/325-libstdc++-pic.patch
patches/gcc/4.3.1/350-gcc43-pr24170.patch
patches/gcc/4.3.1/350-pr24170.patch
patches/gcc/4.3.1/375-gcc4-ia64-noteGNUstack.patch
patches/gcc/4.3.1/375-noteGNUstack-00.patch
patches/gcc/4.3.1/400-gcc4-noteGNUstack.patch
patches/gcc/4.3.1/400-noteGNUstack-01.patch
patches/gcc/4.3.1/425-gcc43-pr34571.patch
patches/gcc/4.3.1/425-pr34571.patch
patches/gcc/4.3.1/450-gcc43-pr25343.patch
patches/gcc/4.3.1/450-pr25343.patch
patches/gcc/4.3.1/500-103-uclibc-conf-noupstream.patch
patches/gcc/4.3.1/500-uclibc-conf-noupstream.patch
patches/gcc/4.3.1/525-200-uclibc-locale.patch
patches/gcc/4.3.1/525-uclibc-locale.patch
patches/gcc/4.3.1/550-203-uclibc-locale-no__x.patch
patches/gcc/4.3.1/550-uclibc-locale-no__x.patch
patches/gcc/4.3.1/575-204-uclibc-locale-wchar_fix.patch
patches/gcc/4.3.1/575-uclibc-locale-wchar_fix.patch
patches/gcc/4.3.1/600-205-uclibc-locale-update.patch
patches/gcc/4.3.1/600-uclibc-locale-update.patch
patches/gcc/4.3.1/625-301-missing-execinfo_h.patch
patches/gcc/4.3.1/625-missing-execinfo_h.patch
patches/gcc/4.3.1/650-303-c99-complex-ugly-hack.patch
patches/gcc/4.3.1/650-c99-complex-ugly-hack.patch
patches/gcc/4.3.1/675-304-index_macro.patch
patches/gcc/4.3.1/675-index_macro.patch
patches/gcc/4.3.1/700-305-libmudflap-susv3-legacy.patch
patches/gcc/4.3.1/700-libmudflap-susv3-legacy.patch
patches/gcc/4.3.1/725-306-libstdc++-namespace.patch
patches/gcc/4.3.1/725-libstdc++-namespace.patch
patches/gcc/4.3.1/940-alpha-signal_h.patch
patches/gcc/4.3.1/940-gcc-alpha-signal_h.patch
patches/gdb/6.7.1/150-gdb-6.3-security-errata-20050610.patch
patches/gdb/6.7.1/150-security-errata-20050610.patch
patches/gdb/6.7.1/175-gdb-hppa-offsets.patch
patches/gdb/6.7.1/175-hppa-offsets.patch
patches/gdb/6.7.1/200-deleted-children.patch
patches/gdb/6.7.1/200-gdb-deleted-children.patch
patches/gdb/6.7.1/225-dwarf-stack-overflow.patch
patches/gdb/6.7.1/225-gdb-6.5-dwarf-stack-overflow.patch
patches/gdb/6.7/100-gdb-6.3-security-errata-20050610.patch
patches/gdb/6.7/100-security-errata-20050610.patch
patches/gdb/6.7/125-gdb-hppa-offsets.patch
patches/gdb/6.7/125-hppa-offsets.patch
patches/gdb/6.7/150-dwarf-stack-overflow.patch
patches/gdb/6.7/150-gdb-6.5-dwarf-stack-overflow.patch
patches/gdb/6.8/100-dwarf-stack-overflow.patch
patches/gdb/6.8/100-gdb-6.5-dwarf-stack-overflow.patch
patches/gdb/6.8/150-gdb-6.3-security-errata-20050610.patch
patches/gdb/6.8/150-security-errata-20050610.patch
patches/gdb/6.8/200-gdb-tdep-opcode-include-workaround.patch
patches/gdb/6.8/200-tdep-opcode-include-workaround.patch
patches/strace/4.5.15/100-autoreconf.patch
patches/strace/4.5.15/100-strace-autoreconf.patch
patches/strace/4.5.15/150-dont-use-REG_SYSCALL-for-sh.patch
patches/strace/4.5.15/150-strace-dont-use-REG_SYSCALL-for-sh.patch
patches/strace/4.5.15/200-fix-arm-bad-syscall.patch
patches/strace/4.5.15/200-strace-fix-arm-bad-syscall.patch
patches/strace/4.5.15/250-fix-disabled-largefile-syscalls.patch
patches/strace/4.5.15/250-strace-fix-disabled-largefile-syscalls.patch
patches/strace/4.5.15/300-mips-sprintsigmask-fix.patch
patches/strace/4.5.15/300-strace-mips-sprintsigmask-fix.patch
patches/strace/4.5.15/350-statfs64-check.patch
patches/strace/4.5.15/350-strace-statfs64-check.patch
patches/strace/4.5.15/400-strace-superh-update.ac.patch
patches/strace/4.5.15/400-superh-update.ac.patch
patches/strace/4.5.15/450-strace-undef-CTL_PROC.patch
patches/strace/4.5.15/450-undef-CTL_PROC.patch
patches/strace/4.5.15/500-strace-undef-PACKET_MEMBERSHIP.patch
patches/strace/4.5.15/500-undef-PACKET_MEMBERSHIP.patch
patches/strace/4.5.15/550-strace-undef-syscall.patch
patches/strace/4.5.15/550-undef-syscall.patch
patches/strace/4.5.16/100-autoreconf.patch
patches/strace/4.5.16/100-strace-autoreconf.patch
patches/strace/4.5.16/150-dont-use-REG_SYSCALL-for-sh.patch
patches/strace/4.5.16/150-strace-dont-use-REG_SYSCALL-for-sh.patch
patches/strace/4.5.16/200-fix-arm-bad-syscall.patch
patches/strace/4.5.16/200-strace-fix-arm-bad-syscall.patch
patches/strace/4.5.16/250-fix-disabled-largefile-syscalls.patch
patches/strace/4.5.16/250-strace-fix-disabled-largefile-syscalls.patch
patches/strace/4.5.16/350-statfs64-check.patch
patches/strace/4.5.16/350-strace-statfs64-check.patch
patches/strace/4.5.16/400-strace-superh-update.ac.patch
patches/strace/4.5.16/400-superh-update.ac.patch
patches/strace/4.5.16/450-strace-undef-CTL_PROC.patch
patches/strace/4.5.16/450-undef-CTL_PROC.patch
patches/strace/4.5.16/500-strace-undef-PACKET_MEMBERSHIP.patch
patches/strace/4.5.16/500-undef-PACKET_MEMBERSHIP.patch
patches/strace/4.5.16/550-strace-undef-syscall.patch
patches/strace/4.5.16/550-undef-syscall.patch
patches/uClibc/0.9.28.1/004-ctype.patch
patches/uClibc/0.9.28.1/004-uClibc_ctype.patch
patches/uClibc/0.9.28.2/004-ctype.patch
patches/uClibc/0.9.28.2/004-uClibc_ctype.patch
patches/uClibc/0.9.28.3/004-ctype.patch
patches/uClibc/0.9.28.3/004-uClibc_ctype.patch
patches/uClibc/0.9.28/004-ctype.patch
patches/uClibc/0.9.28/004-uClibc_ctype.patch
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/patches/cygwin/1.5.15-1/100-crossbuild.patch	Mon Jul 28 21:08:01 2008 +0000
     1.3 @@ -0,0 +1,40 @@
     1.4 +Message-ID: <4269173F.7020705@zee2.com>
     1.5 +Date: Fri, 22 Apr 2005 16:24:47 +0100
     1.6 +From: Steve Papacharalambous <stevep@zee2.com>
     1.7 +To: "Robert P. J. Day" <rpjday@mindspring.com>
     1.8 +CC: crossgcc list <crossgcc@sources.redhat.com>
     1.9 +Subject: Re: cygwin source directory has moved
    1.10 +In-Reply-To: <Pine.LNX.4.61.0504181746050.11794@localhost.localdomain>
    1.11 +
    1.12 +Hi Robert,
    1.13 +
    1.14 +I've attached two patches:
    1.15 +
    1.16 +1/  For crosstool-0.31 which changes the CYGWIN_URL to one which has the
    1.17 +cygwin source archives.  The version of cygwin that is used to build the
    1.18 +cross toolchain has been changed to cygwin-1.5.15-1-src.tar.bz2 since
    1.19 +most of the mirror sites don't seem to have the original archive used.
    1.20 +[created gcc-3.3.2-cygwin-1.5.15-1.dat - dank]
    1.21 +
    1.22 +
    1.23 +2/ The later cygwin source archive fails to cross build with the error:
    1.24 +/opt/crosstool/i686-pc-cygwin/gcc-3.3.2-cygwin-1.5.15-1/lib/gcc-lib/i686-pc-cygwin/bin/ld:
    1.25 +cannot find -luser32
    1.26 +
    1.27 +unless the second patch is applied,
    1.28 +
    1.29 +
    1.30 +diff -uNr cygwin-1.5.15-1.orig/winsup/mingw/Makefile.in cygwin-1.5.15-1/winsup/mingw/Makefile.in
    1.31 +--- cygwin-1.5.15-1.orig/winsup/mingw/Makefile.in	2005-02-28 22:51:02.000000000 +0000
    1.32 ++++ cygwin-1.5.15-1/winsup/mingw/Makefile.in	2005-04-22 15:29:18.000000000 +0100
    1.33 +@@ -71,7 +71,7 @@
    1.34 + mkinstalldirs = $(SHELL) @MKINSTALLDIRS@
    1.35 + 
    1.36 + CC := @CC@
    1.37 +-override CC := ${filter-out -L% -B%,${shell echo $(CC) | sed -e 's%\(-isystem\|-iwithprefixbefore\)  *[^ ]*\( \|$$\)% %g'}}
    1.38 ++override CC := ${filter-out -B%,${shell echo $(CC) | sed -e 's%\(-isystem\|-iwithprefixbefore\)  *[^ ]*\( \|$$\)% %g'}}
    1.39 + # FIXME: Which is it, CC or CC_FOR_TARGET?
    1.40 + CC_FOR_TARGET = $(CC)
    1.41 + AS_FOR_TARGET = $(AS)
    1.42 +
    1.43 +
     2.1 --- a/patches/cygwin/1.5.15-1/100-cygwin-1.5.15-1-crossbuild.patch	Mon Jul 28 20:17:48 2008 +0000
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,40 +0,0 @@
     2.4 -Message-ID: <4269173F.7020705@zee2.com>
     2.5 -Date: Fri, 22 Apr 2005 16:24:47 +0100
     2.6 -From: Steve Papacharalambous <stevep@zee2.com>
     2.7 -To: "Robert P. J. Day" <rpjday@mindspring.com>
     2.8 -CC: crossgcc list <crossgcc@sources.redhat.com>
     2.9 -Subject: Re: cygwin source directory has moved
    2.10 -In-Reply-To: <Pine.LNX.4.61.0504181746050.11794@localhost.localdomain>
    2.11 -
    2.12 -Hi Robert,
    2.13 -
    2.14 -I've attached two patches:
    2.15 -
    2.16 -1/  For crosstool-0.31 which changes the CYGWIN_URL to one which has the
    2.17 -cygwin source archives.  The version of cygwin that is used to build the
    2.18 -cross toolchain has been changed to cygwin-1.5.15-1-src.tar.bz2 since
    2.19 -most of the mirror sites don't seem to have the original archive used.
    2.20 -[created gcc-3.3.2-cygwin-1.5.15-1.dat - dank]
    2.21 -
    2.22 -
    2.23 -2/ The later cygwin source archive fails to cross build with the error:
    2.24 -/opt/crosstool/i686-pc-cygwin/gcc-3.3.2-cygwin-1.5.15-1/lib/gcc-lib/i686-pc-cygwin/bin/ld:
    2.25 -cannot find -luser32
    2.26 -
    2.27 -unless the second patch is applied,
    2.28 -
    2.29 -
    2.30 -diff -uNr cygwin-1.5.15-1.orig/winsup/mingw/Makefile.in cygwin-1.5.15-1/winsup/mingw/Makefile.in
    2.31 ---- cygwin-1.5.15-1.orig/winsup/mingw/Makefile.in	2005-02-28 22:51:02.000000000 +0000
    2.32 -+++ cygwin-1.5.15-1/winsup/mingw/Makefile.in	2005-04-22 15:29:18.000000000 +0100
    2.33 -@@ -71,7 +71,7 @@
    2.34 - mkinstalldirs = $(SHELL) @MKINSTALLDIRS@
    2.35 - 
    2.36 - CC := @CC@
    2.37 --override CC := ${filter-out -L% -B%,${shell echo $(CC) | sed -e 's%\(-isystem\|-iwithprefixbefore\)  *[^ ]*\( \|$$\)% %g'}}
    2.38 -+override CC := ${filter-out -B%,${shell echo $(CC) | sed -e 's%\(-isystem\|-iwithprefixbefore\)  *[^ ]*\( \|$$\)% %g'}}
    2.39 - # FIXME: Which is it, CC or CC_FOR_TARGET?
    2.40 - CC_FOR_TARGET = $(CC)
    2.41 - AS_FOR_TARGET = $(AS)
    2.42 -
    2.43 -
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/patches/gcc/2.95.3/150-cygwin-020611.patch	Mon Jul 28 21:08:01 2008 +0000
     3.3 @@ -0,0 +1,33 @@
     3.4 +[ Building gcc-2.95.3 on cygwin yields a compiler that sticks a .exe
     3.5 +  on the end of every executable, even if they're linux executable.
     3.6 +  This is highly annoying, and causes glibc build failures that look like this:
     3.7 +    mv: `.../bin/makedb.new' and `.../bin/makedb' are the same file
     3.8 +    make[2]: *** [.../bin/makedb] Error 1
     3.9 +    make[2]: Leaving directory `.../gcc-2.95.3-glibc-2.1.3/glibc-2.1.3/db2'
    3.10 +
    3.11 +  The mainline solves this with http://gcc.gnu.org/ml/gcc-cvs/2001-04/msg00440.html,
    3.12 +  but that doesn't apply cleanly to gcc-2.95.3.
    3.13 +
    3.14 +  So, I'm using
    3.15 +  http://www.uclinux.org/pub/uClinux/uclinux-elf-tools/tools-20030314/gcc-2.95.3-cygwin-020611.patch
    3.16 +  This is the only patch in crosstool that *isn't* suitable for the mainline.
    3.17 +  I can live with this patch simply because crosstool does not build
    3.18 +  compilers that target cygwin or VAX/VMS. 
    3.19 +  If that ever changes, I might need to try applying the real patch.
    3.20 +]
    3.21 +
    3.22 +
    3.23 +
    3.24 +#
    3.25 +# This patch can be found at http://www.uclinux.org/pub/uClinux/m68k-elf-tools/
    3.26 +#
    3.27 +--- gcc-2.95.3/gcc/config/i386/xm-cygwin.h	1999-04-22 16:40:56.000000000 +0200
    3.28 ++++ gcc-2.95.3-cygwin/gcc/config/i386/xm-cygwin.h	2002-06-11 08:23:18.000000000 +0200
    3.29 +@@ -19,7 +19,6 @@
    3.30 + the Free Software Foundation, 59 Temple Place - Suite 330,
    3.31 + Boston, MA 02111-1307, USA. */
    3.32 + 
    3.33 +-#define EXECUTABLE_SUFFIX ".exe"
    3.34 + #define NO_SYS_SIGLIST 1
    3.35 + 
    3.36 + /* We support both "/" and "\" since everybody tests both but we
     4.1 --- a/patches/gcc/2.95.3/150-gcc-2.95.3-cygwin-020611.patch	Mon Jul 28 20:17:48 2008 +0000
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,33 +0,0 @@
     4.4 -[ Building gcc-2.95.3 on cygwin yields a compiler that sticks a .exe
     4.5 -  on the end of every executable, even if they're linux executable.
     4.6 -  This is highly annoying, and causes glibc build failures that look like this:
     4.7 -    mv: `.../bin/makedb.new' and `.../bin/makedb' are the same file
     4.8 -    make[2]: *** [.../bin/makedb] Error 1
     4.9 -    make[2]: Leaving directory `.../gcc-2.95.3-glibc-2.1.3/glibc-2.1.3/db2'
    4.10 -
    4.11 -  The mainline solves this with http://gcc.gnu.org/ml/gcc-cvs/2001-04/msg00440.html,
    4.12 -  but that doesn't apply cleanly to gcc-2.95.3.
    4.13 -
    4.14 -  So, I'm using
    4.15 -  http://www.uclinux.org/pub/uClinux/uclinux-elf-tools/tools-20030314/gcc-2.95.3-cygwin-020611.patch
    4.16 -  This is the only patch in crosstool that *isn't* suitable for the mainline.
    4.17 -  I can live with this patch simply because crosstool does not build
    4.18 -  compilers that target cygwin or VAX/VMS. 
    4.19 -  If that ever changes, I might need to try applying the real patch.
    4.20 -]
    4.21 -
    4.22 -
    4.23 -
    4.24 -#
    4.25 -# This patch can be found at http://www.uclinux.org/pub/uClinux/m68k-elf-tools/
    4.26 -#
    4.27 ---- gcc-2.95.3/gcc/config/i386/xm-cygwin.h	1999-04-22 16:40:56.000000000 +0200
    4.28 -+++ gcc-2.95.3-cygwin/gcc/config/i386/xm-cygwin.h	2002-06-11 08:23:18.000000000 +0200
    4.29 -@@ -19,7 +19,6 @@
    4.30 - the Free Software Foundation, 59 Temple Place - Suite 330,
    4.31 - Boston, MA 02111-1307, USA. */
    4.32 - 
    4.33 --#define EXECUTABLE_SUFFIX ".exe"
    4.34 - #define NO_SYS_SIGLIST 1
    4.35 - 
    4.36 - /* We support both "/" and "\" since everybody tests both but we
     5.1 --- a/patches/gcc/2.95.3/160-gcc-2.95.3-trap-posix.patch	Mon Jul 28 20:17:48 2008 +0000
     5.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.3 @@ -1,44 +0,0 @@
     5.4 -# 
     5.5 -# Submitted-By: Marc Kleine-Budde <mkl@pengutronix.de>, 2005-04-20
     5.6 -#
     5.7 -# Error:
     5.8 -#
     5.9 -# creating libintl.h
    5.10 -# Configuring etc...
    5.11 -# loading cache ../config.cache
    5.12 -# checking for a BSD compatible install... (cached) /usr/bin/install -c
    5.13 -# creating ./config.status
    5.14 -# creating Makefile
    5.15 -# trap: usage: trap [-lp] [[arg] signal_spec ...]
    5.16 -#
    5.17 -# Description:
    5.18 -#
    5.19 -# non-posix conform usage of trap causes bash >= 3.0 to fail
    5.20 -# e.g.: http://sourceware.org/ml/crossgcc/2004-12/msg00132.html
    5.21 -#
    5.22 -# Status:
    5.23 -#
    5.24 -# fixed in gcc >= 3.3.5
    5.25 -# backport of gcc-3.3.5 fix
    5.26 -#
    5.27 -diff -ruN gcc-2.95.3-orig/configure gcc-2.95.3/configure
    5.28 ---- gcc-2.95.3-orig/configure	1999-04-02 16:17:40.000000000 +0200
    5.29 -+++ gcc-2.95.3/configure	2005-04-20 18:25:45.030488235 +0200
    5.30 -@@ -687,7 +687,7 @@
    5.31 - if test -f skip-this-dir; then
    5.32 - 	# Perform the same cleanup as the trap handler, minus the "exit 1" of course,
    5.33 - 	# and reset the trap handler.
    5.34 --	trap 0
    5.35 -+	trap '' 0
    5.36 - 	rm -f Makefile* ${tmpfile}.com ${tmpfile}.tgt ${tmpfile}.hst ${tmpfile}.pos
    5.37 - 	# Execute the final clean-up actions
    5.38 - 	${config_shell} skip-this-dir
    5.39 -@@ -1599,7 +1599,7 @@
    5.40 - # Perform the same cleanup as the trap handler, minus the "exit 1" of course,
    5.41 - # and reset the trap handler.
    5.42 - rm -f ${tmpfile}.com ${tmpfile}.tgt ${tmpfile}.hst ${tmpfile}.pos
    5.43 --trap 0
    5.44 -+trap '' 0
    5.45 - 
    5.46 - exit 0
    5.47 - 
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/patches/gcc/2.95.3/160-trap-posix.patch	Mon Jul 28 21:08:01 2008 +0000
     6.3 @@ -0,0 +1,44 @@
     6.4 +# 
     6.5 +# Submitted-By: Marc Kleine-Budde <mkl@pengutronix.de>, 2005-04-20
     6.6 +#
     6.7 +# Error:
     6.8 +#
     6.9 +# creating libintl.h
    6.10 +# Configuring etc...
    6.11 +# loading cache ../config.cache
    6.12 +# checking for a BSD compatible install... (cached) /usr/bin/install -c
    6.13 +# creating ./config.status
    6.14 +# creating Makefile
    6.15 +# trap: usage: trap [-lp] [[arg] signal_spec ...]
    6.16 +#
    6.17 +# Description:
    6.18 +#
    6.19 +# non-posix conform usage of trap causes bash >= 3.0 to fail
    6.20 +# e.g.: http://sourceware.org/ml/crossgcc/2004-12/msg00132.html
    6.21 +#
    6.22 +# Status:
    6.23 +#
    6.24 +# fixed in gcc >= 3.3.5
    6.25 +# backport of gcc-3.3.5 fix
    6.26 +#
    6.27 +diff -ruN gcc-2.95.3-orig/configure gcc-2.95.3/configure
    6.28 +--- gcc-2.95.3-orig/configure	1999-04-02 16:17:40.000000000 +0200
    6.29 ++++ gcc-2.95.3/configure	2005-04-20 18:25:45.030488235 +0200
    6.30 +@@ -687,7 +687,7 @@
    6.31 + if test -f skip-this-dir; then
    6.32 + 	# Perform the same cleanup as the trap handler, minus the "exit 1" of course,
    6.33 + 	# and reset the trap handler.
    6.34 +-	trap 0
    6.35 ++	trap '' 0
    6.36 + 	rm -f Makefile* ${tmpfile}.com ${tmpfile}.tgt ${tmpfile}.hst ${tmpfile}.pos
    6.37 + 	# Execute the final clean-up actions
    6.38 + 	${config_shell} skip-this-dir
    6.39 +@@ -1599,7 +1599,7 @@
    6.40 + # Perform the same cleanup as the trap handler, minus the "exit 1" of course,
    6.41 + # and reset the trap handler.
    6.42 + rm -f ${tmpfile}.com ${tmpfile}.tgt ${tmpfile}.hst ${tmpfile}.pos
    6.43 +-trap 0
    6.44 ++trap '' 0
    6.45 + 
    6.46 + exit 0
    6.47 + 
     7.1 --- a/patches/gcc/2.95.3/170-gcc-pr3106.patch	Mon Jul 28 20:17:48 2008 +0000
     7.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.3 @@ -1,28 +0,0 @@
     7.4 -See http://gcc.gnu.org/PR3106
     7.5 -Backported from gcc-3.0.x
     7.6 -
     7.7 -Fixes error
     7.8 -  .../binutils-2.11.2/libiberty/strerror.c:468: error: conflicting types for `sys_nerr'
     7.9 -  /usr/include/stdio.h:258: error: previous declaration of `sys_nerr'
    7.10 -  make[1]: *** [strerror.o] Error 1
    7.11 -  make: *** [all-libiberty] Error 2
    7.12 -on Mac OS X.
    7.13 -
    7.14 ---- gcc-2.95.3/libiberty/strerror.c.old	2004-03-24 16:23:19.000000000 -0800
    7.15 -+++ gcc-2.95.3/libiberty/strerror.c	2004-03-24 16:23:48.000000000 -0800
    7.16 -@@ -13,6 +13,7 @@
    7.17 -    incompatible with our later declaration, perhaps by using const
    7.18 -    attributes.  So we hide the declaration in errno.h (if any) using a
    7.19 -    macro. */
    7.20 -+#define sys_nerr sys_nerr__
    7.21 - #define sys_errlist sys_errlist__
    7.22 - #endif
    7.23 - 
    7.24 -@@ -20,6 +21,7 @@
    7.25 - #include <errno.h>
    7.26 - 
    7.27 - #ifdef HAVE_SYS_ERRLIST
    7.28 -+#undef sys_nerr
    7.29 - #undef sys_errlist
    7.30 - #endif
    7.31 - 
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/patches/gcc/2.95.3/170-pr3106.patch	Mon Jul 28 21:08:01 2008 +0000
     8.3 @@ -0,0 +1,28 @@
     8.4 +See http://gcc.gnu.org/PR3106
     8.5 +Backported from gcc-3.0.x
     8.6 +
     8.7 +Fixes error
     8.8 +  .../binutils-2.11.2/libiberty/strerror.c:468: error: conflicting types for `sys_nerr'
     8.9 +  /usr/include/stdio.h:258: error: previous declaration of `sys_nerr'
    8.10 +  make[1]: *** [strerror.o] Error 1
    8.11 +  make: *** [all-libiberty] Error 2
    8.12 +on Mac OS X.
    8.13 +
    8.14 +--- gcc-2.95.3/libiberty/strerror.c.old	2004-03-24 16:23:19.000000000 -0800
    8.15 ++++ gcc-2.95.3/libiberty/strerror.c	2004-03-24 16:23:48.000000000 -0800
    8.16 +@@ -13,6 +13,7 @@
    8.17 +    incompatible with our later declaration, perhaps by using const
    8.18 +    attributes.  So we hide the declaration in errno.h (if any) using a
    8.19 +    macro. */
    8.20 ++#define sys_nerr sys_nerr__
    8.21 + #define sys_errlist sys_errlist__
    8.22 + #endif
    8.23 + 
    8.24 +@@ -20,6 +21,7 @@
    8.25 + #include <errno.h>
    8.26 + 
    8.27 + #ifdef HAVE_SYS_ERRLIST
    8.28 ++#undef sys_nerr
    8.29 + #undef sys_errlist
    8.30 + #endif
    8.31 + 
     9.1 --- a/patches/gcc/3.2.3/110-gcc-20020722-ppc405erratum77.patch	Mon Jul 28 20:17:48 2008 +0000
     9.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.3 @@ -1,105 +0,0 @@
     9.4 -# See http://gcc.gnu.org/PR7383, http://www.kegel.com/xgcc3/ppc405erratum77.html
     9.5 -# Fixed in gcc-3.3
     9.6 -
     9.7 -diff -aur gcc-20020722.orig/gcc/config/rs6000/rs6000.h gcc-20020722/gcc/config/rs6000/rs6000.h
     9.8 ---- gcc-20020722.orig/gcc/config/rs6000/rs6000.h	Thu Jul 25 09:32:21 2002
     9.9 -+++ gcc-20020722/gcc/config/rs6000/rs6000.h	Thu Jul 25 09:34:45 2002
    9.10 -@@ -66,7 +66,7 @@
    9.11 - %{mcpu=rsc1: -D_ARCH_PWR} \
    9.12 - %{mcpu=401: -D_ARCH_PPC} \
    9.13 - %{mcpu=403: -D_ARCH_PPC} \
    9.14 --%{mcpu=405: -D_ARCH_PPC} \
    9.15 -+%{mcpu=405: -D_ARCH_PPC -D__PPC405__} \
    9.16 - %{mcpu=505: -D_ARCH_PPC} \
    9.17 - %{mcpu=601: -D_ARCH_PPC -D_ARCH_PWR} \
    9.18 - %{mcpu=602: -D_ARCH_PPC} \
    9.19 -diff -aur gcc-20020722.orig/libjava/sysdep/powerpc/locks.h gcc-20020722/libjava/sysdep/powerpc/locks.h
    9.20 ---- gcc-20020722.orig/libjava/sysdep/powerpc/locks.h	Thu Jul 25 09:32:30 2002
    9.21 -+++ gcc-20020722/libjava/sysdep/powerpc/locks.h	Thu Jul 25 11:39:13 2002
    9.22 -@@ -11,6 +11,17 @@
    9.23 - #ifndef __SYSDEP_LOCKS_H__
    9.24 - #define __SYSDEP_LOCKS_H__
    9.25 - 
    9.26 -+#ifdef __PPC405__
    9.27 -+// workaround for PPC405 erratum #77 - 07/18/02 JRO, dank, NN.  References:
    9.28 -+// http://www-3.ibm.com/chips/techlib/techlib.nsf/techdocs/89DED00DEBFF54BF87256A8000491BA2/$file/405CR_C_errata_1_2.pdf
    9.29 -+// http://ppc.bkbits.net:8080/linuxppc_2_4_devel/cset@1.489
    9.30 -+// http://www.kegel.com/xgcc3/ppc405erratum77.html
    9.31 -+// FIXME: using dbct instead of sync would be faster
    9.32 -+#define __LIBGCJ_PPC405_ERR77_SYNC   "sync \n\t"
    9.33 -+#else
    9.34 -+#define __LIBGCJ_PPC405_ERR77_SYNC
    9.35 -+#endif
    9.36 -+
    9.37 - typedef size_t obj_addr_t;	/* Integer type big enough for object	*/
    9.38 - 				/* address.				*/
    9.39 - 
    9.40 -@@ -25,6 +36,7 @@
    9.41 - 	   "0:    lwarx %0,0,%1 ;"
    9.42 - 	   "      xor. %0,%3,%0;"
    9.43 - 	   "      bne 1f;"
    9.44 -+  	  __LIBGCJ_PPC405_ERR77_SYNC
    9.45 - 	   "      stwcx. %2,0,%1;"
    9.46 - 	   "      bne- 0b;"
    9.47 - 	   "1:    "
    9.48 -@@ -58,6 +70,7 @@
    9.49 - 	   "0:    lwarx %0,0,%1 ;"
    9.50 - 	   "      xor. %0,%3,%0;"
    9.51 - 	   "      bne 1f;"
    9.52 -+	   __LIBGCJ_PPC405_ERR77_SYNC	 
    9.53 - 	   "      stwcx. %2,0,%1;"
    9.54 - 	   "      bne- 0b;"
    9.55 - 	   "1:    "
    9.56 -diff -aur gcc-20020722.orig/libstdc++-v3/config/cpu/powerpc/bits/atomicity.h gcc-20020722/libstdc++-v3/config/cpu/powerpc/bits/atomicity.h
    9.57 ---- gcc-20020722.orig/libstdc++-v3/config/cpu/powerpc/bits/atomicity.h	Thu Jul 25 09:32:31 2002
    9.58 -+++ gcc-20020722/libstdc++-v3/config/cpu/powerpc/bits/atomicity.h	Thu Jul 25 09:34:45 2002
    9.59 -@@ -32,6 +32,17 @@
    9.60 - 
    9.61 - typedef int _Atomic_word;
    9.62 - 
    9.63 -+#ifdef __PPC405__
    9.64 -+// workaround for PPC405 erratum #77 - 07/18/02 JRO & dank.  References:
    9.65 -+// http://www-3.ibm.com/chips/techlib/techlib.nsf/techdocs/89DED00DEBFF54BF87256A8000491BA2/$file/405CR_C_errata_1_2.pdf
    9.66 -+// http://ppc.bkbits.net:8080/linuxppc_2_4_devel/cset@1.489
    9.67 -+// http://www.kegel.com/xgcc3/ppc405erratum77.html
    9.68 -+// FIXME: using dbct instead of sync would be faster
    9.69 -+#define	__LIBSTDCPP_PPC405_ERR77_SYNC	"sync \n\t"
    9.70 -+#else
    9.71 -+#define __LIBSTDCPP_PPC405_ERR77_SYNC
    9.72 -+#endif
    9.73 -+
    9.74 - static inline _Atomic_word
    9.75 - __attribute__ ((__unused__))
    9.76 - __exchange_and_add (volatile _Atomic_word* __mem, int __val)
    9.77 -@@ -42,6 +53,7 @@
    9.78 - 	"0:\t"
    9.79 - 	"lwarx    %0,0,%2 \n\t"
    9.80 - 	"add%I3   %1,%0,%3 \n\t"
    9.81 -+	__LIBSTDCPP_PPC405_ERR77_SYNC
    9.82 - 	"stwcx.   %1,0,%2 \n\t"
    9.83 - 	"bne-     0b \n\t"
    9.84 - 	"/* End exchange & add */"
    9.85 -@@ -61,6 +73,7 @@
    9.86 - 	"0:\t"
    9.87 - 	"lwarx    %0,0,%1 \n\t"
    9.88 - 	"add%I2   %0,%0,%2 \n\t"
    9.89 -+	__LIBSTDCPP_PPC405_ERR77_SYNC
    9.90 - 	"stwcx.   %0,0,%1 \n\t"
    9.91 - 	"bne-     0b \n\t"
    9.92 - 	"/* End atomic add */"
    9.93 -@@ -78,6 +91,7 @@
    9.94 - 	"/* Inline always swap */\n"
    9.95 - 	"0:\t"
    9.96 - 	"lwarx    %0,0,%1 \n\t"
    9.97 -+	__LIBSTDCPP_PPC405_ERR77_SYNC
    9.98 - 	"stwcx.   %2,0,%1 \n\t"
    9.99 - 	"bne-     0b \n\t"
   9.100 - 	"/* End always swap */"
   9.101 -@@ -98,6 +112,7 @@
   9.102 - 	"lwarx    %0,0,%1 \n\t"
   9.103 - 	"cmpwi    %0,0 \n\t"
   9.104 - 	"bne-     1f \n\t"
   9.105 -+	__LIBSTDCPP_PPC405_ERR77_SYNC
   9.106 - 	"stwcx.   %2,0,%1 \n\t"
   9.107 - 	"bne-     0b \n"
   9.108 - 	"1:\n\t"
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/patches/gcc/3.2.3/110-ppc405erratum77.patch	Mon Jul 28 21:08:01 2008 +0000
    10.3 @@ -0,0 +1,105 @@
    10.4 +# See http://gcc.gnu.org/PR7383, http://www.kegel.com/xgcc3/ppc405erratum77.html
    10.5 +# Fixed in gcc-3.3
    10.6 +
    10.7 +diff -aur gcc-20020722.orig/gcc/config/rs6000/rs6000.h gcc-20020722/gcc/config/rs6000/rs6000.h
    10.8 +--- gcc-20020722.orig/gcc/config/rs6000/rs6000.h	Thu Jul 25 09:32:21 2002
    10.9 ++++ gcc-20020722/gcc/config/rs6000/rs6000.h	Thu Jul 25 09:34:45 2002
   10.10 +@@ -66,7 +66,7 @@
   10.11 + %{mcpu=rsc1: -D_ARCH_PWR} \
   10.12 + %{mcpu=401: -D_ARCH_PPC} \
   10.13 + %{mcpu=403: -D_ARCH_PPC} \
   10.14 +-%{mcpu=405: -D_ARCH_PPC} \
   10.15 ++%{mcpu=405: -D_ARCH_PPC -D__PPC405__} \
   10.16 + %{mcpu=505: -D_ARCH_PPC} \
   10.17 + %{mcpu=601: -D_ARCH_PPC -D_ARCH_PWR} \
   10.18 + %{mcpu=602: -D_ARCH_PPC} \
   10.19 +diff -aur gcc-20020722.orig/libjava/sysdep/powerpc/locks.h gcc-20020722/libjava/sysdep/powerpc/locks.h
   10.20 +--- gcc-20020722.orig/libjava/sysdep/powerpc/locks.h	Thu Jul 25 09:32:30 2002
   10.21 ++++ gcc-20020722/libjava/sysdep/powerpc/locks.h	Thu Jul 25 11:39:13 2002
   10.22 +@@ -11,6 +11,17 @@
   10.23 + #ifndef __SYSDEP_LOCKS_H__
   10.24 + #define __SYSDEP_LOCKS_H__
   10.25 + 
   10.26 ++#ifdef __PPC405__
   10.27 ++// workaround for PPC405 erratum #77 - 07/18/02 JRO, dank, NN.  References:
   10.28 ++// http://www-3.ibm.com/chips/techlib/techlib.nsf/techdocs/89DED00DEBFF54BF87256A8000491BA2/$file/405CR_C_errata_1_2.pdf
   10.29 ++// http://ppc.bkbits.net:8080/linuxppc_2_4_devel/cset@1.489
   10.30 ++// http://www.kegel.com/xgcc3/ppc405erratum77.html
   10.31 ++// FIXME: using dbct instead of sync would be faster
   10.32 ++#define __LIBGCJ_PPC405_ERR77_SYNC   "sync \n\t"
   10.33 ++#else
   10.34 ++#define __LIBGCJ_PPC405_ERR77_SYNC
   10.35 ++#endif
   10.36 ++
   10.37 + typedef size_t obj_addr_t;	/* Integer type big enough for object	*/
   10.38 + 				/* address.				*/
   10.39 + 
   10.40 +@@ -25,6 +36,7 @@
   10.41 + 	   "0:    lwarx %0,0,%1 ;"
   10.42 + 	   "      xor. %0,%3,%0;"
   10.43 + 	   "      bne 1f;"
   10.44 ++  	  __LIBGCJ_PPC405_ERR77_SYNC
   10.45 + 	   "      stwcx. %2,0,%1;"
   10.46 + 	   "      bne- 0b;"
   10.47 + 	   "1:    "
   10.48 +@@ -58,6 +70,7 @@
   10.49 + 	   "0:    lwarx %0,0,%1 ;"
   10.50 + 	   "      xor. %0,%3,%0;"
   10.51 + 	   "      bne 1f;"
   10.52 ++	   __LIBGCJ_PPC405_ERR77_SYNC	 
   10.53 + 	   "      stwcx. %2,0,%1;"
   10.54 + 	   "      bne- 0b;"
   10.55 + 	   "1:    "
   10.56 +diff -aur gcc-20020722.orig/libstdc++-v3/config/cpu/powerpc/bits/atomicity.h gcc-20020722/libstdc++-v3/config/cpu/powerpc/bits/atomicity.h
   10.57 +--- gcc-20020722.orig/libstdc++-v3/config/cpu/powerpc/bits/atomicity.h	Thu Jul 25 09:32:31 2002
   10.58 ++++ gcc-20020722/libstdc++-v3/config/cpu/powerpc/bits/atomicity.h	Thu Jul 25 09:34:45 2002
   10.59 +@@ -32,6 +32,17 @@
   10.60 + 
   10.61 + typedef int _Atomic_word;
   10.62 + 
   10.63 ++#ifdef __PPC405__
   10.64 ++// workaround for PPC405 erratum #77 - 07/18/02 JRO & dank.  References:
   10.65 ++// http://www-3.ibm.com/chips/techlib/techlib.nsf/techdocs/89DED00DEBFF54BF87256A8000491BA2/$file/405CR_C_errata_1_2.pdf
   10.66 ++// http://ppc.bkbits.net:8080/linuxppc_2_4_devel/cset@1.489
   10.67 ++// http://www.kegel.com/xgcc3/ppc405erratum77.html
   10.68 ++// FIXME: using dbct instead of sync would be faster
   10.69 ++#define	__LIBSTDCPP_PPC405_ERR77_SYNC	"sync \n\t"
   10.70 ++#else
   10.71 ++#define __LIBSTDCPP_PPC405_ERR77_SYNC
   10.72 ++#endif
   10.73 ++
   10.74 + static inline _Atomic_word
   10.75 + __attribute__ ((__unused__))
   10.76 + __exchange_and_add (volatile _Atomic_word* __mem, int __val)
   10.77 +@@ -42,6 +53,7 @@
   10.78 + 	"0:\t"
   10.79 + 	"lwarx    %0,0,%2 \n\t"
   10.80 + 	"add%I3   %1,%0,%3 \n\t"
   10.81 ++	__LIBSTDCPP_PPC405_ERR77_SYNC
   10.82 + 	"stwcx.   %1,0,%2 \n\t"
   10.83 + 	"bne-     0b \n\t"
   10.84 + 	"/* End exchange & add */"
   10.85 +@@ -61,6 +73,7 @@
   10.86 + 	"0:\t"
   10.87 + 	"lwarx    %0,0,%1 \n\t"
   10.88 + 	"add%I2   %0,%0,%2 \n\t"
   10.89 ++	__LIBSTDCPP_PPC405_ERR77_SYNC
   10.90 + 	"stwcx.   %0,0,%1 \n\t"
   10.91 + 	"bne-     0b \n\t"
   10.92 + 	"/* End atomic add */"
   10.93 +@@ -78,6 +91,7 @@
   10.94 + 	"/* Inline always swap */\n"
   10.95 + 	"0:\t"
   10.96 + 	"lwarx    %0,0,%1 \n\t"
   10.97 ++	__LIBSTDCPP_PPC405_ERR77_SYNC
   10.98 + 	"stwcx.   %2,0,%1 \n\t"
   10.99 + 	"bne-     0b \n\t"
  10.100 + 	"/* End always swap */"
  10.101 +@@ -98,6 +112,7 @@
  10.102 + 	"lwarx    %0,0,%1 \n\t"
  10.103 + 	"cmpwi    %0,0 \n\t"
  10.104 + 	"bne-     1f \n\t"
  10.105 ++	__LIBSTDCPP_PPC405_ERR77_SYNC
  10.106 + 	"stwcx.   %2,0,%1 \n\t"
  10.107 + 	"bne-     0b \n"
  10.108 + 	"1:\n\t"
    11.1 --- a/patches/gcc/3.2.3/120-gcc-20030210-sh-linux-1.patch	Mon Jul 28 20:17:48 2008 +0000
    11.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.3 @@ -1,1761 +0,0 @@
    11.4 -diff -ruN gcc-20030210.orig/boehm-gc/configure gcc-20030210/boehm-gc/configure
    11.5 ---- gcc-20030210.orig/boehm-gc/configure	Fri Jan 31 19:17:00 2003
    11.6 -+++ gcc-20030210/boehm-gc/configure	Sat Feb 22 01:40:14 2003
    11.7 -@@ -1922,7 +1922,7 @@
    11.8 - # This must be Linux ELF.
    11.9 - linux-gnu*)
   11.10 -   case $host_cpu in
   11.11 --  alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* )
   11.12 -+  alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | sh* )
   11.13 -     lt_cv_deplibs_check_method=pass_all ;;
   11.14 -   *)
   11.15 -     # glibc up to 2.1.1 does not perform some relocations on ARM
   11.16 -diff -ruN gcc-20030210.orig/config-ml.in gcc-20030210/config-ml.in
   11.17 ---- gcc-20030210.orig/config-ml.in	Fri Jan 31 19:16:59 2003
   11.18 -+++ gcc-20030210/config-ml.in	Sat Feb 22 01:40:14 2003
   11.19 -@@ -545,6 +545,7 @@
   11.20 - 	      if [ -d ../$${dir}/$${lib} ]; then \
   11.21 - 		flags=`echo $$i | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; \
   11.22 - 		if (cd ../$${dir}/$${lib}; $(MAKE) $(FLAGS_TO_PASS) \
   11.23 -+				DESTDIR="$(DESTDIR)" \
   11.24 - 				CFLAGS="$(CFLAGS) $${flags}" \
   11.25 - 				prefix="$(prefix)" \
   11.26 - 				exec_prefix="$(exec_prefix)" \
   11.27 -diff -ruN gcc-20030210.orig/debian/edit-specs.in gcc-20030210/debian/edit-specs.in
   11.28 ---- gcc-20030210.orig/debian/edit-specs.in	Thu Jan  1 09:00:00 1970
   11.29 -+++ gcc-20030210/debian/edit-specs.in	Sat Feb 22 01:40:14 2003
   11.30 -@@ -0,0 +1,45 @@
   11.31 -+/^*asm:$/ {
   11.32 -+n
   11.33 -+c\
   11.34 -+@AS_ENDIAN_FLAG@ %{mrelax:-relax}
   11.35 -+}
   11.36 -+/^*cpp:$/ {
   11.37 -+n
   11.38 -+c\
   11.39 -+%(cpp_default_cpu_spec)    %(subtarget_cpp_spec)    %(subtarget_cpp_ptr_spec)    %(subtarget_cpp_endian_spec)
   11.40 -+}
   11.41 -+/^*cc1:$/ {
   11.42 -+n
   11.43 -+c\
   11.44 -+-musermode @CC1_CPU_ENDIAN_FLAGS@  %{profile:-p}
   11.45 -+}
   11.46 -+/^*link:$/ {
   11.47 -+n
   11.48 -+c\
   11.49 -+%{!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}
   11.50 -+}
   11.51 -+/^*multilib:$/ {
   11.52 -+n
   11.53 -+c\
   11.54 -+. ;
   11.55 -+}
   11.56 -+/^*multilib_matches:$/ {
   11.57 -+n
   11.58 -+c\
   11.59 -+
   11.60 -+}
   11.61 -+/^*multilib_options:$/ {
   11.62 -+n
   11.63 -+c\
   11.64 -+
   11.65 -+}
   11.66 -+/^*subtarget_cpp_endian_spec:$/ {
   11.67 -+n
   11.68 -+c\
   11.69 -+@CPP_ENDIAN_DEF@
   11.70 -+}
   11.71 -+/^*cpp_default_cpu_spec:$/ {
   11.72 -+n
   11.73 -+c\
   11.74 -+@CPP_CPU_DEFS@
   11.75 -+}
   11.76 -diff -ruN gcc-20030210.orig/debian/install-CPU-linux gcc-20030210/debian/install-CPU-linux
   11.77 ---- gcc-20030210.orig/debian/install-CPU-linux	Thu Jan  1 09:00:00 1970
   11.78 -+++ gcc-20030210/debian/install-CPU-linux	Sat Feb 22 01:40:14 2003
   11.79 -@@ -0,0 +1,111 @@
   11.80 -+#! /bin/sh
   11.81 -+
   11.82 -+VERSION=$1; shift
   11.83 -+CPU=$1
   11.84 -+
   11.85 -+# literally (binary-ly) same
   11.86 -+PROGS_C="cpp gcc"
   11.87 -+PROGS_ADDITIONAL="c++ g++ g77 gcj"
   11.88 -+
   11.89 -+DRIVERS_C="cc1 cpp0 tradcpp0"
   11.90 -+DRIVERS_ADDITIONAL="cc1obj cc1plus collect2 f771 jc1 jvgenmain"
   11.91 -+if [ -z "$STEP1_COMPILER_BUILD" ]; then
   11.92 -+  PROGS="$PROGS_C $PROGS_ADDITIONAL"
   11.93 -+  DRIVERS="$DRIVERS_C $DRIVERSADDITIONAL"
   11.94 -+  INITIAL=""
   11.95 -+else
   11.96 -+  PROGS=$PROGS_C
   11.97 -+  DRIVERS=$DRIVERS_C
   11.98 -+  INITIAL="-initial"
   11.99 -+fi
  11.100 -+
  11.101 -+OBJS="crtbegin.o crtbeginS.o crtend.o crtendS.o"
  11.102 -+LIBS_C="libgcc.a"
  11.103 -+LIBS_1="libgcc_s.so libgcc_s.so.1 libstdc++.so libstdc++.so.3 libstdc++.so.3.0.2"
  11.104 -+LIBS_2="libobjc.a libstdc++.a libsupc++.a"
  11.105 -+INCLUDE="include"
  11.106 -+
  11.107 -+cd debian/gcc-sh-linux-others${INITIAL} || exit 1
  11.108 -+
  11.109 -+# Make directories.
  11.110 -+mkdir -p usr/bin usr/share usr/share/man usr/share/man/man1 usr/lib \
  11.111 -+	 usr/lib/gcc-lib usr/lib/gcc-lib/${CPU}-linux \
  11.112 -+	 usr/lib/gcc-lib/${CPU}-linux/${VERSION} \
  11.113 -+	 usr/${CPU}-linux usr/${CPU}-linux/lib
  11.114 -+
  11.115 -+# Make symbolic links for include dir.
  11.116 -+(cd usr/${CPU}-linux; ln -s ../sh-linux/include .)
  11.117 -+
  11.118 -+# Make symbolic links for executables.
  11.119 -+(cd usr/bin;
  11.120 -+  for p in ${PROGS}; do
  11.121 -+    ln -s shCPU-linux-GCC ${CPU}-linux-$p
  11.122 -+  done)
  11.123 -+
  11.124 -+case "${CPU}" in
  11.125 -+    sh3)
  11.126 -+	MULTILIBDIR=
  11.127 -+	AS_ENDIAN_FLAG="-little"
  11.128 -+	CPP_ENDIAN_DEF="-D__LITTLE_ENDIAN__"
  11.129 -+	CPP_CPU_DEFS="-D__SH3__ -D__sh3__"
  11.130 -+	CC1_CPU_ENDIAN_FLAGS="-ml -m3"
  11.131 -+	LINKER_CPU_ENDIAN_FLAGS="-m shlelf_linux -EL --architecture sh3"
  11.132 -+	LINKER_RPATH_LINK_FLAG="-rpath-link /usr/sh3-linux/lib"
  11.133 -+    ;;
  11.134 -+    sh3eb)
  11.135 -+	MULTILIBDIR=/mb
  11.136 -+	AS_ENDIAN_FLAG="-big"
  11.137 -+	CPP_ENDIAN_DEF="-D__BIG_ENDIAN__"
  11.138 -+	CPP_CPU_DEFS="-D__SH3__ -D__sh3__"
  11.139 -+	CC1_CPU_ENDIAN_FLAGS="-mb -m3"
  11.140 -+	LINKER_CPU_ENDIAN_FLAGS="-m shelf_linux -EB --architecture sh3"
  11.141 -+	LINKER_RPATH_LINK_FLAG="-rpath-link /usr/sh3eb-linux/lib"
  11.142 -+    ;;
  11.143 -+    sh4)
  11.144 -+	MULTILIBDIR=/m4
  11.145 -+	AS_ENDIAN_FLAG="-little"
  11.146 -+	CPP_ENDIAN_DEF="-D__LITTLE_ENDIAN__"
  11.147 -+	CPP_CPU_DEFS="-D__SH4__"
  11.148 -+	CC1_CPU_ENDIAN_FLAGS="-ml -m4"
  11.149 -+	LINKER_CPU_ENDIAN_FLAGS="-m shlelf_linux -EL --architecture sh4"
  11.150 -+	LINKER_RPATH_LINK_FLAG="-rpath-link /usr/sh4-linux/lib"
  11.151 -+    ;;
  11.152 -+    sh4eb)
  11.153 -+	MULTILIBDIR=/mb/m4
  11.154 -+	AS_ENDIAN_FLAG="-big"
  11.155 -+	CPP_ENDIAN_DEF="-D__BIG_ENDIAN__"
  11.156 -+	CPP_CPU_DEFS="-D__SH4__"
  11.157 -+	CC1_CPU_ENDIAN_FLAGS="-mb -m4"
  11.158 -+	LINKER_CPU_ENDIAN_FLAGS="-m shelf_linux -EB --architecture sh4"
  11.159 -+	LINKER_RPATH_LINK_FLAG="-rpath-link /usr/sh4eb-linux/lib"
  11.160 -+    ;;
  11.161 -+esac
  11.162 -+
  11.163 -+# Make symbolic links for GCC drivers, objects, libraries, and include dir.
  11.164 -+(cd usr/lib/gcc-lib/${CPU}-linux/${VERSION};
  11.165 -+ for f in ${DRIVERS} ${INCLUDE}; do
  11.166 -+    ln -s ../../sh-linux/${VERSION}/$f $f;
  11.167 -+ done
  11.168 -+ for f in ${OBJS} ${LIBS_C}; do
  11.169 -+    ln -s ../../sh-linux/${VERSION}${MULTILIBDIR}/$f $f;
  11.170 -+ done)
  11.171 -+
  11.172 -+if [ -z "$STEP1_COMPILER_BUILD" ]; then
  11.173 -+  for f in ${LIBS_1} ${LIBS_2}; do
  11.174 -+    mv ../gcc-sh-linux/usr/sh-linux/lib${MULTILIBDIR}/$f usr/${CPU}-linux/lib/;
  11.175 -+  done
  11.176 -+fi
  11.177 -+
  11.178 -+sed -e "s+@AS_ENDIAN_FLAG@+${AS_ENDIAN_FLAG}+" \
  11.179 -+    -e "s+@CPP_ENDIAN_DEF@+${CPP_ENDIAN_DEF}+" \
  11.180 -+    -e "s+@CPP_CPU_DEFS@+${CPP_CPU_DEFS}+" \
  11.181 -+    -e "s+@CC1_CPU_ENDIAN_FLAGS@+${CC1_CPU_ENDIAN_FLAGS}+" \
  11.182 -+    -e "s+@LINKER_CPU_ENDIAN_FLAGS@+${LINKER_CPU_ENDIAN_FLAGS}+" \
  11.183 -+    -e "s+@LINKER_RPATH_LINK_FLAG@+${LINKER_RPATH_LINK_FLAG}+" \
  11.184 -+    ../edit-specs.in >../edit-specs-${CPU}.sed
  11.185 -+
  11.186 -+sed -f ../edit-specs-${CPU}.sed \
  11.187 -+    ../gcc-sh-linux${INITIAL}/usr/lib/gcc-lib/sh-linux/${VERSION}/specs \
  11.188 -+    > usr/lib/gcc-lib/${CPU}-linux/${VERSION}/specs
  11.189 -+
  11.190 -+exit 0
  11.191 -diff -ruN gcc-20030210.orig/debian/multilib-symlink gcc-20030210/debian/multilib-symlink
  11.192 ---- gcc-20030210.orig/debian/multilib-symlink	Thu Jan  1 09:00:00 1970
  11.193 -+++ gcc-20030210/debian/multilib-symlink	Sat Feb 22 01:40:14 2003
  11.194 -@@ -0,0 +1,10 @@
  11.195 -+#! /bin/sh
  11.196 -+
  11.197 -+cd /usr/sh-linux/lib
  11.198 -+ln -s ../../sh3-linux/lib/{*.a,*.so*,*.o} .
  11.199 -+cd m4
  11.200 -+ln -s ../../../sh4-linux/lib/{*.a,*.so*,*.o} .
  11.201 -+cd ../mb
  11.202 -+ln -s ../../../sh3eb-linux/lib/{*.a,*.so*,*.o} .
  11.203 -+cd m4
  11.204 -+ln -s ../../../../sh4eb-linux/lib/{*.a,*.so*,*.o} .
  11.205 -diff -ruN gcc-20030210.orig/debian/shCPU-linux-GCC gcc-20030210/debian/shCPU-linux-GCC
  11.206 ---- gcc-20030210.orig/debian/shCPU-linux-GCC	Thu Jan  1 09:00:00 1970
  11.207 -+++ gcc-20030210/debian/shCPU-linux-GCC	Sat Feb 22 01:40:14 2003
  11.208 -@@ -0,0 +1,59 @@
  11.209 -+#! /bin/bash
  11.210 -+
  11.211 -+BASENAME=${0##*/}
  11.212 -+PROG=${BASENAME##*-}
  11.213 -+CPU=${BASENAME%%-*}
  11.214 -+
  11.215 -+if [ "$PROG" = gcc ]; then
  11.216 -+    if [ "$1" = "-b" -a "$2" = "i386-linux" ]; then
  11.217 -+	shift 2
  11.218 -+	exec /usr/bin/gcc "$@"
  11.219 -+    elif [ "$1" = "-print-multi-lib" -o "$1" = "--print-multi-lib" ]; then
  11.220 -+	echo ".;"
  11.221 -+	exit 0
  11.222 -+    elif [ "$1" = "-print-multi-os-directory" -o "$1" = "--print-multi-os-directory" ]; then
  11.223 -+	echo "."
  11.224 -+	exit 0
  11.225 -+    elif [ "$1" = "-dumpspecs" ]; then
  11.226 -+	cat /usr/lib/gcc-lib/${CPU}-linux/@@VERSION@@/specs
  11.227 -+	exit 0
  11.228 -+    fi
  11.229 -+fi
  11.230 -+
  11.231 -+case "${CPU}" in
  11.232 -+    sh3)
  11.233 -+	ARCH=m3
  11.234 -+	DEFINES="-D__sh3__ -D__SH3__ -D__LITTLE_ENDIAN__"
  11.235 -+	ENDIAN=ml
  11.236 -+    ;;
  11.237 -+    sh3eb)
  11.238 -+	ARCH=m3
  11.239 -+	DEFINES="-D__sh3__ -D__SH3__ -D__BIG_ENDIAN__"
  11.240 -+	ENDIAN=mb
  11.241 -+    ;;
  11.242 -+    sh4)
  11.243 -+	ARCH=m4
  11.244 -+	DEFINES="-D__SH4__ -D__LITTLE_ENDIAN__"
  11.245 -+	ENDIAN=ml
  11.246 -+    ;;
  11.247 -+    sh4eb)
  11.248 -+	ARCH=m4
  11.249 -+	DEFINES="-D__SH4__ -D__BIG_ENDIAN__"
  11.250 -+	ENDIAN=mb
  11.251 -+    ;;
  11.252 -+esac
  11.253 -+
  11.254 -+# Prepend the appropriate options
  11.255 -+# If user specifies some options, it will be overridden
  11.256 -+
  11.257 -+case "${PROG}" in
  11.258 -+    cpp)
  11.259 -+	exec sh-linux-${PROG} $DEFINES "$@"
  11.260 -+    ;;
  11.261 -+    c++|g++|g77|gcc|gcj)
  11.262 -+	exec sh-linux-${PROG} -$ARCH -$ENDIAN "$@"
  11.263 -+    ;;
  11.264 -+esac
  11.265 -+
  11.266 -+echo "Something wrong..."
  11.267 -+exit 1
  11.268 -diff -ruN gcc-20030210.orig/gcc/config/sh/elf.h gcc-20030210/gcc/config/sh/elf.h
  11.269 ---- gcc-20030210.orig/gcc/config/sh/elf.h	Fri Feb 22 01:42:28 2002
  11.270 -+++ gcc-20030210/gcc/config/sh/elf.h	Sat Feb 22 01:40:14 2003
  11.271 -@@ -170,3 +170,7 @@
  11.272 - #undef ENDFILE_SPEC
  11.273 - #define ENDFILE_SPEC \
  11.274 -   "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
  11.275 -+
  11.276 -+/* ASM_OUTPUT_CASE_LABEL is defined in elfos.h.  With it, 
  11.277 -+   redundant .align will be generated.  */
  11.278 -+#undef  ASM_OUTPUT_CASE_LABEL
  11.279 -diff -ruN gcc-20030210.orig/gcc/config/sh/lib1funcs.asm gcc-20030210/gcc/config/sh/lib1funcs.asm
  11.280 ---- gcc-20030210.orig/gcc/config/sh/lib1funcs.asm	Fri Feb 22 01:42:28 2002
  11.281 -+++ gcc-20030210/gcc/config/sh/lib1funcs.asm	Sat Feb 22 01:40:14 2003
  11.282 -@@ -39,8 +39,13 @@
  11.283 - 
  11.284 - #ifdef __ELF__
  11.285 - #define LOCAL(X) .L_##X
  11.286 -+#define FUNC(X) .type X,@function; .hidden X
  11.287 -+#define _ENDFUNC(X) .Lfe_##X: .size X,.Lfe_##X-X
  11.288 -+#define ENDFUNC(X) _ENDFUNC(X)
  11.289 - #else
  11.290 - #define LOCAL(X) L_##X
  11.291 -+#define FUNC(X)
  11.292 -+#define ENDFUNC(X)
  11.293 - #endif
  11.294 - 
  11.295 - #ifdef __linux__
  11.296 -@@ -91,6 +96,40 @@
  11.297 - 	.global	GLOBAL(ashiftrt_r4_31)
  11.298 - 	.global	GLOBAL(ashiftrt_r4_32)
  11.299 - 
  11.300 -+	FUNC(GLOBAL(ashiftrt_r4_0))
  11.301 -+	FUNC(GLOBAL(ashiftrt_r4_1))
  11.302 -+	FUNC(GLOBAL(ashiftrt_r4_2))
  11.303 -+	FUNC(GLOBAL(ashiftrt_r4_3))
  11.304 -+	FUNC(GLOBAL(ashiftrt_r4_4))
  11.305 -+	FUNC(GLOBAL(ashiftrt_r4_5))
  11.306 -+	FUNC(GLOBAL(ashiftrt_r4_6))
  11.307 -+	FUNC(GLOBAL(ashiftrt_r4_7))
  11.308 -+	FUNC(GLOBAL(ashiftrt_r4_8))
  11.309 -+	FUNC(GLOBAL(ashiftrt_r4_9))
  11.310 -+	FUNC(GLOBAL(ashiftrt_r4_10))
  11.311 -+	FUNC(GLOBAL(ashiftrt_r4_11))
  11.312 -+	FUNC(GLOBAL(ashiftrt_r4_12))
  11.313 -+	FUNC(GLOBAL(ashiftrt_r4_13))
  11.314 -+	FUNC(GLOBAL(ashiftrt_r4_14))
  11.315 -+	FUNC(GLOBAL(ashiftrt_r4_15))
  11.316 -+	FUNC(GLOBAL(ashiftrt_r4_16))
  11.317 -+	FUNC(GLOBAL(ashiftrt_r4_17))
  11.318 -+	FUNC(GLOBAL(ashiftrt_r4_18))
  11.319 -+	FUNC(GLOBAL(ashiftrt_r4_19))
  11.320 -+	FUNC(GLOBAL(ashiftrt_r4_20))
  11.321 -+	FUNC(GLOBAL(ashiftrt_r4_21))
  11.322 -+	FUNC(GLOBAL(ashiftrt_r4_22))
  11.323 -+	FUNC(GLOBAL(ashiftrt_r4_23))
  11.324 -+	FUNC(GLOBAL(ashiftrt_r4_24))
  11.325 -+	FUNC(GLOBAL(ashiftrt_r4_25))
  11.326 -+	FUNC(GLOBAL(ashiftrt_r4_26))
  11.327 -+	FUNC(GLOBAL(ashiftrt_r4_27))
  11.328 -+	FUNC(GLOBAL(ashiftrt_r4_28))
  11.329 -+	FUNC(GLOBAL(ashiftrt_r4_29))
  11.330 -+	FUNC(GLOBAL(ashiftrt_r4_30))
  11.331 -+	FUNC(GLOBAL(ashiftrt_r4_31))
  11.332 -+	FUNC(GLOBAL(ashiftrt_r4_32))
  11.333 -+
  11.334 - 	.align	1
  11.335 - GLOBAL(ashiftrt_r4_32):
  11.336 - GLOBAL(ashiftrt_r4_31):
  11.337 -@@ -170,6 +209,41 @@
  11.338 - GLOBAL(ashiftrt_r4_0):
  11.339 - 	rts
  11.340 - 	nop
  11.341 -+
  11.342 -+	ENDFUNC(GLOBAL(ashiftrt_r4_0))
  11.343 -+	ENDFUNC(GLOBAL(ashiftrt_r4_1))
  11.344 -+	ENDFUNC(GLOBAL(ashiftrt_r4_2))
  11.345 -+	ENDFUNC(GLOBAL(ashiftrt_r4_3))
  11.346 -+	ENDFUNC(GLOBAL(ashiftrt_r4_4))
  11.347 -+	ENDFUNC(GLOBAL(ashiftrt_r4_5))
  11.348 -+	ENDFUNC(GLOBAL(ashiftrt_r4_6))
  11.349 -+	ENDFUNC(GLOBAL(ashiftrt_r4_7))
  11.350 -+	ENDFUNC(GLOBAL(ashiftrt_r4_8))
  11.351 -+	ENDFUNC(GLOBAL(ashiftrt_r4_9))
  11.352 -+	ENDFUNC(GLOBAL(ashiftrt_r4_10))
  11.353 -+	ENDFUNC(GLOBAL(ashiftrt_r4_11))
  11.354 -+	ENDFUNC(GLOBAL(ashiftrt_r4_12))
  11.355 -+	ENDFUNC(GLOBAL(ashiftrt_r4_13))
  11.356 -+	ENDFUNC(GLOBAL(ashiftrt_r4_14))
  11.357 -+	ENDFUNC(GLOBAL(ashiftrt_r4_15))
  11.358 -+	ENDFUNC(GLOBAL(ashiftrt_r4_16))
  11.359 -+	ENDFUNC(GLOBAL(ashiftrt_r4_17))
  11.360 -+	ENDFUNC(GLOBAL(ashiftrt_r4_18))
  11.361 -+	ENDFUNC(GLOBAL(ashiftrt_r4_19))
  11.362 -+	ENDFUNC(GLOBAL(ashiftrt_r4_20))
  11.363 -+	ENDFUNC(GLOBAL(ashiftrt_r4_21))
  11.364 -+	ENDFUNC(GLOBAL(ashiftrt_r4_22))
  11.365 -+	ENDFUNC(GLOBAL(ashiftrt_r4_23))
  11.366 -+	ENDFUNC(GLOBAL(ashiftrt_r4_24))
  11.367 -+	ENDFUNC(GLOBAL(ashiftrt_r4_25))
  11.368 -+	ENDFUNC(GLOBAL(ashiftrt_r4_26))
  11.369 -+	ENDFUNC(GLOBAL(ashiftrt_r4_27))
  11.370 -+	ENDFUNC(GLOBAL(ashiftrt_r4_28))
  11.371 -+	ENDFUNC(GLOBAL(ashiftrt_r4_29))
  11.372 -+	ENDFUNC(GLOBAL(ashiftrt_r4_30))
  11.373 -+	ENDFUNC(GLOBAL(ashiftrt_r4_31))
  11.374 -+	ENDFUNC(GLOBAL(ashiftrt_r4_32))
  11.375 -+
  11.376 - #endif
  11.377 - 
  11.378 - #ifdef L_ashiftrt_n
  11.379 -@@ -192,6 +266,7 @@
  11.380 - !
  11.381 - 
  11.382 - 	.global	GLOBAL(ashrsi3)
  11.383 -+	FUNC(GLOBAL(ashrsi3))
  11.384 - 	.align	2
  11.385 - GLOBAL(ashrsi3):
  11.386 - 	mov	#31,r0
  11.387 -@@ -319,6 +394,8 @@
  11.388 - 	rts
  11.389 - 	nop
  11.390 - 
  11.391 -+	ENDFUNC(GLOBAL(ashrsi3))
  11.392 -+
  11.393 - #endif
  11.394 - 
  11.395 - #ifdef L_ashiftlt
  11.396 -@@ -340,6 +417,7 @@
  11.397 - ! (none)
  11.398 - !
  11.399 - 	.global	GLOBAL(ashlsi3)
  11.400 -+	FUNC(GLOBAL(ashlsi3))
  11.401 - 	.align	2
  11.402 - GLOBAL(ashlsi3):
  11.403 - 	mov	#31,r0
  11.404 -@@ -476,6 +554,8 @@
  11.405 - 	rts
  11.406 - 	nop
  11.407 - 
  11.408 -+	ENDFUNC(GLOBAL(ashlsi3))
  11.409 -+
  11.410 - #endif
  11.411 - 
  11.412 - #ifdef L_lshiftrt
  11.413 -@@ -497,6 +577,7 @@
  11.414 - ! (none)
  11.415 - !
  11.416 - 	.global	GLOBAL(lshrsi3)
  11.417 -+	FUNC(GLOBAL(lshrsi3))
  11.418 - 	.align	2
  11.419 - GLOBAL(lshrsi3):
  11.420 - 	mov	#31,r0
  11.421 -@@ -633,6 +714,8 @@
  11.422 - 	rts
  11.423 - 	nop
  11.424 - 
  11.425 -+	ENDFUNC(GLOBAL(lshrsi3))
  11.426 -+
  11.427 - #endif
  11.428 - 
  11.429 - #ifdef L_movstr
  11.430 -@@ -649,76 +732,113 @@
  11.431 - 	add	#64,r4
  11.432 - 	.align	4
  11.433 - 	.global	GLOBAL(movstrSI64)
  11.434 -+	FUNC(GLOBAL(movstrSI64))
  11.435 - GLOBAL(movstrSI64):
  11.436 - 	mov.l	@(60,r5),r0
  11.437 - 	mov.l	r0,@(60,r4)
  11.438 - 	.global	GLOBAL(movstrSI60)
  11.439 -+	FUNC(GLOBAL(movstrSI60))
  11.440 - GLOBAL(movstrSI60):
  11.441 - 	mov.l	@(56,r5),r0
  11.442 - 	mov.l	r0,@(56,r4)
  11.443 - 	.global	GLOBAL(movstrSI56)
  11.444 -+	FUNC(GLOBAL(movstrSI56))
  11.445 - GLOBAL(movstrSI56):
  11.446 - 	mov.l	@(52,r5),r0
  11.447 - 	mov.l	r0,@(52,r4)
  11.448 - 	.global	GLOBAL(movstrSI52)
  11.449 -+	FUNC(GLOBAL(movstrSI52))
  11.450 - GLOBAL(movstrSI52):
  11.451 - 	mov.l	@(48,r5),r0
  11.452 - 	mov.l	r0,@(48,r4)
  11.453 - 	.global	GLOBAL(movstrSI48)
  11.454 -+	FUNC(GLOBAL(movstrSI48))
  11.455 - GLOBAL(movstrSI48):
  11.456 - 	mov.l	@(44,r5),r0
  11.457 - 	mov.l	r0,@(44,r4)
  11.458 - 	.global	GLOBAL(movstrSI44)
  11.459 -+	FUNC(GLOBAL(movstrSI44))
  11.460 - GLOBAL(movstrSI44):
  11.461 - 	mov.l	@(40,r5),r0
  11.462 - 	mov.l	r0,@(40,r4)
  11.463 - 	.global	GLOBAL(movstrSI40)
  11.464 -+	FUNC(GLOBAL(movstrSI40))
  11.465 - GLOBAL(movstrSI40):
  11.466 - 	mov.l	@(36,r5),r0
  11.467 - 	mov.l	r0,@(36,r4)
  11.468 - 	.global	GLOBAL(movstrSI36)
  11.469 -+	FUNC(GLOBAL(movstrSI36))
  11.470 - GLOBAL(movstrSI36):
  11.471 - 	mov.l	@(32,r5),r0
  11.472 - 	mov.l	r0,@(32,r4)
  11.473 - 	.global	GLOBAL(movstrSI32)
  11.474 -+	FUNC(GLOBAL(movstrSI32))
  11.475 - GLOBAL(movstrSI32):
  11.476 - 	mov.l	@(28,r5),r0
  11.477 - 	mov.l	r0,@(28,r4)
  11.478 - 	.global	GLOBAL(movstrSI28)
  11.479 -+	FUNC(GLOBAL(movstrSI28))
  11.480 - GLOBAL(movstrSI28):
  11.481 - 	mov.l	@(24,r5),r0
  11.482 - 	mov.l	r0,@(24,r4)
  11.483 - 	.global	GLOBAL(movstrSI24)
  11.484 -+	FUNC(GLOBAL(movstrSI24))
  11.485 - GLOBAL(movstrSI24):
  11.486 - 	mov.l	@(20,r5),r0
  11.487 - 	mov.l	r0,@(20,r4)
  11.488 - 	.global	GLOBAL(movstrSI20)
  11.489 -+	FUNC(GLOBAL(movstrSI20))
  11.490 - GLOBAL(movstrSI20):
  11.491 - 	mov.l	@(16,r5),r0
  11.492 - 	mov.l	r0,@(16,r4)
  11.493 - 	.global	GLOBAL(movstrSI16)
  11.494 -+	FUNC(GLOBAL(movstrSI16))
  11.495 - GLOBAL(movstrSI16):
  11.496 - 	mov.l	@(12,r5),r0
  11.497 - 	mov.l	r0,@(12,r4)
  11.498 - 	.global	GLOBAL(movstrSI12)
  11.499 -+	FUNC(GLOBAL(movstrSI12))
  11.500 - GLOBAL(movstrSI12):
  11.501 - 	mov.l	@(8,r5),r0
  11.502 - 	mov.l	r0,@(8,r4)
  11.503 - 	.global	GLOBAL(movstrSI8)
  11.504 -+	FUNC(GLOBAL(movstrSI8))
  11.505 - GLOBAL(movstrSI8):
  11.506 - 	mov.l	@(4,r5),r0
  11.507 - 	mov.l	r0,@(4,r4)
  11.508 - 	.global	GLOBAL(movstrSI4)
  11.509 -+	FUNC(GLOBAL(movstrSI4))
  11.510 - GLOBAL(movstrSI4):
  11.511 - 	mov.l	@(0,r5),r0
  11.512 - 	mov.l	r0,@(0,r4)
  11.513 -+	.global	GLOBAL(movstrSI0)
  11.514 -+	FUNC(GLOBAL(movstrSI0))
  11.515 - GLOBAL(movstrSI0):
  11.516 - 	rts
  11.517 - 	nop
  11.518 - 
  11.519 -+	ENDFUNC(GLOBAL(movstrSI64))
  11.520 -+	ENDFUNC(GLOBAL(movstrSI60))
  11.521 -+	ENDFUNC(GLOBAL(movstrSI56))
  11.522 -+	ENDFUNC(GLOBAL(movstrSI52))
  11.523 -+	ENDFUNC(GLOBAL(movstrSI48))
  11.524 -+	ENDFUNC(GLOBAL(movstrSI44))
  11.525 -+	ENDFUNC(GLOBAL(movstrSI40))
  11.526 -+	ENDFUNC(GLOBAL(movstrSI36))
  11.527 -+	ENDFUNC(GLOBAL(movstrSI32))
  11.528 -+	ENDFUNC(GLOBAL(movstrSI28))
  11.529 -+	ENDFUNC(GLOBAL(movstrSI24))
  11.530 -+	ENDFUNC(GLOBAL(movstrSI20))
  11.531 -+	ENDFUNC(GLOBAL(movstrSI16))
  11.532 -+	ENDFUNC(GLOBAL(movstrSI12))
  11.533 -+	ENDFUNC(GLOBAL(movstrSI8))
  11.534 -+	ENDFUNC(GLOBAL(movstrSI4))
  11.535 -+	ENDFUNC(GLOBAL(movstrSI0))
  11.536 -+
  11.537 - 	.align	4
  11.538 - 
  11.539 - 	.global	GLOBAL(movstr)
  11.540 -+	FUNC(GLOBAL(movstr))
  11.541 - GLOBAL(movstr):
  11.542 - 	mov.l	@(60,r5),r0
  11.543 - 	mov.l	r0,@(60,r4)
  11.544 -@@ -775,6 +895,8 @@
  11.545 - 	add	#64,r5
  11.546 - 	bra	GLOBAL(movstr)
  11.547 - 	add	#64,r4
  11.548 -+
  11.549 -+	FUNC(GLOBAL(movstr))
  11.550 - #endif
  11.551 - 
  11.552 - #ifdef L_movstr_i4
  11.553 -@@ -783,6 +905,10 @@
  11.554 - 	.global	GLOBAL(movstr_i4_odd)
  11.555 - 	.global	GLOBAL(movstrSI12_i4)
  11.556 - 
  11.557 -+	FUNC(GLOBAL(movstr_i4_even))
  11.558 -+	FUNC(GLOBAL(movstr_i4_odd))
  11.559 -+	FUNC(GLOBAL(movstrSI12_i4))
  11.560 -+
  11.561 - 	.p2align	5
  11.562 - L_movstr_2mod4_end:
  11.563 - 	mov.l	r0,@(16,r4)
  11.564 -@@ -791,6 +917,11 @@
  11.565 - 
  11.566 - 	.p2align	2
  11.567 - 
  11.568 -+GLOBAL(movstr_i4_even):
  11.569 -+	mov.l	@r5+,r0
  11.570 -+	bra	L_movstr_start_even
  11.571 -+	mov.l	@r5+,r1
  11.572 -+
  11.573 - GLOBAL(movstr_i4_odd):
  11.574 - 	mov.l	@r5+,r1
  11.575 - 	add	#-4,r4
  11.576 -@@ -817,10 +948,8 @@
  11.577 - 	rts
  11.578 - 	mov.l	r3,@(12,r4)
  11.579 - 
  11.580 --GLOBAL(movstr_i4_even):
  11.581 --	mov.l	@r5+,r0
  11.582 --	bra	L_movstr_start_even
  11.583 --	mov.l	@r5+,r1
  11.584 -+	ENDFUNC(GLOBAL(movstr_i4_even))
  11.585 -+	ENDFUNC(GLOBAL(movstr_i4_odd))
  11.586 - 
  11.587 - 	.p2align	4
  11.588 - GLOBAL(movstrSI12_i4):
  11.589 -@@ -831,12 +960,16 @@
  11.590 - 	mov.l	r1,@(4,r4)
  11.591 - 	rts
  11.592 - 	mov.l	r2,@(8,r4)
  11.593 -+
  11.594 -+	ENDFUNC(GLOBAL(movstrSI12_i4))
  11.595 -+
  11.596 - #endif
  11.597 - 
  11.598 - #ifdef L_mulsi3
  11.599 - 
  11.600 - 
  11.601 - 	.global	GLOBAL(mulsi3)
  11.602 -+	FUNC(GLOBAL(mulsi3))
  11.603 - 
  11.604 - ! r4 =       aabb
  11.605 - ! r5 =       ccdd
  11.606 -@@ -869,7 +1002,7 @@
  11.607 - 	rts
  11.608 - 	add	r2,r0
  11.609 - 
  11.610 --
  11.611 -+	FUNC(GLOBAL(mulsi3))
  11.612 - #endif
  11.613 - #endif /* ! __SH5__ */
  11.614 - #ifdef L_sdivsi3_i4
  11.615 -@@ -879,6 +1012,7 @@
  11.616 - !! args in r4 and r5, result in fpul, clobber dr0, dr2
  11.617 - 
  11.618 - 	.global	GLOBAL(sdivsi3_i4)
  11.619 -+	FUNC(GLOBAL(sdivsi3_i4))
  11.620 - GLOBAL(sdivsi3_i4):
  11.621 - 	lds r4,fpul
  11.622 - 	float fpul,dr0
  11.623 -@@ -888,6 +1022,8 @@
  11.624 - 	rts
  11.625 - 	ftrc dr0,fpul
  11.626 - 
  11.627 -+	ENDFUNC(GLOBAL(sdivsi3_i4))
  11.628 -+
  11.629 - #elif defined(__SH4_SINGLE__) || defined(__SH4_SINGLE_ONLY__) || (defined (__SH5__) && ! defined __SH4_NOFPU__)
  11.630 - !! args in r4 and r5, result in fpul, clobber r2, dr0, dr2
  11.631 - 
  11.632 -@@ -896,6 +1032,7 @@
  11.633 - 	.mode	SHcompact
  11.634 - #endif
  11.635 - 	.global	GLOBAL(sdivsi3_i4)
  11.636 -+	FUNC(GLOBAL(sdivsi3_i4))
  11.637 - GLOBAL(sdivsi3_i4):
  11.638 - 	sts.l fpscr,@-r15
  11.639 - 	mov #8,r2
  11.640 -@@ -910,6 +1047,8 @@
  11.641 - 	rts
  11.642 - 	lds.l @r15+,fpscr
  11.643 - 
  11.644 -+	ENDFUNC(GLOBAL(sdivsi3_i4))
  11.645 -+
  11.646 - #endif /* ! __SH5__ || __SH5__ == 32 */
  11.647 - #endif /* ! __SH4__ */
  11.648 - #endif
  11.649 -@@ -924,9 +1063,10 @@
  11.650 - !!
  11.651 - !!
  11.652 - 
  11.653 --!! args in r4 and r5, result in r0 clobber r1,r2,r3
  11.654 -+!! args in r4 and r5, result in r0 clobber r1, r2, r3, and t bit
  11.655 - 
  11.656 - 	.global	GLOBAL(sdivsi3)
  11.657 -+	FUNC(GLOBAL(sdivsi3))
  11.658 - #if __SHMEDIA__
  11.659 - #if __SH5__ == 32
  11.660 - 	.section	.text..SHmedia32,"ax"
  11.661 -@@ -1076,6 +1216,7 @@
  11.662 - div0:	rts
  11.663 - 	mov	#0,r0
  11.664 - 
  11.665 -+	ENDFUNC(GLOBAL(sdivsi3))
  11.666 - #endif /* ! __SHMEDIA__ */
  11.667 - #endif /* ! __SH4__ */
  11.668 - #endif
  11.669 -@@ -1084,9 +1225,11 @@
  11.670 - 	.title "SH DIVIDE"
  11.671 - !! 4 byte integer Divide code for the Hitachi SH
  11.672 - #ifdef __SH4__
  11.673 --!! args in r4 and r5, result in fpul, clobber r0, r1, r4, r5, dr0, dr2, dr4
  11.674 -+!! args in r4 and r5, result in fpul, clobber r0, r1, r4, r5, dr0, dr2, dr4,
  11.675 -+!! and t bit
  11.676 - 
  11.677 - 	.global	GLOBAL(udivsi3_i4)
  11.678 -+	FUNC(GLOBAL(udivsi3_i4))
  11.679 - GLOBAL(udivsi3_i4):
  11.680 - 	mov #1,r1
  11.681 - 	cmp/hi r1,r5
  11.682 -@@ -1127,6 +1270,8 @@
  11.683 - L1:
  11.684 - 	.double 2147483648
  11.685 - 
  11.686 -+	ENDFUNC(GLOBAL(udivsi3_i4))
  11.687 -+
  11.688 - #elif defined(__SH4_SINGLE__) || defined(__SH4_SINGLE_ONLY__) || (defined (__SH5__) && ! defined __SH4_NOFPU__)
  11.689 - !! args in r4 and r5, result in fpul, clobber r0, r1, r4, r5, dr0, dr2, dr4
  11.690 - 
  11.691 -@@ -1135,6 +1280,7 @@
  11.692 - 	.mode	SHcompact
  11.693 - #endif
  11.694 - 	.global	GLOBAL(udivsi3_i4)
  11.695 -+	FUNC(GLOBAL(udivsi3_i4))
  11.696 - GLOBAL(udivsi3_i4):
  11.697 - 	mov #1,r1
  11.698 - 	cmp/hi r1,r5
  11.699 -@@ -1183,6 +1329,8 @@
  11.700 - #endif
  11.701 - 	.double 2147483648
  11.702 - 
  11.703 -+	ENDFUNC(GLOBAL(udivsi3_i4))
  11.704 -+
  11.705 - #endif /* ! __SH5__ || __SH5__ == 32 */
  11.706 - #endif /* ! __SH4__ */
  11.707 - #endif
  11.708 -@@ -1199,6 +1347,7 @@
  11.709 - 
  11.710 - !! args in r4 and r5, result in r0, clobbers r4, pr, and t bit
  11.711 - 	.global	GLOBAL(udivsi3)
  11.712 -+	FUNC(GLOBAL(udivsi3))
  11.713 - 
  11.714 - #if __SHMEDIA__
  11.715 - #if __SH5__ == 32
  11.716 -@@ -1299,6 +1448,8 @@
  11.717 - ret:	rts
  11.718 - 	mov	r4,r0
  11.719 - 
  11.720 -+	ENDFUNC(GLOBAL(udivsi3))
  11.721 -+
  11.722 - #endif /* ! __SHMEDIA__ */
  11.723 - #endif /* __SH4__ */
  11.724 - #endif
  11.725 -@@ -1308,6 +1459,7 @@
  11.726 - 	.mode	SHcompact
  11.727 - #endif
  11.728 - 	.global GLOBAL(set_fpscr)
  11.729 -+	FUNC(GLOBAL(set_fpscr))
  11.730 - GLOBAL(set_fpscr):
  11.731 - 	lds r4,fpscr
  11.732 - 	mov.l LOCAL(set_fpscr_L1),r1
  11.733 -@@ -1340,11 +1492,16 @@
  11.734 - 	.align 2
  11.735 - LOCAL(set_fpscr_L1):
  11.736 - 	.long GLOBAL(fpscr_values)
  11.737 -+
  11.738 -+	ENDFUNC(GLOBAL(set_fpscr))
  11.739 -+
  11.740 -+#ifndef NO_FPSCR_VALUES
  11.741 - #ifdef __ELF__
  11.742 -         .comm   GLOBAL(fpscr_values),8,4
  11.743 - #else
  11.744 -         .comm   GLOBAL(fpscr_values),8
  11.745 - #endif /* ELF */
  11.746 -+#endif /* NO_FPSCR_VALUES */
  11.747 - #endif /* SH3E / SH4 */
  11.748 - #endif /* L_set_fpscr */
  11.749 - #ifdef L_ic_invalidate
  11.750 -@@ -1360,6 +1517,7 @@
  11.751 - 	blink	tr0, r63
  11.752 - #elif defined(__SH4_SINGLE__) || defined(__SH4__) || defined(__SH4_SINGLE_ONLY__)
  11.753 - 	.global GLOBAL(ic_invalidate)
  11.754 -+	FUNC(GLOBAL(ic_invalidate))
  11.755 - GLOBAL(ic_invalidate):
  11.756 - 	ocbwb	@r4
  11.757 - 	mova	0f,r0
  11.758 -@@ -1382,6 +1540,9 @@
  11.759 - 	nop
  11.760 - 	.endr
  11.761 - 	.endr
  11.762 -+
  11.763 -+	ENDFUNC(GLOBAL(ic_invalidate))
  11.764 -+
  11.765 - #endif /* SH4 */
  11.766 - #endif /* L_ic_invalidate */
  11.767 - 
  11.768 -diff -ruN gcc-20030210.orig/gcc/config/sh/libgcc-glibc.ver gcc-20030210/gcc/config/sh/libgcc-glibc.ver
  11.769 ---- gcc-20030210.orig/gcc/config/sh/libgcc-glibc.ver	Thu Jan  1 09:00:00 1970
  11.770 -+++ gcc-20030210/gcc/config/sh/libgcc-glibc.ver	Sat Feb 22 01:40:14 2003
  11.771 -@@ -0,0 +1,21 @@
  11.772 -+# In order to work around the very problems that force us to now generally
  11.773 -+# create a libgcc.so, glibc reexported a number of routines from libgcc.a.
  11.774 -+# By now choosing the same version tags for these specific routines, we
  11.775 -+# maintain enough binary compatibility to allow future versions of glibc
  11.776 -+# to defer implementation of these routines to libgcc.so via DT_AUXILIARY.
  11.777 -+
  11.778 -+# Note that we cannot use the default libgcc-glibc.ver file on sh,
  11.779 -+# because GLIBC_2.0 does not exist on this architecture, as the first 
  11.780 -+# ever glibc release on the platform was GLIBC_2.2.
  11.781 -+
  11.782 -+%inherit GCC_3.0 GLIBC_2.2
  11.783 -+GLIBC_2.2 {
  11.784 -+  __register_frame
  11.785 -+  __register_frame_table
  11.786 -+  __deregister_frame
  11.787 -+  __register_frame_info
  11.788 -+  __deregister_frame_info
  11.789 -+  __frame_state_for
  11.790 -+  __register_frame_info_table
  11.791 -+}
  11.792 -+
  11.793 -diff -ruN gcc-20030210.orig/gcc/config/sh/linux.h gcc-20030210/gcc/config/sh/linux.h
  11.794 ---- gcc-20030210.orig/gcc/config/sh/linux.h	Tue Apr 16 05:27:42 2002
  11.795 -+++ gcc-20030210/gcc/config/sh/linux.h	Sat Feb 22 01:40:14 2003
  11.796 -@@ -19,6 +19,10 @@
  11.797 - the Free Software Foundation, 59 Temple Place - Suite 330,
  11.798 - Boston, MA 02111-1307, USA.  */
  11.799 - 
  11.800 -+/* We're not SYSVR4, not having /usr/ccs */
  11.801 -+#undef MD_EXEC_PREFIX
  11.802 -+#undef MD_STARTFILE_PREFIX
  11.803 -+
  11.804 - /* Run-time Target Specification.  */
  11.805 - #undef TARGET_VERSION
  11.806 - #define TARGET_VERSION  fputs (" (SH GNU/Linux with ELF)", stderr);
  11.807 -@@ -39,6 +43,28 @@
  11.808 - #undef WCHAR_TYPE_SIZE
  11.809 - #define WCHAR_TYPE_SIZE BITS_PER_WORD
  11.810 - 
  11.811 -+/* This was defined in linux.h.  Define it here also. */
  11.812 -+#undef  DEFAULT_VTABLE_THUNKS
  11.813 -+#define DEFAULT_VTABLE_THUNKS   1
  11.814 -+
  11.815 -+/* Likewise.  */
  11.816 -+#define HANDLE_PRAGMA_PACK_PUSH_POP
  11.817 -+
  11.818 -+/* Pick up the return address upon entry to a procedure. Used for
  11.819 -+   dwarf2 unwind information.  This also enables the table driven
  11.820 -+   mechanism.  */
  11.821 -+
  11.822 -+#define INCOMING_RETURN_ADDR_RTX	gen_rtx_REG (Pmode, PR_REG)
  11.823 -+#define DWARF_FRAME_RETURN_COLUMN	DWARF_FRAME_REGNUM (PR_REG)
  11.824 -+
  11.825 -+#undef CPP_SPEC
  11.826 -+#define CPP_SPEC "\
  11.827 -+   %{m4:-D__SH4__} \
  11.828 -+   %{!m4:%(cpp_default_cpu_spec)} \
  11.829 -+   %(subtarget_cpp_spec) \
  11.830 -+   %(subtarget_cpp_ptr_spec) \
  11.831 -+   %(subtarget_cpp_endian_spec) "
  11.832 -+
  11.833 - #undef SUBTARGET_CPP_SPEC
  11.834 - #define SUBTARGET_CPP_SPEC "\
  11.835 -    %{fPIC:-D__PIC__ -D__pic__} \
  11.836 -@@ -55,36 +81,45 @@
  11.837 - #undef CPP_DEFAULT_CPU_SPEC
  11.838 - #define CPP_DEFAULT_CPU_SPEC "-D__SH3__ -D__sh3__"
  11.839 - 
  11.840 --
  11.841 - #undef CPP_PREDEFINES
  11.842 - #define CPP_PREDEFINES "-D__ELF__ -Dunix -D__sh__ -D__gnu_linux__ -Dlinux -Asystem=posix"
  11.843 - 
  11.844 -+/* The GNU C++ standard library requires that these macros be defined.  */
  11.845 -+#undef CPLUSPLUS_CPP_SPEC
  11.846 -+#define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
  11.847 -+
  11.848 - #undef ASM_SPEC
  11.849 --#define ASM_SPEC  "%{!mb:-little} %{mrelax:-relax}"
  11.850 -+#define ASM_SPEC  "%{mb:-big} %{!mb:-little} %{mrelax:-relax}"
  11.851 - 
  11.852 - #undef CC1_SPEC
  11.853 - #define CC1_SPEC \
  11.854 --  "-musermode %{!mb:-ml} %{!m3e:%{!m4:-m3}}"
  11.855 --
  11.856 --#undef CC1PLUS_SPEC
  11.857 --#define CC1PLUS_SPEC \
  11.858 --  "-musermode %{!mb:-ml} %{!m3e:%{!m4:-m3}}"
  11.859 -+  "-musermode %{!mb:-ml} %{!m4:-m3} %{profile:-p}"
  11.860 - 
  11.861 -+/* XXX: It's wrong if prefix != /usr */
  11.862 - #undef LINK_SPEC
  11.863 - #define LINK_SPEC \
  11.864 --  "%{!mb:-m shlelf_linux} %{mrelax:-relax} \
  11.865 -+  "%{!mb:-m shlelf_linux -EL} %{mb:-m shelf_linux -EB} %{mrelax:-relax} \
  11.866 -    %{shared:-shared} \
  11.867 -    %{!static: \
  11.868 -      %{rdynamic:-export-dynamic} \
  11.869 -      %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2} \
  11.870 --     %{!rpath:-rpath /lib}} \
  11.871 -+     %{!mb:%{!m4:-rpath-link /usr/sh-linux/lib }} \
  11.872 -+     %{!mb:%{m4:-rpath-link /usr/sh-linux/lib/m4 }} \
  11.873 -+     %{mb:%{!m4:-rpath-link /usr/sh-linux/lib/mb }} \
  11.874 -+     %{mb:%{m4:-rpath-link /usr/sh-linux/lib/mb/m4 }}} \
  11.875 -    %{static:-static}"
  11.876 - 
  11.877 - #undef LIB_SPEC
  11.878 -+#undef LIB_SPEC
  11.879 - #define LIB_SPEC \
  11.880 -   "%{shared: -lc} \
  11.881 --   %{!shared: %{pthread:-lthread} \
  11.882 --     %{profile:-lc_p} %{!profile: -lc}}"
  11.883 -+   %{!shared: %{mieee:-lieee} %{pthread:-lpthread} \
  11.884 -+	%{profile:-lc_p} %{!profile: -lc}}"
  11.885 -+
  11.886 -+#if defined(HAVE_LD_EH_FRAME_HDR)
  11.887 -+#undef LINK_EH_SPEC
  11.888 -+#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
  11.889 -+#endif
  11.890 - 
  11.891 - #undef STARTFILE_SPEC
  11.892 - #define STARTFILE_SPEC \
  11.893 -@@ -92,4 +127,40 @@
  11.894 -      %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
  11.895 - 		       %{!p:%{profile:gcrt1.o%s} \
  11.896 - 			 %{!profile:crt1.o%s}}}} \
  11.897 --   crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
  11.898 -+   crti.o%s %{static:crtbeginT.o%s}\
  11.899 -+   %{!static:%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}}"
  11.900 -+
  11.901 -+#undef FUNCTION_PROFILER
  11.902 -+#define FUNCTION_PROFILER(STREAM,LABELNO)				\
  11.903 -+do									\
  11.904 -+{									\
  11.905 -+  if (flag_pic)								\
  11.906 -+    {									\
  11.907 -+      fprintf (STREAM, "	mov.l	3f,r1\n");			\
  11.908 -+      fprintf (STREAM, "	mova	3f,r0\n");			\
  11.909 -+      fprintf (STREAM, "	add	r1,r0\n");			\
  11.910 -+      fprintf (STREAM, "	mov.l	1f,r1\n");			\
  11.911 -+      fprintf (STREAM, "	mov.l	@(r0,r1),r1\n");		\
  11.912 -+    }									\
  11.913 -+  else									\
  11.914 -+    {									\
  11.915 -+      fprintf (STREAM, "	mov.l	1f,r1\n");			\
  11.916 -+    }									\
  11.917 -+  fprintf (STREAM, "	sts.l	pr,@-r15\n");				\
  11.918 -+  fprintf (STREAM, "	mova	2f,r0\n");				\
  11.919 -+  fprintf (STREAM, "	jmp	@r1\n");				\
  11.920 -+  fprintf (STREAM, "	lds	r0,pr\n");				\
  11.921 -+  fprintf (STREAM, "	.align	2\n");					\
  11.922 -+  if (flag_pic)								\
  11.923 -+    {									\
  11.924 -+      fprintf (STREAM, "1:	.long	mcount@GOT\n");			\
  11.925 -+      fprintf (STREAM, "3:	.long	_GLOBAL_OFFSET_TABLE_\n");	\
  11.926 -+    }									\
  11.927 -+  else									\
  11.928 -+    {									\
  11.929 -+      fprintf (STREAM, "1:	.long	mcount\n");			\
  11.930 -+    }									\
  11.931 -+  fprintf (STREAM, "2:	lds.l	@r15+,pr\n");				\
  11.932 -+} while (0)
  11.933 -+
  11.934 -+#define NO_SHARED_LIBGCC_MULTILIB
  11.935 -diff -ruN gcc-20030210.orig/gcc/config/sh/sh-protos.h gcc-20030210/gcc/config/sh/sh-protos.h
  11.936 ---- gcc-20030210.orig/gcc/config/sh/sh-protos.h	Fri Feb 22 01:42:28 2002
  11.937 -+++ gcc-20030210/gcc/config/sh/sh-protos.h	Sat Feb 22 01:40:14 2003
  11.938 -@@ -74,6 +74,7 @@
  11.939 - extern int shl_sext_length PARAMS ((rtx));
  11.940 - extern int gen_shl_sext PARAMS ((rtx, rtx, rtx, rtx));
  11.941 - extern rtx gen_datalabel_ref PARAMS ((rtx));
  11.942 -+extern int shl_casesi_worker_length PARAMS ((rtx));
  11.943 - extern int regs_used PARAMS ((rtx, int));
  11.944 - extern void fixup_addr_diff_vecs PARAMS ((rtx));
  11.945 - extern int get_dest_uid PARAMS ((rtx, int));
  11.946 -diff -ruN gcc-20030210.orig/gcc/config/sh/sh.c gcc-20030210/gcc/config/sh/sh.c
  11.947 ---- gcc-20030210.orig/gcc/config/sh/sh.c	Fri Feb 22 01:42:28 2002
  11.948 -+++ gcc-20030210/gcc/config/sh/sh.c	Sat Feb 22 01:40:14 2003
  11.949 -@@ -2143,6 +2143,48 @@
  11.950 -   return sym;
  11.951 - }
  11.952 - 
  11.953 -+
  11.954 -+/* Function to be used in the length attribute of the casesi_worker
  11.955 -+   instruction.  Returns number of instructions, which is half of the
  11.956 -+   length of bytes. */
  11.957 -+
  11.958 -+int
  11.959 -+shl_casesi_worker_length (insn)
  11.960 -+     rtx insn;
  11.961 -+{
  11.962 -+  rtx set_src, label;
  11.963 -+  rtx diff_vec;
  11.964 -+
  11.965 -+  set_src = SET_SRC (XVECEXP (PATTERN (insn), 0, 0));
  11.966 -+  if (!(GET_CODE (set_src) == UNSPEC
  11.967 -+	&& XINT (set_src, 1) == UNSPEC_CASESI))
  11.968 -+    abort ();
  11.969 -+
  11.970 -+  label = XVECEXP (set_src, 0, 2);
  11.971 -+  if (GET_CODE (label) != LABEL_REF)
  11.972 -+    abort ();
  11.973 -+
  11.974 -+  diff_vec = PATTERN (next_real_insn (XEXP (label, 0)));
  11.975 -+
  11.976 -+  if (GET_CODE (diff_vec) != ADDR_DIFF_VEC)
  11.977 -+    abort ();
  11.978 -+
  11.979 -+  switch (GET_MODE (diff_vec))
  11.980 -+    {
  11.981 -+    case SImode:
  11.982 -+      return 2;
  11.983 -+    case HImode:
  11.984 -+      if (ADDR_DIFF_VEC_FLAGS (diff_vec).offset_unsigned)
  11.985 -+	return 3;
  11.986 -+      return 2;
  11.987 -+    case QImode:
  11.988 -+      if (ADDR_DIFF_VEC_FLAGS (diff_vec).offset_unsigned)
  11.989 -+	return 2;
  11.990 -+      return 1;
  11.991 -+    default:
  11.992 -+      abort ();
  11.993 -+    }
  11.994 -+}
  11.995 - 
  11.996 - /* The SH cannot load a large constant into a register, constants have to
  11.997 -    come from a pc relative load.  The reference of a pc relative load
  11.998 -@@ -3190,7 +3232,7 @@
  11.999 -       vec_lab = XEXP (XEXP (pat, 0), 0);
 11.1000 - 
 11.1001 -       /* Search the matching casesi_jump_2.  */
 11.1002 --      for (prev = vec_lab; ; prev = PREV_INSN (prev))
 11.1003 -+      for (prev = vec_lab; prev; prev = PREV_INSN (prev))
 11.1004 - 	{
 11.1005 - 	  if (GET_CODE (prev) != JUMP_INSN)
 11.1006 - 	    continue;
 11.1007 -@@ -3205,6 +3247,13 @@
 11.1008 - 	    break;
 11.1009 - 	}
 11.1010 - 
 11.1011 -+      if (prev == NULL)
 11.1012 -+	{			/* Switch statement has been optimized out.  */
 11.1013 -+	  delete_insn (PREV_INSN (insn));
 11.1014 -+	  delete_insn (insn);
 11.1015 -+	  continue;
 11.1016 -+	}
 11.1017 -+
 11.1018 -       /* Emit the reference label of the braf where it belongs, right after
 11.1019 - 	 the casesi_jump_2 (i.e. braf).  */
 11.1020 -       braf_label = XEXP (XEXP (SET_SRC (XVECEXP (prevpat, 0, 0)), 1), 0);
 11.1021 -@@ -3223,7 +3272,7 @@
 11.1022 -      rtx barrier_or_label;
 11.1023 - {
 11.1024 -   rtx next = next_real_insn (barrier_or_label), pat, prev;
 11.1025 --  int slot, credit, jump_to_next;
 11.1026 -+  int slot, credit, jump_to_next = 0;
 11.1027 -  
 11.1028 -   if (! next)
 11.1029 -     return 0;
 11.1030 -@@ -4507,7 +4556,8 @@
 11.1031 -   if (current_function_varargs || current_function_stdarg)
 11.1032 -     {
 11.1033 -       /* This is not used by the SH3E calling convention  */
 11.1034 --      if (TARGET_SH1 && ! TARGET_SH3E && ! TARGET_SH5 && ! TARGET_HITACHI)
 11.1035 -+      if (TARGET_SH1 && ! TARGET_SH3E && ! TARGET_SH5 && ! TARGET_HITACHI
 11.1036 -+	  || TARGET_NO_IMPLICIT_FP)
 11.1037 - 	{
 11.1038 - 	  /* Push arg regs as if they'd been provided by caller in stack.  */
 11.1039 - 	  for (i = 0; i < NPARM_REGS(SImode); i++)
 11.1040 -@@ -5149,7 +5199,8 @@
 11.1041 -   tree f_next_o, f_next_o_limit, f_next_fp, f_next_fp_limit, f_next_stack;
 11.1042 -   tree record;
 11.1043 - 
 11.1044 --  if (TARGET_SH5 || (! TARGET_SH3E && ! TARGET_SH4) || TARGET_HITACHI)
 11.1045 -+  if (TARGET_SH5 || (! TARGET_SH3E && ! TARGET_SH4) || TARGET_HITACHI
 11.1046 -+      || TARGET_NO_IMPLICIT_FP)
 11.1047 -     return ptr_type_node;
 11.1048 - 
 11.1049 -   record = make_node (RECORD_TYPE);
 11.1050 -@@ -5211,7 +5262,8 @@
 11.1051 -       return;
 11.1052 -     }
 11.1053 - 
 11.1054 --  if ((! TARGET_SH3E && ! TARGET_SH4) || TARGET_HITACHI)
 11.1055 -+  if ((! TARGET_SH3E && ! TARGET_SH4)
 11.1056 -+      || TARGET_HITACHI || TARGET_NO_IMPLICIT_FP)
 11.1057 -     {
 11.1058 -       std_expand_builtin_va_start (stdarg_p, valist, nextarg);
 11.1059 -       return;
 11.1060 -@@ -5289,7 +5341,8 @@
 11.1061 -   rsize = (size + UNITS_PER_WORD - 1) & -UNITS_PER_WORD;
 11.1062 -   pptr_type_node = build_pointer_type (ptr_type_node);
 11.1063 - 
 11.1064 --  if (! TARGET_SH5 && (TARGET_SH3E || TARGET_SH4) && ! TARGET_HITACHI)
 11.1065 -+  if (! TARGET_SH5 && (TARGET_SH3E || TARGET_SH4)
 11.1066 -+      && ! TARGET_HITACHI && ! TARGET_NO_IMPLICIT_FP)
 11.1067 -     {
 11.1068 -       tree f_next_o, f_next_o_limit, f_next_fp, f_next_fp_limit, f_next_stack;
 11.1069 -       tree next_o, next_o_limit, next_fp, next_fp_limit, next_stack;
 11.1070 -diff -ruN gcc-20030210.orig/gcc/config/sh/sh.h gcc-20030210/gcc/config/sh/sh.h
 11.1071 ---- gcc-20030210.orig/gcc/config/sh/sh.h	Fri Feb 22 01:42:28 2002
 11.1072 -+++ gcc-20030210/gcc/config/sh/sh.h	Sat Feb 22 01:40:14 2003
 11.1073 -@@ -147,10 +147,10 @@
 11.1074 - #define HARD_SH4_BIT	(1<<5)
 11.1075 - #define FPU_SINGLE_BIT	(1<<7)
 11.1076 - #define SH4_BIT	       	(1<<12)
 11.1077 -+#define NO_IMPLICIT_FP_BIT	(1<<3)
 11.1078 - #define FMOVD_BIT	(1<<4)
 11.1079 - #define SH5_BIT		(1<<0)
 11.1080 - #define SPACE_BIT 	(1<<13)
 11.1081 --#define BIGTABLE_BIT  	(1<<14)
 11.1082 - #define RELAX_BIT	(1<<15)
 11.1083 - #define USERMODE_BIT	(1<<16)
 11.1084 - #define HITACHI_BIT     (1<<22)
 11.1085 -@@ -205,6 +205,9 @@
 11.1086 - /* Nonzero if we should generate code for a SH5 CPU (either ISA).  */
 11.1087 - #define TARGET_SH5 (target_flags & SH5_BIT)
 11.1088 - 
 11.1089 -+/* Nonzero if we should not use FPU implicitly.  */
 11.1090 -+#define TARGET_NO_IMPLICIT_FP (target_flags & NO_IMPLICIT_FP_BIT)
 11.1091 -+
 11.1092 - /* Nonzero if we should generate code using the SHcompact instruction
 11.1093 -    set and 32-bit ABI.  */
 11.1094 - #define TARGET_SHCOMPACT (TARGET_SH5 && TARGET_SH1)
 11.1095 -@@ -225,6 +228,7 @@
 11.1096 - 
 11.1097 - /* Nonzero if we should generate code using SHmedia FPU instructions.  */
 11.1098 - #define TARGET_SHMEDIA_FPU (TARGET_SHMEDIA && TARGET_FPU_DOUBLE)
 11.1099 -+
 11.1100 - /* Nonzero if we should generate fmovd.  */
 11.1101 - #define TARGET_FMOVD (target_flags & FMOVD_BIT)
 11.1102 - 
 11.1103 -@@ -234,9 +238,6 @@
 11.1104 - /* Nonzero if we should generate smaller code rather than faster code.  */
 11.1105 - #define TARGET_SMALLCODE   (target_flags & SPACE_BIT)
 11.1106 - 
 11.1107 --/* Nonzero to use long jump tables.  */
 11.1108 --#define TARGET_BIGTABLE     (target_flags & BIGTABLE_BIT)
 11.1109 --
 11.1110 - /* Nonzero to generate pseudo-ops needed by the assembler and linker
 11.1111 -    to do function call relaxing.  */
 11.1112 - #define TARGET_RELAX (target_flags & RELAX_BIT)
 11.1113 -@@ -297,7 +298,6 @@
 11.1114 -   {"5-compact-nofpu", TARGET_NONE, "" },	\
 11.1115 -   {"5-compact-nofpu", SH5_BIT|SH3_BIT|SH2_BIT|SH1_BIT, "Generate FPU-less SHcompact code" }, \
 11.1116 -   {"b",		-LITTLE_ENDIAN_BIT, "" },  	\
 11.1117 --  {"bigtable", 	BIGTABLE_BIT, "" },		\
 11.1118 -   {"dalign",  	DALIGN_BIT, "" },		\
 11.1119 -   {"fmovd",  	FMOVD_BIT, "" },		\
 11.1120 -   {"hitachi",	HITACHI_BIT, "" },		\
 11.1121 -@@ -306,6 +306,7 @@
 11.1122 -   {"isize", 	ISIZE_BIT, "" },		\
 11.1123 -   {"l",		LITTLE_ENDIAN_BIT, "" },  	\
 11.1124 -   {"no-ieee",  	-IEEE_BIT, "" },		\
 11.1125 -+  {"no-implicit-fp", NO_IMPLICIT_FP_BIT, "" },	\
 11.1126 -   {"padstruct", PADSTRUCT_BIT, "" },    	\
 11.1127 -   {"prefergot",	PREFERGOT_BIT, "" },		\
 11.1128 -   {"relax",	RELAX_BIT, "" },		\
 11.1129 -@@ -2493,16 +2494,22 @@
 11.1130 -     goto LABEL;								\
 11.1131 - }
 11.1132 - 
 11.1133 -+extern int optimize; /* needed for gen_casesi.  */
 11.1134 -+extern int optimize_size;
 11.1135 -+
 11.1136 - /* Specify the machine mode that this machine uses
 11.1137 -    for the index in the tablejump instruction.  */
 11.1138 --#define CASE_VECTOR_MODE (TARGET_BIGTABLE ? SImode : HImode)
 11.1139 -+#define CASE_VECTOR_MODE SImode
 11.1140 - 
 11.1141 - #define CASE_VECTOR_SHORTEN_MODE(MIN_OFFSET, MAX_OFFSET, BODY) \
 11.1142 - ((MIN_OFFSET) >= 0 && (MAX_OFFSET) <= 127 \
 11.1143 -  ? (ADDR_DIFF_VEC_FLAGS (BODY).offset_unsigned = 0, QImode) \
 11.1144 -  : (MIN_OFFSET) >= 0 && (MAX_OFFSET) <= 255 \
 11.1145 -  ? (ADDR_DIFF_VEC_FLAGS (BODY).offset_unsigned = 1, QImode) \
 11.1146 -- : (MIN_OFFSET) >= -32768 && (MAX_OFFSET) <= 32767 ? HImode \
 11.1147 -+ : (MIN_OFFSET) >= -32768 && (MAX_OFFSET) <= 32767 \
 11.1148 -+ ? (ADDR_DIFF_VEC_FLAGS (BODY).offset_unsigned = 0, HImode) \
 11.1149 -+ : optimize_size && (MIN_OFFSET) >= 0 && (MAX_OFFSET) <= 65535 \
 11.1150 -+ ? (ADDR_DIFF_VEC_FLAGS (BODY).offset_unsigned = 1, HImode) \
 11.1151 -  : SImode)
 11.1152 - 
 11.1153 - /* Define as C expression which evaluates to nonzero if the tablejump
 11.1154 -@@ -3038,10 +3045,7 @@
 11.1155 - /* Output an absolute table element.  */
 11.1156 - 
 11.1157 - #define ASM_OUTPUT_ADDR_VEC_ELT(STREAM,VALUE)  				\
 11.1158 --  if (TARGET_BIGTABLE) 							\
 11.1159 --    asm_fprintf ((STREAM), "\t.long\t%LL%d\n", (VALUE)); 			\
 11.1160 --  else									\
 11.1161 --    asm_fprintf ((STREAM), "\t.word\t%LL%d\n", (VALUE)); 			\
 11.1162 -+    asm_fprintf ((STREAM), "\t.long\t%LL%d\n", (VALUE))
 11.1163 - 
 11.1164 - /* Output various types of constants.  */
 11.1165 - 
 11.1166 -@@ -3167,8 +3171,6 @@
 11.1167 - #define sh_cpu_attr ((enum attr_cpu)sh_cpu)
 11.1168 - extern enum processor_type sh_cpu;
 11.1169 - 
 11.1170 --extern int optimize; /* needed for gen_casesi.  */
 11.1171 --
 11.1172 - enum mdep_reorg_phase_e
 11.1173 - {
 11.1174 -   SH_BEFORE_MDEP_REORG,
 11.1175 -diff -ruN gcc-20030210.orig/gcc/config/sh/sh.md gcc-20030210/gcc/config/sh/sh.md
 11.1176 ---- gcc-20030210.orig/gcc/config/sh/sh.md	Sat Nov 23 04:58:06 2002
 11.1177 -+++ gcc-20030210/gcc/config/sh/sh.md	Sat Feb 22 01:40:14 2003
 11.1178 -@@ -1242,7 +1242,7 @@
 11.1179 -    (clobber (reg:SI PR_REG))
 11.1180 -    (clobber (reg:SI R4_REG))
 11.1181 -    (use (match_operand:SI 1 "arith_reg_operand" "r"))]
 11.1182 --  "TARGET_SH1 && ! TARGET_SH4"
 11.1183 -+  "TARGET_SH1 && ! TARGET_SH4 || TARGET_NO_IMPLICIT_FP"
 11.1184 -   "jsr	@%1%#"
 11.1185 -   [(set_attr "type" "sfunc")
 11.1186 -    (set_attr "needs_delay_slot" "yes")])
 11.1187 -@@ -1336,7 +1336,7 @@
 11.1188 - 
 11.1189 -   operands[3] = gen_reg_rtx (Pmode);
 11.1190 -   /* Emit the move of the address to a pseudo outside of the libcall.  */
 11.1191 --  if (TARGET_HARD_SH4 && TARGET_SH3E)
 11.1192 -+  if (TARGET_HARD_SH4 && TARGET_SH3E && !TARGET_NO_IMPLICIT_FP)
 11.1193 -     {
 11.1194 -       emit_move_insn (operands[3],
 11.1195 - 		      gen_rtx_SYMBOL_REF (SImode, \"__udivsi3_i4\"));
 11.1196 -@@ -1391,7 +1391,7 @@
 11.1197 -    (clobber (reg:SI R2_REG))
 11.1198 -    (clobber (reg:SI R3_REG))
 11.1199 -    (use (match_operand:SI 1 "arith_reg_operand" "r"))]
 11.1200 --  "TARGET_SH1 && ! TARGET_SH4"
 11.1201 -+  "TARGET_SH1 && ! TARGET_SH4 || TARGET_NO_IMPLICIT_FP"
 11.1202 -   "jsr	@%1%#"
 11.1203 -   [(set_attr "type" "sfunc")
 11.1204 -    (set_attr "needs_delay_slot" "yes")])
 11.1205 -@@ -1476,7 +1476,7 @@
 11.1206 - 
 11.1207 -   operands[3] = gen_reg_rtx (Pmode);
 11.1208 -   /* Emit the move of the address to a pseudo outside of the libcall.  */
 11.1209 --  if (TARGET_HARD_SH4 && TARGET_SH3E)
 11.1210 -+  if (TARGET_HARD_SH4 && TARGET_SH3E && !TARGET_NO_IMPLICIT_FP)
 11.1211 -     {
 11.1212 -       emit_move_insn (operands[3],
 11.1213 - 		      gen_rtx_SYMBOL_REF (SImode, \"__sdivsi3_i4\"));
 11.1214 -@@ -6446,6 +6446,8 @@
 11.1215 -     case SImode:
 11.1216 -       return \"shll2	%1\;mov.l	@(r0,%1),%0\";
 11.1217 -     case HImode:
 11.1218 -+      if (ADDR_DIFF_VEC_FLAGS (diff_vec).offset_unsigned)
 11.1219 -+	return \"add	%1,%1\;mov.w	@(r0,%1),%0\;extu.w	%0,%0\";
 11.1220 -       return \"add	%1,%1\;mov.w	@(r0,%1),%0\";
 11.1221 -     case QImode:
 11.1222 -       if (ADDR_DIFF_VEC_FLAGS (diff_vec).offset_unsigned)
 11.1223 -@@ -6455,7 +6457,15 @@
 11.1224 -       abort ();
 11.1225 -     }
 11.1226 - }"
 11.1227 --  [(set_attr "length" "4")])
 11.1228 -+  [(set (attr "length")
 11.1229 -+	(cond [(eq (symbol_ref "shl_casesi_worker_length (insn)") (const_int 1))
 11.1230 -+	       (const_string "2")
 11.1231 -+	       (eq (symbol_ref "shl_casesi_worker_length (insn)") (const_int 2))
 11.1232 -+	       (const_string "4")
 11.1233 -+	       ;; Put "match_dup" here so that insn_variable_length_p return 1.
 11.1234 -+	       (ne (match_dup 2) (match_dup 2))
 11.1235 -+	       (const_string "4")]
 11.1236 -+	      (const_string "6")))])
 11.1237 - 
 11.1238 - (define_insn "casesi_shift_media"
 11.1239 -   [(set (match_operand 0 "arith_reg_operand" "=r")
 11.1240 -diff -ruN gcc-20030210.orig/gcc/config/sh/sh3-linux.h gcc-20030210/gcc/config/sh/sh3-linux.h
 11.1241 ---- gcc-20030210.orig/gcc/config/sh/sh3-linux.h	Thu Jan  1 09:00:00 1970
 11.1242 -+++ gcc-20030210/gcc/config/sh/sh3-linux.h	Sat Feb 22 01:40:14 2003
 11.1243 -@@ -0,0 +1,29 @@
 11.1244 -+#undef TARGET_VERSION
 11.1245 -+#define TARGET_VERSION  fputs (" (SH3 GNU/Linux with ELF)", stderr);
 11.1246 -+
 11.1247 -+#undef CPP_SPEC
 11.1248 -+#define CPP_SPEC \
 11.1249 -+  "-D__LITTLE_ENDIAN__ \
 11.1250 -+   -D__SH3__ -D__sh3__ \
 11.1251 -+   -D__SIZE_TYPE__=unsigned\\ int \
 11.1252 -+   -D__PTRDIFF_TYPE__=int \
 11.1253 -+   %{fPIC:-D__PIC__ -D__pic__} \
 11.1254 -+   %{fpic:-D__PIC__ -D__pic__} \
 11.1255 -+   %{posix:-D_POSIX_SOURCE} \
 11.1256 -+   %{pthread:-D_REENTRANT -D_PTHREADS}"
 11.1257 -+
 11.1258 -+#undef ASM_SPEC
 11.1259 -+#define ASM_SPEC  "%{mrelax:-relax}"
 11.1260 -+
 11.1261 -+#undef CC1_SPEC
 11.1262 -+#define CC1_SPEC \
 11.1263 -+  "-musermode -ml -m3 %{profile:-p}"
 11.1264 -+
 11.1265 -+#undef LINK_SPEC
 11.1266 -+#define LINK_SPEC \
 11.1267 -+  "%{mrelax:-relax} \
 11.1268 -+   %{shared:-shared} \
 11.1269 -+   %{!static: \
 11.1270 -+     %{rdynamic:-export-dynamic} \
 11.1271 -+     %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
 11.1272 -+    %{static:-static}"
 11.1273 -diff -ruN gcc-20030210.orig/gcc/config/sh/sh3eb-linux.h gcc-20030210/gcc/config/sh/sh3eb-linux.h
 11.1274 ---- gcc-20030210.orig/gcc/config/sh/sh3eb-linux.h	Thu Jan  1 09:00:00 1970
 11.1275 -+++ gcc-20030210/gcc/config/sh/sh3eb-linux.h	Sat Feb 22 01:40:14 2003
 11.1276 -@@ -0,0 +1,29 @@
 11.1277 -+#undef TARGET_VERSION
 11.1278 -+#define TARGET_VERSION  fputs (" (SH3EB GNU/Linux with ELF)", stderr);
 11.1279 -+
 11.1280 -+#undef CPP_SPEC
 11.1281 -+#define CPP_SPEC \
 11.1282 -+  "-D__BIG_ENDIAN__ \
 11.1283 -+   -D__SH3__ -D__sh3__ \
 11.1284 -+   -D__SIZE_TYPE__=unsigned\\ int \
 11.1285 -+   -D__PTRDIFF_TYPE__=int \
 11.1286 -+   %{fPIC:-D__PIC__ -D__pic__} \
 11.1287 -+   %{fpic:-D__PIC__ -D__pic__} \
 11.1288 -+   %{posix:-D_POSIX_SOURCE} \
 11.1289 -+   %{pthread:-D_REENTRANT -D_PTHREADS}"
 11.1290 -+
 11.1291 -+#undef ASM_SPEC
 11.1292 -+#define ASM_SPEC  "%{mrelax:-relax}"
 11.1293 -+
 11.1294 -+#undef CC1_SPEC
 11.1295 -+#define CC1_SPEC \
 11.1296 -+  "-musermode -mb -m3 %{profile:-p}"
 11.1297 -+
 11.1298 -+#undef LINK_SPEC
 11.1299 -+#define LINK_SPEC \
 11.1300 -+  "%{mrelax:-relax} \
 11.1301 -+   %{shared:-shared} \
 11.1302 -+   %{!static: \
 11.1303 -+     %{rdynamic:-export-dynamic} \
 11.1304 -+     %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
 11.1305 -+    %{static:-static}"
 11.1306 -diff -ruN gcc-20030210.orig/gcc/config/sh/sh4-linux.h gcc-20030210/gcc/config/sh/sh4-linux.h
 11.1307 ---- gcc-20030210.orig/gcc/config/sh/sh4-linux.h	Thu Jan  1 09:00:00 1970
 11.1308 -+++ gcc-20030210/gcc/config/sh/sh4-linux.h	Sat Feb 22 01:40:14 2003
 11.1309 -@@ -0,0 +1,29 @@
 11.1310 -+#undef TARGET_VERSION
 11.1311 -+#define TARGET_VERSION  fputs (" (SH4 GNU/Linux with ELF)", stderr);
 11.1312 -+
 11.1313 -+#undef CPP_SPEC
 11.1314 -+#define CPP_SPEC \
 11.1315 -+  "-D__LITTLE_ENDIAN__ \
 11.1316 -+   -D__SH4__ \
 11.1317 -+   -D__SIZE_TYPE__=unsigned\\ int \
 11.1318 -+   -D__PTRDIFF_TYPE__=int \
 11.1319 -+   %{fPIC:-D__PIC__ -D__pic__} \
 11.1320 -+   %{fpic:-D__PIC__ -D__pic__} \
 11.1321 -+   %{posix:-D_POSIX_SOURCE} \
 11.1322 -+   %{pthread:-D_REENTRANT -D_PTHREADS}"
 11.1323 -+
 11.1324 -+#undef ASM_SPEC
 11.1325 -+#define ASM_SPEC  "%{mrelax:-relax}"
 11.1326 -+
 11.1327 -+#undef CC1_SPEC
 11.1328 -+#define CC1_SPEC \
 11.1329 -+  "-musermode -ml -m4 %{profile:-p}"
 11.1330 -+
 11.1331 -+#undef LINK_SPEC
 11.1332 -+#define LINK_SPEC \
 11.1333 -+  "%{mrelax:-relax} \
 11.1334 -+   %{shared:-shared} \
 11.1335 -+   %{!static: \
 11.1336 -+     %{rdynamic:-export-dynamic} \
 11.1337 -+     %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
 11.1338 -+    %{static:-static}"
 11.1339 -diff -ruN gcc-20030210.orig/gcc/config/sh/sh4eb-linux.h gcc-20030210/gcc/config/sh/sh4eb-linux.h
 11.1340 ---- gcc-20030210.orig/gcc/config/sh/sh4eb-linux.h	Thu Jan  1 09:00:00 1970
 11.1341 -+++ gcc-20030210/gcc/config/sh/sh4eb-linux.h	Sat Feb 22 01:40:14 2003
 11.1342 -@@ -0,0 +1,29 @@
 11.1343 -+#undef TARGET_VERSION
 11.1344 -+#define TARGET_VERSION  fputs (" (SH4EB GNU/Linux with ELF)", stderr);
 11.1345 -+
 11.1346 -+#undef CPP_SPEC
 11.1347 -+#define CPP_SPEC \
 11.1348 -+  "-D__BIG_ENDIAN__ \
 11.1349 -+   -D__SH4__ \
 11.1350 -+   -D__SIZE_TYPE__=unsigned\\ int \
 11.1351 -+   -D__PTRDIFF_TYPE__=int \
 11.1352 -+   %{fPIC:-D__PIC__ -D__pic__} \
 11.1353 -+   %{fpic:-D__PIC__ -D__pic__} \
 11.1354 -+   %{posix:-D_POSIX_SOURCE} \
 11.1355 -+   %{pthread:-D_REENTRANT -D_PTHREADS}"
 11.1356 -+
 11.1357 -+#undef ASM_SPEC
 11.1358 -+#define ASM_SPEC  "%{mrelax:-relax}"
 11.1359 -+
 11.1360 -+#undef CC1_SPEC
 11.1361 -+#define CC1_SPEC \
 11.1362 -+  "-musermode -mb -m4 %{profile:-p}"
 11.1363 -+
 11.1364 -+#undef LINK_SPEC
 11.1365 -+#define LINK_SPEC \
 11.1366 -+  "%{mrelax:-relax} \
 11.1367 -+   %{shared:-shared} \
 11.1368 -+   %{!static: \
 11.1369 -+     %{rdynamic:-export-dynamic} \
 11.1370 -+     %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
 11.1371 -+    %{static:-static}"
 11.1372 -diff -ruN gcc-20030210.orig/gcc/config/sh/t-linux gcc-20030210/gcc/config/sh/t-linux
 11.1373 ---- gcc-20030210.orig/gcc/config/sh/t-linux	Thu May 17 12:16:12 2001
 11.1374 -+++ gcc-20030210/gcc/config/sh/t-linux	Sat Feb 22 01:40:14 2003
 11.1375 -@@ -1,10 +1,20 @@
 11.1376 --TARGET_LIBGCC2_CFLAGS = -fpic
 11.1377 -+TARGET_LIBGCC2_CFLAGS = -fpic -DNO_FPSCR_VALUES
 11.1378 -+LIBGCC1 = libgcc1-asm.a
 11.1379 -+CROSS_LIBGCC1 = libgcc1-asm.a
 11.1380 -+LIBGCC1_TEST = libgcc1-test
 11.1381 - LIB1ASMFUNCS = _ashiftrt _ashiftrt_n _ashiftlt _lshiftrt _movstr \
 11.1382 -   _movstr_i4 _mulsi3 _sdivsi3 _sdivsi3_i4 _udivsi3 _udivsi3_i4 _set_fpscr \
 11.1383 -   _ic_invalidate
 11.1384 -+LIB2ADDEH = $(srcdir)/unwind-sjlj.c
 11.1385 -+LIB2ADDEHDEP = unwind.inc unwind-sjlj.c
 11.1386 - 
 11.1387 --MULTILIB_OPTIONS= mb m3e/m4
 11.1388 -+MULTILIB_OPTIONS= mb m4
 11.1389 - MULTILIB_DIRNAMES= 
 11.1390 - MULTILIB_MATCHES = 
 11.1391 - 
 11.1392 --EXTRA_MULTILIB_PARTS= crtbegin.o crtend.o crtbeginS.o crtendS.o
 11.1393 -+EXTRA_MULTILIB_PARTS= crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o
 11.1394 -+
 11.1395 -+# Override t-slibgcc-elf-ver to export some libgcc symbols with
 11.1396 -+# the symbol versions that glibc used and SH specific.
 11.1397 -+SHLIB_MAPFILES =  $(srcdir)/libgcc-std.ver \
 11.1398 -+		  $(srcdir)/config/sh/libgcc-glibc.ver
 11.1399 -diff -ruN gcc-20030210.orig/gcc/config/sh/t-linux-nomulti gcc-20030210/gcc/config/sh/t-linux-nomulti
 11.1400 ---- gcc-20030210.orig/gcc/config/sh/t-linux-nomulti	Thu Jan  1 09:00:00 1970
 11.1401 -+++ gcc-20030210/gcc/config/sh/t-linux-nomulti	Sat Feb 22 01:40:14 2003
 11.1402 -@@ -0,0 +1,9 @@
 11.1403 -+LIBGCC = libgcc.a
 11.1404 -+EXTRA_PARTS = crtbegin.o crtbeginS.o crtend.o crtendS.o crtbeginT.o
 11.1405 -+
 11.1406 -+INSTALL_LIBGCC = install-libgcc
 11.1407 -+
 11.1408 -+MULTILIB_OPTIONS=
 11.1409 -+MULTILIB_DIRNAMES= 
 11.1410 -+MULTILIB_MATCHES = 
 11.1411 -+EXTRA_MULTILIB_PARTS=
 11.1412 -diff -ruN gcc-20030210.orig/gcc/config.gcc gcc-20030210/gcc/config.gcc
 11.1413 ---- gcc-20030210.orig/gcc/config.gcc	Fri Jan 31 19:17:13 2003
 11.1414 -+++ gcc-20030210/gcc/config.gcc	Sat Feb 22 01:40:14 2003
 11.1415 -@@ -337,9 +337,9 @@
 11.1416 - sparc*-*-*)
 11.1417 - 	cpu_type=sparc
 11.1418 - 	;;
 11.1419 --sh64-*-*)
 11.1420 --	cpu_type=sh
 11.1421 --	;;
 11.1422 -+sh*-*-*)
 11.1423 -+ 	cpu_type=sh
 11.1424 -+ 	;;
 11.1425 - esac
 11.1426 - 
 11.1427 - tm_file=${cpu_type}/${cpu_type}.h
 11.1428 -@@ -3018,9 +3018,31 @@
 11.1429 - 	  thread_file='rtems'
 11.1430 - 	fi
 11.1431 - 	;;
 11.1432 --sh-*-linux*)
 11.1433 -+sh*-*-linux*)
 11.1434 - 	tm_file="${tm_file} sh/elf.h sh/linux.h"
 11.1435 --	tmake_file="sh/t-sh sh/t-elf sh/t-linux"
 11.1436 -+	tmake_file="sh/t-sh sh/t-elf t-slibgcc-elf-ver t-linux sh/t-linux"
 11.1437 -+	extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o"
 11.1438 -+	case $machine in
 11.1439 -+		sh3eb-*)
 11.1440 -+			tm_file="${tm_file} sh/sh3eb-linux.h"
 11.1441 -+			tmake_file="${tmake_file} sh/t-linux-nomulti"
 11.1442 -+			;;
 11.1443 -+		sh4eb-*)
 11.1444 -+			tm_file="${tm_file} sh/sh4eb-linux.h"
 11.1445 -+			tmake_file="${tmake_file} sh/t-linux-nomulti"
 11.1446 -+			;;
 11.1447 -+		sh3-*)
 11.1448 -+			tm_file="${tm_file} sh/sh3-linux.h"
 11.1449 -+			tmake_file="${tmake_file} sh/t-linux-nomulti"
 11.1450 -+			;;
 11.1451 -+		sh4-*)
 11.1452 -+			tm_file="${tm_file} sh/sh4-linux.h"
 11.1453 -+			tmake_file="${tmake_file} sh/t-linux-nomulti"
 11.1454 -+			;;
 11.1455 -+		*)
 11.1456 -+			;;
 11.1457 -+	esac
 11.1458 -+	xmake_file=x-linux
 11.1459 - 	gas=yes gnu_ld=yes
 11.1460 - 	float_format=sh
 11.1461 - 	;;
 11.1462 -diff -ruN gcc-20030210.orig/gcc/dwarf2out.c gcc-20030210/gcc/dwarf2out.c
 11.1463 ---- gcc-20030210.orig/gcc/dwarf2out.c	Mon Feb 10 19:36:25 2003
 11.1464 -+++ gcc-20030210/gcc/dwarf2out.c	Sat Feb 22 01:40:14 2003
 11.1465 -@@ -10224,7 +10224,9 @@
 11.1466 - 	  /* We can have a normal definition following an inline one in the
 11.1467 - 	     case of redefinition of GNU C extern inlines.
 11.1468 - 	     It seems reasonable to use AT_specification in this case.  */
 11.1469 --	  && !get_AT_unsigned (old_die, DW_AT_inline))
 11.1470 -+	  && !get_AT_unsigned (old_die, DW_AT_inline)
 11.1471 -+	  /* Skip the nested function.  */
 11.1472 -+	  && !decl_function_context (decl))
 11.1473 - 	{
 11.1474 - 	  /* ??? This can happen if there is a bug in the program, for
 11.1475 - 	     instance, if it has duplicate function definitions.  Ideally,
 11.1476 -diff -ruN gcc-20030210.orig/gcc/final.c gcc-20030210/gcc/final.c
 11.1477 ---- gcc-20030210.orig/gcc/final.c	Fri Jan 31 19:17:20 2003
 11.1478 -+++ gcc-20030210/gcc/final.c	Sat Feb 22 01:40:14 2003
 11.1479 -@@ -1128,7 +1128,7 @@
 11.1480 - 	    }
 11.1481 - 	}
 11.1482 - 
 11.1483 --      INSN_ADDRESSES (uid) = insn_current_address;
 11.1484 -+      INSN_ADDRESSES (uid) = insn_current_address + insn_lengths[uid];
 11.1485 - 
 11.1486 -       if (GET_CODE (insn) == NOTE || GET_CODE (insn) == BARRIER
 11.1487 - 	  || GET_CODE (insn) == CODE_LABEL)
 11.1488 -diff -ruN gcc-20030210.orig/gcc/mkmap-symver.awk gcc-20030210/gcc/mkmap-symver.awk
 11.1489 ---- gcc-20030210.orig/gcc/mkmap-symver.awk	Fri Jan 31 19:17:26 2003
 11.1490 -+++ gcc-20030210/gcc/mkmap-symver.awk	Sat Feb 22 01:40:14 2003
 11.1491 -@@ -89,7 +89,11 @@
 11.1492 -     output(inherit[lib]);
 11.1493 - 
 11.1494 -   printf("%s {\n", lib);
 11.1495 --  printf("  global:\n");
 11.1496 -+  for (sym in ver)
 11.1497 -+    if ((ver[sym] == lib) && (sym in def))
 11.1498 -+      count++;
 11.1499 -+  if (count > 0)
 11.1500 -+    printf("  global:\n");
 11.1501 -   for (sym in ver)
 11.1502 -     if ((ver[sym] == lib) && (sym in def))
 11.1503 -       {
 11.1504 -diff -ruN gcc-20030210.orig/gcc/reload1.c gcc-20030210/gcc/reload1.c
 11.1505 ---- gcc-20030210.orig/gcc/reload1.c	Fri Jan 31 19:17:29 2003
 11.1506 -+++ gcc-20030210/gcc/reload1.c	Sat Feb 22 01:40:14 2003
 11.1507 -@@ -6103,6 +6103,7 @@
 11.1508 - 	    for (j = 0; j < n_reloads; j++)
 11.1509 - 	      if (rld[j].in != 0
 11.1510 - 		  && rld[j].when_needed != RELOAD_OTHER
 11.1511 -+		  && rld[j].when_needed != RELOAD_FOR_OUTPUT_ADDRESS
 11.1512 - 		  && reg_overlap_mentioned_for_reload_p (rld[j].in,
 11.1513 - 							 rld[i].in))
 11.1514 - 		rld[j].when_needed
 11.1515 -diff -ruN gcc-20030210.orig/gcc/reorg.c gcc-20030210/gcc/reorg.c
 11.1516 ---- gcc-20030210.orig/gcc/reorg.c	Fri Jan 31 19:17:30 2003
 11.1517 -+++ gcc-20030210/gcc/reorg.c	Sat Feb 22 01:40:14 2003
 11.1518 -@@ -3265,6 +3265,14 @@
 11.1519 - 		|| condjump_in_parallel_p (XVECEXP (PATTERN (insn), 0, 0))))
 11.1520 - 	continue;
 11.1521 - 
 11.1522 -+#ifdef MD_CAN_REDIRECT_BRANCH
 11.1523 -+      /* On some targets, branches with delay slots can have a limited
 11.1524 -+	 displacement.  Give the back end a chance to tell us we can't do
 11.1525 -+	 this.  */
 11.1526 -+      if (! MD_CAN_REDIRECT_BRANCH (insn, delay_insn))
 11.1527 -+	continue;
 11.1528 -+#endif
 11.1529 -+
 11.1530 -       target_label = JUMP_LABEL (delay_insn);
 11.1531 - 
 11.1532 -       if (target_label)
 11.1533 -diff -ruN gcc-20030210.orig/gcc/tree-inline.c gcc-20030210/gcc/tree-inline.c
 11.1534 ---- gcc-20030210.orig/gcc/tree-inline.c	Fri Jan 31 19:17:33 2003
 11.1535 -+++ gcc-20030210/gcc/tree-inline.c	Sat Feb 22 01:40:14 2003
 11.1536 -@@ -836,11 +836,17 @@
 11.1537 - 
 11.1538 -   /* Don't try to inline functions that are not well-suited to
 11.1539 -      inlining.  */
 11.1540 --  if (!inlinable_function_p (fn, id))
 11.1541 --    return NULL_TREE;
 11.1542 -+  if (! inlinable_function_p (fn, id)
 11.1543 -+      || ! (*lang_hooks.tree_inlining.start_inlining) (fn))
 11.1544 -+    {
 11.1545 -+      if (DECL_INLINE (fn) && warn_inline && ! flag_really_no_inline)
 11.1546 -+	{
 11.1547 -+	  warning_with_decl (fn, "inlining failed in call to `%s'");
 11.1548 -+	  warning ("called from here");
 11.1549 -+	}
 11.1550 - 
 11.1551 --  if (! (*lang_hooks.tree_inlining.start_inlining) (fn))
 11.1552 --    return NULL_TREE;
 11.1553 -+      return NULL_TREE;
 11.1554 -+    }
 11.1555 - 
 11.1556 -   /* Set the current filename and line number to the function we are
 11.1557 -      inlining so that when we create new _STMT nodes here they get
 11.1558 -diff -ruN gcc-20030210.orig/libjava/Makefile.in gcc-20030210/libjava/Makefile.in
 11.1559 ---- gcc-20030210.orig/libjava/Makefile.in	Tue Jan 28 10:44:37 2003
 11.1560 -+++ gcc-20030210/libjava/Makefile.in	Sat Feb 22 01:40:14 2003
 11.1561 -@@ -1637,6 +1637,7 @@
 11.1562 - 	"AS=$(AS)" \
 11.1563 - 	"CC=$(CC)" \
 11.1564 - 	"CXX=$(CXX)" \
 11.1565 -+	"GCJ=$(GCJ)" \
 11.1566 - 	"LD=$(LD)" \
 11.1567 - 	"LIBCFLAGS=$(LIBCFLAGS)" \
 11.1568 - 	"NM=$(NM)" \
 11.1569 -diff -ruN gcc-20030210.orig/libjava/configure gcc-20030210/libjava/configure
 11.1570 ---- gcc-20030210.orig/libjava/configure	Tue Jan 28 10:44:37 2003
 11.1571 -+++ gcc-20030210/libjava/configure	Sat Feb 22 01:42:11 2003
 11.1572 -@@ -2031,7 +2031,7 @@
 11.1573 - # This must be Linux ELF.
 11.1574 - linux-gnu*)
 11.1575 -   case $host_cpu in
 11.1576 --  alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* )
 11.1577 -+  alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | sh* )
 11.1578 -     lt_cv_deplibs_check_method=pass_all ;;
 11.1579 -   *)
 11.1580 -     # glibc up to 2.1.1 does not perform some relocations on ARM
 11.1581 -diff -ruN gcc-20030210.orig/libjava/java/net/natInetAddress.cc gcc-20030210/libjava/java/net/natInetAddress.cc
 11.1582 ---- gcc-20030210.orig/libjava/java/net/natInetAddress.cc	Tue Mar  5 05:02:19 2002
 11.1583 -+++ gcc-20030210/libjava/java/net/natInetAddress.cc	Sat Feb 22 01:40:14 2003
 11.1584 -@@ -56,7 +56,7 @@
 11.1585 - #endif
 11.1586 - 
 11.1587 - #ifndef HAVE_GETHOSTNAME_DECL
 11.1588 --extern "C" int gethostname (char *name, int namelen);
 11.1589 -+extern "C" int gethostname (char *name, unsigned int namelen);
 11.1590 - #endif
 11.1591 - 
 11.1592 - #ifdef DISABLE_JAVA_NET
 11.1593 -diff -ruN gcc-20030210.orig/libjava/libltdl/aclocal.m4 gcc-20030210/libjava/libltdl/aclocal.m4
 11.1594 ---- gcc-20030210.orig/libjava/libltdl/aclocal.m4	Sun Sep 10 17:04:40 2000
 11.1595 -+++ gcc-20030210/libjava/libltdl/aclocal.m4	Sat Feb 22 01:40:14 2003
 11.1596 -@@ -573,7 +573,7 @@
 11.1597 - # This must be Linux ELF.
 11.1598 - linux-gnu*)
 11.1599 -   case "$host_cpu" in
 11.1600 --  alpha* | i*86 | powerpc* | sparc* | ia64* )
 11.1601 -+  alpha* | i*86 | powerpc* | sparc* | ia64* | sh*)
 11.1602 -     lt_cv_deplibs_check_method=pass_all ;;
 11.1603 -   *)
 11.1604 -     # glibc up to 2.1.1 does not perform some relocations on ARM
 11.1605 -diff -ruN gcc-20030210.orig/libjava/sysdep/sh/locks.h gcc-20030210/libjava/sysdep/sh/locks.h
 11.1606 ---- gcc-20030210.orig/libjava/sysdep/sh/locks.h	Thu Jan  1 09:00:00 1970
 11.1607 -+++ gcc-20030210/libjava/sysdep/sh/locks.h	Sat Feb 22 01:40:14 2003
 11.1608 -@@ -0,0 +1,72 @@
 11.1609 -+// locks.h - Thread synchronization primitives. SuperH implementation.
 11.1610 -+
 11.1611 -+/* Copyright (C) 2002  Free Software Foundation
 11.1612 -+
 11.1613 -+   This file is part of libgcj.
 11.1614 -+
 11.1615 -+This software is copyrighted work licensed under the terms of the
 11.1616 -+Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
 11.1617 -+details.  */
 11.1618 -+
 11.1619 -+#ifndef __SYSDEP_LOCKS_H__
 11.1620 -+#define __SYSDEP_LOCKS_H__
 11.1621 -+
 11.1622 -+typedef size_t obj_addr_t;	/* Integer type big enough for object	*/
 11.1623 -+				/* address.				*/
 11.1624 -+
 11.1625 -+static unsigned char __cas_lock = 0;
 11.1626 -+
 11.1627 -+inline static void
 11.1628 -+__cas_start_atomic (void)
 11.1629 -+{
 11.1630 -+  unsigned int val;
 11.1631 -+
 11.1632 -+  do
 11.1633 -+    __asm__ __volatile__ ("tas.b @%1; movt %0"
 11.1634 -+			  : "=r" (val)
 11.1635 -+			  : "r" (&__cas_lock)
 11.1636 -+			  : "memory");
 11.1637 -+  while (val == 0);
 11.1638 -+}
 11.1639 -+
 11.1640 -+inline static void
 11.1641 -+__cas_end_atomic (void)
 11.1642 -+{
 11.1643 -+  __asm__ __volatile__ (" " : : : "memory");
 11.1644 -+  __cas_lock = 0;
 11.1645 -+}
 11.1646 -+
 11.1647 -+inline static bool
 11.1648 -+compare_and_swap (volatile obj_addr_t *addr, obj_addr_t old,
 11.1649 -+		  obj_addr_t new_val)
 11.1650 -+{
 11.1651 -+  bool ret;
 11.1652 -+
 11.1653 -+  __cas_start_atomic ();
 11.1654 -+  if (*addr != old)
 11.1655 -+    ret = false;
 11.1656 -+  else
 11.1657 -+    {
 11.1658 -+      *addr = new_val;
 11.1659 -+      ret = true;
 11.1660 -+    }
 11.1661 -+  __cas_end_atomic ();
 11.1662 -+
 11.1663 -+  return ret;
 11.1664 -+}
 11.1665 -+
 11.1666 -+inline static void
 11.1667 -+release_set (volatile obj_addr_t *addr, obj_addr_t new_val)
 11.1668 -+{
 11.1669 -+  __asm__ __volatile__ (" " : : : "memory");
 11.1670 -+  *(addr) = new_val;
 11.1671 -+}
 11.1672 -+
 11.1673 -+inline static bool
 11.1674 -+compare_and_swap_release (volatile obj_addr_t *addr, obj_addr_t old,
 11.1675 -+			  obj_addr_t new_val)
 11.1676 -+{
 11.1677 -+  return compare_and_swap (addr, old, new_val);
 11.1678 -+}
 11.1679 -+
 11.1680 -+#endif /* ! __SYSDEP_LOCKS_H__ */
 11.1681 -diff -ruN gcc-20030210.orig/libstdc++-v3/acinclude.m4 gcc-20030210/libstdc++-v3/acinclude.m4
 11.1682 ---- gcc-20030210.orig/libstdc++-v3/acinclude.m4	Tue Jan 28 02:30:41 2003
 11.1683 -+++ gcc-20030210/libstdc++-v3/acinclude.m4	Sat Feb 22 01:40:14 2003
 11.1684 -@@ -1828,9 +1828,10 @@
 11.1685 -   GLIBCPP_INCLUDES="-I${glibcpp_builddir}/include/${target_alias} -I${glibcpp_builddir}/include"
 11.1686 - 
 11.1687 -   # Passed down for canadian crosses.
 11.1688 --  if test x"$CANADIAN" = xyes; then
 11.1689 --    TOPLEVEL_INCLUDES='-I$(includedir)'
 11.1690 --  fi
 11.1691 -+  #if test x"$CANADIAN" = xyes; then
 11.1692 -+  #  TOPLEVEL_INCLUDES='-I$(includedir)'
 11.1693 -+  #fi
 11.1694 -+  TOPLEVEL_INCLUDES=''
 11.1695 - 
 11.1696 -   LIBMATH_INCLUDES='-I$(top_srcdir)/libmath'
 11.1697 - 
 11.1698 -diff -ruN gcc-20030210.orig/libstdc++-v3/aclocal.m4 gcc-20030210/libstdc++-v3/aclocal.m4
 11.1699 ---- gcc-20030210.orig/libstdc++-v3/aclocal.m4	Mon Feb 10 19:36:47 2003
 11.1700 -+++ gcc-20030210/libstdc++-v3/aclocal.m4	Sat Feb 22 01:40:14 2003
 11.1701 -@@ -1840,9 +1840,10 @@
 11.1702 -   GLIBCPP_INCLUDES="-I${glibcpp_builddir}/include/${target_alias} -I${glibcpp_builddir}/include"
 11.1703 - 
 11.1704 -   # Passed down for canadian crosses.
 11.1705 --  if test x"$CANADIAN" = xyes; then
 11.1706 --    TOPLEVEL_INCLUDES='-I$(includedir)'
 11.1707 --  fi
 11.1708 -+  #if test x"$CANADIAN" = xyes; then
 11.1709 -+  #  TOPLEVEL_INCLUDES='-I$(includedir)'
 11.1710 -+  #fi
 11.1711 -+  TOPLEVEL_INCLUDES=''
 11.1712 - 
 11.1713 -   LIBMATH_INCLUDES='-I$(top_srcdir)/libmath'
 11.1714 - 
 11.1715 -diff -ruN gcc-20030210.orig/libstdc++-v3/configure gcc-20030210/libstdc++-v3/configure
 11.1716 ---- gcc-20030210.orig/libstdc++-v3/configure	Mon Feb 10 19:37:17 2003
 11.1717 -+++ gcc-20030210/libstdc++-v3/configure	Sat Feb 22 01:40:14 2003
 11.1718 -@@ -1982,7 +1982,7 @@
 11.1719 - # This must be Linux ELF.
 11.1720 - linux-gnu*)
 11.1721 -   case $host_cpu in
 11.1722 --  alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* )
 11.1723 -+  alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | sh*)
 11.1724 -     lt_cv_deplibs_check_method=pass_all ;;
 11.1725 -   *)
 11.1726 -     # glibc up to 2.1.1 does not perform some relocations on ARM
 11.1727 -@@ -22340,9 +22340,10 @@
 11.1728 -   GLIBCPP_INCLUDES="-I${glibcpp_builddir}/include/${target_alias} -I${glibcpp_builddir}/include"
 11.1729 - 
 11.1730 -   # Passed down for canadian crosses.
 11.1731 --  if test x"$CANADIAN" = xyes; then
 11.1732 --    TOPLEVEL_INCLUDES='-I$(includedir)'
 11.1733 --  fi
 11.1734 -+  #if test x"$CANADIAN" = xyes; then
 11.1735 -+  #  TOPLEVEL_INCLUDES='-I$(includedir)'
 11.1736 -+  #fi
 11.1737 -+  TOPLEVEL_INCLUDES=''
 11.1738 - 
 11.1739 -   LIBMATH_INCLUDES='-I$(top_srcdir)/libmath'
 11.1740 - 
 11.1741 -diff -ruN gcc-20030210.orig/libtool.m4 gcc-20030210/libtool.m4
 11.1742 ---- gcc-20030210.orig/libtool.m4	Fri Jan 31 19:16:59 2003
 11.1743 -+++ gcc-20030210/libtool.m4	Sat Feb 22 01:40:14 2003
 11.1744 -@@ -597,7 +597,7 @@
 11.1745 - # This must be Linux ELF.
 11.1746 - linux-gnu*)
 11.1747 -   case $host_cpu in
 11.1748 --  alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* )
 11.1749 -+  alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | sh* )
 11.1750 -     lt_cv_deplibs_check_method=pass_all ;;
 11.1751 -   *)
 11.1752 -     # glibc up to 2.1.1 does not perform some relocations on ARM
 11.1753 -diff -ruN gcc-20030210.orig/zlib/configure gcc-20030210/zlib/configure
 11.1754 ---- gcc-20030210.orig/zlib/configure	Tue Jan 28 10:44:15 2003
 11.1755 -+++ gcc-20030210/zlib/configure	Sat Feb 22 01:40:14 2003
 11.1756 -@@ -1571,7 +1571,7 @@
 11.1757 - # This must be Linux ELF.
 11.1758 - linux-gnu*)
 11.1759 -   case $host_cpu in
 11.1760 --  alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* )
 11.1761 -+  alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | sh* )
 11.1762 -     lt_cv_deplibs_check_method=pass_all ;;
 11.1763 -   *)
 11.1764 -     # glibc up to 2.1.1 does not perform some relocations on ARM
    12.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.2 +++ b/patches/gcc/3.2.3/120-sh-linux-1.patch	Mon Jul 28 21:08:01 2008 +0000
    12.3 @@ -0,0 +1,1761 @@
    12.4 +diff -ruN gcc-20030210.orig/boehm-gc/configure gcc-20030210/boehm-gc/configure
    12.5 +--- gcc-20030210.orig/boehm-gc/configure	Fri Jan 31 19:17:00 2003
    12.6 ++++ gcc-20030210/boehm-gc/configure	Sat Feb 22 01:40:14 2003
    12.7 +@@ -1922,7 +1922,7 @@
    12.8 + # This must be Linux ELF.
    12.9 + linux-gnu*)
   12.10 +   case $host_cpu in
   12.11 +-  alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* )
   12.12 ++  alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | sh* )
   12.13 +     lt_cv_deplibs_check_method=pass_all ;;
   12.14 +   *)
   12.15 +     # glibc up to 2.1.1 does not perform some relocations on ARM
   12.16 +diff -ruN gcc-20030210.orig/config-ml.in gcc-20030210/config-ml.in
   12.17 +--- gcc-20030210.orig/config-ml.in	Fri Jan 31 19:16:59 2003
   12.18 ++++ gcc-20030210/config-ml.in	Sat Feb 22 01:40:14 2003
   12.19 +@@ -545,6 +545,7 @@
   12.20 + 	      if [ -d ../$${dir}/$${lib} ]; then \
   12.21 + 		flags=`echo $$i | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; \
   12.22 + 		if (cd ../$${dir}/$${lib}; $(MAKE) $(FLAGS_TO_PASS) \
   12.23 ++				DESTDIR="$(DESTDIR)" \
   12.24 + 				CFLAGS="$(CFLAGS) $${flags}" \
   12.25 + 				prefix="$(prefix)" \
   12.26 + 				exec_prefix="$(exec_prefix)" \
   12.27 +diff -ruN gcc-20030210.orig/debian/edit-specs.in gcc-20030210/debian/edit-specs.in
   12.28 +--- gcc-20030210.orig/debian/edit-specs.in	Thu Jan  1 09:00:00 1970
   12.29 ++++ gcc-20030210/debian/edit-specs.in	Sat Feb 22 01:40:14 2003
   12.30 +@@ -0,0 +1,45 @@
   12.31 ++/^*asm:$/ {
   12.32 ++n
   12.33 ++c\
   12.34 ++@AS_ENDIAN_FLAG@ %{mrelax:-relax}
   12.35 ++}
   12.36 ++/^*cpp:$/ {
   12.37 ++n
   12.38 ++c\
   12.39 ++%(cpp_default_cpu_spec)    %(subtarget_cpp_spec)    %(subtarget_cpp_ptr_spec)    %(subtarget_cpp_endian_spec)
   12.40 ++}
   12.41 ++/^*cc1:$/ {
   12.42 ++n
   12.43 ++c\
   12.44 ++-musermode @CC1_CPU_ENDIAN_FLAGS@  %{profile:-p}
   12.45 ++}
   12.46 ++/^*link:$/ {
   12.47 ++n
   12.48 ++c\
   12.49 ++%{!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}
   12.50 ++}
   12.51 ++/^*multilib:$/ {
   12.52 ++n
   12.53 ++c\
   12.54 ++. ;
   12.55 ++}
   12.56 ++/^*multilib_matches:$/ {
   12.57 ++n
   12.58 ++c\
   12.59 ++
   12.60 ++}
   12.61 ++/^*multilib_options:$/ {
   12.62 ++n
   12.63 ++c\
   12.64 ++
   12.65 ++}
   12.66 ++/^*subtarget_cpp_endian_spec:$/ {
   12.67 ++n
   12.68 ++c\
   12.69 ++@CPP_ENDIAN_DEF@
   12.70 ++}
   12.71 ++/^*cpp_default_cpu_spec:$/ {
   12.72 ++n
   12.73 ++c\
   12.74 ++@CPP_CPU_DEFS@
   12.75 ++}
   12.76 +diff -ruN gcc-20030210.orig/debian/install-CPU-linux gcc-20030210/debian/install-CPU-linux
   12.77 +--- gcc-20030210.orig/debian/install-CPU-linux	Thu Jan  1 09:00:00 1970
   12.78 ++++ gcc-20030210/debian/install-CPU-linux	Sat Feb 22 01:40:14 2003
   12.79 +@@ -0,0 +1,111 @@
   12.80 ++#! /bin/sh
   12.81 ++
   12.82 ++VERSION=$1; shift
   12.83 ++CPU=$1
   12.84 ++
   12.85 ++# literally (binary-ly) same
   12.86 ++PROGS_C="cpp gcc"
   12.87 ++PROGS_ADDITIONAL="c++ g++ g77 gcj"
   12.88 ++
   12.89 ++DRIVERS_C="cc1 cpp0 tradcpp0"
   12.90 ++DRIVERS_ADDITIONAL="cc1obj cc1plus collect2 f771 jc1 jvgenmain"
   12.91 ++if [ -z "$STEP1_COMPILER_BUILD" ]; then
   12.92 ++  PROGS="$PROGS_C $PROGS_ADDITIONAL"
   12.93 ++  DRIVERS="$DRIVERS_C $DRIVERSADDITIONAL"
   12.94 ++  INITIAL=""
   12.95 ++else
   12.96 ++  PROGS=$PROGS_C
   12.97 ++  DRIVERS=$DRIVERS_C
   12.98 ++  INITIAL="-initial"
   12.99 ++fi
  12.100 ++
  12.101 ++OBJS="crtbegin.o crtbeginS.o crtend.o crtendS.o"
  12.102 ++LIBS_C="libgcc.a"
  12.103 ++LIBS_1="libgcc_s.so libgcc_s.so.1 libstdc++.so libstdc++.so.3 libstdc++.so.3.0.2"
  12.104 ++LIBS_2="libobjc.a libstdc++.a libsupc++.a"
  12.105 ++INCLUDE="include"
  12.106 ++
  12.107 ++cd debian/gcc-sh-linux-others${INITIAL} || exit 1
  12.108 ++
  12.109 ++# Make directories.
  12.110 ++mkdir -p usr/bin usr/share usr/share/man usr/share/man/man1 usr/lib \
  12.111 ++	 usr/lib/gcc-lib usr/lib/gcc-lib/${CPU}-linux \
  12.112 ++	 usr/lib/gcc-lib/${CPU}-linux/${VERSION} \
  12.113 ++	 usr/${CPU}-linux usr/${CPU}-linux/lib
  12.114 ++
  12.115 ++# Make symbolic links for include dir.
  12.116 ++(cd usr/${CPU}-linux; ln -s ../sh-linux/include .)
  12.117 ++
  12.118 ++# Make symbolic links for executables.
  12.119 ++(cd usr/bin;
  12.120 ++  for p in ${PROGS}; do
  12.121 ++    ln -s shCPU-linux-GCC ${CPU}-linux-$p
  12.122 ++  done)
  12.123 ++
  12.124 ++case "${CPU}" in
  12.125 ++    sh3)
  12.126 ++	MULTILIBDIR=
  12.127 ++	AS_ENDIAN_FLAG="-little"
  12.128 ++	CPP_ENDIAN_DEF="-D__LITTLE_ENDIAN__"
  12.129 ++	CPP_CPU_DEFS="-D__SH3__ -D__sh3__"
  12.130 ++	CC1_CPU_ENDIAN_FLAGS="-ml -m3"
  12.131 ++	LINKER_CPU_ENDIAN_FLAGS="-m shlelf_linux -EL --architecture sh3"
  12.132 ++	LINKER_RPATH_LINK_FLAG="-rpath-link /usr/sh3-linux/lib"
  12.133 ++    ;;
  12.134 ++    sh3eb)
  12.135 ++	MULTILIBDIR=/mb
  12.136 ++	AS_ENDIAN_FLAG="-big"
  12.137 ++	CPP_ENDIAN_DEF="-D__BIG_ENDIAN__"
  12.138 ++	CPP_CPU_DEFS="-D__SH3__ -D__sh3__"
  12.139 ++	CC1_CPU_ENDIAN_FLAGS="-mb -m3"
  12.140 ++	LINKER_CPU_ENDIAN_FLAGS="-m shelf_linux -EB --architecture sh3"
  12.141 ++	LINKER_RPATH_LINK_FLAG="-rpath-link /usr/sh3eb-linux/lib"
  12.142 ++    ;;
  12.143 ++    sh4)
  12.144 ++	MULTILIBDIR=/m4
  12.145 ++	AS_ENDIAN_FLAG="-little"
  12.146 ++	CPP_ENDIAN_DEF="-D__LITTLE_ENDIAN__"
  12.147 ++	CPP_CPU_DEFS="-D__SH4__"
  12.148 ++	CC1_CPU_ENDIAN_FLAGS="-ml -m4"
  12.149 ++	LINKER_CPU_ENDIAN_FLAGS="-m shlelf_linux -EL --architecture sh4"
  12.150 ++	LINKER_RPATH_LINK_FLAG="-rpath-link /usr/sh4-linux/lib"
  12.151 ++    ;;
  12.152 ++    sh4eb)
  12.153 ++	MULTILIBDIR=/mb/m4
  12.154 ++	AS_ENDIAN_FLAG="-big"
  12.155 ++	CPP_ENDIAN_DEF="-D__BIG_ENDIAN__"
  12.156 ++	CPP_CPU_DEFS="-D__SH4__"
  12.157 ++	CC1_CPU_ENDIAN_FLAGS="-mb -m4"
  12.158 ++	LINKER_CPU_ENDIAN_FLAGS="-m shelf_linux -EB --architecture sh4"
  12.159 ++	LINKER_RPATH_LINK_FLAG="-rpath-link /usr/sh4eb-linux/lib"
  12.160 ++    ;;
  12.161 ++esac
  12.162 ++
  12.163 ++# Make symbolic links for GCC drivers, objects, libraries, and include dir.
  12.164 ++(cd usr/lib/gcc-lib/${CPU}-linux/${VERSION};
  12.165 ++ for f in ${DRIVERS} ${INCLUDE}; do
  12.166 ++    ln -s ../../sh-linux/${VERSION}/$f $f;
  12.167 ++ done
  12.168 ++ for f in ${OBJS} ${LIBS_C}; do
  12.169 ++    ln -s ../../sh-linux/${VERSION}${MULTILIBDIR}/$f $f;
  12.170 ++ done)
  12.171 ++
  12.172 ++if [ -z "$STEP1_COMPILER_BUILD" ]; then
  12.173 ++  for f in ${LIBS_1} ${LIBS_2}; do
  12.174 ++    mv ../gcc-sh-linux/usr/sh-linux/lib${MULTILIBDIR}/$f usr/${CPU}-linux/lib/;
  12.175 ++  done
  12.176 ++fi
  12.177 ++
  12.178 ++sed -e "s+@AS_ENDIAN_FLAG@+${AS_ENDIAN_FLAG}+" \
  12.179 ++    -e "s+@CPP_ENDIAN_DEF@+${CPP_ENDIAN_DEF}+" \
  12.180 ++    -e "s+@CPP_CPU_DEFS@+${CPP_CPU_DEFS}+" \
  12.181 ++    -e "s+@CC1_CPU_ENDIAN_FLAGS@+${CC1_CPU_ENDIAN_FLAGS}+" \
  12.182 ++    -e "s+@LINKER_CPU_ENDIAN_FLAGS@+${LINKER_CPU_ENDIAN_FLAGS}+" \
  12.183 ++    -e "s+@LINKER_RPATH_LINK_FLAG@+${LINKER_RPATH_LINK_FLAG}+" \
  12.184 ++    ../edit-specs.in >../edit-specs-${CPU}.sed
  12.185 ++
  12.186 ++sed -f ../edit-specs-${CPU}.sed \
  12.187 ++    ../gcc-sh-linux${INITIAL}/usr/lib/gcc-lib/sh-linux/${VERSION}/specs \
  12.188 ++    > usr/lib/gcc-lib/${CPU}-linux/${VERSION}/specs
  12.189 ++
  12.190 ++exit 0
  12.191 +diff -ruN gcc-20030210.orig/debian/multilib-symlink gcc-20030210/debian/multilib-symlink
  12.192 +--- gcc-20030210.orig/debian/multilib-symlink	Thu Jan  1 09:00:00 1970
  12.193 ++++ gcc-20030210/debian/multilib-symlink	Sat Feb 22 01:40:14 2003
  12.194 +@@ -0,0 +1,10 @@
  12.195 ++#! /bin/sh
  12.196 ++
  12.197 ++cd /usr/sh-linux/lib
  12.198 ++ln -s ../../sh3-linux/lib/{*.a,*.so*,*.o} .
  12.199 ++cd m4
  12.200 ++ln -s ../../../sh4-linux/lib/{*.a,*.so*,*.o} .
  12.201 ++cd ../mb
  12.202 ++ln -s ../../../sh3eb-linux/lib/{*.a,*.so*,*.o} .
  12.203 ++cd m4
  12.204 ++ln -s ../../../../sh4eb-linux/lib/{*.a,*.so*,*.o} .
  12.205 +diff -ruN gcc-20030210.orig/debian/shCPU-linux-GCC gcc-20030210/debian/shCPU-linux-GCC
  12.206 +--- gcc-20030210.orig/debian/shCPU-linux-GCC	Thu Jan  1 09:00:00 1970
  12.207 ++++ gcc-20030210/debian/shCPU-linux-GCC	Sat Feb 22 01:40:14 2003
  12.208 +@@ -0,0 +1,59 @@
  12.209 ++#! /bin/bash
  12.210 ++
  12.211 ++BASENAME=${0##*/}
  12.212 ++PROG=${BASENAME##*-}
  12.213 ++CPU=${BASENAME%%-*}
  12.214 ++
  12.215 ++if [ "$PROG" = gcc ]; then
  12.216 ++    if [ "$1" = "-b" -a "$2" = "i386-linux" ]; then
  12.217 ++	shift 2
  12.218 ++	exec /usr/bin/gcc "$@"
  12.219 ++    elif [ "$1" = "-print-multi-lib" -o "$1" = "--print-multi-lib" ]; then
  12.220 ++	echo ".;"
  12.221 ++	exit 0
  12.222 ++    elif [ "$1" = "-print-multi-os-directory" -o "$1" = "--print-multi-os-directory" ]; then
  12.223 ++	echo "."
  12.224 ++	exit 0
  12.225 ++    elif [ "$1" = "-dumpspecs" ]; then
  12.226 ++	cat /usr/lib/gcc-lib/${CPU}-linux/@@VERSION@@/specs
  12.227 ++	exit 0
  12.228 ++    fi
  12.229 ++fi
  12.230 ++
  12.231 ++case "${CPU}" in
  12.232 ++    sh3)
  12.233 ++	ARCH=m3
  12.234 ++	DEFINES="-D__sh3__ -D__SH3__ -D__LITTLE_ENDIAN__"
  12.235 ++	ENDIAN=ml
  12.236 ++    ;;
  12.237 ++    sh3eb)
  12.238 ++	ARCH=m3
  12.239 ++	DEFINES="-D__sh3__ -D__SH3__ -D__BIG_ENDIAN__"
  12.240 ++	ENDIAN=mb
  12.241 ++    ;;
  12.242 ++    sh4)
  12.243 ++	ARCH=m4
  12.244 ++	DEFINES="-D__SH4__ -D__LITTLE_ENDIAN__"
  12.245 ++	ENDIAN=ml
  12.246 ++    ;;
  12.247 ++    sh4eb)
  12.248 ++	ARCH=m4
  12.249 ++	DEFINES="-D__SH4__ -D__BIG_ENDIAN__"
  12.250 ++	ENDIAN=mb
  12.251 ++    ;;
  12.252 ++esac
  12.253 ++
  12.254 ++# Prepend the appropriate options
  12.255 ++# If user specifies some options, it will be overridden
  12.256 ++
  12.257 ++case "${PROG}" in
  12.258 ++    cpp)
  12.259 ++	exec sh-linux-${PROG} $DEFINES "$@"
  12.260 ++    ;;
  12.261 ++    c++|g++|g77|gcc|gcj)
  12.262 ++	exec sh-linux-${PROG} -$ARCH -$ENDIAN "$@"
  12.263 ++    ;;
  12.264 ++esac
  12.265 ++
  12.266 ++echo "Something wrong..."
  12.267 ++exit 1
  12.268 +diff -ruN gcc-20030210.orig/gcc/config/sh/elf.h gcc-20030210/gcc/config/sh/elf.h
  12.269 +--- gcc-20030210.orig/gcc/config/sh/elf.h	Fri Feb 22 01:42:28 2002
  12.270 ++++ gcc-20030210/gcc/config/sh/elf.h	Sat Feb 22 01:40:14 2003
  12.271 +@@ -170,3 +170,7 @@
  12.272 + #undef ENDFILE_SPEC
  12.273 + #define ENDFILE_SPEC \
  12.274 +   "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
  12.275 ++
  12.276 ++/* ASM_OUTPUT_CASE_LABEL is defined in elfos.h.  With it, 
  12.277 ++   redundant .align will be generated.  */
  12.278 ++#undef  ASM_OUTPUT_CASE_LABEL
  12.279 +diff -ruN gcc-20030210.orig/gcc/config/sh/lib1funcs.asm gcc-20030210/gcc/config/sh/lib1funcs.asm
  12.280 +--- gcc-20030210.orig/gcc/config/sh/lib1funcs.asm	Fri Feb 22 01:42:28 2002
  12.281 ++++ gcc-20030210/gcc/config/sh/lib1funcs.asm	Sat Feb 22 01:40:14 2003
  12.282 +@@ -39,8 +39,13 @@
  12.283 + 
  12.284 + #ifdef __ELF__
  12.285 + #define LOCAL(X) .L_##X
  12.286 ++#define FUNC(X) .type X,@function; .hidden X
  12.287 ++#define _ENDFUNC(X) .Lfe_##X: .size X,.Lfe_##X-X
  12.288 ++#define ENDFUNC(X) _ENDFUNC(X)
  12.289 + #else
  12.290 + #define LOCAL(X) L_##X
  12.291 ++#define FUNC(X)
  12.292 ++#define ENDFUNC(X)
  12.293 + #endif
  12.294 + 
  12.295 + #ifdef __linux__
  12.296 +@@ -91,6 +96,40 @@
  12.297 + 	.global	GLOBAL(ashiftrt_r4_31)
  12.298 + 	.global	GLOBAL(ashiftrt_r4_32)
  12.299 + 
  12.300 ++	FUNC(GLOBAL(ashiftrt_r4_0))
  12.301 ++	FUNC(GLOBAL(ashiftrt_r4_1))
  12.302 ++	FUNC(GLOBAL(ashiftrt_r4_2))
  12.303 ++	FUNC(GLOBAL(ashiftrt_r4_3))
  12.304 ++	FUNC(GLOBAL(ashiftrt_r4_4))
  12.305 ++	FUNC(GLOBAL(ashiftrt_r4_5))
  12.306 ++	FUNC(GLOBAL(ashiftrt_r4_6))
  12.307 ++	FUNC(GLOBAL(ashiftrt_r4_7))
  12.308 ++	FUNC(GLOBAL(ashiftrt_r4_8))
  12.309 ++	FUNC(GLOBAL(ashiftrt_r4_9))
  12.310 ++	FUNC(GLOBAL(ashiftrt_r4_10))
  12.311 ++	FUNC(GLOBAL(ashiftrt_r4_11))
  12.312 ++	FUNC(GLOBAL(ashiftrt_r4_12))
  12.313 ++	FUNC(GLOBAL(ashiftrt_r4_13))
  12.314 ++	FUNC(GLOBAL(ashiftrt_r4_14))
  12.315 ++	FUNC(GLOBAL(ashiftrt_r4_15))
  12.316 ++	FUNC(GLOBAL(ashiftrt_r4_16))
  12.317 ++	FUNC(GLOBAL(ashiftrt_r4_17))
  12.318 ++	FUNC(GLOBAL(ashiftrt_r4_18))
  12.319 ++	FUNC(GLOBAL(ashiftrt_r4_19))
  12.320 ++	FUNC(GLOBAL(ashiftrt_r4_20))
  12.321 ++	FUNC(GLOBAL(ashiftrt_r4_21))
  12.322 ++	FUNC(GLOBAL(ashiftrt_r4_22))
  12.323 ++	FUNC(GLOBAL(ashiftrt_r4_23))
  12.324 ++	FUNC(GLOBAL(ashiftrt_r4_24))
  12.325 ++	FUNC(GLOBAL(ashiftrt_r4_25))
  12.326 ++	FUNC(GLOBAL(ashiftrt_r4_26))
  12.327 ++	FUNC(GLOBAL(ashiftrt_r4_27))
  12.328 ++	FUNC(GLOBAL(ashiftrt_r4_28))
  12.329 ++	FUNC(GLOBAL(ashiftrt_r4_29))
  12.330 ++	FUNC(GLOBAL(ashiftrt_r4_30))
  12.331 ++	FUNC(GLOBAL(ashiftrt_r4_31))
  12.332 ++	FUNC(GLOBAL(ashiftrt_r4_32))
  12.333 ++
  12.334 + 	.align	1
  12.335 + GLOBAL(ashiftrt_r4_32):
  12.336 + GLOBAL(ashiftrt_r4_31):
  12.337 +@@ -170,6 +209,41 @@
  12.338 + GLOBAL(ashiftrt_r4_0):
  12.339 + 	rts
  12.340 + 	nop
  12.341 ++
  12.342 ++	ENDFUNC(GLOBAL(ashiftrt_r4_0))
  12.343 ++	ENDFUNC(GLOBAL(ashiftrt_r4_1))
  12.344 ++	ENDFUNC(GLOBAL(ashiftrt_r4_2))
  12.345 ++	ENDFUNC(GLOBAL(ashiftrt_r4_3))
  12.346 ++	ENDFUNC(GLOBAL(ashiftrt_r4_4))
  12.347 ++	ENDFUNC(GLOBAL(ashiftrt_r4_5))
  12.348 ++	ENDFUNC(GLOBAL(ashiftrt_r4_6))
  12.349 ++	ENDFUNC(GLOBAL(ashiftrt_r4_7))
  12.350 ++	ENDFUNC(GLOBAL(ashiftrt_r4_8))
  12.351 ++	ENDFUNC(GLOBAL(ashiftrt_r4_9))
  12.352 ++	ENDFUNC(GLOBAL(ashiftrt_r4_10))
  12.353 ++	ENDFUNC(GLOBAL(ashiftrt_r4_11))
  12.354 ++	ENDFUNC(GLOBAL(ashiftrt_r4_12))
  12.355 ++	ENDFUNC(GLOBAL(ashiftrt_r4_13))
  12.356 ++	ENDFUNC(GLOBAL(ashiftrt_r4_14))
  12.357 ++	ENDFUNC(GLOBAL(ashiftrt_r4_15))
  12.358 ++	ENDFUNC(GLOBAL(ashiftrt_r4_16))
  12.359 ++	ENDFUNC(GLOBAL(ashiftrt_r4_17))
  12.360 ++	ENDFUNC(GLOBAL(ashiftrt_r4_18))
  12.361 ++	ENDFUNC(GLOBAL(ashiftrt_r4_19))
  12.362 ++	ENDFUNC(GLOBAL(ashiftrt_r4_20))
  12.363 ++	ENDFUNC(GLOBAL(ashiftrt_r4_21))
  12.364 ++	ENDFUNC(GLOBAL(ashiftrt_r4_22))
  12.365 ++	ENDFUNC(GLOBAL(ashiftrt_r4_23))
  12.366 ++	ENDFUNC(GLOBAL(ashiftrt_r4_24))
  12.367 ++	ENDFUNC(GLOBAL(ashiftrt_r4_25))
  12.368 ++	ENDFUNC(GLOBAL(ashiftrt_r4_26))
  12.369 ++	ENDFUNC(GLOBAL(ashiftrt_r4_27))
  12.370 ++	ENDFUNC(GLOBAL(ashiftrt_r4_28))
  12.371 ++	ENDFUNC(GLOBAL(ashiftrt_r4_29))
  12.372 ++	ENDFUNC(GLOBAL(ashiftrt_r4_30))
  12.373 ++	ENDFUNC(GLOBAL(ashiftrt_r4_31))
  12.374 ++	ENDFUNC(GLOBAL(ashiftrt_r4_32))
  12.375 ++
  12.376 + #endif
  12.377 + 
  12.378 + #ifdef L_ashiftrt_n
  12.379 +@@ -192,6 +266,7 @@
  12.380 + !
  12.381 + 
  12.382 + 	.global	GLOBAL(ashrsi3)
  12.383 ++	FUNC(GLOBAL(ashrsi3))
  12.384 + 	.align	2
  12.385 + GLOBAL(ashrsi3):
  12.386 + 	mov	#31,r0
  12.387 +@@ -319,6 +394,8 @@
  12.388 + 	rts
  12.389 + 	nop
  12.390 + 
  12.391 ++	ENDFUNC(GLOBAL(ashrsi3))
  12.392 ++
  12.393 + #endif
  12.394 + 
  12.395 + #ifdef L_ashiftlt
  12.396 +@@ -340,6 +417,7 @@
  12.397 + ! (none)
  12.398 + !
  12.399 + 	.global	GLOBAL(ashlsi3)
  12.400 ++	FUNC(GLOBAL(ashlsi3))
  12.401 + 	.align	2
  12.402 + GLOBAL(ashlsi3):
  12.403 + 	mov	#31,r0
  12.404 +@@ -476,6 +554,8 @@
  12.405 + 	rts
  12.406 + 	nop
  12.407 + 
  12.408 ++	ENDFUNC(GLOBAL(ashlsi3))
  12.409 ++
  12.410 + #endif
  12.411 + 
  12.412 + #ifdef L_lshiftrt
  12.413 +@@ -497,6 +577,7 @@
  12.414 + ! (none)
  12.415 + !
  12.416 + 	.global	GLOBAL(lshrsi3)
  12.417 ++	FUNC(GLOBAL(lshrsi3))
  12.418 + 	.align	2
  12.419 + GLOBAL(lshrsi3):
  12.420 + 	mov	#31,r0
  12.421 +@@ -633,6 +714,8 @@
  12.422 + 	rts
  12.423 + 	nop
  12.424 + 
  12.425 ++	ENDFUNC(GLOBAL(lshrsi3))
  12.426 ++
  12.427 + #endif
  12.428 + 
  12.429 + #ifdef L_movstr
  12.430 +@@ -649,76 +732,113 @@
  12.431 + 	add	#64,r4
  12.432 + 	.align	4
  12.433 + 	.global	GLOBAL(movstrSI64)
  12.434 ++	FUNC(GLOBAL(movstrSI64))
  12.435 + GLOBAL(movstrSI64):
  12.436 + 	mov.l	@(60,r5),r0
  12.437 + 	mov.l	r0,@(60,r4)
  12.438 + 	.global	GLOBAL(movstrSI60)
  12.439 ++	FUNC(GLOBAL(movstrSI60))
  12.440 + GLOBAL(movstrSI60):
  12.441 + 	mov.l	@(56,r5),r0
  12.442 + 	mov.l	r0,@(56,r4)
  12.443 + 	.global	GLOBAL(movstrSI56)
  12.444 ++	FUNC(GLOBAL(movstrSI56))
  12.445 + GLOBAL(movstrSI56):
  12.446 + 	mov.l	@(52,r5),r0
  12.447 + 	mov.l	r0,@(52,r4)
  12.448 + 	.global	GLOBAL(movstrSI52)
  12.449 ++	FUNC(GLOBAL(movstrSI52))
  12.450 + GLOBAL(movstrSI52):
  12.451 + 	mov.l	@(48,r5),r0
  12.452 + 	mov.l	r0,@(48,r4)
  12.453 + 	.global	GLOBAL(movstrSI48)
  12.454 ++	FUNC(GLOBAL(movstrSI48))
  12.455 + GLOBAL(movstrSI48):
  12.456 + 	mov.l	@(44,r5),r0
  12.457 + 	mov.l	r0,@(44,r4)
  12.458 + 	.global	GLOBAL(movstrSI44)
  12.459 ++	FUNC(GLOBAL(movstrSI44))
  12.460 + GLOBAL(movstrSI44):
  12.461 + 	mov.l	@(40,r5),r0
  12.462 + 	mov.l	r0,@(40,r4)
  12.463 + 	.global	GLOBAL(movstrSI40)
  12.464 ++	FUNC(GLOBAL(movstrSI40))
  12.465 + GLOBAL(movstrSI40):
  12.466 + 	mov.l	@(36,r5),r0
  12.467 + 	mov.l	r0,@(36,r4)
  12.468 + 	.global	GLOBAL(movstrSI36)
  12.469 ++	FUNC(GLOBAL(movstrSI36))
  12.470 + GLOBAL(movstrSI36):
  12.471 + 	mov.l	@(32,r5),r0
  12.472 + 	mov.l	r0,@(32,r4)
  12.473 + 	.global	GLOBAL(movstrSI32)
  12.474 ++	FUNC(GLOBAL(movstrSI32))
  12.475 + GLOBAL(movstrSI32):
  12.476 + 	mov.l	@(28,r5),r0
  12.477 + 	mov.l	r0,@(28,r4)
  12.478 + 	.global	GLOBAL(movstrSI28)
  12.479 ++	FUNC(GLOBAL(movstrSI28))
  12.480 + GLOBAL(movstrSI28):
  12.481 + 	mov.l	@(24,r5),r0
  12.482 + 	mov.l	r0,@(24,r4)
  12.483 + 	.global	GLOBAL(movstrSI24)
  12.484 ++	FUNC(GLOBAL(movstrSI24))
  12.485 + GLOBAL(movstrSI24):
  12.486 + 	mov.l	@(20,r5),r0
  12.487 + 	mov.l	r0,@(20,r4)
  12.488 + 	.global	GLOBAL(movstrSI20)
  12.489 ++	FUNC(GLOBAL(movstrSI20))
  12.490 + GLOBAL(movstrSI20):
  12.491 + 	mov.l	@(16,r5),r0
  12.492 + 	mov.l	r0,@(16,r4)
  12.493 + 	.global	GLOBAL(movstrSI16)
  12.494 ++	FUNC(GLOBAL(movstrSI16))
  12.495 + GLOBAL(movstrSI16):
  12.496 + 	mov.l	@(12,r5),r0
  12.497 + 	mov.l	r0,@(12,r4)
  12.498 + 	.global	GLOBAL(movstrSI12)
  12.499 ++	FUNC(GLOBAL(movstrSI12))
  12.500 + GLOBAL(movstrSI12):
  12.501 + 	mov.l	@(8,r5),r0
  12.502 + 	mov.l	r0,@(8,r4)
  12.503 + 	.global	GLOBAL(movstrSI8)
  12.504 ++	FUNC(GLOBAL(movstrSI8))
  12.505 + GLOBAL(movstrSI8):
  12.506 + 	mov.l	@(4,r5),r0
  12.507 + 	mov.l	r0,@(4,r4)
  12.508 + 	.global	GLOBAL(movstrSI4)
  12.509 ++	FUNC(GLOBAL(movstrSI4))
  12.510 + GLOBAL(movstrSI4):
  12.511 + 	mov.l	@(0,r5),r0
  12.512 + 	mov.l	r0,@(0,r4)
  12.513 ++	.global	GLOBAL(movstrSI0)
  12.514 ++	FUNC(GLOBAL(movstrSI0))
  12.515 + GLOBAL(movstrSI0):
  12.516 + 	rts
  12.517 + 	nop
  12.518 + 
  12.519 ++	ENDFUNC(GLOBAL(movstrSI64))
  12.520 ++	ENDFUNC(GLOBAL(movstrSI60))
  12.521 ++	ENDFUNC(GLOBAL(movstrSI56))
  12.522 ++	ENDFUNC(GLOBAL(movstrSI52))
  12.523 ++	ENDFUNC(GLOBAL(movstrSI48))
  12.524 ++	ENDFUNC(GLOBAL(movstrSI44))
  12.525 ++	ENDFUNC(GLOBAL(movstrSI40))
  12.526 ++	ENDFUNC(GLOBAL(movstrSI36))
  12.527 ++	ENDFUNC(GLOBAL(movstrSI32))
  12.528 ++	ENDFUNC(GLOBAL(movstrSI28))
  12.529 ++	ENDFUNC(GLOBAL(movstrSI24))
  12.530 ++	ENDFUNC(GLOBAL(movstrSI20))
  12.531 ++	ENDFUNC(GLOBAL(movstrSI16))
  12.532 ++	ENDFUNC(GLOBAL(movstrSI12))
  12.533 ++	ENDFUNC(GLOBAL(movstrSI8))
  12.534 ++	ENDFUNC(GLOBAL(movstrSI4))
  12.535 ++	ENDFUNC(GLOBAL(movstrSI0))
  12.536 ++
  12.537 + 	.align	4
  12.538 + 
  12.539 + 	.global	GLOBAL(movstr)
  12.540 ++	FUNC(GLOBAL(movstr))
  12.541 + GLOBAL(movstr):
  12.542 + 	mov.l	@(60,r5),r0
  12.543 + 	mov.l	r0,@(60,r4)
  12.544 +@@ -775,6 +895,8 @@
  12.545 + 	add	#64,r5
  12.546 + 	bra	GLOBAL(movstr)
  12.547 + 	add	#64,r4
  12.548 ++
  12.549 ++	FUNC(GLOBAL(movstr))
  12.550 + #endif
  12.551 + 
  12.552 + #ifdef L_movstr_i4
  12.553 +@@ -783,6 +905,10 @@
  12.554 + 	.global	GLOBAL(movstr_i4_odd)
  12.555 + 	.global	GLOBAL(movstrSI12_i4)
  12.556 + 
  12.557 ++	FUNC(GLOBAL(movstr_i4_even))
  12.558 ++	FUNC(GLOBAL(movstr_i4_odd))
  12.559 ++	FUNC(GLOBAL(movstrSI12_i4))
  12.560 ++
  12.561 + 	.p2align	5
  12.562 + L_movstr_2mod4_end:
  12.563 + 	mov.l	r0,@(16,r4)
  12.564 +@@ -791,6 +917,11 @@
  12.565 + 
  12.566 + 	.p2align	2
  12.567 + 
  12.568 ++GLOBAL(movstr_i4_even):
  12.569 ++	mov.l	@r5+,r0
  12.570 ++	bra	L_movstr_start_even
  12.571 ++	mov.l	@r5+,r1
  12.572 ++
  12.573 + GLOBAL(movstr_i4_odd):
  12.574 + 	mov.l	@r5+,r1
  12.575 + 	add	#-4,r4
  12.576 +@@ -817,10 +948,8 @@
  12.577 + 	rts
  12.578 + 	mov.l	r3,@(12,r4)
  12.579 + 
  12.580 +-GLOBAL(movstr_i4_even):
  12.581 +-	mov.l	@r5+,r0
  12.582 +-	bra	L_movstr_start_even
  12.583 +-	mov.l	@r5+,r1
  12.584 ++	ENDFUNC(GLOBAL(movstr_i4_even))
  12.585 ++	ENDFUNC(GLOBAL(movstr_i4_odd))
  12.586 + 
  12.587 + 	.p2align	4
  12.588 + GLOBAL(movstrSI12_i4):
  12.589 +@@ -831,12 +960,16 @@
  12.590 + 	mov.l	r1,@(4,r4)
  12.591 + 	rts
  12.592 + 	mov.l	r2,@(8,r4)
  12.593 ++
  12.594 ++	ENDFUNC(GLOBAL(movstrSI12_i4))
  12.595 ++
  12.596 + #endif
  12.597 + 
  12.598 + #ifdef L_mulsi3
  12.599 + 
  12.600 + 
  12.601 + 	.global	GLOBAL(mulsi3)
  12.602 ++	FUNC(GLOBAL(mulsi3))
  12.603 + 
  12.604 + ! r4 =       aabb
  12.605 + ! r5 =       ccdd
  12.606 +@@ -869,7 +1002,7 @@
  12.607 + 	rts
  12.608 + 	add	r2,r0
  12.609 + 
  12.610 +-
  12.611 ++	FUNC(GLOBAL(mulsi3))
  12.612 + #endif
  12.613 + #endif /* ! __SH5__ */
  12.614 + #ifdef L_sdivsi3_i4
  12.615 +@@ -879,6 +1012,7 @@
  12.616 + !! args in r4 and r5, result in fpul, clobber dr0, dr2
  12.617 + 
  12.618 + 	.global	GLOBAL(sdivsi3_i4)
  12.619 ++	FUNC(GLOBAL(sdivsi3_i4))
  12.620 + GLOBAL(sdivsi3_i4):
  12.621 + 	lds r4,fpul
  12.622 + 	float fpul,dr0
  12.623 +@@ -888,6 +1022,8 @@
  12.624 + 	rts
  12.625 + 	ftrc dr0,fpul
  12.626 + 
  12.627 ++	ENDFUNC(GLOBAL(sdivsi3_i4))
  12.628 ++
  12.629 + #elif defined(__SH4_SINGLE__) || defined(__SH4_SINGLE_ONLY__) || (defined (__SH5__) && ! defined __SH4_NOFPU__)
  12.630 + !! args in r4 and r5, result in fpul, clobber r2, dr0, dr2
  12.631 + 
  12.632 +@@ -896,6 +1032,7 @@
  12.633 + 	.mode	SHcompact
  12.634 + #endif
  12.635 + 	.global	GLOBAL(sdivsi3_i4)
  12.636 ++	FUNC(GLOBAL(sdivsi3_i4))
  12.637 + GLOBAL(sdivsi3_i4):
  12.638 + 	sts.l fpscr,@-r15
  12.639 + 	mov #8,r2
  12.640 +@@ -910,6 +1047,8 @@
  12.641 + 	rts
  12.642 + 	lds.l @r15+,fpscr
  12.643 + 
  12.644 ++	ENDFUNC(GLOBAL(sdivsi3_i4))
  12.645 ++
  12.646 + #endif /* ! __SH5__ || __SH5__ == 32 */
  12.647 + #endif /* ! __SH4__ */
  12.648 + #endif
  12.649 +@@ -924,9 +1063,10 @@
  12.650 + !!
  12.651 + !!
  12.652 + 
  12.653 +-!! args in r4 and r5, result in r0 clobber r1,r2,r3
  12.654 ++!! args in r4 and r5, result in r0 clobber r1, r2, r3, and t bit
  12.655 + 
  12.656 + 	.global	GLOBAL(sdivsi3)
  12.657 ++	FUNC(GLOBAL(sdivsi3))
  12.658 + #if __SHMEDIA__
  12.659 + #if __SH5__ == 32
  12.660 + 	.section	.text..SHmedia32,"ax"
  12.661 +@@ -1076,6 +1216,7 @@
  12.662 + div0:	rts
  12.663 + 	mov	#0,r0
  12.664 + 
  12.665 ++	ENDFUNC(GLOBAL(sdivsi3))
  12.666 + #endif /* ! __SHMEDIA__ */
  12.667 + #endif /* ! __SH4__ */
  12.668 + #endif
  12.669 +@@ -1084,9 +1225,11 @@
  12.670 + 	.title "SH DIVIDE"
  12.671 + !! 4 byte integer Divide code for the Hitachi SH
  12.672 + #ifdef __SH4__
  12.673 +-!! args in r4 and r5, result in fpul, clobber r0, r1, r4, r5, dr0, dr2, dr4
  12.674 ++!! args in r4 and r5, result in fpul, clobber r0, r1, r4, r5, dr0, dr2, dr4,
  12.675 ++!! and t bit
  12.676 + 
  12.677 + 	.global	GLOBAL(udivsi3_i4)
  12.678 ++	FUNC(GLOBAL(udivsi3_i4))
  12.679 + GLOBAL(udivsi3_i4):
  12.680 + 	mov #1,r1
  12.681 + 	cmp/hi r1,r5
  12.682 +@@ -1127,6 +1270,8 @@
  12.683 + L1:
  12.684 + 	.double 2147483648
  12.685 + 
  12.686 ++	ENDFUNC(GLOBAL(udivsi3_i4))
  12.687 ++
  12.688 + #elif defined(__SH4_SINGLE__) || defined(__SH4_SINGLE_ONLY__) || (defined (__SH5__) && ! defined __SH4_NOFPU__)
  12.689 + !! args in r4 and r5, result in fpul, clobber r0, r1, r4, r5, dr0, dr2, dr4
  12.690 + 
  12.691 +@@ -1135,6 +1280,7 @@
  12.692 + 	.mode	SHcompact
  12.693 + #endif
  12.694 + 	.global	GLOBAL(udivsi3_i4)
  12.695 ++	FUNC(GLOBAL(udivsi3_i4))
  12.696 + GLOBAL(udivsi3_i4):
  12.697 + 	mov #1,r1
  12.698 + 	cmp/hi r1,r5
  12.699 +@@ -1183,6 +1329,8 @@
  12.700 + #endif
  12.701 + 	.double 2147483648
  12.702 + 
  12.703 ++	ENDFUNC(GLOBAL(udivsi3_i4))
  12.704 ++
  12.705 + #endif /* ! __SH5__ || __SH5__ == 32 */
  12.706 + #endif /* ! __SH4__ */
  12.707 + #endif
  12.708 +@@ -1199,6 +1347,7 @@
  12.709 + 
  12.710 + !! args in r4 and r5, result in r0, clobbers r4, pr, and t bit
  12.711 + 	.global	GLOBAL(udivsi3)
  12.712 ++	FUNC(GLOBAL(udivsi3))
  12.713 + 
  12.714 + #if __SHMEDIA__
  12.715 + #if __SH5__ == 32
  12.716 +@@ -1299,6 +1448,8 @@
  12.717 + ret:	rts
  12.718 + 	mov	r4,r0
  12.719 + 
  12.720 ++	ENDFUNC(GLOBAL(udivsi3))
  12.721 ++
  12.722 + #endif /* ! __SHMEDIA__ */
  12.723 + #endif /* __SH4__ */
  12.724 + #endif
  12.725 +@@ -1308,6 +1459,7 @@
  12.726 + 	.mode	SHcompact
  12.727 + #endif
  12.728 + 	.global GLOBAL(set_fpscr)
  12.729 ++	FUNC(GLOBAL(set_fpscr))
  12.730 + GLOBAL(set_fpscr):
  12.731 + 	lds r4,fpscr
  12.732 + 	mov.l LOCAL(set_fpscr_L1),r1
  12.733 +@@ -1340,11 +1492,16 @@
  12.734 + 	.align 2
  12.735 + LOCAL(set_fpscr_L1):
  12.736 + 	.long GLOBAL(fpscr_values)
  12.737 ++
  12.738 ++	ENDFUNC(GLOBAL(set_fpscr))
  12.739 ++
  12.740 ++#ifndef NO_FPSCR_VALUES
  12.741 + #ifdef __ELF__
  12.742 +         .comm   GLOBAL(fpscr_values),8,4
  12.743 + #else
  12.744 +         .comm   GLOBAL(fpscr_values),8
  12.745 + #endif /* ELF */
  12.746 ++#endif /* NO_FPSCR_VALUES */
  12.747 + #endif /* SH3E / SH4 */
  12.748 + #endif /* L_set_fpscr */
  12.749 + #ifdef L_ic_invalidate
  12.750 +@@ -1360,6 +1517,7 @@
  12.751 + 	blink	tr0, r63
  12.752 + #elif defined(__SH4_SINGLE__) || defined(__SH4__) || defined(__SH4_SINGLE_ONLY__)
  12.753 + 	.global GLOBAL(ic_invalidate)
  12.754 ++	FUNC(GLOBAL(ic_invalidate))
  12.755 + GLOBAL(ic_invalidate):
  12.756 + 	ocbwb	@r4
  12.757 + 	mova	0f,r0
  12.758 +@@ -1382,6 +1540,9 @@
  12.759 + 	nop
  12.760 + 	.endr
  12.761 + 	.endr
  12.762 ++
  12.763 ++	ENDFUNC(GLOBAL(ic_invalidate))
  12.764 ++
  12.765 + #endif /* SH4 */
  12.766 + #endif /* L_ic_invalidate */
  12.767 + 
  12.768 +diff -ruN gcc-20030210.orig/gcc/config/sh/libgcc-glibc.ver gcc-20030210/gcc/config/sh/libgcc-glibc.ver
  12.769 +--- gcc-20030210.orig/gcc/config/sh/libgcc-glibc.ver	Thu Jan  1 09:00:00 1970
  12.770 ++++ gcc-20030210/gcc/config/sh/libgcc-glibc.ver	Sat Feb 22 01:40:14 2003
  12.771 +@@ -0,0 +1,21 @@
  12.772 ++# In order to work around the very problems that force us to now generally
  12.773 ++# create a libgcc.so, glibc reexported a number of routines from libgcc.a.
  12.774 ++# By now choosing the same version tags for these specific routines, we
  12.775 ++# maintain enough binary compatibility to allow future versions of glibc
  12.776 ++# to defer implementation of these routines to libgcc.so via DT_AUXILIARY.
  12.777 ++
  12.778 ++# Note that we cannot use the default libgcc-glibc.ver file on sh,
  12.779 ++# because GLIBC_2.0 does not exist on this architecture, as the first 
  12.780 ++# ever glibc release on the platform was GLIBC_2.2.
  12.781 ++
  12.782 ++%inherit GCC_3.0 GLIBC_2.2
  12.783 ++GLIBC_2.2 {
  12.784 ++  __register_frame
  12.785 ++  __register_frame_table
  12.786 ++  __deregister_frame
  12.787 ++  __register_frame_info
  12.788 ++  __deregister_frame_info
  12.789 ++  __frame_state_for
  12.790 ++  __register_frame_info_table
  12.791 ++}
  12.792 ++
  12.793 +diff -ruN gcc-20030210.orig/gcc/config/sh/linux.h gcc-20030210/gcc/config/sh/linux.h
  12.794 +--- gcc-20030210.orig/gcc/config/sh/linux.h	Tue Apr 16 05:27:42 2002
  12.795 ++++ gcc-20030210/gcc/config/sh/linux.h	Sat Feb 22 01:40:14 2003
  12.796 +@@ -19,6 +19,10 @@
  12.797 + the Free Software Foundation, 59 Temple Place - Suite 330,
  12.798 + Boston, MA 02111-1307, USA.  */
  12.799 + 
  12.800 ++/* We're not SYSVR4, not having /usr/ccs */
  12.801 ++#undef MD_EXEC_PREFIX
  12.802 ++#undef MD_STARTFILE_PREFIX
  12.803 ++
  12.804 + /* Run-time Target Specification.  */
  12.805 + #undef TARGET_VERSION
  12.806 + #define TARGET_VERSION  fputs (" (SH GNU/Linux with ELF)", stderr);
  12.807 +@@ -39,6 +43,28 @@
  12.808 + #undef WCHAR_TYPE_SIZE
  12.809 + #define WCHAR_TYPE_SIZE BITS_PER_WORD
  12.810 + 
  12.811 ++/* This was defined in linux.h.  Define it here also. */
  12.812 ++#undef  DEFAULT_VTABLE_THUNKS
  12.813 ++#define DEFAULT_VTABLE_THUNKS   1
  12.814 ++
  12.815 ++/* Likewise.  */
  12.816 ++#define HANDLE_PRAGMA_PACK_PUSH_POP
  12.817 ++
  12.818 ++/* Pick up the return address upon entry to a procedure. Used for
  12.819 ++   dwarf2 unwind information.  This also enables the table driven
  12.820 ++   mechanism.  */
  12.821 ++
  12.822 ++#define INCOMING_RETURN_ADDR_RTX	gen_rtx_REG (Pmode, PR_REG)
  12.823 ++#define DWARF_FRAME_RETURN_COLUMN	DWARF_FRAME_REGNUM (PR_REG)
  12.824 ++
  12.825 ++#undef CPP_SPEC
  12.826 ++#define CPP_SPEC "\
  12.827 ++   %{m4:-D__SH4__} \
  12.828 ++   %{!m4:%(cpp_default_cpu_spec)} \
  12.829 ++   %(subtarget_cpp_spec) \
  12.830 ++   %(subtarget_cpp_ptr_spec) \
  12.831 ++   %(subtarget_cpp_endian_spec) "
  12.832 ++
  12.833 + #undef SUBTARGET_CPP_SPEC
  12.834 + #define SUBTARGET_CPP_SPEC "\
  12.835 +    %{fPIC:-D__PIC__ -D__pic__} \
  12.836 +@@ -55,36 +81,45 @@
  12.837 + #undef CPP_DEFAULT_CPU_SPEC
  12.838 + #define CPP_DEFAULT_CPU_SPEC "-D__SH3__ -D__sh3__"
  12.839 + 
  12.840 +-
  12.841 + #undef CPP_PREDEFINES
  12.842 + #define CPP_PREDEFINES "-D__ELF__ -Dunix -D__sh__ -D__gnu_linux__ -Dlinux -Asystem=posix"
  12.843 + 
  12.844 ++/* The GNU C++ standard library requires that these macros be defined.  */
  12.845 ++#undef CPLUSPLUS_CPP_SPEC
  12.846 ++#define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
  12.847 ++
  12.848 + #undef ASM_SPEC
  12.849 +-#define ASM_SPEC  "%{!mb:-little} %{mrelax:-relax}"
  12.850 ++#define ASM_SPEC  "%{mb:-big} %{!mb:-little} %{mrelax:-relax}"
  12.851 + 
  12.852 + #undef CC1_SPEC
  12.853 + #define CC1_SPEC \
  12.854 +-  "-musermode %{!mb:-ml} %{!m3e:%{!m4:-m3}}"
  12.855 +-
  12.856 +-#undef CC1PLUS_SPEC
  12.857 +-#define CC1PLUS_SPEC \
  12.858 +-  "-musermode %{!mb:-ml} %{!m3e:%{!m4:-m3}}"
  12.859 ++  "-musermode %{!mb:-ml} %{!m4:-m3} %{profile:-p}"
  12.860 + 
  12.861 ++/* XXX: It's wrong if prefix != /usr */
  12.862 + #undef LINK_SPEC
  12.863 + #define LINK_SPEC \
  12.864 +-  "%{!mb:-m shlelf_linux} %{mrelax:-relax} \
  12.865 ++  "%{!mb:-m shlelf_linux -EL} %{mb:-m shelf_linux -EB} %{mrelax:-relax} \
  12.866 +    %{shared:-shared} \
  12.867 +    %{!static: \
  12.868 +      %{rdynamic:-export-dynamic} \
  12.869 +      %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2} \
  12.870 +-     %{!rpath:-rpath /lib}} \
  12.871 ++     %{!mb:%{!m4:-rpath-link /usr/sh-linux/lib }} \
  12.872 ++     %{!mb:%{m4:-rpath-link /usr/sh-linux/lib/m4 }} \
  12.873 ++     %{mb:%{!m4:-rpath-link /usr/sh-linux/lib/mb }} \
  12.874 ++     %{mb:%{m4:-rpath-link /usr/sh-linux/lib/mb/m4 }}} \
  12.875 +    %{static:-static}"
  12.876 + 
  12.877 + #undef LIB_SPEC
  12.878 ++#undef LIB_SPEC
  12.879 + #define LIB_SPEC \
  12.880 +   "%{shared: -lc} \
  12.881 +-   %{!shared: %{pthread:-lthread} \
  12.882 +-     %{profile:-lc_p} %{!profile: -lc}}"
  12.883 ++   %{!shared: %{mieee:-lieee} %{pthread:-lpthread} \
  12.884 ++	%{profile:-lc_p} %{!profile: -lc}}"
  12.885 ++
  12.886 ++#if defined(HAVE_LD_EH_FRAME_HDR)
  12.887 ++#undef LINK_EH_SPEC
  12.888 ++#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
  12.889 ++#endif
  12.890 + 
  12.891 + #undef STARTFILE_SPEC
  12.892 + #define STARTFILE_SPEC \
  12.893 +@@ -92,4 +127,40 @@
  12.894 +      %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
  12.895 + 		       %{!p:%{profile:gcrt1.o%s} \
  12.896 + 			 %{!profile:crt1.o%s}}}} \
  12.897 +-   crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
  12.898 ++   crti.o%s %{static:crtbeginT.o%s}\
  12.899 ++   %{!static:%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}}"
  12.900 ++
  12.901 ++#undef FUNCTION_PROFILER
  12.902 ++#define FUNCTION_PROFILER(STREAM,LABELNO)				\
  12.903 ++do									\
  12.904 ++{									\
  12.905 ++  if (flag_pic)								\
  12.906 ++    {									\
  12.907 ++      fprintf (STREAM, "	mov.l	3f,r1\n");			\
  12.908 ++      fprintf (STREAM, "	mova	3f,r0\n");			\
  12.909 ++      fprintf (STREAM, "	add	r1,r0\n");			\
  12.910 ++      fprintf (STREAM, "	mov.l	1f,r1\n");			\
  12.911 ++      fprintf (STREAM, "	mov.l	@(r0,r1),r1\n");		\
  12.912 ++    }									\
  12.913 ++  else									\
  12.914 ++    {									\
  12.915 ++      fprintf (STREAM, "	mov.l	1f,r1\n");			\
  12.916 ++    }									\
  12.917 ++  fprintf (STREAM, "	sts.l	pr,@-r15\n");				\
  12.918 ++  fprintf (STREAM, "	mova	2f,r0\n");				\
  12.919 ++  fprintf (STREAM, "	jmp	@r1\n");				\
  12.920 ++  fprintf (STREAM, "	lds	r0,pr\n");				\
  12.921 ++  fprintf (STREAM, "	.align	2\n");					\
  12.922 ++  if (flag_pic)								\
  12.923 ++    {									\
  12.924 ++      fprintf (STREAM, "1:	.long	mcount@GOT\n");			\
  12.925 ++      fprintf (STREAM, "3:	.long	_GLOBAL_OFFSET_TABLE_\n");	\
  12.926 ++    }									\
  12.927 ++  else									\
  12.928 ++    {									\
  12.929 ++      fprintf (STREAM, "1:	.long	mcount\n");			\
  12.930 ++    }									\
  12.931 ++  fprintf (STREAM, "2:	lds.l	@r15+,pr\n");				\
  12.932 ++} while (0)
  12.933 ++
  12.934 ++#define NO_SHARED_LIBGCC_MULTILIB
  12.935 +diff -ruN gcc-20030210.orig/gcc/config/sh/sh-protos.h gcc-20030210/gcc/config/sh/sh-protos.h
  12.936 +--- gcc-20030210.orig/gcc/config/sh/sh-protos.h	Fri Feb 22 01:42:28 2002
  12.937 ++++ gcc-20030210/gcc/config/sh/sh-protos.h	Sat Feb 22 01:40:14 2003
  12.938 +@@ -74,6 +74,7 @@
  12.939 + extern int shl_sext_length PARAMS ((rtx));
  12.940 + extern int gen_shl_sext PARAMS ((rtx, rtx, rtx, rtx));
  12.941 + extern rtx gen_datalabel_ref PARAMS ((rtx));
  12.942 ++extern int shl_casesi_worker_length PARAMS ((rtx));
  12.943 + extern int regs_used PARAMS ((rtx, int));
  12.944 + extern void fixup_addr_diff_vecs PARAMS ((rtx));
  12.945 + extern int get_dest_uid PARAMS ((rtx, int));
  12.946 +diff -ruN gcc-20030210.orig/gcc/config/sh/sh.c gcc-20030210/gcc/config/sh/sh.c
  12.947 +--- gcc-20030210.orig/gcc/config/sh/sh.c	Fri Feb 22 01:42:28 2002
  12.948 ++++ gcc-20030210/gcc/config/sh/sh.c	Sat Feb 22 01:40:14 2003
  12.949 +@@ -2143,6 +2143,48 @@
  12.950 +   return sym;
  12.951 + }
  12.952 + 
  12.953 ++
  12.954 ++/* Function to be used in the length attribute of the casesi_worker
  12.955 ++   instruction.  Returns number of instructions, which is half of the
  12.956 ++   length of bytes. */
  12.957 ++
  12.958 ++int
  12.959 ++shl_casesi_worker_length (insn)
  12.960 ++     rtx insn;
  12.961 ++{
  12.962 ++  rtx set_src, label;
  12.963 ++  rtx diff_vec;
  12.964 ++
  12.965 ++  set_src = SET_SRC (XVECEXP (PATTERN (insn), 0, 0));
  12.966 ++  if (!(GET_CODE (set_src) == UNSPEC
  12.967 ++	&& XINT (set_src, 1) == UNSPEC_CASESI))
  12.968 ++    abort ();
  12.969 ++
  12.970 ++  label = XVECEXP (set_src, 0, 2);
  12.971 ++  if (GET_CODE (label) != LABEL_REF)
  12.972 ++    abort ();
  12.973 ++
  12.974 ++  diff_vec = PATTERN (next_real_insn (XEXP (label, 0)));
  12.975 ++
  12.976 ++  if (GET_CODE (diff_vec) != ADDR_DIFF_VEC)
  12.977 ++    abort ();
  12.978 ++
  12.979 ++  switch (GET_MODE (diff_vec))
  12.980 ++    {
  12.981 ++    case SImode:
  12.982 ++      return 2;
  12.983 ++    case HImode:
  12.984 ++      if (ADDR_DIFF_VEC_FLAGS (diff_vec).offset_unsigned)
  12.985 ++	return 3;
  12.986 ++      return 2;
  12.987 ++    case QImode:
  12.988 ++      if (ADDR_DIFF_VEC_FLAGS (diff_vec).offset_unsigned)
  12.989 ++	return 2;
  12.990 ++      return 1;
  12.991 ++    default:
  12.992 ++      abort ();
  12.993 ++    }
  12.994 ++}
  12.995 + 
  12.996 + /* The SH cannot load a large constant into a register, constants have to
  12.997 +    come from a pc relative load.  The reference of a pc relative load
  12.998 +@@ -3190,7 +3232,7 @@
  12.999 +       vec_lab = XEXP (XEXP (pat, 0), 0);
 12.1000 + 
 12.1001 +       /* Search the matching casesi_jump_2.  */
 12.1002 +-      for (prev = vec_lab; ; prev = PREV_INSN (prev))
 12.1003 ++      for (prev = vec_lab; prev; prev = PREV_INSN (prev))
 12.1004 + 	{
 12.1005 + 	  if (GET_CODE (prev) != JUMP_INSN)
 12.1006 + 	    continue;
 12.1007 +@@ -3205,6 +3247,13 @@
 12.1008 + 	    break;
 12.1009 + 	}
 12.1010 + 
 12.1011 ++      if (prev == NULL)
 12.1012 ++	{			/* Switch statement has been optimized out.  */
 12.1013 ++	  delete_insn (PREV_INSN (insn));
 12.1014 ++	  delete_insn (insn);
 12.1015 ++	  continue;
 12.1016 ++	}
 12.1017 ++
 12.1018 +       /* Emit the reference label of the braf where it belongs, right after
 12.1019 + 	 the casesi_jump_2 (i.e. braf).  */
 12.1020 +       braf_label = XEXP (XEXP (SET_SRC (XVECEXP (prevpat, 0, 0)), 1), 0);
 12.1021 +@@ -3223,7 +3272,7 @@
 12.1022 +      rtx barrier_or_label;
 12.1023 + {
 12.1024 +   rtx next = next_real_insn (barrier_or_label), pat, prev;
 12.1025 +-  int slot, credit, jump_to_next;
 12.1026 ++  int slot, credit, jump_to_next = 0;
 12.1027 +  
 12.1028 +   if (! next)
 12.1029 +     return 0;
 12.1030 +@@ -4507,7 +4556,8 @@
 12.1031 +   if (current_function_varargs || current_function_stdarg)
 12.1032 +     {
 12.1033 +       /* This is not used by the SH3E calling convention  */
 12.1034 +-      if (TARGET_SH1 && ! TARGET_SH3E && ! TARGET_SH5 && ! TARGET_HITACHI)
 12.1035 ++      if (TARGET_SH1 && ! TARGET_SH3E && ! TARGET_SH5 && ! TARGET_HITACHI
 12.1036 ++	  || TARGET_NO_IMPLICIT_FP)
 12.1037 + 	{
 12.1038 + 	  /* Push arg regs as if they'd been provided by caller in stack.  */
 12.1039 + 	  for (i = 0; i < NPARM_REGS(SImode); i++)
 12.1040 +@@ -5149,7 +5199,8 @@
 12.1041 +   tree f_next_o, f_next_o_limit, f_next_fp, f_next_fp_limit, f_next_stack;
 12.1042 +   tree record;
 12.1043 + 
 12.1044 +-  if (TARGET_SH5 || (! TARGET_SH3E && ! TARGET_SH4) || TARGET_HITACHI)
 12.1045 ++  if (TARGET_SH5 || (! TARGET_SH3E && ! TARGET_SH4) || TARGET_HITACHI
 12.1046 ++      || TARGET_NO_IMPLICIT_FP)
 12.1047 +     return ptr_type_node;
 12.1048 + 
 12.1049 +   record = make_node (RECORD_TYPE);
 12.1050 +@@ -5211,7 +5262,8 @@
 12.1051 +       return;
 12.1052 +     }
 12.1053 + 
 12.1054 +-  if ((! TARGET_SH3E && ! TARGET_SH4) || TARGET_HITACHI)
 12.1055 ++  if ((! TARGET_SH3E && ! TARGET_SH4)
 12.1056 ++      || TARGET_HITACHI || TARGET_NO_IMPLICIT_FP)
 12.1057 +     {
 12.1058 +       std_expand_builtin_va_start (stdarg_p, valist, nextarg);
 12.1059 +       return;
 12.1060 +@@ -5289,7 +5341,8 @@
 12.1061 +   rsize = (size + UNITS_PER_WORD - 1) & -UNITS_PER_WORD;
 12.1062 +   pptr_type_node = build_pointer_type (ptr_type_node);
 12.1063 + 
 12.1064 +-  if (! TARGET_SH5 && (TARGET_SH3E || TARGET_SH4) && ! TARGET_HITACHI)
 12.1065 ++  if (! TARGET_SH5 && (TARGET_SH3E || TARGET_SH4)
 12.1066 ++      && ! TARGET_HITACHI && ! TARGET_NO_IMPLICIT_FP)
 12.1067 +     {
 12.1068 +       tree f_next_o, f_next_o_limit, f_next_fp, f_next_fp_limit, f_next_stack;
 12.1069 +       tree next_o, next_o_limit, next_fp, next_fp_limit, next_stack;
 12.1070 +diff -ruN gcc-20030210.orig/gcc/config/sh/sh.h gcc-20030210/gcc/config/sh/sh.h
 12.1071 +--- gcc-20030210.orig/gcc/config/sh/sh.h	Fri Feb 22 01:42:28 2002
 12.1072 ++++ gcc-20030210/gcc/config/sh/sh.h	Sat Feb 22 01:40:14 2003
 12.1073 +@@ -147,10 +147,10 @@
 12.1074 + #define HARD_SH4_BIT	(1<<5)
 12.1075 + #define FPU_SINGLE_BIT	(1<<7)
 12.1076 + #define SH4_BIT	       	(1<<12)
 12.1077 ++#define NO_IMPLICIT_FP_BIT	(1<<3)
 12.1078 + #define FMOVD_BIT	(1<<4)
 12.1079 + #define SH5_BIT		(1<<0)
 12.1080 + #define SPACE_BIT 	(1<<13)
 12.1081 +-#define BIGTABLE_BIT  	(1<<14)
 12.1082 + #define RELAX_BIT	(1<<15)
 12.1083 + #define USERMODE_BIT	(1<<16)
 12.1084 + #define HITACHI_BIT     (1<<22)
 12.1085 +@@ -205,6 +205,9 @@
 12.1086 + /* Nonzero if we should generate code for a SH5 CPU (either ISA).  */
 12.1087 + #define TARGET_SH5 (target_flags & SH5_BIT)
 12.1088 + 
 12.1089 ++/* Nonzero if we should not use FPU implicitly.  */
 12.1090 ++#define TARGET_NO_IMPLICIT_FP (target_flags & NO_IMPLICIT_FP_BIT)
 12.1091 ++
 12.1092 + /* Nonzero if we should generate code using the SHcompact instruction
 12.1093 +    set and 32-bit ABI.  */
 12.1094 + #define TARGET_SHCOMPACT (TARGET_SH5 && TARGET_SH1)
 12.1095 +@@ -225,6 +228,7 @@
 12.1096 + 
 12.1097 + /* Nonzero if we should generate code using SHmedia FPU instructions.  */
 12.1098 + #define TARGET_SHMEDIA_FPU (TARGET_SHMEDIA && TARGET_FPU_DOUBLE)
 12.1099 ++
 12.1100 + /* Nonzero if we should generate fmovd.  */
 12.1101 + #define TARGET_FMOVD (target_flags & FMOVD_BIT)
 12.1102 + 
 12.1103 +@@ -234,9 +238,6 @@
 12.1104 + /* Nonzero if we should generate smaller code rather than faster code.  */
 12.1105 + #define TARGET_SMALLCODE   (target_flags & SPACE_BIT)
 12.1106 + 
 12.1107 +-/* Nonzero to use long jump tables.  */
 12.1108 +-#define TARGET_BIGTABLE     (target_flags & BIGTABLE_BIT)
 12.1109 +-
 12.1110 + /* Nonzero to generate pseudo-ops needed by the assembler and linker
 12.1111 +    to do function call relaxing.  */
 12.1112 + #define TARGET_RELAX (target_flags & RELAX_BIT)
 12.1113 +@@ -297,7 +298,6 @@
 12.1114 +   {"5-compact-nofpu", TARGET_NONE, "" },	\
 12.1115 +   {"5-compact-nofpu", SH5_BIT|SH3_BIT|SH2_BIT|SH1_BIT, "Generate FPU-less SHcompact code" }, \
 12.1116 +   {"b",		-LITTLE_ENDIAN_BIT, "" },  	\
 12.1117 +-  {"bigtable", 	BIGTABLE_BIT, "" },		\
 12.1118 +   {"dalign",  	DALIGN_BIT, "" },		\
 12.1119 +   {"fmovd",  	FMOVD_BIT, "" },		\
 12.1120 +   {"hitachi",	HITACHI_BIT, "" },		\
 12.1121 +@@ -306,6 +306,7 @@
 12.1122 +   {"isize", 	ISIZE_BIT, "" },		\
 12.1123 +   {"l",		LITTLE_ENDIAN_BIT, "" },  	\
 12.1124 +   {"no-ieee",  	-IEEE_BIT, "" },		\
 12.1125 ++  {"no-implicit-fp", NO_IMPLICIT_FP_BIT, "" },	\
 12.1126 +   {"padstruct", PADSTRUCT_BIT, "" },    	\
 12.1127 +   {"prefergot",	PREFERGOT_BIT, "" },		\
 12.1128 +   {"relax",	RELAX_BIT, "" },		\
 12.1129 +@@ -2493,16 +2494,22 @@
 12.1130 +     goto LABEL;								\
 12.1131 + }
 12.1132 + 
 12.1133 ++extern int optimize; /* needed for gen_casesi.  */
 12.1134 ++extern int optimize_size;
 12.1135 ++
 12.1136 + /* Specify the machine mode that this machine uses
 12.1137 +    for the index in the tablejump instruction.  */
 12.1138 +-#define CASE_VECTOR_MODE (TARGET_BIGTABLE ? SImode : HImode)
 12.1139 ++#define CASE_VECTOR_MODE SImode
 12.1140 + 
 12.1141 + #define CASE_VECTOR_SHORTEN_MODE(MIN_OFFSET, MAX_OFFSET, BODY) \
 12.1142 + ((MIN_OFFSET) >= 0 && (MAX_OFFSET) <= 127 \
 12.1143 +  ? (ADDR_DIFF_VEC_FLAGS (BODY).offset_unsigned = 0, QImode) \
 12.1144 +  : (MIN_OFFSET) >= 0 && (MAX_OFFSET) <= 255 \
 12.1145 +  ? (ADDR_DIFF_VEC_FLAGS (BODY).offset_unsigned = 1, QImode) \
 12.1146 +- : (MIN_OFFSET) >= -32768 && (MAX_OFFSET) <= 32767 ? HImode \
 12.1147 ++ : (MIN_OFFSET) >= -32768 && (MAX_OFFSET) <= 32767 \
 12.1148 ++ ? (ADDR_DIFF_VEC_FLAGS (BODY).offset_unsigned = 0, HImode) \
 12.1149 ++ : optimize_size && (MIN_OFFSET) >= 0 && (MAX_OFFSET) <= 65535 \
 12.1150 ++ ? (ADDR_DIFF_VEC_FLAGS (BODY).offset_unsigned = 1, HImode) \
 12.1151 +  : SImode)
 12.1152 + 
 12.1153 + /* Define as C expression which evaluates to nonzero if the tablejump
 12.1154 +@@ -3038,10 +3045,7 @@
 12.1155 + /* Output an absolute table element.  */
 12.1156 + 
 12.1157 + #define ASM_OUTPUT_ADDR_VEC_ELT(STREAM,VALUE)  				\
 12.1158 +-  if (TARGET_BIGTABLE) 							\
 12.1159 +-    asm_fprintf ((STREAM), "\t.long\t%LL%d\n", (VALUE)); 			\
 12.1160 +-  else									\
 12.1161 +-    asm_fprintf ((STREAM), "\t.word\t%LL%d\n", (VALUE)); 			\
 12.1162 ++    asm_fprintf ((STREAM), "\t.long\t%LL%d\n", (VALUE))
 12.1163 + 
 12.1164 + /* Output various types of constants.  */
 12.1165 + 
 12.1166 +@@ -3167,8 +3171,6 @@
 12.1167 + #define sh_cpu_attr ((enum attr_cpu)sh_cpu)
 12.1168 + extern enum processor_type sh_cpu;
 12.1169 + 
 12.1170 +-extern int optimize; /* needed for gen_casesi.  */
 12.1171 +-
 12.1172 + enum mdep_reorg_phase_e
 12.1173 + {
 12.1174 +   SH_BEFORE_MDEP_REORG,
 12.1175 +diff -ruN gcc-20030210.orig/gcc/config/sh/sh.md gcc-20030210/gcc/config/sh/sh.md
 12.1176 +--- gcc-20030210.orig/gcc/config/sh/sh.md	Sat Nov 23 04:58:06 2002
 12.1177 ++++ gcc-20030210/gcc/config/sh/sh.md	Sat Feb 22 01:40:14 2003
 12.1178 +@@ -1242,7 +1242,7 @@
 12.1179 +    (clobber (reg:SI PR_REG))
 12.1180 +    (clobber (reg:SI R4_REG))
 12.1181 +    (use (match_operand:SI 1 "arith_reg_operand" "r"))]
 12.1182 +-  "TARGET_SH1 && ! TARGET_SH4"
 12.1183 ++  "TARGET_SH1 && ! TARGET_SH4 || TARGET_NO_IMPLICIT_FP"
 12.1184 +   "jsr	@%1%#"
 12.1185 +   [(set_attr "type" "sfunc")
 12.1186 +    (set_attr "needs_delay_slot" "yes")])
 12.1187 +@@ -1336,7 +1336,7 @@
 12.1188 + 
 12.1189 +   operands[3] = gen_reg_rtx (Pmode);
 12.1190 +   /* Emit the move of the address to a pseudo outside of the libcall.  */
 12.1191 +-  if (TARGET_HARD_SH4 && TARGET_SH3E)
 12.1192 ++  if (TARGET_HARD_SH4 && TARGET_SH3E && !TARGET_NO_IMPLICIT_FP)
 12.1193 +     {
 12.1194 +       emit_move_insn (operands[3],
 12.1195 + 		      gen_rtx_SYMBOL_REF (SImode, \"__udivsi3_i4\"));
 12.1196 +@@ -1391,7 +1391,7 @@
 12.1197 +    (clobber (reg:SI R2_REG))
 12.1198 +    (clobber (reg:SI R3_REG))
 12.1199 +    (use (match_operand:SI 1 "arith_reg_operand" "r"))]
 12.1200 +-  "TARGET_SH1 && ! TARGET_SH4"
 12.1201 ++  "TARGET_SH1 && ! TARGET_SH4 || TARGET_NO_IMPLICIT_FP"
 12.1202 +   "jsr	@%1%#"
 12.1203 +   [(set_attr "type" "sfunc")
 12.1204 +    (set_attr "needs_delay_slot" "yes")])
 12.1205 +@@ -1476,7 +1476,7 @@
 12.1206 + 
 12.1207 +   operands[3] = gen_reg_rtx (Pmode);
 12.1208 +   /* Emit the move of the address to a pseudo outside of the libcall.  */
 12.1209 +-  if (TARGET_HARD_SH4 && TARGET_SH3E)
 12.1210 ++  if (TARGET_HARD_SH4 && TARGET_SH3E && !TARGET_NO_IMPLICIT_FP)
 12.1211 +     {
 12.1212 +       emit_move_insn (operands[3],
 12.1213 + 		      gen_rtx_SYMBOL_REF (SImode, \"__sdivsi3_i4\"));
 12.1214 +@@ -6446,6 +6446,8 @@
 12.1215 +     case SImode:
 12.1216 +       return \"shll2	%1\;mov.l	@(r0,%1),%0\";
 12.1217 +     case HImode:
 12.1218 ++      if (ADDR_DIFF_VEC_FLAGS (diff_vec).offset_unsigned)
 12.1219 ++	return \"add	%1,%1\;mov.w	@(r0,%1),%0\;extu.w	%0,%0\";
 12.1220 +       return \"add	%1,%1\;mov.w	@(r0,%1),%0\";
 12.1221 +     case QImode:
 12.1222 +       if (ADDR_DIFF_VEC_FLAGS (diff_vec).offset_unsigned)
 12.1223 +@@ -6455,7 +6457,15 @@
 12.1224 +       abort ();
 12.1225 +     }
 12.1226 + }"
 12.1227 +-  [(set_attr "length" "4")])
 12.1228 ++  [(set (attr "length")
 12.1229 ++	(cond [(eq (symbol_ref "shl_casesi_worker_length (insn)") (const_int 1))
 12.1230 ++	       (const_string "2")
 12.1231 ++	       (eq (symbol_ref "shl_casesi_worker_length (insn)") (const_int 2))
 12.1232 ++	       (const_string "4")
 12.1233 ++	       ;; Put "match_dup" here so that insn_variable_length_p return 1.
 12.1234 ++	       (ne (match_dup 2) (match_dup 2))
 12.1235 ++	       (const_string "4")]
 12.1236 ++	      (const_string "6")))])
 12.1237 + 
 12.1238 + (define_insn "casesi_shift_media"
 12.1239 +   [(set (match_operand 0 "arith_reg_operand" "=r")
 12.1240 +diff -ruN gcc-20030210.orig/gcc/config/sh/sh3-linux.h gcc-20030210/gcc/config/sh/sh3-linux.h
 12.1241 +--- gcc-20030210.orig/gcc/config/sh/sh3-linux.h	Thu Jan  1 09:00:00 1970
 12.1242 ++++ gcc-20030210/gcc/config/sh/sh3-linux.h	Sat Feb 22 01:40:14 2003
 12.1243 +@@ -0,0 +1,29 @@
 12.1244 ++#undef TARGET_VERSION
 12.1245 ++#define TARGET_VERSION  fputs (" (SH3 GNU/Linux with ELF)", stderr);
 12.1246 ++
 12.1247 ++#undef CPP_SPEC
 12.1248 ++#define CPP_SPEC \
 12.1249 ++  "-D__LITTLE_ENDIAN__ \
 12.1250 ++   -D__SH3__ -D__sh3__ \
 12.1251 ++   -D__SIZE_TYPE__=unsigned\\ int \
 12.1252 ++   -D__PTRDIFF_TYPE__=int \
 12.1253 ++   %{fPIC:-D__PIC__ -D__pic__} \
 12.1254 ++   %{fpic:-D__PIC__ -D__pic__} \
 12.1255 ++   %{posix:-D_POSIX_SOURCE} \
 12.1256 ++   %{pthread:-D_REENTRANT -D_PTHREADS}"
 12.1257 ++
 12.1258 ++#undef ASM_SPEC
 12.1259 ++#define ASM_SPEC  "%{mrelax:-relax}"
 12.1260 ++
 12.1261 ++#undef CC1_SPEC
 12.1262 ++#define CC1_SPEC \
 12.1263 ++  "-musermode -ml -m3 %{profile:-p}"
 12.1264 ++
 12.1265 ++#undef LINK_SPEC
 12.1266 ++#define LINK_SPEC \
 12.1267 ++  "%{mrelax:-relax} \
 12.1268 ++   %{shared:-shared} \
 12.1269 ++   %{!static: \
 12.1270 ++     %{rdynamic:-export-dynamic} \
 12.1271 ++     %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
 12.1272 ++    %{static:-static}"
 12.1273 +diff -ruN gcc-20030210.orig/gcc/config/sh/sh3eb-linux.h gcc-20030210/gcc/config/sh/sh3eb-linux.h
 12.1274 +--- gcc-20030210.orig/gcc/config/sh/sh3eb-linux.h	Thu Jan  1 09:00:00 1970
 12.1275 ++++ gcc-20030210/gcc/config/sh/sh3eb-linux.h	Sat Feb 22 01:40:14 2003
 12.1276 +@@ -0,0 +1,29 @@
 12.1277 ++#undef TARGET_VERSION
 12.1278 ++#define TARGET_VERSION  fputs (" (SH3EB GNU/Linux with ELF)", stderr);
 12.1279 ++
 12.1280 ++#undef CPP_SPEC
 12.1281 ++#define CPP_SPEC \
 12.1282 ++  "-D__BIG_ENDIAN__ \
 12.1283 ++   -D__SH3__ -D__sh3__ \
 12.1284 ++   -D__SIZE_TYPE__=unsigned\\ int \
 12.1285 ++   -D__PTRDIFF_TYPE__=int \
 12.1286 ++   %{fPIC:-D__PIC__ -D__pic__} \
 12.1287 ++   %{fpic:-D__PIC__ -D__pic__} \
 12.1288 ++   %{posix:-D_POSIX_SOURCE} \
 12.1289 ++   %{pthread:-D_REENTRANT -D_PTHREADS}"
 12.1290 ++
 12.1291 ++#undef ASM_SPEC
 12.1292 ++#define ASM_SPEC  "%{mrelax:-relax}"
 12.1293 ++
 12.1294 ++#undef CC1_SPEC
 12.1295 ++#define CC1_SPEC \
 12.1296 ++  "-musermode -mb -m3 %{profile:-p}"
 12.1297 ++
 12.1298 ++#undef LINK_SPEC
 12.1299 ++#define LINK_SPEC \
 12.1300 ++  "%{mrelax:-relax} \
 12.1301 ++   %{shared:-shared} \
 12.1302 ++   %{!static: \
 12.1303 ++     %{rdynamic:-export-dynamic} \
 12.1304 ++     %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
 12.1305 ++    %{static:-static}"
 12.1306 +diff -ruN gcc-20030210.orig/gcc/config/sh/sh4-linux.h gcc-20030210/gcc/config/sh/sh4-linux.h
 12.1307 +--- gcc-20030210.orig/gcc/config/sh/sh4-linux.h	Thu Jan  1 09:00:00 1970
 12.1308 ++++ gcc-20030210/gcc/config/sh/sh4-linux.h	Sat Feb 22 01:40:14 2003
 12.1309 +@@ -0,0 +1,29 @@
 12.1310 ++#undef TARGET_VERSION
 12.1311 ++#define TARGET_VERSION  fputs (" (SH4 GNU/Linux with ELF)", stderr);
 12.1312 ++
 12.1313 ++#undef CPP_SPEC
 12.1314 ++#define CPP_SPEC \
 12.1315 ++  "-D__LITTLE_ENDIAN__ \
 12.1316 ++   -D__SH4__ \
 12.1317 ++   -D__SIZE_TYPE__=unsigned\\ int \
 12.1318 ++   -D__PTRDIFF_TYPE__=int \
 12.1319 ++   %{fPIC:-D__PIC__ -D__pic__} \
 12.1320 ++   %{fpic:-D__PIC__ -D__pic__} \
 12.1321 ++   %{posix:-D_POSIX_SOURCE} \
 12.1322 ++   %{pthread:-D_REENTRANT -D_PTHREADS}"
 12.1323 ++
 12.1324 ++#undef ASM_SPEC
 12.1325 ++#define ASM_SPEC  "%{mrelax:-relax}"
 12.1326 ++
 12.1327 ++#undef CC1_SPEC
 12.1328 ++#define CC1_SPEC \
 12.1329 ++  "-musermode -ml -m4 %{profile:-p}"
 12.1330 ++
 12.1331 ++#undef LINK_SPEC
 12.1332 ++#define LINK_SPEC \
 12.1333 ++  "%{mrelax:-relax} \
 12.1334 ++   %{shared:-shared} \
 12.1335 ++   %{!static: \
 12.1336 ++     %{rdynamic:-export-dynamic} \
 12.1337 ++     %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
 12.1338 ++    %{static:-static}"
 12.1339 +diff -ruN gcc-20030210.orig/gcc/config/sh/sh4eb-linux.h gcc-20030210/gcc/config/sh/sh4eb-linux.h
 12.1340 +--- gcc-20030210.orig/gcc/config/sh/sh4eb-linux.h	Thu Jan  1 09:00:00 1970
 12.1341 ++++ gcc-20030210/gcc/config/sh/sh4eb-linux.h	Sat Feb 22 01:40:14 2003
 12.1342 +@@ -0,0 +1,29 @@
 12.1343 ++#undef TARGET_VERSION
 12.1344 ++#define TARGET_VERSION  fputs (" (SH4EB GNU/Linux with ELF)", stderr);
 12.1345 ++
 12.1346 ++#undef CPP_SPEC
 12.1347 ++#define CPP_SPEC \
 12.1348 ++  "-D__BIG_ENDIAN__ \
 12.1349 ++   -D__SH4__ \
 12.1350 ++   -D__SIZE_TYPE__=unsigned\\ int \
 12.1351 ++   -D__PTRDIFF_TYPE__=int \
 12.1352 ++   %{fPIC:-D__PIC__ -D__pic__} \
 12.1353 ++   %{fpic:-D__PIC__ -D__pic__} \
 12.1354 ++   %{posix:-D_POSIX_SOURCE} \
 12.1355 ++   %{pthread:-D_REENTRANT -D_PTHREADS}"
 12.1356 ++
 12.1357 ++#undef ASM_SPEC
 12.1358 ++#define ASM_SPEC  "%{mrelax:-relax}"
 12.1359 ++
 12.1360 ++#undef CC1_SPEC
 12.1361 ++#define CC1_SPEC \
 12.1362 ++  "-musermode -mb -m4 %{profile:-p}"
 12.1363 ++
 12.1364 ++#undef LINK_SPEC
 12.1365 ++#define LINK_SPEC \
 12.1366 ++  "%{mrelax:-relax} \
 12.1367 ++   %{shared:-shared} \
 12.1368 ++   %{!static: \
 12.1369 ++     %{rdynamic:-export-dynamic} \
 12.1370 ++     %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
 12.1371 ++    %{static:-static}"
 12.1372 +diff -ruN gcc-20030210.orig/gcc/config/sh/t-linux gcc-20030210/gcc/config/sh/t-linux
 12.1373 +--- gcc-20030210.orig/gcc/config/sh/t-linux	Thu May 17 12:16:12 2001
 12.1374 ++++ gcc-20030210/gcc/config/sh/t-linux	Sat Feb 22 01:40:14 2003
 12.1375 +@@ -1,10 +1,20 @@
 12.1376 +-TARGET_LIBGCC2_CFLAGS = -fpic
 12.1377 ++TARGET_LIBGCC2_CFLAGS = -fpic -DNO_FPSCR_VALUES
 12.1378 ++LIBGCC1 = libgcc1-asm.a
 12.1379 ++CROSS_LIBGCC1 = libgcc1-asm.a
 12.1380 ++LIBGCC1_TEST = libgcc1-test
 12.1381 + LIB1ASMFUNCS = _ashiftrt _ashiftrt_n _ashiftlt _lshiftrt _movstr \
 12.1382 +   _movstr_i4 _mulsi3 _sdivsi3 _sdivsi3_i4 _udivsi3 _udivsi3_i4 _set_fpscr \
 12.1383 +   _ic_invalidate
 12.1384 ++LIB2ADDEH = $(srcdir)/unwind-sjlj.c
 12.1385 ++LIB2ADDEHDEP = unwind.inc unwind-sjlj.c
 12.1386 + 
 12.1387 +-MULTILIB_OPTIONS= mb m3e/m4
 12.1388 ++MULTILIB_OPTIONS= mb m4
 12.1389 + MULTILIB_DIRNAMES= 
 12.1390 + MULTILIB_MATCHES = 
 12.1391 + 
 12.1392 +-EXTRA_MULTILIB_PARTS= crtbegin.o crtend.o crtbeginS.o crtendS.o
 12.1393 ++EXTRA_MULTILIB_PARTS= crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o
 12.1394 ++
 12.1395 ++# Override t-slibgcc-elf-ver to export some libgcc symbols with
 12.1396 ++# the symbol versions that glibc used and SH specific.
 12.1397 ++SHLIB_MAPFILES =  $(srcdir)/libgcc-std.ver \
 12.1398 ++		  $(srcdir)/config/sh/libgcc-glibc.ver
 12.1399 +diff -ruN gcc-20030210.orig/gcc/config/sh/t-linux-nomulti gcc-20030210/gcc/config/sh/t-linux-nomulti
 12.1400 +--- gcc-20030210.orig/gcc/config/sh/t-linux-nomulti	Thu Jan  1 09:00:00 1970
 12.1401 ++++ gcc-20030210/gcc/config/sh/t-linux-nomulti	Sat Feb 22 01:40:14 2003
 12.1402 +@@ -0,0 +1,9 @@
 12.1403 ++LIBGCC = libgcc.a
 12.1404 ++EXTRA_PARTS = crtbegin.o crtbeginS.o crtend.o crtendS.o crtbeginT.o
 12.1405 ++
 12.1406 ++INSTALL_LIBGCC = install-libgcc
 12.1407 ++
 12.1408 ++MULTILIB_OPTIONS=
 12.1409 ++MULTILIB_DIRNAMES= 
 12.1410 ++MULTILIB_MATCHES = 
 12.1411 ++EXTRA_MULTILIB_PARTS=
 12.1412 +diff -ruN gcc-20030210.orig/gcc/config.gcc gcc-20030210/gcc/config.gcc
 12.1413 +--- gcc-20030210.orig/gcc/config.gcc	Fri Jan 31 19:17:13 2003
 12.1414 ++++ gcc-20030210/gcc/config.gcc	Sat Feb 22 01:40:14 2003
 12.1415 +@@ -337,9 +337,9 @@
 12.1416 + sparc*-*-*)
 12.1417 + 	cpu_type=sparc
 12.1418 + 	;;
 12.1419 +-sh64-*-*)
 12.1420 +-	cpu_type=sh
 12.1421 +-	;;
 12.1422 ++sh*-*-*)
 12.1423 ++ 	cpu_type=sh
 12.1424 ++ 	;;
 12.1425 + esac
 12.1426 + 
 12.1427 + tm_file=${cpu_type}/${cpu_type}.h
 12.1428 +@@ -3018,9 +3018,31 @@
 12.1429 + 	  thread_file='rtems'
 12.1430 + 	fi
 12.1431 + 	;;
 12.1432 +-sh-*-linux*)
 12.1433 ++sh*-*-linux*)
 12.1434 + 	tm_file="${tm_file} sh/elf.h sh/linux.h"
 12.1435 +-	tmake_file="sh/t-sh sh/t-elf sh/t-linux"
 12.1436 ++	tmake_file="sh/t-sh sh/t-elf t-slibgcc-elf-ver t-linux sh/t-linux"
 12.1437 ++	extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o"
 12.1438 ++	case $machine in
 12.1439 ++		sh3eb-*)
 12.1440 ++			tm_file="${tm_file} sh/sh3eb-linux.h"
 12.1441 ++			tmake_file="${tmake_file} sh/t-linux-nomulti"
 12.1442 ++			;;
 12.1443 ++		sh4eb-*)
 12.1444 ++			tm_file="${tm_file} sh/sh4eb-linux.h"
 12.1445 ++			tmake_file="${tmake_file} sh/t-linux-nomulti"
 12.1446 ++			;;
 12.1447 ++		sh3-*)
 12.1448 ++			tm_file="${tm_file} sh/sh3-linux.h"
 12.1449 ++			tmake_file="${tmake_file} sh/t-linux-nomulti"
 12.1450 ++			;;
 12.1451 ++		sh4-*)
 12.1452 ++			tm_file="${tm_file} sh/sh4-linux.h"
 12.1453 ++			tmake_file="${tmake_file} sh/t-linux-nomulti"
 12.1454 ++			;;
 12.1455 ++		*)
 12.1456 ++			;;
 12.1457 ++	esac
 12.1458 ++	xmake_file=x-linux
 12.1459 + 	gas=yes gnu_ld=yes
 12.1460 + 	float_format=sh
 12.1461 + 	;;
 12.1462 +diff -ruN gcc-20030210.orig/gcc/dwarf2out.c gcc-20030210/gcc/dwarf2out.c
 12.1463 +--- gcc-20030210.orig/gcc/dwarf2out.c	Mon Feb 10 19:36:25 2003
 12.1464 ++++ gcc-20030210/gcc/dwarf2out.c	Sat Feb 22 01:40:14 2003
 12.1465 +@@ -10224,7 +10224,9 @@
 12.1466 + 	  /* We can have a normal definition following an inline one in the
 12.1467 + 	     case of redefinition of GNU C extern inlines.
 12.1468 + 	     It seems reasonable to use AT_specification in this case.  */
 12.1469 +-	  && !get_AT_unsigned (old_die, DW_AT_inline))
 12.1470 ++	  && !get_AT_unsigned (old_die, DW_AT_inline)
 12.1471 ++	  /* Skip the nested function.  */
 12.1472 ++	  && !decl_function_context (decl))
 12.1473 + 	{
 12.1474 + 	  /* ??? This can happen if there is a bug in the program, for
 12.1475 + 	     instance, if it has duplicate function definitions.  Ideally,
 12.1476 +diff -ruN gcc-20030210.orig/gcc/final.c gcc-20030210/gcc/final.c
 12.1477 +--- gcc-20030210.orig/gcc/final.c	Fri Jan 31 19:17:20 2003
 12.1478 ++++ gcc-20030210/gcc/final.c	Sat Feb 22 01:40:14 2003
 12.1479 +@@ -1128,7 +1128,7 @@
 12.1480 + 	    }
 12.1481 + 	}
 12.1482 + 
 12.1483 +-      INSN_ADDRESSES (uid) = insn_current_address;
 12.1484 ++      INSN_ADDRESSES (uid) = insn_current_address + insn_lengths[uid];
 12.1485 + 
 12.1486 +       if (GET_CODE (insn) == NOTE || GET_CODE (insn) == BARRIER
 12.1487 + 	  || GET_CODE (insn) == CODE_LABEL)
 12.1488 +diff -ruN gcc-20030210.orig/gcc/mkmap-symver.awk gcc-20030210/gcc/mkmap-symver.awk
 12.1489 +--- gcc-20030210.orig/gcc/mkmap-symver.awk	Fri Jan 31 19:17:26 2003
 12.1490 ++++ gcc-20030210/gcc/mkmap-symver.awk	Sat Feb 22 01:40:14 2003
 12.1491 +@@ -89,7 +89,11 @@
 12.1492 +     output(inherit[lib]);
 12.1493 + 
 12.1494 +   printf("%s {\n", lib);
 12.1495 +-  printf("  global:\n");
 12.1496 ++  for (sym in ver)
 12.1497 ++    if ((ver[sym] == lib) && (sym in def))
 12.1498 ++      count++;
 12.1499 ++  if (count > 0)
 12.1500 ++    printf("  global:\n");
 12.1501 +   for (sym in ver)
 12.1502 +     if ((ver[sym] == lib) && (sym in def))
 12.1503 +       {
 12.1504 +diff -ruN gcc-20030210.orig/gcc/reload1.c gcc-20030210/gcc/reload1.c
 12.1505 +--- gcc-20030210.orig/gcc/reload1.c	Fri Jan 31 19:17:29 2003
 12.1506 ++++ gcc-20030210/gcc/reload1.c	Sat Feb 22 01:40:14 2003
 12.1507 +@@ -6103,6 +6103,7 @@
 12.1508 + 	    for (j = 0; j < n_reloads; j++)
 12.1509 + 	      if (rld[j].in != 0
 12.1510 + 		  && rld[j].when_needed != RELOAD_OTHER
 12.1511 ++		  && rld[j].when_needed != RELOAD_FOR_OUTPUT_ADDRESS
 12.1512 + 		  && reg_overlap_mentioned_for_reload_p (rld[j].in,
 12.1513 + 							 rld[i].in))
 12.1514 + 		rld[j].when_needed
 12.1515 +diff -ruN gcc-20030210.orig/gcc/reorg.c gcc-20030210/gcc/reorg.c
 12.1516 +--- gcc-20030210.orig/gcc/reorg.c	Fri Jan 31 19:17:30 2003
 12.1517 ++++ gcc-20030210/gcc/reorg.c	Sat Feb 22 01:40:14 2003
 12.1518 +@@ -3265,6 +3265,14 @@
 12.1519 + 		|| condjump_in_parallel_p (XVECEXP (PATTERN (insn), 0, 0))))
 12.1520 + 	continue;
 12.1521 + 
 12.1522 ++#ifdef MD_CAN_REDIRECT_BRANCH
 12.1523 ++      /* On some targets, branches with delay slots can have a limited
 12.1524 ++	 displacement.  Give the back end a chance to tell us we can't do
 12.1525 ++	 this.  */
 12.1526 ++      if (! MD_CAN_REDIRECT_BRANCH (insn, delay_insn))
 12.1527 ++	continue;
 12.1528 ++#endif
 12.1529 ++
 12.1530 +       target_label = JUMP_LABEL (delay_insn);
 12.1531 + 
 12.1532 +       if (target_label)
 12.1533 +diff -ruN gcc-20030210.orig/gcc/tree-inline.c gcc-20030210/gcc/tree-inline.c
 12.1534 +--- gcc-20030210.orig/gcc/tree-inline.c	Fri Jan 31 19:17:33 2003
 12.1535 ++++ gcc-20030210/gcc/tree-inline.c	Sat Feb 22 01:40:14 2003
 12.1536 +@@ -836,11 +836,17 @@
 12.1537 + 
 12.1538 +   /* Don't try to inline functions that are not well-suited to
 12.1539 +      inlining.  */
 12.1540 +-  if (!inlinable_function_p (fn, id))
 12.1541 +-    return NULL_TREE;
 12.1542 ++  if (! inlinable_function_p (fn, id)
 12.1543 ++      || ! (*lang_hooks.tree_inlining.start_inlining) (fn))
 12.1544 ++    {
 12.1545 ++      if (DECL_INLINE (fn) && warn_inline && ! flag_really_no_inline)
 12.1546 ++	{
 12.1547 ++	  warning_with_decl (fn, "inlining failed in call to `%s'");
 12.1548 ++	  warning ("called from here");
 12.1549 ++	}
 12.1550 + 
 12.1551 +-  if (! (*lang_hooks.tree_inlining.start_inlining) (fn))
 12.1552 +-    return NULL_TREE;
 12.1553 ++      return NULL_TREE;
 12.1554 ++    }
 12.1555 + 
 12.1556 +   /* Set the current filename and line number to the function we are
 12.1557 +      inlining so that when we create new _STMT nodes here they get
 12.1558 +diff -ruN gcc-20030210.orig/libjava/Makefile.in gcc-20030210/libjava/Makefile.in
 12.1559 +--- gcc-20030210.orig/libjava/Makefile.in	Tue Jan 28 10:44:37 2003
 12.1560 ++++ gcc-20030210/libjava/Makefile.in	Sat Feb 22 01:40:14 2003
 12.1561 +@@ -1637,6 +1637,7 @@
 12.1562 + 	"AS=$(AS)" \
 12.1563 + 	"CC=$(CC)" \
 12.1564 + 	"CXX=$(CXX)" \
 12.1565 ++	"GCJ=$(GCJ)" \
 12.1566 + 	"LD=$(LD)" \
 12.1567 + 	"LIBCFLAGS=$(LIBCFLAGS)" \
 12.1568 + 	"NM=$(NM)" \
 12.1569 +diff -ruN gcc-20030210.orig/libjava/configure gcc-20030210/libjava/configure
 12.1570 +--- gcc-20030210.orig/libjava/configure	Tue Jan 28 10:44:37 2003
 12.1571 ++++ gcc-20030210/libjava/configure	Sat Feb 22 01:42:11 2003
 12.1572 +@@ -2031,7 +2031,7 @@
 12.1573 + # This must be Linux ELF.
 12.1574 + linux-gnu*)
 12.1575 +   case $host_cpu in
 12.1576 +-  alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* )
 12.1577 ++  alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | sh* )
 12.1578 +     lt_cv_deplibs_check_method=pass_all ;;
 12.1579 +   *)
 12.1580 +     # glibc up to 2.1.1 does not perform some relocations on ARM
 12.1581 +diff -ruN gcc-20030210.orig/libjava/java/net/natInetAddress.cc gcc-20030210/libjava/java/net/natInetAddress.cc
 12.1582 +--- gcc-20030210.orig/libjava/java/net/natInetAddress.cc	Tue Mar  5 05:02:19 2002
 12.1583 ++++ gcc-20030210/libjava/java/net/natInetAddress.cc	Sat Feb 22 01:40:14 2003
 12.1584 +@@ -56,7 +56,7 @@
 12.1585 + #endif
 12.1586 + 
 12.1587 + #ifndef HAVE_GETHOSTNAME_DECL
 12.1588 +-extern "C" int gethostname (char *name, int namelen);
 12.1589 ++extern "C" int gethostname (char *name, unsigned int namelen);
 12.1590 + #endif
 12.1591 + 
 12.1592 + #ifdef DISABLE_JAVA_NET
 12.1593 +diff -ruN gcc-20030210.orig/libjava/libltdl/aclocal.m4 gcc-20030210/libjava/libltdl/aclocal.m4
 12.1594 +--- gcc-20030210.orig/libjava/libltdl/aclocal.m4	Sun Sep 10 17:04:40 2000
 12.1595 ++++ gcc-20030210/libjava/libltdl/aclocal.m4	Sat Feb 22 01:40:14 2003
 12.1596 +@@ -573,7 +573,7 @@
 12.1597 + # This must be Linux ELF.
 12.1598 + linux-gnu*)
 12.1599 +   case "$host_cpu" in
 12.1600 +-  alpha* | i*86 | powerpc* | sparc* | ia64* )
 12.1601 ++  alpha* | i*86 | powerpc* | sparc* | ia64* | sh*)
 12.1602 +     lt_cv_deplibs_check_method=pass_all ;;
 12.1603 +   *)
 12.1604 +     # glibc up to 2.1.1 does not perform some relocations on ARM
 12.1605 +diff -ruN gcc-20030210.orig/libjava/sysdep/sh/locks.h gcc-20030210/libjava/sysdep/sh/locks.h
 12.1606 +--- gcc-20030210.orig/libjava/sysdep/sh/locks.h	Thu Jan  1 09:00:00 1970
 12.1607 ++++ gcc-20030210/libjava/sysdep/sh/locks.h	Sat Feb 22 01:40:14 2003
 12.1608 +@@ -0,0 +1,72 @@
 12.1609 ++// locks.h - Thread synchronization primitives. SuperH implementation.
 12.1610 ++
 12.1611 ++/* Copyright (C) 2002  Free Software Foundation
 12.1612 ++
 12.1613 ++   This file is part of libgcj.
 12.1614 ++
 12.1615 ++This software is copyrighted work licensed under the terms of the
 12.1616 ++Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
 12.1617 ++details.  */
 12.1618 ++
 12.1619 ++#ifndef __SYSDEP_LOCKS_H__
 12.1620 ++#define __SYSDEP_LOCKS_H__
 12.1621 ++
 12.1622 ++typedef size_t obj_addr_t;	/* Integer type big enough for object	*/
 12.1623 ++				/* address.				*/
 12.1624 ++
 12.1625 ++static unsigned char __cas_lock = 0;
 12.1626 ++
 12.1627 ++inline static void
 12.1628 ++__cas_start_atomic (void)
 12.1629 ++{
 12.1630 ++  unsigned int val;
 12.1631 ++
 12.1632 ++  do
 12.1633 ++    __asm__ __volatile__ ("tas.b @%1; movt %0"
 12.1634 ++			  : "=r" (val)
 12.1635 ++			  : "r" (&__cas_lock)
 12.1636 ++			  : "memory");
 12.1637 ++  while (val == 0);
 12.1638 ++}
 12.1639 ++
 12.1640 ++inline static void
 12.1641 ++__cas_end_atomic (void)
 12.1642 ++{
 12.1643 ++  __asm__ __volatile__ (" " : : : "memory");
 12.1644 ++  __cas_lock = 0;
 12.1645 ++}
 12.1646 ++
 12.1647 ++inline static bool
 12.1648 ++compare_and_swap (volatile obj_addr_t *addr, obj_addr_t old,
 12.1649 ++		  obj_addr_t new_val)
 12.1650 ++{
 12.1651 ++  bool ret;
 12.1652 ++
 12.1653 ++  __cas_start_atomic ();
 12.1654 ++  if (*addr != old)
 12.1655 ++    ret = false;
 12.1656 ++  else
 12.1657 ++    {
 12.1658 ++      *addr = new_val;
 12.1659 ++      ret = true;
 12.1660 ++    }
 12.1661 ++  __cas_end_atomic ();
 12.1662 ++
 12.1663 ++  return ret;
 12.1664 ++}
 12.1665 ++
 12.1666 ++inline static void
 12.1667 ++release_set (volatile obj_addr_t *addr, obj_addr_t new_val)
 12.1668 ++{
 12.1669 ++  __asm__ __volatile__ (" " : : : "memory");
 12.1670 ++  *(addr) = new_val;
 12.1671 ++}
 12.1672 ++
 12.1673 ++inline static bool
 12.1674 ++compare_and_swap_release (volatile obj_addr_t *addr, obj_addr_t old,
 12.1675 ++			  obj_addr_t new_val)
 12.1676 ++{
 12.1677 ++  return compare_and_swap (addr, old, new_val);
 12.1678 ++}
 12.1679 ++
 12.1680 ++#endif /* ! __SYSDEP_LOCKS_H__ */
 12.1681 +diff -ruN gcc-20030210.orig/libstdc++-v3/acinclude.m4 gcc-20030210/libstdc++-v3/acinclude.m4
 12.1682 +--- gcc-20030210.orig/libstdc++-v3/acinclude.m4	Tue Jan 28 02:30:41 2003
 12.1683 ++++ gcc-20030210/libstdc++-v3/acinclude.m4	Sat Feb 22 01:40:14 2003
 12.1684 +@@ -1828,9 +1828,10 @@
 12.1685 +   GLIBCPP_INCLUDES="-I${glibcpp_builddir}/include/${target_alias} -I${glibcpp_builddir}/include"
 12.1686 + 
 12.1687 +   # Passed down for canadian crosses.
 12.1688 +-  if test x"$CANADIAN" = xyes; then
 12.1689 +-    TOPLEVEL_INCLUDES='-I$(includedir)'
 12.1690 +-  fi
 12.1691 ++  #if test x"$CANADIAN" = xyes; then
 12.1692 ++  #  TOPLEVEL_INCLUDES='-I$(includedir)'
 12.1693 ++  #fi
 12.1694 ++  TOPLEVEL_INCLUDES=''
 12.1695 + 
 12.1696 +   LIBMATH_INCLUDES='-I$(top_srcdir)/libmath'
 12.1697 + 
 12.1698 +diff -ruN gcc-20030210.orig/libstdc++-v3/aclocal.m4 gcc-20030210/libstdc++-v3/aclocal.m4
 12.1699 +--- gcc-20030210.orig/libstdc++-v3/aclocal.m4	Mon Feb 10 19:36:47 2003
 12.1700 ++++ gcc-20030210/libstdc++-v3/aclocal.m4	Sat Feb 22 01:40:14 2003
 12.1701 +@@ -1840,9 +1840,10 @@
 12.1702 +   GLIBCPP_INCLUDES="-I${glibcpp_builddir}/include/${target_alias} -I${glibcpp_builddir}/include"
 12.1703 + 
 12.1704 +   # Passed down for canadian crosses.
 12.1705 +-  if test x"$CANADIAN" = xyes; then
 12.1706 +-    TOPLEVEL_INCLUDES='-I$(includedir)'
 12.1707 +-  fi
 12.1708 ++  #if test x"$CANADIAN" = xyes; then
 12.1709 ++  #  TOPLEVEL_INCLUDES='-I$(includedir)'
 12.1710 ++  #fi
 12.1711 ++  TOPLEVEL_INCLUDES=''
 12.1712 + 
 12.1713 +   LIBMATH_INCLUDES='-I$(top_srcdir)/libmath'
 12.1714 + 
 12.1715 +diff -ruN gcc-20030210.orig/libstdc++-v3/configure gcc-20030210/libstdc++-v3/configure
 12.1716 +--- gcc-20030210.orig/libstdc++-v3/configure	Mon Feb 10 19:37:17 2003
 12.1717 ++++ gcc-20030210/libstdc++-v3/configure	Sat Feb 22 01:40:14 2003
 12.1718 +@@ -1982,7 +1982,7 @@
 12.1719 + # This must be Linux ELF.
 12.1720 + linux-gnu*)
 12.1721 +   case $host_cpu in
 12.1722 +-  alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* )
 12.1723 ++  alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | sh*)
 12.1724 +     lt_cv_deplibs_check_method=pass_all ;;
 12.1725 +   *)
 12.1726 +     # glibc up to 2.1.1 does not perform some relocations on ARM
 12.1727 +@@ -22340,9 +22340,10 @@
 12.1728 +   GLIBCPP_INCLUDES="-I${glibcpp_builddir}/include/${target_alias} -I${glibcpp_builddir}/include"
 12.1729 + 
 12.1730 +   # Passed down for canadian crosses.
 12.1731 +-  if test x"$CANADIAN" = xyes; then
 12.1732 +-    TOPLEVEL_INCLUDES='-I$(includedir)'
 12.1733 +-  fi
 12.1734 ++  #if test x"$CANADIAN" = xyes; then
 12.1735 ++  #  TOPLEVEL_INCLUDES='-I$(includedir)'
 12.1736 ++  #fi
 12.1737 ++  TOPLEVEL_INCLUDES=''
 12.1738 + 
 12.1739 +   LIBMATH_INCLUDES='-I$(top_srcdir)/libmath'
 12.1740 + 
 12.1741 +diff -ruN gcc-20030210.orig/libtool.m4 gcc-20030210/libtool.m4
 12.1742 +--- gcc-20030210.orig/libtool.m4	Fri Jan 31 19:16:59 2003
 12.1743 ++++ gcc-20030210/libtool.m4	Sat Feb 22 01:40:14 2003
 12.1744 +@@ -597,7 +597,7 @@
 12.1745 + # This must be Linux ELF.
 12.1746 + linux-gnu*)
 12.1747 +   case $host_cpu in
 12.1748 +-  alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* )
 12.1749 ++  alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | sh* )
 12.1750 +     lt_cv_deplibs_check_method=pass_all ;;
 12.1751 +   *)
 12.1752 +     # glibc up to 2.1.1 does not perform some relocations on ARM
 12.1753 +diff -ruN gcc-20030210.orig/zlib/configure gcc-20030210/zlib/configure
 12.1754 +--- gcc-20030210.orig/zlib/configure	Tue Jan 28 10:44:15 2003
 12.1755 ++++ gcc-20030210/zlib/configure	Sat Feb 22 01:40:14 2003
 12.1756 +@@ -1571,7 +1571,7 @@
 12.1757 + # This must be Linux ELF.
 12.1758 + linux-gnu*)
 12.1759 +   case $host_cpu in
 12.1760 +-  alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* )
 12.1761 ++  alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | sh* )
 12.1762 +     lt_cv_deplibs_check_method=pass_all ;;
 12.1763 +   *)
 12.1764 +     # glibc up to 2.1.1 does not perform some relocations on ARM
    13.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.2 +++ b/patches/gcc/3.2.3/130-g++.exp.patch	Mon Jul 28 21:08:01 2008 +0000
    13.3 @@ -0,0 +1,98 @@
    13.4 +g++ testsuite fixes for cross-compilers, Dan Kegel, Ixia Communications, 12 July 2003
    13.5 +
    13.6 +The first hunk fixes the error
    13.7 +
    13.8 +/testsuite_flags: /testsuite_flags: No such file or directory
    13.9 +    while executing
   13.10 +"exec sh ${odir_v3}/testsuite_flags --build-includes"
   13.11 +    (procedure "g++_include_flags" line 21)
   13.12 +    invoked from within
   13.13 +"g++_include_flags [get_multilibs] "
   13.14 +    (procedure "g++_init" line 63)
   13.15 +    invoked from within
   13.16 +"${tool}_init $test_file_name"
   13.17 +    (procedure "runtest" line 19)
   13.18 +    invoked from within
   13.19 +"runtest $test_name"
   13.20 +    ("foreach" body line 42)
   13.21 +    invoked from within
   13.22 +...
   13.23 +make[1]: [check-g++] Error 1 (ignored)
   13.24 +
   13.25 +The fix isn't especially pretty, but it worked for me, and can't hurt the
   13.26 +more common native compiler case.  Maybe someone who knows the code better 
   13.27 +can come up with a better fix.
   13.28 +
   13.29 +The second hunk fixes the error
   13.30 +
   13.31 +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
   13.32 +
   13.33 +when trying to compile g++ testcases (!); setting up
   13.34 +the shared library environment when running crosstests of g++ 
   13.35 +should either be done by a special board file, or by
   13.36 +setting up a remote chroot environment (see http://kegel.com/crosstool),
   13.37 +not by blithely setting LD_LIBRARY_PATH on the local system.
   13.38 +
   13.39 +--- gcc-3.2.3/gcc/testsuite/lib/g++.exp.old	Fri Jul 11 15:42:47 2003
   13.40 ++++ gcc-3.2.3/gcc/testsuite/lib/g++.exp	Sat Jul 12 12:57:07 2003
   13.41 +@@ -72,6 +72,8 @@
   13.42 + #
   13.43 + proc g++_include_flags { paths } {
   13.44 +     global srcdir
   13.45 ++    global objdir
   13.46 ++    global target_triplet
   13.47 +     global HAVE_LIBSTDCXX_V3
   13.48 +     global TESTING_IN_BUILD_TREE
   13.49 + 
   13.50 +@@ -90,6 +92,20 @@
   13.51 + 
   13.52 +     if { ${HAVE_LIBSTDCXX_V3} } {
   13.53 +       set odir_v3 [lookfor_file ${gccpath} libstdc++-v3]
   13.54 ++      if { $odir_v3 == "" } {
   13.55 ++          verbose "g++_include_flags: couldn't find libstdc++-v3 on first try, now looking in build directory $objdir"
   13.56 ++	  # first assume no multilibs
   13.57 ++          set odir_v3 [lookfor_file ${objdir} "$target_triplet/libstdc++-v3"]
   13.58 ++      }
   13.59 ++      if { $odir_v3 == "" } {
   13.60 ++          verbose "g++_include_flags: couldn't find libstdc++-v3 on second try, trying multilib"
   13.61 ++	  # assume multilib only one level deep
   13.62 ++          set multisub [file tail $gccpath]
   13.63 ++          set odir_v3 [lookfor_file ${objdir} "$target_triplet/$multisub/libstdc++-v3"]
   13.64 ++      }
   13.65 ++      if { $odir_v3 == "" } {
   13.66 ++           error "Can't find libstdc++-v3"
   13.67 ++      }
   13.68 +       append flags [exec sh ${odir_v3}/testsuite_flags --build-includes]
   13.69 +     } else {
   13.70 +       set odir_v2 [lookfor_file ${gccpath} libstdc++]
   13.71 +@@ -192,16 +192,20 @@
   13.72 +       }
   13.73 +     }
   13.74 + 
   13.75 +-    # On IRIX 6, we have to set variables akin to LD_LIBRARY_PATH, but
   13.76 +-    # called LD_LIBRARYN32_PATH (for the N32 ABI) and LD_LIBRARY64_PATH
   13.77 +-    # (for the 64-bit ABI).  The right way to do this would be to modify
   13.78 +-    # unix.exp -- but that's not an option since it's part of DejaGNU
   13.79 +-    # proper, so we do it here.  We really only need to do 
   13.80 +-    # this on IRIX, but it shouldn't hurt to do it anywhere else.
   13.81 +-    setenv  LD_LIBRARY_PATH     $ld_library_path
   13.82 +-    setenv  SHLIB_PATH          $ld_library_path
   13.83 +-    setenv  LD_LIBRARYN32_PATH  $ld_library_path
   13.84 +-    setenv  LD_LIBRARY64_PATH   $ld_library_path
   13.85 ++    if {![is_remote target]} {
   13.86 ++      # On IRIX 6, we have to set variables akin to LD_LIBRARY_PATH, but
   13.87 ++      # called LD_LIBRARYN32_PATH (for the N32 ABI) and LD_LIBRARY64_PATH
   13.88 ++      # (for the 64-bit ABI).  The right way to do this would be to modify
   13.89 ++      # unix.exp -- but that's not an option since it's part of DejaGNU
   13.90 ++      # proper, so we do it here.  We really only need to do 
   13.91 ++      # this on IRIX, but it shouldn't hurt to do it anywhere else.
   13.92 ++
   13.93 ++      # Doing this causes us to be unable to run cross-compilers.
   13.94 ++      setenv  LD_LIBRARY_PATH     $ld_library_path
   13.95 ++      setenv  SHLIB_PATH          $ld_library_path
   13.96 ++      setenv  LD_LIBRARYN32_PATH  $ld_library_path
   13.97 ++      setenv  LD_LIBRARY64_PATH   $ld_library_path
   13.98 ++    }
   13.99 + 
  13.100 +     return "$flags"
  13.101 + }
    14.1 --- a/patches/gcc/3.2.3/130-gcc-3.2.3-g++.exp.patch	Mon Jul 28 20:17:48 2008 +0000
    14.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.3 @@ -1,98 +0,0 @@
    14.4 -g++ testsuite fixes for cross-compilers, Dan Kegel, Ixia Communications, 12 July 2003
    14.5 -
    14.6 -The first hunk fixes the error
    14.7 -
    14.8 -/testsuite_flags: /testsuite_flags: No such file or directory
    14.9 -    while executing
   14.10 -"exec sh ${odir_v3}/testsuite_flags --build-includes"
   14.11 -    (procedure "g++_include_flags" line 21)
   14.12 -    invoked from within
   14.13 -"g++_include_flags [get_multilibs] "
   14.14 -    (procedure "g++_init" line 63)
   14.15 -    invoked from within
   14.16 -"${tool}_init $test_file_name"
   14.17 -    (procedure "runtest" line 19)
   14.18 -    invoked from within
   14.19 -"runtest $test_name"
   14.20 -    ("foreach" body line 42)
   14.21 -    invoked from within
   14.22 -...
   14.23 -make[1]: [check-g++] Error 1 (ignored)
   14.24 -
   14.25 -The fix isn't especially pretty, but it worked for me, and can't hurt the
   14.26 -more common native compiler case.  Maybe someone who knows the code better 
   14.27 -can come up with a better fix.
   14.28 -
   14.29 -The second hunk fixes the error
   14.30 -
   14.31 -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
   14.32 -
   14.33 -when trying to compile g++ testcases (!); setting up
   14.34 -the shared library environment when running crosstests of g++ 
   14.35 -should either be done by a special board file, or by
   14.36 -setting up a remote chroot environment (see http://kegel.com/crosstool),
   14.37 -not by blithely setting LD_LIBRARY_PATH on the local system.
   14.38 -
   14.39 ---- gcc-3.2.3/gcc/testsuite/lib/g++.exp.old	Fri Jul 11 15:42:47 2003
   14.40 -+++ gcc-3.2.3/gcc/testsuite/lib/g++.exp	Sat Jul 12 12:57:07 2003
   14.41 -@@ -72,6 +72,8 @@
   14.42 - #
   14.43 - proc g++_include_flags { paths } {
   14.44 -     global srcdir
   14.45 -+    global objdir
   14.46 -+    global target_triplet
   14.47 -     global HAVE_LIBSTDCXX_V3
   14.48 -     global TESTING_IN_BUILD_TREE
   14.49 - 
   14.50 -@@ -90,6 +92,20 @@
   14.51 - 
   14.52 -     if { ${HAVE_LIBSTDCXX_V3} } {
   14.53 -       set odir_v3 [lookfor_file ${gccpath} libstdc++-v3]
   14.54 -+      if { $odir_v3 == "" } {
   14.55 -+          verbose "g++_include_flags: couldn't find libstdc++-v3 on first try, now looking in build directory $objdir"
   14.56 -+	  # first assume no multilibs
   14.57 -+          set odir_v3 [lookfor_file ${objdir} "$target_triplet/libstdc++-v3"]
   14.58 -+      }
   14.59 -+      if { $odir_v3 == "" } {
   14.60 -+          verbose "g++_include_flags: couldn't find libstdc++-v3 on second try, trying multilib"
   14.61 -+	  # assume multilib only one level deep
   14.62 -+          set multisub [file tail $gccpath]
   14.63 -+          set odir_v3 [lookfor_file ${objdir} "$target_triplet/$multisub/libstdc++-v3"]
   14.64 -+      }
   14.65 -+      if { $odir_v3 == "" } {
   14.66 -+           error "Can't find libstdc++-v3"
   14.67 -+      }
   14.68 -       append flags [exec sh ${odir_v3}/testsuite_flags --build-includes]
   14.69 -     } else {
   14.70 -       set odir_v2 [lookfor_file ${gccpath} libstdc++]
   14.71 -@@ -192,16 +192,20 @@
   14.72 -       }
   14.73 -     }
   14.74 - 
   14.75 --    # On IRIX 6, we have to set variables akin to LD_LIBRARY_PATH, but
   14.76 --    # called LD_LIBRARYN32_PATH (for the N32 ABI) and LD_LIBRARY64_PATH
   14.77 --    # (for the 64-bit ABI).  The right way to do this would be to modify
   14.78 --    # unix.exp -- but that's not an option since it's part of DejaGNU
   14.79 --    # proper, so we do it here.  We really only need to do 
   14.80 --    # this on IRIX, but it shouldn't hurt to do it anywhere else.
   14.81 --    setenv  LD_LIBRARY_PATH     $ld_library_path
   14.82 --    setenv  SHLIB_PATH          $ld_library_path
   14.83 --    setenv  LD_LIBRARYN32_PATH  $ld_library_path
   14.84 --    setenv  LD_LIBRARY64_PATH   $ld_library_path
   14.85 -+    if {![is_remote target]} {
   14.86 -+      # On IRIX 6, we have to set variables akin to LD_LIBRARY_PATH, but
   14.87 -+      # called LD_LIBRARYN32_PATH (for the N32 ABI) and LD_LIBRARY64_PATH
   14.88 -+      # (for the 64-bit ABI).  The right way to do this would be to modify
   14.89 -+      # unix.exp -- but that's not an option since it's part of DejaGNU
   14.90 -+      # proper, so we do it here.  We really only need to do 
   14.91 -+      # this on IRIX, but it shouldn't hurt to do it anywhere else.
   14.92 -+
   14.93 -+      # Doing this causes us to be unable to run cross-compilers.
   14.94 -+      setenv  LD_LIBRARY_PATH     $ld_library_path
   14.95 -+      setenv  SHLIB_PATH          $ld_library_path
   14.96 -+      setenv  LD_LIBRARYN32_PATH  $ld_library_path
   14.97 -+      setenv  LD_LIBRARY64_PATH   $ld_library_path
   14.98 -+    }
   14.99 - 
  14.100 -     return "$flags"
  14.101 - }
    15.1 --- a/patches/gcc/3.2.3/140-gcc-3.2.3-libffi-1.patch	Mon Jul 28 20:17:48 2008 +0000
    15.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.3 @@ -1,6864 +0,0 @@
    15.4 -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/Makefile.am gcc/libffi/Makefile.am
    15.5 ---- gcc-3.2.2.orig/libffi/Makefile.am	Tue Jan 28 10:43:56 2003
    15.6 -+++ gcc/libffi/Makefile.am	Tue Jan 28 10:48:33 2003
    15.7 -@@ -8,14 +8,17 @@
    15.8 - 		src/mips/n32.s src/mips/o32.S src/mips/o32.s \
    15.9 - 		src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S \
   15.10 - 		src/x86/ffi.c src/x86/sysv.S src/x86/win32.S \
   15.11 -+		src/x86/ffi64.c src/x86/unix64.S \
   15.12 - 		src/alpha/ffi.c src/alpha/osf.S \
   15.13 - 		src/m68k/ffi.c src/m68k/sysv.S \
   15.14 - 		src/powerpc/ffi.c src/powerpc/sysv.S \
   15.15 - 		src/powerpc/ppc_closure.S src/powerpc/asm.h \
   15.16 - 		src/powerpc/ffi_darwin.c \
   15.17 - 		src/powerpc/darwin.S src/powerpc/aix.S \
   15.18 --		src/powerpc/darwin_closure.S src/powerpc/aix_closures.S \
   15.19 --		src/arm/ffi.c src/arm/sysv.S
   15.20 -+		src/powerpc/darwin_closure.S src/powerpc/aix_closure.S \
   15.21 -+		src/arm/ffi.c src/arm/sysv.S \
   15.22 -+		src/s390/ffi.c src/s390/sysv.S \
   15.23 -+		src/sh/ffi.c src/sh/sysv.S
   15.24 - 
   15.25 - VPATH = @srcdir@:@srcdir@/src:@srcdir@/src/@TARGETDIR@
   15.26 - 
   15.27 -@@ -83,6 +86,7 @@
   15.28 - ffitest_LDFLAGS = -shared-libgcc
   15.29 - 
   15.30 - TARGET_SRC_MIPS_GCC = src/mips/ffi.c src/mips/o32.S src/mips/n32.S
   15.31 -+TARGET_SRC_MIPS_LINUX = src/mips/ffi.c src/mips/o32.S
   15.32 - TARGET_SRC_MIPS_SGI = src/mips/ffi.c src/mips/o32.s src/mips/n32.s
   15.33 - TARGET_SRC_X86 = src/x86/ffi.c src/x86/sysv.S
   15.34 - TARGET_SRC_X86_WIN32 = src/x86/ffi.c src/x86/win32.S
   15.35 -@@ -91,9 +95,12 @@
   15.36 - TARGET_SRC_IA64 = src/ia64/ffi.c src/ia64/unix.S
   15.37 - TARGET_SRC_M68K = src/m68k/ffi.c src/m68k/sysv.S
   15.38 - TARGET_SRC_POWERPC = src/powerpc/ffi.c src/powerpc/sysv.S src/powerpc/ppc_closure.S
   15.39 --TARGET_SRC_POWERPC_AIX = src/powerpc/ffi_darwin.c src/powerpc/aix.S src/powerpc/aix_closures.S
   15.40 -+TARGET_SRC_POWERPC_AIX = src/powerpc/ffi_darwin.c src/powerpc/aix.S src/powerpc/aix_closure.S
   15.41 - TARGET_SRC_POWERPC_DARWIN = src/powerpc/ffi_darwin.c src/powerpc/darwin.S src/powerpc/darwin_closure.S
   15.42 - TARGET_SRC_ARM =  src/arm/sysv.S src/arm/ffi.c
   15.43 -+TARGET_SRC_S390 =  src/s390/sysv.S src/s390/ffi.c
   15.44 -+TARGET_SRC_X86_64 = src/x86/ffi64.c src/x86/unix64.S src/x86/ffi.c src/x86/sysv.S
   15.45 -+TARGET_SRC_SH =  src/sh/sysv.S src/sh/ffi.c
   15.46 - 
   15.47 - ##libffi_la_SOURCES = src/debug.c src/prep_cif.c src/types.c $(TARGET_SRC_@TARGET@)
   15.48 - ## Work around automake deficiency
   15.49 -@@ -103,6 +110,10 @@
   15.50 - libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_GCC)
   15.51 - libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_GCC)
   15.52 - endif
   15.53 -+if MIPS_LINUX
   15.54 -+libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_LINUX)
   15.55 -+libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_LINUX)
   15.56 -+endif
   15.57 - if MIPS_SGI
   15.58 - libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_SGI)
   15.59 - libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_SGI)
   15.60 -@@ -147,6 +158,18 @@
   15.61 - libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_ARM)
   15.62 - libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_ARM)
   15.63 - endif
   15.64 -+if S390
   15.65 -+libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_S390)
   15.66 -+libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_S390)
   15.67 -+endif
   15.68 -+if X86_64
   15.69 -+libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_X86_64)
   15.70 -+libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_X86_64)
   15.71 -+endif
   15.72 -+if SH
   15.73 -+libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_SH)
   15.74 -+libfficonvenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_SH)
   15.75 -+endif
   15.76 - 
   15.77 - AM_CFLAGS = -fexceptions
   15.78 - 
   15.79 -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/Makefile.in gcc/libffi/Makefile.in
   15.80 ---- gcc-3.2.2.orig/libffi/Makefile.in	Wed Jan 29 07:59:05 2003
   15.81 -+++ gcc/libffi/Makefile.in	Wed Jan 29 07:58:58 2003
   15.82 -@@ -91,14 +91,17 @@
   15.83 - 		src/mips/n32.s src/mips/o32.S src/mips/o32.s \
   15.84 - 		src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S \
   15.85 - 		src/x86/ffi.c src/x86/sysv.S src/x86/win32.S \
   15.86 -+		src/x86/ffi64.c src/x86/unix64.S \
   15.87 - 		src/alpha/ffi.c src/alpha/osf.S \
   15.88 - 		src/m68k/ffi.c src/m68k/sysv.S \
   15.89 - 		src/powerpc/ffi.c src/powerpc/sysv.S \
   15.90 - 		src/powerpc/ppc_closure.S src/powerpc/asm.h \
   15.91 - 		src/powerpc/ffi_darwin.c \
   15.92 - 		src/powerpc/darwin.S src/powerpc/aix.S \
   15.93 --		src/powerpc/darwin_closure.S src/powerpc/aix_closures.S \
   15.94 --		src/arm/ffi.c src/arm/sysv.S
   15.95 -+		src/powerpc/darwin_closure.S src/powerpc/aix_closure.S \
   15.96 -+		src/arm/ffi.c src/arm/sysv.S \
   15.97 -+		src/s390/ffi.c src/s390/sysv.S \
   15.98 -+		src/sh/ffi.c src/sh/sysv.S
   15.99 - 
  15.100 - 
  15.101 - VPATH = @srcdir@:@srcdir@/src:@srcdir@/src/@TARGETDIR@
  15.102 -@@ -162,6 +165,7 @@
  15.103 - ffitest_LDFLAGS = -shared-libgcc
  15.104 - 
  15.105 - TARGET_SRC_MIPS_GCC = src/mips/ffi.c src/mips/o32.S src/mips/n32.S
  15.106 -+TARGET_SRC_MIPS_LINUX = src/mips/ffi.c src/mips/o32.S
  15.107 - TARGET_SRC_MIPS_SGI = src/mips/ffi.c src/mips/o32.s src/mips/n32.s
  15.108 - TARGET_SRC_X86 = src/x86/ffi.c src/x86/sysv.S
  15.109 - TARGET_SRC_X86_WIN32 = src/x86/ffi.c src/x86/win32.S
  15.110 -@@ -170,14 +174,18 @@
  15.111 - TARGET_SRC_IA64 = src/ia64/ffi.c src/ia64/unix.S
  15.112 - TARGET_SRC_M68K = src/m68k/ffi.c src/m68k/sysv.S
  15.113 - TARGET_SRC_POWERPC = src/powerpc/ffi.c src/powerpc/sysv.S src/powerpc/ppc_closure.S
  15.114 --TARGET_SRC_POWERPC_AIX = src/powerpc/ffi_darwin.c src/powerpc/aix.S src/powerpc/aix_closures.S
  15.115 -+TARGET_SRC_POWERPC_AIX = src/powerpc/ffi_darwin.c src/powerpc/aix.S src/powerpc/aix_closure.S
  15.116 - TARGET_SRC_POWERPC_DARWIN = src/powerpc/ffi_darwin.c src/powerpc/darwin.S src/powerpc/darwin_closure.S
  15.117 - TARGET_SRC_ARM = src/arm/sysv.S src/arm/ffi.c
  15.118 -+TARGET_SRC_S390 = src/s390/sysv.S src/s390/ffi.c
  15.119 -+TARGET_SRC_X86_64 = src/x86/ffi64.c src/x86/unix64.S src/x86/ffi.c src/x86/sysv.S
  15.120 -+TARGET_SRC_SH = src/sh/sysv.S src/sh/ffi.c
  15.121 - 
  15.122 - libffi_la_common_SOURCES = src/debug.c src/prep_cif.c src/types.c \
  15.123 - 		src/raw_api.c src/java_raw_api.c
  15.124 - 
  15.125 - @MIPS_GCC_TRUE@libffi_la_SOURCES = @MIPS_GCC_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_GCC)
  15.126 -+@MIPS_LINUX_TRUE@libffi_la_SOURCES = @MIPS_LINUX_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_LINUX)
  15.127 - @MIPS_SGI_TRUE@libffi_la_SOURCES = @MIPS_SGI_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_SGI)
  15.128 - @X86_TRUE@libffi_la_SOURCES = @X86_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86)
  15.129 - @X86_WIN32_TRUE@libffi_la_SOURCES = @X86_WIN32_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86_WIN32)
  15.130 -@@ -189,7 +197,11 @@
  15.131 - @POWERPC_AIX_TRUE@libffi_la_SOURCES = @POWERPC_AIX_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_POWERPC_AIX)
  15.132 - @POWERPC_DARWIN_TRUE@libffi_la_SOURCES = @POWERPC_DARWIN_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_POWERPC_DARWIN)
  15.133 - @ARM_TRUE@libffi_la_SOURCES = @ARM_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_ARM)
  15.134 -+@S390_TRUE@libffi_la_SOURCES = @S390_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_S390)
  15.135 -+@X86_64_TRUE@libffi_la_SOURCES = @X86_64_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86_64)
  15.136 -+@SH_TRUE@libffi_la_SOURCES = @SH_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_SH)
  15.137 - @MIPS_GCC_TRUE@libffi_convenience_la_SOURCES = @MIPS_GCC_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_GCC)
  15.138 -+@MIPS_LINUX_TRUE@libffi_convenience_la_SOURCES = @MIPS_LINUX_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_LINUX)
  15.139 - @MIPS_SGI_TRUE@libffi_convenience_la_SOURCES = @MIPS_SGI_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_SGI)
  15.140 - @X86_TRUE@libffi_convenience_la_SOURCES = @X86_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86)
  15.141 - @X86_WIN32_TRUE@libffi_convenience_la_SOURCES = @X86_WIN32_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86_WIN32)
  15.142 -@@ -201,6 +213,9 @@
  15.143 - @POWERPC_AIX_TRUE@libffi_convenience_la_SOURCES = @POWERPC_AIX_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_POWERPC_AIX)
  15.144 - @POWERPC_DARWIN_TRUE@libffi_convenience_la_SOURCES = @POWERPC_DARWIN_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_POWERPC_DARWIN)
  15.145 - @ARM_TRUE@libffi_convenience_la_SOURCES = @ARM_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_ARM)
  15.146 -+@S390_TRUE@libffi_convenience_la_SOURCES = @S390_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_S390)
  15.147 -+@X86_64_TRUE@libffi_convenience_la_SOURCES = @X86_64_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86_64)
  15.148 -+@SH_TRUE@libfficonvenience_la_SOURCES = @SH_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_SH)
  15.149 - 
  15.150 - AM_CFLAGS = -fexceptions
  15.151 - 
  15.152 -@@ -208,7 +223,7 @@
  15.153 - 
  15.154 - INCLUDES = -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src
  15.155 - ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
  15.156 --mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
  15.157 -+mkinstalldirs = $(SHELL) $(top_srcdir)/${libffi_basedir}/../mkinstalldirs
  15.158 - CONFIG_HEADER = fficonfig.h
  15.159 - CONFIG_CLEAN_FILES = 
  15.160 - LTLIBRARIES =  $(noinst_LTLIBRARIES) $(toolexeclib_LTLIBRARIES)
  15.161 -@@ -220,10 +235,6 @@
  15.162 - LIBS = @LIBS@
  15.163 - libffi_convenience_la_LDFLAGS = 
  15.164 - libffi_convenience_la_LIBADD = 
  15.165 --@POWERPC_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo \
  15.166 --@POWERPC_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
  15.167 --@POWERPC_TRUE@src/java_raw_api.lo src/powerpc/ffi.lo \
  15.168 --@POWERPC_TRUE@src/powerpc/sysv.lo src/powerpc/ppc_closure.lo
  15.169 - @ALPHA_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo \
  15.170 - @ALPHA_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
  15.171 - @ALPHA_TRUE@src/java_raw_api.lo src/alpha/ffi.lo src/alpha/osf.lo
  15.172 -@@ -234,12 +245,29 @@
  15.173 - @MIPS_GCC_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
  15.174 - @MIPS_GCC_TRUE@src/java_raw_api.lo src/mips/ffi.lo src/mips/o32.lo \
  15.175 - @MIPS_GCC_TRUE@src/mips/n32.lo
  15.176 --@X86_WIN32_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo \
  15.177 --@X86_WIN32_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
  15.178 --@X86_WIN32_TRUE@src/java_raw_api.lo src/x86/ffi.lo src/x86/win32.lo
  15.179 -+@S390_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
  15.180 -+@S390_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
  15.181 -+@S390_TRUE@src/s390/sysv.lo src/s390/ffi.lo
  15.182 - @M68K_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
  15.183 - @M68K_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
  15.184 - @M68K_TRUE@src/m68k/ffi.lo src/m68k/sysv.lo
  15.185 -+@X86_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
  15.186 -+@X86_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
  15.187 -+@X86_TRUE@src/x86/ffi.lo src/x86/sysv.lo
  15.188 -+@POWERPC_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo \
  15.189 -+@POWERPC_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
  15.190 -+@POWERPC_TRUE@src/java_raw_api.lo src/powerpc/ffi.lo \
  15.191 -+@POWERPC_TRUE@src/powerpc/sysv.lo src/powerpc/ppc_closure.lo
  15.192 -+@MIPS_LINUX_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo \
  15.193 -+@MIPS_LINUX_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
  15.194 -+@MIPS_LINUX_TRUE@src/java_raw_api.lo src/mips/ffi.lo src/mips/o32.lo
  15.195 -+@X86_WIN32_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo \
  15.196 -+@X86_WIN32_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
  15.197 -+@X86_WIN32_TRUE@src/java_raw_api.lo src/x86/ffi.lo src/x86/win32.lo
  15.198 -+@X86_64_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo \
  15.199 -+@X86_64_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
  15.200 -+@X86_64_TRUE@src/java_raw_api.lo src/x86/ffi64.lo src/x86/unix64.lo \
  15.201 -+@X86_64_TRUE@src/x86/ffi.lo src/x86/sysv.lo
  15.202 - @SPARC_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo \
  15.203 - @SPARC_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
  15.204 - @SPARC_TRUE@src/java_raw_api.lo src/sparc/ffi.lo src/sparc/v8.lo \
  15.205 -@@ -247,62 +275,75 @@
  15.206 - @POWERPC_AIX_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo \
  15.207 - @POWERPC_AIX_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
  15.208 - @POWERPC_AIX_TRUE@src/java_raw_api.lo src/powerpc/ffi_darwin.lo \
  15.209 --@POWERPC_AIX_TRUE@src/powerpc/aix.lo src/powerpc/aix_closures.lo
  15.210 --@X86_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
  15.211 --@X86_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
  15.212 --@X86_TRUE@src/x86/ffi.lo src/x86/sysv.lo
  15.213 --@ARM_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
  15.214 --@ARM_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
  15.215 --@ARM_TRUE@src/arm/sysv.lo src/arm/ffi.lo
  15.216 -+@POWERPC_AIX_TRUE@src/powerpc/aix.lo src/powerpc/aix_closure.lo
  15.217 -+@MIPS_SGI_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo \
  15.218 -+@MIPS_SGI_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
  15.219 -+@MIPS_SGI_TRUE@src/java_raw_api.lo src/mips/ffi.lo src/mips/o32.lo \
  15.220 -+@MIPS_SGI_TRUE@src/mips/n32.lo
  15.221 - @POWERPC_DARWIN_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo \
  15.222 - @POWERPC_DARWIN_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
  15.223 - @POWERPC_DARWIN_TRUE@src/java_raw_api.lo src/powerpc/ffi_darwin.lo \
  15.224 - @POWERPC_DARWIN_TRUE@src/powerpc/darwin.lo \
  15.225 - @POWERPC_DARWIN_TRUE@src/powerpc/darwin_closure.lo
  15.226 --@MIPS_SGI_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo \
  15.227 --@MIPS_SGI_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
  15.228 --@MIPS_SGI_TRUE@src/java_raw_api.lo src/mips/ffi.lo src/mips/o32.lo \
  15.229 --@MIPS_SGI_TRUE@src/mips/n32.lo
  15.230 -+@ARM_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
  15.231 -+@ARM_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
  15.232 -+@ARM_TRUE@src/arm/sysv.lo src/arm/ffi.lo
  15.233 -+@SH_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
  15.234 -+@SH_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
  15.235 -+@SH_TRUE@src/sh/sysv.lo src/sh/ffi.lo
  15.236 - libffi_la_LIBADD = 
  15.237 -+@SH_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo src/types.lo \
  15.238 -+@SH_TRUE@src/raw_api.lo src/java_raw_api.lo src/sh/sysv.lo \
  15.239 -+@SH_TRUE@src/sh/ffi.lo
  15.240 -+@IA64_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
  15.241 -+@IA64_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
  15.242 -+@IA64_TRUE@src/ia64/ffi.lo src/ia64/unix.lo
  15.243 -+@X86_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo src/types.lo \
  15.244 -+@X86_TRUE@src/raw_api.lo src/java_raw_api.lo src/x86/ffi.lo \
  15.245 -+@X86_TRUE@src/x86/sysv.lo
  15.246 - @POWERPC_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
  15.247 - @POWERPC_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
  15.248 - @POWERPC_TRUE@src/powerpc/ffi.lo src/powerpc/sysv.lo \
  15.249 - @POWERPC_TRUE@src/powerpc/ppc_closure.lo
  15.250 --@ALPHA_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
  15.251 --@ALPHA_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
  15.252 --@ALPHA_TRUE@src/alpha/ffi.lo src/alpha/osf.lo
  15.253 --@IA64_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
  15.254 --@IA64_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
  15.255 --@IA64_TRUE@src/ia64/ffi.lo src/ia64/unix.lo
  15.256 --@MIPS_GCC_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
  15.257 --@MIPS_GCC_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
  15.258 --@MIPS_GCC_TRUE@src/mips/ffi.lo src/mips/o32.lo src/mips/n32.lo
  15.259 --@X86_WIN32_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
  15.260 --@X86_WIN32_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
  15.261 --@X86_WIN32_TRUE@src/x86/ffi.lo src/x86/win32.lo
  15.262 --@M68K_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
  15.263 --@M68K_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
  15.264 --@M68K_TRUE@src/m68k/ffi.lo src/m68k/sysv.lo
  15.265 -+@MIPS_LINUX_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
  15.266 -+@MIPS_LINUX_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
  15.267 -+@MIPS_LINUX_TRUE@src/mips/ffi.lo src/mips/o32.lo
  15.268 - @SPARC_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
  15.269 - @SPARC_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
  15.270 - @SPARC_TRUE@src/sparc/ffi.lo src/sparc/v8.lo src/sparc/v9.lo
  15.271 - @POWERPC_AIX_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
  15.272 - @POWERPC_AIX_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
  15.273 - @POWERPC_AIX_TRUE@src/powerpc/ffi_darwin.lo src/powerpc/aix.lo \
  15.274 --@POWERPC_AIX_TRUE@src/powerpc/aix_closures.lo
  15.275 --@X86_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo src/types.lo \
  15.276 --@X86_TRUE@src/raw_api.lo src/java_raw_api.lo src/x86/ffi.lo \
  15.277 --@X86_TRUE@src/x86/sysv.lo
  15.278 -+@POWERPC_AIX_TRUE@src/powerpc/aix_closure.lo
  15.279 -+@MIPS_SGI_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
  15.280 -+@MIPS_SGI_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
  15.281 -+@MIPS_SGI_TRUE@src/mips/ffi.lo src/mips/o32.lo src/mips/n32.lo
  15.282 - @ARM_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo src/types.lo \
  15.283 - @ARM_TRUE@src/raw_api.lo src/java_raw_api.lo src/arm/sysv.lo \
  15.284 - @ARM_TRUE@src/arm/ffi.lo
  15.285 -+@ALPHA_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
  15.286 -+@ALPHA_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
  15.287 -+@ALPHA_TRUE@src/alpha/ffi.lo src/alpha/osf.lo
  15.288 -+@MIPS_GCC_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
  15.289 -+@MIPS_GCC_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
  15.290 -+@MIPS_GCC_TRUE@src/mips/ffi.lo src/mips/o32.lo src/mips/n32.lo
  15.291 -+@S390_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
  15.292 -+@S390_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
  15.293 -+@S390_TRUE@src/s390/sysv.lo src/s390/ffi.lo
  15.294 -+@M68K_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
  15.295 -+@M68K_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
  15.296 -+@M68K_TRUE@src/m68k/ffi.lo src/m68k/sysv.lo
  15.297 -+@X86_WIN32_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
  15.298 -+@X86_WIN32_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
  15.299 -+@X86_WIN32_TRUE@src/x86/ffi.lo src/x86/win32.lo
  15.300 -+@X86_64_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
  15.301 -+@X86_64_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
  15.302 -+@X86_64_TRUE@src/x86/ffi64.lo src/x86/unix64.lo src/x86/ffi.lo \
  15.303 -+@X86_64_TRUE@src/x86/sysv.lo
  15.304 - @POWERPC_DARWIN_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
  15.305 - @POWERPC_DARWIN_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
  15.306 - @POWERPC_DARWIN_TRUE@src/powerpc/ffi_darwin.lo src/powerpc/darwin.lo \
  15.307 - @POWERPC_DARWIN_TRUE@src/powerpc/darwin_closure.lo
  15.308 --@MIPS_SGI_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
  15.309 --@MIPS_SGI_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
  15.310 --@MIPS_SGI_TRUE@src/mips/ffi.lo src/mips/o32.lo src/mips/n32.lo
  15.311 - noinst_PROGRAMS =  ffitest$(EXEEXT)
  15.312 - PROGRAMS =  $(noinst_PROGRAMS)
  15.313 - 
  15.314 -@@ -578,8 +616,8 @@
  15.315 - 	-chmod 777 $(distdir)
  15.316 - 	$(mkinstalldirs) $(distdir)/src/alpha $(distdir)/src/arm \
  15.317 - 	   $(distdir)/src/m68k $(distdir)/src/mips \
  15.318 --	   $(distdir)/src/powerpc $(distdir)/src/sparc \
  15.319 --	   $(distdir)/src/x86
  15.320 -+	   $(distdir)/src/powerpc $(distdir)/src/s390 $(distdir)/src/sh \
  15.321 -+	   $(distdir)/src/sparc $(distdir)/src/x86
  15.322 - 	@for file in $(DISTFILES); do \
  15.323 - 	  if test -f $$file; then d=.; else d=$(srcdir); fi; \
  15.324 - 	  if test -d $$d/$$file; then \
  15.325 -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/acinclude.m4 gcc/libffi/acinclude.m4
  15.326 ---- gcc-3.2.2.orig/libffi/acinclude.m4	Sun Sep 10 16:43:14 2000
  15.327 -+++ gcc/libffi/acinclude.m4	Tue Dec 17 03:22:47 2002
  15.328 -@@ -4,5 +4,8 @@
  15.329 - dnl to add a definition of LIBTOOL to Makefile.in.
  15.330 - ifelse(yes,no,[
  15.331 - AC_DEFUN([AC_PROG_LIBTOOL],)
  15.332 -+AC_DEFUN([AM_PROG_LIBTOOL],)
  15.333 - AC_SUBST(LIBTOOL)
  15.334 - ])
  15.335 -+
  15.336 -+sinclude(../config/accross.m4)
  15.337 -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/aclocal.m4 gcc/libffi/aclocal.m4
  15.338 ---- gcc-3.2.2.orig/libffi/aclocal.m4	Fri Feb  1 07:25:31 2002
  15.339 -+++ gcc/libffi/aclocal.m4	Tue Dec 17 03:22:47 2002
  15.340 -@@ -1,6 +1,6 @@
  15.341 --dnl aclocal.m4 generated automatically by aclocal 1.4
  15.342 -+dnl aclocal.m4 generated automatically by aclocal 1.4-p5
  15.343 - 
  15.344 --dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
  15.345 -+dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
  15.346 - dnl This file is free software; the Free Software Foundation
  15.347 - dnl gives unlimited permission to copy and/or distribute it,
  15.348 - dnl with or without modifications, as long as this notice is preserved.
  15.349 -@@ -16,108 +16,15 @@
  15.350 - dnl to add a definition of LIBTOOL to Makefile.in.
  15.351 - ifelse(yes,no,[
  15.352 - AC_DEFUN([AC_PROG_LIBTOOL],)
  15.353 -+AC_DEFUN([AM_PROG_LIBTOOL],)
  15.354 - AC_SUBST(LIBTOOL)
  15.355 - ])
  15.356 - 
  15.357 --AC_DEFUN([AC_COMPILE_CHECK_SIZEOF],
  15.358 --[changequote(<<, >>)dnl
  15.359 --dnl The name to #define.
  15.360 --define(<<AC_TYPE_NAME>>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl
  15.361 --dnl The cache variable name.
  15.362 --define(<<AC_CV_NAME>>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl
  15.363 --changequote([, ])dnl
  15.364 --AC_MSG_CHECKING(size of $1)
  15.365 --AC_CACHE_VAL(AC_CV_NAME,
  15.366 --[for ac_size in 4 8 1 2 16 12 $2 ; do # List sizes in rough order of prevalence.
  15.367 --  AC_TRY_COMPILE([#include "confdefs.h"
  15.368 --#include <sys/types.h>
  15.369 --$2
  15.370 --], [switch (0) case 0: case (sizeof ($1) == $ac_size):;], AC_CV_NAME=$ac_size)
  15.371 --  if test x$AC_CV_NAME != x ; then break; fi
  15.372 --done
  15.373 --])
  15.374 --if test x$AC_CV_NAME = x ; then
  15.375 --  AC_MSG_ERROR([cannot determine a size for $1])
  15.376 --fi
  15.377 --AC_MSG_RESULT($AC_CV_NAME)
  15.378 --AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME, [The number of bytes in type $1])
  15.379 --undefine([AC_TYPE_NAME])dnl
  15.380 --undefine([AC_CV_NAME])dnl
  15.381 --])
  15.382 --
  15.383 --AC_DEFUN([AC_C_BIGENDIAN_CROSS],
  15.384 --[AC_CACHE_CHECK(whether byte ordering is bigendian, ac_cv_c_bigendian,
  15.385 --[ac_cv_c_bigendian=unknown
  15.386 --# See if sys/param.h defines the BYTE_ORDER macro.
  15.387 --AC_TRY_COMPILE([#include <sys/types.h>
  15.388 --#include <sys/param.h>], [
  15.389 --#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
  15.390 -- bogus endian macros
  15.391 --#endif], [# It does; now see whether it defined to BIG_ENDIAN or not.
  15.392 --AC_TRY_COMPILE([#include <sys/types.h>
  15.393 --#include <sys/param.h>], [
  15.394 --#if BYTE_ORDER != BIG_ENDIAN
  15.395 -- not big endian
  15.396 --#endif], ac_cv_c_bigendian=yes, ac_cv_c_bigendian=no)])
  15.397 --if test $ac_cv_c_bigendian = unknown; then
  15.398 --AC_TRY_RUN([main () {
  15.399 --  /* Are we little or big endian?  From Harbison&Steele.  */
  15.400 --  union
  15.401 --  {
  15.402 --    long l;
  15.403 --    char c[sizeof (long)];
  15.404 --  } u;
  15.405 --  u.l = 1;
  15.406 --  exit (u.c[sizeof (long) - 1] == 1);
  15.407 --}], ac_cv_c_bigendian=no, ac_cv_c_bigendian=yes,
  15.408 --[ echo $ac_n "cross-compiling... " 2>&AC_FD_MSG ])
  15.409 --fi])
  15.410 --if test $ac_cv_c_bigendian = unknown; then
  15.411 --AC_MSG_CHECKING(to probe for byte ordering)
  15.412 --[
  15.413 --cat >conftest.c <<EOF
  15.414 --short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
  15.415 --short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
  15.416 --void _ascii() { char* s = (char*) ascii_mm; s = (char*) ascii_ii; }
  15.417 --short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
  15.418 --short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
  15.419 --void _ebcdic() { char* s = (char*) ebcdic_mm; s = (char*) ebcdic_ii; }
  15.420 --int main() { _ascii (); _ebcdic (); return 0; }
  15.421 --EOF
  15.422 --] if test -f conftest.c ; then
  15.423 --     if ${CC-cc} ${CFLAGS} conftest.c -o conftest.o && test -f conftest.o ; then
  15.424 --        if test `grep -l BIGenDianSyS conftest.o` ; then
  15.425 --           echo $ac_n ' big endian probe OK, ' 1>&AC_FD_MSG
  15.426 --           ac_cv_c_bigendian=yes
  15.427 --        fi
  15.428 --        if test `grep -l LiTTleEnDian conftest.o` ; then
  15.429 --           echo $ac_n ' little endian probe OK, ' 1>&AC_FD_MSG
  15.430 --           if test $ac_cv_c_bigendian = yes ; then
  15.431 --            ac_cv_c_bigendian=unknown;
  15.432 --           else
  15.433 --            ac_cv_c_bigendian=no
  15.434 --           fi
  15.435 --        fi
  15.436 --        echo $ac_n 'guessing bigendian ...  ' >&AC_FD_MSG
  15.437 --     fi
  15.438 --  fi
  15.439 --AC_MSG_RESULT($ac_cv_c_bigendian)
  15.440 --fi
  15.441 --if test $ac_cv_c_bigendian = yes; then
  15.442 --  AC_DEFINE(WORDS_BIGENDIAN, 1, [whether byteorder is bigendian])
  15.443 --  BYTEORDER=4321
  15.444 --else
  15.445 --  BYTEORDER=1234
  15.446 --fi
  15.447 --AC_DEFINE_UNQUOTED(BYTEORDER, $BYTEORDER, [1234 = LIL_ENDIAN, 4321 = BIGENDIAN])
  15.448 --if test $ac_cv_c_bigendian = unknown; then
  15.449 --  AC_MSG_ERROR(unknown endianess - sorry, please pre-set ac_cv_c_bigendian)
  15.450 --fi
  15.451 --])
  15.452 -+sinclude(../config/accross.m4)
  15.453 - 
  15.454 - # Like AC_CONFIG_HEADER, but automatically create stamp file.
  15.455 - 
  15.456 --AC_DEFUN(AM_CONFIG_HEADER,
  15.457 -+AC_DEFUN([AM_CONFIG_HEADER],
  15.458 - [AC_PREREQ([2.12])
  15.459 - AC_CONFIG_HEADER([$1])
  15.460 - dnl When config.status generates a header, we must update the stamp-h file.
  15.461 -@@ -147,7 +54,7 @@
  15.462 - dnl Usage:
  15.463 - dnl AM_INIT_AUTOMAKE(package,version, [no-define])
  15.464 - 
  15.465 --AC_DEFUN(AM_INIT_AUTOMAKE,
  15.466 -+AC_DEFUN([AM_INIT_AUTOMAKE],
  15.467 - [AC_REQUIRE([AC_PROG_INSTALL])
  15.468 - PACKAGE=[$1]
  15.469 - AC_SUBST(PACKAGE)
  15.470 -@@ -175,7 +82,7 @@
  15.471 - # Check to make sure that the build environment is sane.
  15.472 - #
  15.473 - 
  15.474 --AC_DEFUN(AM_SANITY_CHECK,
  15.475 -+AC_DEFUN([AM_SANITY_CHECK],
  15.476 - [AC_MSG_CHECKING([whether build environment is sane])
  15.477 - # Just in case
  15.478 - sleep 1
  15.479 -@@ -216,7 +123,7 @@
  15.480 - 
  15.481 - dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
  15.482 - dnl The program must properly implement --version.
  15.483 --AC_DEFUN(AM_MISSING_PROG,
  15.484 -+AC_DEFUN([AM_MISSING_PROG],
  15.485 - [AC_MSG_CHECKING(for working $2)
  15.486 - # Run test in a subshell; some versions of sh will print an error if
  15.487 - # an executable is not found, even if stderr is redirected.
  15.488 -@@ -235,7 +142,7 @@
  15.489 - 
  15.490 - # serial 1
  15.491 - 
  15.492 --AC_DEFUN(AM_MAINTAINER_MODE,
  15.493 -+AC_DEFUN([AM_MAINTAINER_MODE],
  15.494 - [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
  15.495 -   dnl maintainer-mode is disabled by default
  15.496 -   AC_ARG_ENABLE(maintainer-mode,
  15.497 -@@ -252,7 +159,7 @@
  15.498 - 
  15.499 - # Define a conditional.
  15.500 - 
  15.501 --AC_DEFUN(AM_CONDITIONAL,
  15.502 -+AC_DEFUN([AM_CONDITIONAL],
  15.503 - [AC_SUBST($1_TRUE)
  15.504 - AC_SUBST($1_FALSE)
  15.505 - if $2; then
  15.506 -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/configure gcc/libffi/configure
  15.507 ---- gcc-3.2.2.orig/libffi/configure	Wed Jan 29 07:59:05 2003
  15.508 -+++ gcc/libffi/configure	Sat Feb  1 20:16:19 2003
  15.509 -@@ -633,17 +633,16 @@
  15.510 - 
  15.511 - if test "${srcdir}" = "."; then
  15.512 -   if test "${with_target_subdir}" != "."; then
  15.513 --    libffi_basedir="${srcdir}/${with_multisrctop}.."
  15.514 -+    libffi_basedir="${with_multisrctop}../"
  15.515 -   else
  15.516 --    libffi_basedir="${srcdir}/${with_multisrctop}"
  15.517 -+    libffi_basedir="${with_multisrctop}"
  15.518 -   fi
  15.519 - else
  15.520 --  libffi_basedir="${srcdir}"
  15.521 -+  libffi_basedir=
  15.522 - fi
  15.523 - 
  15.524 --
  15.525 - ac_aux_dir=
  15.526 --for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
  15.527 -+for ac_dir in ${libffi_basedir}.. $srcdir/${libffi_basedir}..; do
  15.528 -   if test -f $ac_dir/install-sh; then
  15.529 -     ac_aux_dir=$ac_dir
  15.530 -     ac_install_sh="$ac_aux_dir/install-sh -c"
  15.531 -@@ -655,13 +654,14 @@
  15.532 -   fi
  15.533 - done
  15.534 - if test -z "$ac_aux_dir"; then
  15.535 --  { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
  15.536 -+  { echo "configure: error: can not find install-sh or install.sh in ${libffi_basedir}.. $srcdir/${libffi_basedir}.." 1>&2; exit 1; }
  15.537 - fi
  15.538 - ac_config_guess=$ac_aux_dir/config.guess
  15.539 - ac_config_sub=$ac_aux_dir/config.sub
  15.540 - ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
  15.541 - 
  15.542 - 
  15.543 -+
  15.544 - # Make sure we can run config.sub.
  15.545 - if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
  15.546 - else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
  15.547 -@@ -1238,9 +1238,18 @@
  15.548 -   ;;
  15.549 - 
  15.550 - hpux10.20*|hpux11*)
  15.551 --  lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
  15.552 --  lt_cv_file_magic_cmd=/usr/bin/file
  15.553 --  lt_cv_file_magic_test_file=/usr/lib/libc.sl
  15.554 -+  case $host_cpu in
  15.555 -+  hppa*)
  15.556 -+    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
  15.557 -+    lt_cv_file_magic_cmd=/usr/bin/file
  15.558 -+    lt_cv_file_magic_test_file=/usr/lib/libc.sl
  15.559 -+    ;;
  15.560 -+  ia64*)
  15.561 -+    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
  15.562 -+    lt_cv_file_magic_cmd=/usr/bin/file
  15.563 -+    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
  15.564 -+    ;;
  15.565 -+  esac
  15.566 -   ;;
  15.567 - 
  15.568 - irix5* | irix6*)
  15.569 -@@ -1267,7 +1276,7 @@
  15.570 - # This must be Linux ELF.
  15.571 - linux-gnu*)
  15.572 -   case $host_cpu in
  15.573 --  alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* )
  15.574 -+  alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | sh* )
  15.575 -     lt_cv_deplibs_check_method=pass_all ;;
  15.576 -   *)
  15.577 -     # glibc up to 2.1.1 does not perform some relocations on ARM
  15.578 -@@ -1330,13 +1339,13 @@
  15.579 - deplibs_check_method=$lt_cv_deplibs_check_method
  15.580 - 
  15.581 - echo $ac_n "checking for object suffix""... $ac_c" 1>&6
  15.582 --echo "configure:1334: checking for object suffix" >&5
  15.583 -+echo "configure:1343: checking for object suffix" >&5
  15.584 - if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
  15.585 -   echo $ac_n "(cached) $ac_c" 1>&6
  15.586 - else
  15.587 -   rm -f conftest*
  15.588 - echo 'int i = 1;' > conftest.$ac_ext
  15.589 --if { (eval echo configure:1340: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  15.590 -+if { (eval echo configure:1349: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  15.591 -   for ac_file in conftest.*; do
  15.592 -     case $ac_file in
  15.593 -     *.c) ;;
  15.594 -@@ -1356,7 +1365,7 @@
  15.595 - 
  15.596 - 
  15.597 - echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
  15.598 --echo "configure:1360: checking for executable suffix" >&5
  15.599 -+echo "configure:1369: checking for executable suffix" >&5
  15.600 - if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
  15.601 -   echo $ac_n "(cached) $ac_c" 1>&6
  15.602 - else
  15.603 -@@ -1366,7 +1375,7 @@
  15.604 -   rm -f conftest*
  15.605 -   echo 'int main () { return 0; }' > conftest.$ac_ext
  15.606 -   ac_cv_exeext=
  15.607 --  if { (eval echo configure:1370: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
  15.608 -+  if { (eval echo configure:1379: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
  15.609 -     for file in conftest.*; do
  15.610 -       case $file in
  15.611 -       *.c | *.o | *.obj) ;;
  15.612 -@@ -1399,7 +1408,7 @@
  15.613 - file_magic*)
  15.614 -   if test "$file_magic_cmd" = '$MAGIC_CMD'; then
  15.615 -     echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6
  15.616 --echo "configure:1403: checking for ${ac_tool_prefix}file" >&5
  15.617 -+echo "configure:1412: checking for ${ac_tool_prefix}file" >&5
  15.618 - if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then
  15.619 -   echo $ac_n "(cached) $ac_c" 1>&6
  15.620 - else
  15.621 -@@ -1461,7 +1470,7 @@
  15.622 - if test -z "$lt_cv_path_MAGIC_CMD"; then
  15.623 -   if test -n "$ac_tool_prefix"; then
  15.624 -     echo $ac_n "checking for file""... $ac_c" 1>&6
  15.625 --echo "configure:1465: checking for file" >&5
  15.626 -+echo "configure:1474: checking for file" >&5
  15.627 - if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then
  15.628 -   echo $ac_n "(cached) $ac_c" 1>&6
  15.629 - else
  15.630 -@@ -1532,7 +1541,7 @@
  15.631 - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
  15.632 - set dummy ${ac_tool_prefix}ranlib; ac_word=$2
  15.633 - echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
  15.634 --echo "configure:1536: checking for $ac_word" >&5
  15.635 -+echo "configure:1545: checking for $ac_word" >&5
  15.636 - if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
  15.637 -   echo $ac_n "(cached) $ac_c" 1>&6
  15.638 - else
  15.639 -@@ -1564,7 +1573,7 @@
  15.640 -   # Extract the first word of "ranlib", so it can be a program name with args.
  15.641 - set dummy ranlib; ac_word=$2
  15.642 - echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
  15.643 --echo "configure:1568: checking for $ac_word" >&5
  15.644 -+echo "configure:1577: checking for $ac_word" >&5
  15.645 - if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
  15.646 -   echo $ac_n "(cached) $ac_c" 1>&6
  15.647 - else
  15.648 -@@ -1599,7 +1608,7 @@
  15.649 - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
  15.650 - set dummy ${ac_tool_prefix}strip; ac_word=$2
  15.651 - echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
  15.652 --echo "configure:1603: checking for $ac_word" >&5
  15.653 -+echo "configure:1612: checking for $ac_word" >&5
  15.654 - if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
  15.655 -   echo $ac_n "(cached) $ac_c" 1>&6
  15.656 - else
  15.657 -@@ -1631,7 +1640,7 @@
  15.658 -   # Extract the first word of "strip", so it can be a program name with args.
  15.659 - set dummy strip; ac_word=$2
  15.660 - echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
  15.661 --echo "configure:1635: checking for $ac_word" >&5
  15.662 -+echo "configure:1644: checking for $ac_word" >&5
  15.663 - if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
  15.664 -   echo $ac_n "(cached) $ac_c" 1>&6
  15.665 - else
  15.666 -@@ -1698,8 +1707,8 @@
  15.667 - case $host in
  15.668 - *-*-irix6*)
  15.669 -   # Find out which ABI we are using.
  15.670 --  echo '#line 1702 "configure"' > conftest.$ac_ext
  15.671 --  if { (eval echo configure:1703: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  15.672 -+  echo '#line 1711 "configure"' > conftest.$ac_ext
  15.673 -+  if { (eval echo configure:1712: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  15.674 -     case `/usr/bin/file conftest.$ac_objext` in
  15.675 -     *32-bit*)
  15.676 -       LD="${LD-ld} -32"
  15.677 -@@ -1715,12 +1724,70 @@
  15.678 -   rm -rf conftest*
  15.679 -   ;;
  15.680 - 
  15.681 -+ia64-*-hpux*)
  15.682 -+  # Find out which ABI we are using.
  15.683 -+  echo 'int i;' > conftest.$ac_ext
  15.684 -+  if { (eval echo configure:1731: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  15.685 -+    case "`/usr/bin/file conftest.o`" in
  15.686 -+    *ELF-32*)
  15.687 -+      HPUX_IA64_MODE="32"
  15.688 -+      ;;
  15.689 -+    *ELF-64*)
  15.690 -+      HPUX_IA64_MODE="64"
  15.691 -+      ;;
  15.692 -+    esac
  15.693 -+  fi
  15.694 -+  rm -rf conftest*
  15.695 -+  ;;
  15.696 -+
  15.697 -+x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
  15.698 -+  # Find out which ABI we are using.
  15.699 -+  echo 'int i;' > conftest.$ac_ext
  15.700 -+  if { (eval echo configure:1747: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  15.701 -+    case "`/usr/bin/file conftest.o`" in
  15.702 -+    *32-bit*)
  15.703 -+      case $host in
  15.704 -+        x86_64-*linux*)
  15.705 -+          LD="${LD-ld} -m elf_i386"
  15.706 -+          ;;
  15.707 -+        ppc64-*linux*)
  15.708 -+          LD="${LD-ld} -m elf32ppclinux"
  15.709 -+          ;;
  15.710 -+        s390x-*linux*)
  15.711 -+          LD="${LD-ld} -m elf_s390"
  15.712 -+          ;;
  15.713 -+        sparc64-*linux*)
  15.714 -+          LD="${LD-ld} -m elf32_sparc"
  15.715 -+          ;;
  15.716 -+      esac
  15.717 -+      ;;
  15.718 -+    *64-bit*)
  15.719 -+      case $host in
  15.720 -+        x86_64-*linux*)
  15.721 -+          LD="${LD-ld} -m elf_x86_64"
  15.722 -+          ;;
  15.723 -+        ppc*-*linux*|powerpc*-*linux*)
  15.724 -+          LD="${LD-ld} -m elf64ppc"
  15.725 -+          ;;
  15.726 -+        s390*-*linux*)
  15.727 -+          LD="${LD-ld} -m elf64_s390"
  15.728 -+          ;;
  15.729 -+        sparc*-*linux*)
  15.730 -+          LD="${LD-ld} -m elf64_sparc"
  15.731 -+          ;;
  15.732 -+      esac
  15.733 -+      ;;
  15.734 -+    esac
  15.735 -+  fi
  15.736 -+  rm -rf conftest*
  15.737 -+  ;;
  15.738 -+
  15.739 - *-*-sco3.2v5*)
  15.740 -   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
  15.741 -   SAVE_CFLAGS="$CFLAGS"
  15.742 -   CFLAGS="$CFLAGS -belf"
  15.743 -   echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
  15.744 --echo "configure:1724: checking whether the C compiler needs -belf" >&5
  15.745 -+echo "configure:1791: checking whether the C compiler needs -belf" >&5
  15.746 - if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then
  15.747 -   echo $ac_n "(cached) $ac_c" 1>&6
  15.748 - else
  15.749 -@@ -1733,14 +1800,14 @@
  15.750 - cross_compiling=$ac_cv_prog_cc_cross
  15.751 - 
  15.752 -      cat > conftest.$ac_ext <<EOF
  15.753 --#line 1737 "configure"
  15.754 -+#line 1804 "configure"
  15.755 - #include "confdefs.h"
  15.756 - 
  15.757 - int main() {
  15.758 - 
  15.759 - ; return 0; }
  15.760 - EOF
  15.761 --if { (eval echo configure:1744: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  15.762 -+if { (eval echo configure:1811: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  15.763 -   rm -rf conftest*
  15.764 -   lt_cv_cc_needs_belf=yes
  15.765 - else
  15.766 -@@ -1868,7 +1935,7 @@
  15.767 - # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
  15.768 - # ./install, which can be erroneously created by make from ./install.sh.
  15.769 - echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
  15.770 --echo "configure:1872: checking for a BSD compatible install" >&5
  15.771 -+echo "configure:1939: checking for a BSD compatible install" >&5
  15.772 - if test -z "$INSTALL"; then
  15.773 - if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
  15.774 -   echo $ac_n "(cached) $ac_c" 1>&6
  15.775 -@@ -1921,7 +1988,7 @@
  15.776 - test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
  15.777 - 
  15.778 - echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
  15.779 --echo "configure:1925: checking whether build environment is sane" >&5
  15.780 -+echo "configure:1992: checking whether build environment is sane" >&5
  15.781 - # Just in case
  15.782 - sleep 1
  15.783 - echo timestamp > conftestfile
  15.784 -@@ -1978,7 +2045,7 @@
  15.785 - test "$program_transform_name" = "" && program_transform_name="s,x,x,"
  15.786 - 
  15.787 - echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
  15.788 --echo "configure:1982: checking whether ${MAKE-make} sets \${MAKE}" >&5
  15.789 -+echo "configure:2049: checking whether ${MAKE-make} sets \${MAKE}" >&5
  15.790 - set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
  15.791 - if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
  15.792 -   echo $ac_n "(cached) $ac_c" 1>&6
  15.793 -@@ -2017,7 +2084,7 @@
  15.794 - 
  15.795 - missing_dir=`cd $ac_aux_dir && pwd`
  15.796 - echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
  15.797 --echo "configure:2021: checking for working aclocal" >&5
  15.798 -+echo "configure:2088: checking for working aclocal" >&5
  15.799 - # Run test in a subshell; some versions of sh will print an error if
  15.800 - # an executable is not found, even if stderr is redirected.
  15.801 - # Redirect stdin to placate older versions of autoconf.  Sigh.
  15.802 -@@ -2030,7 +2097,7 @@
  15.803 - fi
  15.804 - 
  15.805 - echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
  15.806 --echo "configure:2034: checking for working autoconf" >&5
  15.807 -+echo "configure:2101: checking for working autoconf" >&5
  15.808 - # Run test in a subshell; some versions of sh will print an error if
  15.809 - # an executable is not found, even if stderr is redirected.
  15.810 - # Redirect stdin to placate older versions of autoconf.  Sigh.
  15.811 -@@ -2043,7 +2110,7 @@
  15.812 - fi
  15.813 - 
  15.814 - echo $ac_n "checking for working automake""... $ac_c" 1>&6
  15.815 --echo "configure:2047: checking for working automake" >&5
  15.816 -+echo "configure:2114: checking for working automake" >&5
  15.817 - # Run test in a subshell; some versions of sh will print an error if
  15.818 - # an executable is not found, even if stderr is redirected.
  15.819 - # Redirect stdin to placate older versions of autoconf.  Sigh.
  15.820 -@@ -2056,7 +2123,7 @@
  15.821 - fi
  15.822 - 
  15.823 - echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
  15.824 --echo "configure:2060: checking for working autoheader" >&5
  15.825 -+echo "configure:2127: checking for working autoheader" >&5
  15.826 - # Run test in a subshell; some versions of sh will print an error if
  15.827 - # an executable is not found, even if stderr is redirected.
  15.828 - # Redirect stdin to placate older versions of autoconf.  Sigh.
  15.829 -@@ -2069,7 +2136,7 @@
  15.830 - fi
  15.831 - 
  15.832 - echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
  15.833 --echo "configure:2073: checking for working makeinfo" >&5
  15.834 -+echo "configure:2140: checking for working makeinfo" >&5
  15.835 - # Run test in a subshell; some versions of sh will print an error if
  15.836 - # an executable is not found, even if stderr is redirected.
  15.837 - # Redirect stdin to placate older versions of autoconf.  Sigh.
  15.838 -@@ -2086,7 +2153,7 @@
  15.839 - 
  15.840 - 
  15.841 - echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
  15.842 --echo "configure:2090: checking for executable suffix" >&5
  15.843 -+echo "configure:2157: checking for executable suffix" >&5
  15.844 - if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
  15.845 -   echo $ac_n "(cached) $ac_c" 1>&6
  15.846 - else
  15.847 -@@ -2096,7 +2163,7 @@
  15.848 -   rm -f conftest*
  15.849 -   echo 'int main () { return 0; }' > conftest.$ac_ext
  15.850 -   ac_cv_exeext=
  15.851 --  if { (eval echo configure:2100: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
  15.852 -+  if { (eval echo configure:2167: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
  15.853 -     for file in conftest.*; do
  15.854 -       case $file in
  15.855 -       *.c | *.o | *.obj) ;;
  15.856 -@@ -2117,7 +2184,7 @@
  15.857 - ac_exeext=$EXEEXT
  15.858 - 
  15.859 - echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
  15.860 --echo "configure:2121: checking whether to enable maintainer-specific portions of Makefiles" >&5
  15.861 -+echo "configure:2188: checking whether to enable maintainer-specific portions of Makefiles" >&5
  15.862 -     # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
  15.863 - if test "${enable_maintainer_mode+set}" = set; then
  15.864 -   enableval="$enable_maintainer_mode"
  15.865 -@@ -2143,7 +2210,7 @@
  15.866 - # Extract the first word of "gcc", so it can be a program name with args.
  15.867 - set dummy gcc; ac_word=$2
  15.868 - echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
  15.869 --echo "configure:2147: checking for $ac_word" >&5
  15.870 -+echo "configure:2214: checking for $ac_word" >&5
  15.871 - if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
  15.872 -   echo $ac_n "(cached) $ac_c" 1>&6
  15.873 - else
  15.874 -@@ -2173,7 +2240,7 @@
  15.875 -   # Extract the first word of "cc", so it can be a program name with args.
  15.876 - set dummy cc; ac_word=$2
  15.877 - echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
  15.878 --echo "configure:2177: checking for $ac_word" >&5
  15.879 -+echo "configure:2244: checking for $ac_word" >&5
  15.880 - if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
  15.881 -   echo $ac_n "(cached) $ac_c" 1>&6
  15.882 - else
  15.883 -@@ -2224,7 +2291,7 @@
  15.884 -       # Extract the first word of "cl", so it can be a program name with args.
  15.885 - set dummy cl; ac_word=$2
  15.886 - echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
  15.887 --echo "configure:2228: checking for $ac_word" >&5
  15.888 -+echo "configure:2295: checking for $ac_word" >&5
  15.889 - if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
  15.890 -   echo $ac_n "(cached) $ac_c" 1>&6
  15.891 - else
  15.892 -@@ -2256,7 +2323,7 @@
  15.893 - fi
  15.894 - 
  15.895 - echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
  15.896 --echo "configure:2260: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
  15.897 -+echo "configure:2327: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
  15.898 - 
  15.899 - ac_ext=c
  15.900 - # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
  15.901 -@@ -2267,12 +2334,12 @@
  15.902 - 
  15.903 - cat > conftest.$ac_ext << EOF
  15.904 - 
  15.905 --#line 2271 "configure"
  15.906 -+#line 2338 "configure"
  15.907 - #include "confdefs.h"
  15.908 - 
  15.909 - main(){return(0);}
  15.910 - EOF
  15.911 --if { (eval echo configure:2276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  15.912 -+if { (eval echo configure:2343: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  15.913 -   ac_cv_prog_cc_works=yes
  15.914 -   # If we can't run a trivial program, we are probably using a cross compiler.
  15.915 -   if (./conftest; exit) 2>/dev/null; then
  15.916 -@@ -2298,12 +2365,12 @@
  15.917 -   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
  15.918 - fi
  15.919 - echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
  15.920 --echo "configure:2302: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
  15.921 -+echo "configure:2369: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
  15.922 - echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
  15.923 - cross_compiling=$ac_cv_prog_cc_cross
  15.924 - 
  15.925 - echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
  15.926 --echo "configure:2307: checking whether we are using GNU C" >&5
  15.927 -+echo "configure:2374: checking whether we are using GNU C" >&5
  15.928 - if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
  15.929 -   echo $ac_n "(cached) $ac_c" 1>&6
  15.930 - else
  15.931 -@@ -2312,7 +2379,7 @@
  15.932 -   yes;
  15.933 - #endif
  15.934 - EOF
  15.935 --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
  15.936 -+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
  15.937 -   ac_cv_prog_gcc=yes
  15.938 - else
  15.939 -   ac_cv_prog_gcc=no
  15.940 -@@ -2331,7 +2398,7 @@
  15.941 - ac_save_CFLAGS="$CFLAGS"
  15.942 - CFLAGS=
  15.943 - echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
  15.944 --echo "configure:2335: checking whether ${CC-cc} accepts -g" >&5
  15.945 -+echo "configure:2402: checking whether ${CC-cc} accepts -g" >&5
  15.946 - if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
  15.947 -   echo $ac_n "(cached) $ac_c" 1>&6
  15.948 - else
  15.949 -@@ -2381,17 +2448,23 @@
  15.950 - i*86-*-mingw*) TARGET=X86_WIN32; TARGETDIR=x86;;
  15.951 - sparc-sun-4*) TARGET=SPARC; TARGETDIR=sparc;;
  15.952 - sparc*-sun-*) TARGET=SPARC; TARGETDIR=sparc;;
  15.953 --sparc-*-linux*) TARGET=SPARC; TARGETDIR=sparc;;
  15.954 --sparc64-*-linux*) TARGET=SPARC; TARGETDIR=sparc;;
  15.955 --alpha*-*-linux* | alpha*-*-osf* | alpha*-*-freebsd*) TARGET=ALPHA; TARGETDIR=alpha;;
  15.956 -+sparc-*-linux* | sparc-*-netbsdelf*) TARGET=SPARC; TARGETDIR=sparc;;
  15.957 -+sparc64-*-linux* | sparc64-*-netbsd*) TARGET=SPARC; TARGETDIR=sparc;;
  15.958 -+alpha*-*-linux* | alpha*-*-osf* | alpha*-*-freebsd* | alpha*-*-netbsd*) TARGET=ALPHA; TARGETDIR=alpha;;
  15.959 - ia64*-*-*) TARGET=IA64; TARGETDIR=ia64;;
  15.960 - m68k-*-linux*) TARGET=M68K; TARGETDIR=m68k;;
  15.961 -+mips64*-*);;
  15.962 -+mips*-*-linux*) TARGET=MIPS_LINUX; TARGETDIR=mips;;
  15.963 - powerpc-*-linux* | powerpc-*-sysv*) TARGET=POWERPC; TARGETDIR=powerpc;;
  15.964 - powerpc-*-beos*) TARGET=POWERPC; TARGETDIR=powerpc;;
  15.965 - powerpc-*-darwin*) TARGET=POWERPC_DARWIN; TARGETDIR=powerpc;;
  15.966 - powerpc-*-aix*) TARGET=POWERPC_AIX; TARGETDIR=powerpc;;
  15.967 - rs6000-*-aix*) TARGET=POWERPC_AIX; TARGETDIR=powerpc;;
  15.968 - arm*-*-linux-*) TARGET=ARM; TARGETDIR=arm;;
  15.969 -+s390-*-linux-*) TARGET=S390; TARGETDIR=s390;;
  15.970 -+s390x-*-linux-*) TARGET=S390; TARGETDIR=s390;;
  15.971 -+x86_64-*-linux*) TARGET=X86_64; TARGETDIR=x86;;
  15.972 -+sh-*-linux* | sh[34]*-*-linux*) TARGET=SH; TARGETDIR=sh;;
  15.973 - esac
  15.974 - 
  15.975 - if test $TARGETDIR = unknown; then
  15.976 -@@ -2418,6 +2491,15 @@
  15.977 - fi
  15.978 - 
  15.979 - 
  15.980 -+if test x$TARGET = xMIPS_LINUX; then
  15.981 -+  MIPS_LINUX_TRUE=
  15.982 -+  MIPS_LINUX_FALSE='#'
  15.983 -+else
  15.984 -+  MIPS_LINUX_TRUE='#'
  15.985 -+  MIPS_LINUX_FALSE=
  15.986 -+fi
  15.987 -+
  15.988 -+
  15.989 - if test x$TARGET = xSPARC; then
  15.990 -   SPARC_TRUE=
  15.991 -   SPARC_FALSE='#'
  15.992 -@@ -2507,8 +2589,39 @@
  15.993 -   ARM_FALSE=
  15.994 - fi
  15.995 - 
  15.996 -+
  15.997 -+if test x$TARGET = xS390; then
  15.998 -+  S390_TRUE=
  15.999 -+  S390_FALSE='#'
 15.1000 -+else
 15.1001 -+  S390_TRUE='#'
 15.1002 -+  S390_FALSE=
 15.1003 -+fi
 15.1004 -+
 15.1005 -+
 15.1006 -+if test x$TARGET = xX86_64; then
 15.1007 -+  X86_64_TRUE=
 15.1008 -+  X86_64_FALSE='#'
 15.1009 -+else
 15.1010 -+  X86_64_TRUE='#'
 15.1011 -+  X86_64_FALSE=
 15.1012 -+fi
 15.1013 -+
 15.1014 -+
 15.1015 -+if test x$TARGET = xSH; then
 15.1016 -+  SH_TRUE=
 15.1017 -+  SH_FALSE='#'
 15.1018 -+else
 15.1019 -+  SH_TRUE='#'
 15.1020 -+  SH_FALSE=
 15.1021 -+fi
 15.1022 -+
 15.1023 -+if test x$TARGET = xMIPS_LINUX; then
 15.1024 -+  TARGET=MIPS
 15.1025 -+fi
 15.1026 -+
 15.1027 - echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
 15.1028 --echo "configure:2512: checking how to run the C preprocessor" >&5
 15.1029 -+echo "configure:2625: checking how to run the C preprocessor" >&5
 15.1030 - # On Suns, sometimes $CPP names a directory.
 15.1031 - if test -n "$CPP" && test -d "$CPP"; then
 15.1032 -   CPP=
 15.1033 -@@ -2523,13 +2636,13 @@
 15.1034 -   # On the NeXT, cc -E runs the code through the compiler's parser,
 15.1035 -   # not just through cpp.
 15.1036 -   cat > conftest.$ac_ext <<EOF
 15.1037 --#line 2527 "configure"
 15.1038 -+#line 2640 "configure"
 15.1039 - #include "confdefs.h"
 15.1040 - #include <assert.h>
 15.1041 - Syntax Error
 15.1042 - EOF
 15.1043 - ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
 15.1044 --{ (eval echo configure:2533: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 15.1045 -+{ (eval echo configure:2646: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 15.1046 - ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 15.1047 - if test -z "$ac_err"; then
 15.1048 -   :
 15.1049 -@@ -2540,13 +2653,13 @@
 15.1050 -   rm -rf conftest*
 15.1051 -   CPP="${CC-cc} -E -traditional-cpp"
 15.1052 -   cat > conftest.$ac_ext <<EOF
 15.1053 --#line 2544 "configure"
 15.1054 -+#line 2657 "configure"
 15.1055 - #include "confdefs.h"
 15.1056 - #include <assert.h>
 15.1057 - Syntax Error
 15.1058 - EOF
 15.1059 - ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
 15.1060 --{ (eval echo configure:2550: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 15.1061 -+{ (eval echo configure:2663: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 15.1062 - ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 15.1063 - if test -z "$ac_err"; then
 15.1064 -   :
 15.1065 -@@ -2557,13 +2670,13 @@
 15.1066 -   rm -rf conftest*
 15.1067 -   CPP="${CC-cc} -nologo -E"
 15.1068 -   cat > conftest.$ac_ext <<EOF
 15.1069 --#line 2561 "configure"
 15.1070 -+#line 2674 "configure"
 15.1071 - #include "confdefs.h"
 15.1072 - #include <assert.h>
 15.1073 - Syntax Error
 15.1074 - EOF
 15.1075 - ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
 15.1076 --{ (eval echo configure:2567: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 15.1077 -+{ (eval echo configure:2680: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 15.1078 - ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 15.1079 - if test -z "$ac_err"; then
 15.1080 -   :
 15.1081 -@@ -2588,12 +2701,12 @@
 15.1082 - echo "$ac_t""$CPP" 1>&6
 15.1083 - 
 15.1084 - echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
 15.1085 --echo "configure:2592: checking for ANSI C header files" >&5
 15.1086 -+echo "configure:2705: checking for ANSI C header files" >&5
 15.1087 - if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
 15.1088 -   echo $ac_n "(cached) $ac_c" 1>&6
 15.1089 - else
 15.1090 -   cat > conftest.$ac_ext <<EOF
 15.1091 --#line 2597 "configure"
 15.1092 -+#line 2710 "configure"
 15.1093 - #include "confdefs.h"
 15.1094 - #include <stdlib.h>
 15.1095 - #include <stdarg.h>
 15.1096 -@@ -2601,7 +2714,7 @@
 15.1097 - #include <float.h>
 15.1098 - EOF
 15.1099 - ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
 15.1100 --{ (eval echo configure:2605: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 15.1101 -+{ (eval echo configure:2718: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 15.1102 - ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 15.1103 - if test -z "$ac_err"; then
 15.1104 -   rm -rf conftest*
 15.1105 -@@ -2618,7 +2731,7 @@
 15.1106 - if test $ac_cv_header_stdc = yes; then
 15.1107 -   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 15.1108 - cat > conftest.$ac_ext <<EOF
 15.1109 --#line 2622 "configure"
 15.1110 -+#line 2735 "configure"
 15.1111 - #include "confdefs.h"
 15.1112 - #include <string.h>
 15.1113 - EOF
 15.1114 -@@ -2636,7 +2749,7 @@
 15.1115 - if test $ac_cv_header_stdc = yes; then
 15.1116 -   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 15.1117 - cat > conftest.$ac_ext <<EOF
 15.1118 --#line 2640 "configure"
 15.1119 -+#line 2753 "configure"
 15.1120 - #include "confdefs.h"
 15.1121 - #include <stdlib.h>
 15.1122 - EOF
 15.1123 -@@ -2657,7 +2770,7 @@
 15.1124 -   :
 15.1125 - else
 15.1126 -   cat > conftest.$ac_ext <<EOF
 15.1127 --#line 2661 "configure"
 15.1128 -+#line 2774 "configure"
 15.1129 - #include "confdefs.h"
 15.1130 - #include <ctype.h>
 15.1131 - #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
 15.1132 -@@ -2668,7 +2781,7 @@
 15.1133 - exit (0); }
 15.1134 - 
 15.1135 - EOF
 15.1136 --if { (eval echo configure:2672: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 15.1137 -+if { (eval echo configure:2785: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 15.1138 - then
 15.1139 -   :
 15.1140 - else
 15.1141 -@@ -2694,12 +2807,12 @@
 15.1142 - for ac_func in memcpy
 15.1143 - do
 15.1144 - echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
 15.1145 --echo "configure:2698: checking for $ac_func" >&5
 15.1146 -+echo "configure:2811: checking for $ac_func" >&5
 15.1147 - if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
 15.1148 -   echo $ac_n "(cached) $ac_c" 1>&6
 15.1149 - else
 15.1150 -   cat > conftest.$ac_ext <<EOF
 15.1151 --#line 2703 "configure"
 15.1152 -+#line 2816 "configure"
 15.1153 - #include "confdefs.h"
 15.1154 - /* System header to define __stub macros and hopefully few prototypes,
 15.1155 -     which can conflict with char $ac_func(); below.  */
 15.1156 -@@ -2722,7 +2835,7 @@
 15.1157 - 
 15.1158 - ; return 0; }
 15.1159 - EOF
 15.1160 --if { (eval echo configure:2726: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
 15.1161 -+if { (eval echo configure:2839: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
 15.1162 -   rm -rf conftest*
 15.1163 -   eval "ac_cv_func_$ac_func=yes"
 15.1164 - else
 15.1165 -@@ -2749,19 +2862,19 @@
 15.1166 - # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
 15.1167 - # for constant arguments.  Useless!
 15.1168 - echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
 15.1169 --echo "configure:2753: checking for working alloca.h" >&5
 15.1170 -+echo "configure:2866: checking for working alloca.h" >&5
 15.1171 - if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
 15.1172 -   echo $ac_n "(cached) $ac_c" 1>&6
 15.1173 - else
 15.1174 -   cat > conftest.$ac_ext <<EOF
 15.1175 --#line 2758 "configure"
 15.1176 -+#line 2871 "configure"
 15.1177 - #include "confdefs.h"
 15.1178 - #include <alloca.h>
 15.1179 - int main() {
 15.1180 - char *p = alloca(2 * sizeof(int));
 15.1181 - ; return 0; }
 15.1182 - EOF
 15.1183 --if { (eval echo configure:2765: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
 15.1184 -+if { (eval echo configure:2878: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
 15.1185 -   rm -rf conftest*
 15.1186 -   ac_cv_header_alloca_h=yes
 15.1187 - else
 15.1188 -@@ -2782,12 +2895,12 @@
 15.1189 - fi
 15.1190 - 
 15.1191 - echo $ac_n "checking for alloca""... $ac_c" 1>&6
 15.1192 --echo "configure:2786: checking for alloca" >&5
 15.1193 -+echo "configure:2899: checking for alloca" >&5
 15.1194 - if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
 15.1195 -   echo $ac_n "(cached) $ac_c" 1>&6
 15.1196 - else
 15.1197 -   cat > conftest.$ac_ext <<EOF
 15.1198 --#line 2791 "configure"
 15.1199 -+#line 2904 "configure"
 15.1200 - #include "confdefs.h"
 15.1201 - 
 15.1202 - #ifdef __GNUC__
 15.1203 -@@ -2815,7 +2928,7 @@
 15.1204 - char *p = (char *) alloca(1);
 15.1205 - ; return 0; }
 15.1206 - EOF
 15.1207 --if { (eval echo configure:2819: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
 15.1208 -+if { (eval echo configure:2932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
 15.1209 -   rm -rf conftest*
 15.1210 -   ac_cv_func_alloca_works=yes
 15.1211 - else
 15.1212 -@@ -2847,12 +2960,12 @@
 15.1213 - 
 15.1214 - 
 15.1215 - echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
 15.1216 --echo "configure:2851: checking whether alloca needs Cray hooks" >&5
 15.1217 -+echo "configure:2964: checking whether alloca needs Cray hooks" >&5
 15.1218 - if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
 15.1219 -   echo $ac_n "(cached) $ac_c" 1>&6
 15.1220 - else
 15.1221 -   cat > conftest.$ac_ext <<EOF
 15.1222 --#line 2856 "configure"
 15.1223 -+#line 2969 "configure"
 15.1224 - #include "confdefs.h"
 15.1225 - #if defined(CRAY) && ! defined(CRAY2)
 15.1226 - webecray
 15.1227 -@@ -2877,12 +2990,12 @@
 15.1228 - if test $ac_cv_os_cray = yes; then
 15.1229 - for ac_func in _getb67 GETB67 getb67; do
 15.1230 -   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
 15.1231 --echo "configure:2881: checking for $ac_func" >&5
 15.1232 -+echo "configure:2994: checking for $ac_func" >&5
 15.1233 - if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
 15.1234 -   echo $ac_n "(cached) $ac_c" 1>&6
 15.1235 - else
 15.1236 -   cat > conftest.$ac_ext <<EOF
 15.1237 --#line 2886 "configure"
 15.1238 -+#line 2999 "configure"
 15.1239 - #include "confdefs.h"
 15.1240 - /* System header to define __stub macros and hopefully few prototypes,
 15.1241 -     which can conflict with char $ac_func(); below.  */
 15.1242 -@@ -2905,7 +3018,7 @@
 15.1243 - 
 15.1244 - ; return 0; }
 15.1245 - EOF
 15.1246 --if { (eval echo configure:2909: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
 15.1247 -+if { (eval echo configure:3022: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
 15.1248 -   rm -rf conftest*
 15.1249 -   eval "ac_cv_func_$ac_func=yes"
 15.1250 - else
 15.1251 -@@ -2932,7 +3045,7 @@
 15.1252 - fi
 15.1253 - 
 15.1254 - echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
 15.1255 --echo "configure:2936: checking stack direction for C alloca" >&5
 15.1256 -+echo "configure:3049: checking stack direction for C alloca" >&5
 15.1257 - if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
 15.1258 -   echo $ac_n "(cached) $ac_c" 1>&6
 15.1259 - else
 15.1260 -@@ -2940,7 +3053,7 @@
 15.1261 -   ac_cv_c_stack_direction=0
 15.1262 - else
 15.1263 -   cat > conftest.$ac_ext <<EOF
 15.1264 --#line 2944 "configure"
 15.1265 -+#line 3057 "configure"
 15.1266 - #include "confdefs.h"
 15.1267 - find_stack_direction ()
 15.1268 - {
 15.1269 -@@ -2959,7 +3072,7 @@
 15.1270 -   exit (find_stack_direction() < 0);
 15.1271 - }
 15.1272 - EOF
 15.1273 --if { (eval echo configure:2963: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 15.1274 -+if { (eval echo configure:3076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 15.1275 - then
 15.1276 -   ac_cv_c_stack_direction=1
 15.1277 - else
 15.1278 -@@ -2982,13 +3095,13 @@
 15.1279 - 
 15.1280 - 
 15.1281 - echo $ac_n "checking size of short""... $ac_c" 1>&6
 15.1282 --echo "configure:2986: checking size of short" >&5
 15.1283 -+echo "configure:3099: checking size of short" >&5
 15.1284 - if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
 15.1285 -   echo $ac_n "(cached) $ac_c" 1>&6
 15.1286 - else
 15.1287 -   for ac_size in 4 8 1 2 16 12  ; do # List sizes in rough order of prevalence.
 15.1288 -   cat > conftest.$ac_ext <<EOF
 15.1289 --#line 2992 "configure"
 15.1290 -+#line 3105 "configure"
 15.1291 - #include "confdefs.h"
 15.1292 - #include "confdefs.h"
 15.1293 - #include <sys/types.h>
 15.1294 -@@ -2998,7 +3111,7 @@
 15.1295 - switch (0) case 0: case (sizeof (short) == $ac_size):;
 15.1296 - ; return 0; }
 15.1297 - EOF
 15.1298 --if { (eval echo configure:3002: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
 15.1299 -+if { (eval echo configure:3115: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
 15.1300 -   rm -rf conftest*
 15.1301 -   ac_cv_sizeof_short=$ac_size
 15.1302 - else
 15.1303 -@@ -3021,13 +3134,13 @@
 15.1304 - 
 15.1305 - 
 15.1306 - echo $ac_n "checking size of int""... $ac_c" 1>&6
 15.1307 --echo "configure:3025: checking size of int" >&5
 15.1308 -+echo "configure:3138: checking size of int" >&5
 15.1309 - if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
 15.1310 -   echo $ac_n "(cached) $ac_c" 1>&6
 15.1311 - else
 15.1312 -   for ac_size in 4 8 1 2 16 12  ; do # List sizes in rough order of prevalence.
 15.1313 -   cat > conftest.$ac_ext <<EOF
 15.1314 --#line 3031 "configure"
 15.1315 -+#line 3144 "configure"
 15.1316 - #include "confdefs.h"
 15.1317 - #include "confdefs.h"
 15.1318 - #include <sys/types.h>
 15.1319 -@@ -3037,7 +3150,7 @@
 15.1320 - switch (0) case 0: case (sizeof (int) == $ac_size):;
 15.1321 - ; return 0; }
 15.1322 - EOF
 15.1323 --if { (eval echo configure:3041: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
 15.1324 -+if { (eval echo configure:3154: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
 15.1325 -   rm -rf conftest*
 15.1326 -   ac_cv_sizeof_int=$ac_size
 15.1327 - else
 15.1328 -@@ -3060,13 +3173,13 @@
 15.1329 - 
 15.1330 - 
 15.1331 - echo $ac_n "checking size of long""... $ac_c" 1>&6
 15.1332 --echo "configure:3064: checking size of long" >&5
 15.1333 -+echo "configure:3177: checking size of long" >&5
 15.1334 - if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
 15.1335 -   echo $ac_n "(cached) $ac_c" 1>&6
 15.1336 - else
 15.1337 -   for ac_size in 4 8 1 2 16 12  ; do # List sizes in rough order of prevalence.
 15.1338 -   cat > conftest.$ac_ext <<EOF
 15.1339 --#line 3070 "configure"
 15.1340 -+#line 3183 "configure"
 15.1341 - #include "confdefs.h"
 15.1342 - #include "confdefs.h"
 15.1343 - #include <sys/types.h>
 15.1344 -@@ -3076,7 +3189,7 @@
 15.1345 - switch (0) case 0: case (sizeof (long) == $ac_size):;
 15.1346 - ; return 0; }
 15.1347 - EOF
 15.1348 --if { (eval echo configure:3080: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
 15.1349 -+if { (eval echo configure:3193: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
 15.1350 -   rm -rf conftest*
 15.1351 -   ac_cv_sizeof_long=$ac_size
 15.1352 - else
 15.1353 -@@ -3099,13 +3212,13 @@
 15.1354 - 
 15.1355 - 
 15.1356 - echo $ac_n "checking size of long long""... $ac_c" 1>&6
 15.1357 --echo "configure:3103: checking size of long long" >&5
 15.1358 -+echo "configure:3216: checking size of long long" >&5
 15.1359 - if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then
 15.1360 -   echo $ac_n "(cached) $ac_c" 1>&6
 15.1361 - else
 15.1362 -   for ac_size in 4 8 1 2 16 12  ; do # List sizes in rough order of prevalence.
 15.1363 -   cat > conftest.$ac_ext <<EOF
 15.1364 --#line 3109 "configure"
 15.1365 -+#line 3222 "configure"
 15.1366 - #include "confdefs.h"
 15.1367 - #include "confdefs.h"
 15.1368 - #include <sys/types.h>
 15.1369 -@@ -3115,7 +3228,7 @@
 15.1370 - switch (0) case 0: case (sizeof (long long) == $ac_size):;
 15.1371 - ; return 0; }
 15.1372 - EOF
 15.1373 --if { (eval echo configure:3119: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
 15.1374 -+if { (eval echo configure:3232: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
 15.1375 -   rm -rf conftest*
 15.1376 -   ac_cv_sizeof_long_long=$ac_size
 15.1377 - else
 15.1378 -@@ -3138,13 +3251,13 @@
 15.1379 - 
 15.1380 - 
 15.1381 - echo $ac_n "checking size of float""... $ac_c" 1>&6
 15.1382 --echo "configure:3142: checking size of float" >&5
 15.1383 -+echo "configure:3255: checking size of float" >&5
 15.1384 - if eval "test \"`echo '$''{'ac_cv_sizeof_float'+set}'`\" = set"; then
 15.1385 -   echo $ac_n "(cached) $ac_c" 1>&6
 15.1386 - else
 15.1387 -   for ac_size in 4 8 1 2 16 12  ; do # List sizes in rough order of prevalence.
 15.1388 -   cat > conftest.$ac_ext <<EOF
 15.1389 --#line 3148 "configure"
 15.1390 -+#line 3261 "configure"
 15.1391 - #include "confdefs.h"
 15.1392 - #include "confdefs.h"
 15.1393 - #include <sys/types.h>
 15.1394 -@@ -3154,7 +3267,7 @@
 15.1395 - switch (0) case 0: case (sizeof (float) == $ac_size):;
 15.1396 - ; return 0; }
 15.1397 - EOF
 15.1398 --if { (eval echo configure:3158: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
 15.1399 -+if { (eval echo configure:3271: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
 15.1400 -   rm -rf conftest*
 15.1401 -   ac_cv_sizeof_float=$ac_size
 15.1402 - else
 15.1403 -@@ -3177,13 +3290,13 @@
 15.1404 - 
 15.1405 - 
 15.1406 - echo $ac_n "checking size of double""... $ac_c" 1>&6
 15.1407 --echo "configure:3181: checking size of double" >&5
 15.1408 -+echo "configure:3294: checking size of double" >&5
 15.1409 - if eval "test \"`echo '$''{'ac_cv_sizeof_double'+set}'`\" = set"; then
 15.1410 -   echo $ac_n "(cached) $ac_c" 1>&6
 15.1411 - else
 15.1412 -   for ac_size in 4 8 1 2 16 12  ; do # List sizes in rough order of prevalence.
 15.1413 -   cat > conftest.$ac_ext <<EOF
 15.1414 --#line 3187 "configure"
 15.1415 -+#line 3300 "configure"
 15.1416 - #include "confdefs.h"
 15.1417 - #include "confdefs.h"
 15.1418 - #include <sys/types.h>
 15.1419 -@@ -3193,7 +3306,7 @@
 15.1420 - switch (0) case 0: case (sizeof (double) == $ac_size):;
 15.1421 - ; return 0; }
 15.1422 - EOF
 15.1423 --if { (eval echo configure:3197: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
 15.1424 -+if { (eval echo configure:3310: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
 15.1425 -   rm -rf conftest*
 15.1426 -   ac_cv_sizeof_double=$ac_size
 15.1427 - else
 15.1428 -@@ -3216,13 +3329,13 @@
 15.1429 - 
 15.1430 - 
 15.1431 - echo $ac_n "checking size of long double""... $ac_c" 1>&6
 15.1432 --echo "configure:3220: checking size of long double" >&5
 15.1433 -+echo "configure:3333: checking size of long double" >&5
 15.1434 - if eval "test \"`echo '$''{'ac_cv_sizeof_long_double'+set}'`\" = set"; then
 15.1435 -   echo $ac_n "(cached) $ac_c" 1>&6
 15.1436 - else
 15.1437 -   for ac_size in 4 8 1 2 16 12  ; do # List sizes in rough order of prevalence.
 15.1438 -   cat > conftest.$ac_ext <<EOF
 15.1439 --#line 3226 "configure"
 15.1440 -+#line 3339 "configure"
 15.1441 - #include "confdefs.h"
 15.1442 - #include "confdefs.h"
 15.1443 - #include <sys/types.h>
 15.1444 -@@ -3232,7 +3345,7 @@
 15.1445 - switch (0) case 0: case (sizeof (long double) == $ac_size):;
 15.1446 - ; return 0; }
 15.1447 - EOF
 15.1448 --if { (eval echo configure:3236: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
 15.1449 -+if { (eval echo configure:3349: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
 15.1450 -   rm -rf conftest*
 15.1451 -   ac_cv_sizeof_long_double=$ac_size
 15.1452 - else
 15.1453 -@@ -3256,13 +3369,13 @@
 15.1454 - 
 15.1455 - 
 15.1456 - echo $ac_n "checking size of void *""... $ac_c" 1>&6
 15.1457 --echo "configure:3260: checking size of void *" >&5
 15.1458 -+echo "configure:3373: checking size of void *" >&5
 15.1459 - if eval "test \"`echo '$''{'ac_cv_sizeof_void_p'+set}'`\" = set"; then
 15.1460 -   echo $ac_n "(cached) $ac_c" 1>&6
 15.1461 - else
 15.1462 -   for ac_size in 4 8 1 2 16 12  ; do # List sizes in rough order of prevalence.
 15.1463 -   cat > conftest.$ac_ext <<EOF
 15.1464 --#line 3266 "configure"
 15.1465 -+#line 3379 "configure"
 15.1466 - #include "confdefs.h"
 15.1467 - #include "confdefs.h"
 15.1468 - #include <sys/types.h>
 15.1469 -@@ -3272,7 +3385,7 @@
 15.1470 - switch (0) case 0: case (sizeof (void *) == $ac_size):;
 15.1471 - ; return 0; }
 15.1472 - EOF
 15.1473 --if { (eval echo configure:3276: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
 15.1474 -+if { (eval echo configure:3389: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
 15.1475 -   rm -rf conftest*
 15.1476 -   ac_cv_sizeof_void_p=$ac_size
 15.1477 - else
 15.1478 -@@ -3295,14 +3408,14 @@
 15.1479 - 
 15.1480 - 
 15.1481 - echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
 15.1482 --echo "configure:3299: checking whether byte ordering is bigendian" >&5
 15.1483 -+echo "configure:3412: checking whether byte ordering is bigendian" >&5
 15.1484 - if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
 15.1485 -   echo $ac_n "(cached) $ac_c" 1>&6
 15.1486 - else
 15.1487 -   ac_cv_c_bigendian=unknown
 15.1488 - # See if sys/param.h defines the BYTE_ORDER macro.
 15.1489 - cat > conftest.$ac_ext <<EOF
 15.1490 --#line 3306 "configure"
 15.1491 -+#line 3419 "configure"
 15.1492 - #include "confdefs.h"
 15.1493 - #include <sys/types.h>
 15.1494 - #include <sys/param.h>
 15.1495 -@@ -3313,11 +3426,11 @@
 15.1496 - #endif
 15.1497 - ; return 0; }
 15.1498 - EOF
 15.1499 --if { (eval echo configure:3317: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
 15.1500 -+if { (eval echo configure:3430: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
 15.1501 -   rm -rf conftest*
 15.1502 -   # It does; now see whether it defined to BIG_ENDIAN or not.
 15.1503 - cat > conftest.$ac_ext <<EOF
 15.1504 --#line 3321 "configure"
 15.1505 -+#line 3434 "configure"
 15.1506 - #include "confdefs.h"
 15.1507 - #include <sys/types.h>
 15.1508 - #include <sys/param.h>
 15.1509 -@@ -3328,7 +3441,7 @@
 15.1510 - #endif
 15.1511 - ; return 0; }
 15.1512 - EOF
 15.1513 --if { (eval echo configure:3332: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
 15.1514 -+if { (eval echo configure:3445: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
 15.1515 -   rm -rf conftest*
 15.1516 -   ac_cv_c_bigendian=yes
 15.1517 - else
 15.1518 -@@ -3348,7 +3461,7 @@
 15.1519 -    echo $ac_n "cross-compiling... " 2>&6 
 15.1520 - else
 15.1521 -   cat > conftest.$ac_ext <<EOF
 15.1522 --#line 3352 "configure"
 15.1523 -+#line 3465 "configure"
 15.1524 - #include "confdefs.h"
 15.1525 - main () {
 15.1526 -   /* Are we little or big endian?  From Harbison&Steele.  */
 15.1527 -@@ -3361,7 +3474,7 @@
 15.1528 -   exit (u.c[sizeof (long) - 1] == 1);
 15.1529 - }
 15.1530 - EOF
 15.1531 --if { (eval echo configure:3365: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 15.1532 -+if { (eval echo configure:3478: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 15.1533 - then
 15.1534 -   ac_cv_c_bigendian=no
 15.1535 - else
 15.1536 -@@ -3379,7 +3492,7 @@
 15.1537 - echo "$ac_t""$ac_cv_c_bigendian" 1>&6
 15.1538 - if test $ac_cv_c_bigendian = unknown; then
 15.1539 - echo $ac_n "checking to probe for byte ordering""... $ac_c" 1>&6
 15.1540 --echo "configure:3383: checking to probe for byte ordering" >&5
 15.1541 -+echo "configure:3496: checking to probe for byte ordering" >&5
 15.1542 - 
 15.1543 - cat >conftest.c <<EOF
 15.1544 - short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
 15.1545 -@@ -3414,6 +3527,10 @@
 15.1546 - #define WORDS_BIGENDIAN 1
 15.1547 - EOF
 15.1548 - 
 15.1549 -+  cat >> confdefs.h <<\EOF
 15.1550 -+#define HOST_WORDS_BIG_ENDIAN 1
 15.1551 -+EOF
 15.1552 -+
 15.1553 -   BYTEORDER=4321
 15.1554 - else
 15.1555 -   BYTEORDER=1234
 15.1556 -@@ -3429,7 +3546,7 @@
 15.1557 - 
 15.1558 - if test x$TARGET = xSPARC; then
 15.1559 -     echo $ac_n "checking assembler and linker support unaligned pc related relocs""... $ac_c" 1>&6
 15.1560 --echo "configure:3433: checking assembler and linker support unaligned pc related relocs" >&5
 15.1561 -+echo "configure:3550: checking assembler and linker support unaligned pc related relocs" >&5
 15.1562 - if eval "test \"`echo '$''{'libffi_cv_as_sparc_ua_pcrel'+set}'`\" = set"; then
 15.1563 -   echo $ac_n "(cached) $ac_c" 1>&6
 15.1564 - else
 15.1565 -@@ -3439,14 +3556,14 @@
 15.1566 - 	CFLAGS="$CFLAGS -fpic"
 15.1567 - 	LDFLAGS="$LDFLAGS -shared"
 15.1568 - 	cat > conftest.$ac_ext <<EOF
 15.1569 --#line 3443 "configure"
 15.1570 -+#line 3560 "configure"
 15.1571 - #include "confdefs.h"
 15.1572 - asm (".text; foo: nop; .data; .align 4; .byte 0; .uaword %r_disp32(foo); .text");
 15.1573 - int main() {
 15.1574 - 
 15.1575 - ; return 0; }
 15.1576 - EOF
 15.1577 --if { (eval echo configure:3450: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
 15.1578 -+if { (eval echo configure:3567: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
 15.1579 -   rm -rf conftest*
 15.1580 -   libffi_cv_as_sparc_ua_pcrel=yes
 15.1581 - else
 15.1582 -@@ -3709,6 +3826,8 @@
 15.1583 - s%@MIPS_GCC_FALSE@%$MIPS_GCC_FALSE%g
 15.1584 - s%@MIPS_SGI_TRUE@%$MIPS_SGI_TRUE%g
 15.1585 - s%@MIPS_SGI_FALSE@%$MIPS_SGI_FALSE%g
 15.1586 -+s%@MIPS_LINUX_TRUE@%$MIPS_LINUX_TRUE%g
 15.1587 -+s%@MIPS_LINUX_FALSE@%$MIPS_LINUX_FALSE%g
 15.1588 - s%@SPARC_TRUE@%$SPARC_TRUE%g
 15.1589 - s%@SPARC_FALSE@%$SPARC_FALSE%g
 15.1590 - s%@X86_TRUE@%$X86_TRUE%g
 15.1591 -@@ -3729,6 +3848,12 @@
 15.1592 - s%@POWERPC_DARWIN_FALSE@%$POWERPC_DARWIN_FALSE%g
 15.1593 - s%@ARM_TRUE@%$ARM_TRUE%g
 15.1594 - s%@ARM_FALSE@%$ARM_FALSE%g
 15.1595 -+s%@S390_TRUE@%$S390_TRUE%g
 15.1596 -+s%@S390_FALSE@%$S390_FALSE%g
 15.1597 -+s%@X86_64_TRUE@%$X86_64_TRUE%g
 15.1598 -+s%@X86_64_FALSE@%$X86_64_FALSE%g
 15.1599 -+s%@SH_TRUE@%$SH_TRUE%g
 15.1600 -+s%@SH_FALSE@%$SH_FALSE%g
 15.1601 - s%@CPP@%$CPP%g
 15.1602 - s%@ALLOCA@%$ALLOCA%g
 15.1603 - s%@TARGET@%$TARGET%g
 15.1604 -@@ -3969,7 +4094,7 @@
 15.1605 - 
 15.1606 - if test -n "$CONFIG_FILES"; then
 15.1607 -    LD="${ORIGINAL_LD_FOR_MULTILIBS}"
 15.1608 --   ac_file=Makefile . ${libffi_basedir}/../config-ml.in
 15.1609 -+   ac_file=Makefile . ${srcdir}/${libffi_basedir}../config-ml.in
 15.1610 - fi
 15.1611 - 
 15.1612 - exit 0
 15.1613 -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/configure.in gcc/libffi/configure.in
 15.1614 ---- gcc-3.2.2.orig/libffi/configure.in	Tue Jan 28 10:43:56 2003
 15.1615 -+++ gcc/libffi/configure.in	Sat Feb  1 20:16:19 2003
 15.1616 -@@ -22,14 +22,15 @@
 15.1617 - 
 15.1618 - if test "${srcdir}" = "."; then
 15.1619 -   if test "${with_target_subdir}" != "."; then
 15.1620 --    libffi_basedir="${srcdir}/${with_multisrctop}.."
 15.1621 -+    libffi_basedir="${with_multisrctop}../"
 15.1622 -   else
 15.1623 --    libffi_basedir="${srcdir}/${with_multisrctop}"
 15.1624 -+    libffi_basedir="${with_multisrctop}"
 15.1625 -   fi
 15.1626 - else
 15.1627 --  libffi_basedir="${srcdir}"
 15.1628 -+  libffi_basedir=
 15.1629 - fi
 15.1630 - AC_SUBST(libffi_basedir)
 15.1631 -+AC_CONFIG_AUX_DIR(${libffi_basedir}..)
 15.1632 - 
 15.1633 - AC_CANONICAL_HOST
 15.1634 - 
 15.1635 -@@ -56,17 +57,23 @@
 15.1636 - i*86-*-mingw*) TARGET=X86_WIN32; TARGETDIR=x86;;
 15.1637 - sparc-sun-4*) TARGET=SPARC; TARGETDIR=sparc;;
 15.1638 - sparc*-sun-*) TARGET=SPARC; TARGETDIR=sparc;;
 15.1639 --sparc-*-linux*) TARGET=SPARC; TARGETDIR=sparc;;
 15.1640 --sparc64-*-linux*) TARGET=SPARC; TARGETDIR=sparc;;
 15.1641 --alpha*-*-linux* | alpha*-*-osf* | alpha*-*-freebsd*) TARGET=ALPHA; TARGETDIR=alpha;;
 15.1642 -+sparc-*-linux* | sparc-*-netbsdelf*) TARGET=SPARC; TARGETDIR=sparc;;
 15.1643 -+sparc64-*-linux* | sparc64-*-netbsd*) TARGET=SPARC; TARGETDIR=sparc;;
 15.1644 -+alpha*-*-linux* | alpha*-*-osf* | alpha*-*-freebsd* | alpha*-*-netbsd*) TARGET=ALPHA; TARGETDIR=alpha;;
 15.1645 - ia64*-*-*) TARGET=IA64; TARGETDIR=ia64;;
 15.1646 - m68k-*-linux*) TARGET=M68K; TARGETDIR=m68k;;
 15.1647 -+mips64*-*);;
 15.1648 -+mips*-*-linux*) TARGET=MIPS_LINUX; TARGETDIR=mips;;
 15.1649 - powerpc-*-linux* | powerpc-*-sysv*) TARGET=POWERPC; TARGETDIR=powerpc;;
 15.1650 - powerpc-*-beos*) TARGET=POWERPC; TARGETDIR=powerpc;;
 15.1651 - powerpc-*-darwin*) TARGET=POWERPC_DARWIN; TARGETDIR=powerpc;;
 15.1652 - powerpc-*-aix*) TARGET=POWERPC_AIX; TARGETDIR=powerpc;;
 15.1653 - rs6000-*-aix*) TARGET=POWERPC_AIX; TARGETDIR=powerpc;;
 15.1654 - arm*-*-linux-*) TARGET=ARM; TARGETDIR=arm;;
 15.1655 -+s390-*-linux-*) TARGET=S390; TARGETDIR=s390;;
 15.1656 -+s390x-*-linux-*) TARGET=S390; TARGETDIR=s390;;
 15.1657 -+x86_64-*-linux*) TARGET=X86_64; TARGETDIR=x86;;
 15.1658 -+sh-*-linux* | sh[[34]]*-*-linux*) TARGET=SH; TARGETDIR=sh;;
 15.1659 - esac
 15.1660 - 
 15.1661 - if test $TARGETDIR = unknown; then
 15.1662 -@@ -75,6 +82,7 @@
 15.1663 - 
 15.1664 - AM_CONDITIONAL(MIPS_GCC, test ${TARGET}${ac_cv_prog_gcc} = MIPSyes)
 15.1665 - AM_CONDITIONAL(MIPS_SGI, test ${TARGET}${ac_cv_prog_gcc} = MIPSno)
 15.1666 -+AM_CONDITIONAL(MIPS_LINUX, test x$TARGET = xMIPS_LINUX)
 15.1667 - AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC)
 15.1668 - AM_CONDITIONAL(X86, test x$TARGET = xX86)
 15.1669 - AM_CONDITIONAL(X86_WIN32, test x$TARGET = xX86_WIN32)
 15.1670 -@@ -85,6 +93,13 @@
 15.1671 - AM_CONDITIONAL(POWERPC_AIX, test x$TARGET = xPOWERPC_AIX)
 15.1672 - AM_CONDITIONAL(POWERPC_DARWIN, test x$TARGET = xPOWERPC_DARWIN)
 15.1673 - AM_CONDITIONAL(ARM, test x$TARGET = xARM)
 15.1674 -+AM_CONDITIONAL(S390, test x$TARGET = xS390)
 15.1675 -+AM_CONDITIONAL(X86_64, test x$TARGET = xX86_64)
 15.1676 -+AM_CONDITIONAL(SH, test x$TARGET = xSH)
 15.1677 -+
 15.1678 -+if test x$TARGET = xMIPS_LINUX; then
 15.1679 -+  TARGET=MIPS
 15.1680 -+fi
 15.1681 - 
 15.1682 - AC_HEADER_STDC
 15.1683 - AC_CHECK_FUNCS(memcpy)
 15.1684 -@@ -171,7 +186,7 @@
 15.1685 - [
 15.1686 - if test -n "$CONFIG_FILES"; then
 15.1687 -    LD="${ORIGINAL_LD_FOR_MULTILIBS}"
 15.1688 --   ac_file=Makefile . ${libffi_basedir}/../config-ml.in
 15.1689 -+   ac_file=Makefile . ${srcdir}/${libffi_basedir}../config-ml.in
 15.1690 - fi
 15.1691 - ],
 15.1692 - srcdir=${srcdir}
 15.1693 -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/include/Makefile.in gcc/libffi/include/Makefile.in
 15.1694 ---- gcc-3.2.2.orig/libffi/include/Makefile.in	Tue Oct  9 14:32:16 2001
 15.1695 -+++ gcc/libffi/include/Makefile.in	Mon Apr 29 13:14:44 2002
 15.1696 -@@ -99,7 +99,7 @@
 15.1697 - 
 15.1698 - DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
 15.1699 - 
 15.1700 --TAR = gnutar
 15.1701 -+TAR = gtar
 15.1702 - GZIP_ENV = --best
 15.1703 - all: all-redirect
 15.1704 - .SUFFIXES:
 15.1705 -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/include/ffi.h.in gcc/libffi/include/ffi.h.in
 15.1706 ---- gcc-3.2.2.orig/libffi/include/ffi.h.in	Wed Mar 13 07:35:56 2002
 15.1707 -+++ gcc/libffi/include/ffi.h.in	Wed Jan 29 00:54:28 2003
 15.1708 -@@ -1,5 +1,5 @@
 15.1709 - /* -----------------------------------------------------------------*-C-*-
 15.1710 --   libffi @VERSION@ - Copyright (c) 1996-2002  Cygnus Solutions
 15.1711 -+   libffi @VERSION@ - Copyright (c) 1996-2003  Cygnus Solutions
 15.1712 - 
 15.1713 -    Permission is hereby granted, free of charge, to any person obtaining
 15.1714 -    a copy of this software and associated documentation files (the
 15.1715 -@@ -164,6 +164,12 @@
 15.1716 - #endif
 15.1717 - #endif
 15.1718 - 
 15.1719 -+#ifdef S390
 15.1720 -+#if defined (__s390x__)
 15.1721 -+#define S390X
 15.1722 -+#endif
 15.1723 -+#endif
 15.1724 -+
 15.1725 - #ifndef LIBFFI_ASM
 15.1726 - 
 15.1727 - /* ---- Generic type definitions ----------------------------------------- */
 15.1728 -@@ -189,16 +195,23 @@
 15.1729 - #endif
 15.1730 - #endif
 15.1731 - 
 15.1732 --  /* ---- Intel x86 ---------------- */
 15.1733 --#ifdef X86
 15.1734 -+  /* ---- Intel x86 Win32 ---------- */
 15.1735 -+#ifdef X86_WIN32
 15.1736 -   FFI_SYSV,
 15.1737 -+  FFI_STDCALL,
 15.1738 -+  /* TODO: Add fastcall support for the sake of completeness */
 15.1739 -   FFI_DEFAULT_ABI = FFI_SYSV,
 15.1740 - #endif
 15.1741 - 
 15.1742 --  /* ---- Intel x86 Win32 ---------- */
 15.1743 --#ifdef X86_WIN32
 15.1744 -+  /* ---- Intel x86 and AMD x86-64 - */
 15.1745 -+#if !defined(X86_WIN32) && (defined(__i386__) || defined(__x86_64__))
 15.1746 -   FFI_SYSV,
 15.1747 -+  FFI_UNIX64,   /* Unix variants all use the same ABI for x86-64  */
 15.1748 -+#ifdef __i386__
 15.1749 -   FFI_DEFAULT_ABI = FFI_SYSV,
 15.1750 -+#else
 15.1751 -+  FFI_DEFAULT_ABI = FFI_UNIX64,
 15.1752 -+#endif
 15.1753 - #endif
 15.1754 - 
 15.1755 -   /* ---- Intel ia64 ---------------- */
 15.1756 -@@ -251,6 +264,18 @@
 15.1757 -   FFI_DEFAULT_ABI = FFI_SYSV,
 15.1758 - #endif
 15.1759 - 
 15.1760 -+  /* ---- S390 --------------------- */
 15.1761 -+#ifdef S390
 15.1762 -+  FFI_SYSV,
 15.1763 -+  FFI_DEFAULT_ABI = FFI_SYSV,
 15.1764 -+#endif
 15.1765 -+
 15.1766 -+  /* ---- SuperH ------------------- */
 15.1767 -+#ifdef SH
 15.1768 -+  FFI_SYSV,
 15.1769 -+  FFI_DEFAULT_ABI = FFI_SYSV,
 15.1770 -+#endif
 15.1771 -+
 15.1772 -   /* Leave this for debugging purposes */
 15.1773 -   FFI_LAST_ABI
 15.1774 - 
 15.1775 -@@ -264,7 +289,7 @@
 15.1776 -   /*@null@*/ struct _ffi_type **elements;
 15.1777 - } ffi_type;
 15.1778 - 
 15.1779 --/* These are defined in ffi.c */
 15.1780 -+/* These are defined in types.c */
 15.1781 - extern ffi_type ffi_type_void;
 15.1782 - extern ffi_type ffi_type_uint8;
 15.1783 - extern ffi_type ffi_type_sint8;
 15.1784 -@@ -373,13 +398,7 @@
 15.1785 - 
 15.1786 - /* ---- Definitions for closures ----------------------------------------- */
 15.1787 - 
 15.1788 --#ifdef X86
 15.1789 --
 15.1790 --#define FFI_CLOSURES 1		/* x86 supports closures */
 15.1791 --#define FFI_TRAMPOLINE_SIZE 10
 15.1792 --#define FFI_NATIVE_RAW_API 1	/* and has native raw api support */
 15.1793 --
 15.1794 --#elif defined(X86_WIN32)
 15.1795 -+#ifdef __i386__
 15.1796 - 
 15.1797 - #define FFI_CLOSURES 1		/* x86 supports closures */
 15.1798 - #define FFI_TRAMPOLINE_SIZE 10
 15.1799 -@@ -424,6 +443,40 @@
 15.1800 - #define FFI_TRAMPOLINE_SIZE 24 /* see struct below */ 
 15.1801 - #define FFI_NATIVE_RAW_API 0
 15.1802 - 
 15.1803 -+#elif defined(SPARC64)
 15.1804 -+
 15.1805 -+#define FFI_CLOSURES 1
 15.1806 -+#define FFI_TRAMPOLINE_SIZE 24
 15.1807 -+#define FFI_NATIVE_RAW_API 0
 15.1808 -+
 15.1809 -+#elif defined(SPARC)
 15.1810 -+
 15.1811 -+#define FFI_CLOSURES 1
 15.1812 -+#define FFI_TRAMPOLINE_SIZE 16
 15.1813 -+#define FFI_NATIVE_RAW_API 0
 15.1814 -+
 15.1815 -+#elif defined(S390)
 15.1816 -+
 15.1817 -+#define FFI_CLOSURES 1
 15.1818 -+#ifdef S390X
 15.1819 -+#define FFI_TRAMPOLINE_SIZE 32
 15.1820 -+#else
 15.1821 -+#define FFI_TRAMPOLINE_SIZE 16
 15.1822 -+#endif
 15.1823 -+#define FFI_NATIVE_RAW_API 0
 15.1824 -+
 15.1825 -+#elif defined(SH)
 15.1826 -+
 15.1827 -+#define FFI_CLOSURES 1
 15.1828 -+#define FFI_TRAMPOLINE_SIZE 16
 15.1829 -+#define FFI_NATIVE_RAW_API 0
 15.1830 -+
 15.1831 -+#elif defined(__x86_64__)
 15.1832 -+
 15.1833 -+#define FFI_CLOSURES 1
 15.1834 -+#define FFI_TRAMPOLINE_SIZE 24
 15.1835 -+#define FFI_NATIVE_RAW_API 0
 15.1836 -+
 15.1837 - #else 
 15.1838 - 
 15.1839 - #define FFI_CLOSURES 0
 15.1840 -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/arm/ffi.c gcc/libffi/src/arm/ffi.c
 15.1841 ---- gcc-3.2.2.orig/libffi/src/arm/ffi.c	Sat Mar  3 07:21:23 2001
 15.1842 -+++ gcc/libffi/src/arm/ffi.c	Fri Jul 19 08:08:30 2002
 15.1843 -@@ -36,13 +36,10 @@
 15.1844 - /*@=exportheader@*/
 15.1845 - {
 15.1846 -   register unsigned int i;
 15.1847 --  register int tmp;
 15.1848 --  register unsigned int avn;
 15.1849 -   register void **p_argv;
 15.1850 -   register char *argp;
 15.1851 -   register ffi_type **p_arg;
 15.1852 - 
 15.1853 --  tmp = 0;
 15.1854 -   argp = stack;
 15.1855 - 
 15.1856 -   if ( ecif->cif->rtype->type == FFI_TYPE_STRUCT ) {
 15.1857 -@@ -50,11 +47,10 @@
 15.1858 -     argp += 4;
 15.1859 -   }
 15.1860 - 
 15.1861 --  avn = ecif->cif->nargs;
 15.1862 -   p_argv = ecif->avalue;
 15.1863 - 
 15.1864 -   for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types;
 15.1865 --       (i != 0) && (avn != 0);
 15.1866 -+       (i != 0);
 15.1867 -        i--, p_arg++)
 15.1868 -     {
 15.1869 -       size_t z;
 15.1870 -@@ -64,9 +60,6 @@
 15.1871 - 	argp = (char *) ALIGN(argp, (*p_arg)->alignment);
 15.1872 -       }
 15.1873 - 
 15.1874 --      if (avn != 0) 
 15.1875 --	{
 15.1876 --	  avn--;
 15.1877 - 	  z = (*p_arg)->size;
 15.1878 - 	  if (z < sizeof(int))
 15.1879 - 	    {
 15.1880 -@@ -107,7 +100,6 @@
 15.1881 - 	    }
 15.1882 - 	  p_argv++;
 15.1883 - 	  argp += z;
 15.1884 --	}
 15.1885 -     }
 15.1886 -   
 15.1887 -   return;
 15.1888 -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/arm/sysv.S gcc/libffi/src/arm/sysv.S
 15.1889 ---- gcc-3.2.2.orig/libffi/src/arm/sysv.S	Sat Mar  3 07:21:23 2001
 15.1890 -+++ gcc/libffi/src/arm/sysv.S	Mon Sep 30 03:08:58 2002
 15.1891 -@@ -28,8 +28,15 @@
 15.1892 - #ifdef HAVE_MACHINE_ASM_H
 15.1893 - #include <machine/asm.h>
 15.1894 - #else
 15.1895 --/* XXX these lose for some platforms, I'm sure. */
 15.1896 -+#ifdef __USER_LABEL_PREFIX__
 15.1897 -+#define CONCAT1(a, b) CONCAT2(a, b)
 15.1898 -+#define CONCAT2(a, b) a ## b
 15.1899 -+
 15.1900 -+/* Use the right prefix for global labels.  */
 15.1901 -+#define CNAME(x) CONCAT1 (__USER_LABEL_PREFIX__, x)
 15.1902 -+#else
 15.1903 - #define CNAME(x) x
 15.1904 -+#endif
 15.1905 - #define ENTRY(x) .globl CNAME(x); .type CNAME(x),%function; CNAME(x):
 15.1906 - #endif
 15.1907 - 	
 15.1908 -@@ -96,12 +103,20 @@
 15.1909 - 
 15.1910 - # return FLOAT
 15.1911 - 	cmp     a4, #FFI_TYPE_FLOAT
 15.1912 -+#ifdef __SOFTFP__
 15.1913 -+	streq	a1, [a3]
 15.1914 -+#else
 15.1915 - 	stfeqs  f0, [a3]
 15.1916 -+#endif
 15.1917 - 	beq     epilogue
 15.1918 - 
 15.1919 - # return DOUBLE or LONGDOUBLE
 15.1920 - 	cmp     a4, #FFI_TYPE_DOUBLE
 15.1921 -+#ifdef __SOFTFP__
 15.1922 -+	stmeqia	a3, {a1, a2}
 15.1923 -+#else
 15.1924 - 	stfeqd  f0, [a3]
 15.1925 -+#endif
 15.1926 - 
 15.1927 - epilogue:
 15.1928 -         ldmfd sp!, {a1-a4, fp, pc}
 15.1929 -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/java_raw_api.c gcc/libffi/src/java_raw_api.c
 15.1930 ---- gcc-3.2.2.orig/libffi/src/java_raw_api.c	Tue Apr  9 07:31:14 2002
 15.1931 -+++ gcc/libffi/src/java_raw_api.c	Tue Oct  8 23:55:02 2002
 15.1932 -@@ -81,21 +81,14 @@
 15.1933 - 	{
 15.1934 - 	case FFI_TYPE_UINT8:
 15.1935 - 	case FFI_TYPE_SINT8:
 15.1936 --	  *args = (void*) ((char*)(raw++) + SIZEOF_ARG - 1);
 15.1937 -+	  *args = (void*) ((char*)(raw++) + 3);
 15.1938 - 	  break;
 15.1939 - 	  
 15.1940 - 	case FFI_TYPE_UINT16:
 15.1941 - 	case FFI_TYPE_SINT16:
 15.1942 --	  *args = (void*) ((char*)(raw++) + SIZEOF_ARG - 2);
 15.1943 -+	  *args = (void*) ((char*)(raw++) + 2);
 15.1944 - 	  break;
 15.1945 - 
 15.1946 --#if SIZEOF_ARG >= 4	  
 15.1947 --	case FFI_TYPE_UINT32:
 15.1948 --	case FFI_TYPE_SINT32:
 15.1949 --	  *args = (void*) ((char*)(raw++) + SIZEOF_ARG - 4);
 15.1950 --	  break;
 15.1951 --#endif
 15.1952 --	
 15.1953 - #if SIZEOF_ARG == 8	  
 15.1954 - 	case FFI_TYPE_UINT64:
 15.1955 - 	case FFI_TYPE_SINT64:
 15.1956 -@@ -157,31 +150,54 @@
 15.1957 -       switch ((*tp)->type)
 15.1958 - 	{
 15.1959 - 	case FFI_TYPE_UINT8:
 15.1960 -+#if WORDS_BIGENDIAN
 15.1961 -+	  *(UINT32*)(raw++) = *(UINT8*) (*args);
 15.1962 -+#else
 15.1963 - 	  (raw++)->uint = *(UINT8*) (*args);
 15.1964 -+#endif
 15.1965 - 	  break;
 15.1966 - 
 15.1967 - 	case FFI_TYPE_SINT8:
 15.1968 -+#if WORDS_BIGENDIAN
 15.1969 -+	  *(SINT32*)(raw++) = *(SINT8*) (*args);
 15.1970 -+#else
 15.1971 - 	  (raw++)->sint = *(SINT8*) (*args);
 15.1972 -+#endif
 15.1973 - 	  break;
 15.1974 - 
 15.1975 - 	case FFI_TYPE_UINT16:
 15.1976 -+#if WORDS_BIGENDIAN
 15.1977 -+	  *(UINT32*)(raw++) = *(UINT16*) (*args);
 15.1978 -+#else
 15.1979 - 	  (raw++)->uint = *(UINT16*) (*args);
 15.1980 -+#endif
 15.1981 - 	  break;
 15.1982 - 
 15.1983 - 	case FFI_TYPE_SINT16:
 15.1984 -+#if WORDS_BIGENDIAN
 15.1985 -+	  *(SINT32*)(raw++) = *(SINT16*) (*args);
 15.1986 -+#else
 15.1987 - 	  (raw++)->sint = *(SINT16*) (*args);
 15.1988 -+#endif
 15.1989 - 	  break;
 15.1990 - 
 15.1991 --#if SIZEOF_ARG >= 4
 15.1992 - 	case FFI_TYPE_UINT32:
 15.1993 -+#if WORDS_BIGENDIAN
 15.1994 -+	  *(UINT32*)(raw++) = *(UINT32*) (*args);
 15.1995 -+#else
 15.1996 - 	  (raw++)->uint = *(UINT32*) (*args);
 15.1997 -+#endif
 15.1998 - 	  break;
 15.1999 - 
 15.2000 - 	case FFI_TYPE_SINT32:
 15.2001 -+#if WORDS_BIGENDIAN
 15.2002 -+	  *(SINT32*)(raw++) = *(SINT32*) (*args);
 15.2003 -+#else
 15.2004 - 	  (raw++)->sint = *(SINT32*) (*args);
 15.2005 --	  break;
 15.2006 - #endif
 15.2007 --        case FFI_TYPE_FLOAT:
 15.2008 -+	  break;
 15.2009 -+
 15.2010 -+	case FFI_TYPE_FLOAT:
 15.2011 - 	  (raw++)->flt = *(FLOAT32*) (*args);
 15.2012 - 	  break;
 15.2013 - 
 15.2014 -@@ -211,6 +227,55 @@
 15.2015 - 
 15.2016 - #if !FFI_NATIVE_RAW_API
 15.2017 - 
 15.2018 -+static void
 15.2019 -+ffi_java_rvalue_to_raw (ffi_cif *cif, void *rvalue)
 15.2020 -+{
 15.2021 -+#if WORDS_BIGENDIAN && SIZEOF_ARG == 8
 15.2022 -+  switch (cif->rtype->type)
 15.2023 -+    {
 15.2024 -+    case FFI_TYPE_UINT8:
 15.2025 -+    case FFI_TYPE_UINT16:
 15.2026 -+    case FFI_TYPE_UINT32:
 15.2027 -+      *(UINT64 *)rvalue <<= 32;
 15.2028 -+      break;
 15.2029 -+
 15.2030 -+    case FFI_TYPE_SINT8:
 15.2031 -+    case FFI_TYPE_SINT16:
 15.2032 -+    case FFI_TYPE_SINT32:
 15.2033 -+    case FFI_TYPE_INT:
 15.2034 -+      *(SINT64 *)rvalue <<= 32;
 15.2035 -+      break;
 15.2036 -+
 15.2037 -+    default:
 15.2038 -+      break;
 15.2039 -+    }
 15.2040 -+#endif
 15.2041 -+}
 15.2042 -+
 15.2043 -+static void
 15.2044 -+ffi_java_raw_to_rvalue (ffi_cif *cif, void *rvalue)
 15.2045 -+{
 15.2046 -+#if WORDS_BIGENDIAN && SIZEOF_ARG == 8
 15.2047 -+  switch (cif->rtype->type)
 15.2048 -+    {
 15.2049 -+    case FFI_TYPE_UINT8:
 15.2050 -+    case FFI_TYPE_UINT16:
 15.2051 -+    case FFI_TYPE_UINT32:
 15.2052 -+      *(UINT64 *)rvalue >>= 32;
 15.2053 -+      break;
 15.2054 -+
 15.2055 -+    case FFI_TYPE_SINT8:
 15.2056 -+    case FFI_TYPE_SINT16:
 15.2057 -+    case FFI_TYPE_SINT32:
 15.2058 -+    case FFI_TYPE_INT:
 15.2059 -+      *(SINT64 *)rvalue >>= 32;
 15.2060 -+      break;
 15.2061 -+
 15.2062 -+    default:
 15.2063 -+      break;
 15.2064 -+    }
 15.2065 -+#endif
 15.2066 -+}
 15.2067 - 
 15.2068 - /* This is a generic definition of ffi_raw_call, to be used if the
 15.2069 -  * native system does not provide a machine-specific implementation.
 15.2070 -@@ -227,6 +292,7 @@
 15.2071 -   void **avalue = (void**) alloca (cif->nargs * sizeof (void*));
 15.2072 -   ffi_java_raw_to_ptrarray (cif, raw, avalue);
 15.2073 -   ffi_call (cif, fn, rvalue, avalue);
 15.2074 -+  ffi_java_rvalue_to_raw (cif, rvalue);
 15.2075 - }
 15.2076 - 
 15.2077 - #if FFI_CLOSURES		/* base system provides closures */
 15.2078 -@@ -240,6 +306,7 @@
 15.2079 - 
 15.2080 -   ffi_java_ptrarray_to_raw (cif, avalue, raw);
 15.2081 -   (*cl->fun) (cif, rvalue, raw, cl->user_data);
 15.2082 -+  ffi_java_raw_to_rvalue (cif, rvalue);
 15.2083 - }
 15.2084 - 
 15.2085 - /* Again, here is the generic version of ffi_prep_raw_closure, which
 15.2086 -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/m68k/ffi.c gcc/libffi/src/m68k/ffi.c
 15.2087 ---- gcc-3.2.2.orig/libffi/src/m68k/ffi.c	Sun Aug  8 22:27:19 1999
 15.2088 -+++ gcc/libffi/src/m68k/ffi.c	Fri Jul 19 08:08:30 2002
 15.2089 -@@ -16,14 +16,11 @@
 15.2090 - ffi_prep_args (void *stack, extended_cif *ecif)
 15.2091 - {
 15.2092 -   unsigned int i;
 15.2093 --  int tmp;
 15.2094 --  unsigned int avn;
 15.2095 -   void **p_argv;
 15.2096 -   char *argp;
 15.2097 -   ffi_type **p_arg;
 15.2098 -   void *struct_value_ptr;
 15.2099 - 
 15.2100 --  tmp = 0;
 15.2101 -   argp = stack;
 15.2102 - 
 15.2103 -   if (ecif->cif->rtype->type == FFI_TYPE_STRUCT
 15.2104 -@@ -32,11 +29,10 @@
 15.2105 -   else
 15.2106 -     struct_value_ptr = NULL;
 15.2107 - 
 15.2108 --  avn = ecif->cif->nargs;
 15.2109 -   p_argv = ecif->avalue;
 15.2110 - 
 15.2111 -   for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types;
 15.2112 --       i != 0 && avn != 0;
 15.2113 -+       i != 0;
 15.2114 -        i--, p_arg++)
 15.2115 -     {
 15.2116 -       size_t z;
 15.2117 -@@ -45,9 +41,6 @@
 15.2118 -       if (((*p_arg)->alignment - 1) & (unsigned) argp)
 15.2119 - 	argp = (char *) ALIGN (argp, (*p_arg)->alignment);
 15.2120 - 
 15.2121 --      if (avn != 0) 
 15.2122 --	{
 15.2123 --	  avn--;
 15.2124 - 	  z = (*p_arg)->size;
 15.2125 - 	  if (z < sizeof (int))
 15.2126 - 	    {
 15.2127 -@@ -82,7 +75,6 @@
 15.2128 - 	    memcpy (argp, *p_argv, z);
 15.2129 - 	  p_argv++;
 15.2130 - 	  argp += z;
 15.2131 --	}
 15.2132 -     }
 15.2133 - 
 15.2134 -   return struct_value_ptr;
 15.2135 -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/mips/ffi.c gcc/libffi/src/mips/ffi.c
 15.2136 ---- gcc-3.2.2.orig/libffi/src/mips/ffi.c	Sat Mar  3 07:21:23 2001
 15.2137 -+++ gcc/libffi/src/mips/ffi.c	Fri Jul 19 08:08:31 2002
 15.2138 -@@ -23,6 +23,7 @@
 15.2139 -    OTHER DEALINGS IN THE SOFTWARE.
 15.2140 -    ----------------------------------------------------------------------- */
 15.2141 - 
 15.2142 -+#include <sgidefs.h>
 15.2143 - #include <ffi.h>
 15.2144 - #include <ffi_common.h>
 15.2145 - 
 15.2146 -@@ -50,7 +51,6 @@
 15.2147 - 			  int flags)
 15.2148 - {
 15.2149 -   register int i;
 15.2150 --  register int avn;
 15.2151 -   register void **p_argv;
 15.2152 -   register char *argp;
 15.2153 -   register ffi_type **p_arg;
 15.2154 -@@ -80,12 +80,9 @@
 15.2155 -       FIX_ARGP;
 15.2156 -     }
 15.2157 - 
 15.2158 --  avn = ecif->cif->nargs;
 15.2159 -   p_argv = ecif->avalue;
 15.2160 - 
 15.2161 --  for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types;
 15.2162 --       i && avn;
 15.2163 --       i--, p_arg++)
 15.2164 -+  for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; i; i--, p_arg++)
 15.2165 -     {
 15.2166 -       size_t z;
 15.2167 - 
 15.2168 -@@ -101,9 +98,6 @@
 15.2169 - #define OFFSET sizeof(int)
 15.2170 - #endif      
 15.2171 - 
 15.2172 --      if (avn) 
 15.2173 --	{
 15.2174 --	  avn--;
 15.2175 - 	  z = (*p_arg)->size;
 15.2176 - 	  if (z < sizeof(SLOT_TYPE_UNSIGNED))
 15.2177 - 	    {
 15.2178 -@@ -179,7 +173,6 @@
 15.2179 - 	  p_argv++;
 15.2180 - 	  argp += z;
 15.2181 - 	  FIX_ARGP;
 15.2182 --	}
 15.2183 -     }
 15.2184 -   
 15.2185 -   return;
 15.2186 -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/powerpc/darwin.S gcc/libffi/src/powerpc/darwin.S
 15.2187 ---- gcc-3.2.2.orig/libffi/src/powerpc/darwin.S	Sat Jan 19 01:22:34 2002
 15.2188 -+++ gcc/libffi/src/powerpc/darwin.S	Thu Jan 23 03:21:55 2003
 15.2189 -@@ -3,8 +3,6 @@
 15.2190 -    
 15.2191 -    PowerPC Assembly glue.
 15.2192 - 
 15.2193 --   $Id: darwin.S,v 1.2 2002/01/18 16:22:34 dje Exp $
 15.2194 --
 15.2195 -    Permission is hereby granted, free of charge, to any person obtaining
 15.2196 -    a copy of this software and associated documentation files (the
 15.2197 -    ``Software''), to deal in the Software without restriction, including
 15.2198 -@@ -39,30 +37,34 @@
 15.2199 - .text
 15.2200 - 	.align 2
 15.2201 - _ffi_call_DARWIN:
 15.2202 --	mr      r12,r8 // We only need r12 until the call, so it doesn't have to be saved...
 15.2203 -+LFB0:	
 15.2204 -+	mr      r12,r8		/* We only need r12 until the call,
 15.2205 -+				so it doesn't have to be saved...  */
 15.2206 -+LFB1:	
 15.2207 - 	/* Save the old stack pointer as AP.  */
 15.2208 - 	mr	r8,r1
 15.2209 --
 15.2210 -+LCFI0:	
 15.2211 - 	/* Allocate the stack space we need.  */
 15.2212 - 	stwux	r1,r1,r4	
 15.2213 - 	
 15.2214 - 	/* Save registers we use.  */
 15.2215 - 	mflr	r9
 15.2216 - 
 15.2217 --	stw	r28,-16(r8)
 15.2218 -+	stw	r28,-16(r8)	
 15.2219 - 	stw	r29,-12(r8)
 15.2220 - 	stw	r30, -8(r8)
 15.2221 - 	stw	r31, -4(r8)
 15.2222 --	
 15.2223 --	stw	r9,  8(r8)
 15.2224 -+
 15.2225 -+	stw	r9,  8(r8)	
 15.2226 - 	stw	r2, 20(r1)
 15.2227 -+LCFI1:	
 15.2228 - 
 15.2229 - 	/* Save arguments over call...  */
 15.2230 --	mr	r31,r5	/* flags, */
 15.2231 --	mr	r30,r6	/* rvalue, */
 15.2232 --	mr	r29,r7	/* function address, */
 15.2233 --	mr	r28,r8	/* our AP. */
 15.2234 --		
 15.2235 -+	mr	r31,r5	/* flags,  */
 15.2236 -+	mr	r30,r6	/* rvalue,  */
 15.2237 -+	mr	r29,r7	/* function address,  */
 15.2238 -+	mr	r28,r8	/* our AP.  */
 15.2239 -+LCFI2:		
 15.2240 - 	/* Call ffi_prep_args.  */
 15.2241 - 	mr	r4,r1
 15.2242 - 	li	r9,0
 15.2243 -@@ -145,7 +147,8 @@
 15.2244 - L(float_return_value):
 15.2245 - 	stfs	f1,0(r30)
 15.2246 - 	b	L(done_return_value)
 15.2247 --//END(_ffi_call_DARWIN)
 15.2248 -+LFE1:	
 15.2249 -+/* END(_ffi_call_DARWIN)  */
 15.2250 - 
 15.2251 - /* Provide a null definition of _ffi_call_AIX.  */
 15.2252 - .text
 15.2253 -@@ -155,5 +158,61 @@
 15.2254 - 	.align 2
 15.2255 - _ffi_call_AIX:
 15.2256 - 	blr
 15.2257 --//END(_ffi_call_AIX)
 15.2258 -+/* END(_ffi_call_AIX)  */
 15.2259 - 
 15.2260 -+.data
 15.2261 -+.section __TEXT,__eh_frame
 15.2262 -+Lframe1:
 15.2263 -+	.set	L$set$0,LECIE1-LSCIE1
 15.2264 -+	.long	L$set$0	; Length of Common Information Entry
 15.2265 -+LSCIE1:
 15.2266 -+	.long	0x0	; CIE Identifier Tag
 15.2267 -+	.byte	0x1	; CIE Version
 15.2268 -+	.ascii	"zR\0"	; CIE Augmentation
 15.2269 -+	.byte	0x1	; uleb128 0x1; CIE Code Alignment Factor
 15.2270 -+	.byte	0x7c	; sleb128 -4; CIE Data Alignment Factor
 15.2271 -+	.byte	0x41	; CIE RA Column
 15.2272 -+	.byte   0x1     ; uleb128 0x1; Augmentation size
 15.2273 -+	.byte   0x10    ; FDE Encoding (pcrel)
 15.2274 -+	.byte	0xc	; DW_CFA_def_cfa
 15.2275 -+	.byte	0x1	; uleb128 0x1
 15.2276 -+	.byte	0x0	; uleb128 0x0
 15.2277 -+	.align	2
 15.2278 -+LECIE1:
 15.2279 -+LSFDE1:
 15.2280 -+	.set	L$set$1,LEFDE1-LASFDE1
 15.2281 -+	.long	L$set$1	; FDE Length
 15.2282 -+LASFDE1:
 15.2283 -+	.set	L$set$2,LASFDE1-Lframe1
 15.2284 -+	.long	L$set$2	; FDE CIE offset
 15.2285 -+	.long	LFB0-.	; FDE initial location
 15.2286 -+	.set	L$set$3,LFE1-LFB0
 15.2287 -+	.long	L$set$3	; FDE address range
 15.2288 -+	.byte   0x0     ; uleb128 0x0; Augmentation size
 15.2289 -+	.byte	0x4	; DW_CFA_advance_loc4
 15.2290 -+	.set	L$set$4,LCFI0-LFB1
 15.2291 -+	.long	L$set$4
 15.2292 -+	.byte	0xd	; DW_CFA_def_cfa_register
 15.2293 -+	.byte	0x08	; uleb128 0x08 
 15.2294 -+	.byte	0x4	; DW_CFA_advance_loc4
 15.2295 -+	.set	L$set$5,LCFI1-LCFI0
 15.2296 -+	.long	L$set$5
 15.2297 -+	.byte   0x11    ; DW_CFA_offset_extended_sf
 15.2298 -+	.byte	0x41	; uleb128 0x41
 15.2299 -+	.byte   0x7e    ; sleb128 -2
 15.2300 -+	.byte	0x9f	; DW_CFA_offset, column 0x1f 
 15.2301 -+	.byte	0x1	; uleb128 0x1 
 15.2302 -+	.byte	0x9e	; DW_CFA_offset, column 0x1e
 15.2303 -+	.byte	0x2	; uleb128 0x2
 15.2304 -+	.byte	0x9d	; DW_CFA_offset, column 0x1d 
 15.2305 -+	.byte	0x3	; uleb128 0x3 
 15.2306 -+	.byte	0x9c	; DW_CFA_offset, column 0x1c 
 15.2307 -+	.byte	0x4	; uleb128 0x4
 15.2308 -+	.byte	0x4	; DW_CFA_advance_loc4 
 15.2309 -+	.set	L$set$6,LCFI2-LCFI1
 15.2310 -+	.long	L$set$6
 15.2311 -+	.byte	0xd	; DW_CFA_def_cfa_register 
 15.2312 -+	.byte	0x1c	; uleb128 0x1c 
 15.2313 -+	.align 2
 15.2314 -+LEFDE1:
 15.2315 -+	
 15.2316 -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/prep_cif.c gcc/libffi/src/prep_cif.c
 15.2317 ---- gcc-3.2.2.orig/libffi/src/prep_cif.c	Sat Mar  3 07:21:22 2001
 15.2318 -+++ gcc/libffi/src/prep_cif.c	Mon Sep 30 20:59:42 2002
 15.2319 -@@ -103,7 +103,8 @@
 15.2320 -   /* Perform a sanity check on the return type */
 15.2321 -   FFI_ASSERT(ffi_type_test(cif->rtype));
 15.2322 - 
 15.2323 --#ifndef M68K
 15.2324 -+  /* x86-64 and s390 stack space allocation is handled in prep_machdep.  */
 15.2325 -+#if !defined M68K && !defined __x86_64__ && !defined S390
 15.2326 -   /* Make space for the return structure pointer */
 15.2327 -   if (cif->rtype->type == FFI_TYPE_STRUCT
 15.2328 - #ifdef SPARC
 15.2329 -@@ -122,6 +123,7 @@
 15.2330 -       if (((*ptr)->size == 0) && (initialize_aggregate((*ptr)) != FFI_OK))
 15.2331 - 	return FFI_BAD_TYPEDEF;
 15.2332 - 
 15.2333 -+#if !defined __x86_64__ && !defined S390
 15.2334 - #ifdef SPARC
 15.2335 -       if (((*ptr)->type == FFI_TYPE_STRUCT
 15.2336 - 	   && ((*ptr)->size > 16 || cif->abi != FFI_V9))
 15.2337 -@@ -137,6 +139,7 @@
 15.2338 - 	  
 15.2339 - 	  bytes += STACK_ARG_SIZE((*ptr)->size);
 15.2340 - 	}
 15.2341 -+#endif
 15.2342 -     }
 15.2343 - 
 15.2344 -   cif->bytes = bytes;
 15.2345 -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/s390/ffi.c gcc/libffi/src/s390/ffi.c
 15.2346 ---- gcc-3.2.2.orig/libffi/src/s390/ffi.c	Thu Jan  1 09:00:00 1970
 15.2347 -+++ gcc/libffi/src/s390/ffi.c	Thu Feb  6 08:58:57 2003
 15.2348 -@@ -0,0 +1,753 @@
 15.2349 -+/* -----------------------------------------------------------------------
 15.2350 -+   ffi.c - Copyright (c) 2000 Software AG
 15.2351 -+ 
 15.2352 -+   S390 Foreign Function Interface
 15.2353 -+ 
 15.2354 -+   Permission is hereby granted, free of charge, to any person obtaining
 15.2355 -+   a copy of this software and associated documentation files (the
 15.2356 -+   ``Software''), to deal in the Software without restriction, including
 15.2357 -+   without limitation the rights to use, copy, modify, merge, publish,
 15.2358 -+   distribute, sublicense, and/or sell copies of the Software, and to
 15.2359 -+   permit persons to whom the Software is furnished to do so, subject to
 15.2360 -+   the following conditions:
 15.2361 -+ 
 15.2362 -+   The above copyright notice and this permission notice shall be included
 15.2363 -+   in all copies or substantial portions of the Software.
 15.2364 -+ 
 15.2365 -+   THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
 15.2366 -+   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 15.2367 -+   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 15.2368 -+   IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR
 15.2369 -+   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 15.2370 -+   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 15.2371 -+   OTHER DEALINGS IN THE SOFTWARE.
 15.2372 -+   ----------------------------------------------------------------------- */
 15.2373 -+/*====================================================================*/
 15.2374 -+/*                          Includes                                  */
 15.2375 -+/*                          --------                                  */
 15.2376 -+/*====================================================================*/
 15.2377 -+ 
 15.2378 -+#include <ffi.h>
 15.2379 -+#include <ffi_common.h>
 15.2380 -+ 
 15.2381 -+#include <stdlib.h>
 15.2382 -+#include <stdio.h>
 15.2383 -+ 
 15.2384 -+/*====================== End of Includes =============================*/
 15.2385 -+ 
 15.2386 -+/*====================================================================*/
 15.2387 -+/*                           Defines                                  */
 15.2388 -+/*                           -------                                  */
 15.2389 -+/*====================================================================*/
 15.2390 -+
 15.2391 -+/* Maximum number of GPRs available for argument passing.  */ 
 15.2392 -+#define MAX_GPRARGS 5
 15.2393 -+
 15.2394 -+/* Maximum number of FPRs available for argument passing.  */ 
 15.2395 -+#ifdef __s390x__
 15.2396 -+#define MAX_FPRARGS 4
 15.2397 -+#else
 15.2398 -+#define MAX_FPRARGS 2
 15.2399 -+#endif
 15.2400 -+
 15.2401 -+/* Round to multiple of 16.  */
 15.2402 -+#define ROUND_SIZE(size) (((size) + 15) & ~15)
 15.2403 -+
 15.2404 -+/* If these values change, sysv.S must be adapted!  */
 15.2405 -+#define FFI390_RET_VOID		0
 15.2406 -+#define FFI390_RET_STRUCT	1
 15.2407 -+#define FFI390_RET_FLOAT	2
 15.2408 -+#define FFI390_RET_DOUBLE	3
 15.2409 -+#define FFI390_RET_INT32	4
 15.2410 -+#define FFI390_RET_INT64	5
 15.2411 -+
 15.2412 -+/*===================== End of Defines ===============================*/
 15.2413 -+ 
 15.2414 -+/*====================================================================*/
 15.2415 -+/*                          Prototypes                                */
 15.2416 -+/*                          ----------                                */
 15.2417 -+/*====================================================================*/
 15.2418 -+ 
 15.2419 -+static void ffi_prep_args (unsigned char *, extended_cif *);
 15.2420 -+static int ffi_check_float_struct (ffi_type *);
 15.2421 -+void
 15.2422 -+#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2)
 15.2423 -+__attribute__ ((visibility ("hidden")))
 15.2424 -+#endif
 15.2425 -+ffi_closure_helper_SYSV (ffi_closure *, unsigned long *, 
 15.2426 -+			 unsigned long long *, unsigned long *);
 15.2427 -+
 15.2428 -+/*====================== End of Prototypes ===========================*/
 15.2429 -+ 
 15.2430 -+/*====================================================================*/
 15.2431 -+/*                          Externals                                 */
 15.2432 -+/*                          ---------                                 */
 15.2433 -+/*====================================================================*/
 15.2434 -+ 
 15.2435 -+extern void ffi_call_SYSV(unsigned,
 15.2436 -+			  extended_cif *,
 15.2437 -+			  void (*)(unsigned char *, extended_cif *),
 15.2438 -+			  unsigned,
 15.2439 -+			  void *,
 15.2440 -+			  void (*fn)());
 15.2441 -+
 15.2442 -+extern void ffi_closure_SYSV(void);
 15.2443 -+ 
 15.2444 -+/*====================== End of Externals ============================*/
 15.2445 -+ 
 15.2446 -+/*====================================================================*/
 15.2447 -+/*                                                                    */
 15.2448 -+/* Name     - ffi_check_struct_type.                                  */
 15.2449 -+/*                                                                    */
 15.2450 -+/* Function - Determine if a structure can be passed within a         */
 15.2451 -+/*            general purpose or floating point register.             */
 15.2452 -+/*                                                                    */
 15.2453 -+/*====================================================================*/
 15.2454 -+ 
 15.2455 -+static int
 15.2456 -+ffi_check_struct_type (ffi_type *arg)
 15.2457 -+{
 15.2458 -+  size_t size = arg->size;
 15.2459 -+
 15.2460 -+  /* If the struct has just one element, look at that element
 15.2461 -+     to find out whether to consider the struct as floating point.  */
 15.2462 -+  while (arg->type == FFI_TYPE_STRUCT 
 15.2463 -+         && arg->elements[0] && !arg->elements[1])
 15.2464 -+    arg = arg->elements[0];
 15.2465 -+
 15.2466 -+  /* Structs of size 1, 2, 4, and 8 are passed in registers,
 15.2467 -+     just like the corresponding int/float types.  */
 15.2468 -+  switch (size)
 15.2469 -+    {
 15.2470 -+      case 1:
 15.2471 -+        return FFI_TYPE_UINT8;
 15.2472 -+
 15.2473 -+      case 2:
 15.2474 -+        return FFI_TYPE_UINT16;
 15.2475 -+
 15.2476 -+      case 4:
 15.2477 -+	if (arg->type == FFI_TYPE_FLOAT)
 15.2478 -+          return FFI_TYPE_FLOAT;
 15.2479 -+	else
 15.2480 -+	  return FFI_TYPE_UINT32;
 15.2481 -+
 15.2482 -+      case 8:
 15.2483 -+	if (arg->type == FFI_TYPE_DOUBLE)
 15.2484 -+          return FFI_TYPE_DOUBLE;
 15.2485 -+	else
 15.2486 -+	  return FFI_TYPE_UINT64;
 15.2487 -+
 15.2488 -+      default:
 15.2489 -+	break;
 15.2490 -+    }
 15.2491 -+
 15.2492 -+  /* Other structs are passed via a pointer to the data.  */
 15.2493 -+  return FFI_TYPE_POINTER;
 15.2494 -+}
 15.2495 -+ 
 15.2496 -+/*======================== End of Routine ============================*/
 15.2497 -+ 
 15.2498 -+/*====================================================================*/
 15.2499 -+/*                                                                    */
 15.2500 -+/* Name     - ffi_prep_args.                                          */
 15.2501 -+/*                                                                    */
 15.2502 -+/* Function - Prepare parameters for call to function.                */
 15.2503 -+/*                                                                    */
 15.2504 -+/* ffi_prep_args is called by the assembly routine once stack space   */
 15.2505 -+/* has been allocated for the function's arguments.                   */
 15.2506 -+/*                                                                    */
 15.2507 -+/*====================================================================*/
 15.2508 -+ 
 15.2509 -+static void
 15.2510 -+ffi_prep_args (unsigned char *stack, extended_cif *ecif)
 15.2511 -+{
 15.2512 -+  /* The stack space will be filled with those areas:
 15.2513 -+
 15.2514 -+	FPR argument register save area     (highest addresses)
 15.2515 -+	GPR argument register save area
 15.2516 -+	temporary struct copies
 15.2517 -+	overflow argument area              (lowest addresses)
 15.2518 -+
 15.2519 -+     We set up the following pointers:
 15.2520 -+
 15.2521 -+        p_fpr: bottom of the FPR area (growing upwards)
 15.2522 -+	p_gpr: bottom of the GPR area (growing upwards)
 15.2523 -+	p_ov: bottom of the overflow area (growing upwards)
 15.2524 -+	p_struct: top of the struct copy area (growing downwards)
 15.2525 -+
 15.2526 -+     All areas are kept aligned to twice the word size.  */
 15.2527 -+
 15.2528 -+  int gpr_off = ecif->cif->bytes;
 15.2529 -+  int fpr_off = gpr_off + ROUND_SIZE (MAX_GPRARGS * sizeof (long));
 15.2530 -+
 15.2531 -+  unsigned long long *p_fpr = (unsigned long long *)(stack + fpr_off);
 15.2532 -+  unsigned long *p_gpr = (unsigned long *)(stack + gpr_off);
 15.2533 -+  unsigned char *p_struct = (unsigned char *)p_gpr;
 15.2534 -+  unsigned long *p_ov = (unsigned long *)stack;
 15.2535 -+
 15.2536 -+  int n_fpr = 0;
 15.2537 -+  int n_gpr = 0;
 15.2538 -+  int n_ov = 0;
 15.2539 -+
 15.2540 -+  ffi_type **ptr;
 15.2541 -+  void **p_argv = ecif->avalue;
 15.2542 -+  int i;
 15.2543 -+ 
 15.2544 -+  /* If we returning a structure then we set the first parameter register
 15.2545 -+     to the address of where we are returning this structure.  */
 15.2546 -+
 15.2547 -+  if (ecif->cif->flags == FFI390_RET_STRUCT)
 15.2548 -+    p_gpr[n_gpr++] = (unsigned long) ecif->rvalue;
 15.2549 -+
 15.2550 -+  /* Now for the arguments.  */
 15.2551 -+ 
 15.2552 -+  for (ptr = ecif->cif->arg_types, i = ecif->cif->nargs;
 15.2553 -+       i > 0;
 15.2554 -+       i--, ptr++, p_argv++)
 15.2555 -+    {
 15.2556 -+      void *arg = *p_argv;
 15.2557 -+      int type = (*ptr)->type;
 15.2558 -+
 15.2559 -+      /* Check how a structure type is passed.  */
 15.2560 -+      if (type == FFI_TYPE_STRUCT)
 15.2561 -+	{
 15.2562 -+	  type = ffi_check_struct_type (*ptr);
 15.2563 -+
 15.2564 -+	  /* If we pass the struct via pointer, copy the data.  */
 15.2565 -+	  if (type == FFI_TYPE_POINTER)
 15.2566 -+	    {
 15.2567 -+	      p_struct -= ROUND_SIZE ((*ptr)->size);
 15.2568 -+	      memcpy (p_struct, (char *)arg, (*ptr)->size);
 15.2569 -+	      arg = &p_struct;
 15.2570 -+	    }
 15.2571 -+	}
 15.2572 -+
 15.2573 -+      /* Pointers are passed like UINTs of the same size.  */
 15.2574 -+      if (type == FFI_TYPE_POINTER)
 15.2575 -+#ifdef __s390x__
 15.2576 -+	type = FFI_TYPE_UINT64;
 15.2577 -+#else
 15.2578 -+	type = FFI_TYPE_UINT32;
 15.2579 -+#endif
 15.2580 -+
 15.2581 -+      /* Now handle all primitive int/float data types.  */
 15.2582 -+      switch (type) 
 15.2583 -+	{
 15.2584 -+	  case FFI_TYPE_DOUBLE:
 15.2585 -+	    if (n_fpr < MAX_FPRARGS)
 15.2586 -+	      p_fpr[n_fpr++] = *(unsigned long long *) arg;
 15.2587 -+	    else
 15.2588 -+#ifdef __s390x__
 15.2589 -+	      p_ov[n_ov++] = *(unsigned long *) arg;
 15.2590 -+#else
 15.2591 -+	      p_ov[n_ov++] = ((unsigned long *) arg)[0],
 15.2592 -+	      p_ov[n_ov++] = ((unsigned long *) arg)[1];
 15.2593 -+#endif
 15.2594 -+	    break;
 15.2595 -+	
 15.2596 -+	  case FFI_TYPE_FLOAT:
 15.2597 -+	    if (n_fpr < MAX_FPRARGS)
 15.2598 -+	      p_fpr[n_fpr++] = (long long) *(unsigned int *) arg << 32;
 15.2599 -+	    else
 15.2600 -+	      p_ov[n_ov++] = *(unsigned int *) arg;
 15.2601 -+	    break;
 15.2602 -+ 
 15.2603 -+	  case FFI_TYPE_UINT64:
 15.2604 -+	  case FFI_TYPE_SINT64:
 15.2605 -+#ifdef __s390x__
 15.2606 -+	    if (n_gpr < MAX_GPRARGS)
 15.2607 -+	      p_gpr[n_gpr++] = *(unsigned long *) arg;
 15.2608 -+	    else
 15.2609 -+	      p_ov[n_ov++] = *(unsigned long *) arg;
 15.2610 -+#else
 15.2611 -+	    if (n_gpr == MAX_GPRARGS-1)
 15.2612 -+	      n_gpr = MAX_GPRARGS;
 15.2613 -+	    if (n_gpr < MAX_GPRARGS)
 15.2614 -+	      p_gpr[n_gpr++] = ((unsigned long *) arg)[0],
 15.2615 -+	      p_gpr[n_gpr++] = ((unsigned long *) arg)[1];
 15.2616 -+	    else
 15.2617 -+	      p_ov[n_ov++] = ((unsigned long *) arg)[0],
 15.2618 -+	      p_ov[n_ov++] = ((unsigned long *) arg)[1];
 15.2619 -+#endif
 15.2620 -+	    break;
 15.2621 -+ 
 15.2622 -+	  case FFI_TYPE_UINT32:
 15.2623 -+	    if (n_gpr < MAX_GPRARGS)
 15.2624 -+	      p_gpr[n_gpr++] = *(unsigned int *) arg;
 15.2625 -+	    else
 15.2626 -+	      p_ov[n_ov++] = *(unsigned int *) arg;
 15.2627 -+	    break;
 15.2628 -+ 
 15.2629 -+	  case FFI_TYPE_INT:
 15.2630 -+	  case FFI_TYPE_SINT32:
 15.2631 -+	    if (n_gpr < MAX_GPRARGS)
 15.2632 -+	      p_gpr[n_gpr++] = *(signed int *) arg;
 15.2633 -+	    else
 15.2634 -+	      p_ov[n_ov++] = *(signed int *) arg;
 15.2635 -+	    break;
 15.2636 -+ 
 15.2637 -+	  case FFI_TYPE_UINT16:
 15.2638 -+	    if (n_gpr < MAX_GPRARGS)
 15.2639 -+	      p_gpr[n_gpr++] = *(unsigned short *) arg;
 15.2640 -+	    else
 15.2641 -+	      p_ov[n_ov++] = *(unsigned short *) arg;
 15.2642 -+	    break;
 15.2643 -+ 
 15.2644 -+	  case FFI_TYPE_SINT16:
 15.2645 -+	    if (n_gpr < MAX_GPRARGS)
 15.2646 -+	      p_gpr[n_gpr++] = *(signed short *) arg;
 15.2647 -+	    else
 15.2648 -+	      p_ov[n_ov++] = *(signed short *) arg;
 15.2649 -+	    break;
 15.2650 -+
 15.2651 -+	  case FFI_TYPE_UINT8:
 15.2652 -+	    if (n_gpr < MAX_GPRARGS)
 15.2653 -+	      p_gpr[n_gpr++] = *(unsigned char *) arg;
 15.2654 -+	    else
 15.2655 -+	      p_ov[n_ov++] = *(unsigned char *) arg;
 15.2656 -+	    break;
 15.2657 -+ 
 15.2658 -+	  case FFI_TYPE_SINT8:
 15.2659 -+	    if (n_gpr < MAX_GPRARGS)
 15.2660 -+	      p_gpr[n_gpr++] = *(signed char *) arg;
 15.2661 -+	    else
 15.2662 -+	      p_ov[n_ov++] = *(signed char *) arg;
 15.2663 -+	    break;
 15.2664 -+ 
 15.2665 -+	  default:
 15.2666 -+	    FFI_ASSERT (0);
 15.2667 -+	    break;
 15.2668 -+        }
 15.2669 -+    }
 15.2670 -+}
 15.2671 -+
 15.2672 -+/*======================== End of Routine ============================*/
 15.2673 -+ 
 15.2674 -+/*====================================================================*/
 15.2675 -+/*                                                                    */
 15.2676 -+/* Name     - ffi_prep_cif_machdep.                                   */
 15.2677 -+/*                                                                    */
 15.2678 -+/* Function - Perform machine dependent CIF processing.               */
 15.2679 -+/*                                                                    */
 15.2680 -+/*====================================================================*/
 15.2681 -+ 
 15.2682 -+ffi_status
 15.2683 -+ffi_prep_cif_machdep(ffi_cif *cif)
 15.2684 -+{
 15.2685 -+  size_t struct_size = 0;
 15.2686 -+  int n_gpr = 0;
 15.2687 -+  int n_fpr = 0;
 15.2688 -+  int n_ov = 0;
 15.2689 -+
 15.2690 -+  ffi_type **ptr;
 15.2691 -+  int i;
 15.2692 -+
 15.2693 -+  /* Determine return value handling.  */ 
 15.2694 -+
 15.2695 -+  switch (cif->rtype->type)
 15.2696 -+    {
 15.2697 -+      /* Void is easy.  */
 15.2698 -+      case FFI_TYPE_VOID:
 15.2699 -+	cif->flags = FFI390_RET_VOID;
 15.2700 -+	break;
 15.2701 -+
 15.2702 -+      /* Structures are returned via a hidden pointer.  */
 15.2703 -+      case FFI_TYPE_STRUCT:
 15.2704 -+	cif->flags = FFI390_RET_STRUCT;
 15.2705 -+	n_gpr++;  /* We need one GPR to pass the pointer.  */
 15.2706 -+	break; 
 15.2707 -+
 15.2708 -+      /* Floating point values are returned in fpr 0.  */
 15.2709 -+      case FFI_TYPE_FLOAT:
 15.2710 -+	cif->flags = FFI390_RET_FLOAT;
 15.2711 -+	break;
 15.2712 -+
 15.2713 -+      case FFI_TYPE_DOUBLE:
 15.2714 -+	cif->flags = FFI390_RET_DOUBLE;
 15.2715 -+	break;
 15.2716 -+
 15.2717 -+      /* Integer values are returned in gpr 2 (and gpr 3
 15.2718 -+	 for 64-bit values on 31-bit machines).  */
 15.2719 -+      case FFI_TYPE_UINT64:
 15.2720 -+      case FFI_TYPE_SINT64:
 15.2721 -+	cif->flags = FFI390_RET_INT64;
 15.2722 -+	break;
 15.2723 -+
 15.2724 -+      case FFI_TYPE_POINTER:
 15.2725 -+      case FFI_TYPE_INT:
 15.2726 -+      case FFI_TYPE_UINT32:
 15.2727 -+      case FFI_TYPE_SINT32:
 15.2728 -+      case FFI_TYPE_UINT16:
 15.2729 -+      case FFI_TYPE_SINT16:
 15.2730 -+      case FFI_TYPE_UINT8:
 15.2731 -+      case FFI_TYPE_SINT8:
 15.2732 -+	/* These are to be extended to word size.  */
 15.2733 -+#ifdef __s390x__
 15.2734 -+	cif->flags = FFI390_RET_INT64;
 15.2735 -+#else
 15.2736 -+	cif->flags = FFI390_RET_INT32;
 15.2737 -+#endif
 15.2738 -+	break;
 15.2739 -+ 
 15.2740 -+      default:
 15.2741 -+        FFI_ASSERT (0);
 15.2742 -+        break;
 15.2743 -+    }
 15.2744 -+
 15.2745 -+  /* Now for the arguments.  */
 15.2746 -+ 
 15.2747 -+  for (ptr = cif->arg_types, i = cif->nargs;
 15.2748 -+       i > 0;
 15.2749 -+       i--, ptr++)
 15.2750 -+    {
 15.2751 -+      int type = (*ptr)->type;
 15.2752 -+
 15.2753 -+      /* Check how a structure type is passed.  */
 15.2754 -+      if (type == FFI_TYPE_STRUCT)
 15.2755 -+	{
 15.2756 -+	  type = ffi_check_struct_type (*ptr);
 15.2757 -+
 15.2758 -+	  /* If we pass the struct via pointer, we must reserve space
 15.2759 -+	     to copy its data for proper call-by-value semantics.  */
 15.2760 -+	  if (type == FFI_TYPE_POINTER)
 15.2761 -+	    struct_size += ROUND_SIZE ((*ptr)->size);
 15.2762 -+	}
 15.2763 -+
 15.2764 -+      /* Now handle all primitive int/float data types.  */
 15.2765 -+      switch (type) 
 15.2766 -+	{
 15.2767 -+	  /* The first MAX_FPRARGS floating point arguments
 15.2768 -+	     go in FPRs, the rest overflow to the stack.  */
 15.2769 -+
 15.2770 -+	  case FFI_TYPE_DOUBLE:
 15.2771 -+	    if (n_fpr < MAX_FPRARGS)
 15.2772 -+	      n_fpr++;
 15.2773 -+	    else
 15.2774 -+	      n_ov += sizeof (double) / sizeof (long);
 15.2775 -+	    break;
 15.2776 -+	
 15.2777 -+	  case FFI_TYPE_FLOAT:
 15.2778 -+	    if (n_fpr < MAX_FPRARGS)
 15.2779 -+	      n_fpr++;
 15.2780 -+	    else
 15.2781 -+	      n_ov++;
 15.2782 -+	    break;
 15.2783 -+
 15.2784 -+	  /* On 31-bit machines, 64-bit integers are passed in GPR pairs,
 15.2785 -+	     if one is still available, or else on the stack.  If only one
 15.2786 -+	     register is free, skip the register (it won't be used for any 
 15.2787 -+	     subsequent argument either).  */
 15.2788 -+	      
 15.2789 -+#ifndef __s390x__
 15.2790 -+	  case FFI_TYPE_UINT64:
 15.2791 -+	  case FFI_TYPE_SINT64:
 15.2792 -+	    if (n_gpr == MAX_GPRARGS-1)
 15.2793 -+	      n_gpr = MAX_GPRARGS;
 15.2794 -+	    if (n_gpr < MAX_GPRARGS)
 15.2795 -+	      n_gpr += 2;
 15.2796 -+	    else
 15.2797 -+	      n_ov += 2;
 15.2798 -+	    break;
 15.2799 -+#endif
 15.2800 -+
 15.2801 -+	  /* Everything else is passed in GPRs (until MAX_GPRARGS
 15.2802 -+	     have been used) or overflows to the stack.  */
 15.2803 -+
 15.2804 -+	  default: 
 15.2805 -+	    if (n_gpr < MAX_GPRARGS)
 15.2806 -+	      n_gpr++;
 15.2807 -+	    else
 15.2808 -+	      n_ov++;
 15.2809 -+	    break;
 15.2810 -+        }
 15.2811 -+    }
 15.2812 -+
 15.2813 -+  /* Total stack space as required for overflow arguments
 15.2814 -+     and temporary structure copies.  */
 15.2815 -+
 15.2816 -+  cif->bytes = ROUND_SIZE (n_ov * sizeof (long)) + struct_size;
 15.2817 -+ 
 15.2818 -+  return FFI_OK;
 15.2819 -+}
 15.2820 -+ 
 15.2821 -+/*======================== End of Routine ============================*/
 15.2822 -+ 
 15.2823 -+/*====================================================================*/
 15.2824 -+/*                                                                    */
 15.2825 -+/* Name     - ffi_call.                                               */
 15.2826 -+/*                                                                    */
 15.2827 -+/* Function - Call the FFI routine.                                   */
 15.2828 -+/*                                                                    */
 15.2829 -+/*====================================================================*/
 15.2830 -+ 
 15.2831 -+void
 15.2832 -+ffi_call(ffi_cif *cif,
 15.2833 -+	 void (*fn)(),
 15.2834 -+	 void *rvalue,
 15.2835 -+	 void **avalue)
 15.2836 -+{
 15.2837 -+  int ret_type = cif->flags;
 15.2838 -+  extended_cif ecif;
 15.2839 -+ 
 15.2840 -+  ecif.cif    = cif;
 15.2841 -+  ecif.avalue = avalue;
 15.2842 -+  ecif.rvalue = rvalue;
 15.2843 -+
 15.2844 -+  /* If we don't have a return value, we need to fake one.  */
 15.2845 -+  if (rvalue == NULL)
 15.2846 -+    {
 15.2847 -+      if (ret_type == FFI390_RET_STRUCT)
 15.2848 -+	ecif.rvalue = alloca (cif->rtype->size);
 15.2849 -+      else
 15.2850 -+	ret_type = FFI390_RET_VOID;
 15.2851 -+    } 
 15.2852 -+
 15.2853 -+  switch (cif->abi)
 15.2854 -+    {
 15.2855 -+      case FFI_SYSV:
 15.2856 -+        ffi_call_SYSV (cif->bytes, &ecif, ffi_prep_args,
 15.2857 -+		       ret_type, ecif.rvalue, fn);
 15.2858 -+        break;
 15.2859 -+ 
 15.2860 -+      default:
 15.2861 -+        FFI_ASSERT (0);
 15.2862 -+        break;
 15.2863 -+    }
 15.2864 -+}
 15.2865 -+ 
 15.2866 -+/*======================== End of Routine ============================*/
 15.2867 -+
 15.2868 -+/*====================================================================*/
 15.2869 -+/*                                                                    */
 15.2870 -+/* Name     - ffi_closure_helper_SYSV.                                */
 15.2871 -+/*                                                                    */
 15.2872 -+/* Function - Call a FFI closure target function.                     */
 15.2873 -+/*                                                                    */
 15.2874 -+/*====================================================================*/
 15.2875 -+ 
 15.2876 -+void
 15.2877 -+ffi_closure_helper_SYSV (ffi_closure *closure,
 15.2878 -+			 unsigned long *p_gpr,
 15.2879 -+			 unsigned long long *p_fpr,
 15.2880 -+			 unsigned long *p_ov)
 15.2881 -+{
 15.2882 -+  unsigned long long ret_buffer;
 15.2883 -+
 15.2884 -+  void *rvalue = &ret_buffer;
 15.2885 -+  void **avalue;
 15.2886 -+  void **p_arg;
 15.2887 -+
 15.2888 -+  int n_gpr = 0;
 15.2889 -+  int n_fpr = 0;
 15.2890 -+  int n_ov = 0;
 15.2891 -+
 15.2892 -+  ffi_type **ptr;
 15.2893 -+  int i;
 15.2894 -+
 15.2895 -+  /* Allocate buffer for argument list pointers.  */
 15.2896 -+
 15.2897 -+  p_arg = avalue = alloca (closure->cif->nargs * sizeof (void *));
 15.2898 -+
 15.2899 -+  /* If we returning a structure, pass the structure address 
 15.2900 -+     directly to the target function.  Otherwise, have the target 
 15.2901 -+     function store the return value to the GPR save area.  */
 15.2902 -+
 15.2903 -+  if (closure->cif->flags == FFI390_RET_STRUCT)
 15.2904 -+    rvalue = (void *) p_gpr[n_gpr++];
 15.2905 -+
 15.2906 -+  /* Now for the arguments.  */
 15.2907 -+
 15.2908 -+  for (ptr = closure->cif->arg_types, i = closure->cif->nargs;
 15.2909 -+       i > 0;
 15.2910 -+       i--, p_arg++, ptr++)
 15.2911 -+    {
 15.2912 -+      int deref_struct_pointer = 0;
 15.2913 -+      int type = (*ptr)->type;
 15.2914 -+
 15.2915 -+      /* Check how a structure type is passed.  */
 15.2916 -+      if (type == FFI_TYPE_STRUCT)
 15.2917 -+	{
 15.2918 -+	  type = ffi_check_struct_type (*ptr);
 15.2919 -+
 15.2920 -+	  /* If we pass the struct via pointer, remember to 
 15.2921 -+	     retrieve the pointer later.  */
 15.2922 -+	  if (type == FFI_TYPE_POINTER)
 15.2923 -+	    deref_struct_pointer = 1;
 15.2924 -+	}
 15.2925 -+
 15.2926 -+      /* Pointers are passed like UINTs of the same size.  */
 15.2927 -+      if (type == FFI_TYPE_POINTER)
 15.2928 -+#ifdef __s390x__
 15.2929 -+	type = FFI_TYPE_UINT64;
 15.2930 -+#else
 15.2931 -+	type = FFI_TYPE_UINT32;
 15.2932 -+#endif
 15.2933 -+
 15.2934 -+      /* Now handle all primitive int/float data types.  */
 15.2935 -+      switch (type) 
 15.2936 -+	{
 15.2937 -+	  case FFI_TYPE_DOUBLE:
 15.2938 -+	    if (n_fpr < MAX_FPRARGS)
 15.2939 -+	      *p_arg = &p_fpr[n_fpr++];
 15.2940 -+	    else
 15.2941 -+	      *p_arg = &p_ov[n_ov], 
 15.2942 -+	      n_ov += sizeof (double) / sizeof (long);
 15.2943 -+	    break;
 15.2944 -+	
 15.2945 -+	  case FFI_TYPE_FLOAT:
 15.2946 -+	    if (n_fpr < MAX_FPRARGS)
 15.2947 -+	      *p_arg = &p_fpr[n_fpr++];
 15.2948 -+	    else
 15.2949 -+	      *p_arg = (char *)&p_ov[n_ov++] + sizeof (long) - 4;
 15.2950 -+	    break;
 15.2951 -+ 
 15.2952 -+	  case FFI_TYPE_UINT64:
 15.2953 -+	  case FFI_TYPE_SINT64:
 15.2954 -+#ifdef __s390x__
 15.2955 -+	    if (n_gpr < MAX_GPRARGS)
 15.2956 -+	      *p_arg = &p_gpr[n_gpr++];
 15.2957 -+	    else
 15.2958 -+	      *p_arg = &p_ov[n_ov++];
 15.2959 -+#else
 15.2960 -+	    if (n_gpr == MAX_GPRARGS-1)
 15.2961 -+	      n_gpr = MAX_GPRARGS;
 15.2962 -+	    if (n_gpr < MAX_GPRARGS)
 15.2963 -+	      *p_arg = &p_gpr[n_gpr], n_gpr += 2;
 15.2964 -+	    else
 15.2965 -+	      *p_arg = &p_ov[n_ov], n_ov += 2;
 15.2966 -+#endif
 15.2967 -+	    break;
 15.2968 -+ 
 15.2969 -+	  case FFI_TYPE_INT:
 15.2970 -+	  case FFI_TYPE_UINT32:
 15.2971 -+	  case FFI_TYPE_SINT32:
 15.2972 -+	    if (n_gpr < MAX_GPRARGS)
 15.2973 -+	      *p_arg = (char *)&p_gpr[n_gpr++] + sizeof (long) - 4;
 15.2974 -+	    else
 15.2975 -+	      *p_arg = (char *)&p_ov[n_ov++] + sizeof (long) - 4;
 15.2976 -+	    break;
 15.2977 -+ 
 15.2978 -+	  case FFI_TYPE_UINT16:
 15.2979 -+	  case FFI_TYPE_SINT16:
 15.2980 -+	    if (n_gpr < MAX_GPRARGS)
 15.2981 -+	      *p_arg = (char *)&p_gpr[n_gpr++] + sizeof (long) - 2;
 15.2982 -+	    else
 15.2983 -+	      *p_arg = (char *)&p_ov[n_ov++] + sizeof (long) - 2;
 15.2984 -+	    break;
 15.2985 -+
 15.2986 -+	  case FFI_TYPE_UINT8:
 15.2987 -+	  case FFI_TYPE_SINT8:
 15.2988 -+	    if (n_gpr < MAX_GPRARGS)
 15.2989 -+	      *p_arg = (char *)&p_gpr[n_gpr++] + sizeof (long) - 1;
 15.2990 -+	    else
 15.2991 -+	      *p_arg = (char *)&p_ov[n_ov++] + sizeof (long) - 1;
 15.2992 -+	    break;
 15.2993 -+ 
 15.2994 -+	  default:
 15.2995 -+	    FFI_ASSERT (0);
 15.2996 -+	    break;
 15.2997 -+        }
 15.2998 -+
 15.2999 -+      /* If this is a struct passed via pointer, we need to
 15.3000 -+	 actually retrieve that pointer.  */
 15.3001 -+      if (deref_struct_pointer)
 15.3002 -+	*p_arg = *(void **)*p_arg;
 15.3003 -+    }
 15.3004 -+
 15.3005 -+
 15.3006 -+  /* Call the target function.  */
 15.3007 -+  (closure->fun) (closure->cif, rvalue, avalue, closure->user_data);
 15.3008 -+
 15.3009 -+  /* Convert the return value.  */
 15.3010 -+  switch (closure->cif->rtype->type)
 15.3011 -+    {
 15.3012 -+      /* Void is easy, and so is struct.  */
 15.3013 -+      case FFI_TYPE_VOID:
 15.3014 -+      case FFI_TYPE_STRUCT:
 15.3015 -+	break;
 15.3016 -+
 15.3017 -+      /* Floating point values are returned in fpr 0.  */
 15.3018 -+      case FFI_TYPE_FLOAT:
 15.3019 -+	p_fpr[0] = (long long) *(unsigned int *) rvalue << 32;
 15.3020 -+	break;
 15.3021 -+
 15.3022 -+      case FFI_TYPE_DOUBLE:
 15.3023 -+	p_fpr[0] = *(unsigned long long *) rvalue;
 15.3024 -+	break;
 15.3025 -+
 15.3026 -+      /* Integer values are returned in gpr 2 (and gpr 3
 15.3027 -+	 for 64-bit values on 31-bit machines).  */
 15.3028 -+      case FFI_TYPE_UINT64:
 15.3029 -+      case FFI_TYPE_SINT64:
 15.3030 -+#ifdef __s390x__
 15.3031 -+	p_gpr[0] = *(unsigned long *) rvalue;
 15.3032 -+#else
 15.3033 -+	p_gpr[0] = ((unsigned long *) rvalue)[0],
 15.3034 -+	p_gpr[1] = ((unsigned long *) rvalue)[1];
 15.3035 -+#endif
 15.3036 -+	break;
 15.3037 -+
 15.3038 -+      case FFI_TYPE_POINTER:
 15.3039 -+      case FFI_TYPE_UINT32:
 15.3040 -+      case FFI_TYPE_UINT16:
 15.3041 -+      case FFI_TYPE_UINT8:
 15.3042 -+	p_gpr[0] = *(unsigned long *) rvalue;
 15.3043 -+	break;
 15.3044 -+
 15.3045 -+      case FFI_TYPE_INT:
 15.3046 -+      case FFI_TYPE_SINT32:
 15.3047 -+      case FFI_TYPE_SINT16:
 15.3048 -+      case FFI_TYPE_SINT8:
 15.3049 -+	p_gpr[0] = *(signed long *) rvalue;
 15.3050 -+	break;
 15.3051 -+
 15.3052 -+      default:
 15.3053 -+        FFI_ASSERT (0);
 15.3054 -+        break;
 15.3055 -+    }
 15.3056 -+}
 15.3057 -+ 
 15.3058 -+/*======================== End of Routine ============================*/
 15.3059 -+
 15.3060 -+/*====================================================================*/
 15.3061 -+/*                                                                    */
 15.3062 -+/* Name     - ffi_prep_closure.                                       */
 15.3063 -+/*                                                                    */
 15.3064 -+/* Function - Prepare a FFI closure.                                  */
 15.3065 -+/*                                                                    */
 15.3066 -+/*====================================================================*/
 15.3067 -+ 
 15.3068 -+ffi_status
 15.3069 -+ffi_prep_closure (ffi_closure *closure,
 15.3070 -+                  ffi_cif *cif,
 15.3071 -+                  void (*fun) (ffi_cif *, void *, void **, void *),
 15.3072 -+                  void *user_data)
 15.3073 -+{
 15.3074 -+  FFI_ASSERT (cif->abi == FFI_SYSV);
 15.3075 -+
 15.3076 -+#ifndef __s390x__
 15.3077 -+  *(short *)&closure->tramp [0] = 0x0d10;   /* basr %r1,0 */
 15.3078 -+  *(short *)&closure->tramp [2] = 0x9801;   /* lm %r0,%r1,6(%r1) */
 15.3079 -+  *(short *)&closure->tramp [4] = 0x1006;
 15.3080 -+  *(short *)&closure->tramp [6] = 0x07f1;   /* br %r1 */
 15.3081 -+  *(long  *)&closure->tramp [8] = (long)closure;
 15.3082 -+  *(long  *)&closure->tramp[12] = (long)&ffi_closure_SYSV;
 15.3083 -+#else
 15.3084 -+  *(short *)&closure->tramp [0] = 0x0d10;   /* basr %r1,0 */
 15.3085 -+  *(short *)&closure->tramp [2] = 0xeb01;   /* lmg %r0,%r1,14(%r1) */
 15.3086 -+  *(short *)&closure->tramp [4] = 0x100e;
 15.3087 -+  *(short *)&closure->tramp [6] = 0x0004;
 15.3088 -+  *(short *)&closure->tramp [8] = 0x07f1;   /* br %r1 */
 15.3089 -+  *(long  *)&closure->tramp[16] = (long)closure;
 15.3090 -+  *(long  *)&closure->tramp[24] = (long)&ffi_closure_SYSV;
 15.3091 -+#endif 
 15.3092 -+ 
 15.3093 -+  closure->cif = cif;
 15.3094 -+  closure->user_data = user_data;
 15.3095 -+  closure->fun = fun;
 15.3096 -+ 
 15.3097 -+  return FFI_OK;
 15.3098 -+}
 15.3099 -+
 15.3100 -+/*======================== End of Routine ============================*/
 15.3101 -+ 
 15.3102 -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/s390/sysv.S gcc/libffi/src/s390/sysv.S
 15.3103 ---- gcc-3.2.2.orig/libffi/src/s390/sysv.S	Thu Jan  1 09:00:00 1970
 15.3104 -+++ gcc/libffi/src/s390/sysv.S	Thu Nov 28 01:44:35 2002
 15.3105 -@@ -0,0 +1,425 @@
 15.3106 -+/* -----------------------------------------------------------------------
 15.3107 -+   sysv.S - Copyright (c) 2000 Software AG
 15.3108 -+ 
 15.3109 -+   S390 Foreign Function Interface
 15.3110 -+ 
 15.3111 -+   Permission is hereby granted, free of charge, to any person obtaining
 15.3112 -+   a copy of this software and associated documentation files (the
 15.3113 -+   ``Software''), to deal in the Software without restriction, including
 15.3114 -+   without limitation the rights to use, copy, modify, merge, publish,
 15.3115 -+   distribute, sublicense, and/or sell copies of the Software, and to
 15.3116 -+   permit persons to whom the Software is furnished to do so, subject to
 15.3117 -+   the following conditions:
 15.3118 -+ 
 15.3119 -+   The above copyright notice and this permission notice shall be included
 15.3120 -+   in all copies or substantial portions of the Software.
 15.3121 -+ 
 15.3122 -+   THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
 15.3123 -+   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 15.3124 -+   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 15.3125 -+   IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR
 15.3126 -+   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 15.3127 -+   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 15.3128 -+   OTHER DEALINGS IN THE SOFTWARE.
 15.3129 -+   ----------------------------------------------------------------------- */
 15.3130 -+
 15.3131 -+#ifndef __s390x__
 15.3132 -+ 
 15.3133 -+.text
 15.3134 -+
 15.3135 -+	# r2:	cif->bytes
 15.3136 -+	# r3:	&ecif
 15.3137 -+	# r4:	ffi_prep_args
 15.3138 -+	# r5:	ret_type
 15.3139 -+	# r6:	ecif.rvalue
 15.3140 -+	# ov:	fn 
 15.3141 -+ 
 15.3142 -+	# This assumes we are using gas.
 15.3143 -+	.globl	ffi_call_SYSV
 15.3144 -+	.type	ffi_call_SYSV,%function
 15.3145 -+ffi_call_SYSV:
 15.3146 -+.LFB1:
 15.3147 -+	stm	%r6,%r15,24(%r15)		# Save registers
 15.3148 -+.LCFI0:
 15.3149 -+	basr	%r13,0				# Set up base register
 15.3150 -+.Lbase:
 15.3151 -+	lr	%r11,%r15			# Set up frame pointer
 15.3152 -+.LCFI1:
 15.3153 -+	sr	%r15,%r2
 15.3154 -+	ahi	%r15,-96-48			# Allocate stack
 15.3155 -+	lr	%r8,%r6				# Save ecif.rvalue
 15.3156 -+	sr	%r9,%r9
 15.3157 -+	ic	%r9,.Ltable-.Lbase(%r13,%r5)	# Load epilog address
 15.3158 -+	l	%r7,96(%r11)			# Load function address
 15.3159 -+	st	%r11,0(%r15)			# Set up back chain
 15.3160 -+	ahi	%r11,-48			# Register save area
 15.3161 -+.LCFI2:
 15.3162 -+
 15.3163 -+	la	%r2,96(%r15)			# Save area
 15.3164 -+						# r3 already holds &ecif
 15.3165 -+	basr	%r14,%r4			# Call ffi_prep_args
 15.3166 -+
 15.3167 -+	lm	%r2,%r6,0(%r11)			# Load arguments
 15.3168 -+	ld	%f0,32(%r11)
 15.3169 -+	ld	%f2,40(%r11)
 15.3170 -+	la	%r14,0(%r13,%r9)		# Set return address
 15.3171 -+	br	%r7				# ... and call function
 15.3172 -+
 15.3173 -+.LretNone:					# Return void
 15.3174 -+	l	%r4,48+56(%r11)
 15.3175 -+	lm	%r6,%r15,48+24(%r11)
 15.3176 -+	br	%r4
 15.3177 -+
 15.3178 -+.LretFloat:
 15.3179 -+	l	%r4,48+56(%r11)
 15.3180 -+	ste	%f0,0(%r8)			# Return float
 15.3181 -+	lm	%r6,%r15,48+24(%r11)
 15.3182 -+	br	%r4
 15.3183 -+ 
 15.3184 -+.LretDouble:
 15.3185 -+	l	%r4,48+56(%r11)
 15.3186 -+	std	%f0,0(%r8)			# Return double
 15.3187 -+	lm	%r6,%r15,48+24(%r11)
 15.3188 -+	br	%r4
 15.3189 -+
 15.3190 -+.LretInt32:
 15.3191 -+	l	%r4,48+56(%r11)
 15.3192 -+	st	%r2,0(%r8)			# Return int
 15.3193 -+	lm	%r6,%r15,48+24(%r11)
 15.3194 -+	br	%r4
 15.3195 -+ 
 15.3196 -+.LretInt64:
 15.3197 -+	l	%r4,48+56(%r11)
 15.3198 -+	stm	%r2,%r3,0(%r8)			# Return long long
 15.3199 -+	lm	%r6,%r15,48+24(%r11)
 15.3200 -+	br	%r4
 15.3201 -+ 
 15.3202 -+.Ltable:
 15.3203 -+	.byte	.LretNone-.Lbase		# FFI390_RET_VOID
 15.3204 -+	.byte	.LretNone-.Lbase		# FFI390_RET_STRUCT
 15.3205 -+	.byte	.LretFloat-.Lbase		# FFI390_RET_FLOAT
 15.3206 -+	.byte	.LretDouble-.Lbase		# FFI390_RET_DOUBLE
 15.3207 -+	.byte	.LretInt32-.Lbase		# FFI390_RET_INT32
 15.3208 -+	.byte	.LretInt64-.Lbase		# FFI390_RET_INT64
 15.3209 -+
 15.3210 -+.LFE1: 
 15.3211 -+.ffi_call_SYSV_end:
 15.3212 -+	.size	 ffi_call_SYSV,.ffi_call_SYSV_end-ffi_call_SYSV
 15.3213 -+
 15.3214 -+
 15.3215 -+	.globl	ffi_closure_SYSV
 15.3216 -+	.type	ffi_closure_SYSV,%function
 15.3217 -+ffi_closure_SYSV:
 15.3218 -+.LFB2:
 15.3219 -+	stm	%r12,%r15,48(%r15)		# Save registers
 15.3220 -+.LCFI10:
 15.3221 -+	basr	%r13,0				# Set up base register
 15.3222 -+.Lcbase:
 15.3223 -+	stm	%r2,%r6,8(%r15)			# Save arguments
 15.3224 -+	std	%f0,64(%r15)
 15.3225 -+	std	%f2,72(%r15)
 15.3226 -+	lr	%r1,%r15			# Set up stack frame
 15.3227 -+	ahi	%r15,-96
 15.3228 -+.LCFI11:
 15.3229 -+	l	%r12,.Lchelper-.Lcbase(%r13)	# Get helper function
 15.3230 -+	lr	%r2,%r0				# Closure
 15.3231 -+	la	%r3,8(%r1)			# GPRs
 15.3232 -+	la	%r4,64(%r1)			# FPRs
 15.3233 -+	la	%r5,96(%r1)			# Overflow
 15.3234 -+	st	%r1,0(%r15)			# Set up back chain
 15.3235 -+
 15.3236 -+	bas	%r14,0(%r12,%r13)		# Call helper
 15.3237 -+
 15.3238 -+	l	%r4,96+56(%r15)
 15.3239 -+	ld	%f0,96+64(%r15)			# Load return registers
 15.3240 -+	lm	%r2,%r3,96+8(%r15)
 15.3241 -+	lm	%r12,%r15,96+48(%r15)
 15.3242 -+	br	%r4
 15.3243 -+
 15.3244 -+	.align 4
 15.3245 -+.Lchelper:
 15.3246 -+	.long	ffi_closure_helper_SYSV-.Lcbase
 15.3247 -+
 15.3248 -+.LFE2: 
 15.3249 -+
 15.3250 -+.ffi_closure_SYSV_end:
 15.3251 -+	.size	 ffi_closure_SYSV,.ffi_closure_SYSV_end-ffi_closure_SYSV
 15.3252 -+
 15.3253 -+
 15.3254 -+	.section	.eh_frame,"a",@progbits
 15.3255 -+.Lframe1:
 15.3256 -+	.4byte	.LECIE1-.LSCIE1	# Length of Common Information Entry
 15.3257 -+.LSCIE1:
 15.3258 -+	.4byte	0x0	# CIE Identifier Tag
 15.3259 -+	.byte	0x1	# CIE Version
 15.3260 -+	.ascii "zR\0"	# CIE Augmentation
 15.3261 -+	.uleb128 0x1	# CIE Code Alignment Factor
 15.3262 -+	.sleb128 -4	# CIE Data Alignment Factor
 15.3263 -+	.byte	0xe	# CIE RA Column
 15.3264 -+	.uleb128 0x1	# Augmentation size
 15.3265 -+	.byte	0x1b	# FDE Encoding (pcrel sdata4)
 15.3266 -+	.byte	0xc	# DW_CFA_def_cfa
 15.3267 -+	.uleb128 0xf
 15.3268 -+	.uleb128 0x60
 15.3269 -+	.align	4
 15.3270 -+.LECIE1:
 15.3271 -+.LSFDE1:
 15.3272 -+	.4byte	.LEFDE1-.LASFDE1	# FDE Length
 15.3273 -+.LASFDE1:
 15.3274 -+	.4byte	.LASFDE1-.Lframe1	# FDE CIE offset
 15.3275 -+	.4byte	.LFB1-.	# FDE initial location
 15.3276 -+	.4byte	.LFE1-.LFB1	# FDE address range
 15.3277 -+	.uleb128 0x0	# Augmentation size
 15.3278 -+	.byte	0x4	# DW_CFA_advance_loc4
 15.3279 -+	.4byte	.LCFI0-.LFB1
 15.3280 -+	.byte	0x8f	# DW_CFA_offset, column 0xf
 15.3281 -+	.uleb128 0x9
 15.3282 -+	.byte	0x8e	# DW_CFA_offset, column 0xe
 15.3283 -+	.uleb128 0xa
 15.3284 -+	.byte	0x8d	# DW_CFA_offset, column 0xd
 15.3285 -+	.uleb128 0xb
 15.3286 -+	.byte	0x8c	# DW_CFA_offset, column 0xc
 15.3287 -+	.uleb128 0xc
 15.3288 -+	.byte	0x8b	# DW_CFA_offset, column 0xb
 15.3289 -+	.uleb128 0xd
 15.3290 -+	.byte	0x8a	# DW_CFA_offset, column 0xa
 15.3291 -+	.uleb128 0xe
 15.3292 -+	.byte	0x89	# DW_CFA_offset, column 0x9
 15.3293 -+	.uleb128 0xf
 15.3294 -+	.byte	0x88	# DW_CFA_offset, column 0x8
 15.3295 -+	.uleb128 0x10
 15.3296 -+	.byte	0x87	# DW_CFA_offset, column 0x7
 15.3297 -+	.uleb128 0x11
 15.3298 -+	.byte	0x86	# DW_CFA_offset, column 0x6
 15.3299 -+	.uleb128 0x12
 15.3300 -+	.byte	0x4	# DW_CFA_advance_loc4
 15.3301 -+	.4byte	.LCFI1-.LCFI0
 15.3302 -+	.byte	0xd	# DW_CFA_def_cfa_register
 15.3303 -+	.uleb128 0xb
 15.3304 -+	.byte	0x4	# DW_CFA_advance_loc4
 15.3305 -+	.4byte	.LCFI2-.LCFI1
 15.3306 -+	.byte	0xe	# DW_CFA_def_cfa_offset
 15.3307 -+	.uleb128 0x90
 15.3308 -+	.align	4
 15.3309 -+.LEFDE1:
 15.3310 -+.LSFDE2:
 15.3311 -+	.4byte	.LEFDE2-.LASFDE2	# FDE Length
 15.3312 -+.LASFDE2:
 15.3313 -+	.4byte	.LASFDE2-.Lframe1	# FDE CIE offset
 15.3314 -+	.4byte	.LFB2-.	# FDE initial location
 15.3315 -+	.4byte	.LFE2-.LFB2	# FDE address range
 15.3316 -+	.uleb128 0x0	# Augmentation size
 15.3317 -+	.byte	0x4	# DW_CFA_advance_loc4
 15.3318 -+	.4byte	.LCFI10-.LFB2
 15.3319 -+	.byte	0x8f	# DW_CFA_offset, column 0xf
 15.3320 -+	.uleb128 0x9
 15.3321 -+	.byte	0x8e	# DW_CFA_offset, column 0xe
 15.3322 -+	.uleb128 0xa
 15.3323 -+	.byte	0x8d	# DW_CFA_offset, column 0xd
 15.3324 -+	.uleb128 0xb
 15.3325 -+	.byte	0x8c	# DW_CFA_offset, column 0xc
 15.3326 -+	.uleb128 0xc
 15.3327 -+	.byte	0x4	# DW_CFA_advance_loc4
 15.3328 -+	.4byte	.LCFI11-.LCFI10
 15.3329 -+	.byte	0xe	# DW_CFA_def_cfa_offset
 15.3330 -+	.uleb128 0xc0
 15.3331 -+	.align	4
 15.3332 -+.LEFDE2:
 15.3333 -+
 15.3334 -+#else
 15.3335 -+ 
 15.3336 -+.text
 15.3337 -+ 
 15.3338 -+	# r2:	cif->bytes
 15.3339 -+	# r3:	&ecif
 15.3340 -+	# r4:	ffi_prep_args
 15.3341 -+	# r5:	ret_type
 15.3342 -+	# r6:	ecif.rvalue
 15.3343 -+	# ov:	fn 
 15.3344 -+ 
 15.3345 -+	# This assumes we are using gas.
 15.3346 -+	.globl	ffi_call_SYSV
 15.3347 -+	.type	ffi_call_SYSV,%function
 15.3348 -+ffi_call_SYSV:
 15.3349 -+.LFB1:
 15.3350 -+	stmg	%r6,%r15,48(%r15)		# Save registers
 15.3351 -+.LCFI0:
 15.3352 -+	larl	%r13,.Lbase			# Set up base register
 15.3353 -+	lgr	%r11,%r15			# Set up frame pointer
 15.3354 -+.LCFI1:
 15.3355 -+	sgr	%r15,%r2
 15.3356 -+	aghi	%r15,-160-80			# Allocate stack
 15.3357 -+	lgr	%r8,%r6				# Save ecif.rvalue
 15.3358 -+	llgc	%r9,.Ltable-.Lbase(%r13,%r5)	# Load epilog address
 15.3359 -+	lg	%r7,160(%r11)			# Load function address
 15.3360 -+	stg	%r11,0(%r15)			# Set up back chain
 15.3361 -+	aghi	%r11,-80			# Register save area
 15.3362 -+.LCFI2:
 15.3363 -+
 15.3364 -+	la	%r2,160(%r15)			# Save area
 15.3365 -+						# r3 already holds &ecif
 15.3366 -+	basr	%r14,%r4			# Call ffi_prep_args
 15.3367 -+
 15.3368 -+	lmg	%r2,%r6,0(%r11)			# Load arguments
 15.3369 -+	ld	%f0,48(%r11)
 15.3370 -+	ld	%f2,56(%r11)
 15.3371 -+	ld	%f4,64(%r11)
 15.3372 -+	ld	%f6,72(%r11)
 15.3373 -+	la	%r14,0(%r13,%r9)		# Set return address
 15.3374 -+	br	%r7				# ... and call function
 15.3375 -+
 15.3376 -+.Lbase:
 15.3377 -+.LretNone:					# Return void
 15.3378 -+	lg	%r4,80+112(%r11)
 15.3379 -+	lmg	%r6,%r15,80+48(%r11)
 15.3380 -+	br	%r4
 15.3381 -+
 15.3382 -+.LretFloat:
 15.3383 -+	lg	%r4,80+112(%r11)
 15.3384 -+	ste	%f0,0(%r8)			# Return float
 15.3385 -+	lmg	%r6,%r15,80+48(%r11)
 15.3386 -+	br	%r4
 15.3387 -+ 
 15.3388 -+.LretDouble:
 15.3389 -+	lg	%r4,80+112(%r11)
 15.3390 -+	std	%f0,0(%r8)			# Return double
 15.3391 -+	lmg	%r6,%r15,80+48(%r11)
 15.3392 -+	br	%r4
 15.3393 -+
 15.3394 -+.LretInt32:
 15.3395 -+	lg	%r4,80+112(%r11)
 15.3396 -+	st	%r2,0(%r8)			# Return int
 15.3397 -+	lmg	%r6,%r15,80+48(%r11)
 15.3398 -+	br	%r4
 15.3399 -+ 
 15.3400 -+.LretInt64:
 15.3401 -+	lg	%r4,80+112(%r11)
 15.3402 -+	stg	%r2,0(%r8)			# Return long
 15.3403 -+	lmg	%r6,%r15,80+48(%r11)
 15.3404 -+	br	%r4
 15.3405 -+ 
 15.3406 -+.Ltable:
 15.3407 -+	.byte	.LretNone-.Lbase		# FFI390_RET_VOID
 15.3408 -+	.byte	.LretNone-.Lbase		# FFI390_RET_STRUCT
 15.3409 -+	.byte	.LretFloat-.Lbase		# FFI390_RET_FLOAT
 15.3410 -+	.byte	.LretDouble-.Lbase		# FFI390_RET_DOUBLE
 15.3411 -+	.byte	.LretInt32-.Lbase		# FFI390_RET_INT32
 15.3412 -+	.byte	.LretInt64-.Lbase		# FFI390_RET_INT64
 15.3413 -+
 15.3414 -+.LFE1: 
 15.3415 -+.ffi_call_SYSV_end:
 15.3416 -+	.size	 ffi_call_SYSV,.ffi_call_SYSV_end-ffi_call_SYSV
 15.3417 -+
 15.3418 -+
 15.3419 -+	.globl	ffi_closure_SYSV
 15.3420 -+	.type	ffi_closure_SYSV,%function
 15.3421 -+ffi_closure_SYSV:
 15.3422 -+.LFB2:
 15.3423 -+	stmg	%r14,%r15,112(%r15)		# Save registers
 15.3424 -+.LCFI10:
 15.3425 -+	stmg	%r2,%r6,16(%r15)		# Save arguments
 15.3426 -+	std	%f0,128(%r15)
 15.3427 -+	std	%f2,136(%r15)
 15.3428 -+	std	%f4,144(%r15)
 15.3429 -+	std	%f6,152(%r15)
 15.3430 -+	lgr	%r1,%r15			# Set up stack frame
 15.3431 -+	aghi	%r15,-160
 15.3432 -+.LCFI11:
 15.3433 -+	lgr	%r2,%r0				# Closure
 15.3434 -+	la	%r3,16(%r1)			# GPRs
 15.3435 -+	la	%r4,128(%r1)			# FPRs
 15.3436 -+	la	%r5,160(%r1)			# Overflow
 15.3437 -+	stg	%r1,0(%r15)			# Set up back chain
 15.3438 -+
 15.3439 -+	brasl	%r14,ffi_closure_helper_SYSV	# Call helper
 15.3440 -+
 15.3441 -+	lg	%r14,160+112(%r15)
 15.3442 -+	ld	%f0,160+128(%r15)		# Load return registers
 15.3443 -+	lg	%r2,160+16(%r15)
 15.3444 -+	la	%r15,160(%r15)
 15.3445 -+	br	%r14
 15.3446 -+.LFE2: 
 15.3447 -+
 15.3448 -+.ffi_closure_SYSV_end:
 15.3449 -+	.size	 ffi_closure_SYSV,.ffi_closure_SYSV_end-ffi_closure_SYSV
 15.3450 -+
 15.3451 -+
 15.3452 -+
 15.3453 -+	.section	.eh_frame,"a",@progbits
 15.3454 -+.Lframe1:
 15.3455 -+	.4byte	.LECIE1-.LSCIE1	# Length of Common Information Entry
 15.3456 -+.LSCIE1:
 15.3457 -+	.4byte	0x0	# CIE Identifier Tag
 15.3458 -+	.byte	0x1	# CIE Version
 15.3459 -+	.ascii "zR\0"	# CIE Augmentation
 15.3460 -+	.uleb128 0x1	# CIE Code Alignment Factor
 15.3461 -+	.sleb128 -8	# CIE Data Alignment Factor
 15.3462 -+	.byte	0xe	# CIE RA Column
 15.3463 -+	.uleb128 0x1	# Augmentation size
 15.3464 -+	.byte	0x1b	# FDE Encoding (pcrel sdata4)
 15.3465 -+	.byte	0xc	# DW_CFA_def_cfa
 15.3466 -+	.uleb128 0xf
 15.3467 -+	.uleb128 0xa0
 15.3468 -+	.align	8
 15.3469 -+.LECIE1:
 15.3470 -+.LSFDE1:
 15.3471 -+	.4byte	.LEFDE1-.LASFDE1	# FDE Length
 15.3472 -+.LASFDE1:
 15.3473 -+	.4byte	.LASFDE1-.Lframe1	# FDE CIE offset
 15.3474 -+	.4byte	.LFB1-.	# FDE initial location
 15.3475 -+	.4byte	.LFE1-.LFB1	# FDE address range
 15.3476 -+	.uleb128 0x0	# Augmentation size
 15.3477 -+	.byte	0x4	# DW_CFA_advance_loc4
 15.3478 -+	.4byte	.LCFI0-.LFB1
 15.3479 -+	.byte	0x8f	# DW_CFA_offset, column 0xf
 15.3480 -+	.uleb128 0x5
 15.3481 -+	.byte	0x8e	# DW_CFA_offset, column 0xe
 15.3482 -+	.uleb128 0x6
 15.3483 -+	.byte	0x8d	# DW_CFA_offset, column 0xd
 15.3484 -+	.uleb128 0x7
 15.3485 -+	.byte	0x8c	# DW_CFA_offset, column 0xc
 15.3486 -+	.uleb128 0x8
 15.3487 -+	.byte	0x8b	# DW_CFA_offset, column 0xb
 15.3488 -+	.uleb128 0x9
 15.3489 -+	.byte	0x8a	# DW_CFA_offset, column 0xa
 15.3490 -+	.uleb128 0xa
 15.3491 -+	.byte	0x89	# DW_CFA_offset, column 0x9
 15.3492 -+	.uleb128 0xb
 15.3493 -+	.byte	0x88	# DW_CFA_offset, column 0x8
 15.3494 -+	.uleb128 0xc
 15.3495 -+	.byte	0x87	# DW_CFA_offset, column 0x7
 15.3496 -+	.uleb128 0xd
 15.3497 -+	.byte	0x86	# DW_CFA_offset, column 0x6
 15.3498 -+	.uleb128 0xe
 15.3499 -+	.byte	0x4	# DW_CFA_advance_loc4
 15.3500 -+	.4byte	.LCFI1-.LCFI0
 15.3501 -+	.byte	0xd	# DW_CFA_def_cfa_register
 15.3502 -+	.uleb128 0xb
 15.3503 -+	.byte	0x4	# DW_CFA_advance_loc4
 15.3504 -+	.4byte	.LCFI2-.LCFI1
 15.3505 -+	.byte	0xe	# DW_CFA_def_cfa_offset
 15.3506 -+	.uleb128 0xf0
 15.3507 -+	.align	8
 15.3508 -+.LEFDE1:
 15.3509 -+.LSFDE2:
 15.3510 -+	.4byte	.LEFDE2-.LASFDE2	# FDE Length
 15.3511 -+.LASFDE2:
 15.3512 -+	.4byte	.LASFDE2-.Lframe1	# FDE CIE offset
 15.3513 -+	.4byte	.LFB2-.	# FDE initial location
 15.3514 -+	.4byte	.LFE2-.LFB2	# FDE address range
 15.3515 -+	.uleb128 0x0	# Augmentation size
 15.3516 -+	.byte	0x4	# DW_CFA_advance_loc4
 15.3517 -+	.4byte	.LCFI10-.LFB2
 15.3518 -+	.byte	0x8f	# DW_CFA_offset, column 0xf
 15.3519 -+	.uleb128 0x5
 15.3520 -+	.byte	0x8e	# DW_CFA_offset, column 0xe
 15.3521 -+	.uleb128 0x6
 15.3522 -+	.byte	0x4	# DW_CFA_advance_loc4
 15.3523 -+	.4byte	.LCFI11-.LCFI10
 15.3524 -+	.byte	0xe	# DW_CFA_def_cfa_offset
 15.3525 -+	.uleb128 0x140
 15.3526 -+	.align	8
 15.3527 -+.LEFDE2:
 15.3528 -+
 15.3529 -+#endif
 15.3530 -+
 15.3531 -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/sh/ffi.c gcc/libffi/src/sh/ffi.c
 15.3532 ---- gcc-3.2.2.orig/libffi/src/sh/ffi.c	Thu Jan  1 09:00:00 1970
 15.3533 -+++ gcc/libffi/src/sh/ffi.c	Fri Jul 19 10:08:43 2002
 15.3534 -@@ -0,0 +1,722 @@
 15.3535 -+/* -----------------------------------------------------------------------
 15.3536 -+   ffi.c - Copyright (c) 2002 Kaz Kojima
 15.3537 -+   
 15.3538 -+   SuperH Foreign Function Interface 
 15.3539 -+
 15.3540 -+   Permission is hereby granted, free of charge, to any person obtaining
 15.3541 -+   a copy of this software and associated documentation files (the
 15.3542 -+   ``Software''), to deal in the Software without restriction, including
 15.3543 -+   without limitation the rights to use, copy, modify, merge, publish,
 15.3544 -+   distribute, sublicense, and/or sell copies of the Software, and to
 15.3545 -+   permit persons to whom the Software is furnished to do so, subject to
 15.3546 -+   the following conditions:
 15.3547 -+
 15.3548 -+   The above copyright notice and this permission notice shall be included
 15.3549 -+   in all copies or substantial portions of the Software.
 15.3550 -+
 15.3551 -+   THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
 15.3552 -+   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 15.3553 -+   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 15.3554 -+   IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR
 15.3555 -+   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 15.3556 -+   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 15.3557 -+   OTHER DEALINGS IN THE SOFTWARE.
 15.3558 -+   ----------------------------------------------------------------------- */
 15.3559 -+
 15.3560 -+#include <ffi.h>
 15.3561 -+#include <ffi_common.h>
 15.3562 -+
 15.3563 -+#include <stdlib.h>
 15.3564 -+
 15.3565 -+#define NGREGARG 4
 15.3566 -+#if defined(__SH4__)
 15.3567 -+#define NFREGARG 8
 15.3568 -+#endif
 15.3569 -+
 15.3570 -+#if defined(__HITACHI__)
 15.3571 -+#define STRUCT_VALUE_ADDRESS_WITH_ARG 1
 15.3572 -+#else
 15.3573 -+#define STRUCT_VALUE_ADDRESS_WITH_ARG 0
 15.3574 -+#endif
 15.3575 -+
 15.3576 -+/* If the structure has essentialy an unique element, return its type.  */
 15.3577 -+static int
 15.3578 -+simple_type (ffi_type *arg)
 15.3579 -+{
 15.3580 -+  if (arg->type != FFI_TYPE_STRUCT)
 15.3581 -+    return arg->type;
 15.3582 -+  else if (arg->elements[1])
 15.3583 -+    return FFI_TYPE_STRUCT;
 15.3584 -+
 15.3585 -+  return simple_type (arg->elements[0]);
 15.3586 -+}
 15.3587 -+
 15.3588 -+static int
 15.3589 -+return_type (ffi_type *arg)
 15.3590 -+{
 15.3591 -+  unsigned short type;
 15.3592 -+
 15.3593 -+  if (arg->type != FFI_TYPE_STRUCT)
 15.3594 -+    return arg->type;
 15.3595 -+
 15.3596 -+  type = simple_type (arg->elements[0]);
 15.3597 -+  if (! arg->elements[1])
 15.3598 -+    {
 15.3599 -+      switch (type)
 15.3600 -+	{
 15.3601 -+	case FFI_TYPE_SINT8:
 15.3602 -+	case FFI_TYPE_UINT8:
 15.3603 -+	case FFI_TYPE_SINT16:
 15.3604 -+	case FFI_TYPE_UINT16:
 15.3605 -+	case FFI_TYPE_SINT32:
 15.3606 -+	case FFI_TYPE_UINT32:
 15.3607 -+	  return FFI_TYPE_INT;
 15.3608 -+
 15.3609 -+	default:
 15.3610 -+	  return type;
 15.3611 -+	}
 15.3612 -+    }
 15.3613 -+
 15.3614 -+  /* gcc uses r0/r1 pair for some kind of structures.  */
 15.3615 -+  if (arg->size <= 2 * sizeof (int))
 15.3616 -+    {
 15.3617 -+      int i = 0;
 15.3618 -+      ffi_type *e;
 15.3619 -+
 15.3620 -+      while ((e = arg->elements[i++]))
 15.3621 -+	{
 15.3622 -+	  type = simple_type (e);
 15.3623 -+	  switch (type)
 15.3624 -+	    {
 15.3625 -+	    case FFI_TYPE_SINT32:
 15.3626 -+	    case FFI_TYPE_UINT32:
 15.3627 -+	    case FFI_TYPE_INT:
 15.3628 -+	    case FFI_TYPE_FLOAT:
 15.3629 -+	      return FFI_TYPE_UINT64;
 15.3630 -+
 15.3631 -+	    default:
 15.3632 -+	      break;
 15.3633 -+	    }
 15.3634 -+	}
 15.3635 -+    }
 15.3636 -+
 15.3637 -+  return FFI_TYPE_STRUCT;
 15.3638 -+}
 15.3639 -+
 15.3640 -+/* ffi_prep_args is called by the assembly routine once stack space
 15.3641 -+   has been allocated for the function's arguments */
 15.3642 -+
 15.3643 -+/*@-exportheader@*/
 15.3644 -+void ffi_prep_args(char *stack, extended_cif *ecif)
 15.3645 -+/*@=exportheader@*/
 15.3646 -+{
 15.3647 -+  register unsigned int i;
 15.3648 -+  register int tmp;
 15.3649 -+  register unsigned int avn;
 15.3650 -+  register void **p_argv;
 15.3651 -+  register char *argp;
 15.3652 -+  register ffi_type **p_arg;
 15.3653 -+  int greg, ireg;
 15.3654 -+#if defined(__SH4__)
 15.3655 -+  int freg = 0;
 15.3656 -+#endif
 15.3657 -+
 15.3658 -+  tmp = 0;
 15.3659 -+  argp = stack;
 15.3660 -+
 15.3661 -+  if (return_type (ecif->cif->rtype) == FFI_TYPE_STRUCT)
 15.3662 -+    {
 15.3663 -+      *(void **) argp = ecif->rvalue;
 15.3664 -+      argp += 4;
 15.3665 -+      ireg = STRUCT_VALUE_ADDRESS_WITH_ARG ? 1 : 0;
 15.3666 -+    }
 15.3667 -+  else
 15.3668 -+    ireg = 0;
 15.3669 -+
 15.3670 -+  /* Set arguments for registers.  */
 15.3671 -+  greg = ireg;
 15.3672 -+  avn = ecif->cif->nargs;
 15.3673 -+  p_argv = ecif->avalue;
 15.3674 -+
 15.3675 -+  for (i = 0, p_arg = ecif->cif->arg_types; i < avn; i++, p_arg++, p_argv++)
 15.3676 -+    {
 15.3677 -+      size_t z;
 15.3678 -+
 15.3679 -+      z = (*p_arg)->size;
 15.3680 -+      if (z < sizeof(int))
 15.3681 -+	{
 15.3682 -+	  if (greg++ >= NGREGARG)
 15.3683 -+	    continue;
 15.3684 -+
 15.3685 -+	  z = sizeof(int);
 15.3686 -+	  switch ((*p_arg)->type)
 15.3687 -+	    {
 15.3688 -+	    case FFI_TYPE_SINT8:
 15.3689 -+	      *(signed int *) argp = (signed int)*(SINT8 *)(* p_argv);
 15.3690 -+	      break;
 15.3691 -+  
 15.3692 -+	    case FFI_TYPE_UINT8:
 15.3693 -+	      *(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv);
 15.3694 -+	      break;
 15.3695 -+  
 15.3696 -+	    case FFI_TYPE_SINT16:
 15.3697 -+	      *(signed int *) argp = (signed int)*(SINT16 *)(* p_argv);
 15.3698 -+	      break;
 15.3699 -+  
 15.3700 -+	    case FFI_TYPE_UINT16:
 15.3701 -+	      *(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv);
 15.3702 -+	      break;
 15.3703 -+  
 15.3704 -+	    case FFI_TYPE_STRUCT:
 15.3705 -+	      *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv);
 15.3706 -+	      break;
 15.3707 -+
 15.3708 -+	    default:
 15.3709 -+	      FFI_ASSERT(0);
 15.3710 -+	    }
 15.3711 -+	  argp += z;
 15.3712 -+	}
 15.3713 -+      else if (z == sizeof(int))
 15.3714 -+	{
 15.3715 -+#if defined(__SH4__)
 15.3716 -+	  if ((*p_arg)->type == FFI_TYPE_FLOAT)
 15.3717 -+	    {
 15.3718 -+	      if (freg++ >= NFREGARG)
 15.3719 -+		continue;
 15.3720 -+	    }
 15.3721 -+	  else
 15.3722 -+#endif
 15.3723 -+	    {
 15.3724 -+	      if (greg++ >= NGREGARG)
 15.3725 -+		continue;
 15.3726 -+	    }
 15.3727 -+	  *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv);
 15.3728 -+	  argp += z;
 15.3729 -+	}
 15.3730 -+#if defined(__SH4__)
 15.3731 -+      else if ((*p_arg)->type == FFI_TYPE_DOUBLE)
 15.3732 -+	{
 15.3733 -+	  if (freg + 1 >= NFREGARG)
 15.3734 -+	    continue;
 15.3735 -+	  freg = (freg + 1) & ~1;
 15.3736 -+	  freg += 2;
 15.3737 -+	  memcpy (argp, *p_argv, z);
 15.3738 -+	  argp += z;
 15.3739 -+	}
 15.3740 -+#endif
 15.3741 -+      else
 15.3742 -+	{
 15.3743 -+	  int n = (z + sizeof (int) - 1) / sizeof (int);
 15.3744 -+#if defined(__SH4__)
 15.3745 -+	  if (greg + n - 1 >= NGREGARG)
 15.3746 -+	    continue;
 15.3747 -+	  greg += n;
 15.3748 -+#else
 15.3749 -+	  if (greg >= NGREGARG)
 15.3750 -+	    continue;
 15.3751 -+	  else if (greg + n - 1 >= NGREGARG)
 15.3752 -+	    greg = NGREGARG;
 15.3753 -+	  else
 15.3754 -+	    greg += n;
 15.3755 -+#endif
 15.3756 -+	  memcpy (argp, *p_argv, z);
 15.3757 -+	  argp += z;
 15.3758 -+	}
 15.3759 -+    }
 15.3760 -+
 15.3761 -+  /* Set arguments on stack.  */
 15.3762 -+  greg = ireg;
 15.3763 -+#if defined(__SH4__)
 15.3764 -+  freg = 0;
 15.3765 -+#endif
 15.3766 -+  p_argv = ecif->avalue;
 15.3767 -+
 15.3768 -+  for (i = 0, p_arg = ecif->cif->arg_types; i < avn; i++, p_arg++, p_argv++)
 15.3769 -+    {
 15.3770 -+      size_t z;
 15.3771 -+
 15.3772 -+      z = (*p_arg)->size;
 15.3773 -+      if (z < sizeof(int))
 15.3774 -+	{
 15.3775 -+	  if (greg++ < NGREGARG)
 15.3776 -+	    continue;
 15.3777 -+
 15.3778 -+	  z = sizeof(int);
 15.3779 -+	  switch ((*p_arg)->type)
 15.3780 -+	    {
 15.3781 -+	    case FFI_TYPE_SINT8:
 15.3782 -+	      *(signed int *) argp = (signed int)*(SINT8 *)(* p_argv);
 15.3783 -+	      break;
 15.3784 -+  
 15.3785 -+	    case FFI_TYPE_UINT8:
 15.3786 -+	      *(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv);
 15.3787 -+	      break;
 15.3788 -+  
 15.3789 -+	    case FFI_TYPE_SINT16:
 15.3790 -+	      *(signed int *) argp = (signed int)*(SINT16 *)(* p_argv);
 15.3791 -+	      break;
 15.3792 -+  
 15.3793 -+	    case FFI_TYPE_UINT16:
 15.3794 -+	      *(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv);
 15.3795 -+	      break;
 15.3796 -+  
 15.3797 -+	    case FFI_TYPE_STRUCT:
 15.3798 -+	      *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv);
 15.3799 -+	      break;
 15.3800 -+
 15.3801 -+	    default:
 15.3802 -+	      FFI_ASSERT(0);
 15.3803 -+	    }
 15.3804 -+	  argp += z;
 15.3805 -+	}
 15.3806 -+      else if (z == sizeof(int))
 15.3807 -+	{
 15.3808 -+#if defined(__SH4__)
 15.3809 -+	  if ((*p_arg)->type == FFI_TYPE_FLOAT)
 15.3810 -+	    {
 15.3811 -+	      if (freg++ < NFREGARG)
 15.3812 -+		continue;
 15.3813 -+	    }
 15.3814 -+	  else
 15.3815 -+#endif
 15.3816 -+	    {
 15.3817 -+	      if (greg++ < NGREGARG)
 15.3818 -+		continue;
 15.3819 -+	    }
 15.3820 -+	  *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv);
 15.3821 -+	  argp += z;
 15.3822 -+	}
 15.3823 -+#if defined(__SH4__)
 15.3824 -+      else if ((*p_arg)->type == FFI_TYPE_DOUBLE)
 15.3825 -+	{
 15.3826 -+	  if (freg + 1 < NFREGARG)
 15.3827 -+	    {
 15.3828 -+	      freg = (freg + 1) & ~1;
 15.3829 -+	      freg += 2;
 15.3830 -+	      continue;
 15.3831 -+	    }
 15.3832 -+	  memcpy (argp, *p_argv, z);
 15.3833 -+	  argp += z;
 15.3834 -+	}
 15.3835 -+#endif
 15.3836 -+      else
 15.3837 -+	{
 15.3838 -+	  int n = (z + sizeof (int) - 1) / sizeof (int);
 15.3839 -+	  if (greg + n - 1 < NGREGARG)
 15.3840 -+	    {
 15.3841 -+	      greg += n;
 15.3842 -+	      continue;
 15.3843 -+	    }
 15.3844 -+#if (! defined(__SH4__))
 15.3845 -+	  else if (greg < NGREGARG)
 15.3846 -+	    {
 15.3847 -+	      greg = NGREGARG;
 15.3848 -+	      continue;
 15.3849 -+	    }
 15.3850 -+#endif
 15.3851 -+	  memcpy (argp, *p_argv, z);
 15.3852 -+	  argp += z;
 15.3853 -+	}
 15.3854 -+    }
 15.3855 -+
 15.3856 -+  return;
 15.3857 -+}
 15.3858 -+
 15.3859 -+/* Perform machine dependent cif processing */
 15.3860 -+ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
 15.3861 -+{
 15.3862 -+  int i, j;
 15.3863 -+  int size, type;
 15.3864 -+  int n, m;
 15.3865 -+  int greg;
 15.3866 -+#if defined(__SH4__)
 15.3867 -+  int freg = 0;
 15.3868 -+#endif
 15.3869 -+
 15.3870 -+  cif->flags = 0;
 15.3871 -+
 15.3872 -+  greg = ((return_type (cif->rtype) == FFI_TYPE_STRUCT) &&
 15.3873 -+	  STRUCT_VALUE_ADDRESS_WITH_ARG) ? 1 : 0;
 15.3874 -+
 15.3875 -+#if defined(__SH4__)
 15.3876 -+  for (i = j = 0; i < cif->nargs && j < 12; i++)
 15.3877 -+    {
 15.3878 -+      type = (cif->arg_types)[i]->type;
 15.3879 -+      switch (type)
 15.3880 -+	{
 15.3881 -+	case FFI_TYPE_FLOAT:
 15.3882 -+	  if (freg >= NFREGARG)
 15.3883 -+	    continue;
 15.3884 -+	  freg++;
 15.3885 -+	  cif->flags += ((cif->arg_types)[i]->type) << (2 * j);
 15.3886 -+	  j++;
 15.3887 -+	  break;
 15.3888 -+
 15.3889 -+	case FFI_TYPE_DOUBLE:
 15.3890 -+	  if ((freg + 1) >= NFREGARG)
 15.3891 -+	    continue;
 15.3892 -+	  freg = (freg + 1) & ~1;
 15.3893 -+	  freg += 2;
 15.3894 -+	  cif->flags += ((cif->arg_types)[i]->type) << (2 * j);
 15.3895 -+	  j++;
 15.3896 -+	  break;
 15.3897 -+	      
 15.3898 -+	default:
 15.3899 -+	  size = (cif->arg_types)[i]->size;
 15.3900 -+	  n = (size + sizeof (int) - 1) / sizeof (int);
 15.3901 -+	  if (greg + n - 1 >= NGREGARG)
 15.3902 -+		continue;
 15.3903 -+	  greg += n;
 15.3904 -+	  for (m = 0; m < n; m++)
 15.3905 -+	    cif->flags += FFI_TYPE_INT << (2 * j++);
 15.3906 -+	  break;
 15.3907 -+	}
 15.3908 -+    }
 15.3909 -+#else
 15.3910 -+  for (i = j = 0; i < cif->nargs && j < 4; i++)
 15.3911 -+    {
 15.3912 -+      size = (cif->arg_types)[i]->size;
 15.3913 -+      n = (size + sizeof (int) - 1) / sizeof (int);
 15.3914 -+      if (greg >= NGREGARG)
 15.3915 -+	continue;
 15.3916 -+      else if (greg + n - 1 >= NGREGARG)
 15.3917 -+	greg = NGREGARG;
 15.3918 -+      else
 15.3919 -+	greg += n;
 15.3920 -+      for (m = 0; m < n; m++)
 15.3921 -+        cif->flags += FFI_TYPE_INT << (2 * j++);
 15.3922 -+    }
 15.3923 -+#endif
 15.3924 -+
 15.3925 -+  /* Set the return type flag */
 15.3926 -+  switch (cif->rtype->type)
 15.3927 -+    {
 15.3928 -+    case FFI_TYPE_STRUCT:
 15.3929 -+      cif->flags += (unsigned) (return_type (cif->rtype)) << 24;
 15.3930 -+      break;
 15.3931 -+
 15.3932 -+    case FFI_TYPE_VOID:
 15.3933 -+    case FFI_TYPE_FLOAT:
 15.3934 -+    case FFI_TYPE_DOUBLE:
 15.3935 -+    case FFI_TYPE_SINT64:
 15.3936 -+    case FFI_TYPE_UINT64:
 15.3937 -+      cif->flags += (unsigned) cif->rtype->type << 24;
 15.3938 -+      break;
 15.3939 -+
 15.3940 -+    default:
 15.3941 -+      cif->flags += FFI_TYPE_INT << 24;
 15.3942 -+      break;
 15.3943 -+    }
 15.3944 -+
 15.3945 -+  return FFI_OK;
 15.3946 -+}
 15.3947 -+
 15.3948 -+/*@-declundef@*/
 15.3949 -+/*@-exportheader@*/
 15.3950 -+extern void ffi_call_SYSV(void (*)(char *, extended_cif *), 
 15.3951 -+			  /*@out@*/ extended_cif *, 
 15.3952 -+			  unsigned, unsigned, 
 15.3953 -+			  /*@out@*/ unsigned *, 
 15.3954 -+			  void (*fn)());
 15.3955 -+/*@=declundef@*/
 15.3956 -+/*@=exportheader@*/
 15.3957 -+
 15.3958 -+void ffi_call(/*@dependent@*/ ffi_cif *cif, 
 15.3959 -+	      void (*fn)(), 
 15.3960 -+	      /*@out@*/ void *rvalue, 
 15.3961 -+	      /*@dependent@*/ void **avalue)
 15.3962 -+{
 15.3963 -+  extended_cif ecif;
 15.3964 -+
 15.3965 -+  ecif.cif = cif;
 15.3966 -+  ecif.avalue = avalue;
 15.3967 -+  
 15.3968 -+  /* If the return value is a struct and we don't have a return	*/
 15.3969 -+  /* value address then we need to make one		        */
 15.3970 -+
 15.3971 -+  if ((rvalue == NULL) && 
 15.3972 -+      (cif->rtype->type == FFI_TYPE_STRUCT))
 15.3973 -+    {
 15.3974 -+      /*@-sysunrecog@*/
 15.3975 -+      ecif.rvalue = alloca(cif->rtype->size);
 15.3976 -+      /*@=sysunrecog@*/
 15.3977 -+    }
 15.3978 -+  else
 15.3979 -+    ecif.rvalue = rvalue;
 15.3980 -+    
 15.3981 -+
 15.3982 -+  switch (cif->abi) 
 15.3983 -+    {
 15.3984 -+    case FFI_SYSV:
 15.3985 -+      /*@-usedef@*/
 15.3986 -+      ffi_call_SYSV(ffi_prep_args, &ecif, cif->bytes, 
 15.3987 -+		    cif->flags, ecif.rvalue, fn);
 15.3988 -+      /*@=usedef@*/
 15.3989 -+      break;
 15.3990 -+    default:
 15.3991 -+      FFI_ASSERT(0);
 15.3992 -+      break;
 15.3993 -+    }
 15.3994 -+}
 15.3995 -+
 15.3996 -+extern void ffi_closure_SYSV (void);
 15.3997 -+#if defined(__SH4__)
 15.3998 -+extern void __ic_invalidate (void *line);
 15.3999 -+#endif
 15.4000 -+
 15.4001 -+ffi_status
 15.4002 -+ffi_prep_closure (ffi_closure* closure,
 15.4003 -+		  ffi_cif* cif,
 15.4004 -+		  void (*fun)(ffi_cif*, void*, void**, void*),
 15.4005 -+		  void *user_data)
 15.4006 -+{
 15.4007 -+  unsigned int *tramp;
 15.4008 -+
 15.4009 -+  FFI_ASSERT (cif->abi == FFI_GCC_SYSV);
 15.4010 -+
 15.4011 -+  tramp = (unsigned int *) &closure->tramp[0];
 15.4012 -+#ifdef __LITTLE_ENDIAN__
 15.4013 -+  tramp[0] = 0xd301d202;
 15.4014 -+  tramp[1] = 0x0009422b;
 15.4015 -+#else
 15.4016 -+  tramp[0] = 0xd202d301;
 15.4017 -+  tramp[1] = 0x422b0009;
 15.4018 -+#endif
 15.4019 -+  *(void **) &tramp[2] = (void *)closure;          /* ctx */
 15.4020 -+  *(void **) &tramp[3] = (void *)ffi_closure_SYSV; /* funaddr */
 15.4021 -+
 15.4022 -+  closure->cif = cif;
 15.4023 -+  closure->fun = fun;
 15.4024 -+  closure->user_data = user_data;
 15.4025 -+
 15.4026 -+#if defined(__SH4__)
 15.4027 -+  /* Flush the icache.  */
 15.4028 -+  __ic_invalidate(&closure->tramp[0]);
 15.4029 -+#endif
 15.4030 -+
 15.4031 -+  return FFI_OK;
 15.4032 -+}
 15.4033 -+
 15.4034 -+/* Basically the trampoline invokes ffi_closure_SYSV, and on 
 15.4035 -+ * entry, r3 holds the address of the closure.
 15.4036 -+ * After storing the registers that could possibly contain
 15.4037 -+ * parameters to be passed into the stack frame and setting
 15.4038 -+ * up space for a return value, ffi_closure_SYSV invokes the 
 15.4039 -+ * following helper function to do most of the work.
 15.4040 -+ */
 15.4041 -+
 15.4042 -+#ifdef __LITTLE_ENDIAN__
 15.4043 -+#define OFS_INT8	0
 15.4044 -+#define OFS_INT16	2
 15.4045 -+#else
 15.4046 -+#define OFS_INT8	3
 15.4047 -+#define OFS_INT16	2
 15.4048 -+#endif
 15.4049 -+
 15.4050 -+int
 15.4051 -+ffi_closure_helper_SYSV (ffi_closure *closure, void *rvalue, 
 15.4052 -+			 unsigned long *pgr, unsigned long *pfr, 
 15.4053 -+			 unsigned long *pst)
 15.4054 -+{
 15.4055 -+  void **avalue;
 15.4056 -+  ffi_type **p_arg;
 15.4057 -+  int i, avn;
 15.4058 -+  int ireg, greg = 0;
 15.4059 -+#if defined(__SH4__)
 15.4060 -+  int freg = 0;
 15.4061 -+#endif
 15.4062 -+  ffi_cif *cif; 
 15.4063 -+  double temp; 
 15.4064 -+
 15.4065 -+  cif = closure->cif;
 15.4066 -+  avalue = alloca(cif->nargs * sizeof(void *));
 15.4067 -+
 15.4068 -+  /* Copy the caller's structure return value address so that the closure
 15.4069 -+     returns the data directly to the caller.  */
 15.4070 -+  if (cif->rtype->type == FFI_TYPE_STRUCT)
 15.4071 -+    {
 15.4072 -+      rvalue = *pgr++;
 15.4073 -+      ireg = STRUCT_VALUE_ADDRESS_WITH_ARG ? 1 : 0;
 15.4074 -+    }
 15.4075 -+  else
 15.4076 -+    ireg = 0;
 15.4077 -+
 15.4078 -+  cif = closure->cif;
 15.4079 -+  greg = ireg;
 15.4080 -+  avn = cif->nargs;
 15.4081 -+
 15.4082 -+  /* Grab the addresses of the arguments from the stack frame.  */
 15.4083 -+  for (i = 0, p_arg = cif->arg_types; i < avn; i++, p_arg++)
 15.4084 -+    {
 15.4085 -+      size_t z;
 15.4086 -+
 15.4087 -+      z = (*p_arg)->size;
 15.4088 -+      if (z < sizeof(int))
 15.4089 -+	{
 15.4090 -+	  if (greg++ >= NGREGARG)
 15.4091 -+	    continue;
 15.4092 -+
 15.4093 -+	  z = sizeof(int);
 15.4094 -+	  switch ((*p_arg)->type)
 15.4095 -+	    {
 15.4096 -+	    case FFI_TYPE_SINT8:
 15.4097 -+	    case FFI_TYPE_UINT8:
 15.4098 -+	      avalue[i] = (((char *)pgr) + OFS_INT8);
 15.4099 -+	      break;
 15.4100 -+  
 15.4101 -+	    case FFI_TYPE_SINT16:
 15.4102 -+	    case FFI_TYPE_UINT16:
 15.4103 -+	      avalue[i] = (((char *)pgr) + OFS_INT16);
 15.4104 -+	      break;
 15.4105 -+  
 15.4106 -+	    case FFI_TYPE_STRUCT:
 15.4107 -+	      avalue[i] = pgr;
 15.4108 -+	      break;
 15.4109 -+
 15.4110 -+	    default:
 15.4111 -+	      FFI_ASSERT(0);
 15.4112 -+	    }
 15.4113 -+	  pgr++;
 15.4114 -+	}
 15.4115 -+      else if (z == sizeof(int))
 15.4116 -+	{
 15.4117 -+#if defined(__SH4__)
 15.4118 -+	  if ((*p_arg)->type == FFI_TYPE_FLOAT)
 15.4119 -+	    {
 15.4120 -+	      if (freg++ >= NFREGARG)
 15.4121 -+		continue;
 15.4122 -+	      avalue[i] = pfr;
 15.4123 -+	      pfr++;
 15.4124 -+	    }
 15.4125 -+	  else
 15.4126 -+#endif
 15.4127 -+	    {
 15.4128 -+	      if (greg++ >= NGREGARG)
 15.4129 -+		continue;
 15.4130 -+	      avalue[i] = pgr;
 15.4131 -+	      pgr++;
 15.4132 -+	    }
 15.4133 -+	}
 15.4134 -+#if defined(__SH4__)
 15.4135 -+      else if ((*p_arg)->type == FFI_TYPE_DOUBLE)
 15.4136 -+	{
 15.4137 -+	  if (freg + 1 >= NFREGARG)
 15.4138 -+	    continue;
 15.4139 -+	  freg = (freg + 1) & ~1;
 15.4140 -+	  freg += 2;
 15.4141 -+	  avalue[i] = pfr;
 15.4142 -+	  pfr += 2;
 15.4143 -+	}
 15.4144 -+#endif
 15.4145 -+      else
 15.4146 -+	{
 15.4147 -+	  int n = (z + sizeof (int) - 1) / sizeof (int);
 15.4148 -+#if defined(__SH4__)
 15.4149 -+	  if (greg + n - 1 >= NGREGARG)
 15.4150 -+	    continue;
 15.4151 -+	  greg += n;
 15.4152 -+#else
 15.4153 -+	  if (greg >= NGREGARG)
 15.4154 -+	    continue;
 15.4155 -+	  else if (greg + n - 1 >= NGREGARG)
 15.4156 -+	    greg = NGREGARG;
 15.4157 -+	  else
 15.4158 -+	    greg += n;
 15.4159 -+#endif
 15.4160 -+	  avalue[i] = pgr;
 15.4161 -+	  pgr += n;
 15.4162 -+	}
 15.4163 -+    }
 15.4164 -+
 15.4165 -+  greg = ireg;
 15.4166 -+#if defined(__SH4__)
 15.4167 -+  freg = 0;
 15.4168 -+#endif
 15.4169 -+
 15.4170 -+  for (i = 0, p_arg = cif->arg_types; i < avn; i++, p_arg++)
 15.4171 -+    {
 15.4172 -+      size_t z;
 15.4173 -+
 15.4174 -+      z = (*p_arg)->size;
 15.4175 -+      if (z < sizeof(int))
 15.4176 -+	{
 15.4177 -+	  if (greg++ < NGREGARG)
 15.4178 -+	    continue;
 15.4179 -+
 15.4180 -+	  z = sizeof(int);
 15.4181 -+	  switch ((*p_arg)->type)
 15.4182 -+	    {
 15.4183 -+	    case FFI_TYPE_SINT8:
 15.4184 -+	    case FFI_TYPE_UINT8:
 15.4185 -+	      avalue[i] = (((char *)pst) + OFS_INT8);
 15.4186 -+	      break;
 15.4187 -+  
 15.4188 -+	    case FFI_TYPE_SINT16:
 15.4189 -+	    case FFI_TYPE_UINT16:
 15.4190 -+	      avalue[i] = (((char *)pst) + OFS_INT16);
 15.4191 -+	      break;
 15.4192 -+  
 15.4193 -+	    case FFI_TYPE_STRUCT:
 15.4194 -+	      avalue[i] = pst;
 15.4195 -+	      break;
 15.4196 -+
 15.4197 -+	    default:
 15.4198 -+	      FFI_ASSERT(0);
 15.4199 -+	    }
 15.4200 -+	  pst++;
 15.4201 -+	}
 15.4202 -+      else if (z == sizeof(int))
 15.4203 -+	{
 15.4204 -+#if defined(__SH4__)
 15.4205 -+	  if ((*p_arg)->type == FFI_TYPE_FLOAT)
 15.4206 -+	    {
 15.4207 -+	      if (freg++ < NFREGARG)
 15.4208 -+		continue;
 15.4209 -+	    }
 15.4210 -+	  else
 15.4211 -+#endif
 15.4212 -+	    {
 15.4213 -+	      if (greg++ < NGREGARG)
 15.4214 -+		continue;
 15.4215 -+	    }
 15.4216 -+	  avalue[i] = pst;
 15.4217 -+	  pst++;
 15.4218 -+	}
 15.4219 -+#if defined(__SH4__)
 15.4220 -+      else if ((*p_arg)->type == FFI_TYPE_DOUBLE)
 15.4221 -+	{
 15.4222 -+	  if (freg + 1 < NFREGARG)
 15.4223 -+	    {
 15.4224 -+	      freg = (freg + 1) & ~1;
 15.4225 -+	      freg += 2;
 15.4226 -+	      continue;
 15.4227 -+	    }
 15.4228 -+	  avalue[i] = pst;
 15.4229 -+	  pst += 2;
 15.4230 -+	}
 15.4231 -+#endif
 15.4232 -+      else
 15.4233 -+	{
 15.4234 -+	  int n = (z + sizeof (int) - 1) / sizeof (int);
 15.4235 -+	  if (greg + n - 1 < NGREGARG)
 15.4236 -+	    {
 15.4237 -+	      greg += n;
 15.4238 -+	      continue;
 15.4239 -+	    }
 15.4240 -+#if (! defined(__SH4__))
 15.4241 -+	  else if (greg < NGREGARG)
 15.4242 -+	    {
 15.4243 -+	      greg = NGREGARG;
 15.4244 -+	      continue;
 15.4245 -+	    }
 15.4246 -+#endif
 15.4247 -+	  avalue[i] = pst;
 15.4248 -+	  pst += n;
 15.4249 -+	}
 15.4250 -+    }
 15.4251 -+
 15.4252 -+  (closure->fun) (cif, rvalue, avalue, closure->user_data);
 15.4253 -+
 15.4254 -+  /* Tell ffi_closure_osf how to perform return type promotions.  */
 15.4255 -+  return cif->rtype->type;
 15.4256 -+}
 15.4257 -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/sh/sysv.S gcc/libffi/src/sh/sysv.S
 15.4258 ---- gcc-3.2.2.orig/libffi/src/sh/sysv.S	Thu Jan  1 09:00:00 1970
 15.4259 -+++ gcc/libffi/src/sh/sysv.S	Tue Dec 17 03:22:48 2002
 15.4260 -@@ -0,0 +1,773 @@
 15.4261 -+/* -----------------------------------------------------------------------
 15.4262 -+   sysv.S - Copyright (c) 2002 Kaz Kojima
 15.4263 -+   
 15.4264 -+   SuperH Foreign Function Interface 
 15.4265 -+
 15.4266 -+   Permission is hereby granted, free of charge, to any person obtaining
 15.4267 -+   a copy of this software and associated documentation files (the
 15.4268 -+   ``Software''), to deal in the Software without restriction, including
 15.4269 -+   without limitation the rights to use, copy, modify, merge, publish,
 15.4270 -+   distribute, sublicense, and/or sell copies of the Software, and to
 15.4271 -+   permit persons to whom the Software is furnished to do so, subject to
 15.4272 -+   the following conditions:
 15.4273 -+
 15.4274 -+   The above copyright notice and this permission notice shall be included
 15.4275 -+   in all copies or substantial portions of the Software.
 15.4276 -+
 15.4277 -+   THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
 15.4278 -+   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 15.4279 -+   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 15.4280 -+   IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR
 15.4281 -+   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 15.4282 -+   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 15.4283 -+   OTHER DEALINGS IN THE SOFTWARE.
 15.4284 -+   ----------------------------------------------------------------------- */
 15.4285 -+
 15.4286 -+#define LIBFFI_ASM	
 15.4287 -+#include <ffi.h>
 15.4288 -+#ifdef HAVE_MACHINE_ASM_H
 15.4289 -+#include <machine/asm.h>
 15.4290 -+#else
 15.4291 -+/* XXX these lose for some platforms, I'm sure. */
 15.4292 -+#define CNAME(x) x
 15.4293 -+#define ENTRY(x) .globl CNAME(x); .type CNAME(x),%function; CNAME(x):
 15.4294 -+#endif
 15.4295 -+
 15.4296 -+#if defined(__HITACHI__)
 15.4297 -+#define STRUCT_VALUE_ADDRESS_WITH_ARG 1
 15.4298 -+#else
 15.4299 -+#define STRUCT_VALUE_ADDRESS_WITH_ARG 0
 15.4300 -+#endif
 15.4301 -+
 15.4302 -+.text
 15.4303 -+
 15.4304 -+	# r4:	ffi_prep_args
 15.4305 -+	# r5:	&ecif
 15.4306 -+	# r6:	bytes
 15.4307 -+	# r7:	flags
 15.4308 -+	# sp+0: rvalue
 15.4309 -+	# sp+4: fn
 15.4310 -+
 15.4311 -+	# This assumes we are using gas.
 15.4312 -+ENTRY(ffi_call_SYSV)
 15.4313 -+	# Save registers
 15.4314 -+.LFB1:
 15.4315 -+	mov.l	r8,@-r15
 15.4316 -+.LCFI0:
 15.4317 -+	mov.l	r9,@-r15
 15.4318 -+.LCFI1:
 15.4319 -+	mov.l	r10,@-r15
 15.4320 -+.LCFI2:
 15.4321 -+	mov.l	r12,@-r15
 15.4322 -+.LCFI3:
 15.4323 -+	mov.l	r14,@-r15
 15.4324 -+.LCFI4:
 15.4325 -+	sts.l	pr,@-r15
 15.4326 -+.LCFI5:
 15.4327 -+	mov	r15,r14
 15.4328 -+.LCFI6:
 15.4329 -+#if defined(__SH4__)
 15.4330 -+	mov	r6,r8
 15.4331 -+	mov	r7,r9
 15.4332 -+
 15.4333 -+	sub	r6,r15
 15.4334 -+	add	#-16,r15
 15.4335 -+	mov	#~7,r0
 15.4336 -+	and	r0,r15
 15.4337 -+
 15.4338 -+	mov	r4,r0
 15.4339 -+	jsr	@r0
 15.4340 -+	 mov	r15,r4
 15.4341 -+
 15.4342 -+	mov	r9,r1
 15.4343 -+	shlr8	r9
 15.4344 -+	shlr8	r9
 15.4345 -+	shlr8	r9
 15.4346 -+
 15.4347 -+	mov	#FFI_TYPE_STRUCT,r2
 15.4348 -+	cmp/eq	r2,r9
 15.4349 -+	bf	1f
 15.4350 -+#if STRUCT_VALUE_ADDRESS_WITH_ARG
 15.4351 -+ 	mov.l	@r15+,r4
 15.4352 -+	bra	2f
 15.4353 -+	 mov	#5,r2
 15.4354 -+#else
 15.4355 -+ 	mov.l	@r15+,r10
 15.4356 -+#endif
 15.4357 -+1:
 15.4358 -+	mov	#4,r2
 15.4359 -+2:
 15.4360 -+	mov	#4,r3
 15.4361 -+
 15.4362 -+L_pass:
 15.4363 -+	cmp/pl	r8
 15.4364 -+	bf	L_call_it
 15.4365 -+
 15.4366 -+	mov	r1,r0
 15.4367 -+	and	#3,r0
 15.4368 -+
 15.4369 -+L_pass_d:
 15.4370 -+	cmp/eq	#FFI_TYPE_DOUBLE,r0
 15.4371 -+	bf	L_pass_f
 15.4372 -+
 15.4373 -+	mov	r3,r0
 15.4374 -+	and	#1,r0
 15.4375 -+	tst	r0,r0
 15.4376 -+	bt	1f
 15.4377 -+	add	#1,r3
 15.4378 -+1:
 15.4379 -+	mov	r15,r0
 15.4380 -+	and	#7,r0
 15.4381 -+	tst	r0,r0
 15.4382 -+	bt	2f
 15.4383 -+	add	#4,r15
 15.4384 -+2:
 15.4385 -+	mov	#12,r0
 15.4386 -+	cmp/hs	r0,r3
 15.4387 -+	bt/s	3f
 15.4388 -+	 shlr2	r1
 15.4389 -+	bsr	L_pop_d
 15.4390 -+	 nop
 15.4391 -+3:
 15.4392 -+	add	#2,r3
 15.4393 -+	bra	L_pass
 15.4394 -+	 add	#-8,r8
 15.4395 -+
 15.4396 -+L_pop_d:
 15.4397 -+	mov	r3,r0
 15.4398 -+	add	r0,r0
 15.4399 -+	add	r3,r0
 15.4400 -+	add	#-12,r0
 15.4401 -+	braf	r0
 15.4402 -+	 nop
 15.4403 -+#ifdef __LITTLE_ENDIAN__
 15.4404 -+	fmov.s	@r15+,fr5
 15.4405 -+	rts
 15.4406 -+	 fmov.s	@r15+,fr4
 15.4407 -+	fmov.s	@r15+,fr7
 15.4408 -+	rts
 15.4409 -+	 fmov.s	@r15+,fr6
 15.4410 -+	fmov.s	@r15+,fr9
 15.4411 -+	rts
 15.4412 -+	 fmov.s	@r15+,fr8
 15.4413 -+	fmov.s	@r15+,fr11
 15.4414 -+	rts
 15.4415 -+	 fmov.s	@r15+,fr10
 15.4416 -+#else
 15.4417 -+	fmov.s	@r15+,fr4
 15.4418 -+	rts
 15.4419 -+	 fmov.s	@r15+,fr5
 15.4420 -+	fmov.s	@r15+,fr6
 15.4421 -+	rts
 15.4422 -+	 fmov.s	@r15+,fr7
 15.4423 -+	fmov.s	@r15+,fr8
 15.4424 -+	rts
 15.4425 -+	 fmov.s	@r15+,fr9
 15.4426 -+	fmov.s	@r15+,fr10
 15.4427 -+	rts
 15.4428 -+	 fmov.s	@r15+,fr11
 15.4429 -+#endif
 15.4430 -+
 15.4431 -+L_pass_f:
 15.4432 -+	cmp/eq	#FFI_TYPE_FLOAT,r0
 15.4433 -+	bf	L_pass_i
 15.4434 -+
 15.4435 -+	mov	#12,r0
 15.4436 -+	cmp/hs	r0,r3
 15.4437 -+	bt/s	2f
 15.4438 -+	 shlr2	r1
 15.4439 -+	bsr	L_pop_f
 15.4440 -+	 nop
 15.4441 -+2:
 15.4442 -+	add	#1,r3
 15.4443 -+	bra	L_pass
 15.4444 -+	 add	#-4,r8
 15.4445 -+
 15.4446 -+L_pop_f:
 15.4447 -+	mov	r3,r0
 15.4448 -+	shll2	r0
 15.4449 -+	add	#-16,r0
 15.4450 -+	braf	r0
 15.4451 -+	 nop
 15.4452 -+#ifdef __LITTLE_ENDIAN__
 15.4453 -+	rts
 15.4454 -+	 fmov.s	@r15+,fr5
 15.4455 -+	rts
 15.4456 -+	 fmov.s	@r15+,fr4
 15.4457 -+	rts
 15.4458 -+	 fmov.s	@r15+,fr7
 15.4459 -+	rts
 15.4460 -+	 fmov.s	@r15+,fr6
 15.4461 -+	rts
 15.4462 -+	 fmov.s	@r15+,fr9
 15.4463 -+	rts
 15.4464 -+	 fmov.s	@r15+,fr8
 15.4465 -+	rts
 15.4466 -+	 fmov.s	@r15+,fr11
 15.4467 -+	rts
 15.4468 -+	 fmov.s	@r15+,fr10
 15.4469 -+#else
 15.4470 -+	rts
 15.4471 -+	 fmov.s	@r15+,fr4
 15.4472 -+	rts
 15.4473 -+	 fmov.s	@r15+,fr5
 15.4474 -+	rts
 15.4475 -+	 fmov.s	@r15+,fr6
 15.4476 -+	rts
 15.4477 -+	 fmov.s	@r15+,fr7
 15.4478 -+	rts
 15.4479 -+	 fmov.s	@r15+,fr8
 15.4480 -+	rts
 15.4481 -+	 fmov.s	@r15+,fr9
 15.4482 -+	rts
 15.4483 -+	 fmov.s	@r15+,fr10
 15.4484 -+	rts
 15.4485 -+	 fmov.s	@r15+,fr11
 15.4486 -+#endif
 15.4487 -+
 15.4488 -+L_pass_i:
 15.4489 -+	cmp/eq	#FFI_TYPE_INT,r0
 15.4490 -+	bf	L_call_it
 15.4491 -+
 15.4492 -+	mov	#8,r0
 15.4493 -+	cmp/hs	r0,r2
 15.4494 -+	bt/s	2f
 15.4495 -+	 shlr2	r1
 15.4496 -+	bsr	L_pop_i
 15.4497 -+	 nop
 15.4498 -+2:
 15.4499 -+	add	#1,r2
 15.4500 -+	bra	L_pass
 15.4501 -+	 add	#-4,r8
 15.4502 -+
 15.4503 -+L_pop_i:
 15.4504 -+	mov	r2,r0
 15.4505 -+	shll2	r0
 15.4506 -+	add	#-16,r0
 15.4507 -+	braf	r0
 15.4508 -+	 nop
 15.4509 -+	rts
 15.4510 -+	 mov.l	@r15+,r4
 15.4511 -+	rts
 15.4512 -+	 mov.l	@r15+,r5
 15.4513 -+	rts
 15.4514 -+	 mov.l	@r15+,r6
 15.4515 -+	rts
 15.4516 -+	 mov.l	@r15+,r7
 15.4517 -+
 15.4518 -+L_call_it:
 15.4519 -+	# call function
 15.4520 -+#if (! STRUCT_VALUE_ADDRESS_WITH_ARG)
 15.4521 -+	mov	r10, r2
 15.4522 -+#endif
 15.4523 -+	mov.l  @(28,r14),r1
 15.4524 -+	jsr    @r1
 15.4525 -+	 nop
 15.4526 -+
 15.4527 -+L_ret_d:
 15.4528 -+	mov	#FFI_TYPE_DOUBLE,r2
 15.4529 -+	cmp/eq	r2,r9
 15.4530 -+	bf	L_ret_ll
 15.4531 -+
 15.4532 -+	mov.l	@(24,r14),r1
 15.4533 -+#ifdef __LITTLE_ENDIAN__
 15.4534 -+	fmov.s	fr1,@r1
 15.4535 -+	add	#4,r1
 15.4536 -+	bra	L_epilogue
 15.4537 -+	 fmov.s	fr0,@r1
 15.4538 -+#else
 15.4539 -+	fmov.s	fr0,@r1
 15.4540 -+	add	#4,r1
 15.4541 -+	bra	L_epilogue
 15.4542 -+	 fmov.s	fr1,@r1
 15.4543 -+#endif
 15.4544 -+
 15.4545 -+L_ret_ll:
 15.4546 -+	mov	#FFI_TYPE_SINT64,r2
 15.4547 -+	cmp/eq	r2,r9
 15.4548 -+	bt/s	1f
 15.4549 -+	 mov	#FFI_TYPE_UINT64,r2
 15.4550 -+	cmp/eq	r2,r9
 15.4551 -+	bf	L_ret_f
 15.4552 -+
 15.4553 -+1:
 15.4554 -+	mov.l	@(24,r14),r2
 15.4555 -+	mov.l	r0,@r2
 15.4556 -+	bra	L_epilogue
 15.4557 -+	 mov.l	r1,@(4,r2)
 15.4558 -+
 15.4559 -+L_ret_f:
 15.4560 -+	mov	#FFI_TYPE_FLOAT,r2
 15.4561 -+	cmp/eq	r2,r9
 15.4562 -+	bf	L_ret_i
 15.4563 -+
 15.4564 -+	mov.l	@(24,r14),r1
 15.4565 -+	bra	L_epilogue
 15.4566 -+	 fmov.s	fr0,@r1
 15.4567 -+
 15.4568 -+L_ret_i:
 15.4569 -+	mov	#FFI_TYPE_INT,r2
 15.4570 -+	cmp/eq	r2,r9
 15.4571 -+	bf	L_epilogue
 15.4572 -+
 15.4573 -+	mov.l	@(24,r14),r1
 15.4574 -+	bra	L_epilogue
 15.4575 -+	 mov.l	r0,@r1
 15.4576 -+
 15.4577 -+L_epilogue:
 15.4578 -+	# Remove the space we pushed for the args
 15.4579 -+	mov   r14,r15
 15.4580 -+
 15.4581 -+	lds.l  @r15+,pr
 15.4582 -+	mov.l  @r15+,r14
 15.4583 -+	mov.l  @r15+,r12
 15.4584 -+	mov.l  @r15+,r10
 15.4585 -+	mov.l  @r15+,r9
 15.4586 -+	rts
 15.4587 -+	 mov.l  @r15+,r8
 15.4588 -+#else
 15.4589 -+	mov	r6,r8
 15.4590 -+	mov	r7,r9
 15.4591 -+
 15.4592 -+	sub	r6,r15
 15.4593 -+	add	#-16,r15
 15.4594 -+	mov	#~7,r0
 15.4595 -+	and	r0,r15
 15.4596 -+
 15.4597 -+	mov	r4,r0
 15.4598 -+	jsr	@r0
 15.4599 -+	 mov	r15,r4
 15.4600 -+
 15.4601 -+	mov	r9,r3
 15.4602 -+	shlr8	r9
 15.4603 -+	shlr8	r9
 15.4604 -+	shlr8	r9
 15.4605 -+
 15.4606 -+	mov	#FFI_TYPE_STRUCT,r2
 15.4607 -+	cmp/eq	r2,r9
 15.4608 -+	bf	1f
 15.4609 -+#if STRUCT_VALUE_ADDRESS_WITH_ARG
 15.4610 -+	mov.l	@r15+,r4
 15.4611 -+	bra	2f
 15.4612 -+	 mov	#5,r2
 15.4613 -+#else
 15.4614 -+	mov.l	@r15+,r10
 15.4615 -+#endif
 15.4616 -+1:
 15.4617 -+	mov	#4,r2
 15.4618 -+2:
 15.4619 -+
 15.4620 -+L_pass:
 15.4621 -+	cmp/pl	r8
 15.4622 -+	bf	L_call_it
 15.4623 -+
 15.4624 -+	mov	r3,r0
 15.4625 -+	and	#3,r0
 15.4626 -+
 15.4627 -+L_pass_d:
 15.4628 -+	cmp/eq	#FFI_TYPE_DOUBLE,r0
 15.4629 -+	bf	L_pass_i
 15.4630 -+
 15.4631 -+	mov	r15,r0
 15.4632 -+	and	#7,r0
 15.4633 -+	tst	r0,r0
 15.4634 -+	bt	1f
 15.4635 -+	add	#4,r15
 15.4636 -+1:
 15.4637 -+	mov	#8,r0
 15.4638 -+	cmp/hs	r0,r2
 15.4639 -+	bt/s	2f
 15.4640 -+	 shlr2	r3
 15.4641 -+	bsr	L_pop_d
 15.4642 -+	 nop
 15.4643 -+2:
 15.4644 -+	add	#2,r2
 15.4645 -+	bra	L_pass
 15.4646 -+	 add	#-8,r8
 15.4647 -+
 15.4648 -+L_pop_d:
 15.4649 -+	mov	r2,r0
 15.4650 -+	add	r0,r0
 15.4651 -+	add	r2,r0
 15.4652 -+	add	#-12,r0
 15.4653 -+	add	r0,r0
 15.4654 -+	braf	r0
 15.4655 -+	 nop
 15.4656 -+	mov.l	@r15+,r4
 15.4657 -+	rts
 15.4658 -+	 mov.l	@r15+,r5
 15.4659 -+	mov.l	@r15+,r5
 15.4660 -+	rts
 15.4661 -+	 mov.l	@r15+,r6
 15.4662 -+	mov.l	@r15+,r6
 15.4663 -+	rts
 15.4664 -+	 mov.l	@r15+,r7
 15.4665 -+	rts
 15.4666 -+	 mov.l	@r15+,r7
 15.4667 -+
 15.4668 -+L_pass_i:
 15.4669 -+	mov	#8,r0
 15.4670 -+	cmp/hs	r0,r2
 15.4671 -+	bt/s	2f
 15.4672 -+	 shlr2	r3
 15.4673 -+	bsr	L_pop_i
 15.4674 -+	 nop
 15.4675 -+2:
 15.4676 -+	add	#1,r2
 15.4677 -+	bra	L_pass
 15.4678 -+	 add	#-4,r8
 15.4679 -+
 15.4680 -+L_pop_i:
 15.4681 -+	mov	r2,r0
 15.4682 -+	shll2	r0
 15.4683 -+	add	#-16,r0
 15.4684 -+	braf	r0
 15.4685 -+	 nop
 15.4686 -+	rts
 15.4687 -+	 mov.l	@r15+,r4
 15.4688 -+	rts
 15.4689 -+	 mov.l	@r15+,r5
 15.4690 -+	rts
 15.4691 -+	 mov.l	@r15+,r6
 15.4692 -+	rts
 15.4693 -+	 mov.l	@r15+,r7
 15.4694 -+
 15.4695 -+L_call_it:
 15.4696 -+	# call function
 15.4697 -+#if (! STRUCT_VALUE_ADDRESS_WITH_ARG)
 15.4698 -+	mov	r10, r2
 15.4699 -+#endif
 15.4700 -+	mov.l  @(28,r14),r1
 15.4701 -+	jsr    @r1
 15.4702 -+	 nop
 15.4703 -+
 15.4704 -+L_ret_d:
 15.4705 -+	mov	#FFI_TYPE_DOUBLE,r2
 15.4706 -+	cmp/eq	r2,r9
 15.4707 -+	bf	L_ret_ll
 15.4708 -+
 15.4709 -+	mov.l	@(24,r14),r2
 15.4710 -+	mov.l	r0,@r2
 15.4711 -+	bra	L_epilogue
 15.4712 -+	 mov.l	r1,@(4,r2)
 15.4713 -+
 15.4714 -+L_ret_ll:
 15.4715 -+	mov	#FFI_TYPE_SINT64,r2
 15.4716 -+	cmp/eq	r2,r9
 15.4717 -+	bt/s	1f
 15.4718 -+	 mov	#FFI_TYPE_UINT64,r2
 15.4719 -+	cmp/eq	r2,r9
 15.4720 -+	bf	L_ret_i
 15.4721 -+
 15.4722 -+1:
 15.4723 -+	mov.l	@(24,r14),r2
 15.4724 -+	mov.l	r0,@r2
 15.4725 -+	bra	L_epilogue
 15.4726 -+	 mov.l	r1,@(4,r2)
 15.4727 -+
 15.4728 -+L_ret_i:
 15.4729 -+	mov	#FFI_TYPE_FLOAT,r2
 15.4730 -+	cmp/eq	r2,r9
 15.4731 -+	bt	1f
 15.4732 -+	mov	#FFI_TYPE_INT,r2
 15.4733 -+	cmp/eq	r2,r9
 15.4734 -+	bf	L_epilogue
 15.4735 -+1:
 15.4736 -+	mov.l	@(24,r14),r1
 15.4737 -+	bra	L_epilogue
 15.4738 -+	 mov.l	r0,@r1
 15.4739 -+
 15.4740 -+L_epilogue:
 15.4741 -+	# Remove the space we pushed for the args
 15.4742 -+	mov   r14,r15
 15.4743 -+
 15.4744 -+	lds.l  @r15+,pr
 15.4745 -+	mov.l  @r15+,r14
 15.4746 -+	mov.l  @r15+,r12
 15.4747 -+	mov.l  @r15+,r10
 15.4748 -+	mov.l  @r15+,r9
 15.4749 -+	rts
 15.4750 -+	 mov.l  @r15+,r8
 15.4751 -+#endif
 15.4752 -+.LFE1:
 15.4753 -+.ffi_call_SYSV_end:
 15.4754 -+        .size    CNAME(ffi_call_SYSV),.ffi_call_SYSV_end-CNAME(ffi_call_SYSV)
 15.4755 -+
 15.4756 -+.globl	ffi_closure_helper_SYSV
 15.4757 -+
 15.4758 -+ENTRY(ffi_closure_SYSV)
 15.4759 -+.LFB2:
 15.4760 -+	mov.l	r14,@-r15
 15.4761 -+.LCFI7:
 15.4762 -+	sts.l	pr,@-r15
 15.4763 -+
 15.4764 -+	/* Stack layout:	
 15.4765 -+	   ...
 15.4766 -+	   32 bytes (floating register parameters, SH-4 only)
 15.4767 -+	   16 bytes (register parameters)
 15.4768 -+	    4 bytes (result)
 15.4769 -+	    4 bytes (5th arg)
 15.4770 -+	   <- new stack pointer
 15.4771 -+	*/
 15.4772 -+.LCFI8:
 15.4773 -+#if defined(__SH4__)
 15.4774 -+	add	#-56,r15
 15.4775 -+#else
 15.4776 -+	add	#-24,r15
 15.4777 -+#endif
 15.4778 -+.LCFI9:
 15.4779 -+	mov	r15,r14
 15.4780 -+.LCFIA:
 15.4781 -+	mov	r14,r1
 15.4782 -+	add	#24,r1
 15.4783 -+	mov.l	r7,@-r1
 15.4784 -+	mov.l	r6,@-r1
 15.4785 -+	mov.l	r5,@-r1
 15.4786 -+	mov.l	r4,@-r1
 15.4787 -+	mov	r1,r6
 15.4788 -+
 15.4789 -+#if defined(__SH4__)
 15.4790 -+	mov	r14,r1
 15.4791 -+	add	#56,r1
 15.4792 -+#ifdef __LITTLE_ENDIAN__
 15.4793 -+	fmov.s	fr10,@-r1
 15.4794 -+	fmov.s	fr11,@-r1
 15.4795 -+	fmov.s	fr8,@-r1
 15.4796 -+	fmov.s	fr9,@-r1
 15.4797 -+	fmov.s	fr6,@-r1
 15.4798 -+	fmov.s	fr7,@-r1
 15.4799 -+	fmov.s	fr4,@-r1
 15.4800 -+	fmov.s	fr5,@-r1
 15.4801 -+#else
 15.4802 -+	fmov.s	fr11,@-r1
 15.4803 -+	fmov.s	fr10,@-r1
 15.4804 -+	fmov.s	fr9,@-r1
 15.4805 -+	fmov.s	fr8,@-r1
 15.4806 -+	fmov.s	fr7,@-r1
 15.4807 -+	fmov.s	fr6,@-r1
 15.4808 -+	fmov.s	fr5,@-r1
 15.4809 -+	fmov.s	fr4,@-r1
 15.4810 -+#endif
 15.4811 -+	mov	r1,r7
 15.4812 -+#endif
 15.4813 -+
 15.4814 -+	mov	r14,r1
 15.4815 -+	add	#4,r1
 15.4816 -+	mov	r1,r5
 15.4817 -+
 15.4818 -+	mov	r14,r1
 15.4819 -+#if defined(__SH4__)
 15.4820 -+	add	#64,r1
 15.4821 -+#else
 15.4822 -+	add	#32,r1
 15.4823 -+#endif
 15.4824 -+	mov.l	r1,@r14
 15.4825 -+
 15.4826 -+	mov.l	L_helper,r0
 15.4827 -+	jsr	@r0
 15.4828 -+	 mov	r3,r4
 15.4829 -+
 15.4830 -+	shll	r0
 15.4831 -+	mov	r0,r1
 15.4832 -+	mova	L_table,r0
 15.4833 -+	add	r1,r0
 15.4834 -+	mov.w	@r0,r0
 15.4835 -+	mov	r14,r2
 15.4836 -+	braf	r0
 15.4837 -+	 add	#4,r2
 15.4838 -+0:
 15.4839 -+	.align 2
 15.4840 -+L_helper:
 15.4841 -+	.long	ffi_closure_helper_SYSV
 15.4842 -+L_table:
 15.4843 -+	.short L_case_v - 0b	/* FFI_TYPE_VOID */
 15.4844 -+	.short L_case_i - 0b	/* FFI_TYPE_INT */
 15.4845 -+#if defined(__SH4__)
 15.4846 -+	.short L_case_f - 0b	/* FFI_TYPE_FLOAT */
 15.4847 -+	.short L_case_d - 0b	/* FFI_TYPE_DOUBLE */
 15.4848 -+	.short L_case_d - 0b	/* FFI_TYPE_LONGDOUBLE */
 15.4849 -+#else
 15.4850 -+	.short L_case_i - 0b	/* FFI_TYPE_FLOAT */
 15.4851 -+	.short L_case_ll - 0b	/* FFI_TYPE_DOUBLE */
 15.4852 -+	.short L_case_ll - 0b	/* FFI_TYPE_LONGDOUBLE */
 15.4853 -+#endif
 15.4854 -+	.short L_case_uq - 0b	/* FFI_TYPE_UINT8 */
 15.4855 -+	.short L_case_q - 0b	/* FFI_TYPE_SINT8 */
 15.4856 -+	.short L_case_uh - 0b	/* FFI_TYPE_UINT16 */
 15.4857 -+	.short L_case_h - 0b	/* FFI_TYPE_SINT16 */
 15.4858 -+	.short L_case_i - 0b	/* FFI_TYPE_UINT32 */
 15.4859 -+	.short L_case_i - 0b	/* FFI_TYPE_SINT32 */
 15.4860 -+	.short L_case_ll - 0b	/* FFI_TYPE_UINT64 */
 15.4861 -+	.short L_case_ll - 0b	/* FFI_TYPE_SINT64 */
 15.4862 -+	.short L_case_v - 0b	/* FFI_TYPE_STRUCT */
 15.4863 -+	.short L_case_i - 0b	/* FFI_TYPE_POINTER */
 15.4864 -+
 15.4865 -+#if defined(__SH4__)
 15.4866 -+L_case_d:
 15.4867 -+#ifdef __LITTLE_ENDIAN__
 15.4868 -+	fmov.s	@r2+,fr1
 15.4869 -+	bra	L_case_v
 15.4870 -+	 fmov.s	@r2,fr0
 15.4871 -+#else
 15.4872 -+	fmov.s	@r2+,fr0
 15.4873 -+	bra	L_case_v
 15.4874 -+	 fmov.s	@r2,fr1
 15.4875 -+#endif
 15.4876 -+
 15.4877 -+L_case_f:
 15.4878 -+	bra	L_case_v
 15.4879 -+	 fmov.s	@r2,fr0
 15.4880 -+#endif
 15.4881 -+	
 15.4882 -+L_case_ll:
 15.4883 -+	mov.l	@r2+,r0
 15.4884 -+	bra	L_case_v
 15.4885 -+	 mov.l	@r2,r1
 15.4886 -+	
 15.4887 -+L_case_i:
 15.4888 -+	bra	L_case_v
 15.4889 -+	 mov.l	@r2,r0
 15.4890 -+	
 15.4891 -+L_case_q:
 15.4892 -+#ifdef __LITTLE_ENDIAN__
 15.4893 -+#else
 15.4894 -+	add	#3,r2
 15.4895 -+#endif
 15.4896 -+	bra	L_case_v
 15.4897 -+	 mov.b	@r2,r0
 15.4898 -+
 15.4899 -+L_case_uq:
 15.4900 -+#ifdef __LITTLE_ENDIAN__
 15.4901 -+#else
 15.4902 -+	add	#3,r2
 15.4903 -+#endif
 15.4904 -+	mov.b	@r2,r0
 15.4905 -+	bra	L_case_v
 15.4906 -+	 extu.b r0,r0
 15.4907 -+
 15.4908 -+L_case_h:
 15.4909 -+#ifdef __LITTLE_ENDIAN__
 15.4910 -+#else
 15.4911 -+	add	#2,r2
 15.4912 -+#endif
 15.4913 -+	bra	L_case_v
 15.4914 -+	 mov.w	@r2,r0
 15.4915 -+
 15.4916 -+L_case_uh:
 15.4917 -+#ifdef __LITTLE_ENDIAN__
 15.4918 -+#else
 15.4919 -+	add	#2,r2
 15.4920 -+#endif
 15.4921 -+	mov.w	@r2,r0
 15.4922 -+	extu.w	r0,r0
 15.4923 -+	/* fall through */
 15.4924 -+
 15.4925 -+L_case_v:
 15.4926 -+#if defined(__SH4__)
 15.4927 -+	add	#56,r15
 15.4928 -+#else
 15.4929 -+	add	#24,r15
 15.4930 -+#endif
 15.4931 -+	lds.l	@r15+,pr
 15.4932 -+	rts
 15.4933 -+	 mov.l	@r15+,r14
 15.4934 -+.LFE2:
 15.4935 -+.ffi_closure_SYSV_end:
 15.4936 -+        .size    CNAME(ffi_closure_SYSV),.ffi_closure_SYSV_end-CNAME(ffi_closure_SYSV)
 15.4937 -+
 15.4938 -+	.section	".eh_frame","aw",@progbits
 15.4939 -+__FRAME_BEGIN__:
 15.4940 -+	.4byte	.LECIE1-.LSCIE1	/* Length of Common Information Entry */
 15.4941 -+.LSCIE1:
 15.4942 -+	.4byte	0x0	/* CIE Identifier Tag */
 15.4943 -+	.byte	0x1	/* CIE Version */
 15.4944 -+	.byte	0x0	/* CIE Augmentation */
 15.4945 -+	.byte	0x1	/* uleb128 0x1; CIE Code Alignment Factor */
 15.4946 -+	.byte	0x7c	/* sleb128 -4; CIE Data Alignment Factor */
 15.4947 -+	.byte	0x11	/* CIE RA Column */
 15.4948 -+	.byte	0xc	/* DW_CFA_def_cfa */
 15.4949 -+	.byte	0xf	/* uleb128 0xf */
 15.4950 -+	.byte	0x0	/* uleb128 0x0 */
 15.4951 -+	.align	2
 15.4952 -+.LECIE1:
 15.4953 -+.LSFDE1:
 15.4954 -+	.4byte	.LEFDE1-.LASFDE1	/* FDE Length */
 15.4955 -+.LASFDE1:
 15.4956 -+	.4byte	.LASFDE1-__FRAME_BEGIN__	/* FDE CIE offset */
 15.4957 -+	.4byte	.LFB1	/* FDE initial location */
 15.4958 -+	.4byte	.LFE1-.LFB1	 /* FDE address range */
 15.4959 -+	.byte	0x4	/* DW_CFA_advance_loc4 */
 15.4960 -+	.4byte	.LCFI0-.LFB1
 15.4961 -+	.byte	0xe	/* DW_CFA_def_cfa_offset */
 15.4962 -+	.byte	0x4	/* uleb128 0x4 */
 15.4963 -+	.byte	0x4	/* DW_CFA_advance_loc4 */
 15.4964 -+	.4byte	.LCFI1-.LCFI0
 15.4965 -+	.byte	0xe	/* DW_CFA_def_cfa_offset */
 15.4966 -+	.byte	0x8	/* uleb128 0x4 */
 15.4967 -+	.byte	0x4	/* DW_CFA_advance_loc4 */
 15.4968 -+	.4byte	.LCFI2-.LCFI1
 15.4969 -+	.byte	0xe	/* DW_CFA_def_cfa_offset */
 15.4970 -+	.byte	0xc	/* uleb128 0x4 */
 15.4971 -+	.byte	0x4	/* DW_CFA_advance_loc4 */
 15.4972 -+	.4byte	.LCFI3-.LCFI2
 15.4973 -+	.byte	0xe	/* DW_CFA_def_cfa_offset */
 15.4974 -+	.byte	0x10	/* uleb128 0x4 */
 15.4975 -+	.byte	0x4	/* DW_CFA_advance_loc4 */
 15.4976 -+	.4byte	.LCFI4-.LCFI3
 15.4977 -+	.byte	0xe	/* DW_CFA_def_cfa_offset */
 15.4978 -+	.byte	0x14	/* uleb128 0x4 */
 15.4979 -+	.byte	0x4	/* DW_CFA_advance_loc4 */
 15.4980 -+	.4byte	.LCFI5-.LCFI4
 15.4981 -+	.byte	0xe	/* DW_CFA_def_cfa_offset */
 15.4982 -+	.byte	0x18	/* uleb128 0x4 */
 15.4983 -+	.byte	0x91	/* DW_CFA_offset, column 0x11 */
 15.4984 -+	.byte	0x6	/* uleb128 0x6 */
 15.4985 -+	.byte	0x8e	/* DW_CFA_offset, column 0xe */
 15.4986 -+	.byte	0x5	/* uleb128 0x5 */
 15.4987 -+	.byte	0x8c	/* DW_CFA_offset, column 0xc */
 15.4988 -+	.byte	0x4	/* uleb128 0x4 */
 15.4989 -+	.byte	0x8a	/* DW_CFA_offset, column 0xa */
 15.4990 -+	.byte	0x3	/* uleb128 0x3 */
 15.4991 -+	.byte	0x89	/* DW_CFA_offset, column 0x9 */
 15.4992 -+	.byte	0x2	/* uleb128 0x2 */
 15.4993 -+	.byte	0x88	/* DW_CFA_offset, column 0x8 */
 15.4994 -+	.byte	0x1	/* uleb128 0x1 */
 15.4995 -+	.byte	0x4	/* DW_CFA_advance_loc4 */
 15.4996 -+	.4byte	.LCFI6-.LCFI5
 15.4997 -+	.byte	0xd	/* DW_CFA_def_cfa_register */
 15.4998 -+	.byte	0xe	/* uleb128 0xe */
 15.4999 -+	.align	2
 15.5000 -+.LEFDE1:
 15.5001 -+
 15.5002 -+.LSFDE3:
 15.5003 -+	.4byte	.LEFDE3-.LASFDE3	/* FDE Length */
 15.5004 -+.LASFDE3:
 15.5005 -+	.4byte	.LASFDE3-__FRAME_BEGIN__	/* FDE CIE offset */
 15.5006 -+	.4byte	.LFB2	/* FDE initial location */
 15.5007 -+	.4byte	.LFE2-.LFB2	 /* FDE address range */
 15.5008 -+	.byte	0x4	/* DW_CFA_advance_loc4 */
 15.5009 -+	.4byte	.LCFI7-.LFB2
 15.5010 -+	.byte	0xe	/* DW_CFA_def_cfa_offset */
 15.5011 -+	.byte	0x4	/* uleb128 0x4 */
 15.5012 -+	.byte	0x4	/* DW_CFA_advance_loc4 */
 15.5013 -+	.4byte	.LCFI8-.LCFI7
 15.5014 -+	.byte	0xe	/* DW_CFA_def_cfa_offset */
 15.5015 -+	.byte	0x8	/* uleb128 0x8 */
 15.5016 -+	.byte	0x4	/* DW_CFA_advance_loc4 */
 15.5017 -+	.4byte	.LCFI9-.LCFI8
 15.5018 -+	.byte	0xe	/* DW_CFA_def_cfa_offset */
 15.5019 -+#if defined(__SH4__)
 15.5020 -+	.byte	8+56	/* uleb128 8+56 */
 15.5021 -+#else
 15.5022 -+	.byte	8+24	/* uleb128 8+24 */
 15.5023 -+#endif
 15.5024 -+	.byte	0x91	/* DW_CFA_offset, column 0x11 */
 15.5025 -+        .byte	0x2
 15.5026 -+        .byte	0x8e	/* DW_CFA_offset, column 0xe */
 15.5027 -+        .byte	0x1
 15.5028 -+	.byte	0x4	/* DW_CFA_advance_loc4 */
 15.5029 -+	.4byte	.LCFIA-.LCFI9
 15.5030 -+	.byte	0xd	/* DW_CFA_def_cfa_register */
 15.5031 -+	.byte	0xe	/* uleb128 0xe */
 15.5032 -+	.align	2
 15.5033 -+.LEFDE3:
 15.5034 -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/sparc/ffi.c gcc/libffi/src/sparc/ffi.c
 15.5035 ---- gcc-3.2.2.orig/libffi/src/sparc/ffi.c	Sat Mar  3 07:21:23 2001
 15.5036 -+++ gcc/libffi/src/sparc/ffi.c	Sat Jan  4 08:08:56 2003
 15.5037 -@@ -1,5 +1,5 @@
 15.5038 - /* -----------------------------------------------------------------------
 15.5039 --   ffi.c - Copyright (c) 1996 Cygnus Solutions
 15.5040 -+   ffi.c - Copyright (c) 1996, 2003 Cygnus Solutions
 15.5041 -    
 15.5042 -    Sparc Foreign Function Interface 
 15.5043 - 
 15.5044 -@@ -28,20 +28,22 @@
 15.5045 - 
 15.5046 - #include <stdlib.h>
 15.5047 - 
 15.5048 -+#ifdef SPARC64
 15.5049 -+extern void ffi_closure_v9(void);
 15.5050 -+#else
 15.5051 -+extern void ffi_closure_v8(void);
 15.5052 -+#endif
 15.5053 -+
 15.5054 - /* ffi_prep_args is called by the assembly routine once stack space
 15.5055 -    has been allocated for the function's arguments */
 15.5056 - 
 15.5057 - void ffi_prep_args_v8(char *stack, extended_cif *ecif)
 15.5058 - {
 15.5059 -   int i;
 15.5060 --  int tmp;
 15.5061 --  int avn;
 15.5062 -   void **p_argv;
 15.5063 -   char *argp;
 15.5064 -   ffi_type **p_arg;
 15.5065 - 
 15.5066 --  tmp = 0;
 15.5067 --
 15.5068 -   /* Skip 16 words for the window save area */
 15.5069 -   argp = stack + 16*sizeof(int);
 15.5070 - 
 15.5071 -@@ -66,18 +68,12 @@
 15.5072 -   ((int*)argp)[5] = 0;
 15.5073 - #endif
 15.5074 - 
 15.5075 --  avn = ecif->cif->nargs;
 15.5076 -   p_argv = ecif->avalue;
 15.5077 - 
 15.5078 --  for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types;
 15.5079 --       i && avn;
 15.5080 --       i--, p_arg++)
 15.5081 -+  for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; i; i--, p_arg++)
 15.5082 -     {
 15.5083 -       size_t z;
 15.5084 - 
 15.5085 --      if (avn) 
 15.5086 --	{
 15.5087 --	  avn--;
 15.5088 - 	  if ((*p_arg)->type == FFI_TYPE_STRUCT
 15.5089 - #if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
 15.5090 - 	      || (*p_arg)->type == FFI_TYPE_LONGDOUBLE
 15.5091 -@@ -122,7 +118,6 @@
 15.5092 - 	    }
 15.5093 - 	  p_argv++;
 15.5094 - 	  argp += z;
 15.5095 --	}
 15.5096 -     }
 15.5097 -   
 15.5098 -   return;
 15.5099 -@@ -420,3 +415,101 @@
 15.5100 -     }
 15.5101 - 
 15.5102 - }
 15.5103 -+
 15.5104 -+ffi_status
 15.5105 -+ffi_prep_closure (ffi_closure* closure,
 15.5106 -+		  ffi_cif* cif,
 15.5107 -+		  void (*fun)(ffi_cif*, void*, void**, void*),
 15.5108 -+		  void *user_data)
 15.5109 -+{
 15.5110 -+  unsigned int *tramp = (unsigned int *) &closure->tramp[0];
 15.5111 -+  unsigned long fn;
 15.5112 -+  unsigned long ctx = (unsigned long) closure;
 15.5113 -+
 15.5114 -+#ifdef SPARC64
 15.5115 -+  /* Trampoline address is equal to the closure address.  We take advantage
 15.5116 -+     of that to reduce the trampoline size by 8 bytes. */
 15.5117 -+  FFI_ASSERT (cif->abi == FFI_V9);
 15.5118 -+  fn = (unsigned long) ffi_closure_v9;
 15.5119 -+  tramp[0] = 0x83414000;	/* rd	%pc, %g1	*/
 15.5120 -+  tramp[1] = 0xca586010;	/* ldx	[%g1+16], %g5	*/
 15.5121 -+  tramp[2] = 0x81c14000;	/* jmp	%g5		*/
 15.5122 -+  tramp[3] = 0x01000000;	/* nop			*/
 15.5123 -+  *((unsigned long *) &tramp[4]) = fn;
 15.5124 -+#else
 15.5125 -+  FFI_ASSERT (cif->abi == FFI_V8);
 15.5126 -+  fn = (unsigned long) ffi_closure_v8;
 15.5127 -+  tramp[0] = 0x03000000 | fn >> 10;	/* sethi %hi(fn), %g1	*/
 15.5128 -+  tramp[1] = 0x05000000 | ctx >> 10;	/* sethi %hi(ctx), %g2	*/
 15.5129 -+  tramp[2] = 0x81c06000 | (fn & 0x3ff);	/* jmp   %g1+%lo(fn)	*/
 15.5130 -+  tramp[3] = 0x8410a000 | (ctx & 0x3ff);/* or    %g2, %lo(ctx)	*/
 15.5131 -+#endif
 15.5132 -+
 15.5133 -+  closure->cif = cif;
 15.5134 -+  closure->fun = fun;
 15.5135 -+  closure->user_data = user_data;
 15.5136 -+
 15.5137 -+  /* Flush the Icache.  FIXME: alignment isn't certain, assume 8 bytes */
 15.5138 -+#ifdef SPARC64
 15.5139 -+  asm volatile ("flush	%0" : : "r" (closure) : "memory");
 15.5140 -+  asm volatile ("flush	%0" : : "r" (((char *) closure) + 8) : "memory");
 15.5141 -+#else
 15.5142 -+  asm volatile ("iflush	%0" : : "r" (closure) : "memory");
 15.5143 -+  asm volatile ("iflush	%0" : : "r" (((char *) closure) + 8) : "memory");
 15.5144 -+#endif
 15.5145 -+
 15.5146 -+  return FFI_OK;
 15.5147 -+}
 15.5148 -+
 15.5149 -+int
 15.5150 -+ffi_closure_sparc_inner(ffi_closure *closure,
 15.5151 -+  void *rvalue, unsigned long *gpr, double *fpr)
 15.5152 -+{
 15.5153 -+  ffi_cif *cif;
 15.5154 -+  void **avalue;
 15.5155 -+  ffi_type **arg_types;
 15.5156 -+  int i, avn, argn;
 15.5157 -+
 15.5158 -+  cif = closure->cif;
 15.5159 -+  avalue = alloca(cif->nargs * sizeof(void *));
 15.5160 -+
 15.5161 -+  argn = 0;
 15.5162 -+
 15.5163 -+  /* Copy the caller's structure return address to that the closure
 15.5164 -+     returns the data directly to the caller.  */
 15.5165 -+  if (cif->flags == FFI_TYPE_STRUCT)
 15.5166 -+    {
 15.5167 -+      rvalue = (void *) gpr[0];
 15.5168 -+      argn = 1;
 15.5169 -+    }
 15.5170 -+
 15.5171 -+  i = 0;
 15.5172 -+  avn = cif->nargs;
 15.5173 -+  arg_types = cif->arg_types;
 15.5174 -+  
 15.5175 -+  /* Grab the addresses of the arguments from the stack frame.  */
 15.5176 -+  while (i < avn)
 15.5177 -+    {
 15.5178 -+      /* Assume big-endian.  FIXME */
 15.5179 -+      argn += ALIGN(arg_types[i]->size, SIZEOF_ARG) / SIZEOF_ARG;
 15.5180 -+
 15.5181 -+#ifdef SPARC64
 15.5182 -+      if (i < 6 && (arg_types[i]->type == FFI_TYPE_FLOAT
 15.5183 -+		 || arg_types[i]->type == FFI_TYPE_DOUBLE
 15.5184 -+#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
 15.5185 -+		 || arg_types[i]->type == FFI_TYPE_LONGDOUBLE
 15.5186 -+#endif
 15.5187 -+		))
 15.5188 -+        avalue[i] = ((char *) &fpr[argn]) - arg_types[i]->size;
 15.5189 -+      else
 15.5190 -+#endif
 15.5191 -+        avalue[i] = ((char *) &gpr[argn]) - arg_types[i]->size;
 15.5192 -+      i++;
 15.5193 -+    }
 15.5194 -+
 15.5195 -+  /* Invoke the closure.  */
 15.5196 -+  (closure->fun) (cif, rvalue, avalue, closure->user_data);
 15.5197 -+
 15.5198 -+  /* Tell ffi_closure_sparc how to perform return type promotions.  */
 15.5199 -+  return cif->rtype->type;
 15.5200 -+}
 15.5201 -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/sparc/v8.S gcc/libffi/src/sparc/v8.S
 15.5202 ---- gcc-3.2.2.orig/libffi/src/sparc/v8.S	Mon Apr 29 05:12:04 2002
 15.5203 -+++ gcc/libffi/src/sparc/v8.S	Sat Jan  4 08:08:56 2003
 15.5204 -@@ -1,5 +1,5 @@
 15.5205 - /* -----------------------------------------------------------------------
 15.5206 --   v8.S - Copyright (c) 1996, 1997 Cygnus Solutions
 15.5207 -+   v8.S - Copyright (c) 1996, 1997, 2003 Cygnus Solutions
 15.5208 -    
 15.5209 -    Sparc Foreign Function Interface 
 15.5210 - 
 15.5211 -@@ -94,6 +94,72 @@
 15.5212 - .ffi_call_V8_end:
 15.5213 - 	.size	ffi_call_V8,.ffi_call_V8_end-ffi_call_V8
 15.5214 - 
 15.5215 -+
 15.5216 -+#define	STACKFRAME	104	/* 16*4 register window +
 15.5217 -+				   1*4 struct return +	
 15.5218 -+				   6*4 args backing store +
 15.5219 -+				   3*4 locals */
 15.5220 -+
 15.5221 -+/* ffi_closure_v8(...)
 15.5222 -+
 15.5223 -+   Receives the closure argument in %g2.   */
 15.5224 -+
 15.5225 -+	.text
 15.5226 -+	.align 8
 15.5227 -+	.globl ffi_closure_v8
 15.5228 -+
 15.5229 -+ffi_closure_v8:
 15.5230 -+	.register	%g2, #scratch
 15.5231 -+.LLFB2:
 15.5232 -+	save	%sp, -STACKFRAME, %sp
 15.5233 -+.LLCFI1:
 15.5234 -+
 15.5235 -+	! Store all of the potential argument registers in va_list format.
 15.5236 -+	st	%i0, [%fp+68+0]
 15.5237 -+	st	%i1, [%fp+68+4]
 15.5238 -+	st	%i2, [%fp+68+8]
 15.5239 -+	st	%i3, [%fp+68+12]
 15.5240 -+	st	%i4, [%fp+68+16]
 15.5241 -+	st	%i5, [%fp+68+20]
 15.5242 -+
 15.5243 -+	! Call ffi_closure_sparc_inner to do the bulk of the work.
 15.5244 -+	mov	%g2, %o0
 15.5245 -+	add	%fp, -8, %o1
 15.5246 -+	add	%fp,  68, %o2
 15.5247 -+	call	ffi_closure_sparc_inner
 15.5248 -+	 mov	0, %o3
 15.5249 -+
 15.5250 -+	! Load up the return value in the proper type.
 15.5251 -+	cmp	%o0, FFI_TYPE_VOID
 15.5252 -+	be	done1
 15.5253 -+
 15.5254 -+	cmp	%o0, FFI_TYPE_FLOAT
 15.5255 -+	be,a	done1
 15.5256 -+	 ld	[%fp-8], %f0
 15.5257 -+
 15.5258 -+	cmp	%o0, FFI_TYPE_DOUBLE
 15.5259 -+	be,a	done1
 15.5260 -+	 ldd	[%fp-8], %f0
 15.5261 -+
 15.5262 -+	cmp	%o0, FFI_TYPE_SINT64
 15.5263 -+	be,a	integer
 15.5264 -+	 ld	[%fp-4], %i1
 15.5265 -+
 15.5266 -+	cmp	%o0, FFI_TYPE_UINT64
 15.5267 -+	be,a	integer
 15.5268 -+	 ld	[%fp-4], %i1
 15.5269 -+
 15.5270 -+integer:
 15.5271 -+	ld	[%fp-8], %i0
 15.5272 -+
 15.5273 -+done1:
 15.5274 -+	ret
 15.5275 -+	 restore
 15.5276 -+.LLFE2:
 15.5277 -+
 15.5278 -+.ffi_closure_v8_end:
 15.5279 -+	.size	ffi_closure_v8,.ffi_closure_v8_end-ffi_closure_v8
 15.5280 -+
 15.5281 - #ifdef SPARC64
 15.5282 - #define WS 8
 15.5283 - #define nword	xword
 15.5284 -@@ -148,3 +214,26 @@
 15.5285 - 	.byte	0x1f	! uleb128 0x1f
 15.5286 - 	.align	WS
 15.5287 - .LLEFDE1:
 15.5288 -+.LLSFDE2:
 15.5289 -+	.uaword	.LLEFDE2-.LLASFDE2	! FDE Length
 15.5290 -+.LLASFDE2:
 15.5291 -+	.uaword	.LLASFDE2-.LLframe1	! FDE CIE offset
 15.5292 -+#ifdef HAVE_AS_SPARC_UA_PCREL
 15.5293 -+	.uaword	%r_disp32(.LLFB2)
 15.5294 -+	.uaword	.LLFE2-.LLFB2	! FDE address range
 15.5295 -+#else
 15.5296 -+	.align	WS
 15.5297 -+	.nword	.LLFB2
 15.5298 -+	.uanword .LLFE2-.LLFB2	! FDE address range
 15.5299 -+#endif
 15.5300 -+	.byte	0x0	! uleb128 0x0; Augmentation size
 15.5301 -+	.byte	0x4	! DW_CFA_advance_loc4
 15.5302 -+	.uaword	.LLCFI1-.LLFB2
 15.5303 -+	.byte	0xd	! DW_CFA_def_cfa_register
 15.5304 -+	.byte	0x1e	! uleb128 0x1e
 15.5305 -+	.byte	0x2d	! DW_CFA_GNU_window_save
 15.5306 -+	.byte	0x9	! DW_CFA_register
 15.5307 -+	.byte	0xf	! uleb128 0xf
 15.5308 -+	.byte	0x1f	! uleb128 0x1f
 15.5309 -+	.align	WS
 15.5310 -+.LLEFDE2:
 15.5311 -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/sparc/v9.S gcc/libffi/src/sparc/v9.S
 15.5312 ---- gcc-3.2.2.orig/libffi/src/sparc/v9.S	Mon Apr 29 05:12:04 2002
 15.5313 -+++ gcc/libffi/src/sparc/v9.S	Sat Jan  4 08:08:56 2003
 15.5314 -@@ -1,5 +1,5 @@
 15.5315 - /* -----------------------------------------------------------------------
 15.5316 --   v9.S - Copyright (c) 2000 Cygnus Solutions
 15.5317 -+   v9.S - Copyright (c) 2000, 2003 Cygnus Solutions
 15.5318 -    
 15.5319 -    Sparc 64bit Foreign Function Interface 
 15.5320 - 
 15.5321 -@@ -99,7 +99,7 @@
 15.5322 - 	cmp	%i3, FFI_TYPE_STRUCT
 15.5323 - 	be,pn	%icc, dostruct
 15.5324 - 
 15.5325 --	 cmp	%i3, FFI_TYPE_LONGDOUBLE
 15.5326 -+	cmp	%i3, FFI_TYPE_LONGDOUBLE
 15.5327 - 	bne,pt	%icc, done
 15.5328 - 	 nop
 15.5329 - 	std	%f0, [%i4+0]
 15.5330 -@@ -125,6 +125,88 @@
 15.5331 - .ffi_call_V9_end:
 15.5332 - 	.size	ffi_call_V9,.ffi_call_V9_end-ffi_call_V9
 15.5333 - 
 15.5334 -+
 15.5335 -+#define	STACKFRAME	 240	/* 16*8 register window +
 15.5336 -+				   6*8 args backing store +
 15.5337 -+				   8*8 locals */
 15.5338 -+#define	FP		%fp+STACK_BIAS
 15.5339 -+
 15.5340 -+/* ffi_closure_v9(...)
 15.5341 -+
 15.5342 -+   Receives the closure argument in %g1.   */
 15.5343 -+
 15.5344 -+	.text
 15.5345 -+	.align 8
 15.5346 -+	.globl ffi_closure_v9
 15.5347 -+
 15.5348 -+ffi_closure_v9:
 15.5349 -+.LLFB2:
 15.5350 -+	save	%sp, -STACKFRAME, %sp
 15.5351 -+.LLCFI1:
 15.5352 -+
 15.5353 -+	! Store all of the potential argument registers in va_list format.
 15.5354 -+	stx	%i0, [FP+128+0]
 15.5355 -+	stx	%i1, [FP+128+8]
 15.5356 -+	stx	%i2, [FP+128+16]
 15.5357 -+	stx	%i3, [FP+128+24]
 15.5358 -+	stx	%i4, [FP+128+32]
 15.5359 -+	stx	%i5, [FP+128+40]
 15.5360 -+
 15.5361 -+	! Store possible floating point argument registers too.
 15.5362 -+	std	%f0, [FP-48]
 15.5363 -+	std	%f2, [FP-40]
 15.5364 -+	std	%f4, [FP-32]
 15.5365 -+	std	%f6, [FP-24]
 15.5366 -+	std	%f8, [FP-16]
 15.5367 -+	std	%f10, [FP-8]
 15.5368 -+
 15.5369 -+	! Call ffi_closure_sparc_inner to do the bulk of the work.
 15.5370 -+	mov	%g1, %o0
 15.5371 -+	add	%fp, STACK_BIAS-64, %o1
 15.5372 -+	add	%fp, STACK_BIAS+128, %o2
 15.5373 -+	call	ffi_closure_sparc_inner
 15.5374 -+	 add	%fp, STACK_BIAS-48, %o3
 15.5375 -+
 15.5376 -+	! Load up the return value in the proper type.
 15.5377 -+	cmp	%o0, FFI_TYPE_VOID
 15.5378 -+	be,pn	%icc, done1
 15.5379 -+
 15.5380 -+	cmp	%o0, FFI_TYPE_FLOAT
 15.5381 -+	be,a,pn	%icc, done1
 15.5382 -+	 ld	[FP-64], %f0
 15.5383 -+
 15.5384 -+	cmp	%o0, FFI_TYPE_DOUBLE
 15.5385 -+	be,a,pn	%icc, done1
 15.5386 -+	 ldd	[FP-64], %f0
 15.5387 -+
 15.5388 -+	cmp	%o0, FFI_TYPE_LONGDOUBLE
 15.5389 -+	be,a,pn	%icc, longdouble1
 15.5390 -+	 ldd	[FP-64], %f0
 15.5391 -+
 15.5392 -+	cmp	%o0, FFI_TYPE_STRUCT
 15.5393 -+	be,pn	%icc, struct1
 15.5394 -+
 15.5395 -+	! FFI_TYPE_UINT64 | FFI_TYPE_SINT64 | FFI_TYPE_POINTER
 15.5396 -+	ldx	[FP-64], %i0
 15.5397 -+
 15.5398 -+done1:
 15.5399 -+	ret
 15.5400 -+	 restore
 15.5401 -+
 15.5402 -+struct1:
 15.5403 -+	ldx [FP-56], %i2
 15.5404 -+	ret
 15.5405 -+	 restore
 15.5406 -+
 15.5407 -+longdouble1:
 15.5408 -+	ldd	[FP-56], %f2
 15.5409 -+	ret
 15.5410 -+	 restore
 15.5411 -+.LLFE2:
 15.5412 -+
 15.5413 -+.ffi_closure_v9_end:
 15.5414 -+	.size	ffi_closure_v9,.ffi_closure_v9_end-ffi_closure_v9
 15.5415 -+
 15.5416 - 	.section	".eh_frame",#alloc,#write
 15.5417 - .LLframe1:
 15.5418 - 	.uaword	.LLECIE1-.LLSCIE1	! Length of Common Information Entry
 15.5419 -@@ -169,5 +251,27 @@
 15.5420 - 	.byte	0x1f	! uleb128 0x1f
 15.5421 - 	.align 8
 15.5422 - .LLEFDE1:
 15.5423 --
 15.5424 -+.LLSFDE2:
 15.5425 -+	.uaword	.LLEFDE2-.LLASFDE2	! FDE Length
 15.5426 -+.LLASFDE2:
 15.5427 -+	.uaword	.LLASFDE2-.LLframe1	! FDE CIE offset
 15.5428 -+#ifdef HAVE_AS_SPARC_UA_PCREL
 15.5429 -+	.uaword	%r_disp32(.LLFB2)
 15.5430 -+	.uaword	.LLFE2-.LLFB2		! FDE address range
 15.5431 -+#else
 15.5432 -+	.align 8
 15.5433 -+	.xword	.LLFB2
 15.5434 -+	.uaxword	.LLFE2-.LLFB2	! FDE address range
 15.5435 -+#endif
 15.5436 -+	.byte	0x0	! uleb128 0x0; Augmentation size
 15.5437 -+	.byte	0x4	! DW_CFA_advance_loc4
 15.5438 -+	.uaword	.LLCFI1-.LLFB2
 15.5439 -+	.byte	0xd	! DW_CFA_def_cfa_register
 15.5440 -+	.byte	0x1e	! uleb128 0x1e
 15.5441 -+	.byte	0x2d	! DW_CFA_GNU_window_save
 15.5442 -+	.byte	0x9	! DW_CFA_register
 15.5443 -+	.byte	0xf	! uleb128 0xf
 15.5444 -+	.byte	0x1f	! uleb128 0x1f
 15.5445 -+	.align 8
 15.5446 -+.LLEFDE2:
 15.5447 - #endif
 15.5448 -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/types.c gcc/libffi/src/types.c
 15.5449 ---- gcc-3.2.2.orig/libffi/src/types.c	Tue Mar 27 11:39:16 2001
 15.5450 -+++ gcc/libffi/src/types.c	Wed Nov 27 07:24:05 2002
 15.5451 -@@ -42,7 +42,8 @@
 15.5452 - FFI_INTEGRAL_TYPEDEF(sint32, 4, 4, FFI_TYPE_SINT32);
 15.5453 - FFI_INTEGRAL_TYPEDEF(float, 4, 4, FFI_TYPE_FLOAT);
 15.5454 - 
 15.5455 --#if defined ALPHA || defined SPARC64
 15.5456 -+#if defined ALPHA || defined SPARC64 || defined X86_64 || defined S390X \
 15.5457 -+    || defined IA64
 15.5458 - 
 15.5459 - FFI_INTEGRAL_TYPEDEF(pointer, 8, 8, FFI_TYPE_POINTER);
 15.5460 - 
 15.5461 -@@ -52,22 +53,12 @@
 15.5462 - 
 15.5463 - #endif
 15.5464 - 
 15.5465 --#ifdef X86
 15.5466 -+#if defined X86 || defined X86_WIN32 || defined ARM || defined M68K
 15.5467 - 
 15.5468 - FFI_INTEGRAL_TYPEDEF(uint64, 8, 4, FFI_TYPE_UINT64);
 15.5469 - FFI_INTEGRAL_TYPEDEF(sint64, 8, 4, FFI_TYPE_SINT64);
 15.5470 - 
 15.5471 --#elif defined X86_WIN32
 15.5472 --
 15.5473 --FFI_INTEGRAL_TYPEDEF(uint64, 8, 4, FFI_TYPE_UINT64);
 15.5474 --FFI_INTEGRAL_TYPEDEF(sint64, 8, 4, FFI_TYPE_SINT64);
 15.5475 --
 15.5476 --#elif defined ARM
 15.5477 --
 15.5478 --FFI_INTEGRAL_TYPEDEF(uint64, 8, 4, FFI_TYPE_UINT64);
 15.5479 --FFI_INTEGRAL_TYPEDEF(sint64, 8, 4, FFI_TYPE_SINT64);
 15.5480 --
 15.5481 --#elif defined M68K
 15.5482 -+#elif defined SH
 15.5483 - 
 15.5484 - FFI_INTEGRAL_TYPEDEF(uint64, 8, 4, FFI_TYPE_UINT64);
 15.5485 - FFI_INTEGRAL_TYPEDEF(sint64, 8, 4, FFI_TYPE_SINT64);
 15.5486 -@@ -80,12 +71,7 @@
 15.5487 - #endif
 15.5488 - 
 15.5489 - 
 15.5490 --#ifdef X86
 15.5491 --
 15.5492 --FFI_INTEGRAL_TYPEDEF(double, 8, 4, FFI_TYPE_DOUBLE);
 15.5493 --FFI_INTEGRAL_TYPEDEF(longdouble, 12, 4, FFI_TYPE_LONGDOUBLE);
 15.5494 --
 15.5495 --#elif defined X86_WIN32
 15.5496 -+#if defined X86 || defined X86_WIN32 || defined M68K
 15.5497 - 
 15.5498 - FFI_INTEGRAL_TYPEDEF(double, 8, 4, FFI_TYPE_DOUBLE);
 15.5499 - FFI_INTEGRAL_TYPEDEF(longdouble, 12, 4, FFI_TYPE_LONGDOUBLE);
 15.5500 -@@ -95,25 +81,25 @@
 15.5501 - FFI_INTEGRAL_TYPEDEF(double, 8, 4, FFI_TYPE_DOUBLE);
 15.5502 - FFI_INTEGRAL_TYPEDEF(longdouble, 8, 4, FFI_TYPE_LONGDOUBLE);
 15.5503 - 
 15.5504 --#elif defined M68K
 15.5505 -+#elif defined SH
 15.5506 - 
 15.5507 - FFI_INTEGRAL_TYPEDEF(double, 8, 4, FFI_TYPE_DOUBLE);
 15.5508 --FFI_INTEGRAL_TYPEDEF(longdouble, 12, 4, FFI_TYPE_LONGDOUBLE);
 15.5509 -+FFI_INTEGRAL_TYPEDEF(longdouble, 8, 4, FFI_TYPE_LONGDOUBLE);
 15.5510 - 
 15.5511 - #elif defined SPARC
 15.5512 - 
 15.5513 - FFI_INTEGRAL_TYPEDEF(double, 8, 8, FFI_TYPE_DOUBLE);
 15.5514 --
 15.5515 - #ifdef SPARC64
 15.5516 --
 15.5517 - FFI_INTEGRAL_TYPEDEF(longdouble, 16, 16, FFI_TYPE_LONGDOUBLE);
 15.5518 --
 15.5519 - #else
 15.5520 --
 15.5521 - FFI_INTEGRAL_TYPEDEF(longdouble, 16, 8, FFI_TYPE_LONGDOUBLE);
 15.5522 --
 15.5523 - #endif
 15.5524 - 
 15.5525 -+#elif defined X86_64
 15.5526 -+
 15.5527 -+FFI_INTEGRAL_TYPEDEF(double, 8, 8, FFI_TYPE_DOUBLE);
 15.5528 -+FFI_INTEGRAL_TYPEDEF(longdouble, 16, 16, FFI_TYPE_LONGDOUBLE);
 15.5529 -+
 15.5530 - #else
 15.5531 - 
 15.5532 - FFI_INTEGRAL_TYPEDEF(double, 8, 8, FFI_TYPE_DOUBLE);
 15.5533 -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/x86/ffi.c gcc/libffi/src/x86/ffi.c
 15.5534 ---- gcc-3.2.2.orig/libffi/src/x86/ffi.c	Tue May 28 18:22:08 2002
 15.5535 -+++ gcc/libffi/src/x86/ffi.c	Fri Dec  6 10:16:45 2002
 15.5536 -@@ -1,5 +1,8 @@
 15.5537 - /* -----------------------------------------------------------------------
 15.5538 --   ffi.c - Copyright (c) 1996, 1998, 1999  Cygnus Solutions
 15.5539 -+   ffi.c - Copyright (c) 1996, 1998, 1999, 2001  Red Hat, Inc.
 15.5540 -+           Copyright (c) 2002  Ranjit Mathew
 15.5541 -+           Copyright (c) 2002  Bo Thorsen
 15.5542 -+           Copyright (c) 2002  Roger Sayle
 15.5543 -    
 15.5544 -    x86 Foreign Function Interface 
 15.5545 - 
 15.5546 -@@ -23,6 +26,8 @@
 15.5547 -    OTHER DEALINGS IN THE SOFTWARE.
 15.5548 -    ----------------------------------------------------------------------- */
 15.5549 - 
 15.5550 -+#ifndef __x86_64__
 15.5551 -+
 15.5552 - #include <ffi.h>
 15.5553 - #include <ffi_common.h>
 15.5554 - 
 15.5555 -@@ -36,12 +41,10 @@
 15.5556 - /*@=exportheader@*/
 15.5557 - {
 15.5558 -   register unsigned int i;
 15.5559 --  register int tmp;
 15.5560 -   register void **p_argv;
 15.5561 -   register char *argp;
 15.5562 -   register ffi_type **p_arg;
 15.5563 - 
 15.5564 --  tmp = 0;
 15.5565 -   argp = stack;
 15.5566 - 
 15.5567 -   if (ecif->cif->rtype->type == FFI_TYPE_STRUCT)
 15.5568 -@@ -148,6 +151,18 @@
 15.5569 - /*@=declundef@*/
 15.5570 - /*@=exportheader@*/
 15.5571 - 
 15.5572 -+#ifdef X86_WIN32
 15.5573 -+/*@-declundef@*/
 15.5574 -+/*@-exportheader@*/
 15.5575 -+extern void ffi_call_STDCALL(void (*)(char *, extended_cif *),
 15.5576 -+			  /*@out@*/ extended_cif *,
 15.5577 -+			  unsigned, unsigned,
 15.5578 -+			  /*@out@*/ unsigned *,
 15.5579 -+			  void (*fn)());
 15.5580 -+/*@=declundef@*/
 15.5581 -+/*@=exportheader@*/
 15.5582 -+#endif /* X86_WIN32 */
 15.5583 -+
 15.5584 - void ffi_call(/*@dependent@*/ ffi_cif *cif, 
 15.5585 - 	      void (*fn)(), 
 15.5586 - 	      /*@out@*/ void *rvalue, 
 15.5587 -@@ -180,6 +195,14 @@
 15.5588 - 		    cif->flags, ecif.rvalue, fn);
 15.5589 -       /*@=usedef@*/
 15.5590 -       break;
 15.5591 -+#ifdef X86_WIN32
 15.5592 -+    case FFI_STDCALL:
 15.5593 -+      /*@-usedef@*/
 15.5594 -+      ffi_call_STDCALL(ffi_prep_args, &ecif, cif->bytes,
 15.5595 -+		    cif->flags, ecif.rvalue, fn);
 15.5596 -+      /*@=usedef@*/
 15.5597 -+      break;
 15.5598 -+#endif /* X86_WIN32 */
 15.5599 -     default:
 15.5600 -       FFI_ASSERT(0);
 15.5601 -       break;
 15.5602 -@@ -266,12 +289,10 @@
 15.5603 - /*@=exportheader@*/
 15.5604 - {
 15.5605 -   register unsigned int i;
 15.5606 --  register int tmp;
 15.5607 -   register void **p_argv;
 15.5608 -   register char *argp;
 15.5609 -   register ffi_type **p_arg;
 15.5610 - 
 15.5611 --  tmp = 0;
 15.5612 -   argp = stack;
 15.5613 - 
 15.5614 -   if ( cif->rtype->type == FFI_TYPE_STRUCT ) {
 15.5615 -@@ -281,13 +302,14 @@
 15.5616 - 
 15.5617 -   p_argv = avalue;
 15.5618 - 
 15.5619 --  for (i = cif->nargs, p_arg = cif->arg_types; i != 0; i--, p_arg++)
 15.5620 -+  for (i = cif->nargs, p_arg = cif->arg_types; (i != 0); i--, p_arg++)
 15.5621 -     {
 15.5622 -       size_t z;
 15.5623 - 
 15.5624 -       /* Align if necessary */
 15.5625 --      if (((*p_arg)->alignment - 1) & (unsigned) argp)
 15.5626 -+      if (((*p_arg)->alignment - 1) & (unsigned) argp) {
 15.5627 - 	argp = (char *) ALIGN(argp, (*p_arg)->alignment);
 15.5628 -+      }
 15.5629 - 
 15.5630 -       z = (*p_arg)->size;
 15.5631 - 
 15.5632 -@@ -298,7 +320,7 @@
 15.5633 -       p_argv++;
 15.5634 -       argp += z;
 15.5635 -     }
 15.5636 --
 15.5637 -+  
 15.5638 -   return;
 15.5639 - }
 15.5640 - 
 15.5641 -@@ -449,6 +471,15 @@
 15.5642 - 	      /*@out@*/ unsigned *, 
 15.5643 - 	      void (*fn)());
 15.5644 - 
 15.5645 -+#ifdef X86_WIN32
 15.5646 -+extern void
 15.5647 -+ffi_call_STDCALL(void (*)(char *, extended_cif *),
 15.5648 -+	      /*@out@*/ extended_cif *,
 15.5649 -+	      unsigned, unsigned,
 15.5650 -+	      /*@out@*/ unsigned *,
 15.5651 -+	      void (*fn)());
 15.5652 -+#endif /* X86_WIN32 */
 15.5653 -+
 15.5654 - void
 15.5655 - ffi_raw_call(/*@dependent@*/ ffi_cif *cif, 
 15.5656 - 	     void (*fn)(), 
 15.5657 -@@ -483,6 +514,14 @@
 15.5658 - 		    cif->flags, ecif.rvalue, fn);
 15.5659 -       /*@=usedef@*/
 15.5660 -       break;
 15.5661 -+#ifdef X86_WIN32
 15.5662 -+    case FFI_STDCALL:
 15.5663 -+      /*@-usedef@*/
 15.5664 -+      ffi_call_STDCALL(ffi_prep_args_raw, &ecif, cif->bytes,
 15.5665 -+		    cif->flags, ecif.rvalue, fn);
 15.5666 -+      /*@=usedef@*/
 15.5667 -+      break;
 15.5668 -+#endif /* X86_WIN32 */
 15.5669 -     default:
 15.5670 -       FFI_ASSERT(0);
 15.5671 -       break;
 15.5672 -@@ -490,3 +529,5 @@
 15.5673 - }
 15.5674 - 
 15.5675 - #endif
 15.5676 -+
 15.5677 -+#endif /* __x86_64__  */
 15.5678 -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/x86/ffi64.c gcc/libffi/src/x86/ffi64.c
 15.5679 ---- gcc-3.2.2.orig/libffi/src/x86/ffi64.c	Thu Jan  1 09:00:00 1970
 15.5680 -+++ gcc/libffi/src/x86/ffi64.c	Wed Jan 29 00:54:28 2003
 15.5681 -@@ -0,0 +1,706 @@
 15.5682 -+/* -----------------------------------------------------------------------
 15.5683 -+   ffi.c - Copyright (c) 2002  Bo Thorsen <bo@suse.de>
 15.5684 -+   
 15.5685 -+   x86-64 Foreign Function Interface 
 15.5686 -+
 15.5687 -+   Permission is hereby granted, free of charge, to any person obtaining
 15.5688 -+   a copy of this software and associated documentation files (the
 15.5689 -+   ``Software''), to deal in the Software without restriction, including
 15.5690 -+   without limitation the rights to use, copy, modify, merge, publish,
 15.5691 -+   distribute, sublicense, and/or sell copies of the Software, and to
 15.5692 -+   permit persons to whom the Software is furnished to do so, subject to
 15.5693 -+   the following conditions:
 15.5694 -+
 15.5695 -+   The above copyright notice and this permission notice shall be included
 15.5696 -+   in all copies or substantial portions of the Software.
 15.5697 -+
 15.5698 -+   THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
 15.5699 -+   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 15.5700 -+   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 15.5701 -+   IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR
 15.5702 -+   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 15.5703 -+   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 15.5704 -+   OTHER DEALINGS IN THE SOFTWARE.
 15.5705 -+   ----------------------------------------------------------------------- */
 15.5706 -+
 15.5707 -+#include <ffi.h>
 15.5708 -+#include <ffi_common.h>
 15.5709 -+
 15.5710 -+#include <stdlib.h>
 15.5711 -+#include <stdarg.h>
 15.5712 -+
 15.5713 -+/* ffi_prep_args is called by the assembly routine once stack space
 15.5714 -+   has been allocated for the function's arguments */
 15.5715 -+
 15.5716 -+#ifdef __x86_64__
 15.5717 -+
 15.5718 -+#define MAX_GPR_REGS 6
 15.5719 -+#define MAX_SSE_REGS 8
 15.5720 -+typedef struct
 15.5721 -+{
 15.5722 -+  /* Registers for argument passing.  */
 15.5723 -+  long gpr[MAX_GPR_REGS];
 15.5724 -+  __int128_t sse[MAX_SSE_REGS];
 15.5725 -+
 15.5726 -+  /* Stack space for arguments.  */
 15.5727 -+  char argspace[0];
 15.5728 -+} stackLayout;
 15.5729 -+
 15.5730 -+/* All reference to register classes here is identical to the code in
 15.5731 -+   gcc/config/i386/i386.c. Do *not* change one without the other.  */
 15.5732 -+
 15.5733 -+/* Register class used for passing given 64bit part of the argument.
 15.5734 -+   These represent classes as documented by the PS ABI, with the exception
 15.5735 -+   of SSESF, SSEDF classes, that are basically SSE class, just gcc will
 15.5736 -+   use SF or DFmode move instead of DImode to avoid reformating penalties.
 15.5737 -+
 15.5738 -+   Similary we play games with INTEGERSI_CLASS to use cheaper SImode moves
 15.5739 -+   whenever possible (upper half does contain padding).
 15.5740 -+ */
 15.5741 -+enum x86_64_reg_class
 15.5742 -+  {
 15.5743 -+    X86_64_NO_CLASS,
 15.5744 -+    X86_64_INTEGER_CLASS,
 15.5745 -+    X86_64_INTEGERSI_CLASS,
 15.5746 -+    X86_64_SSE_CLASS,
 15.5747 -+    X86_64_SSESF_CLASS,
 15.5748 -+    X86_64_SSEDF_CLASS,
 15.5749 -+    X86_64_SSEUP_CLASS,
 15.5750 -+    X86_64_X87_CLASS,
 15.5751 -+    X86_64_X87UP_CLASS,
 15.5752 -+    X86_64_MEMORY_CLASS
 15.5753 -+  };
 15.5754 -+
 15.5755 -+#define MAX_CLASSES 4
 15.5756 -+
 15.5757 -+/* x86-64 register passing implementation.  See x86-64 ABI for details.  Goal
 15.5758 -+   of this code is to classify each 8bytes of incoming argument by the register
 15.5759 -+   class and assign registers accordingly.  */
 15.5760 -+
 15.5761 -+/* Return the union class of CLASS1 and CLASS2.
 15.5762 -+   See the x86-64 PS ABI for details.  */
 15.5763 -+
 15.5764 -+static enum x86_64_reg_class
 15.5765 -+merge_classes (enum x86_64_reg_class class1, enum x86_64_reg_class class2)
 15.5766 -+{
 15.5767 -+  /* Rule #1: If both classes are equal, this is the resulting class.  */
 15.5768 -+  if (class1 == class2)
 15.5769 -+    return class1;
 15.5770 -+
 15.5771 -+  /* Rule #2: If one of the classes is NO_CLASS, the resulting class is
 15.5772 -+     the other class.  */
 15.5773 -+  if (class1 == X86_64_NO_CLASS)
 15.5774 -+    return class2;
 15.5775 -+  if (class2 == X86_64_NO_CLASS)
 15.5776 -+    return class1;
 15.5777 -+
 15.5778 -+  /* Rule #3: If one of the classes is MEMORY, the result is MEMORY.  */
 15.5779 -+  if (class1 == X86_64_MEMORY_CLASS || class2 == X86_64_MEMORY_CLASS)
 15.5780 -+    return X86_64_MEMORY_CLASS;
 15.5781 -+
 15.5782 -+  /* Rule #4: If one of the classes is INTEGER, the result is INTEGER.  */
 15.5783 -+  if ((class1 == X86_64_INTEGERSI_CLASS && class2 == X86_64_SSESF_CLASS)
 15.5784 -+      || (class2 == X86_64_INTEGERSI_CLASS && class1 == X86_64_SSESF_CLASS))
 15.5785 -+    return X86_64_INTEGERSI_CLASS;
 15.5786 -+  if (class1 == X86_64_INTEGER_CLASS || class1 == X86_64_INTEGERSI_CLASS
 15.5787 -+      || class2 == X86_64_INTEGER_CLASS || class2 == X86_64_INTEGERSI_CLASS)
 15.5788 -+    return X86_64_INTEGER_CLASS;
 15.5789 -+
 15.5790 -+  /* Rule #5: If one of the classes is X87 or X87UP class, MEMORY is used.  */
 15.5791 -+  if (class1 == X86_64_X87_CLASS || class1 == X86_64_X87UP_CLASS
 15.5792 -+      || class2 == X86_64_X87_CLASS || class2 == X86_64_X87UP_CLASS)
 15.5793 -+    return X86_64_MEMORY_CLASS;
 15.5794 -+
 15.5795 -+  /* Rule #6: Otherwise class SSE is used.  */
 15.5796 -+  return X86_64_SSE_CLASS;
 15.5797 -+}
 15.5798 -+
 15.5799 -+/* Classify the argument of type TYPE and mode MODE.
 15.5800 -+   CLASSES will be filled by the register class used to pass each word
 15.5801 -+   of the operand.  The number of words is returned.  In case the parameter
 15.5802 -+   should be passed in memory, 0 is returned. As a special case for zero
 15.5803 -+   sized containers, classes[0] will be NO_CLASS and 1 is returned.
 15.5804 -+
 15.5805 -+   See the x86-64 PS ABI for details.
 15.5806 -+*/
 15.5807 -+static int
 15.5808 -+classify_argument (ffi_type *type, enum x86_64_reg_class classes[],
 15.5809 -+		   int *byte_offset)
 15.5810 -+{
 15.5811 -+  /* First, align to the right place.  */
 15.5812 -+  *byte_offset = ALIGN(*byte_offset, type->alignment);
 15.5813 -+
 15.5814 -+  switch (type->type)
 15.5815 -+    {
 15.5816 -+    case FFI_TYPE_UINT8:
 15.5817 -+    case FFI_TYPE_SINT8:
 15.5818 -+    case FFI_TYPE_UINT16:
 15.5819 -+    case FFI_TYPE_SINT16:
 15.5820 -+    case FFI_TYPE_UINT32:
 15.5821 -+    case FFI_TYPE_SINT32:
 15.5822 -+    case FFI_TYPE_UINT64:
 15.5823 -+    case FFI_TYPE_SINT64:
 15.5824 -+    case FFI_TYPE_POINTER:
 15.5825 -+      if (((*byte_offset) % 8 + type->size) <= 4)
 15.5826 -+	classes[0] = X86_64_INTEGERSI_CLASS;
 15.5827 -+      else
 15.5828 -+	classes[0] = X86_64_INTEGER_CLASS;
 15.5829 -+      return 1;
 15.5830 -+    case FFI_TYPE_FLOAT:
 15.5831 -+      if (((*byte_offset) % 8) == 0)
 15.5832 -+	classes[0] = X86_64_SSESF_CLASS;
 15.5833 -+      else
 15.5834 -+	classes[0] = X86_64_SSE_CLASS;
 15.5835 -+      return 1;
 15.5836 -+    case FFI_TYPE_DOUBLE:
 15.5837 -+      classes[0] = X86_64_SSEDF_CLASS;
 15.5838 -+      return 1;
 15.5839 -+    case FFI_TYPE_LONGDOUBLE:
 15.5840 -+      classes[0] = X86_64_X87_CLASS;
 15.5841 -+      classes[1] = X86_64_X87UP_CLASS;
 15.5842 -+      return 2;
 15.5843 -+    case FFI_TYPE_STRUCT:
 15.5844 -+      {
 15.5845 -+	const int UNITS_PER_WORD = 8;
 15.5846 -+	int words = (type->size + UNITS_PER_WORD - 1) / UNITS_PER_WORD;
 15.5847 -+	ffi_type **ptr; 
 15.5848 -+	int i;
 15.5849 -+	enum x86_64_reg_class subclasses[MAX_CLASSES];
 15.5850 -+
 15.5851 -+	/* If the struct is larger than 16 bytes, pass it on the stack.  */
 15.5852 -+	if (type->size > 16)
 15.5853 -+	  return 0;
 15.5854 -+
 15.5855 -+	for (i = 0; i < words; i++)
 15.5856 -+	  classes[i] = X86_64_NO_CLASS;
 15.5857 -+
 15.5858 -+	/* Merge the fields of structure.  */
 15.5859 -+	for (ptr=type->elements; (*ptr)!=NULL; ptr++)
 15.5860 -+	  {
 15.5861 -+	    int num;
 15.5862 -+
 15.5863 -+	    num = classify_argument (*ptr, subclasses, byte_offset);
 15.5864 -+	    if (num == 0)
 15.5865 -+	      return 0;
 15.5866 -+	    for (i = 0; i < num; i++)
 15.5867 -+	      {
 15.5868 -+		int pos = *byte_offset / 8;
 15.5869 -+		classes[i + pos] =
 15.5870 -+		  merge_classes (subclasses[i], classes[i + pos]);
 15.5871 -+	      }
 15.5872 -+
 15.5873 -+	    if ((*ptr)->type != FFI_TYPE_STRUCT)
 15.5874 -+	      *byte_offset += (*ptr)->size;
 15.5875 -+	  }
 15.5876 -+
 15.5877 -+	/* Final merger cleanup.  */
 15.5878 -+	for (i = 0; i < words; i++)
 15.5879 -+	  {
 15.5880 -+	    /* If one class is MEMORY, everything should be passed in
 15.5881 -+	       memory.  */
 15.5882 -+	    if (classes[i] == X86_64_MEMORY_CLASS)
 15.5883 -+	      return 0;
 15.5884 -+
 15.5885 -+	    /* The X86_64_SSEUP_CLASS should be always preceded by
 15.5886 -+	       X86_64_SSE_CLASS.  */
 15.5887 -+	    if (classes[i] == X86_64_SSEUP_CLASS
 15.5888 -+		&& (i == 0 || classes[i - 1] != X86_64_SSE_CLASS))
 15.5889 -+	      classes[i] = X86_64_SSE_CLASS;
 15.5890 -+
 15.5891 -+	    /*  X86_64_X87UP_CLASS should be preceded by X86_64_X87_CLASS.  */
 15.5892 -+	    if (classes[i] == X86_64_X87UP_CLASS
 15.5893 -+		&& (i == 0 || classes[i - 1] != X86_64_X87_CLASS))
 15.5894 -+	      classes[i] = X86_64_SSE_CLASS;
 15.5895 -+	  }
 15.5896 -+	return words;
 15.5897 -+      }
 15.5898 -+
 15.5899 -+    default:
 15.5900 -+      FFI_ASSERT(0);
 15.5901 -+    }
 15.5902 -+  return 0; /* Never reached.  */
 15.5903 -+}
 15.5904 -+
 15.5905 -+/* Examine the argument and return set number of register required in each
 15.5906 -+   class.  Return 0 iff parameter should be passed in memory.  */
 15.5907 -+static int
 15.5908 -+examine_argument (ffi_type *type, int in_return, int *int_nregs,int *sse_nregs)
 15.5909 -+{
 15.5910 -+  enum x86_64_reg_class class[MAX_CLASSES];
 15.5911 -+  int offset = 0;
 15.5912 -+  int n;
 15.5913 -+
 15.5914 -+  n = classify_argument (type, class, &offset);
 15.5915 -+
 15.5916 -+  if (n == 0)
 15.5917 -+    return 0;
 15.5918 -+
 15.5919 -+  *int_nregs = 0;
 15.5920 -+  *sse_nregs = 0;
 15.5921 -+  for (n--; n>=0; n--)
 15.5922 -+    switch (class[n])
 15.5923 -+      {
 15.5924 -+      case X86_64_INTEGER_CLASS:
 15.5925 -+      case X86_64_INTEGERSI_CLASS:
 15.5926 -+	(*int_nregs)++;
 15.5927 -+	break;
 15.5928 -+      case X86_64_SSE_CLASS:
 15.5929 -+      case X86_64_SSESF_CLASS:
 15.5930 -+      case X86_64_SSEDF_CLASS:
 15.5931 -+	(*sse_nregs)++;
 15.5932 -+	break;
 15.5933 -+      case X86_64_NO_CLASS:
 15.5934 -+      case X86_64_SSEUP_CLASS:
 15.5935 -+	break;
 15.5936 -+      case X86_64_X87_CLASS:
 15.5937 -+      case X86_64_X87UP_CLASS:
 15.5938 -+	if (!in_return)
 15.5939 -+	  return 0;
 15.5940 -+	break;
 15.5941 -+      default:
 15.5942 -+	abort ();
 15.5943 -+      }
 15.5944 -+  return 1;
 15.5945 -+}
 15.5946 -+
 15.5947 -+/* Functions to load floats and double to an SSE register placeholder.  */
 15.5948 -+extern void float2sse (float, __int128_t *);
 15.5949 -+extern void double2sse (double, __int128_t *);
 15.5950 -+extern void floatfloat2sse (void *, __int128_t *);
 15.5951 -+
 15.5952 -+/* Functions to put the floats and doubles back.  */
 15.5953 -+extern float sse2float (__int128_t *);
 15.5954 -+extern double sse2double (__int128_t *);
 15.5955 -+extern void sse2floatfloat(__int128_t *, void *);
 15.5956 -+
 15.5957 -+/*@-exportheader@*/
 15.5958 -+void
 15.5959 -+ffi_prep_args (stackLayout *stack, extended_cif *ecif)
 15.5960 -+/*@=exportheader@*/
 15.5961 -+{
 15.5962 -+  int gprcount, ssecount, i, g, s;
 15.5963 -+  void **p_argv;
 15.5964 -+  void *argp = &stack->argspace;
 15.5965 -+  ffi_type **p_arg;
 15.5966 -+
 15.5967 -+  /* First check if the return value should be passed in memory. If so,
 15.5968 -+     pass the pointer as the first argument.  */
 15.5969 -+  gprcount = ssecount = 0;
 15.5970 -+  if (ecif->cif->rtype->type != FFI_TYPE_VOID 
 15.5971 -+      && examine_argument (ecif->cif->rtype, 1, &g, &s) == 0)
 15.5972 -+    (void *)stack->gpr[gprcount++] = ecif->rvalue;
 15.5973 -+
 15.5974 -+  for (i=ecif->cif->nargs, p_arg=ecif->cif->arg_types, p_argv = ecif->avalue;
 15.5975 -+       i!=0; i--, p_arg++, p_argv++)
 15.5976 -+    {
 15.5977 -+      int in_register = 0;
 15.5978 -+
 15.5979 -+      switch ((*p_arg)->type)
 15.5980 -+	{
 15.5981 -+	case FFI_TYPE_SINT8:
 15.5982 -+	case FFI_TYPE_SINT16:
 15.5983 -+	case FFI_TYPE_SINT32:
 15.5984 -+	case FFI_TYPE_SINT64:
 15.5985 -+	case FFI_TYPE_UINT8:
 15.5986 -+	case FFI_TYPE_UINT16:
 15.5987 -+	case FFI_TYPE_UINT32:
 15.5988 -+	case FFI_TYPE_UINT64:
 15.5989 -+	case FFI_TYPE_POINTER:
 15.5990 -+	  if (gprcount < MAX_GPR_REGS)
 15.5991 -+	    {
 15.5992 -+	      stack->gpr[gprcount] = 0;
 15.5993 -+	      stack->gpr[gprcount++] = *(long long *)(*p_argv);
 15.5994 -+	      in_register = 1;
 15.5995 -+	    }
 15.5996 -+	  break;
 15.5997 -+
 15.5998 -+	case FFI_TYPE_FLOAT:
 15.5999 -+	  if (ssecount < MAX_SSE_REGS)
 15.6000 -+	    {
 15.6001 -+	      float2sse (*(float *)(*p_argv), &stack->sse[ssecount++]);
 15.6002 -+	      in_register = 1;
 15.6003 -+	    }
 15.6004 -+	  break;
 15.6005 -+
 15.6006 -+	case FFI_TYPE_DOUBLE:
 15.6007 -+	  if (ssecount < MAX_SSE_REGS)
 15.6008 -+	    {
 15.6009 -+	      double2sse (*(double *)(*p_argv), &stack->sse[ssecount++]);
 15.6010 -+	      in_register = 1;
 15.6011 -+	    }
 15.6012 -+	  break;
 15.6013 -+	}
 15.6014 -+
 15.6015 -+      if (in_register)
 15.6016 -+	continue;
 15.6017 -+
 15.6018 -+      /* Either all places in registers where filled, or this is a
 15.6019 -+	 type that potentially goes into a memory slot.  */
 15.6020 -+      if (examine_argument (*p_arg, 0, &g, &s) == 0
 15.6021 -+	  || gprcount + g > MAX_GPR_REGS || ssecount + s > MAX_SSE_REGS)
 15.6022 -+	{
 15.6023 -+	  /* Pass this argument in memory.  */
 15.6024 -+	  argp = (void *)ALIGN(argp, (*p_arg)->alignment);
 15.6025 -+	  memcpy (argp, *p_argv, (*p_arg)->size);
 15.6026 -+	  argp += (*p_arg)->size;
 15.6027 -+	}
 15.6028 -+      else
 15.6029 -+	{
 15.6030 -+	  /* All easy cases are eliminated. Now fire the big guns.  */
 15.6031 -+
 15.6032 -+	  enum x86_64_reg_class classes[MAX_CLASSES];
 15.6033 -+	  int offset = 0, j, num;
 15.6034 -+	  void *a;
 15.6035 -+
 15.6036 -+	  num = classify_argument (*p_arg, classes, &offset);
 15.6037 -+	  for (j=0, a=*p_argv; j<num; j++, a+=8)
 15.6038 -+	    {
 15.6039 -+	      switch (classes[j])
 15.6040 -+		{
 15.6041 -+		case X86_64_INTEGER_CLASS:
 15.6042 -+		case X86_64_INTEGERSI_CLASS:
 15.6043 -+		  stack->gpr[gprcount++] = *(long long *)a;
 15.6044 -+		  break;
 15.6045 -+		case X86_64_SSE_CLASS:
 15.6046 -+		  floatfloat2sse (a, &stack->sse[ssecount++]);
 15.6047 -+		  break;
 15.6048 -+		case X86_64_SSESF_CLASS:
 15.6049 -+		  float2sse (*(float *)a, &stack->sse[ssecount++]);
 15.6050 -+		  break;
 15.6051 -+		case X86_64_SSEDF_CLASS:
 15.6052 -+		  double2sse (*(double *)a, &stack->sse[ssecount++]);
 15.6053 -+		  break;
 15.6054 -+		default:
 15.6055 -+		  abort();
 15.6056 -+		}
 15.6057 -+	    }
 15.6058 -+	}
 15.6059 -+    }
 15.6060 -+}
 15.6061 -+
 15.6062 -+/* Perform machine dependent cif processing.  */
 15.6063 -+ffi_status
 15.6064 -+ffi_prep_cif_machdep (ffi_cif *cif)
 15.6065 -+{
 15.6066 -+  int gprcount, ssecount, i, g, s;
 15.6067 -+
 15.6068 -+  gprcount = ssecount = 0;
 15.6069 -+
 15.6070 -+  /* Reset the byte count. We handle this size estimation here.  */
 15.6071 -+  cif->bytes = 0;
 15.6072 -+
 15.6073 -+  /* If the return value should be passed in memory, pass the pointer
 15.6074 -+     as the first argument. The actual memory isn't allocated here.  */
 15.6075 -+  if (cif->rtype->type != FFI_TYPE_VOID 
 15.6076 -+      && examine_argument (cif->rtype, 1, &g, &s) == 0)
 15.6077 -+    gprcount = 1;
 15.6078 -+
 15.6079 -+  /* Go over all arguments and determine the way they should be passed.
 15.6080 -+     If it's in a register and there is space for it, let that be so. If
 15.6081 -+     not, add it's size to the stack byte count.  */
 15.6082 -+  for (i=0; i<cif->nargs; i++)
 15.6083 -+    {
 15.6084 -+      if (examine_argument (cif->arg_types[i], 0, &g, &s) == 0
 15.6085 -+	  || gprcount + g > MAX_GPR_REGS || ssecount + s > MAX_SSE_REGS)
 15.6086 -+	{
 15.6087 -+	  /* This is passed in memory. First align to the basic type.  */
 15.6088 -+	  cif->bytes = ALIGN(cif->bytes, cif->arg_types[i]->alignment);
 15.6089 -+
 15.6090 -+	  /* Stack arguments are *always* at least 8 byte aligned.  */
 15.6091 -+	  cif->bytes = ALIGN(cif->bytes, 8);
 15.6092 -+
 15.6093 -+	  /* Now add the size of this argument.  */
 15.6094 -+	  cif->bytes += cif->arg_types[i]->size;
 15.6095 -+	}
 15.6096 -+      else
 15.6097 -+	{
 15.6098 -+	  gprcount += g;
 15.6099 -+	  ssecount += s;
 15.6100 -+	}
 15.6101 -+    }
 15.6102 -+
 15.6103 -+  /* Set the flag for the closures return.  */
 15.6104 -+    switch (cif->rtype->type)
 15.6105 -+    {
 15.6106 -+    case FFI_TYPE_VOID:
 15.6107 -+    case FFI_TYPE_STRUCT:
 15.6108 -+    case FFI_TYPE_SINT64:
 15.6109 -+    case FFI_TYPE_FLOAT:
 15.6110 -+    case FFI_TYPE_DOUBLE:
 15.6111 -+    case FFI_TYPE_LONGDOUBLE:
 15.6112 -+      cif->flags = (unsigned) cif->rtype->type;
 15.6113 -+      break;
 15.6114 -+
 15.6115 -+    case FFI_TYPE_UINT64:
 15.6116 -+      cif->flags = FFI_TYPE_SINT64;
 15.6117 -+      break;
 15.6118 -+
 15.6119 -+    default:
 15.6120 -+      cif->flags = FFI_TYPE_INT;
 15.6121 -+      break;
 15.6122 -+    }
 15.6123 -+
 15.6124 -+  return FFI_OK;
 15.6125 -+}
 15.6126 -+
 15.6127 -+typedef struct
 15.6128 -+{
 15.6129 -+  long gpr[2];
 15.6130 -+  __int128_t sse[2];
 15.6131 -+  long double st0;
 15.6132 -+} return_value;
 15.6133 -+
 15.6134 -+void
 15.6135 -+ffi_fill_return_value (return_value *rv, extended_cif *ecif)
 15.6136 -+{
 15.6137 -+  enum x86_64_reg_class classes[MAX_CLASSES];
 15.6138 -+  int i = 0, num;
 15.6139 -+  long *gpr = rv->gpr;
 15.6140 -+  __int128_t *sse = rv->sse;
 15.6141 -+  signed char sc;
 15.6142 -+  signed short ss;
 15.6143 -+
 15.6144 -+  /* This is needed because of the way x86-64 handles signed short
 15.6145 -+     integers.  */
 15.6146 -+  switch (ecif->cif->rtype->type)
 15.6147 -+    {
 15.6148 -+    case FFI_TYPE_SINT8:
 15.6149 -+      sc = *(signed char *)gpr;
 15.6150 -+      *(long long *)ecif->rvalue = (long long)sc;
 15.6151 -+      return;
 15.6152 -+    case FFI_TYPE_SINT16:
 15.6153 -+      ss = *(signed short *)gpr;
 15.6154 -+      *(long long *)ecif->rvalue = (long long)ss;
 15.6155 -+      return;
 15.6156 -+    default:
 15.6157 -+      /* Just continue.  */
 15.6158 -+      ;
 15.6159 -+    }
 15.6160 -+
 15.6161 -+  num = classify_argument (ecif->cif->rtype, classes, &i);
 15.6162 -+
 15.6163 -+  if (num == 0)
 15.6164 -+    /* Return in memory.  */
 15.6165 -+    ecif->rvalue = (void *) rv->gpr[0];
 15.6166 -+  else if (num == 2 && classes[0] == X86_64_X87_CLASS &&
 15.6167 -+	classes[1] == X86_64_X87UP_CLASS)
 15.6168 -+    /* This is a long double (this is easiest to handle this way instead
 15.6169 -+       of an eightbyte at a time as in the loop below.  */
 15.6170 -+    *((long double *)ecif->rvalue) = rv->st0;
 15.6171 -+  else
 15.6172 -+    {
 15.6173 -+      void *a;
 15.6174 -+
 15.6175 -+      for (i=0, a=ecif->rvalue; i<num; i++, a+=8)
 15.6176 -+	{
 15.6177 -+	  switch (classes[i])
 15.6178 -+	    {
 15.6179 -+	    case X86_64_INTEGER_CLASS:
 15.6180 -+	    case X86_64_INTEGERSI_CLASS:
 15.6181 -+	      *(long long *)a = *gpr;
 15.6182 -+	      gpr++;
 15.6183 -+	      break;
 15.6184 -+	    case X86_64_SSE_CLASS:
 15.6185 -+	      sse2floatfloat (sse++, a);
 15.6186 -+	      break;
 15.6187 -+	    case X86_64_SSESF_CLASS:
 15.6188 -+	      *(float *)a = sse2float (sse++);
 15.6189 -+	      break;
 15.6190 -+	    case X86_64_SSEDF_CLASS:
 15.6191 -+	      *(double *)a = sse2double (sse++);
 15.6192 -+	      break;
 15.6193 -+	    default:
 15.6194 -+	      abort();
 15.6195 -+	    }
 15.6196 -+	}
 15.6197 -+    }
 15.6198 -+}
 15.6199 -+
 15.6200 -+/*@-declundef@*/
 15.6201 -+/*@-exportheader@*/
 15.6202 -+extern void ffi_call_UNIX64(void (*)(stackLayout *, extended_cif *),
 15.6203 -+			    void (*) (return_value *, extended_cif *),
 15.6204 -+			    /*@out@*/ extended_cif *, 
 15.6205 -+			    unsigned, /*@out@*/ unsigned *, void (*fn)());
 15.6206 -+/*@=declundef@*/
 15.6207 -+/*@=exportheader@*/
 15.6208 -+
 15.6209 -+void ffi_call(/*@dependent@*/ ffi_cif *cif, 
 15.6210 -+	      void (*fn)(), 
 15.6211 -+	      /*@out@*/ void *rvalue, 
 15.6212 -+	      /*@dependent@*/ void **avalue)
 15.6213 -+{
 15.6214 -+  extended_cif ecif;
 15.6215 -+  int dummy;
 15.6216 -+
 15.6217 -+  ecif.cif = cif;
 15.6218 -+  ecif.avalue = avalue;
 15.6219 -+  
 15.6220 -+  /* If the return value is a struct and we don't have a return	*/
 15.6221 -+  /* value address then we need to make one		        */
 15.6222 -+
 15.6223 -+  if ((rvalue == NULL) && 
 15.6224 -+      (examine_argument (cif->rtype, 1, &dummy, &dummy) == 0))
 15.6225 -+    {
 15.6226 -+      /*@-sysunrecog@*/
 15.6227 -+      ecif.rvalue = alloca(cif->rtype->size);
 15.6228 -+      /*@=sysunrecog@*/
 15.6229 -+    }
 15.6230 -+  else
 15.6231 -+    ecif.rvalue = rvalue;
 15.6232 -+    
 15.6233 -+  /* Stack must always be 16byte aligned. Make it so.  */
 15.6234 -+  cif->bytes = ALIGN(cif->bytes, 16);
 15.6235 -+  
 15.6236 -+  switch (cif->abi) 
 15.6237 -+    {
 15.6238 -+    case FFI_SYSV:
 15.6239 -+      /* Calling 32bit code from 64bit is not possible  */
 15.6240 -+      FFI_ASSERT(0);
 15.6241 -+      break;
 15.6242 -+
 15.6243 -+    case FFI_UNIX64:
 15.6244 -+      /*@-usedef@*/
 15.6245 -+      ffi_call_UNIX64 (ffi_prep_args, ffi_fill_return_value, &ecif,
 15.6246 -+		       cif->bytes, ecif.rvalue, fn);
 15.6247 -+      /*@=usedef@*/
 15.6248 -+      break;
 15.6249 -+
 15.6250 -+    default:
 15.6251 -+      FFI_ASSERT(0);
 15.6252 -+      break;
 15.6253 -+    }
 15.6254 -+}
 15.6255 -+
 15.6256 -+extern void ffi_closure_UNIX64(void);
 15.6257 -+
 15.6258 -+ffi_status
 15.6259 -+ffi_prep_closure (ffi_closure* closure,
 15.6260 -+		  ffi_cif* cif,
 15.6261 -+		  void (*fun)(ffi_cif*, void*, void**, void*),
 15.6262 -+		  void *user_data)
 15.6263 -+{
 15.6264 -+  volatile unsigned short *tramp;
 15.6265 -+
 15.6266 -+  /* FFI_ASSERT (cif->abi == FFI_OSF);  */
 15.6267 -+
 15.6268 -+  tramp = (volatile unsigned short *) &closure->tramp[0];
 15.6269 -+  tramp[0] = 0xbb49;		/* mov <code>, %r11	*/
 15.6270 -+  tramp[5] = 0xba49;		/* mov <data>, %r10	*/
 15.6271 -+  tramp[10] = 0xff49;		/* jmp *%r11	*/
 15.6272 -+  tramp[11] = 0x00e3;
 15.6273 -+  *(void * volatile *) &tramp[1] = ffi_closure_UNIX64;
 15.6274 -+  *(void * volatile *) &tramp[6] = closure;
 15.6275 -+
 15.6276 -+  closure->cif = cif;
 15.6277 -+  closure->fun = fun;
 15.6278 -+  closure->user_data = user_data;
 15.6279 -+
 15.6280 -+  return FFI_OK;
 15.6281 -+}
 15.6282 -+
 15.6283 -+int
 15.6284 -+ffi_closure_UNIX64_inner(ffi_closure *closure, va_list l, void *rp)
 15.6285 -+{
 15.6286 -+  ffi_cif *cif;
 15.6287 -+  void **avalue;
 15.6288 -+  ffi_type **arg_types;
 15.6289 -+  long i, avn, argn;
 15.6290 -+
 15.6291 -+  cif = closure->cif;
 15.6292 -+  avalue = alloca(cif->nargs * sizeof(void *));
 15.6293 -+
 15.6294 -+  argn = 0;
 15.6295 -+
 15.6296 -+  i = 0;
 15.6297 -+  avn = cif->nargs;
 15.6298 -+  arg_types = cif->arg_types;
 15.6299 -+  
 15.6300 -+  /* Grab the addresses of the arguments from the stack frame.  */
 15.6301 -+  while (i < avn)
 15.6302 -+    {
 15.6303 -+      switch (arg_types[i]->type)
 15.6304 -+	{
 15.6305 -+	case FFI_TYPE_SINT8:
 15.6306 -+	case FFI_TYPE_UINT8:
 15.6307 -+	case FFI_TYPE_SINT16:
 15.6308 -+	case FFI_TYPE_UINT16:
 15.6309 -+	case FFI_TYPE_SINT32:
 15.6310 -+	case FFI_TYPE_UINT32:
 15.6311 -+	case FFI_TYPE_SINT64:
 15.6312 -+	case FFI_TYPE_UINT64:
 15.6313 -+	case FFI_TYPE_POINTER:
 15.6314 -+	  {
 15.6315 -+	    if (l->gp_offset > 48-8)
 15.6316 -+	      {
 15.6317 -+		avalue[i] = l->overflow_arg_area;
 15.6318 -+		l->overflow_arg_area = (char *)l->overflow_arg_area + 8;
 15.6319 -+	      }
 15.6320 -+	    else
 15.6321 -+	      {
 15.6322 -+		avalue[i] = (char *)l->reg_save_area + l->gp_offset;
 15.6323 -+		l->gp_offset += 8;
 15.6324 -+	      }
 15.6325 -+	  }
 15.6326 -+	  break;
 15.6327 -+
 15.6328 -+	case FFI_TYPE_STRUCT:
 15.6329 -+	  /* FIXME  */
 15.6330 -+	  FFI_ASSERT(0);
 15.6331 -+	  break;
 15.6332 -+
 15.6333 -+	case FFI_TYPE_DOUBLE:
 15.6334 -+	  {
 15.6335 -+	    if (l->fp_offset > 176-16)
 15.6336 -+	      {
 15.6337 -+		avalue[i] = l->overflow_arg_area;
 15.6338 -+		l->overflow_arg_area = (char *)l->overflow_arg_area + 8;
 15.6339 -+	      }
 15.6340 -+	    else
 15.6341 -+	      {
 15.6342 -+		avalue[i] = (char *)l->reg_save_area + l->fp_offset;
 15.6343 -+		l->fp_offset += 16;
 15.6344 -+	      }
 15.6345 -+	  }
 15.6346 -+#if DEBUG_FFI
 15.6347 -+	  fprintf (stderr, "double arg %d = %g\n", i, *(double *)avalue[i]);
 15.6348 -+#endif
 15.6349 -+	  break;
 15.6350 -+	  
 15.6351 -+	case FFI_TYPE_FLOAT:
 15.6352 -+	  {
 15.6353 -+	    if (l->fp_offset > 176-16)
 15.6354 -+	      {
 15.6355 -+		avalue[i] = l->overflow_arg_area;
 15.6356 -+		l->overflow_arg_area = (char *)l->overflow_arg_area + 8;
 15.6357 -+	      }
 15.6358 -+	    else
 15.6359 -+	      {
 15.6360 -+		avalue[i] = (char *)l->reg_save_area + l->fp_offset;
 15.6361 -+		l->fp_offset += 16;
 15.6362 -+	      }
 15.6363 -+	  }
 15.6364 -+#if DEBUG_FFI
 15.6365 -+	  fprintf (stderr, "float arg %d = %g\n", i, *(float *)avalue[i]);
 15.6366 -+#endif
 15.6367 -+	  break;
 15.6368 -+	  
 15.6369 -+	default:
 15.6370 -+	  FFI_ASSERT(0);
 15.6371 -+	}
 15.6372 -+
 15.6373 -+      argn += ALIGN(arg_types[i]->size, SIZEOF_ARG) / SIZEOF_ARG;
 15.6374 -+      i++;
 15.6375 -+    }
 15.6376 -+
 15.6377 -+  /* Invoke the closure.  */
 15.6378 -+  (closure->fun) (cif, rp, avalue, closure->user_data);
 15.6379 -+
 15.6380 -+  /* FIXME: Structs not supported.  */
 15.6381 -+  FFI_ASSERT(cif->rtype->type != FFI_TYPE_STRUCT);
 15.6382 -+
 15.6383 -+  /* Tell ffi_closure_UNIX64 how to perform return type promotions.  */
 15.6384 -+
 15.6385 -+  return cif->rtype->type;
 15.6386 -+}
 15.6387 -+#endif /* ifndef __x86_64__ */
 15.6388 -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/x86/sysv.S gcc/libffi/src/x86/sysv.S
 15.6389 ---- gcc-3.2.2.orig/libffi/src/x86/sysv.S	Tue Jul 17 02:10:53 2001
 15.6390 -+++ gcc/libffi/src/x86/sysv.S	Fri Jul 19 08:08:31 2002
 15.6391 -@@ -1,5 +1,5 @@
 15.6392 - /* -----------------------------------------------------------------------
 15.6393 --   sysv.S - Copyright (c) 1996, 1998, 2001  Cygnus Solutions
 15.6394 -+   sysv.S - Copyright (c) 1996, 1998, 2001, 2002  Cygnus Solutions
 15.6395 -    
 15.6396 -    X86 Foreign Function Interface 
 15.6397 - 
 15.6398 -@@ -23,6 +23,8 @@
 15.6399 -    OTHER DEALINGS IN THE SOFTWARE.
 15.6400 -    ----------------------------------------------------------------------- */
 15.6401 - 
 15.6402 -+#ifndef __x86_64__
 15.6403 -+
 15.6404 - #define LIBFFI_ASM	
 15.6405 - #include <ffi.h>
 15.6406 - 
 15.6407 -@@ -163,3 +165,5 @@
 15.6408 - 	.align 4
 15.6409 - .LEFDE1:
 15.6410 - 	.set	.LLFDE1,.LEFDE1-.LSFDE1
 15.6411 -+
 15.6412 -+#endif /* ifndef __x86_64__ */
 15.6413 -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/x86/unix64.S gcc/libffi/src/x86/unix64.S
 15.6414 ---- gcc-3.2.2.orig/libffi/src/x86/unix64.S	Thu Jan  1 09:00:00 1970
 15.6415 -+++ gcc/libffi/src/x86/unix64.S	Wed Jan 29 00:54:28 2003
 15.6416 -@@ -0,0 +1,302 @@
 15.6417 -+/* -----------------------------------------------------------------------
 15.6418 -+   unix64.S - Copyright (c) 2002  Bo Thorsen <bo@suse.de>
 15.6419 -+
 15.6420 -+   x86-64 Foreign Function Interface 
 15.6421 -+
 15.6422 -+   Permission is hereby granted, free of charge, to any person obtaining
 15.6423 -+   a copy of this software and associated documentation files (the
 15.6424 -+   ``Software''), to deal in the Software without restriction, including
 15.6425 -+   without limitation the rights to use, copy, modify, merge, publish,
 15.6426 -+   distribute, sublicense, and/or sell copies of the Software, and to
 15.6427 -+   permit persons to whom the Software is furnished to do so, subject to
 15.6428 -+   the following conditions:
 15.6429 -+
 15.6430 -+   The above copyright notice and this permission notice shall be included
 15.6431 -+   in all copies or substantial portions of the Software.
 15.6432 -+
 15.6433 -+   THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
 15.6434 -+   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 15.6435 -+   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 15.6436 -+   IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR
 15.6437 -+   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 15.6438 -+   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 15.6439 -+   OTHER DEALINGS IN THE SOFTWARE.
 15.6440 -+   ----------------------------------------------------------------------- */
 15.6441 -+
 15.6442 -+#ifdef __x86_64__
 15.6443 -+#define LIBFFI_ASM	
 15.6444 -+#include <ffi.h>
 15.6445 -+
 15.6446 -+	.section	.rodata
 15.6447 -+.LC0:
 15.6448 -+	.string	"asm in progress %lld\n"
 15.6449 -+.LC1:
 15.6450 -+	.string	"asm in progress\n"
 15.6451 -+.text
 15.6452 -+	.align	2
 15.6453 -+.globl ffi_call_UNIX64
 15.6454 -+        .type	ffi_call_UNIX64,@function
 15.6455 -+
 15.6456 -+ffi_call_UNIX64:
 15.6457 -+.LFB1:
 15.6458 -+        pushq	%rbp
 15.6459 -+.LCFI0:
 15.6460 -+        movq	%rsp, %rbp
 15.6461 -+.LCFI1:
 15.6462 -+	/* Save all arguments */
 15.6463 -+	subq	$48, %rsp
 15.6464 -+.LCFI2:
 15.6465 -+	movq	%rdi, -8(%rbp)		/* ffi_prep_args	 */
 15.6466 -+	movq	%rsi, -16(%rbp)		/* ffi_fill_return_value */
 15.6467 -+	movq	%rdx, -24(%rbp)		/* ecif			 */
 15.6468 -+	movq	%rcx, -32(%rbp)		/* cif->bytes		 */
 15.6469 -+	movq	%r8, -40(%rbp)		/* ecif.rvalue		 */
 15.6470 -+	movq	%r9, -48(%rbp)		/* fn			 */
 15.6471 -+
 15.6472 -+	/* Make room for all of the new args and the register args */
 15.6473 -+	addl	$176, %ecx
 15.6474 -+.LCFI3:
 15.6475 -+	subq	%rcx, %rsp
 15.6476 -+.LCFI4:
 15.6477 -+	/* Setup the call to ffi_prep_args.  */
 15.6478 -+	movq	%rdi, %rax		/* &ffi_prep_args	*/
 15.6479 -+	movq	%rsp, %rdi		/* stackLayout		*/
 15.6480 -+	movq	%rdx, %rsi		/* ecif			*/
 15.6481 -+	call	*%rax			/* ffi_prep_args(stackLayout, ecif);*/ 
 15.6482 -+
 15.6483 -+	/* ffi_prep_args have put all the register contents into the  */
 15.6484 -+	/* stackLayout struct. Now put the register values in place.  */
 15.6485 -+	movq	(%rsp), %rdi
 15.6486 -+	movq	8(%rsp), %rsi
 15.6487 -+	movq	16(%rsp), %rdx
 15.6488 -+	movq	24(%rsp), %rcx
 15.6489 -+	movq	32(%rsp), %r8
 15.6490 -+	movq	40(%rsp), %r9
 15.6491 -+	movaps	48(%rsp), %xmm0
 15.6492 -+	movaps	64(%rsp), %xmm1
 15.6493 -+	movaps	80(%rsp), %xmm2
 15.6494 -+	movaps	96(%rsp), %xmm3
 15.6495 -+	movaps	112(%rsp), %xmm4
 15.6496 -+	movaps	128(%rsp), %xmm5
 15.6497 -+	movaps	144(%rsp), %xmm6
 15.6498 -+	movaps	160(%rsp), %xmm7
 15.6499 -+
 15.6500 -+	/* Remove space for stackLayout so stack arguments are placed
 15.6501 -+	   correctly for the call.  */
 15.6502 -+.LCFI5:
 15.6503 -+	addq	$176, %rsp
 15.6504 -+.LCFI6:
 15.6505 -+	/* Call the user function.  */
 15.6506 -+	call	*-48(%rbp)
 15.6507 -+
 15.6508 -+	/* Make stack space for the return_value struct.  */
 15.6509 -+	subq	$64, %rsp
 15.6510 -+
 15.6511 -+	/* Fill in all potential return values to this struct.  */
 15.6512 -+	movq	%rax, (%rsp)
 15.6513 -+	movq	%rdx, 8(%rsp)
 15.6514 -+	movaps	%xmm0, 16(%rsp)
 15.6515 -+	movaps	%xmm1, 32(%rsp)
 15.6516 -+	fstpt	48(%rsp)
 15.6517 -+
 15.6518 -+	/* Now call ffi_fill_return_value.  */
 15.6519 -+	movq	%rsp, %rdi		/* struct return_value	  */
 15.6520 -+	movq	-24(%rbp), %rsi		/* ecif			  */
 15.6521 -+	movq	-16(%rbp), %rax		/* &ffi_fill_return_value */
 15.6522 -+	call	*%rax			/* call it		  */
 15.6523 -+
 15.6524 -+	/* And the work is done.  */
 15.6525 -+        leave
 15.6526 -+        ret
 15.6527 -+.LFE1:
 15.6528 -+.ffi_call_UNIX64_end:
 15.6529 -+        .size    ffi_call_UNIX64,.ffi_call_UNIX64_end-ffi_call_UNIX64
 15.6530 -+
 15.6531 -+.text
 15.6532 -+	.align	2
 15.6533 -+.globl float2sse
 15.6534 -+        .type	float2sse,@function
 15.6535 -+float2sse:
 15.6536 -+	/* Save the contents of this sse-float in a pointer.  */
 15.6537 -+	movaps	%xmm0, (%rdi)
 15.6538 -+	ret
 15.6539 -+
 15.6540 -+	.align	2
 15.6541 -+.globl floatfloat2sse
 15.6542 -+        .type	floatfloat2sse,@function
 15.6543 -+floatfloat2sse:
 15.6544 -+	/* Save the contents of these two sse-floats in a pointer.  */
 15.6545 -+	movq	(%rdi), %xmm0
 15.6546 -+	movaps	%xmm0, (%rsi)
 15.6547 -+	ret
 15.6548 -+
 15.6549 -+	.align	2
 15.6550 -+.globl double2sse
 15.6551 -+        .type	double2sse,@function
 15.6552 -+double2sse:
 15.6553 -+	/* Save the contents of this sse-double in a pointer.  */
 15.6554 -+	movaps	%xmm0, (%rdi)
 15.6555 -+	ret
 15.6556 -+
 15.6557 -+	.align	2
 15.6558 -+.globl sse2float
 15.6559 -+        .type	sse2float,@function
 15.6560 -+sse2float:
 15.6561 -+	/* Save the contents of this sse-float in a pointer.  */
 15.6562 -+	movaps	(%rdi), %xmm0
 15.6563 -+	ret
 15.6564 -+
 15.6565 -+	.align	2
 15.6566 -+.globl sse2double
 15.6567 -+        .type	sse2double,@function
 15.6568 -+sse2double:
 15.6569 -+	/* Save the contents of this pointer in a sse-double.  */
 15.6570 -+	movaps	(%rdi), %xmm0
 15.6571 -+	ret
 15.6572 -+
 15.6573 -+	.align	2
 15.6574 -+.globl sse2floatfloat
 15.6575 -+        .type	sse2floatfloat,@function
 15.6576 -+sse2floatfloat:
 15.6577 -+	/* Save the contents of this pointer in two sse-floats.  */
 15.6578 -+	movaps	(%rdi), %xmm0
 15.6579 -+	movq	%xmm0, (%rsi)
 15.6580 -+	ret
 15.6581 -+
 15.6582 -+	.align	2
 15.6583 -+.globl ffi_closure_UNIX64
 15.6584 -+        .type	ffi_closure_UNIX64,@function
 15.6585 -+
 15.6586 -+ffi_closure_UNIX64:
 15.6587 -+.LFB2:
 15.6588 -+        pushq   %rbp
 15.6589 -+.LCFI10:
 15.6590 -+        movq    %rsp, %rbp
 15.6591 -+.LCFI11:
 15.6592 -+        subq    $240, %rsp
 15.6593 -+.LCFI12:
 15.6594 -+	movq	%rdi, -176(%rbp)
 15.6595 -+        movq    %rsi, -168(%rbp)
 15.6596 -+        movq    %rdx, -160(%rbp)
 15.6597 -+        movq    %rcx, -152(%rbp)
 15.6598 -+        movq    %r8, -144(%rbp)
 15.6599 -+        movq    %r9, -136(%rbp)
 15.6600 -+        /* FIXME: We can avoid all this stashing of XMM registers by
 15.6601 -+	   (in ffi_prep_closure) computing the number of
 15.6602 -+	   floating-point args and moving it into %rax before calling
 15.6603 -+	   this function.  Once this is done, uncomment the next few
 15.6604 -+	   lines and only the essential XMM registers will be written
 15.6605 -+	   to memory.  This is a significant saving.  */
 15.6606 -+/*         movzbl  %al, %eax  */
 15.6607 -+/*         movq    %rax, %rdx */
 15.6608 -+/*         leaq    0(,%rdx,4), %rax */
 15.6609 -+/*         leaq    2f(%rip), %rdx */
 15.6610 -+/*         subq    %rax, %rdx */
 15.6611 -+        leaq    -1(%rbp), %rax
 15.6612 -+/*         jmp     *%rdx */
 15.6613 -+        movaps  %xmm7, -15(%rax)
 15.6614 -+        movaps  %xmm6, -31(%rax)
 15.6615 -+        movaps  %xmm5, -47(%rax)
 15.6616 -+        movaps  %xmm4, -63(%rax)
 15.6617 -+        movaps  %xmm3, -79(%rax)
 15.6618 -+        movaps  %xmm2, -95(%rax)
 15.6619 -+        movaps  %xmm1, -111(%rax)
 15.6620 -+        movaps  %xmm0, -127(%rax)
 15.6621 -+2:
 15.6622 -+        movl    %edi, -180(%rbp)
 15.6623 -+        movl    $0, -224(%rbp)
 15.6624 -+        movl    $48, -220(%rbp)
 15.6625 -+        leaq    16(%rbp), %rax
 15.6626 -+        movq    %rax, -216(%rbp)
 15.6627 -+        leaq    -176(%rbp), %rdx
 15.6628 -+        movq    %rdx, -208(%rbp)
 15.6629 -+        leaq    -224(%rbp), %rsi
 15.6630 -+	movq	%r10, %rdi
 15.6631 -+	movq	%rsp, %rdx
 15.6632 -+        call    ffi_closure_UNIX64_inner@PLT
 15.6633 -+
 15.6634 -+	cmpl	$FFI_TYPE_FLOAT, %eax
 15.6635 -+	je	1f
 15.6636 -+	cmpl	$FFI_TYPE_DOUBLE, %eax
 15.6637 -+	je	2f
 15.6638 -+	cmpl	$FFI_TYPE_LONGDOUBLE, %eax
 15.6639 -+	je	3f
 15.6640 -+	cmpl	$FFI_TYPE_STRUCT, %eax
 15.6641 -+	je	4f
 15.6642 -+	popq	%rax
 15.6643 -+        leave
 15.6644 -+        ret
 15.6645 -+1:
 15.6646 -+2:
 15.6647 -+3:	
 15.6648 -+	movaps	-240(%rbp), %xmm0
 15.6649 -+        leave
 15.6650 -+        ret
 15.6651 -+4:
 15.6652 -+	leave
 15.6653 -+	ret
 15.6654 -+.LFE2:	
 15.6655 -+		
 15.6656 -+        .section        .eh_frame,"a",@progbits
 15.6657 -+.Lframe0:
 15.6658 -+        .long   .LECIE1-.LSCIE1
 15.6659 -+.LSCIE1:
 15.6660 -+        .long   0x0
 15.6661 -+        .byte   0x1
 15.6662 -+        .string "zR"
 15.6663 -+        .uleb128 0x1
 15.6664 -+        .sleb128 -8
 15.6665 -+        .byte   0x10
 15.6666 -+        .uleb128 0x1
 15.6667 -+        .byte   0x1b
 15.6668 -+        .byte   0xc
 15.6669 -+        .uleb128 0x7
 15.6670 -+        .uleb128 0x8
 15.6671 -+        .byte   0x90
 15.6672 -+        .uleb128 0x1
 15.6673 -+        .align 8
 15.6674 -+.LECIE1:
 15.6675 -+.LSFDE1:
 15.6676 -+	.long	.LEFDE1-.LASFDE1
 15.6677 -+.LASFDE1:
 15.6678 -+        .long   .LASFDE1-.Lframe0
 15.6679 -+
 15.6680 -+        .long   .LFB1-.
 15.6681 -+        .long   .LFE1-.LFB1
 15.6682 -+        .uleb128 0x0
 15.6683 -+        .byte   0x4		# DW_CFA_advance_loc4
 15.6684 -+        .long   .LCFI0-.LFB1
 15.6685 -+        .byte   0xe		# DW_CFA_def_cfa_offset
 15.6686 -+        .uleb128 0x10
 15.6687 -+        .byte   0x86		# DW_CFA_offset: r6 at cfa-16
 15.6688 -+        .uleb128 0x2
 15.6689 -+        .byte   0x4		# DW_CFA_advance_loc4
 15.6690 -+        .long   .LCFI1-.LCFI0
 15.6691 -+        .byte   0x86		# DW_CFA_offset: r6 at cfa-16
 15.6692 -+        .uleb128 0x2
 15.6693 -+        .byte   0xd		# DW_CFA_def_cfa_reg: r6
 15.6694 -+        .uleb128 0x6
 15.6695 -+	.align 8
 15.6696 -+.LEFDE1:
 15.6697 -+.LSFDE3:
 15.6698 -+        .long   .LEFDE3-.LASFDE3        # FDE Length
 15.6699 -+.LASFDE3:
 15.6700 -+        .long   .LASFDE3-.Lframe0       # FDE CIE offset
 15.6701 -+
 15.6702 -+        .long   .LFB2-. # FDE initial location
 15.6703 -+        .long   .LFE2-.LFB2     # FDE address range
 15.6704 -+        .uleb128 0x0    # Augmentation size
 15.6705 -+        .byte   0x4     # DW_CFA_advance_loc4
 15.6706 -+        .long   .LCFI10-.LFB2
 15.6707 -+        .byte   0xe     # DW_CFA_def_cfa_offset
 15.6708 -+        .uleb128 0x10
 15.6709 -+        .byte   0x86    # DW_CFA_offset, column 0x6
 15.6710 -+        .uleb128 0x2
 15.6711 -+        .byte   0x4     # DW_CFA_advance_loc4
 15.6712 -+        .long   .LCFI11-.LCFI10
 15.6713 -+        .byte   0xd     # DW_CFA_def_cfa_register
 15.6714 -+        .uleb128 0x6
 15.6715 -+        .align 8
 15.6716 -+.LEFDE3:
 15.6717 -+
 15.6718 -+#endif /* __x86_64__  */
 15.6719 -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/x86/win32.S gcc/libffi/src/x86/win32.S
 15.6720 ---- gcc-3.2.2.orig/libffi/src/x86/win32.S	Tue Mar 27 11:39:16 2001
 15.6721 -+++ gcc/libffi/src/x86/win32.S	Fri Dec  6 10:16:45 2002
 15.6722 -@@ -1,5 +1,8 @@
 15.6723 - /* -----------------------------------------------------------------------
 15.6724 --   win32.S - Copyright (c) 1996, 1998, 2001  Cygnus Solutions
 15.6725 -+   win32.S - Copyright (c) 1996, 1998, 2001, 2002  Red Hat, Inc.
 15.6726 -+	     Copyright (c) 2001  John Beniton
 15.6727 -+	     Copyright (c) 2002  Ranjit Mathew
 15.6728 -+			
 15.6729 -  
 15.6730 -    X86 Foreign Function Interface
 15.6731 -  
 15.6732 -@@ -52,7 +55,10 @@
 15.6733 -         # Return stack to previous state and call the function
 15.6734 -         addl  $8,%esp
 15.6735 -  
 15.6736 --        call  *28(%ebp)
 15.6737 -+        # FIXME: Align the stack to a 128-bit boundary to avoid
 15.6738 -+        # potential performance hits.
 15.6739 -+
 15.6740 -+	call  *28(%ebp)
 15.6741 -  
 15.6742 -         # Remove the space we pushed for the args
 15.6743 -         movl  16(%ebp),%ecx
 15.6744 -@@ -123,3 +129,98 @@
 15.6745 -         ret
 15.6746 -  
 15.6747 - .ffi_call_SYSV_end:
 15.6748 -+
 15.6749 -+        # This assumes we are using gas.
 15.6750 -+        .balign 16
 15.6751 -+.globl _ffi_call_STDCALL
 15.6752 -+
 15.6753 -+_ffi_call_STDCALL:
 15.6754 -+        pushl %ebp
 15.6755 -+        movl  %esp,%ebp
 15.6756 -+
 15.6757 -+        # Make room for all of the new args.
 15.6758 -+        movl  16(%ebp),%ecx 
 15.6759 -+        subl  %ecx,%esp
 15.6760 -+
 15.6761 -+        movl  %esp,%eax
 15.6762 -+
 15.6763 -+        # Place all of the ffi_prep_args in position
 15.6764 -+        pushl 12(%ebp)
 15.6765 -+        pushl %eax
 15.6766 -+        call  *8(%ebp)
 15.6767 -+
 15.6768 -+        # Return stack to previous state and call the function
 15.6769 -+        addl  $8,%esp
 15.6770 -+
 15.6771 -+        # FIXME: Align the stack to a 128-bit boundary to avoid
 15.6772 -+        # potential performance hits.
 15.6773 -+
 15.6774 -+        call  *28(%ebp)
 15.6775 -+
 15.6776 -+        # stdcall functions pop arguments off the stack themselves
 15.6777 -+
 15.6778 -+        # Load %ecx with the return type code
 15.6779 -+        movl  20(%ebp),%ecx
 15.6780 -+
 15.6781 -+        # If the return value pointer is NULL, assume no return value.
 15.6782 -+        cmpl  $0,24(%ebp)
 15.6783 -+        jne   sc_retint
 15.6784 -+
 15.6785 -+        # Even if there is no space for the return value, we are
 15.6786 -+        # obliged to handle floating-point values.
 15.6787 -+        cmpl  $FFI_TYPE_FLOAT,%ecx
 15.6788 -+        jne   sc_noretval
 15.6789 -+        fstp  %st(0)
 15.6790 -+
 15.6791 -+        jmp   sc_epilogue
 15.6792 -+
 15.6793 -+sc_retint:
 15.6794 -+        cmpl  $FFI_TYPE_INT,%ecx
 15.6795 -+        jne   sc_retfloat
 15.6796 -+        # Load %ecx with the pointer to storage for the return value
 15.6797 -+        movl  24(%ebp),%ecx
 15.6798 -+        movl  %eax,0(%ecx)
 15.6799 -+        jmp   sc_epilogue
 15.6800 -+
 15.6801 -+sc_retfloat:
 15.6802 -+        cmpl  $FFI_TYPE_FLOAT,%ecx
 15.6803 -+        jne   sc_retdouble
 15.6804 -+         # Load %ecx with the pointer to storage for the return value
 15.6805 -+        movl  24(%ebp),%ecx
 15.6806 -+        fstps (%ecx)
 15.6807 -+        jmp   sc_epilogue
 15.6808 -+
 15.6809 -+sc_retdouble:
 15.6810 -+        cmpl  $FFI_TYPE_DOUBLE,%ecx
 15.6811 -+        jne   sc_retlongdouble
 15.6812 -+        # Load %ecx with the pointer to storage for the return value
 15.6813 -+        movl  24(%ebp),%ecx
 15.6814 -+        fstpl (%ecx)
 15.6815 -+        jmp   sc_epilogue
 15.6816 -+
 15.6817 -+sc_retlongdouble:
 15.6818 -+        cmpl  $FFI_TYPE_LONGDOUBLE,%ecx
 15.6819 -+        jne   sc_retint64
 15.6820 -+        # Load %ecx with the pointer to storage for the return value
 15.6821 -+        movl  24(%ebp),%ecx
 15.6822 -+        fstpt (%ecx)
 15.6823 -+        jmp   sc_epilogue
 15.6824 -+
 15.6825 -+sc_retint64:
 15.6826 -+        cmpl  $FFI_TYPE_SINT64,%ecx
 15.6827 -+        jne   sc_retstruct
 15.6828 -+        # Load %ecx with the pointer to storage for the return value
 15.6829 -+        movl  24(%ebp),%ecx
 15.6830 -+        movl  %eax,0(%ecx)
 15.6831 -+        movl  %edx,4(%ecx)
 15.6832 -+
 15.6833 -+sc_retstruct:
 15.6834 -+        # Nothing to do!
 15.6835 -+
 15.6836 -+sc_noretval:
 15.6837 -+sc_epilogue:
 15.6838 -+        movl %ebp,%esp
 15.6839 -+        popl %ebp
 15.6840 -+        ret
 15.6841 -+
 15.6842 -+.ffi_call_STDCALL_end:
 15.6843 ---- gcc-3.2.2.orig/libjava/configure.host	Mon Jun 10 13:15:26 2002
 15.6844 -+++ gcc-3.2.2/libjava/configure.host	Sat Feb 15 19:57:25 2003
 15.6845 -@@ -115,6 +115,12 @@
 15.6846 - 	enable_getenv_properties_default=no
 15.6847 - 	enable_main_args_default=no
 15.6848 - 	;;
 15.6849 -+  sh-* | sh[34]*-*)
 15.6850 -+	sysdeps_dir=sh
 15.6851 -+	libgcj_flags="${libgcj_flags} -mieee"
 15.6852 -+	libgcj_interpreter=yes
 15.6853 -+	enable_hash_synchronization_default=yes
 15.6854 -+	;;
 15.6855 - esac
 15.6856 - 
 15.6857 - # This case statement supports generic port properties and may refine
 15.6858 -@@ -126,7 +132,8 @@
 15.6859 -   powerpc*-linux* | \
 15.6860 -   alpha*-linux* | \
 15.6861 -   sparc*-linux* | \
 15.6862 --  ia64-*)
 15.6863 -+  ia64-* | \
 15.6864 -+  sh-linux* | sh[34]*-linux*)
 15.6865 -   	can_unwind_signal=yes
 15.6866 - 	;;
 15.6867 -   *-*-darwin*)
    16.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.2 +++ b/patches/gcc/3.2.3/140-libffi-1.patch	Mon Jul 28 21:08:01 2008 +0000
    16.3 @@ -0,0 +1,6864 @@
    16.4 +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/Makefile.am gcc/libffi/Makefile.am
    16.5 +--- gcc-3.2.2.orig/libffi/Makefile.am	Tue Jan 28 10:43:56 2003
    16.6 ++++ gcc/libffi/Makefile.am	Tue Jan 28 10:48:33 2003
    16.7 +@@ -8,14 +8,17 @@
    16.8 + 		src/mips/n32.s src/mips/o32.S src/mips/o32.s \
    16.9 + 		src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S \
   16.10 + 		src/x86/ffi.c src/x86/sysv.S src/x86/win32.S \
   16.11 ++		src/x86/ffi64.c src/x86/unix64.S \
   16.12 + 		src/alpha/ffi.c src/alpha/osf.S \
   16.13 + 		src/m68k/ffi.c src/m68k/sysv.S \
   16.14 + 		src/powerpc/ffi.c src/powerpc/sysv.S \
   16.15 + 		src/powerpc/ppc_closure.S src/powerpc/asm.h \
   16.16 + 		src/powerpc/ffi_darwin.c \
   16.17 + 		src/powerpc/darwin.S src/powerpc/aix.S \
   16.18 +-		src/powerpc/darwin_closure.S src/powerpc/aix_closures.S \
   16.19 +-		src/arm/ffi.c src/arm/sysv.S
   16.20 ++		src/powerpc/darwin_closure.S src/powerpc/aix_closure.S \
   16.21 ++		src/arm/ffi.c src/arm/sysv.S \
   16.22 ++		src/s390/ffi.c src/s390/sysv.S \
   16.23 ++		src/sh/ffi.c src/sh/sysv.S
   16.24 + 
   16.25 + VPATH = @srcdir@:@srcdir@/src:@srcdir@/src/@TARGETDIR@
   16.26 + 
   16.27 +@@ -83,6 +86,7 @@
   16.28 + ffitest_LDFLAGS = -shared-libgcc
   16.29 + 
   16.30 + TARGET_SRC_MIPS_GCC = src/mips/ffi.c src/mips/o32.S src/mips/n32.S
   16.31 ++TARGET_SRC_MIPS_LINUX = src/mips/ffi.c src/mips/o32.S
   16.32 + TARGET_SRC_MIPS_SGI = src/mips/ffi.c src/mips/o32.s src/mips/n32.s
   16.33 + TARGET_SRC_X86 = src/x86/ffi.c src/x86/sysv.S
   16.34 + TARGET_SRC_X86_WIN32 = src/x86/ffi.c src/x86/win32.S
   16.35 +@@ -91,9 +95,12 @@
   16.36 + TARGET_SRC_IA64 = src/ia64/ffi.c src/ia64/unix.S
   16.37 + TARGET_SRC_M68K = src/m68k/ffi.c src/m68k/sysv.S
   16.38 + TARGET_SRC_POWERPC = src/powerpc/ffi.c src/powerpc/sysv.S src/powerpc/ppc_closure.S
   16.39 +-TARGET_SRC_POWERPC_AIX = src/powerpc/ffi_darwin.c src/powerpc/aix.S src/powerpc/aix_closures.S
   16.40 ++TARGET_SRC_POWERPC_AIX = src/powerpc/ffi_darwin.c src/powerpc/aix.S src/powerpc/aix_closure.S
   16.41 + TARGET_SRC_POWERPC_DARWIN = src/powerpc/ffi_darwin.c src/powerpc/darwin.S src/powerpc/darwin_closure.S
   16.42 + TARGET_SRC_ARM =  src/arm/sysv.S src/arm/ffi.c
   16.43 ++TARGET_SRC_S390 =  src/s390/sysv.S src/s390/ffi.c
   16.44 ++TARGET_SRC_X86_64 = src/x86/ffi64.c src/x86/unix64.S src/x86/ffi.c src/x86/sysv.S
   16.45 ++TARGET_SRC_SH =  src/sh/sysv.S src/sh/ffi.c
   16.46 + 
   16.47 + ##libffi_la_SOURCES = src/debug.c src/prep_cif.c src/types.c $(TARGET_SRC_@TARGET@)
   16.48 + ## Work around automake deficiency
   16.49 +@@ -103,6 +110,10 @@
   16.50 + libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_GCC)
   16.51 + libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_GCC)
   16.52 + endif
   16.53 ++if MIPS_LINUX
   16.54 ++libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_LINUX)
   16.55 ++libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_LINUX)
   16.56 ++endif
   16.57 + if MIPS_SGI
   16.58 + libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_SGI)
   16.59 + libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_SGI)
   16.60 +@@ -147,6 +158,18 @@
   16.61 + libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_ARM)
   16.62 + libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_ARM)
   16.63 + endif
   16.64 ++if S390
   16.65 ++libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_S390)
   16.66 ++libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_S390)
   16.67 ++endif
   16.68 ++if X86_64
   16.69 ++libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_X86_64)
   16.70 ++libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_X86_64)
   16.71 ++endif
   16.72 ++if SH
   16.73 ++libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_SH)
   16.74 ++libfficonvenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_SH)
   16.75 ++endif
   16.76 + 
   16.77 + AM_CFLAGS = -fexceptions
   16.78 + 
   16.79 +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/Makefile.in gcc/libffi/Makefile.in
   16.80 +--- gcc-3.2.2.orig/libffi/Makefile.in	Wed Jan 29 07:59:05 2003
   16.81 ++++ gcc/libffi/Makefile.in	Wed Jan 29 07:58:58 2003
   16.82 +@@ -91,14 +91,17 @@
   16.83 + 		src/mips/n32.s src/mips/o32.S src/mips/o32.s \
   16.84 + 		src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S \
   16.85 + 		src/x86/ffi.c src/x86/sysv.S src/x86/win32.S \
   16.86 ++		src/x86/ffi64.c src/x86/unix64.S \
   16.87 + 		src/alpha/ffi.c src/alpha/osf.S \
   16.88 + 		src/m68k/ffi.c src/m68k/sysv.S \
   16.89 + 		src/powerpc/ffi.c src/powerpc/sysv.S \
   16.90 + 		src/powerpc/ppc_closure.S src/powerpc/asm.h \
   16.91 + 		src/powerpc/ffi_darwin.c \
   16.92 + 		src/powerpc/darwin.S src/powerpc/aix.S \
   16.93 +-		src/powerpc/darwin_closure.S src/powerpc/aix_closures.S \
   16.94 +-		src/arm/ffi.c src/arm/sysv.S
   16.95 ++		src/powerpc/darwin_closure.S src/powerpc/aix_closure.S \
   16.96 ++		src/arm/ffi.c src/arm/sysv.S \
   16.97 ++		src/s390/ffi.c src/s390/sysv.S \
   16.98 ++		src/sh/ffi.c src/sh/sysv.S
   16.99 + 
  16.100 + 
  16.101 + VPATH = @srcdir@:@srcdir@/src:@srcdir@/src/@TARGETDIR@
  16.102 +@@ -162,6 +165,7 @@
  16.103 + ffitest_LDFLAGS = -shared-libgcc
  16.104 + 
  16.105 + TARGET_SRC_MIPS_GCC = src/mips/ffi.c src/mips/o32.S src/mips/n32.S
  16.106 ++TARGET_SRC_MIPS_LINUX = src/mips/ffi.c src/mips/o32.S
  16.107 + TARGET_SRC_MIPS_SGI = src/mips/ffi.c src/mips/o32.s src/mips/n32.s
  16.108 + TARGET_SRC_X86 = src/x86/ffi.c src/x86/sysv.S
  16.109 + TARGET_SRC_X86_WIN32 = src/x86/ffi.c src/x86/win32.S
  16.110 +@@ -170,14 +174,18 @@
  16.111 + TARGET_SRC_IA64 = src/ia64/ffi.c src/ia64/unix.S
  16.112 + TARGET_SRC_M68K = src/m68k/ffi.c src/m68k/sysv.S
  16.113 + TARGET_SRC_POWERPC = src/powerpc/ffi.c src/powerpc/sysv.S src/powerpc/ppc_closure.S
  16.114 +-TARGET_SRC_POWERPC_AIX = src/powerpc/ffi_darwin.c src/powerpc/aix.S src/powerpc/aix_closures.S
  16.115 ++TARGET_SRC_POWERPC_AIX = src/powerpc/ffi_darwin.c src/powerpc/aix.S src/powerpc/aix_closure.S
  16.116 + TARGET_SRC_POWERPC_DARWIN = src/powerpc/ffi_darwin.c src/powerpc/darwin.S src/powerpc/darwin_closure.S
  16.117 + TARGET_SRC_ARM = src/arm/sysv.S src/arm/ffi.c
  16.118 ++TARGET_SRC_S390 = src/s390/sysv.S src/s390/ffi.c
  16.119 ++TARGET_SRC_X86_64 = src/x86/ffi64.c src/x86/unix64.S src/x86/ffi.c src/x86/sysv.S
  16.120 ++TARGET_SRC_SH = src/sh/sysv.S src/sh/ffi.c
  16.121 + 
  16.122 + libffi_la_common_SOURCES = src/debug.c src/prep_cif.c src/types.c \
  16.123 + 		src/raw_api.c src/java_raw_api.c
  16.124 + 
  16.125 + @MIPS_GCC_TRUE@libffi_la_SOURCES = @MIPS_GCC_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_GCC)
  16.126 ++@MIPS_LINUX_TRUE@libffi_la_SOURCES = @MIPS_LINUX_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_LINUX)
  16.127 + @MIPS_SGI_TRUE@libffi_la_SOURCES = @MIPS_SGI_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_SGI)
  16.128 + @X86_TRUE@libffi_la_SOURCES = @X86_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86)
  16.129 + @X86_WIN32_TRUE@libffi_la_SOURCES = @X86_WIN32_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86_WIN32)
  16.130 +@@ -189,7 +197,11 @@
  16.131 + @POWERPC_AIX_TRUE@libffi_la_SOURCES = @POWERPC_AIX_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_POWERPC_AIX)
  16.132 + @POWERPC_DARWIN_TRUE@libffi_la_SOURCES = @POWERPC_DARWIN_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_POWERPC_DARWIN)
  16.133 + @ARM_TRUE@libffi_la_SOURCES = @ARM_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_ARM)
  16.134 ++@S390_TRUE@libffi_la_SOURCES = @S390_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_S390)
  16.135 ++@X86_64_TRUE@libffi_la_SOURCES = @X86_64_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86_64)
  16.136 ++@SH_TRUE@libffi_la_SOURCES = @SH_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_SH)
  16.137 + @MIPS_GCC_TRUE@libffi_convenience_la_SOURCES = @MIPS_GCC_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_GCC)
  16.138 ++@MIPS_LINUX_TRUE@libffi_convenience_la_SOURCES = @MIPS_LINUX_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_LINUX)
  16.139 + @MIPS_SGI_TRUE@libffi_convenience_la_SOURCES = @MIPS_SGI_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_SGI)
  16.140 + @X86_TRUE@libffi_convenience_la_SOURCES = @X86_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86)
  16.141 + @X86_WIN32_TRUE@libffi_convenience_la_SOURCES = @X86_WIN32_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86_WIN32)
  16.142 +@@ -201,6 +213,9 @@
  16.143 + @POWERPC_AIX_TRUE@libffi_convenience_la_SOURCES = @POWERPC_AIX_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_POWERPC_AIX)
  16.144 + @POWERPC_DARWIN_TRUE@libffi_convenience_la_SOURCES = @POWERPC_DARWIN_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_POWERPC_DARWIN)
  16.145 + @ARM_TRUE@libffi_convenience_la_SOURCES = @ARM_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_ARM)
  16.146 ++@S390_TRUE@libffi_convenience_la_SOURCES = @S390_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_S390)
  16.147 ++@X86_64_TRUE@libffi_convenience_la_SOURCES = @X86_64_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86_64)
  16.148 ++@SH_TRUE@libfficonvenience_la_SOURCES = @SH_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_SH)
  16.149 + 
  16.150 + AM_CFLAGS = -fexceptions
  16.151 + 
  16.152 +@@ -208,7 +223,7 @@
  16.153 + 
  16.154 + INCLUDES = -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src
  16.155 + ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
  16.156 +-mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
  16.157 ++mkinstalldirs = $(SHELL) $(top_srcdir)/${libffi_basedir}/../mkinstalldirs
  16.158 + CONFIG_HEADER = fficonfig.h
  16.159 + CONFIG_CLEAN_FILES = 
  16.160 + LTLIBRARIES =  $(noinst_LTLIBRARIES) $(toolexeclib_LTLIBRARIES)
  16.161 +@@ -220,10 +235,6 @@
  16.162 + LIBS = @LIBS@
  16.163 + libffi_convenience_la_LDFLAGS = 
  16.164 + libffi_convenience_la_LIBADD = 
  16.165 +-@POWERPC_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo \
  16.166 +-@POWERPC_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
  16.167 +-@POWERPC_TRUE@src/java_raw_api.lo src/powerpc/ffi.lo \
  16.168 +-@POWERPC_TRUE@src/powerpc/sysv.lo src/powerpc/ppc_closure.lo
  16.169 + @ALPHA_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo \
  16.170 + @ALPHA_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
  16.171 + @ALPHA_TRUE@src/java_raw_api.lo src/alpha/ffi.lo src/alpha/osf.lo
  16.172 +@@ -234,12 +245,29 @@
  16.173 + @MIPS_GCC_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
  16.174 + @MIPS_GCC_TRUE@src/java_raw_api.lo src/mips/ffi.lo src/mips/o32.lo \
  16.175 + @MIPS_GCC_TRUE@src/mips/n32.lo
  16.176 +-@X86_WIN32_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo \
  16.177 +-@X86_WIN32_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
  16.178 +-@X86_WIN32_TRUE@src/java_raw_api.lo src/x86/ffi.lo src/x86/win32.lo
  16.179 ++@S390_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
  16.180 ++@S390_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
  16.181 ++@S390_TRUE@src/s390/sysv.lo src/s390/ffi.lo
  16.182 + @M68K_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
  16.183 + @M68K_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
  16.184 + @M68K_TRUE@src/m68k/ffi.lo src/m68k/sysv.lo
  16.185 ++@X86_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
  16.186 ++@X86_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
  16.187 ++@X86_TRUE@src/x86/ffi.lo src/x86/sysv.lo
  16.188 ++@POWERPC_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo \
  16.189 ++@POWERPC_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
  16.190 ++@POWERPC_TRUE@src/java_raw_api.lo src/powerpc/ffi.lo \
  16.191 ++@POWERPC_TRUE@src/powerpc/sysv.lo src/powerpc/ppc_closure.lo
  16.192 ++@MIPS_LINUX_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo \
  16.193 ++@MIPS_LINUX_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
  16.194 ++@MIPS_LINUX_TRUE@src/java_raw_api.lo src/mips/ffi.lo src/mips/o32.lo
  16.195 ++@X86_WIN32_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo \
  16.196 ++@X86_WIN32_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
  16.197 ++@X86_WIN32_TRUE@src/java_raw_api.lo src/x86/ffi.lo src/x86/win32.lo
  16.198 ++@X86_64_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo \
  16.199 ++@X86_64_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
  16.200 ++@X86_64_TRUE@src/java_raw_api.lo src/x86/ffi64.lo src/x86/unix64.lo \
  16.201 ++@X86_64_TRUE@src/x86/ffi.lo src/x86/sysv.lo
  16.202 + @SPARC_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo \
  16.203 + @SPARC_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
  16.204 + @SPARC_TRUE@src/java_raw_api.lo src/sparc/ffi.lo src/sparc/v8.lo \
  16.205 +@@ -247,62 +275,75 @@
  16.206 + @POWERPC_AIX_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo \
  16.207 + @POWERPC_AIX_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
  16.208 + @POWERPC_AIX_TRUE@src/java_raw_api.lo src/powerpc/ffi_darwin.lo \
  16.209 +-@POWERPC_AIX_TRUE@src/powerpc/aix.lo src/powerpc/aix_closures.lo
  16.210 +-@X86_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
  16.211 +-@X86_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
  16.212 +-@X86_TRUE@src/x86/ffi.lo src/x86/sysv.lo
  16.213 +-@ARM_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
  16.214 +-@ARM_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
  16.215 +-@ARM_TRUE@src/arm/sysv.lo src/arm/ffi.lo
  16.216 ++@POWERPC_AIX_TRUE@src/powerpc/aix.lo src/powerpc/aix_closure.lo
  16.217 ++@MIPS_SGI_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo \
  16.218 ++@MIPS_SGI_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
  16.219 ++@MIPS_SGI_TRUE@src/java_raw_api.lo src/mips/ffi.lo src/mips/o32.lo \
  16.220 ++@MIPS_SGI_TRUE@src/mips/n32.lo
  16.221 + @POWERPC_DARWIN_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo \
  16.222 + @POWERPC_DARWIN_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
  16.223 + @POWERPC_DARWIN_TRUE@src/java_raw_api.lo src/powerpc/ffi_darwin.lo \
  16.224 + @POWERPC_DARWIN_TRUE@src/powerpc/darwin.lo \
  16.225 + @POWERPC_DARWIN_TRUE@src/powerpc/darwin_closure.lo
  16.226 +-@MIPS_SGI_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo \
  16.227 +-@MIPS_SGI_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
  16.228 +-@MIPS_SGI_TRUE@src/java_raw_api.lo src/mips/ffi.lo src/mips/o32.lo \
  16.229 +-@MIPS_SGI_TRUE@src/mips/n32.lo
  16.230 ++@ARM_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
  16.231 ++@ARM_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
  16.232 ++@ARM_TRUE@src/arm/sysv.lo src/arm/ffi.lo
  16.233 ++@SH_TRUE@libffi_convenience_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
  16.234 ++@SH_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
  16.235 ++@SH_TRUE@src/sh/sysv.lo src/sh/ffi.lo
  16.236 + libffi_la_LIBADD = 
  16.237 ++@SH_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo src/types.lo \
  16.238 ++@SH_TRUE@src/raw_api.lo src/java_raw_api.lo src/sh/sysv.lo \
  16.239 ++@SH_TRUE@src/sh/ffi.lo
  16.240 ++@IA64_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
  16.241 ++@IA64_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
  16.242 ++@IA64_TRUE@src/ia64/ffi.lo src/ia64/unix.lo
  16.243 ++@X86_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo src/types.lo \
  16.244 ++@X86_TRUE@src/raw_api.lo src/java_raw_api.lo src/x86/ffi.lo \
  16.245 ++@X86_TRUE@src/x86/sysv.lo
  16.246 + @POWERPC_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
  16.247 + @POWERPC_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
  16.248 + @POWERPC_TRUE@src/powerpc/ffi.lo src/powerpc/sysv.lo \
  16.249 + @POWERPC_TRUE@src/powerpc/ppc_closure.lo
  16.250 +-@ALPHA_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
  16.251 +-@ALPHA_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
  16.252 +-@ALPHA_TRUE@src/alpha/ffi.lo src/alpha/osf.lo
  16.253 +-@IA64_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
  16.254 +-@IA64_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
  16.255 +-@IA64_TRUE@src/ia64/ffi.lo src/ia64/unix.lo
  16.256 +-@MIPS_GCC_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
  16.257 +-@MIPS_GCC_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
  16.258 +-@MIPS_GCC_TRUE@src/mips/ffi.lo src/mips/o32.lo src/mips/n32.lo
  16.259 +-@X86_WIN32_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
  16.260 +-@X86_WIN32_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
  16.261 +-@X86_WIN32_TRUE@src/x86/ffi.lo src/x86/win32.lo
  16.262 +-@M68K_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
  16.263 +-@M68K_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
  16.264 +-@M68K_TRUE@src/m68k/ffi.lo src/m68k/sysv.lo
  16.265 ++@MIPS_LINUX_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
  16.266 ++@MIPS_LINUX_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
  16.267 ++@MIPS_LINUX_TRUE@src/mips/ffi.lo src/mips/o32.lo
  16.268 + @SPARC_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
  16.269 + @SPARC_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
  16.270 + @SPARC_TRUE@src/sparc/ffi.lo src/sparc/v8.lo src/sparc/v9.lo
  16.271 + @POWERPC_AIX_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
  16.272 + @POWERPC_AIX_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
  16.273 + @POWERPC_AIX_TRUE@src/powerpc/ffi_darwin.lo src/powerpc/aix.lo \
  16.274 +-@POWERPC_AIX_TRUE@src/powerpc/aix_closures.lo
  16.275 +-@X86_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo src/types.lo \
  16.276 +-@X86_TRUE@src/raw_api.lo src/java_raw_api.lo src/x86/ffi.lo \
  16.277 +-@X86_TRUE@src/x86/sysv.lo
  16.278 ++@POWERPC_AIX_TRUE@src/powerpc/aix_closure.lo
  16.279 ++@MIPS_SGI_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
  16.280 ++@MIPS_SGI_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
  16.281 ++@MIPS_SGI_TRUE@src/mips/ffi.lo src/mips/o32.lo src/mips/n32.lo
  16.282 + @ARM_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo src/types.lo \
  16.283 + @ARM_TRUE@src/raw_api.lo src/java_raw_api.lo src/arm/sysv.lo \
  16.284 + @ARM_TRUE@src/arm/ffi.lo
  16.285 ++@ALPHA_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
  16.286 ++@ALPHA_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
  16.287 ++@ALPHA_TRUE@src/alpha/ffi.lo src/alpha/osf.lo
  16.288 ++@MIPS_GCC_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
  16.289 ++@MIPS_GCC_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
  16.290 ++@MIPS_GCC_TRUE@src/mips/ffi.lo src/mips/o32.lo src/mips/n32.lo
  16.291 ++@S390_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
  16.292 ++@S390_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
  16.293 ++@S390_TRUE@src/s390/sysv.lo src/s390/ffi.lo
  16.294 ++@M68K_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
  16.295 ++@M68K_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
  16.296 ++@M68K_TRUE@src/m68k/ffi.lo src/m68k/sysv.lo
  16.297 ++@X86_WIN32_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
  16.298 ++@X86_WIN32_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
  16.299 ++@X86_WIN32_TRUE@src/x86/ffi.lo src/x86/win32.lo
  16.300 ++@X86_64_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
  16.301 ++@X86_64_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
  16.302 ++@X86_64_TRUE@src/x86/ffi64.lo src/x86/unix64.lo src/x86/ffi.lo \
  16.303 ++@X86_64_TRUE@src/x86/sysv.lo
  16.304 + @POWERPC_DARWIN_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
  16.305 + @POWERPC_DARWIN_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
  16.306 + @POWERPC_DARWIN_TRUE@src/powerpc/ffi_darwin.lo src/powerpc/darwin.lo \
  16.307 + @POWERPC_DARWIN_TRUE@src/powerpc/darwin_closure.lo
  16.308 +-@MIPS_SGI_TRUE@libffi_la_OBJECTS =  src/debug.lo src/prep_cif.lo \
  16.309 +-@MIPS_SGI_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
  16.310 +-@MIPS_SGI_TRUE@src/mips/ffi.lo src/mips/o32.lo src/mips/n32.lo
  16.311 + noinst_PROGRAMS =  ffitest$(EXEEXT)
  16.312 + PROGRAMS =  $(noinst_PROGRAMS)
  16.313 + 
  16.314 +@@ -578,8 +616,8 @@
  16.315 + 	-chmod 777 $(distdir)
  16.316 + 	$(mkinstalldirs) $(distdir)/src/alpha $(distdir)/src/arm \
  16.317 + 	   $(distdir)/src/m68k $(distdir)/src/mips \
  16.318 +-	   $(distdir)/src/powerpc $(distdir)/src/sparc \
  16.319 +-	   $(distdir)/src/x86
  16.320 ++	   $(distdir)/src/powerpc $(distdir)/src/s390 $(distdir)/src/sh \
  16.321 ++	   $(distdir)/src/sparc $(distdir)/src/x86
  16.322 + 	@for file in $(DISTFILES); do \
  16.323 + 	  if test -f $$file; then d=.; else d=$(srcdir); fi; \
  16.324 + 	  if test -d $$d/$$file; then \
  16.325 +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/acinclude.m4 gcc/libffi/acinclude.m4
  16.326 +--- gcc-3.2.2.orig/libffi/acinclude.m4	Sun Sep 10 16:43:14 2000
  16.327 ++++ gcc/libffi/acinclude.m4	Tue Dec 17 03:22:47 2002
  16.328 +@@ -4,5 +4,8 @@
  16.329 + dnl to add a definition of LIBTOOL to Makefile.in.
  16.330 + ifelse(yes,no,[
  16.331 + AC_DEFUN([AC_PROG_LIBTOOL],)
  16.332 ++AC_DEFUN([AM_PROG_LIBTOOL],)
  16.333 + AC_SUBST(LIBTOOL)
  16.334 + ])
  16.335 ++
  16.336 ++sinclude(../config/accross.m4)
  16.337 +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/aclocal.m4 gcc/libffi/aclocal.m4
  16.338 +--- gcc-3.2.2.orig/libffi/aclocal.m4	Fri Feb  1 07:25:31 2002
  16.339 ++++ gcc/libffi/aclocal.m4	Tue Dec 17 03:22:47 2002
  16.340 +@@ -1,6 +1,6 @@
  16.341 +-dnl aclocal.m4 generated automatically by aclocal 1.4
  16.342 ++dnl aclocal.m4 generated automatically by aclocal 1.4-p5
  16.343 + 
  16.344 +-dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
  16.345 ++dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
  16.346 + dnl This file is free software; the Free Software Foundation
  16.347 + dnl gives unlimited permission to copy and/or distribute it,
  16.348 + dnl with or without modifications, as long as this notice is preserved.
  16.349 +@@ -16,108 +16,15 @@
  16.350 + dnl to add a definition of LIBTOOL to Makefile.in.
  16.351 + ifelse(yes,no,[
  16.352 + AC_DEFUN([AC_PROG_LIBTOOL],)
  16.353 ++AC_DEFUN([AM_PROG_LIBTOOL],)
  16.354 + AC_SUBST(LIBTOOL)
  16.355 + ])
  16.356 + 
  16.357 +-AC_DEFUN([AC_COMPILE_CHECK_SIZEOF],
  16.358 +-[changequote(<<, >>)dnl
  16.359 +-dnl The name to #define.
  16.360 +-define(<<AC_TYPE_NAME>>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl
  16.361 +-dnl The cache variable name.
  16.362 +-define(<<AC_CV_NAME>>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl
  16.363 +-changequote([, ])dnl
  16.364 +-AC_MSG_CHECKING(size of $1)
  16.365 +-AC_CACHE_VAL(AC_CV_NAME,
  16.366 +-[for ac_size in 4 8 1 2 16 12 $2 ; do # List sizes in rough order of prevalence.
  16.367 +-  AC_TRY_COMPILE([#include "confdefs.h"
  16.368 +-#include <sys/types.h>
  16.369 +-$2
  16.370 +-], [switch (0) case 0: case (sizeof ($1) == $ac_size):;], AC_CV_NAME=$ac_size)
  16.371 +-  if test x$AC_CV_NAME != x ; then break; fi
  16.372 +-done
  16.373 +-])
  16.374 +-if test x$AC_CV_NAME = x ; then
  16.375 +-  AC_MSG_ERROR([cannot determine a size for $1])
  16.376 +-fi
  16.377 +-AC_MSG_RESULT($AC_CV_NAME)
  16.378 +-AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME, [The number of bytes in type $1])
  16.379 +-undefine([AC_TYPE_NAME])dnl
  16.380 +-undefine([AC_CV_NAME])dnl
  16.381 +-])
  16.382 +-
  16.383 +-AC_DEFUN([AC_C_BIGENDIAN_CROSS],
  16.384 +-[AC_CACHE_CHECK(whether byte ordering is bigendian, ac_cv_c_bigendian,
  16.385 +-[ac_cv_c_bigendian=unknown
  16.386 +-# See if sys/param.h defines the BYTE_ORDER macro.
  16.387 +-AC_TRY_COMPILE([#include <sys/types.h>
  16.388 +-#include <sys/param.h>], [
  16.389 +-#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
  16.390 +- bogus endian macros
  16.391 +-#endif], [# It does; now see whether it defined to BIG_ENDIAN or not.
  16.392 +-AC_TRY_COMPILE([#include <sys/types.h>
  16.393 +-#include <sys/param.h>], [
  16.394 +-#if BYTE_ORDER != BIG_ENDIAN
  16.395 +- not big endian
  16.396 +-#endif], ac_cv_c_bigendian=yes, ac_cv_c_bigendian=no)])
  16.397 +-if test $ac_cv_c_bigendian = unknown; then
  16.398 +-AC_TRY_RUN([main () {
  16.399 +-  /* Are we little or big endian?  From Harbison&Steele.  */
  16.400 +-  union
  16.401 +-  {
  16.402 +-    long l;
  16.403 +-    char c[sizeof (long)];
  16.404 +-  } u;
  16.405 +-  u.l = 1;
  16.406 +-  exit (u.c[sizeof (long) - 1] == 1);
  16.407 +-}], ac_cv_c_bigendian=no, ac_cv_c_bigendian=yes,
  16.408 +-[ echo $ac_n "cross-compiling... " 2>&AC_FD_MSG ])
  16.409 +-fi])
  16.410 +-if test $ac_cv_c_bigendian = unknown; then
  16.411 +-AC_MSG_CHECKING(to probe for byte ordering)
  16.412 +-[
  16.413 +-cat >conftest.c <<EOF
  16.414 +-short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
  16.415 +-short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
  16.416 +-void _ascii() { char* s = (char*) ascii_mm; s = (char*) ascii_ii; }
  16.417 +-short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
  16.418 +-short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
  16.419 +-void _ebcdic() { char* s = (char*) ebcdic_mm; s = (char*) ebcdic_ii; }
  16.420 +-int main() { _ascii (); _ebcdic (); return 0; }
  16.421 +-EOF
  16.422 +-] if test -f conftest.c ; then
  16.423 +-     if ${CC-cc} ${CFLAGS} conftest.c -o conftest.o && test -f conftest.o ; then
  16.424 +-        if test `grep -l BIGenDianSyS conftest.o` ; then
  16.425 +-           echo $ac_n ' big endian probe OK, ' 1>&AC_FD_MSG
  16.426 +-           ac_cv_c_bigendian=yes
  16.427 +-        fi
  16.428 +-        if test `grep -l LiTTleEnDian conftest.o` ; then
  16.429 +-           echo $ac_n ' little endian probe OK, ' 1>&AC_FD_MSG
  16.430 +-           if test $ac_cv_c_bigendian = yes ; then
  16.431 +-            ac_cv_c_bigendian=unknown;
  16.432 +-           else
  16.433 +-            ac_cv_c_bigendian=no
  16.434 +-           fi
  16.435 +-        fi
  16.436 +-        echo $ac_n 'guessing bigendian ...  ' >&AC_FD_MSG
  16.437 +-     fi
  16.438 +-  fi
  16.439 +-AC_MSG_RESULT($ac_cv_c_bigendian)
  16.440 +-fi
  16.441 +-if test $ac_cv_c_bigendian = yes; then
  16.442 +-  AC_DEFINE(WORDS_BIGENDIAN, 1, [whether byteorder is bigendian])
  16.443 +-  BYTEORDER=4321
  16.444 +-else
  16.445 +-  BYTEORDER=1234
  16.446 +-fi
  16.447 +-AC_DEFINE_UNQUOTED(BYTEORDER, $BYTEORDER, [1234 = LIL_ENDIAN, 4321 = BIGENDIAN])
  16.448 +-if test $ac_cv_c_bigendian = unknown; then
  16.449 +-  AC_MSG_ERROR(unknown endianess - sorry, please pre-set ac_cv_c_bigendian)
  16.450 +-fi
  16.451 +-])
  16.452 ++sinclude(../config/accross.m4)
  16.453 + 
  16.454 + # Like AC_CONFIG_HEADER, but automatically create stamp file.
  16.455 + 
  16.456 +-AC_DEFUN(AM_CONFIG_HEADER,
  16.457 ++AC_DEFUN([AM_CONFIG_HEADER],
  16.458 + [AC_PREREQ([2.12])
  16.459 + AC_CONFIG_HEADER([$1])
  16.460 + dnl When config.status generates a header, we must update the stamp-h file.
  16.461 +@@ -147,7 +54,7 @@
  16.462 + dnl Usage:
  16.463 + dnl AM_INIT_AUTOMAKE(package,version, [no-define])
  16.464 + 
  16.465 +-AC_DEFUN(AM_INIT_AUTOMAKE,
  16.466 ++AC_DEFUN([AM_INIT_AUTOMAKE],
  16.467 + [AC_REQUIRE([AC_PROG_INSTALL])
  16.468 + PACKAGE=[$1]
  16.469 + AC_SUBST(PACKAGE)
  16.470 +@@ -175,7 +82,7 @@
  16.471 + # Check to make sure that the build environment is sane.
  16.472 + #
  16.473 + 
  16.474 +-AC_DEFUN(AM_SANITY_CHECK,
  16.475 ++AC_DEFUN([AM_SANITY_CHECK],
  16.476 + [AC_MSG_CHECKING([whether build environment is sane])
  16.477 + # Just in case
  16.478 + sleep 1
  16.479 +@@ -216,7 +123,7 @@
  16.480 + 
  16.481 + dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
  16.482 + dnl The program must properly implement --version.
  16.483 +-AC_DEFUN(AM_MISSING_PROG,
  16.484 ++AC_DEFUN([AM_MISSING_PROG],
  16.485 + [AC_MSG_CHECKING(for working $2)
  16.486 + # Run test in a subshell; some versions of sh will print an error if
  16.487 + # an executable is not found, even if stderr is redirected.
  16.488 +@@ -235,7 +142,7 @@
  16.489 + 
  16.490 + # serial 1
  16.491 + 
  16.492 +-AC_DEFUN(AM_MAINTAINER_MODE,
  16.493 ++AC_DEFUN([AM_MAINTAINER_MODE],
  16.494 + [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
  16.495 +   dnl maintainer-mode is disabled by default
  16.496 +   AC_ARG_ENABLE(maintainer-mode,
  16.497 +@@ -252,7 +159,7 @@
  16.498 + 
  16.499 + # Define a conditional.
  16.500 + 
  16.501 +-AC_DEFUN(AM_CONDITIONAL,
  16.502 ++AC_DEFUN([AM_CONDITIONAL],
  16.503 + [AC_SUBST($1_TRUE)
  16.504 + AC_SUBST($1_FALSE)
  16.505 + if $2; then
  16.506 +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/configure gcc/libffi/configure
  16.507 +--- gcc-3.2.2.orig/libffi/configure	Wed Jan 29 07:59:05 2003
  16.508 ++++ gcc/libffi/configure	Sat Feb  1 20:16:19 2003
  16.509 +@@ -633,17 +633,16 @@
  16.510 + 
  16.511 + if test "${srcdir}" = "."; then
  16.512 +   if test "${with_target_subdir}" != "."; then
  16.513 +-    libffi_basedir="${srcdir}/${with_multisrctop}.."
  16.514 ++    libffi_basedir="${with_multisrctop}../"
  16.515 +   else
  16.516 +-    libffi_basedir="${srcdir}/${with_multisrctop}"
  16.517 ++    libffi_basedir="${with_multisrctop}"
  16.518 +   fi
  16.519 + else
  16.520 +-  libffi_basedir="${srcdir}"
  16.521 ++  libffi_basedir=
  16.522 + fi
  16.523 + 
  16.524 +-
  16.525 + ac_aux_dir=
  16.526 +-for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
  16.527 ++for ac_dir in ${libffi_basedir}.. $srcdir/${libffi_basedir}..; do
  16.528 +   if test -f $ac_dir/install-sh; then
  16.529 +     ac_aux_dir=$ac_dir
  16.530 +     ac_install_sh="$ac_aux_dir/install-sh -c"
  16.531 +@@ -655,13 +654,14 @@
  16.532 +   fi
  16.533 + done
  16.534 + if test -z "$ac_aux_dir"; then
  16.535 +-  { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
  16.536 ++  { echo "configure: error: can not find install-sh or install.sh in ${libffi_basedir}.. $srcdir/${libffi_basedir}.." 1>&2; exit 1; }
  16.537 + fi
  16.538 + ac_config_guess=$ac_aux_dir/config.guess
  16.539 + ac_config_sub=$ac_aux_dir/config.sub
  16.540 + ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
  16.541 + 
  16.542 + 
  16.543 ++
  16.544 + # Make sure we can run config.sub.
  16.545 + if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
  16.546 + else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
  16.547 +@@ -1238,9 +1238,18 @@
  16.548 +   ;;
  16.549 + 
  16.550 + hpux10.20*|hpux11*)
  16.551 +-  lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
  16.552 +-  lt_cv_file_magic_cmd=/usr/bin/file
  16.553 +-  lt_cv_file_magic_test_file=/usr/lib/libc.sl
  16.554 ++  case $host_cpu in
  16.555 ++  hppa*)
  16.556 ++    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
  16.557 ++    lt_cv_file_magic_cmd=/usr/bin/file
  16.558 ++    lt_cv_file_magic_test_file=/usr/lib/libc.sl
  16.559 ++    ;;
  16.560 ++  ia64*)
  16.561 ++    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
  16.562 ++    lt_cv_file_magic_cmd=/usr/bin/file
  16.563 ++    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
  16.564 ++    ;;
  16.565 ++  esac
  16.566 +   ;;
  16.567 + 
  16.568 + irix5* | irix6*)
  16.569 +@@ -1267,7 +1276,7 @@
  16.570 + # This must be Linux ELF.
  16.571 + linux-gnu*)
  16.572 +   case $host_cpu in
  16.573 +-  alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* )
  16.574 ++  alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | sh* )
  16.575 +     lt_cv_deplibs_check_method=pass_all ;;
  16.576 +   *)
  16.577 +     # glibc up to 2.1.1 does not perform some relocations on ARM
  16.578 +@@ -1330,13 +1339,13 @@
  16.579 + deplibs_check_method=$lt_cv_deplibs_check_method
  16.580 + 
  16.581 + echo $ac_n "checking for object suffix""... $ac_c" 1>&6
  16.582 +-echo "configure:1334: checking for object suffix" >&5
  16.583 ++echo "configure:1343: checking for object suffix" >&5
  16.584 + if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
  16.585 +   echo $ac_n "(cached) $ac_c" 1>&6
  16.586 + else
  16.587 +   rm -f conftest*
  16.588 + echo 'int i = 1;' > conftest.$ac_ext
  16.589 +-if { (eval echo configure:1340: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  16.590 ++if { (eval echo configure:1349: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  16.591 +   for ac_file in conftest.*; do
  16.592 +     case $ac_file in
  16.593 +     *.c) ;;
  16.594 +@@ -1356,7 +1365,7 @@
  16.595 + 
  16.596 + 
  16.597 + echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
  16.598 +-echo "configure:1360: checking for executable suffix" >&5
  16.599 ++echo "configure:1369: checking for executable suffix" >&5
  16.600 + if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
  16.601 +   echo $ac_n "(cached) $ac_c" 1>&6
  16.602 + else
  16.603 +@@ -1366,7 +1375,7 @@
  16.604 +   rm -f conftest*
  16.605 +   echo 'int main () { return 0; }' > conftest.$ac_ext
  16.606 +   ac_cv_exeext=
  16.607 +-  if { (eval echo configure:1370: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
  16.608 ++  if { (eval echo configure:1379: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
  16.609 +     for file in conftest.*; do
  16.610 +       case $file in
  16.611 +       *.c | *.o | *.obj) ;;
  16.612 +@@ -1399,7 +1408,7 @@
  16.613 + file_magic*)
  16.614 +   if test "$file_magic_cmd" = '$MAGIC_CMD'; then
  16.615 +     echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6
  16.616 +-echo "configure:1403: checking for ${ac_tool_prefix}file" >&5
  16.617 ++echo "configure:1412: checking for ${ac_tool_prefix}file" >&5
  16.618 + if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then
  16.619 +   echo $ac_n "(cached) $ac_c" 1>&6
  16.620 + else
  16.621 +@@ -1461,7 +1470,7 @@
  16.622 + if test -z "$lt_cv_path_MAGIC_CMD"; then
  16.623 +   if test -n "$ac_tool_prefix"; then
  16.624 +     echo $ac_n "checking for file""... $ac_c" 1>&6
  16.625 +-echo "configure:1465: checking for file" >&5
  16.626 ++echo "configure:1474: checking for file" >&5
  16.627 + if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then
  16.628 +   echo $ac_n "(cached) $ac_c" 1>&6
  16.629 + else
  16.630 +@@ -1532,7 +1541,7 @@
  16.631 + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
  16.632 + set dummy ${ac_tool_prefix}ranlib; ac_word=$2
  16.633 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
  16.634 +-echo "configure:1536: checking for $ac_word" >&5
  16.635 ++echo "configure:1545: checking for $ac_word" >&5
  16.636 + if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
  16.637 +   echo $ac_n "(cached) $ac_c" 1>&6
  16.638 + else
  16.639 +@@ -1564,7 +1573,7 @@
  16.640 +   # Extract the first word of "ranlib", so it can be a program name with args.
  16.641 + set dummy ranlib; ac_word=$2
  16.642 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
  16.643 +-echo "configure:1568: checking for $ac_word" >&5
  16.644 ++echo "configure:1577: checking for $ac_word" >&5
  16.645 + if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
  16.646 +   echo $ac_n "(cached) $ac_c" 1>&6
  16.647 + else
  16.648 +@@ -1599,7 +1608,7 @@
  16.649 + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
  16.650 + set dummy ${ac_tool_prefix}strip; ac_word=$2
  16.651 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
  16.652 +-echo "configure:1603: checking for $ac_word" >&5
  16.653 ++echo "configure:1612: checking for $ac_word" >&5
  16.654 + if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
  16.655 +   echo $ac_n "(cached) $ac_c" 1>&6
  16.656 + else
  16.657 +@@ -1631,7 +1640,7 @@
  16.658 +   # Extract the first word of "strip", so it can be a program name with args.
  16.659 + set dummy strip; ac_word=$2
  16.660 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
  16.661 +-echo "configure:1635: checking for $ac_word" >&5
  16.662 ++echo "configure:1644: checking for $ac_word" >&5
  16.663 + if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
  16.664 +   echo $ac_n "(cached) $ac_c" 1>&6
  16.665 + else
  16.666 +@@ -1698,8 +1707,8 @@
  16.667 + case $host in
  16.668 + *-*-irix6*)
  16.669 +   # Find out which ABI we are using.
  16.670 +-  echo '#line 1702 "configure"' > conftest.$ac_ext
  16.671 +-  if { (eval echo configure:1703: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  16.672 ++  echo '#line 1711 "configure"' > conftest.$ac_ext
  16.673 ++  if { (eval echo configure:1712: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  16.674 +     case `/usr/bin/file conftest.$ac_objext` in
  16.675 +     *32-bit*)
  16.676 +       LD="${LD-ld} -32"
  16.677 +@@ -1715,12 +1724,70 @@
  16.678 +   rm -rf conftest*
  16.679 +   ;;
  16.680 + 
  16.681 ++ia64-*-hpux*)
  16.682 ++  # Find out which ABI we are using.
  16.683 ++  echo 'int i;' > conftest.$ac_ext
  16.684 ++  if { (eval echo configure:1731: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  16.685 ++    case "`/usr/bin/file conftest.o`" in
  16.686 ++    *ELF-32*)
  16.687 ++      HPUX_IA64_MODE="32"
  16.688 ++      ;;
  16.689 ++    *ELF-64*)
  16.690 ++      HPUX_IA64_MODE="64"
  16.691 ++      ;;
  16.692 ++    esac
  16.693 ++  fi
  16.694 ++  rm -rf conftest*
  16.695 ++  ;;
  16.696 ++
  16.697 ++x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
  16.698 ++  # Find out which ABI we are using.
  16.699 ++  echo 'int i;' > conftest.$ac_ext
  16.700 ++  if { (eval echo configure:1747: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  16.701 ++    case "`/usr/bin/file conftest.o`" in
  16.702 ++    *32-bit*)
  16.703 ++      case $host in
  16.704 ++        x86_64-*linux*)
  16.705 ++          LD="${LD-ld} -m elf_i386"
  16.706 ++          ;;
  16.707 ++        ppc64-*linux*)
  16.708 ++          LD="${LD-ld} -m elf32ppclinux"
  16.709 ++          ;;
  16.710 ++        s390x-*linux*)
  16.711 ++          LD="${LD-ld} -m elf_s390"
  16.712 ++          ;;
  16.713 ++        sparc64-*linux*)
  16.714 ++          LD="${LD-ld} -m elf32_sparc"
  16.715 ++          ;;
  16.716 ++      esac
  16.717 ++      ;;
  16.718 ++    *64-bit*)
  16.719 ++      case $host in
  16.720 ++        x86_64-*linux*)
  16.721 ++          LD="${LD-ld} -m elf_x86_64"
  16.722 ++          ;;
  16.723 ++        ppc*-*linux*|powerpc*-*linux*)
  16.724 ++          LD="${LD-ld} -m elf64ppc"
  16.725 ++          ;;
  16.726 ++        s390*-*linux*)
  16.727 ++          LD="${LD-ld} -m elf64_s390"
  16.728 ++          ;;
  16.729 ++        sparc*-*linux*)
  16.730 ++          LD="${LD-ld} -m elf64_sparc"
  16.731 ++          ;;
  16.732 ++      esac
  16.733 ++      ;;
  16.734 ++    esac
  16.735 ++  fi
  16.736 ++  rm -rf conftest*
  16.737 ++  ;;
  16.738 ++
  16.739 + *-*-sco3.2v5*)
  16.740 +   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
  16.741 +   SAVE_CFLAGS="$CFLAGS"
  16.742 +   CFLAGS="$CFLAGS -belf"
  16.743 +   echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
  16.744 +-echo "configure:1724: checking whether the C compiler needs -belf" >&5
  16.745 ++echo "configure:1791: checking whether the C compiler needs -belf" >&5
  16.746 + if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then
  16.747 +   echo $ac_n "(cached) $ac_c" 1>&6
  16.748 + else
  16.749 +@@ -1733,14 +1800,14 @@
  16.750 + cross_compiling=$ac_cv_prog_cc_cross
  16.751 + 
  16.752 +      cat > conftest.$ac_ext <<EOF
  16.753 +-#line 1737 "configure"
  16.754 ++#line 1804 "configure"
  16.755 + #include "confdefs.h"
  16.756 + 
  16.757 + int main() {
  16.758 + 
  16.759 + ; return 0; }
  16.760 + EOF
  16.761 +-if { (eval echo configure:1744: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  16.762 ++if { (eval echo configure:1811: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  16.763 +   rm -rf conftest*
  16.764 +   lt_cv_cc_needs_belf=yes
  16.765 + else
  16.766 +@@ -1868,7 +1935,7 @@
  16.767 + # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
  16.768 + # ./install, which can be erroneously created by make from ./install.sh.
  16.769 + echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
  16.770 +-echo "configure:1872: checking for a BSD compatible install" >&5
  16.771 ++echo "configure:1939: checking for a BSD compatible install" >&5
  16.772 + if test -z "$INSTALL"; then
  16.773 + if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
  16.774 +   echo $ac_n "(cached) $ac_c" 1>&6
  16.775 +@@ -1921,7 +1988,7 @@
  16.776 + test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
  16.777 + 
  16.778 + echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
  16.779 +-echo "configure:1925: checking whether build environment is sane" >&5
  16.780 ++echo "configure:1992: checking whether build environment is sane" >&5
  16.781 + # Just in case
  16.782 + sleep 1
  16.783 + echo timestamp > conftestfile
  16.784 +@@ -1978,7 +2045,7 @@
  16.785 + test "$program_transform_name" = "" && program_transform_name="s,x,x,"
  16.786 + 
  16.787 + echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
  16.788 +-echo "configure:1982: checking whether ${MAKE-make} sets \${MAKE}" >&5
  16.789 ++echo "configure:2049: checking whether ${MAKE-make} sets \${MAKE}" >&5
  16.790 + set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
  16.791 + if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
  16.792 +   echo $ac_n "(cached) $ac_c" 1>&6
  16.793 +@@ -2017,7 +2084,7 @@
  16.794 + 
  16.795 + missing_dir=`cd $ac_aux_dir && pwd`
  16.796 + echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
  16.797 +-echo "configure:2021: checking for working aclocal" >&5
  16.798 ++echo "configure:2088: checking for working aclocal" >&5
  16.799 + # Run test in a subshell; some versions of sh will print an error if
  16.800 + # an executable is not found, even if stderr is redirected.
  16.801 + # Redirect stdin to placate older versions of autoconf.  Sigh.
  16.802 +@@ -2030,7 +2097,7 @@
  16.803 + fi
  16.804 + 
  16.805 + echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
  16.806 +-echo "configure:2034: checking for working autoconf" >&5
  16.807 ++echo "configure:2101: checking for working autoconf" >&5
  16.808 + # Run test in a subshell; some versions of sh will print an error if
  16.809 + # an executable is not found, even if stderr is redirected.
  16.810 + # Redirect stdin to placate older versions of autoconf.  Sigh.
  16.811 +@@ -2043,7 +2110,7 @@
  16.812 + fi
  16.813 + 
  16.814 + echo $ac_n "checking for working automake""... $ac_c" 1>&6
  16.815 +-echo "configure:2047: checking for working automake" >&5
  16.816 ++echo "configure:2114: checking for working automake" >&5
  16.817 + # Run test in a subshell; some versions of sh will print an error if
  16.818 + # an executable is not found, even if stderr is redirected.
  16.819 + # Redirect stdin to placate older versions of autoconf.  Sigh.
  16.820 +@@ -2056,7 +2123,7 @@
  16.821 + fi
  16.822 + 
  16.823 + echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
  16.824 +-echo "configure:2060: checking for working autoheader" >&5
  16.825 ++echo "configure:2127: checking for working autoheader" >&5
  16.826 + # Run test in a subshell; some versions of sh will print an error if
  16.827 + # an executable is not found, even if stderr is redirected.
  16.828 + # Redirect stdin to placate older versions of autoconf.  Sigh.
  16.829 +@@ -2069,7 +2136,7 @@
  16.830 + fi
  16.831 + 
  16.832 + echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
  16.833 +-echo "configure:2073: checking for working makeinfo" >&5
  16.834 ++echo "configure:2140: checking for working makeinfo" >&5
  16.835 + # Run test in a subshell; some versions of sh will print an error if
  16.836 + # an executable is not found, even if stderr is redirected.
  16.837 + # Redirect stdin to placate older versions of autoconf.  Sigh.
  16.838 +@@ -2086,7 +2153,7 @@
  16.839 + 
  16.840 + 
  16.841 + echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
  16.842 +-echo "configure:2090: checking for executable suffix" >&5
  16.843 ++echo "configure:2157: checking for executable suffix" >&5
  16.844 + if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
  16.845 +   echo $ac_n "(cached) $ac_c" 1>&6
  16.846 + else
  16.847 +@@ -2096,7 +2163,7 @@
  16.848 +   rm -f conftest*
  16.849 +   echo 'int main () { return 0; }' > conftest.$ac_ext
  16.850 +   ac_cv_exeext=
  16.851 +-  if { (eval echo configure:2100: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
  16.852 ++  if { (eval echo configure:2167: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
  16.853 +     for file in conftest.*; do
  16.854 +       case $file in
  16.855 +       *.c | *.o | *.obj) ;;
  16.856 +@@ -2117,7 +2184,7 @@
  16.857 + ac_exeext=$EXEEXT
  16.858 + 
  16.859 + echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
  16.860 +-echo "configure:2121: checking whether to enable maintainer-specific portions of Makefiles" >&5
  16.861 ++echo "configure:2188: checking whether to enable maintainer-specific portions of Makefiles" >&5
  16.862 +     # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
  16.863 + if test "${enable_maintainer_mode+set}" = set; then
  16.864 +   enableval="$enable_maintainer_mode"
  16.865 +@@ -2143,7 +2210,7 @@
  16.866 + # Extract the first word of "gcc", so it can be a program name with args.
  16.867 + set dummy gcc; ac_word=$2
  16.868 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
  16.869 +-echo "configure:2147: checking for $ac_word" >&5
  16.870 ++echo "configure:2214: checking for $ac_word" >&5
  16.871 + if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
  16.872 +   echo $ac_n "(cached) $ac_c" 1>&6
  16.873 + else
  16.874 +@@ -2173,7 +2240,7 @@
  16.875 +   # Extract the first word of "cc", so it can be a program name with args.
  16.876 + set dummy cc; ac_word=$2
  16.877 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
  16.878 +-echo "configure:2177: checking for $ac_word" >&5
  16.879 ++echo "configure:2244: checking for $ac_word" >&5
  16.880 + if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
  16.881 +   echo $ac_n "(cached) $ac_c" 1>&6
  16.882 + else
  16.883 +@@ -2224,7 +2291,7 @@
  16.884 +       # Extract the first word of "cl", so it can be a program name with args.
  16.885 + set dummy cl; ac_word=$2
  16.886 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
  16.887 +-echo "configure:2228: checking for $ac_word" >&5
  16.888 ++echo "configure:2295: checking for $ac_word" >&5
  16.889 + if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
  16.890 +   echo $ac_n "(cached) $ac_c" 1>&6
  16.891 + else
  16.892 +@@ -2256,7 +2323,7 @@
  16.893 + fi
  16.894 + 
  16.895 + echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
  16.896 +-echo "configure:2260: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
  16.897 ++echo "configure:2327: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
  16.898 + 
  16.899 + ac_ext=c
  16.900 + # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
  16.901 +@@ -2267,12 +2334,12 @@
  16.902 + 
  16.903 + cat > conftest.$ac_ext << EOF
  16.904 + 
  16.905 +-#line 2271 "configure"
  16.906 ++#line 2338 "configure"
  16.907 + #include "confdefs.h"
  16.908 + 
  16.909 + main(){return(0);}
  16.910 + EOF
  16.911 +-if { (eval echo configure:2276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  16.912 ++if { (eval echo configure:2343: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  16.913 +   ac_cv_prog_cc_works=yes
  16.914 +   # If we can't run a trivial program, we are probably using a cross compiler.
  16.915 +   if (./conftest; exit) 2>/dev/null; then
  16.916 +@@ -2298,12 +2365,12 @@
  16.917 +   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
  16.918 + fi
  16.919 + echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
  16.920 +-echo "configure:2302: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
  16.921 ++echo "configure:2369: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
  16.922 + echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
  16.923 + cross_compiling=$ac_cv_prog_cc_cross
  16.924 + 
  16.925 + echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
  16.926 +-echo "configure:2307: checking whether we are using GNU C" >&5
  16.927 ++echo "configure:2374: checking whether we are using GNU C" >&5
  16.928 + if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
  16.929 +   echo $ac_n "(cached) $ac_c" 1>&6
  16.930 + else
  16.931 +@@ -2312,7 +2379,7 @@
  16.932 +   yes;
  16.933 + #endif
  16.934 + EOF
  16.935 +-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
  16.936 ++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
  16.937 +   ac_cv_prog_gcc=yes
  16.938 + else
  16.939 +   ac_cv_prog_gcc=no
  16.940 +@@ -2331,7 +2398,7 @@
  16.941 + ac_save_CFLAGS="$CFLAGS"
  16.942 + CFLAGS=
  16.943 + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
  16.944 +-echo "configure:2335: checking whether ${CC-cc} accepts -g" >&5
  16.945 ++echo "configure:2402: checking whether ${CC-cc} accepts -g" >&5
  16.946 + if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
  16.947 +   echo $ac_n "(cached) $ac_c" 1>&6
  16.948 + else
  16.949 +@@ -2381,17 +2448,23 @@
  16.950 + i*86-*-mingw*) TARGET=X86_WIN32; TARGETDIR=x86;;
  16.951 + sparc-sun-4*) TARGET=SPARC; TARGETDIR=sparc;;
  16.952 + sparc*-sun-*) TARGET=SPARC; TARGETDIR=sparc;;
  16.953 +-sparc-*-linux*) TARGET=SPARC; TARGETDIR=sparc;;
  16.954 +-sparc64-*-linux*) TARGET=SPARC; TARGETDIR=sparc;;
  16.955 +-alpha*-*-linux* | alpha*-*-osf* | alpha*-*-freebsd*) TARGET=ALPHA; TARGETDIR=alpha;;
  16.956 ++sparc-*-linux* | sparc-*-netbsdelf*) TARGET=SPARC; TARGETDIR=sparc;;
  16.957 ++sparc64-*-linux* | sparc64-*-netbsd*) TARGET=SPARC; TARGETDIR=sparc;;
  16.958 ++alpha*-*-linux* | alpha*-*-osf* | alpha*-*-freebsd* | alpha*-*-netbsd*) TARGET=ALPHA; TARGETDIR=alpha;;
  16.959 + ia64*-*-*) TARGET=IA64; TARGETDIR=ia64;;
  16.960 + m68k-*-linux*) TARGET=M68K; TARGETDIR=m68k;;
  16.961 ++mips64*-*);;
  16.962 ++mips*-*-linux*) TARGET=MIPS_LINUX; TARGETDIR=mips;;
  16.963 + powerpc-*-linux* | powerpc-*-sysv*) TARGET=POWERPC; TARGETDIR=powerpc;;
  16.964 + powerpc-*-beos*) TARGET=POWERPC; TARGETDIR=powerpc;;
  16.965 + powerpc-*-darwin*) TARGET=POWERPC_DARWIN; TARGETDIR=powerpc;;
  16.966 + powerpc-*-aix*) TARGET=POWERPC_AIX; TARGETDIR=powerpc;;
  16.967 + rs6000-*-aix*) TARGET=POWERPC_AIX; TARGETDIR=powerpc;;
  16.968 + arm*-*-linux-*) TARGET=ARM; TARGETDIR=arm;;
  16.969 ++s390-*-linux-*) TARGET=S390; TARGETDIR=s390;;
  16.970 ++s390x-*-linux-*) TARGET=S390; TARGETDIR=s390;;
  16.971 ++x86_64-*-linux*) TARGET=X86_64; TARGETDIR=x86;;
  16.972 ++sh-*-linux* | sh[34]*-*-linux*) TARGET=SH; TARGETDIR=sh;;
  16.973 + esac
  16.974 + 
  16.975 + if test $TARGETDIR = unknown; then
  16.976 +@@ -2418,6 +2491,15 @@
  16.977 + fi
  16.978 + 
  16.979 + 
  16.980 ++if test x$TARGET = xMIPS_LINUX; then
  16.981 ++  MIPS_LINUX_TRUE=
  16.982 ++  MIPS_LINUX_FALSE='#'
  16.983 ++else
  16.984 ++  MIPS_LINUX_TRUE='#'
  16.985 ++  MIPS_LINUX_FALSE=
  16.986 ++fi
  16.987 ++
  16.988 ++
  16.989 + if test x$TARGET = xSPARC; then
  16.990 +   SPARC_TRUE=
  16.991 +   SPARC_FALSE='#'
  16.992 +@@ -2507,8 +2589,39 @@
  16.993 +   ARM_FALSE=
  16.994 + fi
  16.995 + 
  16.996 ++
  16.997 ++if test x$TARGET = xS390; then
  16.998 ++  S390_TRUE=
  16.999 ++  S390_FALSE='#'
 16.1000 ++else
 16.1001 ++  S390_TRUE='#'
 16.1002 ++  S390_FALSE=
 16.1003 ++fi
 16.1004 ++
 16.1005 ++
 16.1006 ++if test x$TARGET = xX86_64; then
 16.1007 ++  X86_64_TRUE=
 16.1008 ++  X86_64_FALSE='#'
 16.1009 ++else
 16.1010 ++  X86_64_TRUE='#'
 16.1011 ++  X86_64_FALSE=
 16.1012 ++fi
 16.1013 ++
 16.1014 ++
 16.1015 ++if test x$TARGET = xSH; then
 16.1016 ++  SH_TRUE=
 16.1017 ++  SH_FALSE='#'
 16.1018 ++else
 16.1019 ++  SH_TRUE='#'
 16.1020 ++  SH_FALSE=
 16.1021 ++fi
 16.1022 ++
 16.1023 ++if test x$TARGET = xMIPS_LINUX; then
 16.1024 ++  TARGET=MIPS
 16.1025 ++fi
 16.1026 ++
 16.1027 + echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
 16.1028 +-echo "configure:2512: checking how to run the C preprocessor" >&5
 16.1029 ++echo "configure:2625: checking how to run the C preprocessor" >&5
 16.1030 + # On Suns, sometimes $CPP names a directory.
 16.1031 + if test -n "$CPP" && test -d "$CPP"; then
 16.1032 +   CPP=
 16.1033 +@@ -2523,13 +2636,13 @@
 16.1034 +   # On the NeXT, cc -E runs the code through the compiler's parser,
 16.1035 +   # not just through cpp.
 16.1036 +   cat > conftest.$ac_ext <<EOF
 16.1037 +-#line 2527 "configure"
 16.1038 ++#line 2640 "configure"
 16.1039 + #include "confdefs.h"
 16.1040 + #include <assert.h>
 16.1041 + Syntax Error
 16.1042 + EOF
 16.1043 + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
 16.1044 +-{ (eval echo configure:2533: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 16.1045 ++{ (eval echo configure:2646: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 16.1046 + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 16.1047 + if test -z "$ac_err"; then
 16.1048 +   :
 16.1049 +@@ -2540,13 +2653,13 @@
 16.1050 +   rm -rf conftest*
 16.1051 +   CPP="${CC-cc} -E -traditional-cpp"
 16.1052 +   cat > conftest.$ac_ext <<EOF
 16.1053 +-#line 2544 "configure"
 16.1054 ++#line 2657 "configure"
 16.1055 + #include "confdefs.h"
 16.1056 + #include <assert.h>
 16.1057 + Syntax Error
 16.1058 + EOF
 16.1059 + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
 16.1060 +-{ (eval echo configure:2550: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 16.1061 ++{ (eval echo configure:2663: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 16.1062 + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 16.1063 + if test -z "$ac_err"; then
 16.1064 +   :
 16.1065 +@@ -2557,13 +2670,13 @@
 16.1066 +   rm -rf conftest*
 16.1067 +   CPP="${CC-cc} -nologo -E"
 16.1068 +   cat > conftest.$ac_ext <<EOF
 16.1069 +-#line 2561 "configure"
 16.1070 ++#line 2674 "configure"
 16.1071 + #include "confdefs.h"
 16.1072 + #include <assert.h>
 16.1073 + Syntax Error
 16.1074 + EOF
 16.1075 + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
 16.1076 +-{ (eval echo configure:2567: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 16.1077 ++{ (eval echo configure:2680: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 16.1078 + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 16.1079 + if test -z "$ac_err"; then
 16.1080 +   :
 16.1081 +@@ -2588,12 +2701,12 @@
 16.1082 + echo "$ac_t""$CPP" 1>&6
 16.1083 + 
 16.1084 + echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
 16.1085 +-echo "configure:2592: checking for ANSI C header files" >&5
 16.1086 ++echo "configure:2705: checking for ANSI C header files" >&5
 16.1087 + if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
 16.1088 +   echo $ac_n "(cached) $ac_c" 1>&6
 16.1089 + else
 16.1090 +   cat > conftest.$ac_ext <<EOF
 16.1091 +-#line 2597 "configure"
 16.1092 ++#line 2710 "configure"
 16.1093 + #include "confdefs.h"
 16.1094 + #include <stdlib.h>
 16.1095 + #include <stdarg.h>
 16.1096 +@@ -2601,7 +2714,7 @@
 16.1097 + #include <float.h>
 16.1098 + EOF
 16.1099 + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
 16.1100 +-{ (eval echo configure:2605: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 16.1101 ++{ (eval echo configure:2718: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 16.1102 + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 16.1103 + if test -z "$ac_err"; then
 16.1104 +   rm -rf conftest*
 16.1105 +@@ -2618,7 +2731,7 @@
 16.1106 + if test $ac_cv_header_stdc = yes; then
 16.1107 +   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 16.1108 + cat > conftest.$ac_ext <<EOF
 16.1109 +-#line 2622 "configure"
 16.1110 ++#line 2735 "configure"
 16.1111 + #include "confdefs.h"
 16.1112 + #include <string.h>
 16.1113 + EOF
 16.1114 +@@ -2636,7 +2749,7 @@
 16.1115 + if test $ac_cv_header_stdc = yes; then
 16.1116 +   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 16.1117 + cat > conftest.$ac_ext <<EOF
 16.1118 +-#line 2640 "configure"
 16.1119 ++#line 2753 "configure"
 16.1120 + #include "confdefs.h"
 16.1121 + #include <stdlib.h>
 16.1122 + EOF
 16.1123 +@@ -2657,7 +2770,7 @@
 16.1124 +   :
 16.1125 + else
 16.1126 +   cat > conftest.$ac_ext <<EOF
 16.1127 +-#line 2661 "configure"
 16.1128 ++#line 2774 "configure"
 16.1129 + #include "confdefs.h"
 16.1130 + #include <ctype.h>
 16.1131 + #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
 16.1132 +@@ -2668,7 +2781,7 @@
 16.1133 + exit (0); }
 16.1134 + 
 16.1135 + EOF
 16.1136 +-if { (eval echo configure:2672: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 16.1137 ++if { (eval echo configure:2785: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 16.1138 + then
 16.1139 +   :
 16.1140 + else
 16.1141 +@@ -2694,12 +2807,12 @@
 16.1142 + for ac_func in memcpy
 16.1143 + do
 16.1144 + echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
 16.1145 +-echo "configure:2698: checking for $ac_func" >&5
 16.1146 ++echo "configure:2811: checking for $ac_func" >&5
 16.1147 + if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
 16.1148 +   echo $ac_n "(cached) $ac_c" 1>&6
 16.1149 + else
 16.1150 +   cat > conftest.$ac_ext <<EOF
 16.1151 +-#line 2703 "configure"
 16.1152 ++#line 2816 "configure"
 16.1153 + #include "confdefs.h"
 16.1154 + /* System header to define __stub macros and hopefully few prototypes,
 16.1155 +     which can conflict with char $ac_func(); below.  */
 16.1156 +@@ -2722,7 +2835,7 @@
 16.1157 + 
 16.1158 + ; return 0; }
 16.1159 + EOF
 16.1160 +-if { (eval echo configure:2726: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
 16.1161 ++if { (eval echo configure:2839: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
 16.1162 +   rm -rf conftest*
 16.1163 +   eval "ac_cv_func_$ac_func=yes"
 16.1164 + else
 16.1165 +@@ -2749,19 +2862,19 @@
 16.1166 + # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
 16.1167 + # for constant arguments.  Useless!
 16.1168 + echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
 16.1169 +-echo "configure:2753: checking for working alloca.h" >&5
 16.1170 ++echo "configure:2866: checking for working alloca.h" >&5
 16.1171 + if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
 16.1172 +   echo $ac_n "(cached) $ac_c" 1>&6
 16.1173 + else
 16.1174 +   cat > conftest.$ac_ext <<EOF
 16.1175 +-#line 2758 "configure"
 16.1176 ++#line 2871 "configure"
 16.1177 + #include "confdefs.h"
 16.1178 + #include <alloca.h>
 16.1179 + int main() {
 16.1180 + char *p = alloca(2 * sizeof(int));
 16.1181 + ; return 0; }
 16.1182 + EOF
 16.1183 +-if { (eval echo configure:2765: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
 16.1184 ++if { (eval echo configure:2878: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
 16.1185 +   rm -rf conftest*
 16.1186 +   ac_cv_header_alloca_h=yes
 16.1187 + else
 16.1188 +@@ -2782,12 +2895,12 @@
 16.1189 + fi
 16.1190 + 
 16.1191 + echo $ac_n "checking for alloca""... $ac_c" 1>&6
 16.1192 +-echo "configure:2786: checking for alloca" >&5
 16.1193 ++echo "configure:2899: checking for alloca" >&5
 16.1194 + if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
 16.1195 +   echo $ac_n "(cached) $ac_c" 1>&6
 16.1196 + else
 16.1197 +   cat > conftest.$ac_ext <<EOF
 16.1198 +-#line 2791 "configure"
 16.1199 ++#line 2904 "configure"
 16.1200 + #include "confdefs.h"
 16.1201 + 
 16.1202 + #ifdef __GNUC__
 16.1203 +@@ -2815,7 +2928,7 @@
 16.1204 + char *p = (char *) alloca(1);
 16.1205 + ; return 0; }
 16.1206 + EOF
 16.1207 +-if { (eval echo configure:2819: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
 16.1208 ++if { (eval echo configure:2932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
 16.1209 +   rm -rf conftest*
 16.1210 +   ac_cv_func_alloca_works=yes
 16.1211 + else
 16.1212 +@@ -2847,12 +2960,12 @@
 16.1213 + 
 16.1214 + 
 16.1215 + echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
 16.1216 +-echo "configure:2851: checking whether alloca needs Cray hooks" >&5
 16.1217 ++echo "configure:2964: checking whether alloca needs Cray hooks" >&5
 16.1218 + if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
 16.1219 +   echo $ac_n "(cached) $ac_c" 1>&6
 16.1220 + else
 16.1221 +   cat > conftest.$ac_ext <<EOF
 16.1222 +-#line 2856 "configure"
 16.1223 ++#line 2969 "configure"
 16.1224 + #include "confdefs.h"
 16.1225 + #if defined(CRAY) && ! defined(CRAY2)
 16.1226 + webecray
 16.1227 +@@ -2877,12 +2990,12 @@
 16.1228 + if test $ac_cv_os_cray = yes; then
 16.1229 + for ac_func in _getb67 GETB67 getb67; do
 16.1230 +   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
 16.1231 +-echo "configure:2881: checking for $ac_func" >&5
 16.1232 ++echo "configure:2994: checking for $ac_func" >&5
 16.1233 + if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
 16.1234 +   echo $ac_n "(cached) $ac_c" 1>&6
 16.1235 + else
 16.1236 +   cat > conftest.$ac_ext <<EOF
 16.1237 +-#line 2886 "configure"
 16.1238 ++#line 2999 "configure"
 16.1239 + #include "confdefs.h"
 16.1240 + /* System header to define __stub macros and hopefully few prototypes,
 16.1241 +     which can conflict with char $ac_func(); below.  */
 16.1242 +@@ -2905,7 +3018,7 @@
 16.1243 + 
 16.1244 + ; return 0; }
 16.1245 + EOF
 16.1246 +-if { (eval echo configure:2909: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
 16.1247 ++if { (eval echo configure:3022: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
 16.1248 +   rm -rf conftest*
 16.1249 +   eval "ac_cv_func_$ac_func=yes"
 16.1250 + else
 16.1251 +@@ -2932,7 +3045,7 @@
 16.1252 + fi
 16.1253 + 
 16.1254 + echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
 16.1255 +-echo "configure:2936: checking stack direction for C alloca" >&5
 16.1256 ++echo "configure:3049: checking stack direction for C alloca" >&5
 16.1257 + if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
 16.1258 +   echo $ac_n "(cached) $ac_c" 1>&6
 16.1259 + else
 16.1260 +@@ -2940,7 +3053,7 @@
 16.1261 +   ac_cv_c_stack_direction=0
 16.1262 + else
 16.1263 +   cat > conftest.$ac_ext <<EOF
 16.1264 +-#line 2944 "configure"
 16.1265 ++#line 3057 "configure"
 16.1266 + #include "confdefs.h"
 16.1267 + find_stack_direction ()
 16.1268 + {
 16.1269 +@@ -2959,7 +3072,7 @@
 16.1270 +   exit (find_stack_direction() < 0);
 16.1271 + }
 16.1272 + EOF
 16.1273 +-if { (eval echo configure:2963: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 16.1274 ++if { (eval echo configure:3076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 16.1275 + then
 16.1276 +   ac_cv_c_stack_direction=1
 16.1277 + else
 16.1278 +@@ -2982,13 +3095,13 @@
 16.1279 + 
 16.1280 + 
 16.1281 + echo $ac_n "checking size of short""... $ac_c" 1>&6
 16.1282 +-echo "configure:2986: checking size of short" >&5
 16.1283 ++echo "configure:3099: checking size of short" >&5
 16.1284 + if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
 16.1285 +   echo $ac_n "(cached) $ac_c" 1>&6
 16.1286 + else
 16.1287 +   for ac_size in 4 8 1 2 16 12  ; do # List sizes in rough order of prevalence.
 16.1288 +   cat > conftest.$ac_ext <<EOF
 16.1289 +-#line 2992 "configure"
 16.1290 ++#line 3105 "configure"
 16.1291 + #include "confdefs.h"
 16.1292 + #include "confdefs.h"
 16.1293 + #include <sys/types.h>
 16.1294 +@@ -2998,7 +3111,7 @@
 16.1295 + switch (0) case 0: case (sizeof (short) == $ac_size):;
 16.1296 + ; return 0; }
 16.1297 + EOF
 16.1298 +-if { (eval echo configure:3002: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
 16.1299 ++if { (eval echo configure:3115: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
 16.1300 +   rm -rf conftest*
 16.1301 +   ac_cv_sizeof_short=$ac_size
 16.1302 + else
 16.1303 +@@ -3021,13 +3134,13 @@
 16.1304 + 
 16.1305 + 
 16.1306 + echo $ac_n "checking size of int""... $ac_c" 1>&6
 16.1307 +-echo "configure:3025: checking size of int" >&5
 16.1308 ++echo "configure:3138: checking size of int" >&5
 16.1309 + if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
 16.1310 +   echo $ac_n "(cached) $ac_c" 1>&6
 16.1311 + else
 16.1312 +   for ac_size in 4 8 1 2 16 12  ; do # List sizes in rough order of prevalence.
 16.1313 +   cat > conftest.$ac_ext <<EOF
 16.1314 +-#line 3031 "configure"
 16.1315 ++#line 3144 "configure"
 16.1316 + #include "confdefs.h"
 16.1317 + #include "confdefs.h"
 16.1318 + #include <sys/types.h>
 16.1319 +@@ -3037,7 +3150,7 @@
 16.1320 + switch (0) case 0: case (sizeof (int) == $ac_size):;
 16.1321 + ; return 0; }
 16.1322 + EOF
 16.1323 +-if { (eval echo configure:3041: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
 16.1324 ++if { (eval echo configure:3154: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
 16.1325 +   rm -rf conftest*
 16.1326 +   ac_cv_sizeof_int=$ac_size
 16.1327 + else
 16.1328 +@@ -3060,13 +3173,13 @@
 16.1329 + 
 16.1330 + 
 16.1331 + echo $ac_n "checking size of long""... $ac_c" 1>&6
 16.1332 +-echo "configure:3064: checking size of long" >&5
 16.1333 ++echo "configure:3177: checking size of long" >&5
 16.1334 + if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
 16.1335 +   echo $ac_n "(cached) $ac_c" 1>&6
 16.1336 + else
 16.1337 +   for ac_size in 4 8 1 2 16 12  ; do # List sizes in rough order of prevalence.
 16.1338 +   cat > conftest.$ac_ext <<EOF
 16.1339 +-#line 3070 "configure"
 16.1340 ++#line 3183 "configure"
 16.1341 + #include "confdefs.h"
 16.1342 + #include "confdefs.h"
 16.1343 + #include <sys/types.h>
 16.1344 +@@ -3076,7 +3189,7 @@
 16.1345 + switch (0) case 0: case (sizeof (long) == $ac_size):;
 16.1346 + ; return 0; }
 16.1347 + EOF
 16.1348 +-if { (eval echo configure:3080: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
 16.1349 ++if { (eval echo configure:3193: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
 16.1350 +   rm -rf conftest*
 16.1351 +   ac_cv_sizeof_long=$ac_size
 16.1352 + else
 16.1353 +@@ -3099,13 +3212,13 @@
 16.1354 + 
 16.1355 + 
 16.1356 + echo $ac_n "checking size of long long""... $ac_c" 1>&6
 16.1357 +-echo "configure:3103: checking size of long long" >&5
 16.1358 ++echo "configure:3216: checking size of long long" >&5
 16.1359 + if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then
 16.1360 +   echo $ac_n "(cached) $ac_c" 1>&6
 16.1361 + else
 16.1362 +   for ac_size in 4 8 1 2 16 12  ; do # List sizes in rough order of prevalence.
 16.1363 +   cat > conftest.$ac_ext <<EOF
 16.1364 +-#line 3109 "configure"
 16.1365 ++#line 3222 "configure"
 16.1366 + #include "confdefs.h"
 16.1367 + #include "confdefs.h"
 16.1368 + #include <sys/types.h>
 16.1369 +@@ -3115,7 +3228,7 @@
 16.1370 + switch (0) case 0: case (sizeof (long long) == $ac_size):;
 16.1371 + ; return 0; }
 16.1372 + EOF
 16.1373 +-if { (eval echo configure:3119: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
 16.1374 ++if { (eval echo configure:3232: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
 16.1375 +   rm -rf conftest*
 16.1376 +   ac_cv_sizeof_long_long=$ac_size
 16.1377 + else
 16.1378 +@@ -3138,13 +3251,13 @@
 16.1379 + 
 16.1380 + 
 16.1381 + echo $ac_n "checking size of float""... $ac_c" 1>&6
 16.1382 +-echo "configure:3142: checking size of float" >&5
 16.1383 ++echo "configure:3255: checking size of float" >&5
 16.1384 + if eval "test \"`echo '$''{'ac_cv_sizeof_float'+set}'`\" = set"; then
 16.1385 +   echo $ac_n "(cached) $ac_c" 1>&6
 16.1386 + else
 16.1387 +   for ac_size in 4 8 1 2 16 12  ; do # List sizes in rough order of prevalence.
 16.1388 +   cat > conftest.$ac_ext <<EOF
 16.1389 +-#line 3148 "configure"
 16.1390 ++#line 3261 "configure"
 16.1391 + #include "confdefs.h"
 16.1392 + #include "confdefs.h"
 16.1393 + #include <sys/types.h>
 16.1394 +@@ -3154,7 +3267,7 @@
 16.1395 + switch (0) case 0: case (sizeof (float) == $ac_size):;
 16.1396 + ; return 0; }
 16.1397 + EOF
 16.1398 +-if { (eval echo configure:3158: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
 16.1399 ++if { (eval echo configure:3271: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
 16.1400 +   rm -rf conftest*
 16.1401 +   ac_cv_sizeof_float=$ac_size
 16.1402 + else
 16.1403 +@@ -3177,13 +3290,13 @@
 16.1404 + 
 16.1405 + 
 16.1406 + echo $ac_n "checking size of double""... $ac_c" 1>&6
 16.1407 +-echo "configure:3181: checking size of double" >&5
 16.1408 ++echo "configure:3294: checking size of double" >&5
 16.1409 + if eval "test \"`echo '$''{'ac_cv_sizeof_double'+set}'`\" = set"; then
 16.1410 +   echo $ac_n "(cached) $ac_c" 1>&6
 16.1411 + else
 16.1412 +   for ac_size in 4 8 1 2 16 12  ; do # List sizes in rough order of prevalence.
 16.1413 +   cat > conftest.$ac_ext <<EOF
 16.1414 +-#line 3187 "configure"
 16.1415 ++#line 3300 "configure"
 16.1416 + #include "confdefs.h"
 16.1417 + #include "confdefs.h"
 16.1418 + #include <sys/types.h>
 16.1419 +@@ -3193,7 +3306,7 @@
 16.1420 + switch (0) case 0: case (sizeof (double) == $ac_size):;
 16.1421 + ; return 0; }
 16.1422 + EOF
 16.1423 +-if { (eval echo configure:3197: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
 16.1424 ++if { (eval echo configure:3310: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
 16.1425 +   rm -rf conftest*
 16.1426 +   ac_cv_sizeof_double=$ac_size
 16.1427 + else
 16.1428 +@@ -3216,13 +3329,13 @@
 16.1429 + 
 16.1430 + 
 16.1431 + echo $ac_n "checking size of long double""... $ac_c" 1>&6
 16.1432 +-echo "configure:3220: checking size of long double" >&5
 16.1433 ++echo "configure:3333: checking size of long double" >&5
 16.1434 + if eval "test \"`echo '$''{'ac_cv_sizeof_long_double'+set}'`\" = set"; then
 16.1435 +   echo $ac_n "(cached) $ac_c" 1>&6
 16.1436 + else
 16.1437 +   for ac_size in 4 8 1 2 16 12  ; do # List sizes in rough order of prevalence.
 16.1438 +   cat > conftest.$ac_ext <<EOF
 16.1439 +-#line 3226 "configure"
 16.1440 ++#line 3339 "configure"
 16.1441 + #include "confdefs.h"
 16.1442 + #include "confdefs.h"
 16.1443 + #include <sys/types.h>
 16.1444 +@@ -3232,7 +3345,7 @@
 16.1445 + switch (0) case 0: case (sizeof (long double) == $ac_size):;
 16.1446 + ; return 0; }
 16.1447 + EOF
 16.1448 +-if { (eval echo configure:3236: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
 16.1449 ++if { (eval echo configure:3349: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
 16.1450 +   rm -rf conftest*
 16.1451 +   ac_cv_sizeof_long_double=$ac_size
 16.1452 + else
 16.1453 +@@ -3256,13 +3369,13 @@
 16.1454 + 
 16.1455 + 
 16.1456 + echo $ac_n "checking size of void *""... $ac_c" 1>&6
 16.1457 +-echo "configure:3260: checking size of void *" >&5
 16.1458 ++echo "configure:3373: checking size of void *" >&5
 16.1459 + if eval "test \"`echo '$''{'ac_cv_sizeof_void_p'+set}'`\" = set"; then
 16.1460 +   echo $ac_n "(cached) $ac_c" 1>&6
 16.1461 + else
 16.1462 +   for ac_size in 4 8 1 2 16 12  ; do # List sizes in rough order of prevalence.
 16.1463 +   cat > conftest.$ac_ext <<EOF
 16.1464 +-#line 3266 "configure"
 16.1465 ++#line 3379 "configure"
 16.1466 + #include "confdefs.h"
 16.1467 + #include "confdefs.h"
 16.1468 + #include <sys/types.h>
 16.1469 +@@ -3272,7 +3385,7 @@
 16.1470 + switch (0) case 0: case (sizeof (void *) == $ac_size):;
 16.1471 + ; return 0; }
 16.1472 + EOF
 16.1473 +-if { (eval echo configure:3276: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
 16.1474 ++if { (eval echo configure:3389: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
 16.1475 +   rm -rf conftest*
 16.1476 +   ac_cv_sizeof_void_p=$ac_size
 16.1477 + else
 16.1478 +@@ -3295,14 +3408,14 @@
 16.1479 + 
 16.1480 + 
 16.1481 + echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
 16.1482 +-echo "configure:3299: checking whether byte ordering is bigendian" >&5
 16.1483 ++echo "configure:3412: checking whether byte ordering is bigendian" >&5
 16.1484 + if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
 16.1485 +   echo $ac_n "(cached) $ac_c" 1>&6
 16.1486 + else
 16.1487 +   ac_cv_c_bigendian=unknown
 16.1488 + # See if sys/param.h defines the BYTE_ORDER macro.
 16.1489 + cat > conftest.$ac_ext <<EOF
 16.1490 +-#line 3306 "configure"
 16.1491 ++#line 3419 "configure"
 16.1492 + #include "confdefs.h"
 16.1493 + #include <sys/types.h>
 16.1494 + #include <sys/param.h>
 16.1495 +@@ -3313,11 +3426,11 @@
 16.1496 + #endif
 16.1497 + ; return 0; }
 16.1498 + EOF
 16.1499 +-if { (eval echo configure:3317: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
 16.1500 ++if { (eval echo configure:3430: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
 16.1501 +   rm -rf conftest*
 16.1502 +   # It does; now see whether it defined to BIG_ENDIAN or not.
 16.1503 + cat > conftest.$ac_ext <<EOF
 16.1504 +-#line 3321 "configure"
 16.1505 ++#line 3434 "configure"
 16.1506 + #include "confdefs.h"
 16.1507 + #include <sys/types.h>
 16.1508 + #include <sys/param.h>
 16.1509 +@@ -3328,7 +3441,7 @@
 16.1510 + #endif
 16.1511 + ; return 0; }
 16.1512 + EOF
 16.1513 +-if { (eval echo configure:3332: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
 16.1514 ++if { (eval echo configure:3445: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
 16.1515 +   rm -rf conftest*
 16.1516 +   ac_cv_c_bigendian=yes
 16.1517 + else
 16.1518 +@@ -3348,7 +3461,7 @@
 16.1519 +    echo $ac_n "cross-compiling... " 2>&6 
 16.1520 + else
 16.1521 +   cat > conftest.$ac_ext <<EOF
 16.1522 +-#line 3352 "configure"
 16.1523 ++#line 3465 "configure"
 16.1524 + #include "confdefs.h"
 16.1525 + main () {
 16.1526 +   /* Are we little or big endian?  From Harbison&Steele.  */
 16.1527 +@@ -3361,7 +3474,7 @@
 16.1528 +   exit (u.c[sizeof (long) - 1] == 1);
 16.1529 + }
 16.1530 + EOF
 16.1531 +-if { (eval echo configure:3365: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 16.1532 ++if { (eval echo configure:3478: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 16.1533 + then
 16.1534 +   ac_cv_c_bigendian=no
 16.1535 + else
 16.1536 +@@ -3379,7 +3492,7 @@
 16.1537 + echo "$ac_t""$ac_cv_c_bigendian" 1>&6
 16.1538 + if test $ac_cv_c_bigendian = unknown; then
 16.1539 + echo $ac_n "checking to probe for byte ordering""... $ac_c" 1>&6
 16.1540 +-echo "configure:3383: checking to probe for byte ordering" >&5
 16.1541 ++echo "configure:3496: checking to probe for byte ordering" >&5
 16.1542 + 
 16.1543 + cat >conftest.c <<EOF
 16.1544 + short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
 16.1545 +@@ -3414,6 +3527,10 @@
 16.1546 + #define WORDS_BIGENDIAN 1
 16.1547 + EOF
 16.1548 + 
 16.1549 ++  cat >> confdefs.h <<\EOF
 16.1550 ++#define HOST_WORDS_BIG_ENDIAN 1
 16.1551 ++EOF
 16.1552 ++
 16.1553 +   BYTEORDER=4321
 16.1554 + else
 16.1555 +   BYTEORDER=1234
 16.1556 +@@ -3429,7 +3546,7 @@
 16.1557 + 
 16.1558 + if test x$TARGET = xSPARC; then
 16.1559 +     echo $ac_n "checking assembler and linker support unaligned pc related relocs""... $ac_c" 1>&6
 16.1560 +-echo "configure:3433: checking assembler and linker support unaligned pc related relocs" >&5
 16.1561 ++echo "configure:3550: checking assembler and linker support unaligned pc related relocs" >&5
 16.1562 + if eval "test \"`echo '$''{'libffi_cv_as_sparc_ua_pcrel'+set}'`\" = set"; then
 16.1563 +   echo $ac_n "(cached) $ac_c" 1>&6
 16.1564 + else
 16.1565 +@@ -3439,14 +3556,14 @@
 16.1566 + 	CFLAGS="$CFLAGS -fpic"
 16.1567 + 	LDFLAGS="$LDFLAGS -shared"
 16.1568 + 	cat > conftest.$ac_ext <<EOF
 16.1569 +-#line 3443 "configure"
 16.1570 ++#line 3560 "configure"
 16.1571 + #include "confdefs.h"
 16.1572 + asm (".text; foo: nop; .data; .align 4; .byte 0; .uaword %r_disp32(foo); .text");
 16.1573 + int main() {
 16.1574 + 
 16.1575 + ; return 0; }
 16.1576 + EOF
 16.1577 +-if { (eval echo configure:3450: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
 16.1578 ++if { (eval echo configure:3567: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
 16.1579 +   rm -rf conftest*
 16.1580 +   libffi_cv_as_sparc_ua_pcrel=yes
 16.1581 + else
 16.1582 +@@ -3709,6 +3826,8 @@
 16.1583 + s%@MIPS_GCC_FALSE@%$MIPS_GCC_FALSE%g
 16.1584 + s%@MIPS_SGI_TRUE@%$MIPS_SGI_TRUE%g
 16.1585 + s%@MIPS_SGI_FALSE@%$MIPS_SGI_FALSE%g
 16.1586 ++s%@MIPS_LINUX_TRUE@%$MIPS_LINUX_TRUE%g
 16.1587 ++s%@MIPS_LINUX_FALSE@%$MIPS_LINUX_FALSE%g
 16.1588 + s%@SPARC_TRUE@%$SPARC_TRUE%g
 16.1589 + s%@SPARC_FALSE@%$SPARC_FALSE%g
 16.1590 + s%@X86_TRUE@%$X86_TRUE%g
 16.1591 +@@ -3729,6 +3848,12 @@
 16.1592 + s%@POWERPC_DARWIN_FALSE@%$POWERPC_DARWIN_FALSE%g
 16.1593 + s%@ARM_TRUE@%$ARM_TRUE%g
 16.1594 + s%@ARM_FALSE@%$ARM_FALSE%g
 16.1595 ++s%@S390_TRUE@%$S390_TRUE%g
 16.1596 ++s%@S390_FALSE@%$S390_FALSE%g
 16.1597 ++s%@X86_64_TRUE@%$X86_64_TRUE%g
 16.1598 ++s%@X86_64_FALSE@%$X86_64_FALSE%g
 16.1599 ++s%@SH_TRUE@%$SH_TRUE%g
 16.1600 ++s%@SH_FALSE@%$SH_FALSE%g
 16.1601 + s%@CPP@%$CPP%g
 16.1602 + s%@ALLOCA@%$ALLOCA%g
 16.1603 + s%@TARGET@%$TARGET%g
 16.1604 +@@ -3969,7 +4094,7 @@
 16.1605 + 
 16.1606 + if test -n "$CONFIG_FILES"; then
 16.1607 +    LD="${ORIGINAL_LD_FOR_MULTILIBS}"
 16.1608 +-   ac_file=Makefile . ${libffi_basedir}/../config-ml.in
 16.1609 ++   ac_file=Makefile . ${srcdir}/${libffi_basedir}../config-ml.in
 16.1610 + fi
 16.1611 + 
 16.1612 + exit 0
 16.1613 +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/configure.in gcc/libffi/configure.in
 16.1614 +--- gcc-3.2.2.orig/libffi/configure.in	Tue Jan 28 10:43:56 2003
 16.1615 ++++ gcc/libffi/configure.in	Sat Feb  1 20:16:19 2003
 16.1616 +@@ -22,14 +22,15 @@
 16.1617 + 
 16.1618 + if test "${srcdir}" = "."; then
 16.1619 +   if test "${with_target_subdir}" != "."; then
 16.1620 +-    libffi_basedir="${srcdir}/${with_multisrctop}.."
 16.1621 ++    libffi_basedir="${with_multisrctop}../"
 16.1622 +   else
 16.1623 +-    libffi_basedir="${srcdir}/${with_multisrctop}"
 16.1624 ++    libffi_basedir="${with_multisrctop}"
 16.1625 +   fi
 16.1626 + else
 16.1627 +-  libffi_basedir="${srcdir}"
 16.1628 ++  libffi_basedir=
 16.1629 + fi
 16.1630 + AC_SUBST(libffi_basedir)
 16.1631 ++AC_CONFIG_AUX_DIR(${libffi_basedir}..)
 16.1632 + 
 16.1633 + AC_CANONICAL_HOST
 16.1634 + 
 16.1635 +@@ -56,17 +57,23 @@
 16.1636 + i*86-*-mingw*) TARGET=X86_WIN32; TARGETDIR=x86;;
 16.1637 + sparc-sun-4*) TARGET=SPARC; TARGETDIR=sparc;;
 16.1638 + sparc*-sun-*) TARGET=SPARC; TARGETDIR=sparc;;
 16.1639 +-sparc-*-linux*) TARGET=SPARC; TARGETDIR=sparc;;
 16.1640 +-sparc64-*-linux*) TARGET=SPARC; TARGETDIR=sparc;;
 16.1641 +-alpha*-*-linux* | alpha*-*-osf* | alpha*-*-freebsd*) TARGET=ALPHA; TARGETDIR=alpha;;
 16.1642 ++sparc-*-linux* | sparc-*-netbsdelf*) TARGET=SPARC; TARGETDIR=sparc;;
 16.1643 ++sparc64-*-linux* | sparc64-*-netbsd*) TARGET=SPARC; TARGETDIR=sparc;;
 16.1644 ++alpha*-*-linux* | alpha*-*-osf* | alpha*-*-freebsd* | alpha*-*-netbsd*) TARGET=ALPHA; TARGETDIR=alpha;;
 16.1645 + ia64*-*-*) TARGET=IA64; TARGETDIR=ia64;;
 16.1646 + m68k-*-linux*) TARGET=M68K; TARGETDIR=m68k;;
 16.1647 ++mips64*-*);;
 16.1648 ++mips*-*-linux*) TARGET=MIPS_LINUX; TARGETDIR=mips;;
 16.1649 + powerpc-*-linux* | powerpc-*-sysv*) TARGET=POWERPC; TARGETDIR=powerpc;;
 16.1650 + powerpc-*-beos*) TARGET=POWERPC; TARGETDIR=powerpc;;
 16.1651 + powerpc-*-darwin*) TARGET=POWERPC_DARWIN; TARGETDIR=powerpc;;
 16.1652 + powerpc-*-aix*) TARGET=POWERPC_AIX; TARGETDIR=powerpc;;
 16.1653 + rs6000-*-aix*) TARGET=POWERPC_AIX; TARGETDIR=powerpc;;
 16.1654 + arm*-*-linux-*) TARGET=ARM; TARGETDIR=arm;;
 16.1655 ++s390-*-linux-*) TARGET=S390; TARGETDIR=s390;;
 16.1656 ++s390x-*-linux-*) TARGET=S390; TARGETDIR=s390;;
 16.1657 ++x86_64-*-linux*) TARGET=X86_64; TARGETDIR=x86;;
 16.1658 ++sh-*-linux* | sh[[34]]*-*-linux*) TARGET=SH; TARGETDIR=sh;;
 16.1659 + esac
 16.1660 + 
 16.1661 + if test $TARGETDIR = unknown; then
 16.1662 +@@ -75,6 +82,7 @@
 16.1663 + 
 16.1664 + AM_CONDITIONAL(MIPS_GCC, test ${TARGET}${ac_cv_prog_gcc} = MIPSyes)
 16.1665 + AM_CONDITIONAL(MIPS_SGI, test ${TARGET}${ac_cv_prog_gcc} = MIPSno)
 16.1666 ++AM_CONDITIONAL(MIPS_LINUX, test x$TARGET = xMIPS_LINUX)
 16.1667 + AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC)
 16.1668 + AM_CONDITIONAL(X86, test x$TARGET = xX86)
 16.1669 + AM_CONDITIONAL(X86_WIN32, test x$TARGET = xX86_WIN32)
 16.1670 +@@ -85,6 +93,13 @@
 16.1671 + AM_CONDITIONAL(POWERPC_AIX, test x$TARGET = xPOWERPC_AIX)
 16.1672 + AM_CONDITIONAL(POWERPC_DARWIN, test x$TARGET = xPOWERPC_DARWIN)
 16.1673 + AM_CONDITIONAL(ARM, test x$TARGET = xARM)
 16.1674 ++AM_CONDITIONAL(S390, test x$TARGET = xS390)
 16.1675 ++AM_CONDITIONAL(X86_64, test x$TARGET = xX86_64)
 16.1676 ++AM_CONDITIONAL(SH, test x$TARGET = xSH)
 16.1677 ++
 16.1678 ++if test x$TARGET = xMIPS_LINUX; then
 16.1679 ++  TARGET=MIPS
 16.1680 ++fi
 16.1681 + 
 16.1682 + AC_HEADER_STDC
 16.1683 + AC_CHECK_FUNCS(memcpy)
 16.1684 +@@ -171,7 +186,7 @@
 16.1685 + [
 16.1686 + if test -n "$CONFIG_FILES"; then
 16.1687 +    LD="${ORIGINAL_LD_FOR_MULTILIBS}"
 16.1688 +-   ac_file=Makefile . ${libffi_basedir}/../config-ml.in
 16.1689 ++   ac_file=Makefile . ${srcdir}/${libffi_basedir}../config-ml.in
 16.1690 + fi
 16.1691 + ],
 16.1692 + srcdir=${srcdir}
 16.1693 +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/include/Makefile.in gcc/libffi/include/Makefile.in
 16.1694 +--- gcc-3.2.2.orig/libffi/include/Makefile.in	Tue Oct  9 14:32:16 2001
 16.1695 ++++ gcc/libffi/include/Makefile.in	Mon Apr 29 13:14:44 2002
 16.1696 +@@ -99,7 +99,7 @@
 16.1697 + 
 16.1698 + DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
 16.1699 + 
 16.1700 +-TAR = gnutar
 16.1701 ++TAR = gtar
 16.1702 + GZIP_ENV = --best
 16.1703 + all: all-redirect
 16.1704 + .SUFFIXES:
 16.1705 +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/include/ffi.h.in gcc/libffi/include/ffi.h.in
 16.1706 +--- gcc-3.2.2.orig/libffi/include/ffi.h.in	Wed Mar 13 07:35:56 2002
 16.1707 ++++ gcc/libffi/include/ffi.h.in	Wed Jan 29 00:54:28 2003
 16.1708 +@@ -1,5 +1,5 @@
 16.1709 + /* -----------------------------------------------------------------*-C-*-
 16.1710 +-   libffi @VERSION@ - Copyright (c) 1996-2002  Cygnus Solutions
 16.1711 ++   libffi @VERSION@ - Copyright (c) 1996-2003  Cygnus Solutions
 16.1712 + 
 16.1713 +    Permission is hereby granted, free of charge, to any person obtaining
 16.1714 +    a copy of this software and associated documentation files (the
 16.1715 +@@ -164,6 +164,12 @@
 16.1716 + #endif
 16.1717 + #endif
 16.1718 + 
 16.1719 ++#ifdef S390
 16.1720 ++#if defined (__s390x__)
 16.1721 ++#define S390X
 16.1722 ++#endif
 16.1723 ++#endif
 16.1724 ++
 16.1725 + #ifndef LIBFFI_ASM
 16.1726 + 
 16.1727 + /* ---- Generic type definitions ----------------------------------------- */
 16.1728 +@@ -189,16 +195,23 @@
 16.1729 + #endif
 16.1730 + #endif
 16.1731 + 
 16.1732 +-  /* ---- Intel x86 ---------------- */
 16.1733 +-#ifdef X86
 16.1734 ++  /* ---- Intel x86 Win32 ---------- */
 16.1735 ++#ifdef X86_WIN32
 16.1736 +   FFI_SYSV,
 16.1737 ++  FFI_STDCALL,
 16.1738 ++  /* TODO: Add fastcall support for the sake of completeness */
 16.1739 +   FFI_DEFAULT_ABI = FFI_SYSV,
 16.1740 + #endif
 16.1741 + 
 16.1742 +-  /* ---- Intel x86 Win32 ---------- */
 16.1743 +-#ifdef X86_WIN32
 16.1744 ++  /* ---- Intel x86 and AMD x86-64 - */
 16.1745 ++#if !defined(X86_WIN32) && (defined(__i386__) || defined(__x86_64__))
 16.1746 +   FFI_SYSV,
 16.1747 ++  FFI_UNIX64,   /* Unix variants all use the same ABI for x86-64  */
 16.1748 ++#ifdef __i386__
 16.1749 +   FFI_DEFAULT_ABI = FFI_SYSV,
 16.1750 ++#else
 16.1751 ++  FFI_DEFAULT_ABI = FFI_UNIX64,
 16.1752 ++#endif
 16.1753 + #endif
 16.1754 + 
 16.1755 +   /* ---- Intel ia64 ---------------- */
 16.1756 +@@ -251,6 +264,18 @@
 16.1757 +   FFI_DEFAULT_ABI = FFI_SYSV,
 16.1758 + #endif
 16.1759 + 
 16.1760 ++  /* ---- S390 --------------------- */
 16.1761 ++#ifdef S390
 16.1762 ++  FFI_SYSV,
 16.1763 ++  FFI_DEFAULT_ABI = FFI_SYSV,
 16.1764 ++#endif
 16.1765 ++
 16.1766 ++  /* ---- SuperH ------------------- */
 16.1767 ++#ifdef SH
 16.1768 ++  FFI_SYSV,
 16.1769 ++  FFI_DEFAULT_ABI = FFI_SYSV,
 16.1770 ++#endif
 16.1771 ++
 16.1772 +   /* Leave this for debugging purposes */
 16.1773 +   FFI_LAST_ABI
 16.1774 + 
 16.1775 +@@ -264,7 +289,7 @@
 16.1776 +   /*@null@*/ struct _ffi_type **elements;
 16.1777 + } ffi_type;
 16.1778 + 
 16.1779 +-/* These are defined in ffi.c */
 16.1780 ++/* These are defined in types.c */
 16.1781 + extern ffi_type ffi_type_void;
 16.1782 + extern ffi_type ffi_type_uint8;
 16.1783 + extern ffi_type ffi_type_sint8;
 16.1784 +@@ -373,13 +398,7 @@
 16.1785 + 
 16.1786 + /* ---- Definitions for closures ----------------------------------------- */
 16.1787 + 
 16.1788 +-#ifdef X86
 16.1789 +-
 16.1790 +-#define FFI_CLOSURES 1		/* x86 supports closures */
 16.1791 +-#define FFI_TRAMPOLINE_SIZE 10
 16.1792 +-#define FFI_NATIVE_RAW_API 1	/* and has native raw api support */
 16.1793 +-
 16.1794 +-#elif defined(X86_WIN32)
 16.1795 ++#ifdef __i386__
 16.1796 + 
 16.1797 + #define FFI_CLOSURES 1		/* x86 supports closures */
 16.1798 + #define FFI_TRAMPOLINE_SIZE 10
 16.1799 +@@ -424,6 +443,40 @@
 16.1800 + #define FFI_TRAMPOLINE_SIZE 24 /* see struct below */ 
 16.1801 + #define FFI_NATIVE_RAW_API 0
 16.1802 + 
 16.1803 ++#elif defined(SPARC64)
 16.1804 ++
 16.1805 ++#define FFI_CLOSURES 1
 16.1806 ++#define FFI_TRAMPOLINE_SIZE 24
 16.1807 ++#define FFI_NATIVE_RAW_API 0
 16.1808 ++
 16.1809 ++#elif defined(SPARC)
 16.1810 ++
 16.1811 ++#define FFI_CLOSURES 1
 16.1812 ++#define FFI_TRAMPOLINE_SIZE 16
 16.1813 ++#define FFI_NATIVE_RAW_API 0
 16.1814 ++
 16.1815 ++#elif defined(S390)
 16.1816 ++
 16.1817 ++#define FFI_CLOSURES 1
 16.1818 ++#ifdef S390X
 16.1819 ++#define FFI_TRAMPOLINE_SIZE 32
 16.1820 ++#else
 16.1821 ++#define FFI_TRAMPOLINE_SIZE 16
 16.1822 ++#endif
 16.1823 ++#define FFI_NATIVE_RAW_API 0
 16.1824 ++
 16.1825 ++#elif defined(SH)
 16.1826 ++
 16.1827 ++#define FFI_CLOSURES 1
 16.1828 ++#define FFI_TRAMPOLINE_SIZE 16
 16.1829 ++#define FFI_NATIVE_RAW_API 0
 16.1830 ++
 16.1831 ++#elif defined(__x86_64__)
 16.1832 ++
 16.1833 ++#define FFI_CLOSURES 1
 16.1834 ++#define FFI_TRAMPOLINE_SIZE 24
 16.1835 ++#define FFI_NATIVE_RAW_API 0
 16.1836 ++
 16.1837 + #else 
 16.1838 + 
 16.1839 + #define FFI_CLOSURES 0
 16.1840 +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/arm/ffi.c gcc/libffi/src/arm/ffi.c
 16.1841 +--- gcc-3.2.2.orig/libffi/src/arm/ffi.c	Sat Mar  3 07:21:23 2001
 16.1842 ++++ gcc/libffi/src/arm/ffi.c	Fri Jul 19 08:08:30 2002
 16.1843 +@@ -36,13 +36,10 @@
 16.1844 + /*@=exportheader@*/
 16.1845 + {
 16.1846 +   register unsigned int i;
 16.1847 +-  register int tmp;
 16.1848 +-  register unsigned int avn;
 16.1849 +   register void **p_argv;
 16.1850 +   register char *argp;
 16.1851 +   register ffi_type **p_arg;
 16.1852 + 
 16.1853 +-  tmp = 0;
 16.1854 +   argp = stack;
 16.1855 + 
 16.1856 +   if ( ecif->cif->rtype->type == FFI_TYPE_STRUCT ) {
 16.1857 +@@ -50,11 +47,10 @@
 16.1858 +     argp += 4;
 16.1859 +   }
 16.1860 + 
 16.1861 +-  avn = ecif->cif->nargs;
 16.1862 +   p_argv = ecif->avalue;
 16.1863 + 
 16.1864 +   for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types;
 16.1865 +-       (i != 0) && (avn != 0);
 16.1866 ++       (i != 0);
 16.1867 +        i--, p_arg++)
 16.1868 +     {
 16.1869 +       size_t z;
 16.1870 +@@ -64,9 +60,6 @@
 16.1871 + 	argp = (char *) ALIGN(argp, (*p_arg)->alignment);
 16.1872 +       }
 16.1873 + 
 16.1874 +-      if (avn != 0) 
 16.1875 +-	{
 16.1876 +-	  avn--;
 16.1877 + 	  z = (*p_arg)->size;
 16.1878 + 	  if (z < sizeof(int))
 16.1879 + 	    {
 16.1880 +@@ -107,7 +100,6 @@
 16.1881 + 	    }
 16.1882 + 	  p_argv++;
 16.1883 + 	  argp += z;
 16.1884 +-	}
 16.1885 +     }
 16.1886 +   
 16.1887 +   return;
 16.1888 +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/arm/sysv.S gcc/libffi/src/arm/sysv.S
 16.1889 +--- gcc-3.2.2.orig/libffi/src/arm/sysv.S	Sat Mar  3 07:21:23 2001
 16.1890 ++++ gcc/libffi/src/arm/sysv.S	Mon Sep 30 03:08:58 2002
 16.1891 +@@ -28,8 +28,15 @@
 16.1892 + #ifdef HAVE_MACHINE_ASM_H
 16.1893 + #include <machine/asm.h>
 16.1894 + #else
 16.1895 +-/* XXX these lose for some platforms, I'm sure. */
 16.1896 ++#ifdef __USER_LABEL_PREFIX__
 16.1897 ++#define CONCAT1(a, b) CONCAT2(a, b)
 16.1898 ++#define CONCAT2(a, b) a ## b
 16.1899 ++
 16.1900 ++/* Use the right prefix for global labels.  */
 16.1901 ++#define CNAME(x) CONCAT1 (__USER_LABEL_PREFIX__, x)
 16.1902 ++#else
 16.1903 + #define CNAME(x) x
 16.1904 ++#endif
 16.1905 + #define ENTRY(x) .globl CNAME(x); .type CNAME(x),%function; CNAME(x):
 16.1906 + #endif
 16.1907 + 	
 16.1908 +@@ -96,12 +103,20 @@
 16.1909 + 
 16.1910 + # return FLOAT
 16.1911 + 	cmp     a4, #FFI_TYPE_FLOAT
 16.1912 ++#ifdef __SOFTFP__
 16.1913 ++	streq	a1, [a3]
 16.1914 ++#else
 16.1915 + 	stfeqs  f0, [a3]
 16.1916 ++#endif
 16.1917 + 	beq     epilogue
 16.1918 + 
 16.1919 + # return DOUBLE or LONGDOUBLE
 16.1920 + 	cmp     a4, #FFI_TYPE_DOUBLE
 16.1921 ++#ifdef __SOFTFP__
 16.1922 ++	stmeqia	a3, {a1, a2}
 16.1923 ++#else
 16.1924 + 	stfeqd  f0, [a3]
 16.1925 ++#endif
 16.1926 + 
 16.1927 + epilogue:
 16.1928 +         ldmfd sp!, {a1-a4, fp, pc}
 16.1929 +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/java_raw_api.c gcc/libffi/src/java_raw_api.c
 16.1930 +--- gcc-3.2.2.orig/libffi/src/java_raw_api.c	Tue Apr  9 07:31:14 2002
 16.1931 ++++ gcc/libffi/src/java_raw_api.c	Tue Oct  8 23:55:02 2002
 16.1932 +@@ -81,21 +81,14 @@
 16.1933 + 	{
 16.1934 + 	case FFI_TYPE_UINT8:
 16.1935 + 	case FFI_TYPE_SINT8:
 16.1936 +-	  *args = (void*) ((char*)(raw++) + SIZEOF_ARG - 1);
 16.1937 ++	  *args = (void*) ((char*)(raw++) + 3);
 16.1938 + 	  break;
 16.1939 + 	  
 16.1940 + 	case FFI_TYPE_UINT16:
 16.1941 + 	case FFI_TYPE_SINT16:
 16.1942 +-	  *args = (void*) ((char*)(raw++) + SIZEOF_ARG - 2);
 16.1943 ++	  *args = (void*) ((char*)(raw++) + 2);
 16.1944 + 	  break;
 16.1945 + 
 16.1946 +-#if SIZEOF_ARG >= 4	  
 16.1947 +-	case FFI_TYPE_UINT32:
 16.1948 +-	case FFI_TYPE_SINT32:
 16.1949 +-	  *args = (void*) ((char*)(raw++) + SIZEOF_ARG - 4);
 16.1950 +-	  break;
 16.1951 +-#endif
 16.1952 +-	
 16.1953 + #if SIZEOF_ARG == 8	  
 16.1954 + 	case FFI_TYPE_UINT64:
 16.1955 + 	case FFI_TYPE_SINT64:
 16.1956 +@@ -157,31 +150,54 @@
 16.1957 +       switch ((*tp)->type)
 16.1958 + 	{
 16.1959 + 	case FFI_TYPE_UINT8:
 16.1960 ++#if WORDS_BIGENDIAN
 16.1961 ++	  *(UINT32*)(raw++) = *(UINT8*) (*args);
 16.1962 ++#else
 16.1963 + 	  (raw++)->uint = *(UINT8*) (*args);
 16.1964 ++#endif
 16.1965 + 	  break;
 16.1966 + 
 16.1967 + 	case FFI_TYPE_SINT8:
 16.1968 ++#if WORDS_BIGENDIAN
 16.1969 ++	  *(SINT32*)(raw++) = *(SINT8*) (*args);
 16.1970 ++#else
 16.1971 + 	  (raw++)->sint = *(SINT8*) (*args);
 16.1972 ++#endif
 16.1973 + 	  break;
 16.1974 + 
 16.1975 + 	case FFI_TYPE_UINT16:
 16.1976 ++#if WORDS_BIGENDIAN
 16.1977 ++	  *(UINT32*)(raw++) = *(UINT16*) (*args);
 16.1978 ++#else
 16.1979 + 	  (raw++)->uint = *(UINT16*) (*args);
 16.1980 ++#endif
 16.1981 + 	  break;
 16.1982 + 
 16.1983 + 	case FFI_TYPE_SINT16:
 16.1984 ++#if WORDS_BIGENDIAN
 16.1985 ++	  *(SINT32*)(raw++) = *(SINT16*) (*args);
 16.1986 ++#else
 16.1987 + 	  (raw++)->sint = *(SINT16*) (*args);
 16.1988 ++#endif
 16.1989 + 	  break;
 16.1990 + 
 16.1991 +-#if SIZEOF_ARG >= 4
 16.1992 + 	case FFI_TYPE_UINT32:
 16.1993 ++#if WORDS_BIGENDIAN
 16.1994 ++	  *(UINT32*)(raw++) = *(UINT32*) (*args);
 16.1995 ++#else
 16.1996 + 	  (raw++)->uint = *(UINT32*) (*args);
 16.1997 ++#endif
 16.1998 + 	  break;
 16.1999 + 
 16.2000 + 	case FFI_TYPE_SINT32:
 16.2001 ++#if WORDS_BIGENDIAN
 16.2002 ++	  *(SINT32*)(raw++) = *(SINT32*) (*args);
 16.2003 ++#else
 16.2004 + 	  (raw++)->sint = *(SINT32*) (*args);
 16.2005 +-	  break;
 16.2006 + #endif
 16.2007 +-        case FFI_TYPE_FLOAT:
 16.2008 ++	  break;
 16.2009 ++
 16.2010 ++	case FFI_TYPE_FLOAT:
 16.2011 + 	  (raw++)->flt = *(FLOAT32*) (*args);
 16.2012 + 	  break;
 16.2013 + 
 16.2014 +@@ -211,6 +227,55 @@
 16.2015 + 
 16.2016 + #if !FFI_NATIVE_RAW_API
 16.2017 + 
 16.2018 ++static void
 16.2019 ++ffi_java_rvalue_to_raw (ffi_cif *cif, void *rvalue)
 16.2020 ++{
 16.2021 ++#if WORDS_BIGENDIAN && SIZEOF_ARG == 8
 16.2022 ++  switch (cif->rtype->type)
 16.2023 ++    {
 16.2024 ++    case FFI_TYPE_UINT8:
 16.2025 ++    case FFI_TYPE_UINT16:
 16.2026 ++    case FFI_TYPE_UINT32:
 16.2027 ++      *(UINT64 *)rvalue <<= 32;
 16.2028 ++      break;
 16.2029 ++
 16.2030 ++    case FFI_TYPE_SINT8:
 16.2031 ++    case FFI_TYPE_SINT16:
 16.2032 ++    case FFI_TYPE_SINT32:
 16.2033 ++    case FFI_TYPE_INT:
 16.2034 ++      *(SINT64 *)rvalue <<= 32;
 16.2035 ++      break;
 16.2036 ++
 16.2037 ++    default:
 16.2038 ++      break;
 16.2039 ++    }
 16.2040 ++#endif
 16.2041 ++}
 16.2042 ++
 16.2043 ++static void
 16.2044 ++ffi_java_raw_to_rvalue (ffi_cif *cif, void *rvalue)
 16.2045 ++{
 16.2046 ++#if WORDS_BIGENDIAN && SIZEOF_ARG == 8
 16.2047 ++  switch (cif->rtype->type)
 16.2048 ++    {
 16.2049 ++    case FFI_TYPE_UINT8:
 16.2050 ++    case FFI_TYPE_UINT16:
 16.2051 ++    case FFI_TYPE_UINT32:
 16.2052 ++      *(UINT64 *)rvalue >>= 32;
 16.2053 ++      break;
 16.2054 ++
 16.2055 ++    case FFI_TYPE_SINT8:
 16.2056 ++    case FFI_TYPE_SINT16:
 16.2057 ++    case FFI_TYPE_SINT32:
 16.2058 ++    case FFI_TYPE_INT:
 16.2059 ++      *(SINT64 *)rvalue >>= 32;
 16.2060 ++      break;
 16.2061 ++
 16.2062 ++    default:
 16.2063 ++      break;
 16.2064 ++    }
 16.2065 ++#endif
 16.2066 ++}
 16.2067 + 
 16.2068 + /* This is a generic definition of ffi_raw_call, to be used if the
 16.2069 +  * native system does not provide a machine-specific implementation.
 16.2070 +@@ -227,6 +292,7 @@
 16.2071 +   void **avalue = (void**) alloca (cif->nargs * sizeof (void*));
 16.2072 +   ffi_java_raw_to_ptrarray (cif, raw, avalue);
 16.2073 +   ffi_call (cif, fn, rvalue, avalue);
 16.2074 ++  ffi_java_rvalue_to_raw (cif, rvalue);
 16.2075 + }
 16.2076 + 
 16.2077 + #if FFI_CLOSURES		/* base system provides closures */
 16.2078 +@@ -240,6 +306,7 @@
 16.2079 + 
 16.2080 +   ffi_java_ptrarray_to_raw (cif, avalue, raw);
 16.2081 +   (*cl->fun) (cif, rvalue, raw, cl->user_data);
 16.2082 ++  ffi_java_raw_to_rvalue (cif, rvalue);
 16.2083 + }
 16.2084 + 
 16.2085 + /* Again, here is the generic version of ffi_prep_raw_closure, which
 16.2086 +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/m68k/ffi.c gcc/libffi/src/m68k/ffi.c
 16.2087 +--- gcc-3.2.2.orig/libffi/src/m68k/ffi.c	Sun Aug  8 22:27:19 1999
 16.2088 ++++ gcc/libffi/src/m68k/ffi.c	Fri Jul 19 08:08:30 2002
 16.2089 +@@ -16,14 +16,11 @@
 16.2090 + ffi_prep_args (void *stack, extended_cif *ecif)
 16.2091 + {
 16.2092 +   unsigned int i;
 16.2093 +-  int tmp;
 16.2094 +-  unsigned int avn;
 16.2095 +   void **p_argv;
 16.2096 +   char *argp;
 16.2097 +   ffi_type **p_arg;
 16.2098 +   void *struct_value_ptr;
 16.2099 + 
 16.2100 +-  tmp = 0;
 16.2101 +   argp = stack;
 16.2102 + 
 16.2103 +   if (ecif->cif->rtype->type == FFI_TYPE_STRUCT
 16.2104 +@@ -32,11 +29,10 @@
 16.2105 +   else
 16.2106 +     struct_value_ptr = NULL;
 16.2107 + 
 16.2108 +-  avn = ecif->cif->nargs;
 16.2109 +   p_argv = ecif->avalue;
 16.2110 + 
 16.2111 +   for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types;
 16.2112 +-       i != 0 && avn != 0;
 16.2113 ++       i != 0;
 16.2114 +        i--, p_arg++)
 16.2115 +     {
 16.2116 +       size_t z;
 16.2117 +@@ -45,9 +41,6 @@
 16.2118 +       if (((*p_arg)->alignment - 1) & (unsigned) argp)
 16.2119 + 	argp = (char *) ALIGN (argp, (*p_arg)->alignment);
 16.2120 + 
 16.2121 +-      if (avn != 0) 
 16.2122 +-	{
 16.2123 +-	  avn--;
 16.2124 + 	  z = (*p_arg)->size;
 16.2125 + 	  if (z < sizeof (int))
 16.2126 + 	    {
 16.2127 +@@ -82,7 +75,6 @@
 16.2128 + 	    memcpy (argp, *p_argv, z);
 16.2129 + 	  p_argv++;
 16.2130 + 	  argp += z;
 16.2131 +-	}
 16.2132 +     }
 16.2133 + 
 16.2134 +   return struct_value_ptr;
 16.2135 +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/mips/ffi.c gcc/libffi/src/mips/ffi.c
 16.2136 +--- gcc-3.2.2.orig/libffi/src/mips/ffi.c	Sat Mar  3 07:21:23 2001
 16.2137 ++++ gcc/libffi/src/mips/ffi.c	Fri Jul 19 08:08:31 2002
 16.2138 +@@ -23,6 +23,7 @@
 16.2139 +    OTHER DEALINGS IN THE SOFTWARE.
 16.2140 +    ----------------------------------------------------------------------- */
 16.2141 + 
 16.2142 ++#include <sgidefs.h>
 16.2143 + #include <ffi.h>
 16.2144 + #include <ffi_common.h>
 16.2145 + 
 16.2146 +@@ -50,7 +51,6 @@
 16.2147 + 			  int flags)
 16.2148 + {
 16.2149 +   register int i;
 16.2150 +-  register int avn;
 16.2151 +   register void **p_argv;
 16.2152 +   register char *argp;
 16.2153 +   register ffi_type **p_arg;
 16.2154 +@@ -80,12 +80,9 @@
 16.2155 +       FIX_ARGP;
 16.2156 +     }
 16.2157 + 
 16.2158 +-  avn = ecif->cif->nargs;
 16.2159 +   p_argv = ecif->avalue;
 16.2160 + 
 16.2161 +-  for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types;
 16.2162 +-       i && avn;
 16.2163 +-       i--, p_arg++)
 16.2164 ++  for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; i; i--, p_arg++)
 16.2165 +     {
 16.2166 +       size_t z;
 16.2167 + 
 16.2168 +@@ -101,9 +98,6 @@
 16.2169 + #define OFFSET sizeof(int)
 16.2170 + #endif      
 16.2171 + 
 16.2172 +-      if (avn) 
 16.2173 +-	{
 16.2174 +-	  avn--;
 16.2175 + 	  z = (*p_arg)->size;
 16.2176 + 	  if (z < sizeof(SLOT_TYPE_UNSIGNED))
 16.2177 + 	    {
 16.2178 +@@ -179,7 +173,6 @@
 16.2179 + 	  p_argv++;
 16.2180 + 	  argp += z;
 16.2181 + 	  FIX_ARGP;
 16.2182 +-	}
 16.2183 +     }
 16.2184 +   
 16.2185 +   return;
 16.2186 +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/powerpc/darwin.S gcc/libffi/src/powerpc/darwin.S
 16.2187 +--- gcc-3.2.2.orig/libffi/src/powerpc/darwin.S	Sat Jan 19 01:22:34 2002
 16.2188 ++++ gcc/libffi/src/powerpc/darwin.S	Thu Jan 23 03:21:55 2003
 16.2189 +@@ -3,8 +3,6 @@
 16.2190 +    
 16.2191 +    PowerPC Assembly glue.
 16.2192 + 
 16.2193 +-   $Id: darwin.S,v 1.2 2002/01/18 16:22:34 dje Exp $
 16.2194 +-
 16.2195 +    Permission is hereby granted, free of charge, to any person obtaining
 16.2196 +    a copy of this software and associated documentation files (the
 16.2197 +    ``Software''), to deal in the Software without restriction, including
 16.2198 +@@ -39,30 +37,34 @@
 16.2199 + .text
 16.2200 + 	.align 2
 16.2201 + _ffi_call_DARWIN:
 16.2202 +-	mr      r12,r8 // We only need r12 until the call, so it doesn't have to be saved...
 16.2203 ++LFB0:	
 16.2204 ++	mr      r12,r8		/* We only need r12 until the call,
 16.2205 ++				so it doesn't have to be saved...  */
 16.2206 ++LFB1:	
 16.2207 + 	/* Save the old stack pointer as AP.  */
 16.2208 + 	mr	r8,r1
 16.2209 +-
 16.2210 ++LCFI0:	
 16.2211 + 	/* Allocate the stack space we need.  */
 16.2212 + 	stwux	r1,r1,r4	
 16.2213 + 	
 16.2214 + 	/* Save registers we use.  */
 16.2215 + 	mflr	r9
 16.2216 + 
 16.2217 +-	stw	r28,-16(r8)
 16.2218 ++	stw	r28,-16(r8)	
 16.2219 + 	stw	r29,-12(r8)
 16.2220 + 	stw	r30, -8(r8)
 16.2221 + 	stw	r31, -4(r8)
 16.2222 +-	
 16.2223 +-	stw	r9,  8(r8)
 16.2224 ++
 16.2225 ++	stw	r9,  8(r8)	
 16.2226 + 	stw	r2, 20(r1)
 16.2227 ++LCFI1:	
 16.2228 + 
 16.2229 + 	/* Save arguments over call...  */
 16.2230 +-	mr	r31,r5	/* flags, */
 16.2231 +-	mr	r30,r6	/* rvalue, */
 16.2232 +-	mr	r29,r7	/* function address, */
 16.2233 +-	mr	r28,r8	/* our AP. */
 16.2234 +-		
 16.2235 ++	mr	r31,r5	/* flags,  */
 16.2236 ++	mr	r30,r6	/* rvalue,  */
 16.2237 ++	mr	r29,r7	/* function address,  */
 16.2238 ++	mr	r28,r8	/* our AP.  */
 16.2239 ++LCFI2:		
 16.2240 + 	/* Call ffi_prep_args.  */
 16.2241 + 	mr	r4,r1
 16.2242 + 	li	r9,0
 16.2243 +@@ -145,7 +147,8 @@
 16.2244 + L(float_return_value):
 16.2245 + 	stfs	f1,0(r30)
 16.2246 + 	b	L(done_return_value)
 16.2247 +-//END(_ffi_call_DARWIN)
 16.2248 ++LFE1:	
 16.2249 ++/* END(_ffi_call_DARWIN)  */
 16.2250 + 
 16.2251 + /* Provide a null definition of _ffi_call_AIX.  */
 16.2252 + .text
 16.2253 +@@ -155,5 +158,61 @@
 16.2254 + 	.align 2
 16.2255 + _ffi_call_AIX:
 16.2256 + 	blr
 16.2257 +-//END(_ffi_call_AIX)
 16.2258 ++/* END(_ffi_call_AIX)  */
 16.2259 + 
 16.2260 ++.data
 16.2261 ++.section __TEXT,__eh_frame
 16.2262 ++Lframe1:
 16.2263 ++	.set	L$set$0,LECIE1-LSCIE1
 16.2264 ++	.long	L$set$0	; Length of Common Information Entry
 16.2265 ++LSCIE1:
 16.2266 ++	.long	0x0	; CIE Identifier Tag
 16.2267 ++	.byte	0x1	; CIE Version
 16.2268 ++	.ascii	"zR\0"	; CIE Augmentation
 16.2269 ++	.byte	0x1	; uleb128 0x1; CIE Code Alignment Factor
 16.2270 ++	.byte	0x7c	; sleb128 -4; CIE Data Alignment Factor
 16.2271 ++	.byte	0x41	; CIE RA Column
 16.2272 ++	.byte   0x1     ; uleb128 0x1; Augmentation size
 16.2273 ++	.byte   0x10    ; FDE Encoding (pcrel)
 16.2274 ++	.byte	0xc	; DW_CFA_def_cfa
 16.2275 ++	.byte	0x1	; uleb128 0x1
 16.2276 ++	.byte	0x0	; uleb128 0x0
 16.2277 ++	.align	2
 16.2278 ++LECIE1:
 16.2279 ++LSFDE1:
 16.2280 ++	.set	L$set$1,LEFDE1-LASFDE1
 16.2281 ++	.long	L$set$1	; FDE Length
 16.2282 ++LASFDE1:
 16.2283 ++	.set	L$set$2,LASFDE1-Lframe1
 16.2284 ++	.long	L$set$2	; FDE CIE offset
 16.2285 ++	.long	LFB0-.	; FDE initial location
 16.2286 ++	.set	L$set$3,LFE1-LFB0
 16.2287 ++	.long	L$set$3	; FDE address range
 16.2288 ++	.byte   0x0     ; uleb128 0x0; Augmentation size
 16.2289 ++	.byte	0x4	; DW_CFA_advance_loc4
 16.2290 ++	.set	L$set$4,LCFI0-LFB1
 16.2291 ++	.long	L$set$4
 16.2292 ++	.byte	0xd	; DW_CFA_def_cfa_register
 16.2293 ++	.byte	0x08	; uleb128 0x08 
 16.2294 ++	.byte	0x4	; DW_CFA_advance_loc4
 16.2295 ++	.set	L$set$5,LCFI1-LCFI0
 16.2296 ++	.long	L$set$5
 16.2297 ++	.byte   0x11    ; DW_CFA_offset_extended_sf
 16.2298 ++	.byte	0x41	; uleb128 0x41
 16.2299 ++	.byte   0x7e    ; sleb128 -2
 16.2300 ++	.byte	0x9f	; DW_CFA_offset, column 0x1f 
 16.2301 ++	.byte	0x1	; uleb128 0x1 
 16.2302 ++	.byte	0x9e	; DW_CFA_offset, column 0x1e
 16.2303 ++	.byte	0x2	; uleb128 0x2
 16.2304 ++	.byte	0x9d	; DW_CFA_offset, column 0x1d 
 16.2305 ++	.byte	0x3	; uleb128 0x3 
 16.2306 ++	.byte	0x9c	; DW_CFA_offset, column 0x1c 
 16.2307 ++	.byte	0x4	; uleb128 0x4
 16.2308 ++	.byte	0x4	; DW_CFA_advance_loc4 
 16.2309 ++	.set	L$set$6,LCFI2-LCFI1
 16.2310 ++	.long	L$set$6
 16.2311 ++	.byte	0xd	; DW_CFA_def_cfa_register 
 16.2312 ++	.byte	0x1c	; uleb128 0x1c 
 16.2313 ++	.align 2
 16.2314 ++LEFDE1:
 16.2315 ++	
 16.2316 +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/prep_cif.c gcc/libffi/src/prep_cif.c
 16.2317 +--- gcc-3.2.2.orig/libffi/src/prep_cif.c	Sat Mar  3 07:21:22 2001
 16.2318 ++++ gcc/libffi/src/prep_cif.c	Mon Sep 30 20:59:42 2002
 16.2319 +@@ -103,7 +103,8 @@
 16.2320 +   /* Perform a sanity check on the return type */
 16.2321 +   FFI_ASSERT(ffi_type_test(cif->rtype));
 16.2322 + 
 16.2323 +-#ifndef M68K
 16.2324 ++  /* x86-64 and s390 stack space allocation is handled in prep_machdep.  */
 16.2325 ++#if !defined M68K && !defined __x86_64__ && !defined S390
 16.2326 +   /* Make space for the return structure pointer */
 16.2327 +   if (cif->rtype->type == FFI_TYPE_STRUCT
 16.2328 + #ifdef SPARC
 16.2329 +@@ -122,6 +123,7 @@
 16.2330 +       if (((*ptr)->size == 0) && (initialize_aggregate((*ptr)) != FFI_OK))
 16.2331 + 	return FFI_BAD_TYPEDEF;
 16.2332 + 
 16.2333 ++#if !defined __x86_64__ && !defined S390
 16.2334 + #ifdef SPARC
 16.2335 +       if (((*ptr)->type == FFI_TYPE_STRUCT
 16.2336 + 	   && ((*ptr)->size > 16 || cif->abi != FFI_V9))
 16.2337 +@@ -137,6 +139,7 @@
 16.2338 + 	  
 16.2339 + 	  bytes += STACK_ARG_SIZE((*ptr)->size);
 16.2340 + 	}
 16.2341 ++#endif
 16.2342 +     }
 16.2343 + 
 16.2344 +   cif->bytes = bytes;
 16.2345 +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/s390/ffi.c gcc/libffi/src/s390/ffi.c
 16.2346 +--- gcc-3.2.2.orig/libffi/src/s390/ffi.c	Thu Jan  1 09:00:00 1970
 16.2347 ++++ gcc/libffi/src/s390/ffi.c	Thu Feb  6 08:58:57 2003
 16.2348 +@@ -0,0 +1,753 @@
 16.2349 ++/* -----------------------------------------------------------------------
 16.2350 ++   ffi.c - Copyright (c) 2000 Software AG
 16.2351 ++ 
 16.2352 ++   S390 Foreign Function Interface
 16.2353 ++ 
 16.2354 ++   Permission is hereby granted, free of charge, to any person obtaining
 16.2355 ++   a copy of this software and associated documentation files (the
 16.2356 ++   ``Software''), to deal in the Software without restriction, including
 16.2357 ++   without limitation the rights to use, copy, modify, merge, publish,
 16.2358 ++   distribute, sublicense, and/or sell copies of the Software, and to
 16.2359 ++   permit persons to whom the Software is furnished to do so, subject to
 16.2360 ++   the following conditions:
 16.2361 ++ 
 16.2362 ++   The above copyright notice and this permission notice shall be included
 16.2363 ++   in all copies or substantial portions of the Software.
 16.2364 ++ 
 16.2365 ++   THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
 16.2366 ++   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 16.2367 ++   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 16.2368 ++   IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR
 16.2369 ++   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 16.2370 ++   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 16.2371 ++   OTHER DEALINGS IN THE SOFTWARE.
 16.2372 ++   ----------------------------------------------------------------------- */
 16.2373 ++/*====================================================================*/
 16.2374 ++/*                          Includes                                  */
 16.2375 ++/*                          --------                                  */
 16.2376 ++/*====================================================================*/
 16.2377 ++ 
 16.2378 ++#include <ffi.h>
 16.2379 ++#include <ffi_common.h>
 16.2380 ++ 
 16.2381 ++#include <stdlib.h>
 16.2382 ++#include <stdio.h>
 16.2383 ++ 
 16.2384 ++/*====================== End of Includes =============================*/
 16.2385 ++ 
 16.2386 ++/*====================================================================*/
 16.2387 ++/*                           Defines                                  */
 16.2388 ++/*                           -------                                  */
 16.2389 ++/*====================================================================*/
 16.2390 ++
 16.2391 ++/* Maximum number of GPRs available for argument passing.  */ 
 16.2392 ++#define MAX_GPRARGS 5
 16.2393 ++
 16.2394 ++/* Maximum number of FPRs available for argument passing.  */ 
 16.2395 ++#ifdef __s390x__
 16.2396 ++#define MAX_FPRARGS 4
 16.2397 ++#else
 16.2398 ++#define MAX_FPRARGS 2
 16.2399 ++#endif
 16.2400 ++
 16.2401 ++/* Round to multiple of 16.  */
 16.2402 ++#define ROUND_SIZE(size) (((size) + 15) & ~15)
 16.2403 ++
 16.2404 ++/* If these values change, sysv.S must be adapted!  */
 16.2405 ++#define FFI390_RET_VOID		0
 16.2406 ++#define FFI390_RET_STRUCT	1
 16.2407 ++#define FFI390_RET_FLOAT	2
 16.2408 ++#define FFI390_RET_DOUBLE	3
 16.2409 ++#define FFI390_RET_INT32	4
 16.2410 ++#define FFI390_RET_INT64	5
 16.2411 ++
 16.2412 ++/*===================== End of Defines ===============================*/
 16.2413 ++ 
 16.2414 ++/*====================================================================*/
 16.2415 ++/*                          Prototypes                                */
 16.2416 ++/*                          ----------                                */
 16.2417 ++/*====================================================================*/
 16.2418 ++ 
 16.2419 ++static void ffi_prep_args (unsigned char *, extended_cif *);
 16.2420 ++static int ffi_check_float_struct (ffi_type *);
 16.2421 ++void
 16.2422 ++#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2)
 16.2423 ++__attribute__ ((visibility ("hidden")))
 16.2424 ++#endif
 16.2425 ++ffi_closure_helper_SYSV (ffi_closure *, unsigned long *, 
 16.2426 ++			 unsigned long long *, unsigned long *);
 16.2427 ++
 16.2428 ++/*====================== End of Prototypes ===========================*/
 16.2429 ++ 
 16.2430 ++/*====================================================================*/
 16.2431 ++/*                          Externals                                 */
 16.2432 ++/*                          ---------                                 */
 16.2433 ++/*====================================================================*/
 16.2434 ++ 
 16.2435 ++extern void ffi_call_SYSV(unsigned,
 16.2436 ++			  extended_cif *,
 16.2437 ++			  void (*)(unsigned char *, extended_cif *),
 16.2438 ++			  unsigned,
 16.2439 ++			  void *,
 16.2440 ++			  void (*fn)());
 16.2441 ++
 16.2442 ++extern void ffi_closure_SYSV(void);
 16.2443 ++ 
 16.2444 ++/*====================== End of Externals ============================*/
 16.2445 ++ 
 16.2446 ++/*====================================================================*/
 16.2447 ++/*                                                                    */
 16.2448 ++/* Name     - ffi_check_struct_type.                                  */
 16.2449 ++/*                                                                    */
 16.2450 ++/* Function - Determine if a structure can be passed within a         */
 16.2451 ++/*            general purpose or floating point register.             */
 16.2452 ++/*                                                                    */
 16.2453 ++/*====================================================================*/
 16.2454 ++ 
 16.2455 ++static int
 16.2456 ++ffi_check_struct_type (ffi_type *arg)
 16.2457 ++{
 16.2458 ++  size_t size = arg->size;
 16.2459 ++
 16.2460 ++  /* If the struct has just one element, look at that element
 16.2461 ++     to find out whether to consider the struct as floating point.  */
 16.2462 ++  while (arg->type == FFI_TYPE_STRUCT 
 16.2463 ++         && arg->elements[0] && !arg->elements[1])
 16.2464 ++    arg = arg->elements[0];
 16.2465 ++
 16.2466 ++  /* Structs of size 1, 2, 4, and 8 are passed in registers,
 16.2467 ++     just like the corresponding int/float types.  */
 16.2468 ++  switch (size)
 16.2469 ++    {
 16.2470 ++      case 1:
 16.2471 ++        return FFI_TYPE_UINT8;
 16.2472 ++
 16.2473 ++      case 2:
 16.2474 ++        return FFI_TYPE_UINT16;
 16.2475 ++
 16.2476 ++      case 4:
 16.2477 ++	if (arg->type == FFI_TYPE_FLOAT)
 16.2478 ++          return FFI_TYPE_FLOAT;
 16.2479 ++	else
 16.2480 ++	  return FFI_TYPE_UINT32;
 16.2481 ++
 16.2482 ++      case 8:
 16.2483 ++	if (arg->type == FFI_TYPE_DOUBLE)
 16.2484 ++          return FFI_TYPE_DOUBLE;
 16.2485 ++	else
 16.2486 ++	  return FFI_TYPE_UINT64;
 16.2487 ++
 16.2488 ++      default:
 16.2489 ++	break;
 16.2490 ++    }
 16.2491 ++
 16.2492 ++  /* Other structs are passed via a pointer to the data.  */
 16.2493 ++  return FFI_TYPE_POINTER;
 16.2494 ++}
 16.2495 ++ 
 16.2496 ++/*======================== End of Routine ============================*/
 16.2497 ++ 
 16.2498 ++/*====================================================================*/
 16.2499 ++/*                                                                    */
 16.2500 ++/* Name     - ffi_prep_args.                                          */
 16.2501 ++/*                                                                    */
 16.2502 ++/* Function - Prepare parameters for call to function.                */
 16.2503 ++/*                                                                    */
 16.2504 ++/* ffi_prep_args is called by the assembly routine once stack space   */
 16.2505 ++/* has been allocated for the function's arguments.                   */
 16.2506 ++/*                                                                    */
 16.2507 ++/*====================================================================*/
 16.2508 ++ 
 16.2509 ++static void
 16.2510 ++ffi_prep_args (unsigned char *stack, extended_cif *ecif)
 16.2511 ++{
 16.2512 ++  /* The stack space will be filled with those areas:
 16.2513 ++
 16.2514 ++	FPR argument register save area     (highest addresses)
 16.2515 ++	GPR argument register save area
 16.2516 ++	temporary struct copies
 16.2517 ++	overflow argument area              (lowest addresses)
 16.2518 ++
 16.2519 ++     We set up the following pointers:
 16.2520 ++
 16.2521 ++        p_fpr: bottom of the FPR area (growing upwards)
 16.2522 ++	p_gpr: bottom of the GPR area (growing upwards)
 16.2523 ++	p_ov: bottom of the overflow area (growing upwards)
 16.2524 ++	p_struct: top of the struct copy area (growing downwards)
 16.2525 ++
 16.2526 ++     All areas are kept aligned to twice the word size.  */
 16.2527 ++
 16.2528 ++  int gpr_off = ecif->cif->bytes;
 16.2529 ++  int fpr_off = gpr_off + ROUND_SIZE (MAX_GPRARGS * sizeof (long));
 16.2530 ++
 16.2531 ++  unsigned long long *p_fpr = (unsigned long long *)(stack + fpr_off);
 16.2532 ++  unsigned long *p_gpr = (unsigned long *)(stack + gpr_off);
 16.2533 ++  unsigned char *p_struct = (unsigned char *)p_gpr;
 16.2534 ++  unsigned long *p_ov = (unsigned long *)stack;
 16.2535 ++
 16.2536 ++  int n_fpr = 0;
 16.2537 ++  int n_gpr = 0;
 16.2538 ++  int n_ov = 0;
 16.2539 ++
 16.2540 ++  ffi_type **ptr;
 16.2541 ++  void **p_argv = ecif->avalue;
 16.2542 ++  int i;
 16.2543 ++ 
 16.2544 ++  /* If we returning a structure then we set the first parameter register
 16.2545 ++     to the address of where we are returning this structure.  */
 16.2546 ++
 16.2547 ++  if (ecif->cif->flags == FFI390_RET_STRUCT)
 16.2548 ++    p_gpr[n_gpr++] = (unsigned long) ecif->rvalue;
 16.2549 ++
 16.2550 ++  /* Now for the arguments.  */
 16.2551 ++ 
 16.2552 ++  for (ptr = ecif->cif->arg_types, i = ecif->cif->nargs;
 16.2553 ++       i > 0;
 16.2554 ++       i--, ptr++, p_argv++)
 16.2555 ++    {
 16.2556 ++      void *arg = *p_argv;
 16.2557 ++      int type = (*ptr)->type;
 16.2558 ++
 16.2559 ++      /* Check how a structure type is passed.  */
 16.2560 ++      if (type == FFI_TYPE_STRUCT)
 16.2561 ++	{
 16.2562 ++	  type = ffi_check_struct_type (*ptr);
 16.2563 ++
 16.2564 ++	  /* If we pass the struct via pointer, copy the data.  */
 16.2565 ++	  if (type == FFI_TYPE_POINTER)
 16.2566 ++	    {
 16.2567 ++	      p_struct -= ROUND_SIZE ((*ptr)->size);
 16.2568 ++	      memcpy (p_struct, (char *)arg, (*ptr)->size);
 16.2569 ++	      arg = &p_struct;
 16.2570 ++	    }
 16.2571 ++	}
 16.2572 ++
 16.2573 ++      /* Pointers are passed like UINTs of the same size.  */
 16.2574 ++      if (type == FFI_TYPE_POINTER)
 16.2575 ++#ifdef __s390x__
 16.2576 ++	type = FFI_TYPE_UINT64;
 16.2577 ++#else
 16.2578 ++	type = FFI_TYPE_UINT32;
 16.2579 ++#endif
 16.2580 ++
 16.2581 ++      /* Now handle all primitive int/float data types.  */
 16.2582 ++      switch (type) 
 16.2583 ++	{
 16.2584 ++	  case FFI_TYPE_DOUBLE:
 16.2585 ++	    if (n_fpr < MAX_FPRARGS)
 16.2586 ++	      p_fpr[n_fpr++] = *(unsigned long long *) arg;
 16.2587 ++	    else
 16.2588 ++#ifdef __s390x__
 16.2589 ++	      p_ov[n_ov++] = *(unsigned long *) arg;
 16.2590 ++#else
 16.2591 ++	      p_ov[n_ov++] = ((unsigned long *) arg)[0],
 16.2592 ++	      p_ov[n_ov++] = ((unsigned long *) arg)[1];
 16.2593 ++#endif
 16.2594 ++	    break;
 16.2595 ++	
 16.2596 ++	  case FFI_TYPE_FLOAT:
 16.2597 ++	    if (n_fpr < MAX_FPRARGS)
 16.2598 ++	      p_fpr[n_fpr++] = (long long) *(unsigned int *) arg << 32;
 16.2599 ++	    else
 16.2600 ++	      p_ov[n_ov++] = *(unsigned int *) arg;
 16.2601 ++	    break;
 16.2602 ++ 
 16.2603 ++	  case FFI_TYPE_UINT64:
 16.2604 ++	  case FFI_TYPE_SINT64:
 16.2605 ++#ifdef __s390x__
 16.2606 ++	    if (n_gpr < MAX_GPRARGS)
 16.2607 ++	      p_gpr[n_gpr++] = *(unsigned long *) arg;
 16.2608 ++	    else
 16.2609 ++	      p_ov[n_ov++] = *(unsigned long *) arg;
 16.2610 ++#else
 16.2611 ++	    if (n_gpr == MAX_GPRARGS-1)
 16.2612 ++	      n_gpr = MAX_GPRARGS;
 16.2613 ++	    if (n_gpr < MAX_GPRARGS)
 16.2614 ++	      p_gpr[n_gpr++] = ((unsigned long *) arg)[0],
 16.2615 ++	      p_gpr[n_gpr++] = ((unsigned long *) arg)[1];
 16.2616 ++	    else
 16.2617 ++	      p_ov[n_ov++] = ((unsigned long *) arg)[0],
 16.2618 ++	      p_ov[n_ov++] = ((unsigned long *) arg)[1];
 16.2619 ++#endif
 16.2620 ++	    break;
 16.2621 ++ 
 16.2622 ++	  case FFI_TYPE_UINT32:
 16.2623 ++	    if (n_gpr < MAX_GPRARGS)
 16.2624 ++	      p_gpr[n_gpr++] = *(unsigned int *) arg;
 16.2625 ++	    else
 16.2626 ++	      p_ov[n_ov++] = *(unsigned int *) arg;
 16.2627 ++	    break;
 16.2628 ++ 
 16.2629 ++	  case FFI_TYPE_INT:
 16.2630 ++	  case FFI_TYPE_SINT32:
 16.2631 ++	    if (n_gpr < MAX_GPRARGS)
 16.2632 ++	      p_gpr[n_gpr++] = *(signed int *) arg;
 16.2633 ++	    else
 16.2634 ++	      p_ov[n_ov++] = *(signed int *) arg;
 16.2635 ++	    break;
 16.2636 ++ 
 16.2637 ++	  case FFI_TYPE_UINT16:
 16.2638 ++	    if (n_gpr < MAX_GPRARGS)
 16.2639 ++	      p_gpr[n_gpr++] = *(unsigned short *) arg;
 16.2640 ++	    else
 16.2641 ++	      p_ov[n_ov++] = *(unsigned short *) arg;
 16.2642 ++	    break;
 16.2643 ++ 
 16.2644 ++	  case FFI_TYPE_SINT16:
 16.2645 ++	    if (n_gpr < MAX_GPRARGS)
 16.2646 ++	      p_gpr[n_gpr++] = *(signed short *) arg;
 16.2647 ++	    else
 16.2648 ++	      p_ov[n_ov++] = *(signed short *) arg;
 16.2649 ++	    break;
 16.2650 ++
 16.2651 ++	  case FFI_TYPE_UINT8:
 16.2652 ++	    if (n_gpr < MAX_GPRARGS)
 16.2653 ++	      p_gpr[n_gpr++] = *(unsigned char *) arg;
 16.2654 ++	    else
 16.2655 ++	      p_ov[n_ov++] = *(unsigned char *) arg;
 16.2656 ++	    break;
 16.2657 ++ 
 16.2658 ++	  case FFI_TYPE_SINT8:
 16.2659 ++	    if (n_gpr < MAX_GPRARGS)
 16.2660 ++	      p_gpr[n_gpr++] = *(signed char *) arg;
 16.2661 ++	    else
 16.2662 ++	      p_ov[n_ov++] = *(signed char *) arg;
 16.2663 ++	    break;
 16.2664 ++ 
 16.2665 ++	  default:
 16.2666 ++	    FFI_ASSERT (0);
 16.2667 ++	    break;
 16.2668 ++        }
 16.2669 ++    }
 16.2670 ++}
 16.2671 ++
 16.2672 ++/*======================== End of Routine ============================*/
 16.2673 ++ 
 16.2674 ++/*====================================================================*/
 16.2675 ++/*                                                                    */
 16.2676 ++/* Name     - ffi_prep_cif_machdep.                                   */
 16.2677 ++/*                                                                    */
 16.2678 ++/* Function - Perform machine dependent CIF processing.               */
 16.2679 ++/*                                                                    */
 16.2680 ++/*====================================================================*/
 16.2681 ++ 
 16.2682 ++ffi_status
 16.2683 ++ffi_prep_cif_machdep(ffi_cif *cif)
 16.2684 ++{
 16.2685 ++  size_t struct_size = 0;
 16.2686 ++  int n_gpr = 0;
 16.2687 ++  int n_fpr = 0;
 16.2688 ++  int n_ov = 0;
 16.2689 ++
 16.2690 ++  ffi_type **ptr;
 16.2691 ++  int i;
 16.2692 ++
 16.2693 ++  /* Determine return value handling.  */ 
 16.2694 ++
 16.2695 ++  switch (cif->rtype->type)
 16.2696 ++    {
 16.2697 ++      /* Void is easy.  */
 16.2698 ++      case FFI_TYPE_VOID:
 16.2699 ++	cif->flags = FFI390_RET_VOID;
 16.2700 ++	break;
 16.2701 ++
 16.2702 ++      /* Structures are returned via a hidden pointer.  */
 16.2703 ++      case FFI_TYPE_STRUCT:
 16.2704 ++	cif->flags = FFI390_RET_STRUCT;
 16.2705 ++	n_gpr++;  /* We need one GPR to pass the pointer.  */
 16.2706 ++	break; 
 16.2707 ++
 16.2708 ++      /* Floating point values are returned in fpr 0.  */
 16.2709 ++      case FFI_TYPE_FLOAT:
 16.2710 ++	cif->flags = FFI390_RET_FLOAT;
 16.2711 ++	break;
 16.2712 ++
 16.2713 ++      case FFI_TYPE_DOUBLE:
 16.2714 ++	cif->flags = FFI390_RET_DOUBLE;
 16.2715 ++	break;
 16.2716 ++
 16.2717 ++      /* Integer values are returned in gpr 2 (and gpr 3
 16.2718 ++	 for 64-bit values on 31-bit machines).  */
 16.2719 ++      case FFI_TYPE_UINT64:
 16.2720 ++      case FFI_TYPE_SINT64:
 16.2721 ++	cif->flags = FFI390_RET_INT64;
 16.2722 ++	break;
 16.2723 ++
 16.2724 ++      case FFI_TYPE_POINTER:
 16.2725 ++      case FFI_TYPE_INT:
 16.2726 ++      case FFI_TYPE_UINT32:
 16.2727 ++      case FFI_TYPE_SINT32:
 16.2728 ++      case FFI_TYPE_UINT16:
 16.2729 ++      case FFI_TYPE_SINT16:
 16.2730 ++      case FFI_TYPE_UINT8:
 16.2731 ++      case FFI_TYPE_SINT8:
 16.2732 ++	/* These are to be extended to word size.  */
 16.2733 ++#ifdef __s390x__
 16.2734 ++	cif->flags = FFI390_RET_INT64;
 16.2735 ++#else
 16.2736 ++	cif->flags = FFI390_RET_INT32;
 16.2737 ++#endif
 16.2738 ++	break;
 16.2739 ++ 
 16.2740 ++      default:
 16.2741 ++        FFI_ASSERT (0);
 16.2742 ++        break;
 16.2743 ++    }
 16.2744 ++
 16.2745 ++  /* Now for the arguments.  */
 16.2746 ++ 
 16.2747 ++  for (ptr = cif->arg_types, i = cif->nargs;
 16.2748 ++       i > 0;
 16.2749 ++       i--, ptr++)
 16.2750 ++    {
 16.2751 ++      int type = (*ptr)->type;
 16.2752 ++
 16.2753 ++      /* Check how a structure type is passed.  */
 16.2754 ++      if (type == FFI_TYPE_STRUCT)
 16.2755 ++	{
 16.2756 ++	  type = ffi_check_struct_type (*ptr);
 16.2757 ++
 16.2758 ++	  /* If we pass the struct via pointer, we must reserve space
 16.2759 ++	     to copy its data for proper call-by-value semantics.  */
 16.2760 ++	  if (type == FFI_TYPE_POINTER)
 16.2761 ++	    struct_size += ROUND_SIZE ((*ptr)->size);
 16.2762 ++	}
 16.2763 ++
 16.2764 ++      /* Now handle all primitive int/float data types.  */
 16.2765 ++      switch (type) 
 16.2766 ++	{
 16.2767 ++	  /* The first MAX_FPRARGS floating point arguments
 16.2768 ++	     go in FPRs, the rest overflow to the stack.  */
 16.2769 ++
 16.2770 ++	  case FFI_TYPE_DOUBLE:
 16.2771 ++	    if (n_fpr < MAX_FPRARGS)
 16.2772 ++	      n_fpr++;
 16.2773 ++	    else
 16.2774 ++	      n_ov += sizeof (double) / sizeof (long);
 16.2775 ++	    break;
 16.2776 ++	
 16.2777 ++	  case FFI_TYPE_FLOAT:
 16.2778 ++	    if (n_fpr < MAX_FPRARGS)
 16.2779 ++	      n_fpr++;
 16.2780 ++	    else
 16.2781 ++	      n_ov++;
 16.2782 ++	    break;
 16.2783 ++
 16.2784 ++	  /* On 31-bit machines, 64-bit integers are passed in GPR pairs,
 16.2785 ++	     if one is still available, or else on the stack.  If only one
 16.2786 ++	     register is free, skip the register (it won't be used for any 
 16.2787 ++	     subsequent argument either).  */
 16.2788 ++	      
 16.2789 ++#ifndef __s390x__
 16.2790 ++	  case FFI_TYPE_UINT64:
 16.2791 ++	  case FFI_TYPE_SINT64:
 16.2792 ++	    if (n_gpr == MAX_GPRARGS-1)
 16.2793 ++	      n_gpr = MAX_GPRARGS;
 16.2794 ++	    if (n_gpr < MAX_GPRARGS)
 16.2795 ++	      n_gpr += 2;
 16.2796 ++	    else
 16.2797 ++	      n_ov += 2;
 16.2798 ++	    break;
 16.2799 ++#endif
 16.2800 ++
 16.2801 ++	  /* Everything else is passed in GPRs (until MAX_GPRARGS
 16.2802 ++	     have been used) or overflows to the stack.  */
 16.2803 ++
 16.2804 ++	  default: 
 16.2805 ++	    if (n_gpr < MAX_GPRARGS)
 16.2806 ++	      n_gpr++;
 16.2807 ++	    else
 16.2808 ++	      n_ov++;
 16.2809 ++	    break;
 16.2810 ++        }
 16.2811 ++    }
 16.2812 ++
 16.2813 ++  /* Total stack space as required for overflow arguments
 16.2814 ++     and temporary structure copies.  */
 16.2815 ++
 16.2816 ++  cif->bytes = ROUND_SIZE (n_ov * sizeof (long)) + struct_size;
 16.2817 ++ 
 16.2818 ++  return FFI_OK;
 16.2819 ++}
 16.2820 ++ 
 16.2821 ++/*======================== End of Routine ============================*/
 16.2822 ++ 
 16.2823 ++/*====================================================================*/
 16.2824 ++/*                                                                    */
 16.2825 ++/* Name     - ffi_call.                                               */
 16.2826 ++/*                                                                    */
 16.2827 ++/* Function - Call the FFI routine.                                   */
 16.2828 ++/*                                                                    */
 16.2829 ++/*====================================================================*/
 16.2830 ++ 
 16.2831 ++void
 16.2832 ++ffi_call(ffi_cif *cif,
 16.2833 ++	 void (*fn)(),
 16.2834 ++	 void *rvalue,
 16.2835 ++	 void **avalue)
 16.2836 ++{
 16.2837 ++  int ret_type = cif->flags;
 16.2838 ++  extended_cif ecif;
 16.2839 ++ 
 16.2840 ++  ecif.cif    = cif;
 16.2841 ++  ecif.avalue = avalue;
 16.2842 ++  ecif.rvalue = rvalue;
 16.2843 ++
 16.2844 ++  /* If we don't have a return value, we need to fake one.  */
 16.2845 ++  if (rvalue == NULL)
 16.2846 ++    {
 16.2847 ++      if (ret_type == FFI390_RET_STRUCT)
 16.2848 ++	ecif.rvalue = alloca (cif->rtype->size);
 16.2849 ++      else
 16.2850 ++	ret_type = FFI390_RET_VOID;
 16.2851 ++    } 
 16.2852 ++
 16.2853 ++  switch (cif->abi)
 16.2854 ++    {
 16.2855 ++      case FFI_SYSV:
 16.2856 ++        ffi_call_SYSV (cif->bytes, &ecif, ffi_prep_args,
 16.2857 ++		       ret_type, ecif.rvalue, fn);
 16.2858 ++        break;
 16.2859 ++ 
 16.2860 ++      default:
 16.2861 ++        FFI_ASSERT (0);
 16.2862 ++        break;
 16.2863 ++    }
 16.2864 ++}
 16.2865 ++ 
 16.2866 ++/*======================== End of Routine ============================*/
 16.2867 ++
 16.2868 ++/*====================================================================*/
 16.2869 ++/*                                                                    */
 16.2870 ++/* Name     - ffi_closure_helper_SYSV.                                */
 16.2871 ++/*                                                                    */
 16.2872 ++/* Function - Call a FFI closure target function.                     */
 16.2873 ++/*                                                                    */
 16.2874 ++/*====================================================================*/
 16.2875 ++ 
 16.2876 ++void
 16.2877 ++ffi_closure_helper_SYSV (ffi_closure *closure,
 16.2878 ++			 unsigned long *p_gpr,
 16.2879 ++			 unsigned long long *p_fpr,
 16.2880 ++			 unsigned long *p_ov)
 16.2881 ++{
 16.2882 ++  unsigned long long ret_buffer;
 16.2883 ++
 16.2884 ++  void *rvalue = &ret_buffer;
 16.2885 ++  void **avalue;
 16.2886 ++  void **p_arg;
 16.2887 ++
 16.2888 ++  int n_gpr = 0;
 16.2889 ++  int n_fpr = 0;
 16.2890 ++  int n_ov = 0;
 16.2891 ++
 16.2892 ++  ffi_type **ptr;
 16.2893 ++  int i;
 16.2894 ++
 16.2895 ++  /* Allocate buffer for argument list pointers.  */
 16.2896 ++
 16.2897 ++  p_arg = avalue = alloca (closure->cif->nargs * sizeof (void *));
 16.2898 ++
 16.2899 ++  /* If we returning a structure, pass the structure address 
 16.2900 ++     directly to the target function.  Otherwise, have the target 
 16.2901 ++     function store the return value to the GPR save area.  */
 16.2902 ++
 16.2903 ++  if (closure->cif->flags == FFI390_RET_STRUCT)
 16.2904 ++    rvalue = (void *) p_gpr[n_gpr++];
 16.2905 ++
 16.2906 ++  /* Now for the arguments.  */
 16.2907 ++
 16.2908 ++  for (ptr = closure->cif->arg_types, i = closure->cif->nargs;
 16.2909 ++       i > 0;
 16.2910 ++       i--, p_arg++, ptr++)
 16.2911 ++    {
 16.2912 ++      int deref_struct_pointer = 0;
 16.2913 ++      int type = (*ptr)->type;
 16.2914 ++
 16.2915 ++      /* Check how a structure type is passed.  */
 16.2916 ++      if (type == FFI_TYPE_STRUCT)
 16.2917 ++	{
 16.2918 ++	  type = ffi_check_struct_type (*ptr);
 16.2919 ++
 16.2920 ++	  /* If we pass the struct via pointer, remember to 
 16.2921 ++	     retrieve the pointer later.  */
 16.2922 ++	  if (type == FFI_TYPE_POINTER)
 16.2923 ++	    deref_struct_pointer = 1;
 16.2924 ++	}
 16.2925 ++
 16.2926 ++      /* Pointers are passed like UINTs of the same size.  */
 16.2927 ++      if (type == FFI_TYPE_POINTER)
 16.2928 ++#ifdef __s390x__
 16.2929 ++	type = FFI_TYPE_UINT64;
 16.2930 ++#else
 16.2931 ++	type = FFI_TYPE_UINT32;
 16.2932 ++#endif
 16.2933 ++
 16.2934 ++      /* Now handle all primitive int/float data types.  */
 16.2935 ++      switch (type) 
 16.2936 ++	{
 16.2937 ++	  case FFI_TYPE_DOUBLE:
 16.2938 ++	    if (n_fpr < MAX_FPRARGS)
 16.2939 ++	      *p_arg = &p_fpr[n_fpr++];
 16.2940 ++	    else
 16.2941 ++	      *p_arg = &p_ov[n_ov], 
 16.2942 ++	      n_ov += sizeof (double) / sizeof (long);
 16.2943 ++	    break;
 16.2944 ++	
 16.2945 ++	  case FFI_TYPE_FLOAT:
 16.2946 ++	    if (n_fpr < MAX_FPRARGS)
 16.2947 ++	      *p_arg = &p_fpr[n_fpr++];
 16.2948 ++	    else
 16.2949 ++	      *p_arg = (char *)&p_ov[n_ov++] + sizeof (long) - 4;
 16.2950 ++	    break;
 16.2951 ++ 
 16.2952 ++	  case FFI_TYPE_UINT64:
 16.2953 ++	  case FFI_TYPE_SINT64:
 16.2954 ++#ifdef __s390x__
 16.2955 ++	    if (n_gpr < MAX_GPRARGS)
 16.2956 ++	      *p_arg = &p_gpr[n_gpr++];
 16.2957 ++	    else
 16.2958 ++	      *p_arg = &p_ov[n_ov++];
 16.2959 ++#else
 16.2960 ++	    if (n_gpr == MAX_GPRARGS-1)
 16.2961 ++	      n_gpr = MAX_GPRARGS;
 16.2962 ++	    if (n_gpr < MAX_GPRARGS)
 16.2963 ++	      *p_arg = &p_gpr[n_gpr], n_gpr += 2;
 16.2964 ++	    else
 16.2965 ++	      *p_arg = &p_ov[n_ov], n_ov += 2;
 16.2966 ++#endif
 16.2967 ++	    break;
 16.2968 ++ 
 16.2969 ++	  case FFI_TYPE_INT:
 16.2970 ++	  case FFI_TYPE_UINT32:
 16.2971 ++	  case FFI_TYPE_SINT32:
 16.2972 ++	    if (n_gpr < MAX_GPRARGS)
 16.2973 ++	      *p_arg = (char *)&p_gpr[n_gpr++] + sizeof (long) - 4;
 16.2974 ++	    else
 16.2975 ++	      *p_arg = (char *)&p_ov[n_ov++] + sizeof (long) - 4;
 16.2976 ++	    break;
 16.2977 ++ 
 16.2978 ++	  case FFI_TYPE_UINT16:
 16.2979 ++	  case FFI_TYPE_SINT16:
 16.2980 ++	    if (n_gpr < MAX_GPRARGS)
 16.2981 ++	      *p_arg = (char *)&p_gpr[n_gpr++] + sizeof (long) - 2;
 16.2982 ++	    else
 16.2983 ++	      *p_arg = (char *)&p_ov[n_ov++] + sizeof (long) - 2;
 16.2984 ++	    break;
 16.2985 ++
 16.2986 ++	  case FFI_TYPE_UINT8:
 16.2987 ++	  case FFI_TYPE_SINT8:
 16.2988 ++	    if (n_gpr < MAX_GPRARGS)
 16.2989 ++	      *p_arg = (char *)&p_gpr[n_gpr++] + sizeof (long) - 1;
 16.2990 ++	    else
 16.2991 ++	      *p_arg = (char *)&p_ov[n_ov++] + sizeof (long) - 1;
 16.2992 ++	    break;
 16.2993 ++ 
 16.2994 ++	  default:
 16.2995 ++	    FFI_ASSERT (0);
 16.2996 ++	    break;
 16.2997 ++        }
 16.2998 ++
 16.2999 ++      /* If this is a struct passed via pointer, we need to
 16.3000 ++	 actually retrieve that pointer.  */
 16.3001 ++      if (deref_struct_pointer)
 16.3002 ++	*p_arg = *(void **)*p_arg;
 16.3003 ++    }
 16.3004 ++
 16.3005 ++
 16.3006 ++  /* Call the target function.  */
 16.3007 ++  (closure->fun) (closure->cif, rvalue, avalue, closure->user_data);
 16.3008 ++
 16.3009 ++  /* Convert the return value.  */
 16.3010 ++  switch (closure->cif->rtype->type)
 16.3011 ++    {
 16.3012 ++      /* Void is easy, and so is struct.  */
 16.3013 ++      case FFI_TYPE_VOID:
 16.3014 ++      case FFI_TYPE_STRUCT:
 16.3015 ++	break;
 16.3016 ++
 16.3017 ++      /* Floating point values are returned in fpr 0.  */
 16.3018 ++      case FFI_TYPE_FLOAT:
 16.3019 ++	p_fpr[0] = (long long) *(unsigned int *) rvalue << 32;
 16.3020 ++	break;
 16.3021 ++
 16.3022 ++      case FFI_TYPE_DOUBLE:
 16.3023 ++	p_fpr[0] = *(unsigned long long *) rvalue;
 16.3024 ++	break;
 16.3025 ++
 16.3026 ++      /* Integer values are returned in gpr 2 (and gpr 3
 16.3027 ++	 for 64-bit values on 31-bit machines).  */
 16.3028 ++      case FFI_TYPE_UINT64:
 16.3029 ++      case FFI_TYPE_SINT64:
 16.3030 ++#ifdef __s390x__
 16.3031 ++	p_gpr[0] = *(unsigned long *) rvalue;
 16.3032 ++#else
 16.3033 ++	p_gpr[0] = ((unsigned long *) rvalue)[0],
 16.3034 ++	p_gpr[1] = ((unsigned long *) rvalue)[1];
 16.3035 ++#endif
 16.3036 ++	break;
 16.3037 ++
 16.3038 ++      case FFI_TYPE_POINTER:
 16.3039 ++      case FFI_TYPE_UINT32:
 16.3040 ++      case FFI_TYPE_UINT16:
 16.3041 ++      case FFI_TYPE_UINT8:
 16.3042 ++	p_gpr[0] = *(unsigned long *) rvalue;
 16.3043 ++	break;
 16.3044 ++
 16.3045 ++      case FFI_TYPE_INT:
 16.3046 ++      case FFI_TYPE_SINT32:
 16.3047 ++      case FFI_TYPE_SINT16:
 16.3048 ++      case FFI_TYPE_SINT8:
 16.3049 ++	p_gpr[0] = *(signed long *) rvalue;
 16.3050 ++	break;
 16.3051 ++
 16.3052 ++      default:
 16.3053 ++        FFI_ASSERT (0);
 16.3054 ++        break;
 16.3055 ++    }
 16.3056 ++}
 16.3057 ++ 
 16.3058 ++/*======================== End of Routine ============================*/
 16.3059 ++
 16.3060 ++/*====================================================================*/
 16.3061 ++/*                                                                    */
 16.3062 ++/* Name     - ffi_prep_closure.                                       */
 16.3063 ++/*                                                                    */
 16.3064 ++/* Function - Prepare a FFI closure.                                  */
 16.3065 ++/*                                                                    */
 16.3066 ++/*====================================================================*/
 16.3067 ++ 
 16.3068 ++ffi_status
 16.3069 ++ffi_prep_closure (ffi_closure *closure,
 16.3070 ++                  ffi_cif *cif,
 16.3071 ++                  void (*fun) (ffi_cif *, void *, void **, void *),
 16.3072 ++                  void *user_data)
 16.3073 ++{
 16.3074 ++  FFI_ASSERT (cif->abi == FFI_SYSV);
 16.3075 ++
 16.3076 ++#ifndef __s390x__
 16.3077 ++  *(short *)&closure->tramp [0] = 0x0d10;   /* basr %r1,0 */
 16.3078 ++  *(short *)&closure->tramp [2] = 0x9801;   /* lm %r0,%r1,6(%r1) */
 16.3079 ++  *(short *)&closure->tramp [4] = 0x1006;
 16.3080 ++  *(short *)&closure->tramp [6] = 0x07f1;   /* br %r1 */
 16.3081 ++  *(long  *)&closure->tramp [8] = (long)closure;
 16.3082 ++  *(long  *)&closure->tramp[12] = (long)&ffi_closure_SYSV;
 16.3083 ++#else
 16.3084 ++  *(short *)&closure->tramp [0] = 0x0d10;   /* basr %r1,0 */
 16.3085 ++  *(short *)&closure->tramp [2] = 0xeb01;   /* lmg %r0,%r1,14(%r1) */
 16.3086 ++  *(short *)&closure->tramp [4] = 0x100e;
 16.3087 ++  *(short *)&closure->tramp [6] = 0x0004;
 16.3088 ++  *(short *)&closure->tramp [8] = 0x07f1;   /* br %r1 */
 16.3089 ++  *(long  *)&closure->tramp[16] = (long)closure;
 16.3090 ++  *(long  *)&closure->tramp[24] = (long)&ffi_closure_SYSV;
 16.3091 ++#endif 
 16.3092 ++ 
 16.3093 ++  closure->cif = cif;
 16.3094 ++  closure->user_data = user_data;
 16.3095 ++  closure->fun = fun;
 16.3096 ++ 
 16.3097 ++  return FFI_OK;
 16.3098 ++}
 16.3099 ++
 16.3100 ++/*======================== End of Routine ============================*/
 16.3101 ++ 
 16.3102 +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/s390/sysv.S gcc/libffi/src/s390/sysv.S
 16.3103 +--- gcc-3.2.2.orig/libffi/src/s390/sysv.S	Thu Jan  1 09:00:00 1970
 16.3104 ++++ gcc/libffi/src/s390/sysv.S	Thu Nov 28 01:44:35 2002
 16.3105 +@@ -0,0 +1,425 @@
 16.3106 ++/* -----------------------------------------------------------------------
 16.3107 ++   sysv.S - Copyright (c) 2000 Software AG
 16.3108 ++ 
 16.3109 ++   S390 Foreign Function Interface
 16.3110 ++ 
 16.3111 ++   Permission is hereby granted, free of charge, to any person obtaining
 16.3112 ++   a copy of this software and associated documentation files (the
 16.3113 ++   ``Software''), to deal in the Software without restriction, including
 16.3114 ++   without limitation the rights to use, copy, modify, merge, publish,
 16.3115 ++   distribute, sublicense, and/or sell copies of the Software, and to
 16.3116 ++   permit persons to whom the Software is furnished to do so, subject to
 16.3117 ++   the following conditions:
 16.3118 ++ 
 16.3119 ++   The above copyright notice and this permission notice shall be included
 16.3120 ++   in all copies or substantial portions of the Software.
 16.3121 ++ 
 16.3122 ++   THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
 16.3123 ++   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 16.3124 ++   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 16.3125 ++   IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR
 16.3126 ++   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 16.3127 ++   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 16.3128 ++   OTHER DEALINGS IN THE SOFTWARE.
 16.3129 ++   ----------------------------------------------------------------------- */
 16.3130 ++
 16.3131 ++#ifndef __s390x__
 16.3132 ++ 
 16.3133 ++.text
 16.3134 ++
 16.3135 ++	# r2:	cif->bytes
 16.3136 ++	# r3:	&ecif
 16.3137 ++	# r4:	ffi_prep_args
 16.3138 ++	# r5:	ret_type
 16.3139 ++	# r6:	ecif.rvalue
 16.3140 ++	# ov:	fn 
 16.3141 ++ 
 16.3142 ++	# This assumes we are using gas.
 16.3143 ++	.globl	ffi_call_SYSV
 16.3144 ++	.type	ffi_call_SYSV,%function
 16.3145 ++ffi_call_SYSV:
 16.3146 ++.LFB1:
 16.3147 ++	stm	%r6,%r15,24(%r15)		# Save registers
 16.3148 ++.LCFI0:
 16.3149 ++	basr	%r13,0				# Set up base register
 16.3150 ++.Lbase:
 16.3151 ++	lr	%r11,%r15			# Set up frame pointer
 16.3152 ++.LCFI1:
 16.3153 ++	sr	%r15,%r2
 16.3154 ++	ahi	%r15,-96-48			# Allocate stack
 16.3155 ++	lr	%r8,%r6				# Save ecif.rvalue
 16.3156 ++	sr	%r9,%r9
 16.3157 ++	ic	%r9,.Ltable-.Lbase(%r13,%r5)	# Load epilog address
 16.3158 ++	l	%r7,96(%r11)			# Load function address
 16.3159 ++	st	%r11,0(%r15)			# Set up back chain
 16.3160 ++	ahi	%r11,-48			# Register save area
 16.3161 ++.LCFI2:
 16.3162 ++
 16.3163 ++	la	%r2,96(%r15)			# Save area
 16.3164 ++						# r3 already holds &ecif
 16.3165 ++	basr	%r14,%r4			# Call ffi_prep_args
 16.3166 ++
 16.3167 ++	lm	%r2,%r6,0(%r11)			# Load arguments
 16.3168 ++	ld	%f0,32(%r11)
 16.3169 ++	ld	%f2,40(%r11)
 16.3170 ++	la	%r14,0(%r13,%r9)		# Set return address
 16.3171 ++	br	%r7				# ... and call function
 16.3172 ++
 16.3173 ++.LretNone:					# Return void
 16.3174 ++	l	%r4,48+56(%r11)
 16.3175 ++	lm	%r6,%r15,48+24(%r11)
 16.3176 ++	br	%r4
 16.3177 ++
 16.3178 ++.LretFloat:
 16.3179 ++	l	%r4,48+56(%r11)
 16.3180 ++	ste	%f0,0(%r8)			# Return float
 16.3181 ++	lm	%r6,%r15,48+24(%r11)
 16.3182 ++	br	%r4
 16.3183 ++ 
 16.3184 ++.LretDouble:
 16.3185 ++	l	%r4,48+56(%r11)
 16.3186 ++	std	%f0,0(%r8)			# Return double
 16.3187 ++	lm	%r6,%r15,48+24(%r11)
 16.3188 ++	br	%r4
 16.3189 ++
 16.3190 ++.LretInt32:
 16.3191 ++	l	%r4,48+56(%r11)
 16.3192 ++	st	%r2,0(%r8)			# Return int
 16.3193 ++	lm	%r6,%r15,48+24(%r11)
 16.3194 ++	br	%r4
 16.3195 ++ 
 16.3196 ++.LretInt64:
 16.3197 ++	l	%r4,48+56(%r11)
 16.3198 ++	stm	%r2,%r3,0(%r8)			# Return long long
 16.3199 ++	lm	%r6,%r15,48+24(%r11)
 16.3200 ++	br	%r4
 16.3201 ++ 
 16.3202 ++.Ltable:
 16.3203 ++	.byte	.LretNone-.Lbase		# FFI390_RET_VOID
 16.3204 ++	.byte	.LretNone-.Lbase		# FFI390_RET_STRUCT
 16.3205 ++	.byte	.LretFloat-.Lbase		# FFI390_RET_FLOAT
 16.3206 ++	.byte	.LretDouble-.Lbase		# FFI390_RET_DOUBLE
 16.3207 ++	.byte	.LretInt32-.Lbase		# FFI390_RET_INT32
 16.3208 ++	.byte	.LretInt64-.Lbase		# FFI390_RET_INT64
 16.3209 ++
 16.3210 ++.LFE1: 
 16.3211 ++.ffi_call_SYSV_end:
 16.3212 ++	.size	 ffi_call_SYSV,.ffi_call_SYSV_end-ffi_call_SYSV
 16.3213 ++
 16.3214 ++
 16.3215 ++	.globl	ffi_closure_SYSV
 16.3216 ++	.type	ffi_closure_SYSV,%function
 16.3217 ++ffi_closure_SYSV:
 16.3218 ++.LFB2:
 16.3219 ++	stm	%r12,%r15,48(%r15)		# Save registers
 16.3220 ++.LCFI10:
 16.3221 ++	basr	%r13,0				# Set up base register
 16.3222 ++.Lcbase:
 16.3223 ++	stm	%r2,%r6,8(%r15)			# Save arguments
 16.3224 ++	std	%f0,64(%r15)
 16.3225 ++	std	%f2,72(%r15)
 16.3226 ++	lr	%r1,%r15			# Set up stack frame
 16.3227 ++	ahi	%r15,-96
 16.3228 ++.LCFI11:
 16.3229 ++	l	%r12,.Lchelper-.Lcbase(%r13)	# Get helper function
 16.3230 ++	lr	%r2,%r0				# Closure
 16.3231 ++	la	%r3,8(%r1)			# GPRs
 16.3232 ++	la	%r4,64(%r1)			# FPRs
 16.3233 ++	la	%r5,96(%r1)			# Overflow
 16.3234 ++	st	%r1,0(%r15)			# Set up back chain
 16.3235 ++
 16.3236 ++	bas	%r14,0(%r12,%r13)		# Call helper
 16.3237 ++
 16.3238 ++	l	%r4,96+56(%r15)
 16.3239 ++	ld	%f0,96+64(%r15)			# Load return registers
 16.3240 ++	lm	%r2,%r3,96+8(%r15)
 16.3241 ++	lm	%r12,%r15,96+48(%r15)
 16.3242 ++	br	%r4
 16.3243 ++
 16.3244 ++	.align 4
 16.3245 ++.Lchelper:
 16.3246 ++	.long	ffi_closure_helper_SYSV-.Lcbase
 16.3247 ++
 16.3248 ++.LFE2: 
 16.3249 ++
 16.3250 ++.ffi_closure_SYSV_end:
 16.3251 ++	.size	 ffi_closure_SYSV,.ffi_closure_SYSV_end-ffi_closure_SYSV
 16.3252 ++
 16.3253 ++
 16.3254 ++	.section	.eh_frame,"a",@progbits
 16.3255 ++.Lframe1:
 16.3256 ++	.4byte	.LECIE1-.LSCIE1	# Length of Common Information Entry
 16.3257 ++.LSCIE1:
 16.3258 ++	.4byte	0x0	# CIE Identifier Tag
 16.3259 ++	.byte	0x1	# CIE Version
 16.3260 ++	.ascii "zR\0"	# CIE Augmentation
 16.3261 ++	.uleb128 0x1	# CIE Code Alignment Factor
 16.3262 ++	.sleb128 -4	# CIE Data Alignment Factor
 16.3263 ++	.byte	0xe	# CIE RA Column
 16.3264 ++	.uleb128 0x1	# Augmentation size
 16.3265 ++	.byte	0x1b	# FDE Encoding (pcrel sdata4)
 16.3266 ++	.byte	0xc	# DW_CFA_def_cfa
 16.3267 ++	.uleb128 0xf
 16.3268 ++	.uleb128 0x60
 16.3269 ++	.align	4
 16.3270 ++.LECIE1:
 16.3271 ++.LSFDE1:
 16.3272 ++	.4byte	.LEFDE1-.LASFDE1	# FDE Length
 16.3273 ++.LASFDE1:
 16.3274 ++	.4byte	.LASFDE1-.Lframe1	# FDE CIE offset
 16.3275 ++	.4byte	.LFB1-.	# FDE initial location
 16.3276 ++	.4byte	.LFE1-.LFB1	# FDE address range
 16.3277 ++	.uleb128 0x0	# Augmentation size
 16.3278 ++	.byte	0x4	# DW_CFA_advance_loc4
 16.3279 ++	.4byte	.LCFI0-.LFB1
 16.3280 ++	.byte	0x8f	# DW_CFA_offset, column 0xf
 16.3281 ++	.uleb128 0x9
 16.3282 ++	.byte	0x8e	# DW_CFA_offset, column 0xe
 16.3283 ++	.uleb128 0xa
 16.3284 ++	.byte	0x8d	# DW_CFA_offset, column 0xd
 16.3285 ++	.uleb128 0xb
 16.3286 ++	.byte	0x8c	# DW_CFA_offset, column 0xc
 16.3287 ++	.uleb128 0xc
 16.3288 ++	.byte	0x8b	# DW_CFA_offset, column 0xb
 16.3289 ++	.uleb128 0xd
 16.3290 ++	.byte	0x8a	# DW_CFA_offset, column 0xa
 16.3291 ++	.uleb128 0xe
 16.3292 ++	.byte	0x89	# DW_CFA_offset, column 0x9
 16.3293 ++	.uleb128 0xf
 16.3294 ++	.byte	0x88	# DW_CFA_offset, column 0x8
 16.3295 ++	.uleb128 0x10
 16.3296 ++	.byte	0x87	# DW_CFA_offset, column 0x7
 16.3297 ++	.uleb128 0x11
 16.3298 ++	.byte	0x86	# DW_CFA_offset, column 0x6
 16.3299 ++	.uleb128 0x12
 16.3300 ++	.byte	0x4	# DW_CFA_advance_loc4
 16.3301 ++	.4byte	.LCFI1-.LCFI0
 16.3302 ++	.byte	0xd	# DW_CFA_def_cfa_register
 16.3303 ++	.uleb128 0xb
 16.3304 ++	.byte	0x4	# DW_CFA_advance_loc4
 16.3305 ++	.4byte	.LCFI2-.LCFI1
 16.3306 ++	.byte	0xe	# DW_CFA_def_cfa_offset
 16.3307 ++	.uleb128 0x90
 16.3308 ++	.align	4
 16.3309 ++.LEFDE1:
 16.3310 ++.LSFDE2:
 16.3311 ++	.4byte	.LEFDE2-.LASFDE2	# FDE Length
 16.3312 ++.LASFDE2:
 16.3313 ++	.4byte	.LASFDE2-.Lframe1	# FDE CIE offset
 16.3314 ++	.4byte	.LFB2-.	# FDE initial location
 16.3315 ++	.4byte	.LFE2-.LFB2	# FDE address range
 16.3316 ++	.uleb128 0x0	# Augmentation size
 16.3317 ++	.byte	0x4	# DW_CFA_advance_loc4
 16.3318 ++	.4byte	.LCFI10-.LFB2
 16.3319 ++	.byte	0x8f	# DW_CFA_offset, column 0xf
 16.3320 ++	.uleb128 0x9
 16.3321 ++	.byte	0x8e	# DW_CFA_offset, column 0xe
 16.3322 ++	.uleb128 0xa
 16.3323 ++	.byte	0x8d	# DW_CFA_offset, column 0xd
 16.3324 ++	.uleb128 0xb
 16.3325 ++	.byte	0x8c	# DW_CFA_offset, column 0xc
 16.3326 ++	.uleb128 0xc
 16.3327 ++	.byte	0x4	# DW_CFA_advance_loc4
 16.3328 ++	.4byte	.LCFI11-.LCFI10
 16.3329 ++	.byte	0xe	# DW_CFA_def_cfa_offset
 16.3330 ++	.uleb128 0xc0
 16.3331 ++	.align	4
 16.3332 ++.LEFDE2:
 16.3333 ++
 16.3334 ++#else
 16.3335 ++ 
 16.3336 ++.text
 16.3337 ++ 
 16.3338 ++	# r2:	cif->bytes
 16.3339 ++	# r3:	&ecif
 16.3340 ++	# r4:	ffi_prep_args
 16.3341 ++	# r5:	ret_type
 16.3342 ++	# r6:	ecif.rvalue
 16.3343 ++	# ov:	fn 
 16.3344 ++ 
 16.3345 ++	# This assumes we are using gas.
 16.3346 ++	.globl	ffi_call_SYSV
 16.3347 ++	.type	ffi_call_SYSV,%function
 16.3348 ++ffi_call_SYSV:
 16.3349 ++.LFB1:
 16.3350 ++	stmg	%r6,%r15,48(%r15)		# Save registers
 16.3351 ++.LCFI0:
 16.3352 ++	larl	%r13,.Lbase			# Set up base register
 16.3353 ++	lgr	%r11,%r15			# Set up frame pointer
 16.3354 ++.LCFI1:
 16.3355 ++	sgr	%r15,%r2
 16.3356 ++	aghi	%r15,-160-80			# Allocate stack
 16.3357 ++	lgr	%r8,%r6				# Save ecif.rvalue
 16.3358 ++	llgc	%r9,.Ltable-.Lbase(%r13,%r5)	# Load epilog address
 16.3359 ++	lg	%r7,160(%r11)			# Load function address
 16.3360 ++	stg	%r11,0(%r15)			# Set up back chain
 16.3361 ++	aghi	%r11,-80			# Register save area
 16.3362 ++.LCFI2:
 16.3363 ++
 16.3364 ++	la	%r2,160(%r15)			# Save area
 16.3365 ++						# r3 already holds &ecif
 16.3366 ++	basr	%r14,%r4			# Call ffi_prep_args
 16.3367 ++
 16.3368 ++	lmg	%r2,%r6,0(%r11)			# Load arguments
 16.3369 ++	ld	%f0,48(%r11)
 16.3370 ++	ld	%f2,56(%r11)
 16.3371 ++	ld	%f4,64(%r11)
 16.3372 ++	ld	%f6,72(%r11)
 16.3373 ++	la	%r14,0(%r13,%r9)		# Set return address
 16.3374 ++	br	%r7				# ... and call function
 16.3375 ++
 16.3376 ++.Lbase:
 16.3377 ++.LretNone:					# Return void
 16.3378 ++	lg	%r4,80+112(%r11)
 16.3379 ++	lmg	%r6,%r15,80+48(%r11)
 16.3380 ++	br	%r4
 16.3381 ++
 16.3382 ++.LretFloat:
 16.3383 ++	lg	%r4,80+112(%r11)
 16.3384 ++	ste	%f0,0(%r8)			# Return float
 16.3385 ++	lmg	%r6,%r15,80+48(%r11)
 16.3386 ++	br	%r4
 16.3387 ++ 
 16.3388 ++.LretDouble:
 16.3389 ++	lg	%r4,80+112(%r11)
 16.3390 ++	std	%f0,0(%r8)			# Return double
 16.3391 ++	lmg	%r6,%r15,80+48(%r11)
 16.3392 ++	br	%r4
 16.3393 ++
 16.3394 ++.LretInt32:
 16.3395 ++	lg	%r4,80+112(%r11)
 16.3396 ++	st	%r2,0(%r8)			# Return int
 16.3397 ++	lmg	%r6,%r15,80+48(%r11)
 16.3398 ++	br	%r4
 16.3399 ++ 
 16.3400 ++.LretInt64:
 16.3401 ++	lg	%r4,80+112(%r11)
 16.3402 ++	stg	%r2,0(%r8)			# Return long
 16.3403 ++	lmg	%r6,%r15,80+48(%r11)
 16.3404 ++	br	%r4
 16.3405 ++ 
 16.3406 ++.Ltable:
 16.3407 ++	.byte	.LretNone-.Lbase		# FFI390_RET_VOID
 16.3408 ++	.byte	.LretNone-.Lbase		# FFI390_RET_STRUCT
 16.3409 ++	.byte	.LretFloat-.Lbase		# FFI390_RET_FLOAT
 16.3410 ++	.byte	.LretDouble-.Lbase		# FFI390_RET_DOUBLE
 16.3411 ++	.byte	.LretInt32-.Lbase		# FFI390_RET_INT32
 16.3412 ++	.byte	.LretInt64-.Lbase		# FFI390_RET_INT64
 16.3413 ++
 16.3414 ++.LFE1: 
 16.3415 ++.ffi_call_SYSV_end:
 16.3416 ++	.size	 ffi_call_SYSV,.ffi_call_SYSV_end-ffi_call_SYSV
 16.3417 ++
 16.3418 ++
 16.3419 ++	.globl	ffi_closure_SYSV
 16.3420 ++	.type	ffi_closure_SYSV,%function
 16.3421 ++ffi_closure_SYSV:
 16.3422 ++.LFB2:
 16.3423 ++	stmg	%r14,%r15,112(%r15)		# Save registers
 16.3424 ++.LCFI10:
 16.3425 ++	stmg	%r2,%r6,16(%r15)		# Save arguments
 16.3426 ++	std	%f0,128(%r15)
 16.3427 ++	std	%f2,136(%r15)
 16.3428 ++	std	%f4,144(%r15)
 16.3429 ++	std	%f6,152(%r15)
 16.3430 ++	lgr	%r1,%r15			# Set up stack frame
 16.3431 ++	aghi	%r15,-160
 16.3432 ++.LCFI11:
 16.3433 ++	lgr	%r2,%r0				# Closure
 16.3434 ++	la	%r3,16(%r1)			# GPRs
 16.3435 ++	la	%r4,128(%r1)			# FPRs
 16.3436 ++	la	%r5,160(%r1)			# Overflow
 16.3437 ++	stg	%r1,0(%r15)			# Set up back chain
 16.3438 ++
 16.3439 ++	brasl	%r14,ffi_closure_helper_SYSV	# Call helper
 16.3440 ++
 16.3441 ++	lg	%r14,160+112(%r15)
 16.3442 ++	ld	%f0,160+128(%r15)		# Load return registers
 16.3443 ++	lg	%r2,160+16(%r15)
 16.3444 ++	la	%r15,160(%r15)
 16.3445 ++	br	%r14
 16.3446 ++.LFE2: 
 16.3447 ++
 16.3448 ++.ffi_closure_SYSV_end:
 16.3449 ++	.size	 ffi_closure_SYSV,.ffi_closure_SYSV_end-ffi_closure_SYSV
 16.3450 ++
 16.3451 ++
 16.3452 ++
 16.3453 ++	.section	.eh_frame,"a",@progbits
 16.3454 ++.Lframe1:
 16.3455 ++	.4byte	.LECIE1-.LSCIE1	# Length of Common Information Entry
 16.3456 ++.LSCIE1:
 16.3457 ++	.4byte	0x0	# CIE Identifier Tag
 16.3458 ++	.byte	0x1	# CIE Version
 16.3459 ++	.ascii "zR\0"	# CIE Augmentation
 16.3460 ++	.uleb128 0x1	# CIE Code Alignment Factor
 16.3461 ++	.sleb128 -8	# CIE Data Alignment Factor
 16.3462 ++	.byte	0xe	# CIE RA Column
 16.3463 ++	.uleb128 0x1	# Augmentation size
 16.3464 ++	.byte	0x1b	# FDE Encoding (pcrel sdata4)
 16.3465 ++	.byte	0xc	# DW_CFA_def_cfa
 16.3466 ++	.uleb128 0xf
 16.3467 ++	.uleb128 0xa0
 16.3468 ++	.align	8
 16.3469 ++.LECIE1:
 16.3470 ++.LSFDE1:
 16.3471 ++	.4byte	.LEFDE1-.LASFDE1	# FDE Length
 16.3472 ++.LASFDE1:
 16.3473 ++	.4byte	.LASFDE1-.Lframe1	# FDE CIE offset
 16.3474 ++	.4byte	.LFB1-.	# FDE initial location
 16.3475 ++	.4byte	.LFE1-.LFB1	# FDE address range
 16.3476 ++	.uleb128 0x0	# Augmentation size
 16.3477 ++	.byte	0x4	# DW_CFA_advance_loc4
 16.3478 ++	.4byte	.LCFI0-.LFB1
 16.3479 ++	.byte	0x8f	# DW_CFA_offset, column 0xf
 16.3480 ++	.uleb128 0x5
 16.3481 ++	.byte	0x8e	# DW_CFA_offset, column 0xe
 16.3482 ++	.uleb128 0x6
 16.3483 ++	.byte	0x8d	# DW_CFA_offset, column 0xd
 16.3484 ++	.uleb128 0x7
 16.3485 ++	.byte	0x8c	# DW_CFA_offset, column 0xc
 16.3486 ++	.uleb128 0x8
 16.3487 ++	.byte	0x8b	# DW_CFA_offset, column 0xb
 16.3488 ++	.uleb128 0x9
 16.3489 ++	.byte	0x8a	# DW_CFA_offset, column 0xa
 16.3490 ++	.uleb128 0xa
 16.3491 ++	.byte	0x89	# DW_CFA_offset, column 0x9
 16.3492 ++	.uleb128 0xb
 16.3493 ++	.byte	0x88	# DW_CFA_offset, column 0x8
 16.3494 ++	.uleb128 0xc
 16.3495 ++	.byte	0x87	# DW_CFA_offset, column 0x7
 16.3496 ++	.uleb128 0xd
 16.3497 ++	.byte	0x86	# DW_CFA_offset, column 0x6
 16.3498 ++	.uleb128 0xe
 16.3499 ++	.byte	0x4	# DW_CFA_advance_loc4
 16.3500 ++	.4byte	.LCFI1-.LCFI0
 16.3501 ++	.byte	0xd	# DW_CFA_def_cfa_register
 16.3502 ++	.uleb128 0xb
 16.3503 ++	.byte	0x4	# DW_CFA_advance_loc4
 16.3504 ++	.4byte	.LCFI2-.LCFI1
 16.3505 ++	.byte	0xe	# DW_CFA_def_cfa_offset
 16.3506 ++	.uleb128 0xf0
 16.3507 ++	.align	8
 16.3508 ++.LEFDE1:
 16.3509 ++.LSFDE2:
 16.3510 ++	.4byte	.LEFDE2-.LASFDE2	# FDE Length
 16.3511 ++.LASFDE2:
 16.3512 ++	.4byte	.LASFDE2-.Lframe1	# FDE CIE offset
 16.3513 ++	.4byte	.LFB2-.	# FDE initial location
 16.3514 ++	.4byte	.LFE2-.LFB2	# FDE address range
 16.3515 ++	.uleb128 0x0	# Augmentation size
 16.3516 ++	.byte	0x4	# DW_CFA_advance_loc4
 16.3517 ++	.4byte	.LCFI10-.LFB2
 16.3518 ++	.byte	0x8f	# DW_CFA_offset, column 0xf
 16.3519 ++	.uleb128 0x5
 16.3520 ++	.byte	0x8e	# DW_CFA_offset, column 0xe
 16.3521 ++	.uleb128 0x6
 16.3522 ++	.byte	0x4	# DW_CFA_advance_loc4
 16.3523 ++	.4byte	.LCFI11-.LCFI10
 16.3524 ++	.byte	0xe	# DW_CFA_def_cfa_offset
 16.3525 ++	.uleb128 0x140
 16.3526 ++	.align	8
 16.3527 ++.LEFDE2:
 16.3528 ++
 16.3529 ++#endif
 16.3530 ++
 16.3531 +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/sh/ffi.c gcc/libffi/src/sh/ffi.c
 16.3532 +--- gcc-3.2.2.orig/libffi/src/sh/ffi.c	Thu Jan  1 09:00:00 1970
 16.3533 ++++ gcc/libffi/src/sh/ffi.c	Fri Jul 19 10:08:43 2002
 16.3534 +@@ -0,0 +1,722 @@
 16.3535 ++/* -----------------------------------------------------------------------
 16.3536 ++   ffi.c - Copyright (c) 2002 Kaz Kojima
 16.3537 ++   
 16.3538 ++   SuperH Foreign Function Interface 
 16.3539 ++
 16.3540 ++   Permission is hereby granted, free of charge, to any person obtaining
 16.3541 ++   a copy of this software and associated documentation files (the
 16.3542 ++   ``Software''), to deal in the Software without restriction, including
 16.3543 ++   without limitation the rights to use, copy, modify, merge, publish,
 16.3544 ++   distribute, sublicense, and/or sell copies of the Software, and to
 16.3545 ++   permit persons to whom the Software is furnished to do so, subject to
 16.3546 ++   the following conditions:
 16.3547 ++
 16.3548 ++   The above copyright notice and this permission notice shall be included
 16.3549 ++   in all copies or substantial portions of the Software.
 16.3550 ++
 16.3551 ++   THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
 16.3552 ++   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 16.3553 ++   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 16.3554 ++   IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR
 16.3555 ++   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 16.3556 ++   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 16.3557 ++   OTHER DEALINGS IN THE SOFTWARE.
 16.3558 ++   ----------------------------------------------------------------------- */
 16.3559 ++
 16.3560 ++#include <ffi.h>
 16.3561 ++#include <ffi_common.h>
 16.3562 ++
 16.3563 ++#include <stdlib.h>
 16.3564 ++
 16.3565 ++#define NGREGARG 4
 16.3566 ++#if defined(__SH4__)
 16.3567 ++#define NFREGARG 8
 16.3568 ++#endif
 16.3569 ++
 16.3570 ++#if defined(__HITACHI__)
 16.3571 ++#define STRUCT_VALUE_ADDRESS_WITH_ARG 1
 16.3572 ++#else
 16.3573 ++#define STRUCT_VALUE_ADDRESS_WITH_ARG 0
 16.3574 ++#endif
 16.3575 ++
 16.3576 ++/* If the structure has essentialy an unique element, return its type.  */
 16.3577 ++static int
 16.3578 ++simple_type (ffi_type *arg)
 16.3579 ++{
 16.3580 ++  if (arg->type != FFI_TYPE_STRUCT)
 16.3581 ++    return arg->type;
 16.3582 ++  else if (arg->elements[1])
 16.3583 ++    return FFI_TYPE_STRUCT;
 16.3584 ++
 16.3585 ++  return simple_type (arg->elements[0]);
 16.3586 ++}
 16.3587 ++
 16.3588 ++static int
 16.3589 ++return_type (ffi_type *arg)
 16.3590 ++{
 16.3591 ++  unsigned short type;
 16.3592 ++
 16.3593 ++  if (arg->type != FFI_TYPE_STRUCT)
 16.3594 ++    return arg->type;
 16.3595 ++
 16.3596 ++  type = simple_type (arg->elements[0]);
 16.3597 ++  if (! arg->elements[1])
 16.3598 ++    {
 16.3599 ++      switch (type)
 16.3600 ++	{
 16.3601 ++	case FFI_TYPE_SINT8:
 16.3602 ++	case FFI_TYPE_UINT8:
 16.3603 ++	case FFI_TYPE_SINT16:
 16.3604 ++	case FFI_TYPE_UINT16:
 16.3605 ++	case FFI_TYPE_SINT32:
 16.3606 ++	case FFI_TYPE_UINT32:
 16.3607 ++	  return FFI_TYPE_INT;
 16.3608 ++
 16.3609 ++	default:
 16.3610 ++	  return type;
 16.3611 ++	}
 16.3612 ++    }
 16.3613 ++
 16.3614 ++  /* gcc uses r0/r1 pair for some kind of structures.  */
 16.3615 ++  if (arg->size <= 2 * sizeof (int))
 16.3616 ++    {
 16.3617 ++      int i = 0;
 16.3618 ++      ffi_type *e;
 16.3619 ++
 16.3620 ++      while ((e = arg->elements[i++]))
 16.3621 ++	{
 16.3622 ++	  type = simple_type (e);
 16.3623 ++	  switch (type)
 16.3624 ++	    {
 16.3625 ++	    case FFI_TYPE_SINT32:
 16.3626 ++	    case FFI_TYPE_UINT32:
 16.3627 ++	    case FFI_TYPE_INT:
 16.3628 ++	    case FFI_TYPE_FLOAT:
 16.3629 ++	      return FFI_TYPE_UINT64;
 16.3630 ++
 16.3631 ++	    default:
 16.3632 ++	      break;
 16.3633 ++	    }
 16.3634 ++	}
 16.3635 ++    }
 16.3636 ++
 16.3637 ++  return FFI_TYPE_STRUCT;
 16.3638 ++}
 16.3639 ++
 16.3640 ++/* ffi_prep_args is called by the assembly routine once stack space
 16.3641 ++   has been allocated for the function's arguments */
 16.3642 ++
 16.3643 ++/*@-exportheader@*/
 16.3644 ++void ffi_prep_args(char *stack, extended_cif *ecif)
 16.3645 ++/*@=exportheader@*/
 16.3646 ++{
 16.3647 ++  register unsigned int i;
 16.3648 ++  register int tmp;
 16.3649 ++  register unsigned int avn;
 16.3650 ++  register void **p_argv;
 16.3651 ++  register char *argp;
 16.3652 ++  register ffi_type **p_arg;
 16.3653 ++  int greg, ireg;
 16.3654 ++#if defined(__SH4__)
 16.3655 ++  int freg = 0;
 16.3656 ++#endif
 16.3657 ++
 16.3658 ++  tmp = 0;
 16.3659 ++  argp = stack;
 16.3660 ++
 16.3661 ++  if (return_type (ecif->cif->rtype) == FFI_TYPE_STRUCT)
 16.3662 ++    {
 16.3663 ++      *(void **) argp = ecif->rvalue;
 16.3664 ++      argp += 4;
 16.3665 ++      ireg = STRUCT_VALUE_ADDRESS_WITH_ARG ? 1 : 0;
 16.3666 ++    }
 16.3667 ++  else
 16.3668 ++    ireg = 0;
 16.3669 ++
 16.3670 ++  /* Set arguments for registers.  */
 16.3671 ++  greg = ireg;
 16.3672 ++  avn = ecif->cif->nargs;
 16.3673 ++  p_argv = ecif->avalue;
 16.3674 ++
 16.3675 ++  for (i = 0, p_arg = ecif->cif->arg_types; i < avn; i++, p_arg++, p_argv++)
 16.3676 ++    {
 16.3677 ++      size_t z;
 16.3678 ++
 16.3679 ++      z = (*p_arg)->size;
 16.3680 ++      if (z < sizeof(int))
 16.3681 ++	{
 16.3682 ++	  if (greg++ >= NGREGARG)
 16.3683 ++	    continue;
 16.3684 ++
 16.3685 ++	  z = sizeof(int);
 16.3686 ++	  switch ((*p_arg)->type)
 16.3687 ++	    {
 16.3688 ++	    case FFI_TYPE_SINT8:
 16.3689 ++	      *(signed int *) argp = (signed int)*(SINT8 *)(* p_argv);
 16.3690 ++	      break;
 16.3691 ++  
 16.3692 ++	    case FFI_TYPE_UINT8:
 16.3693 ++	      *(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv);
 16.3694 ++	      break;
 16.3695 ++  
 16.3696 ++	    case FFI_TYPE_SINT16:
 16.3697 ++	      *(signed int *) argp = (signed int)*(SINT16 *)(* p_argv);
 16.3698 ++	      break;
 16.3699 ++  
 16.3700 ++	    case FFI_TYPE_UINT16:
 16.3701 ++	      *(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv);
 16.3702 ++	      break;
 16.3703 ++  
 16.3704 ++	    case FFI_TYPE_STRUCT:
 16.3705 ++	      *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv);
 16.3706 ++	      break;
 16.3707 ++
 16.3708 ++	    default:
 16.3709 ++	      FFI_ASSERT(0);
 16.3710 ++	    }
 16.3711 ++	  argp += z;
 16.3712 ++	}
 16.3713 ++      else if (z == sizeof(int))
 16.3714 ++	{
 16.3715 ++#if defined(__SH4__)
 16.3716 ++	  if ((*p_arg)->type == FFI_TYPE_FLOAT)
 16.3717 ++	    {
 16.3718 ++	      if (freg++ >= NFREGARG)
 16.3719 ++		continue;
 16.3720 ++	    }
 16.3721 ++	  else
 16.3722 ++#endif
 16.3723 ++	    {
 16.3724 ++	      if (greg++ >= NGREGARG)
 16.3725 ++		continue;
 16.3726 ++	    }
 16.3727 ++	  *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv);
 16.3728 ++	  argp += z;
 16.3729 ++	}
 16.3730 ++#if defined(__SH4__)
 16.3731 ++      else if ((*p_arg)->type == FFI_TYPE_DOUBLE)
 16.3732 ++	{
 16.3733 ++	  if (freg + 1 >= NFREGARG)
 16.3734 ++	    continue;
 16.3735 ++	  freg = (freg + 1) & ~1;
 16.3736 ++	  freg += 2;
 16.3737 ++	  memcpy (argp, *p_argv, z);
 16.3738 ++	  argp += z;
 16.3739 ++	}
 16.3740 ++#endif
 16.3741 ++      else
 16.3742 ++	{
 16.3743 ++	  int n = (z + sizeof (int) - 1) / sizeof (int);
 16.3744 ++#if defined(__SH4__)
 16.3745 ++	  if (greg + n - 1 >= NGREGARG)
 16.3746 ++	    continue;
 16.3747 ++	  greg += n;
 16.3748 ++#else
 16.3749 ++	  if (greg >= NGREGARG)
 16.3750 ++	    continue;
 16.3751 ++	  else if (greg + n - 1 >= NGREGARG)
 16.3752 ++	    greg = NGREGARG;
 16.3753 ++	  else
 16.3754 ++	    greg += n;
 16.3755 ++#endif
 16.3756 ++	  memcpy (argp, *p_argv, z);
 16.3757 ++	  argp += z;
 16.3758 ++	}
 16.3759 ++    }
 16.3760 ++
 16.3761 ++  /* Set arguments on stack.  */
 16.3762 ++  greg = ireg;
 16.3763 ++#if defined(__SH4__)
 16.3764 ++  freg = 0;
 16.3765 ++#endif
 16.3766 ++  p_argv = ecif->avalue;
 16.3767 ++
 16.3768 ++  for (i = 0, p_arg = ecif->cif->arg_types; i < avn; i++, p_arg++, p_argv++)
 16.3769 ++    {
 16.3770 ++      size_t z;
 16.3771 ++
 16.3772 ++      z = (*p_arg)->size;
 16.3773 ++      if (z < sizeof(int))
 16.3774 ++	{
 16.3775 ++	  if (greg++ < NGREGARG)
 16.3776 ++	    continue;
 16.3777 ++
 16.3778 ++	  z = sizeof(int);
 16.3779 ++	  switch ((*p_arg)->type)
 16.3780 ++	    {
 16.3781 ++	    case FFI_TYPE_SINT8:
 16.3782 ++	      *(signed int *) argp = (signed int)*(SINT8 *)(* p_argv);
 16.3783 ++	      break;
 16.3784 ++  
 16.3785 ++	    case FFI_TYPE_UINT8:
 16.3786 ++	      *(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv);
 16.3787 ++	      break;
 16.3788 ++  
 16.3789 ++	    case FFI_TYPE_SINT16:
 16.3790 ++	      *(signed int *) argp = (signed int)*(SINT16 *)(* p_argv);
 16.3791 ++	      break;
 16.3792 ++  
 16.3793 ++	    case FFI_TYPE_UINT16:
 16.3794 ++	      *(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv);
 16.3795 ++	      break;
 16.3796 ++  
 16.3797 ++	    case FFI_TYPE_STRUCT:
 16.3798 ++	      *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv);
 16.3799 ++	      break;
 16.3800 ++
 16.3801 ++	    default:
 16.3802 ++	      FFI_ASSERT(0);
 16.3803 ++	    }
 16.3804 ++	  argp += z;
 16.3805 ++	}
 16.3806 ++      else if (z == sizeof(int))
 16.3807 ++	{
 16.3808 ++#if defined(__SH4__)
 16.3809 ++	  if ((*p_arg)->type == FFI_TYPE_FLOAT)
 16.3810 ++	    {
 16.3811 ++	      if (freg++ < NFREGARG)
 16.3812 ++		continue;
 16.3813 ++	    }
 16.3814 ++	  else
 16.3815 ++#endif
 16.3816 ++	    {
 16.3817 ++	      if (greg++ < NGREGARG)
 16.3818 ++		continue;
 16.3819 ++	    }
 16.3820 ++	  *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv);
 16.3821 ++	  argp += z;
 16.3822 ++	}
 16.3823 ++#if defined(__SH4__)
 16.3824 ++      else if ((*p_arg)->type == FFI_TYPE_DOUBLE)
 16.3825 ++	{
 16.3826 ++	  if (freg + 1 < NFREGARG)
 16.3827 ++	    {
 16.3828 ++	      freg = (freg + 1) & ~1;
 16.3829 ++	      freg += 2;
 16.3830 ++	      continue;
 16.3831 ++	    }
 16.3832 ++	  memcpy (argp, *p_argv, z);
 16.3833 ++	  argp += z;
 16.3834 ++	}
 16.3835 ++#endif
 16.3836 ++      else
 16.3837 ++	{
 16.3838 ++	  int n = (z + sizeof (int) - 1) / sizeof (int);
 16.3839 ++	  if (greg + n - 1 < NGREGARG)
 16.3840 ++	    {
 16.3841 ++	      greg += n;
 16.3842 ++	      continue;
 16.3843 ++	    }
 16.3844 ++#if (! defined(__SH4__))
 16.3845 ++	  else if (greg < NGREGARG)
 16.3846 ++	    {
 16.3847 ++	      greg = NGREGARG;
 16.3848 ++	      continue;
 16.3849 ++	    }
 16.3850 ++#endif
 16.3851 ++	  memcpy (argp, *p_argv, z);
 16.3852 ++	  argp += z;
 16.3853 ++	}
 16.3854 ++    }
 16.3855 ++
 16.3856 ++  return;
 16.3857 ++}
 16.3858 ++
 16.3859 ++/* Perform machine dependent cif processing */
 16.3860 ++ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
 16.3861 ++{
 16.3862 ++  int i, j;
 16.3863 ++  int size, type;
 16.3864 ++  int n, m;
 16.3865 ++  int greg;
 16.3866 ++#if defined(__SH4__)
 16.3867 ++  int freg = 0;
 16.3868 ++#endif
 16.3869 ++
 16.3870 ++  cif->flags = 0;
 16.3871 ++
 16.3872 ++  greg = ((return_type (cif->rtype) == FFI_TYPE_STRUCT) &&
 16.3873 ++	  STRUCT_VALUE_ADDRESS_WITH_ARG) ? 1 : 0;
 16.3874 ++
 16.3875 ++#if defined(__SH4__)
 16.3876 ++  for (i = j = 0; i < cif->nargs && j < 12; i++)
 16.3877 ++    {
 16.3878 ++      type = (cif->arg_types)[i]->type;
 16.3879 ++      switch (type)
 16.3880 ++	{
 16.3881 ++	case FFI_TYPE_FLOAT:
 16.3882 ++	  if (freg >= NFREGARG)
 16.3883 ++	    continue;
 16.3884 ++	  freg++;
 16.3885 ++	  cif->flags += ((cif->arg_types)[i]->type) << (2 * j);
 16.3886 ++	  j++;
 16.3887 ++	  break;
 16.3888 ++
 16.3889 ++	case FFI_TYPE_DOUBLE:
 16.3890 ++	  if ((freg + 1) >= NFREGARG)
 16.3891 ++	    continue;
 16.3892 ++	  freg = (freg + 1) & ~1;
 16.3893 ++	  freg += 2;
 16.3894 ++	  cif->flags += ((cif->arg_types)[i]->type) << (2 * j);
 16.3895 ++	  j++;
 16.3896 ++	  break;
 16.3897 ++	      
 16.3898 ++	default:
 16.3899 ++	  size = (cif->arg_types)[i]->size;
 16.3900 ++	  n = (size + sizeof (int) - 1) / sizeof (int);
 16.3901 ++	  if (greg + n - 1 >= NGREGARG)
 16.3902 ++		continue;
 16.3903 ++	  greg += n;
 16.3904 ++	  for (m = 0; m < n; m++)
 16.3905 ++	    cif->flags += FFI_TYPE_INT << (2 * j++);
 16.3906 ++	  break;
 16.3907 ++	}
 16.3908 ++    }
 16.3909 ++#else
 16.3910 ++  for (i = j = 0; i < cif->nargs && j < 4; i++)
 16.3911 ++    {
 16.3912 ++      size = (cif->arg_types)[i]->size;
 16.3913 ++      n = (size + sizeof (int) - 1) / sizeof (int);
 16.3914 ++      if (greg >= NGREGARG)
 16.3915 ++	continue;
 16.3916 ++      else if (greg + n - 1 >= NGREGARG)
 16.3917 ++	greg = NGREGARG;
 16.3918 ++      else
 16.3919 ++	greg += n;
 16.3920 ++      for (m = 0; m < n; m++)
 16.3921 ++        cif->flags += FFI_TYPE_INT << (2 * j++);
 16.3922 ++    }
 16.3923 ++#endif
 16.3924 ++
 16.3925 ++  /* Set the return type flag */
 16.3926 ++  switch (cif->rtype->type)
 16.3927 ++    {
 16.3928 ++    case FFI_TYPE_STRUCT:
 16.3929 ++      cif->flags += (unsigned) (return_type (cif->rtype)) << 24;
 16.3930 ++      break;
 16.3931 ++
 16.3932 ++    case FFI_TYPE_VOID:
 16.3933 ++    case FFI_TYPE_FLOAT:
 16.3934 ++    case FFI_TYPE_DOUBLE:
 16.3935 ++    case FFI_TYPE_SINT64:
 16.3936 ++    case FFI_TYPE_UINT64:
 16.3937 ++      cif->flags += (unsigned) cif->rtype->type << 24;
 16.3938 ++      break;
 16.3939 ++
 16.3940 ++    default:
 16.3941 ++      cif->flags += FFI_TYPE_INT << 24;
 16.3942 ++      break;
 16.3943 ++    }
 16.3944 ++
 16.3945 ++  return FFI_OK;
 16.3946 ++}
 16.3947 ++
 16.3948 ++/*@-declundef@*/
 16.3949 ++/*@-exportheader@*/
 16.3950 ++extern void ffi_call_SYSV(void (*)(char *, extended_cif *), 
 16.3951 ++			  /*@out@*/ extended_cif *, 
 16.3952 ++			  unsigned, unsigned, 
 16.3953 ++			  /*@out@*/ unsigned *, 
 16.3954 ++			  void (*fn)());
 16.3955 ++/*@=declundef@*/
 16.3956 ++/*@=exportheader@*/
 16.3957 ++
 16.3958 ++void ffi_call(/*@dependent@*/ ffi_cif *cif, 
 16.3959 ++	      void (*fn)(), 
 16.3960 ++	      /*@out@*/ void *rvalue, 
 16.3961 ++	      /*@dependent@*/ void **avalue)
 16.3962 ++{
 16.3963 ++  extended_cif ecif;
 16.3964 ++
 16.3965 ++  ecif.cif = cif;
 16.3966 ++  ecif.avalue = avalue;
 16.3967 ++  
 16.3968 ++  /* If the return value is a struct and we don't have a return	*/
 16.3969 ++  /* value address then we need to make one		        */
 16.3970 ++
 16.3971 ++  if ((rvalue == NULL) && 
 16.3972 ++      (cif->rtype->type == FFI_TYPE_STRUCT))
 16.3973 ++    {
 16.3974 ++      /*@-sysunrecog@*/
 16.3975 ++      ecif.rvalue = alloca(cif->rtype->size);
 16.3976 ++      /*@=sysunrecog@*/
 16.3977 ++    }
 16.3978 ++  else
 16.3979 ++    ecif.rvalue = rvalue;
 16.3980 ++    
 16.3981 ++
 16.3982 ++  switch (cif->abi) 
 16.3983 ++    {
 16.3984 ++    case FFI_SYSV:
 16.3985 ++      /*@-usedef@*/
 16.3986 ++      ffi_call_SYSV(ffi_prep_args, &ecif, cif->bytes, 
 16.3987 ++		    cif->flags, ecif.rvalue, fn);
 16.3988 ++      /*@=usedef@*/
 16.3989 ++      break;
 16.3990 ++    default:
 16.3991 ++      FFI_ASSERT(0);
 16.3992 ++      break;
 16.3993 ++    }
 16.3994 ++}
 16.3995 ++
 16.3996 ++extern void ffi_closure_SYSV (void);
 16.3997 ++#if defined(__SH4__)
 16.3998 ++extern void __ic_invalidate (void *line);
 16.3999 ++#endif
 16.4000 ++
 16.4001 ++ffi_status
 16.4002 ++ffi_prep_closure (ffi_closure* closure,
 16.4003 ++		  ffi_cif* cif,
 16.4004 ++		  void (*fun)(ffi_cif*, void*, void**, void*),
 16.4005 ++		  void *user_data)
 16.4006 ++{
 16.4007 ++  unsigned int *tramp;
 16.4008 ++
 16.4009 ++  FFI_ASSERT (cif->abi == FFI_GCC_SYSV);
 16.4010 ++
 16.4011 ++  tramp = (unsigned int *) &closure->tramp[0];
 16.4012 ++#ifdef __LITTLE_ENDIAN__
 16.4013 ++  tramp[0] = 0xd301d202;
 16.4014 ++  tramp[1] = 0x0009422b;
 16.4015 ++#else
 16.4016 ++  tramp[0] = 0xd202d301;
 16.4017 ++  tramp[1] = 0x422b0009;
 16.4018 ++#endif
 16.4019 ++  *(void **) &tramp[2] = (void *)closure;          /* ctx */
 16.4020 ++  *(void **) &tramp[3] = (void *)ffi_closure_SYSV; /* funaddr */
 16.4021 ++
 16.4022 ++  closure->cif = cif;
 16.4023 ++  closure->fun = fun;
 16.4024 ++  closure->user_data = user_data;
 16.4025 ++
 16.4026 ++#if defined(__SH4__)
 16.4027 ++  /* Flush the icache.  */
 16.4028 ++  __ic_invalidate(&closure->tramp[0]);
 16.4029 ++#endif
 16.4030 ++
 16.4031 ++  return FFI_OK;
 16.4032 ++}
 16.4033 ++
 16.4034 ++/* Basically the trampoline invokes ffi_closure_SYSV, and on 
 16.4035 ++ * entry, r3 holds the address of the closure.
 16.4036 ++ * After storing the registers that could possibly contain
 16.4037 ++ * parameters to be passed into the stack frame and setting
 16.4038 ++ * up space for a return value, ffi_closure_SYSV invokes the 
 16.4039 ++ * following helper function to do most of the work.
 16.4040 ++ */
 16.4041 ++
 16.4042 ++#ifdef __LITTLE_ENDIAN__
 16.4043 ++#define OFS_INT8	0
 16.4044 ++#define OFS_INT16	2
 16.4045 ++#else
 16.4046 ++#define OFS_INT8	3
 16.4047 ++#define OFS_INT16	2
 16.4048 ++#endif
 16.4049 ++
 16.4050 ++int
 16.4051 ++ffi_closure_helper_SYSV (ffi_closure *closure, void *rvalue, 
 16.4052 ++			 unsigned long *pgr, unsigned long *pfr, 
 16.4053 ++			 unsigned long *pst)
 16.4054 ++{
 16.4055 ++  void **avalue;
 16.4056 ++  ffi_type **p_arg;
 16.4057 ++  int i, avn;
 16.4058 ++  int ireg, greg = 0;
 16.4059 ++#if defined(__SH4__)
 16.4060 ++  int freg = 0;
 16.4061 ++#endif
 16.4062 ++  ffi_cif *cif; 
 16.4063 ++  double temp; 
 16.4064 ++
 16.4065 ++  cif = closure->cif;
 16.4066 ++  avalue = alloca(cif->nargs * sizeof(void *));
 16.4067 ++
 16.4068 ++  /* Copy the caller's structure return value address so that the closure
 16.4069 ++     returns the data directly to the caller.  */
 16.4070 ++  if (cif->rtype->type == FFI_TYPE_STRUCT)
 16.4071 ++    {
 16.4072 ++      rvalue = *pgr++;
 16.4073 ++      ireg = STRUCT_VALUE_ADDRESS_WITH_ARG ? 1 : 0;
 16.4074 ++    }
 16.4075 ++  else
 16.4076 ++    ireg = 0;
 16.4077 ++
 16.4078 ++  cif = closure->cif;
 16.4079 ++  greg = ireg;
 16.4080 ++  avn = cif->nargs;
 16.4081 ++
 16.4082 ++  /* Grab the addresses of the arguments from the stack frame.  */
 16.4083 ++  for (i = 0, p_arg = cif->arg_types; i < avn; i++, p_arg++)
 16.4084 ++    {
 16.4085 ++      size_t z;
 16.4086 ++
 16.4087 ++      z = (*p_arg)->size;
 16.4088 ++      if (z < sizeof(int))
 16.4089 ++	{
 16.4090 ++	  if (greg++ >= NGREGARG)
 16.4091 ++	    continue;
 16.4092 ++
 16.4093 ++	  z = sizeof(int);
 16.4094 ++	  switch ((*p_arg)->type)
 16.4095 ++	    {
 16.4096 ++	    case FFI_TYPE_SINT8:
 16.4097 ++	    case FFI_TYPE_UINT8:
 16.4098 ++	      avalue[i] = (((char *)pgr) + OFS_INT8);
 16.4099 ++	      break;
 16.4100 ++  
 16.4101 ++	    case FFI_TYPE_SINT16:
 16.4102 ++	    case FFI_TYPE_UINT16:
 16.4103 ++	      avalue[i] = (((char *)pgr) + OFS_INT16);
 16.4104 ++	      break;
 16.4105 ++  
 16.4106 ++	    case FFI_TYPE_STRUCT:
 16.4107 ++	      avalue[i] = pgr;
 16.4108 ++	      break;
 16.4109 ++
 16.4110 ++	    default:
 16.4111 ++	      FFI_ASSERT(0);
 16.4112 ++	    }
 16.4113 ++	  pgr++;
 16.4114 ++	}
 16.4115 ++      else if (z == sizeof(int))
 16.4116 ++	{
 16.4117 ++#if defined(__SH4__)
 16.4118 ++	  if ((*p_arg)->type == FFI_TYPE_FLOAT)
 16.4119 ++	    {
 16.4120 ++	      if (freg++ >= NFREGARG)
 16.4121 ++		continue;
 16.4122 ++	      avalue[i] = pfr;
 16.4123 ++	      pfr++;
 16.4124 ++	    }
 16.4125 ++	  else
 16.4126 ++#endif
 16.4127 ++	    {
 16.4128 ++	      if (greg++ >= NGREGARG)
 16.4129 ++		continue;
 16.4130 ++	      avalue[i] = pgr;
 16.4131 ++	      pgr++;
 16.4132 ++	    }
 16.4133 ++	}
 16.4134 ++#if defined(__SH4__)
 16.4135 ++      else if ((*p_arg)->type == FFI_TYPE_DOUBLE)
 16.4136 ++	{
 16.4137 ++	  if (freg + 1 >= NFREGARG)
 16.4138 ++	    continue;
 16.4139 ++	  freg = (freg + 1) & ~1;
 16.4140 ++	  freg += 2;
 16.4141 ++	  avalue[i] = pfr;
 16.4142 ++	  pfr += 2;
 16.4143 ++	}
 16.4144 ++#endif
 16.4145 ++      else
 16.4146 ++	{
 16.4147 ++	  int n = (z + sizeof (int) - 1) / sizeof (int);
 16.4148 ++#if defined(__SH4__)
 16.4149 ++	  if (greg + n - 1 >= NGREGARG)
 16.4150 ++	    continue;
 16.4151 ++	  greg += n;
 16.4152 ++#else
 16.4153 ++	  if (greg >= NGREGARG)
 16.4154 ++	    continue;
 16.4155 ++	  else if (greg + n - 1 >= NGREGARG)
 16.4156 ++	    greg = NGREGARG;
 16.4157 ++	  else
 16.4158 ++	    greg += n;
 16.4159 ++#endif
 16.4160 ++	  avalue[i] = pgr;
 16.4161 ++	  pgr += n;
 16.4162 ++	}
 16.4163 ++    }
 16.4164 ++
 16.4165 ++  greg = ireg;
 16.4166 ++#if defined(__SH4__)
 16.4167 ++  freg = 0;
 16.4168 ++#endif
 16.4169 ++
 16.4170 ++  for (i = 0, p_arg = cif->arg_types; i < avn; i++, p_arg++)
 16.4171 ++    {
 16.4172 ++      size_t z;
 16.4173 ++
 16.4174 ++      z = (*p_arg)->size;
 16.4175 ++      if (z < sizeof(int))
 16.4176 ++	{
 16.4177 ++	  if (greg++ < NGREGARG)
 16.4178 ++	    continue;
 16.4179 ++
 16.4180 ++	  z = sizeof(int);
 16.4181 ++	  switch ((*p_arg)->type)
 16.4182 ++	    {
 16.4183 ++	    case FFI_TYPE_SINT8:
 16.4184 ++	    case FFI_TYPE_UINT8:
 16.4185 ++	      avalue[i] = (((char *)pst) + OFS_INT8);
 16.4186 ++	      break;
 16.4187 ++  
 16.4188 ++	    case FFI_TYPE_SINT16:
 16.4189 ++	    case FFI_TYPE_UINT16:
 16.4190 ++	      avalue[i] = (((char *)pst) + OFS_INT16);
 16.4191 ++	      break;
 16.4192 ++  
 16.4193 ++	    case FFI_TYPE_STRUCT:
 16.4194 ++	      avalue[i] = pst;
 16.4195 ++	      break;
 16.4196 ++
 16.4197 ++	    default:
 16.4198 ++	      FFI_ASSERT(0);
 16.4199 ++	    }
 16.4200 ++	  pst++;
 16.4201 ++	}
 16.4202 ++      else if (z == sizeof(int))
 16.4203 ++	{
 16.4204 ++#if defined(__SH4__)
 16.4205 ++	  if ((*p_arg)->type == FFI_TYPE_FLOAT)
 16.4206 ++	    {
 16.4207 ++	      if (freg++ < NFREGARG)
 16.4208 ++		continue;
 16.4209 ++	    }
 16.4210 ++	  else
 16.4211 ++#endif
 16.4212 ++	    {
 16.4213 ++	      if (greg++ < NGREGARG)
 16.4214 ++		continue;
 16.4215 ++	    }
 16.4216 ++	  avalue[i] = pst;
 16.4217 ++	  pst++;
 16.4218 ++	}
 16.4219 ++#if defined(__SH4__)
 16.4220 ++      else if ((*p_arg)->type == FFI_TYPE_DOUBLE)
 16.4221 ++	{
 16.4222 ++	  if (freg + 1 < NFREGARG)
 16.4223 ++	    {
 16.4224 ++	      freg = (freg + 1) & ~1;
 16.4225 ++	      freg += 2;
 16.4226 ++	      continue;
 16.4227 ++	    }
 16.4228 ++	  avalue[i] = pst;
 16.4229 ++	  pst += 2;
 16.4230 ++	}
 16.4231 ++#endif
 16.4232 ++      else
 16.4233 ++	{
 16.4234 ++	  int n = (z + sizeof (int) - 1) / sizeof (int);
 16.4235 ++	  if (greg + n - 1 < NGREGARG)
 16.4236 ++	    {
 16.4237 ++	      greg += n;
 16.4238 ++	      continue;
 16.4239 ++	    }
 16.4240 ++#if (! defined(__SH4__))
 16.4241 ++	  else if (greg < NGREGARG)
 16.4242 ++	    {
 16.4243 ++	      greg = NGREGARG;
 16.4244 ++	      continue;
 16.4245 ++	    }
 16.4246 ++#endif
 16.4247 ++	  avalue[i] = pst;
 16.4248 ++	  pst += n;
 16.4249 ++	}
 16.4250 ++    }
 16.4251 ++
 16.4252 ++  (closure->fun) (cif, rvalue, avalue, closure->user_data);
 16.4253 ++
 16.4254 ++  /* Tell ffi_closure_osf how to perform return type promotions.  */
 16.4255 ++  return cif->rtype->type;
 16.4256 ++}
 16.4257 +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/sh/sysv.S gcc/libffi/src/sh/sysv.S
 16.4258 +--- gcc-3.2.2.orig/libffi/src/sh/sysv.S	Thu Jan  1 09:00:00 1970
 16.4259 ++++ gcc/libffi/src/sh/sysv.S	Tue Dec 17 03:22:48 2002
 16.4260 +@@ -0,0 +1,773 @@
 16.4261 ++/* -----------------------------------------------------------------------
 16.4262 ++   sysv.S - Copyright (c) 2002 Kaz Kojima
 16.4263 ++   
 16.4264 ++   SuperH Foreign Function Interface 
 16.4265 ++
 16.4266 ++   Permission is hereby granted, free of charge, to any person obtaining
 16.4267 ++   a copy of this software and associated documentation files (the
 16.4268 ++   ``Software''), to deal in the Software without restriction, including
 16.4269 ++   without limitation the rights to use, copy, modify, merge, publish,
 16.4270 ++   distribute, sublicense, and/or sell copies of the Software, and to
 16.4271 ++   permit persons to whom the Software is furnished to do so, subject to
 16.4272 ++   the following conditions:
 16.4273 ++
 16.4274 ++   The above copyright notice and this permission notice shall be included
 16.4275 ++   in all copies or substantial portions of the Software.
 16.4276 ++
 16.4277 ++   THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
 16.4278 ++   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 16.4279 ++   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 16.4280 ++   IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR
 16.4281 ++   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 16.4282 ++   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 16.4283 ++   OTHER DEALINGS IN THE SOFTWARE.
 16.4284 ++   ----------------------------------------------------------------------- */
 16.4285 ++
 16.4286 ++#define LIBFFI_ASM	
 16.4287 ++#include <ffi.h>
 16.4288 ++#ifdef HAVE_MACHINE_ASM_H
 16.4289 ++#include <machine/asm.h>
 16.4290 ++#else
 16.4291 ++/* XXX these lose for some platforms, I'm sure. */
 16.4292 ++#define CNAME(x) x
 16.4293 ++#define ENTRY(x) .globl CNAME(x); .type CNAME(x),%function; CNAME(x):
 16.4294 ++#endif
 16.4295 ++
 16.4296 ++#if defined(__HITACHI__)
 16.4297 ++#define STRUCT_VALUE_ADDRESS_WITH_ARG 1
 16.4298 ++#else
 16.4299 ++#define STRUCT_VALUE_ADDRESS_WITH_ARG 0
 16.4300 ++#endif
 16.4301 ++
 16.4302 ++.text
 16.4303 ++
 16.4304 ++	# r4:	ffi_prep_args
 16.4305 ++	# r5:	&ecif
 16.4306 ++	# r6:	bytes
 16.4307 ++	# r7:	flags
 16.4308 ++	# sp+0: rvalue
 16.4309 ++	# sp+4: fn
 16.4310 ++
 16.4311 ++	# This assumes we are using gas.
 16.4312 ++ENTRY(ffi_call_SYSV)
 16.4313 ++	# Save registers
 16.4314 ++.LFB1:
 16.4315 ++	mov.l	r8,@-r15
 16.4316 ++.LCFI0:
 16.4317 ++	mov.l	r9,@-r15
 16.4318 ++.LCFI1:
 16.4319 ++	mov.l	r10,@-r15
 16.4320 ++.LCFI2:
 16.4321 ++	mov.l	r12,@-r15
 16.4322 ++.LCFI3:
 16.4323 ++	mov.l	r14,@-r15
 16.4324 ++.LCFI4:
 16.4325 ++	sts.l	pr,@-r15
 16.4326 ++.LCFI5:
 16.4327 ++	mov	r15,r14
 16.4328 ++.LCFI6:
 16.4329 ++#if defined(__SH4__)
 16.4330 ++	mov	r6,r8
 16.4331 ++	mov	r7,r9
 16.4332 ++
 16.4333 ++	sub	r6,r15
 16.4334 ++	add	#-16,r15
 16.4335 ++	mov	#~7,r0
 16.4336 ++	and	r0,r15
 16.4337 ++
 16.4338 ++	mov	r4,r0
 16.4339 ++	jsr	@r0
 16.4340 ++	 mov	r15,r4
 16.4341 ++
 16.4342 ++	mov	r9,r1
 16.4343 ++	shlr8	r9
 16.4344 ++	shlr8	r9
 16.4345 ++	shlr8	r9
 16.4346 ++
 16.4347 ++	mov	#FFI_TYPE_STRUCT,r2
 16.4348 ++	cmp/eq	r2,r9
 16.4349 ++	bf	1f
 16.4350 ++#if STRUCT_VALUE_ADDRESS_WITH_ARG
 16.4351 ++ 	mov.l	@r15+,r4
 16.4352 ++	bra	2f
 16.4353 ++	 mov	#5,r2
 16.4354 ++#else
 16.4355 ++ 	mov.l	@r15+,r10
 16.4356 ++#endif
 16.4357 ++1:
 16.4358 ++	mov	#4,r2
 16.4359 ++2:
 16.4360 ++	mov	#4,r3
 16.4361 ++
 16.4362 ++L_pass:
 16.4363 ++	cmp/pl	r8
 16.4364 ++	bf	L_call_it
 16.4365 ++
 16.4366 ++	mov	r1,r0
 16.4367 ++	and	#3,r0
 16.4368 ++
 16.4369 ++L_pass_d:
 16.4370 ++	cmp/eq	#FFI_TYPE_DOUBLE,r0
 16.4371 ++	bf	L_pass_f
 16.4372 ++
 16.4373 ++	mov	r3,r0
 16.4374 ++	and	#1,r0
 16.4375 ++	tst	r0,r0
 16.4376 ++	bt	1f
 16.4377 ++	add	#1,r3
 16.4378 ++1:
 16.4379 ++	mov	r15,r0
 16.4380 ++	and	#7,r0
 16.4381 ++	tst	r0,r0
 16.4382 ++	bt	2f
 16.4383 ++	add	#4,r15
 16.4384 ++2:
 16.4385 ++	mov	#12,r0
 16.4386 ++	cmp/hs	r0,r3
 16.4387 ++	bt/s	3f
 16.4388 ++	 shlr2	r1
 16.4389 ++	bsr	L_pop_d
 16.4390 ++	 nop
 16.4391 ++3:
 16.4392 ++	add	#2,r3
 16.4393 ++	bra	L_pass
 16.4394 ++	 add	#-8,r8
 16.4395 ++
 16.4396 ++L_pop_d:
 16.4397 ++	mov	r3,r0
 16.4398 ++	add	r0,r0
 16.4399 ++	add	r3,r0
 16.4400 ++	add	#-12,r0
 16.4401 ++	braf	r0
 16.4402 ++	 nop
 16.4403 ++#ifdef __LITTLE_ENDIAN__
 16.4404 ++	fmov.s	@r15+,fr5
 16.4405 ++	rts
 16.4406 ++	 fmov.s	@r15+,fr4
 16.4407 ++	fmov.s	@r15+,fr7
 16.4408 ++	rts
 16.4409 ++	 fmov.s	@r15+,fr6
 16.4410 ++	fmov.s	@r15+,fr9
 16.4411 ++	rts
 16.4412 ++	 fmov.s	@r15+,fr8
 16.4413 ++	fmov.s	@r15+,fr11
 16.4414 ++	rts
 16.4415 ++	 fmov.s	@r15+,fr10
 16.4416 ++#else
 16.4417 ++	fmov.s	@r15+,fr4
 16.4418 ++	rts
 16.4419 ++	 fmov.s	@r15+,fr5
 16.4420 ++	fmov.s	@r15+,fr6
 16.4421 ++	rts
 16.4422 ++	 fmov.s	@r15+,fr7
 16.4423 ++	fmov.s	@r15+,fr8
 16.4424 ++	rts
 16.4425 ++	 fmov.s	@r15+,fr9
 16.4426 ++	fmov.s	@r15+,fr10
 16.4427 ++	rts
 16.4428 ++	 fmov.s	@r15+,fr11
 16.4429 ++#endif
 16.4430 ++
 16.4431 ++L_pass_f:
 16.4432 ++	cmp/eq	#FFI_TYPE_FLOAT,r0
 16.4433 ++	bf	L_pass_i
 16.4434 ++
 16.4435 ++	mov	#12,r0
 16.4436 ++	cmp/hs	r0,r3
 16.4437 ++	bt/s	2f
 16.4438 ++	 shlr2	r1
 16.4439 ++	bsr	L_pop_f
 16.4440 ++	 nop
 16.4441 ++2:
 16.4442 ++	add	#1,r3
 16.4443 ++	bra	L_pass
 16.4444 ++	 add	#-4,r8
 16.4445 ++
 16.4446 ++L_pop_f:
 16.4447 ++	mov	r3,r0
 16.4448 ++	shll2	r0
 16.4449 ++	add	#-16,r0
 16.4450 ++	braf	r0
 16.4451 ++	 nop
 16.4452 ++#ifdef __LITTLE_ENDIAN__
 16.4453 ++	rts
 16.4454 ++	 fmov.s	@r15+,fr5
 16.4455 ++	rts
 16.4456 ++	 fmov.s	@r15+,fr4
 16.4457 ++	rts
 16.4458 ++	 fmov.s	@r15+,fr7
 16.4459 ++	rts
 16.4460 ++	 fmov.s	@r15+,fr6
 16.4461 ++	rts
 16.4462 ++	 fmov.s	@r15+,fr9
 16.4463 ++	rts
 16.4464 ++	 fmov.s	@r15+,fr8
 16.4465 ++	rts
 16.4466 ++	 fmov.s	@r15+,fr11
 16.4467 ++	rts
 16.4468 ++	 fmov.s	@r15+,fr10
 16.4469 ++#else
 16.4470 ++	rts
 16.4471 ++	 fmov.s	@r15+,fr4
 16.4472 ++	rts
 16.4473 ++	 fmov.s	@r15+,fr5
 16.4474 ++	rts
 16.4475 ++	 fmov.s	@r15+,fr6
 16.4476 ++	rts
 16.4477 ++	 fmov.s	@r15+,fr7
 16.4478 ++	rts
 16.4479 ++	 fmov.s	@r15+,fr8
 16.4480 ++	rts
 16.4481 ++	 fmov.s	@r15+,fr9
 16.4482 ++	rts
 16.4483 ++	 fmov.s	@r15+,fr10
 16.4484 ++	rts
 16.4485 ++	 fmov.s	@r15+,fr11
 16.4486 ++#endif
 16.4487 ++
 16.4488 ++L_pass_i:
 16.4489 ++	cmp/eq	#FFI_TYPE_INT,r0
 16.4490 ++	bf	L_call_it
 16.4491 ++
 16.4492 ++	mov	#8,r0
 16.4493 ++	cmp/hs	r0,r2
 16.4494 ++	bt/s	2f
 16.4495 ++	 shlr2	r1
 16.4496 ++	bsr	L_pop_i
 16.4497 ++	 nop
 16.4498 ++2:
 16.4499 ++	add	#1,r2
 16.4500 ++	bra	L_pass
 16.4501 ++	 add	#-4,r8
 16.4502 ++
 16.4503 ++L_pop_i:
 16.4504 ++	mov	r2,r0
 16.4505 ++	shll2	r0
 16.4506 ++	add	#-16,r0
 16.4507 ++	braf	r0
 16.4508 ++	 nop
 16.4509 ++	rts
 16.4510 ++	 mov.l	@r15+,r4
 16.4511 ++	rts
 16.4512 ++	 mov.l	@r15+,r5
 16.4513 ++	rts
 16.4514 ++	 mov.l	@r15+,r6
 16.4515 ++	rts
 16.4516 ++	 mov.l	@r15+,r7
 16.4517 ++
 16.4518 ++L_call_it:
 16.4519 ++	# call function
 16.4520 ++#if (! STRUCT_VALUE_ADDRESS_WITH_ARG)
 16.4521 ++	mov	r10, r2
 16.4522 ++#endif
 16.4523 ++	mov.l  @(28,r14),r1
 16.4524 ++	jsr    @r1
 16.4525 ++	 nop
 16.4526 ++
 16.4527 ++L_ret_d:
 16.4528 ++	mov	#FFI_TYPE_DOUBLE,r2
 16.4529 ++	cmp/eq	r2,r9
 16.4530 ++	bf	L_ret_ll
 16.4531 ++
 16.4532 ++	mov.l	@(24,r14),r1
 16.4533 ++#ifdef __LITTLE_ENDIAN__
 16.4534 ++	fmov.s	fr1,@r1
 16.4535 ++	add	#4,r1
 16.4536 ++	bra	L_epilogue
 16.4537 ++	 fmov.s	fr0,@r1
 16.4538 ++#else
 16.4539 ++	fmov.s	fr0,@r1
 16.4540 ++	add	#4,r1
 16.4541 ++	bra	L_epilogue
 16.4542 ++	 fmov.s	fr1,@r1
 16.4543 ++#endif
 16.4544 ++
 16.4545 ++L_ret_ll:
 16.4546 ++	mov	#FFI_TYPE_SINT64,r2
 16.4547 ++	cmp/eq	r2,r9
 16.4548 ++	bt/s	1f
 16.4549 ++	 mov	#FFI_TYPE_UINT64,r2
 16.4550 ++	cmp/eq	r2,r9
 16.4551 ++	bf	L_ret_f
 16.4552 ++
 16.4553 ++1:
 16.4554 ++	mov.l	@(24,r14),r2
 16.4555 ++	mov.l	r0,@r2
 16.4556 ++	bra	L_epilogue
 16.4557 ++	 mov.l	r1,@(4,r2)
 16.4558 ++
 16.4559 ++L_ret_f:
 16.4560 ++	mov	#FFI_TYPE_FLOAT,r2
 16.4561 ++	cmp/eq	r2,r9
 16.4562 ++	bf	L_ret_i
 16.4563 ++
 16.4564 ++	mov.l	@(24,r14),r1
 16.4565 ++	bra	L_epilogue
 16.4566 ++	 fmov.s	fr0,@r1
 16.4567 ++
 16.4568 ++L_ret_i:
 16.4569 ++	mov	#FFI_TYPE_INT,r2
 16.4570 ++	cmp/eq	r2,r9
 16.4571 ++	bf	L_epilogue
 16.4572 ++
 16.4573 ++	mov.l	@(24,r14),r1
 16.4574 ++	bra	L_epilogue
 16.4575 ++	 mov.l	r0,@r1
 16.4576 ++
 16.4577 ++L_epilogue:
 16.4578 ++	# Remove the space we pushed for the args
 16.4579 ++	mov   r14,r15
 16.4580 ++
 16.4581 ++	lds.l  @r15+,pr
 16.4582 ++	mov.l  @r15+,r14
 16.4583 ++	mov.l  @r15+,r12
 16.4584 ++	mov.l  @r15+,r10
 16.4585 ++	mov.l  @r15+,r9
 16.4586 ++	rts
 16.4587 ++	 mov.l  @r15+,r8
 16.4588 ++#else
 16.4589 ++	mov	r6,r8
 16.4590 ++	mov	r7,r9
 16.4591 ++
 16.4592 ++	sub	r6,r15
 16.4593 ++	add	#-16,r15
 16.4594 ++	mov	#~7,r0
 16.4595 ++	and	r0,r15
 16.4596 ++
 16.4597 ++	mov	r4,r0
 16.4598 ++	jsr	@r0
 16.4599 ++	 mov	r15,r4
 16.4600 ++
 16.4601 ++	mov	r9,r3
 16.4602 ++	shlr8	r9
 16.4603 ++	shlr8	r9
 16.4604 ++	shlr8	r9
 16.4605 ++
 16.4606 ++	mov	#FFI_TYPE_STRUCT,r2
 16.4607 ++	cmp/eq	r2,r9
 16.4608 ++	bf	1f
 16.4609 ++#if STRUCT_VALUE_ADDRESS_WITH_ARG
 16.4610 ++	mov.l	@r15+,r4
 16.4611 ++	bra	2f
 16.4612 ++	 mov	#5,r2
 16.4613 ++#else
 16.4614 ++	mov.l	@r15+,r10
 16.4615 ++#endif
 16.4616 ++1:
 16.4617 ++	mov	#4,r2
 16.4618 ++2:
 16.4619 ++
 16.4620 ++L_pass:
 16.4621 ++	cmp/pl	r8
 16.4622 ++	bf	L_call_it
 16.4623 ++
 16.4624 ++	mov	r3,r0
 16.4625 ++	and	#3,r0
 16.4626 ++
 16.4627 ++L_pass_d:
 16.4628 ++	cmp/eq	#FFI_TYPE_DOUBLE,r0
 16.4629 ++	bf	L_pass_i
 16.4630 ++
 16.4631 ++	mov	r15,r0
 16.4632 ++	and	#7,r0
 16.4633 ++	tst	r0,r0
 16.4634 ++	bt	1f
 16.4635 ++	add	#4,r15
 16.4636 ++1:
 16.4637 ++	mov	#8,r0
 16.4638 ++	cmp/hs	r0,r2
 16.4639 ++	bt/s	2f
 16.4640 ++	 shlr2	r3
 16.4641 ++	bsr	L_pop_d
 16.4642 ++	 nop
 16.4643 ++2:
 16.4644 ++	add	#2,r2
 16.4645 ++	bra	L_pass
 16.4646 ++	 add	#-8,r8
 16.4647 ++
 16.4648 ++L_pop_d:
 16.4649 ++	mov	r2,r0
 16.4650 ++	add	r0,r0
 16.4651 ++	add	r2,r0
 16.4652 ++	add	#-12,r0
 16.4653 ++	add	r0,r0
 16.4654 ++	braf	r0
 16.4655 ++	 nop
 16.4656 ++	mov.l	@r15+,r4
 16.4657 ++	rts
 16.4658 ++	 mov.l	@r15+,r5
 16.4659 ++	mov.l	@r15+,r5
 16.4660 ++	rts
 16.4661 ++	 mov.l	@r15+,r6
 16.4662 ++	mov.l	@r15+,r6
 16.4663 ++	rts
 16.4664 ++	 mov.l	@r15+,r7
 16.4665 ++	rts
 16.4666 ++	 mov.l	@r15+,r7
 16.4667 ++
 16.4668 ++L_pass_i:
 16.4669 ++	mov	#8,r0
 16.4670 ++	cmp/hs	r0,r2
 16.4671 ++	bt/s	2f
 16.4672 ++	 shlr2	r3
 16.4673 ++	bsr	L_pop_i
 16.4674 ++	 nop
 16.4675 ++2:
 16.4676 ++	add	#1,r2
 16.4677 ++	bra	L_pass
 16.4678 ++	 add	#-4,r8
 16.4679 ++
 16.4680 ++L_pop_i:
 16.4681 ++	mov	r2,r0
 16.4682 ++	shll2	r0
 16.4683 ++	add	#-16,r0
 16.4684 ++	braf	r0
 16.4685 ++	 nop
 16.4686 ++	rts
 16.4687 ++	 mov.l	@r15+,r4
 16.4688 ++	rts
 16.4689 ++	 mov.l	@r15+,r5
 16.4690 ++	rts
 16.4691 ++	 mov.l	@r15+,r6
 16.4692 ++	rts
 16.4693 ++	 mov.l	@r15+,r7
 16.4694 ++
 16.4695 ++L_call_it:
 16.4696 ++	# call function
 16.4697 ++#if (! STRUCT_VALUE_ADDRESS_WITH_ARG)
 16.4698 ++	mov	r10, r2
 16.4699 ++#endif
 16.4700 ++	mov.l  @(28,r14),r1
 16.4701 ++	jsr    @r1
 16.4702 ++	 nop
 16.4703 ++
 16.4704 ++L_ret_d:
 16.4705 ++	mov	#FFI_TYPE_DOUBLE,r2
 16.4706 ++	cmp/eq	r2,r9
 16.4707 ++	bf	L_ret_ll
 16.4708 ++
 16.4709 ++	mov.l	@(24,r14),r2
 16.4710 ++	mov.l	r0,@r2
 16.4711 ++	bra	L_epilogue
 16.4712 ++	 mov.l	r1,@(4,r2)
 16.4713 ++
 16.4714 ++L_ret_ll:
 16.4715 ++	mov	#FFI_TYPE_SINT64,r2
 16.4716 ++	cmp/eq	r2,r9
 16.4717 ++	bt/s	1f
 16.4718 ++	 mov	#FFI_TYPE_UINT64,r2
 16.4719 ++	cmp/eq	r2,r9
 16.4720 ++	bf	L_ret_i
 16.4721 ++
 16.4722 ++1:
 16.4723 ++	mov.l	@(24,r14),r2
 16.4724 ++	mov.l	r0,@r2
 16.4725 ++	bra	L_epilogue
 16.4726 ++	 mov.l	r1,@(4,r2)
 16.4727 ++
 16.4728 ++L_ret_i:
 16.4729 ++	mov	#FFI_TYPE_FLOAT,r2
 16.4730 ++	cmp/eq	r2,r9
 16.4731 ++	bt	1f
 16.4732 ++	mov	#FFI_TYPE_INT,r2
 16.4733 ++	cmp/eq	r2,r9
 16.4734 ++	bf	L_epilogue
 16.4735 ++1:
 16.4736 ++	mov.l	@(24,r14),r1
 16.4737 ++	bra	L_epilogue
 16.4738 ++	 mov.l	r0,@r1
 16.4739 ++
 16.4740 ++L_epilogue:
 16.4741 ++	# Remove the space we pushed for the args
 16.4742 ++	mov   r14,r15
 16.4743 ++
 16.4744 ++	lds.l  @r15+,pr
 16.4745 ++	mov.l  @r15+,r14
 16.4746 ++	mov.l  @r15+,r12
 16.4747 ++	mov.l  @r15+,r10
 16.4748 ++	mov.l  @r15+,r9
 16.4749 ++	rts
 16.4750 ++	 mov.l  @r15+,r8
 16.4751 ++#endif
 16.4752 ++.LFE1:
 16.4753 ++.ffi_call_SYSV_end:
 16.4754 ++        .size    CNAME(ffi_call_SYSV),.ffi_call_SYSV_end-CNAME(ffi_call_SYSV)
 16.4755 ++
 16.4756 ++.globl	ffi_closure_helper_SYSV
 16.4757 ++
 16.4758 ++ENTRY(ffi_closure_SYSV)
 16.4759 ++.LFB2:
 16.4760 ++	mov.l	r14,@-r15
 16.4761 ++.LCFI7:
 16.4762 ++	sts.l	pr,@-r15
 16.4763 ++
 16.4764 ++	/* Stack layout:	
 16.4765 ++	   ...
 16.4766 ++	   32 bytes (floating register parameters, SH-4 only)
 16.4767 ++	   16 bytes (register parameters)
 16.4768 ++	    4 bytes (result)
 16.4769 ++	    4 bytes (5th arg)
 16.4770 ++	   <- new stack pointer
 16.4771 ++	*/
 16.4772 ++.LCFI8:
 16.4773 ++#if defined(__SH4__)
 16.4774 ++	add	#-56,r15
 16.4775 ++#else
 16.4776 ++	add	#-24,r15
 16.4777 ++#endif
 16.4778 ++.LCFI9:
 16.4779 ++	mov	r15,r14
 16.4780 ++.LCFIA:
 16.4781 ++	mov	r14,r1
 16.4782 ++	add	#24,r1
 16.4783 ++	mov.l	r7,@-r1
 16.4784 ++	mov.l	r6,@-r1
 16.4785 ++	mov.l	r5,@-r1
 16.4786 ++	mov.l	r4,@-r1
 16.4787 ++	mov	r1,r6
 16.4788 ++
 16.4789 ++#if defined(__SH4__)
 16.4790 ++	mov	r14,r1
 16.4791 ++	add	#56,r1
 16.4792 ++#ifdef __LITTLE_ENDIAN__
 16.4793 ++	fmov.s	fr10,@-r1
 16.4794 ++	fmov.s	fr11,@-r1
 16.4795 ++	fmov.s	fr8,@-r1
 16.4796 ++	fmov.s	fr9,@-r1
 16.4797 ++	fmov.s	fr6,@-r1
 16.4798 ++	fmov.s	fr7,@-r1
 16.4799 ++	fmov.s	fr4,@-r1
 16.4800 ++	fmov.s	fr5,@-r1
 16.4801 ++#else
 16.4802 ++	fmov.s	fr11,@-r1
 16.4803 ++	fmov.s	fr10,@-r1
 16.4804 ++	fmov.s	fr9,@-r1
 16.4805 ++	fmov.s	fr8,@-r1
 16.4806 ++	fmov.s	fr7,@-r1
 16.4807 ++	fmov.s	fr6,@-r1
 16.4808 ++	fmov.s	fr5,@-r1
 16.4809 ++	fmov.s	fr4,@-r1
 16.4810 ++#endif
 16.4811 ++	mov	r1,r7
 16.4812 ++#endif
 16.4813 ++
 16.4814 ++	mov	r14,r1
 16.4815 ++	add	#4,r1
 16.4816 ++	mov	r1,r5
 16.4817 ++
 16.4818 ++	mov	r14,r1
 16.4819 ++#if defined(__SH4__)
 16.4820 ++	add	#64,r1
 16.4821 ++#else
 16.4822 ++	add	#32,r1
 16.4823 ++#endif
 16.4824 ++	mov.l	r1,@r14
 16.4825 ++
 16.4826 ++	mov.l	L_helper,r0
 16.4827 ++	jsr	@r0
 16.4828 ++	 mov	r3,r4
 16.4829 ++
 16.4830 ++	shll	r0
 16.4831 ++	mov	r0,r1
 16.4832 ++	mova	L_table,r0
 16.4833 ++	add	r1,r0
 16.4834 ++	mov.w	@r0,r0
 16.4835 ++	mov	r14,r2
 16.4836 ++	braf	r0
 16.4837 ++	 add	#4,r2
 16.4838 ++0:
 16.4839 ++	.align 2
 16.4840 ++L_helper:
 16.4841 ++	.long	ffi_closure_helper_SYSV
 16.4842 ++L_table:
 16.4843 ++	.short L_case_v - 0b	/* FFI_TYPE_VOID */
 16.4844 ++	.short L_case_i - 0b	/* FFI_TYPE_INT */
 16.4845 ++#if defined(__SH4__)
 16.4846 ++	.short L_case_f - 0b	/* FFI_TYPE_FLOAT */
 16.4847 ++	.short L_case_d - 0b	/* FFI_TYPE_DOUBLE */
 16.4848 ++	.short L_case_d - 0b	/* FFI_TYPE_LONGDOUBLE */
 16.4849 ++#else
 16.4850 ++	.short L_case_i - 0b	/* FFI_TYPE_FLOAT */
 16.4851 ++	.short L_case_ll - 0b	/* FFI_TYPE_DOUBLE */
 16.4852 ++	.short L_case_ll - 0b	/* FFI_TYPE_LONGDOUBLE */
 16.4853 ++#endif
 16.4854 ++	.short L_case_uq - 0b	/* FFI_TYPE_UINT8 */
 16.4855 ++	.short L_case_q - 0b	/* FFI_TYPE_SINT8 */
 16.4856 ++	.short L_case_uh - 0b	/* FFI_TYPE_UINT16 */
 16.4857 ++	.short L_case_h - 0b	/* FFI_TYPE_SINT16 */
 16.4858 ++	.short L_case_i - 0b	/* FFI_TYPE_UINT32 */
 16.4859 ++	.short L_case_i - 0b	/* FFI_TYPE_SINT32 */
 16.4860 ++	.short L_case_ll - 0b	/* FFI_TYPE_UINT64 */
 16.4861 ++	.short L_case_ll - 0b	/* FFI_TYPE_SINT64 */
 16.4862 ++	.short L_case_v - 0b	/* FFI_TYPE_STRUCT */
 16.4863 ++	.short L_case_i - 0b	/* FFI_TYPE_POINTER */
 16.4864 ++
 16.4865 ++#if defined(__SH4__)
 16.4866 ++L_case_d:
 16.4867 ++#ifdef __LITTLE_ENDIAN__
 16.4868 ++	fmov.s	@r2+,fr1
 16.4869 ++	bra	L_case_v
 16.4870 ++	 fmov.s	@r2,fr0
 16.4871 ++#else
 16.4872 ++	fmov.s	@r2+,fr0
 16.4873 ++	bra	L_case_v
 16.4874 ++	 fmov.s	@r2,fr1
 16.4875 ++#endif
 16.4876 ++
 16.4877 ++L_case_f:
 16.4878 ++	bra	L_case_v
 16.4879 ++	 fmov.s	@r2,fr0
 16.4880 ++#endif
 16.4881 ++	
 16.4882 ++L_case_ll:
 16.4883 ++	mov.l	@r2+,r0
 16.4884 ++	bra	L_case_v
 16.4885 ++	 mov.l	@r2,r1
 16.4886 ++	
 16.4887 ++L_case_i:
 16.4888 ++	bra	L_case_v
 16.4889 ++	 mov.l	@r2,r0
 16.4890 ++	
 16.4891 ++L_case_q:
 16.4892 ++#ifdef __LITTLE_ENDIAN__
 16.4893 ++#else
 16.4894 ++	add	#3,r2
 16.4895 ++#endif
 16.4896 ++	bra	L_case_v
 16.4897 ++	 mov.b	@r2,r0
 16.4898 ++
 16.4899 ++L_case_uq:
 16.4900 ++#ifdef __LITTLE_ENDIAN__
 16.4901 ++#else
 16.4902 ++	add	#3,r2
 16.4903 ++#endif
 16.4904 ++	mov.b	@r2,r0
 16.4905 ++	bra	L_case_v
 16.4906 ++	 extu.b r0,r0
 16.4907 ++
 16.4908 ++L_case_h:
 16.4909 ++#ifdef __LITTLE_ENDIAN__
 16.4910 ++#else
 16.4911 ++	add	#2,r2
 16.4912 ++#endif
 16.4913 ++	bra	L_case_v
 16.4914 ++	 mov.w	@r2,r0
 16.4915 ++
 16.4916 ++L_case_uh:
 16.4917 ++#ifdef __LITTLE_ENDIAN__
 16.4918 ++#else
 16.4919 ++	add	#2,r2
 16.4920 ++#endif
 16.4921 ++	mov.w	@r2,r0
 16.4922 ++	extu.w	r0,r0
 16.4923 ++	/* fall through */
 16.4924 ++
 16.4925 ++L_case_v:
 16.4926 ++#if defined(__SH4__)
 16.4927 ++	add	#56,r15
 16.4928 ++#else
 16.4929 ++	add	#24,r15
 16.4930 ++#endif
 16.4931 ++	lds.l	@r15+,pr
 16.4932 ++	rts
 16.4933 ++	 mov.l	@r15+,r14
 16.4934 ++.LFE2:
 16.4935 ++.ffi_closure_SYSV_end:
 16.4936 ++        .size    CNAME(ffi_closure_SYSV),.ffi_closure_SYSV_end-CNAME(ffi_closure_SYSV)
 16.4937 ++
 16.4938 ++	.section	".eh_frame","aw",@progbits
 16.4939 ++__FRAME_BEGIN__:
 16.4940 ++	.4byte	.LECIE1-.LSCIE1	/* Length of Common Information Entry */
 16.4941 ++.LSCIE1:
 16.4942 ++	.4byte	0x0	/* CIE Identifier Tag */
 16.4943 ++	.byte	0x1	/* CIE Version */
 16.4944 ++	.byte	0x0	/* CIE Augmentation */
 16.4945 ++	.byte	0x1	/* uleb128 0x1; CIE Code Alignment Factor */
 16.4946 ++	.byte	0x7c	/* sleb128 -4; CIE Data Alignment Factor */
 16.4947 ++	.byte	0x11	/* CIE RA Column */
 16.4948 ++	.byte	0xc	/* DW_CFA_def_cfa */
 16.4949 ++	.byte	0xf	/* uleb128 0xf */
 16.4950 ++	.byte	0x0	/* uleb128 0x0 */
 16.4951 ++	.align	2
 16.4952 ++.LECIE1:
 16.4953 ++.LSFDE1:
 16.4954 ++	.4byte	.LEFDE1-.LASFDE1	/* FDE Length */
 16.4955 ++.LASFDE1:
 16.4956 ++	.4byte	.LASFDE1-__FRAME_BEGIN__	/* FDE CIE offset */
 16.4957 ++	.4byte	.LFB1	/* FDE initial location */
 16.4958 ++	.4byte	.LFE1-.LFB1	 /* FDE address range */
 16.4959 ++	.byte	0x4	/* DW_CFA_advance_loc4 */
 16.4960 ++	.4byte	.LCFI0-.LFB1
 16.4961 ++	.byte	0xe	/* DW_CFA_def_cfa_offset */
 16.4962 ++	.byte	0x4	/* uleb128 0x4 */
 16.4963 ++	.byte	0x4	/* DW_CFA_advance_loc4 */
 16.4964 ++	.4byte	.LCFI1-.LCFI0
 16.4965 ++	.byte	0xe	/* DW_CFA_def_cfa_offset */
 16.4966 ++	.byte	0x8	/* uleb128 0x4 */
 16.4967 ++	.byte	0x4	/* DW_CFA_advance_loc4 */
 16.4968 ++	.4byte	.LCFI2-.LCFI1
 16.4969 ++	.byte	0xe	/* DW_CFA_def_cfa_offset */
 16.4970 ++	.byte	0xc	/* uleb128 0x4 */
 16.4971 ++	.byte	0x4	/* DW_CFA_advance_loc4 */
 16.4972 ++	.4byte	.LCFI3-.LCFI2
 16.4973 ++	.byte	0xe	/* DW_CFA_def_cfa_offset */
 16.4974 ++	.byte	0x10	/* uleb128 0x4 */
 16.4975 ++	.byte	0x4	/* DW_CFA_advance_loc4 */
 16.4976 ++	.4byte	.LCFI4-.LCFI3
 16.4977 ++	.byte	0xe	/* DW_CFA_def_cfa_offset */
 16.4978 ++	.byte	0x14	/* uleb128 0x4 */
 16.4979 ++	.byte	0x4	/* DW_CFA_advance_loc4 */
 16.4980 ++	.4byte	.LCFI5-.LCFI4
 16.4981 ++	.byte	0xe	/* DW_CFA_def_cfa_offset */
 16.4982 ++	.byte	0x18	/* uleb128 0x4 */
 16.4983 ++	.byte	0x91	/* DW_CFA_offset, column 0x11 */
 16.4984 ++	.byte	0x6	/* uleb128 0x6 */
 16.4985 ++	.byte	0x8e	/* DW_CFA_offset, column 0xe */
 16.4986 ++	.byte	0x5	/* uleb128 0x5 */
 16.4987 ++	.byte	0x8c	/* DW_CFA_offset, column 0xc */
 16.4988 ++	.byte	0x4	/* uleb128 0x4 */
 16.4989 ++	.byte	0x8a	/* DW_CFA_offset, column 0xa */
 16.4990 ++	.byte	0x3	/* uleb128 0x3 */
 16.4991 ++	.byte	0x89	/* DW_CFA_offset, column 0x9 */
 16.4992 ++	.byte	0x2	/* uleb128 0x2 */
 16.4993 ++	.byte	0x88	/* DW_CFA_offset, column 0x8 */
 16.4994 ++	.byte	0x1	/* uleb128 0x1 */
 16.4995 ++	.byte	0x4	/* DW_CFA_advance_loc4 */
 16.4996 ++	.4byte	.LCFI6-.LCFI5
 16.4997 ++	.byte	0xd	/* DW_CFA_def_cfa_register */
 16.4998 ++	.byte	0xe	/* uleb128 0xe */
 16.4999 ++	.align	2
 16.5000 ++.LEFDE1:
 16.5001 ++
 16.5002 ++.LSFDE3:
 16.5003 ++	.4byte	.LEFDE3-.LASFDE3	/* FDE Length */
 16.5004 ++.LASFDE3:
 16.5005 ++	.4byte	.LASFDE3-__FRAME_BEGIN__	/* FDE CIE offset */
 16.5006 ++	.4byte	.LFB2	/* FDE initial location */
 16.5007 ++	.4byte	.LFE2-.LFB2	 /* FDE address range */
 16.5008 ++	.byte	0x4	/* DW_CFA_advance_loc4 */
 16.5009 ++	.4byte	.LCFI7-.LFB2
 16.5010 ++	.byte	0xe	/* DW_CFA_def_cfa_offset */
 16.5011 ++	.byte	0x4	/* uleb128 0x4 */
 16.5012 ++	.byte	0x4	/* DW_CFA_advance_loc4 */
 16.5013 ++	.4byte	.LCFI8-.LCFI7
 16.5014 ++	.byte	0xe	/* DW_CFA_def_cfa_offset */
 16.5015 ++	.byte	0x8	/* uleb128 0x8 */
 16.5016 ++	.byte	0x4	/* DW_CFA_advance_loc4 */
 16.5017 ++	.4byte	.LCFI9-.LCFI8
 16.5018 ++	.byte	0xe	/* DW_CFA_def_cfa_offset */
 16.5019 ++#if defined(__SH4__)
 16.5020 ++	.byte	8+56	/* uleb128 8+56 */
 16.5021 ++#else
 16.5022 ++	.byte	8+24	/* uleb128 8+24 */
 16.5023 ++#endif
 16.5024 ++	.byte	0x91	/* DW_CFA_offset, column 0x11 */
 16.5025 ++        .byte	0x2
 16.5026 ++        .byte	0x8e	/* DW_CFA_offset, column 0xe */
 16.5027 ++        .byte	0x1
 16.5028 ++	.byte	0x4	/* DW_CFA_advance_loc4 */
 16.5029 ++	.4byte	.LCFIA-.LCFI9
 16.5030 ++	.byte	0xd	/* DW_CFA_def_cfa_register */
 16.5031 ++	.byte	0xe	/* uleb128 0xe */
 16.5032 ++	.align	2
 16.5033 ++.LEFDE3:
 16.5034 +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/sparc/ffi.c gcc/libffi/src/sparc/ffi.c
 16.5035 +--- gcc-3.2.2.orig/libffi/src/sparc/ffi.c	Sat Mar  3 07:21:23 2001
 16.5036 ++++ gcc/libffi/src/sparc/ffi.c	Sat Jan  4 08:08:56 2003
 16.5037 +@@ -1,5 +1,5 @@
 16.5038 + /* -----------------------------------------------------------------------
 16.5039 +-   ffi.c - Copyright (c) 1996 Cygnus Solutions
 16.5040 ++   ffi.c - Copyright (c) 1996, 2003 Cygnus Solutions
 16.5041 +    
 16.5042 +    Sparc Foreign Function Interface 
 16.5043 + 
 16.5044 +@@ -28,20 +28,22 @@
 16.5045 + 
 16.5046 + #include <stdlib.h>
 16.5047 + 
 16.5048 ++#ifdef SPARC64
 16.5049 ++extern void ffi_closure_v9(void);
 16.5050 ++#else
 16.5051 ++extern void ffi_closure_v8(void);
 16.5052 ++#endif
 16.5053 ++
 16.5054 + /* ffi_prep_args is called by the assembly routine once stack space
 16.5055 +    has been allocated for the function's arguments */
 16.5056 + 
 16.5057 + void ffi_prep_args_v8(char *stack, extended_cif *ecif)
 16.5058 + {
 16.5059 +   int i;
 16.5060 +-  int tmp;
 16.5061 +-  int avn;
 16.5062 +   void **p_argv;
 16.5063 +   char *argp;
 16.5064 +   ffi_type **p_arg;
 16.5065 + 
 16.5066 +-  tmp = 0;
 16.5067 +-
 16.5068 +   /* Skip 16 words for the window save area */
 16.5069 +   argp = stack + 16*sizeof(int);
 16.5070 + 
 16.5071 +@@ -66,18 +68,12 @@
 16.5072 +   ((int*)argp)[5] = 0;
 16.5073 + #endif
 16.5074 + 
 16.5075 +-  avn = ecif->cif->nargs;
 16.5076 +   p_argv = ecif->avalue;
 16.5077 + 
 16.5078 +-  for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types;
 16.5079 +-       i && avn;
 16.5080 +-       i--, p_arg++)
 16.5081 ++  for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; i; i--, p_arg++)
 16.5082 +     {
 16.5083 +       size_t z;
 16.5084 + 
 16.5085 +-      if (avn) 
 16.5086 +-	{
 16.5087 +-	  avn--;
 16.5088 + 	  if ((*p_arg)->type == FFI_TYPE_STRUCT
 16.5089 + #if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
 16.5090 + 	      || (*p_arg)->type == FFI_TYPE_LONGDOUBLE
 16.5091 +@@ -122,7 +118,6 @@
 16.5092 + 	    }
 16.5093 + 	  p_argv++;
 16.5094 + 	  argp += z;
 16.5095 +-	}
 16.5096 +     }
 16.5097 +   
 16.5098 +   return;
 16.5099 +@@ -420,3 +415,101 @@
 16.5100 +     }
 16.5101 + 
 16.5102 + }
 16.5103 ++
 16.5104 ++ffi_status
 16.5105 ++ffi_prep_closure (ffi_closure* closure,
 16.5106 ++		  ffi_cif* cif,
 16.5107 ++		  void (*fun)(ffi_cif*, void*, void**, void*),
 16.5108 ++		  void *user_data)
 16.5109 ++{
 16.5110 ++  unsigned int *tramp = (unsigned int *) &closure->tramp[0];
 16.5111 ++  unsigned long fn;
 16.5112 ++  unsigned long ctx = (unsigned long) closure;
 16.5113 ++
 16.5114 ++#ifdef SPARC64
 16.5115 ++  /* Trampoline address is equal to the closure address.  We take advantage
 16.5116 ++     of that to reduce the trampoline size by 8 bytes. */
 16.5117 ++  FFI_ASSERT (cif->abi == FFI_V9);
 16.5118 ++  fn = (unsigned long) ffi_closure_v9;
 16.5119 ++  tramp[0] = 0x83414000;	/* rd	%pc, %g1	*/
 16.5120 ++  tramp[1] = 0xca586010;	/* ldx	[%g1+16], %g5	*/
 16.5121 ++  tramp[2] = 0x81c14000;	/* jmp	%g5		*/
 16.5122 ++  tramp[3] = 0x01000000;	/* nop			*/
 16.5123 ++  *((unsigned long *) &tramp[4]) = fn;
 16.5124 ++#else
 16.5125 ++  FFI_ASSERT (cif->abi == FFI_V8);
 16.5126 ++  fn = (unsigned long) ffi_closure_v8;
 16.5127 ++  tramp[0] = 0x03000000 | fn >> 10;	/* sethi %hi(fn), %g1	*/
 16.5128 ++  tramp[1] = 0x05000000 | ctx >> 10;	/* sethi %hi(ctx), %g2	*/
 16.5129 ++  tramp[2] = 0x81c06000 | (fn & 0x3ff);	/* jmp   %g1+%lo(fn)	*/
 16.5130 ++  tramp[3] = 0x8410a000 | (ctx & 0x3ff);/* or    %g2, %lo(ctx)	*/
 16.5131 ++#endif
 16.5132 ++
 16.5133 ++  closure->cif = cif;
 16.5134 ++  closure->fun = fun;
 16.5135 ++  closure->user_data = user_data;
 16.5136 ++
 16.5137 ++  /* Flush the Icache.  FIXME: alignment isn't certain, assume 8 bytes */
 16.5138 ++#ifdef SPARC64
 16.5139 ++  asm volatile ("flush	%0" : : "r" (closure) : "memory");
 16.5140 ++  asm volatile ("flush	%0" : : "r" (((char *) closure) + 8) : "memory");
 16.5141 ++#else
 16.5142 ++  asm volatile ("iflush	%0" : : "r" (closure) : "memory");
 16.5143 ++  asm volatile ("iflush	%0" : : "r" (((char *) closure) + 8) : "memory");
 16.5144 ++#endif
 16.5145 ++
 16.5146 ++  return FFI_OK;
 16.5147 ++}
 16.5148 ++
 16.5149 ++int
 16.5150 ++ffi_closure_sparc_inner(ffi_closure *closure,
 16.5151 ++  void *rvalue, unsigned long *gpr, double *fpr)
 16.5152 ++{
 16.5153 ++  ffi_cif *cif;
 16.5154 ++  void **avalue;
 16.5155 ++  ffi_type **arg_types;
 16.5156 ++  int i, avn, argn;
 16.5157 ++
 16.5158 ++  cif = closure->cif;
 16.5159 ++  avalue = alloca(cif->nargs * sizeof(void *));
 16.5160 ++
 16.5161 ++  argn = 0;
 16.5162 ++
 16.5163 ++  /* Copy the caller's structure return address to that the closure
 16.5164 ++     returns the data directly to the caller.  */
 16.5165 ++  if (cif->flags == FFI_TYPE_STRUCT)
 16.5166 ++    {
 16.5167 ++      rvalue = (void *) gpr[0];
 16.5168 ++      argn = 1;
 16.5169 ++    }
 16.5170 ++
 16.5171 ++  i = 0;
 16.5172 ++  avn = cif->nargs;
 16.5173 ++  arg_types = cif->arg_types;
 16.5174 ++  
 16.5175 ++  /* Grab the addresses of the arguments from the stack frame.  */
 16.5176 ++  while (i < avn)
 16.5177 ++    {
 16.5178 ++      /* Assume big-endian.  FIXME */
 16.5179 ++      argn += ALIGN(arg_types[i]->size, SIZEOF_ARG) / SIZEOF_ARG;
 16.5180 ++
 16.5181 ++#ifdef SPARC64
 16.5182 ++      if (i < 6 && (arg_types[i]->type == FFI_TYPE_FLOAT
 16.5183 ++		 || arg_types[i]->type == FFI_TYPE_DOUBLE
 16.5184 ++#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
 16.5185 ++		 || arg_types[i]->type == FFI_TYPE_LONGDOUBLE
 16.5186 ++#endif
 16.5187 ++		))
 16.5188 ++        avalue[i] = ((char *) &fpr[argn]) - arg_types[i]->size;
 16.5189 ++      else
 16.5190 ++#endif
 16.5191 ++        avalue[i] = ((char *) &gpr[argn]) - arg_types[i]->size;
 16.5192 ++      i++;
 16.5193 ++    }
 16.5194 ++
 16.5195 ++  /* Invoke the closure.  */
 16.5196 ++  (closure->fun) (cif, rvalue, avalue, closure->user_data);
 16.5197 ++
 16.5198 ++  /* Tell ffi_closure_sparc how to perform return type promotions.  */
 16.5199 ++  return cif->rtype->type;
 16.5200 ++}
 16.5201 +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/sparc/v8.S gcc/libffi/src/sparc/v8.S
 16.5202 +--- gcc-3.2.2.orig/libffi/src/sparc/v8.S	Mon Apr 29 05:12:04 2002
 16.5203 ++++ gcc/libffi/src/sparc/v8.S	Sat Jan  4 08:08:56 2003
 16.5204 +@@ -1,5 +1,5 @@
 16.5205 + /* -----------------------------------------------------------------------
 16.5206 +-   v8.S - Copyright (c) 1996, 1997 Cygnus Solutions
 16.5207 ++   v8.S - Copyright (c) 1996, 1997, 2003 Cygnus Solutions
 16.5208 +    
 16.5209 +    Sparc Foreign Function Interface 
 16.5210 + 
 16.5211 +@@ -94,6 +94,72 @@
 16.5212 + .ffi_call_V8_end:
 16.5213 + 	.size	ffi_call_V8,.ffi_call_V8_end-ffi_call_V8
 16.5214 + 
 16.5215 ++
 16.5216 ++#define	STACKFRAME	104	/* 16*4 register window +
 16.5217 ++				   1*4 struct return +	
 16.5218 ++				   6*4 args backing store +
 16.5219 ++				   3*4 locals */
 16.5220 ++
 16.5221 ++/* ffi_closure_v8(...)
 16.5222 ++
 16.5223 ++   Receives the closure argument in %g2.   */
 16.5224 ++
 16.5225 ++	.text
 16.5226 ++	.align 8
 16.5227 ++	.globl ffi_closure_v8
 16.5228 ++
 16.5229 ++ffi_closure_v8:
 16.5230 ++	.register	%g2, #scratch
 16.5231 ++.LLFB2:
 16.5232 ++	save	%sp, -STACKFRAME, %sp
 16.5233 ++.LLCFI1:
 16.5234 ++
 16.5235 ++	! Store all of the potential argument registers in va_list format.
 16.5236 ++	st	%i0, [%fp+68+0]
 16.5237 ++	st	%i1, [%fp+68+4]
 16.5238 ++	st	%i2, [%fp+68+8]
 16.5239 ++	st	%i3, [%fp+68+12]
 16.5240 ++	st	%i4, [%fp+68+16]
 16.5241 ++	st	%i5, [%fp+68+20]
 16.5242 ++
 16.5243 ++	! Call ffi_closure_sparc_inner to do the bulk of the work.
 16.5244 ++	mov	%g2, %o0
 16.5245 ++	add	%fp, -8, %o1
 16.5246 ++	add	%fp,  68, %o2
 16.5247 ++	call	ffi_closure_sparc_inner
 16.5248 ++	 mov	0, %o3
 16.5249 ++
 16.5250 ++	! Load up the return value in the proper type.
 16.5251 ++	cmp	%o0, FFI_TYPE_VOID
 16.5252 ++	be	done1
 16.5253 ++
 16.5254 ++	cmp	%o0, FFI_TYPE_FLOAT
 16.5255 ++	be,a	done1
 16.5256 ++	 ld	[%fp-8], %f0
 16.5257 ++
 16.5258 ++	cmp	%o0, FFI_TYPE_DOUBLE
 16.5259 ++	be,a	done1
 16.5260 ++	 ldd	[%fp-8], %f0
 16.5261 ++
 16.5262 ++	cmp	%o0, FFI_TYPE_SINT64
 16.5263 ++	be,a	integer
 16.5264 ++	 ld	[%fp-4], %i1
 16.5265 ++
 16.5266 ++	cmp	%o0, FFI_TYPE_UINT64
 16.5267 ++	be,a	integer
 16.5268 ++	 ld	[%fp-4], %i1
 16.5269 ++
 16.5270 ++integer:
 16.5271 ++	ld	[%fp-8], %i0
 16.5272 ++
 16.5273 ++done1:
 16.5274 ++	ret
 16.5275 ++	 restore
 16.5276 ++.LLFE2:
 16.5277 ++
 16.5278 ++.ffi_closure_v8_end:
 16.5279 ++	.size	ffi_closure_v8,.ffi_closure_v8_end-ffi_closure_v8
 16.5280 ++
 16.5281 + #ifdef SPARC64
 16.5282 + #define WS 8
 16.5283 + #define nword	xword
 16.5284 +@@ -148,3 +214,26 @@
 16.5285 + 	.byte	0x1f	! uleb128 0x1f
 16.5286 + 	.align	WS
 16.5287 + .LLEFDE1:
 16.5288 ++.LLSFDE2:
 16.5289 ++	.uaword	.LLEFDE2-.LLASFDE2	! FDE Length
 16.5290 ++.LLASFDE2:
 16.5291 ++	.uaword	.LLASFDE2-.LLframe1	! FDE CIE offset
 16.5292 ++#ifdef HAVE_AS_SPARC_UA_PCREL
 16.5293 ++	.uaword	%r_disp32(.LLFB2)
 16.5294 ++	.uaword	.LLFE2-.LLFB2	! FDE address range
 16.5295 ++#else
 16.5296 ++	.align	WS
 16.5297 ++	.nword	.LLFB2
 16.5298 ++	.uanword .LLFE2-.LLFB2	! FDE address range
 16.5299 ++#endif
 16.5300 ++	.byte	0x0	! uleb128 0x0; Augmentation size
 16.5301 ++	.byte	0x4	! DW_CFA_advance_loc4
 16.5302 ++	.uaword	.LLCFI1-.LLFB2
 16.5303 ++	.byte	0xd	! DW_CFA_def_cfa_register
 16.5304 ++	.byte	0x1e	! uleb128 0x1e
 16.5305 ++	.byte	0x2d	! DW_CFA_GNU_window_save
 16.5306 ++	.byte	0x9	! DW_CFA_register
 16.5307 ++	.byte	0xf	! uleb128 0xf
 16.5308 ++	.byte	0x1f	! uleb128 0x1f
 16.5309 ++	.align	WS
 16.5310 ++.LLEFDE2:
 16.5311 +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/sparc/v9.S gcc/libffi/src/sparc/v9.S
 16.5312 +--- gcc-3.2.2.orig/libffi/src/sparc/v9.S	Mon Apr 29 05:12:04 2002
 16.5313 ++++ gcc/libffi/src/sparc/v9.S	Sat Jan  4 08:08:56 2003
 16.5314 +@@ -1,5 +1,5 @@
 16.5315 + /* -----------------------------------------------------------------------
 16.5316 +-   v9.S - Copyright (c) 2000 Cygnus Solutions
 16.5317 ++   v9.S - Copyright (c) 2000, 2003 Cygnus Solutions
 16.5318 +    
 16.5319 +    Sparc 64bit Foreign Function Interface 
 16.5320 + 
 16.5321 +@@ -99,7 +99,7 @@
 16.5322 + 	cmp	%i3, FFI_TYPE_STRUCT
 16.5323 + 	be,pn	%icc, dostruct
 16.5324 + 
 16.5325 +-	 cmp	%i3, FFI_TYPE_LONGDOUBLE
 16.5326 ++	cmp	%i3, FFI_TYPE_LONGDOUBLE
 16.5327 + 	bne,pt	%icc, done
 16.5328 + 	 nop
 16.5329 + 	std	%f0, [%i4+0]
 16.5330 +@@ -125,6 +125,88 @@
 16.5331 + .ffi_call_V9_end:
 16.5332 + 	.size	ffi_call_V9,.ffi_call_V9_end-ffi_call_V9
 16.5333 + 
 16.5334 ++
 16.5335 ++#define	STACKFRAME	 240	/* 16*8 register window +
 16.5336 ++				   6*8 args backing store +
 16.5337 ++				   8*8 locals */
 16.5338 ++#define	FP		%fp+STACK_BIAS
 16.5339 ++
 16.5340 ++/* ffi_closure_v9(...)
 16.5341 ++
 16.5342 ++   Receives the closure argument in %g1.   */
 16.5343 ++
 16.5344 ++	.text
 16.5345 ++	.align 8
 16.5346 ++	.globl ffi_closure_v9
 16.5347 ++
 16.5348 ++ffi_closure_v9:
 16.5349 ++.LLFB2:
 16.5350 ++	save	%sp, -STACKFRAME, %sp
 16.5351 ++.LLCFI1:
 16.5352 ++
 16.5353 ++	! Store all of the potential argument registers in va_list format.
 16.5354 ++	stx	%i0, [FP+128+0]
 16.5355 ++	stx	%i1, [FP+128+8]
 16.5356 ++	stx	%i2, [FP+128+16]
 16.5357 ++	stx	%i3, [FP+128+24]
 16.5358 ++	stx	%i4, [FP+128+32]
 16.5359 ++	stx	%i5, [FP+128+40]
 16.5360 ++
 16.5361 ++	! Store possible floating point argument registers too.
 16.5362 ++	std	%f0, [FP-48]
 16.5363 ++	std	%f2, [FP-40]
 16.5364 ++	std	%f4, [FP-32]
 16.5365 ++	std	%f6, [FP-24]
 16.5366 ++	std	%f8, [FP-16]
 16.5367 ++	std	%f10, [FP-8]
 16.5368 ++
 16.5369 ++	! Call ffi_closure_sparc_inner to do the bulk of the work.
 16.5370 ++	mov	%g1, %o0
 16.5371 ++	add	%fp, STACK_BIAS-64, %o1
 16.5372 ++	add	%fp, STACK_BIAS+128, %o2
 16.5373 ++	call	ffi_closure_sparc_inner
 16.5374 ++	 add	%fp, STACK_BIAS-48, %o3
 16.5375 ++
 16.5376 ++	! Load up the return value in the proper type.
 16.5377 ++	cmp	%o0, FFI_TYPE_VOID
 16.5378 ++	be,pn	%icc, done1
 16.5379 ++
 16.5380 ++	cmp	%o0, FFI_TYPE_FLOAT
 16.5381 ++	be,a,pn	%icc, done1
 16.5382 ++	 ld	[FP-64], %f0
 16.5383 ++
 16.5384 ++	cmp	%o0, FFI_TYPE_DOUBLE
 16.5385 ++	be,a,pn	%icc, done1
 16.5386 ++	 ldd	[FP-64], %f0
 16.5387 ++
 16.5388 ++	cmp	%o0, FFI_TYPE_LONGDOUBLE
 16.5389 ++	be,a,pn	%icc, longdouble1
 16.5390 ++	 ldd	[FP-64], %f0
 16.5391 ++
 16.5392 ++	cmp	%o0, FFI_TYPE_STRUCT
 16.5393 ++	be,pn	%icc, struct1
 16.5394 ++
 16.5395 ++	! FFI_TYPE_UINT64 | FFI_TYPE_SINT64 | FFI_TYPE_POINTER
 16.5396 ++	ldx	[FP-64], %i0
 16.5397 ++
 16.5398 ++done1:
 16.5399 ++	ret
 16.5400 ++	 restore
 16.5401 ++
 16.5402 ++struct1:
 16.5403 ++	ldx [FP-56], %i2
 16.5404 ++	ret
 16.5405 ++	 restore
 16.5406 ++
 16.5407 ++longdouble1:
 16.5408 ++	ldd	[FP-56], %f2
 16.5409 ++	ret
 16.5410 ++	 restore
 16.5411 ++.LLFE2:
 16.5412 ++
 16.5413 ++.ffi_closure_v9_end:
 16.5414 ++	.size	ffi_closure_v9,.ffi_closure_v9_end-ffi_closure_v9
 16.5415 ++
 16.5416 + 	.section	".eh_frame",#alloc,#write
 16.5417 + .LLframe1:
 16.5418 + 	.uaword	.LLECIE1-.LLSCIE1	! Length of Common Information Entry
 16.5419 +@@ -169,5 +251,27 @@
 16.5420 + 	.byte	0x1f	! uleb128 0x1f
 16.5421 + 	.align 8
 16.5422 + .LLEFDE1:
 16.5423 +-
 16.5424 ++.LLSFDE2:
 16.5425 ++	.uaword	.LLEFDE2-.LLASFDE2	! FDE Length
 16.5426 ++.LLASFDE2:
 16.5427 ++	.uaword	.LLASFDE2-.LLframe1	! FDE CIE offset
 16.5428 ++#ifdef HAVE_AS_SPARC_UA_PCREL
 16.5429 ++	.uaword	%r_disp32(.LLFB2)
 16.5430 ++	.uaword	.LLFE2-.LLFB2		! FDE address range
 16.5431 ++#else
 16.5432 ++	.align 8
 16.5433 ++	.xword	.LLFB2
 16.5434 ++	.uaxword	.LLFE2-.LLFB2	! FDE address range
 16.5435 ++#endif
 16.5436 ++	.byte	0x0	! uleb128 0x0; Augmentation size
 16.5437 ++	.byte	0x4	! DW_CFA_advance_loc4
 16.5438 ++	.uaword	.LLCFI1-.LLFB2
 16.5439 ++	.byte	0xd	! DW_CFA_def_cfa_register
 16.5440 ++	.byte	0x1e	! uleb128 0x1e
 16.5441 ++	.byte	0x2d	! DW_CFA_GNU_window_save
 16.5442 ++	.byte	0x9	! DW_CFA_register
 16.5443 ++	.byte	0xf	! uleb128 0xf
 16.5444 ++	.byte	0x1f	! uleb128 0x1f
 16.5445 ++	.align 8
 16.5446 ++.LLEFDE2:
 16.5447 + #endif
 16.5448 +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/types.c gcc/libffi/src/types.c
 16.5449 +--- gcc-3.2.2.orig/libffi/src/types.c	Tue Mar 27 11:39:16 2001
 16.5450 ++++ gcc/libffi/src/types.c	Wed Nov 27 07:24:05 2002
 16.5451 +@@ -42,7 +42,8 @@
 16.5452 + FFI_INTEGRAL_TYPEDEF(sint32, 4, 4, FFI_TYPE_SINT32);
 16.5453 + FFI_INTEGRAL_TYPEDEF(float, 4, 4, FFI_TYPE_FLOAT);
 16.5454 + 
 16.5455 +-#if defined ALPHA || defined SPARC64
 16.5456 ++#if defined ALPHA || defined SPARC64 || defined X86_64 || defined S390X \
 16.5457 ++    || defined IA64
 16.5458 + 
 16.5459 + FFI_INTEGRAL_TYPEDEF(pointer, 8, 8, FFI_TYPE_POINTER);
 16.5460 + 
 16.5461 +@@ -52,22 +53,12 @@
 16.5462 + 
 16.5463 + #endif
 16.5464 + 
 16.5465 +-#ifdef X86
 16.5466 ++#if defined X86 || defined X86_WIN32 || defined ARM || defined M68K
 16.5467 + 
 16.5468 + FFI_INTEGRAL_TYPEDEF(uint64, 8, 4, FFI_TYPE_UINT64);
 16.5469 + FFI_INTEGRAL_TYPEDEF(sint64, 8, 4, FFI_TYPE_SINT64);
 16.5470 + 
 16.5471 +-#elif defined X86_WIN32
 16.5472 +-
 16.5473 +-FFI_INTEGRAL_TYPEDEF(uint64, 8, 4, FFI_TYPE_UINT64);
 16.5474 +-FFI_INTEGRAL_TYPEDEF(sint64, 8, 4, FFI_TYPE_SINT64);
 16.5475 +-
 16.5476 +-#elif defined ARM
 16.5477 +-
 16.5478 +-FFI_INTEGRAL_TYPEDEF(uint64, 8, 4, FFI_TYPE_UINT64);
 16.5479 +-FFI_INTEGRAL_TYPEDEF(sint64, 8, 4, FFI_TYPE_SINT64);
 16.5480 +-
 16.5481 +-#elif defined M68K
 16.5482 ++#elif defined SH
 16.5483 + 
 16.5484 + FFI_INTEGRAL_TYPEDEF(uint64, 8, 4, FFI_TYPE_UINT64);
 16.5485 + FFI_INTEGRAL_TYPEDEF(sint64, 8, 4, FFI_TYPE_SINT64);
 16.5486 +@@ -80,12 +71,7 @@
 16.5487 + #endif
 16.5488 + 
 16.5489 + 
 16.5490 +-#ifdef X86
 16.5491 +-
 16.5492 +-FFI_INTEGRAL_TYPEDEF(double, 8, 4, FFI_TYPE_DOUBLE);
 16.5493 +-FFI_INTEGRAL_TYPEDEF(longdouble, 12, 4, FFI_TYPE_LONGDOUBLE);
 16.5494 +-
 16.5495 +-#elif defined X86_WIN32
 16.5496 ++#if defined X86 || defined X86_WIN32 || defined M68K
 16.5497 + 
 16.5498 + FFI_INTEGRAL_TYPEDEF(double, 8, 4, FFI_TYPE_DOUBLE);
 16.5499 + FFI_INTEGRAL_TYPEDEF(longdouble, 12, 4, FFI_TYPE_LONGDOUBLE);
 16.5500 +@@ -95,25 +81,25 @@
 16.5501 + FFI_INTEGRAL_TYPEDEF(double, 8, 4, FFI_TYPE_DOUBLE);
 16.5502 + FFI_INTEGRAL_TYPEDEF(longdouble, 8, 4, FFI_TYPE_LONGDOUBLE);
 16.5503 + 
 16.5504 +-#elif defined M68K
 16.5505 ++#elif defined SH
 16.5506 + 
 16.5507 + FFI_INTEGRAL_TYPEDEF(double, 8, 4, FFI_TYPE_DOUBLE);
 16.5508 +-FFI_INTEGRAL_TYPEDEF(longdouble, 12, 4, FFI_TYPE_LONGDOUBLE);
 16.5509 ++FFI_INTEGRAL_TYPEDEF(longdouble, 8, 4, FFI_TYPE_LONGDOUBLE);
 16.5510 + 
 16.5511 + #elif defined SPARC
 16.5512 + 
 16.5513 + FFI_INTEGRAL_TYPEDEF(double, 8, 8, FFI_TYPE_DOUBLE);
 16.5514 +-
 16.5515 + #ifdef SPARC64
 16.5516 +-
 16.5517 + FFI_INTEGRAL_TYPEDEF(longdouble, 16, 16, FFI_TYPE_LONGDOUBLE);
 16.5518 +-
 16.5519 + #else
 16.5520 +-
 16.5521 + FFI_INTEGRAL_TYPEDEF(longdouble, 16, 8, FFI_TYPE_LONGDOUBLE);
 16.5522 +-
 16.5523 + #endif
 16.5524 + 
 16.5525 ++#elif defined X86_64
 16.5526 ++
 16.5527 ++FFI_INTEGRAL_TYPEDEF(double, 8, 8, FFI_TYPE_DOUBLE);
 16.5528 ++FFI_INTEGRAL_TYPEDEF(longdouble, 16, 16, FFI_TYPE_LONGDOUBLE);
 16.5529 ++
 16.5530 + #else
 16.5531 + 
 16.5532 + FFI_INTEGRAL_TYPEDEF(double, 8, 8, FFI_TYPE_DOUBLE);
 16.5533 +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/x86/ffi.c gcc/libffi/src/x86/ffi.c
 16.5534 +--- gcc-3.2.2.orig/libffi/src/x86/ffi.c	Tue May 28 18:22:08 2002
 16.5535 ++++ gcc/libffi/src/x86/ffi.c	Fri Dec  6 10:16:45 2002
 16.5536 +@@ -1,5 +1,8 @@
 16.5537 + /* -----------------------------------------------------------------------
 16.5538 +-   ffi.c - Copyright (c) 1996, 1998, 1999  Cygnus Solutions
 16.5539 ++   ffi.c - Copyright (c) 1996, 1998, 1999, 2001  Red Hat, Inc.
 16.5540 ++           Copyright (c) 2002  Ranjit Mathew
 16.5541 ++           Copyright (c) 2002  Bo Thorsen
 16.5542 ++           Copyright (c) 2002  Roger Sayle
 16.5543 +    
 16.5544 +    x86 Foreign Function Interface 
 16.5545 + 
 16.5546 +@@ -23,6 +26,8 @@
 16.5547 +    OTHER DEALINGS IN THE SOFTWARE.
 16.5548 +    ----------------------------------------------------------------------- */
 16.5549 + 
 16.5550 ++#ifndef __x86_64__
 16.5551 ++
 16.5552 + #include <ffi.h>
 16.5553 + #include <ffi_common.h>
 16.5554 + 
 16.5555 +@@ -36,12 +41,10 @@
 16.5556 + /*@=exportheader@*/
 16.5557 + {
 16.5558 +   register unsigned int i;
 16.5559 +-  register int tmp;
 16.5560 +   register void **p_argv;
 16.5561 +   register char *argp;
 16.5562 +   register ffi_type **p_arg;
 16.5563 + 
 16.5564 +-  tmp = 0;
 16.5565 +   argp = stack;
 16.5566 + 
 16.5567 +   if (ecif->cif->rtype->type == FFI_TYPE_STRUCT)
 16.5568 +@@ -148,6 +151,18 @@
 16.5569 + /*@=declundef@*/
 16.5570 + /*@=exportheader@*/
 16.5571 + 
 16.5572 ++#ifdef X86_WIN32
 16.5573 ++/*@-declundef@*/
 16.5574 ++/*@-exportheader@*/
 16.5575 ++extern void ffi_call_STDCALL(void (*)(char *, extended_cif *),
 16.5576 ++			  /*@out@*/ extended_cif *,
 16.5577 ++			  unsigned, unsigned,
 16.5578 ++			  /*@out@*/ unsigned *,
 16.5579 ++			  void (*fn)());
 16.5580 ++/*@=declundef@*/
 16.5581 ++/*@=exportheader@*/
 16.5582 ++#endif /* X86_WIN32 */
 16.5583 ++
 16.5584 + void ffi_call(/*@dependent@*/ ffi_cif *cif, 
 16.5585 + 	      void (*fn)(), 
 16.5586 + 	      /*@out@*/ void *rvalue, 
 16.5587 +@@ -180,6 +195,14 @@
 16.5588 + 		    cif->flags, ecif.rvalue, fn);
 16.5589 +       /*@=usedef@*/
 16.5590 +       break;
 16.5591 ++#ifdef X86_WIN32
 16.5592 ++    case FFI_STDCALL:
 16.5593 ++      /*@-usedef@*/
 16.5594 ++      ffi_call_STDCALL(ffi_prep_args, &ecif, cif->bytes,
 16.5595 ++		    cif->flags, ecif.rvalue, fn);
 16.5596 ++      /*@=usedef@*/
 16.5597 ++      break;
 16.5598 ++#endif /* X86_WIN32 */
 16.5599 +     default:
 16.5600 +       FFI_ASSERT(0);
 16.5601 +       break;
 16.5602 +@@ -266,12 +289,10 @@
 16.5603 + /*@=exportheader@*/
 16.5604 + {
 16.5605 +   register unsigned int i;
 16.5606 +-  register int tmp;
 16.5607 +   register void **p_argv;
 16.5608 +   register char *argp;
 16.5609 +   register ffi_type **p_arg;
 16.5610 + 
 16.5611 +-  tmp = 0;
 16.5612 +   argp = stack;
 16.5613 + 
 16.5614 +   if ( cif->rtype->type == FFI_TYPE_STRUCT ) {
 16.5615 +@@ -281,13 +302,14 @@
 16.5616 + 
 16.5617 +   p_argv = avalue;
 16.5618 + 
 16.5619 +-  for (i = cif->nargs, p_arg = cif->arg_types; i != 0; i--, p_arg++)
 16.5620 ++  for (i = cif->nargs, p_arg = cif->arg_types; (i != 0); i--, p_arg++)
 16.5621 +     {
 16.5622 +       size_t z;
 16.5623 + 
 16.5624 +       /* Align if necessary */
 16.5625 +-      if (((*p_arg)->alignment - 1) & (unsigned) argp)
 16.5626 ++      if (((*p_arg)->alignment - 1) & (unsigned) argp) {
 16.5627 + 	argp = (char *) ALIGN(argp, (*p_arg)->alignment);
 16.5628 ++      }
 16.5629 + 
 16.5630 +       z = (*p_arg)->size;
 16.5631 + 
 16.5632 +@@ -298,7 +320,7 @@
 16.5633 +       p_argv++;
 16.5634 +       argp += z;
 16.5635 +     }
 16.5636 +-
 16.5637 ++  
 16.5638 +   return;
 16.5639 + }
 16.5640 + 
 16.5641 +@@ -449,6 +471,15 @@
 16.5642 + 	      /*@out@*/ unsigned *, 
 16.5643 + 	      void (*fn)());
 16.5644 + 
 16.5645 ++#ifdef X86_WIN32
 16.5646 ++extern void
 16.5647 ++ffi_call_STDCALL(void (*)(char *, extended_cif *),
 16.5648 ++	      /*@out@*/ extended_cif *,
 16.5649 ++	      unsigned, unsigned,
 16.5650 ++	      /*@out@*/ unsigned *,
 16.5651 ++	      void (*fn)());
 16.5652 ++#endif /* X86_WIN32 */
 16.5653 ++
 16.5654 + void
 16.5655 + ffi_raw_call(/*@dependent@*/ ffi_cif *cif, 
 16.5656 + 	     void (*fn)(), 
 16.5657 +@@ -483,6 +514,14 @@
 16.5658 + 		    cif->flags, ecif.rvalue, fn);
 16.5659 +       /*@=usedef@*/
 16.5660 +       break;
 16.5661 ++#ifdef X86_WIN32
 16.5662 ++    case FFI_STDCALL:
 16.5663 ++      /*@-usedef@*/
 16.5664 ++      ffi_call_STDCALL(ffi_prep_args_raw, &ecif, cif->bytes,
 16.5665 ++		    cif->flags, ecif.rvalue, fn);
 16.5666 ++      /*@=usedef@*/
 16.5667 ++      break;
 16.5668 ++#endif /* X86_WIN32 */
 16.5669 +     default:
 16.5670 +       FFI_ASSERT(0);
 16.5671 +       break;
 16.5672 +@@ -490,3 +529,5 @@
 16.5673 + }
 16.5674 + 
 16.5675 + #endif
 16.5676 ++
 16.5677 ++#endif /* __x86_64__  */
 16.5678 +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/x86/ffi64.c gcc/libffi/src/x86/ffi64.c
 16.5679 +--- gcc-3.2.2.orig/libffi/src/x86/ffi64.c	Thu Jan  1 09:00:00 1970
 16.5680 ++++ gcc/libffi/src/x86/ffi64.c	Wed Jan 29 00:54:28 2003
 16.5681 +@@ -0,0 +1,706 @@
 16.5682 ++/* -----------------------------------------------------------------------
 16.5683 ++   ffi.c - Copyright (c) 2002  Bo Thorsen <bo@suse.de>
 16.5684 ++   
 16.5685 ++   x86-64 Foreign Function Interface 
 16.5686 ++
 16.5687 ++   Permission is hereby granted, free of charge, to any person obtaining
 16.5688 ++   a copy of this software and associated documentation files (the
 16.5689 ++   ``Software''), to deal in the Software without restriction, including
 16.5690 ++   without limitation the rights to use, copy, modify, merge, publish,
 16.5691 ++   distribute, sublicense, and/or sell copies of the Software, and to
 16.5692 ++   permit persons to whom the Software is furnished to do so, subject to
 16.5693 ++   the following conditions:
 16.5694 ++
 16.5695 ++   The above copyright notice and this permission notice shall be included
 16.5696 ++   in all copies or substantial portions of the Software.
 16.5697 ++
 16.5698 ++   THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
 16.5699 ++   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 16.5700 ++   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 16.5701 ++   IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR
 16.5702 ++   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 16.5703 ++   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 16.5704 ++   OTHER DEALINGS IN THE SOFTWARE.
 16.5705 ++   ----------------------------------------------------------------------- */
 16.5706 ++
 16.5707 ++#include <ffi.h>
 16.5708 ++#include <ffi_common.h>
 16.5709 ++
 16.5710 ++#include <stdlib.h>
 16.5711 ++#include <stdarg.h>
 16.5712 ++
 16.5713 ++/* ffi_prep_args is called by the assembly routine once stack space
 16.5714 ++   has been allocated for the function's arguments */
 16.5715 ++
 16.5716 ++#ifdef __x86_64__
 16.5717 ++
 16.5718 ++#define MAX_GPR_REGS 6
 16.5719 ++#define MAX_SSE_REGS 8
 16.5720 ++typedef struct
 16.5721 ++{
 16.5722 ++  /* Registers for argument passing.  */
 16.5723 ++  long gpr[MAX_GPR_REGS];
 16.5724 ++  __int128_t sse[MAX_SSE_REGS];
 16.5725 ++
 16.5726 ++  /* Stack space for arguments.  */
 16.5727 ++  char argspace[0];
 16.5728 ++} stackLayout;
 16.5729 ++
 16.5730 ++/* All reference to register classes here is identical to the code in
 16.5731 ++   gcc/config/i386/i386.c. Do *not* change one without the other.  */
 16.5732 ++
 16.5733 ++/* Register class used for passing given 64bit part of the argument.
 16.5734 ++   These represent classes as documented by the PS ABI, with the exception
 16.5735 ++   of SSESF, SSEDF classes, that are basically SSE class, just gcc will
 16.5736 ++   use SF or DFmode move instead of DImode to avoid reformating penalties.
 16.5737 ++
 16.5738 ++   Similary we play games with INTEGERSI_CLASS to use cheaper SImode moves
 16.5739 ++   whenever possible (upper half does contain padding).
 16.5740 ++ */
 16.5741 ++enum x86_64_reg_class
 16.5742 ++  {
 16.5743 ++    X86_64_NO_CLASS,
 16.5744 ++    X86_64_INTEGER_CLASS,
 16.5745 ++    X86_64_INTEGERSI_CLASS,
 16.5746 ++    X86_64_SSE_CLASS,
 16.5747 ++    X86_64_SSESF_CLASS,
 16.5748 ++    X86_64_SSEDF_CLASS,
 16.5749 ++    X86_64_SSEUP_CLASS,
 16.5750 ++    X86_64_X87_CLASS,
 16.5751 ++    X86_64_X87UP_CLASS,
 16.5752 ++    X86_64_MEMORY_CLASS
 16.5753 ++  };
 16.5754 ++
 16.5755 ++#define MAX_CLASSES 4
 16.5756 ++
 16.5757 ++/* x86-64 register passing implementation.  See x86-64 ABI for details.  Goal
 16.5758 ++   of this code is to classify each 8bytes of incoming argument by the register
 16.5759 ++   class and assign registers accordingly.  */
 16.5760 ++
 16.5761 ++/* Return the union class of CLASS1 and CLASS2.
 16.5762 ++   See the x86-64 PS ABI for details.  */
 16.5763 ++
 16.5764 ++static enum x86_64_reg_class
 16.5765 ++merge_classes (enum x86_64_reg_class class1, enum x86_64_reg_class class2)
 16.5766 ++{
 16.5767 ++  /* Rule #1: If both classes are equal, this is the resulting class.  */
 16.5768 ++  if (class1 == class2)
 16.5769 ++    return class1;
 16.5770 ++
 16.5771 ++  /* Rule #2: If one of the classes is NO_CLASS, the resulting class is
 16.5772 ++     the other class.  */
 16.5773 ++  if (class1 == X86_64_NO_CLASS)
 16.5774 ++    return class2;
 16.5775 ++  if (class2 == X86_64_NO_CLASS)
 16.5776 ++    return class1;
 16.5777 ++
 16.5778 ++  /* Rule #3: If one of the classes is MEMORY, the result is MEMORY.  */
 16.5779 ++  if (class1 == X86_64_MEMORY_CLASS || class2 == X86_64_MEMORY_CLASS)
 16.5780 ++    return X86_64_MEMORY_CLASS;
 16.5781 ++
 16.5782 ++  /* Rule #4: If one of the classes is INTEGER, the result is INTEGER.  */
 16.5783 ++  if ((class1 == X86_64_INTEGERSI_CLASS && class2 == X86_64_SSESF_CLASS)
 16.5784 ++      || (class2 == X86_64_INTEGERSI_CLASS && class1 == X86_64_SSESF_CLASS))
 16.5785 ++    return X86_64_INTEGERSI_CLASS;
 16.5786 ++  if (class1 == X86_64_INTEGER_CLASS || class1 == X86_64_INTEGERSI_CLASS
 16.5787 ++      || class2 == X86_64_INTEGER_CLASS || class2 == X86_64_INTEGERSI_CLASS)
 16.5788 ++    return X86_64_INTEGER_CLASS;
 16.5789 ++
 16.5790 ++  /* Rule #5: If one of the classes is X87 or X87UP class, MEMORY is used.  */
 16.5791 ++  if (class1 == X86_64_X87_CLASS || class1 == X86_64_X87UP_CLASS
 16.5792 ++      || class2 == X86_64_X87_CLASS || class2 == X86_64_X87UP_CLASS)
 16.5793 ++    return X86_64_MEMORY_CLASS;
 16.5794 ++
 16.5795 ++  /* Rule #6: Otherwise class SSE is used.  */
 16.5796 ++  return X86_64_SSE_CLASS;
 16.5797 ++}
 16.5798 ++
 16.5799 ++/* Classify the argument of type TYPE and mode MODE.
 16.5800 ++   CLASSES will be filled by the register class used to pass each word
 16.5801 ++   of the operand.  The number of words is returned.  In case the parameter
 16.5802 ++   should be passed in memory, 0 is returned. As a special case for zero
 16.5803 ++   sized containers, classes[0] will be NO_CLASS and 1 is returned.
 16.5804 ++
 16.5805 ++   See the x86-64 PS ABI for details.
 16.5806 ++*/
 16.5807 ++static int
 16.5808 ++classify_argument (ffi_type *type, enum x86_64_reg_class classes[],
 16.5809 ++		   int *byte_offset)
 16.5810 ++{
 16.5811 ++  /* First, align to the right place.  */
 16.5812 ++  *byte_offset = ALIGN(*byte_offset, type->alignment);
 16.5813 ++
 16.5814 ++  switch (type->type)
 16.5815 ++    {
 16.5816 ++    case FFI_TYPE_UINT8:
 16.5817 ++    case FFI_TYPE_SINT8:
 16.5818 ++    case FFI_TYPE_UINT16:
 16.5819 ++    case FFI_TYPE_SINT16:
 16.5820 ++    case FFI_TYPE_UINT32:
 16.5821 ++    case FFI_TYPE_SINT32:
 16.5822 ++    case FFI_TYPE_UINT64:
 16.5823 ++    case FFI_TYPE_SINT64:
 16.5824 ++    case FFI_TYPE_POINTER:
 16.5825 ++      if (((*byte_offset) % 8 + type->size) <= 4)
 16.5826 ++	classes[0] = X86_64_INTEGERSI_CLASS;
 16.5827 ++      else
 16.5828 ++	classes[0] = X86_64_INTEGER_CLASS;
 16.5829 ++      return 1;
 16.5830 ++    case FFI_TYPE_FLOAT:
 16.5831 ++      if (((*byte_offset) % 8) == 0)
 16.5832 ++	classes[0] = X86_64_SSESF_CLASS;
 16.5833 ++      else
 16.5834 ++	classes[0] = X86_64_SSE_CLASS;
 16.5835 ++      return 1;
 16.5836 ++    case FFI_TYPE_DOUBLE:
 16.5837 ++      classes[0] = X86_64_SSEDF_CLASS;
 16.5838 ++      return 1;
 16.5839 ++    case FFI_TYPE_LONGDOUBLE:
 16.5840 ++      classes[0] = X86_64_X87_CLASS;
 16.5841 ++      classes[1] = X86_64_X87UP_CLASS;
 16.5842 ++      return 2;
 16.5843 ++    case FFI_TYPE_STRUCT:
 16.5844 ++      {
 16.5845 ++	const int UNITS_PER_WORD = 8;
 16.5846 ++	int words = (type->size + UNITS_PER_WORD - 1) / UNITS_PER_WORD;
 16.5847 ++	ffi_type **ptr; 
 16.5848 ++	int i;
 16.5849 ++	enum x86_64_reg_class subclasses[MAX_CLASSES];
 16.5850 ++
 16.5851 ++	/* If the struct is larger than 16 bytes, pass it on the stack.  */
 16.5852 ++	if (type->size > 16)
 16.5853 ++	  return 0;
 16.5854 ++
 16.5855 ++	for (i = 0; i < words; i++)
 16.5856 ++	  classes[i] = X86_64_NO_CLASS;
 16.5857 ++
 16.5858 ++	/* Merge the fields of structure.  */
 16.5859 ++	for (ptr=type->elements; (*ptr)!=NULL; ptr++)
 16.5860 ++	  {
 16.5861 ++	    int num;
 16.5862 ++
 16.5863 ++	    num = classify_argument (*ptr, subclasses, byte_offset);
 16.5864 ++	    if (num == 0)
 16.5865 ++	      return 0;
 16.5866 ++	    for (i = 0; i < num; i++)
 16.5867 ++	      {
 16.5868 ++		int pos = *byte_offset / 8;
 16.5869 ++		classes[i + pos] =
 16.5870 ++		  merge_classes (subclasses[i], classes[i + pos]);
 16.5871 ++	      }
 16.5872 ++
 16.5873 ++	    if ((*ptr)->type != FFI_TYPE_STRUCT)
 16.5874 ++	      *byte_offset += (*ptr)->size;
 16.5875 ++	  }
 16.5876 ++
 16.5877 ++	/* Final merger cleanup.  */
 16.5878 ++	for (i = 0; i < words; i++)
 16.5879 ++	  {
 16.5880 ++	    /* If one class is MEMORY, everything should be passed in
 16.5881 ++	       memory.  */
 16.5882 ++	    if (classes[i] == X86_64_MEMORY_CLASS)
 16.5883 ++	      return 0;
 16.5884 ++
 16.5885 ++	    /* The X86_64_SSEUP_CLASS should be always preceded by
 16.5886 ++	       X86_64_SSE_CLASS.  */
 16.5887 ++	    if (classes[i] == X86_64_SSEUP_CLASS
 16.5888 ++		&& (i == 0 || classes[i - 1] != X86_64_SSE_CLASS))
 16.5889 ++	      classes[i] = X86_64_SSE_CLASS;
 16.5890 ++
 16.5891 ++	    /*  X86_64_X87UP_CLASS should be preceded by X86_64_X87_CLASS.  */
 16.5892 ++	    if (classes[i] == X86_64_X87UP_CLASS
 16.5893 ++		&& (i == 0 || classes[i - 1] != X86_64_X87_CLASS))
 16.5894 ++	      classes[i] = X86_64_SSE_CLASS;
 16.5895 ++	  }
 16.5896 ++	return words;
 16.5897 ++      }
 16.5898 ++
 16.5899 ++    default:
 16.5900 ++      FFI_ASSERT(0);
 16.5901 ++    }
 16.5902 ++  return 0; /* Never reached.  */
 16.5903 ++}
 16.5904 ++
 16.5905 ++/* Examine the argument and return set number of register required in each
 16.5906 ++   class.  Return 0 iff parameter should be passed in memory.  */
 16.5907 ++static int
 16.5908 ++examine_argument (ffi_type *type, int in_return, int *int_nregs,int *sse_nregs)
 16.5909 ++{
 16.5910 ++  enum x86_64_reg_class class[MAX_CLASSES];
 16.5911 ++  int offset = 0;
 16.5912 ++  int n;
 16.5913 ++
 16.5914 ++  n = classify_argument (type, class, &offset);
 16.5915 ++
 16.5916 ++  if (n == 0)
 16.5917 ++    return 0;
 16.5918 ++
 16.5919 ++  *int_nregs = 0;
 16.5920 ++  *sse_nregs = 0;
 16.5921 ++  for (n--; n>=0; n--)
 16.5922 ++    switch (class[n])
 16.5923 ++      {
 16.5924 ++      case X86_64_INTEGER_CLASS:
 16.5925 ++      case X86_64_INTEGERSI_CLASS:
 16.5926 ++	(*int_nregs)++;
 16.5927 ++	break;
 16.5928 ++      case X86_64_SSE_CLASS:
 16.5929 ++      case X86_64_SSESF_CLASS:
 16.5930 ++      case X86_64_SSEDF_CLASS:
 16.5931 ++	(*sse_nregs)++;
 16.5932 ++	break;
 16.5933 ++      case X86_64_NO_CLASS:
 16.5934 ++      case X86_64_SSEUP_CLASS:
 16.5935 ++	break;
 16.5936 ++      case X86_64_X87_CLASS:
 16.5937 ++      case X86_64_X87UP_CLASS:
 16.5938 ++	if (!in_return)
 16.5939 ++	  return 0;
 16.5940 ++	break;
 16.5941 ++      default:
 16.5942 ++	abort ();
 16.5943 ++      }
 16.5944 ++  return 1;
 16.5945 ++}
 16.5946 ++
 16.5947 ++/* Functions to load floats and double to an SSE register placeholder.  */
 16.5948 ++extern void float2sse (float, __int128_t *);
 16.5949 ++extern void double2sse (double, __int128_t *);
 16.5950 ++extern void floatfloat2sse (void *, __int128_t *);
 16.5951 ++
 16.5952 ++/* Functions to put the floats and doubles back.  */
 16.5953 ++extern float sse2float (__int128_t *);
 16.5954 ++extern double sse2double (__int128_t *);
 16.5955 ++extern void sse2floatfloat(__int128_t *, void *);
 16.5956 ++
 16.5957 ++/*@-exportheader@*/
 16.5958 ++void
 16.5959 ++ffi_prep_args (stackLayout *stack, extended_cif *ecif)
 16.5960 ++/*@=exportheader@*/
 16.5961 ++{
 16.5962 ++  int gprcount, ssecount, i, g, s;
 16.5963 ++  void **p_argv;
 16.5964 ++  void *argp = &stack->argspace;
 16.5965 ++  ffi_type **p_arg;
 16.5966 ++
 16.5967 ++  /* First check if the return value should be passed in memory. If so,
 16.5968 ++     pass the pointer as the first argument.  */
 16.5969 ++  gprcount = ssecount = 0;
 16.5970 ++  if (ecif->cif->rtype->type != FFI_TYPE_VOID 
 16.5971 ++      && examine_argument (ecif->cif->rtype, 1, &g, &s) == 0)
 16.5972 ++    (void *)stack->gpr[gprcount++] = ecif->rvalue;
 16.5973 ++
 16.5974 ++  for (i=ecif->cif->nargs, p_arg=ecif->cif->arg_types, p_argv = ecif->avalue;
 16.5975 ++       i!=0; i--, p_arg++, p_argv++)
 16.5976 ++    {
 16.5977 ++      int in_register = 0;
 16.5978 ++
 16.5979 ++      switch ((*p_arg)->type)
 16.5980 ++	{
 16.5981 ++	case FFI_TYPE_SINT8:
 16.5982 ++	case FFI_TYPE_SINT16:
 16.5983 ++	case FFI_TYPE_SINT32:
 16.5984 ++	case FFI_TYPE_SINT64:
 16.5985 ++	case FFI_TYPE_UINT8:
 16.5986 ++	case FFI_TYPE_UINT16:
 16.5987 ++	case FFI_TYPE_UINT32:
 16.5988 ++	case FFI_TYPE_UINT64:
 16.5989 ++	case FFI_TYPE_POINTER:
 16.5990 ++	  if (gprcount < MAX_GPR_REGS)
 16.5991 ++	    {
 16.5992 ++	      stack->gpr[gprcount] = 0;
 16.5993 ++	      stack->gpr[gprcount++] = *(long long *)(*p_argv);
 16.5994 ++	      in_register = 1;
 16.5995 ++	    }
 16.5996 ++	  break;
 16.5997 ++
 16.5998 ++	case FFI_TYPE_FLOAT:
 16.5999 ++	  if (ssecount < MAX_SSE_REGS)
 16.6000 ++	    {
 16.6001 ++	      float2sse (*(float *)(*p_argv), &stack->sse[ssecount++]);
 16.6002 ++	      in_register = 1;
 16.6003 ++	    }
 16.6004 ++	  break;
 16.6005 ++
 16.6006 ++	case FFI_TYPE_DOUBLE:
 16.6007 ++	  if (ssecount < MAX_SSE_REGS)
 16.6008 ++	    {
 16.6009 ++	      double2sse (*(double *)(*p_argv), &stack->sse[ssecount++]);
 16.6010 ++	      in_register = 1;
 16.6011 ++	    }
 16.6012 ++	  break;
 16.6013 ++	}
 16.6014 ++
 16.6015 ++      if (in_register)
 16.6016 ++	continue;
 16.6017 ++
 16.6018 ++      /* Either all places in registers where filled, or this is a
 16.6019 ++	 type that potentially goes into a memory slot.  */
 16.6020 ++      if (examine_argument (*p_arg, 0, &g, &s) == 0
 16.6021 ++	  || gprcount + g > MAX_GPR_REGS || ssecount + s > MAX_SSE_REGS)
 16.6022 ++	{
 16.6023 ++	  /* Pass this argument in memory.  */
 16.6024 ++	  argp = (void *)ALIGN(argp, (*p_arg)->alignment);
 16.6025 ++	  memcpy (argp, *p_argv, (*p_arg)->size);
 16.6026 ++	  argp += (*p_arg)->size;
 16.6027 ++	}
 16.6028 ++      else
 16.6029 ++	{
 16.6030 ++	  /* All easy cases are eliminated. Now fire the big guns.  */
 16.6031 ++
 16.6032 ++	  enum x86_64_reg_class classes[MAX_CLASSES];
 16.6033 ++	  int offset = 0, j, num;
 16.6034 ++	  void *a;
 16.6035 ++
 16.6036 ++	  num = classify_argument (*p_arg, classes, &offset);
 16.6037 ++	  for (j=0, a=*p_argv; j<num; j++, a+=8)
 16.6038 ++	    {
 16.6039 ++	      switch (classes[j])
 16.6040 ++		{
 16.6041 ++		case X86_64_INTEGER_CLASS:
 16.6042 ++		case X86_64_INTEGERSI_CLASS:
 16.6043 ++		  stack->gpr[gprcount++] = *(long long *)a;
 16.6044 ++		  break;
 16.6045 ++		case X86_64_SSE_CLASS:
 16.6046 ++		  floatfloat2sse (a, &stack->sse[ssecount++]);
 16.6047 ++		  break;
 16.6048 ++		case X86_64_SSESF_CLASS:
 16.6049 ++		  float2sse (*(float *)a, &stack->sse[ssecount++]);
 16.6050 ++		  break;
 16.6051 ++		case X86_64_SSEDF_CLASS:
 16.6052 ++		  double2sse (*(double *)a, &stack->sse[ssecount++]);
 16.6053 ++		  break;
 16.6054 ++		default:
 16.6055 ++		  abort();
 16.6056 ++		}
 16.6057 ++	    }
 16.6058 ++	}
 16.6059 ++    }
 16.6060 ++}
 16.6061 ++
 16.6062 ++/* Perform machine dependent cif processing.  */
 16.6063 ++ffi_status
 16.6064 ++ffi_prep_cif_machdep (ffi_cif *cif)
 16.6065 ++{
 16.6066 ++  int gprcount, ssecount, i, g, s;
 16.6067 ++
 16.6068 ++  gprcount = ssecount = 0;
 16.6069 ++
 16.6070 ++  /* Reset the byte count. We handle this size estimation here.  */
 16.6071 ++  cif->bytes = 0;
 16.6072 ++
 16.6073 ++  /* If the return value should be passed in memory, pass the pointer
 16.6074 ++     as the first argument. The actual memory isn't allocated here.  */
 16.6075 ++  if (cif->rtype->type != FFI_TYPE_VOID 
 16.6076 ++      && examine_argument (cif->rtype, 1, &g, &s) == 0)
 16.6077 ++    gprcount = 1;
 16.6078 ++
 16.6079 ++  /* Go over all arguments and determine the way they should be passed.
 16.6080 ++     If it's in a register and there is space for it, let that be so. If
 16.6081 ++     not, add it's size to the stack byte count.  */
 16.6082 ++  for (i=0; i<cif->nargs; i++)
 16.6083 ++    {
 16.6084 ++      if (examine_argument (cif->arg_types[i], 0, &g, &s) == 0
 16.6085 ++	  || gprcount + g > MAX_GPR_REGS || ssecount + s > MAX_SSE_REGS)
 16.6086 ++	{
 16.6087 ++	  /* This is passed in memory. First align to the basic type.  */
 16.6088 ++	  cif->bytes = ALIGN(cif->bytes, cif->arg_types[i]->alignment);
 16.6089 ++
 16.6090 ++	  /* Stack arguments are *always* at least 8 byte aligned.  */
 16.6091 ++	  cif->bytes = ALIGN(cif->bytes, 8);
 16.6092 ++
 16.6093 ++	  /* Now add the size of this argument.  */
 16.6094 ++	  cif->bytes += cif->arg_types[i]->size;
 16.6095 ++	}
 16.6096 ++      else
 16.6097 ++	{
 16.6098 ++	  gprcount += g;
 16.6099 ++	  ssecount += s;
 16.6100 ++	}
 16.6101 ++    }
 16.6102 ++
 16.6103 ++  /* Set the flag for the closures return.  */
 16.6104 ++    switch (cif->rtype->type)
 16.6105 ++    {
 16.6106 ++    case FFI_TYPE_VOID:
 16.6107 ++    case FFI_TYPE_STRUCT:
 16.6108 ++    case FFI_TYPE_SINT64:
 16.6109 ++    case FFI_TYPE_FLOAT:
 16.6110 ++    case FFI_TYPE_DOUBLE:
 16.6111 ++    case FFI_TYPE_LONGDOUBLE:
 16.6112 ++      cif->flags = (unsigned) cif->rtype->type;
 16.6113 ++      break;
 16.6114 ++
 16.6115 ++    case FFI_TYPE_UINT64:
 16.6116 ++      cif->flags = FFI_TYPE_SINT64;
 16.6117 ++      break;
 16.6118 ++
 16.6119 ++    default:
 16.6120 ++      cif->flags = FFI_TYPE_INT;
 16.6121 ++      break;
 16.6122 ++    }
 16.6123 ++
 16.6124 ++  return FFI_OK;
 16.6125 ++}
 16.6126 ++
 16.6127 ++typedef struct
 16.6128 ++{
 16.6129 ++  long gpr[2];
 16.6130 ++  __int128_t sse[2];
 16.6131 ++  long double st0;
 16.6132 ++} return_value;
 16.6133 ++
 16.6134 ++void
 16.6135 ++ffi_fill_return_value (return_value *rv, extended_cif *ecif)
 16.6136 ++{
 16.6137 ++  enum x86_64_reg_class classes[MAX_CLASSES];
 16.6138 ++  int i = 0, num;
 16.6139 ++  long *gpr = rv->gpr;
 16.6140 ++  __int128_t *sse = rv->sse;
 16.6141 ++  signed char sc;
 16.6142 ++  signed short ss;
 16.6143 ++
 16.6144 ++  /* This is needed because of the way x86-64 handles signed short
 16.6145 ++     integers.  */
 16.6146 ++  switch (ecif->cif->rtype->type)
 16.6147 ++    {
 16.6148 ++    case FFI_TYPE_SINT8:
 16.6149 ++      sc = *(signed char *)gpr;
 16.6150 ++      *(long long *)ecif->rvalue = (long long)sc;
 16.6151 ++      return;
 16.6152 ++    case FFI_TYPE_SINT16:
 16.6153 ++      ss = *(signed short *)gpr;
 16.6154 ++      *(long long *)ecif->rvalue = (long long)ss;
 16.6155 ++      return;
 16.6156 ++    default:
 16.6157 ++      /* Just continue.  */
 16.6158 ++      ;
 16.6159 ++    }
 16.6160 ++
 16.6161 ++  num = classify_argument (ecif->cif->rtype, classes, &i);
 16.6162 ++
 16.6163 ++  if (num == 0)
 16.6164 ++    /* Return in memory.  */
 16.6165 ++    ecif->rvalue = (void *) rv->gpr[0];
 16.6166 ++  else if (num == 2 && classes[0] == X86_64_X87_CLASS &&
 16.6167 ++	classes[1] == X86_64_X87UP_CLASS)
 16.6168 ++    /* This is a long double (this is easiest to handle this way instead
 16.6169 ++       of an eightbyte at a time as in the loop below.  */
 16.6170 ++    *((long double *)ecif->rvalue) = rv->st0;
 16.6171 ++  else
 16.6172 ++    {
 16.6173 ++      void *a;
 16.6174 ++
 16.6175 ++      for (i=0, a=ecif->rvalue; i<num; i++, a+=8)
 16.6176 ++	{
 16.6177 ++	  switch (classes[i])
 16.6178 ++	    {
 16.6179 ++	    case X86_64_INTEGER_CLASS:
 16.6180 ++	    case X86_64_INTEGERSI_CLASS:
 16.6181 ++	      *(long long *)a = *gpr;
 16.6182 ++	      gpr++;
 16.6183 ++	      break;
 16.6184 ++	    case X86_64_SSE_CLASS:
 16.6185 ++	      sse2floatfloat (sse++, a);
 16.6186 ++	      break;
 16.6187 ++	    case X86_64_SSESF_CLASS:
 16.6188 ++	      *(float *)a = sse2float (sse++);
 16.6189 ++	      break;
 16.6190 ++	    case X86_64_SSEDF_CLASS:
 16.6191 ++	      *(double *)a = sse2double (sse++);
 16.6192 ++	      break;
 16.6193 ++	    default:
 16.6194 ++	      abort();
 16.6195 ++	    }
 16.6196 ++	}
 16.6197 ++    }
 16.6198 ++}
 16.6199 ++
 16.6200 ++/*@-declundef@*/
 16.6201 ++/*@-exportheader@*/
 16.6202 ++extern void ffi_call_UNIX64(void (*)(stackLayout *, extended_cif *),
 16.6203 ++			    void (*) (return_value *, extended_cif *),
 16.6204 ++			    /*@out@*/ extended_cif *, 
 16.6205 ++			    unsigned, /*@out@*/ unsigned *, void (*fn)());
 16.6206 ++/*@=declundef@*/
 16.6207 ++/*@=exportheader@*/
 16.6208 ++
 16.6209 ++void ffi_call(/*@dependent@*/ ffi_cif *cif, 
 16.6210 ++	      void (*fn)(), 
 16.6211 ++	      /*@out@*/ void *rvalue, 
 16.6212 ++	      /*@dependent@*/ void **avalue)
 16.6213 ++{
 16.6214 ++  extended_cif ecif;
 16.6215 ++  int dummy;
 16.6216 ++
 16.6217 ++  ecif.cif = cif;
 16.6218 ++  ecif.avalue = avalue;
 16.6219 ++  
 16.6220 ++  /* If the return value is a struct and we don't have a return	*/
 16.6221 ++  /* value address then we need to make one		        */
 16.6222 ++
 16.6223 ++  if ((rvalue == NULL) && 
 16.6224 ++      (examine_argument (cif->rtype, 1, &dummy, &dummy) == 0))
 16.6225 ++    {
 16.6226 ++      /*@-sysunrecog@*/
 16.6227 ++      ecif.rvalue = alloca(cif->rtype->size);
 16.6228 ++      /*@=sysunrecog@*/
 16.6229 ++    }
 16.6230 ++  else
 16.6231 ++    ecif.rvalue = rvalue;
 16.6232 ++    
 16.6233 ++  /* Stack must always be 16byte aligned. Make it so.  */
 16.6234 ++  cif->bytes = ALIGN(cif->bytes, 16);
 16.6235 ++  
 16.6236 ++  switch (cif->abi) 
 16.6237 ++    {
 16.6238 ++    case FFI_SYSV:
 16.6239 ++      /* Calling 32bit code from 64bit is not possible  */
 16.6240 ++      FFI_ASSERT(0);
 16.6241 ++      break;
 16.6242 ++
 16.6243 ++    case FFI_UNIX64:
 16.6244 ++      /*@-usedef@*/
 16.6245 ++      ffi_call_UNIX64 (ffi_prep_args, ffi_fill_return_value, &ecif,
 16.6246 ++		       cif->bytes, ecif.rvalue, fn);
 16.6247 ++      /*@=usedef@*/
 16.6248 ++      break;
 16.6249 ++
 16.6250 ++    default:
 16.6251 ++      FFI_ASSERT(0);
 16.6252 ++      break;
 16.6253 ++    }
 16.6254 ++}
 16.6255 ++
 16.6256 ++extern void ffi_closure_UNIX64(void);
 16.6257 ++
 16.6258 ++ffi_status
 16.6259 ++ffi_prep_closure (ffi_closure* closure,
 16.6260 ++		  ffi_cif* cif,
 16.6261 ++		  void (*fun)(ffi_cif*, void*, void**, void*),
 16.6262 ++		  void *user_data)
 16.6263 ++{
 16.6264 ++  volatile unsigned short *tramp;
 16.6265 ++
 16.6266 ++  /* FFI_ASSERT (cif->abi == FFI_OSF);  */
 16.6267 ++
 16.6268 ++  tramp = (volatile unsigned short *) &closure->tramp[0];
 16.6269 ++  tramp[0] = 0xbb49;		/* mov <code>, %r11	*/
 16.6270 ++  tramp[5] = 0xba49;		/* mov <data>, %r10	*/
 16.6271 ++  tramp[10] = 0xff49;		/* jmp *%r11	*/
 16.6272 ++  tramp[11] = 0x00e3;
 16.6273 ++  *(void * volatile *) &tramp[1] = ffi_closure_UNIX64;
 16.6274 ++  *(void * volatile *) &tramp[6] = closure;
 16.6275 ++
 16.6276 ++  closure->cif = cif;
 16.6277 ++  closure->fun = fun;
 16.6278 ++  closure->user_data = user_data;
 16.6279 ++
 16.6280 ++  return FFI_OK;
 16.6281 ++}
 16.6282 ++
 16.6283 ++int
 16.6284 ++ffi_closure_UNIX64_inner(ffi_closure *closure, va_list l, void *rp)
 16.6285 ++{
 16.6286 ++  ffi_cif *cif;
 16.6287 ++  void **avalue;
 16.6288 ++  ffi_type **arg_types;
 16.6289 ++  long i, avn, argn;
 16.6290 ++
 16.6291 ++  cif = closure->cif;
 16.6292 ++  avalue = alloca(cif->nargs * sizeof(void *));
 16.6293 ++
 16.6294 ++  argn = 0;
 16.6295 ++
 16.6296 ++  i = 0;
 16.6297 ++  avn = cif->nargs;
 16.6298 ++  arg_types = cif->arg_types;
 16.6299 ++  
 16.6300 ++  /* Grab the addresses of the arguments from the stack frame.  */
 16.6301 ++  while (i < avn)
 16.6302 ++    {
 16.6303 ++      switch (arg_types[i]->type)
 16.6304 ++	{
 16.6305 ++	case FFI_TYPE_SINT8:
 16.6306 ++	case FFI_TYPE_UINT8:
 16.6307 ++	case FFI_TYPE_SINT16:
 16.6308 ++	case FFI_TYPE_UINT16:
 16.6309 ++	case FFI_TYPE_SINT32:
 16.6310 ++	case FFI_TYPE_UINT32:
 16.6311 ++	case FFI_TYPE_SINT64:
 16.6312 ++	case FFI_TYPE_UINT64:
 16.6313 ++	case FFI_TYPE_POINTER:
 16.6314 ++	  {
 16.6315 ++	    if (l->gp_offset > 48-8)
 16.6316 ++	      {
 16.6317 ++		avalue[i] = l->overflow_arg_area;
 16.6318 ++		l->overflow_arg_area = (char *)l->overflow_arg_area + 8;
 16.6319 ++	      }
 16.6320 ++	    else
 16.6321 ++	      {
 16.6322 ++		avalue[i] = (char *)l->reg_save_area + l->gp_offset;
 16.6323 ++		l->gp_offset += 8;
 16.6324 ++	      }
 16.6325 ++	  }
 16.6326 ++	  break;
 16.6327 ++
 16.6328 ++	case FFI_TYPE_STRUCT:
 16.6329 ++	  /* FIXME  */
 16.6330 ++	  FFI_ASSERT(0);
 16.6331 ++	  break;
 16.6332 ++
 16.6333 ++	case FFI_TYPE_DOUBLE:
 16.6334 ++	  {
 16.6335 ++	    if (l->fp_offset > 176-16)
 16.6336 ++	      {
 16.6337 ++		avalue[i] = l->overflow_arg_area;
 16.6338 ++		l->overflow_arg_area = (char *)l->overflow_arg_area + 8;
 16.6339 ++	      }
 16.6340 ++	    else
 16.6341 ++	      {
 16.6342 ++		avalue[i] = (char *)l->reg_save_area + l->fp_offset;
 16.6343 ++		l->fp_offset += 16;
 16.6344 ++	      }
 16.6345 ++	  }
 16.6346 ++#if DEBUG_FFI
 16.6347 ++	  fprintf (stderr, "double arg %d = %g\n", i, *(double *)avalue[i]);
 16.6348 ++#endif
 16.6349 ++	  break;
 16.6350 ++	  
 16.6351 ++	case FFI_TYPE_FLOAT:
 16.6352 ++	  {
 16.6353 ++	    if (l->fp_offset > 176-16)
 16.6354 ++	      {
 16.6355 ++		avalue[i] = l->overflow_arg_area;
 16.6356 ++		l->overflow_arg_area = (char *)l->overflow_arg_area + 8;
 16.6357 ++	      }
 16.6358 ++	    else
 16.6359 ++	      {
 16.6360 ++		avalue[i] = (char *)l->reg_save_area + l->fp_offset;
 16.6361 ++		l->fp_offset += 16;
 16.6362 ++	      }
 16.6363 ++	  }
 16.6364 ++#if DEBUG_FFI
 16.6365 ++	  fprintf (stderr, "float arg %d = %g\n", i, *(float *)avalue[i]);
 16.6366 ++#endif
 16.6367 ++	  break;
 16.6368 ++	  
 16.6369 ++	default:
 16.6370 ++	  FFI_ASSERT(0);
 16.6371 ++	}
 16.6372 ++
 16.6373 ++      argn += ALIGN(arg_types[i]->size, SIZEOF_ARG) / SIZEOF_ARG;
 16.6374 ++      i++;
 16.6375 ++    }
 16.6376 ++
 16.6377 ++  /* Invoke the closure.  */
 16.6378 ++  (closure->fun) (cif, rp, avalue, closure->user_data);
 16.6379 ++
 16.6380 ++  /* FIXME: Structs not supported.  */
 16.6381 ++  FFI_ASSERT(cif->rtype->type != FFI_TYPE_STRUCT);
 16.6382 ++
 16.6383 ++  /* Tell ffi_closure_UNIX64 how to perform return type promotions.  */
 16.6384 ++
 16.6385 ++  return cif->rtype->type;
 16.6386 ++}
 16.6387 ++#endif /* ifndef __x86_64__ */
 16.6388 +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/x86/sysv.S gcc/libffi/src/x86/sysv.S
 16.6389 +--- gcc-3.2.2.orig/libffi/src/x86/sysv.S	Tue Jul 17 02:10:53 2001
 16.6390 ++++ gcc/libffi/src/x86/sysv.S	Fri Jul 19 08:08:31 2002
 16.6391 +@@ -1,5 +1,5 @@
 16.6392 + /* -----------------------------------------------------------------------
 16.6393 +-   sysv.S - Copyright (c) 1996, 1998, 2001  Cygnus Solutions
 16.6394 ++   sysv.S - Copyright (c) 1996, 1998, 2001, 2002  Cygnus Solutions
 16.6395 +    
 16.6396 +    X86 Foreign Function Interface 
 16.6397 + 
 16.6398 +@@ -23,6 +23,8 @@
 16.6399 +    OTHER DEALINGS IN THE SOFTWARE.
 16.6400 +    ----------------------------------------------------------------------- */
 16.6401 + 
 16.6402 ++#ifndef __x86_64__
 16.6403 ++
 16.6404 + #define LIBFFI_ASM	
 16.6405 + #include <ffi.h>
 16.6406 + 
 16.6407 +@@ -163,3 +165,5 @@
 16.6408 + 	.align 4
 16.6409 + .LEFDE1:
 16.6410 + 	.set	.LLFDE1,.LEFDE1-.LSFDE1
 16.6411 ++
 16.6412 ++#endif /* ifndef __x86_64__ */
 16.6413 +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/x86/unix64.S gcc/libffi/src/x86/unix64.S
 16.6414 +--- gcc-3.2.2.orig/libffi/src/x86/unix64.S	Thu Jan  1 09:00:00 1970
 16.6415 ++++ gcc/libffi/src/x86/unix64.S	Wed Jan 29 00:54:28 2003
 16.6416 +@@ -0,0 +1,302 @@
 16.6417 ++/* -----------------------------------------------------------------------
 16.6418 ++   unix64.S - Copyright (c) 2002  Bo Thorsen <bo@suse.de>
 16.6419 ++
 16.6420 ++   x86-64 Foreign Function Interface 
 16.6421 ++
 16.6422 ++   Permission is hereby granted, free of charge, to any person obtaining
 16.6423 ++   a copy of this software and associated documentation files (the
 16.6424 ++   ``Software''), to deal in the Software without restriction, including
 16.6425 ++   without limitation the rights to use, copy, modify, merge, publish,
 16.6426 ++   distribute, sublicense, and/or sell copies of the Software, and to
 16.6427 ++   permit persons to whom the Software is furnished to do so, subject to
 16.6428 ++   the following conditions:
 16.6429 ++
 16.6430 ++   The above copyright notice and this permission notice shall be included
 16.6431 ++   in all copies or substantial portions of the Software.
 16.6432 ++
 16.6433 ++   THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
 16.6434 ++   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 16.6435 ++   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 16.6436 ++   IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR
 16.6437 ++   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 16.6438 ++   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 16.6439 ++   OTHER DEALINGS IN THE SOFTWARE.
 16.6440 ++   ----------------------------------------------------------------------- */
 16.6441 ++
 16.6442 ++#ifdef __x86_64__
 16.6443 ++#define LIBFFI_ASM	
 16.6444 ++#include <ffi.h>
 16.6445 ++
 16.6446 ++	.section	.rodata
 16.6447 ++.LC0:
 16.6448 ++	.string	"asm in progress %lld\n"
 16.6449 ++.LC1:
 16.6450 ++	.string	"asm in progress\n"
 16.6451 ++.text
 16.6452 ++	.align	2
 16.6453 ++.globl ffi_call_UNIX64
 16.6454 ++        .type	ffi_call_UNIX64,@function
 16.6455 ++
 16.6456 ++ffi_call_UNIX64:
 16.6457 ++.LFB1:
 16.6458 ++        pushq	%rbp
 16.6459 ++.LCFI0:
 16.6460 ++        movq	%rsp, %rbp
 16.6461 ++.LCFI1:
 16.6462 ++	/* Save all arguments */
 16.6463 ++	subq	$48, %rsp
 16.6464 ++.LCFI2:
 16.6465 ++	movq	%rdi, -8(%rbp)		/* ffi_prep_args	 */
 16.6466 ++	movq	%rsi, -16(%rbp)		/* ffi_fill_return_value */
 16.6467 ++	movq	%rdx, -24(%rbp)		/* ecif			 */
 16.6468 ++	movq	%rcx, -32(%rbp)		/* cif->bytes		 */
 16.6469 ++	movq	%r8, -40(%rbp)		/* ecif.rvalue		 */
 16.6470 ++	movq	%r9, -48(%rbp)		/* fn			 */
 16.6471 ++
 16.6472 ++	/* Make room for all of the new args and the register args */
 16.6473 ++	addl	$176, %ecx
 16.6474 ++.LCFI3:
 16.6475 ++	subq	%rcx, %rsp
 16.6476 ++.LCFI4:
 16.6477 ++	/* Setup the call to ffi_prep_args.  */
 16.6478 ++	movq	%rdi, %rax		/* &ffi_prep_args	*/
 16.6479 ++	movq	%rsp, %rdi		/* stackLayout		*/
 16.6480 ++	movq	%rdx, %rsi		/* ecif			*/
 16.6481 ++	call	*%rax			/* ffi_prep_args(stackLayout, ecif);*/ 
 16.6482 ++
 16.6483 ++	/* ffi_prep_args have put all the register contents into the  */
 16.6484 ++	/* stackLayout struct. Now put the register values in place.  */
 16.6485 ++	movq	(%rsp), %rdi
 16.6486 ++	movq	8(%rsp), %rsi
 16.6487 ++	movq	16(%rsp), %rdx
 16.6488 ++	movq	24(%rsp), %rcx
 16.6489 ++	movq	32(%rsp), %r8
 16.6490 ++	movq	40(%rsp), %r9
 16.6491 ++	movaps	48(%rsp), %xmm0
 16.6492 ++	movaps	64(%rsp), %xmm1
 16.6493 ++	movaps	80(%rsp), %xmm2
 16.6494 ++	movaps	96(%rsp), %xmm3
 16.6495 ++	movaps	112(%rsp), %xmm4
 16.6496 ++	movaps	128(%rsp), %xmm5
 16.6497 ++	movaps	144(%rsp), %xmm6
 16.6498 ++	movaps	160(%rsp), %xmm7
 16.6499 ++
 16.6500 ++	/* Remove space for stackLayout so stack arguments are placed
 16.6501 ++	   correctly for the call.  */
 16.6502 ++.LCFI5:
 16.6503 ++	addq	$176, %rsp
 16.6504 ++.LCFI6:
 16.6505 ++	/* Call the user function.  */
 16.6506 ++	call	*-48(%rbp)
 16.6507 ++
 16.6508 ++	/* Make stack space for the return_value struct.  */
 16.6509 ++	subq	$64, %rsp
 16.6510 ++
 16.6511 ++	/* Fill in all potential return values to this struct.  */
 16.6512 ++	movq	%rax, (%rsp)
 16.6513 ++	movq	%rdx, 8(%rsp)
 16.6514 ++	movaps	%xmm0, 16(%rsp)
 16.6515 ++	movaps	%xmm1, 32(%rsp)
 16.6516 ++	fstpt	48(%rsp)
 16.6517 ++
 16.6518 ++	/* Now call ffi_fill_return_value.  */
 16.6519 ++	movq	%rsp, %rdi		/* struct return_value	  */
 16.6520 ++	movq	-24(%rbp), %rsi		/* ecif			  */
 16.6521 ++	movq	-16(%rbp), %rax		/* &ffi_fill_return_value */
 16.6522 ++	call	*%rax			/* call it		  */
 16.6523 ++
 16.6524 ++	/* And the work is done.  */
 16.6525 ++        leave
 16.6526 ++        ret
 16.6527 ++.LFE1:
 16.6528 ++.ffi_call_UNIX64_end:
 16.6529 ++        .size    ffi_call_UNIX64,.ffi_call_UNIX64_end-ffi_call_UNIX64
 16.6530 ++
 16.6531 ++.text
 16.6532 ++	.align	2
 16.6533 ++.globl float2sse
 16.6534 ++        .type	float2sse,@function
 16.6535 ++float2sse:
 16.6536 ++	/* Save the contents of this sse-float in a pointer.  */
 16.6537 ++	movaps	%xmm0, (%rdi)
 16.6538 ++	ret
 16.6539 ++
 16.6540 ++	.align	2
 16.6541 ++.globl floatfloat2sse
 16.6542 ++        .type	floatfloat2sse,@function
 16.6543 ++floatfloat2sse:
 16.6544 ++	/* Save the contents of these two sse-floats in a pointer.  */
 16.6545 ++	movq	(%rdi), %xmm0
 16.6546 ++	movaps	%xmm0, (%rsi)
 16.6547 ++	ret
 16.6548 ++
 16.6549 ++	.align	2
 16.6550 ++.globl double2sse
 16.6551 ++        .type	double2sse,@function
 16.6552 ++double2sse:
 16.6553 ++	/* Save the contents of this sse-double in a pointer.  */
 16.6554 ++	movaps	%xmm0, (%rdi)
 16.6555 ++	ret
 16.6556 ++
 16.6557 ++	.align	2
 16.6558 ++.globl sse2float
 16.6559 ++        .type	sse2float,@function
 16.6560 ++sse2float:
 16.6561 ++	/* Save the contents of this sse-float in a pointer.  */
 16.6562 ++	movaps	(%rdi), %xmm0
 16.6563 ++	ret
 16.6564 ++
 16.6565 ++	.align	2
 16.6566 ++.globl sse2double
 16.6567 ++        .type	sse2double,@function
 16.6568 ++sse2double:
 16.6569 ++	/* Save the contents of this pointer in a sse-double.  */
 16.6570 ++	movaps	(%rdi), %xmm0
 16.6571 ++	ret
 16.6572 ++
 16.6573 ++	.align	2
 16.6574 ++.globl sse2floatfloat
 16.6575 ++        .type	sse2floatfloat,@function
 16.6576 ++sse2floatfloat:
 16.6577 ++	/* Save the contents of this pointer in two sse-floats.  */
 16.6578 ++	movaps	(%rdi), %xmm0
 16.6579 ++	movq	%xmm0, (%rsi)
 16.6580 ++	ret
 16.6581 ++
 16.6582 ++	.align	2
 16.6583 ++.globl ffi_closure_UNIX64
 16.6584 ++        .type	ffi_closure_UNIX64,@function
 16.6585 ++
 16.6586 ++ffi_closure_UNIX64:
 16.6587 ++.LFB2:
 16.6588 ++        pushq   %rbp
 16.6589 ++.LCFI10:
 16.6590 ++        movq    %rsp, %rbp
 16.6591 ++.LCFI11:
 16.6592 ++        subq    $240, %rsp
 16.6593 ++.LCFI12:
 16.6594 ++	movq	%rdi, -176(%rbp)
 16.6595 ++        movq    %rsi, -168(%rbp)
 16.6596 ++        movq    %rdx, -160(%rbp)
 16.6597 ++        movq    %rcx, -152(%rbp)
 16.6598 ++        movq    %r8, -144(%rbp)
 16.6599 ++        movq    %r9, -136(%rbp)
 16.6600 ++        /* FIXME: We can avoid all this stashing of XMM registers by
 16.6601 ++	   (in ffi_prep_closure) computing the number of
 16.6602 ++	   floating-point args and moving it into %rax before calling
 16.6603 ++	   this function.  Once this is done, uncomment the next few
 16.6604 ++	   lines and only the essential XMM registers will be written
 16.6605 ++	   to memory.  This is a significant saving.  */
 16.6606 ++/*         movzbl  %al, %eax  */
 16.6607 ++/*         movq    %rax, %rdx */
 16.6608 ++/*         leaq    0(,%rdx,4), %rax */
 16.6609 ++/*         leaq    2f(%rip), %rdx */
 16.6610 ++/*         subq    %rax, %rdx */
 16.6611 ++        leaq    -1(%rbp), %rax
 16.6612 ++/*         jmp     *%rdx */
 16.6613 ++        movaps  %xmm7, -15(%rax)
 16.6614 ++        movaps  %xmm6, -31(%rax)
 16.6615 ++        movaps  %xmm5, -47(%rax)
 16.6616 ++        movaps  %xmm4, -63(%rax)
 16.6617 ++        movaps  %xmm3, -79(%rax)
 16.6618 ++        movaps  %xmm2, -95(%rax)
 16.6619 ++        movaps  %xmm1, -111(%rax)
 16.6620 ++        movaps  %xmm0, -127(%rax)
 16.6621 ++2:
 16.6622 ++        movl    %edi, -180(%rbp)
 16.6623 ++        movl    $0, -224(%rbp)
 16.6624 ++        movl    $48, -220(%rbp)
 16.6625 ++        leaq    16(%rbp), %rax
 16.6626 ++        movq    %rax, -216(%rbp)
 16.6627 ++        leaq    -176(%rbp), %rdx
 16.6628 ++        movq    %rdx, -208(%rbp)
 16.6629 ++        leaq    -224(%rbp), %rsi
 16.6630 ++	movq	%r10, %rdi
 16.6631 ++	movq	%rsp, %rdx
 16.6632 ++        call    ffi_closure_UNIX64_inner@PLT
 16.6633 ++
 16.6634 ++	cmpl	$FFI_TYPE_FLOAT, %eax
 16.6635 ++	je	1f
 16.6636 ++	cmpl	$FFI_TYPE_DOUBLE, %eax
 16.6637 ++	je	2f
 16.6638 ++	cmpl	$FFI_TYPE_LONGDOUBLE, %eax
 16.6639 ++	je	3f
 16.6640 ++	cmpl	$FFI_TYPE_STRUCT, %eax
 16.6641 ++	je	4f
 16.6642 ++	popq	%rax
 16.6643 ++        leave
 16.6644 ++        ret
 16.6645 ++1:
 16.6646 ++2:
 16.6647 ++3:	
 16.6648 ++	movaps	-240(%rbp), %xmm0
 16.6649 ++        leave
 16.6650 ++        ret
 16.6651 ++4:
 16.6652 ++	leave
 16.6653 ++	ret
 16.6654 ++.LFE2:	
 16.6655 ++		
 16.6656 ++        .section        .eh_frame,"a",@progbits
 16.6657 ++.Lframe0:
 16.6658 ++        .long   .LECIE1-.LSCIE1
 16.6659 ++.LSCIE1:
 16.6660 ++        .long   0x0
 16.6661 ++        .byte   0x1
 16.6662 ++        .string "zR"
 16.6663 ++        .uleb128 0x1
 16.6664 ++        .sleb128 -8
 16.6665 ++        .byte   0x10
 16.6666 ++        .uleb128 0x1
 16.6667 ++        .byte   0x1b
 16.6668 ++        .byte   0xc
 16.6669 ++        .uleb128 0x7
 16.6670 ++        .uleb128 0x8
 16.6671 ++        .byte   0x90
 16.6672 ++        .uleb128 0x1
 16.6673 ++        .align 8
 16.6674 ++.LECIE1:
 16.6675 ++.LSFDE1:
 16.6676 ++	.long	.LEFDE1-.LASFDE1
 16.6677 ++.LASFDE1:
 16.6678 ++        .long   .LASFDE1-.Lframe0
 16.6679 ++
 16.6680 ++        .long   .LFB1-.
 16.6681 ++        .long   .LFE1-.LFB1
 16.6682 ++        .uleb128 0x0
 16.6683 ++        .byte   0x4		# DW_CFA_advance_loc4
 16.6684 ++        .long   .LCFI0-.LFB1
 16.6685 ++        .byte   0xe		# DW_CFA_def_cfa_offset
 16.6686 ++        .uleb128 0x10
 16.6687 ++        .byte   0x86		# DW_CFA_offset: r6 at cfa-16
 16.6688 ++        .uleb128 0x2
 16.6689 ++        .byte   0x4		# DW_CFA_advance_loc4
 16.6690 ++        .long   .LCFI1-.LCFI0
 16.6691 ++        .byte   0x86		# DW_CFA_offset: r6 at cfa-16
 16.6692 ++        .uleb128 0x2
 16.6693 ++        .byte   0xd		# DW_CFA_def_cfa_reg: r6
 16.6694 ++        .uleb128 0x6
 16.6695 ++	.align 8
 16.6696 ++.LEFDE1:
 16.6697 ++.LSFDE3:
 16.6698 ++        .long   .LEFDE3-.LASFDE3        # FDE Length
 16.6699 ++.LASFDE3:
 16.6700 ++        .long   .LASFDE3-.Lframe0       # FDE CIE offset
 16.6701 ++
 16.6702 ++        .long   .LFB2-. # FDE initial location
 16.6703 ++        .long   .LFE2-.LFB2     # FDE address range
 16.6704 ++        .uleb128 0x0    # Augmentation size
 16.6705 ++        .byte   0x4     # DW_CFA_advance_loc4
 16.6706 ++        .long   .LCFI10-.LFB2
 16.6707 ++        .byte   0xe     # DW_CFA_def_cfa_offset
 16.6708 ++        .uleb128 0x10
 16.6709 ++        .byte   0x86    # DW_CFA_offset, column 0x6
 16.6710 ++        .uleb128 0x2
 16.6711 ++        .byte   0x4     # DW_CFA_advance_loc4
 16.6712 ++        .long   .LCFI11-.LCFI10
 16.6713 ++        .byte   0xd     # DW_CFA_def_cfa_register
 16.6714 ++        .uleb128 0x6
 16.6715 ++        .align 8
 16.6716 ++.LEFDE3:
 16.6717 ++
 16.6718 ++#endif /* __x86_64__  */
 16.6719 +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/x86/win32.S gcc/libffi/src/x86/win32.S
 16.6720 +--- gcc-3.2.2.orig/libffi/src/x86/win32.S	Tue Mar 27 11:39:16 2001
 16.6721 ++++ gcc/libffi/src/x86/win32.S	Fri Dec  6 10:16:45 2002
 16.6722 +@@ -1,5 +1,8 @@
 16.6723 + /* -----------------------------------------------------------------------
 16.6724 +-   win32.S - Copyright (c) 1996, 1998, 2001  Cygnus Solutions
 16.6725 ++   win32.S - Copyright (c) 1996, 1998, 2001, 2002  Red Hat, Inc.
 16.6726 ++	     Copyright (c) 2001  John Beniton
 16.6727 ++	     Copyright (c) 2002  Ranjit Mathew
 16.6728 ++			
 16.6729 +  
 16.6730 +    X86 Foreign Function Interface
 16.6731 +  
 16.6732 +@@ -52,7 +55,10 @@
 16.6733 +         # Return stack to previous state and call the function
 16.6734 +         addl  $8,%esp
 16.6735 +  
 16.6736 +-        call  *28(%ebp)
 16.6737 ++        # FIXME: Align the stack to a 128-bit boundary to avoid
 16.6738 ++        # potential performance hits.
 16.6739 ++
 16.6740 ++	call  *28(%ebp)
 16.6741 +  
 16.6742 +         # Remove the space we pushed for the args
 16.6743 +         movl  16(%ebp),%ecx
 16.6744 +@@ -123,3 +129,98 @@
 16.6745 +         ret
 16.6746 +  
 16.6747 + .ffi_call_SYSV_end:
 16.6748 ++
 16.6749 ++        # This assumes we are using gas.
 16.6750 ++        .balign 16
 16.6751 ++.globl _ffi_call_STDCALL
 16.6752 ++
 16.6753 ++_ffi_call_STDCALL:
 16.6754 ++        pushl %ebp
 16.6755 ++        movl  %esp,%ebp
 16.6756 ++
 16.6757 ++        # Make room for all of the new args.
 16.6758 ++        movl  16(%ebp),%ecx 
 16.6759 ++        subl  %ecx,%esp
 16.6760 ++
 16.6761 ++        movl  %esp,%eax
 16.6762 ++
 16.6763 ++        # Place all of the ffi_prep_args in position
 16.6764 ++        pushl 12(%ebp)
 16.6765 ++        pushl %eax
 16.6766 ++        call  *8(%ebp)
 16.6767 ++
 16.6768 ++        # Return stack to previous state and call the function
 16.6769 ++        addl  $8,%esp
 16.6770 ++
 16.6771 ++        # FIXME: Align the stack to a 128-bit boundary to avoid
 16.6772 ++        # potential performance hits.
 16.6773 ++
 16.6774 ++        call  *28(%ebp)
 16.6775 ++
 16.6776 ++        # stdcall functions pop arguments off the stack themselves
 16.6777 ++
 16.6778 ++        # Load %ecx with the return type code
 16.6779 ++        movl  20(%ebp),%ecx
 16.6780 ++
 16.6781 ++        # If the return value pointer is NULL, assume no return value.
 16.6782 ++        cmpl  $0,24(%ebp)
 16.6783 ++        jne   sc_retint
 16.6784 ++
 16.6785 ++        # Even if there is no space for the return value, we are
 16.6786 ++        # obliged to handle floating-point values.
 16.6787 ++        cmpl  $FFI_TYPE_FLOAT,%ecx
 16.6788 ++        jne   sc_noretval
 16.6789 ++        fstp  %st(0)
 16.6790 ++
 16.6791 ++        jmp   sc_epilogue
 16.6792 ++
 16.6793 ++sc_retint:
 16.6794 ++        cmpl  $FFI_TYPE_INT,%ecx
 16.6795 ++        jne   sc_retfloat
 16.6796 ++        # Load %ecx with the pointer to storage for the return value
 16.6797 ++        movl  24(%ebp),%ecx
 16.6798 ++        movl  %eax,0(%ecx)
 16.6799 ++        jmp   sc_epilogue
 16.6800 ++
 16.6801 ++sc_retfloat:
 16.6802 ++        cmpl  $FFI_TYPE_FLOAT,%ecx
 16.6803 ++        jne   sc_retdouble
 16.6804 ++         # Load %ecx with the pointer to storage for the return value
 16.6805 ++        movl  24(%ebp),%ecx
 16.6806 ++        fstps (%ecx)
 16.6807 ++        jmp   sc_epilogue
 16.6808 ++
 16.6809 ++sc_retdouble:
 16.6810 ++        cmpl  $FFI_TYPE_DOUBLE,%ecx
 16.6811 ++        jne   sc_retlongdouble
 16.6812 ++        # Load %ecx with the pointer to storage for the return value
 16.6813 ++        movl  24(%ebp),%ecx
 16.6814 ++        fstpl (%ecx)
 16.6815 ++        jmp   sc_epilogue
 16.6816 ++
 16.6817 ++sc_retlongdouble:
 16.6818 ++        cmpl  $FFI_TYPE_LONGDOUBLE,%ecx
 16.6819 ++        jne   sc_retint64
 16.6820 ++        # Load %ecx with the pointer to storage for the return value
 16.6821 ++        movl  24(%ebp),%ecx
 16.6822 ++        fstpt (%ecx)
 16.6823 ++        jmp   sc_epilogue
 16.6824 ++
 16.6825 ++sc_retint64:
 16.6826 ++        cmpl  $FFI_TYPE_SINT64,%ecx
 16.6827 ++        jne   sc_retstruct
 16.6828 ++        # Load %ecx with the pointer to storage for the return value
 16.6829 ++        movl  24(%ebp),%ecx
 16.6830 ++        movl  %eax,0(%ecx)
 16.6831 ++        movl  %edx,4(%ecx)
 16.6832 ++
 16.6833 ++sc_retstruct:
 16.6834 ++        # Nothing to do!
 16.6835 ++
 16.6836 ++sc_noretval:
 16.6837 ++sc_epilogue:
 16.6838 ++        movl %ebp,%esp
 16.6839 ++        popl %ebp
 16.6840 ++        ret
 16.6841 ++
 16.6842 ++.ffi_call_STDCALL_end:
 16.6843 +--- gcc-3.2.2.orig/libjava/configure.host	Mon Jun 10 13:15:26 2002
 16.6844 ++++ gcc-3.2.2/libjava/configure.host	Sat Feb 15 19:57:25 2003
 16.6845 +@@ -115,6 +115,12 @@
 16.6846 + 	enable_getenv_properties_default=no
 16.6847 + 	enable_main_args_default=no
 16.6848 + 	;;
 16.6849 ++  sh-* | sh[34]*-*)
 16.6850 ++	sysdeps_dir=sh
 16.6851 ++	libgcj_flags="${libgcj_flags} -mieee"
 16.6852 ++	libgcj_interpreter=yes
 16.6853 ++	enable_hash_synchronization_default=yes
 16.6854 ++	;;
 16.6855 + esac
 16.6856 + 
 16.6857 + # This case statement supports generic port properties and may refine
 16.6858 +@@ -126,7 +132,8 @@
 16.6859 +   powerpc*-linux* | \
 16.6860 +   alpha*-linux* | \
 16.6861 +   sparc*-linux* | \
 16.6862 +-  ia64-*)
 16.6863 ++  ia64-* | \
 16.6864 ++  sh-linux* | sh[34]*-linux*)
 16.6865 +   	can_unwind_signal=yes
 16.6866 + 	;;
 16.6867 +   *-*-darwin*)
    17.1 --- a/patches/gcc/3.2.3/150-gcc-3.2.3-ppc-asm-spec.patch	Mon Jul 28 20:17:48 2008 +0000
    17.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.3 @@ -1,54 +0,0 @@
    17.4 -Based on gcc-3.4.0/gcc-3.3.3h-ppc-asm-spec.patch
    17.5 -
    17.6 -Fixes the following errors when building gcc for ppc7450:
    17.7 -
    17.8 -/tmp/ccYph3gd.s: Assembler messages:
    17.9 -/tmp/ccYph3gd.s:3823: Error: Unrecognized opcode: `mfvrsave'
   17.10 -/tmp/ccYph3gd.s:3857: Error: Unrecognized opcode: `stvx'
   17.11 -/tmp/ccYph3gd.s:4026: Error: Unrecognized opcode: `lvx'
   17.12 -/tmp/ccYph3gd.s:4027: Error: Unrecognized opcode: `mtvrsave'
   17.13 -make[2]: *** [libgcc/./unwind-dw2.o] Error 1
   17.14 -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'
   17.15 -make[1]: *** [stmp-multilib] Error 2
   17.16 -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'
   17.17 -make: *** [all-gcc] Error 2
   17.18 -
   17.19 -Note that the "-mcpu=7450" option must appear on the "gcc" command line in
   17.20 -order for "-maltivec" to be passed to the assembler.  Or, "-maltivec" itself
   17.21 -may be passed to the "gcc" command.
   17.22 -
   17.23 -Contributed by Tom Warzeka <waz@quahog.npt.nuwc.navy.mil>
   17.24 -
   17.25 -===================================================================
   17.26 ---- gcc-3.2.3/gcc/config/rs6000/rs6000.h~	2003-03-29 07:39:20.000000000 -0500
   17.27 -+++ gcc-3.2.3/gcc/config/rs6000/rs6000.h	2004-08-23 16:33:21.000000000 -0400
   17.28 -@@ -77,8 +77,8 @@
   17.29 - %{mcpu=604e: -D_ARCH_PPC} \
   17.30 - %{mcpu=620: -D_ARCH_PPC} \
   17.31 - %{mcpu=740: -D_ARCH_PPC} \
   17.32 --%{mcpu=7400: -D_ARCH_PPC} \
   17.33 --%{mcpu=7450: -D_ARCH_PPC} \
   17.34 -+%{mcpu=7400: -D_ARCH_PPC -D__ALTIVEC__} \
   17.35 -+%{mcpu=7450: -D_ARCH_PPC -D__ALTIVEC__} \
   17.36 - %{mcpu=750: -D_ARCH_PPC} \
   17.37 - %{mcpu=801: -D_ARCH_PPC} \
   17.38 - %{mcpu=821: -D_ARCH_PPC} \
   17.39 -@@ -117,14 +117,15 @@
   17.40 - %{mcpu=604e: -mppc} \
   17.41 - %{mcpu=620: -mppc} \
   17.42 - %{mcpu=740: -mppc} \
   17.43 --%{mcpu=7400: -mppc} \
   17.44 --%{mcpu=7450: -mppc} \
   17.45 -+%{mcpu=7400: -mppc -maltivec} \
   17.46 -+%{mcpu=7450: -mppc -maltivec} \
   17.47 - %{mcpu=750: -mppc} \
   17.48 - %{mcpu=801: -mppc} \
   17.49 - %{mcpu=821: -mppc} \
   17.50 - %{mcpu=823: -mppc} \
   17.51 - %{mcpu=860: -mppc} \
   17.52 --%{maltivec: -maltivec}"
   17.53 -+%{maltivec: -maltivec} \
   17.54 -+-many"
   17.55 - 
   17.56 - #define CPP_DEFAULT_SPEC ""
   17.57 - 
    18.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.2 +++ b/patches/gcc/3.2.3/150-ppc-asm-spec.patch	Mon Jul 28 21:08:01 2008 +0000
    18.3 @@ -0,0 +1,54 @@
    18.4 +Based on gcc-3.4.0/gcc-3.3.3h-ppc-asm-spec.patch
    18.5 +
    18.6 +Fixes the following errors when building gcc for ppc7450:
    18.7 +
    18.8 +/tmp/ccYph3gd.s: Assembler messages:
    18.9 +/tmp/ccYph3gd.s:3823: Error: Unrecognized opcode: `mfvrsave'
   18.10 +/tmp/ccYph3gd.s:3857: Error: Unrecognized opcode: `stvx'
   18.11 +/tmp/ccYph3gd.s:4026: Error: Unrecognized opcode: `lvx'
   18.12 +/tmp/ccYph3gd.s:4027: Error: Unrecognized opcode: `mtvrsave'
   18.13 +make[2]: *** [libgcc/./unwind-dw2.o] Error 1
   18.14 +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'
   18.15 +make[1]: *** [stmp-multilib] Error 2
   18.16 +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'
   18.17 +make: *** [all-gcc] Error 2
   18.18 +
   18.19 +Note that the "-mcpu=7450" option must appear on the "gcc" command line in
   18.20 +order for "-maltivec" to be passed to the assembler.  Or, "-maltivec" itself
   18.21 +may be passed to the "gcc" command.
   18.22 +
   18.23 +Contributed by Tom Warzeka <waz@quahog.npt.nuwc.navy.mil>
   18.24 +
   18.25 +===================================================================
   18.26 +--- gcc-3.2.3/gcc/config/rs6000/rs6000.h~	2003-03-29 07:39:20.000000000 -0500
   18.27 ++++ gcc-3.2.3/gcc/config/rs6000/rs6000.h	2004-08-23 16:33:21.000000000 -0400
   18.28 +@@ -77,8 +77,8 @@
   18.29 + %{mcpu=604e: -D_ARCH_PPC} \
   18.30 + %{mcpu=620: -D_ARCH_PPC} \
   18.31 + %{mcpu=740: -D_ARCH_PPC} \
   18.32 +-%{mcpu=7400: -D_ARCH_PPC} \
   18.33 +-%{mcpu=7450: -D_ARCH_PPC} \
   18.34 ++%{mcpu=7400: -D_ARCH_PPC -D__ALTIVEC__} \
   18.35 ++%{mcpu=7450: -D_ARCH_PPC -D__ALTIVEC__} \
   18.36 + %{mcpu=750: -D_ARCH_PPC} \
   18.37 + %{mcpu=801: -D_ARCH_PPC} \
   18.38 + %{mcpu=821: -D_ARCH_PPC} \
   18.39 +@@ -117,14 +117,15 @@
   18.40 + %{mcpu=604e: -mppc} \
   18.41 + %{mcpu=620: -mppc} \
   18.42 + %{mcpu=740: -mppc} \
   18.43 +-%{mcpu=7400: -mppc} \
   18.44 +-%{mcpu=7450: -mppc} \
   18.45 ++%{mcpu=7400: -mppc -maltivec} \
   18.46 ++%{mcpu=7450: -mppc -maltivec} \
   18.47 + %{mcpu=750: -mppc} \
   18.48 + %{mcpu=801: -mppc} \
   18.49 + %{mcpu=821: -mppc} \
   18.50 + %{mcpu=823: -mppc} \
   18.51 + %{mcpu=860: -mppc} \
   18.52 +-%{maltivec: -maltivec}"
   18.53 ++%{maltivec: -maltivec} \
   18.54 ++-many"
   18.55 + 
   18.56 + #define CPP_DEFAULT_SPEC ""
   18.57 + 
    19.1 --- a/patches/gcc/3.2.3/160-gcc-3.2.3-trap-posix.patch	Mon Jul 28 20:17:48 2008 +0000
    19.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.3 @@ -1,45 +0,0 @@
    19.4 -# 
    19.5 -# Submitted-By: Marc Kleine-Budde <mkl@pengutronix.de>, 2005-04-20
    19.6 -#
    19.7 -# Error:
    19.8 -#
    19.9 -# creating libintl.h
   19.10 -# Configuring etc...
   19.11 -# loading cache ../config.cache
   19.12 -# checking for a BSD compatible install... (cached) /usr/bin/install -c
   19.13 -# creating ./config.status
   19.14 -# creating Makefile
   19.15 -# trap: usage: trap [-lp] [[arg] signal_spec ...]
   19.16 -#
   19.17 -# Description:
   19.18 -#
   19.19 -# non-posix conform usage of trap causes bash >= 3.0 to fail
   19.20 -#
   19.21 -# e.g.: http://sourceware.org/ml/crossgcc/2004-12/msg00132.html
   19.22 -#
   19.23 -# Status:
   19.24 -#
   19.25 -# fixed in gcc >= 3.3.5
   19.26 -# backport of gcc-3.3.5 fix
   19.27 -#
   19.28 -diff -ruN gcc-3.2.3-orig/configure gcc-3.2.3/configure
   19.29 ---- gcc-3.2.3-orig/configure	2002-06-24 18:14:28.000000000 +0200
   19.30 -+++ gcc-3.2.3/configure	2005-04-20 18:42:49.000000000 +0200
   19.31 -@@ -697,7 +697,7 @@
   19.32 - if test -f skip-this-dir; then
   19.33 - 	# Perform the same cleanup as the trap handler, minus the "exit 1" of course,
   19.34 - 	# and reset the trap handler.
   19.35 --	trap 0
   19.36 -+	trap '' 0
   19.37 - 	rm -rf Makefile* ${tmpdir}
   19.38 - 	# Execute the final clean-up actions
   19.39 - 	${config_shell} skip-this-dir
   19.40 -@@ -1615,7 +1615,7 @@
   19.41 - # Perform the same cleanup as the trap handler, minus the "exit 1" of course,
   19.42 - # and reset the trap handler.
   19.43 - rm -rf ${tmpdir}
   19.44 --trap 0
   19.45 -+trap '' 0
   19.46 - 
   19.47 - exit 0
   19.48 - 
    20.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    20.2 +++ b/patches/gcc/3.2.3/160-trap-posix.patch	Mon Jul 28 21:08:01 2008 +0000
    20.3 @@ -0,0 +1,45 @@
    20.4 +# 
    20.5 +# Submitted-By: Marc Kleine-Budde <mkl@pengutronix.de>, 2005-04-20
    20.6 +#
    20.7 +# Error:
    20.8 +#
    20.9 +# creating libintl.h
   20.10 +# Configuring etc...
   20.11 +# loading cache ../config.cache
   20.12 +# checking for a BSD compatible install... (cached) /usr/bin/install -c
   20.13 +# creating ./config.status
   20.14 +# creating Makefile
   20.15 +# trap: usage: trap [-lp] [[arg] signal_spec ...]
   20.16 +#
   20.17 +# Description:
   20.18 +#
   20.19 +# non-posix conform usage of trap causes bash >= 3.0 to fail
   20.20 +#
   20.21 +# e.g.: http://sourceware.org/ml/crossgcc/2004-12/msg00132.html
   20.22 +#
   20.23 +# Status:
   20.24 +#
   20.25 +# fixed in gcc >= 3.3.5
   20.26 +# backport of gcc-3.3.5 fix
   20.27 +#
   20.28 +diff -ruN gcc-3.2.3-orig/configure gcc-3.2.3/configure
   20.29 +--- gcc-3.2.3-orig/configure	2002-06-24 18:14:28.000000000 +0200
   20.30 ++++ gcc-3.2.3/configure	2005-04-20 18:42:49.000000000 +0200
   20.31 +@@ -697,7 +697,7 @@
   20.32 + if test -f skip-this-dir; then
   20.33 + 	# Perform the same cleanup as the trap handler, minus the "exit 1" of course,
   20.34 + 	# and reset the trap handler.
   20.35 +-	trap 0
   20.36 ++	trap '' 0
   20.37 + 	rm -rf Makefile* ${tmpdir}
   20.38 + 	# Execute the final clean-up actions
   20.39 + 	${config_shell} skip-this-dir
   20.40 +@@ -1615,7 +1615,7 @@
   20.41 + # Perform the same cleanup as the trap handler, minus the "exit 1" of course,
   20.42 + # and reset the trap handler.
   20.43 + rm -rf ${tmpdir}
   20.44 +-trap 0
   20.45 ++trap '' 0
   20.46 + 
   20.47 + exit 0
   20.48 + 
    21.1 --- a/patches/gcc/3.2.3/170-gcc-3.3-libstdc++-v3-dg.exp.patch	Mon Jul 28 20:17:48 2008 +0000
    21.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.3 @@ -1,54 +0,0 @@
    21.4 -Without this patch, the command
    21.5 -
    21.6 -RUNTESTFLAGS=--target=powerpc-750-linux-gnu -v -v -v -v make check-target-libstdc++-v3
    21.7 -
    21.8 -fails in two ways:
    21.9 -1. the -L option meant to locate the testsuite directory is incorrect, and
   21.10 -2. the wrong compiler is invoked, causing all sorts of havoc, not least of which
   21.11 -is the native compiler is invoked when we really wanted to invoke the cross-compiler
   21.12 -we just built.
   21.13 -
   21.14 -Here's an example log of the problem in action.  Every testcase fails, this shows just one:
   21.15 --------------
   21.16 -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
   21.17 -compiler exited with status 1
   21.18 -output is:
   21.19 -/usr/lib/gcc-lib/i386-linux/2.95.4/../../../../include/g++-3/stl_function.h: In method `void binder2nd<mem_fun1_ref_t<void,Elem,int> >::operator ()(const Elem &) const':^M
   21.20 -/usr/lib/gcc-lib/i386-linux/2.95.4/../../../../include/g++-3/stl_algo.h:83:   instantiated from `for_each<Elem *, binder2nd<mem_fun1_ref_t<void,Elem,int> > >(Elem *, Elem *, binder2nd<mem_fun1_ref_t<void,Elem,int> >)'^M
   21.21 -/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
   21.22 -/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
   21.23 -/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<void,Elem,int>::operator ()(Elem &, int) const'^M
   21.24 -...
   21.25 -FAIL: 20_util/binders.cc (test for excess errors)
   21.26 -WARNING: 20_util/binders.cc compilation failed to produce executable
   21.27 --------------
   21.28 -
   21.29 -And here's the patch.  I'm not happy with it, and it probably gets some cases wrong,
   21.30 -but it seems to work for the common native case and for my cross-compiler case.
   21.31 -
   21.32 ---- gcc-3.3/libstdc++-v3/testsuite/lib/libstdc++-v3-dg.exp.old	Sun Jul 13 10:42:01 2003
   21.33 -+++ gcc-3.3/libstdc++-v3/testsuite/lib/libstdc++-v3-dg.exp	Sun Jul 13 11:39:54 2003
   21.34 -@@ -46,8 +46,23 @@
   21.35 -     global gluefile wrap_flags
   21.36 -     global ld_library_path
   21.37 -     global tool_root_dir
   21.38 -+    global target_triplet
   21.39 - 
   21.40 -     set blddir [lookfor_file [get_multilibs] libstdc++-v3]
   21.41 -+    if { $blddir == "" } {
   21.42 -+        set multilibs [get_multilibs]
   21.43 -+        # FIXME: assume multilib only one level deep
   21.44 -+        set multisub [file tail $multilibs]
   21.45 -+        verbose "libstdc++-v3-init: couldn't find libstdc++-v3 in $multilibs, trying $objdir"
   21.46 -+        set blddir [lookfor_file ${objdir} "$target_triplet/$multisub/libstdc++-v3"]
   21.47 -+    }
   21.48 -+    if { $blddir == "" } {
   21.49 -+        verbose "libstdc++-v3-init: couldn't find libstdc++-v3, trying $objdir without multilibs"
   21.50 -+        set blddir [lookfor_file ${objdir} "$target_triplet/libstdc++-v3"]
   21.51 -+    }
   21.52 -+    if { $blddir == "" } {
   21.53 -+         error "Can't find libstdc++-v3"
   21.54 -+    }
   21.55 - 
   21.56 -     # By default, we assume we want to run program images.
   21.57 -     global dg-do-what-default
    22.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    22.2 +++ b/patches/gcc/3.2.3/170-libstdc++-v3-dg.exp.patch	Mon Jul 28 21:08:01 2008 +0000
    22.3 @@ -0,0 +1,54 @@
    22.4 +Without this patch, the command
    22.5 +
    22.6 +RUNTESTFLAGS=--target=powerpc-750-linux-gnu -v -v -v -v make check-target-libstdc++-v3
    22.7 +
    22.8 +fails in two ways:
    22.9 +1. the -L option meant to locate the testsuite directory is incorrect, and
   22.10 +2. the wrong compiler is invoked, causing all sorts of havoc, not least of which
   22.11 +is the native compiler is invoked when we really wanted to invoke the cross-compiler
   22.12 +we just built.
   22.13 +
   22.14 +Here's an example log of the problem in action.  Every testcase fails, this shows just one:
   22.15 +-------------
   22.16 +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
   22.17 +compiler exited with status 1
   22.18 +output is:
   22.19 +/usr/lib/gcc-lib/i386-linux/2.95.4/../../../../include/g++-3/stl_function.h: In method `void binder2nd<mem_fun1_ref_t<void,Elem,int> >::operator ()(const Elem &) const':^M
   22.20 +/usr/lib/gcc-lib/i386-linux/2.95.4/../../../../include/g++-3/stl_algo.h:83:   instantiated from `for_each<Elem *, binder2nd<mem_fun1_ref_t<void,Elem,int> > >(Elem *, Elem *, binder2nd<mem_fun1_ref_t<void,Elem,int> >)'^M
   22.21 +/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
   22.22 +/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
   22.23 +/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<void,Elem,int>::operator ()(Elem &, int) const'^M
   22.24 +...
   22.25 +FAIL: 20_util/binders.cc (test for excess errors)
   22.26 +WARNING: 20_util/binders.cc compilation failed to produce executable
   22.27 +-------------
   22.28 +
   22.29 +And here's the patch.  I'm not happy with it, and it probably gets some cases wrong,
   22.30 +but it seems to work for the common native case and for my cross-compiler case.
   22.31 +
   22.32 +--- gcc-3.3/libstdc++-v3/testsuite/lib/libstdc++-v3-dg.exp.old	Sun Jul 13 10:42:01 2003
   22.33 ++++ gcc-3.3/libstdc++-v3/testsuite/lib/libstdc++-v3-dg.exp	Sun Jul 13 11:39:54 2003
   22.34 +@@ -46,8 +46,23 @@
   22.35 +     global gluefile wrap_flags
   22.36 +     global ld_library_path
   22.37 +     global tool_root_dir
   22.38 ++    global target_triplet
   22.39 + 
   22.40 +     set blddir [lookfor_file [get_multilibs] libstdc++-v3]
   22.41 ++    if { $blddir == "" } {
   22.42 ++        set multilibs [get_multilibs]
   22.43 ++        # FIXME: assume multilib only one level deep
   22.44 ++        set multisub [file tail $multilibs]
   22.45 ++        verbose "libstdc++-v3-init: couldn't find libstdc++-v3 in $multilibs, trying $objdir"
   22.46 ++        set blddir [lookfor_file ${objdir} "$target_triplet/$multisub/libstdc++-v3"]
   22.47 ++    }
   22.48 ++    if { $blddir == "" } {
   22.49 ++        verbose "libstdc++-v3-init: couldn't find libstdc++-v3, trying $objdir without multilibs"
   22.50 ++        set blddir [lookfor_file ${objdir} "$target_triplet/libstdc++-v3"]
   22.51 ++    }
   22.52 ++    if { $blddir == "" } {
   22.53 ++         error "Can't find libstdc++-v3"
   22.54 ++    }
   22.55 + 
   22.56 +     # By default, we assume we want to run program images.
   22.57 +     global dg-do-what-default
    23.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    23.2 +++ b/patches/gcc/3.3.6/110-arm-bigendian.patch	Mon Jul 28 21:08:01 2008 +0000
    23.3 @@ -0,0 +1,62 @@
    23.4 +diff -urN gcc-3.3.4.orig/gcc/config/arm/linux-elf.h gcc-3.3.4/gcc/config/arm/linux-elf.h
    23.5 +--- gcc-3.3.4.orig/gcc/config/arm/linux-elf.h	2004-03-30 22:43:45.000000000 +0200
    23.6 ++++ gcc-3.3.4/gcc/config/arm/linux-elf.h	2004-08-20 02:13:02.969084177 +0200
    23.7 +@@ -30,17 +30,31 @@
    23.8 + /* Do not assume anything about header files.  */
    23.9 + #define NO_IMPLICIT_EXTERN_C
   23.10 + 
   23.11 ++/*
   23.12 ++ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
   23.13 ++ * (big endian) configurations.
   23.14 ++ */
   23.15 ++#if TARGET_BIG_ENDIAN_DEFAULT
   23.16 ++#define TARGET_ENDIAN_DEFAULT ARM_FLAG_BIG_END
   23.17 ++#define TARGET_ENDIAN_OPTION "mbig-endian"
   23.18 ++#define TARGET_LINKER_EMULATION "armelfb_linux"
   23.19 ++#else
   23.20 ++#define TARGET_ENDIAN_DEFAULT 0
   23.21 ++#define TARGET_ENDIAN_OPTION "mlittle-endian"
   23.22 ++#define TARGET_LINKER_EMULATION "armelf_linux"
   23.23 ++#endif
   23.24 ++
   23.25 + /* Default is to use APCS-32 mode.  */
   23.26 + #undef  TARGET_DEFAULT
   23.27 +-#define TARGET_DEFAULT (ARM_FLAG_APCS_32 | ARM_FLAG_MMU_TRAPS)
   23.28 ++#define TARGET_DEFAULT (ARM_FLAG_APCS_32 | ARM_FLAG_MMU_TRAPS | TARGET_ENDIAN_DEFAULT)
   23.29 + 
   23.30 + #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
   23.31 + 
   23.32 +-#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p"
   23.33 ++#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p"
   23.34 + 
   23.35 + #undef  MULTILIB_DEFAULTS
   23.36 + #define MULTILIB_DEFAULTS \
   23.37 +-	{ "marm", "mlittle-endian", "mhard-float", "mapcs-32", "mno-thumb-interwork" }
   23.38 ++	{ "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mapcs-32", "mno-thumb-interwork" }
   23.39 + 
   23.40 + #define CPP_APCS_PC_DEFAULT_SPEC "-D__APCS_32__"
   23.41 + 
   23.42 +@@ -88,7 +102,7 @@
   23.43 +    %{rdynamic:-export-dynamic} \
   23.44 +    %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2} \
   23.45 +    -X \
   23.46 +-   %{mbig-endian:-EB}" \
   23.47 ++   %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
   23.48 +    SUBTARGET_EXTRA_LINK_SPEC
   23.49 + 
   23.50 + #define TARGET_OS_CPP_BUILTINS()		\
   23.51 +diff -urN gcc-3.3.4.orig/gcc/config.gcc gcc-3.3.4/gcc/config.gcc
   23.52 +--- gcc-3.3.4.orig/gcc/config.gcc	2004-04-29 06:42:47.000000000 +0200
   23.53 ++++ gcc-3.3.4/gcc/config.gcc	2004-08-20 02:11:04.326143343 +0200
   23.54 +@@ -699,6 +699,11 @@
   23.55 + 	;;
   23.56 + arm*-*-linux*)			# ARM GNU/Linux with ELF
   23.57 + 	tm_file="dbxelf.h elfos.h arm/elf.h arm/linux-gas.h arm/linux-elf.h arm/aout.h arm/arm.h"
   23.58 ++	case $machine in
   23.59 ++	arm*b-*)
   23.60 ++		tm_defines="TARGET_BIG_ENDIAN_DEFAULT=1 $tm_defines"
   23.61 ++		;;
   23.62 ++	esac
   23.63 + 	tmake_file="t-slibgcc-elf-ver t-linux arm/t-linux"
   23.64 + 	extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
   23.65 + 	gnu_ld=yes
    24.1 --- a/patches/gcc/3.3.6/110-gcc-3.3.4-arm-bigendian.patch	Mon Jul 28 20:17:48 2008 +0000
    24.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    24.3 @@ -1,62 +0,0 @@
    24.4 -diff -urN gcc-3.3.4.orig/gcc/config/arm/linux-elf.h gcc-3.3.4/gcc/config/arm/linux-elf.h
    24.5 ---- gcc-3.3.4.orig/gcc/config/arm/linux-elf.h	2004-03-30 22:43:45.000000000 +0200
    24.6 -+++ gcc-3.3.4/gcc/config/arm/linux-elf.h	2004-08-20 02:13:02.969084177 +0200
    24.7 -@@ -30,17 +30,31 @@
    24.8 - /* Do not assume anything about header files.  */
    24.9 - #define NO_IMPLICIT_EXTERN_C
   24.10 - 
   24.11 -+/*
   24.12 -+ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
   24.13 -+ * (big endian) configurations.
   24.14 -+ */
   24.15 -+#if TARGET_BIG_ENDIAN_DEFAULT
   24.16 -+#define TARGET_ENDIAN_DEFAULT ARM_FLAG_BIG_END
   24.17 -+#define TARGET_ENDIAN_OPTION "mbig-endian"
   24.18 -+#define TARGET_LINKER_EMULATION "armelfb_linux"
   24.19 -+#else
   24.20 -+#define TARGET_ENDIAN_DEFAULT 0
   24.21 -+#define TARGET_ENDIAN_OPTION "mlittle-endian"
   24.22 -+#define TARGET_LINKER_EMULATION "armelf_linux"
   24.23 -+#endif
   24.24 -+
   24.25 - /* Default is to use APCS-32 mode.  */
   24.26 - #undef  TARGET_DEFAULT
   24.27 --#define TARGET_DEFAULT (ARM_FLAG_APCS_32 | ARM_FLAG_MMU_TRAPS)
   24.28 -+#define TARGET_DEFAULT (ARM_FLAG_APCS_32 | ARM_FLAG_MMU_TRAPS | TARGET_ENDIAN_DEFAULT)
   24.29 - 
   24.30 - #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
   24.31 - 
   24.32 --#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p"
   24.33 -+#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p"
   24.34 - 
   24.35 - #undef  MULTILIB_DEFAULTS
   24.36 - #define MULTILIB_DEFAULTS \
   24.37 --	{ "marm", "mlittle-endian", "mhard-float", "mapcs-32", "mno-thumb-interwork" }
   24.38 -+	{ "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mapcs-32", "mno-thumb-interwork" }
   24.39 - 
   24.40 - #define CPP_APCS_PC_DEFAULT_SPEC "-D__APCS_32__"
   24.41 - 
   24.42 -@@ -88,7 +102,7 @@
   24.43 -    %{rdynamic:-export-dynamic} \
   24.44 -    %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2} \
   24.45 -    -X \
   24.46 --   %{mbig-endian:-EB}" \
   24.47 -+   %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
   24.48 -    SUBTARGET_EXTRA_LINK_SPEC
   24.49 - 
   24.50 - #define TARGET_OS_CPP_BUILTINS()		\
   24.51 -diff -urN gcc-3.3.4.orig/gcc/config.gcc gcc-3.3.4/gcc/config.gcc
   24.52 ---- gcc-3.3.4.orig/gcc/config.gcc	2004-04-29 06:42:47.000000000 +0200
   24.53 -+++ gcc-3.3.4/gcc/config.gcc	2004-08-20 02:11:04.326143343 +0200
   24.54 -@@ -699,6 +699,11 @@
   24.55 - 	;;
   24.56 - arm*-*-linux*)			# ARM GNU/Linux with ELF
   24.57 - 	tm_file="dbxelf.h elfos.h arm/elf.h arm/linux-gas.h arm/linux-elf.h arm/aout.h arm/arm.h"
   24.58 -+	case $machine in
   24.59 -+	arm*b-*)
   24.60 -+		tm_defines="TARGET_BIG_ENDIAN_DEFAULT=1 $tm_defines"
   24.61 -+		;;
   24.62 -+	esac
   24.63 - 	tmake_file="t-slibgcc-elf-ver t-linux arm/t-linux"
   24.64 - 	extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
   24.65 - 	gnu_ld=yes
    25.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    25.2 +++ b/patches/gcc/3.3.6/120-arm-pr22528.patch	Mon Jul 28 21:08:01 2008 +0000
    25.3 @@ -0,0 +1,71 @@
    25.4 +From http://gcc.gnu.org/ml/gcc-patches/2003-11/msg00832.html, by
    25.5 +Richard Earnshaw.  Fixes http://gcc.gnu.org/PR22528
    25.6 +
    25.7 +--- gcc-3.3.4/gcc/config/arm/arm.md.orig	2004-03-30 22:43:44.000000000 +0200
    25.8 ++++ gcc-3.3.4/gcc/config/arm/arm.md	2005-08-15 12:21:55.000000000 +0200
    25.9 +@@ -4275,7 +4275,7 @@
   25.10 +    (set (match_dup 2)
   25.11 + 	(ashiftrt:SI (match_operand 0 "" "") (const_int 8)))
   25.12 +    ;; store the high byte
   25.13 +-   (set (match_dup 4) (subreg:QI (match_dup 2) 0))]	;explicit subreg safe
   25.14 ++   (set (match_dup 4) (match_dup 5))]
   25.15 +   "TARGET_ARM"
   25.16 +   "
   25.17 +   {
   25.18 +@@ -4291,7 +4291,8 @@
   25.19 +     operands[1] = adjust_address (operands[1], QImode, 0);
   25.20 +     operands[3] = gen_lowpart (QImode, operands[0]);
   25.21 +     operands[0] = gen_lowpart (SImode, operands[0]);
   25.22 +-    operands[2] = gen_reg_rtx (SImode); 
   25.23 ++    operands[2] = gen_reg_rtx (SImode);
   25.24 ++    operands[5] = gen_lowpart (QImode, operands[2]);
   25.25 +   }"
   25.26 + )
   25.27 + 
   25.28 +@@ -4299,7 +4300,7 @@
   25.29 +   [(set (match_dup 4) (match_dup 3))
   25.30 +    (set (match_dup 2)
   25.31 + 	(ashiftrt:SI (match_operand 0 "" "") (const_int 8)))
   25.32 +-   (set (match_operand 1 "" "")	(subreg:QI (match_dup 2) 3))]
   25.33 ++   (set (match_operand 1 "" "")	(match_dup 5))]
   25.34 +   "TARGET_ARM"
   25.35 +   "
   25.36 +   {
   25.37 +@@ -4316,13 +4317,14 @@
   25.38 +     operands[3] = gen_lowpart (QImode, operands[0]);
   25.39 +     operands[0] = gen_lowpart (SImode, operands[0]);
   25.40 +     operands[2] = gen_reg_rtx (SImode);
   25.41 ++    operands[5] = gen_lowpart (QImode, operands[2]);
   25.42 +   }"
   25.43 + )
   25.44 + 
   25.45 + ;; Subroutine to store a half word integer constant into memory.
   25.46 + (define_expand "storeinthi"
   25.47 +   [(set (match_operand 0 "" "")
   25.48 +-	(subreg:QI (match_operand 1 "" "") 0))
   25.49 ++	(match_operand 1 "" ""))
   25.50 +    (set (match_dup 3) (match_dup 2))]
   25.51 +   "TARGET_ARM"
   25.52 +   "
   25.53 +@@ -4363,6 +4365,7 @@
   25.54 +     operands[3] = adjust_address (op0, QImode, 1);
   25.55 +     operands[0] = adjust_address (operands[0], QImode, 0);
   25.56 +     operands[2] = gen_lowpart (QImode, operands[2]);
   25.57 ++    operands[1] = gen_lowpart (QImode, operands[1]);
   25.58 +   }"
   25.59 + )
   25.60 + 
   25.61 +@@ -4682,11 +4685,12 @@
   25.62 +    (set (match_dup 3)
   25.63 + 	(ashiftrt:SI (match_dup 2) (const_int 16)))
   25.64 +    (set (match_operand:HI 0 "s_register_operand" "")
   25.65 +-	(subreg:HI (match_dup 3) 0))]
   25.66 ++	(match_dup 4))]
   25.67 +   "TARGET_ARM"
   25.68 +   "
   25.69 +   operands[2] = gen_reg_rtx (SImode);
   25.70 +   operands[3] = gen_reg_rtx (SImode);
   25.71 ++  operands[4] = gen_lowpart (HImode, operands[3]);
   25.72 +   "
   25.73 + )
   25.74 + 
    26.1 --- a/patches/gcc/3.3.6/120-gcc-3.3.4-arm-pr22528.patch	Mon Jul 28 20:17:48 2008 +0000
    26.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    26.3 @@ -1,71 +0,0 @@
    26.4 -From http://gcc.gnu.org/ml/gcc-patches/2003-11/msg00832.html, by
    26.5 -Richard Earnshaw.  Fixes http://gcc.gnu.org/PR22528
    26.6 -
    26.7 ---- gcc-3.3.4/gcc/config/arm/arm.md.orig	2004-03-30 22:43:44.000000000 +0200
    26.8 -+++ gcc-3.3.4/gcc/config/arm/arm.md	2005-08-15 12:21:55.000000000 +0200
    26.9 -@@ -4275,7 +4275,7 @@
   26.10 -    (set (match_dup 2)
   26.11 - 	(ashiftrt:SI (match_operand 0 "" "") (const_int 8)))
   26.12 -    ;; store the high byte
   26.13 --   (set (match_dup 4) (subreg:QI (match_dup 2) 0))]	;explicit subreg safe
   26.14 -+   (set (match_dup 4) (match_dup 5))]
   26.15 -   "TARGET_ARM"
   26.16 -   "
   26.17 -   {
   26.18 -@@ -4291,7 +4291,8 @@
   26.19 -     operands[1] = adjust_address (operands[1], QImode, 0);
   26.20 -     operands[3] = gen_lowpart (QImode, operands[0]);
   26.21 -     operands[0] = gen_lowpart (SImode, operands[0]);
   26.22 --    operands[2] = gen_reg_rtx (SImode); 
   26.23 -+    operands[2] = gen_reg_rtx (SImode);
   26.24 -+    operands[5] = gen_lowpart (QImode, operands[2]);
   26.25 -   }"
   26.26 - )
   26.27 - 
   26.28 -@@ -4299,7 +4300,7 @@
   26.29 -   [(set (match_dup 4) (match_dup 3))
   26.30 -    (set (match_dup 2)
   26.31 - 	(ashiftrt:SI (match_operand 0 "" "") (const_int 8)))
   26.32 --   (set (match_operand 1 "" "")	(subreg:QI (match_dup 2) 3))]
   26.33 -+   (set (match_operand 1 "" "")	(match_dup 5))]
   26.34 -   "TARGET_ARM"
   26.35 -   "
   26.36 -   {
   26.37 -@@ -4316,13 +4317,14 @@
   26.38 -     operands[3] = gen_lowpart (QImode, operands[0]);
   26.39 -     operands[0] = gen_lowpart (SImode, operands[0]);
   26.40 -     operands[2] = gen_reg_rtx (SImode);
   26.41 -+    operands[5] = gen_lowpart (QImode, operands[2]);
   26.42 -   }"
   26.43 - )
   26.44 - 
   26.45 - ;; Subroutine to store a half word integer constant into memory.
   26.46 - (define_expand "storeinthi"
   26.47 -   [(set (match_operand 0 "" "")
   26.48 --	(subreg:QI (match_operand 1 "" "") 0))
   26.49 -+	(match_operand 1 "" ""))
   26.50 -    (set (match_dup 3) (match_dup 2))]
   26.51 -   "TARGET_ARM"
   26.52 -   "
   26.53 -@@ -4363,6 +4365,7 @@
   26.54 -     operands[3] = adjust_address (op0, QImode, 1);
   26.55 -     operands[0] = adjust_address (operands[0], QImode, 0);
   26.56 -     operands[2] = gen_lowpart (QImode, operands[2]);
   26.57 -+    operands[1] = gen_lowpart (QImode, operands[1]);
   26.58 -   }"
   26.59 - )
   26.60 - 
   26.61 -@@ -4682,11 +4685,12 @@
   26.62 -    (set (match_dup 3)
   26.63 - 	(ashiftrt:SI (match_dup 2) (const_int 16)))
   26.64 -    (set (match_operand:HI 0 "s_register_operand" "")
   26.65 --	(subreg:HI (match_dup 3) 0))]
   26.66 -+	(match_dup 4))]
   26.67 -   "TARGET_ARM"
   26.68 -   "
   26.69 -   operands[2] = gen_reg_rtx (SImode);
   26.70 -   operands[3] = gen_reg_rtx (SImode);
   26.71 -+  operands[4] = gen_lowpart (HImode, operands[3]);
   26.72 -   "
   26.73 - )
   26.74 - 
    27.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    27.2 +++ b/patches/gcc/3.4.6/600-arm-ldm-peephole.patch	Mon Jul 28 21:08:01 2008 +0000
    27.3 @@ -0,0 +1,68 @@
    27.4 +diff -durN gcc-3.4.6.orig/gcc/config/arm/arm.c gcc-3.4.6/gcc/config/arm/arm.c
    27.5 +--- gcc-3.4.6.orig/gcc/config/arm/arm.c	2005-10-01 15:31:38.000000000 +0200
    27.6 ++++ gcc-3.4.6/gcc/config/arm/arm.c	2007-08-15 22:54:59.000000000 +0200
    27.7 +@@ -4857,6 +4857,11 @@
    27.8 +       *load_offset = unsorted_offsets[order[0]];
    27.9 +     }
   27.10 + 
   27.11 ++  /* For XScale a two-word LDM is a performance loss, so only do this if
   27.12 ++     size is more important.  See comments in arm_gen_load_multiple.  */
   27.13 ++  if (nops == 2 && arm_tune_xscale && !optimize_size)
   27.14 ++    return 0;
   27.15 ++
   27.16 +   if (unsorted_offsets[order[0]] == 0)
   27.17 +     return 1; /* ldmia */
   27.18 + 
   27.19 +@@ -5083,6 +5088,11 @@
   27.20 +       *load_offset = unsorted_offsets[order[0]];
   27.21 +     }
   27.22 + 
   27.23 ++  /* For XScale a two-word LDM is a performance loss, so only do this if
   27.24 ++     size is more important.  See comments in arm_gen_load_multiple.  */
   27.25 ++  if (nops == 2 && arm_tune_xscale && !optimize_size)
   27.26 ++    return 0;
   27.27 ++
   27.28 +   if (unsorted_offsets[order[0]] == 0)
   27.29 +     return 1; /* stmia */
   27.30 + 
   27.31 +diff -durN gcc-3.4.6.orig/gcc/config/arm/arm.md gcc-3.4.6/gcc/config/arm/arm.md
   27.32 +--- gcc-3.4.6.orig/gcc/config/arm/arm.md	2005-10-01 15:31:38.000000000 +0200
   27.33 ++++ gcc-3.4.6/gcc/config/arm/arm.md	2007-08-15 22:54:59.000000000 +0200
   27.34 +@@ -8811,13 +8811,16 @@
   27.35 +    (set_attr "length" "4,8,8")]
   27.36 + )
   27.37 + 
   27.38 ++; Try to convert LDR+LDR+arith into [add+]LDM+arith
   27.39 ++; On XScale, LDM is always slower than two LDRs, so only do this if
   27.40 ++; optimising for size.
   27.41 + (define_insn "*arith_adjacentmem"
   27.42 +   [(set (match_operand:SI 0 "s_register_operand" "=r")
   27.43 + 	(match_operator:SI 1 "shiftable_operator"
   27.44 + 	 [(match_operand:SI 2 "memory_operand" "m")
   27.45 + 	  (match_operand:SI 3 "memory_operand" "m")]))
   27.46 +    (clobber (match_scratch:SI 4 "=r"))]
   27.47 +-  "TARGET_ARM && adjacent_mem_locations (operands[2], operands[3])"
   27.48 ++  "TARGET_ARM && (!arm_tune_xscale || optimize_size) && adjacent_mem_locations (operands[2], operands[3])"
   27.49 +   "*
   27.50 +   {
   27.51 +     rtx ldm[3];
   27.52 +@@ -8852,6 +8855,8 @@
   27.53 +       }
   27.54 +    if (val1 && val2)
   27.55 +       {
   27.56 ++	/* This would be a loss on a Harvard core, but adjacent_mem_locations()
   27.57 ++	   will prevent it from happening.  */
   27.58 + 	rtx ops[3];
   27.59 + 	ldm[0] = ops[0] = operands[4];
   27.60 + 	ops[1] = XEXP (XEXP (operands[2], 0), 0);
   27.61 +diff -durN gcc-3.4.6.orig/gcc/genpeep.c gcc-3.4.6/gcc/genpeep.c
   27.62 +--- gcc-3.4.6.orig/gcc/genpeep.c	2003-07-05 07:27:22.000000000 +0200
   27.63 ++++ gcc-3.4.6/gcc/genpeep.c	2007-08-15 22:54:59.000000000 +0200
   27.64 +@@ -381,6 +381,7 @@
   27.65 +   printf ("#include \"recog.h\"\n");
   27.66 +   printf ("#include \"except.h\"\n\n");
   27.67 +   printf ("#include \"function.h\"\n\n");
   27.68 ++  printf ("#include \"flags.h\"\n\n");
   27.69 + 
   27.70 +   printf ("#ifdef HAVE_peephole\n");
   27.71 +   printf ("extern rtx peep_operand[];\n\n");
    28.1 --- a/patches/gcc/3.4.6/600-gcc34-arm-ldm-peephole.patch	Mon Jul 28 20:17:48 2008 +0000
    28.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    28.3 @@ -1,68 +0,0 @@
    28.4 -diff -durN gcc-3.4.6.orig/gcc/config/arm/arm.c gcc-3.4.6/gcc/config/arm/arm.c
    28.5 ---- gcc-3.4.6.orig/gcc/config/arm/arm.c	2005-10-01 15:31:38.000000000 +0200
    28.6 -+++ gcc-3.4.6/gcc/config/arm/arm.c	2007-08-15 22:54:59.000000000 +0200
    28.7 -@@ -4857,6 +4857,11 @@
    28.8 -       *load_offset = unsorted_offsets[order[0]];
    28.9 -     }
   28.10 - 
   28.11 -+  /* For XScale a two-word LDM is a performance loss, so only do this if
   28.12 -+     size is more important.  See comments in arm_gen_load_multiple.  */
   28.13 -+  if (nops == 2 && arm_tune_xscale && !optimize_size)
   28.14 -+    return 0;
   28.15 -+
   28.16 -   if (unsorted_offsets[order[0]] == 0)
   28.17 -     return 1; /* ldmia */
   28.18 - 
   28.19 -@@ -5083,6 +5088,11 @@
   28.20 -       *load_offset = unsorted_offsets[order[0]];
   28.21 -     }
   28.22 - 
   28.23 -+  /* For XScale a two-word LDM is a performance loss, so only do this if
   28.24 -+     size is more important.  See comments in arm_gen_load_multiple.  */
   28.25 -+  if (nops == 2 && arm_tune_xscale && !optimize_size)
   28.26 -+    return 0;
   28.27 -+
   28.28 -   if (unsorted_offsets[order[0]] == 0)
   28.29 -     return 1; /* stmia */
   28.30 - 
   28.31 -diff -durN gcc-3.4.6.orig/gcc/config/arm/arm.md gcc-3.4.6/gcc/config/arm/arm.md
   28.32 ---- gcc-3.4.6.orig/gcc/config/arm/arm.md	2005-10-01 15:31:38.000000000 +0200
   28.33 -+++ gcc-3.4.6/gcc/config/arm/arm.md	2007-08-15 22:54:59.000000000 +0200
   28.34 -@@ -8811,13 +8811,16 @@
   28.35 -    (set_attr "length" "4,8,8")]
   28.36 - )
   28.37 - 
   28.38 -+; Try to convert LDR+LDR+arith into [add+]LDM+arith
   28.39 -+; On XScale, LDM is always slower than two LDRs, so only do this if
   28.40 -+; optimising for size.
   28.41 - (define_insn "*arith_adjacentmem"
   28.42 -   [(set (match_operand:SI 0 "s_register_operand" "=r")
   28.43 - 	(match_operator:SI 1 "shiftable_operator"
   28.44 - 	 [(match_operand:SI 2 "memory_operand" "m")
   28.45 - 	  (match_operand:SI 3 "memory_operand" "m")]))
   28.46 -    (clobber (match_scratch:SI 4 "=r"))]
   28.47 --  "TARGET_ARM && adjacent_mem_locations (operands[2], operands[3])"
   28.48 -+  "TARGET_ARM && (!arm_tune_xscale || optimize_size) && adjacent_mem_locations (operands[2], operands[3])"
   28.49 -   "*
   28.50 -   {
   28.51 -     rtx ldm[3];
   28.52 -@@ -8852,6 +8855,8 @@
   28.53 -       }
   28.54 -    if (val1 && val2)
   28.55 -       {
   28.56 -+	/* This would be a loss on a Harvard core, but adjacent_mem_locations()
   28.57 -+	   will prevent it from happening.  */
   28.58 - 	rtx ops[3];
   28.59 - 	ldm[0] = ops[0] = operands[4];
   28.60 - 	ops[1] = XEXP (XEXP (operands[2], 0), 0);
   28.61 -diff -durN gcc-3.4.6.orig/gcc/genpeep.c gcc-3.4.6/gcc/genpeep.c
   28.62 ---- gcc-3.4.6.orig/gcc/genpeep.c	2003-07-05 07:27:22.000000000 +0200
   28.63 -+++ gcc-3.4.6/gcc/genpeep.c	2007-08-15 22:54:59.000000000 +0200
   28.64 -@@ -381,6 +381,7 @@
   28.65 -   printf ("#include \"recog.h\"\n");
   28.66 -   printf ("#include \"except.h\"\n\n");
   28.67 -   printf ("#include \"function.h\"\n\n");
   28.68 -+  printf ("#include \"flags.h\"\n\n");
   28.69 - 
   28.70 -   printf ("#ifdef HAVE_peephole\n");
   28.71 -   printf ("extern rtx peep_operand[];\n\n");
    29.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    29.2 +++ b/patches/gcc/3.4.6/601-arm-ldm.patch	Mon Jul 28 21:08:01 2008 +0000
    29.3 @@ -0,0 +1,120 @@
    29.4 +diff -durN gcc-3.4.6.orig/gcc/config/arm/arm.c gcc-3.4.6/gcc/config/arm/arm.c
    29.5 +--- gcc-3.4.6.orig/gcc/config/arm/arm.c	2007-08-15 22:56:20.000000000 +0200
    29.6 ++++ gcc-3.4.6/gcc/config/arm/arm.c	2007-08-15 22:56:20.000000000 +0200
    29.7 +@@ -8524,6 +8524,26 @@
    29.8 +   return_used_this_function = 0;  
    29.9 + }
   29.10 + 
   29.11 ++/* Return the number (counting from 0) of
   29.12 ++   the least significant set bit in MASK.  */
   29.13 ++
   29.14 ++#ifdef __GNUC__
   29.15 ++inline
   29.16 ++#endif
   29.17 ++static int
   29.18 ++number_of_first_bit_set (mask)
   29.19 ++     int mask;
   29.20 ++{
   29.21 ++  int bit;
   29.22 ++
   29.23 ++  for (bit = 0;
   29.24 ++       (mask & (1 << bit)) == 0;
   29.25 ++       ++bit)
   29.26 ++    continue;
   29.27 ++
   29.28 ++  return bit;
   29.29 ++}
   29.30 ++
   29.31 + const char *
   29.32 + arm_output_epilogue (rtx sibling)
   29.33 + {
   29.34 +@@ -8757,27 +8777,47 @@
   29.35 + 	  saved_regs_mask |=   (1 << PC_REGNUM);
   29.36 + 	}
   29.37 + 
   29.38 +-      /* Load the registers off the stack.  If we only have one register
   29.39 +-	 to load use the LDR instruction - it is faster.  */
   29.40 +-      if (saved_regs_mask == (1 << LR_REGNUM))
   29.41 +-	{
   29.42 +-	  /* The exception handler ignores the LR, so we do
   29.43 +-	     not really need to load it off the stack.  */
   29.44 +-	  if (eh_ofs)
   29.45 +-	    asm_fprintf (f, "\tadd\t%r, %r, #4\n", SP_REGNUM, SP_REGNUM);
   29.46 +-	  else
   29.47 +-	    asm_fprintf (f, "\tldr\t%r, [%r], #4\n", LR_REGNUM, SP_REGNUM);
   29.48 +-	}
   29.49 +-      else if (saved_regs_mask)
   29.50 ++      if (saved_regs_mask)
   29.51 + 	{
   29.52 +-	  if (saved_regs_mask & (1 << SP_REGNUM))
   29.53 +-	    /* Note - write back to the stack register is not enabled
   29.54 +-	       (ie "ldmfd sp!...").  We know that the stack pointer is
   29.55 +-	       in the list of registers and if we add writeback the
   29.56 +-	       instruction becomes UNPREDICTABLE.  */
   29.57 +-	    print_multi_reg (f, "ldmfd\t%r", SP_REGNUM, saved_regs_mask);
   29.58 ++	  /* Load the registers off the stack.  If we only have one register
   29.59 ++	     to load use the LDR instruction - it is faster.  */
   29.60 ++	  if (bit_count (saved_regs_mask) == 1)
   29.61 ++	    {
   29.62 ++	      int reg = number_of_first_bit_set (saved_regs_mask);
   29.63 ++
   29.64 ++	      switch (reg)
   29.65 ++		{
   29.66 ++		case SP_REGNUM:
   29.67 ++		  /* Mustn't use base writeback when loading SP.  */
   29.68 ++		  asm_fprintf (f, "\tldr\t%r, [%r]\n", SP_REGNUM, SP_REGNUM);
   29.69 ++		  break;
   29.70 ++		  
   29.71 ++		case LR_REGNUM:
   29.72 ++		  if (eh_ofs)
   29.73 ++		    {
   29.74 ++		      /* The exception handler ignores the LR, so we do
   29.75 ++			 not really need to load it off the stack.  */
   29.76 ++		      asm_fprintf (f, "\tadd\t%r, %r, #4\n", SP_REGNUM, SP_REGNUM);
   29.77 ++		      break;
   29.78 ++		    }
   29.79 ++		  /* else fall through */
   29.80 ++		  
   29.81 ++		default:
   29.82 ++		  asm_fprintf (f, "\tldr\t%r, [%r], #4\n", reg, SP_REGNUM);
   29.83 ++		  break;
   29.84 ++		}
   29.85 ++	    }
   29.86 + 	  else
   29.87 +-	    print_multi_reg (f, "ldmfd\t%r!", SP_REGNUM, saved_regs_mask);
   29.88 ++	    {
   29.89 ++	      if (saved_regs_mask & (1 << SP_REGNUM))
   29.90 ++		/* Note - write back to the stack register is not enabled
   29.91 ++		   (ie "ldmfd sp!...").  We know that the stack pointer is
   29.92 ++		   in the list of registers and if we add writeback the
   29.93 ++		   instruction becomes UNPREDICTABLE.  */
   29.94 ++		print_multi_reg (f, "ldmfd\t%r", SP_REGNUM, saved_regs_mask);
   29.95 ++	      else
   29.96 ++		print_multi_reg (f, "ldmfd\t%r!", SP_REGNUM, saved_regs_mask);
   29.97 ++	    }
   29.98 + 	}
   29.99 + 
  29.100 +       if (current_function_pretend_args_size)
  29.101 +@@ -11405,22 +11445,6 @@
  29.102 +     }
  29.103 + }
  29.104 + 
  29.105 +-/* Return the number (counting from 0) of
  29.106 +-   the least significant set bit in MASK.  */
  29.107 +-
  29.108 +-inline static int
  29.109 +-number_of_first_bit_set (int mask)
  29.110 +-{
  29.111 +-  int bit;
  29.112 +-
  29.113 +-  for (bit = 0;
  29.114 +-       (mask & (1 << bit)) == 0;
  29.115 +-       ++bit)
  29.116 +-    continue;
  29.117 +-
  29.118 +-  return bit;
  29.119 +-}
  29.120 +-
  29.121 + /* Generate code to return from a thumb function.
  29.122 +    If 'reg_containing_return_addr' is -1, then the return address is
  29.123 +    actually on the stack, at the stack pointer.  */
    30.1 --- a/patches/gcc/3.4.6/601-gcc34-arm-ldm-peephole2.patch	Mon Jul 28 20:17:48 2008 +0000
    30.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    30.3 @@ -1,32 +0,0 @@
    30.4 -diff -durN gcc-3.4.6.orig/gcc/config/arm/arm.c gcc-3.4.6/gcc/config/arm/arm.c
    30.5 ---- gcc-3.4.6.orig/gcc/config/arm/arm.c	2007-08-15 22:57:51.000000000 +0200
    30.6 -+++ gcc-3.4.6/gcc/config/arm/arm.c	2007-08-15 22:57:51.000000000 +0200
    30.7 -@@ -4572,6 +4572,10 @@
    30.8 - int
    30.9 - adjacent_mem_locations (rtx a, rtx b)
   30.10 - {
   30.11 -+  /* We don't guarantee to preserve the order of these memory refs.  */
   30.12 -+  if (volatile_refs_p (a) || volatile_refs_p (b))
   30.13 -+    return 0;
   30.14 -+
   30.15 -   if ((GET_CODE (XEXP (a, 0)) == REG
   30.16 -        || (GET_CODE (XEXP (a, 0)) == PLUS
   30.17 - 	   && GET_CODE (XEXP (XEXP (a, 0), 1)) == CONST_INT))
   30.18 -@@ -4611,6 +4615,17 @@
   30.19 - 	return 0;
   30.20 - 
   30.21 -       val_diff = val1 - val0;
   30.22 -+
   30.23 -+      if (arm_ld_sched)
   30.24 -+	{
   30.25 -+	  /* If the target has load delay slots, then there's no benefit
   30.26 -+	     to using an ldm instruction unless the offset is zero and
   30.27 -+	     we are optimizing for size.  */
   30.28 -+	  return (optimize_size && (REGNO (reg0) == REGNO (reg1))
   30.29 -+		  && (val0 == 0 || val1 == 0 || val0 == 4 || val1 == 4)
   30.30 -+		  && (val_diff == 4 || val_diff == -4));
   30.31 -+	}
   30.32 -+
   30.33 -       return ((REGNO (reg0) == REGNO (reg1))
   30.34 - 	      && (val_diff == 4 || val_diff == -4));
   30.35 -     }
    31.1 --- a/patches/gcc/3.4.6/601-gcc34-arm-ldm.patch	Mon Jul 28 20:17:48 2008 +0000
    31.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    31.3 @@ -1,120 +0,0 @@
    31.4 -diff -durN gcc-3.4.6.orig/gcc/config/arm/arm.c gcc-3.4.6/gcc/config/arm/arm.c
    31.5 ---- gcc-3.4.6.orig/gcc/config/arm/arm.c	2007-08-15 22:56:20.000000000 +0200
    31.6 -+++ gcc-3.4.6/gcc/config/arm/arm.c	2007-08-15 22:56:20.000000000 +0200
    31.7 -@@ -8524,6 +8524,26 @@
    31.8 -   return_used_this_function = 0;  
    31.9 - }
   31.10 - 
   31.11 -+/* Return the number (counting from 0) of
   31.12 -+   the least significant set bit in MASK.  */
   31.13 -+
   31.14 -+#ifdef __GNUC__
   31.15 -+inline
   31.16 -+#endif
   31.17 -+static int
   31.18 -+number_of_first_bit_set (mask)
   31.19 -+     int mask;
   31.20 -+{
   31.21 -+  int bit;
   31.22 -+
   31.23 -+  for (bit = 0;
   31.24 -+       (mask & (1 << bit)) == 0;
   31.25 -+       ++bit)
   31.26 -+    continue;
   31.27 -+
   31.28 -+  return bit;
   31.29 -+}
   31.30 -+
   31.31 - const char *
   31.32 - arm_output_epilogue (rtx sibling)
   31.33 - {
   31.34 -@@ -8757,27 +8777,47 @@
   31.35 - 	  saved_regs_mask |=   (1 << PC_REGNUM);
   31.36 - 	}
   31.37 - 
   31.38 --      /* Load the registers off the stack.  If we only have one register
   31.39 --	 to load use the LDR instruction - it is faster.  */
   31.40 --      if (saved_regs_mask == (1 << LR_REGNUM))
   31.41 --	{
   31.42 --	  /* The exception handler ignores the LR, so we do
   31.43 --	     not really need to load it off the stack.  */
   31.44 --	  if (eh_ofs)
   31.45 --	    asm_fprintf (f, "\tadd\t%r, %r, #4\n", SP_REGNUM, SP_REGNUM);
   31.46 --	  else
   31.47 --	    asm_fprintf (f, "\tldr\t%r, [%r], #4\n", LR_REGNUM, SP_REGNUM);
   31.48 --	}
   31.49 --      else if (saved_regs_mask)
   31.50 -+      if (saved_regs_mask)
   31.51 - 	{
   31.52 --	  if (saved_regs_mask & (1 << SP_REGNUM))
   31.53 --	    /* Note - write back to the stack register is not enabled
   31.54 --	       (ie "ldmfd sp!...").  We know that the stack pointer is
   31.55 --	       in the list of registers and if we add writeback the
   31.56 --	       instruction becomes UNPREDICTABLE.  */
   31.57 --	    print_multi_reg (f, "ldmfd\t%r", SP_REGNUM, saved_regs_mask);
   31.58 -+	  /* Load the registers off the stack.  If we only have one register
   31.59 -+	     to load use the LDR instruction - it is faster.  */
   31.60 -+	  if (bit_count (saved_regs_mask) == 1)
   31.61 -+	    {
   31.62 -+	      int reg = number_of_first_bit_set (saved_regs_mask);
   31.63 -+
   31.64 -+	      switch (reg)
   31.65 -+		{
   31.66 -+		case SP_REGNUM:
   31.67 -+		  /* Mustn't use base writeback when loading SP.  */
   31.68 -+		  asm_fprintf (f, "\tldr\t%r, [%r]\n", SP_REGNUM, SP_REGNUM);
   31.69 -+		  break;
   31.70 -+		  
   31.71 -+		case LR_REGNUM:
   31.72 -+		  if (eh_ofs)
   31.73 -+		    {
   31.74 -+		      /* The exception handler ignores the LR, so we do
   31.75 -+			 not really need to load it off the stack.  */
   31.76 -+		      asm_fprintf (f, "\tadd\t%r, %r, #4\n", SP_REGNUM, SP_REGNUM);
   31.77 -+		      break;
   31.78 -+		    }
   31.79 -+		  /* else fall through */
   31.80 -+		  
   31.81 -+		default:
   31.82 -+		  asm_fprintf (f, "\tldr\t%r, [%r], #4\n", reg, SP_REGNUM);
   31.83 -+		  break;
   31.84 -+		}
   31.85 -+	    }
   31.86 - 	  else
   31.87 --	    print_multi_reg (f, "ldmfd\t%r!", SP_REGNUM, saved_regs_mask);
   31.88 -+	    {
   31.89 -+	      if (saved_regs_mask & (1 << SP_REGNUM))
   31.90 -+		/* Note - write back to the stack register is not enabled
   31.91 -+		   (ie "ldmfd sp!...").  We know that the stack pointer is
   31.92 -+		   in the list of registers and if we add writeback the
   31.93 -+		   instruction becomes UNPREDICTABLE.  */
   31.94 -+		print_multi_reg (f, "ldmfd\t%r", SP_REGNUM, saved_regs_mask);
   31.95 -+	      else
   31.96 -+		print_multi_reg (f, "ldmfd\t%r!", SP_REGNUM, saved_regs_mask);
   31.97 -+	    }
   31.98 - 	}
   31.99 - 
  31.100 -       if (current_function_pretend_args_size)
  31.101 -@@ -11405,22 +11445,6 @@
  31.102 -     }
  31.103 - }
  31.104 - 
  31.105 --/* Return the number (counting from 0) of
  31.106 --   the least significant set bit in MASK.  */
  31.107 --
  31.108 --inline static int
  31.109 --number_of_first_bit_set (int mask)
  31.110 --{
  31.111 --  int bit;
  31.112 --
  31.113 --  for (bit = 0;
  31.114 --       (mask & (1 << bit)) == 0;
  31.115 --       ++bit)
  31.116 --    continue;
  31.117 --
  31.118 --  return bit;
  31.119 --}
  31.120 --
  31.121 - /* Generate code to return from a thumb function.
  31.122 -    If 'reg_containing_return_addr' is -1, then the return address is
  31.123 -    actually on the stack, at the stack pointer.  */
    32.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    32.2 +++ b/patches/gcc/3.4.6/602-arm-ldm-peephole2.patch	Mon Jul 28 21:08:01 2008 +0000
    32.3 @@ -0,0 +1,32 @@
    32.4 +diff -durN gcc-3.4.6.orig/gcc/config/arm/arm.c gcc-3.4.6/gcc/config/arm/arm.c
    32.5 +--- gcc-3.4.6.orig/gcc/config/arm/arm.c	2007-08-15 22:57:51.000000000 +0200
    32.6 ++++ gcc-3.4.6/gcc/config/arm/arm.c	2007-08-15 22:57:51.000000000 +0200
    32.7 +@@ -4572,6 +4572,10 @@
    32.8 + int
    32.9 + adjacent_mem_locations (rtx a, rtx b)
   32.10 + {
   32.11 ++  /* We don't guarantee to preserve the order of these memory refs.  */
   32.12 ++  if (volatile_refs_p (a) || volatile_refs_p (b))
   32.13 ++    return 0;
   32.14 ++
   32.15 +   if ((GET_CODE (XEXP (a, 0)) == REG
   32.16 +        || (GET_CODE (XEXP (a, 0)) == PLUS
   32.17 + 	   && GET_CODE (XEXP (XEXP (a, 0), 1)) == CONST_INT))
   32.18 +@@ -4611,6 +4615,17 @@
   32.19 + 	return 0;
   32.20 + 
   32.21 +       val_diff = val1 - val0;
   32.22 ++
   32.23 ++      if (arm_ld_sched)
   32.24 ++	{
   32.25 ++	  /* If the target has load delay slots, then there's no benefit
   32.26 ++	     to using an ldm instruction unless the offset is zero and
   32.27 ++	     we are optimizing for size.  */
   32.28 ++	  return (optimize_size && (REGNO (reg0) == REGNO (reg1))
   32.29 ++		  && (val0 == 0 || val1 == 0 || val0 == 4 || val1 == 4)
   32.30 ++		  && (val_diff == 4 || val_diff == -4));
   32.31 ++	}
   32.32 ++
   32.33 +       return ((REGNO (reg0) == REGNO (reg1))
   32.34 + 	      && (val_diff == 4 || val_diff == -4));
   32.35 +     }
    33.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    33.2 +++ b/patches/gcc/4.0.0/110-arm-bigendian.patch	Mon Jul 28 21:08:01 2008 +0000
    33.3 @@ -0,0 +1,79 @@
    33.4 +By Lennert Buytenhek <buytenh@wantstofly.org>
    33.5 +Adds support for arm*b-linux* big-endian ARM targets
    33.6 +
    33.7 +Fixes following build error for big-endian ARM targets:
    33.8 +
    33.9 +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
   33.10 +Supported emulations: armelfb_linux armelfb
   33.11 +collect2: ld returned 1 exit status
   33.12 +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
   33.13 +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'
   33.14 +make[1]: *** [csu/subdir_lib] Error 2
   33.15 +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'
   33.16 +make: *** [lib] Error 2
   33.17 +
   33.18 +
   33.19 +See http://gcc.gnu.org/PR16350
   33.20 +
   33.21 +--- gcc-4.0-20050305/gcc/config/arm/linux-elf.h.orig	2005-03-23 18:44:54.822707377 +0100
   33.22 ++++ gcc-4.0-20050305/gcc/config/arm/linux-elf.h	2005-03-23 18:46:18.228560206 +0100
   33.23 +@@ -31,19 +31,33 @@
   33.24 + /* Do not assume anything about header files.  */
   33.25 + #define NO_IMPLICIT_EXTERN_C
   33.26 + 
   33.27 ++/*
   33.28 ++ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for
   33.29 ++ * arm*b-*-linux* (big endian) configurations.
   33.30 ++ */
   33.31 ++#if TARGET_BIG_ENDIAN_DEFAULT
   33.32 ++#define TARGET_ENDIAN_DEFAULT ARM_FLAG_BIG_END
   33.33 ++#define TARGET_ENDIAN_OPTION "mbig-endian"
   33.34 ++#define TARGET_LINKER_EMULATION "armelfb_linux"
   33.35 ++#else
   33.36 ++#define TARGET_ENDIAN_DEFAULT 0
   33.37 ++#define TARGET_ENDIAN_OPTION "mlittle-endian"
   33.38 ++#define TARGET_LINKER_EMULATION "armelf_linux"
   33.39 ++#endif
   33.40 ++
   33.41 + #undef  TARGET_DEFAULT_FLOAT_ABI
   33.42 + #define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD
   33.43 + 
   33.44 + #undef  TARGET_DEFAULT
   33.45 +-#define TARGET_DEFAULT (0)
   33.46 ++#define TARGET_DEFAULT (TARGET_ENDIAN_DEFAULT)
   33.47 + 
   33.48 + #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
   33.49 + 
   33.50 +-#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p"
   33.51 ++#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p"
   33.52 + 
   33.53 + #undef  MULTILIB_DEFAULTS
   33.54 + #define MULTILIB_DEFAULTS \
   33.55 +-	{ "marm", "mlittle-endian", "mhard-float", "mno-thumb-interwork" }
   33.56 ++	{ "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mno-thumb-interwork" }
   33.57 + 
   33.58 + /* The GNU C++ standard library requires that these macros be defined.  */
   33.59 + #undef CPLUSPLUS_CPP_SPEC
   33.60 +@@ -90,7 +104,7 @@
   33.61 +    %{rdynamic:-export-dynamic} \
   33.62 +    %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2} \
   33.63 +    -X \
   33.64 +-   %{mbig-endian:-EB}" \
   33.65 ++   %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
   33.66 +    SUBTARGET_EXTRA_LINK_SPEC
   33.67 + 
   33.68 + #define TARGET_OS_CPP_BUILTINS()		\
   33.69 +--- gcc-4.0-20050305/gcc/config.gcc.orig	2005-03-23 18:46:23.318105335 +0100
   33.70 ++++ gcc-4.0-20050305/gcc/config.gcc	2005-03-23 18:47:41.592546386 +0100
   33.71 +@@ -650,6 +650,11 @@
   33.72 + 	;;
   33.73 + arm*-*-linux*)			# ARM GNU/Linux with ELF
   33.74 + 	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"
   33.75 ++	case $target in
   33.76 ++	arm*b-*-linux*)
   33.77 ++		tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
   33.78 ++		;;
   33.79 ++	esac
   33.80 + 	tmake_file="${tmake_file} arm/t-arm arm/t-linux"
   33.81 + 	extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
   33.82 + 	gnu_ld=yes
    34.1 --- a/patches/gcc/4.0.0/110-gcc-4.0-arm-bigendian.patch	Mon Jul 28 20:17:48 2008 +0000
    34.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    34.3 @@ -1,79 +0,0 @@
    34.4 -By Lennert Buytenhek <buytenh@wantstofly.org>
    34.5 -Adds support for arm*b-linux* big-endian ARM targets
    34.6 -
    34.7 -Fixes following build error for big-endian ARM targets:
    34.8 -
    34.9 -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
   34.10 -Supported emulations: armelfb_linux armelfb
   34.11 -collect2: ld returned 1 exit status
   34.12 -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
   34.13 -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'
   34.14 -make[1]: *** [csu/subdir_lib] Error 2
   34.15 -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'
   34.16 -make: *** [lib] Error 2
   34.17 -
   34.18 -
   34.19 -See http://gcc.gnu.org/PR16350
   34.20 -
   34.21 ---- gcc-4.0-20050305/gcc/config/arm/linux-elf.h.orig	2005-03-23 18:44:54.822707377 +0100
   34.22 -+++ gcc-4.0-20050305/gcc/config/arm/linux-elf.h	2005-03-23 18:46:18.228560206 +0100
   34.23 -@@ -31,19 +31,33 @@
   34.24 - /* Do not assume anything about header files.  */
   34.25 - #define NO_IMPLICIT_EXTERN_C
   34.26 - 
   34.27 -+/*
   34.28 -+ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for
   34.29 -+ * arm*b-*-linux* (big endian) configurations.
   34.30 -+ */
   34.31 -+#if TARGET_BIG_ENDIAN_DEFAULT
   34.32 -+#define TARGET_ENDIAN_DEFAULT ARM_FLAG_BIG_END
   34.33 -+#define TARGET_ENDIAN_OPTION "mbig-endian"
   34.34 -+#define TARGET_LINKER_EMULATION "armelfb_linux"
   34.35 -+#else
   34.36 -+#define TARGET_ENDIAN_DEFAULT 0
   34.37 -+#define TARGET_ENDIAN_OPTION "mlittle-endian"
   34.38 -+#define TARGET_LINKER_EMULATION "armelf_linux"
   34.39 -+#endif
   34.40 -+
   34.41 - #undef  TARGET_DEFAULT_FLOAT_ABI
   34.42 - #define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD
   34.43 - 
   34.44 - #undef  TARGET_DEFAULT
   34.45 --#define TARGET_DEFAULT (0)
   34.46 -+#define TARGET_DEFAULT (TARGET_ENDIAN_DEFAULT)
   34.47 - 
   34.48 - #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
   34.49 - 
   34.50 --#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p"
   34.51 -+#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p"
   34.52 - 
   34.53 - #undef  MULTILIB_DEFAULTS
   34.54 - #define MULTILIB_DEFAULTS \
   34.55 --	{ "marm", "mlittle-endian", "mhard-float", "mno-thumb-interwork" }
   34.56 -+	{ "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mno-thumb-interwork" }
   34.57 - 
   34.58 - /* The GNU C++ standard library requires that these macros be defined.  */
   34.59 - #undef CPLUSPLUS_CPP_SPEC
   34.60 -@@ -90,7 +104,7 @@
   34.61 -    %{rdynamic:-export-dynamic} \
   34.62 -    %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2} \
   34.63 -    -X \
   34.64 --   %{mbig-endian:-EB}" \
   34.65 -+   %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
   34.66 -    SUBTARGET_EXTRA_LINK_SPEC
   34.67 - 
   34.68 - #define TARGET_OS_CPP_BUILTINS()		\
   34.69 ---- gcc-4.0-20050305/gcc/config.gcc.orig	2005-03-23 18:46:23.318105335 +0100
   34.70 -+++ gcc-4.0-20050305/gcc/config.gcc	2005-03-23 18:47:41.592546386 +0100
   34.71 -@@ -650,6 +650,11 @@
   34.72 - 	;;
   34.73 - arm*-*-linux*)			# ARM GNU/Linux with ELF
   34.74 - 	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"
   34.75 -+	case $target in
   34.76 -+	arm*b-*-linux*)
   34.77 -+		tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
   34.78 -+		;;
   34.79 -+	esac
   34.80 - 	tmake_file="${tmake_file} arm/t-arm arm/t-linux"
   34.81 - 	extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
   34.82 - 	gnu_ld=yes
    35.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    35.2 +++ b/patches/gcc/4.1.0/100-fix-fixincl.patch	Mon Jul 28 21:08:01 2008 +0000
    35.3 @@ -0,0 +1,71 @@
    35.4 +See http://gcc.gnu.org/PR22541
    35.5 +
    35.6 +From: Dan Kegel
    35.7 +
    35.8 +When building gcc-3.4.3 or gcc-4.x into a clean $PREFIX,
    35.9 +the configure script happily copies the glibc include files from include to sys-include;
   35.10 +here's the line from the log file (with $PREFIX instead of the real prefix):
   35.11 +
   35.12 +Copying $PREFIX/i686-unknown-linux-gnu/include to $PREFIX/i686-unknown-linux-gnu/sys-include
   35.13 +
   35.14 +But later, when running fixincludes, it gives the error message
   35.15 + The directory that should contain system headers does not exist:
   35.16 +  $PREFIX/lib/gcc/i686-unknown-linux-gnu/3.4.3/../../../../i686-unknown-linux-gnu/sys-include
   35.17 +
   35.18 +Nevertheless, it continues building; the header files it installs in
   35.19 + $PREFIX/lib/gcc/i686-unknown-linux-gnu/3.4.3/include
   35.20 +do not include the boilerplate that would cause it to #include_next the
   35.21 +glibc headers in the system header directory.
   35.22 +Thus the resulting toolchain can't compile the following program:
   35.23 +#include <limits.h>
   35.24 +int x = PATH_MAX;
   35.25 +because its limits.h doesn't include the glibc header.
   35.26 +
   35.27 +The problem is that gcc/Makefile.in assumes that
   35.28 +it can refer to $PREFIX/i686-unknown-linux-gnu  with the path
   35.29 +                $PREFIX/lib/../i686-unknown-linux-gnu, but
   35.30 +that fails because the directory $PREFIX/lib doesn't exist during 'make all';
   35.31 +it is only created later, during 'make install'.  (Which makes this problem
   35.32 +confusing, since one only notices the breakage well after 'make install',
   35.33 +at which point the path configure complained about does exist, and has the
   35.34 +right stuff in it.)
   35.35 +
   35.36 +A fix that I've been using for a while is to use sed to canonicalize
   35.37 +the path.  The sed syntax is a bit obtuse, but it works. 
   35.38 +
   35.39 +(hey, that's the first time I've ever used a label in a sed script; thanks to the sed faq
   35.40 +for explaining the :a ... ta method of looping to repeat a search-and-replace until it doesn't match.)
   35.41 +
   35.42 +[rediffed against gcc-4.1-20060210]
   35.43 +
   35.44 +--- gcc-4.1-20060210/gcc/Makefile.in.old	2006-01-11 06:29:29.000000000 -0800
   35.45 ++++ gcc-4.1-20060210/gcc/Makefile.in	2006-02-14 16:08:54.000000000 -0800
   35.46 +@@ -388,7 +388,10 @@
   35.47 + CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@
   35.48 + 
   35.49 + # autoconf sets SYSTEM_HEADER_DIR to one of the above.
   35.50 +-SYSTEM_HEADER_DIR = @SYSTEM_HEADER_DIR@
   35.51 ++# Purge it of unneccessary internal relative paths
   35.52 ++# to directories that might not exist yet.
   35.53 ++# The sed idiom for this is to repeat the search-and-replace until it doesn't match, using :a ... ta.
   35.54 ++SYSTEM_HEADER_DIR = `echo @SYSTEM_HEADER_DIR@ | sed -e :a -e "s,[^/]*/\.\.\/,," -e ta`
   35.55 + 
   35.56 + # Control whether to run fixproto and fixincludes.
   35.57 + STMP_FIXPROTO = @STMP_FIXPROTO@
   35.58 +@@ -3167,13 +3170,15 @@
   35.59 + ../$(build_subdir)/fixincludes/fixincl: ; @ :
   35.60 + 
   35.61 + # Build fixed copies of system files.
   35.62 ++# Abort if no system headers available, unless building a crosscompiler.
   35.63 ++# Canonicalize $gcc_tooldir/sys-include in same way as $SYSTEM_HEADER_DIR was canonicalized so test still works
   35.64 + stmp-fixinc: gsyslimits.h macro_list \
   35.65 +   $(build_objdir)/fixincludes/fixincl \
   35.66 +   $(build_objdir)/fixincludes/fixinc.sh
   35.67 + 	@if ! $(inhibit_libc) && test ! -d ${SYSTEM_HEADER_DIR}; then \
   35.68 + 	  echo The directory that should contain system headers does not exist: >&2 ; \
   35.69 + 	  echo "  ${SYSTEM_HEADER_DIR}" >&2 ; \
   35.70 +-	  if test "x${SYSTEM_HEADER_DIR}" = "x${gcc_tooldir}/sys-include"; \
   35.71 ++	  if test "x${SYSTEM_HEADER_DIR}" = "x`echo "${gcc_tooldir}/sys-include" | sed -e :a -e "s,[^/]*/\.\.\/,," -e ta`"; \
   35.72 + 	  then sleep 1; else exit 1; fi; \
   35.73 + 	fi
   35.74 + 	rm -rf include; mkdir include
    36.1 --- a/patches/gcc/4.1.0/100-gcc-4.1-fix-fixincl.patch	Mon Jul 28 20:17:48 2008 +0000
    36.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    36.3 @@ -1,71 +0,0 @@
    36.4 -See http://gcc.gnu.org/PR22541
    36.5 -
    36.6 -From: Dan Kegel
    36.7 -
    36.8 -When building gcc-3.4.3 or gcc-4.x into a clean $PREFIX,
    36.9 -the configure script happily copies the glibc include files from include to sys-include;
   36.10 -here's the line from the log file (with $PREFIX instead of the real prefix):
   36.11 -
   36.12 -Copying $PREFIX/i686-unknown-linux-gnu/include to $PREFIX/i686-unknown-linux-gnu/sys-include
   36.13 -
   36.14 -But later, when running fixincludes, it gives the error message
   36.15 - The directory that should contain system headers does not exist:
   36.16 -  $PREFIX/lib/gcc/i686-unknown-linux-gnu/3.4.3/../../../../i686-unknown-linux-gnu/sys-include
   36.17 -
   36.18 -Nevertheless, it continues building; the header files it installs in
   36.19 - $PREFIX/lib/gcc/i686-unknown-linux-gnu/3.4.3/include
   36.20 -do not include the boilerplate that would cause it to #include_next the
   36.21 -glibc headers in the system header directory.
   36.22 -Thus the resulting toolchain can't compile the following program:
   36.23 -#include <limits.h>
   36.24 -int x = PATH_MAX;
   36.25 -because its limits.h doesn't include the glibc header.
   36.26 -
   36.27 -The problem is that gcc/Makefile.in assumes that
   36.28 -it can refer to $PREFIX/i686-unknown-linux-gnu  with the path
   36.29 -                $PREFIX/lib/../i686-unknown-linux-gnu, but
   36.30 -that fails because the directory $PREFIX/lib doesn't exist during 'make all';
   36.31 -it is only created later, during 'make install'.  (Which makes this problem
   36.32 -confusing, since one only notices the breakage well after 'make install',
   36.33 -at which point the path configure complained about does exist, and has the
   36.34 -right stuff in it.)
   36.35 -
   36.36 -A fix that I've been using for a while is to use sed to canonicalize
   36.37 -the path.  The sed syntax is a bit obtuse, but it works. 
   36.38 -
   36.39 -(hey, that's the first time I've ever used a label in a sed script; thanks to the sed faq
   36.40 -for explaining the :a ... ta method of looping to repeat a search-and-replace until it doesn't match.)
   36.41 -
   36.42 -[rediffed against gcc-4.1-20060210]
   36.43 -
   36.44 ---- gcc-4.1-20060210/gcc/Makefile.in.old	2006-01-11 06:29:29.000000000 -0800
   36.45 -+++ gcc-4.1-20060210/gcc/Makefile.in	2006-02-14 16:08:54.000000000 -0800
   36.46 -@@ -388,7 +388,10 @@
   36.47 - CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@
   36.48 - 
   36.49 - # autoconf sets SYSTEM_HEADER_DIR to one of the above.
   36.50 --SYSTEM_HEADER_DIR = @SYSTEM_HEADER_DIR@
   36.51 -+# Purge it of unneccessary internal relative paths
   36.52 -+# to directories that might not exist yet.
   36.53 -+# The sed idiom for this is to repeat the search-and-replace until it doesn't match, using :a ... ta.
   36.54 -+SYSTEM_HEADER_DIR = `echo @SYSTEM_HEADER_DIR@ | sed -e :a -e "s,[^/]*/\.\.\/,," -e ta`
   36.55 - 
   36.56 - # Control whether to run fixproto and fixincludes.
   36.57 - STMP_FIXPROTO = @STMP_FIXPROTO@
   36.58 -@@ -3167,13 +3170,15 @@
   36.59 - ../$(build_subdir)/fixincludes/fixincl: ; @ :
   36.60 - 
   36.61 - # Build fixed copies of system files.
   36.62 -+# Abort if no system headers available, unless building a crosscompiler.
   36.63 -+# Canonicalize $gcc_tooldir/sys-include in same way as $SYSTEM_HEADER_DIR was canonicalized so test still works
   36.64 - stmp-fixinc: gsyslimits.h macro_list \
   36.65 -   $(build_objdir)/fixincludes/fixincl \
   36.66 -   $(build_objdir)/fixincludes/fixinc.sh
   36.67 - 	@if ! $(inhibit_libc) && test ! -d ${SYSTEM_HEADER_DIR}; then \
   36.68 - 	  echo The directory that should contain system headers does not exist: >&2 ; \
   36.69 - 	  echo "  ${SYSTEM_HEADER_DIR}" >&2 ; \
   36.70 --	  if test "x${SYSTEM_HEADER_DIR}" = "x${gcc_tooldir}/sys-include"; \
   36.71 -+	  if test "x${SYSTEM_HEADER_DIR}" = "x`echo "${gcc_tooldir}/sys-include" | sed -e :a -e "s,[^/]*/\.\.\/,," -e ta`"; \
   36.72 - 	  then sleep 1; else exit 1; fi; \
   36.73 - 	fi
   36.74 - 	rm -rf include; mkdir include
    37.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    37.2 +++ b/patches/gcc/4.2.0/940-alpha-signal_h.patch	Mon Jul 28 21:08:01 2008 +0000
    37.3 @@ -0,0 +1,17 @@
    37.4 +--- gcc-4.2.1-stock/gcc/config/alpha/linux-unwind.h	2005-06-24 20:22:41.000000000 -0500
    37.5 ++++ gcc-4.2.1/gcc/config/alpha/linux-unwind.h	2007-09-01 20:21:34.000000000 -0500
    37.6 +@@ -29,6 +29,9 @@ Boston, MA 02110-1301, USA.  */
    37.7 + /* Do code reading to identify a signal frame, and set the frame
    37.8 +    state data appropriately.  See unwind-dw2.c for the structs.  */
    37.9 + 
   37.10 ++/* Don't use this if inhibit_libc is set
   37.11 ++   The build for this target will fail trying to include missing headers */
   37.12 ++#ifndef inhibit_libc
   37.13 + #include <signal.h>
   37.14 + #include <sys/ucontext.h>
   37.15 + 
   37.16 +@@ -80,3 +83,4 @@ alpha_fallback_frame_state (struct _Unwi
   37.17 +   fs->retaddr_column = 64;
   37.18 +   return _URC_NO_REASON;
   37.19 + }
   37.20 ++#endif /* inhibit_libc */
    38.1 --- a/patches/gcc/4.2.0/940-gcc-alpha-signal_h.patch	Mon Jul 28 20:17:48 2008 +0000
    38.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    38.3 @@ -1,17 +0,0 @@
    38.4 ---- gcc-4.2.1-stock/gcc/config/alpha/linux-unwind.h	2005-06-24 20:22:41.000000000 -0500
    38.5 -+++ gcc-4.2.1/gcc/config/alpha/linux-unwind.h	2007-09-01 20:21:34.000000000 -0500
    38.6 -@@ -29,6 +29,9 @@ Boston, MA 02110-1301, USA.  */
    38.7 - /* Do code reading to identify a signal frame, and set the frame
    38.8 -    state data appropriately.  See unwind-dw2.c for the structs.  */
    38.9 - 
   38.10 -+/* Don't use this if inhibit_libc is set
   38.11 -+   The build for this target will fail trying to include missing headers */
   38.12 -+#ifndef inhibit_libc
   38.13 - #include <signal.h>
   38.14 - #include <sys/ucontext.h>
   38.15 - 
   38.16 -@@ -80,3 +83,4 @@ alpha_fallback_frame_state (struct _Unwi
   38.17 -   fs->retaddr_column = 64;
   38.18 -   return _URC_NO_REASON;
   38.19 - }
   38.20 -+#endif /* inhibit_libc */
    39.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    39.2 +++ b/patches/gcc/4.2.1/940-alpha-signal_h.patch	Mon Jul 28 21:08:01 2008 +0000
    39.3 @@ -0,0 +1,17 @@
    39.4 +--- gcc-4.2.1-stock/gcc/config/alpha/linux-unwind.h	2005-06-24 20:22:41.000000000 -0500
    39.5 ++++ gcc-4.2.1/gcc/config/alpha/linux-unwind.h	2007-09-01 20:21:34.000000000 -0500
    39.6 +@@ -29,6 +29,9 @@ Boston, MA 02110-1301, USA.  */
    39.7 + /* Do code reading to identify a signal frame, and set the frame
    39.8 +    state data appropriately.  See unwind-dw2.c for the structs.  */
    39.9 + 
   39.10 ++/* Don't use this if inhibit_libc is set
   39.11 ++   The build for this target will fail trying to include missing headers */
   39.12 ++#ifndef inhibit_libc
   39.13 + #include <signal.h>
   39.14 + #include <sys/ucontext.h>
   39.15 + 
   39.16 +@@ -80,3 +83,4 @@ alpha_fallback_frame_state (struct _Unwi
   39.17 +   fs->retaddr_column = 64;
   39.18 +   return _URC_NO_REASON;
   39.19 + }
   39.20 ++#endif /* inhibit_libc */
    40.1 --- a/patches/gcc/4.2.1/940-gcc-alpha-signal_h.patch	Mon Jul 28 20:17:48 2008 +0000
    40.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    40.3 @@ -1,17 +0,0 @@
    40.4 ---- gcc-4.2.1-stock/gcc/config/alpha/linux-unwind.h	2005-06-24 20:22:41.000000000 -0500
    40.5 -+++ gcc-4.2.1/gcc/config/alpha/linux-unwind.h	2007-09-01 20:21:34.000000000 -0500
    40.6 -@@ -29,6 +29,9 @@ Boston, MA 02110-1301, USA.  */
    40.7 - /* Do code reading to identify a signal frame, and set the frame
    40.8 -    state data appropriately.  See unwind-dw2.c for the structs.  */
    40.9 - 
   40.10 -+/* Don't use this if inhibit_libc is set
   40.11 -+   The build for this target will fail trying to include missing headers */
   40.12 -+#ifndef inhibit_libc
   40.13 - #include <signal.h>
   40.14 - #include <sys/ucontext.h>
   40.15 - 
   40.16 -@@ -80,3 +83,4 @@ alpha_fallback_frame_state (struct _Unwi
   40.17 -   fs->retaddr_column = 64;
   40.18 -   return _URC_NO_REASON;
   40.19 - }
   40.20 -+#endif /* inhibit_libc */
    41.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    41.2 +++ b/patches/gcc/4.2.2/940-alpha-signal_h.patch	Mon Jul 28 21:08:01 2008 +0000
    41.3 @@ -0,0 +1,17 @@
    41.4 +--- gcc-4.2.1-stock/gcc/config/alpha/linux-unwind.h	2005-06-24 20:22:41.000000000 -0500
    41.5 ++++ gcc-4.2.1/gcc/config/alpha/linux-unwind.h	2007-09-01 20:21:34.000000000 -0500
    41.6 +@@ -29,6 +29,9 @@ Boston, MA 02110-1301, USA.  */
    41.7 + /* Do code reading to identify a signal frame, and set the frame
    41.8 +    state data appropriately.  See unwind-dw2.c for the structs.  */
    41.9 + 
   41.10 ++/* Don't use this if inhibit_libc is set
   41.11 ++   The build for this target will fail trying to include missing headers */
   41.12 ++#ifndef inhibit_libc
   41.13 + #include <signal.h>
   41.14 + #include <sys/ucontext.h>
   41.15 + 
   41.16 +@@ -80,3 +83,4 @@ alpha_fallback_frame_state (struct _Unwi
   41.17 +   fs->retaddr_column = 64;
   41.18 +   return _URC_NO_REASON;
   41.19 + }
   41.20 ++#endif /* inhibit_libc */
    42.1 --- a/patches/gcc/4.2.2/940-gcc-alpha-signal_h.patch	Mon Jul 28 20:17:48 2008 +0000
    42.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    42.3 @@ -1,17 +0,0 @@
    42.4 ---- gcc-4.2.1-stock/gcc/config/alpha/linux-unwind.h	2005-06-24 20:22:41.000000000 -0500
    42.5 -+++ gcc-4.2.1/gcc/config/alpha/linux-unwind.h	2007-09-01 20:21:34.000000000 -0500
    42.6 -@@ -29,6 +29,9 @@ Boston, MA 02110-1301, USA.  */
    42.7 - /* Do code reading to identify a signal frame, and set the frame
    42.8 -    state data appropriately.  See unwind-dw2.c for the structs.  */
    42.9 - 
   42.10 -+/* Don't use this if inhibit_libc is set
   42.11 -+   The build for this target will fail trying to include missing headers */
   42.12 -+#ifndef inhibit_libc
   42.13 - #include <signal.h>
   42.14 - #include <sys/ucontext.h>
   42.15 - 
   42.16 -@@ -80,3 +83,4 @@ alpha_fallback_frame_state (struct _Unwi
   42.17 -   fs->retaddr_column = 64;
   42.18 -   return _URC_NO_REASON;
   42.19 - }
   42.20 -+#endif /* inhibit_libc */
    43.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    43.2 +++ b/patches/gcc/4.2.3/940-alpha-signal_h.patch	Mon Jul 28 21:08:01 2008 +0000
    43.3 @@ -0,0 +1,17 @@
    43.4 +--- gcc-4.2.1-stock/gcc/config/alpha/linux-unwind.h	2005-06-24 20:22:41.000000000 -0500
    43.5 ++++ gcc-4.2.1/gcc/config/alpha/linux-unwind.h	2007-09-01 20:21:34.000000000 -0500
    43.6 +@@ -29,6 +29,9 @@ Boston, MA 02110-1301, USA.  */
    43.7 + /* Do code reading to identify a signal frame, and set the frame
    43.8 +    state data appropriately.  See unwind-dw2.c for the structs.  */
    43.9 + 
   43.10 ++/* Don't use this if inhibit_libc is set
   43.11 ++   The build for this target will fail trying to include missing headers */
   43.12 ++#ifndef inhibit_libc
   43.13 + #include <signal.h>
   43.14 + #include <sys/ucontext.h>
   43.15 + 
   43.16 +@@ -80,3 +83,4 @@ alpha_fallback_frame_state (struct _Unwi
   43.17 +   fs->retaddr_column = 64;
   43.18 +   return _URC_NO_REASON;
   43.19 + }
   43.20 ++#endif /* inhibit_libc */
    44.1 --- a/patches/gcc/4.2.3/940-gcc-alpha-signal_h.patch	Mon Jul 28 20:17:48 2008 +0000
    44.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    44.3 @@ -1,17 +0,0 @@
    44.4 ---- gcc-4.2.1-stock/gcc/config/alpha/linux-unwind.h	2005-06-24 20:22:41.000000000 -0500
    44.5 -+++ gcc-4.2.1/gcc/config/alpha/linux-unwind.h	2007-09-01 20:21:34.000000000 -0500
    44.6 -@@ -29,6 +29,9 @@ Boston, MA 02110-1301, USA.  */
    44.7 - /* Do code reading to identify a signal frame, and set the frame
    44.8 -    state data appropriately.  See unwind-dw2.c for the structs.  */
    44.9 - 
   44.10 -+/* Don't use this if inhibit_libc is set
   44.11 -+   The build for this target will fail trying to include missing headers */
   44.12 -+#ifndef inhibit_libc
   44.13 - #include <signal.h>
   44.14 - #include <sys/ucontext.h>
   44.15 - 
   44.16 -@@ -80,3 +83,4 @@ alpha_fallback_frame_state (struct _Unwi
   44.17 -   fs->retaddr_column = 64;
   44.18 -   return _URC_NO_REASON;
   44.19 - }
   44.20 -+#endif /* inhibit_libc */
    45.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    45.2 +++ b/patches/gcc/4.2.4/940-alpha-signal_h.patch	Mon Jul 28 21:08:01 2008 +0000
    45.3 @@ -0,0 +1,17 @@
    45.4 +--- gcc-4.2.1-stock/gcc/config/alpha/linux-unwind.h	2005-06-24 20:22:41.000000000 -0500
    45.5 ++++ gcc-4.2.1/gcc/config/alpha/linux-unwind.h	2007-09-01 20:21:34.000000000 -0500
    45.6 +@@ -29,6 +29,9 @@ Boston, MA 02110-1301, USA.  */
    45.7 + /* Do code reading to identify a signal frame, and set the frame
    45.8 +    state data appropriately.  See unwind-dw2.c for the structs.  */
    45.9 + 
   45.10 ++/* Don't use this if inhibit_libc is set
   45.11 ++   The build for this target will fail trying to include missing headers */
   45.12 ++#ifndef inhibit_libc
   45.13 + #include <signal.h>
   45.14 + #include <sys/ucontext.h>
   45.15 + 
   45.16 +@@ -80,3 +83,4 @@ alpha_fallback_frame_state (struct _Unwi
   45.17 +   fs->retaddr_column = 64;
   45.18 +   return _URC_NO_REASON;
   45.19 + }
   45.20 ++#endif /* inhibit_libc */
    46.1 --- a/patches/gcc/4.2.4/940-gcc-alpha-signal_h.patch	Mon Jul 28 20:17:48 2008 +0000
    46.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    46.3 @@ -1,17 +0,0 @@
    46.4 ---- gcc-4.2.1-stock/gcc/config/alpha/linux-unwind.h	2005-06-24 20:22:41.000000000 -0500
    46.5 -+++ gcc-4.2.1/gcc/config/alpha/linux-unwind.h	2007-09-01 20:21:34.000000000 -0500
    46.6 -@@ -29,6 +29,9 @@ Boston, MA 02110-1301, USA.  */
    46.7 - /* Do code reading to identify a signal frame, and set the frame
    46.8 -    state data appropriately.  See unwind-dw2.c for the structs.  */
    46.9 - 
   46.10 -+/* Don't use this if inhibit_libc is set
   46.11 -+   The build for this target will fail trying to include missing headers */
   46.12 -+#ifndef inhibit_libc
   46.13 - #include <signal.h>
   46.14 - #include <sys/ucontext.h>
   46.15 - 
   46.16 -@@ -80,3 +83,4 @@ alpha_fallback_frame_state (struct _Unwi
   46.17 -   fs->retaddr_column = 64;
   46.18 -   return _URC_NO_REASON;
   46.19 - }
   46.20 -+#endif /* inhibit_libc */
    47.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    47.2 +++ b/patches/gcc/4.3.0/100-alpha-mieee-default.patch	Mon Jul 28 21:08:01 2008 +0000
    47.3 @@ -0,0 +1,34 @@
    47.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/00_all_gcc-4.1-alpha-mieee-default.patch
    47.5 +Set the default behavior on alpha to use -mieee since the large majority of
    47.6 +time we want this (bad/weird things can happen with packages built without
    47.7 +-mieee).
    47.8 +
    47.9 +To satisfy those people who may not want -mieee forced on them all the time,
   47.10 +we also provide -mno-ieee.
   47.11 +
   47.12 +Patch by Mike Frysinger <vapier@gentoo.org>
   47.13 +
   47.14 +diff -durN gcc-4.3.0.orig/gcc/config/alpha/alpha.h gcc-4.3.0/gcc/config/alpha/alpha.h
   47.15 +--- gcc-4.3.0.orig/gcc/config/alpha/alpha.h	2007-12-06 14:25:37.000000000 +0100
   47.16 ++++ gcc-4.3.0/gcc/config/alpha/alpha.h	2008-06-10 14:44:06.000000000 +0200
   47.17 +@@ -95,6 +95,8 @@
   47.18 +   while (0)
   47.19 + #endif
   47.20 + 
   47.21 ++#define CPP_SPEC "%{!no-ieee:-mieee}"
   47.22 ++
   47.23 + #define WORD_SWITCH_TAKES_ARG(STR)		\
   47.24 +  (!strcmp (STR, "rpath") || DEFAULT_WORD_SWITCH_TAKES_ARG(STR))
   47.25 + 
   47.26 +diff -durN gcc-4.3.0.orig/gcc/config/alpha/alpha.opt gcc-4.3.0/gcc/config/alpha/alpha.opt
   47.27 +--- gcc-4.3.0.orig/gcc/config/alpha/alpha.opt	2007-08-02 12:49:31.000000000 +0200
   47.28 ++++ gcc-4.3.0/gcc/config/alpha/alpha.opt	2008-06-10 14:44:06.000000000 +0200
   47.29 +@@ -39,7 +39,7 @@
   47.30 + Request IEEE-conformant math library routines (OSF/1)
   47.31 + 
   47.32 + mieee
   47.33 +-Target Report RejectNegative Mask(IEEE)
   47.34 ++Target Report Mask(IEEE)
   47.35 + Emit IEEE-conformant code, without inexact exceptions
   47.36 + 
   47.37 + mieee-with-inexact
    48.1 --- a/patches/gcc/4.3.0/100-gcc-4.1-alpha-mieee-default.patch	Mon Jul 28 20:17:48 2008 +0000
    48.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    48.3 @@ -1,34 +0,0 @@
    48.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/00_all_gcc-4.1-alpha-mieee-default.patch
    48.5 -Set the default behavior on alpha to use -mieee since the large majority of
    48.6 -time we want this (bad/weird things can happen with packages built without
    48.7 --mieee).
    48.8 -
    48.9 -To satisfy those people who may not want -mieee forced on them all the time,
   48.10 -we also provide -mno-ieee.
   48.11 -
   48.12 -Patch by Mike Frysinger <vapier@gentoo.org>
   48.13 -
   48.14 -diff -durN gcc-4.3.0.orig/gcc/config/alpha/alpha.h gcc-4.3.0/gcc/config/alpha/alpha.h
   48.15 ---- gcc-4.3.0.orig/gcc/config/alpha/alpha.h	2007-12-06 14:25:37.000000000 +0100
   48.16 -+++ gcc-4.3.0/gcc/config/alpha/alpha.h	2008-06-10 14:44:06.000000000 +0200
   48.17 -@@ -95,6 +95,8 @@
   48.18 -   while (0)
   48.19 - #endif
   48.20 - 
   48.21 -+#define CPP_SPEC "%{!no-ieee:-mieee}"
   48.22 -+
   48.23 - #define WORD_SWITCH_TAKES_ARG(STR)		\
   48.24 -  (!strcmp (STR, "rpath") || DEFAULT_WORD_SWITCH_TAKES_ARG(STR))
   48.25 - 
   48.26 -diff -durN gcc-4.3.0.orig/gcc/config/alpha/alpha.opt gcc-4.3.0/gcc/config/alpha/alpha.opt
   48.27 ---- gcc-4.3.0.orig/gcc/config/alpha/alpha.opt	2007-08-02 12:49:31.000000000 +0200
   48.28 -+++ gcc-4.3.0/gcc/config/alpha/alpha.opt	2008-06-10 14:44:06.000000000 +0200
   48.29 -@@ -39,7 +39,7 @@
   48.30 - Request IEEE-conformant math library routines (OSF/1)
   48.31 - 
   48.32 - mieee
   48.33 --Target Report RejectNegative Mask(IEEE)
   48.34 -+Target Report Mask(IEEE)
   48.35 - Emit IEEE-conformant code, without inexact exceptions
   48.36 - 
   48.37 - mieee-with-inexact
    49.1 --- a/patches/gcc/4.3.0/125-gcc-trampolinewarn.patch	Mon Jul 28 20:17:48 2008 +0000
    49.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    49.3 @@ -1,35 +0,0 @@
    49.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/00_all_gcc-trampolinewarn.patch
    49.5 -	This trivial patch causes gcc to emit a warning whenever
    49.6 -	it generates a trampoline.  These are otherwise hard to
    49.7 -	locate.  It is rigged to default ON - to have it default
    49.8 -	to OFF remove the text 'Init(1)' from the common.opt
    49.9 -	patch, leaving just 'Common Var(warn_trampolines)'.
   49.10 -	Kevin F. Quinn <kevquinn@gentoo.org> 17 Jan 2006
   49.11 -
   49.12 -diff -durN gcc-4.3.0.orig/gcc/builtins.c gcc-4.3.0/gcc/builtins.c
   49.13 ---- gcc-4.3.0.orig/gcc/builtins.c	2008-02-20 18:27:21.000000000 +0100
   49.14 -+++ gcc-4.3.0/gcc/builtins.c	2008-06-10 14:44:10.000000000 +0200
   49.15 -@@ -5659,6 +5659,9 @@
   49.16 -   trampolines_created = 1;
   49.17 -   INITIALIZE_TRAMPOLINE (r_tramp, r_func, r_chain);
   49.18 - 
   49.19 -+  if (warn_trampolines)
   49.20 -+    warning (OPT_Wtrampolines, "generating trampoline in object (requires executable stack)");
   49.21 -+
   49.22 -   return const0_rtx;
   49.23 - }
   49.24 - 
   49.25 -diff -durN gcc-4.3.0.orig/gcc/common.opt gcc-4.3.0/gcc/common.opt
   49.26 ---- gcc-4.3.0.orig/gcc/common.opt	2008-01-22 15:11:44.000000000 +0100
   49.27 -+++ gcc-4.3.0/gcc/common.opt	2008-06-10 14:44:10.000000000 +0200
   49.28 -@@ -182,6 +182,10 @@
   49.29 - Common Var(warn_system_headers) Warning
   49.30 - Do not suppress warnings from system headers
   49.31 - 
   49.32 -+Wtrampolines
   49.33 -+Common Var(warn_trampolines) Init(1)
   49.34 -+Warn whenever a trampoline is generated
   49.35 -+
   49.36 - Wuninitialized
   49.37 - Common Var(warn_uninitialized) Warning
   49.38 - Warn about uninitialized automatic variables
    50.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    50.2 +++ b/patches/gcc/4.3.0/125-trampolinewarn.patch	Mon Jul 28 21:08:01 2008 +0000
    50.3 @@ -0,0 +1,35 @@
    50.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/00_all_gcc-trampolinewarn.patch
    50.5 +	This trivial patch causes gcc to emit a warning whenever
    50.6 +	it generates a trampoline.  These are otherwise hard to
    50.7 +	locate.  It is rigged to default ON - to have it default
    50.8 +	to OFF remove the text 'Init(1)' from the common.opt
    50.9 +	patch, leaving just 'Common Var(warn_trampolines)'.
   50.10 +	Kevin F. Quinn <kevquinn@gentoo.org> 17 Jan 2006
   50.11 +
   50.12 +diff -durN gcc-4.3.0.orig/gcc/builtins.c gcc-4.3.0/gcc/builtins.c
   50.13 +--- gcc-4.3.0.orig/gcc/builtins.c	2008-02-20 18:27:21.000000000 +0100
   50.14 ++++ gcc-4.3.0/gcc/builtins.c	2008-06-10 14:44:10.000000000 +0200
   50.15 +@@ -5659,6 +5659,9 @@
   50.16 +   trampolines_created = 1;
   50.17 +   INITIALIZE_TRAMPOLINE (r_tramp, r_func, r_chain);
   50.18 + 
   50.19 ++  if (warn_trampolines)
   50.20 ++    warning (OPT_Wtrampolines, "generating trampoline in object (requires executable stack)");
   50.21 ++
   50.22 +   return const0_rtx;
   50.23 + }
   50.24 + 
   50.25 +diff -durN gcc-4.3.0.orig/gcc/common.opt gcc-4.3.0/gcc/common.opt
   50.26 +--- gcc-4.3.0.orig/gcc/common.opt	2008-01-22 15:11:44.000000000 +0100
   50.27 ++++ gcc-4.3.0/gcc/common.opt	2008-06-10 14:44:10.000000000 +0200
   50.28 +@@ -182,6 +182,10 @@
   50.29 + Common Var(warn_system_headers) Warning
   50.30 + Do not suppress warnings from system headers
   50.31 + 
   50.32 ++Wtrampolines
   50.33 ++Common Var(warn_trampolines) Init(1)
   50.34 ++Warn whenever a trampoline is generated
   50.35 ++
   50.36 + Wuninitialized
   50.37 + Common Var(warn_uninitialized) Warning
   50.38 + Warn about uninitialized automatic variables
    51.1 --- a/patches/gcc/4.3.0/150-gcc43-java-nomulti.patch	Mon Jul 28 20:17:48 2008 +0000
    51.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    51.3 @@ -1,47 +0,0 @@
    51.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/03_all_gcc43-java-nomulti.patch
    51.5 -diff -durN gcc-4.3.0.orig/libjava/configure gcc-4.3.0/libjava/configure
    51.6 ---- gcc-4.3.0.orig/libjava/configure	2008-03-05 19:44:25.000000000 +0100
    51.7 -+++ gcc-4.3.0/libjava/configure	2008-06-10 14:44:13.000000000 +0200
    51.8 -@@ -1018,6 +1018,8 @@
    51.9 -   --enable-gconf-peer     compile GConf native peers for util.preferences
   51.10 -   --enable-java-maintainer-mode
   51.11 -                           allow rebuilding of .class and .h files
   51.12 -+  --enable-libjava-multilib
   51.13 -+                          build libjava as multilib
   51.14 -   --disable-dependency-tracking  speeds up one-time build
   51.15 -   --enable-dependency-tracking   do not reject slow dependency extractors
   51.16 -   --enable-maintainer-mode  enable make rules and dependencies not useful
   51.17 -@@ -1850,6 +1852,16 @@
   51.18 - fi
   51.19 - 
   51.20 - 
   51.21 -+# Check whether --enable-libjava-multilib was given.
   51.22 -+if test "${enable_libjava_multilib+set}" = set; then
   51.23 -+  enableval=$enable_libjava_multilib;
   51.24 -+fi
   51.25 -+
   51.26 -+if test "$enable_libjava_multilib" = no; then
   51.27 -+  multilib=no
   51.28 -+  ac_configure_args="$ac_configure_args --disable-multilib"
   51.29 -+fi
   51.30 -+
   51.31 - # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX.
   51.32 - 
   51.33 - 
   51.34 -diff -durN gcc-4.3.0.orig/libjava/configure.ac gcc-4.3.0/libjava/configure.ac
   51.35 ---- gcc-4.3.0.orig/libjava/configure.ac	2007-12-22 16:48:46.000000000 +0100
   51.36 -+++ gcc-4.3.0/libjava/configure.ac	2008-06-10 14:44:13.000000000 +0200
   51.37 -@@ -82,6 +82,13 @@
   51.38 - 	[allow rebuilding of .class and .h files]))
   51.39 - AM_CONDITIONAL(JAVA_MAINTAINER_MODE, test "$enable_java_maintainer_mode" = yes)
   51.40 - 
   51.41 -+AC_ARG_ENABLE(libjava-multilib,
   51.42 -+	AS_HELP_STRING([--enable-libjava-multilib], [build libjava as multilib]))
   51.43 -+if test "$enable_libjava_multilib" = no; then
   51.44 -+  multilib=no
   51.45 -+  ac_configure_args="$ac_configure_args --disable-multilib"
   51.46 -+fi
   51.47 -+
   51.48 - # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX.
   51.49 - GCC_NO_EXECUTABLES
   51.50 - 
    52.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    52.2 +++ b/patches/gcc/4.3.0/150-java-nomulti.patch	Mon Jul 28 21:08:01 2008 +0000
    52.3 @@ -0,0 +1,47 @@
    52.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/03_all_gcc43-java-nomulti.patch
    52.5 +diff -durN gcc-4.3.0.orig/libjava/configure gcc-4.3.0/libjava/configure
    52.6 +--- gcc-4.3.0.orig/libjava/configure	2008-03-05 19:44:25.000000000 +0100
    52.7 ++++ gcc-4.3.0/libjava/configure	2008-06-10 14:44:13.000000000 +0200
    52.8 +@@ -1018,6 +1018,8 @@
    52.9 +   --enable-gconf-peer     compile GConf native peers for util.preferences
   52.10 +   --enable-java-maintainer-mode
   52.11 +                           allow rebuilding of .class and .h files
   52.12 ++  --enable-libjava-multilib
   52.13 ++                          build libjava as multilib
   52.14 +   --disable-dependency-tracking  speeds up one-time build
   52.15 +   --enable-dependency-tracking   do not reject slow dependency extractors
   52.16 +   --enable-maintainer-mode  enable make rules and dependencies not useful
   52.17 +@@ -1850,6 +1852,16 @@
   52.18 + fi
   52.19 + 
   52.20 + 
   52.21 ++# Check whether --enable-libjava-multilib was given.
   52.22 ++if test "${enable_libjava_multilib+set}" = set; then
   52.23 ++  enableval=$enable_libjava_multilib;
   52.24 ++fi
   52.25 ++
   52.26 ++if test "$enable_libjava_multilib" = no; then
   52.27 ++  multilib=no
   52.28 ++  ac_configure_args="$ac_configure_args --disable-multilib"
   52.29 ++fi
   52.30 ++
   52.31 + # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX.
   52.32 + 
   52.33 + 
   52.34 +diff -durN gcc-4.3.0.orig/libjava/configure.ac gcc-4.3.0/libjava/configure.ac
   52.35 +--- gcc-4.3.0.orig/libjava/configure.ac	2007-12-22 16:48:46.000000000 +0100
   52.36 ++++ gcc-4.3.0/libjava/configure.ac	2008-06-10 14:44:13.000000000 +0200
   52.37 +@@ -82,6 +82,13 @@
   52.38 + 	[allow rebuilding of .class and .h files]))
   52.39 + AM_CONDITIONAL(JAVA_MAINTAINER_MODE, test "$enable_java_maintainer_mode" = yes)
   52.40 + 
   52.41 ++AC_ARG_ENABLE(libjava-multilib,
   52.42 ++	AS_HELP_STRING([--enable-libjava-multilib], [build libjava as multilib]))
   52.43 ++if test "$enable_libjava_multilib" = no; then
   52.44 ++  multilib=no
   52.45 ++  ac_configure_args="$ac_configure_args --disable-multilib"
   52.46 ++fi
   52.47 ++
   52.48 + # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX.
   52.49 + GCC_NO_EXECUTABLES
   52.50 + 
    53.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    53.2 +++ b/patches/gcc/4.3.0/175-cross-compile.patch	Mon Jul 28 21:08:01 2008 +0000
    53.3 @@ -0,0 +1,44 @@
    53.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/08_all_gcc-4.1-cross-compile.patch
    53.5 +Some notes on the 'bootstrap with or without libc headers' debate:
    53.6 +http://linuxfromscratch.org/pipermail/lfs-dev/2005-July/052409.html
    53.7 +http://gcc.gnu.org/ml/gcc/2005-07/msg01195.html
    53.8 +
    53.9 +diff -durN gcc-4.3.0.orig/gcc/configure gcc-4.3.0/gcc/configure
   53.10 +--- gcc-4.3.0.orig/gcc/configure	2008-03-05 00:39:11.000000000 +0100
   53.11 ++++ gcc-4.3.0/gcc/configure	2008-06-10 14:44:17.000000000 +0200
   53.12 +@@ -13274,7 +13274,7 @@
   53.13 + 	    | powerpc*-*-*,powerpc64*-*-*)
   53.14 + 		CROSS="$CROSS -DNATIVE_CROSS" ;;
   53.15 + 	esac
   53.16 +-elif test "x$TARGET_SYSTEM_ROOT" != x; then
   53.17 ++elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then
   53.18 +         SYSTEM_HEADER_DIR=$build_system_header_dir
   53.19 + fi
   53.20 + 
   53.21 +diff -durN gcc-4.3.0.orig/gcc/configure.ac gcc-4.3.0/gcc/configure.ac
   53.22 +--- gcc-4.3.0.orig/gcc/configure.ac	2008-03-05 00:39:11.000000000 +0100
   53.23 ++++ gcc-4.3.0/gcc/configure.ac	2008-06-10 14:44:17.000000000 +0200
   53.24 +@@ -1745,7 +1745,7 @@
   53.25 + 	    | powerpc*-*-*,powerpc64*-*-*)
   53.26 + 		CROSS="$CROSS -DNATIVE_CROSS" ;;
   53.27 + 	esac
   53.28 +-elif test "x$TARGET_SYSTEM_ROOT" != x; then
   53.29 ++elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then
   53.30 +         SYSTEM_HEADER_DIR=$build_system_header_dir 
   53.31 + fi
   53.32 + 
   53.33 +diff -durN gcc-4.3.0.orig/gcc/unwind-dw2.c gcc-4.3.0/gcc/unwind-dw2.c
   53.34 +--- gcc-4.3.0.orig/gcc/unwind-dw2.c	2007-07-25 20:14:57.000000000 +0200
   53.35 ++++ gcc-4.3.0/gcc/unwind-dw2.c	2008-06-10 14:44:17.000000000 +0200
   53.36 +@@ -334,9 +334,11 @@
   53.37 + }
   53.38 + #endif
   53.39 + 
   53.40 ++#ifndef inhibit_libc
   53.41 + #ifdef MD_UNWIND_SUPPORT
   53.42 + #include MD_UNWIND_SUPPORT
   53.43 + #endif
   53.44 ++#endif
   53.45 + 
   53.46 + /* Extract any interesting information from the CIE for the translation
   53.47 +    unit F belongs to.  Return a pointer to the byte after the augmentation,
    54.1 --- a/patches/gcc/4.3.0/175-gcc-4.1-cross-compile.patch	Mon Jul 28 20:17:48 2008 +0000
    54.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    54.3 @@ -1,44 +0,0 @@
    54.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/08_all_gcc-4.1-cross-compile.patch
    54.5 -Some notes on the 'bootstrap with or without libc headers' debate:
    54.6 -http://linuxfromscratch.org/pipermail/lfs-dev/2005-July/052409.html
    54.7 -http://gcc.gnu.org/ml/gcc/2005-07/msg01195.html
    54.8 -
    54.9 -diff -durN gcc-4.3.0.orig/gcc/configure gcc-4.3.0/gcc/configure
   54.10 ---- gcc-4.3.0.orig/gcc/configure	2008-03-05 00:39:11.000000000 +0100
   54.11 -+++ gcc-4.3.0/gcc/configure	2008-06-10 14:44:17.000000000 +0200
   54.12 -@@ -13274,7 +13274,7 @@
   54.13 - 	    | powerpc*-*-*,powerpc64*-*-*)
   54.14 - 		CROSS="$CROSS -DNATIVE_CROSS" ;;
   54.15 - 	esac
   54.16 --elif test "x$TARGET_SYSTEM_ROOT" != x; then
   54.17 -+elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then
   54.18 -         SYSTEM_HEADER_DIR=$build_system_header_dir
   54.19 - fi
   54.20 - 
   54.21 -diff -durN gcc-4.3.0.orig/gcc/configure.ac gcc-4.3.0/gcc/configure.ac
   54.22 ---- gcc-4.3.0.orig/gcc/configure.ac	2008-03-05 00:39:11.000000000 +0100
   54.23 -+++ gcc-4.3.0/gcc/configure.ac	2008-06-10 14:44:17.000000000 +0200
   54.24 -@@ -1745,7 +1745,7 @@
   54.25 - 	    | powerpc*-*-*,powerpc64*-*-*)
   54.26 - 		CROSS="$CROSS -DNATIVE_CROSS" ;;
   54.27 - 	esac
   54.28 --elif test "x$TARGET_SYSTEM_ROOT" != x; then
   54.29 -+elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then
   54.30 -         SYSTEM_HEADER_DIR=$build_system_header_dir 
   54.31 - fi
   54.32 - 
   54.33 -diff -durN gcc-4.3.0.orig/gcc/unwind-dw2.c gcc-4.3.0/gcc/unwind-dw2.c
   54.34 ---- gcc-4.3.0.orig/gcc/unwind-dw2.c	2007-07-25 20:14:57.000000000 +0200
   54.35 -+++ gcc-4.3.0/gcc/unwind-dw2.c	2008-06-10 14:44:17.000000000 +0200
   54.36 -@@ -334,9 +334,11 @@
   54.37 - }
   54.38 - #endif
   54.39 - 
   54.40 -+#ifndef inhibit_libc
   54.41 - #ifdef MD_UNWIND_SUPPORT
   54.42 - #include MD_UNWIND_SUPPORT
   54.43 - #endif
   54.44 -+#endif
   54.45 - 
   54.46 - /* Extract any interesting information from the CIE for the translation
   54.47 -    unit F belongs to.  Return a pointer to the byte after the augmentation,
    55.1 --- a/patches/gcc/4.3.0/200-gcc-netbsd-symbolic.patch	Mon Jul 28 20:17:48 2008 +0000
    55.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    55.3 @@ -1,14 +0,0 @@
    55.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/11_all_gcc-netbsd-symbolic.patch
    55.5 -http://bugs.gentoo.org/122698
    55.6 -
    55.7 -diff -durN gcc-4.3.0.orig/gcc/config/netbsd-elf.h gcc-4.3.0/gcc/config/netbsd-elf.h
    55.8 ---- gcc-4.3.0.orig/gcc/config/netbsd-elf.h	2007-09-03 18:14:04.000000000 +0200
    55.9 -+++ gcc-4.3.0/gcc/config/netbsd-elf.h	2008-06-10 14:44:21.000000000 +0200
   55.10 -@@ -82,6 +82,7 @@
   55.11 - #define NETBSD_LINK_SPEC_ELF \
   55.12 -   "%{assert*} %{R*} %{rpath*} \
   55.13 -    %{shared:-shared} \
   55.14 -+   %{symbolic:-Bsymbolic} \
   55.15 -    %{!shared: \
   55.16 -      -dc -dp \
   55.17 -      %{!nostdlib: \
    56.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    56.2 +++ b/patches/gcc/4.3.0/200-netbsd-symbolic.patch	Mon Jul 28 21:08:01 2008 +0000
    56.3 @@ -0,0 +1,14 @@
    56.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/11_all_gcc-netbsd-symbolic.patch
    56.5 +http://bugs.gentoo.org/122698
    56.6 +
    56.7 +diff -durN gcc-4.3.0.orig/gcc/config/netbsd-elf.h gcc-4.3.0/gcc/config/netbsd-elf.h
    56.8 +--- gcc-4.3.0.orig/gcc/config/netbsd-elf.h	2007-09-03 18:14:04.000000000 +0200
    56.9 ++++ gcc-4.3.0/gcc/config/netbsd-elf.h	2008-06-10 14:44:21.000000000 +0200
   56.10 +@@ -82,6 +82,7 @@
   56.11 + #define NETBSD_LINK_SPEC_ELF \
   56.12 +   "%{assert*} %{R*} %{rpath*} \
   56.13 +    %{shared:-shared} \
   56.14 ++   %{symbolic:-Bsymbolic} \
   56.15 +    %{!shared: \
   56.16 +      -dc -dp \
   56.17 +      %{!nostdlib: \
    57.1 --- a/patches/gcc/4.3.0/225-gcc-sparc64-bsd.patch	Mon Jul 28 20:17:48 2008 +0000
    57.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    57.3 @@ -1,30 +0,0 @@
    57.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/14_all_gcc-sparc64-bsd.patch
    57.5 -diff -durN gcc-4.3.0.orig/gcc/config/sparc/freebsd.h gcc-4.3.0/gcc/config/sparc/freebsd.h
    57.6 ---- gcc-4.3.0.orig/gcc/config/sparc/freebsd.h	2007-08-02 12:49:31.000000000 +0200
    57.7 -+++ gcc-4.3.0/gcc/config/sparc/freebsd.h	2008-06-10 14:44:26.000000000 +0200
    57.8 -@@ -25,9 +25,22 @@
    57.9 - /* FreeBSD needs the platform name (sparc64) defined.
   57.10 -    Emacs needs to know if the arch is 64 or 32-bits.  */
   57.11 - 
   57.12 --#undef  CPP_CPU64_DEFAULT_SPEC
   57.13 --#define CPP_CPU64_DEFAULT_SPEC \
   57.14 --  "-D__sparc64__ -D__sparc_v9__ -D__sparcv9 -D__arch64__"
   57.15 -+#undef  FBSD_TARGET_CPU_CPP_BUILTINS
   57.16 -+#define FBSD_TARGET_CPU_CPP_BUILTINS()                  \
   57.17 -+  do                                                    \
   57.18 -+    {                                                   \
   57.19 -+      if (TARGET_ARCH64)                                \
   57.20 -+        {                                               \
   57.21 -+          builtin_define ("__sparc64__");               \
   57.22 -+          builtin_define ("__sparc_v9__");              \
   57.23 -+          builtin_define ("__sparcv9");                 \
   57.24 -+        }                                               \
   57.25 -+      else                                              \
   57.26 -+        builtin_define ("__sparc");                     \
   57.27 -+      builtin_define ("__sparc__");                     \
   57.28 -+    }                                                   \
   57.29 -+  while (0)
   57.30 -+
   57.31 - 
   57.32 - #define LINK_SPEC "%(link_arch)						\
   57.33 -   %{!mno-relax:%{!r:-relax}}						\
    58.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    58.2 +++ b/patches/gcc/4.3.0/225-sparc64-bsd.patch	Mon Jul 28 21:08:01 2008 +0000
    58.3 @@ -0,0 +1,30 @@
    58.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/14_all_gcc-sparc64-bsd.patch
    58.5 +diff -durN gcc-4.3.0.orig/gcc/config/sparc/freebsd.h gcc-4.3.0/gcc/config/sparc/freebsd.h
    58.6 +--- gcc-4.3.0.orig/gcc/config/sparc/freebsd.h	2007-08-02 12:49:31.000000000 +0200
    58.7 ++++ gcc-4.3.0/gcc/config/sparc/freebsd.h	2008-06-10 14:44:26.000000000 +0200
    58.8 +@@ -25,9 +25,22 @@
    58.9 + /* FreeBSD needs the platform name (sparc64) defined.
   58.10 +    Emacs needs to know if the arch is 64 or 32-bits.  */
   58.11 + 
   58.12 +-#undef  CPP_CPU64_DEFAULT_SPEC
   58.13 +-#define CPP_CPU64_DEFAULT_SPEC \
   58.14 +-  "-D__sparc64__ -D__sparc_v9__ -D__sparcv9 -D__arch64__"
   58.15 ++#undef  FBSD_TARGET_CPU_CPP_BUILTINS
   58.16 ++#define FBSD_TARGET_CPU_CPP_BUILTINS()                  \
   58.17 ++  do                                                    \
   58.18 ++    {                                                   \
   58.19 ++      if (TARGET_ARCH64)                                \
   58.20 ++        {                                               \
   58.21 ++          builtin_define ("__sparc64__");               \
   58.22 ++          builtin_define ("__sparc_v9__");              \
   58.23 ++          builtin_define ("__sparcv9");                 \
   58.24 ++        }                                               \
   58.25 ++      else                                              \
   58.26 ++        builtin_define ("__sparc");                     \
   58.27 ++      builtin_define ("__sparc__");                     \
   58.28 ++    }                                                   \
   58.29 ++  while (0)
   58.30 ++
   58.31 + 
   58.32 + #define LINK_SPEC "%(link_arch)						\
   58.33 +   %{!mno-relax:%{!r:-relax}}						\
    59.1 --- a/patches/gcc/4.3.0/250-904-flatten-switch-stmt-00.patch	Mon Jul 28 20:17:48 2008 +0000
    59.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    59.3 @@ -1,76 +0,0 @@
    59.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/18_all_904-flatten-switch-stmt-00.patch
    59.5 -http://gcc.gnu.org/ml/gcc-patches/2007-04/msg00927.html
    59.6 -
    59.7 -Hi,
    59.8 -
    59.9 -The attached patch makes sure that we create smaller object code for
   59.10 -simple switch statements. We just make sure to flatten the switch
   59.11 -statement into an if-else chain, basically.
   59.12 -
   59.13 -This fixes a size-regression as compared to gcc-3.4, as can be seen
   59.14 -below.
   59.15 -
   59.16 -2007-04-15  Bernhard Fischer  <..>
   59.17 -
   59.18 -	* stmt.c (expand_case): Do not create a complex binary tree when
   59.19 -	optimizing for size but rather use the simple ordered list.
   59.20 -	(emit_case_nodes): do not emit jumps to the default_label when
   59.21 -	optimizing for size.
   59.22 -
   59.23 -Not regtested so far.
   59.24 -Comments?
   59.25 -
   59.26 -Attached is the test switch.c mentioned below.
   59.27 -
   59.28 -$ 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
   59.29 -gcc-$i  -DCHAIN -Os -o switch-CHAIN-$i.o -c switch.c ;done
   59.30 -$ 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
   59.31 -gcc-$i  -UCHAIN -Os -o switch-$i.o -c switch.c ;done
   59.32 -
   59.33 -$ size switch-*.o
   59.34 -   text	   data	    bss	    dec	    hex	filename
   59.35 -    169	      0	      0	    169	     a9	switch-2.95.o
   59.36 -    115	      0	      0	    115	     73	switch-3.3.o
   59.37 -    103	      0	      0	    103	     67	switch-3.4.o
   59.38 -    124	      0	      0	    124	     7c	switch-4.0.o
   59.39 -    124	      0	      0	    124	     7c	switch-4.1.o
   59.40 -    124	      0	      0	    124	     7c	switch-4.2.orig-HEAD.o
   59.41 -     95	      0	      0	     95	     5f	switch-4.3-HEAD.o
   59.42 -    124	      0	      0	    124	     7c	switch-4.3.orig-HEAD.o
   59.43 -    166	      0	      0	    166	     a6	switch-CHAIN-2.95.o
   59.44 -    111	      0	      0	    111	     6f	switch-CHAIN-3.3.o
   59.45 -     95	      0	      0	     95	     5f	switch-CHAIN-3.4.o
   59.46 -     95	      0	      0	     95	     5f	switch-CHAIN-4.0.o
   59.47 -     95	      0	      0	     95	     5f	switch-CHAIN-4.1.o
   59.48 -     95	      0	      0	     95	     5f	switch-CHAIN-4.2.orig-HEAD.o
   59.49 -     95	      0	      0	     95	     5f	switch-CHAIN-4.3-HEAD.o
   59.50 -     95	      0	      0	     95	     5f	switch-CHAIN-4.3.orig-HEAD.o
   59.51 -
   59.52 -
   59.53 -Content-Type: text/x-diff; charset=us-ascii
   59.54 -Content-Disposition: attachment; filename="gcc-4.3.gcc-flatten-switch-stmt.00.diff"
   59.55 -
   59.56 -diff -durN gcc-4.3.0.orig/gcc/stmt.c gcc-4.3.0/gcc/stmt.c
   59.57 ---- gcc-4.3.0.orig/gcc/stmt.c	2007-12-04 22:55:32.000000000 +0100
   59.58 -+++ gcc-4.3.0/gcc/stmt.c	2008-06-10 14:44:33.000000000 +0200
   59.59 -@@ -2508,7 +2508,11 @@
   59.60 - 	  use_cost_table
   59.61 - 	    = (TREE_CODE (orig_type) != ENUMERAL_TYPE
   59.62 - 	       && estimate_case_costs (case_list));
   59.63 --	  balance_case_nodes (&case_list, NULL);
   59.64 -+	  /* When optimizing for size, we want a straight list to avoid
   59.65 -+	     jumps as much as possible. This basically creates an if-else
   59.66 -+	     chain.  */
   59.67 -+	  if (!optimize_size)
   59.68 -+	    balance_case_nodes (&case_list, NULL);
   59.69 - 	  emit_case_nodes (index, case_list, default_label, index_type);
   59.70 - 	  emit_jump (default_label);
   59.71 - 	}
   59.72 -@@ -3066,6 +3070,7 @@
   59.73 - 	    {
   59.74 - 	      if (!node_has_low_bound (node, index_type))
   59.75 - 		{
   59.76 -+		  if (!optimize_size) /* don't jl to the .default_label. */
   59.77 - 		  emit_cmp_and_jump_insns (index,
   59.78 - 					   convert_modes
   59.79 - 					   (mode, imode,
    60.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    60.2 +++ b/patches/gcc/4.3.0/250-flatten-switch-stmt-00.patch	Mon Jul 28 21:08:01 2008 +0000
    60.3 @@ -0,0 +1,76 @@
    60.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/18_all_904-flatten-switch-stmt-00.patch
    60.5 +http://gcc.gnu.org/ml/gcc-patches/2007-04/msg00927.html
    60.6 +
    60.7 +Hi,
    60.8 +
    60.9 +The attached patch makes sure that we create smaller object code for
   60.10 +simple switch statements. We just make sure to flatten the switch
   60.11 +statement into an if-else chain, basically.
   60.12 +
   60.13 +This fixes a size-regression as compared to gcc-3.4, as can be seen
   60.14 +below.
   60.15 +
   60.16 +2007-04-15  Bernhard Fischer  <..>
   60.17 +
   60.18 +	* stmt.c (expand_case): Do not create a complex binary tree when
   60.19 +	optimizing for size but rather use the simple ordered list.
   60.20 +	(emit_case_nodes): do not emit jumps to the default_label when
   60.21 +	optimizing for size.
   60.22 +
   60.23 +Not regtested so far.
   60.24 +Comments?
   60.25 +
   60.26 +Attached is the test switch.c mentioned below.
   60.27 +
   60.28 +$ 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
   60.29 +gcc-$i  -DCHAIN -Os -o switch-CHAIN-$i.o -c switch.c ;done
   60.30 +$ 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
   60.31 +gcc-$i  -UCHAIN -Os -o switch-$i.o -c switch.c ;done
   60.32 +
   60.33 +$ size switch-*.o
   60.34 +   text	   data	    bss	    dec	    hex	filename
   60.35 +    169	      0	      0	    169	     a9	switch-2.95.o
   60.36 +    115	      0	      0	    115	     73	switch-3.3.o
   60.37 +    103	      0	      0	    103	     67	switch-3.4.o
   60.38 +    124	      0	      0	    124	     7c	switch-4.0.o
   60.39 +    124	      0	      0	    124	     7c	switch-4.1.o
   60.40 +    124	      0	      0	    124	     7c	switch-4.2.orig-HEAD.o
   60.41 +     95	      0	      0	     95	     5f	switch-4.3-HEAD.o
   60.42 +    124	      0	      0	    124	     7c	switch-4.3.orig-HEAD.o
   60.43 +    166	      0	      0	    166	     a6	switch-CHAIN-2.95.o
   60.44 +    111	      0	      0	    111	     6f	switch-CHAIN-3.3.o
   60.45 +     95	      0	      0	     95	     5f	switch-CHAIN-3.4.o
   60.46 +     95	      0	      0	     95	     5f	switch-CHAIN-4.0.o
   60.47 +     95	      0	      0	     95	     5f	switch-CHAIN-4.1.o
   60.48 +     95	      0	      0	     95	     5f	switch-CHAIN-4.2.orig-HEAD.o
   60.49 +     95	      0	      0	     95	     5f	switch-CHAIN-4.3-HEAD.o
   60.50 +     95	      0	      0	     95	     5f	switch-CHAIN-4.3.orig-HEAD.o
   60.51 +
   60.52 +
   60.53 +Content-Type: text/x-diff; charset=us-ascii
   60.54 +Content-Disposition: attachment; filename="gcc-4.3.gcc-flatten-switch-stmt.00.diff"
   60.55 +
   60.56 +diff -durN gcc-4.3.0.orig/gcc/stmt.c gcc-4.3.0/gcc/stmt.c
   60.57 +--- gcc-4.3.0.orig/gcc/stmt.c	2007-12-04 22:55:32.000000000 +0100
   60.58 ++++ gcc-4.3.0/gcc/stmt.c	2008-06-10 14:44:33.000000000 +0200
   60.59 +@@ -2508,7 +2508,11 @@
   60.60 + 	  use_cost_table
   60.61 + 	    = (TREE_CODE (orig_type) != ENUMERAL_TYPE
   60.62 + 	       && estimate_case_costs (case_list));
   60.63 +-	  balance_case_nodes (&case_list, NULL);
   60.64 ++	  /* When optimizing for size, we want a straight list to avoid
   60.65 ++	     jumps as much as possible. This basically creates an if-else
   60.66 ++	     chain.  */
   60.67 ++	  if (!optimize_size)
   60.68 ++	    balance_case_nodes (&case_list, NULL);
   60.69 + 	  emit_case_nodes (index, case_list, default_label, index_type);
   60.70 + 	  emit_jump (default_label);
   60.71 + 	}
   60.72 +@@ -3066,6 +3070,7 @@
   60.73 + 	    {
   60.74 + 	      if (!node_has_low_bound (node, index_type))
   60.75 + 		{
   60.76 ++		  if (!optimize_size) /* don't jl to the .default_label. */
   60.77 + 		  emit_cmp_and_jump_insns (index,
   60.78 + 					   convert_modes
   60.79 + 					   (mode, imode,
    61.1 --- a/patches/gcc/4.3.0/275-gcc-x86-emit-cld.patch	Mon Jul 28 20:17:48 2008 +0000
    61.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    61.3 @@ -1,156 +0,0 @@
    61.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/20_all_gcc-x86-emit-cld.patch
    61.5 -bandaid for the cld issue.  to be dropped when gcc-4.3 goes stable.
    61.6 -
    61.7 -http://gcc.gnu.org/ml/gcc-patches/2008-03/msg00417.html
    61.8 -
    61.9 -2008-03-06  Uros Bizjak  <ubizjak@gmail.com>
   61.10 -
   61.11 -	* config/i386/i386.h (TARGET_CLD): New define.
   61.12 -	(struct machine_function): Add needs_cld field.
   61.13 -	(ix86_current_function_needs_cld): New define.
   61.14 -	* config/i386/i386.md (UNSPEC_CLD): New unspec volatile constant.
   61.15 -	("cld"): New isns pattern.
   61.16 -	("strmov_singleop"): Set ix86_current_function_needs_cld flag.
   61.17 -	("rep_mov"): Ditto.
   61.18 -	("strset_singleop"): Ditto.
   61.19 -	("rep_stos"): Ditto.
   61.20 -	("cmpstrnqi_nz_1"): Ditto.
   61.21 -	("cmpstrnqi_1"): Ditto.
   61.22 -	("strlenqi_1"): Ditto.
   61.23 -	* config/i386/i386.c (ix86_expand_prologue): Emit cld insn for
   61.24 -	TARGET_CLD when ix86_current_function_needs_cld is set.
   61.25 -
   61.26 -diff -durN gcc-4.3.0.orig/gcc/config/i386/i386.c gcc-4.3.0/gcc/config/i386/i386.c
   61.27 ---- gcc-4.3.0.orig/gcc/config/i386/i386.c	2008-02-21 13:30:00.000000000 +0100
   61.28 -+++ gcc-4.3.0/gcc/config/i386/i386.c	2008-06-10 14:44:37.000000000 +0200
   61.29 -@@ -6448,6 +6448,10 @@
   61.30 - 	emit_insn (gen_prologue_use (pic_offset_table_rtx));
   61.31 -       emit_insn (gen_blockage ());
   61.32 -     }
   61.33 -+
   61.34 -+  /* Emit cld instruction if stringops are used in the function.  */
   61.35 -+  if (TARGET_CLD && ix86_current_function_needs_cld)
   61.36 -+    emit_insn (gen_cld ());
   61.37 - }
   61.38 - 
   61.39 - /* Emit code to restore saved registers using MOV insns.  First register
   61.40 -diff -durN gcc-4.3.0.orig/gcc/config/i386/i386.h gcc-4.3.0/gcc/config/i386/i386.h
   61.41 ---- gcc-4.3.0.orig/gcc/config/i386/i386.h	2008-02-15 09:12:02.000000000 +0100
   61.42 -+++ gcc-4.3.0/gcc/config/i386/i386.h	2008-06-10 14:44:37.000000000 +0200
   61.43 -@@ -388,6 +388,7 @@
   61.44 - 
   61.45 - extern int x86_prefetch_sse;
   61.46 - 
   61.47 -+#define TARGET_CLD		1
   61.48 - #define TARGET_ABM		x86_abm
   61.49 - #define TARGET_CMPXCHG16B	x86_cmpxchg16b
   61.50 - #define TARGET_POPCNT		x86_popcnt
   61.51 -@@ -2443,8 +2444,9 @@
   61.52 -   int save_varrargs_registers;
   61.53 -   int accesses_prev_frame;
   61.54 -   int optimize_mode_switching[MAX_386_ENTITIES];
   61.55 --  /* Set by ix86_compute_frame_layout and used by prologue/epilogue expander to
   61.56 --     determine the style used.  */
   61.57 -+  int needs_cld;
   61.58 -+  /* Set by ix86_compute_frame_layout and used by prologue/epilogue
   61.59 -+     expander to determine the style used.  */
   61.60 -   int use_fast_prologue_epilogue;
   61.61 -   /* Number of saved registers USE_FAST_PROLOGUE_EPILOGUE has been computed
   61.62 -      for.  */
   61.63 -@@ -2464,6 +2466,7 @@
   61.64 - #define ix86_stack_locals (cfun->machine->stack_locals)
   61.65 - #define ix86_save_varrargs_registers (cfun->machine->save_varrargs_registers)
   61.66 - #define ix86_optimize_mode_switching (cfun->machine->optimize_mode_switching)
   61.67 -+#define ix86_current_function_needs_cld (cfun->machine->needs_cld)
   61.68 - #define ix86_tls_descriptor_calls_expanded_in_cfun \
   61.69 -   (cfun->machine->tls_descriptor_call_expanded_p)
   61.70 - /* Since tls_descriptor_call_expanded is not cleared, even if all TLS
   61.71 -diff -durN gcc-4.3.0.orig/gcc/config/i386/i386.md gcc-4.3.0/gcc/config/i386/i386.md
   61.72 ---- gcc-4.3.0.orig/gcc/config/i386/i386.md	2008-02-06 12:34:00.000000000 +0100
   61.73 -+++ gcc-4.3.0/gcc/config/i386/i386.md	2008-06-10 14:44:37.000000000 +0200
   61.74 -@@ -205,6 +205,7 @@
   61.75 -    (UNSPECV_XCHG		12)
   61.76 -    (UNSPECV_LOCK		13)
   61.77 -    (UNSPECV_PROLOGUE_USE	14)
   61.78 -+   (UNSPECV_CLD			15)
   61.79 -   ])
   61.80 - 
   61.81 - ;; Constants to represent pcomtrue/pcomfalse variants
   61.82 -@@ -18529,6 +18530,14 @@
   61.83 - 
   61.84 - ;; Block operation instructions
   61.85 - 
   61.86 -+(define_insn "cld"
   61.87 -+  [(unspec_volatile [(const_int 0)] UNSPECV_CLD)]
   61.88 -+  ""
   61.89 -+  "cld"
   61.90 -+  [(set_attr "length" "1")
   61.91 -+   (set_attr "length_immediate" "0")
   61.92 -+   (set_attr "modrm" "0")])
   61.93 -+
   61.94 - (define_expand "movmemsi"
   61.95 -   [(use (match_operand:BLK 0 "memory_operand" ""))
   61.96 -    (use (match_operand:BLK 1 "memory_operand" ""))
   61.97 -@@ -18601,7 +18610,7 @@
   61.98 - 	      (set (match_operand 2 "register_operand" "")
   61.99 - 		   (match_operand 5 "" ""))])]
  61.100 -   "TARGET_SINGLE_STRINGOP || optimize_size"
  61.101 --  "")
  61.102 -+  "ix86_current_function_needs_cld = 1;")
  61.103 - 
  61.104 - (define_insn "*strmovdi_rex_1"
  61.105 -   [(set (mem:DI (match_operand:DI 2 "register_operand" "0"))
  61.106 -@@ -18718,7 +18727,7 @@
  61.107 - 		   (match_operand 3 "memory_operand" ""))
  61.108 - 	      (use (match_dup 4))])]
  61.109 -   ""
  61.110 --  "")
  61.111 -+  "ix86_current_function_needs_cld = 1;")
  61.112 - 
  61.113 - (define_insn "*rep_movdi_rex64"
  61.114 -   [(set (match_operand:DI 2 "register_operand" "=c") (const_int 0))
  61.115 -@@ -18878,7 +18887,7 @@
  61.116 - 	      (set (match_operand 0 "register_operand" "")
  61.117 - 		   (match_operand 3 "" ""))])]
  61.118 -   "TARGET_SINGLE_STRINGOP || optimize_size"
  61.119 --  "")
  61.120 -+  "ix86_current_function_needs_cld = 1;")
  61.121 - 
  61.122 - (define_insn "*strsetdi_rex_1"
  61.123 -   [(set (mem:DI (match_operand:DI 1 "register_operand" "0"))
  61.124 -@@ -18972,7 +18981,7 @@
  61.125 - 	      (use (match_operand 3 "register_operand" ""))
  61.126 - 	      (use (match_dup 1))])]
  61.127 -   ""
  61.128 --  "")
  61.129 -+  "ix86_current_function_needs_cld = 1;")
  61.130 - 
  61.131 - (define_insn "*rep_stosdi_rex64"
  61.132 -   [(set (match_operand:DI 1 "register_operand" "=c") (const_int 0))
  61.133 -@@ -19148,7 +19157,7 @@
  61.134 - 	      (clobber (match_operand 1 "register_operand" ""))
  61.135 - 	      (clobber (match_dup 2))])]
  61.136 -   ""
  61.137 --  "")
  61.138 -+  "ix86_current_function_needs_cld = 1;")
  61.139 - 
  61.140 - (define_insn "*cmpstrnqi_nz_1"
  61.141 -   [(set (reg:CC FLAGS_REG)
  61.142 -@@ -19195,7 +19204,7 @@
  61.143 - 	      (clobber (match_operand 1 "register_operand" ""))
  61.144 - 	      (clobber (match_dup 2))])]
  61.145 -   ""
  61.146 --  "")
  61.147 -+  "ix86_current_function_needs_cld = 1;")
  61.148 - 
  61.149 - (define_insn "*cmpstrnqi_1"
  61.150 -   [(set (reg:CC FLAGS_REG)
  61.151 -@@ -19264,7 +19273,7 @@
  61.152 - 	      (clobber (match_operand 1 "register_operand" ""))
  61.153 - 	      (clobber (reg:CC FLAGS_REG))])]
  61.154 -   ""
  61.155 --  "")
  61.156 -+  "ix86_current_function_needs_cld = 1;")
  61.157 - 
  61.158 - (define_insn "*strlenqi_1"
  61.159 -   [(set (match_operand:SI 0 "register_operand" "=&c")
    62.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    62.2 +++ b/patches/gcc/4.3.0/275-x86-emit-cld.patch	Mon Jul 28 21:08:01 2008 +0000
    62.3 @@ -0,0 +1,156 @@
    62.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/20_all_gcc-x86-emit-cld.patch
    62.5 +bandaid for the cld issue.  to be dropped when gcc-4.3 goes stable.
    62.6 +
    62.7 +http://gcc.gnu.org/ml/gcc-patches/2008-03/msg00417.html
    62.8 +
    62.9 +2008-03-06  Uros Bizjak  <ubizjak@gmail.com>
   62.10 +
   62.11 +	* config/i386/i386.h (TARGET_CLD): New define.
   62.12 +	(struct machine_function): Add needs_cld field.
   62.13 +	(ix86_current_function_needs_cld): New define.
   62.14 +	* config/i386/i386.md (UNSPEC_CLD): New unspec volatile constant.
   62.15 +	("cld"): New isns pattern.
   62.16 +	("strmov_singleop"): Set ix86_current_function_needs_cld flag.
   62.17 +	("rep_mov"): Ditto.
   62.18 +	("strset_singleop"): Ditto.
   62.19 +	("rep_stos"): Ditto.
   62.20 +	("cmpstrnqi_nz_1"): Ditto.
   62.21 +	("cmpstrnqi_1"): Ditto.
   62.22 +	("strlenqi_1"): Ditto.
   62.23 +	* config/i386/i386.c (ix86_expand_prologue): Emit cld insn for
   62.24 +	TARGET_CLD when ix86_current_function_needs_cld is set.
   62.25 +
   62.26 +diff -durN gcc-4.3.0.orig/gcc/config/i386/i386.c gcc-4.3.0/gcc/config/i386/i386.c
   62.27 +--- gcc-4.3.0.orig/gcc/config/i386/i386.c	2008-02-21 13:30:00.000000000 +0100
   62.28 ++++ gcc-4.3.0/gcc/config/i386/i386.c	2008-06-10 14:44:37.000000000 +0200
   62.29 +@@ -6448,6 +6448,10 @@
   62.30 + 	emit_insn (gen_prologue_use (pic_offset_table_rtx));
   62.31 +       emit_insn (gen_blockage ());
   62.32 +     }
   62.33 ++
   62.34 ++  /* Emit cld instruction if stringops are used in the function.  */
   62.35 ++  if (TARGET_CLD && ix86_current_function_needs_cld)
   62.36 ++    emit_insn (gen_cld ());
   62.37 + }
   62.38 + 
   62.39 + /* Emit code to restore saved registers using MOV insns.  First register
   62.40 +diff -durN gcc-4.3.0.orig/gcc/config/i386/i386.h gcc-4.3.0/gcc/config/i386/i386.h
   62.41 +--- gcc-4.3.0.orig/gcc/config/i386/i386.h	2008-02-15 09:12:02.000000000 +0100
   62.42 ++++ gcc-4.3.0/gcc/config/i386/i386.h	2008-06-10 14:44:37.000000000 +0200
   62.43 +@@ -388,6 +388,7 @@
   62.44 + 
   62.45 + extern int x86_prefetch_sse;
   62.46 + 
   62.47 ++#define TARGET_CLD		1
   62.48 + #define TARGET_ABM		x86_abm
   62.49 + #define TARGET_CMPXCHG16B	x86_cmpxchg16b
   62.50 + #define TARGET_POPCNT		x86_popcnt
   62.51 +@@ -2443,8 +2444,9 @@
   62.52 +   int save_varrargs_registers;
   62.53 +   int accesses_prev_frame;
   62.54 +   int optimize_mode_switching[MAX_386_ENTITIES];
   62.55 +-  /* Set by ix86_compute_frame_layout and used by prologue/epilogue expander to
   62.56 +-     determine the style used.  */
   62.57 ++  int needs_cld;
   62.58 ++  /* Set by ix86_compute_frame_layout and used by prologue/epilogue
   62.59 ++     expander to determine the style used.  */
   62.60 +   int use_fast_prologue_epilogue;
   62.61 +   /* Number of saved registers USE_FAST_PROLOGUE_EPILOGUE has been computed
   62.62 +      for.  */
   62.63 +@@ -2464,6 +2466,7 @@
   62.64 + #define ix86_stack_locals (cfun->machine->stack_locals)
   62.65 + #define ix86_save_varrargs_registers (cfun->machine->save_varrargs_registers)
   62.66 + #define ix86_optimize_mode_switching (cfun->machine->optimize_mode_switching)
   62.67 ++#define ix86_current_function_needs_cld (cfun->machine->needs_cld)
   62.68 + #define ix86_tls_descriptor_calls_expanded_in_cfun \
   62.69 +   (cfun->machine->tls_descriptor_call_expanded_p)
   62.70 + /* Since tls_descriptor_call_expanded is not cleared, even if all TLS
   62.71 +diff -durN gcc-4.3.0.orig/gcc/config/i386/i386.md gcc-4.3.0/gcc/config/i386/i386.md
   62.72 +--- gcc-4.3.0.orig/gcc/config/i386/i386.md	2008-02-06 12:34:00.000000000 +0100
   62.73 ++++ gcc-4.3.0/gcc/config/i386/i386.md	2008-06-10 14:44:37.000000000 +0200
   62.74 +@@ -205,6 +205,7 @@
   62.75 +    (UNSPECV_XCHG		12)
   62.76 +    (UNSPECV_LOCK		13)
   62.77 +    (UNSPECV_PROLOGUE_USE	14)
   62.78 ++   (UNSPECV_CLD			15)
   62.79 +   ])
   62.80 + 
   62.81 + ;; Constants to represent pcomtrue/pcomfalse variants
   62.82 +@@ -18529,6 +18530,14 @@
   62.83 + 
   62.84 + ;; Block operation instructions
   62.85 + 
   62.86 ++(define_insn "cld"
   62.87 ++  [(unspec_volatile [(const_int 0)] UNSPECV_CLD)]
   62.88 ++  ""
   62.89 ++  "cld"
   62.90 ++  [(set_attr "length" "1")
   62.91 ++   (set_attr "length_immediate" "0")
   62.92 ++   (set_attr "modrm" "0")])
   62.93 ++
   62.94 + (define_expand "movmemsi"
   62.95 +   [(use (match_operand:BLK 0 "memory_operand" ""))
   62.96 +    (use (match_operand:BLK 1 "memory_operand" ""))
   62.97 +@@ -18601,7 +18610,7 @@
   62.98 + 	      (set (match_operand 2 "register_operand" "")
   62.99 + 		   (match_operand 5 "" ""))])]
  62.100 +   "TARGET_SINGLE_STRINGOP || optimize_size"
  62.101 +-  "")
  62.102 ++  "ix86_current_function_needs_cld = 1;")
  62.103 + 
  62.104 + (define_insn "*strmovdi_rex_1"
  62.105 +   [(set (mem:DI (match_operand:DI 2 "register_operand" "0"))
  62.106 +@@ -18718,7 +18727,7 @@
  62.107 + 		   (match_operand 3 "memory_operand" ""))
  62.108 + 	      (use (match_dup 4))])]
  62.109 +   ""
  62.110 +-  "")
  62.111 ++  "ix86_current_function_needs_cld = 1;")
  62.112 + 
  62.113 + (define_insn "*rep_movdi_rex64"
  62.114 +   [(set (match_operand:DI 2 "register_operand" "=c") (const_int 0))
  62.115 +@@ -18878,7 +18887,7 @@
  62.116 + 	      (set (match_operand 0 "register_operand" "")
  62.117 + 		   (match_operand 3 "" ""))])]
  62.118 +   "TARGET_SINGLE_STRINGOP || optimize_size"
  62.119 +-  "")
  62.120 ++  "ix86_current_function_needs_cld = 1;")
  62.121 + 
  62.122 + (define_insn "*strsetdi_rex_1"
  62.123 +   [(set (mem:DI (match_operand:DI 1 "register_operand" "0"))
  62.124 +@@ -18972,7 +18981,7 @@
  62.125 + 	      (use (match_operand 3 "register_operand" ""))
  62.126 + 	      (use (match_dup 1))])]
  62.127 +   ""
  62.128 +-  "")
  62.129 ++  "ix86_current_function_needs_cld = 1;")
  62.130 + 
  62.131 + (define_insn "*rep_stosdi_rex64"
  62.132 +   [(set (match_operand:DI 1 "register_operand" "=c") (const_int 0))
  62.133 +@@ -19148,7 +19157,7 @@
  62.134 + 	      (clobber (match_operand 1 "register_operand" ""))
  62.135 + 	      (clobber (match_dup 2))])]
  62.136 +   ""
  62.137 +-  "")
  62.138 ++  "ix86_current_function_needs_cld = 1;")
  62.139 + 
  62.140 + (define_insn "*cmpstrnqi_nz_1"
  62.141 +   [(set (reg:CC FLAGS_REG)
  62.142 +@@ -19195,7 +19204,7 @@
  62.143 + 	      (clobber (match_operand 1 "register_operand" ""))
  62.144 + 	      (clobber (match_dup 2))])]
  62.145 +   ""
  62.146 +-  "")
  62.147 ++  "ix86_current_function_needs_cld = 1;")
  62.148 + 
  62.149 + (define_insn "*cmpstrnqi_1"
  62.150 +   [(set (reg:CC FLAGS_REG)
  62.151 +@@ -19264,7 +19273,7 @@
  62.152 + 	      (clobber (match_operand 1 "register_operand" ""))
  62.153 + 	      (clobber (reg:CC FLAGS_REG))])]
  62.154 +   ""
  62.155 +-  "")
  62.156 ++  "ix86_current_function_needs_cld = 1;")
  62.157 + 
  62.158 + (define_insn "*strlenqi_1"
  62.159 +   [(set (match_operand:SI 0 "register_operand" "=&c")
    63.1 --- a/patches/gcc/4.3.0/300-gcc-3.4-libiberty-pic.patch	Mon Jul 28 20:17:48 2008 +0000
    63.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    63.3 @@ -1,12 +0,0 @@
    63.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/51_all_gcc-3.4-libiberty-pic.patch
    63.5 -diff -durN gcc-4.3.0.orig/libiberty/Makefile.in gcc-4.3.0/libiberty/Makefile.in
    63.6 ---- gcc-4.3.0.orig/libiberty/Makefile.in	2007-07-25 08:26:45.000000000 +0200
    63.7 -+++ gcc-4.3.0/libiberty/Makefile.in	2008-06-10 14:44:43.000000000 +0200
    63.8 -@@ -225,6 +225,7 @@
    63.9 - 	  $(AR) $(AR_FLAGS) $(TARGETLIB) \
   63.10 - 	    $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \
   63.11 - 	  $(RANLIB) $(TARGETLIB); \
   63.12 -+	  cp $(TARGETLIB) ../ ; \
   63.13 - 	  cd ..; \
   63.14 - 	else true; fi
   63.15 - 
    64.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    64.2 +++ b/patches/gcc/4.3.0/300-libiberty-pic.patch	Mon Jul 28 21:08:01 2008 +0000
    64.3 @@ -0,0 +1,12 @@
    64.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/51_all_gcc-3.4-libiberty-pic.patch
    64.5 +diff -durN gcc-4.3.0.orig/libiberty/Makefile.in gcc-4.3.0/libiberty/Makefile.in
    64.6 +--- gcc-4.3.0.orig/libiberty/Makefile.in	2007-07-25 08:26:45.000000000 +0200
    64.7 ++++ gcc-4.3.0/libiberty/Makefile.in	2008-06-10 14:44:43.000000000 +0200
    64.8 +@@ -225,6 +225,7 @@
    64.9 + 	  $(AR) $(AR_FLAGS) $(TARGETLIB) \
   64.10 + 	    $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \
   64.11 + 	  $(RANLIB) $(TARGETLIB); \
   64.12 ++	  cp $(TARGETLIB) ../ ; \
   64.13 + 	  cd ..; \
   64.14 + 	else true; fi
   64.15 + 
    65.1 --- a/patches/gcc/4.3.0/325-gcc4-superh-default-multilib.patch	Mon Jul 28 20:17:48 2008 +0000
    65.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    65.3 @@ -1,25 +0,0 @@
    65.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/53_all_gcc4-superh-default-multilib.patch
    65.5 -The gcc-3.x toolchains would contain all the targets by default.  With gcc-4,
    65.6 -you have to actually list out the multilibs you want or you will end up with
    65.7 -just one when using targets like 'sh4-linux-gnu'.
    65.8 -
    65.9 -The resulting toolchain can't even build a kernel as the kernel needs to build
   65.10 -with the nofpu flag to be sure that no fpu ops are generated.
   65.11 -
   65.12 -Here we restore the gcc-3.x behavior; the additional overhead of building all
   65.13 -of these multilibs by default is negligible.
   65.14 -
   65.15 -http://bugs.gentoo.org/140205
   65.16 -
   65.17 -diff -durN gcc-4.3.0.orig/gcc/config.gcc gcc-4.3.0/gcc/config.gcc
   65.18 ---- gcc-4.3.0.orig/gcc/config.gcc	2008-01-29 17:28:10.000000000 +0100
   65.19 -+++ gcc-4.3.0/gcc/config.gcc	2008-06-10 14:44:47.000000000 +0200
   65.20 -@@ -2271,7 +2271,7 @@
   65.21 - 	if test x${sh_multilibs} = x ; then
   65.22 - 		case ${target} in
   65.23 - 		sh64-superh-linux* | \
   65.24 --		sh[1234]*)	sh_multilibs=${sh_cpu_target} ;;
   65.25 -+		sh[1234]*)	sh_multilibs=`cd ${srcdir}/config/sh ; echo t-mlib-sh[1-4]* | sed 's:t-mlib-sh:,m:g;s: ::g'` ;;
   65.26 - 		sh64* | sh5*)	sh_multilibs=m5-32media,m5-32media-nofpu,m5-compact,m5-compact-nofpu,m5-64media,m5-64media-nofpu ;;
   65.27 - 		sh-superh-*)	sh_multilibs=m4,m4-single,m4-single-only,m4-nofpu ;;
   65.28 - 		sh*-*-linux*)	sh_multilibs=m1,m3e,m4 ;;
    66.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    66.2 +++ b/patches/gcc/4.3.0/325-superh-default-multilib.patch	Mon Jul 28 21:08:01 2008 +0000
    66.3 @@ -0,0 +1,25 @@
    66.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/53_all_gcc4-superh-default-multilib.patch
    66.5 +The gcc-3.x toolchains would contain all the targets by default.  With gcc-4,
    66.6 +you have to actually list out the multilibs you want or you will end up with
    66.7 +just one when using targets like 'sh4-linux-gnu'.
    66.8 +
    66.9 +The resulting toolchain can't even build a kernel as the kernel needs to build
   66.10 +with the nofpu flag to be sure that no fpu ops are generated.
   66.11 +
   66.12 +Here we restore the gcc-3.x behavior; the additional overhead of building all
   66.13 +of these multilibs by default is negligible.
   66.14 +
   66.15 +http://bugs.gentoo.org/140205
   66.16 +
   66.17 +diff -durN gcc-4.3.0.orig/gcc/config.gcc gcc-4.3.0/gcc/config.gcc
   66.18 +--- gcc-4.3.0.orig/gcc/config.gcc	2008-01-29 17:28:10.000000000 +0100
   66.19 ++++ gcc-4.3.0/gcc/config.gcc	2008-06-10 14:44:47.000000000 +0200
   66.20 +@@ -2271,7 +2271,7 @@
   66.21 + 	if test x${sh_multilibs} = x ; then
   66.22 + 		case ${target} in
   66.23 + 		sh64-superh-linux* | \
   66.24 +-		sh[1234]*)	sh_multilibs=${sh_cpu_target} ;;
   66.25 ++		sh[1234]*)	sh_multilibs=`cd ${srcdir}/config/sh ; echo t-mlib-sh[1-4]* | sed 's:t-mlib-sh:,m:g;s: ::g'` ;;
   66.26 + 		sh64* | sh5*)	sh_multilibs=m5-32media,m5-32media-nofpu,m5-compact,m5-compact-nofpu,m5-64media,m5-64media-nofpu ;;
   66.27 + 		sh-superh-*)	sh_multilibs=m4,m4-single,m4-single-only,m4-nofpu ;;
   66.28 + 		sh*-*-linux*)	sh_multilibs=m1,m3e,m4 ;;
    67.1 --- a/patches/gcc/4.3.0/350-300-libstdc++-pic.patch	Mon Jul 28 20:17:48 2008 +0000
    67.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    67.3 @@ -1,56 +0,0 @@
    67.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/54_all_300-libstdc++-pic.patch
    67.5 -install libstdc++_pic.a if we have pic objs
    67.6 -
    67.7 -diff -durN gcc-4.3.0.orig/libstdc++-v3/src/Makefile.am gcc-4.3.0/libstdc++-v3/src/Makefile.am
    67.8 ---- gcc-4.3.0.orig/libstdc++-v3/src/Makefile.am	2008-02-29 19:26:50.000000000 +0100
    67.9 -+++ gcc-4.3.0/libstdc++-v3/src/Makefile.am	2008-06-10 14:44:51.000000000 +0200
   67.10 -@@ -289,6 +289,13 @@
   67.11 - 	  $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
   67.12 - 
   67.13 - 
   67.14 -+install-exec-local:
   67.15 -+	pic_objs=`sed -n "s:'::g;s:^pic_object=::p" *.lo | grep -v '^none$$'`; \
   67.16 -+	if [ x"$$pic_objs" != x ]; then \
   67.17 -+		$(AR) cru libstdc++_pic.a $$pic_objs $(top_builddir)/libsupc++/*.o || exit 1; \
   67.18 -+		$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir) || exit 1; \
   67.19 -+	fi
   67.20 -+
   67.21 - # Added bits to build debug library.
   67.22 - if GLIBCXX_BUILD_DEBUG
   67.23 - all-local: build_debug
   67.24 -diff -durN gcc-4.3.0.orig/libstdc++-v3/src/Makefile.in gcc-4.3.0/libstdc++-v3/src/Makefile.in
   67.25 ---- gcc-4.3.0.orig/libstdc++-v3/src/Makefile.in	2008-02-29 19:26:50.000000000 +0100
   67.26 -+++ gcc-4.3.0/libstdc++-v3/src/Makefile.in	2008-06-10 14:44:51.000000000 +0200
   67.27 -@@ -693,7 +693,7 @@
   67.28 - 
   67.29 - install-data-am: install-data-local
   67.30 - 
   67.31 --install-exec-am: install-toolexeclibLTLIBRARIES
   67.32 -+install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local
   67.33 - 
   67.34 - install-info: install-info-am
   67.35 - 
   67.36 -@@ -732,7 +732,7 @@
   67.37 - 	maintainer-clean-generic mostlyclean mostlyclean-compile \
   67.38 - 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
   67.39 - 	tags uninstall uninstall-am uninstall-info-am \
   67.40 --	uninstall-toolexeclibLTLIBRARIES
   67.41 -+	uninstall-toolexeclibLTLIBRARIES install-exec-local
   67.42 - 
   67.43 - 
   67.44 - # Symbol versioning for shared libraries.
   67.45 -@@ -858,6 +858,14 @@
   67.46 - install_debug:
   67.47 - 	(cd ${debugdir} && $(MAKE) \
   67.48 - 	toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install)
   67.49 -+
   67.50 -+install-exec-local:
   67.51 -+	pic_objs=`sed -n "s:'::g;s:^pic_object=::p" *.lo | grep -v '^none$$'`; \
   67.52 -+	if [ x"$$pic_objs" != x ]; then \
   67.53 -+		$(AR) cru libstdc++_pic.a $$pic_objs $(top_builddir)/libsupc++/*.o || exit 1; \
   67.54 -+		$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir) || exit 1; \
   67.55 -+	fi
   67.56 -+
   67.57 - # Tell versions [3.59,3.63) of GNU make to not export all variables.
   67.58 - # Otherwise a system limit (for SysV at least) may be exceeded.
   67.59 - .NOEXPORT:
    68.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    68.2 +++ b/patches/gcc/4.3.0/350-libstdc++-pic.patch	Mon Jul 28 21:08:01 2008 +0000
    68.3 @@ -0,0 +1,56 @@
    68.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/54_all_300-libstdc++-pic.patch
    68.5 +install libstdc++_pic.a if we have pic objs
    68.6 +
    68.7 +diff -durN gcc-4.3.0.orig/libstdc++-v3/src/Makefile.am gcc-4.3.0/libstdc++-v3/src/Makefile.am
    68.8 +--- gcc-4.3.0.orig/libstdc++-v3/src/Makefile.am	2008-02-29 19:26:50.000000000 +0100
    68.9 ++++ gcc-4.3.0/libstdc++-v3/src/Makefile.am	2008-06-10 14:44:51.000000000 +0200
   68.10 +@@ -289,6 +289,13 @@
   68.11 + 	  $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
   68.12 + 
   68.13 + 
   68.14 ++install-exec-local:
   68.15 ++	pic_objs=`sed -n "s:'::g;s:^pic_object=::p" *.lo | grep -v '^none$$'`; \
   68.16 ++	if [ x"$$pic_objs" != x ]; then \
   68.17 ++		$(AR) cru libstdc++_pic.a $$pic_objs $(top_builddir)/libsupc++/*.o || exit 1; \
   68.18 ++		$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir) || exit 1; \
   68.19 ++	fi
   68.20 ++
   68.21 + # Added bits to build debug library.
   68.22 + if GLIBCXX_BUILD_DEBUG
   68.23 + all-local: build_debug
   68.24 +diff -durN gcc-4.3.0.orig/libstdc++-v3/src/Makefile.in gcc-4.3.0/libstdc++-v3/src/Makefile.in
   68.25 +--- gcc-4.3.0.orig/libstdc++-v3/src/Makefile.in	2008-02-29 19:26:50.000000000 +0100
   68.26 ++++ gcc-4.3.0/libstdc++-v3/src/Makefile.in	2008-06-10 14:44:51.000000000 +0200
   68.27 +@@ -693,7 +693,7 @@
   68.28 + 
   68.29 + install-data-am: install-data-local
   68.30 + 
   68.31 +-install-exec-am: install-toolexeclibLTLIBRARIES
   68.32 ++install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local
   68.33 + 
   68.34 + install-info: install-info-am
   68.35 + 
   68.36 +@@ -732,7 +732,7 @@
   68.37 + 	maintainer-clean-generic mostlyclean mostlyclean-compile \
   68.38 + 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
   68.39 + 	tags uninstall uninstall-am uninstall-info-am \
   68.40 +-	uninstall-toolexeclibLTLIBRARIES
   68.41 ++	uninstall-toolexeclibLTLIBRARIES install-exec-local
   68.42 + 
   68.43 + 
   68.44 + # Symbol versioning for shared libraries.
   68.45 +@@ -858,6 +858,14 @@
   68.46 + install_debug:
   68.47 + 	(cd ${debugdir} && $(MAKE) \
   68.48 + 	toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install)
   68.49 ++
   68.50 ++install-exec-local:
   68.51 ++	pic_objs=`sed -n "s:'::g;s:^pic_object=::p" *.lo | grep -v '^none$$'`; \
   68.52 ++	if [ x"$$pic_objs" != x ]; then \
   68.53 ++		$(AR) cru libstdc++_pic.a $$pic_objs $(top_builddir)/libsupc++/*.o || exit 1; \
   68.54 ++		$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir) || exit 1; \
   68.55 ++	fi
   68.56 ++
   68.57 + # Tell versions [3.59,3.63) of GNU make to not export all variables.
   68.58 + # Otherwise a system limit (for SysV at least) may be exceeded.
   68.59 + .NOEXPORT:
    69.1 --- a/patches/gcc/4.3.0/375-gcc43-pr35440.patch	Mon Jul 28 20:17:48 2008 +0000
    69.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    69.3 @@ -1,59 +0,0 @@
    69.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/60_all_gcc43-pr35440.patch
    69.5 -2008-03-19  Jakub Jelinek  <jakub@redhat.com>
    69.6 -
    69.7 -	PR c/35440
    69.8 -	* c-pretty-print.c (pp_c_initializer_list): Handle CONSTRUCTOR
    69.9 -	for all types.
   69.10 -
   69.11 -	* gcc.dg/pr35440.c: New test.
   69.12 -
   69.13 -diff -durN gcc-4.3.0.orig/gcc/c-pretty-print.c gcc-4.3.0/gcc/c-pretty-print.c
   69.14 ---- gcc-4.3.0.orig/gcc/c-pretty-print.c	2008-01-29 14:59:59.000000000 +0100
   69.15 -+++ gcc-4.3.0/gcc/c-pretty-print.c	2008-06-10 14:44:54.000000000 +0200
   69.16 -@@ -1173,6 +1173,12 @@
   69.17 -   tree type = TREE_TYPE (e);
   69.18 -   const enum tree_code code = TREE_CODE (type);
   69.19 - 
   69.20 -+  if (TREE_CODE (e) == CONSTRUCTOR)
   69.21 -+    {
   69.22 -+      pp_c_constructor_elts (pp, CONSTRUCTOR_ELTS (e));
   69.23 -+      return;
   69.24 -+    }
   69.25 -+
   69.26 -   switch (code)
   69.27 -     {
   69.28 -     case RECORD_TYPE:
   69.29 -@@ -1207,16 +1213,12 @@
   69.30 -     case VECTOR_TYPE:
   69.31 -       if (TREE_CODE (e) == VECTOR_CST)
   69.32 - 	pp_c_expression_list (pp, TREE_VECTOR_CST_ELTS (e));
   69.33 --      else if (TREE_CODE (e) == CONSTRUCTOR)
   69.34 --	pp_c_constructor_elts (pp, CONSTRUCTOR_ELTS (e));
   69.35 -       else
   69.36 - 	break;
   69.37 -       return;
   69.38 - 
   69.39 -     case COMPLEX_TYPE:
   69.40 --      if (TREE_CODE (e) == CONSTRUCTOR)
   69.41 --	pp_c_constructor_elts (pp, CONSTRUCTOR_ELTS (e));
   69.42 --      else if (TREE_CODE (e) == COMPLEX_CST || TREE_CODE (e) == COMPLEX_EXPR)
   69.43 -+      if (TREE_CODE (e) == COMPLEX_CST || TREE_CODE (e) == COMPLEX_EXPR)
   69.44 - 	{
   69.45 - 	  const bool cst = TREE_CODE (e) == COMPLEX_CST;
   69.46 - 	  pp_expression (pp, cst ? TREE_REALPART (e) : TREE_OPERAND (e, 0));
   69.47 -diff -durN gcc-4.3.0.orig/gcc/testsuite/gcc.dg/pr35440.c gcc-4.3.0/gcc/testsuite/gcc.dg/pr35440.c
   69.48 ---- gcc-4.3.0.orig/gcc/testsuite/gcc.dg/pr35440.c	1970-01-01 01:00:00.000000000 +0100
   69.49 -+++ gcc-4.3.0/gcc/testsuite/gcc.dg/pr35440.c	2008-06-10 14:44:54.000000000 +0200
   69.50 -@@ -0,0 +1,12 @@
   69.51 -+/* PR c/35440 */
   69.52 -+/* { dg-do compile } */
   69.53 -+/* { dg-options "-std=gnu99" } */
   69.54 -+
   69.55 -+struct A {};
   69.56 -+struct B { int i; char j[2]; };
   69.57 -+
   69.58 -+void foo (void)
   69.59 -+{
   69.60 -+  (struct A){}();			/* { dg-error "called object" } */
   69.61 -+  (struct B){ .i = 2, .j[1] = 1 }();	/* { dg-error "called object" } */
   69.62 -+}
    70.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    70.2 +++ b/patches/gcc/4.3.0/375-pr35440.patch	Mon Jul 28 21:08:01 2008 +0000
    70.3 @@ -0,0 +1,59 @@
    70.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/60_all_gcc43-pr35440.patch
    70.5 +2008-03-19  Jakub Jelinek  <jakub@redhat.com>
    70.6 +
    70.7 +	PR c/35440
    70.8 +	* c-pretty-print.c (pp_c_initializer_list): Handle CONSTRUCTOR
    70.9 +	for all types.
   70.10 +
   70.11 +	* gcc.dg/pr35440.c: New test.
   70.12 +
   70.13 +diff -durN gcc-4.3.0.orig/gcc/c-pretty-print.c gcc-4.3.0/gcc/c-pretty-print.c
   70.14 +--- gcc-4.3.0.orig/gcc/c-pretty-print.c	2008-01-29 14:59:59.000000000 +0100
   70.15 ++++ gcc-4.3.0/gcc/c-pretty-print.c	2008-06-10 14:44:54.000000000 +0200
   70.16 +@@ -1173,6 +1173,12 @@
   70.17 +   tree type = TREE_TYPE (e);
   70.18 +   const enum tree_code code = TREE_CODE (type);
   70.19 + 
   70.20 ++  if (TREE_CODE (e) == CONSTRUCTOR)
   70.21 ++    {
   70.22 ++      pp_c_constructor_elts (pp, CONSTRUCTOR_ELTS (e));
   70.23 ++      return;
   70.24 ++    }
   70.25 ++
   70.26 +   switch (code)
   70.27 +     {
   70.28 +     case RECORD_TYPE:
   70.29 +@@ -1207,16 +1213,12 @@
   70.30 +     case VECTOR_TYPE:
   70.31 +       if (TREE_CODE (e) == VECTOR_CST)
   70.32 + 	pp_c_expression_list (pp, TREE_VECTOR_CST_ELTS (e));
   70.33 +-      else if (TREE_CODE (e) == CONSTRUCTOR)
   70.34 +-	pp_c_constructor_elts (pp, CONSTRUCTOR_ELTS (e));
   70.35 +       else
   70.36 + 	break;
   70.37 +       return;
   70.38 + 
   70.39 +     case COMPLEX_TYPE:
   70.40 +-      if (TREE_CODE (e) == CONSTRUCTOR)
   70.41 +-	pp_c_constructor_elts (pp, CONSTRUCTOR_ELTS (e));
   70.42 +-      else if (TREE_CODE (e) == COMPLEX_CST || TREE_CODE (e) == COMPLEX_EXPR)
   70.43 ++      if (TREE_CODE (e) == COMPLEX_CST || TREE_CODE (e) == COMPLEX_EXPR)
   70.44 + 	{
   70.45 + 	  const bool cst = TREE_CODE (e) == COMPLEX_CST;
   70.46 + 	  pp_expression (pp, cst ? TREE_REALPART (e) : TREE_OPERAND (e, 0));
   70.47 +diff -durN gcc-4.3.0.orig/gcc/testsuite/gcc.dg/pr35440.c gcc-4.3.0/gcc/testsuite/gcc.dg/pr35440.c
   70.48 +--- gcc-4.3.0.orig/gcc/testsuite/gcc.dg/pr35440.c	1970-01-01 01:00:00.000000000 +0100
   70.49 ++++ gcc-4.3.0/gcc/testsuite/gcc.dg/pr35440.c	2008-06-10 14:44:54.000000000 +0200
   70.50 +@@ -0,0 +1,12 @@
   70.51 ++/* PR c/35440 */
   70.52 ++/* { dg-do compile } */
   70.53 ++/* { dg-options "-std=gnu99" } */
   70.54 ++
   70.55 ++struct A {};
   70.56 ++struct B { int i; char j[2]; };
   70.57 ++
   70.58 ++void foo (void)
   70.59 ++{
   70.60 ++  (struct A){}();			/* { dg-error "called object" } */
   70.61 ++  (struct B){ .i = 2, .j[1] = 1 }();	/* { dg-error "called object" } */
   70.62 ++}
    71.1 --- a/patches/gcc/4.3.0/400-gcc43-pr24170.patch	Mon Jul 28 20:17:48 2008 +0000
    71.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    71.3 @@ -1,61 +0,0 @@
    71.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/61_all_gcc43-pr24170.patch
    71.5 -http://gcc.gnu.org/PR24170
    71.6 -
    71.7 -2008-02-20  Tom Tromey  <tromey@redhat.com>
    71.8 -
    71.9 -	PR libgcj/24170:
   71.10 -	* java/io/natFilePosix.cc (File::performList): Don't use
   71.11 -	readdir_r.
   71.12 -	* configure, include/config.h.in: Rebuilt.
   71.13 -	* configure.ac: Don't check for readdir_r.
   71.14 -
   71.15 -diff -durN gcc-4.3.0.orig/libjava/configure.ac gcc-4.3.0/libjava/configure.ac
   71.16 ---- gcc-4.3.0.orig/libjava/configure.ac	2008-06-10 14:44:17.000000000 +0200
   71.17 -+++ gcc-4.3.0/libjava/configure.ac	2008-06-10 14:44:58.000000000 +0200
   71.18 -@@ -1030,7 +1030,7 @@
   71.19 -    PLATFORMNET=NoNet
   71.20 - else
   71.21 -    AC_CHECK_FUNCS([strerror_r select fstat open fsync sleep opendir \
   71.22 --                   localtime_r readdir_r getpwuid_r getcwd \
   71.23 -+                   localtime_r getpwuid_r getcwd \
   71.24 - 		   access stat lstat mkdir rename rmdir unlink utime chmod readlink \
   71.25 - 		   nl_langinfo setlocale \
   71.26 - 		   inet_pton uname inet_ntoa \
   71.27 -diff -durN gcc-4.3.0.orig/libjava/include/config.h.in gcc-4.3.0/libjava/include/config.h.in
   71.28 ---- gcc-4.3.0.orig/libjava/include/config.h.in	2007-07-31 18:17:21.000000000 +0200
   71.29 -+++ gcc-4.3.0/libjava/include/config.h.in	2008-06-10 14:44:58.000000000 +0200
   71.30 -@@ -214,9 +214,6 @@
   71.31 - /* Define to 1 if you have the <pwd.h> header file. */
   71.32 - #undef HAVE_PWD_H
   71.33 - 
   71.34 --/* Define to 1 if you have the `readdir_r' function. */
   71.35 --#undef HAVE_READDIR_R
   71.36 --
   71.37 - /* Define to 1 if you have the `readlink' function. */
   71.38 - #undef HAVE_READLINK
   71.39 - 
   71.40 -diff -durN gcc-4.3.0.orig/libjava/java/io/natFilePosix.cc gcc-4.3.0/libjava/java/io/natFilePosix.cc
   71.41 ---- gcc-4.3.0.orig/libjava/java/io/natFilePosix.cc	2007-08-04 23:50:01.000000000 +0200
   71.42 -+++ gcc-4.3.0/libjava/java/io/natFilePosix.cc	2008-06-10 14:44:58.000000000 +0200
   71.43 -@@ -1,6 +1,6 @@
   71.44 - // natFile.cc - Native part of File class for POSIX.
   71.45 - 
   71.46 --/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2006
   71.47 -+/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2006, 2008
   71.48 -    Free Software Foundation
   71.49 - 
   71.50 -    This file is part of libgcj.
   71.51 -@@ -292,13 +292,7 @@
   71.52 - 
   71.53 -   java::util::ArrayList *list = new java::util::ArrayList ();
   71.54 -   struct dirent *d;
   71.55 --#if defined(HAVE_READDIR_R) && defined(_POSIX_PTHREAD_SEMANTICS)
   71.56 --  int name_max = pathconf (buf, _PC_NAME_MAX);
   71.57 --  char dbuf[sizeof (struct dirent) + name_max + 1];
   71.58 --  while (readdir_r (dir, (struct dirent *) dbuf, &d) == 0 && d != NULL)
   71.59 --#else /* HAVE_READDIR_R */
   71.60 -   while ((d = readdir (dir)) != NULL)
   71.61 --#endif /* HAVE_READDIR_R */
   71.62 -     {
   71.63 -       // Omit "." and "..".
   71.64 -       if (d->d_name[0] == '.'
    72.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    72.2 +++ b/patches/gcc/4.3.0/400-pr24170.patch	Mon Jul 28 21:08:01 2008 +0000
    72.3 @@ -0,0 +1,61 @@
    72.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/61_all_gcc43-pr24170.patch
    72.5 +http://gcc.gnu.org/PR24170
    72.6 +
    72.7 +2008-02-20  Tom Tromey  <tromey@redhat.com>
    72.8 +
    72.9 +	PR libgcj/24170:
   72.10 +	* java/io/natFilePosix.cc (File::performList): Don't use
   72.11 +	readdir_r.
   72.12 +	* configure, include/config.h.in: Rebuilt.
   72.13 +	* configure.ac: Don't check for readdir_r.
   72.14 +
   72.15 +diff -durN gcc-4.3.0.orig/libjava/configure.ac gcc-4.3.0/libjava/configure.ac
   72.16 +--- gcc-4.3.0.orig/libjava/configure.ac	2008-06-10 14:44:17.000000000 +0200
   72.17 ++++ gcc-4.3.0/libjava/configure.ac	2008-06-10 14:44:58.000000000 +0200
   72.18 +@@ -1030,7 +1030,7 @@
   72.19 +    PLATFORMNET=NoNet
   72.20 + else
   72.21 +    AC_CHECK_FUNCS([strerror_r select fstat open fsync sleep opendir \
   72.22 +-                   localtime_r readdir_r getpwuid_r getcwd \
   72.23 ++                   localtime_r getpwuid_r getcwd \
   72.24 + 		   access stat lstat mkdir rename rmdir unlink utime chmod readlink \
   72.25 + 		   nl_langinfo setlocale \
   72.26 + 		   inet_pton uname inet_ntoa \
   72.27 +diff -durN gcc-4.3.0.orig/libjava/include/config.h.in gcc-4.3.0/libjava/include/config.h.in
   72.28 +--- gcc-4.3.0.orig/libjava/include/config.h.in	2007-07-31 18:17:21.000000000 +0200
   72.29 ++++ gcc-4.3.0/libjava/include/config.h.in	2008-06-10 14:44:58.000000000 +0200
   72.30 +@@ -214,9 +214,6 @@
   72.31 + /* Define to 1 if you have the <pwd.h> header file. */
   72.32 + #undef HAVE_PWD_H
   72.33 + 
   72.34 +-/* Define to 1 if you have the `readdir_r' function. */
   72.35 +-#undef HAVE_READDIR_R
   72.36 +-
   72.37 + /* Define to 1 if you have the `readlink' function. */
   72.38 + #undef HAVE_READLINK
   72.39 + 
   72.40 +diff -durN gcc-4.3.0.orig/libjava/java/io/natFilePosix.cc gcc-4.3.0/libjava/java/io/natFilePosix.cc
   72.41 +--- gcc-4.3.0.orig/libjava/java/io/natFilePosix.cc	2007-08-04 23:50:01.000000000 +0200
   72.42 ++++ gcc-4.3.0/libjava/java/io/natFilePosix.cc	2008-06-10 14:44:58.000000000 +0200
   72.43 +@@ -1,6 +1,6 @@
   72.44 + // natFile.cc - Native part of File class for POSIX.
   72.45 + 
   72.46 +-/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2006
   72.47 ++/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2006, 2008
   72.48 +    Free Software Foundation
   72.49 + 
   72.50 +    This file is part of libgcj.
   72.51 +@@ -292,13 +292,7 @@
   72.52 + 
   72.53 +   java::util::ArrayList *list = new java::util::ArrayList ();
   72.54 +   struct dirent *d;
   72.55 +-#if defined(HAVE_READDIR_R) && defined(_POSIX_PTHREAD_SEMANTICS)
   72.56 +-  int name_max = pathconf (buf, _PC_NAME_MAX);
   72.57 +-  char dbuf[sizeof (struct dirent) + name_max + 1];
   72.58 +-  while (readdir_r (dir, (struct dirent *) dbuf, &d) == 0 && d != NULL)
   72.59 +-#else /* HAVE_READDIR_R */
   72.60 +   while ((d = readdir (dir)) != NULL)
   72.61 +-#endif /* HAVE_READDIR_R */
   72.62 +     {
   72.63 +       // Omit "." and "..".
   72.64 +       if (d->d_name[0] == '.'
    73.1 --- a/patches/gcc/4.3.0/425-gcc4-ia64-noteGNUstack.patch	Mon Jul 28 20:17:48 2008 +0000
    73.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    73.3 @@ -1,96 +0,0 @@
    73.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/61_all_gcc4-ia64-noteGNUstack.patch
    73.5 -2004-09-20  Jakub Jelinek  <jakub@redhat.com>
    73.6 -
    73.7 -	* config/rs6000/ppc-asm.h: Add .note.GNU-stack section also
    73.8 -	on ppc64-linux.
    73.9 -
   73.10 -	* config/ia64/lib1funcs.asm: Add .note.GNU-stack section on
   73.11 -	ia64-linux.
   73.12 -	* config/ia64/crtbegin.asm: Likewise.
   73.13 -	* config/ia64/crtend.asm: Likewise.
   73.14 -	* config/ia64/crti.asm: Likewise.
   73.15 -	* config/ia64/crtn.asm: Likewise.
   73.16 -
   73.17 -2004-05-14  Jakub Jelinek  <jakub@redhat.com>
   73.18 -
   73.19 -	* config/ia64/linux.h (TARGET_ASM_FILE_END): Define.
   73.20 -
   73.21 -diff -durN gcc-4.3.0.orig/gcc/config/ia64/crtbegin.asm gcc-4.3.0/gcc/config/ia64/crtbegin.asm
   73.22 ---- gcc-4.3.0.orig/gcc/config/ia64/crtbegin.asm	2005-09-27 02:52:24.000000000 +0200
   73.23 -+++ gcc-4.3.0/gcc/config/ia64/crtbegin.asm	2008-06-10 14:45:02.000000000 +0200
   73.24 -@@ -255,3 +255,7 @@
   73.25 - .weak __cxa_finalize
   73.26 - #endif
   73.27 - .weak _Jv_RegisterClasses
   73.28 -+
   73.29 -+#ifdef __linux__
   73.30 -+.section .note.GNU-stack; .previous
   73.31 -+#endif
   73.32 -diff -durN gcc-4.3.0.orig/gcc/config/ia64/crtend.asm gcc-4.3.0/gcc/config/ia64/crtend.asm
   73.33 ---- gcc-4.3.0.orig/gcc/config/ia64/crtend.asm	2005-09-27 02:52:24.000000000 +0200
   73.34 -+++ gcc-4.3.0/gcc/config/ia64/crtend.asm	2008-06-10 14:45:02.000000000 +0200
   73.35 -@@ -122,3 +122,7 @@
   73.36 - 
   73.37 - 	br.ret.sptk.many rp
   73.38 - 	.endp __do_global_ctors_aux
   73.39 -+
   73.40 -+#ifdef __linux__
   73.41 -+.section .note.GNU-stack; .previous
   73.42 -+#endif
   73.43 -diff -durN gcc-4.3.0.orig/gcc/config/ia64/crti.asm gcc-4.3.0/gcc/config/ia64/crti.asm
   73.44 ---- gcc-4.3.0.orig/gcc/config/ia64/crti.asm	2005-06-25 03:22:41.000000000 +0200
   73.45 -+++ gcc-4.3.0/gcc/config/ia64/crti.asm	2008-06-10 14:45:02.000000000 +0200
   73.46 -@@ -64,3 +64,7 @@
   73.47 - 	.body
   73.48 - 
   73.49 - # end of crti.asm
   73.50 -+
   73.51 -+#ifdef __linux__
   73.52 -+.section .note.GNU-stack; .previous
   73.53 -+#endif
   73.54 -diff -durN gcc-4.3.0.orig/gcc/config/ia64/crtn.asm gcc-4.3.0/gcc/config/ia64/crtn.asm
   73.55 ---- gcc-4.3.0.orig/gcc/config/ia64/crtn.asm	2005-06-25 03:22:41.000000000 +0200
   73.56 -+++ gcc-4.3.0/gcc/config/ia64/crtn.asm	2008-06-10 14:45:02.000000000 +0200
   73.57 -@@ -54,3 +54,7 @@
   73.58 - 	br.ret.sptk.many b0
   73.59 - 
   73.60 - # end of crtn.asm
   73.61 -+
   73.62 -+#ifdef __linux__
   73.63 -+.section .note.GNU-stack; .previous
   73.64 -+#endif
   73.65 -diff -durN gcc-4.3.0.orig/gcc/config/ia64/lib1funcs.asm gcc-4.3.0/gcc/config/ia64/lib1funcs.asm
   73.66 ---- gcc-4.3.0.orig/gcc/config/ia64/lib1funcs.asm	2005-09-27 02:52:24.000000000 +0200
   73.67 -+++ gcc-4.3.0/gcc/config/ia64/lib1funcs.asm	2008-06-10 14:45:02.000000000 +0200
   73.68 -@@ -792,3 +792,7 @@
   73.69 - 	}
   73.70 - 	.endp __floattitf
   73.71 - #endif
   73.72 -+
   73.73 -+#ifdef __linux__
   73.74 -+.section .note.GNU-stack; .previous
   73.75 -+#endif
   73.76 -diff -durN gcc-4.3.0.orig/gcc/config/ia64/linux.h gcc-4.3.0/gcc/config/ia64/linux.h
   73.77 ---- gcc-4.3.0.orig/gcc/config/ia64/linux.h	2006-12-12 16:15:19.000000000 +0100
   73.78 -+++ gcc-4.3.0/gcc/config/ia64/linux.h	2008-06-10 14:45:02.000000000 +0200
   73.79 -@@ -5,6 +5,8 @@
   73.80 - 
   73.81 - #define TARGET_VERSION fprintf (stderr, " (IA-64) Linux");
   73.82 - 
   73.83 -+#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
   73.84 -+
   73.85 - /* This is for -profile to use -lc_p instead of -lc.  */
   73.86 - #undef CC1_SPEC
   73.87 - #define CC1_SPEC "%{profile:-p} %{G*}"
   73.88 -diff -durN gcc-4.3.0.orig/gcc/config/rs6000/ppc-asm.h gcc-4.3.0/gcc/config/rs6000/ppc-asm.h
   73.89 ---- gcc-4.3.0.orig/gcc/config/rs6000/ppc-asm.h	2003-06-04 18:44:51.000000000 +0200
   73.90 -+++ gcc-4.3.0/gcc/config/rs6000/ppc-asm.h	2008-06-10 14:45:02.000000000 +0200
   73.91 -@@ -158,7 +158,7 @@
   73.92 - 	.size FUNC_NAME(name),GLUE(.L,name)-FUNC_NAME(name)
   73.93 - #endif
   73.94 - 
   73.95 --#if defined __linux__ && !defined __powerpc64__
   73.96 -+#if defined __linux__
   73.97 - 	.section .note.GNU-stack
   73.98 - 	.previous
   73.99 - #endif
    74.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    74.2 +++ b/patches/gcc/4.3.0/425-noteGNUstack-00.patch	Mon Jul 28 21:08:01 2008 +0000
    74.3 @@ -0,0 +1,96 @@
    74.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/61_all_gcc4-ia64-noteGNUstack.patch
    74.5 +2004-09-20  Jakub Jelinek  <jakub@redhat.com>
    74.6 +
    74.7 +	* config/rs6000/ppc-asm.h: Add .note.GNU-stack section also
    74.8 +	on ppc64-linux.
    74.9 +
   74.10 +	* config/ia64/lib1funcs.asm: Add .note.GNU-stack section on
   74.11 +	ia64-linux.
   74.12 +	* config/ia64/crtbegin.asm: Likewise.
   74.13 +	* config/ia64/crtend.asm: Likewise.
   74.14 +	* config/ia64/crti.asm: Likewise.
   74.15 +	* config/ia64/crtn.asm: Likewise.
   74.16 +
   74.17 +2004-05-14  Jakub Jelinek  <jakub@redhat.com>
   74.18 +
   74.19 +	* config/ia64/linux.h (TARGET_ASM_FILE_END): Define.
   74.20 +
   74.21 +diff -durN gcc-4.3.0.orig/gcc/config/ia64/crtbegin.asm gcc-4.3.0/gcc/config/ia64/crtbegin.asm
   74.22 +--- gcc-4.3.0.orig/gcc/config/ia64/crtbegin.asm	2005-09-27 02:52:24.000000000 +0200
   74.23 ++++ gcc-4.3.0/gcc/config/ia64/crtbegin.asm	2008-06-10 14:45:02.000000000 +0200
   74.24 +@@ -255,3 +255,7 @@
   74.25 + .weak __cxa_finalize
   74.26 + #endif
   74.27 + .weak _Jv_RegisterClasses
   74.28 ++
   74.29 ++#ifdef __linux__
   74.30 ++.section .note.GNU-stack; .previous
   74.31 ++#endif
   74.32 +diff -durN gcc-4.3.0.orig/gcc/config/ia64/crtend.asm gcc-4.3.0/gcc/config/ia64/crtend.asm
   74.33 +--- gcc-4.3.0.orig/gcc/config/ia64/crtend.asm	2005-09-27 02:52:24.000000000 +0200
   74.34 ++++ gcc-4.3.0/gcc/config/ia64/crtend.asm	2008-06-10 14:45:02.000000000 +0200
   74.35 +@@ -122,3 +122,7 @@
   74.36 + 
   74.37 + 	br.ret.sptk.many rp
   74.38 + 	.endp __do_global_ctors_aux
   74.39 ++
   74.40 ++#ifdef __linux__
   74.41 ++.section .note.GNU-stack; .previous
   74.42 ++#endif
   74.43 +diff -durN gcc-4.3.0.orig/gcc/config/ia64/crti.asm gcc-4.3.0/gcc/config/ia64/crti.asm
   74.44 +--- gcc-4.3.0.orig/gcc/config/ia64/crti.asm	2005-06-25 03:22:41.000000000 +0200
   74.45 ++++ gcc-4.3.0/gcc/config/ia64/crti.asm	2008-06-10 14:45:02.000000000 +0200
   74.46 +@@ -64,3 +64,7 @@
   74.47 + 	.body
   74.48 + 
   74.49 + # end of crti.asm
   74.50 ++
   74.51 ++#ifdef __linux__
   74.52 ++.section .note.GNU-stack; .previous
   74.53 ++#endif
   74.54 +diff -durN gcc-4.3.0.orig/gcc/config/ia64/crtn.asm gcc-4.3.0/gcc/config/ia64/crtn.asm
   74.55 +--- gcc-4.3.0.orig/gcc/config/ia64/crtn.asm	2005-06-25 03:22:41.000000000 +0200
   74.56 ++++ gcc-4.3.0/gcc/config/ia64/crtn.asm	2008-06-10 14:45:02.000000000 +0200
   74.57 +@@ -54,3 +54,7 @@
   74.58 + 	br.ret.sptk.many b0
   74.59 + 
   74.60 + # end of crtn.asm
   74.61 ++
   74.62 ++#ifdef __linux__
   74.63 ++.section .note.GNU-stack; .previous
   74.64 ++#endif
   74.65 +diff -durN gcc-4.3.0.orig/gcc/config/ia64/lib1funcs.asm gcc-4.3.0/gcc/config/ia64/lib1funcs.asm
   74.66 +--- gcc-4.3.0.orig/gcc/config/ia64/lib1funcs.asm	2005-09-27 02:52:24.000000000 +0200
   74.67 ++++ gcc-4.3.0/gcc/config/ia64/lib1funcs.asm	2008-06-10 14:45:02.000000000 +0200
   74.68 +@@ -792,3 +792,7 @@
   74.69 + 	}
   74.70 + 	.endp __floattitf
   74.71 + #endif
   74.72 ++
   74.73 ++#ifdef __linux__
   74.74 ++.section .note.GNU-stack; .previous
   74.75 ++#endif
   74.76 +diff -durN gcc-4.3.0.orig/gcc/config/ia64/linux.h gcc-4.3.0/gcc/config/ia64/linux.h
   74.77 +--- gcc-4.3.0.orig/gcc/config/ia64/linux.h	2006-12-12 16:15:19.000000000 +0100
   74.78 ++++ gcc-4.3.0/gcc/config/ia64/linux.h	2008-06-10 14:45:02.000000000 +0200
   74.79 +@@ -5,6 +5,8 @@
   74.80 + 
   74.81 + #define TARGET_VERSION fprintf (stderr, " (IA-64) Linux");
   74.82 + 
   74.83 ++#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
   74.84 ++
   74.85 + /* This is for -profile to use -lc_p instead of -lc.  */
   74.86 + #undef CC1_SPEC
   74.87 + #define CC1_SPEC "%{profile:-p} %{G*}"
   74.88 +diff -durN gcc-4.3.0.orig/gcc/config/rs6000/ppc-asm.h gcc-4.3.0/gcc/config/rs6000/ppc-asm.h
   74.89 +--- gcc-4.3.0.orig/gcc/config/rs6000/ppc-asm.h	2003-06-04 18:44:51.000000000 +0200
   74.90 ++++ gcc-4.3.0/gcc/config/rs6000/ppc-asm.h	2008-06-10 14:45:02.000000000 +0200
   74.91 +@@ -158,7 +158,7 @@
   74.92 + 	.size FUNC_NAME(name),GLUE(.L,name)-FUNC_NAME(name)
   74.93 + #endif
   74.94 + 
   74.95 +-#if defined __linux__ && !defined __powerpc64__
   74.96 ++#if defined __linux__
   74.97 + 	.section .note.GNU-stack
   74.98 + 	.previous
   74.99 + #endif
    75.1 --- a/patches/gcc/4.3.0/450-gcc4-noteGNUstack.patch	Mon Jul 28 20:17:48 2008 +0000
    75.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    75.3 @@ -1,198 +0,0 @@
    75.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/62_all_gcc4-noteGNUstack.patch
    75.5 -2005-02-08  Jakub Jelinek  <jakub@redhat.com>
    75.6 -
    75.7 -	* src/alpha/osf.S: Add .note.GNU-stack on Linux.
    75.8 -	* src/s390/sysv.S: Likewise.
    75.9 -	* src/powerpc/linux64.S: Likewise.
   75.10 -	* src/powerpc/linux64_closure.S: Likewise.
   75.11 -	* src/powerpc/ppc_closure.S: Likewise.
   75.12 -	* src/powerpc/sysv.S: Likewise.
   75.13 -	* src/x86/unix64.S: Likewise.
   75.14 -	* src/x86/sysv.S: Likewise.
   75.15 -	* src/sparc/v8.S: Likewise.
   75.16 -	* src/sparc/v9.S: Likewise.
   75.17 -	* src/m68k/sysv.S: Likewise.
   75.18 -	* src/ia64/unix.S: Likewise.
   75.19 -	* src/arm/sysv.S: Likewise.
   75.20 -
   75.21 -	* ia64_save_regs_in_stack.s: Moved to...
   75.22 -	* ia64_save_regs_in_stack.S: ... this.  Add .note.GNU-stack
   75.23 -	on Linux.
   75.24 -
   75.25 -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
   75.26 ---- gcc-4.3.0.orig/boehm-gc/ia64_save_regs_in_stack.S	1970-01-01 01:00:00.000000000 +0100
   75.27 -+++ gcc-4.3.0/boehm-gc/ia64_save_regs_in_stack.S	2008-06-10 14:45:05.000000000 +0200
   75.28 -@@ -0,0 +1,15 @@
   75.29 -+        .text
   75.30 -+        .align 16
   75.31 -+        .global GC_save_regs_in_stack
   75.32 -+        .proc GC_save_regs_in_stack
   75.33 -+GC_save_regs_in_stack:
   75.34 -+        .bodyfoo.mpg
   75.35 -+        flushrs
   75.36 -+        ;;
   75.37 -+        mov r8=ar.bsp
   75.38 -+        br.ret.sptk.few rp
   75.39 -+        .endp GC_save_regs_in_stack
   75.40 -+
   75.41 -+#ifdef __linux__
   75.42 -+	.section .note.GNU-stack,"",@progbits
   75.43 -+#endif
   75.44 -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
   75.45 ---- gcc-4.3.0.orig/boehm-gc/ia64_save_regs_in_stack.s	2001-10-15 06:57:59.000000000 +0200
   75.46 -+++ gcc-4.3.0/boehm-gc/ia64_save_regs_in_stack.s	2008-06-10 14:45:05.000000000 +0200
   75.47 -@@ -1,12 +0,0 @@
   75.48 --        .text
   75.49 --        .align 16
   75.50 --        .global GC_save_regs_in_stack
   75.51 --        .proc GC_save_regs_in_stack
   75.52 --GC_save_regs_in_stack:
   75.53 --        .body
   75.54 --        flushrs
   75.55 --        ;;
   75.56 --        mov r8=ar.bsp
   75.57 --        br.ret.sptk.few rp
   75.58 --        .endp GC_save_regs_in_stack
   75.59 --
   75.60 -diff -durN gcc-4.3.0.orig/libffi/src/alpha/osf.S gcc-4.3.0/libffi/src/alpha/osf.S
   75.61 ---- gcc-4.3.0.orig/libffi/src/alpha/osf.S	2007-04-06 18:24:16.000000000 +0200
   75.62 -+++ gcc-4.3.0/libffi/src/alpha/osf.S	2008-06-10 14:45:05.000000000 +0200
   75.63 -@@ -358,4 +358,8 @@
   75.64 - 	.byte	16		# uleb128 offset 16*-8
   75.65 - 	.align 3
   75.66 - $LEFDE3:
   75.67 -+
   75.68 -+#ifdef __linux__
   75.69 -+	.section	.note.GNU-stack,"",@progbits
   75.70 -+#endif
   75.71 - #endif
   75.72 -diff -durN gcc-4.3.0.orig/libffi/src/arm/sysv.S gcc-4.3.0/libffi/src/arm/sysv.S
   75.73 ---- gcc-4.3.0.orig/libffi/src/arm/sysv.S	2007-09-04 19:52:45.000000000 +0200
   75.74 -+++ gcc-4.3.0/libffi/src/arm/sysv.S	2008-06-10 14:45:05.000000000 +0200
   75.75 -@@ -293,3 +293,6 @@
   75.76 - 	UNWIND .fnend
   75.77 -         .size    CNAME(ffi_closure_SYSV),.ffi_closure_SYSV_end-CNAME(ffi_closure_SYSV)
   75.78 - 
   75.79 -+#if defined __ELF__ && defined __linux__
   75.80 -+	.section	.note.GNU-stack,"",%progbits
   75.81 -+#endif
   75.82 -diff -durN gcc-4.3.0.orig/libffi/src/ia64/unix.S gcc-4.3.0/libffi/src/ia64/unix.S
   75.83 ---- gcc-4.3.0.orig/libffi/src/ia64/unix.S	2005-03-30 23:49:19.000000000 +0200
   75.84 -+++ gcc-4.3.0/libffi/src/ia64/unix.S	2008-06-10 14:45:05.000000000 +0200
   75.85 -@@ -553,3 +553,7 @@
   75.86 - 	data8	@pcrel(.Lld_hfa_float)		// FFI_IA64_TYPE_HFA_FLOAT
   75.87 - 	data8	@pcrel(.Lld_hfa_double)		// FFI_IA64_TYPE_HFA_DOUBLE
   75.88 - 	data8	@pcrel(.Lld_hfa_ldouble)	// FFI_IA64_TYPE_HFA_LDOUBLE
   75.89 -+
   75.90 -+#if defined __ELF__ && defined __linux__
   75.91 -+	.section	.note.GNU-stack,"",@progbits
   75.92 -+#endif
   75.93 -diff -durN gcc-4.3.0.orig/libffi/src/m68k/sysv.S gcc-4.3.0/libffi/src/m68k/sysv.S
   75.94 ---- gcc-4.3.0.orig/libffi/src/m68k/sysv.S	2007-05-10 23:29:04.000000000 +0200
   75.95 -+++ gcc-4.3.0/libffi/src/m68k/sysv.S	2008-06-10 14:45:05.000000000 +0200
   75.96 -@@ -207,3 +207,7 @@
   75.97 - 	rts
   75.98 - 	CFI_ENDPROC()
   75.99 - 	.size	ffi_closure_struct_SYSV,.-ffi_closure_struct_SYSV
  75.100 -+
  75.101 -+#if defined __ELF__ && defined __linux__
  75.102 -+	.section	.note.GNU-stack,"",@progbits
  75.103 -+#endif
  75.104 -diff -durN gcc-4.3.0.orig/libffi/src/powerpc/linux64.S gcc-4.3.0/libffi/src/powerpc/linux64.S
  75.105 ---- gcc-4.3.0.orig/libffi/src/powerpc/linux64.S	2007-11-17 00:24:53.000000000 +0100
  75.106 -+++ gcc-4.3.0/libffi/src/powerpc/linux64.S	2008-06-10 14:45:05.000000000 +0200
  75.107 -@@ -179,3 +179,7 @@
  75.108 - 	.align 3
  75.109 - .LEFDE1:
  75.110 - #endif
  75.111 -+
  75.112 -+#if defined __ELF__ && defined __linux__
  75.113 -+	.section	.note.GNU-stack,"",@progbits
  75.114 -+#endif
  75.115 -diff -durN gcc-4.3.0.orig/libffi/src/powerpc/linux64_closure.S gcc-4.3.0/libffi/src/powerpc/linux64_closure.S
  75.116 ---- gcc-4.3.0.orig/libffi/src/powerpc/linux64_closure.S	2005-08-11 23:18:24.000000000 +0200
  75.117 -+++ gcc-4.3.0/libffi/src/powerpc/linux64_closure.S	2008-06-10 14:45:05.000000000 +0200
  75.118 -@@ -204,3 +204,7 @@
  75.119 - 	.align 3
  75.120 - .LEFDE1:
  75.121 - #endif
  75.122 -+
  75.123 -+#if defined __ELF__ && defined __linux__
  75.124 -+	.section	.note.GNU-stack,"",@progbits
  75.125 -+#endif
  75.126 -diff -durN gcc-4.3.0.orig/libffi/src/powerpc/ppc_closure.S gcc-4.3.0/libffi/src/powerpc/ppc_closure.S
  75.127 ---- gcc-4.3.0.orig/libffi/src/powerpc/ppc_closure.S	2007-12-01 22:00:04.000000000 +0100
  75.128 -+++ gcc-4.3.0/libffi/src/powerpc/ppc_closure.S	2008-06-10 14:45:05.000000000 +0200
  75.129 -@@ -295,3 +295,7 @@
  75.130 - .LEFDE1:
  75.131 - 
  75.132 - #endif
  75.133 -+
  75.134 -+#if defined __ELF__ && defined __linux__
  75.135 -+	.section	.note.GNU-stack,"",@progbits
  75.136 -+#endif
  75.137 -diff -durN gcc-4.3.0.orig/libffi/src/powerpc/sysv.S gcc-4.3.0/libffi/src/powerpc/sysv.S
  75.138 ---- gcc-4.3.0.orig/libffi/src/powerpc/sysv.S	2007-12-01 22:00:04.000000000 +0100
  75.139 -+++ gcc-4.3.0/libffi/src/powerpc/sysv.S	2008-06-10 14:45:05.000000000 +0200
  75.140 -@@ -223,3 +223,7 @@
  75.141 -       .align 2
  75.142 - .LEFDE1:
  75.143 - #endif
  75.144 -+
  75.145 -+#if defined __ELF__ && defined __linux__
  75.146 -+	.section	.note.GNU-stack,"",@progbits
  75.147 -+#endif
  75.148 -diff -durN gcc-4.3.0.orig/libffi/src/s390/sysv.S gcc-4.3.0/libffi/src/s390/sysv.S
  75.149 ---- gcc-4.3.0.orig/libffi/src/s390/sysv.S	2003-10-21 21:01:58.000000000 +0200
  75.150 -+++ gcc-4.3.0/libffi/src/s390/sysv.S	2008-06-10 14:45:05.000000000 +0200
  75.151 -@@ -427,3 +427,6 @@
  75.152 - 
  75.153 - #endif
  75.154 - 
  75.155 -+#if defined __ELF__ && defined __linux__
  75.156 -+	.section	.note.GNU-stack,"",@progbits
  75.157 -+#endif
  75.158 -diff -durN gcc-4.3.0.orig/libffi/src/sparc/v8.S gcc-4.3.0/libffi/src/sparc/v8.S
  75.159 ---- gcc-4.3.0.orig/libffi/src/sparc/v8.S	2004-11-22 19:35:16.000000000 +0100
  75.160 -+++ gcc-4.3.0/libffi/src/sparc/v8.S	2008-06-10 14:45:05.000000000 +0200
  75.161 -@@ -265,3 +265,7 @@
  75.162 - 	.byte	0x1f	! uleb128 0x1f
  75.163 - 	.align	WS
  75.164 - .LLEFDE2:
  75.165 -+
  75.166 -+#if defined __ELF__ && defined __linux__
  75.167 -+	.section	.note.GNU-stack,"",@progbits
  75.168 -+#endif
  75.169 -diff -durN gcc-4.3.0.orig/libffi/src/sparc/v9.S gcc-4.3.0/libffi/src/sparc/v9.S
  75.170 ---- gcc-4.3.0.orig/libffi/src/sparc/v9.S	2004-01-25 07:58:33.000000000 +0100
  75.171 -+++ gcc-4.3.0/libffi/src/sparc/v9.S	2008-06-10 14:45:05.000000000 +0200
  75.172 -@@ -300,3 +300,7 @@
  75.173 - 	.align 8
  75.174 - .LLEFDE2:
  75.175 - #endif
  75.176 -+
  75.177 -+#ifdef __linux__
  75.178 -+	.section	.note.GNU-stack,"",@progbits
  75.179 -+#endif
  75.180 -diff -durN gcc-4.3.0.orig/libffi/src/x86/sysv.S gcc-4.3.0/libffi/src/x86/sysv.S
  75.181 ---- gcc-4.3.0.orig/libffi/src/x86/sysv.S	2008-01-30 15:36:58.000000000 +0100
  75.182 -+++ gcc-4.3.0/libffi/src/x86/sysv.S	2008-06-10 14:45:05.000000000 +0200
  75.183 -@@ -430,3 +430,7 @@
  75.184 - #endif
  75.185 - 
  75.186 - #endif /* ifndef __x86_64__ */
  75.187 -+
  75.188 -+#if defined __ELF__ && defined __linux__
  75.189 -+	.section	.note.GNU-stack,"",@progbits
  75.190 -+#endif
  75.191 -diff -durN gcc-4.3.0.orig/libffi/src/x86/unix64.S gcc-4.3.0/libffi/src/x86/unix64.S
  75.192 ---- gcc-4.3.0.orig/libffi/src/x86/unix64.S	2005-05-05 06:06:38.000000000 +0200
  75.193 -+++ gcc-4.3.0/libffi/src/x86/unix64.S	2008-06-10 14:45:05.000000000 +0200
  75.194 -@@ -410,3 +410,7 @@
  75.195 - .LEFDE3:
  75.196 - 
  75.197 - #endif /* __x86_64__ */
  75.198 -+
  75.199 -+#if defined __ELF__ && defined __linux__
  75.200 -+	.section	.note.GNU-stack,"",@progbits
  75.201 -+#endif
    76.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    76.2 +++ b/patches/gcc/4.3.0/450-noteGNUstack-01.patch	Mon Jul 28 21:08:01 2008 +0000
    76.3 @@ -0,0 +1,198 @@
    76.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/62_all_gcc4-noteGNUstack.patch
    76.5 +2005-02-08  Jakub Jelinek  <jakub@redhat.com>
    76.6 +
    76.7 +	* src/alpha/osf.S: Add .note.GNU-stack on Linux.
    76.8 +	* src/s390/sysv.S: Likewise.
    76.9 +	* src/powerpc/linux64.S: Likewise.
   76.10 +	* src/powerpc/linux64_closure.S: Likewise.
   76.11 +	* src/powerpc/ppc_closure.S: Likewise.
   76.12 +	* src/powerpc/sysv.S: Likewise.
   76.13 +	* src/x86/unix64.S: Likewise.
   76.14 +	* src/x86/sysv.S: Likewise.
   76.15 +	* src/sparc/v8.S: Likewise.
   76.16 +	* src/sparc/v9.S: Likewise.
   76.17 +	* src/m68k/sysv.S: Likewise.
   76.18 +	* src/ia64/unix.S: Likewise.
   76.19 +	* src/arm/sysv.S: Likewise.
   76.20 +
   76.21 +	* ia64_save_regs_in_stack.s: Moved to...
   76.22 +	* ia64_save_regs_in_stack.S: ... this.  Add .note.GNU-stack
   76.23 +	on Linux.
   76.24 +
   76.25 +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
   76.26 +--- gcc-4.3.0.orig/boehm-gc/ia64_save_regs_in_stack.S	1970-01-01 01:00:00.000000000 +0100
   76.27 ++++ gcc-4.3.0/boehm-gc/ia64_save_regs_in_stack.S	2008-06-10 14:45:05.000000000 +0200
   76.28 +@@ -0,0 +1,15 @@
   76.29 ++        .text
   76.30 ++        .align 16
   76.31 ++        .global GC_save_regs_in_stack
   76.32 ++        .proc GC_save_regs_in_stack
   76.33 ++GC_save_regs_in_stack:
   76.34 ++        .bodyfoo.mpg
   76.35 ++        flushrs
   76.36 ++        ;;
   76.37 ++        mov r8=ar.bsp
   76.38 ++        br.ret.sptk.few rp
   76.39 ++        .endp GC_save_regs_in_stack
   76.40 ++
   76.41 ++#ifdef __linux__
   76.42 ++	.section .note.GNU-stack,"",@progbits
   76.43 ++#endif
   76.44 +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
   76.45 +--- gcc-4.3.0.orig/boehm-gc/ia64_save_regs_in_stack.s	2001-10-15 06:57:59.000000000 +0200
   76.46 ++++ gcc-4.3.0/boehm-gc/ia64_save_regs_in_stack.s	2008-06-10 14:45:05.000000000 +0200
   76.47 +@@ -1,12 +0,0 @@
   76.48 +-        .text
   76.49 +-        .align 16
   76.50 +-        .global GC_save_regs_in_stack
   76.51 +-        .proc GC_save_regs_in_stack
   76.52 +-GC_save_regs_in_stack:
   76.53 +-        .body
   76.54 +-        flushrs
   76.55 +-        ;;
   76.56 +-        mov r8=ar.bsp
   76.57 +-        br.ret.sptk.few rp
   76.58 +-        .endp GC_save_regs_in_stack
   76.59 +-
   76.60 +diff -durN gcc-4.3.0.orig/libffi/src/alpha/osf.S gcc-4.3.0/libffi/src/alpha/osf.S
   76.61 +--- gcc-4.3.0.orig/libffi/src/alpha/osf.S	2007-04-06 18:24:16.000000000 +0200
   76.62 ++++ gcc-4.3.0/libffi/src/alpha/osf.S	2008-06-10 14:45:05.000000000 +0200
   76.63 +@@ -358,4 +358,8 @@
   76.64 + 	.byte	16		# uleb128 offset 16*-8
   76.65 + 	.align 3
   76.66 + $LEFDE3:
   76.67 ++
   76.68 ++#ifdef __linux__
   76.69 ++	.section	.note.GNU-stack,"",@progbits
   76.70 ++#endif
   76.71 + #endif
   76.72 +diff -durN gcc-4.3.0.orig/libffi/src/arm/sysv.S gcc-4.3.0/libffi/src/arm/sysv.S
   76.73 +--- gcc-4.3.0.orig/libffi/src/arm/sysv.S	2007-09-04 19:52:45.000000000 +0200
   76.74 ++++ gcc-4.3.0/libffi/src/arm/sysv.S	2008-06-10 14:45:05.000000000 +0200
   76.75 +@@ -293,3 +293,6 @@
   76.76 + 	UNWIND .fnend
   76.77 +         .size    CNAME(ffi_closure_SYSV),.ffi_closure_SYSV_end-CNAME(ffi_closure_SYSV)
   76.78 + 
   76.79 ++#if defined __ELF__ && defined __linux__
   76.80 ++	.section	.note.GNU-stack,"",%progbits
   76.81 ++#endif
   76.82 +diff -durN gcc-4.3.0.orig/libffi/src/ia64/unix.S gcc-4.3.0/libffi/src/ia64/unix.S
   76.83 +--- gcc-4.3.0.orig/libffi/src/ia64/unix.S	2005-03-30 23:49:19.000000000 +0200
   76.84 ++++ gcc-4.3.0/libffi/src/ia64/unix.S	2008-06-10 14:45:05.000000000 +0200
   76.85 +@@ -553,3 +553,7 @@
   76.86 + 	data8	@pcrel(.Lld_hfa_float)		// FFI_IA64_TYPE_HFA_FLOAT
   76.87 + 	data8	@pcrel(.Lld_hfa_double)		// FFI_IA64_TYPE_HFA_DOUBLE
   76.88 + 	data8	@pcrel(.Lld_hfa_ldouble)	// FFI_IA64_TYPE_HFA_LDOUBLE
   76.89 ++
   76.90 ++#if defined __ELF__ && defined __linux__
   76.91 ++	.section	.note.GNU-stack,"",@progbits
   76.92 ++#endif
   76.93 +diff -durN gcc-4.3.0.orig/libffi/src/m68k/sysv.S gcc-4.3.0/libffi/src/m68k/sysv.S
   76.94 +--- gcc-4.3.0.orig/libffi/src/m68k/sysv.S	2007-05-10 23:29:04.000000000 +0200
   76.95 ++++ gcc-4.3.0/libffi/src/m68k/sysv.S	2008-06-10 14:45:05.000000000 +0200
   76.96 +@@ -207,3 +207,7 @@
   76.97 + 	rts
   76.98 + 	CFI_ENDPROC()
   76.99 + 	.size	ffi_closure_struct_SYSV,.-ffi_closure_struct_SYSV
  76.100 ++
  76.101 ++#if defined __ELF__ && defined __linux__
  76.102 ++	.section	.note.GNU-stack,"",@progbits
  76.103 ++#endif
  76.104 +diff -durN gcc-4.3.0.orig/libffi/src/powerpc/linux64.S gcc-4.3.0/libffi/src/powerpc/linux64.S
  76.105 +--- gcc-4.3.0.orig/libffi/src/powerpc/linux64.S	2007-11-17 00:24:53.000000000 +0100
  76.106 ++++ gcc-4.3.0/libffi/src/powerpc/linux64.S	2008-06-10 14:45:05.000000000 +0200
  76.107 +@@ -179,3 +179,7 @@
  76.108 + 	.align 3
  76.109 + .LEFDE1:
  76.110 + #endif
  76.111 ++
  76.112 ++#if defined __ELF__ && defined __linux__
  76.113 ++	.section	.note.GNU-stack,"",@progbits
  76.114 ++#endif
  76.115 +diff -durN gcc-4.3.0.orig/libffi/src/powerpc/linux64_closure.S gcc-4.3.0/libffi/src/powerpc/linux64_closure.S
  76.116 +--- gcc-4.3.0.orig/libffi/src/powerpc/linux64_closure.S	2005-08-11 23:18:24.000000000 +0200
  76.117 ++++ gcc-4.3.0/libffi/src/powerpc/linux64_closure.S	2008-06-10 14:45:05.000000000 +0200
  76.118 +@@ -204,3 +204,7 @@
  76.119 + 	.align 3
  76.120 + .LEFDE1:
  76.121 + #endif
  76.122 ++
  76.123 ++#if defined __ELF__ && defined __linux__
  76.124 ++	.section	.note.GNU-stack,"",@progbits
  76.125 ++#endif
  76.126 +diff -durN gcc-4.3.0.orig/libffi/src/powerpc/ppc_closure.S gcc-4.3.0/libffi/src/powerpc/ppc_closure.S
  76.127 +--- gcc-4.3.0.orig/libffi/src/powerpc/ppc_closure.S	2007-12-01 22:00:04.000000000 +0100
  76.128 ++++ gcc-4.3.0/libffi/src/powerpc/ppc_closure.S	2008-06-10 14:45:05.000000000 +0200
  76.129 +@@ -295,3 +295,7 @@
  76.130 + .LEFDE1:
  76.131 + 
  76.132 + #endif
  76.133 ++
  76.134 ++#if defined __ELF__ && defined __linux__
  76.135 ++	.section	.note.GNU-stack,"",@progbits
  76.136 ++#endif
  76.137 +diff -durN gcc-4.3.0.orig/libffi/src/powerpc/sysv.S gcc-4.3.0/libffi/src/powerpc/sysv.S
  76.138 +--- gcc-4.3.0.orig/libffi/src/powerpc/sysv.S	2007-12-01 22:00:04.000000000 +0100
  76.139 ++++ gcc-4.3.0/libffi/src/powerpc/sysv.S	2008-06-10 14:45:05.000000000 +0200
  76.140 +@@ -223,3 +223,7 @@
  76.141 +       .align 2
  76.142 + .LEFDE1:
  76.143 + #endif
  76.144 ++
  76.145 ++#if defined __ELF__ && defined __linux__
  76.146 ++	.section	.note.GNU-stack,"",@progbits
  76.147 ++#endif
  76.148 +diff -durN gcc-4.3.0.orig/libffi/src/s390/sysv.S gcc-4.3.0/libffi/src/s390/sysv.S
  76.149 +--- gcc-4.3.0.orig/libffi/src/s390/sysv.S	2003-10-21 21:01:58.000000000 +0200
  76.150 ++++ gcc-4.3.0/libffi/src/s390/sysv.S	2008-06-10 14:45:05.000000000 +0200
  76.151 +@@ -427,3 +427,6 @@
  76.152 + 
  76.153 + #endif
  76.154 + 
  76.155 ++#if defined __ELF__ && defined __linux__
  76.156 ++	.section	.note.GNU-stack,"",@progbits
  76.157 ++#endif
  76.158 +diff -durN gcc-4.3.0.orig/libffi/src/sparc/v8.S gcc-4.3.0/libffi/src/sparc/v8.S
  76.159 +--- gcc-4.3.0.orig/libffi/src/sparc/v8.S	2004-11-22 19:35:16.000000000 +0100
  76.160 ++++ gcc-4.3.0/libffi/src/sparc/v8.S	2008-06-10 14:45:05.000000000 +0200
  76.161 +@@ -265,3 +265,7 @@
  76.162 + 	.byte	0x1f	! uleb128 0x1f
  76.163 + 	.align	WS
  76.164 + .LLEFDE2:
  76.165 ++
  76.166 ++#if defined __ELF__ && defined __linux__
  76.167 ++	.section	.note.GNU-stack,"",@progbits
  76.168 ++#endif
  76.169 +diff -durN gcc-4.3.0.orig/libffi/src/sparc/v9.S gcc-4.3.0/libffi/src/sparc/v9.S
  76.170 +--- gcc-4.3.0.orig/libffi/src/sparc/v9.S	2004-01-25 07:58:33.000000000 +0100
  76.171 ++++ gcc-4.3.0/libffi/src/sparc/v9.S	2008-06-10 14:45:05.000000000 +0200
  76.172 +@@ -300,3 +300,7 @@
  76.173 + 	.align 8
  76.174 + .LLEFDE2:
  76.175 + #endif
  76.176 ++
  76.177 ++#ifdef __linux__
  76.178 ++	.section	.note.GNU-stack,"",@progbits
  76.179 ++#endif
  76.180 +diff -durN gcc-4.3.0.orig/libffi/src/x86/sysv.S gcc-4.3.0/libffi/src/x86/sysv.S
  76.181 +--- gcc-4.3.0.orig/libffi/src/x86/sysv.S	2008-01-30 15:36:58.000000000 +0100
  76.182 ++++ gcc-4.3.0/libffi/src/x86/sysv.S	2008-06-10 14:45:05.000000000 +0200
  76.183 +@@ -430,3 +430,7 @@
  76.184 + #endif
  76.185 + 
  76.186 + #endif /* ifndef __x86_64__ */
  76.187 ++
  76.188 ++#if defined __ELF__ && defined __linux__
  76.189 ++	.section	.note.GNU-stack,"",@progbits
  76.190 ++#endif
  76.191 +diff -durN gcc-4.3.0.orig/libffi/src/x86/unix64.S gcc-4.3.0/libffi/src/x86/unix64.S
  76.192 +--- gcc-4.3.0.orig/libffi/src/x86/unix64.S	2005-05-05 06:06:38.000000000 +0200
  76.193 ++++ gcc-4.3.0/libffi/src/x86/unix64.S	2008-06-10 14:45:05.000000000 +0200
  76.194 +@@ -410,3 +410,7 @@
  76.195 + .LEFDE3:
  76.196 + 
  76.197 + #endif /* __x86_64__ */
  76.198 ++
  76.199 ++#if defined __ELF__ && defined __linux__
  76.200 ++	.section	.note.GNU-stack,"",@progbits
  76.201 ++#endif
    77.1 --- a/patches/gcc/4.3.0/475-gcc43-pr35705.patch	Mon Jul 28 20:17:48 2008 +0000
    77.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    77.3 @@ -1,21 +0,0 @@
    77.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/63_all_gcc43-pr35705.patch
    77.5 -http://gcc.gnu.org/PR35705
    77.6 -
    77.7 -2008-04-01  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
    77.8 -
    77.9 -	PR middle-end/35705
   77.10 -	* fold-const.c (get_pointer_modulus_and_residue): Return modulus 1 if
   77.11 -	the expression is a function address.
   77.12 -
   77.13 -diff -durN gcc-4.3.0.orig/gcc/fold-const.c gcc-4.3.0/gcc/fold-const.c
   77.14 ---- gcc-4.3.0.orig/gcc/fold-const.c	2008-02-27 15:12:33.000000000 +0100
   77.15 -+++ gcc-4.3.0/gcc/fold-const.c	2008-06-10 14:45:09.000000000 +0200
   77.16 -@@ -9357,7 +9357,7 @@
   77.17 - 	    }
   77.18 - 	}
   77.19 - 
   77.20 --      if (DECL_P (expr))
   77.21 -+      if (DECL_P (expr) && TREE_CODE (expr) != FUNCTION_DECL)
   77.22 - 	return DECL_ALIGN_UNIT (expr);
   77.23 -     }
   77.24 -   else if (code == POINTER_PLUS_EXPR)
    78.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    78.2 +++ b/patches/gcc/4.3.0/475-pr35705.patch	Mon Jul 28 21:08:01 2008 +0000
    78.3 @@ -0,0 +1,21 @@
    78.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/63_all_gcc43-pr35705.patch
    78.5 +http://gcc.gnu.org/PR35705
    78.6 +
    78.7 +2008-04-01  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
    78.8 +
    78.9 +	PR middle-end/35705
   78.10 +	* fold-const.c (get_pointer_modulus_and_residue): Return modulus 1 if
   78.11 +	the expression is a function address.
   78.12 +
   78.13 +diff -durN gcc-4.3.0.orig/gcc/fold-const.c gcc-4.3.0/gcc/fold-const.c
   78.14 +--- gcc-4.3.0.orig/gcc/fold-const.c	2008-02-27 15:12:33.000000000 +0100
   78.15 ++++ gcc-4.3.0/gcc/fold-const.c	2008-06-10 14:45:09.000000000 +0200
   78.16 +@@ -9357,7 +9357,7 @@
   78.17 + 	    }
   78.18 + 	}
   78.19 + 
   78.20 +-      if (DECL_P (expr))
   78.21 ++      if (DECL_P (expr) && TREE_CODE (expr) != FUNCTION_DECL)
   78.22 + 	return DECL_ALIGN_UNIT (expr);
   78.23 +     }
   78.24 +   else if (code == POINTER_PLUS_EXPR)
    79.1 --- a/patches/gcc/4.3.0/500-gcc43-pr34571.patch	Mon Jul 28 20:17:48 2008 +0000
    79.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    79.3 @@ -1,35 +0,0 @@
    79.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/64_all_gcc43-pr34571.patch
    79.5 -http://gcc.gnu.org/PR34571
    79.6 -
    79.7 -2007-12-26  Rask Ingemann Lambertsen  <rask@sygehus.dk>
    79.8 -
    79.9 -	PR target/34571
   79.10 -	* config/alpha/alpha.c (alpha_cannot_force_const_mem): Use
   79.11 -	symbolic_operand.
   79.12 -	* varasm.c (output_constant_pool_1): Fix typo.
   79.13 -
   79.14 -diff -durN gcc-4.3.0.orig/gcc/config/alpha/alpha.c gcc-4.3.0/gcc/config/alpha/alpha.c
   79.15 ---- gcc-4.3.0.orig/gcc/config/alpha/alpha.c	2008-02-07 18:45:24.000000000 +0100
   79.16 -+++ gcc-4.3.0/gcc/config/alpha/alpha.c	2008-06-10 14:45:13.000000000 +0200
   79.17 -@@ -1113,8 +1113,7 @@
   79.18 - static bool
   79.19 - alpha_cannot_force_const_mem (rtx x)
   79.20 - {
   79.21 --  enum rtx_code code = GET_CODE (x);
   79.22 --  return code == SYMBOL_REF || code == LABEL_REF || code == CONST;
   79.23 -+  return symbolic_operand (x, GET_MODE (x));
   79.24 - }
   79.25 - 
   79.26 - /* We do not allow indirect calls to be optimized into sibling calls, nor
   79.27 -diff -durN gcc-4.3.0.orig/gcc/varasm.c gcc-4.3.0/gcc/varasm.c
   79.28 ---- gcc-4.3.0.orig/gcc/varasm.c	2007-12-05 22:55:10.000000000 +0100
   79.29 -+++ gcc-4.3.0/gcc/varasm.c	2008-06-10 14:45:13.000000000 +0200
   79.30 -@@ -3710,7 +3710,7 @@
   79.31 -       /* FALLTHRU  */
   79.32 - 
   79.33 -     case LABEL_REF:
   79.34 --      tmp = XEXP (x, 0);
   79.35 -+      tmp = XEXP (tmp, 0);
   79.36 -       gcc_assert (!INSN_DELETED_P (tmp));
   79.37 -       gcc_assert (!NOTE_P (tmp)
   79.38 - 		  || NOTE_KIND (tmp) != NOTE_INSN_DELETED);
    80.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    80.2 +++ b/patches/gcc/4.3.0/500-pr34571.patch	Mon Jul 28 21:08:01 2008 +0000
    80.3 @@ -0,0 +1,35 @@
    80.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/64_all_gcc43-pr34571.patch
    80.5 +http://gcc.gnu.org/PR34571
    80.6 +
    80.7 +2007-12-26  Rask Ingemann Lambertsen  <rask@sygehus.dk>
    80.8 +
    80.9 +	PR target/34571
   80.10 +	* config/alpha/alpha.c (alpha_cannot_force_const_mem): Use
   80.11 +	symbolic_operand.
   80.12 +	* varasm.c (output_constant_pool_1): Fix typo.
   80.13 +
   80.14 +diff -durN gcc-4.3.0.orig/gcc/config/alpha/alpha.c gcc-4.3.0/gcc/config/alpha/alpha.c
   80.15 +--- gcc-4.3.0.orig/gcc/config/alpha/alpha.c	2008-02-07 18:45:24.000000000 +0100
   80.16 ++++ gcc-4.3.0/gcc/config/alpha/alpha.c	2008-06-10 14:45:13.000000000 +0200
   80.17 +@@ -1113,8 +1113,7 @@
   80.18 + static bool
   80.19 + alpha_cannot_force_const_mem (rtx x)
   80.20 + {
   80.21 +-  enum rtx_code code = GET_CODE (x);
   80.22 +-  return code == SYMBOL_REF || code == LABEL_REF || code == CONST;
   80.23 ++  return symbolic_operand (x, GET_MODE (x));
   80.24 + }
   80.25 + 
   80.26 + /* We do not allow indirect calls to be optimized into sibling calls, nor
   80.27 +diff -durN gcc-4.3.0.orig/gcc/varasm.c gcc-4.3.0/gcc/varasm.c
   80.28 +--- gcc-4.3.0.orig/gcc/varasm.c	2007-12-05 22:55:10.000000000 +0100
   80.29 ++++ gcc-4.3.0/gcc/varasm.c	2008-06-10 14:45:13.000000000 +0200
   80.30 +@@ -3710,7 +3710,7 @@
   80.31 +       /* FALLTHRU  */
   80.32 + 
   80.33 +     case LABEL_REF:
   80.34 +-      tmp = XEXP (x, 0);
   80.35 ++      tmp = XEXP (tmp, 0);
   80.36 +       gcc_assert (!INSN_DELETED_P (tmp));
   80.37 +       gcc_assert (!NOTE_P (tmp)
   80.38 + 		  || NOTE_KIND (tmp) != NOTE_INSN_DELETED);
    81.1 --- a/patches/gcc/4.3.0/525-gcc43-pr35982.patch	Mon Jul 28 20:17:48 2008 +0000
    81.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    81.3 @@ -1,23 +0,0 @@
    81.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/65_all_gcc43-pr35982.patch
    81.5 -http://gcc.gnu.org/PR35982
    81.6 -
    81.7 -2008-04-23  Ira Rosen  <irar@il.ibm.com>
    81.8 -
    81.9 -	PR tree-optimization/35982
   81.10 -	* tree-vect-analyze.c (vect_check_interleaving): Check that the
   81.11 -	interleaved data-refs are of the same type.
   81.12 -
   81.13 -diff -durN gcc-4.3.0.orig/gcc/tree-vect-analyze.c gcc-4.3.0/gcc/tree-vect-analyze.c
   81.14 ---- gcc-4.3.0.orig/gcc/tree-vect-analyze.c	2007-12-06 17:18:55.000000000 +0100
   81.15 -+++ gcc-4.3.0/gcc/tree-vect-analyze.c	2008-06-10 14:45:17.000000000 +0200
   81.16 -@@ -1081,7 +1081,9 @@
   81.17 -   type_size_b = TREE_INT_CST_LOW (TYPE_SIZE_UNIT (TREE_TYPE (DR_REF (drb))));
   81.18 - 
   81.19 -   if (type_size_a != type_size_b
   81.20 --      || tree_int_cst_compare (DR_STEP (dra), DR_STEP (drb)))
   81.21 -+      || tree_int_cst_compare (DR_STEP (dra), DR_STEP (drb))
   81.22 -+      || !types_compatible_p (TREE_TYPE (DR_REF (dra)), 
   81.23 -+                              TREE_TYPE (DR_REF (drb))))
   81.24 -     return;
   81.25 - 
   81.26 -   init_a = TREE_INT_CST_LOW (DR_INIT (dra));
    82.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    82.2 +++ b/patches/gcc/4.3.0/525-pr35982.patch	Mon Jul 28 21:08:01 2008 +0000
    82.3 @@ -0,0 +1,23 @@
    82.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/65_all_gcc43-pr35982.patch
    82.5 +http://gcc.gnu.org/PR35982
    82.6 +
    82.7 +2008-04-23  Ira Rosen  <irar@il.ibm.com>
    82.8 +
    82.9 +	PR tree-optimization/35982
   82.10 +	* tree-vect-analyze.c (vect_check_interleaving): Check that the
   82.11 +	interleaved data-refs are of the same type.
   82.12 +
   82.13 +diff -durN gcc-4.3.0.orig/gcc/tree-vect-analyze.c gcc-4.3.0/gcc/tree-vect-analyze.c
   82.14 +--- gcc-4.3.0.orig/gcc/tree-vect-analyze.c	2007-12-06 17:18:55.000000000 +0100
   82.15 ++++ gcc-4.3.0/gcc/tree-vect-analyze.c	2008-06-10 14:45:17.000000000 +0200
   82.16 +@@ -1081,7 +1081,9 @@
   82.17 +   type_size_b = TREE_INT_CST_LOW (TYPE_SIZE_UNIT (TREE_TYPE (DR_REF (drb))));
   82.18 + 
   82.19 +   if (type_size_a != type_size_b
   82.20 +-      || tree_int_cst_compare (DR_STEP (dra), DR_STEP (drb)))
   82.21 ++      || tree_int_cst_compare (DR_STEP (dra), DR_STEP (drb))
   82.22 ++      || !types_compatible_p (TREE_TYPE (DR_REF (dra)), 
   82.23 ++                              TREE_TYPE (DR_REF (drb))))
   82.24 +     return;
   82.25 + 
   82.26 +   init_a = TREE_INT_CST_LOW (DR_INIT (dra));
    83.1 --- a/patches/gcc/4.3.0/550-gcc43-pr25343.patch	Mon Jul 28 20:17:48 2008 +0000
    83.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    83.3 @@ -1,21 +0,0 @@
    83.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/66_all_gcc43-pr25343.patch
    83.5 -http://gcc.gnu.org/PR25343
    83.6 -
    83.7 -sniped from Debian
    83.8 -
    83.9 -2008-04-27  Roman Zippel <zippel@linux-m68k.org>
   83.10 -
   83.11 -	* config/host-linux.c (TRY_EMPTY_VM_SPACE): Define for __mc68000__.
   83.12 -
   83.13 -diff -durN gcc-4.3.0.orig/gcc/config/host-linux.c gcc-4.3.0/gcc/config/host-linux.c
   83.14 ---- gcc-4.3.0.orig/gcc/config/host-linux.c	2007-08-02 12:49:31.000000000 +0200
   83.15 -+++ gcc-4.3.0/gcc/config/host-linux.c	2008-06-10 14:45:20.000000000 +0200
   83.16 -@@ -84,6 +84,8 @@
   83.17 - # define TRY_EMPTY_VM_SPACE	0x8000000000
   83.18 - #elif defined(__sparc__)
   83.19 - # define TRY_EMPTY_VM_SPACE	0x60000000
   83.20 -+#elif defined(__mc68000__)
   83.21 -+# define TRY_EMPTY_VM_SPACE	0x40000000
   83.22 - #else
   83.23 - # define TRY_EMPTY_VM_SPACE	0
   83.24 - #endif
    84.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    84.2 +++ b/patches/gcc/4.3.0/550-pr25343.patch	Mon Jul 28 21:08:01 2008 +0000
    84.3 @@ -0,0 +1,21 @@
    84.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/66_all_gcc43-pr25343.patch
    84.5 +http://gcc.gnu.org/PR25343
    84.6 +
    84.7 +sniped from Debian
    84.8 +
    84.9 +2008-04-27  Roman Zippel <zippel@linux-m68k.org>
   84.10 +
   84.11 +	* config/host-linux.c (TRY_EMPTY_VM_SPACE): Define for __mc68000__.
   84.12 +
   84.13 +diff -durN gcc-4.3.0.orig/gcc/config/host-linux.c gcc-4.3.0/gcc/config/host-linux.c
   84.14 +--- gcc-4.3.0.orig/gcc/config/host-linux.c	2007-08-02 12:49:31.000000000 +0200
   84.15 ++++ gcc-4.3.0/gcc/config/host-linux.c	2008-06-10 14:45:20.000000000 +0200
   84.16 +@@ -84,6 +84,8 @@
   84.17 + # define TRY_EMPTY_VM_SPACE	0x8000000000
   84.18 + #elif defined(__sparc__)
   84.19 + # define TRY_EMPTY_VM_SPACE	0x60000000
   84.20 ++#elif defined(__mc68000__)
   84.21 ++# define TRY_EMPTY_VM_SPACE	0x40000000
   84.22 + #else
   84.23 + # define TRY_EMPTY_VM_SPACE	0
   84.24 + #endif
    85.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    85.2 +++ b/patches/gcc/4.3.0/600-ca-translation-typo.patch	Mon Jul 28 21:08:01 2008 +0000
    85.3 @@ -0,0 +1,19 @@
    85.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/85_all_gcc-ca-translation-typo.patch
    85.5 +http://bugs.gentoo.org/127190
    85.6 +
    85.7 +2006-03-28  Harald van Dijk  <truedfx@gentoo.org>
    85.8 +
    85.9 +	* ca.po: Fix printf flag typo in negative value translation.
   85.10 +
   85.11 +diff -durN gcc-4.3.0.orig/gcc/po/ca.po gcc-4.3.0/gcc/po/ca.po
   85.12 +--- gcc-4.3.0.orig/gcc/po/ca.po	2007-11-10 19:36:27.000000000 +0100
   85.13 ++++ gcc-4.3.0/gcc/po/ca.po	2008-06-10 14:45:27.000000000 +0200
   85.14 +@@ -36028,7 +36028,7 @@
   85.15 + #~ msgstr "passant el valor negatiu `%E' per a %s %P de \"%D\""
   85.16 + 
   85.17 + #~ msgid "%s of negative value `%E' to `%T'"
   85.18 +-#~ msgstr "%s de valor negatiu `%I' a \"%T\""
   85.19 ++#~ msgstr "%s de valor negatiu `%E' a \"%T\""
   85.20 + 
   85.21 + #~ msgid "initializing array with parameter list"
   85.22 + #~ msgstr "inicialitzant una matriu amb una llista de paràmetres"
    86.1 --- a/patches/gcc/4.3.0/600-gcc-ca-translation-typo.patch	Mon Jul 28 20:17:48 2008 +0000
    86.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    86.3 @@ -1,19 +0,0 @@
    86.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/gentoo/85_all_gcc-ca-translation-typo.patch
    86.5 -http://bugs.gentoo.org/127190
    86.6 -
    86.7 -2006-03-28  Harald van Dijk  <truedfx@gentoo.org>
    86.8 -
    86.9 -	* ca.po: Fix printf flag typo in negative value translation.
   86.10 -
   86.11 -diff -durN gcc-4.3.0.orig/gcc/po/ca.po gcc-4.3.0/gcc/po/ca.po
   86.12 ---- gcc-4.3.0.orig/gcc/po/ca.po	2007-11-10 19:36:27.000000000 +0100
   86.13 -+++ gcc-4.3.0/gcc/po/ca.po	2008-06-10 14:45:27.000000000 +0200
   86.14 -@@ -36028,7 +36028,7 @@
   86.15 - #~ msgstr "passant el valor negatiu `%E' per a %s %P de \"%D\""
   86.16 - 
   86.17 - #~ msgid "%s of negative value `%E' to `%T'"
   86.18 --#~ msgstr "%s de valor negatiu `%I' a \"%T\""
   86.19 -+#~ msgstr "%s de valor negatiu `%E' a \"%T\""
   86.20 - 
   86.21 - #~ msgid "initializing array with parameter list"
   86.22 - #~ msgstr "inicialitzant una matriu amb una llista de paràmetres"
    87.1 --- a/patches/gcc/4.3.0/625-103-uclibc-conf-noupstream.patch	Mon Jul 28 20:17:48 2008 +0000
    87.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    87.3 @@ -1,13 +0,0 @@
    87.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_103-uclibc-conf-noupstream.patch
    87.5 -diff -durN gcc-4.3.0.orig/gcc/config.gcc gcc-4.3.0/gcc/config.gcc
    87.6 ---- gcc-4.3.0.orig/gcc/config.gcc	2008-06-10 14:44:51.000000000 +0200
    87.7 -+++ gcc-4.3.0/gcc/config.gcc	2008-06-10 14:45:31.000000000 +0200
    87.8 -@@ -2142,7 +2142,7 @@
    87.9 -         ;;
   87.10 - sh-*-elf* | sh[12346l]*-*-elf* | sh*-*-kaos* | \
   87.11 - sh-*-symbianelf* | sh[12346l]*-*-symbianelf* | \
   87.12 --  sh-*-linux* | sh[346lbe]*-*-linux* | \
   87.13 -+  sh*-*-linux* | sh[346lbe]*-*-linux* | \
   87.14 -   sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
   87.15 -    sh64-*-netbsd* | sh64l*-*-netbsd*)
   87.16 - 	tmake_file="${tmake_file} sh/t-sh sh/t-elf"
    88.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    88.2 +++ b/patches/gcc/4.3.0/625-uclibc-conf-noupstream.patch	Mon Jul 28 21:08:01 2008 +0000
    88.3 @@ -0,0 +1,13 @@
    88.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_103-uclibc-conf-noupstream.patch
    88.5 +diff -durN gcc-4.3.0.orig/gcc/config.gcc gcc-4.3.0/gcc/config.gcc
    88.6 +--- gcc-4.3.0.orig/gcc/config.gcc	2008-06-10 14:44:51.000000000 +0200
    88.7 ++++ gcc-4.3.0/gcc/config.gcc	2008-06-10 14:45:31.000000000 +0200
    88.8 +@@ -2142,7 +2142,7 @@
    88.9 +         ;;
   88.10 + sh-*-elf* | sh[12346l]*-*-elf* | sh*-*-kaos* | \
   88.11 + sh-*-symbianelf* | sh[12346l]*-*-symbianelf* | \
   88.12 +-  sh-*-linux* | sh[346lbe]*-*-linux* | \
   88.13 ++  sh*-*-linux* | sh[346lbe]*-*-linux* | \
   88.14 +   sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
   88.15 +    sh64-*-netbsd* | sh64l*-*-netbsd*)
   88.16 + 	tmake_file="${tmake_file} sh/t-sh sh/t-elf"
    89.1 --- a/patches/gcc/4.3.0/650-200-uclibc-locale.patch	Mon Jul 28 20:17:48 2008 +0000
    89.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    89.3 @@ -1,2794 +0,0 @@
    89.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_200-uclibc-locale.patch
    89.5 -diff -durN gcc-4.3.0.orig/libstdc++-v3/acinclude.m4 gcc-4.3.0/libstdc++-v3/acinclude.m4
    89.6 ---- gcc-4.3.0.orig/libstdc++-v3/acinclude.m4	2008-02-29 01:00:39.000000000 +0100
    89.7 -+++ gcc-4.3.0/libstdc++-v3/acinclude.m4	2008-06-10 14:45:35.000000000 +0200
    89.8 -@@ -1349,7 +1349,7 @@
    89.9 - AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
   89.10 -   GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
   89.11 -     [use MODEL for target locale package],
   89.12 --    [permit generic|gnu|ieee_1003.1-2001|yes|no|auto])
   89.13 -+    [permit generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto])
   89.14 - 
   89.15 -   # Deal with gettext issues.  Default to not using it (=no) until we detect
   89.16 -   # support for it later.  Let the user turn it off via --e/d, but let that
   89.17 -@@ -1370,6 +1370,9 @@
   89.18 -   # Default to "generic".
   89.19 -   if test $enable_clocale_flag = auto; then
   89.20 -     case ${target_os} in
   89.21 -+      *-uclibc*)
   89.22 -+        enable_clocale_flag=uclibc
   89.23 -+        ;;
   89.24 -       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
   89.25 -         enable_clocale_flag=gnu	
   89.26 -         ;;
   89.27 -@@ -1541,6 +1544,40 @@
   89.28 -       CTIME_CC=config/locale/generic/time_members.cc
   89.29 -       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
   89.30 -       ;;
   89.31 -+    uclibc)
   89.32 -+      AC_MSG_RESULT(uclibc)
   89.33 -+
   89.34 -+      # Declare intention to use gettext, and add support for specific
   89.35 -+      # languages.
   89.36 -+      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
   89.37 -+      ALL_LINGUAS="de fr"
   89.38 -+
   89.39 -+      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
   89.40 -+      AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
   89.41 -+      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
   89.42 -+        USE_NLS=yes
   89.43 -+      fi
   89.44 -+      # Export the build objects.
   89.45 -+      for ling in $ALL_LINGUAS; do \
   89.46 -+        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
   89.47 -+        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
   89.48 -+      done
   89.49 -+      AC_SUBST(glibcxx_MOFILES)
   89.50 -+      AC_SUBST(glibcxx_POFILES)
   89.51 -+
   89.52 -+      CLOCALE_H=config/locale/uclibc/c_locale.h
   89.53 -+      CLOCALE_CC=config/locale/uclibc/c_locale.cc
   89.54 -+      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
   89.55 -+      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
   89.56 -+      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
   89.57 -+      CMESSAGES_H=config/locale/uclibc/messages_members.h
   89.58 -+      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
   89.59 -+      CMONEY_CC=config/locale/uclibc/monetary_members.cc
   89.60 -+      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
   89.61 -+      CTIME_H=config/locale/uclibc/time_members.h
   89.62 -+      CTIME_CC=config/locale/uclibc/time_members.cc
   89.63 -+      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
   89.64 -+      ;;
   89.65 -   esac
   89.66 - 
   89.67 -   # This is where the testsuite looks for locale catalogs, using the
   89.68 -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
   89.69 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	1970-01-01 01:00:00.000000000 +0100
   89.70 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2008-06-10 14:45:35.000000000 +0200
   89.71 -@@ -0,0 +1,63 @@
   89.72 -+// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
   89.73 -+
   89.74 -+// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
   89.75 -+//
   89.76 -+// This file is part of the GNU ISO C++ Library.  This library is free
   89.77 -+// software; you can redistribute it and/or modify it under the
   89.78 -+// terms of the GNU General Public License as published by the
   89.79 -+// Free Software Foundation; either version 2, or (at your option)
   89.80 -+// any later version.
   89.81 -+
   89.82 -+// This library is distributed in the hope that it will be useful,
   89.83 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
   89.84 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   89.85 -+// GNU General Public License for more details.
   89.86 -+
   89.87 -+// You should have received a copy of the GNU General Public License along
   89.88 -+// with this library; see the file COPYING.  If not, write to the Free
   89.89 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
   89.90 -+// USA.
   89.91 -+
   89.92 -+// As a special exception, you may use this file as part of a free software
   89.93 -+// library without restriction.  Specifically, if other files instantiate
   89.94 -+// templates or use macros or inline functions from this file, or you compile
   89.95 -+// this file and link it with other files to produce an executable, this
   89.96 -+// file does not by itself cause the resulting executable to be covered by
   89.97 -+// the GNU General Public License.  This exception does not however
   89.98 -+// invalidate any other reasons why the executable file might be covered by
   89.99 -+// the GNU General Public License.
  89.100 -+
  89.101 -+// Written by Jakub Jelinek <jakub@redhat.com>
  89.102 -+
  89.103 -+#include <bits/c++config.h>
  89.104 -+#include <clocale>
  89.105 -+
  89.106 -+#ifdef __UCLIBC_MJN3_ONLY__
  89.107 -+#warning clean this up
  89.108 -+#endif
  89.109 -+
  89.110 -+#ifdef __UCLIBC_HAS_XLOCALE__
  89.111 -+                                                  
  89.112 -+extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
  89.113 -+extern "C" __typeof(strcoll_l) __strcoll_l;
  89.114 -+extern "C" __typeof(strftime_l) __strftime_l;
  89.115 -+extern "C" __typeof(strtod_l) __strtod_l;
  89.116 -+extern "C" __typeof(strtof_l) __strtof_l;
  89.117 -+extern "C" __typeof(strtold_l) __strtold_l;
  89.118 -+extern "C" __typeof(strxfrm_l) __strxfrm_l;
  89.119 -+extern "C" __typeof(newlocale) __newlocale;
  89.120 -+extern "C" __typeof(freelocale) __freelocale;
  89.121 -+extern "C" __typeof(duplocale) __duplocale;
  89.122 -+extern "C" __typeof(uselocale) __uselocale;
  89.123 -+
  89.124 -+#ifdef _GLIBCXX_USE_WCHAR_T
  89.125 -+extern "C" __typeof(iswctype_l) __iswctype_l;
  89.126 -+extern "C" __typeof(towlower_l) __towlower_l;
  89.127 -+extern "C" __typeof(towupper_l) __towupper_l;
  89.128 -+extern "C" __typeof(wcscoll_l) __wcscoll_l;
  89.129 -+extern "C" __typeof(wcsftime_l) __wcsftime_l;
  89.130 -+extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
  89.131 -+extern "C" __typeof(wctype_l) __wctype_l;
  89.132 -+#endif 
  89.133 -+
  89.134 -+#endif // GLIBC 2.3 and later
  89.135 -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
  89.136 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc	1970-01-01 01:00:00.000000000 +0100
  89.137 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.cc	2008-06-10 14:45:35.000000000 +0200
  89.138 -@@ -0,0 +1,160 @@
  89.139 -+// Wrapper for underlying C-language localization -*- C++ -*-
  89.140 -+
  89.141 -+// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
  89.142 -+//
  89.143 -+// This file is part of the GNU ISO C++ Library.  This library is free
  89.144 -+// software; you can redistribute it and/or modify it under the
  89.145 -+// terms of the GNU General Public License as published by the
  89.146 -+// Free Software Foundation; either version 2, or (at your option)
  89.147 -+// any later version.
  89.148 -+
  89.149 -+// This library is distributed in the hope that it will be useful,
  89.150 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
  89.151 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  89.152 -+// GNU General Public License for more details.
  89.153 -+
  89.154 -+// You should have received a copy of the GNU General Public License along
  89.155 -+// with this library; see the file COPYING.  If not, write to the Free
  89.156 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  89.157 -+// USA.
  89.158 -+
  89.159 -+// As a special exception, you may use this file as part of a free software
  89.160 -+// library without restriction.  Specifically, if other files instantiate
  89.161 -+// templates or use macros or inline functions from this file, or you compile
  89.162 -+// this file and link it with other files to produce an executable, this
  89.163 -+// file does not by itself cause the resulting executable to be covered by
  89.164 -+// the GNU General Public License.  This exception does not however
  89.165 -+// invalidate any other reasons why the executable file might be covered by
  89.166 -+// the GNU General Public License.
  89.167 -+
  89.168 -+//
  89.169 -+// ISO C++ 14882: 22.8  Standard locale categories.
  89.170 -+//
  89.171 -+
  89.172 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
  89.173 -+
  89.174 -+#include <cerrno>  // For errno
  89.175 -+#include <locale>
  89.176 -+#include <stdexcept>
  89.177 -+#include <langinfo.h>
  89.178 -+#include <bits/c++locale_internal.h>
  89.179 -+
  89.180 -+#ifndef __UCLIBC_HAS_XLOCALE__
  89.181 -+#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
  89.182 -+#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
  89.183 -+#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
  89.184 -+#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
  89.185 -+#define __strtof_l(S, E, L)         strtof((S), (E))
  89.186 -+#define __strtod_l(S, E, L)         strtod((S), (E))
  89.187 -+#define __strtold_l(S, E, L)        strtold((S), (E))
  89.188 -+#warning should dummy __newlocale check for C|POSIX ?
  89.189 -+#define __newlocale(a, b, c)        NULL
  89.190 -+#define __freelocale(a)             ((void)0)
  89.191 -+#define __duplocale(a)              __c_locale()
  89.192 -+#endif
  89.193 -+
  89.194 -+namespace std 
  89.195 -+{
  89.196 -+  template<>
  89.197 -+    void
  89.198 -+    __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, 
  89.199 -+		   const __c_locale& __cloc)
  89.200 -+    {
  89.201 -+      if (!(__err & ios_base::failbit))
  89.202 -+	{
  89.203 -+	  char* __sanity;
  89.204 -+	  errno = 0;
  89.205 -+	  float __f = __strtof_l(__s, &__sanity, __cloc);
  89.206 -+          if (__sanity != __s && errno != ERANGE)
  89.207 -+	    __v = __f;
  89.208 -+	  else
  89.209 -+	    __err |= ios_base::failbit;
  89.210 -+	}
  89.211 -+    }
  89.212 -+
  89.213 -+  template<>
  89.214 -+    void
  89.215 -+    __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, 
  89.216 -+		   const __c_locale& __cloc)
  89.217 -+    {
  89.218 -+      if (!(__err & ios_base::failbit))
  89.219 -+	{
  89.220 -+	  char* __sanity;
  89.221 -+	  errno = 0;
  89.222 -+	  double __d = __strtod_l(__s, &__sanity, __cloc);
  89.223 -+          if (__sanity != __s && errno != ERANGE)
  89.224 -+	    __v = __d;
  89.225 -+	  else
  89.226 -+	    __err |= ios_base::failbit;
  89.227 -+	}
  89.228 -+    }
  89.229 -+
  89.230 -+  template<>
  89.231 -+    void
  89.232 -+    __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
  89.233 -+		   const __c_locale& __cloc)
  89.234 -+    {
  89.235 -+      if (!(__err & ios_base::failbit))
  89.236 -+	{
  89.237 -+	  char* __sanity;
  89.238 -+	  errno = 0;
  89.239 -+	  long double __ld = __strtold_l(__s, &__sanity, __cloc);
  89.240 -+          if (__sanity != __s && errno != ERANGE)
  89.241 -+	    __v = __ld;
  89.242 -+	  else
  89.243 -+	    __err |= ios_base::failbit;
  89.244 -+	}
  89.245 -+    }
  89.246 -+
  89.247 -+  void
  89.248 -+  locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s, 
  89.249 -+				    __c_locale __old)
  89.250 -+  {
  89.251 -+    __cloc = __newlocale(1 << LC_ALL, __s, __old);
  89.252 -+#ifdef __UCLIBC_HAS_XLOCALE__
  89.253 -+    if (!__cloc)
  89.254 -+      {
  89.255 -+	// This named locale is not supported by the underlying OS.
  89.256 -+	__throw_runtime_error(__N("locale::facet::_S_create_c_locale "
  89.257 -+			      "name not valid"));
  89.258 -+      }
  89.259 -+#endif
  89.260 -+  }
  89.261 -+  
  89.262 -+  void
  89.263 -+  locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
  89.264 -+  {
  89.265 -+    if (_S_get_c_locale() != __cloc)
  89.266 -+      __freelocale(__cloc); 
  89.267 -+  }
  89.268 -+
  89.269 -+  __c_locale
  89.270 -+  locale::facet::_S_clone_c_locale(__c_locale& __cloc)
  89.271 -+  { return __duplocale(__cloc); }
  89.272 -+} // namespace std
  89.273 -+
  89.274 -+namespace __gnu_cxx
  89.275 -+{
  89.276 -+  const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
  89.277 -+    {
  89.278 -+      "LC_CTYPE", 
  89.279 -+      "LC_NUMERIC",
  89.280 -+      "LC_TIME", 
  89.281 -+      "LC_COLLATE", 
  89.282 -+      "LC_MONETARY",
  89.283 -+      "LC_MESSAGES", 
  89.284 -+#if _GLIBCXX_NUM_CATEGORIES != 0
  89.285 -+      "LC_PAPER", 
  89.286 -+      "LC_NAME", 
  89.287 -+      "LC_ADDRESS",
  89.288 -+      "LC_TELEPHONE", 
  89.289 -+      "LC_MEASUREMENT", 
  89.290 -+      "LC_IDENTIFICATION" 
  89.291 -+#endif
  89.292 -+    };
  89.293 -+}
  89.294 -+
  89.295 -+namespace std
  89.296 -+{
  89.297 -+  const char* const* const locale::_S_categories = __gnu_cxx::category_names;
  89.298 -+}  // namespace std
  89.299 -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
  89.300 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.h	1970-01-01 01:00:00.000000000 +0100
  89.301 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.h	2008-06-10 14:45:35.000000000 +0200
  89.302 -@@ -0,0 +1,117 @@
  89.303 -+// Wrapper for underlying C-language localization -*- C++ -*-
  89.304 -+
  89.305 -+// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
  89.306 -+//
  89.307 -+// This file is part of the GNU ISO C++ Library.  This library is free
  89.308 -+// software; you can redistribute it and/or modify it under the
  89.309 -+// terms of the GNU General Public License as published by the
  89.310 -+// Free Software Foundation; either version 2, or (at your option)
  89.311 -+// any later version.
  89.312 -+
  89.313 -+// This library is distributed in the hope that it will be useful,
  89.314 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
  89.315 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  89.316 -+// GNU General Public License for more details.
  89.317 -+
  89.318 -+// You should have received a copy of the GNU General Public License along
  89.319 -+// with this library; see the file COPYING.  If not, write to the Free
  89.320 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  89.321 -+// USA.
  89.322 -+
  89.323 -+// As a special exception, you may use this file as part of a free software
  89.324 -+// library without restriction.  Specifically, if other files instantiate
  89.325 -+// templates or use macros or inline functions from this file, or you compile
  89.326 -+// this file and link it with other files to produce an executable, this
  89.327 -+// file does not by itself cause the resulting executable to be covered by
  89.328 -+// the GNU General Public License.  This exception does not however
  89.329 -+// invalidate any other reasons why the executable file might be covered by
  89.330 -+// the GNU General Public License.
  89.331 -+
  89.332 -+//
  89.333 -+// ISO C++ 14882: 22.8  Standard locale categories.
  89.334 -+//
  89.335 -+
  89.336 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
  89.337 -+
  89.338 -+#ifndef _C_LOCALE_H
  89.339 -+#define _C_LOCALE_H 1
  89.340 -+
  89.341 -+#pragma GCC system_header
  89.342 -+
  89.343 -+#include <cstring>              // get std::strlen
  89.344 -+#include <cstdio>               // get std::snprintf or std::sprintf
  89.345 -+#include <clocale>
  89.346 -+#include <langinfo.h>		// For codecvt
  89.347 -+#ifdef __UCLIBC_MJN3_ONLY__
  89.348 -+#warning fix this
  89.349 -+#endif
  89.350 -+#ifdef __UCLIBC_HAS_LOCALE__
  89.351 -+#include <iconv.h>		// For codecvt using iconv, iconv_t
  89.352 -+#endif
  89.353 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
  89.354 -+#include <libintl.h> 		// For messages
  89.355 -+#endif
  89.356 -+
  89.357 -+#ifdef __UCLIBC_MJN3_ONLY__
  89.358 -+#warning what is _GLIBCXX_C_LOCALE_GNU for
  89.359 -+#endif
  89.360 -+#define _GLIBCXX_C_LOCALE_GNU 1
  89.361 -+
  89.362 -+#ifdef __UCLIBC_MJN3_ONLY__
  89.363 -+#warning fix categories
  89.364 -+#endif
  89.365 -+// #define _GLIBCXX_NUM_CATEGORIES 6
  89.366 -+#define _GLIBCXX_NUM_CATEGORIES 0
  89.367 -+ 
  89.368 -+#ifdef __UCLIBC_HAS_XLOCALE__
  89.369 -+namespace __gnu_cxx
  89.370 -+{
  89.371 -+  extern "C" __typeof(uselocale) __uselocale;
  89.372 -+}
  89.373 -+#endif
  89.374 -+
  89.375 -+namespace std
  89.376 -+{
  89.377 -+#ifdef __UCLIBC_HAS_XLOCALE__
  89.378 -+  typedef __locale_t		__c_locale;
  89.379 -+#else
  89.380 -+  typedef int*			__c_locale;
  89.381 -+#endif
  89.382 -+
  89.383 -+  // Convert numeric value of type _Tv to string and return length of
  89.384 -+  // string.  If snprintf is available use it, otherwise fall back to
  89.385 -+  // the unsafe sprintf which, in general, can be dangerous and should
  89.386 -+  // be avoided.
  89.387 -+  template<typename _Tv>
  89.388 -+    int
  89.389 -+    __convert_from_v(char* __out, 
  89.390 -+		     const int __size __attribute__ ((__unused__)),
  89.391 -+		     const char* __fmt,
  89.392 -+#ifdef __UCLIBC_HAS_XCLOCALE__
  89.393 -+		     _Tv __v, const __c_locale& __cloc, int __prec)
  89.394 -+    {
  89.395 -+      __c_locale __old = __gnu_cxx::__uselocale(__cloc);
  89.396 -+#else
  89.397 -+		     _Tv __v, const __c_locale&, int __prec)
  89.398 -+    {
  89.399 -+# ifdef __UCLIBC_HAS_LOCALE__
  89.400 -+      char* __old = std::setlocale(LC_ALL, NULL);
  89.401 -+      char* __sav = new char[std::strlen(__old) + 1];
  89.402 -+      std::strcpy(__sav, __old);
  89.403 -+      std::setlocale(LC_ALL, "C");
  89.404 -+# endif
  89.405 -+#endif
  89.406 -+
  89.407 -+      const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
  89.408 -+
  89.409 -+#ifdef __UCLIBC_HAS_XCLOCALE__
  89.410 -+      __gnu_cxx::__uselocale(__old);
  89.411 -+#elif defined __UCLIBC_HAS_LOCALE__
  89.412 -+      std::setlocale(LC_ALL, __sav);
  89.413 -+      delete [] __sav;
  89.414 -+#endif
  89.415 -+      return __ret;
  89.416 -+    }
  89.417 -+}
  89.418 -+
  89.419 -+#endif
  89.420 -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
  89.421 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/codecvt_members.cc	1970-01-01 01:00:00.000000000 +0100
  89.422 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/codecvt_members.cc	2008-06-10 14:45:35.000000000 +0200
  89.423 -@@ -0,0 +1,306 @@
  89.424 -+// std::codecvt implementation details, GNU version -*- C++ -*-
  89.425 -+
  89.426 -+// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
  89.427 -+//
  89.428 -+// This file is part of the GNU ISO C++ Library.  This library is free
  89.429 -+// software; you can redistribute it and/or modify it under the
  89.430 -+// terms of the GNU General Public License as published by the
  89.431 -+// Free Software Foundation; either version 2, or (at your option)
  89.432 -+// any later version.
  89.433 -+
  89.434 -+// This library is distributed in the hope that it will be useful,
  89.435 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
  89.436 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  89.437 -+// GNU General Public License for more details.
  89.438 -+
  89.439 -+// You should have received a copy of the GNU General Public License along
  89.440 -+// with this library; see the file COPYING.  If not, write to the Free
  89.441 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  89.442 -+// USA.
  89.443 -+
  89.444 -+// As a special exception, you may use this file as part of a free software
  89.445 -+// library without restriction.  Specifically, if other files instantiate
  89.446 -+// templates or use macros or inline functions from this file, or you compile
  89.447 -+// this file and link it with other files to produce an executable, this
  89.448 -+// file does not by itself cause the resulting executable to be covered by
  89.449 -+// the GNU General Public License.  This exception does not however
  89.450 -+// invalidate any other reasons why the executable file might be covered by
  89.451 -+// the GNU General Public License.
  89.452 -+
  89.453 -+//
  89.454 -+// ISO C++ 14882: 22.2.1.5 - Template class codecvt
  89.455 -+//
  89.456 -+
  89.457 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
  89.458 -+
  89.459 -+#include <locale>
  89.460 -+#include <bits/c++locale_internal.h>
  89.461 -+
  89.462 -+namespace std
  89.463 -+{
  89.464 -+  // Specializations.
  89.465 -+#ifdef _GLIBCXX_USE_WCHAR_T
  89.466 -+  codecvt_base::result
  89.467 -+  codecvt<wchar_t, char, mbstate_t>::
  89.468 -+  do_out(state_type& __state, const intern_type* __from, 
  89.469 -+	 const intern_type* __from_end, const intern_type*& __from_next,
  89.470 -+	 extern_type* __to, extern_type* __to_end,
  89.471 -+	 extern_type*& __to_next) const
  89.472 -+  {
  89.473 -+    result __ret = ok;
  89.474 -+    state_type __tmp_state(__state);
  89.475 -+
  89.476 -+#ifdef __UCLIBC_HAS_XLOCALE__
  89.477 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
  89.478 -+#endif
  89.479 -+
  89.480 -+    // wcsnrtombs is *very* fast but stops if encounters NUL characters:
  89.481 -+    // in case we fall back to wcrtomb and then continue, in a loop.
  89.482 -+    // NB: wcsnrtombs is a GNU extension
  89.483 -+    for (__from_next = __from, __to_next = __to;
  89.484 -+	 __from_next < __from_end && __to_next < __to_end
  89.485 -+	 && __ret == ok;)
  89.486 -+      {
  89.487 -+	const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
  89.488 -+						      __from_end - __from_next);
  89.489 -+	if (!__from_chunk_end)
  89.490 -+	  __from_chunk_end = __from_end;
  89.491 -+
  89.492 -+	__from = __from_next;
  89.493 -+	const size_t __conv = wcsnrtombs(__to_next, &__from_next,
  89.494 -+					 __from_chunk_end - __from_next,
  89.495 -+					 __to_end - __to_next, &__state);
  89.496 -+	if (__conv == static_cast<size_t>(-1))
  89.497 -+	  {
  89.498 -+	    // In case of error, in order to stop at the exact place we
  89.499 -+	    // have to start again from the beginning with a series of
  89.500 -+	    // wcrtomb.
  89.501 -+	    for (; __from < __from_next; ++__from)
  89.502 -+	      __to_next += wcrtomb(__to_next, *__from, &__tmp_state);
  89.503 -+	    __state = __tmp_state;
  89.504 -+	    __ret = error;
  89.505 -+	  }
  89.506 -+	else if (__from_next && __from_next < __from_chunk_end)
  89.507 -+	  {
  89.508 -+	    __to_next += __conv;
  89.509 -+	    __ret = partial;
  89.510 -+	  }
  89.511 -+	else
  89.512 -+	  {
  89.513 -+	    __from_next = __from_chunk_end;
  89.514 -+	    __to_next += __conv;
  89.515 -+	  }
  89.516 -+
  89.517 -+	if (__from_next < __from_end && __ret == ok)
  89.518 -+	  {
  89.519 -+	    extern_type __buf[MB_LEN_MAX];
  89.520 -+	    __tmp_state = __state;
  89.521 -+	    const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
  89.522 -+	    if (__conv > static_cast<size_t>(__to_end - __to_next))
  89.523 -+	      __ret = partial;
  89.524 -+	    else
  89.525 -+	      {
  89.526 -+		memcpy(__to_next, __buf, __conv);
  89.527 -+		__state = __tmp_state;
  89.528 -+		__to_next += __conv;
  89.529 -+		++__from_next;
  89.530 -+	      }
  89.531 -+	  }
  89.532 -+      }
  89.533 -+
  89.534 -+#ifdef __UCLIBC_HAS_XLOCALE__
  89.535 -+    __uselocale(__old);
  89.536 -+#endif
  89.537 -+
  89.538 -+    return __ret; 
  89.539 -+  }
  89.540 -+  
  89.541 -+  codecvt_base::result
  89.542 -+  codecvt<wchar_t, char, mbstate_t>::
  89.543 -+  do_in(state_type& __state, const extern_type* __from, 
  89.544 -+	const extern_type* __from_end, const extern_type*& __from_next,
  89.545 -+	intern_type* __to, intern_type* __to_end,
  89.546 -+	intern_type*& __to_next) const
  89.547 -+  {
  89.548 -+    result __ret = ok;
  89.549 -+    state_type __tmp_state(__state);
  89.550 -+
  89.551 -+#ifdef __UCLIBC_HAS_XLOCALE__
  89.552 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
  89.553 -+#endif
  89.554 -+
  89.555 -+    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
  89.556 -+    // in case we store a L'\0' and then continue, in a loop.
  89.557 -+    // NB: mbsnrtowcs is a GNU extension
  89.558 -+    for (__from_next = __from, __to_next = __to;
  89.559 -+	 __from_next < __from_end && __to_next < __to_end
  89.560 -+	 && __ret == ok;)
  89.561 -+      {
  89.562 -+	const extern_type* __from_chunk_end;
  89.563 -+	__from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
  89.564 -+								  __from_end
  89.565 -+								  - __from_next));
  89.566 -+	if (!__from_chunk_end)
  89.567 -+	  __from_chunk_end = __from_end;
  89.568 -+
  89.569 -+	__from = __from_next;
  89.570 -+	size_t __conv = mbsnrtowcs(__to_next, &__from_next,
  89.571 -+				   __from_chunk_end - __from_next,
  89.572 -+				   __to_end - __to_next, &__state);
  89.573 -+	if (__conv == static_cast<size_t>(-1))
  89.574 -+	  {
  89.575 -+	    // In case of error, in order to stop at the exact place we
  89.576 -+	    // have to start again from the beginning with a series of
  89.577 -+	    // mbrtowc.
  89.578 -+	    for (;; ++__to_next, __from += __conv)
  89.579 -+	      {
  89.580 -+		__conv = mbrtowc(__to_next, __from, __from_end - __from,
  89.581 -+				 &__tmp_state);
  89.582 -+		if (__conv == static_cast<size_t>(-1)
  89.583 -+		    || __conv == static_cast<size_t>(-2))
  89.584 -+		  break;
  89.585 -+	      }
  89.586 -+	    __from_next = __from;
  89.587 -+	    __state = __tmp_state;	    
  89.588 -+	    __ret = error;
  89.589 -+	  }
  89.590 -+	else if (__from_next && __from_next < __from_chunk_end)
  89.591 -+	  {
  89.592 -+	    // It is unclear what to return in this case (see DR 382). 
  89.593 -+	    __to_next += __conv;
  89.594 -+	    __ret = partial;
  89.595 -+	  }
  89.596 -+	else
  89.597 -+	  {
  89.598 -+	    __from_next = __from_chunk_end;
  89.599 -+	    __to_next += __conv;
  89.600 -+	  }
  89.601 -+
  89.602 -+	if (__from_next < __from_end && __ret == ok)
  89.603 -+	  {
  89.604 -+	    if (__to_next < __to_end)
  89.605 -+	      {
  89.606 -+		// XXX Probably wrong for stateful encodings
  89.607 -+		__tmp_state = __state;		
  89.608 -+		++__from_next;
  89.609 -+		*__to_next++ = L'\0';
  89.610 -+	      }
  89.611 -+	    else
  89.612 -+	      __ret = partial;
  89.613 -+	  }
  89.614 -+      }
  89.615 -+
  89.616 -+#ifdef __UCLIBC_HAS_XLOCALE__
  89.617 -+    __uselocale(__old);
  89.618 -+#endif
  89.619 -+
  89.620 -+    return __ret; 
  89.621 -+  }
  89.622 -+
  89.623 -+  int 
  89.624 -+  codecvt<wchar_t, char, mbstate_t>::
  89.625 -+  do_encoding() const throw()
  89.626 -+  {
  89.627 -+    // XXX This implementation assumes that the encoding is
  89.628 -+    // stateless and is either single-byte or variable-width.
  89.629 -+    int __ret = 0;
  89.630 -+#ifdef __UCLIBC_HAS_XLOCALE__
  89.631 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
  89.632 -+#endif
  89.633 -+    if (MB_CUR_MAX == 1)
  89.634 -+      __ret = 1;
  89.635 -+#ifdef __UCLIBC_HAS_XLOCALE__
  89.636 -+    __uselocale(__old);
  89.637 -+#endif
  89.638 -+    return __ret;
  89.639 -+  }  
  89.640 -+
  89.641 -+  int 
  89.642 -+  codecvt<wchar_t, char, mbstate_t>::
  89.643 -+  do_max_length() const throw()
  89.644 -+  {
  89.645 -+#ifdef __UCLIBC_HAS_XLOCALE__
  89.646 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
  89.647 -+#endif
  89.648 -+    // XXX Probably wrong for stateful encodings.
  89.649 -+    int __ret = MB_CUR_MAX;
  89.650 -+#ifdef __UCLIBC_HAS_XLOCALE__
  89.651 -+    __uselocale(__old);
  89.652 -+#endif
  89.653 -+    return __ret;
  89.654 -+  }
  89.655 -+  
  89.656 -+  int 
  89.657 -+  codecvt<wchar_t, char, mbstate_t>::
  89.658 -+  do_length(state_type& __state, const extern_type* __from,
  89.659 -+	    const extern_type* __end, size_t __max) const
  89.660 -+  {
  89.661 -+    int __ret = 0;
  89.662 -+    state_type __tmp_state(__state);
  89.663 -+
  89.664 -+#ifdef __UCLIBC_HAS_XLOCALE__
  89.665 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
  89.666 -+#endif
  89.667 -+
  89.668 -+    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
  89.669 -+    // in case we advance past it and then continue, in a loop.
  89.670 -+    // NB: mbsnrtowcs is a GNU extension
  89.671 -+  
  89.672 -+    // A dummy internal buffer is needed in order for mbsnrtocws to consider
  89.673 -+    // its fourth parameter (it wouldn't with NULL as first parameter).
  89.674 -+    wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t) 
  89.675 -+							   * __max));
  89.676 -+    while (__from < __end && __max)
  89.677 -+      {
  89.678 -+	const extern_type* __from_chunk_end;
  89.679 -+	__from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
  89.680 -+								  __end
  89.681 -+								  - __from));
  89.682 -+	if (!__from_chunk_end)
  89.683 -+	  __from_chunk_end = __end;
  89.684 -+
  89.685 -+	const extern_type* __tmp_from = __from;
  89.686 -+	size_t __conv = mbsnrtowcs(__to, &__from,
  89.687 -+				   __from_chunk_end - __from,
  89.688 -+				   __max, &__state);
  89.689 -+	if (__conv == static_cast<size_t>(-1))
  89.690 -+	  {
  89.691 -+	    // In case of error, in order to stop at the exact place we
  89.692 -+	    // have to start again from the beginning with a series of
  89.693 -+	    // mbrtowc.
  89.694 -+	    for (__from = __tmp_from;; __from += __conv)
  89.695 -+	      {
  89.696 -+		__conv = mbrtowc(NULL, __from, __end - __from,
  89.697 -+				 &__tmp_state);
  89.698 -+		if (__conv == static_cast<size_t>(-1)
  89.699 -+		    || __conv == static_cast<size_t>(-2))
  89.700 -+		  break;
  89.701 -+	      }
  89.702 -+	    __state = __tmp_state;
  89.703 -+	    __ret += __from - __tmp_from;
  89.704 -+	    break;
  89.705 -+	  }
  89.706 -+	if (!__from)
  89.707 -+	  __from = __from_chunk_end;
  89.708 -+	
  89.709 -+	__ret += __from - __tmp_from;
  89.710 -+	__max -= __conv;
  89.711 -+
  89.712 -+	if (__from < __end && __max)
  89.713 -+	  {
  89.714 -+	    // XXX Probably wrong for stateful encodings
  89.715 -+	    __tmp_state = __state;
  89.716 -+	    ++__from;
  89.717 -+	    ++__ret;
  89.718 -+	    --__max;
  89.719 -+	  }
  89.720 -+      }
  89.721 -+
  89.722 -+#ifdef __UCLIBC_HAS_XLOCALE__
  89.723 -+    __uselocale(__old);
  89.724 -+#endif
  89.725 -+
  89.726 -+    return __ret; 
  89.727 -+  }
  89.728 -+#endif
  89.729 -+}
  89.730 -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
  89.731 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc	1970-01-01 01:00:00.000000000 +0100
  89.732 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/collate_members.cc	2008-06-10 14:45:35.000000000 +0200
  89.733 -@@ -0,0 +1,80 @@
  89.734 -+// std::collate implementation details, GNU version -*- C++ -*-
  89.735 -+
  89.736 -+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
  89.737 -+//
  89.738 -+// This file is part of the GNU ISO C++ Library.  This library is free
  89.739 -+// software; you can redistribute it and/or modify it under the
  89.740 -+// terms of the GNU General Public License as published by the
  89.741 -+// Free Software Foundation; either version 2, or (at your option)
  89.742 -+// any later version.
  89.743 -+
  89.744 -+// This library is distributed in the hope that it will be useful,
  89.745 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
  89.746 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  89.747 -+// GNU General Public License for more details.
  89.748 -+
  89.749 -+// You should have received a copy of the GNU General Public License along
  89.750 -+// with this library; see the file COPYING.  If not, write to the Free
  89.751 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  89.752 -+// USA.
  89.753 -+
  89.754 -+// As a special exception, you may use this file as part of a free software
  89.755 -+// library without restriction.  Specifically, if other files instantiate
  89.756 -+// templates or use macros or inline functions from this file, or you compile
  89.757 -+// this file and link it with other files to produce an executable, this
  89.758 -+// file does not by itself cause the resulting executable to be covered by
  89.759 -+// the GNU General Public License.  This exception does not however
  89.760 -+// invalidate any other reasons why the executable file might be covered by
  89.761 -+// the GNU General Public License.
  89.762 -+
  89.763 -+//
  89.764 -+// ISO C++ 14882: 22.2.4.1.2  collate virtual functions
  89.765 -+//
  89.766 -+
  89.767 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
  89.768 -+
  89.769 -+#include <locale>
  89.770 -+#include <bits/c++locale_internal.h>
  89.771 -+
  89.772 -+#ifndef __UCLIBC_HAS_XLOCALE__
  89.773 -+#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
  89.774 -+#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
  89.775 -+#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
  89.776 -+#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
  89.777 -+#endif
  89.778 -+
  89.779 -+namespace std
  89.780 -+{
  89.781 -+  // These are basically extensions to char_traits, and perhaps should
  89.782 -+  // be put there instead of here.
  89.783 -+  template<>
  89.784 -+    int 
  89.785 -+    collate<char>::_M_compare(const char* __one, const char* __two) const
  89.786 -+    { 
  89.787 -+      int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
  89.788 -+      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
  89.789 -+    }
  89.790 -+  
  89.791 -+  template<>
  89.792 -+    size_t
  89.793 -+    collate<char>::_M_transform(char* __to, const char* __from, 
  89.794 -+				size_t __n) const 
  89.795 -+    { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
  89.796 -+
  89.797 -+#ifdef _GLIBCXX_USE_WCHAR_T
  89.798 -+  template<>
  89.799 -+    int 
  89.800 -+    collate<wchar_t>::_M_compare(const wchar_t* __one, 
  89.801 -+				 const wchar_t* __two) const
  89.802 -+    {
  89.803 -+      int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
  89.804 -+      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
  89.805 -+    }
  89.806 -+  
  89.807 -+  template<>
  89.808 -+    size_t
  89.809 -+    collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
  89.810 -+				   size_t __n) const
  89.811 -+    { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
  89.812 -+#endif
  89.813 -+}
  89.814 -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
  89.815 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc	1970-01-01 01:00:00.000000000 +0100
  89.816 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2008-06-10 14:45:35.000000000 +0200
  89.817 -@@ -0,0 +1,300 @@
  89.818 -+// std::ctype implementation details, GNU version -*- C++ -*-
  89.819 -+
  89.820 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
  89.821 -+//
  89.822 -+// This file is part of the GNU ISO C++ Library.  This library is free
  89.823 -+// software; you can redistribute it and/or modify it under the
  89.824 -+// terms of the GNU General Public License as published by the
  89.825 -+// Free Software Foundation; either version 2, or (at your option)
  89.826 -+// any later version.
  89.827 -+
  89.828 -+// This library is distributed in the hope that it will be useful,
  89.829 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
  89.830 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  89.831 -+// GNU General Public License for more details.
  89.832 -+
  89.833 -+// You should have received a copy of the GNU General Public License along
  89.834 -+// with this library; see the file COPYING.  If not, write to the Free
  89.835 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  89.836 -+// USA.
  89.837 -+
  89.838 -+// As a special exception, you may use this file as part of a free software
  89.839 -+// library without restriction.  Specifically, if other files instantiate
  89.840 -+// templates or use macros or inline functions from this file, or you compile
  89.841 -+// this file and link it with other files to produce an executable, this
  89.842 -+// file does not by itself cause the resulting executable to be covered by
  89.843 -+// the GNU General Public License.  This exception does not however
  89.844 -+// invalidate any other reasons why the executable file might be covered by
  89.845 -+// the GNU General Public License.
  89.846 -+
  89.847 -+//
  89.848 -+// ISO C++ 14882: 22.2.1.1.2  ctype virtual functions.
  89.849 -+//
  89.850 -+
  89.851 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
  89.852 -+
  89.853 -+#define _LIBC
  89.854 -+#include <locale>
  89.855 -+#undef _LIBC
  89.856 -+#include <bits/c++locale_internal.h>
  89.857 -+
  89.858 -+#ifndef __UCLIBC_HAS_XLOCALE__
  89.859 -+#define __wctype_l(S, L)           wctype((S))
  89.860 -+#define __towupper_l(C, L)         towupper((C))
  89.861 -+#define __towlower_l(C, L)         towlower((C))
  89.862 -+#define __iswctype_l(C, M, L)      iswctype((C), (M))
  89.863 -+#endif
  89.864 -+
  89.865 -+namespace std
  89.866 -+{
  89.867 -+  // NB: The other ctype<char> specializations are in src/locale.cc and
  89.868 -+  // various /config/os/* files.
  89.869 -+  template<>
  89.870 -+    ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
  89.871 -+    : ctype<char>(0, false, __refs) 
  89.872 -+    { 		
  89.873 -+      if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
  89.874 -+	{
  89.875 -+	  this->_S_destroy_c_locale(this->_M_c_locale_ctype);
  89.876 -+	  this->_S_create_c_locale(this->_M_c_locale_ctype, __s); 
  89.877 -+#ifdef __UCLIBC_HAS_XLOCALE__
  89.878 -+	  this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
  89.879 -+	  this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
  89.880 -+	  this->_M_table = this->_M_c_locale_ctype->__ctype_b;
  89.881 -+#endif
  89.882 -+	}
  89.883 -+    }
  89.884 -+
  89.885 -+#ifdef _GLIBCXX_USE_WCHAR_T  
  89.886 -+  ctype<wchar_t>::__wmask_type
  89.887 -+  ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
  89.888 -+  {
  89.889 -+    __wmask_type __ret;
  89.890 -+    switch (__m)
  89.891 -+      {
  89.892 -+      case space:
  89.893 -+	__ret = __wctype_l("space", _M_c_locale_ctype);
  89.894 -+	break;
  89.895 -+      case print:
  89.896 -+	__ret = __wctype_l("print", _M_c_locale_ctype);
  89.897 -+	break;
  89.898 -+      case cntrl:
  89.899 -+	__ret = __wctype_l("cntrl", _M_c_locale_ctype);
  89.900 -+	break;
  89.901 -+      case upper:
  89.902 -+	__ret = __wctype_l("upper", _M_c_locale_ctype);
  89.903 -+	break;
  89.904 -+      case lower:
  89.905 -+	__ret = __wctype_l("lower", _M_c_locale_ctype);
  89.906 -+	break;
  89.907 -+      case alpha:
  89.908 -+	__ret = __wctype_l("alpha", _M_c_locale_ctype);
  89.909 -+	break;
  89.910 -+      case digit:
  89.911 -+	__ret = __wctype_l("digit", _M_c_locale_ctype);
  89.912 -+	break;
  89.913 -+      case punct:
  89.914 -+	__ret = __wctype_l("punct", _M_c_locale_ctype);
  89.915 -+	break;
  89.916 -+      case xdigit:
  89.917 -+	__ret = __wctype_l("xdigit", _M_c_locale_ctype);
  89.918 -+	break;
  89.919 -+      case alnum:
  89.920 -+	__ret = __wctype_l("alnum", _M_c_locale_ctype);
  89.921 -+	break;
  89.922 -+      case graph:
  89.923 -+	__ret = __wctype_l("graph", _M_c_locale_ctype);
  89.924 -+	break;
  89.925 -+      default:
  89.926 -+	__ret = __wmask_type();
  89.927 -+      }
  89.928 -+    return __ret;
  89.929 -+  }
  89.930 -+  
  89.931 -+  wchar_t
  89.932 -+  ctype<wchar_t>::do_toupper(wchar_t __c) const
  89.933 -+  { return __towupper_l(__c, _M_c_locale_ctype); }
  89.934 -+
  89.935 -+  const wchar_t*
  89.936 -+  ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
  89.937 -+  {
  89.938 -+    while (__lo < __hi)
  89.939 -+      {
  89.940 -+        *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
  89.941 -+        ++__lo;
  89.942 -+      }
  89.943 -+    return __hi;
  89.944 -+  }
  89.945 -+  
  89.946 -+  wchar_t
  89.947 -+  ctype<wchar_t>::do_tolower(wchar_t __c) const
  89.948 -+  { return __towlower_l(__c, _M_c_locale_ctype); }
  89.949 -+  
  89.950 -+  const wchar_t*
  89.951 -+  ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
  89.952 -+  {
  89.953 -+    while (__lo < __hi)
  89.954 -+      {
  89.955 -+        *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
  89.956 -+        ++__lo;
  89.957 -+      }
  89.958 -+    return __hi;
  89.959 -+  }
  89.960 -+
  89.961 -+  bool
  89.962 -+  ctype<wchar_t>::
  89.963 -+  do_is(mask __m, wchar_t __c) const
  89.964 -+  { 
  89.965 -+    // Highest bitmask in ctype_base == 10, but extra in "C"
  89.966 -+    // library for blank.
  89.967 -+    bool __ret = false;
  89.968 -+    const size_t __bitmasksize = 11; 
  89.969 -+    for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
  89.970 -+      if (__m & _M_bit[__bitcur]
  89.971 -+	  && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
  89.972 -+	{
  89.973 -+	  __ret = true;
  89.974 -+	  break;
  89.975 -+	}
  89.976 -+    return __ret;    
  89.977 -+  }
  89.978 -+  
  89.979 -+  const wchar_t* 
  89.980 -+  ctype<wchar_t>::
  89.981 -+  do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
  89.982 -+  {
  89.983 -+    for (; __lo < __hi; ++__vec, ++__lo)
  89.984 -+      {
  89.985 -+	// Highest bitmask in ctype_base == 10, but extra in "C"
  89.986 -+	// library for blank.
  89.987 -+	const size_t __bitmasksize = 11; 
  89.988 -+	mask __m = 0;
  89.989 -+	for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
  89.990 -+	  if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
  89.991 -+	    __m |= _M_bit[__bitcur];
  89.992 -+	*__vec = __m;
  89.993 -+      }
  89.994 -+    return __hi;
  89.995 -+  }
  89.996 -+  
  89.997 -+  const wchar_t* 
  89.998 -+  ctype<wchar_t>::
  89.999 -+  do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
 89.1000 -+  {
 89.1001 -+    while (__lo < __hi && !this->do_is(__m, *__lo))
 89.1002 -+      ++__lo;
 89.1003 -+    return __lo;
 89.1004 -+  }
 89.1005 -+
 89.1006 -+  const wchar_t*
 89.1007 -+  ctype<wchar_t>::
 89.1008 -+  do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
 89.1009 -+  {
 89.1010 -+    while (__lo < __hi && this->do_is(__m, *__lo) != 0)
 89.1011 -+      ++__lo;
 89.1012 -+    return __lo;
 89.1013 -+  }
 89.1014 -+
 89.1015 -+  wchar_t
 89.1016 -+  ctype<wchar_t>::
 89.1017 -+  do_widen(char __c) const
 89.1018 -+  { return _M_widen[static_cast<unsigned char>(__c)]; }
 89.1019 -+
 89.1020 -+  const char* 
 89.1021 -+  ctype<wchar_t>::
 89.1022 -+  do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
 89.1023 -+  {
 89.1024 -+    while (__lo < __hi)
 89.1025 -+      {
 89.1026 -+	*__dest = _M_widen[static_cast<unsigned char>(*__lo)];
 89.1027 -+	++__lo;
 89.1028 -+	++__dest;
 89.1029 -+      }
 89.1030 -+    return __hi;
 89.1031 -+  }
 89.1032 -+
 89.1033 -+  char
 89.1034 -+  ctype<wchar_t>::
 89.1035 -+  do_narrow(wchar_t __wc, char __dfault) const
 89.1036 -+  {
 89.1037 -+    if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
 89.1038 -+      return _M_narrow[__wc];
 89.1039 -+#ifdef __UCLIBC_HAS_XLOCALE__
 89.1040 -+    __c_locale __old = __uselocale(_M_c_locale_ctype);
 89.1041 -+#endif
 89.1042 -+    const int __c = wctob(__wc);
 89.1043 -+#ifdef __UCLIBC_HAS_XLOCALE__
 89.1044 -+    __uselocale(__old);
 89.1045 -+#endif
 89.1046 -+    return (__c == EOF ? __dfault : static_cast<char>(__c)); 
 89.1047 -+  }
 89.1048 -+
 89.1049 -+  const wchar_t*
 89.1050 -+  ctype<wchar_t>::
 89.1051 -+  do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault, 
 89.1052 -+	    char* __dest) const
 89.1053 -+  {
 89.1054 -+#ifdef __UCLIBC_HAS_XLOCALE__
 89.1055 -+    __c_locale __old = __uselocale(_M_c_locale_ctype);
 89.1056 -+#endif
 89.1057 -+    if (_M_narrow_ok)
 89.1058 -+      while (__lo < __hi)
 89.1059 -+	{
 89.1060 -+	  if (*__lo >= 0 && *__lo < 128)
 89.1061 -+	    *__dest = _M_narrow[*__lo];
 89.1062 -+	  else
 89.1063 -+	    {
 89.1064 -+	      const int __c = wctob(*__lo);
 89.1065 -+	      *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
 89.1066 -+	    }
 89.1067 -+	  ++__lo;
 89.1068 -+	  ++__dest;
 89.1069 -+	}
 89.1070 -+    else
 89.1071 -+      while (__lo < __hi)
 89.1072 -+	{
 89.1073 -+	  const int __c = wctob(*__lo);
 89.1074 -+	  *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
 89.1075 -+	  ++__lo;
 89.1076 -+	  ++__dest;
 89.1077 -+	}
 89.1078 -+#ifdef __UCLIBC_HAS_XLOCALE__
 89.1079 -+    __uselocale(__old);
 89.1080 -+#endif
 89.1081 -+    return __hi;
 89.1082 -+  }
 89.1083 -+
 89.1084 -+  void
 89.1085 -+  ctype<wchar_t>::_M_initialize_ctype()
 89.1086 -+  {
 89.1087 -+#ifdef __UCLIBC_HAS_XLOCALE__
 89.1088 -+    __c_locale __old = __uselocale(_M_c_locale_ctype);
 89.1089 -+#endif
 89.1090 -+    wint_t __i;
 89.1091 -+    for (__i = 0; __i < 128; ++__i)
 89.1092 -+      {
 89.1093 -+	const int __c = wctob(__i);
 89.1094 -+	if (__c == EOF)
 89.1095 -+	  break;
 89.1096 -+	else
 89.1097 -+	  _M_narrow[__i] = static_cast<char>(__c);
 89.1098 -+      }
 89.1099 -+    if (__i == 128)
 89.1100 -+      _M_narrow_ok = true;
 89.1101 -+    else
 89.1102 -+      _M_narrow_ok = false;
 89.1103 -+    for (size_t __j = 0;
 89.1104 -+	 __j < sizeof(_M_widen) / sizeof(wint_t); ++__j)
 89.1105 -+      _M_widen[__j] = btowc(__j);
 89.1106 -+
 89.1107 -+    for (size_t __k = 0; __k <= 11; ++__k)
 89.1108 -+      { 
 89.1109 -+	_M_bit[__k] = static_cast<mask>(_ISbit(__k));
 89.1110 -+	_M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
 89.1111 -+      }
 89.1112 -+#ifdef __UCLIBC_HAS_XLOCALE__
 89.1113 -+    __uselocale(__old);
 89.1114 -+#endif
 89.1115 -+  }
 89.1116 -+#endif //  _GLIBCXX_USE_WCHAR_T
 89.1117 -+}
 89.1118 -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
 89.1119 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc	1970-01-01 01:00:00.000000000 +0100
 89.1120 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.cc	2008-06-10 14:45:35.000000000 +0200
 89.1121 -@@ -0,0 +1,100 @@
 89.1122 -+// std::messages implementation details, GNU version -*- C++ -*-
 89.1123 -+
 89.1124 -+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
 89.1125 -+//
 89.1126 -+// This file is part of the GNU ISO C++ Library.  This library is free
 89.1127 -+// software; you can redistribute it and/or modify it under the
 89.1128 -+// terms of the GNU General Public License as published by the
 89.1129 -+// Free Software Foundation; either version 2, or (at your option)
 89.1130 -+// any later version.
 89.1131 -+
 89.1132 -+// This library is distributed in the hope that it will be useful,
 89.1133 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 89.1134 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 89.1135 -+// GNU General Public License for more details.
 89.1136 -+
 89.1137 -+// You should have received a copy of the GNU General Public License along
 89.1138 -+// with this library; see the file COPYING.  If not, write to the Free
 89.1139 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 89.1140 -+// USA.
 89.1141 -+
 89.1142 -+// As a special exception, you may use this file as part of a free software
 89.1143 -+// library without restriction.  Specifically, if other files instantiate
 89.1144 -+// templates or use macros or inline functions from this file, or you compile
 89.1145 -+// this file and link it with other files to produce an executable, this
 89.1146 -+// file does not by itself cause the resulting executable to be covered by
 89.1147 -+// the GNU General Public License.  This exception does not however
 89.1148 -+// invalidate any other reasons why the executable file might be covered by
 89.1149 -+// the GNU General Public License.
 89.1150 -+
 89.1151 -+//
 89.1152 -+// ISO C++ 14882: 22.2.7.1.2  messages virtual functions
 89.1153 -+//
 89.1154 -+
 89.1155 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 89.1156 -+
 89.1157 -+#include <locale>
 89.1158 -+#include <bits/c++locale_internal.h>
 89.1159 -+
 89.1160 -+#ifdef __UCLIBC_MJN3_ONLY__
 89.1161 -+#warning fix gettext stuff
 89.1162 -+#endif
 89.1163 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 89.1164 -+extern "C" char *__dcgettext(const char *domainname,
 89.1165 -+			     const char *msgid, int category);
 89.1166 -+#undef gettext
 89.1167 -+#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
 89.1168 -+#else
 89.1169 -+#undef gettext
 89.1170 -+#define gettext(msgid) (msgid)
 89.1171 -+#endif
 89.1172 -+
 89.1173 -+namespace std
 89.1174 -+{
 89.1175 -+  // Specializations.
 89.1176 -+  template<>
 89.1177 -+    string
 89.1178 -+    messages<char>::do_get(catalog, int, int, const string& __dfault) const
 89.1179 -+    {
 89.1180 -+#ifdef __UCLIBC_HAS_XLOCALE__
 89.1181 -+      __c_locale __old = __uselocale(_M_c_locale_messages);
 89.1182 -+      const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
 89.1183 -+      __uselocale(__old);
 89.1184 -+      return string(__msg);
 89.1185 -+#elif defined __UCLIBC_HAS_LOCALE__
 89.1186 -+      char* __old = strdup(setlocale(LC_ALL, NULL));
 89.1187 -+      setlocale(LC_ALL, _M_name_messages);
 89.1188 -+      const char* __msg = gettext(__dfault.c_str());
 89.1189 -+      setlocale(LC_ALL, __old);
 89.1190 -+      free(__old);
 89.1191 -+      return string(__msg);
 89.1192 -+#else
 89.1193 -+      const char* __msg = gettext(__dfault.c_str());
 89.1194 -+      return string(__msg);
 89.1195 -+#endif
 89.1196 -+    }
 89.1197 -+
 89.1198 -+#ifdef _GLIBCXX_USE_WCHAR_T
 89.1199 -+  template<>
 89.1200 -+    wstring
 89.1201 -+    messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
 89.1202 -+    {
 89.1203 -+# ifdef __UCLIBC_HAS_XLOCALE__
 89.1204 -+      __c_locale __old = __uselocale(_M_c_locale_messages);
 89.1205 -+      char* __msg = gettext(_M_convert_to_char(__dfault));
 89.1206 -+      __uselocale(__old);
 89.1207 -+      return _M_convert_from_char(__msg);
 89.1208 -+# elif defined __UCLIBC_HAS_LOCALE__
 89.1209 -+      char* __old = strdup(setlocale(LC_ALL, NULL));
 89.1210 -+      setlocale(LC_ALL, _M_name_messages);
 89.1211 -+      char* __msg = gettext(_M_convert_to_char(__dfault));
 89.1212 -+      setlocale(LC_ALL, __old);
 89.1213 -+      free(__old);
 89.1214 -+      return _M_convert_from_char(__msg);
 89.1215 -+# else
 89.1216 -+      char* __msg = gettext(_M_convert_to_char(__dfault));
 89.1217 -+      return _M_convert_from_char(__msg);
 89.1218 -+# endif
 89.1219 -+    }
 89.1220 -+#endif
 89.1221 -+}
 89.1222 -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
 89.1223 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	1970-01-01 01:00:00.000000000 +0100
 89.1224 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:45:35.000000000 +0200
 89.1225 -@@ -0,0 +1,118 @@
 89.1226 -+// std::messages implementation details, GNU version -*- C++ -*-
 89.1227 -+
 89.1228 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 89.1229 -+//
 89.1230 -+// This file is part of the GNU ISO C++ Library.  This library is free
 89.1231 -+// software; you can redistribute it and/or modify it under the
 89.1232 -+// terms of the GNU General Public License as published by the
 89.1233 -+// Free Software Foundation; either version 2, or (at your option)
 89.1234 -+// any later version.
 89.1235 -+
 89.1236 -+// This library is distributed in the hope that it will be useful,
 89.1237 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 89.1238 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 89.1239 -+// GNU General Public License for more details.
 89.1240 -+
 89.1241 -+// You should have received a copy of the GNU General Public License along
 89.1242 -+// with this library; see the file COPYING.  If not, write to the Free
 89.1243 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 89.1244 -+// USA.
 89.1245 -+
 89.1246 -+// As a special exception, you may use this file as part of a free software
 89.1247 -+// library without restriction.  Specifically, if other files instantiate
 89.1248 -+// templates or use macros or inline functions from this file, or you compile
 89.1249 -+// this file and link it with other files to produce an executable, this
 89.1250 -+// file does not by itself cause the resulting executable to be covered by
 89.1251 -+// the GNU General Public License.  This exception does not however
 89.1252 -+// invalidate any other reasons why the executable file might be covered by
 89.1253 -+// the GNU General Public License.
 89.1254 -+
 89.1255 -+//
 89.1256 -+// ISO C++ 14882: 22.2.7.1.2  messages functions
 89.1257 -+//
 89.1258 -+
 89.1259 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 89.1260 -+
 89.1261 -+#ifdef __UCLIBC_MJN3_ONLY__
 89.1262 -+#warning fix prototypes for *textdomain funcs
 89.1263 -+#endif
 89.1264 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 89.1265 -+extern "C" char *__textdomain(const char *domainname);
 89.1266 -+extern "C" char *__bindtextdomain(const char *domainname,
 89.1267 -+				  const char *dirname);
 89.1268 -+#else
 89.1269 -+#undef __textdomain
 89.1270 -+#undef __bindtextdomain
 89.1271 -+#define __textdomain(D)           ((void)0)
 89.1272 -+#define __bindtextdomain(D,P)     ((void)0)
 89.1273 -+#endif
 89.1274 -+
 89.1275 -+  // Non-virtual member functions.
 89.1276 -+  template<typename _CharT>
 89.1277 -+     messages<_CharT>::messages(size_t __refs)
 89.1278 -+     : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), 
 89.1279 -+     _M_name_messages(_S_get_c_name())
 89.1280 -+     { }
 89.1281 -+
 89.1282 -+  template<typename _CharT>
 89.1283 -+     messages<_CharT>::messages(__c_locale __cloc, const char* __s, 
 89.1284 -+				size_t __refs) 
 89.1285 -+     : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
 89.1286 -+     _M_name_messages(__s)
 89.1287 -+     {
 89.1288 -+       char* __tmp = new char[std::strlen(__s) + 1];
 89.1289 -+       std::strcpy(__tmp, __s);
 89.1290 -+       _M_name_messages = __tmp;
 89.1291 -+     }
 89.1292 -+
 89.1293 -+  template<typename _CharT>
 89.1294 -+    typename messages<_CharT>::catalog 
 89.1295 -+    messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, 
 89.1296 -+			   const char* __dir) const
 89.1297 -+    { 
 89.1298 -+      __bindtextdomain(__s.c_str(), __dir);
 89.1299 -+      return this->do_open(__s, __loc); 
 89.1300 -+    }
 89.1301 -+
 89.1302 -+  // Virtual member functions.
 89.1303 -+  template<typename _CharT>
 89.1304 -+    messages<_CharT>::~messages()
 89.1305 -+    { 
 89.1306 -+      if (_M_name_messages != _S_get_c_name())
 89.1307 -+	delete [] _M_name_messages;
 89.1308 -+      _S_destroy_c_locale(_M_c_locale_messages); 
 89.1309 -+    }
 89.1310 -+
 89.1311 -+  template<typename _CharT>
 89.1312 -+    typename messages<_CharT>::catalog 
 89.1313 -+    messages<_CharT>::do_open(const basic_string<char>& __s, 
 89.1314 -+			      const locale&) const
 89.1315 -+    { 
 89.1316 -+      // No error checking is done, assume the catalog exists and can
 89.1317 -+      // be used.
 89.1318 -+      __textdomain(__s.c_str());
 89.1319 -+      return 0;
 89.1320 -+    }
 89.1321 -+
 89.1322 -+  template<typename _CharT>
 89.1323 -+    void    
 89.1324 -+    messages<_CharT>::do_close(catalog) const 
 89.1325 -+    { }
 89.1326 -+
 89.1327 -+   // messages_byname
 89.1328 -+   template<typename _CharT>
 89.1329 -+     messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
 89.1330 -+     : messages<_CharT>(__refs) 
 89.1331 -+     { 
 89.1332 -+       if (this->_M_name_messages != locale::facet::_S_get_c_name())
 89.1333 -+	 delete [] this->_M_name_messages;
 89.1334 -+       char* __tmp = new char[std::strlen(__s) + 1];
 89.1335 -+       std::strcpy(__tmp, __s);
 89.1336 -+       this->_M_name_messages = __tmp;
 89.1337 -+
 89.1338 -+       if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
 89.1339 -+	 {
 89.1340 -+	   this->_S_destroy_c_locale(this->_M_c_locale_messages);
 89.1341 -+	   this->_S_create_c_locale(this->_M_c_locale_messages, __s); 
 89.1342 -+	 }
 89.1343 -+     }
 89.1344 -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
 89.1345 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	1970-01-01 01:00:00.000000000 +0100
 89.1346 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:45:35.000000000 +0200
 89.1347 -@@ -0,0 +1,692 @@
 89.1348 -+// std::moneypunct implementation details, GNU version -*- C++ -*-
 89.1349 -+
 89.1350 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 89.1351 -+//
 89.1352 -+// This file is part of the GNU ISO C++ Library.  This library is free
 89.1353 -+// software; you can redistribute it and/or modify it under the
 89.1354 -+// terms of the GNU General Public License as published by the
 89.1355 -+// Free Software Foundation; either version 2, or (at your option)
 89.1356 -+// any later version.
 89.1357 -+
 89.1358 -+// This library is distributed in the hope that it will be useful,
 89.1359 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 89.1360 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 89.1361 -+// GNU General Public License for more details.
 89.1362 -+
 89.1363 -+// You should have received a copy of the GNU General Public License along
 89.1364 -+// with this library; see the file COPYING.  If not, write to the Free
 89.1365 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 89.1366 -+// USA.
 89.1367 -+
 89.1368 -+// As a special exception, you may use this file as part of a free software
 89.1369 -+// library without restriction.  Specifically, if other files instantiate
 89.1370 -+// templates or use macros or inline functions from this file, or you compile
 89.1371 -+// this file and link it with other files to produce an executable, this
 89.1372 -+// file does not by itself cause the resulting executable to be covered by
 89.1373 -+// the GNU General Public License.  This exception does not however
 89.1374 -+// invalidate any other reasons why the executable file might be covered by
 89.1375 -+// the GNU General Public License.
 89.1376 -+
 89.1377 -+//
 89.1378 -+// ISO C++ 14882: 22.2.6.3.2  moneypunct virtual functions
 89.1379 -+//
 89.1380 -+
 89.1381 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 89.1382 -+
 89.1383 -+#define _LIBC
 89.1384 -+#include <locale>
 89.1385 -+#undef _LIBC
 89.1386 -+#include <bits/c++locale_internal.h>
 89.1387 -+
 89.1388 -+#ifdef __UCLIBC_MJN3_ONLY__
 89.1389 -+#warning optimize this for uclibc
 89.1390 -+#warning tailor for stub locale support
 89.1391 -+#endif
 89.1392 -+
 89.1393 -+#ifndef __UCLIBC_HAS_XLOCALE__
 89.1394 -+#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 89.1395 -+#endif
 89.1396 -+
 89.1397 -+namespace std
 89.1398 -+{
 89.1399 -+  // Construct and return valid pattern consisting of some combination of:
 89.1400 -+  // space none symbol sign value
 89.1401 -+  money_base::pattern
 89.1402 -+  money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
 89.1403 -+  { 
 89.1404 -+    pattern __ret;
 89.1405 -+
 89.1406 -+    // This insanely complicated routine attempts to construct a valid
 89.1407 -+    // pattern for use with monyepunct. A couple of invariants:
 89.1408 -+
 89.1409 -+    // if (__precedes) symbol -> value
 89.1410 -+    // else value -> symbol
 89.1411 -+    
 89.1412 -+    // if (__space) space
 89.1413 -+    // else none
 89.1414 -+
 89.1415 -+    // none == never first
 89.1416 -+    // space never first or last
 89.1417 -+
 89.1418 -+    // Any elegant implementations of this are welcome.
 89.1419 -+    switch (__posn)
 89.1420 -+      {
 89.1421 -+      case 0:
 89.1422 -+      case 1:
 89.1423 -+	// 1 The sign precedes the value and symbol.
 89.1424 -+	__ret.field[0] = sign;
 89.1425 -+	if (__space)
 89.1426 -+	  {
 89.1427 -+	    // Pattern starts with sign.
 89.1428 -+	    if (__precedes)
 89.1429 -+	      {
 89.1430 -+		__ret.field[1] = symbol;
 89.1431 -+		__ret.field[3] = value;
 89.1432 -+	      }
 89.1433 -+	    else
 89.1434 -+	      {
 89.1435 -+		__ret.field[1] = value;
 89.1436 -+		__ret.field[3] = symbol;
 89.1437 -+	      }
 89.1438 -+	    __ret.field[2] = space;
 89.1439 -+	  }
 89.1440 -+	else
 89.1441 -+	  {
 89.1442 -+	    // Pattern starts with sign and ends with none.
 89.1443 -+	    if (__precedes)
 89.1444 -+	      {
 89.1445 -+		__ret.field[1] = symbol;
 89.1446 -+		__ret.field[2] = value;
 89.1447 -+	      }
 89.1448 -+	    else
 89.1449 -+	      {
 89.1450 -+		__ret.field[1] = value;
 89.1451 -+		__ret.field[2] = symbol;
 89.1452 -+	      }
 89.1453 -+	    __ret.field[3] = none;
 89.1454 -+	  }
 89.1455 -+	break;
 89.1456 -+      case 2:
 89.1457 -+	// 2 The sign follows the value and symbol.
 89.1458 -+	if (__space)
 89.1459 -+	  {
 89.1460 -+	    // Pattern either ends with sign.
 89.1461 -+	    if (__precedes)
 89.1462 -+	      {
 89.1463 -+		__ret.field[0] = symbol;
 89.1464 -+		__ret.field[2] = value;
 89.1465 -+	      }
 89.1466 -+	    else
 89.1467 -+	      {
 89.1468 -+		__ret.field[0] = value;
 89.1469 -+		__ret.field[2] = symbol;
 89.1470 -+	      }
 89.1471 -+	    __ret.field[1] = space;
 89.1472 -+	    __ret.field[3] = sign;
 89.1473 -+	  }
 89.1474 -+	else
 89.1475 -+	  {
 89.1476 -+	    // Pattern ends with sign then none.
 89.1477 -+	    if (__precedes)
 89.1478 -+	      {
 89.1479 -+		__ret.field[0] = symbol;
 89.1480 -+		__ret.field[1] = value;
 89.1481 -+	      }
 89.1482 -+	    else
 89.1483 -+	      {
 89.1484 -+		__ret.field[0] = value;
 89.1485 -+		__ret.field[1] = symbol;
 89.1486 -+	      }
 89.1487 -+	    __ret.field[2] = sign;
 89.1488 -+	    __ret.field[3] = none;
 89.1489 -+	  }
 89.1490 -+	break;
 89.1491 -+      case 3:
 89.1492 -+	// 3 The sign immediately precedes the symbol.
 89.1493 -+	if (__precedes)
 89.1494 -+	  {
 89.1495 -+	    __ret.field[0] = sign;
 89.1496 -+	    __ret.field[1] = symbol;	    
 89.1497 -+	    if (__space)
 89.1498 -+	      {
 89.1499 -+		__ret.field[2] = space;
 89.1500 -+		__ret.field[3] = value;
 89.1501 -+	      }
 89.1502 -+	    else
 89.1503 -+	      {
 89.1504 -+		__ret.field[2] = value;		
 89.1505 -+		__ret.field[3] = none;
 89.1506 -+	      }
 89.1507 -+	  }
 89.1508 -+	else
 89.1509 -+	  {
 89.1510 -+	    __ret.field[0] = value;
 89.1511 -+	    if (__space)
 89.1512 -+	      {
 89.1513 -+		__ret.field[1] = space;
 89.1514 -+		__ret.field[2] = sign;
 89.1515 -+		__ret.field[3] = symbol;
 89.1516 -+	      }
 89.1517 -+	    else
 89.1518 -+	      {
 89.1519 -+		__ret.field[1] = sign;
 89.1520 -+		__ret.field[2] = symbol;
 89.1521 -+		__ret.field[3] = none;
 89.1522 -+	      }
 89.1523 -+	  }
 89.1524 -+	break;
 89.1525 -+      case 4:
 89.1526 -+	// 4 The sign immediately follows the symbol.
 89.1527 -+	if (__precedes)
 89.1528 -+	  {
 89.1529 -+	    __ret.field[0] = symbol;
 89.1530 -+	    __ret.field[1] = sign;
 89.1531 -+	    if (__space)
 89.1532 -+	      {
 89.1533 -+		__ret.field[2] = space;
 89.1534 -+		__ret.field[3] = value;
 89.1535 -+	      }
 89.1536 -+	    else
 89.1537 -+	      {
 89.1538 -+		__ret.field[2] = value;
 89.1539 -+		__ret.field[3] = none;
 89.1540 -+	      }
 89.1541 -+	  }
 89.1542 -+	else
 89.1543 -+	  {
 89.1544 -+	    __ret.field[0] = value;
 89.1545 -+	    if (__space)
 89.1546 -+	      {
 89.1547 -+		__ret.field[1] = space;
 89.1548 -+		__ret.field[2] = symbol;
 89.1549 -+		__ret.field[3] = sign;
 89.1550 -+	      }
 89.1551 -+	    else
 89.1552 -+	      {
 89.1553 -+		__ret.field[1] = symbol;
 89.1554 -+		__ret.field[2] = sign;
 89.1555 -+		__ret.field[3] = none;
 89.1556 -+	      }
 89.1557 -+	  }
 89.1558 -+	break;
 89.1559 -+      default:
 89.1560 -+	;
 89.1561 -+      }
 89.1562 -+    return __ret;
 89.1563 -+  }
 89.1564 -+
 89.1565 -+  template<> 
 89.1566 -+    void
 89.1567 -+    moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc, 
 89.1568 -+						     const char*)
 89.1569 -+    {
 89.1570 -+      if (!_M_data)
 89.1571 -+	_M_data = new __moneypunct_cache<char, true>;
 89.1572 -+
 89.1573 -+      if (!__cloc)
 89.1574 -+	{
 89.1575 -+	  // "C" locale
 89.1576 -+	  _M_data->_M_decimal_point = '.';
 89.1577 -+	  _M_data->_M_thousands_sep = ',';
 89.1578 -+	  _M_data->_M_grouping = "";
 89.1579 -+	  _M_data->_M_grouping_size = 0;
 89.1580 -+	  _M_data->_M_curr_symbol = "";
 89.1581 -+	  _M_data->_M_curr_symbol_size = 0;
 89.1582 -+	  _M_data->_M_positive_sign = "";
 89.1583 -+	  _M_data->_M_positive_sign_size = 0;
 89.1584 -+	  _M_data->_M_negative_sign = "";
 89.1585 -+	  _M_data->_M_negative_sign_size = 0;
 89.1586 -+	  _M_data->_M_frac_digits = 0;
 89.1587 -+	  _M_data->_M_pos_format = money_base::_S_default_pattern;
 89.1588 -+	  _M_data->_M_neg_format = money_base::_S_default_pattern;
 89.1589 -+
 89.1590 -+	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
 89.1591 -+	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
 89.1592 -+	}
 89.1593 -+      else
 89.1594 -+	{
 89.1595 -+	  // Named locale.
 89.1596 -+	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
 89.1597 -+							__cloc));
 89.1598 -+	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
 89.1599 -+							__cloc));
 89.1600 -+	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
 89.1601 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
 89.1602 -+	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
 89.1603 -+	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
 89.1604 -+
 89.1605 -+	  char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
 89.1606 -+	  if (!__nposn)
 89.1607 -+	    _M_data->_M_negative_sign = "()";
 89.1608 -+	  else
 89.1609 -+	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, 
 89.1610 -+							__cloc);
 89.1611 -+	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
 89.1612 -+
 89.1613 -+	  // _Intl == true
 89.1614 -+	  _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
 89.1615 -+	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
 89.1616 -+	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
 89.1617 -+						      __cloc));
 89.1618 -+	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
 89.1619 -+	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
 89.1620 -+	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
 89.1621 -+	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
 89.1622 -+							__pposn);
 89.1623 -+	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
 89.1624 -+	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
 89.1625 -+	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
 89.1626 -+							__nposn);
 89.1627 -+	}
 89.1628 -+    }
 89.1629 -+
 89.1630 -+  template<> 
 89.1631 -+    void
 89.1632 -+    moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc, 
 89.1633 -+						      const char*)
 89.1634 -+    {
 89.1635 -+      if (!_M_data)
 89.1636 -+	_M_data = new __moneypunct_cache<char, false>;
 89.1637 -+
 89.1638 -+      if (!__cloc)
 89.1639 -+	{
 89.1640 -+	  // "C" locale
 89.1641 -+	  _M_data->_M_decimal_point = '.';
 89.1642 -+	  _M_data->_M_thousands_sep = ',';
 89.1643 -+	  _M_data->_M_grouping = "";
 89.1644 -+	  _M_data->_M_grouping_size = 0;
 89.1645 -+	  _M_data->_M_curr_symbol = "";
 89.1646 -+	  _M_data->_M_curr_symbol_size = 0;
 89.1647 -+	  _M_data->_M_positive_sign = "";
 89.1648 -+	  _M_data->_M_positive_sign_size = 0;
 89.1649 -+	  _M_data->_M_negative_sign = "";
 89.1650 -+	  _M_data->_M_negative_sign_size = 0;
 89.1651 -+	  _M_data->_M_frac_digits = 0;
 89.1652 -+	  _M_data->_M_pos_format = money_base::_S_default_pattern;
 89.1653 -+	  _M_data->_M_neg_format = money_base::_S_default_pattern;
 89.1654 -+
 89.1655 -+	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
 89.1656 -+	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
 89.1657 -+	}
 89.1658 -+      else
 89.1659 -+	{
 89.1660 -+	  // Named locale.
 89.1661 -+	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
 89.1662 -+							__cloc));
 89.1663 -+	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
 89.1664 -+							__cloc));
 89.1665 -+	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
 89.1666 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
 89.1667 -+	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
 89.1668 -+	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
 89.1669 -+
 89.1670 -+	  char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
 89.1671 -+	  if (!__nposn)
 89.1672 -+	    _M_data->_M_negative_sign = "()";
 89.1673 -+	  else
 89.1674 -+	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
 89.1675 -+							__cloc);
 89.1676 -+	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
 89.1677 -+
 89.1678 -+	  // _Intl == false
 89.1679 -+	  _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
 89.1680 -+	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
 89.1681 -+	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
 89.1682 -+	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
 89.1683 -+	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
 89.1684 -+	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
 89.1685 -+	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
 89.1686 -+							__pposn);
 89.1687 -+	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
 89.1688 -+	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
 89.1689 -+	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
 89.1690 -+							__nposn);
 89.1691 -+	}
 89.1692 -+    }
 89.1693 -+
 89.1694 -+  template<> 
 89.1695 -+    moneypunct<char, true>::~moneypunct()
 89.1696 -+    { delete _M_data; }
 89.1697 -+
 89.1698 -+  template<> 
 89.1699 -+    moneypunct<char, false>::~moneypunct()
 89.1700 -+    { delete _M_data; }
 89.1701 -+
 89.1702 -+#ifdef _GLIBCXX_USE_WCHAR_T
 89.1703 -+  template<> 
 89.1704 -+    void
 89.1705 -+    moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc, 
 89.1706 -+#ifdef __UCLIBC_HAS_XLOCALE__
 89.1707 -+							const char*)
 89.1708 -+#else
 89.1709 -+							const char* __name)
 89.1710 -+#endif
 89.1711 -+    {
 89.1712 -+      if (!_M_data)
 89.1713 -+	_M_data = new __moneypunct_cache<wchar_t, true>;
 89.1714 -+
 89.1715 -+      if (!__cloc)
 89.1716 -+	{
 89.1717 -+	  // "C" locale
 89.1718 -+	  _M_data->_M_decimal_point = L'.';
 89.1719 -+	  _M_data->_M_thousands_sep = L',';
 89.1720 -+	  _M_data->_M_grouping = "";
 89.1721 -+	  _M_data->_M_grouping_size = 0;
 89.1722 -+	  _M_data->_M_curr_symbol = L"";
 89.1723 -+	  _M_data->_M_curr_symbol_size = 0;
 89.1724 -+	  _M_data->_M_positive_sign = L"";
 89.1725 -+	  _M_data->_M_positive_sign_size = 0;
 89.1726 -+	  _M_data->_M_negative_sign = L"";
 89.1727 -+	  _M_data->_M_negative_sign_size = 0;
 89.1728 -+	  _M_data->_M_frac_digits = 0;
 89.1729 -+	  _M_data->_M_pos_format = money_base::_S_default_pattern;
 89.1730 -+	  _M_data->_M_neg_format = money_base::_S_default_pattern;
 89.1731 -+
 89.1732 -+	  // Use ctype::widen code without the facet...
 89.1733 -+	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
 89.1734 -+	    _M_data->_M_atoms[__i] =
 89.1735 -+	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
 89.1736 -+	}
 89.1737 -+      else
 89.1738 -+	{
 89.1739 -+	  // Named locale.
 89.1740 -+#ifdef __UCLIBC_HAS_XLOCALE__
 89.1741 -+	  __c_locale __old = __uselocale(__cloc);
 89.1742 -+#else
 89.1743 -+	  // Switch to named locale so that mbsrtowcs will work.
 89.1744 -+	  char* __old = strdup(setlocale(LC_ALL, NULL));
 89.1745 -+	  setlocale(LC_ALL, __name);
 89.1746 -+#endif
 89.1747 -+
 89.1748 -+#ifdef __UCLIBC_MJN3_ONLY__
 89.1749 -+#warning fix this... should be monetary
 89.1750 -+#endif
 89.1751 -+#ifdef __UCLIBC__
 89.1752 -+# ifdef __UCLIBC_HAS_XLOCALE__
 89.1753 -+	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
 89.1754 -+	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
 89.1755 -+# else
 89.1756 -+	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
 89.1757 -+	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
 89.1758 -+# endif
 89.1759 -+#else
 89.1760 -+	  union { char *__s; wchar_t __w; } __u;
 89.1761 -+	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
 89.1762 -+	  _M_data->_M_decimal_point = __u.__w;
 89.1763 -+
 89.1764 -+	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
 89.1765 -+	  _M_data->_M_thousands_sep = __u.__w;
 89.1766 -+#endif
 89.1767 -+	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
 89.1768 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
 89.1769 -+
 89.1770 -+	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
 89.1771 -+	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
 89.1772 -+	  const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
 89.1773 -+
 89.1774 -+	  wchar_t* __wcs_ps = 0;
 89.1775 -+	  wchar_t* __wcs_ns = 0;
 89.1776 -+	  const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
 89.1777 -+	  try
 89.1778 -+	    {
 89.1779 -+	      mbstate_t __state;
 89.1780 -+	      size_t __len = strlen(__cpossign);
 89.1781 -+	      if (__len)
 89.1782 -+		{
 89.1783 -+		  ++__len;
 89.1784 -+		  memset(&__state, 0, sizeof(mbstate_t));
 89.1785 -+		  __wcs_ps = new wchar_t[__len];
 89.1786 -+		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
 89.1787 -+		  _M_data->_M_positive_sign = __wcs_ps;
 89.1788 -+		}
 89.1789 -+	      else
 89.1790 -+		_M_data->_M_positive_sign = L"";
 89.1791 -+	      _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
 89.1792 -+	      
 89.1793 -+	      __len = strlen(__cnegsign);
 89.1794 -+	      if (!__nposn)
 89.1795 -+		_M_data->_M_negative_sign = L"()";
 89.1796 -+	      else if (__len)
 89.1797 -+		{ 
 89.1798 -+		  ++__len;
 89.1799 -+		  memset(&__state, 0, sizeof(mbstate_t));
 89.1800 -+		  __wcs_ns = new wchar_t[__len];
 89.1801 -+		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
 89.1802 -+		  _M_data->_M_negative_sign = __wcs_ns;
 89.1803 -+		}
 89.1804 -+	      else
 89.1805 -+		_M_data->_M_negative_sign = L"";
 89.1806 -+	      _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
 89.1807 -+	      
 89.1808 -+	      // _Intl == true.
 89.1809 -+	      __len = strlen(__ccurr);
 89.1810 -+	      if (__len)
 89.1811 -+		{
 89.1812 -+		  ++__len;
 89.1813 -+		  memset(&__state, 0, sizeof(mbstate_t));
 89.1814 -+		  wchar_t* __wcs = new wchar_t[__len];
 89.1815 -+		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
 89.1816 -+		  _M_data->_M_curr_symbol = __wcs;
 89.1817 -+		}
 89.1818 -+	      else
 89.1819 -+		_M_data->_M_curr_symbol = L"";
 89.1820 -+	      _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
 89.1821 -+	    }
 89.1822 -+	  catch (...)
 89.1823 -+	    {
 89.1824 -+	      delete _M_data;
 89.1825 -+	      _M_data = 0;
 89.1826 -+	      delete __wcs_ps;
 89.1827 -+	      delete __wcs_ns;	      
 89.1828 -+#ifdef __UCLIBC_HAS_XLOCALE__
 89.1829 -+	      __uselocale(__old);
 89.1830 -+#else
 89.1831 -+	      setlocale(LC_ALL, __old);
 89.1832 -+	      free(__old);
 89.1833 -+#endif
 89.1834 -+	      __throw_exception_again;
 89.1835 -+	    } 
 89.1836 -+	  
 89.1837 -+	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
 89.1838 -+						      __cloc));
 89.1839 -+	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
 89.1840 -+	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
 89.1841 -+	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
 89.1842 -+	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
 89.1843 -+							__pposn);
 89.1844 -+	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
 89.1845 -+	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
 89.1846 -+	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
 89.1847 -+							__nposn);
 89.1848 -+
 89.1849 -+#ifdef __UCLIBC_HAS_XLOCALE__
 89.1850 -+	  __uselocale(__old);
 89.1851 -+#else
 89.1852 -+	  setlocale(LC_ALL, __old);
 89.1853 -+	  free(__old);
 89.1854 -+#endif
 89.1855 -+	}
 89.1856 -+    }
 89.1857 -+
 89.1858 -+  template<> 
 89.1859 -+  void
 89.1860 -+  moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
 89.1861 -+#ifdef __UCLIBC_HAS_XLOCALE__
 89.1862 -+						       const char*)
 89.1863 -+#else
 89.1864 -+                                                       const char* __name)
 89.1865 -+#endif
 89.1866 -+  {
 89.1867 -+    if (!_M_data)
 89.1868 -+      _M_data = new __moneypunct_cache<wchar_t, false>;
 89.1869 -+
 89.1870 -+    if (!__cloc)
 89.1871 -+	{
 89.1872 -+	  // "C" locale
 89.1873 -+	  _M_data->_M_decimal_point = L'.';
 89.1874 -+	  _M_data->_M_thousands_sep = L',';
 89.1875 -+	  _M_data->_M_grouping = "";
 89.1876 -+          _M_data->_M_grouping_size = 0;
 89.1877 -+	  _M_data->_M_curr_symbol = L"";
 89.1878 -+	  _M_data->_M_curr_symbol_size = 0;
 89.1879 -+	  _M_data->_M_positive_sign = L"";
 89.1880 -+	  _M_data->_M_positive_sign_size = 0;
 89.1881 -+	  _M_data->_M_negative_sign = L"";
 89.1882 -+	  _M_data->_M_negative_sign_size = 0;
 89.1883 -+	  _M_data->_M_frac_digits = 0;
 89.1884 -+	  _M_data->_M_pos_format = money_base::_S_default_pattern;
 89.1885 -+	  _M_data->_M_neg_format = money_base::_S_default_pattern;
 89.1886 -+
 89.1887 -+	  // Use ctype::widen code without the facet...
 89.1888 -+	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
 89.1889 -+	    _M_data->_M_atoms[__i] =
 89.1890 -+	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
 89.1891 -+	}
 89.1892 -+      else
 89.1893 -+	{
 89.1894 -+	  // Named locale.
 89.1895 -+#ifdef __UCLIBC_HAS_XLOCALE__
 89.1896 -+	  __c_locale __old = __uselocale(__cloc);
 89.1897 -+#else
 89.1898 -+	  // Switch to named locale so that mbsrtowcs will work.
 89.1899 -+	  char* __old = strdup(setlocale(LC_ALL, NULL));
 89.1900 -+	  setlocale(LC_ALL, __name);
 89.1901 -+#endif
 89.1902 -+
 89.1903 -+#ifdef __UCLIBC_MJN3_ONLY__
 89.1904 -+#warning fix this... should be monetary
 89.1905 -+#endif
 89.1906 -+#ifdef __UCLIBC__
 89.1907 -+# ifdef __UCLIBC_HAS_XLOCALE__
 89.1908 -+	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
 89.1909 -+	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
 89.1910 -+# else
 89.1911 -+	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
 89.1912 -+	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
 89.1913 -+# endif
 89.1914 -+#else
 89.1915 -+          union { char *__s; wchar_t __w; } __u;
 89.1916 -+	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
 89.1917 -+	  _M_data->_M_decimal_point = __u.__w;
 89.1918 -+
 89.1919 -+	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
 89.1920 -+	  _M_data->_M_thousands_sep = __u.__w;
 89.1921 -+#endif
 89.1922 -+	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
 89.1923 -+          _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
 89.1924 -+
 89.1925 -+	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
 89.1926 -+	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
 89.1927 -+	  const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
 89.1928 -+
 89.1929 -+	  wchar_t* __wcs_ps = 0;
 89.1930 -+	  wchar_t* __wcs_ns = 0;
 89.1931 -+	  const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
 89.1932 -+	  try
 89.1933 -+            {
 89.1934 -+              mbstate_t __state;
 89.1935 -+              size_t __len;
 89.1936 -+              __len = strlen(__cpossign);
 89.1937 -+              if (__len)
 89.1938 -+                {
 89.1939 -+		  ++__len;
 89.1940 -+		  memset(&__state, 0, sizeof(mbstate_t));
 89.1941 -+		  __wcs_ps = new wchar_t[__len];
 89.1942 -+		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
 89.1943 -+		  _M_data->_M_positive_sign = __wcs_ps;
 89.1944 -+		}
 89.1945 -+	      else
 89.1946 -+		_M_data->_M_positive_sign = L"";
 89.1947 -+              _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
 89.1948 -+	      
 89.1949 -+	      __len = strlen(__cnegsign);
 89.1950 -+	      if (!__nposn)
 89.1951 -+		_M_data->_M_negative_sign = L"()";
 89.1952 -+	      else if (__len)
 89.1953 -+		{ 
 89.1954 -+		  ++__len;
 89.1955 -+		  memset(&__state, 0, sizeof(mbstate_t));
 89.1956 -+		  __wcs_ns = new wchar_t[__len];
 89.1957 -+		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
 89.1958 -+		  _M_data->_M_negative_sign = __wcs_ns;
 89.1959 -+		}
 89.1960 -+	      else
 89.1961 -+		_M_data->_M_negative_sign = L"";
 89.1962 -+              _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
 89.1963 -+
 89.1964 -+	      // _Intl == true.
 89.1965 -+	      __len = strlen(__ccurr);
 89.1966 -+	      if (__len)
 89.1967 -+		{
 89.1968 -+		  ++__len;
 89.1969 -+		  memset(&__state, 0, sizeof(mbstate_t));
 89.1970 -+		  wchar_t* __wcs = new wchar_t[__len];
 89.1971 -+		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
 89.1972 -+		  _M_data->_M_curr_symbol = __wcs;
 89.1973 -+		}
 89.1974 -+	      else
 89.1975 -+		_M_data->_M_curr_symbol = L"";
 89.1976 -+              _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
 89.1977 -+	    }
 89.1978 -+          catch (...)
 89.1979 -+	    {
 89.1980 -+	      delete _M_data;
 89.1981 -+              _M_data = 0;
 89.1982 -+	      delete __wcs_ps;
 89.1983 -+	      delete __wcs_ns;	      
 89.1984 -+#ifdef __UCLIBC_HAS_XLOCALE__
 89.1985 -+	      __uselocale(__old);
 89.1986 -+#else
 89.1987 -+	      setlocale(LC_ALL, __old);
 89.1988 -+	      free(__old);
 89.1989 -+#endif
 89.1990 -+              __throw_exception_again;
 89.1991 -+	    }
 89.1992 -+
 89.1993 -+	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
 89.1994 -+	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
 89.1995 -+	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
 89.1996 -+	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
 89.1997 -+	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
 89.1998 -+	                                                __pposn);
 89.1999 -+	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
 89.2000 -+	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
 89.2001 -+	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
 89.2002 -+	                                                __nposn);
 89.2003 -+
 89.2004 -+#ifdef __UCLIBC_HAS_XLOCALE__
 89.2005 -+	  __uselocale(__old);
 89.2006 -+#else
 89.2007 -+	  setlocale(LC_ALL, __old);
 89.2008 -+	  free(__old);
 89.2009 -+#endif
 89.2010 -+	}
 89.2011 -+    }
 89.2012 -+
 89.2013 -+  template<> 
 89.2014 -+    moneypunct<wchar_t, true>::~moneypunct()
 89.2015 -+    {
 89.2016 -+      if (_M_data->_M_positive_sign_size)
 89.2017 -+	delete [] _M_data->_M_positive_sign;
 89.2018 -+      if (_M_data->_M_negative_sign_size
 89.2019 -+          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
 89.2020 -+	delete [] _M_data->_M_negative_sign;
 89.2021 -+      if (_M_data->_M_curr_symbol_size)
 89.2022 -+	delete [] _M_data->_M_curr_symbol;
 89.2023 -+      delete _M_data;
 89.2024 -+    }
 89.2025 -+
 89.2026 -+  template<> 
 89.2027 -+    moneypunct<wchar_t, false>::~moneypunct()
 89.2028 -+    {
 89.2029 -+      if (_M_data->_M_positive_sign_size)
 89.2030 -+	delete [] _M_data->_M_positive_sign;
 89.2031 -+      if (_M_data->_M_negative_sign_size
 89.2032 -+          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
 89.2033 -+	delete [] _M_data->_M_negative_sign;
 89.2034 -+      if (_M_data->_M_curr_symbol_size)
 89.2035 -+	delete [] _M_data->_M_curr_symbol;
 89.2036 -+      delete _M_data;
 89.2037 -+    }
 89.2038 -+#endif
 89.2039 -+}
 89.2040 -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
 89.2041 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	1970-01-01 01:00:00.000000000 +0100
 89.2042 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:45:35.000000000 +0200
 89.2043 -@@ -0,0 +1,160 @@
 89.2044 -+// std::numpunct implementation details, GNU version -*- C++ -*-
 89.2045 -+
 89.2046 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 89.2047 -+//
 89.2048 -+// This file is part of the GNU ISO C++ Library.  This library is free
 89.2049 -+// software; you can redistribute it and/or modify it under the
 89.2050 -+// terms of the GNU General Public License as published by the
 89.2051 -+// Free Software Foundation; either version 2, or (at your option)
 89.2052 -+// any later version.
 89.2053 -+
 89.2054 -+// This library is distributed in the hope that it will be useful,
 89.2055 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 89.2056 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 89.2057 -+// GNU General Public License for more details.
 89.2058 -+
 89.2059 -+// You should have received a copy of the GNU General Public License along
 89.2060 -+// with this library; see the file COPYING.  If not, write to the Free
 89.2061 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 89.2062 -+// USA.
 89.2063 -+
 89.2064 -+// As a special exception, you may use this file as part of a free software
 89.2065 -+// library without restriction.  Specifically, if other files instantiate
 89.2066 -+// templates or use macros or inline functions from this file, or you compile
 89.2067 -+// this file and link it with other files to produce an executable, this
 89.2068 -+// file does not by itself cause the resulting executable to be covered by
 89.2069 -+// the GNU General Public License.  This exception does not however
 89.2070 -+// invalidate any other reasons why the executable file might be covered by
 89.2071 -+// the GNU General Public License.
 89.2072 -+
 89.2073 -+//
 89.2074 -+// ISO C++ 14882: 22.2.3.1.2  numpunct virtual functions
 89.2075 -+//
 89.2076 -+
 89.2077 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 89.2078 -+
 89.2079 -+#define _LIBC
 89.2080 -+#include <locale>
 89.2081 -+#undef _LIBC
 89.2082 -+#include <bits/c++locale_internal.h>
 89.2083 -+
 89.2084 -+#ifdef __UCLIBC_MJN3_ONLY__
 89.2085 -+#warning tailor for stub locale support
 89.2086 -+#endif
 89.2087 -+#ifndef __UCLIBC_HAS_XLOCALE__
 89.2088 -+#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 89.2089 -+#endif
 89.2090 -+
 89.2091 -+namespace std
 89.2092 -+{
 89.2093 -+  template<> 
 89.2094 -+    void
 89.2095 -+    numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
 89.2096 -+    {
 89.2097 -+      if (!_M_data)
 89.2098 -+	_M_data = new __numpunct_cache<char>;
 89.2099 -+
 89.2100 -+      if (!__cloc)
 89.2101 -+	{
 89.2102 -+	  // "C" locale
 89.2103 -+	  _M_data->_M_grouping = "";
 89.2104 -+	  _M_data->_M_grouping_size = 0;
 89.2105 -+	  _M_data->_M_use_grouping = false;
 89.2106 -+
 89.2107 -+	  _M_data->_M_decimal_point = '.';
 89.2108 -+	  _M_data->_M_thousands_sep = ',';
 89.2109 -+
 89.2110 -+	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
 89.2111 -+	    _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
 89.2112 -+
 89.2113 -+	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
 89.2114 -+	    _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j];
 89.2115 -+	}
 89.2116 -+      else
 89.2117 -+	{
 89.2118 -+	  // Named locale.
 89.2119 -+	  _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT, 
 89.2120 -+							__cloc));
 89.2121 -+	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP, 
 89.2122 -+							__cloc));
 89.2123 -+
 89.2124 -+	  // Check for NULL, which implies no grouping.
 89.2125 -+	  if (_M_data->_M_thousands_sep == '\0')
 89.2126 -+	    _M_data->_M_grouping = "";
 89.2127 -+	  else
 89.2128 -+	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
 89.2129 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
 89.2130 -+	}
 89.2131 -+
 89.2132 -+      // NB: There is no way to extact this info from posix locales.
 89.2133 -+      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
 89.2134 -+      _M_data->_M_truename = "true";
 89.2135 -+      _M_data->_M_truename_size = 4;
 89.2136 -+      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
 89.2137 -+      _M_data->_M_falsename = "false";
 89.2138 -+      _M_data->_M_falsename_size = 5;
 89.2139 -+    }
 89.2140 -+ 
 89.2141 -+  template<> 
 89.2142 -+    numpunct<char>::~numpunct()
 89.2143 -+    { delete _M_data; }
 89.2144 -+   
 89.2145 -+#ifdef _GLIBCXX_USE_WCHAR_T
 89.2146 -+  template<> 
 89.2147 -+    void
 89.2148 -+    numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
 89.2149 -+    {
 89.2150 -+      if (!_M_data)
 89.2151 -+	_M_data = new __numpunct_cache<wchar_t>;
 89.2152 -+
 89.2153 -+      if (!__cloc)
 89.2154 -+	{
 89.2155 -+	  // "C" locale
 89.2156 -+	  _M_data->_M_grouping = "";
 89.2157 -+	  _M_data->_M_grouping_size = 0;
 89.2158 -+	  _M_data->_M_use_grouping = false;
 89.2159 -+
 89.2160 -+	  _M_data->_M_decimal_point = L'.';
 89.2161 -+	  _M_data->_M_thousands_sep = L',';
 89.2162 -+
 89.2163 -+	  // Use ctype::widen code without the facet...
 89.2164 -+	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
 89.2165 -+	    _M_data->_M_atoms_out[__i] =
 89.2166 -+	      static_cast<wchar_t>(__num_base::_S_atoms_out[__i]);
 89.2167 -+
 89.2168 -+	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
 89.2169 -+	    _M_data->_M_atoms_in[__j] =
 89.2170 -+	      static_cast<wchar_t>(__num_base::_S_atoms_in[__j]);
 89.2171 -+	}
 89.2172 -+      else
 89.2173 -+	{
 89.2174 -+	  // Named locale.
 89.2175 -+	  // NB: In the GNU model wchar_t is always 32 bit wide.
 89.2176 -+	  union { char *__s; wchar_t __w; } __u;
 89.2177 -+	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
 89.2178 -+	  _M_data->_M_decimal_point = __u.__w;
 89.2179 -+
 89.2180 -+	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
 89.2181 -+	  _M_data->_M_thousands_sep = __u.__w;
 89.2182 -+
 89.2183 -+	  if (_M_data->_M_thousands_sep == L'\0')
 89.2184 -+	    _M_data->_M_grouping = "";
 89.2185 -+	  else
 89.2186 -+	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
 89.2187 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
 89.2188 -+	}
 89.2189 -+
 89.2190 -+      // NB: There is no way to extact this info from posix locales.
 89.2191 -+      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
 89.2192 -+      _M_data->_M_truename = L"true";
 89.2193 -+      _M_data->_M_truename_size = 4;
 89.2194 -+      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
 89.2195 -+      _M_data->_M_falsename = L"false";
 89.2196 -+      _M_data->_M_falsename_size = 5;
 89.2197 -+    }
 89.2198 -+
 89.2199 -+  template<> 
 89.2200 -+    numpunct<wchar_t>::~numpunct()
 89.2201 -+    { delete _M_data; }
 89.2202 -+ #endif
 89.2203 -+}
 89.2204 -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
 89.2205 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.cc	1970-01-01 01:00:00.000000000 +0100
 89.2206 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.cc	2008-06-10 14:45:35.000000000 +0200
 89.2207 -@@ -0,0 +1,406 @@
 89.2208 -+// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
 89.2209 -+
 89.2210 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 89.2211 -+//
 89.2212 -+// This file is part of the GNU ISO C++ Library.  This library is free
 89.2213 -+// software; you can redistribute it and/or modify it under the
 89.2214 -+// terms of the GNU General Public License as published by the
 89.2215 -+// Free Software Foundation; either version 2, or (at your option)
 89.2216 -+// any later version.
 89.2217 -+
 89.2218 -+// This library is distributed in the hope that it will be useful,
 89.2219 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 89.2220 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 89.2221 -+// GNU General Public License for more details.
 89.2222 -+
 89.2223 -+// You should have received a copy of the GNU General Public License along
 89.2224 -+// with this library; see the file COPYING.  If not, write to the Free
 89.2225 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 89.2226 -+// USA.
 89.2227 -+
 89.2228 -+// As a special exception, you may use this file as part of a free software
 89.2229 -+// library without restriction.  Specifically, if other files instantiate
 89.2230 -+// templates or use macros or inline functions from this file, or you compile
 89.2231 -+// this file and link it with other files to produce an executable, this
 89.2232 -+// file does not by itself cause the resulting executable to be covered by
 89.2233 -+// the GNU General Public License.  This exception does not however
 89.2234 -+// invalidate any other reasons why the executable file might be covered by
 89.2235 -+// the GNU General Public License.
 89.2236 -+
 89.2237 -+//
 89.2238 -+// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
 89.2239 -+// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
 89.2240 -+//
 89.2241 -+
 89.2242 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 89.2243 -+
 89.2244 -+#include <locale>
 89.2245 -+#include <bits/c++locale_internal.h>
 89.2246 -+
 89.2247 -+#ifdef __UCLIBC_MJN3_ONLY__
 89.2248 -+#warning tailor for stub locale support
 89.2249 -+#endif
 89.2250 -+#ifndef __UCLIBC_HAS_XLOCALE__
 89.2251 -+#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 89.2252 -+#endif
 89.2253 -+
 89.2254 -+namespace std
 89.2255 -+{
 89.2256 -+  template<>
 89.2257 -+    void
 89.2258 -+    __timepunct<char>::
 89.2259 -+    _M_put(char* __s, size_t __maxlen, const char* __format, 
 89.2260 -+	   const tm* __tm) const
 89.2261 -+    {
 89.2262 -+#ifdef __UCLIBC_HAS_XLOCALE__
 89.2263 -+      const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
 89.2264 -+					_M_c_locale_timepunct);
 89.2265 -+#else
 89.2266 -+      char* __old = strdup(setlocale(LC_ALL, NULL));
 89.2267 -+      setlocale(LC_ALL, _M_name_timepunct);
 89.2268 -+      const size_t __len = strftime(__s, __maxlen, __format, __tm);
 89.2269 -+      setlocale(LC_ALL, __old);
 89.2270 -+      free(__old);
 89.2271 -+#endif
 89.2272 -+      // Make sure __s is null terminated.
 89.2273 -+      if (__len == 0)
 89.2274 -+	__s[0] = '\0';
 89.2275 -+    }
 89.2276 -+
 89.2277 -+  template<> 
 89.2278 -+    void
 89.2279 -+    __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
 89.2280 -+    {
 89.2281 -+      if (!_M_data)
 89.2282 -+	_M_data = new __timepunct_cache<char>;
 89.2283 -+
 89.2284 -+      if (!__cloc)
 89.2285 -+	{
 89.2286 -+	  // "C" locale
 89.2287 -+	  _M_c_locale_timepunct = _S_get_c_locale();
 89.2288 -+
 89.2289 -+	  _M_data->_M_date_format = "%m/%d/%y";
 89.2290 -+	  _M_data->_M_date_era_format = "%m/%d/%y";
 89.2291 -+	  _M_data->_M_time_format = "%H:%M:%S";
 89.2292 -+	  _M_data->_M_time_era_format = "%H:%M:%S";
 89.2293 -+	  _M_data->_M_date_time_format = "";
 89.2294 -+	  _M_data->_M_date_time_era_format = "";
 89.2295 -+	  _M_data->_M_am = "AM";
 89.2296 -+	  _M_data->_M_pm = "PM";
 89.2297 -+	  _M_data->_M_am_pm_format = "";
 89.2298 -+
 89.2299 -+	  // Day names, starting with "C"'s Sunday.
 89.2300 -+	  _M_data->_M_day1 = "Sunday";
 89.2301 -+	  _M_data->_M_day2 = "Monday";
 89.2302 -+	  _M_data->_M_day3 = "Tuesday";
 89.2303 -+	  _M_data->_M_day4 = "Wednesday";
 89.2304 -+	  _M_data->_M_day5 = "Thursday";
 89.2305 -+	  _M_data->_M_day6 = "Friday";
 89.2306 -+	  _M_data->_M_day7 = "Saturday";
 89.2307 -+
 89.2308 -+	  // Abbreviated day names, starting with "C"'s Sun.
 89.2309 -+	  _M_data->_M_aday1 = "Sun";
 89.2310 -+	  _M_data->_M_aday2 = "Mon";
 89.2311 -+	  _M_data->_M_aday3 = "Tue";
 89.2312 -+	  _M_data->_M_aday4 = "Wed";
 89.2313 -+	  _M_data->_M_aday5 = "Thu";
 89.2314 -+	  _M_data->_M_aday6 = "Fri";
 89.2315 -+	  _M_data->_M_aday7 = "Sat";
 89.2316 -+
 89.2317 -+	  // Month names, starting with "C"'s January.
 89.2318 -+	  _M_data->_M_month01 = "January";
 89.2319 -+	  _M_data->_M_month02 = "February";
 89.2320 -+	  _M_data->_M_month03 = "March";
 89.2321 -+	  _M_data->_M_month04 = "April";
 89.2322 -+	  _M_data->_M_month05 = "May";
 89.2323 -+	  _M_data->_M_month06 = "June";
 89.2324 -+	  _M_data->_M_month07 = "July";
 89.2325 -+	  _M_data->_M_month08 = "August";
 89.2326 -+	  _M_data->_M_month09 = "September";
 89.2327 -+	  _M_data->_M_month10 = "October";
 89.2328 -+	  _M_data->_M_month11 = "November";
 89.2329 -+	  _M_data->_M_month12 = "December";
 89.2330 -+
 89.2331 -+	  // Abbreviated month names, starting with "C"'s Jan.
 89.2332 -+	  _M_data->_M_amonth01 = "Jan";
 89.2333 -+	  _M_data->_M_amonth02 = "Feb";
 89.2334 -+	  _M_data->_M_amonth03 = "Mar";
 89.2335 -+	  _M_data->_M_amonth04 = "Apr";
 89.2336 -+	  _M_data->_M_amonth05 = "May";
 89.2337 -+	  _M_data->_M_amonth06 = "Jun";
 89.2338 -+	  _M_data->_M_amonth07 = "Jul";
 89.2339 -+	  _M_data->_M_amonth08 = "Aug";
 89.2340 -+	  _M_data->_M_amonth09 = "Sep";
 89.2341 -+	  _M_data->_M_amonth10 = "Oct";
 89.2342 -+	  _M_data->_M_amonth11 = "Nov";
 89.2343 -+	  _M_data->_M_amonth12 = "Dec";
 89.2344 -+	}
 89.2345 -+      else
 89.2346 -+	{
 89.2347 -+	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
 89.2348 -+
 89.2349 -+	  _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
 89.2350 -+	  _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
 89.2351 -+	  _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
 89.2352 -+	  _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
 89.2353 -+	  _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
 89.2354 -+	  _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT,
 89.2355 -+							     __cloc);
 89.2356 -+	  _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
 89.2357 -+	  _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
 89.2358 -+	  _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
 89.2359 -+
 89.2360 -+	  // Day names, starting with "C"'s Sunday.
 89.2361 -+	  _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
 89.2362 -+	  _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
 89.2363 -+	  _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
 89.2364 -+	  _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
 89.2365 -+	  _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
 89.2366 -+	  _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
 89.2367 -+	  _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
 89.2368 -+
 89.2369 -+	  // Abbreviated day names, starting with "C"'s Sun.
 89.2370 -+	  _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
 89.2371 -+	  _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
 89.2372 -+	  _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
 89.2373 -+	  _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
 89.2374 -+	  _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
 89.2375 -+	  _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
 89.2376 -+	  _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
 89.2377 -+
 89.2378 -+	  // Month names, starting with "C"'s January.
 89.2379 -+	  _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
 89.2380 -+	  _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
 89.2381 -+	  _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
 89.2382 -+	  _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
 89.2383 -+	  _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
 89.2384 -+	  _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
 89.2385 -+	  _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
 89.2386 -+	  _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
 89.2387 -+	  _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
 89.2388 -+	  _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
 89.2389 -+	  _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
 89.2390 -+	  _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
 89.2391 -+
 89.2392 -+	  // Abbreviated month names, starting with "C"'s Jan.
 89.2393 -+	  _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
 89.2394 -+	  _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
 89.2395 -+	  _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
 89.2396 -+	  _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
 89.2397 -+	  _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
 89.2398 -+	  _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
 89.2399 -+	  _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
 89.2400 -+	  _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
 89.2401 -+	  _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
 89.2402 -+	  _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
 89.2403 -+	  _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
 89.2404 -+	  _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
 89.2405 -+	}
 89.2406 -+    }
 89.2407 -+
 89.2408 -+#ifdef _GLIBCXX_USE_WCHAR_T
 89.2409 -+  template<>
 89.2410 -+    void
 89.2411 -+    __timepunct<wchar_t>::
 89.2412 -+    _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format, 
 89.2413 -+	   const tm* __tm) const
 89.2414 -+    {
 89.2415 -+#ifdef __UCLIBC_HAS_XLOCALE__
 89.2416 -+      __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
 89.2417 -+      const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
 89.2418 -+					_M_c_locale_timepunct);
 89.2419 -+#else
 89.2420 -+      char* __old = strdup(setlocale(LC_ALL, NULL));
 89.2421 -+      setlocale(LC_ALL, _M_name_timepunct);
 89.2422 -+      const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
 89.2423 -+      setlocale(LC_ALL, __old);
 89.2424 -+      free(__old);
 89.2425 -+#endif
 89.2426 -+      // Make sure __s is null terminated.
 89.2427 -+      if (__len == 0)
 89.2428 -+	__s[0] = L'\0';
 89.2429 -+    }
 89.2430 -+
 89.2431 -+  template<> 
 89.2432 -+    void
 89.2433 -+    __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
 89.2434 -+    {
 89.2435 -+      if (!_M_data)
 89.2436 -+	_M_data = new __timepunct_cache<wchar_t>;
 89.2437 -+
 89.2438 -+#warning wide time stuff
 89.2439 -+//       if (!__cloc)
 89.2440 -+	{
 89.2441 -+	  // "C" locale
 89.2442 -+	  _M_c_locale_timepunct = _S_get_c_locale();
 89.2443 -+
 89.2444 -+	  _M_data->_M_date_format = L"%m/%d/%y";
 89.2445 -+	  _M_data->_M_date_era_format = L"%m/%d/%y";
 89.2446 -+	  _M_data->_M_time_format = L"%H:%M:%S";
 89.2447 -+	  _M_data->_M_time_era_format = L"%H:%M:%S";
 89.2448 -+	  _M_data->_M_date_time_format = L"";
 89.2449 -+	  _M_data->_M_date_time_era_format = L"";
 89.2450 -+	  _M_data->_M_am = L"AM";
 89.2451 -+	  _M_data->_M_pm = L"PM";
 89.2452 -+	  _M_data->_M_am_pm_format = L"";
 89.2453 -+
 89.2454 -+	  // Day names, starting with "C"'s Sunday.
 89.2455 -+	  _M_data->_M_day1 = L"Sunday";
 89.2456 -+	  _M_data->_M_day2 = L"Monday";
 89.2457 -+	  _M_data->_M_day3 = L"Tuesday";
 89.2458 -+	  _M_data->_M_day4 = L"Wednesday";
 89.2459 -+	  _M_data->_M_day5 = L"Thursday";
 89.2460 -+	  _M_data->_M_day6 = L"Friday";
 89.2461 -+	  _M_data->_M_day7 = L"Saturday";
 89.2462 -+
 89.2463 -+	  // Abbreviated day names, starting with "C"'s Sun.
 89.2464 -+	  _M_data->_M_aday1 = L"Sun";
 89.2465 -+	  _M_data->_M_aday2 = L"Mon";
 89.2466 -+	  _M_data->_M_aday3 = L"Tue";
 89.2467 -+	  _M_data->_M_aday4 = L"Wed";
 89.2468 -+	  _M_data->_M_aday5 = L"Thu";
 89.2469 -+	  _M_data->_M_aday6 = L"Fri";
 89.2470 -+	  _M_data->_M_aday7 = L"Sat";
 89.2471 -+
 89.2472 -+	  // Month names, starting with "C"'s January.
 89.2473 -+	  _M_data->_M_month01 = L"January";
 89.2474 -+	  _M_data->_M_month02 = L"February";
 89.2475 -+	  _M_data->_M_month03 = L"March";
 89.2476 -+	  _M_data->_M_month04 = L"April";
 89.2477 -+	  _M_data->_M_month05 = L"May";
 89.2478 -+	  _M_data->_M_month06 = L"June";
 89.2479 -+	  _M_data->_M_month07 = L"July";
 89.2480 -+	  _M_data->_M_month08 = L"August";
 89.2481 -+	  _M_data->_M_month09 = L"September";
 89.2482 -+	  _M_data->_M_month10 = L"October";
 89.2483 -+	  _M_data->_M_month11 = L"November";
 89.2484 -+	  _M_data->_M_month12 = L"December";
 89.2485 -+
 89.2486 -+	  // Abbreviated month names, starting with "C"'s Jan.
 89.2487 -+	  _M_data->_M_amonth01 = L"Jan";
 89.2488 -+	  _M_data->_M_amonth02 = L"Feb";
 89.2489 -+	  _M_data->_M_amonth03 = L"Mar";
 89.2490 -+	  _M_data->_M_amonth04 = L"Apr";
 89.2491 -+	  _M_data->_M_amonth05 = L"May";
 89.2492 -+	  _M_data->_M_amonth06 = L"Jun";
 89.2493 -+	  _M_data->_M_amonth07 = L"Jul";
 89.2494 -+	  _M_data->_M_amonth08 = L"Aug";
 89.2495 -+	  _M_data->_M_amonth09 = L"Sep";
 89.2496 -+	  _M_data->_M_amonth10 = L"Oct";
 89.2497 -+	  _M_data->_M_amonth11 = L"Nov";
 89.2498 -+	  _M_data->_M_amonth12 = L"Dec";
 89.2499 -+	}
 89.2500 -+#if 0
 89.2501 -+      else
 89.2502 -+	{
 89.2503 -+	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
 89.2504 -+
 89.2505 -+	  union { char *__s; wchar_t *__w; } __u;
 89.2506 -+
 89.2507 -+	  __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc);
 89.2508 -+	  _M_data->_M_date_format = __u.__w;
 89.2509 -+	  __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc);
 89.2510 -+	  _M_data->_M_date_era_format = __u.__w;
 89.2511 -+	  __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc);
 89.2512 -+	  _M_data->_M_time_format = __u.__w;
 89.2513 -+	  __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc);
 89.2514 -+	  _M_data->_M_time_era_format = __u.__w;
 89.2515 -+	  __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc);
 89.2516 -+	  _M_data->_M_date_time_format = __u.__w;
 89.2517 -+	  __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc);
 89.2518 -+	  _M_data->_M_date_time_era_format = __u.__w;
 89.2519 -+	  __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc);
 89.2520 -+	  _M_data->_M_am = __u.__w;
 89.2521 -+	  __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc);
 89.2522 -+	  _M_data->_M_pm = __u.__w;
 89.2523 -+	  __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc);
 89.2524 -+	  _M_data->_M_am_pm_format = __u.__w;
 89.2525 -+
 89.2526 -+	  // Day names, starting with "C"'s Sunday.
 89.2527 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc);
 89.2528 -+	  _M_data->_M_day1 = __u.__w;
 89.2529 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc);
 89.2530 -+	  _M_data->_M_day2 = __u.__w;
 89.2531 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc);
 89.2532 -+	  _M_data->_M_day3 = __u.__w;
 89.2533 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc);
 89.2534 -+	  _M_data->_M_day4 = __u.__w;
 89.2535 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc);
 89.2536 -+	  _M_data->_M_day5 = __u.__w;
 89.2537 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc);
 89.2538 -+	  _M_data->_M_day6 = __u.__w;
 89.2539 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc);
 89.2540 -+	  _M_data->_M_day7 = __u.__w;
 89.2541 -+
 89.2542 -+	  // Abbreviated day names, starting with "C"'s Sun.
 89.2543 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc);
 89.2544 -+	  _M_data->_M_aday1 = __u.__w;
 89.2545 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc);
 89.2546 -+	  _M_data->_M_aday2 = __u.__w;
 89.2547 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc);
 89.2548 -+	  _M_data->_M_aday3 = __u.__w;
 89.2549 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc);
 89.2550 -+	  _M_data->_M_aday4 = __u.__w;
 89.2551 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc);
 89.2552 -+	  _M_data->_M_aday5 = __u.__w;
 89.2553 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc);
 89.2554 -+	  _M_data->_M_aday6 = __u.__w;
 89.2555 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc);
 89.2556 -+	  _M_data->_M_aday7 = __u.__w;
 89.2557 -+
 89.2558 -+	  // Month names, starting with "C"'s January.
 89.2559 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc);
 89.2560 -+	  _M_data->_M_month01 = __u.__w;
 89.2561 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc);
 89.2562 -+	  _M_data->_M_month02 = __u.__w;
 89.2563 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc);
 89.2564 -+	  _M_data->_M_month03 = __u.__w;
 89.2565 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc);
 89.2566 -+	  _M_data->_M_month04 = __u.__w;
 89.2567 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc);
 89.2568 -+	  _M_data->_M_month05 = __u.__w;
 89.2569 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc);
 89.2570 -+	  _M_data->_M_month06 = __u.__w;
 89.2571 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc);
 89.2572 -+	  _M_data->_M_month07 = __u.__w;
 89.2573 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc);
 89.2574 -+	  _M_data->_M_month08 = __u.__w;
 89.2575 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc);
 89.2576 -+	  _M_data->_M_month09 = __u.__w;
 89.2577 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc);
 89.2578 -+	  _M_data->_M_month10 = __u.__w;
 89.2579 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc);
 89.2580 -+	  _M_data->_M_month11 = __u.__w;
 89.2581 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc);
 89.2582 -+	  _M_data->_M_month12 = __u.__w;
 89.2583 -+
 89.2584 -+	  // Abbreviated month names, starting with "C"'s Jan.
 89.2585 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc);
 89.2586 -+	  _M_data->_M_amonth01 = __u.__w;
 89.2587 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc);
 89.2588 -+	  _M_data->_M_amonth02 = __u.__w;
 89.2589 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc);
 89.2590 -+	  _M_data->_M_amonth03 = __u.__w;
 89.2591 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc);
 89.2592 -+	  _M_data->_M_amonth04 = __u.__w;
 89.2593 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc);
 89.2594 -+	  _M_data->_M_amonth05 = __u.__w;
 89.2595 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc);
 89.2596 -+	  _M_data->_M_amonth06 = __u.__w;
 89.2597 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc);
 89.2598 -+	  _M_data->_M_amonth07 = __u.__w;
 89.2599 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc);
 89.2600 -+	  _M_data->_M_amonth08 = __u.__w;
 89.2601 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc);
 89.2602 -+	  _M_data->_M_amonth09 = __u.__w;
 89.2603 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc);
 89.2604 -+	  _M_data->_M_amonth10 = __u.__w;
 89.2605 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc);
 89.2606 -+	  _M_data->_M_amonth11 = __u.__w;
 89.2607 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc);
 89.2608 -+	  _M_data->_M_amonth12 = __u.__w;
 89.2609 -+	}
 89.2610 -+#endif // 0
 89.2611 -+    }
 89.2612 -+#endif
 89.2613 -+}
 89.2614 -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
 89.2615 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.h	1970-01-01 01:00:00.000000000 +0100
 89.2616 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.h	2008-06-10 14:45:35.000000000 +0200
 89.2617 -@@ -0,0 +1,68 @@
 89.2618 -+// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
 89.2619 -+
 89.2620 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 89.2621 -+//
 89.2622 -+// This file is part of the GNU ISO C++ Library.  This library is free
 89.2623 -+// software; you can redistribute it and/or modify it under the
 89.2624 -+// terms of the GNU General Public License as published by the
 89.2625 -+// Free Software Foundation; either version 2, or (at your option)
 89.2626 -+// any later version.
 89.2627 -+
 89.2628 -+// This library is distributed in the hope that it will be useful,
 89.2629 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 89.2630 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 89.2631 -+// GNU General Public License for more details.
 89.2632 -+
 89.2633 -+// You should have received a copy of the GNU General Public License along
 89.2634 -+// with this library; see the file COPYING.  If not, write to the Free
 89.2635 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 89.2636 -+// USA.
 89.2637 -+
 89.2638 -+// As a special exception, you may use this file as part of a free software
 89.2639 -+// library without restriction.  Specifically, if other files instantiate
 89.2640 -+// templates or use macros or inline functions from this file, or you compile
 89.2641 -+// this file and link it with other files to produce an executable, this
 89.2642 -+// file does not by itself cause the resulting executable to be covered by
 89.2643 -+// the GNU General Public License.  This exception does not however
 89.2644 -+// invalidate any other reasons why the executable file might be covered by
 89.2645 -+// the GNU General Public License.
 89.2646 -+
 89.2647 -+//
 89.2648 -+// ISO C++ 14882: 22.2.5.1.2 - time_get functions
 89.2649 -+// ISO C++ 14882: 22.2.5.3.2 - time_put functions
 89.2650 -+//
 89.2651 -+
 89.2652 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 89.2653 -+
 89.2654 -+  template<typename _CharT>
 89.2655 -+    __timepunct<_CharT>::__timepunct(size_t __refs) 
 89.2656 -+    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
 89.2657 -+    _M_name_timepunct(_S_get_c_name())
 89.2658 -+    { _M_initialize_timepunct(); }
 89.2659 -+
 89.2660 -+  template<typename _CharT>
 89.2661 -+    __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) 
 89.2662 -+    : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), 
 89.2663 -+    _M_name_timepunct(_S_get_c_name())
 89.2664 -+    { _M_initialize_timepunct(); }
 89.2665 -+
 89.2666 -+  template<typename _CharT>
 89.2667 -+    __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
 89.2668 -+				     size_t __refs) 
 89.2669 -+    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
 89.2670 -+    _M_name_timepunct(__s)
 89.2671 -+    { 
 89.2672 -+      char* __tmp = new char[std::strlen(__s) + 1];
 89.2673 -+      std::strcpy(__tmp, __s);
 89.2674 -+      _M_name_timepunct = __tmp;
 89.2675 -+      _M_initialize_timepunct(__cloc); 
 89.2676 -+    }
 89.2677 -+
 89.2678 -+  template<typename _CharT>
 89.2679 -+    __timepunct<_CharT>::~__timepunct()
 89.2680 -+    { 
 89.2681 -+      if (_M_name_timepunct != _S_get_c_name())
 89.2682 -+	delete [] _M_name_timepunct;
 89.2683 -+      delete _M_data; 
 89.2684 -+      _S_destroy_c_locale(_M_c_locale_timepunct); 
 89.2685 -+    }
 89.2686 -diff -durN gcc-4.3.0.orig/libstdc++-v3/configure gcc-4.3.0/libstdc++-v3/configure
 89.2687 ---- gcc-4.3.0.orig/libstdc++-v3/configure	2008-02-29 01:00:39.000000000 +0100
 89.2688 -+++ gcc-4.3.0/libstdc++-v3/configure	2008-06-10 14:45:35.000000000 +0200
 89.2689 -@@ -14001,7 +14001,7 @@
 89.2690 -   enableval="$enable_clocale"
 89.2691 - 
 89.2692 -       case "$enableval" in
 89.2693 --       generic|gnu|ieee_1003.1-2001|yes|no|auto) ;;
 89.2694 -+       generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto) ;;
 89.2695 -        *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable clocale" >&5
 89.2696 - echo "$as_me: error: Unknown argument to enable/disable clocale" >&2;}
 89.2697 -    { (exit 1); exit 1; }; } ;;
 89.2698 -@@ -14034,6 +14034,9 @@
 89.2699 -   # Default to "generic".
 89.2700 -   if test $enable_clocale_flag = auto; then
 89.2701 -     case ${target_os} in
 89.2702 -+      linux-uclibc*)
 89.2703 -+        enable_clocale_flag=uclibc
 89.2704 -+	;;
 89.2705 -       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
 89.2706 -         enable_clocale_flag=gnu
 89.2707 -         ;;
 89.2708 -@@ -14422,6 +14425,76 @@
 89.2709 -       CTIME_CC=config/locale/generic/time_members.cc
 89.2710 -       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
 89.2711 -       ;;
 89.2712 -+    uclibc)
 89.2713 -+      echo "$as_me:$LINENO: result: uclibc" >&5
 89.2714 -+echo "${ECHO_T}uclibc" >&6
 89.2715 -+
 89.2716 -+      # Declare intention to use gettext, and add support for specific
 89.2717 -+      # languages.
 89.2718 -+      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
 89.2719 -+      ALL_LINGUAS="de fr"
 89.2720 -+
 89.2721 -+      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
 89.2722 -+      # Extract the first word of "msgfmt", so it can be a program name with args.
 89.2723 -+set dummy msgfmt; ac_word=$2
 89.2724 -+echo "$as_me:$LINENO: checking for $ac_word" >&5
 89.2725 -+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 89.2726 -+if test "${ac_cv_prog_check_msgfmt+set}" = set; then
 89.2727 -+  echo $ECHO_N "(cached) $ECHO_C" >&6
 89.2728 -+else
 89.2729 -+  if test -n "$check_msgfmt"; then
 89.2730 -+  ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
 89.2731 -+else
 89.2732 -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 89.2733 -+for as_dir in $PATH
 89.2734 -+do
 89.2735 -+  IFS=$as_save_IFS
 89.2736 -+  test -z "$as_dir" && as_dir=.
 89.2737 -+  for ac_exec_ext in '' $ac_executable_extensions; do
 89.2738 -+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
 89.2739 -+    ac_cv_prog_check_msgfmt="yes"
 89.2740 -+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
 89.2741 -+    break 2
 89.2742 -+  fi
 89.2743 -+done
 89.2744 -+done
 89.2745 -+
 89.2746 -+  test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
 89.2747 -+fi
 89.2748 -+fi
 89.2749 -+check_msgfmt=$ac_cv_prog_check_msgfmt
 89.2750 -+if test -n "$check_msgfmt"; then
 89.2751 -+  echo "$as_me:$LINENO: result: $check_msgfmt" >&5
 89.2752 -+echo "${ECHO_T}$check_msgfmt" >&6
 89.2753 -+else
 89.2754 -+  echo "$as_me:$LINENO: result: no" >&5
 89.2755 -+echo "${ECHO_T}no" >&6
 89.2756 -+fi
 89.2757 -+
 89.2758 -+      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
 89.2759 -+        USE_NLS=yes
 89.2760 -+      fi
 89.2761 -+      # Export the build objects.
 89.2762 -+      for ling in $ALL_LINGUAS; do \
 89.2763 -+        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
 89.2764 -+        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
 89.2765 -+      done
 89.2766 -+
 89.2767 -+
 89.2768 -+
 89.2769 -+      CLOCALE_H=config/locale/uclibc/c_locale.h
 89.2770 -+      CLOCALE_CC=config/locale/uclibc/c_locale.cc
 89.2771 -+      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
 89.2772 -+      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
 89.2773 -+      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
 89.2774 -+      CMESSAGES_H=config/locale/uclibc/messages_members.h
 89.2775 -+      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
 89.2776 -+      CMONEY_CC=config/locale/uclibc/monetary_members.cc
 89.2777 -+      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
 89.2778 -+      CTIME_H=config/locale/uclibc/time_members.h
 89.2779 -+      CTIME_CC=config/locale/uclibc/time_members.cc
 89.2780 -+      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
 89.2781 -+      ;;
 89.2782 -   esac
 89.2783 - 
 89.2784 -   # This is where the testsuite looks for locale catalogs, using the
 89.2785 -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
 89.2786 ---- gcc-4.3.0.orig/libstdc++-v3/include/c_compatibility/wchar.h	2007-03-04 23:59:49.000000000 +0100
 89.2787 -+++ gcc-4.3.0/libstdc++-v3/include/c_compatibility/wchar.h	2008-06-10 14:45:35.000000000 +0200
 89.2788 -@@ -106,7 +106,9 @@
 89.2789 - using std::wmemcpy;
 89.2790 - using std::wmemmove;
 89.2791 - using std::wmemset;
 89.2792 -+#if _GLIBCXX_HAVE_WCSFTIME
 89.2793 - using std::wcsftime;
 89.2794 -+#endif
 89.2795 - 
 89.2796 - #if _GLIBCXX_USE_C99
 89.2797 - using std::wcstold;
    90.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    90.2 +++ b/patches/gcc/4.3.0/650-uclibc-locale.patch	Mon Jul 28 21:08:01 2008 +0000
    90.3 @@ -0,0 +1,2794 @@
    90.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_200-uclibc-locale.patch
    90.5 +diff -durN gcc-4.3.0.orig/libstdc++-v3/acinclude.m4 gcc-4.3.0/libstdc++-v3/acinclude.m4
    90.6 +--- gcc-4.3.0.orig/libstdc++-v3/acinclude.m4	2008-02-29 01:00:39.000000000 +0100
    90.7 ++++ gcc-4.3.0/libstdc++-v3/acinclude.m4	2008-06-10 14:45:35.000000000 +0200
    90.8 +@@ -1349,7 +1349,7 @@
    90.9 + AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
   90.10 +   GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
   90.11 +     [use MODEL for target locale package],
   90.12 +-    [permit generic|gnu|ieee_1003.1-2001|yes|no|auto])
   90.13 ++    [permit generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto])
   90.14 + 
   90.15 +   # Deal with gettext issues.  Default to not using it (=no) until we detect
   90.16 +   # support for it later.  Let the user turn it off via --e/d, but let that
   90.17 +@@ -1370,6 +1370,9 @@
   90.18 +   # Default to "generic".
   90.19 +   if test $enable_clocale_flag = auto; then
   90.20 +     case ${target_os} in
   90.21 ++      *-uclibc*)
   90.22 ++        enable_clocale_flag=uclibc
   90.23 ++        ;;
   90.24 +       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
   90.25 +         enable_clocale_flag=gnu	
   90.26 +         ;;
   90.27 +@@ -1541,6 +1544,40 @@
   90.28 +       CTIME_CC=config/locale/generic/time_members.cc
   90.29 +       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
   90.30 +       ;;
   90.31 ++    uclibc)
   90.32 ++      AC_MSG_RESULT(uclibc)
   90.33 ++
   90.34 ++      # Declare intention to use gettext, and add support for specific
   90.35 ++      # languages.
   90.36 ++      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
   90.37 ++      ALL_LINGUAS="de fr"
   90.38 ++
   90.39 ++      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
   90.40 ++      AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
   90.41 ++      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
   90.42 ++        USE_NLS=yes
   90.43 ++      fi
   90.44 ++      # Export the build objects.
   90.45 ++      for ling in $ALL_LINGUAS; do \
   90.46 ++        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
   90.47 ++        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
   90.48 ++      done
   90.49 ++      AC_SUBST(glibcxx_MOFILES)
   90.50 ++      AC_SUBST(glibcxx_POFILES)
   90.51 ++
   90.52 ++      CLOCALE_H=config/locale/uclibc/c_locale.h
   90.53 ++      CLOCALE_CC=config/locale/uclibc/c_locale.cc
   90.54 ++      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
   90.55 ++      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
   90.56 ++      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
   90.57 ++      CMESSAGES_H=config/locale/uclibc/messages_members.h
   90.58 ++      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
   90.59 ++      CMONEY_CC=config/locale/uclibc/monetary_members.cc
   90.60 ++      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
   90.61 ++      CTIME_H=config/locale/uclibc/time_members.h
   90.62 ++      CTIME_CC=config/locale/uclibc/time_members.cc
   90.63 ++      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
   90.64 ++      ;;
   90.65 +   esac
   90.66 + 
   90.67 +   # This is where the testsuite looks for locale catalogs, using the
   90.68 +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
   90.69 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	1970-01-01 01:00:00.000000000 +0100
   90.70 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2008-06-10 14:45:35.000000000 +0200
   90.71 +@@ -0,0 +1,63 @@
   90.72 ++// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
   90.73 ++
   90.74 ++// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
   90.75 ++//
   90.76 ++// This file is part of the GNU ISO C++ Library.  This library is free
   90.77 ++// software; you can redistribute it and/or modify it under the
   90.78 ++// terms of the GNU General Public License as published by the
   90.79 ++// Free Software Foundation; either version 2, or (at your option)
   90.80 ++// any later version.
   90.81 ++
   90.82 ++// This library is distributed in the hope that it will be useful,
   90.83 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
   90.84 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   90.85 ++// GNU General Public License for more details.
   90.86 ++
   90.87 ++// You should have received a copy of the GNU General Public License along
   90.88 ++// with this library; see the file COPYING.  If not, write to the Free
   90.89 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
   90.90 ++// USA.
   90.91 ++
   90.92 ++// As a special exception, you may use this file as part of a free software
   90.93 ++// library without restriction.  Specifically, if other files instantiate
   90.94 ++// templates or use macros or inline functions from this file, or you compile
   90.95 ++// this file and link it with other files to produce an executable, this
   90.96 ++// file does not by itself cause the resulting executable to be covered by
   90.97 ++// the GNU General Public License.  This exception does not however
   90.98 ++// invalidate any other reasons why the executable file might be covered by
   90.99 ++// the GNU General Public License.
  90.100 ++
  90.101 ++// Written by Jakub Jelinek <jakub@redhat.com>
  90.102 ++
  90.103 ++#include <bits/c++config.h>
  90.104 ++#include <clocale>
  90.105 ++
  90.106 ++#ifdef __UCLIBC_MJN3_ONLY__
  90.107 ++#warning clean this up
  90.108 ++#endif
  90.109 ++
  90.110 ++#ifdef __UCLIBC_HAS_XLOCALE__
  90.111 ++                                                  
  90.112 ++extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
  90.113 ++extern "C" __typeof(strcoll_l) __strcoll_l;
  90.114 ++extern "C" __typeof(strftime_l) __strftime_l;
  90.115 ++extern "C" __typeof(strtod_l) __strtod_l;
  90.116 ++extern "C" __typeof(strtof_l) __strtof_l;
  90.117 ++extern "C" __typeof(strtold_l) __strtold_l;
  90.118 ++extern "C" __typeof(strxfrm_l) __strxfrm_l;
  90.119 ++extern "C" __typeof(newlocale) __newlocale;
  90.120 ++extern "C" __typeof(freelocale) __freelocale;
  90.121 ++extern "C" __typeof(duplocale) __duplocale;
  90.122 ++extern "C" __typeof(uselocale) __uselocale;
  90.123 ++
  90.124 ++#ifdef _GLIBCXX_USE_WCHAR_T
  90.125 ++extern "C" __typeof(iswctype_l) __iswctype_l;
  90.126 ++extern "C" __typeof(towlower_l) __towlower_l;
  90.127 ++extern "C" __typeof(towupper_l) __towupper_l;
  90.128 ++extern "C" __typeof(wcscoll_l) __wcscoll_l;
  90.129 ++extern "C" __typeof(wcsftime_l) __wcsftime_l;
  90.130 ++extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
  90.131 ++extern "C" __typeof(wctype_l) __wctype_l;
  90.132 ++#endif 
  90.133 ++
  90.134 ++#endif // GLIBC 2.3 and later
  90.135 +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
  90.136 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc	1970-01-01 01:00:00.000000000 +0100
  90.137 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.cc	2008-06-10 14:45:35.000000000 +0200
  90.138 +@@ -0,0 +1,160 @@
  90.139 ++// Wrapper for underlying C-language localization -*- C++ -*-
  90.140 ++
  90.141 ++// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
  90.142 ++//
  90.143 ++// This file is part of the GNU ISO C++ Library.  This library is free
  90.144 ++// software; you can redistribute it and/or modify it under the
  90.145 ++// terms of the GNU General Public License as published by the
  90.146 ++// Free Software Foundation; either version 2, or (at your option)
  90.147 ++// any later version.
  90.148 ++
  90.149 ++// This library is distributed in the hope that it will be useful,
  90.150 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
  90.151 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  90.152 ++// GNU General Public License for more details.
  90.153 ++
  90.154 ++// You should have received a copy of the GNU General Public License along
  90.155 ++// with this library; see the file COPYING.  If not, write to the Free
  90.156 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  90.157 ++// USA.
  90.158 ++
  90.159 ++// As a special exception, you may use this file as part of a free software
  90.160 ++// library without restriction.  Specifically, if other files instantiate
  90.161 ++// templates or use macros or inline functions from this file, or you compile
  90.162 ++// this file and link it with other files to produce an executable, this
  90.163 ++// file does not by itself cause the resulting executable to be covered by
  90.164 ++// the GNU General Public License.  This exception does not however
  90.165 ++// invalidate any other reasons why the executable file might be covered by
  90.166 ++// the GNU General Public License.
  90.167 ++
  90.168 ++//
  90.169 ++// ISO C++ 14882: 22.8  Standard locale categories.
  90.170 ++//
  90.171 ++
  90.172 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
  90.173 ++
  90.174 ++#include <cerrno>  // For errno
  90.175 ++#include <locale>
  90.176 ++#include <stdexcept>
  90.177 ++#include <langinfo.h>
  90.178 ++#include <bits/c++locale_internal.h>
  90.179 ++
  90.180 ++#ifndef __UCLIBC_HAS_XLOCALE__
  90.181 ++#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
  90.182 ++#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
  90.183 ++#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
  90.184 ++#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
  90.185 ++#define __strtof_l(S, E, L)         strtof((S), (E))
  90.186 ++#define __strtod_l(S, E, L)         strtod((S), (E))
  90.187 ++#define __strtold_l(S, E, L)        strtold((S), (E))
  90.188 ++#warning should dummy __newlocale check for C|POSIX ?
  90.189 ++#define __newlocale(a, b, c)        NULL
  90.190 ++#define __freelocale(a)             ((void)0)
  90.191 ++#define __duplocale(a)              __c_locale()
  90.192 ++#endif
  90.193 ++
  90.194 ++namespace std 
  90.195 ++{
  90.196 ++  template<>
  90.197 ++    void
  90.198 ++    __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, 
  90.199 ++		   const __c_locale& __cloc)
  90.200 ++    {
  90.201 ++      if (!(__err & ios_base::failbit))
  90.202 ++	{
  90.203 ++	  char* __sanity;
  90.204 ++	  errno = 0;
  90.205 ++	  float __f = __strtof_l(__s, &__sanity, __cloc);
  90.206 ++          if (__sanity != __s && errno != ERANGE)
  90.207 ++	    __v = __f;
  90.208 ++	  else
  90.209 ++	    __err |= ios_base::failbit;
  90.210 ++	}
  90.211 ++    }
  90.212 ++
  90.213 ++  template<>
  90.214 ++    void
  90.215 ++    __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, 
  90.216 ++		   const __c_locale& __cloc)
  90.217 ++    {
  90.218 ++      if (!(__err & ios_base::failbit))
  90.219 ++	{
  90.220 ++	  char* __sanity;
  90.221 ++	  errno = 0;
  90.222 ++	  double __d = __strtod_l(__s, &__sanity, __cloc);
  90.223 ++          if (__sanity != __s && errno != ERANGE)
  90.224 ++	    __v = __d;
  90.225 ++	  else
  90.226 ++	    __err |= ios_base::failbit;
  90.227 ++	}
  90.228 ++    }
  90.229 ++
  90.230 ++  template<>
  90.231 ++    void
  90.232 ++    __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
  90.233 ++		   const __c_locale& __cloc)
  90.234 ++    {
  90.235 ++      if (!(__err & ios_base::failbit))
  90.236 ++	{
  90.237 ++	  char* __sanity;
  90.238 ++	  errno = 0;
  90.239 ++	  long double __ld = __strtold_l(__s, &__sanity, __cloc);
  90.240 ++          if (__sanity != __s && errno != ERANGE)
  90.241 ++	    __v = __ld;
  90.242 ++	  else
  90.243 ++	    __err |= ios_base::failbit;
  90.244 ++	}
  90.245 ++    }
  90.246 ++
  90.247 ++  void
  90.248 ++  locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s, 
  90.249 ++				    __c_locale __old)
  90.250 ++  {
  90.251 ++    __cloc = __newlocale(1 << LC_ALL, __s, __old);
  90.252 ++#ifdef __UCLIBC_HAS_XLOCALE__
  90.253 ++    if (!__cloc)
  90.254 ++      {
  90.255 ++	// This named locale is not supported by the underlying OS.
  90.256 ++	__throw_runtime_error(__N("locale::facet::_S_create_c_locale "
  90.257 ++			      "name not valid"));
  90.258 ++      }
  90.259 ++#endif
  90.260 ++  }
  90.261 ++  
  90.262 ++  void
  90.263 ++  locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
  90.264 ++  {
  90.265 ++    if (_S_get_c_locale() != __cloc)
  90.266 ++      __freelocale(__cloc); 
  90.267 ++  }
  90.268 ++
  90.269 ++  __c_locale
  90.270 ++  locale::facet::_S_clone_c_locale(__c_locale& __cloc)
  90.271 ++  { return __duplocale(__cloc); }
  90.272 ++} // namespace std
  90.273 ++
  90.274 ++namespace __gnu_cxx
  90.275 ++{
  90.276 ++  const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
  90.277 ++    {
  90.278 ++      "LC_CTYPE", 
  90.279 ++      "LC_NUMERIC",
  90.280 ++      "LC_TIME", 
  90.281 ++      "LC_COLLATE", 
  90.282 ++      "LC_MONETARY",
  90.283 ++      "LC_MESSAGES", 
  90.284 ++#if _GLIBCXX_NUM_CATEGORIES != 0
  90.285 ++      "LC_PAPER", 
  90.286 ++      "LC_NAME", 
  90.287 ++      "LC_ADDRESS",
  90.288 ++      "LC_TELEPHONE", 
  90.289 ++      "LC_MEASUREMENT", 
  90.290 ++      "LC_IDENTIFICATION" 
  90.291 ++#endif
  90.292 ++    };
  90.293 ++}
  90.294 ++
  90.295 ++namespace std
  90.296 ++{
  90.297 ++  const char* const* const locale::_S_categories = __gnu_cxx::category_names;
  90.298 ++}  // namespace std
  90.299 +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
  90.300 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.h	1970-01-01 01:00:00.000000000 +0100
  90.301 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.h	2008-06-10 14:45:35.000000000 +0200
  90.302 +@@ -0,0 +1,117 @@
  90.303 ++// Wrapper for underlying C-language localization -*- C++ -*-
  90.304 ++
  90.305 ++// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
  90.306 ++//
  90.307 ++// This file is part of the GNU ISO C++ Library.  This library is free
  90.308 ++// software; you can redistribute it and/or modify it under the
  90.309 ++// terms of the GNU General Public License as published by the
  90.310 ++// Free Software Foundation; either version 2, or (at your option)
  90.311 ++// any later version.
  90.312 ++
  90.313 ++// This library is distributed in the hope that it will be useful,
  90.314 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
  90.315 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  90.316 ++// GNU General Public License for more details.
  90.317 ++
  90.318 ++// You should have received a copy of the GNU General Public License along
  90.319 ++// with this library; see the file COPYING.  If not, write to the Free
  90.320 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  90.321 ++// USA.
  90.322 ++
  90.323 ++// As a special exception, you may use this file as part of a free software
  90.324 ++// library without restriction.  Specifically, if other files instantiate
  90.325 ++// templates or use macros or inline functions from this file, or you compile
  90.326 ++// this file and link it with other files to produce an executable, this
  90.327 ++// file does not by itself cause the resulting executable to be covered by
  90.328 ++// the GNU General Public License.  This exception does not however
  90.329 ++// invalidate any other reasons why the executable file might be covered by
  90.330 ++// the GNU General Public License.
  90.331 ++
  90.332 ++//
  90.333 ++// ISO C++ 14882: 22.8  Standard locale categories.
  90.334 ++//
  90.335 ++
  90.336 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
  90.337 ++
  90.338 ++#ifndef _C_LOCALE_H
  90.339 ++#define _C_LOCALE_H 1
  90.340 ++
  90.341 ++#pragma GCC system_header
  90.342 ++
  90.343 ++#include <cstring>              // get std::strlen
  90.344 ++#include <cstdio>               // get std::snprintf or std::sprintf
  90.345 ++#include <clocale>
  90.346 ++#include <langinfo.h>		// For codecvt
  90.347 ++#ifdef __UCLIBC_MJN3_ONLY__
  90.348 ++#warning fix this
  90.349 ++#endif
  90.350 ++#ifdef __UCLIBC_HAS_LOCALE__
  90.351 ++#include <iconv.h>		// For codecvt using iconv, iconv_t
  90.352 ++#endif
  90.353 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
  90.354 ++#include <libintl.h> 		// For messages
  90.355 ++#endif
  90.356 ++
  90.357 ++#ifdef __UCLIBC_MJN3_ONLY__
  90.358 ++#warning what is _GLIBCXX_C_LOCALE_GNU for
  90.359 ++#endif
  90.360 ++#define _GLIBCXX_C_LOCALE_GNU 1
  90.361 ++
  90.362 ++#ifdef __UCLIBC_MJN3_ONLY__
  90.363 ++#warning fix categories
  90.364 ++#endif
  90.365 ++// #define _GLIBCXX_NUM_CATEGORIES 6
  90.366 ++#define _GLIBCXX_NUM_CATEGORIES 0
  90.367 ++ 
  90.368 ++#ifdef __UCLIBC_HAS_XLOCALE__
  90.369 ++namespace __gnu_cxx
  90.370 ++{
  90.371 ++  extern "C" __typeof(uselocale) __uselocale;
  90.372 ++}
  90.373 ++#endif
  90.374 ++
  90.375 ++namespace std
  90.376 ++{
  90.377 ++#ifdef __UCLIBC_HAS_XLOCALE__
  90.378 ++  typedef __locale_t		__c_locale;
  90.379 ++#else
  90.380 ++  typedef int*			__c_locale;
  90.381 ++#endif
  90.382 ++
  90.383 ++  // Convert numeric value of type _Tv to string and return length of
  90.384 ++  // string.  If snprintf is available use it, otherwise fall back to
  90.385 ++  // the unsafe sprintf which, in general, can be dangerous and should
  90.386 ++  // be avoided.
  90.387 ++  template<typename _Tv>
  90.388 ++    int
  90.389 ++    __convert_from_v(char* __out, 
  90.390 ++		     const int __size __attribute__ ((__unused__)),
  90.391 ++		     const char* __fmt,
  90.392 ++#ifdef __UCLIBC_HAS_XCLOCALE__
  90.393 ++		     _Tv __v, const __c_locale& __cloc, int __prec)
  90.394 ++    {
  90.395 ++      __c_locale __old = __gnu_cxx::__uselocale(__cloc);
  90.396 ++#else
  90.397 ++		     _Tv __v, const __c_locale&, int __prec)
  90.398 ++    {
  90.399 ++# ifdef __UCLIBC_HAS_LOCALE__
  90.400 ++      char* __old = std::setlocale(LC_ALL, NULL);
  90.401 ++      char* __sav = new char[std::strlen(__old) + 1];
  90.402 ++      std::strcpy(__sav, __old);
  90.403 ++      std::setlocale(LC_ALL, "C");
  90.404 ++# endif
  90.405 ++#endif
  90.406 ++
  90.407 ++      const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
  90.408 ++
  90.409 ++#ifdef __UCLIBC_HAS_XCLOCALE__
  90.410 ++      __gnu_cxx::__uselocale(__old);
  90.411 ++#elif defined __UCLIBC_HAS_LOCALE__
  90.412 ++      std::setlocale(LC_ALL, __sav);
  90.413 ++      delete [] __sav;
  90.414 ++#endif
  90.415 ++      return __ret;
  90.416 ++    }
  90.417 ++}
  90.418 ++
  90.419 ++#endif
  90.420 +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
  90.421 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/codecvt_members.cc	1970-01-01 01:00:00.000000000 +0100
  90.422 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/codecvt_members.cc	2008-06-10 14:45:35.000000000 +0200
  90.423 +@@ -0,0 +1,306 @@
  90.424 ++// std::codecvt implementation details, GNU version -*- C++ -*-
  90.425 ++
  90.426 ++// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
  90.427 ++//
  90.428 ++// This file is part of the GNU ISO C++ Library.  This library is free
  90.429 ++// software; you can redistribute it and/or modify it under the
  90.430 ++// terms of the GNU General Public License as published by the
  90.431 ++// Free Software Foundation; either version 2, or (at your option)
  90.432 ++// any later version.
  90.433 ++
  90.434 ++// This library is distributed in the hope that it will be useful,
  90.435 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
  90.436 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  90.437 ++// GNU General Public License for more details.
  90.438 ++
  90.439 ++// You should have received a copy of the GNU General Public License along
  90.440 ++// with this library; see the file COPYING.  If not, write to the Free
  90.441 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  90.442 ++// USA.
  90.443 ++
  90.444 ++// As a special exception, you may use this file as part of a free software
  90.445 ++// library without restriction.  Specifically, if other files instantiate
  90.446 ++// templates or use macros or inline functions from this file, or you compile
  90.447 ++// this file and link it with other files to produce an executable, this
  90.448 ++// file does not by itself cause the resulting executable to be covered by
  90.449 ++// the GNU General Public License.  This exception does not however
  90.450 ++// invalidate any other reasons why the executable file might be covered by
  90.451 ++// the GNU General Public License.
  90.452 ++
  90.453 ++//
  90.454 ++// ISO C++ 14882: 22.2.1.5 - Template class codecvt
  90.455 ++//
  90.456 ++
  90.457 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
  90.458 ++
  90.459 ++#include <locale>
  90.460 ++#include <bits/c++locale_internal.h>
  90.461 ++
  90.462 ++namespace std
  90.463 ++{
  90.464 ++  // Specializations.
  90.465 ++#ifdef _GLIBCXX_USE_WCHAR_T
  90.466 ++  codecvt_base::result
  90.467 ++  codecvt<wchar_t, char, mbstate_t>::
  90.468 ++  do_out(state_type& __state, const intern_type* __from, 
  90.469 ++	 const intern_type* __from_end, const intern_type*& __from_next,
  90.470 ++	 extern_type* __to, extern_type* __to_end,
  90.471 ++	 extern_type*& __to_next) const
  90.472 ++  {
  90.473 ++    result __ret = ok;
  90.474 ++    state_type __tmp_state(__state);
  90.475 ++
  90.476 ++#ifdef __UCLIBC_HAS_XLOCALE__
  90.477 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
  90.478 ++#endif
  90.479 ++
  90.480 ++    // wcsnrtombs is *very* fast but stops if encounters NUL characters:
  90.481 ++    // in case we fall back to wcrtomb and then continue, in a loop.
  90.482 ++    // NB: wcsnrtombs is a GNU extension
  90.483 ++    for (__from_next = __from, __to_next = __to;
  90.484 ++	 __from_next < __from_end && __to_next < __to_end
  90.485 ++	 && __ret == ok;)
  90.486 ++      {
  90.487 ++	const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
  90.488 ++						      __from_end - __from_next);
  90.489 ++	if (!__from_chunk_end)
  90.490 ++	  __from_chunk_end = __from_end;
  90.491 ++
  90.492 ++	__from = __from_next;
  90.493 ++	const size_t __conv = wcsnrtombs(__to_next, &__from_next,
  90.494 ++					 __from_chunk_end - __from_next,
  90.495 ++					 __to_end - __to_next, &__state);
  90.496 ++	if (__conv == static_cast<size_t>(-1))
  90.497 ++	  {
  90.498 ++	    // In case of error, in order to stop at the exact place we
  90.499 ++	    // have to start again from the beginning with a series of
  90.500 ++	    // wcrtomb.
  90.501 ++	    for (; __from < __from_next; ++__from)
  90.502 ++	      __to_next += wcrtomb(__to_next, *__from, &__tmp_state);
  90.503 ++	    __state = __tmp_state;
  90.504 ++	    __ret = error;
  90.505 ++	  }
  90.506 ++	else if (__from_next && __from_next < __from_chunk_end)
  90.507 ++	  {
  90.508 ++	    __to_next += __conv;
  90.509 ++	    __ret = partial;
  90.510 ++	  }
  90.511 ++	else
  90.512 ++	  {
  90.513 ++	    __from_next = __from_chunk_end;
  90.514 ++	    __to_next += __conv;
  90.515 ++	  }
  90.516 ++
  90.517 ++	if (__from_next < __from_end && __ret == ok)
  90.518 ++	  {
  90.519 ++	    extern_type __buf[MB_LEN_MAX];
  90.520 ++	    __tmp_state = __state;
  90.521 ++	    const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
  90.522 ++	    if (__conv > static_cast<size_t>(__to_end - __to_next))
  90.523 ++	      __ret = partial;
  90.524 ++	    else
  90.525 ++	      {
  90.526 ++		memcpy(__to_next, __buf, __conv);
  90.527 ++		__state = __tmp_state;
  90.528 ++		__to_next += __conv;
  90.529 ++		++__from_next;
  90.530 ++	      }
  90.531 ++	  }
  90.532 ++      }
  90.533 ++
  90.534 ++#ifdef __UCLIBC_HAS_XLOCALE__
  90.535 ++    __uselocale(__old);
  90.536 ++#endif
  90.537 ++
  90.538 ++    return __ret; 
  90.539 ++  }
  90.540 ++  
  90.541 ++  codecvt_base::result
  90.542 ++  codecvt<wchar_t, char, mbstate_t>::
  90.543 ++  do_in(state_type& __state, const extern_type* __from, 
  90.544 ++	const extern_type* __from_end, const extern_type*& __from_next,
  90.545 ++	intern_type* __to, intern_type* __to_end,
  90.546 ++	intern_type*& __to_next) const
  90.547 ++  {
  90.548 ++    result __ret = ok;
  90.549 ++    state_type __tmp_state(__state);
  90.550 ++
  90.551 ++#ifdef __UCLIBC_HAS_XLOCALE__
  90.552 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
  90.553 ++#endif
  90.554 ++
  90.555 ++    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
  90.556 ++    // in case we store a L'\0' and then continue, in a loop.
  90.557 ++    // NB: mbsnrtowcs is a GNU extension
  90.558 ++    for (__from_next = __from, __to_next = __to;
  90.559 ++	 __from_next < __from_end && __to_next < __to_end
  90.560 ++	 && __ret == ok;)
  90.561 ++      {
  90.562 ++	const extern_type* __from_chunk_end;
  90.563 ++	__from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
  90.564 ++								  __from_end
  90.565 ++								  - __from_next));
  90.566 ++	if (!__from_chunk_end)
  90.567 ++	  __from_chunk_end = __from_end;
  90.568 ++
  90.569 ++	__from = __from_next;
  90.570 ++	size_t __conv = mbsnrtowcs(__to_next, &__from_next,
  90.571 ++				   __from_chunk_end - __from_next,
  90.572 ++				   __to_end - __to_next, &__state);
  90.573 ++	if (__conv == static_cast<size_t>(-1))
  90.574 ++	  {
  90.575 ++	    // In case of error, in order to stop at the exact place we
  90.576 ++	    // have to start again from the beginning with a series of
  90.577 ++	    // mbrtowc.
  90.578 ++	    for (;; ++__to_next, __from += __conv)
  90.579 ++	      {
  90.580 ++		__conv = mbrtowc(__to_next, __from, __from_end - __from,
  90.581 ++				 &__tmp_state);
  90.582 ++		if (__conv == static_cast<size_t>(-1)
  90.583 ++		    || __conv == static_cast<size_t>(-2))
  90.584 ++		  break;
  90.585 ++	      }
  90.586 ++	    __from_next = __from;
  90.587 ++	    __state = __tmp_state;	    
  90.588 ++	    __ret = error;
  90.589 ++	  }
  90.590 ++	else if (__from_next && __from_next < __from_chunk_end)
  90.591 ++	  {
  90.592 ++	    // It is unclear what to return in this case (see DR 382). 
  90.593 ++	    __to_next += __conv;
  90.594 ++	    __ret = partial;
  90.595 ++	  }
  90.596 ++	else
  90.597 ++	  {
  90.598 ++	    __from_next = __from_chunk_end;
  90.599 ++	    __to_next += __conv;
  90.600 ++	  }
  90.601 ++
  90.602 ++	if (__from_next < __from_end && __ret == ok)
  90.603 ++	  {
  90.604 ++	    if (__to_next < __to_end)
  90.605 ++	      {
  90.606 ++		// XXX Probably wrong for stateful encodings
  90.607 ++		__tmp_state = __state;		
  90.608 ++		++__from_next;
  90.609 ++		*__to_next++ = L'\0';
  90.610 ++	      }
  90.611 ++	    else
  90.612 ++	      __ret = partial;
  90.613 ++	  }
  90.614 ++      }
  90.615 ++
  90.616 ++#ifdef __UCLIBC_HAS_XLOCALE__
  90.617 ++    __uselocale(__old);
  90.618 ++#endif
  90.619 ++
  90.620 ++    return __ret; 
  90.621 ++  }
  90.622 ++
  90.623 ++  int 
  90.624 ++  codecvt<wchar_t, char, mbstate_t>::
  90.625 ++  do_encoding() const throw()
  90.626 ++  {
  90.627 ++    // XXX This implementation assumes that the encoding is
  90.628 ++    // stateless and is either single-byte or variable-width.
  90.629 ++    int __ret = 0;
  90.630 ++#ifdef __UCLIBC_HAS_XLOCALE__
  90.631 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
  90.632 ++#endif
  90.633 ++    if (MB_CUR_MAX == 1)
  90.634 ++      __ret = 1;
  90.635 ++#ifdef __UCLIBC_HAS_XLOCALE__
  90.636 ++    __uselocale(__old);
  90.637 ++#endif
  90.638 ++    return __ret;
  90.639 ++  }  
  90.640 ++
  90.641 ++  int 
  90.642 ++  codecvt<wchar_t, char, mbstate_t>::
  90.643 ++  do_max_length() const throw()
  90.644 ++  {
  90.645 ++#ifdef __UCLIBC_HAS_XLOCALE__
  90.646 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
  90.647 ++#endif
  90.648 ++    // XXX Probably wrong for stateful encodings.
  90.649 ++    int __ret = MB_CUR_MAX;
  90.650 ++#ifdef __UCLIBC_HAS_XLOCALE__
  90.651 ++    __uselocale(__old);
  90.652 ++#endif
  90.653 ++    return __ret;
  90.654 ++  }
  90.655 ++  
  90.656 ++  int 
  90.657 ++  codecvt<wchar_t, char, mbstate_t>::
  90.658 ++  do_length(state_type& __state, const extern_type* __from,
  90.659 ++	    const extern_type* __end, size_t __max) const
  90.660 ++  {
  90.661 ++    int __ret = 0;
  90.662 ++    state_type __tmp_state(__state);
  90.663 ++
  90.664 ++#ifdef __UCLIBC_HAS_XLOCALE__
  90.665 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
  90.666 ++#endif
  90.667 ++
  90.668 ++    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
  90.669 ++    // in case we advance past it and then continue, in a loop.
  90.670 ++    // NB: mbsnrtowcs is a GNU extension
  90.671 ++  
  90.672 ++    // A dummy internal buffer is needed in order for mbsnrtocws to consider
  90.673 ++    // its fourth parameter (it wouldn't with NULL as first parameter).
  90.674 ++    wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t) 
  90.675 ++							   * __max));
  90.676 ++    while (__from < __end && __max)
  90.677 ++      {
  90.678 ++	const extern_type* __from_chunk_end;
  90.679 ++	__from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
  90.680 ++								  __end
  90.681 ++								  - __from));
  90.682 ++	if (!__from_chunk_end)
  90.683 ++	  __from_chunk_end = __end;
  90.684 ++
  90.685 ++	const extern_type* __tmp_from = __from;
  90.686 ++	size_t __conv = mbsnrtowcs(__to, &__from,
  90.687 ++				   __from_chunk_end - __from,
  90.688 ++				   __max, &__state);
  90.689 ++	if (__conv == static_cast<size_t>(-1))
  90.690 ++	  {
  90.691 ++	    // In case of error, in order to stop at the exact place we
  90.692 ++	    // have to start again from the beginning with a series of
  90.693 ++	    // mbrtowc.
  90.694 ++	    for (__from = __tmp_from;; __from += __conv)
  90.695 ++	      {
  90.696 ++		__conv = mbrtowc(NULL, __from, __end - __from,
  90.697 ++				 &__tmp_state);
  90.698 ++		if (__conv == static_cast<size_t>(-1)
  90.699 ++		    || __conv == static_cast<size_t>(-2))
  90.700 ++		  break;
  90.701 ++	      }
  90.702 ++	    __state = __tmp_state;
  90.703 ++	    __ret += __from - __tmp_from;
  90.704 ++	    break;
  90.705 ++	  }
  90.706 ++	if (!__from)
  90.707 ++	  __from = __from_chunk_end;
  90.708 ++	
  90.709 ++	__ret += __from - __tmp_from;
  90.710 ++	__max -= __conv;
  90.711 ++
  90.712 ++	if (__from < __end && __max)
  90.713 ++	  {
  90.714 ++	    // XXX Probably wrong for stateful encodings
  90.715 ++	    __tmp_state = __state;
  90.716 ++	    ++__from;
  90.717 ++	    ++__ret;
  90.718 ++	    --__max;
  90.719 ++	  }
  90.720 ++      }
  90.721 ++
  90.722 ++#ifdef __UCLIBC_HAS_XLOCALE__
  90.723 ++    __uselocale(__old);
  90.724 ++#endif
  90.725 ++
  90.726 ++    return __ret; 
  90.727 ++  }
  90.728 ++#endif
  90.729 ++}
  90.730 +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
  90.731 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc	1970-01-01 01:00:00.000000000 +0100
  90.732 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/collate_members.cc	2008-06-10 14:45:35.000000000 +0200
  90.733 +@@ -0,0 +1,80 @@
  90.734 ++// std::collate implementation details, GNU version -*- C++ -*-
  90.735 ++
  90.736 ++// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
  90.737 ++//
  90.738 ++// This file is part of the GNU ISO C++ Library.  This library is free
  90.739 ++// software; you can redistribute it and/or modify it under the
  90.740 ++// terms of the GNU General Public License as published by the
  90.741 ++// Free Software Foundation; either version 2, or (at your option)
  90.742 ++// any later version.
  90.743 ++
  90.744 ++// This library is distributed in the hope that it will be useful,
  90.745 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
  90.746 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  90.747 ++// GNU General Public License for more details.
  90.748 ++
  90.749 ++// You should have received a copy of the GNU General Public License along
  90.750 ++// with this library; see the file COPYING.  If not, write to the Free
  90.751 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  90.752 ++// USA.
  90.753 ++
  90.754 ++// As a special exception, you may use this file as part of a free software
  90.755 ++// library without restriction.  Specifically, if other files instantiate
  90.756 ++// templates or use macros or inline functions from this file, or you compile
  90.757 ++// this file and link it with other files to produce an executable, this
  90.758 ++// file does not by itself cause the resulting executable to be covered by
  90.759 ++// the GNU General Public License.  This exception does not however
  90.760 ++// invalidate any other reasons why the executable file might be covered by
  90.761 ++// the GNU General Public License.
  90.762 ++
  90.763 ++//
  90.764 ++// ISO C++ 14882: 22.2.4.1.2  collate virtual functions
  90.765 ++//
  90.766 ++
  90.767 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
  90.768 ++
  90.769 ++#include <locale>
  90.770 ++#include <bits/c++locale_internal.h>
  90.771 ++
  90.772 ++#ifndef __UCLIBC_HAS_XLOCALE__
  90.773 ++#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
  90.774 ++#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
  90.775 ++#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
  90.776 ++#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
  90.777 ++#endif
  90.778 ++
  90.779 ++namespace std
  90.780 ++{
  90.781 ++  // These are basically extensions to char_traits, and perhaps should
  90.782 ++  // be put there instead of here.
  90.783 ++  template<>
  90.784 ++    int 
  90.785 ++    collate<char>::_M_compare(const char* __one, const char* __two) const
  90.786 ++    { 
  90.787 ++      int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
  90.788 ++      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
  90.789 ++    }
  90.790 ++  
  90.791 ++  template<>
  90.792 ++    size_t
  90.793 ++    collate<char>::_M_transform(char* __to, const char* __from, 
  90.794 ++				size_t __n) const 
  90.795 ++    { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
  90.796 ++
  90.797 ++#ifdef _GLIBCXX_USE_WCHAR_T
  90.798 ++  template<>
  90.799 ++    int 
  90.800 ++    collate<wchar_t>::_M_compare(const wchar_t* __one, 
  90.801 ++				 const wchar_t* __two) const
  90.802 ++    {
  90.803 ++      int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
  90.804 ++      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
  90.805 ++    }
  90.806 ++  
  90.807 ++  template<>
  90.808 ++    size_t
  90.809 ++    collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
  90.810 ++				   size_t __n) const
  90.811 ++    { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
  90.812 ++#endif
  90.813 ++}
  90.814 +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
  90.815 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc	1970-01-01 01:00:00.000000000 +0100
  90.816 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2008-06-10 14:45:35.000000000 +0200
  90.817 +@@ -0,0 +1,300 @@
  90.818 ++// std::ctype implementation details, GNU version -*- C++ -*-
  90.819 ++
  90.820 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
  90.821 ++//
  90.822 ++// This file is part of the GNU ISO C++ Library.  This library is free
  90.823 ++// software; you can redistribute it and/or modify it under the
  90.824 ++// terms of the GNU General Public License as published by the
  90.825 ++// Free Software Foundation; either version 2, or (at your option)
  90.826 ++// any later version.
  90.827 ++
  90.828 ++// This library is distributed in the hope that it will be useful,
  90.829 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
  90.830 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  90.831 ++// GNU General Public License for more details.
  90.832 ++
  90.833 ++// You should have received a copy of the GNU General Public License along
  90.834 ++// with this library; see the file COPYING.  If not, write to the Free
  90.835 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  90.836 ++// USA.
  90.837 ++
  90.838 ++// As a special exception, you may use this file as part of a free software
  90.839 ++// library without restriction.  Specifically, if other files instantiate
  90.840 ++// templates or use macros or inline functions from this file, or you compile
  90.841 ++// this file and link it with other files to produce an executable, this
  90.842 ++// file does not by itself cause the resulting executable to be covered by
  90.843 ++// the GNU General Public License.  This exception does not however
  90.844 ++// invalidate any other reasons why the executable file might be covered by
  90.845 ++// the GNU General Public License.
  90.846 ++
  90.847 ++//
  90.848 ++// ISO C++ 14882: 22.2.1.1.2  ctype virtual functions.
  90.849 ++//
  90.850 ++
  90.851 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
  90.852 ++
  90.853 ++#define _LIBC
  90.854 ++#include <locale>
  90.855 ++#undef _LIBC
  90.856 ++#include <bits/c++locale_internal.h>
  90.857 ++
  90.858 ++#ifndef __UCLIBC_HAS_XLOCALE__
  90.859 ++#define __wctype_l(S, L)           wctype((S))
  90.860 ++#define __towupper_l(C, L)         towupper((C))
  90.861 ++#define __towlower_l(C, L)         towlower((C))
  90.862 ++#define __iswctype_l(C, M, L)      iswctype((C), (M))
  90.863 ++#endif
  90.864 ++
  90.865 ++namespace std
  90.866 ++{
  90.867 ++  // NB: The other ctype<char> specializations are in src/locale.cc and
  90.868 ++  // various /config/os/* files.
  90.869 ++  template<>
  90.870 ++    ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
  90.871 ++    : ctype<char>(0, false, __refs) 
  90.872 ++    { 		
  90.873 ++      if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
  90.874 ++	{
  90.875 ++	  this->_S_destroy_c_locale(this->_M_c_locale_ctype);
  90.876 ++	  this->_S_create_c_locale(this->_M_c_locale_ctype, __s); 
  90.877 ++#ifdef __UCLIBC_HAS_XLOCALE__
  90.878 ++	  this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
  90.879 ++	  this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
  90.880 ++	  this->_M_table = this->_M_c_locale_ctype->__ctype_b;
  90.881 ++#endif
  90.882 ++	}
  90.883 ++    }
  90.884 ++
  90.885 ++#ifdef _GLIBCXX_USE_WCHAR_T  
  90.886 ++  ctype<wchar_t>::__wmask_type
  90.887 ++  ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
  90.888 ++  {
  90.889 ++    __wmask_type __ret;
  90.890 ++    switch (__m)
  90.891 ++      {
  90.892 ++      case space:
  90.893 ++	__ret = __wctype_l("space", _M_c_locale_ctype);
  90.894 ++	break;
  90.895 ++      case print:
  90.896 ++	__ret = __wctype_l("print", _M_c_locale_ctype);
  90.897 ++	break;
  90.898 ++      case cntrl:
  90.899 ++	__ret = __wctype_l("cntrl", _M_c_locale_ctype);
  90.900 ++	break;
  90.901 ++      case upper:
  90.902 ++	__ret = __wctype_l("upper", _M_c_locale_ctype);
  90.903 ++	break;
  90.904 ++      case lower:
  90.905 ++	__ret = __wctype_l("lower", _M_c_locale_ctype);
  90.906 ++	break;
  90.907 ++      case alpha:
  90.908 ++	__ret = __wctype_l("alpha", _M_c_locale_ctype);
  90.909 ++	break;
  90.910 ++      case digit:
  90.911 ++	__ret = __wctype_l("digit", _M_c_locale_ctype);
  90.912 ++	break;
  90.913 ++      case punct:
  90.914 ++	__ret = __wctype_l("punct", _M_c_locale_ctype);
  90.915 ++	break;
  90.916 ++      case xdigit:
  90.917 ++	__ret = __wctype_l("xdigit", _M_c_locale_ctype);
  90.918 ++	break;
  90.919 ++      case alnum:
  90.920 ++	__ret = __wctype_l("alnum", _M_c_locale_ctype);
  90.921 ++	break;
  90.922 ++      case graph:
  90.923 ++	__ret = __wctype_l("graph", _M_c_locale_ctype);
  90.924 ++	break;
  90.925 ++      default:
  90.926 ++	__ret = __wmask_type();
  90.927 ++      }
  90.928 ++    return __ret;
  90.929 ++  }
  90.930 ++  
  90.931 ++  wchar_t
  90.932 ++  ctype<wchar_t>::do_toupper(wchar_t __c) const
  90.933 ++  { return __towupper_l(__c, _M_c_locale_ctype); }
  90.934 ++
  90.935 ++  const wchar_t*
  90.936 ++  ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
  90.937 ++  {
  90.938 ++    while (__lo < __hi)
  90.939 ++      {
  90.940 ++        *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
  90.941 ++        ++__lo;
  90.942 ++      }
  90.943 ++    return __hi;
  90.944 ++  }
  90.945 ++  
  90.946 ++  wchar_t
  90.947 ++  ctype<wchar_t>::do_tolower(wchar_t __c) const
  90.948 ++  { return __towlower_l(__c, _M_c_locale_ctype); }
  90.949 ++  
  90.950 ++  const wchar_t*
  90.951 ++  ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
  90.952 ++  {
  90.953 ++    while (__lo < __hi)
  90.954 ++      {
  90.955 ++        *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
  90.956 ++        ++__lo;
  90.957 ++      }
  90.958 ++    return __hi;
  90.959 ++  }
  90.960 ++
  90.961 ++  bool
  90.962 ++  ctype<wchar_t>::
  90.963 ++  do_is(mask __m, wchar_t __c) const
  90.964 ++  { 
  90.965 ++    // Highest bitmask in ctype_base == 10, but extra in "C"
  90.966 ++    // library for blank.
  90.967 ++    bool __ret = false;
  90.968 ++    const size_t __bitmasksize = 11; 
  90.969 ++    for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
  90.970 ++      if (__m & _M_bit[__bitcur]
  90.971 ++	  && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
  90.972 ++	{
  90.973 ++	  __ret = true;
  90.974 ++	  break;
  90.975 ++	}
  90.976 ++    return __ret;    
  90.977 ++  }
  90.978 ++  
  90.979 ++  const wchar_t* 
  90.980 ++  ctype<wchar_t>::
  90.981 ++  do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
  90.982 ++  {
  90.983 ++    for (; __lo < __hi; ++__vec, ++__lo)
  90.984 ++      {
  90.985 ++	// Highest bitmask in ctype_base == 10, but extra in "C"
  90.986 ++	// library for blank.
  90.987 ++	const size_t __bitmasksize = 11; 
  90.988 ++	mask __m = 0;
  90.989 ++	for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
  90.990 ++	  if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
  90.991 ++	    __m |= _M_bit[__bitcur];
  90.992 ++	*__vec = __m;
  90.993 ++      }
  90.994 ++    return __hi;
  90.995 ++  }
  90.996 ++  
  90.997 ++  const wchar_t* 
  90.998 ++  ctype<wchar_t>::
  90.999 ++  do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
 90.1000 ++  {
 90.1001 ++    while (__lo < __hi && !this->do_is(__m, *__lo))
 90.1002 ++      ++__lo;
 90.1003 ++    return __lo;
 90.1004 ++  }
 90.1005 ++
 90.1006 ++  const wchar_t*
 90.1007 ++  ctype<wchar_t>::
 90.1008 ++  do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
 90.1009 ++  {
 90.1010 ++    while (__lo < __hi && this->do_is(__m, *__lo) != 0)
 90.1011 ++      ++__lo;
 90.1012 ++    return __lo;
 90.1013 ++  }
 90.1014 ++
 90.1015 ++  wchar_t
 90.1016 ++  ctype<wchar_t>::
 90.1017 ++  do_widen(char __c) const
 90.1018 ++  { return _M_widen[static_cast<unsigned char>(__c)]; }
 90.1019 ++
 90.1020 ++  const char* 
 90.1021 ++  ctype<wchar_t>::
 90.1022 ++  do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
 90.1023 ++  {
 90.1024 ++    while (__lo < __hi)
 90.1025 ++      {
 90.1026 ++	*__dest = _M_widen[static_cast<unsigned char>(*__lo)];
 90.1027 ++	++__lo;
 90.1028 ++	++__dest;
 90.1029 ++      }
 90.1030 ++    return __hi;
 90.1031 ++  }
 90.1032 ++
 90.1033 ++  char
 90.1034 ++  ctype<wchar_t>::
 90.1035 ++  do_narrow(wchar_t __wc, char __dfault) const
 90.1036 ++  {
 90.1037 ++    if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
 90.1038 ++      return _M_narrow[__wc];
 90.1039 ++#ifdef __UCLIBC_HAS_XLOCALE__
 90.1040 ++    __c_locale __old = __uselocale(_M_c_locale_ctype);
 90.1041 ++#endif
 90.1042 ++    const int __c = wctob(__wc);
 90.1043 ++#ifdef __UCLIBC_HAS_XLOCALE__
 90.1044 ++    __uselocale(__old);
 90.1045 ++#endif
 90.1046 ++    return (__c == EOF ? __dfault : static_cast<char>(__c)); 
 90.1047 ++  }
 90.1048 ++
 90.1049 ++  const wchar_t*
 90.1050 ++  ctype<wchar_t>::
 90.1051 ++  do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault, 
 90.1052 ++	    char* __dest) const
 90.1053 ++  {
 90.1054 ++#ifdef __UCLIBC_HAS_XLOCALE__
 90.1055 ++    __c_locale __old = __uselocale(_M_c_locale_ctype);
 90.1056 ++#endif
 90.1057 ++    if (_M_narrow_ok)
 90.1058 ++      while (__lo < __hi)
 90.1059 ++	{
 90.1060 ++	  if (*__lo >= 0 && *__lo < 128)
 90.1061 ++	    *__dest = _M_narrow[*__lo];
 90.1062 ++	  else
 90.1063 ++	    {
 90.1064 ++	      const int __c = wctob(*__lo);
 90.1065 ++	      *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
 90.1066 ++	    }
 90.1067 ++	  ++__lo;
 90.1068 ++	  ++__dest;
 90.1069 ++	}
 90.1070 ++    else
 90.1071 ++      while (__lo < __hi)
 90.1072 ++	{
 90.1073 ++	  const int __c = wctob(*__lo);
 90.1074 ++	  *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
 90.1075 ++	  ++__lo;
 90.1076 ++	  ++__dest;
 90.1077 ++	}
 90.1078 ++#ifdef __UCLIBC_HAS_XLOCALE__
 90.1079 ++    __uselocale(__old);
 90.1080 ++#endif
 90.1081 ++    return __hi;
 90.1082 ++  }
 90.1083 ++
 90.1084 ++  void
 90.1085 ++  ctype<wchar_t>::_M_initialize_ctype()
 90.1086 ++  {
 90.1087 ++#ifdef __UCLIBC_HAS_XLOCALE__
 90.1088 ++    __c_locale __old = __uselocale(_M_c_locale_ctype);
 90.1089 ++#endif
 90.1090 ++    wint_t __i;
 90.1091 ++    for (__i = 0; __i < 128; ++__i)
 90.1092 ++      {
 90.1093 ++	const int __c = wctob(__i);
 90.1094 ++	if (__c == EOF)
 90.1095 ++	  break;
 90.1096 ++	else
 90.1097 ++	  _M_narrow[__i] = static_cast<char>(__c);
 90.1098 ++      }
 90.1099 ++    if (__i == 128)
 90.1100 ++      _M_narrow_ok = true;
 90.1101 ++    else
 90.1102 ++      _M_narrow_ok = false;
 90.1103 ++    for (size_t __j = 0;
 90.1104 ++	 __j < sizeof(_M_widen) / sizeof(wint_t); ++__j)
 90.1105 ++      _M_widen[__j] = btowc(__j);
 90.1106 ++
 90.1107 ++    for (size_t __k = 0; __k <= 11; ++__k)
 90.1108 ++      { 
 90.1109 ++	_M_bit[__k] = static_cast<mask>(_ISbit(__k));
 90.1110 ++	_M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
 90.1111 ++      }
 90.1112 ++#ifdef __UCLIBC_HAS_XLOCALE__
 90.1113 ++    __uselocale(__old);
 90.1114 ++#endif
 90.1115 ++  }
 90.1116 ++#endif //  _GLIBCXX_USE_WCHAR_T
 90.1117 ++}
 90.1118 +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
 90.1119 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc	1970-01-01 01:00:00.000000000 +0100
 90.1120 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.cc	2008-06-10 14:45:35.000000000 +0200
 90.1121 +@@ -0,0 +1,100 @@
 90.1122 ++// std::messages implementation details, GNU version -*- C++ -*-
 90.1123 ++
 90.1124 ++// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
 90.1125 ++//
 90.1126 ++// This file is part of the GNU ISO C++ Library.  This library is free
 90.1127 ++// software; you can redistribute it and/or modify it under the
 90.1128 ++// terms of the GNU General Public License as published by the
 90.1129 ++// Free Software Foundation; either version 2, or (at your option)
 90.1130 ++// any later version.
 90.1131 ++
 90.1132 ++// This library is distributed in the hope that it will be useful,
 90.1133 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 90.1134 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 90.1135 ++// GNU General Public License for more details.
 90.1136 ++
 90.1137 ++// You should have received a copy of the GNU General Public License along
 90.1138 ++// with this library; see the file COPYING.  If not, write to the Free
 90.1139 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 90.1140 ++// USA.
 90.1141 ++
 90.1142 ++// As a special exception, you may use this file as part of a free software
 90.1143 ++// library without restriction.  Specifically, if other files instantiate
 90.1144 ++// templates or use macros or inline functions from this file, or you compile
 90.1145 ++// this file and link it with other files to produce an executable, this
 90.1146 ++// file does not by itself cause the resulting executable to be covered by
 90.1147 ++// the GNU General Public License.  This exception does not however
 90.1148 ++// invalidate any other reasons why the executable file might be covered by
 90.1149 ++// the GNU General Public License.
 90.1150 ++
 90.1151 ++//
 90.1152 ++// ISO C++ 14882: 22.2.7.1.2  messages virtual functions
 90.1153 ++//
 90.1154 ++
 90.1155 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 90.1156 ++
 90.1157 ++#include <locale>
 90.1158 ++#include <bits/c++locale_internal.h>
 90.1159 ++
 90.1160 ++#ifdef __UCLIBC_MJN3_ONLY__
 90.1161 ++#warning fix gettext stuff
 90.1162 ++#endif
 90.1163 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 90.1164 ++extern "C" char *__dcgettext(const char *domainname,
 90.1165 ++			     const char *msgid, int category);
 90.1166 ++#undef gettext
 90.1167 ++#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
 90.1168 ++#else
 90.1169 ++#undef gettext
 90.1170 ++#define gettext(msgid) (msgid)
 90.1171 ++#endif
 90.1172 ++
 90.1173 ++namespace std
 90.1174 ++{
 90.1175 ++  // Specializations.
 90.1176 ++  template<>
 90.1177 ++    string
 90.1178 ++    messages<char>::do_get(catalog, int, int, const string& __dfault) const
 90.1179 ++    {
 90.1180 ++#ifdef __UCLIBC_HAS_XLOCALE__
 90.1181 ++      __c_locale __old = __uselocale(_M_c_locale_messages);
 90.1182 ++      const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
 90.1183 ++      __uselocale(__old);
 90.1184 ++      return string(__msg);
 90.1185 ++#elif defined __UCLIBC_HAS_LOCALE__
 90.1186 ++      char* __old = strdup(setlocale(LC_ALL, NULL));
 90.1187 ++      setlocale(LC_ALL, _M_name_messages);
 90.1188 ++      const char* __msg = gettext(__dfault.c_str());
 90.1189 ++      setlocale(LC_ALL, __old);
 90.1190 ++      free(__old);
 90.1191 ++      return string(__msg);
 90.1192 ++#else
 90.1193 ++      const char* __msg = gettext(__dfault.c_str());
 90.1194 ++      return string(__msg);
 90.1195 ++#endif
 90.1196 ++    }
 90.1197 ++
 90.1198 ++#ifdef _GLIBCXX_USE_WCHAR_T
 90.1199 ++  template<>
 90.1200 ++    wstring
 90.1201 ++    messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
 90.1202 ++    {
 90.1203 ++# ifdef __UCLIBC_HAS_XLOCALE__
 90.1204 ++      __c_locale __old = __uselocale(_M_c_locale_messages);
 90.1205 ++      char* __msg = gettext(_M_convert_to_char(__dfault));
 90.1206 ++      __uselocale(__old);
 90.1207 ++      return _M_convert_from_char(__msg);
 90.1208 ++# elif defined __UCLIBC_HAS_LOCALE__
 90.1209 ++      char* __old = strdup(setlocale(LC_ALL, NULL));
 90.1210 ++      setlocale(LC_ALL, _M_name_messages);
 90.1211 ++      char* __msg = gettext(_M_convert_to_char(__dfault));
 90.1212 ++      setlocale(LC_ALL, __old);
 90.1213 ++      free(__old);
 90.1214 ++      return _M_convert_from_char(__msg);
 90.1215 ++# else
 90.1216 ++      char* __msg = gettext(_M_convert_to_char(__dfault));
 90.1217 ++      return _M_convert_from_char(__msg);
 90.1218 ++# endif
 90.1219 ++    }
 90.1220 ++#endif
 90.1221 ++}
 90.1222 +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
 90.1223 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	1970-01-01 01:00:00.000000000 +0100
 90.1224 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:45:35.000000000 +0200
 90.1225 +@@ -0,0 +1,118 @@
 90.1226 ++// std::messages implementation details, GNU version -*- C++ -*-
 90.1227 ++
 90.1228 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 90.1229 ++//
 90.1230 ++// This file is part of the GNU ISO C++ Library.  This library is free
 90.1231 ++// software; you can redistribute it and/or modify it under the
 90.1232 ++// terms of the GNU General Public License as published by the
 90.1233 ++// Free Software Foundation; either version 2, or (at your option)
 90.1234 ++// any later version.
 90.1235 ++
 90.1236 ++// This library is distributed in the hope that it will be useful,
 90.1237 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 90.1238 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 90.1239 ++// GNU General Public License for more details.
 90.1240 ++
 90.1241 ++// You should have received a copy of the GNU General Public License along
 90.1242 ++// with this library; see the file COPYING.  If not, write to the Free
 90.1243 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 90.1244 ++// USA.
 90.1245 ++
 90.1246 ++// As a special exception, you may use this file as part of a free software
 90.1247 ++// library without restriction.  Specifically, if other files instantiate
 90.1248 ++// templates or use macros or inline functions from this file, or you compile
 90.1249 ++// this file and link it with other files to produce an executable, this
 90.1250 ++// file does not by itself cause the resulting executable to be covered by
 90.1251 ++// the GNU General Public License.  This exception does not however
 90.1252 ++// invalidate any other reasons why the executable file might be covered by
 90.1253 ++// the GNU General Public License.
 90.1254 ++
 90.1255 ++//
 90.1256 ++// ISO C++ 14882: 22.2.7.1.2  messages functions
 90.1257 ++//
 90.1258 ++
 90.1259 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 90.1260 ++
 90.1261 ++#ifdef __UCLIBC_MJN3_ONLY__
 90.1262 ++#warning fix prototypes for *textdomain funcs
 90.1263 ++#endif
 90.1264 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 90.1265 ++extern "C" char *__textdomain(const char *domainname);
 90.1266 ++extern "C" char *__bindtextdomain(const char *domainname,
 90.1267 ++				  const char *dirname);
 90.1268 ++#else
 90.1269 ++#undef __textdomain
 90.1270 ++#undef __bindtextdomain
 90.1271 ++#define __textdomain(D)           ((void)0)
 90.1272 ++#define __bindtextdomain(D,P)     ((void)0)
 90.1273 ++#endif
 90.1274 ++
 90.1275 ++  // Non-virtual member functions.
 90.1276 ++  template<typename _CharT>
 90.1277 ++     messages<_CharT>::messages(size_t __refs)
 90.1278 ++     : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), 
 90.1279 ++     _M_name_messages(_S_get_c_name())
 90.1280 ++     { }
 90.1281 ++
 90.1282 ++  template<typename _CharT>
 90.1283 ++     messages<_CharT>::messages(__c_locale __cloc, const char* __s, 
 90.1284 ++				size_t __refs) 
 90.1285 ++     : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
 90.1286 ++     _M_name_messages(__s)
 90.1287 ++     {
 90.1288 ++       char* __tmp = new char[std::strlen(__s) + 1];
 90.1289 ++       std::strcpy(__tmp, __s);
 90.1290 ++       _M_name_messages = __tmp;
 90.1291 ++     }
 90.1292 ++
 90.1293 ++  template<typename _CharT>
 90.1294 ++    typename messages<_CharT>::catalog 
 90.1295 ++    messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, 
 90.1296 ++			   const char* __dir) const
 90.1297 ++    { 
 90.1298 ++      __bindtextdomain(__s.c_str(), __dir);
 90.1299 ++      return this->do_open(__s, __loc); 
 90.1300 ++    }
 90.1301 ++
 90.1302 ++  // Virtual member functions.
 90.1303 ++  template<typename _CharT>
 90.1304 ++    messages<_CharT>::~messages()
 90.1305 ++    { 
 90.1306 ++      if (_M_name_messages != _S_get_c_name())
 90.1307 ++	delete [] _M_name_messages;
 90.1308 ++      _S_destroy_c_locale(_M_c_locale_messages); 
 90.1309 ++    }
 90.1310 ++
 90.1311 ++  template<typename _CharT>
 90.1312 ++    typename messages<_CharT>::catalog 
 90.1313 ++    messages<_CharT>::do_open(const basic_string<char>& __s, 
 90.1314 ++			      const locale&) const
 90.1315 ++    { 
 90.1316 ++      // No error checking is done, assume the catalog exists and can
 90.1317 ++      // be used.
 90.1318 ++      __textdomain(__s.c_str());
 90.1319 ++      return 0;
 90.1320 ++    }
 90.1321 ++
 90.1322 ++  template<typename _CharT>
 90.1323 ++    void    
 90.1324 ++    messages<_CharT>::do_close(catalog) const 
 90.1325 ++    { }
 90.1326 ++
 90.1327 ++   // messages_byname
 90.1328 ++   template<typename _CharT>
 90.1329 ++     messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
 90.1330 ++     : messages<_CharT>(__refs) 
 90.1331 ++     { 
 90.1332 ++       if (this->_M_name_messages != locale::facet::_S_get_c_name())
 90.1333 ++	 delete [] this->_M_name_messages;
 90.1334 ++       char* __tmp = new char[std::strlen(__s) + 1];
 90.1335 ++       std::strcpy(__tmp, __s);
 90.1336 ++       this->_M_name_messages = __tmp;
 90.1337 ++
 90.1338 ++       if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
 90.1339 ++	 {
 90.1340 ++	   this->_S_destroy_c_locale(this->_M_c_locale_messages);
 90.1341 ++	   this->_S_create_c_locale(this->_M_c_locale_messages, __s); 
 90.1342 ++	 }
 90.1343 ++     }
 90.1344 +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
 90.1345 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	1970-01-01 01:00:00.000000000 +0100
 90.1346 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:45:35.000000000 +0200
 90.1347 +@@ -0,0 +1,692 @@
 90.1348 ++// std::moneypunct implementation details, GNU version -*- C++ -*-
 90.1349 ++
 90.1350 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 90.1351 ++//
 90.1352 ++// This file is part of the GNU ISO C++ Library.  This library is free
 90.1353 ++// software; you can redistribute it and/or modify it under the
 90.1354 ++// terms of the GNU General Public License as published by the
 90.1355 ++// Free Software Foundation; either version 2, or (at your option)
 90.1356 ++// any later version.
 90.1357 ++
 90.1358 ++// This library is distributed in the hope that it will be useful,
 90.1359 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 90.1360 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 90.1361 ++// GNU General Public License for more details.
 90.1362 ++
 90.1363 ++// You should have received a copy of the GNU General Public License along
 90.1364 ++// with this library; see the file COPYING.  If not, write to the Free
 90.1365 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 90.1366 ++// USA.
 90.1367 ++
 90.1368 ++// As a special exception, you may use this file as part of a free software
 90.1369 ++// library without restriction.  Specifically, if other files instantiate
 90.1370 ++// templates or use macros or inline functions from this file, or you compile
 90.1371 ++// this file and link it with other files to produce an executable, this
 90.1372 ++// file does not by itself cause the resulting executable to be covered by
 90.1373 ++// the GNU General Public License.  This exception does not however
 90.1374 ++// invalidate any other reasons why the executable file might be covered by
 90.1375 ++// the GNU General Public License.
 90.1376 ++
 90.1377 ++//
 90.1378 ++// ISO C++ 14882: 22.2.6.3.2  moneypunct virtual functions
 90.1379 ++//
 90.1380 ++
 90.1381 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 90.1382 ++
 90.1383 ++#define _LIBC
 90.1384 ++#include <locale>
 90.1385 ++#undef _LIBC
 90.1386 ++#include <bits/c++locale_internal.h>
 90.1387 ++
 90.1388 ++#ifdef __UCLIBC_MJN3_ONLY__
 90.1389 ++#warning optimize this for uclibc
 90.1390 ++#warning tailor for stub locale support
 90.1391 ++#endif
 90.1392 ++
 90.1393 ++#ifndef __UCLIBC_HAS_XLOCALE__
 90.1394 ++#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 90.1395 ++#endif
 90.1396 ++
 90.1397 ++namespace std
 90.1398 ++{
 90.1399 ++  // Construct and return valid pattern consisting of some combination of:
 90.1400 ++  // space none symbol sign value
 90.1401 ++  money_base::pattern
 90.1402 ++  money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
 90.1403 ++  { 
 90.1404 ++    pattern __ret;
 90.1405 ++
 90.1406 ++    // This insanely complicated routine attempts to construct a valid
 90.1407 ++    // pattern for use with monyepunct. A couple of invariants:
 90.1408 ++
 90.1409 ++    // if (__precedes) symbol -> value
 90.1410 ++    // else value -> symbol
 90.1411 ++    
 90.1412 ++    // if (__space) space
 90.1413 ++    // else none
 90.1414 ++
 90.1415 ++    // none == never first
 90.1416 ++    // space never first or last
 90.1417 ++
 90.1418 ++    // Any elegant implementations of this are welcome.
 90.1419 ++    switch (__posn)
 90.1420 ++      {
 90.1421 ++      case 0:
 90.1422 ++      case 1:
 90.1423 ++	// 1 The sign precedes the value and symbol.
 90.1424 ++	__ret.field[0] = sign;
 90.1425 ++	if (__space)
 90.1426 ++	  {
 90.1427 ++	    // Pattern starts with sign.
 90.1428 ++	    if (__precedes)
 90.1429 ++	      {
 90.1430 ++		__ret.field[1] = symbol;
 90.1431 ++		__ret.field[3] = value;
 90.1432 ++	      }
 90.1433 ++	    else
 90.1434 ++	      {
 90.1435 ++		__ret.field[1] = value;
 90.1436 ++		__ret.field[3] = symbol;
 90.1437 ++	      }
 90.1438 ++	    __ret.field[2] = space;
 90.1439 ++	  }
 90.1440 ++	else
 90.1441 ++	  {
 90.1442 ++	    // Pattern starts with sign and ends with none.
 90.1443 ++	    if (__precedes)
 90.1444 ++	      {
 90.1445 ++		__ret.field[1] = symbol;
 90.1446 ++		__ret.field[2] = value;
 90.1447 ++	      }
 90.1448 ++	    else
 90.1449 ++	      {
 90.1450 ++		__ret.field[1] = value;
 90.1451 ++		__ret.field[2] = symbol;
 90.1452 ++	      }
 90.1453 ++	    __ret.field[3] = none;
 90.1454 ++	  }
 90.1455 ++	break;
 90.1456 ++      case 2:
 90.1457 ++	// 2 The sign follows the value and symbol.
 90.1458 ++	if (__space)
 90.1459 ++	  {
 90.1460 ++	    // Pattern either ends with sign.
 90.1461 ++	    if (__precedes)
 90.1462 ++	      {
 90.1463 ++		__ret.field[0] = symbol;
 90.1464 ++		__ret.field[2] = value;
 90.1465 ++	      }
 90.1466 ++	    else
 90.1467 ++	      {
 90.1468 ++		__ret.field[0] = value;
 90.1469 ++		__ret.field[2] = symbol;
 90.1470 ++	      }
 90.1471 ++	    __ret.field[1] = space;
 90.1472 ++	    __ret.field[3] = sign;
 90.1473 ++	  }
 90.1474 ++	else
 90.1475 ++	  {
 90.1476 ++	    // Pattern ends with sign then none.
 90.1477 ++	    if (__precedes)
 90.1478 ++	      {
 90.1479 ++		__ret.field[0] = symbol;
 90.1480 ++		__ret.field[1] = value;
 90.1481 ++	      }
 90.1482 ++	    else
 90.1483 ++	      {
 90.1484 ++		__ret.field[0] = value;
 90.1485 ++		__ret.field[1] = symbol;
 90.1486 ++	      }
 90.1487 ++	    __ret.field[2] = sign;
 90.1488 ++	    __ret.field[3] = none;
 90.1489 ++	  }
 90.1490 ++	break;
 90.1491 ++      case 3:
 90.1492 ++	// 3 The sign immediately precedes the symbol.
 90.1493 ++	if (__precedes)
 90.1494 ++	  {
 90.1495 ++	    __ret.field[0] = sign;
 90.1496 ++	    __ret.field[1] = symbol;	    
 90.1497 ++	    if (__space)
 90.1498 ++	      {
 90.1499 ++		__ret.field[2] = space;
 90.1500 ++		__ret.field[3] = value;
 90.1501 ++	      }
 90.1502 ++	    else
 90.1503 ++	      {
 90.1504 ++		__ret.field[2] = value;		
 90.1505 ++		__ret.field[3] = none;
 90.1506 ++	      }
 90.1507 ++	  }
 90.1508 ++	else
 90.1509 ++	  {
 90.1510 ++	    __ret.field[0] = value;
 90.1511 ++	    if (__space)
 90.1512 ++	      {
 90.1513 ++		__ret.field[1] = space;
 90.1514 ++		__ret.field[2] = sign;
 90.1515 ++		__ret.field[3] = symbol;
 90.1516 ++	      }
 90.1517 ++	    else
 90.1518 ++	      {
 90.1519 ++		__ret.field[1] = sign;
 90.1520 ++		__ret.field[2] = symbol;
 90.1521 ++		__ret.field[3] = none;
 90.1522 ++	      }
 90.1523 ++	  }
 90.1524 ++	break;
 90.1525 ++      case 4:
 90.1526 ++	// 4 The sign immediately follows the symbol.
 90.1527 ++	if (__precedes)
 90.1528 ++	  {
 90.1529 ++	    __ret.field[0] = symbol;
 90.1530 ++	    __ret.field[1] = sign;
 90.1531 ++	    if (__space)
 90.1532 ++	      {
 90.1533 ++		__ret.field[2] = space;
 90.1534 ++		__ret.field[3] = value;
 90.1535 ++	      }
 90.1536 ++	    else
 90.1537 ++	      {
 90.1538 ++		__ret.field[2] = value;
 90.1539 ++		__ret.field[3] = none;
 90.1540 ++	      }
 90.1541 ++	  }
 90.1542 ++	else
 90.1543 ++	  {
 90.1544 ++	    __ret.field[0] = value;
 90.1545 ++	    if (__space)
 90.1546 ++	      {
 90.1547 ++		__ret.field[1] = space;
 90.1548 ++		__ret.field[2] = symbol;
 90.1549 ++		__ret.field[3] = sign;
 90.1550 ++	      }
 90.1551 ++	    else
 90.1552 ++	      {
 90.1553 ++		__ret.field[1] = symbol;
 90.1554 ++		__ret.field[2] = sign;
 90.1555 ++		__ret.field[3] = none;
 90.1556 ++	      }
 90.1557 ++	  }
 90.1558 ++	break;
 90.1559 ++      default:
 90.1560 ++	;
 90.1561 ++      }
 90.1562 ++    return __ret;
 90.1563 ++  }
 90.1564 ++
 90.1565 ++  template<> 
 90.1566 ++    void
 90.1567 ++    moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc, 
 90.1568 ++						     const char*)
 90.1569 ++    {
 90.1570 ++      if (!_M_data)
 90.1571 ++	_M_data = new __moneypunct_cache<char, true>;
 90.1572 ++
 90.1573 ++      if (!__cloc)
 90.1574 ++	{
 90.1575 ++	  // "C" locale
 90.1576 ++	  _M_data->_M_decimal_point = '.';
 90.1577 ++	  _M_data->_M_thousands_sep = ',';
 90.1578 ++	  _M_data->_M_grouping = "";
 90.1579 ++	  _M_data->_M_grouping_size = 0;
 90.1580 ++	  _M_data->_M_curr_symbol = "";
 90.1581 ++	  _M_data->_M_curr_symbol_size = 0;
 90.1582 ++	  _M_data->_M_positive_sign = "";
 90.1583 ++	  _M_data->_M_positive_sign_size = 0;
 90.1584 ++	  _M_data->_M_negative_sign = "";
 90.1585 ++	  _M_data->_M_negative_sign_size = 0;
 90.1586 ++	  _M_data->_M_frac_digits = 0;
 90.1587 ++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
 90.1588 ++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
 90.1589 ++
 90.1590 ++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
 90.1591 ++	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
 90.1592 ++	}
 90.1593 ++      else
 90.1594 ++	{
 90.1595 ++	  // Named locale.
 90.1596 ++	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
 90.1597 ++							__cloc));
 90.1598 ++	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
 90.1599 ++							__cloc));
 90.1600 ++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
 90.1601 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
 90.1602 ++	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
 90.1603 ++	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
 90.1604 ++
 90.1605 ++	  char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
 90.1606 ++	  if (!__nposn)
 90.1607 ++	    _M_data->_M_negative_sign = "()";
 90.1608 ++	  else
 90.1609 ++	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, 
 90.1610 ++							__cloc);
 90.1611 ++	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
 90.1612 ++
 90.1613 ++	  // _Intl == true
 90.1614 ++	  _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
 90.1615 ++	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
 90.1616 ++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
 90.1617 ++						      __cloc));
 90.1618 ++	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
 90.1619 ++	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
 90.1620 ++	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
 90.1621 ++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
 90.1622 ++							__pposn);
 90.1623 ++	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
 90.1624 ++	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
 90.1625 ++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
 90.1626 ++							__nposn);
 90.1627 ++	}
 90.1628 ++    }
 90.1629 ++
 90.1630 ++  template<> 
 90.1631 ++    void
 90.1632 ++    moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc, 
 90.1633 ++						      const char*)
 90.1634 ++    {
 90.1635 ++      if (!_M_data)
 90.1636 ++	_M_data = new __moneypunct_cache<char, false>;
 90.1637 ++
 90.1638 ++      if (!__cloc)
 90.1639 ++	{
 90.1640 ++	  // "C" locale
 90.1641 ++	  _M_data->_M_decimal_point = '.';
 90.1642 ++	  _M_data->_M_thousands_sep = ',';
 90.1643 ++	  _M_data->_M_grouping = "";
 90.1644 ++	  _M_data->_M_grouping_size = 0;
 90.1645 ++	  _M_data->_M_curr_symbol = "";
 90.1646 ++	  _M_data->_M_curr_symbol_size = 0;
 90.1647 ++	  _M_data->_M_positive_sign = "";
 90.1648 ++	  _M_data->_M_positive_sign_size = 0;
 90.1649 ++	  _M_data->_M_negative_sign = "";
 90.1650 ++	  _M_data->_M_negative_sign_size = 0;
 90.1651 ++	  _M_data->_M_frac_digits = 0;
 90.1652 ++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
 90.1653 ++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
 90.1654 ++
 90.1655 ++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
 90.1656 ++	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
 90.1657 ++	}
 90.1658 ++      else
 90.1659 ++	{
 90.1660 ++	  // Named locale.
 90.1661 ++	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
 90.1662 ++							__cloc));
 90.1663 ++	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
 90.1664 ++							__cloc));
 90.1665 ++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
 90.1666 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
 90.1667 ++	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
 90.1668 ++	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
 90.1669 ++
 90.1670 ++	  char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
 90.1671 ++	  if (!__nposn)
 90.1672 ++	    _M_data->_M_negative_sign = "()";
 90.1673 ++	  else
 90.1674 ++	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
 90.1675 ++							__cloc);
 90.1676 ++	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
 90.1677 ++
 90.1678 ++	  // _Intl == false
 90.1679 ++	  _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
 90.1680 ++	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
 90.1681 ++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
 90.1682 ++	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
 90.1683 ++	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
 90.1684 ++	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
 90.1685 ++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
 90.1686 ++							__pposn);
 90.1687 ++	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
 90.1688 ++	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
 90.1689 ++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
 90.1690 ++							__nposn);
 90.1691 ++	}
 90.1692 ++    }
 90.1693 ++
 90.1694 ++  template<> 
 90.1695 ++    moneypunct<char, true>::~moneypunct()
 90.1696 ++    { delete _M_data; }
 90.1697 ++
 90.1698 ++  template<> 
 90.1699 ++    moneypunct<char, false>::~moneypunct()
 90.1700 ++    { delete _M_data; }
 90.1701 ++
 90.1702 ++#ifdef _GLIBCXX_USE_WCHAR_T
 90.1703 ++  template<> 
 90.1704 ++    void
 90.1705 ++    moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc, 
 90.1706 ++#ifdef __UCLIBC_HAS_XLOCALE__
 90.1707 ++							const char*)
 90.1708 ++#else
 90.1709 ++							const char* __name)
 90.1710 ++#endif
 90.1711 ++    {
 90.1712 ++      if (!_M_data)
 90.1713 ++	_M_data = new __moneypunct_cache<wchar_t, true>;
 90.1714 ++
 90.1715 ++      if (!__cloc)
 90.1716 ++	{
 90.1717 ++	  // "C" locale
 90.1718 ++	  _M_data->_M_decimal_point = L'.';
 90.1719 ++	  _M_data->_M_thousands_sep = L',';
 90.1720 ++	  _M_data->_M_grouping = "";
 90.1721 ++	  _M_data->_M_grouping_size = 0;
 90.1722 ++	  _M_data->_M_curr_symbol = L"";
 90.1723 ++	  _M_data->_M_curr_symbol_size = 0;
 90.1724 ++	  _M_data->_M_positive_sign = L"";
 90.1725 ++	  _M_data->_M_positive_sign_size = 0;
 90.1726 ++	  _M_data->_M_negative_sign = L"";
 90.1727 ++	  _M_data->_M_negative_sign_size = 0;
 90.1728 ++	  _M_data->_M_frac_digits = 0;
 90.1729 ++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
 90.1730 ++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
 90.1731 ++
 90.1732 ++	  // Use ctype::widen code without the facet...
 90.1733 ++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
 90.1734 ++	    _M_data->_M_atoms[__i] =
 90.1735 ++	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
 90.1736 ++	}
 90.1737 ++      else
 90.1738 ++	{
 90.1739 ++	  // Named locale.
 90.1740 ++#ifdef __UCLIBC_HAS_XLOCALE__
 90.1741 ++	  __c_locale __old = __uselocale(__cloc);
 90.1742 ++#else
 90.1743 ++	  // Switch to named locale so that mbsrtowcs will work.
 90.1744 ++	  char* __old = strdup(setlocale(LC_ALL, NULL));
 90.1745 ++	  setlocale(LC_ALL, __name);
 90.1746 ++#endif
 90.1747 ++
 90.1748 ++#ifdef __UCLIBC_MJN3_ONLY__
 90.1749 ++#warning fix this... should be monetary
 90.1750 ++#endif
 90.1751 ++#ifdef __UCLIBC__
 90.1752 ++# ifdef __UCLIBC_HAS_XLOCALE__
 90.1753 ++	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
 90.1754 ++	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
 90.1755 ++# else
 90.1756 ++	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
 90.1757 ++	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
 90.1758 ++# endif
 90.1759 ++#else
 90.1760 ++	  union { char *__s; wchar_t __w; } __u;
 90.1761 ++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
 90.1762 ++	  _M_data->_M_decimal_point = __u.__w;
 90.1763 ++
 90.1764 ++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
 90.1765 ++	  _M_data->_M_thousands_sep = __u.__w;
 90.1766 ++#endif
 90.1767 ++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
 90.1768 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
 90.1769 ++
 90.1770 ++	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
 90.1771 ++	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
 90.1772 ++	  const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
 90.1773 ++
 90.1774 ++	  wchar_t* __wcs_ps = 0;
 90.1775 ++	  wchar_t* __wcs_ns = 0;
 90.1776 ++	  const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
 90.1777 ++	  try
 90.1778 ++	    {
 90.1779 ++	      mbstate_t __state;
 90.1780 ++	      size_t __len = strlen(__cpossign);
 90.1781 ++	      if (__len)
 90.1782 ++		{
 90.1783 ++		  ++__len;
 90.1784 ++		  memset(&__state, 0, sizeof(mbstate_t));
 90.1785 ++		  __wcs_ps = new wchar_t[__len];
 90.1786 ++		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
 90.1787 ++		  _M_data->_M_positive_sign = __wcs_ps;
 90.1788 ++		}
 90.1789 ++	      else
 90.1790 ++		_M_data->_M_positive_sign = L"";
 90.1791 ++	      _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
 90.1792 ++	      
 90.1793 ++	      __len = strlen(__cnegsign);
 90.1794 ++	      if (!__nposn)
 90.1795 ++		_M_data->_M_negative_sign = L"()";
 90.1796 ++	      else if (__len)
 90.1797 ++		{ 
 90.1798 ++		  ++__len;
 90.1799 ++		  memset(&__state, 0, sizeof(mbstate_t));
 90.1800 ++		  __wcs_ns = new wchar_t[__len];
 90.1801 ++		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
 90.1802 ++		  _M_data->_M_negative_sign = __wcs_ns;
 90.1803 ++		}
 90.1804 ++	      else
 90.1805 ++		_M_data->_M_negative_sign = L"";
 90.1806 ++	      _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
 90.1807 ++	      
 90.1808 ++	      // _Intl == true.
 90.1809 ++	      __len = strlen(__ccurr);
 90.1810 ++	      if (__len)
 90.1811 ++		{
 90.1812 ++		  ++__len;
 90.1813 ++		  memset(&__state, 0, sizeof(mbstate_t));
 90.1814 ++		  wchar_t* __wcs = new wchar_t[__len];
 90.1815 ++		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
 90.1816 ++		  _M_data->_M_curr_symbol = __wcs;
 90.1817 ++		}
 90.1818 ++	      else
 90.1819 ++		_M_data->_M_curr_symbol = L"";
 90.1820 ++	      _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
 90.1821 ++	    }
 90.1822 ++	  catch (...)
 90.1823 ++	    {
 90.1824 ++	      delete _M_data;
 90.1825 ++	      _M_data = 0;
 90.1826 ++	      delete __wcs_ps;
 90.1827 ++	      delete __wcs_ns;	      
 90.1828 ++#ifdef __UCLIBC_HAS_XLOCALE__
 90.1829 ++	      __uselocale(__old);
 90.1830 ++#else
 90.1831 ++	      setlocale(LC_ALL, __old);
 90.1832 ++	      free(__old);
 90.1833 ++#endif
 90.1834 ++	      __throw_exception_again;
 90.1835 ++	    } 
 90.1836 ++	  
 90.1837 ++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
 90.1838 ++						      __cloc));
 90.1839 ++	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
 90.1840 ++	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
 90.1841 ++	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
 90.1842 ++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
 90.1843 ++							__pposn);
 90.1844 ++	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
 90.1845 ++	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
 90.1846 ++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
 90.1847 ++							__nposn);
 90.1848 ++
 90.1849 ++#ifdef __UCLIBC_HAS_XLOCALE__
 90.1850 ++	  __uselocale(__old);
 90.1851 ++#else
 90.1852 ++	  setlocale(LC_ALL, __old);
 90.1853 ++	  free(__old);
 90.1854 ++#endif
 90.1855 ++	}
 90.1856 ++    }
 90.1857 ++
 90.1858 ++  template<> 
 90.1859 ++  void
 90.1860 ++  moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
 90.1861 ++#ifdef __UCLIBC_HAS_XLOCALE__
 90.1862 ++						       const char*)
 90.1863 ++#else
 90.1864 ++                                                       const char* __name)
 90.1865 ++#endif
 90.1866 ++  {
 90.1867 ++    if (!_M_data)
 90.1868 ++      _M_data = new __moneypunct_cache<wchar_t, false>;
 90.1869 ++
 90.1870 ++    if (!__cloc)
 90.1871 ++	{
 90.1872 ++	  // "C" locale
 90.1873 ++	  _M_data->_M_decimal_point = L'.';
 90.1874 ++	  _M_data->_M_thousands_sep = L',';
 90.1875 ++	  _M_data->_M_grouping = "";
 90.1876 ++          _M_data->_M_grouping_size = 0;
 90.1877 ++	  _M_data->_M_curr_symbol = L"";
 90.1878 ++	  _M_data->_M_curr_symbol_size = 0;
 90.1879 ++	  _M_data->_M_positive_sign = L"";
 90.1880 ++	  _M_data->_M_positive_sign_size = 0;
 90.1881 ++	  _M_data->_M_negative_sign = L"";
 90.1882 ++	  _M_data->_M_negative_sign_size = 0;
 90.1883 ++	  _M_data->_M_frac_digits = 0;
 90.1884 ++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
 90.1885 ++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
 90.1886 ++
 90.1887 ++	  // Use ctype::widen code without the facet...
 90.1888 ++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
 90.1889 ++	    _M_data->_M_atoms[__i] =
 90.1890 ++	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
 90.1891 ++	}
 90.1892 ++      else
 90.1893 ++	{
 90.1894 ++	  // Named locale.
 90.1895 ++#ifdef __UCLIBC_HAS_XLOCALE__
 90.1896 ++	  __c_locale __old = __uselocale(__cloc);
 90.1897 ++#else
 90.1898 ++	  // Switch to named locale so that mbsrtowcs will work.
 90.1899 ++	  char* __old = strdup(setlocale(LC_ALL, NULL));
 90.1900 ++	  setlocale(LC_ALL, __name);
 90.1901 ++#endif
 90.1902 ++
 90.1903 ++#ifdef __UCLIBC_MJN3_ONLY__
 90.1904 ++#warning fix this... should be monetary
 90.1905 ++#endif
 90.1906 ++#ifdef __UCLIBC__
 90.1907 ++# ifdef __UCLIBC_HAS_XLOCALE__
 90.1908 ++	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
 90.1909 ++	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
 90.1910 ++# else
 90.1911 ++	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
 90.1912 ++	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
 90.1913 ++# endif
 90.1914 ++#else
 90.1915 ++          union { char *__s; wchar_t __w; } __u;
 90.1916 ++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
 90.1917 ++	  _M_data->_M_decimal_point = __u.__w;
 90.1918 ++
 90.1919 ++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
 90.1920 ++	  _M_data->_M_thousands_sep = __u.__w;
 90.1921 ++#endif
 90.1922 ++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
 90.1923 ++          _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
 90.1924 ++
 90.1925 ++	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
 90.1926 ++	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
 90.1927 ++	  const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
 90.1928 ++
 90.1929 ++	  wchar_t* __wcs_ps = 0;
 90.1930 ++	  wchar_t* __wcs_ns = 0;
 90.1931 ++	  const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
 90.1932 ++	  try
 90.1933 ++            {
 90.1934 ++              mbstate_t __state;
 90.1935 ++              size_t __len;
 90.1936 ++              __len = strlen(__cpossign);
 90.1937 ++              if (__len)
 90.1938 ++                {
 90.1939 ++		  ++__len;
 90.1940 ++		  memset(&__state, 0, sizeof(mbstate_t));
 90.1941 ++		  __wcs_ps = new wchar_t[__len];
 90.1942 ++		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
 90.1943 ++		  _M_data->_M_positive_sign = __wcs_ps;
 90.1944 ++		}
 90.1945 ++	      else
 90.1946 ++		_M_data->_M_positive_sign = L"";
 90.1947 ++              _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
 90.1948 ++	      
 90.1949 ++	      __len = strlen(__cnegsign);
 90.1950 ++	      if (!__nposn)
 90.1951 ++		_M_data->_M_negative_sign = L"()";
 90.1952 ++	      else if (__len)
 90.1953 ++		{ 
 90.1954 ++		  ++__len;
 90.1955 ++		  memset(&__state, 0, sizeof(mbstate_t));
 90.1956 ++		  __wcs_ns = new wchar_t[__len];
 90.1957 ++		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
 90.1958 ++		  _M_data->_M_negative_sign = __wcs_ns;
 90.1959 ++		}
 90.1960 ++	      else
 90.1961 ++		_M_data->_M_negative_sign = L"";
 90.1962 ++              _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
 90.1963 ++
 90.1964 ++	      // _Intl == true.
 90.1965 ++	      __len = strlen(__ccurr);
 90.1966 ++	      if (__len)
 90.1967 ++		{
 90.1968 ++		  ++__len;
 90.1969 ++		  memset(&__state, 0, sizeof(mbstate_t));
 90.1970 ++		  wchar_t* __wcs = new wchar_t[__len];
 90.1971 ++		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
 90.1972 ++		  _M_data->_M_curr_symbol = __wcs;
 90.1973 ++		}
 90.1974 ++	      else
 90.1975 ++		_M_data->_M_curr_symbol = L"";
 90.1976 ++              _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
 90.1977 ++	    }
 90.1978 ++          catch (...)
 90.1979 ++	    {
 90.1980 ++	      delete _M_data;
 90.1981 ++              _M_data = 0;
 90.1982 ++	      delete __wcs_ps;
 90.1983 ++	      delete __wcs_ns;	      
 90.1984 ++#ifdef __UCLIBC_HAS_XLOCALE__
 90.1985 ++	      __uselocale(__old);
 90.1986 ++#else
 90.1987 ++	      setlocale(LC_ALL, __old);
 90.1988 ++	      free(__old);
 90.1989 ++#endif
 90.1990 ++              __throw_exception_again;
 90.1991 ++	    }
 90.1992 ++
 90.1993 ++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
 90.1994 ++	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
 90.1995 ++	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
 90.1996 ++	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
 90.1997 ++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
 90.1998 ++	                                                __pposn);
 90.1999 ++	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
 90.2000 ++	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
 90.2001 ++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
 90.2002 ++	                                                __nposn);
 90.2003 ++
 90.2004 ++#ifdef __UCLIBC_HAS_XLOCALE__
 90.2005 ++	  __uselocale(__old);
 90.2006 ++#else
 90.2007 ++	  setlocale(LC_ALL, __old);
 90.2008 ++	  free(__old);
 90.2009 ++#endif
 90.2010 ++	}
 90.2011 ++    }
 90.2012 ++
 90.2013 ++  template<> 
 90.2014 ++    moneypunct<wchar_t, true>::~moneypunct()
 90.2015 ++    {
 90.2016 ++      if (_M_data->_M_positive_sign_size)
 90.2017 ++	delete [] _M_data->_M_positive_sign;
 90.2018 ++      if (_M_data->_M_negative_sign_size
 90.2019 ++          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
 90.2020 ++	delete [] _M_data->_M_negative_sign;
 90.2021 ++      if (_M_data->_M_curr_symbol_size)
 90.2022 ++	delete [] _M_data->_M_curr_symbol;
 90.2023 ++      delete _M_data;
 90.2024 ++    }
 90.2025 ++
 90.2026 ++  template<> 
 90.2027 ++    moneypunct<wchar_t, false>::~moneypunct()
 90.2028 ++    {
 90.2029 ++      if (_M_data->_M_positive_sign_size)
 90.2030 ++	delete [] _M_data->_M_positive_sign;
 90.2031 ++      if (_M_data->_M_negative_sign_size
 90.2032 ++          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
 90.2033 ++	delete [] _M_data->_M_negative_sign;
 90.2034 ++      if (_M_data->_M_curr_symbol_size)
 90.2035 ++	delete [] _M_data->_M_curr_symbol;
 90.2036 ++      delete _M_data;
 90.2037 ++    }
 90.2038 ++#endif
 90.2039 ++}
 90.2040 +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
 90.2041 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	1970-01-01 01:00:00.000000000 +0100
 90.2042 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:45:35.000000000 +0200
 90.2043 +@@ -0,0 +1,160 @@
 90.2044 ++// std::numpunct implementation details, GNU version -*- C++ -*-
 90.2045 ++
 90.2046 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 90.2047 ++//
 90.2048 ++// This file is part of the GNU ISO C++ Library.  This library is free
 90.2049 ++// software; you can redistribute it and/or modify it under the
 90.2050 ++// terms of the GNU General Public License as published by the
 90.2051 ++// Free Software Foundation; either version 2, or (at your option)
 90.2052 ++// any later version.
 90.2053 ++
 90.2054 ++// This library is distributed in the hope that it will be useful,
 90.2055 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 90.2056 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 90.2057 ++// GNU General Public License for more details.
 90.2058 ++
 90.2059 ++// You should have received a copy of the GNU General Public License along
 90.2060 ++// with this library; see the file COPYING.  If not, write to the Free
 90.2061 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 90.2062 ++// USA.
 90.2063 ++
 90.2064 ++// As a special exception, you may use this file as part of a free software
 90.2065 ++// library without restriction.  Specifically, if other files instantiate
 90.2066 ++// templates or use macros or inline functions from this file, or you compile
 90.2067 ++// this file and link it with other files to produce an executable, this
 90.2068 ++// file does not by itself cause the resulting executable to be covered by
 90.2069 ++// the GNU General Public License.  This exception does not however
 90.2070 ++// invalidate any other reasons why the executable file might be covered by
 90.2071 ++// the GNU General Public License.
 90.2072 ++
 90.2073 ++//
 90.2074 ++// ISO C++ 14882: 22.2.3.1.2  numpunct virtual functions
 90.2075 ++//
 90.2076 ++
 90.2077 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 90.2078 ++
 90.2079 ++#define _LIBC
 90.2080 ++#include <locale>
 90.2081 ++#undef _LIBC
 90.2082 ++#include <bits/c++locale_internal.h>
 90.2083 ++
 90.2084 ++#ifdef __UCLIBC_MJN3_ONLY__
 90.2085 ++#warning tailor for stub locale support
 90.2086 ++#endif
 90.2087 ++#ifndef __UCLIBC_HAS_XLOCALE__
 90.2088 ++#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 90.2089 ++#endif
 90.2090 ++
 90.2091 ++namespace std
 90.2092 ++{
 90.2093 ++  template<> 
 90.2094 ++    void
 90.2095 ++    numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
 90.2096 ++    {
 90.2097 ++      if (!_M_data)
 90.2098 ++	_M_data = new __numpunct_cache<char>;
 90.2099 ++
 90.2100 ++      if (!__cloc)
 90.2101 ++	{
 90.2102 ++	  // "C" locale
 90.2103 ++	  _M_data->_M_grouping = "";
 90.2104 ++	  _M_data->_M_grouping_size = 0;
 90.2105 ++	  _M_data->_M_use_grouping = false;
 90.2106 ++
 90.2107 ++	  _M_data->_M_decimal_point = '.';
 90.2108 ++	  _M_data->_M_thousands_sep = ',';
 90.2109 ++
 90.2110 ++	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
 90.2111 ++	    _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
 90.2112 ++
 90.2113 ++	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
 90.2114 ++	    _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j];
 90.2115 ++	}
 90.2116 ++      else
 90.2117 ++	{
 90.2118 ++	  // Named locale.
 90.2119 ++	  _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT, 
 90.2120 ++							__cloc));
 90.2121 ++	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP, 
 90.2122 ++							__cloc));
 90.2123 ++
 90.2124 ++	  // Check for NULL, which implies no grouping.
 90.2125 ++	  if (_M_data->_M_thousands_sep == '\0')
 90.2126 ++	    _M_data->_M_grouping = "";
 90.2127 ++	  else
 90.2128 ++	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
 90.2129 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
 90.2130 ++	}
 90.2131 ++
 90.2132 ++      // NB: There is no way to extact this info from posix locales.
 90.2133 ++      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
 90.2134 ++      _M_data->_M_truename = "true";
 90.2135 ++      _M_data->_M_truename_size = 4;
 90.2136 ++      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
 90.2137 ++      _M_data->_M_falsename = "false";
 90.2138 ++      _M_data->_M_falsename_size = 5;
 90.2139 ++    }
 90.2140 ++ 
 90.2141 ++  template<> 
 90.2142 ++    numpunct<char>::~numpunct()
 90.2143 ++    { delete _M_data; }
 90.2144 ++   
 90.2145 ++#ifdef _GLIBCXX_USE_WCHAR_T
 90.2146 ++  template<> 
 90.2147 ++    void
 90.2148 ++    numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
 90.2149 ++    {
 90.2150 ++      if (!_M_data)
 90.2151 ++	_M_data = new __numpunct_cache<wchar_t>;
 90.2152 ++
 90.2153 ++      if (!__cloc)
 90.2154 ++	{
 90.2155 ++	  // "C" locale
 90.2156 ++	  _M_data->_M_grouping = "";
 90.2157 ++	  _M_data->_M_grouping_size = 0;
 90.2158 ++	  _M_data->_M_use_grouping = false;
 90.2159 ++
 90.2160 ++	  _M_data->_M_decimal_point = L'.';
 90.2161 ++	  _M_data->_M_thousands_sep = L',';
 90.2162 ++
 90.2163 ++	  // Use ctype::widen code without the facet...
 90.2164 ++	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
 90.2165 ++	    _M_data->_M_atoms_out[__i] =
 90.2166 ++	      static_cast<wchar_t>(__num_base::_S_atoms_out[__i]);
 90.2167 ++
 90.2168 ++	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
 90.2169 ++	    _M_data->_M_atoms_in[__j] =
 90.2170 ++	      static_cast<wchar_t>(__num_base::_S_atoms_in[__j]);
 90.2171 ++	}
 90.2172 ++      else
 90.2173 ++	{
 90.2174 ++	  // Named locale.
 90.2175 ++	  // NB: In the GNU model wchar_t is always 32 bit wide.
 90.2176 ++	  union { char *__s; wchar_t __w; } __u;
 90.2177 ++	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
 90.2178 ++	  _M_data->_M_decimal_point = __u.__w;
 90.2179 ++
 90.2180 ++	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
 90.2181 ++	  _M_data->_M_thousands_sep = __u.__w;
 90.2182 ++
 90.2183 ++	  if (_M_data->_M_thousands_sep == L'\0')
 90.2184 ++	    _M_data->_M_grouping = "";
 90.2185 ++	  else
 90.2186 ++	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
 90.2187 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
 90.2188 ++	}
 90.2189 ++
 90.2190 ++      // NB: There is no way to extact this info from posix locales.
 90.2191 ++      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
 90.2192 ++      _M_data->_M_truename = L"true";
 90.2193 ++      _M_data->_M_truename_size = 4;
 90.2194 ++      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
 90.2195 ++      _M_data->_M_falsename = L"false";
 90.2196 ++      _M_data->_M_falsename_size = 5;
 90.2197 ++    }
 90.2198 ++
 90.2199 ++  template<> 
 90.2200 ++    numpunct<wchar_t>::~numpunct()
 90.2201 ++    { delete _M_data; }
 90.2202 ++ #endif
 90.2203 ++}
 90.2204 +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
 90.2205 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.cc	1970-01-01 01:00:00.000000000 +0100
 90.2206 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.cc	2008-06-10 14:45:35.000000000 +0200
 90.2207 +@@ -0,0 +1,406 @@
 90.2208 ++// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
 90.2209 ++
 90.2210 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 90.2211 ++//
 90.2212 ++// This file is part of the GNU ISO C++ Library.  This library is free
 90.2213 ++// software; you can redistribute it and/or modify it under the
 90.2214 ++// terms of the GNU General Public License as published by the
 90.2215 ++// Free Software Foundation; either version 2, or (at your option)
 90.2216 ++// any later version.
 90.2217 ++
 90.2218 ++// This library is distributed in the hope that it will be useful,
 90.2219 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 90.2220 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 90.2221 ++// GNU General Public License for more details.
 90.2222 ++
 90.2223 ++// You should have received a copy of the GNU General Public License along
 90.2224 ++// with this library; see the file COPYING.  If not, write to the Free
 90.2225 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 90.2226 ++// USA.
 90.2227 ++
 90.2228 ++// As a special exception, you may use this file as part of a free software
 90.2229 ++// library without restriction.  Specifically, if other files instantiate
 90.2230 ++// templates or use macros or inline functions from this file, or you compile
 90.2231 ++// this file and link it with other files to produce an executable, this
 90.2232 ++// file does not by itself cause the resulting executable to be covered by
 90.2233 ++// the GNU General Public License.  This exception does not however
 90.2234 ++// invalidate any other reasons why the executable file might be covered by
 90.2235 ++// the GNU General Public License.
 90.2236 ++
 90.2237 ++//
 90.2238 ++// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
 90.2239 ++// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
 90.2240 ++//
 90.2241 ++
 90.2242 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 90.2243 ++
 90.2244 ++#include <locale>
 90.2245 ++#include <bits/c++locale_internal.h>
 90.2246 ++
 90.2247 ++#ifdef __UCLIBC_MJN3_ONLY__
 90.2248 ++#warning tailor for stub locale support
 90.2249 ++#endif
 90.2250 ++#ifndef __UCLIBC_HAS_XLOCALE__
 90.2251 ++#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 90.2252 ++#endif
 90.2253 ++
 90.2254 ++namespace std
 90.2255 ++{
 90.2256 ++  template<>
 90.2257 ++    void
 90.2258 ++    __timepunct<char>::
 90.2259 ++    _M_put(char* __s, size_t __maxlen, const char* __format, 
 90.2260 ++	   const tm* __tm) const
 90.2261 ++    {
 90.2262 ++#ifdef __UCLIBC_HAS_XLOCALE__
 90.2263 ++      const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
 90.2264 ++					_M_c_locale_timepunct);
 90.2265 ++#else
 90.2266 ++      char* __old = strdup(setlocale(LC_ALL, NULL));
 90.2267 ++      setlocale(LC_ALL, _M_name_timepunct);
 90.2268 ++      const size_t __len = strftime(__s, __maxlen, __format, __tm);
 90.2269 ++      setlocale(LC_ALL, __old);
 90.2270 ++      free(__old);
 90.2271 ++#endif
 90.2272 ++      // Make sure __s is null terminated.
 90.2273 ++      if (__len == 0)
 90.2274 ++	__s[0] = '\0';
 90.2275 ++    }
 90.2276 ++
 90.2277 ++  template<> 
 90.2278 ++    void
 90.2279 ++    __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
 90.2280 ++    {
 90.2281 ++      if (!_M_data)
 90.2282 ++	_M_data = new __timepunct_cache<char>;
 90.2283 ++
 90.2284 ++      if (!__cloc)
 90.2285 ++	{
 90.2286 ++	  // "C" locale
 90.2287 ++	  _M_c_locale_timepunct = _S_get_c_locale();
 90.2288 ++
 90.2289 ++	  _M_data->_M_date_format = "%m/%d/%y";
 90.2290 ++	  _M_data->_M_date_era_format = "%m/%d/%y";
 90.2291 ++	  _M_data->_M_time_format = "%H:%M:%S";
 90.2292 ++	  _M_data->_M_time_era_format = "%H:%M:%S";
 90.2293 ++	  _M_data->_M_date_time_format = "";
 90.2294 ++	  _M_data->_M_date_time_era_format = "";
 90.2295 ++	  _M_data->_M_am = "AM";
 90.2296 ++	  _M_data->_M_pm = "PM";
 90.2297 ++	  _M_data->_M_am_pm_format = "";
 90.2298 ++
 90.2299 ++	  // Day names, starting with "C"'s Sunday.
 90.2300 ++	  _M_data->_M_day1 = "Sunday";
 90.2301 ++	  _M_data->_M_day2 = "Monday";
 90.2302 ++	  _M_data->_M_day3 = "Tuesday";
 90.2303 ++	  _M_data->_M_day4 = "Wednesday";
 90.2304 ++	  _M_data->_M_day5 = "Thursday";
 90.2305 ++	  _M_data->_M_day6 = "Friday";
 90.2306 ++	  _M_data->_M_day7 = "Saturday";
 90.2307 ++
 90.2308 ++	  // Abbreviated day names, starting with "C"'s Sun.
 90.2309 ++	  _M_data->_M_aday1 = "Sun";
 90.2310 ++	  _M_data->_M_aday2 = "Mon";
 90.2311 ++	  _M_data->_M_aday3 = "Tue";
 90.2312 ++	  _M_data->_M_aday4 = "Wed";
 90.2313 ++	  _M_data->_M_aday5 = "Thu";
 90.2314 ++	  _M_data->_M_aday6 = "Fri";
 90.2315 ++	  _M_data->_M_aday7 = "Sat";
 90.2316 ++
 90.2317 ++	  // Month names, starting with "C"'s January.
 90.2318 ++	  _M_data->_M_month01 = "January";
 90.2319 ++	  _M_data->_M_month02 = "February";
 90.2320 ++	  _M_data->_M_month03 = "March";
 90.2321 ++	  _M_data->_M_month04 = "April";
 90.2322 ++	  _M_data->_M_month05 = "May";
 90.2323 ++	  _M_data->_M_month06 = "June";
 90.2324 ++	  _M_data->_M_month07 = "July";
 90.2325 ++	  _M_data->_M_month08 = "August";
 90.2326 ++	  _M_data->_M_month09 = "September";
 90.2327 ++	  _M_data->_M_month10 = "October";
 90.2328 ++	  _M_data->_M_month11 = "November";
 90.2329 ++	  _M_data->_M_month12 = "December";
 90.2330 ++
 90.2331 ++	  // Abbreviated month names, starting with "C"'s Jan.
 90.2332 ++	  _M_data->_M_amonth01 = "Jan";
 90.2333 ++	  _M_data->_M_amonth02 = "Feb";
 90.2334 ++	  _M_data->_M_amonth03 = "Mar";
 90.2335 ++	  _M_data->_M_amonth04 = "Apr";
 90.2336 ++	  _M_data->_M_amonth05 = "May";
 90.2337 ++	  _M_data->_M_amonth06 = "Jun";
 90.2338 ++	  _M_data->_M_amonth07 = "Jul";
 90.2339 ++	  _M_data->_M_amonth08 = "Aug";
 90.2340 ++	  _M_data->_M_amonth09 = "Sep";
 90.2341 ++	  _M_data->_M_amonth10 = "Oct";
 90.2342 ++	  _M_data->_M_amonth11 = "Nov";
 90.2343 ++	  _M_data->_M_amonth12 = "Dec";
 90.2344 ++	}
 90.2345 ++      else
 90.2346 ++	{
 90.2347 ++	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
 90.2348 ++
 90.2349 ++	  _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
 90.2350 ++	  _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
 90.2351 ++	  _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
 90.2352 ++	  _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
 90.2353 ++	  _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
 90.2354 ++	  _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT,
 90.2355 ++							     __cloc);
 90.2356 ++	  _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
 90.2357 ++	  _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
 90.2358 ++	  _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
 90.2359 ++
 90.2360 ++	  // Day names, starting with "C"'s Sunday.
 90.2361 ++	  _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
 90.2362 ++	  _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
 90.2363 ++	  _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
 90.2364 ++	  _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
 90.2365 ++	  _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
 90.2366 ++	  _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
 90.2367 ++	  _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
 90.2368 ++
 90.2369 ++	  // Abbreviated day names, starting with "C"'s Sun.
 90.2370 ++	  _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
 90.2371 ++	  _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
 90.2372 ++	  _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
 90.2373 ++	  _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
 90.2374 ++	  _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
 90.2375 ++	  _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
 90.2376 ++	  _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
 90.2377 ++
 90.2378 ++	  // Month names, starting with "C"'s January.
 90.2379 ++	  _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
 90.2380 ++	  _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
 90.2381 ++	  _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
 90.2382 ++	  _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
 90.2383 ++	  _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
 90.2384 ++	  _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
 90.2385 ++	  _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
 90.2386 ++	  _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
 90.2387 ++	  _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
 90.2388 ++	  _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
 90.2389 ++	  _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
 90.2390 ++	  _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
 90.2391 ++
 90.2392 ++	  // Abbreviated month names, starting with "C"'s Jan.
 90.2393 ++	  _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
 90.2394 ++	  _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
 90.2395 ++	  _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
 90.2396 ++	  _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
 90.2397 ++	  _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
 90.2398 ++	  _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
 90.2399 ++	  _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
 90.2400 ++	  _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
 90.2401 ++	  _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
 90.2402 ++	  _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
 90.2403 ++	  _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
 90.2404 ++	  _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
 90.2405 ++	}
 90.2406 ++    }
 90.2407 ++
 90.2408 ++#ifdef _GLIBCXX_USE_WCHAR_T
 90.2409 ++  template<>
 90.2410 ++    void
 90.2411 ++    __timepunct<wchar_t>::
 90.2412 ++    _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format, 
 90.2413 ++	   const tm* __tm) const
 90.2414 ++    {
 90.2415 ++#ifdef __UCLIBC_HAS_XLOCALE__
 90.2416 ++      __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
 90.2417 ++      const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
 90.2418 ++					_M_c_locale_timepunct);
 90.2419 ++#else
 90.2420 ++      char* __old = strdup(setlocale(LC_ALL, NULL));
 90.2421 ++      setlocale(LC_ALL, _M_name_timepunct);
 90.2422 ++      const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
 90.2423 ++      setlocale(LC_ALL, __old);
 90.2424 ++      free(__old);
 90.2425 ++#endif
 90.2426 ++      // Make sure __s is null terminated.
 90.2427 ++      if (__len == 0)
 90.2428 ++	__s[0] = L'\0';
 90.2429 ++    }
 90.2430 ++
 90.2431 ++  template<> 
 90.2432 ++    void
 90.2433 ++    __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
 90.2434 ++    {
 90.2435 ++      if (!_M_data)
 90.2436 ++	_M_data = new __timepunct_cache<wchar_t>;
 90.2437 ++
 90.2438 ++#warning wide time stuff
 90.2439 ++//       if (!__cloc)
 90.2440 ++	{
 90.2441 ++	  // "C" locale
 90.2442 ++	  _M_c_locale_timepunct = _S_get_c_locale();
 90.2443 ++
 90.2444 ++	  _M_data->_M_date_format = L"%m/%d/%y";
 90.2445 ++	  _M_data->_M_date_era_format = L"%m/%d/%y";
 90.2446 ++	  _M_data->_M_time_format = L"%H:%M:%S";
 90.2447 ++	  _M_data->_M_time_era_format = L"%H:%M:%S";
 90.2448 ++	  _M_data->_M_date_time_format = L"";
 90.2449 ++	  _M_data->_M_date_time_era_format = L"";
 90.2450 ++	  _M_data->_M_am = L"AM";
 90.2451 ++	  _M_data->_M_pm = L"PM";
 90.2452 ++	  _M_data->_M_am_pm_format = L"";
 90.2453 ++
 90.2454 ++	  // Day names, starting with "C"'s Sunday.
 90.2455 ++	  _M_data->_M_day1 = L"Sunday";
 90.2456 ++	  _M_data->_M_day2 = L"Monday";
 90.2457 ++	  _M_data->_M_day3 = L"Tuesday";
 90.2458 ++	  _M_data->_M_day4 = L"Wednesday";
 90.2459 ++	  _M_data->_M_day5 = L"Thursday";
 90.2460 ++	  _M_data->_M_day6 = L"Friday";
 90.2461 ++	  _M_data->_M_day7 = L"Saturday";
 90.2462 ++
 90.2463 ++	  // Abbreviated day names, starting with "C"'s Sun.
 90.2464 ++	  _M_data->_M_aday1 = L"Sun";
 90.2465 ++	  _M_data->_M_aday2 = L"Mon";
 90.2466 ++	  _M_data->_M_aday3 = L"Tue";
 90.2467 ++	  _M_data->_M_aday4 = L"Wed";
 90.2468 ++	  _M_data->_M_aday5 = L"Thu";
 90.2469 ++	  _M_data->_M_aday6 = L"Fri";
 90.2470 ++	  _M_data->_M_aday7 = L"Sat";
 90.2471 ++
 90.2472 ++	  // Month names, starting with "C"'s January.
 90.2473 ++	  _M_data->_M_month01 = L"January";
 90.2474 ++	  _M_data->_M_month02 = L"February";
 90.2475 ++	  _M_data->_M_month03 = L"March";
 90.2476 ++	  _M_data->_M_month04 = L"April";
 90.2477 ++	  _M_data->_M_month05 = L"May";
 90.2478 ++	  _M_data->_M_month06 = L"June";
 90.2479 ++	  _M_data->_M_month07 = L"July";
 90.2480 ++	  _M_data->_M_month08 = L"August";
 90.2481 ++	  _M_data->_M_month09 = L"September";
 90.2482 ++	  _M_data->_M_month10 = L"October";
 90.2483 ++	  _M_data->_M_month11 = L"November";
 90.2484 ++	  _M_data->_M_month12 = L"December";
 90.2485 ++
 90.2486 ++	  // Abbreviated month names, starting with "C"'s Jan.
 90.2487 ++	  _M_data->_M_amonth01 = L"Jan";
 90.2488 ++	  _M_data->_M_amonth02 = L"Feb";
 90.2489 ++	  _M_data->_M_amonth03 = L"Mar";
 90.2490 ++	  _M_data->_M_amonth04 = L"Apr";
 90.2491 ++	  _M_data->_M_amonth05 = L"May";
 90.2492 ++	  _M_data->_M_amonth06 = L"Jun";
 90.2493 ++	  _M_data->_M_amonth07 = L"Jul";
 90.2494 ++	  _M_data->_M_amonth08 = L"Aug";
 90.2495 ++	  _M_data->_M_amonth09 = L"Sep";
 90.2496 ++	  _M_data->_M_amonth10 = L"Oct";
 90.2497 ++	  _M_data->_M_amonth11 = L"Nov";
 90.2498 ++	  _M_data->_M_amonth12 = L"Dec";
 90.2499 ++	}
 90.2500 ++#if 0
 90.2501 ++      else
 90.2502 ++	{
 90.2503 ++	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
 90.2504 ++
 90.2505 ++	  union { char *__s; wchar_t *__w; } __u;
 90.2506 ++
 90.2507 ++	  __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc);
 90.2508 ++	  _M_data->_M_date_format = __u.__w;
 90.2509 ++	  __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc);
 90.2510 ++	  _M_data->_M_date_era_format = __u.__w;
 90.2511 ++	  __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc);
 90.2512 ++	  _M_data->_M_time_format = __u.__w;
 90.2513 ++	  __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc);
 90.2514 ++	  _M_data->_M_time_era_format = __u.__w;
 90.2515 ++	  __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc);
 90.2516 ++	  _M_data->_M_date_time_format = __u.__w;
 90.2517 ++	  __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc);
 90.2518 ++	  _M_data->_M_date_time_era_format = __u.__w;
 90.2519 ++	  __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc);
 90.2520 ++	  _M_data->_M_am = __u.__w;
 90.2521 ++	  __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc);
 90.2522 ++	  _M_data->_M_pm = __u.__w;
 90.2523 ++	  __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc);
 90.2524 ++	  _M_data->_M_am_pm_format = __u.__w;
 90.2525 ++
 90.2526 ++	  // Day names, starting with "C"'s Sunday.
 90.2527 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc);
 90.2528 ++	  _M_data->_M_day1 = __u.__w;
 90.2529 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc);
 90.2530 ++	  _M_data->_M_day2 = __u.__w;
 90.2531 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc);
 90.2532 ++	  _M_data->_M_day3 = __u.__w;
 90.2533 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc);
 90.2534 ++	  _M_data->_M_day4 = __u.__w;
 90.2535 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc);
 90.2536 ++	  _M_data->_M_day5 = __u.__w;
 90.2537 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc);
 90.2538 ++	  _M_data->_M_day6 = __u.__w;
 90.2539 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc);
 90.2540 ++	  _M_data->_M_day7 = __u.__w;
 90.2541 ++
 90.2542 ++	  // Abbreviated day names, starting with "C"'s Sun.
 90.2543 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc);
 90.2544 ++	  _M_data->_M_aday1 = __u.__w;
 90.2545 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc);
 90.2546 ++	  _M_data->_M_aday2 = __u.__w;
 90.2547 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc);
 90.2548 ++	  _M_data->_M_aday3 = __u.__w;
 90.2549 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc);
 90.2550 ++	  _M_data->_M_aday4 = __u.__w;
 90.2551 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc);
 90.2552 ++	  _M_data->_M_aday5 = __u.__w;
 90.2553 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc);
 90.2554 ++	  _M_data->_M_aday6 = __u.__w;
 90.2555 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc);
 90.2556 ++	  _M_data->_M_aday7 = __u.__w;
 90.2557 ++
 90.2558 ++	  // Month names, starting with "C"'s January.
 90.2559 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc);
 90.2560 ++	  _M_data->_M_month01 = __u.__w;
 90.2561 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc);
 90.2562 ++	  _M_data->_M_month02 = __u.__w;
 90.2563 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc);
 90.2564 ++	  _M_data->_M_month03 = __u.__w;
 90.2565 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc);
 90.2566 ++	  _M_data->_M_month04 = __u.__w;
 90.2567 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc);
 90.2568 ++	  _M_data->_M_month05 = __u.__w;
 90.2569 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc);
 90.2570 ++	  _M_data->_M_month06 = __u.__w;
 90.2571 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc);
 90.2572 ++	  _M_data->_M_month07 = __u.__w;
 90.2573 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc);
 90.2574 ++	  _M_data->_M_month08 = __u.__w;
 90.2575 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc);
 90.2576 ++	  _M_data->_M_month09 = __u.__w;
 90.2577 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc);
 90.2578 ++	  _M_data->_M_month10 = __u.__w;
 90.2579 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc);
 90.2580 ++	  _M_data->_M_month11 = __u.__w;
 90.2581 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc);
 90.2582 ++	  _M_data->_M_month12 = __u.__w;
 90.2583 ++
 90.2584 ++	  // Abbreviated month names, starting with "C"'s Jan.
 90.2585 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc);
 90.2586 ++	  _M_data->_M_amonth01 = __u.__w;
 90.2587 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc);
 90.2588 ++	  _M_data->_M_amonth02 = __u.__w;
 90.2589 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc);
 90.2590 ++	  _M_data->_M_amonth03 = __u.__w;
 90.2591 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc);
 90.2592 ++	  _M_data->_M_amonth04 = __u.__w;
 90.2593 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc);
 90.2594 ++	  _M_data->_M_amonth05 = __u.__w;
 90.2595 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc);
 90.2596 ++	  _M_data->_M_amonth06 = __u.__w;
 90.2597 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc);
 90.2598 ++	  _M_data->_M_amonth07 = __u.__w;
 90.2599 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc);
 90.2600 ++	  _M_data->_M_amonth08 = __u.__w;
 90.2601 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc);
 90.2602 ++	  _M_data->_M_amonth09 = __u.__w;
 90.2603 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc);
 90.2604 ++	  _M_data->_M_amonth10 = __u.__w;
 90.2605 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc);
 90.2606 ++	  _M_data->_M_amonth11 = __u.__w;
 90.2607 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc);
 90.2608 ++	  _M_data->_M_amonth12 = __u.__w;
 90.2609 ++	}
 90.2610 ++#endif // 0
 90.2611 ++    }
 90.2612 ++#endif
 90.2613 ++}
 90.2614 +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
 90.2615 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.h	1970-01-01 01:00:00.000000000 +0100
 90.2616 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.h	2008-06-10 14:45:35.000000000 +0200
 90.2617 +@@ -0,0 +1,68 @@
 90.2618 ++// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
 90.2619 ++
 90.2620 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 90.2621 ++//
 90.2622 ++// This file is part of the GNU ISO C++ Library.  This library is free
 90.2623 ++// software; you can redistribute it and/or modify it under the
 90.2624 ++// terms of the GNU General Public License as published by the
 90.2625 ++// Free Software Foundation; either version 2, or (at your option)
 90.2626 ++// any later version.
 90.2627 ++
 90.2628 ++// This library is distributed in the hope that it will be useful,
 90.2629 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 90.2630 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 90.2631 ++// GNU General Public License for more details.
 90.2632 ++
 90.2633 ++// You should have received a copy of the GNU General Public License along
 90.2634 ++// with this library; see the file COPYING.  If not, write to the Free
 90.2635 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 90.2636 ++// USA.
 90.2637 ++
 90.2638 ++// As a special exception, you may use this file as part of a free software
 90.2639 ++// library without restriction.  Specifically, if other files instantiate
 90.2640 ++// templates or use macros or inline functions from this file, or you compile
 90.2641 ++// this file and link it with other files to produce an executable, this
 90.2642 ++// file does not by itself cause the resulting executable to be covered by
 90.2643 ++// the GNU General Public License.  This exception does not however
 90.2644 ++// invalidate any other reasons why the executable file might be covered by
 90.2645 ++// the GNU General Public License.
 90.2646 ++
 90.2647 ++//
 90.2648 ++// ISO C++ 14882: 22.2.5.1.2 - time_get functions
 90.2649 ++// ISO C++ 14882: 22.2.5.3.2 - time_put functions
 90.2650 ++//
 90.2651 ++
 90.2652 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 90.2653 ++
 90.2654 ++  template<typename _CharT>
 90.2655 ++    __timepunct<_CharT>::__timepunct(size_t __refs) 
 90.2656 ++    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
 90.2657 ++    _M_name_timepunct(_S_get_c_name())
 90.2658 ++    { _M_initialize_timepunct(); }
 90.2659 ++
 90.2660 ++  template<typename _CharT>
 90.2661 ++    __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) 
 90.2662 ++    : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), 
 90.2663 ++    _M_name_timepunct(_S_get_c_name())
 90.2664 ++    { _M_initialize_timepunct(); }
 90.2665 ++
 90.2666 ++  template<typename _CharT>
 90.2667 ++    __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
 90.2668 ++				     size_t __refs) 
 90.2669 ++    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
 90.2670 ++    _M_name_timepunct(__s)
 90.2671 ++    { 
 90.2672 ++      char* __tmp = new char[std::strlen(__s) + 1];
 90.2673 ++      std::strcpy(__tmp, __s);
 90.2674 ++      _M_name_timepunct = __tmp;
 90.2675 ++      _M_initialize_timepunct(__cloc); 
 90.2676 ++    }
 90.2677 ++
 90.2678 ++  template<typename _CharT>
 90.2679 ++    __timepunct<_CharT>::~__timepunct()
 90.2680 ++    { 
 90.2681 ++      if (_M_name_timepunct != _S_get_c_name())
 90.2682 ++	delete [] _M_name_timepunct;
 90.2683 ++      delete _M_data; 
 90.2684 ++      _S_destroy_c_locale(_M_c_locale_timepunct); 
 90.2685 ++    }
 90.2686 +diff -durN gcc-4.3.0.orig/libstdc++-v3/configure gcc-4.3.0/libstdc++-v3/configure
 90.2687 +--- gcc-4.3.0.orig/libstdc++-v3/configure	2008-02-29 01:00:39.000000000 +0100
 90.2688 ++++ gcc-4.3.0/libstdc++-v3/configure	2008-06-10 14:45:35.000000000 +0200
 90.2689 +@@ -14001,7 +14001,7 @@
 90.2690 +   enableval="$enable_clocale"
 90.2691 + 
 90.2692 +       case "$enableval" in
 90.2693 +-       generic|gnu|ieee_1003.1-2001|yes|no|auto) ;;
 90.2694 ++       generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto) ;;
 90.2695 +        *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable clocale" >&5
 90.2696 + echo "$as_me: error: Unknown argument to enable/disable clocale" >&2;}
 90.2697 +    { (exit 1); exit 1; }; } ;;
 90.2698 +@@ -14034,6 +14034,9 @@
 90.2699 +   # Default to "generic".
 90.2700 +   if test $enable_clocale_flag = auto; then
 90.2701 +     case ${target_os} in
 90.2702 ++      linux-uclibc*)
 90.2703 ++        enable_clocale_flag=uclibc
 90.2704 ++	;;
 90.2705 +       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
 90.2706 +         enable_clocale_flag=gnu
 90.2707 +         ;;
 90.2708 +@@ -14422,6 +14425,76 @@
 90.2709 +       CTIME_CC=config/locale/generic/time_members.cc
 90.2710 +       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
 90.2711 +       ;;
 90.2712 ++    uclibc)
 90.2713 ++      echo "$as_me:$LINENO: result: uclibc" >&5
 90.2714 ++echo "${ECHO_T}uclibc" >&6
 90.2715 ++
 90.2716 ++      # Declare intention to use gettext, and add support for specific
 90.2717 ++      # languages.
 90.2718 ++      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
 90.2719 ++      ALL_LINGUAS="de fr"
 90.2720 ++
 90.2721 ++      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
 90.2722 ++      # Extract the first word of "msgfmt", so it can be a program name with args.
 90.2723 ++set dummy msgfmt; ac_word=$2
 90.2724 ++echo "$as_me:$LINENO: checking for $ac_word" >&5
 90.2725 ++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 90.2726 ++if test "${ac_cv_prog_check_msgfmt+set}" = set; then
 90.2727 ++  echo $ECHO_N "(cached) $ECHO_C" >&6
 90.2728 ++else
 90.2729 ++  if test -n "$check_msgfmt"; then
 90.2730 ++  ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
 90.2731 ++else
 90.2732 ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 90.2733 ++for as_dir in $PATH
 90.2734 ++do
 90.2735 ++  IFS=$as_save_IFS
 90.2736 ++  test -z "$as_dir" && as_dir=.
 90.2737 ++  for ac_exec_ext in '' $ac_executable_extensions; do
 90.2738 ++  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
 90.2739 ++    ac_cv_prog_check_msgfmt="yes"
 90.2740 ++    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
 90.2741 ++    break 2
 90.2742 ++  fi
 90.2743 ++done
 90.2744 ++done
 90.2745 ++
 90.2746 ++  test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
 90.2747 ++fi
 90.2748 ++fi
 90.2749 ++check_msgfmt=$ac_cv_prog_check_msgfmt
 90.2750 ++if test -n "$check_msgfmt"; then
 90.2751 ++  echo "$as_me:$LINENO: result: $check_msgfmt" >&5
 90.2752 ++echo "${ECHO_T}$check_msgfmt" >&6
 90.2753 ++else
 90.2754 ++  echo "$as_me:$LINENO: result: no" >&5
 90.2755 ++echo "${ECHO_T}no" >&6
 90.2756 ++fi
 90.2757 ++
 90.2758 ++      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
 90.2759 ++        USE_NLS=yes
 90.2760 ++      fi
 90.2761 ++      # Export the build objects.
 90.2762 ++      for ling in $ALL_LINGUAS; do \
 90.2763 ++        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
 90.2764 ++        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
 90.2765 ++      done
 90.2766 ++
 90.2767 ++
 90.2768 ++
 90.2769 ++      CLOCALE_H=config/locale/uclibc/c_locale.h
 90.2770 ++      CLOCALE_CC=config/locale/uclibc/c_locale.cc
 90.2771 ++      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
 90.2772 ++      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
 90.2773 ++      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
 90.2774 ++      CMESSAGES_H=config/locale/uclibc/messages_members.h
 90.2775 ++      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
 90.2776 ++      CMONEY_CC=config/locale/uclibc/monetary_members.cc
 90.2777 ++      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
 90.2778 ++      CTIME_H=config/locale/uclibc/time_members.h
 90.2779 ++      CTIME_CC=config/locale/uclibc/time_members.cc
 90.2780 ++      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
 90.2781 ++      ;;
 90.2782 +   esac
 90.2783 + 
 90.2784 +   # This is where the testsuite looks for locale catalogs, using the
 90.2785 +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
 90.2786 +--- gcc-4.3.0.orig/libstdc++-v3/include/c_compatibility/wchar.h	2007-03-04 23:59:49.000000000 +0100
 90.2787 ++++ gcc-4.3.0/libstdc++-v3/include/c_compatibility/wchar.h	2008-06-10 14:45:35.000000000 +0200
 90.2788 +@@ -106,7 +106,9 @@
 90.2789 + using std::wmemcpy;
 90.2790 + using std::wmemmove;
 90.2791 + using std::wmemset;
 90.2792 ++#if _GLIBCXX_HAVE_WCSFTIME
 90.2793 + using std::wcsftime;
 90.2794 ++#endif
 90.2795 + 
 90.2796 + #if _GLIBCXX_USE_C99
 90.2797 + using std::wcstold;
    91.1 --- a/patches/gcc/4.3.0/675-203-uclibc-locale-no__x.patch	Mon Jul 28 20:17:48 2008 +0000
    91.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    91.3 @@ -1,224 +0,0 @@
    91.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_203-uclibc-locale-no__x.patch
    91.5 -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
    91.6 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2008-06-10 14:45:39.000000000 +0200
    91.7 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2008-06-10 14:45:39.000000000 +0200
    91.8 -@@ -60,4 +60,49 @@
    91.9 - extern "C" __typeof(wctype_l) __wctype_l;
   91.10 - #endif 
   91.11 - 
   91.12 -+# define __nl_langinfo_l nl_langinfo_l
   91.13 -+# define __strcoll_l strcoll_l
   91.14 -+# define __strftime_l strftime_l
   91.15 -+# define __strtod_l strtod_l
   91.16 -+# define __strtof_l strtof_l
   91.17 -+# define __strtold_l strtold_l
   91.18 -+# define __strxfrm_l strxfrm_l
   91.19 -+# define __newlocale newlocale
   91.20 -+# define __freelocale freelocale
   91.21 -+# define __duplocale duplocale
   91.22 -+# define __uselocale uselocale
   91.23 -+
   91.24 -+# ifdef _GLIBCXX_USE_WCHAR_T
   91.25 -+#  define __iswctype_l iswctype_l
   91.26 -+#  define __towlower_l towlower_l
   91.27 -+#  define __towupper_l towupper_l
   91.28 -+#  define __wcscoll_l wcscoll_l
   91.29 -+#  define __wcsftime_l wcsftime_l
   91.30 -+#  define __wcsxfrm_l wcsxfrm_l
   91.31 -+#  define __wctype_l wctype_l
   91.32 -+# endif
   91.33 -+
   91.34 -+#else
   91.35 -+# define __nl_langinfo_l(N, L)       nl_langinfo((N))
   91.36 -+# define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
   91.37 -+# define __strtod_l(S, E, L)         strtod((S), (E))
   91.38 -+# define __strtof_l(S, E, L)         strtof((S), (E))
   91.39 -+# define __strtold_l(S, E, L)        strtold((S), (E))
   91.40 -+# define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
   91.41 -+# warning should dummy __newlocale check for C|POSIX ?
   91.42 -+# define __newlocale(a, b, c)        NULL
   91.43 -+# define __freelocale(a)             ((void)0)
   91.44 -+# define __duplocale(a)              __c_locale()
   91.45 -+//# define __uselocale ?
   91.46 -+//
   91.47 -+# ifdef _GLIBCXX_USE_WCHAR_T
   91.48 -+#  define __iswctype_l(C, M, L)       iswctype((C), (M))
   91.49 -+#  define __towlower_l(C, L)          towlower((C))
   91.50 -+#  define __towupper_l(C, L)          towupper((C))
   91.51 -+#  define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
   91.52 -+//#  define __wcsftime_l(S, M, F, T, L)  wcsftime((S), (M), (F), (T)) 
   91.53 -+#  define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
   91.54 -+#  define __wctype_l(S, L)            wctype((S))
   91.55 -+# endif
   91.56 -+
   91.57 - #endif // GLIBC 2.3 and later
   91.58 -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
   91.59 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc	2008-06-10 14:45:39.000000000 +0200
   91.60 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.cc	2008-06-10 14:45:39.000000000 +0200
   91.61 -@@ -39,20 +39,6 @@
   91.62 - #include <langinfo.h>
   91.63 - #include <bits/c++locale_internal.h>
   91.64 - 
   91.65 --#ifndef __UCLIBC_HAS_XLOCALE__
   91.66 --#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
   91.67 --#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
   91.68 --#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
   91.69 --#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
   91.70 --#define __strtof_l(S, E, L)         strtof((S), (E))
   91.71 --#define __strtod_l(S, E, L)         strtod((S), (E))
   91.72 --#define __strtold_l(S, E, L)        strtold((S), (E))
   91.73 --#warning should dummy __newlocale check for C|POSIX ?
   91.74 --#define __newlocale(a, b, c)        NULL
   91.75 --#define __freelocale(a)             ((void)0)
   91.76 --#define __duplocale(a)              __c_locale()
   91.77 --#endif
   91.78 --
   91.79 - namespace std 
   91.80 - {
   91.81 -   template<>
   91.82 -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
   91.83 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.h	2008-06-10 14:45:39.000000000 +0200
   91.84 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.h	2008-06-10 14:45:39.000000000 +0200
   91.85 -@@ -68,6 +68,7 @@
   91.86 - {
   91.87 -   extern "C" __typeof(uselocale) __uselocale;
   91.88 - }
   91.89 -+#define __uselocale uselocale
   91.90 - #endif
   91.91 - 
   91.92 - namespace std
   91.93 -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
   91.94 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc	2008-06-10 14:45:39.000000000 +0200
   91.95 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/collate_members.cc	2008-06-10 14:45:39.000000000 +0200
   91.96 -@@ -36,13 +36,6 @@
   91.97 - #include <locale>
   91.98 - #include <bits/c++locale_internal.h>
   91.99 - 
  91.100 --#ifndef __UCLIBC_HAS_XLOCALE__
  91.101 --#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
  91.102 --#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
  91.103 --#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
  91.104 --#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
  91.105 --#endif
  91.106 --
  91.107 - namespace std
  91.108 - {
  91.109 -   // These are basically extensions to char_traits, and perhaps should
  91.110 -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
  91.111 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2008-06-10 14:45:39.000000000 +0200
  91.112 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2008-06-10 14:45:39.000000000 +0200
  91.113 -@@ -38,13 +38,6 @@
  91.114 - #undef _LIBC
  91.115 - #include <bits/c++locale_internal.h>
  91.116 - 
  91.117 --#ifndef __UCLIBC_HAS_XLOCALE__
  91.118 --#define __wctype_l(S, L)           wctype((S))
  91.119 --#define __towupper_l(C, L)         towupper((C))
  91.120 --#define __towlower_l(C, L)         towlower((C))
  91.121 --#define __iswctype_l(C, M, L)      iswctype((C), (M))
  91.122 --#endif
  91.123 --
  91.124 - namespace std
  91.125 - {
  91.126 -   // NB: The other ctype<char> specializations are in src/locale.cc and
  91.127 -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
  91.128 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc	2008-06-10 14:45:39.000000000 +0200
  91.129 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.cc	2008-06-10 14:45:39.000000000 +0200
  91.130 -@@ -39,13 +39,10 @@
  91.131 - #ifdef __UCLIBC_MJN3_ONLY__
  91.132 - #warning fix gettext stuff
  91.133 - #endif
  91.134 --#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
  91.135 --extern "C" char *__dcgettext(const char *domainname,
  91.136 --			     const char *msgid, int category);
  91.137 - #undef gettext
  91.138 --#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
  91.139 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
  91.140 -+#define gettext(msgid) dcgettext(NULL, msgid, LC_MESSAGES)
  91.141 - #else
  91.142 --#undef gettext
  91.143 - #define gettext(msgid) (msgid)
  91.144 - #endif
  91.145 - 
  91.146 -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
  91.147 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:45:39.000000000 +0200
  91.148 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:45:39.000000000 +0200
  91.149 -@@ -36,15 +36,11 @@
  91.150 - #ifdef __UCLIBC_MJN3_ONLY__
  91.151 - #warning fix prototypes for *textdomain funcs
  91.152 - #endif
  91.153 --#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
  91.154 --extern "C" char *__textdomain(const char *domainname);
  91.155 --extern "C" char *__bindtextdomain(const char *domainname,
  91.156 --				  const char *dirname);
  91.157 --#else
  91.158 --#undef __textdomain
  91.159 --#undef __bindtextdomain
  91.160 --#define __textdomain(D)           ((void)0)
  91.161 --#define __bindtextdomain(D,P)     ((void)0)
  91.162 -+#ifndef __UCLIBC_HAS_GETTEXT_AWARENESS__
  91.163 -+#undef textdomain
  91.164 -+#undef bindtextdomain
  91.165 -+#define textdomain(D)           ((void)0)
  91.166 -+#define bindtextdomain(D,P)     ((void)0)
  91.167 - #endif
  91.168 - 
  91.169 -   // Non-virtual member functions.
  91.170 -@@ -70,7 +66,7 @@
  91.171 -     messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, 
  91.172 - 			   const char* __dir) const
  91.173 -     { 
  91.174 --      __bindtextdomain(__s.c_str(), __dir);
  91.175 -+      bindtextdomain(__s.c_str(), __dir);
  91.176 -       return this->do_open(__s, __loc); 
  91.177 -     }
  91.178 - 
  91.179 -@@ -90,7 +86,7 @@
  91.180 -     { 
  91.181 -       // No error checking is done, assume the catalog exists and can
  91.182 -       // be used.
  91.183 --      __textdomain(__s.c_str());
  91.184 -+      textdomain(__s.c_str());
  91.185 -       return 0;
  91.186 -     }
  91.187 - 
  91.188 -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
  91.189 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:45:39.000000000 +0200
  91.190 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:45:39.000000000 +0200
  91.191 -@@ -43,10 +43,6 @@
  91.192 - #warning tailor for stub locale support
  91.193 - #endif
  91.194 - 
  91.195 --#ifndef __UCLIBC_HAS_XLOCALE__
  91.196 --#define __nl_langinfo_l(N, L)         nl_langinfo((N))
  91.197 --#endif
  91.198 --
  91.199 - namespace std
  91.200 - {
  91.201 -   // Construct and return valid pattern consisting of some combination of:
  91.202 -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
  91.203 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:45:39.000000000 +0200
  91.204 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:45:39.000000000 +0200
  91.205 -@@ -41,9 +41,6 @@
  91.206 - #ifdef __UCLIBC_MJN3_ONLY__
  91.207 - #warning tailor for stub locale support
  91.208 - #endif
  91.209 --#ifndef __UCLIBC_HAS_XLOCALE__
  91.210 --#define __nl_langinfo_l(N, L)         nl_langinfo((N))
  91.211 --#endif
  91.212 - 
  91.213 - namespace std
  91.214 - {
  91.215 -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
  91.216 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.cc	2008-06-10 14:45:39.000000000 +0200
  91.217 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.cc	2008-06-10 14:45:39.000000000 +0200
  91.218 -@@ -40,9 +40,6 @@
  91.219 - #ifdef __UCLIBC_MJN3_ONLY__
  91.220 - #warning tailor for stub locale support
  91.221 - #endif
  91.222 --#ifndef __UCLIBC_HAS_XLOCALE__
  91.223 --#define __nl_langinfo_l(N, L)         nl_langinfo((N))
  91.224 --#endif
  91.225 - 
  91.226 - namespace std
  91.227 - {
    92.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    92.2 +++ b/patches/gcc/4.3.0/675-uclibc-locale-no__x.patch	Mon Jul 28 21:08:01 2008 +0000
    92.3 @@ -0,0 +1,224 @@
    92.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_203-uclibc-locale-no__x.patch
    92.5 +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
    92.6 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2008-06-10 14:45:39.000000000 +0200
    92.7 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2008-06-10 14:45:39.000000000 +0200
    92.8 +@@ -60,4 +60,49 @@
    92.9 + extern "C" __typeof(wctype_l) __wctype_l;
   92.10 + #endif 
   92.11 + 
   92.12 ++# define __nl_langinfo_l nl_langinfo_l
   92.13 ++# define __strcoll_l strcoll_l
   92.14 ++# define __strftime_l strftime_l
   92.15 ++# define __strtod_l strtod_l
   92.16 ++# define __strtof_l strtof_l
   92.17 ++# define __strtold_l strtold_l
   92.18 ++# define __strxfrm_l strxfrm_l
   92.19 ++# define __newlocale newlocale
   92.20 ++# define __freelocale freelocale
   92.21 ++# define __duplocale duplocale
   92.22 ++# define __uselocale uselocale
   92.23 ++
   92.24 ++# ifdef _GLIBCXX_USE_WCHAR_T
   92.25 ++#  define __iswctype_l iswctype_l
   92.26 ++#  define __towlower_l towlower_l
   92.27 ++#  define __towupper_l towupper_l
   92.28 ++#  define __wcscoll_l wcscoll_l
   92.29 ++#  define __wcsftime_l wcsftime_l
   92.30 ++#  define __wcsxfrm_l wcsxfrm_l
   92.31 ++#  define __wctype_l wctype_l
   92.32 ++# endif
   92.33 ++
   92.34 ++#else
   92.35 ++# define __nl_langinfo_l(N, L)       nl_langinfo((N))
   92.36 ++# define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
   92.37 ++# define __strtod_l(S, E, L)         strtod((S), (E))
   92.38 ++# define __strtof_l(S, E, L)         strtof((S), (E))
   92.39 ++# define __strtold_l(S, E, L)        strtold((S), (E))
   92.40 ++# define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
   92.41 ++# warning should dummy __newlocale check for C|POSIX ?
   92.42 ++# define __newlocale(a, b, c)        NULL
   92.43 ++# define __freelocale(a)             ((void)0)
   92.44 ++# define __duplocale(a)              __c_locale()
   92.45 ++//# define __uselocale ?
   92.46 ++//
   92.47 ++# ifdef _GLIBCXX_USE_WCHAR_T
   92.48 ++#  define __iswctype_l(C, M, L)       iswctype((C), (M))
   92.49 ++#  define __towlower_l(C, L)          towlower((C))
   92.50 ++#  define __towupper_l(C, L)          towupper((C))
   92.51 ++#  define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
   92.52 ++//#  define __wcsftime_l(S, M, F, T, L)  wcsftime((S), (M), (F), (T)) 
   92.53 ++#  define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
   92.54 ++#  define __wctype_l(S, L)            wctype((S))
   92.55 ++# endif
   92.56 ++
   92.57 + #endif // GLIBC 2.3 and later
   92.58 +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
   92.59 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc	2008-06-10 14:45:39.000000000 +0200
   92.60 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.cc	2008-06-10 14:45:39.000000000 +0200
   92.61 +@@ -39,20 +39,6 @@
   92.62 + #include <langinfo.h>
   92.63 + #include <bits/c++locale_internal.h>
   92.64 + 
   92.65 +-#ifndef __UCLIBC_HAS_XLOCALE__
   92.66 +-#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
   92.67 +-#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
   92.68 +-#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
   92.69 +-#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
   92.70 +-#define __strtof_l(S, E, L)         strtof((S), (E))
   92.71 +-#define __strtod_l(S, E, L)         strtod((S), (E))
   92.72 +-#define __strtold_l(S, E, L)        strtold((S), (E))
   92.73 +-#warning should dummy __newlocale check for C|POSIX ?
   92.74 +-#define __newlocale(a, b, c)        NULL
   92.75 +-#define __freelocale(a)             ((void)0)
   92.76 +-#define __duplocale(a)              __c_locale()
   92.77 +-#endif
   92.78 +-
   92.79 + namespace std 
   92.80 + {
   92.81 +   template<>
   92.82 +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
   92.83 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.h	2008-06-10 14:45:39.000000000 +0200
   92.84 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.h	2008-06-10 14:45:39.000000000 +0200
   92.85 +@@ -68,6 +68,7 @@
   92.86 + {
   92.87 +   extern "C" __typeof(uselocale) __uselocale;
   92.88 + }
   92.89 ++#define __uselocale uselocale
   92.90 + #endif
   92.91 + 
   92.92 + namespace std
   92.93 +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
   92.94 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc	2008-06-10 14:45:39.000000000 +0200
   92.95 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/collate_members.cc	2008-06-10 14:45:39.000000000 +0200
   92.96 +@@ -36,13 +36,6 @@
   92.97 + #include <locale>
   92.98 + #include <bits/c++locale_internal.h>
   92.99 + 
  92.100 +-#ifndef __UCLIBC_HAS_XLOCALE__
  92.101 +-#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
  92.102 +-#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
  92.103 +-#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
  92.104 +-#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
  92.105 +-#endif
  92.106 +-
  92.107 + namespace std
  92.108 + {
  92.109 +   // These are basically extensions to char_traits, and perhaps should
  92.110 +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
  92.111 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2008-06-10 14:45:39.000000000 +0200
  92.112 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2008-06-10 14:45:39.000000000 +0200
  92.113 +@@ -38,13 +38,6 @@
  92.114 + #undef _LIBC
  92.115 + #include <bits/c++locale_internal.h>
  92.116 + 
  92.117 +-#ifndef __UCLIBC_HAS_XLOCALE__
  92.118 +-#define __wctype_l(S, L)           wctype((S))
  92.119 +-#define __towupper_l(C, L)         towupper((C))
  92.120 +-#define __towlower_l(C, L)         towlower((C))
  92.121 +-#define __iswctype_l(C, M, L)      iswctype((C), (M))
  92.122 +-#endif
  92.123 +-
  92.124 + namespace std
  92.125 + {
  92.126 +   // NB: The other ctype<char> specializations are in src/locale.cc and
  92.127 +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
  92.128 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc	2008-06-10 14:45:39.000000000 +0200
  92.129 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.cc	2008-06-10 14:45:39.000000000 +0200
  92.130 +@@ -39,13 +39,10 @@
  92.131 + #ifdef __UCLIBC_MJN3_ONLY__
  92.132 + #warning fix gettext stuff
  92.133 + #endif
  92.134 +-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
  92.135 +-extern "C" char *__dcgettext(const char *domainname,
  92.136 +-			     const char *msgid, int category);
  92.137 + #undef gettext
  92.138 +-#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
  92.139 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
  92.140 ++#define gettext(msgid) dcgettext(NULL, msgid, LC_MESSAGES)
  92.141 + #else
  92.142 +-#undef gettext
  92.143 + #define gettext(msgid) (msgid)
  92.144 + #endif
  92.145 + 
  92.146 +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
  92.147 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:45:39.000000000 +0200
  92.148 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:45:39.000000000 +0200
  92.149 +@@ -36,15 +36,11 @@
  92.150 + #ifdef __UCLIBC_MJN3_ONLY__
  92.151 + #warning fix prototypes for *textdomain funcs
  92.152 + #endif
  92.153 +-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
  92.154 +-extern "C" char *__textdomain(const char *domainname);
  92.155 +-extern "C" char *__bindtextdomain(const char *domainname,
  92.156 +-				  const char *dirname);
  92.157 +-#else
  92.158 +-#undef __textdomain
  92.159 +-#undef __bindtextdomain
  92.160 +-#define __textdomain(D)           ((void)0)
  92.161 +-#define __bindtextdomain(D,P)     ((void)0)
  92.162 ++#ifndef __UCLIBC_HAS_GETTEXT_AWARENESS__
  92.163 ++#undef textdomain
  92.164 ++#undef bindtextdomain
  92.165 ++#define textdomain(D)           ((void)0)
  92.166 ++#define bindtextdomain(D,P)     ((void)0)
  92.167 + #endif
  92.168 + 
  92.169 +   // Non-virtual member functions.
  92.170 +@@ -70,7 +66,7 @@
  92.171 +     messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, 
  92.172 + 			   const char* __dir) const
  92.173 +     { 
  92.174 +-      __bindtextdomain(__s.c_str(), __dir);
  92.175 ++      bindtextdomain(__s.c_str(), __dir);
  92.176 +       return this->do_open(__s, __loc); 
  92.177 +     }
  92.178 + 
  92.179 +@@ -90,7 +86,7 @@
  92.180 +     { 
  92.181 +       // No error checking is done, assume the catalog exists and can
  92.182 +       // be used.
  92.183 +-      __textdomain(__s.c_str());
  92.184 ++      textdomain(__s.c_str());
  92.185 +       return 0;
  92.186 +     }
  92.187 + 
  92.188 +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
  92.189 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:45:39.000000000 +0200
  92.190 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:45:39.000000000 +0200
  92.191 +@@ -43,10 +43,6 @@
  92.192 + #warning tailor for stub locale support
  92.193 + #endif
  92.194 + 
  92.195 +-#ifndef __UCLIBC_HAS_XLOCALE__
  92.196 +-#define __nl_langinfo_l(N, L)         nl_langinfo((N))
  92.197 +-#endif
  92.198 +-
  92.199 + namespace std
  92.200 + {
  92.201 +   // Construct and return valid pattern consisting of some combination of:
  92.202 +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
  92.203 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:45:39.000000000 +0200
  92.204 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:45:39.000000000 +0200
  92.205 +@@ -41,9 +41,6 @@
  92.206 + #ifdef __UCLIBC_MJN3_ONLY__
  92.207 + #warning tailor for stub locale support
  92.208 + #endif
  92.209 +-#ifndef __UCLIBC_HAS_XLOCALE__
  92.210 +-#define __nl_langinfo_l(N, L)         nl_langinfo((N))
  92.211 +-#endif
  92.212 + 
  92.213 + namespace std
  92.214 + {
  92.215 +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
  92.216 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.cc	2008-06-10 14:45:39.000000000 +0200
  92.217 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.cc	2008-06-10 14:45:39.000000000 +0200
  92.218 +@@ -40,9 +40,6 @@
  92.219 + #ifdef __UCLIBC_MJN3_ONLY__
  92.220 + #warning tailor for stub locale support
  92.221 + #endif
  92.222 +-#ifndef __UCLIBC_HAS_XLOCALE__
  92.223 +-#define __nl_langinfo_l(N, L)         nl_langinfo((N))
  92.224 +-#endif
  92.225 + 
  92.226 + namespace std
  92.227 + {
    93.1 --- a/patches/gcc/4.3.0/700-204-uclibc-locale-wchar_fix.patch	Mon Jul 28 20:17:48 2008 +0000
    93.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    93.3 @@ -1,51 +0,0 @@
    93.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_204-uclibc-locale-wchar_fix.patch
    93.5 -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
    93.6 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:45:43.000000000 +0200
    93.7 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:45:43.000000000 +0200
    93.8 -@@ -401,7 +401,7 @@
    93.9 - # ifdef __UCLIBC_HAS_XLOCALE__
   93.10 - 	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
   93.11 - 	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
   93.12 --# else
   93.13 -+# elif defined __UCLIBC_HAS_LOCALE__
   93.14 - 	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
   93.15 - 	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
   93.16 - # endif
   93.17 -@@ -556,7 +556,7 @@
   93.18 - # ifdef __UCLIBC_HAS_XLOCALE__
   93.19 - 	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
   93.20 - 	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
   93.21 --# else
   93.22 -+# elif defined __UCLIBC_HAS_LOCALE__
   93.23 - 	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
   93.24 - 	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
   93.25 - # endif
   93.26 -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
   93.27 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:45:43.000000000 +0200
   93.28 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:45:43.000000000 +0200
   93.29 -@@ -127,12 +127,25 @@
   93.30 - 	{
   93.31 - 	  // Named locale.
   93.32 - 	  // NB: In the GNU model wchar_t is always 32 bit wide.
   93.33 -+#ifdef __UCLIBC_MJN3_ONLY__
   93.34 -+#warning fix this... should be numeric
   93.35 -+#endif
   93.36 -+#ifdef __UCLIBC__
   93.37 -+# ifdef __UCLIBC_HAS_XLOCALE__
   93.38 -+	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
   93.39 -+	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
   93.40 -+# elif defined __UCLIBC_HAS_LOCALE__
   93.41 -+	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
   93.42 -+	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
   93.43 -+# endif
   93.44 -+#else
   93.45 - 	  union { char *__s; wchar_t __w; } __u;
   93.46 - 	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
   93.47 - 	  _M_data->_M_decimal_point = __u.__w;
   93.48 - 
   93.49 - 	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
   93.50 - 	  _M_data->_M_thousands_sep = __u.__w;
   93.51 -+#endif
   93.52 - 
   93.53 - 	  if (_M_data->_M_thousands_sep == L'\0')
   93.54 - 	    _M_data->_M_grouping = "";
    94.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    94.2 +++ b/patches/gcc/4.3.0/700-uclibc-locale-wchar_fix.patch	Mon Jul 28 21:08:01 2008 +0000
    94.3 @@ -0,0 +1,51 @@
    94.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_204-uclibc-locale-wchar_fix.patch
    94.5 +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
    94.6 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:45:43.000000000 +0200
    94.7 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:45:43.000000000 +0200
    94.8 +@@ -401,7 +401,7 @@
    94.9 + # ifdef __UCLIBC_HAS_XLOCALE__
   94.10 + 	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
   94.11 + 	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
   94.12 +-# else
   94.13 ++# elif defined __UCLIBC_HAS_LOCALE__
   94.14 + 	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
   94.15 + 	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
   94.16 + # endif
   94.17 +@@ -556,7 +556,7 @@
   94.18 + # ifdef __UCLIBC_HAS_XLOCALE__
   94.19 + 	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
   94.20 + 	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
   94.21 +-# else
   94.22 ++# elif defined __UCLIBC_HAS_LOCALE__
   94.23 + 	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
   94.24 + 	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
   94.25 + # endif
   94.26 +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
   94.27 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:45:43.000000000 +0200
   94.28 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:45:43.000000000 +0200
   94.29 +@@ -127,12 +127,25 @@
   94.30 + 	{
   94.31 + 	  // Named locale.
   94.32 + 	  // NB: In the GNU model wchar_t is always 32 bit wide.
   94.33 ++#ifdef __UCLIBC_MJN3_ONLY__
   94.34 ++#warning fix this... should be numeric
   94.35 ++#endif
   94.36 ++#ifdef __UCLIBC__
   94.37 ++# ifdef __UCLIBC_HAS_XLOCALE__
   94.38 ++	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
   94.39 ++	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
   94.40 ++# elif defined __UCLIBC_HAS_LOCALE__
   94.41 ++	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
   94.42 ++	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
   94.43 ++# endif
   94.44 ++#else
   94.45 + 	  union { char *__s; wchar_t __w; } __u;
   94.46 + 	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
   94.47 + 	  _M_data->_M_decimal_point = __u.__w;
   94.48 + 
   94.49 + 	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
   94.50 + 	  _M_data->_M_thousands_sep = __u.__w;
   94.51 ++#endif
   94.52 + 
   94.53 + 	  if (_M_data->_M_thousands_sep == L'\0')
   94.54 + 	    _M_data->_M_grouping = "";
    95.1 --- a/patches/gcc/4.3.0/725-205-uclibc-locale-update.patch	Mon Jul 28 20:17:48 2008 +0000
    95.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    95.3 @@ -1,355 +0,0 @@
    95.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_205-uclibc-locale-update.patch
    95.5 -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
    95.6 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc	2008-06-10 14:45:43.000000000 +0200
    95.7 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.cc	2008-06-10 14:45:46.000000000 +0200
    95.8 -@@ -46,16 +46,13 @@
    95.9 -     __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, 
   95.10 - 		   const __c_locale& __cloc)
   95.11 -     {
   95.12 --      if (!(__err & ios_base::failbit))
   95.13 --	{
   95.14 --	  char* __sanity;
   95.15 --	  errno = 0;
   95.16 --	  float __f = __strtof_l(__s, &__sanity, __cloc);
   95.17 --          if (__sanity != __s && errno != ERANGE)
   95.18 --	    __v = __f;
   95.19 --	  else
   95.20 --	    __err |= ios_base::failbit;
   95.21 --	}
   95.22 -+      char* __sanity;
   95.23 -+      errno = 0;
   95.24 -+      float __f = __strtof_l(__s, &__sanity, __cloc);
   95.25 -+      if (__sanity != __s && errno != ERANGE)
   95.26 -+	__v = __f;
   95.27 -+      else
   95.28 -+	__err |= ios_base::failbit;
   95.29 -     }
   95.30 - 
   95.31 -   template<>
   95.32 -@@ -63,16 +60,13 @@
   95.33 -     __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, 
   95.34 - 		   const __c_locale& __cloc)
   95.35 -     {
   95.36 --      if (!(__err & ios_base::failbit))
   95.37 --	{
   95.38 --	  char* __sanity;
   95.39 --	  errno = 0;
   95.40 --	  double __d = __strtod_l(__s, &__sanity, __cloc);
   95.41 --          if (__sanity != __s && errno != ERANGE)
   95.42 --	    __v = __d;
   95.43 --	  else
   95.44 --	    __err |= ios_base::failbit;
   95.45 --	}
   95.46 -+      char* __sanity;
   95.47 -+      errno = 0;
   95.48 -+      double __d = __strtod_l(__s, &__sanity, __cloc);
   95.49 -+      if (__sanity != __s && errno != ERANGE)
   95.50 -+	__v = __d;
   95.51 -+      else
   95.52 -+	__err |= ios_base::failbit;
   95.53 -     }
   95.54 - 
   95.55 -   template<>
   95.56 -@@ -80,16 +74,13 @@
   95.57 -     __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
   95.58 - 		   const __c_locale& __cloc)
   95.59 -     {
   95.60 --      if (!(__err & ios_base::failbit))
   95.61 --	{
   95.62 --	  char* __sanity;
   95.63 --	  errno = 0;
   95.64 --	  long double __ld = __strtold_l(__s, &__sanity, __cloc);
   95.65 --          if (__sanity != __s && errno != ERANGE)
   95.66 --	    __v = __ld;
   95.67 --	  else
   95.68 --	    __err |= ios_base::failbit;
   95.69 --	}
   95.70 -+      char* __sanity;
   95.71 -+      errno = 0;
   95.72 -+      long double __ld = __strtold_l(__s, &__sanity, __cloc);
   95.73 -+      if (__sanity != __s && errno != ERANGE)
   95.74 -+	__v = __ld;
   95.75 -+      else
   95.76 -+	__err |= ios_base::failbit;
   95.77 -     }
   95.78 - 
   95.79 -   void
   95.80 -@@ -110,7 +101,7 @@
   95.81 -   void
   95.82 -   locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
   95.83 -   {
   95.84 --    if (_S_get_c_locale() != __cloc)
   95.85 -+    if (__cloc && _S_get_c_locale() != __cloc)
   95.86 -       __freelocale(__cloc); 
   95.87 -   }
   95.88 - 
   95.89 -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
   95.90 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.h	2008-06-10 14:45:43.000000000 +0200
   95.91 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.h	2008-06-10 14:45:46.000000000 +0200
   95.92 -@@ -39,21 +39,23 @@
   95.93 - #pragma GCC system_header
   95.94 - 
   95.95 - #include <cstring>              // get std::strlen
   95.96 --#include <cstdio>               // get std::snprintf or std::sprintf
   95.97 -+#include <cstdio>               // get std::vsnprintf or std::vsprintf
   95.98 - #include <clocale>
   95.99 - #include <langinfo.h>		// For codecvt
  95.100 - #ifdef __UCLIBC_MJN3_ONLY__
  95.101 - #warning fix this
  95.102 - #endif
  95.103 --#ifdef __UCLIBC_HAS_LOCALE__
  95.104 -+#ifdef _GLIBCXX_USE_ICONV
  95.105 - #include <iconv.h>		// For codecvt using iconv, iconv_t
  95.106 - #endif
  95.107 --#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
  95.108 --#include <libintl.h> 		// For messages
  95.109 -+#ifdef HAVE_LIBINTL_H
  95.110 -+#include <libintl.h>		// For messages
  95.111 - #endif
  95.112 -+#include <cstdarg>
  95.113 - 
  95.114 - #ifdef __UCLIBC_MJN3_ONLY__
  95.115 - #warning what is _GLIBCXX_C_LOCALE_GNU for
  95.116 -+// psm: used in os/gnu-linux/ctype_noninline.h
  95.117 - #endif
  95.118 - #define _GLIBCXX_C_LOCALE_GNU 1
  95.119 - 
  95.120 -@@ -62,7 +64,7 @@
  95.121 - #endif
  95.122 - // #define _GLIBCXX_NUM_CATEGORIES 6
  95.123 - #define _GLIBCXX_NUM_CATEGORIES 0
  95.124 -- 
  95.125 -+
  95.126 - #ifdef __UCLIBC_HAS_XLOCALE__
  95.127 - namespace __gnu_cxx
  95.128 - {
  95.129 -@@ -79,22 +81,24 @@
  95.130 -   typedef int*			__c_locale;
  95.131 - #endif
  95.132 - 
  95.133 --  // Convert numeric value of type _Tv to string and return length of
  95.134 --  // string.  If snprintf is available use it, otherwise fall back to
  95.135 --  // the unsafe sprintf which, in general, can be dangerous and should
  95.136 -+  // Convert numeric value of type double to string and return length of
  95.137 -+  // string.  If vsnprintf is available use it, otherwise fall back to
  95.138 -+  // the unsafe vsprintf which, in general, can be dangerous and should
  95.139 -   // be avoided.
  95.140 --  template<typename _Tv>
  95.141 --    int
  95.142 --    __convert_from_v(char* __out, 
  95.143 --		     const int __size __attribute__ ((__unused__)),
  95.144 --		     const char* __fmt,
  95.145 --#ifdef __UCLIBC_HAS_XCLOCALE__
  95.146 --		     _Tv __v, const __c_locale& __cloc, int __prec)
  95.147 -+    inline int
  95.148 -+    __convert_from_v(const __c_locale&
  95.149 -+#ifndef __UCLIBC_HAS_XCLOCALE__
  95.150 -+					__cloc __attribute__ ((__unused__))
  95.151 -+#endif
  95.152 -+		     ,
  95.153 -+		     char* __out,
  95.154 -+		     const int __size,
  95.155 -+		     const char* __fmt, ...)
  95.156 -     {
  95.157 -+      va_list __args;
  95.158 -+#ifdef __UCLIBC_HAS_XCLOCALE__
  95.159 -       __c_locale __old = __gnu_cxx::__uselocale(__cloc);
  95.160 - #else
  95.161 --		     _Tv __v, const __c_locale&, int __prec)
  95.162 --    {
  95.163 - # ifdef __UCLIBC_HAS_LOCALE__
  95.164 -       char* __old = std::setlocale(LC_ALL, NULL);
  95.165 -       char* __sav = new char[std::strlen(__old) + 1];
  95.166 -@@ -103,7 +107,9 @@
  95.167 - # endif
  95.168 - #endif
  95.169 - 
  95.170 --      const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
  95.171 -+      va_start(__args, __fmt);
  95.172 -+      const int __ret = std::vsnprintf(__out, __size, __fmt, __args);
  95.173 -+      va_end(__args);
  95.174 - 
  95.175 - #ifdef __UCLIBC_HAS_XCLOCALE__
  95.176 -       __gnu_cxx::__uselocale(__old);
  95.177 -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
  95.178 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2008-06-10 14:45:43.000000000 +0200
  95.179 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2008-06-10 14:45:46.000000000 +0200
  95.180 -@@ -33,9 +33,14 @@
  95.181 - 
  95.182 - // Written by Benjamin Kosnik <bkoz@redhat.com>
  95.183 - 
  95.184 -+#include <features.h>
  95.185 -+#ifdef __UCLIBC_HAS_LOCALE__
  95.186 - #define _LIBC
  95.187 - #include <locale>
  95.188 - #undef _LIBC
  95.189 -+#else
  95.190 -+#include <locale>
  95.191 -+#endif
  95.192 - #include <bits/c++locale_internal.h>
  95.193 - 
  95.194 - namespace std
  95.195 -@@ -138,20 +143,34 @@
  95.196 -   ctype<wchar_t>::
  95.197 -   do_is(mask __m, wchar_t __c) const
  95.198 -   { 
  95.199 --    // Highest bitmask in ctype_base == 10, but extra in "C"
  95.200 --    // library for blank.
  95.201 -+    // The case of __m == ctype_base::space is particularly important,
  95.202 -+    // due to its use in many istream functions.  Therefore we deal with
  95.203 -+    // it first, exploiting the knowledge that on GNU systems _M_bit[5]
  95.204 -+    // is the mask corresponding to ctype_base::space.  NB: an encoding
  95.205 -+    // change would not affect correctness!
  95.206 -     bool __ret = false;
  95.207 --    const size_t __bitmasksize = 11; 
  95.208 --    for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
  95.209 --      if (__m & _M_bit[__bitcur]
  95.210 --	  && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
  95.211 --	{
  95.212 --	  __ret = true;
  95.213 --	  break;
  95.214 --	}
  95.215 -+    if (__m == _M_bit[5])
  95.216 -+      __ret = __iswctype_l(__c, _M_wmask[5], _M_c_locale_ctype);
  95.217 -+    else
  95.218 -+      {
  95.219 -+	// Highest bitmask in ctype_base == 10, but extra in "C"
  95.220 -+	// library for blank.
  95.221 -+	const size_t __bitmasksize = 11;
  95.222 -+	for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
  95.223 -+	  if (__m & _M_bit[__bitcur])
  95.224 -+	    {
  95.225 -+	      if (__iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
  95.226 -+		{
  95.227 -+		  __ret = true;
  95.228 -+		  break;
  95.229 -+		}
  95.230 -+	      else if (__m == _M_bit[__bitcur])
  95.231 -+		break;
  95.232 -+	    }
  95.233 -+      }
  95.234 -     return __ret;    
  95.235 -   }
  95.236 --  
  95.237 -+
  95.238 -   const wchar_t* 
  95.239 -   ctype<wchar_t>::
  95.240 -   do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
  95.241 -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
  95.242 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:45:43.000000000 +0200
  95.243 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:45:46.000000000 +0200
  95.244 -@@ -47,18 +47,21 @@
  95.245 -   template<typename _CharT>
  95.246 -      messages<_CharT>::messages(size_t __refs)
  95.247 -      : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), 
  95.248 --     _M_name_messages(_S_get_c_name())
  95.249 -+       _M_name_messages(_S_get_c_name())
  95.250 -      { }
  95.251 - 
  95.252 -   template<typename _CharT>
  95.253 -      messages<_CharT>::messages(__c_locale __cloc, const char* __s, 
  95.254 - 				size_t __refs) 
  95.255 --     : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
  95.256 --     _M_name_messages(__s)
  95.257 -+     : facet(__refs), _M_c_locale_messages(NULL), _M_name_messages(NULL)
  95.258 -      {
  95.259 --       char* __tmp = new char[std::strlen(__s) + 1];
  95.260 --       std::strcpy(__tmp, __s);
  95.261 -+       const size_t __len = std::strlen(__s) + 1;
  95.262 -+       char* __tmp = new char[__len];
  95.263 -+       std::memcpy(__tmp, __s, __len);
  95.264 -        _M_name_messages = __tmp;
  95.265 -+
  95.266 -+       // Last to avoid leaking memory if new throws.
  95.267 -+       _M_c_locale_messages = _S_clone_c_locale(__cloc);
  95.268 -      }
  95.269 - 
  95.270 -   template<typename _CharT>
  95.271 -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
  95.272 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:45:46.000000000 +0200
  95.273 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:45:46.000000000 +0200
  95.274 -@@ -33,9 +33,14 @@
  95.275 - 
  95.276 - // Written by Benjamin Kosnik <bkoz@redhat.com>
  95.277 - 
  95.278 -+#include <features.h>
  95.279 -+#ifdef __UCLIBC_HAS_LOCALE__
  95.280 - #define _LIBC
  95.281 - #include <locale>
  95.282 - #undef _LIBC
  95.283 -+#else
  95.284 -+#include <locale>
  95.285 -+#endif
  95.286 - #include <bits/c++locale_internal.h>
  95.287 - 
  95.288 - #ifdef __UCLIBC_MJN3_ONLY__
  95.289 -@@ -206,7 +211,7 @@
  95.290 - 	  }
  95.291 - 	break;
  95.292 -       default:
  95.293 --	;
  95.294 -+	__ret = pattern();
  95.295 -       }
  95.296 -     return __ret;
  95.297 -   }
  95.298 -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
  95.299 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:45:46.000000000 +0200
  95.300 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:45:46.000000000 +0200
  95.301 -@@ -33,9 +33,14 @@
  95.302 - 
  95.303 - // Written by Benjamin Kosnik <bkoz@redhat.com>
  95.304 - 
  95.305 -+#include <features.h>
  95.306 -+#ifdef __UCLIBC_HAS_LOCALE__
  95.307 - #define _LIBC
  95.308 - #include <locale>
  95.309 - #undef _LIBC
  95.310 -+#else
  95.311 -+#include <locale>
  95.312 -+#endif
  95.313 - #include <bits/c++locale_internal.h>
  95.314 - 
  95.315 - #ifdef __UCLIBC_MJN3_ONLY__
  95.316 -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
  95.317 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.h	2008-06-10 14:45:39.000000000 +0200
  95.318 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.h	2008-06-10 14:45:46.000000000 +0200
  95.319 -@@ -37,25 +37,33 @@
  95.320 -   template<typename _CharT>
  95.321 -     __timepunct<_CharT>::__timepunct(size_t __refs) 
  95.322 -     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
  95.323 --    _M_name_timepunct(_S_get_c_name())
  95.324 -+      _M_name_timepunct(_S_get_c_name())
  95.325 -     { _M_initialize_timepunct(); }
  95.326 - 
  95.327 -   template<typename _CharT>
  95.328 -     __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) 
  95.329 -     : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), 
  95.330 --    _M_name_timepunct(_S_get_c_name())
  95.331 -+      _M_name_timepunct(_S_get_c_name())
  95.332 -     { _M_initialize_timepunct(); }
  95.333 - 
  95.334 -   template<typename _CharT>
  95.335 -     __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
  95.336 - 				     size_t __refs) 
  95.337 -     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
  95.338 --    _M_name_timepunct(__s)
  95.339 -+      _M_name_timepunct(NULL)
  95.340 -     { 
  95.341 --      char* __tmp = new char[std::strlen(__s) + 1];
  95.342 --      std::strcpy(__tmp, __s);
  95.343 -+      const size_t __len = std::strlen(__s) + 1;
  95.344 -+      char* __tmp = new char[__len];
  95.345 -+      std::memcpy(__tmp, __s, __len);
  95.346 -       _M_name_timepunct = __tmp;
  95.347 --      _M_initialize_timepunct(__cloc); 
  95.348 -+
  95.349 -+      try
  95.350 -+	{ _M_initialize_timepunct(__cloc); }
  95.351 -+      catch(...)
  95.352 -+	{
  95.353 -+	  delete [] _M_name_timepunct;
  95.354 -+	  __throw_exception_again;
  95.355 -+	}
  95.356 -     }
  95.357 - 
  95.358 -   template<typename _CharT>
    96.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    96.2 +++ b/patches/gcc/4.3.0/725-uclibc-locale-update.patch	Mon Jul 28 21:08:01 2008 +0000
    96.3 @@ -0,0 +1,355 @@
    96.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_205-uclibc-locale-update.patch
    96.5 +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
    96.6 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc	2008-06-10 14:45:43.000000000 +0200
    96.7 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.cc	2008-06-10 14:45:46.000000000 +0200
    96.8 +@@ -46,16 +46,13 @@
    96.9 +     __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, 
   96.10 + 		   const __c_locale& __cloc)
   96.11 +     {
   96.12 +-      if (!(__err & ios_base::failbit))
   96.13 +-	{
   96.14 +-	  char* __sanity;
   96.15 +-	  errno = 0;
   96.16 +-	  float __f = __strtof_l(__s, &__sanity, __cloc);
   96.17 +-          if (__sanity != __s && errno != ERANGE)
   96.18 +-	    __v = __f;
   96.19 +-	  else
   96.20 +-	    __err |= ios_base::failbit;
   96.21 +-	}
   96.22 ++      char* __sanity;
   96.23 ++      errno = 0;
   96.24 ++      float __f = __strtof_l(__s, &__sanity, __cloc);
   96.25 ++      if (__sanity != __s && errno != ERANGE)
   96.26 ++	__v = __f;
   96.27 ++      else
   96.28 ++	__err |= ios_base::failbit;
   96.29 +     }
   96.30 + 
   96.31 +   template<>
   96.32 +@@ -63,16 +60,13 @@
   96.33 +     __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, 
   96.34 + 		   const __c_locale& __cloc)
   96.35 +     {
   96.36 +-      if (!(__err & ios_base::failbit))
   96.37 +-	{
   96.38 +-	  char* __sanity;
   96.39 +-	  errno = 0;
   96.40 +-	  double __d = __strtod_l(__s, &__sanity, __cloc);
   96.41 +-          if (__sanity != __s && errno != ERANGE)
   96.42 +-	    __v = __d;
   96.43 +-	  else
   96.44 +-	    __err |= ios_base::failbit;
   96.45 +-	}
   96.46 ++      char* __sanity;
   96.47 ++      errno = 0;
   96.48 ++      double __d = __strtod_l(__s, &__sanity, __cloc);
   96.49 ++      if (__sanity != __s && errno != ERANGE)
   96.50 ++	__v = __d;
   96.51 ++      else
   96.52 ++	__err |= ios_base::failbit;
   96.53 +     }
   96.54 + 
   96.55 +   template<>
   96.56 +@@ -80,16 +74,13 @@
   96.57 +     __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
   96.58 + 		   const __c_locale& __cloc)
   96.59 +     {
   96.60 +-      if (!(__err & ios_base::failbit))
   96.61 +-	{
   96.62 +-	  char* __sanity;
   96.63 +-	  errno = 0;
   96.64 +-	  long double __ld = __strtold_l(__s, &__sanity, __cloc);
   96.65 +-          if (__sanity != __s && errno != ERANGE)
   96.66 +-	    __v = __ld;
   96.67 +-	  else
   96.68 +-	    __err |= ios_base::failbit;
   96.69 +-	}
   96.70 ++      char* __sanity;
   96.71 ++      errno = 0;
   96.72 ++      long double __ld = __strtold_l(__s, &__sanity, __cloc);
   96.73 ++      if (__sanity != __s && errno != ERANGE)
   96.74 ++	__v = __ld;
   96.75 ++      else
   96.76 ++	__err |= ios_base::failbit;
   96.77 +     }
   96.78 + 
   96.79 +   void
   96.80 +@@ -110,7 +101,7 @@
   96.81 +   void
   96.82 +   locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
   96.83 +   {
   96.84 +-    if (_S_get_c_locale() != __cloc)
   96.85 ++    if (__cloc && _S_get_c_locale() != __cloc)
   96.86 +       __freelocale(__cloc); 
   96.87 +   }
   96.88 + 
   96.89 +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
   96.90 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.h	2008-06-10 14:45:43.000000000 +0200
   96.91 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.h	2008-06-10 14:45:46.000000000 +0200
   96.92 +@@ -39,21 +39,23 @@
   96.93 + #pragma GCC system_header
   96.94 + 
   96.95 + #include <cstring>              // get std::strlen
   96.96 +-#include <cstdio>               // get std::snprintf or std::sprintf
   96.97 ++#include <cstdio>               // get std::vsnprintf or std::vsprintf
   96.98 + #include <clocale>
   96.99 + #include <langinfo.h>		// For codecvt
  96.100 + #ifdef __UCLIBC_MJN3_ONLY__
  96.101 + #warning fix this
  96.102 + #endif
  96.103 +-#ifdef __UCLIBC_HAS_LOCALE__
  96.104 ++#ifdef _GLIBCXX_USE_ICONV
  96.105 + #include <iconv.h>		// For codecvt using iconv, iconv_t
  96.106 + #endif
  96.107 +-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
  96.108 +-#include <libintl.h> 		// For messages
  96.109 ++#ifdef HAVE_LIBINTL_H
  96.110 ++#include <libintl.h>		// For messages
  96.111 + #endif
  96.112 ++#include <cstdarg>
  96.113 + 
  96.114 + #ifdef __UCLIBC_MJN3_ONLY__
  96.115 + #warning what is _GLIBCXX_C_LOCALE_GNU for
  96.116 ++// psm: used in os/gnu-linux/ctype_noninline.h
  96.117 + #endif
  96.118 + #define _GLIBCXX_C_LOCALE_GNU 1
  96.119 + 
  96.120 +@@ -62,7 +64,7 @@
  96.121 + #endif
  96.122 + // #define _GLIBCXX_NUM_CATEGORIES 6
  96.123 + #define _GLIBCXX_NUM_CATEGORIES 0
  96.124 +- 
  96.125 ++
  96.126 + #ifdef __UCLIBC_HAS_XLOCALE__
  96.127 + namespace __gnu_cxx
  96.128 + {
  96.129 +@@ -79,22 +81,24 @@
  96.130 +   typedef int*			__c_locale;
  96.131 + #endif
  96.132 + 
  96.133 +-  // Convert numeric value of type _Tv to string and return length of
  96.134 +-  // string.  If snprintf is available use it, otherwise fall back to
  96.135 +-  // the unsafe sprintf which, in general, can be dangerous and should
  96.136 ++  // Convert numeric value of type double to string and return length of
  96.137 ++  // string.  If vsnprintf is available use it, otherwise fall back to
  96.138 ++  // the unsafe vsprintf which, in general, can be dangerous and should
  96.139 +   // be avoided.
  96.140 +-  template<typename _Tv>
  96.141 +-    int
  96.142 +-    __convert_from_v(char* __out, 
  96.143 +-		     const int __size __attribute__ ((__unused__)),
  96.144 +-		     const char* __fmt,
  96.145 +-#ifdef __UCLIBC_HAS_XCLOCALE__
  96.146 +-		     _Tv __v, const __c_locale& __cloc, int __prec)
  96.147 ++    inline int
  96.148 ++    __convert_from_v(const __c_locale&
  96.149 ++#ifndef __UCLIBC_HAS_XCLOCALE__
  96.150 ++					__cloc __attribute__ ((__unused__))
  96.151 ++#endif
  96.152 ++		     ,
  96.153 ++		     char* __out,
  96.154 ++		     const int __size,
  96.155 ++		     const char* __fmt, ...)
  96.156 +     {
  96.157 ++      va_list __args;
  96.158 ++#ifdef __UCLIBC_HAS_XCLOCALE__
  96.159 +       __c_locale __old = __gnu_cxx::__uselocale(__cloc);
  96.160 + #else
  96.161 +-		     _Tv __v, const __c_locale&, int __prec)
  96.162 +-    {
  96.163 + # ifdef __UCLIBC_HAS_LOCALE__
  96.164 +       char* __old = std::setlocale(LC_ALL, NULL);
  96.165 +       char* __sav = new char[std::strlen(__old) + 1];
  96.166 +@@ -103,7 +107,9 @@
  96.167 + # endif
  96.168 + #endif
  96.169 + 
  96.170 +-      const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
  96.171 ++      va_start(__args, __fmt);
  96.172 ++      const int __ret = std::vsnprintf(__out, __size, __fmt, __args);
  96.173 ++      va_end(__args);
  96.174 + 
  96.175 + #ifdef __UCLIBC_HAS_XCLOCALE__
  96.176 +       __gnu_cxx::__uselocale(__old);
  96.177 +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
  96.178 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2008-06-10 14:45:43.000000000 +0200
  96.179 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2008-06-10 14:45:46.000000000 +0200
  96.180 +@@ -33,9 +33,14 @@
  96.181 + 
  96.182 + // Written by Benjamin Kosnik <bkoz@redhat.com>
  96.183 + 
  96.184 ++#include <features.h>
  96.185 ++#ifdef __UCLIBC_HAS_LOCALE__
  96.186 + #define _LIBC
  96.187 + #include <locale>
  96.188 + #undef _LIBC
  96.189 ++#else
  96.190 ++#include <locale>
  96.191 ++#endif
  96.192 + #include <bits/c++locale_internal.h>
  96.193 + 
  96.194 + namespace std
  96.195 +@@ -138,20 +143,34 @@
  96.196 +   ctype<wchar_t>::
  96.197 +   do_is(mask __m, wchar_t __c) const
  96.198 +   { 
  96.199 +-    // Highest bitmask in ctype_base == 10, but extra in "C"
  96.200 +-    // library for blank.
  96.201 ++    // The case of __m == ctype_base::space is particularly important,
  96.202 ++    // due to its use in many istream functions.  Therefore we deal with
  96.203 ++    // it first, exploiting the knowledge that on GNU systems _M_bit[5]
  96.204 ++    // is the mask corresponding to ctype_base::space.  NB: an encoding
  96.205 ++    // change would not affect correctness!
  96.206 +     bool __ret = false;
  96.207 +-    const size_t __bitmasksize = 11; 
  96.208 +-    for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
  96.209 +-      if (__m & _M_bit[__bitcur]
  96.210 +-	  && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
  96.211 +-	{
  96.212 +-	  __ret = true;
  96.213 +-	  break;
  96.214 +-	}
  96.215 ++    if (__m == _M_bit[5])
  96.216 ++      __ret = __iswctype_l(__c, _M_wmask[5], _M_c_locale_ctype);
  96.217 ++    else
  96.218 ++      {
  96.219 ++	// Highest bitmask in ctype_base == 10, but extra in "C"
  96.220 ++	// library for blank.
  96.221 ++	const size_t __bitmasksize = 11;
  96.222 ++	for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
  96.223 ++	  if (__m & _M_bit[__bitcur])
  96.224 ++	    {
  96.225 ++	      if (__iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
  96.226 ++		{
  96.227 ++		  __ret = true;
  96.228 ++		  break;
  96.229 ++		}
  96.230 ++	      else if (__m == _M_bit[__bitcur])
  96.231 ++		break;
  96.232 ++	    }
  96.233 ++      }
  96.234 +     return __ret;    
  96.235 +   }
  96.236 +-  
  96.237 ++
  96.238 +   const wchar_t* 
  96.239 +   ctype<wchar_t>::
  96.240 +   do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
  96.241 +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
  96.242 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:45:43.000000000 +0200
  96.243 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:45:46.000000000 +0200
  96.244 +@@ -47,18 +47,21 @@
  96.245 +   template<typename _CharT>
  96.246 +      messages<_CharT>::messages(size_t __refs)
  96.247 +      : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), 
  96.248 +-     _M_name_messages(_S_get_c_name())
  96.249 ++       _M_name_messages(_S_get_c_name())
  96.250 +      { }
  96.251 + 
  96.252 +   template<typename _CharT>
  96.253 +      messages<_CharT>::messages(__c_locale __cloc, const char* __s, 
  96.254 + 				size_t __refs) 
  96.255 +-     : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
  96.256 +-     _M_name_messages(__s)
  96.257 ++     : facet(__refs), _M_c_locale_messages(NULL), _M_name_messages(NULL)
  96.258 +      {
  96.259 +-       char* __tmp = new char[std::strlen(__s) + 1];
  96.260 +-       std::strcpy(__tmp, __s);
  96.261 ++       const size_t __len = std::strlen(__s) + 1;
  96.262 ++       char* __tmp = new char[__len];
  96.263 ++       std::memcpy(__tmp, __s, __len);
  96.264 +        _M_name_messages = __tmp;
  96.265 ++
  96.266 ++       // Last to avoid leaking memory if new throws.
  96.267 ++       _M_c_locale_messages = _S_clone_c_locale(__cloc);
  96.268 +      }
  96.269 + 
  96.270 +   template<typename _CharT>
  96.271 +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
  96.272 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:45:46.000000000 +0200
  96.273 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:45:46.000000000 +0200
  96.274 +@@ -33,9 +33,14 @@
  96.275 + 
  96.276 + // Written by Benjamin Kosnik <bkoz@redhat.com>
  96.277 + 
  96.278 ++#include <features.h>
  96.279 ++#ifdef __UCLIBC_HAS_LOCALE__
  96.280 + #define _LIBC
  96.281 + #include <locale>
  96.282 + #undef _LIBC
  96.283 ++#else
  96.284 ++#include <locale>
  96.285 ++#endif
  96.286 + #include <bits/c++locale_internal.h>
  96.287 + 
  96.288 + #ifdef __UCLIBC_MJN3_ONLY__
  96.289 +@@ -206,7 +211,7 @@
  96.290 + 	  }
  96.291 + 	break;
  96.292 +       default:
  96.293 +-	;
  96.294 ++	__ret = pattern();
  96.295 +       }
  96.296 +     return __ret;
  96.297 +   }
  96.298 +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
  96.299 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:45:46.000000000 +0200
  96.300 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:45:46.000000000 +0200
  96.301 +@@ -33,9 +33,14 @@
  96.302 + 
  96.303 + // Written by Benjamin Kosnik <bkoz@redhat.com>
  96.304 + 
  96.305 ++#include <features.h>
  96.306 ++#ifdef __UCLIBC_HAS_LOCALE__
  96.307 + #define _LIBC
  96.308 + #include <locale>
  96.309 + #undef _LIBC
  96.310 ++#else
  96.311 ++#include <locale>
  96.312 ++#endif
  96.313 + #include <bits/c++locale_internal.h>
  96.314 + 
  96.315 + #ifdef __UCLIBC_MJN3_ONLY__
  96.316 +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
  96.317 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.h	2008-06-10 14:45:39.000000000 +0200
  96.318 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.h	2008-06-10 14:45:46.000000000 +0200
  96.319 +@@ -37,25 +37,33 @@
  96.320 +   template<typename _CharT>
  96.321 +     __timepunct<_CharT>::__timepunct(size_t __refs) 
  96.322 +     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
  96.323 +-    _M_name_timepunct(_S_get_c_name())
  96.324 ++      _M_name_timepunct(_S_get_c_name())
  96.325 +     { _M_initialize_timepunct(); }
  96.326 + 
  96.327 +   template<typename _CharT>
  96.328 +     __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) 
  96.329 +     : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), 
  96.330 +-    _M_name_timepunct(_S_get_c_name())
  96.331 ++      _M_name_timepunct(_S_get_c_name())
  96.332 +     { _M_initialize_timepunct(); }
  96.333 + 
  96.334 +   template<typename _CharT>
  96.335 +     __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
  96.336 + 				     size_t __refs) 
  96.337 +     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
  96.338 +-    _M_name_timepunct(__s)
  96.339 ++      _M_name_timepunct(NULL)
  96.340 +     { 
  96.341 +-      char* __tmp = new char[std::strlen(__s) + 1];
  96.342 +-      std::strcpy(__tmp, __s);
  96.343 ++      const size_t __len = std::strlen(__s) + 1;
  96.344 ++      char* __tmp = new char[__len];
  96.345 ++      std::memcpy(__tmp, __s, __len);
  96.346 +       _M_name_timepunct = __tmp;
  96.347 +-      _M_initialize_timepunct(__cloc); 
  96.348 ++
  96.349 ++      try
  96.350 ++	{ _M_initialize_timepunct(__cloc); }
  96.351 ++      catch(...)
  96.352 ++	{
  96.353 ++	  delete [] _M_name_timepunct;
  96.354 ++	  __throw_exception_again;
  96.355 ++	}
  96.356 +     }
  96.357 + 
  96.358 +   template<typename _CharT>
    97.1 --- a/patches/gcc/4.3.0/750-301-missing-execinfo_h.patch	Mon Jul 28 20:17:48 2008 +0000
    97.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    97.3 @@ -1,13 +0,0 @@
    97.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_301-missing-execinfo_h.patch
    97.5 -diff -durN gcc-4.3.0.orig/boehm-gc/include/gc.h gcc-4.3.0/boehm-gc/include/gc.h
    97.6 ---- gcc-4.3.0.orig/boehm-gc/include/gc.h	2007-04-23 23:10:09.000000000 +0200
    97.7 -+++ gcc-4.3.0/boehm-gc/include/gc.h	2008-06-10 14:45:50.000000000 +0200
    97.8 -@@ -503,7 +503,7 @@
    97.9 - #if defined(__linux__) || defined(__GLIBC__)
   97.10 - # include <features.h>
   97.11 - # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
   97.12 --     && !defined(__ia64__)
   97.13 -+     && !defined(__ia64__) && !defined(__UCLIBC__)
   97.14 - #   ifndef GC_HAVE_BUILTIN_BACKTRACE
   97.15 - #     define GC_HAVE_BUILTIN_BACKTRACE
   97.16 - #   endif
    98.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    98.2 +++ b/patches/gcc/4.3.0/750-missing-execinfo_h.patch	Mon Jul 28 21:08:01 2008 +0000
    98.3 @@ -0,0 +1,13 @@
    98.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_301-missing-execinfo_h.patch
    98.5 +diff -durN gcc-4.3.0.orig/boehm-gc/include/gc.h gcc-4.3.0/boehm-gc/include/gc.h
    98.6 +--- gcc-4.3.0.orig/boehm-gc/include/gc.h	2007-04-23 23:10:09.000000000 +0200
    98.7 ++++ gcc-4.3.0/boehm-gc/include/gc.h	2008-06-10 14:45:50.000000000 +0200
    98.8 +@@ -503,7 +503,7 @@
    98.9 + #if defined(__linux__) || defined(__GLIBC__)
   98.10 + # include <features.h>
   98.11 + # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
   98.12 +-     && !defined(__ia64__)
   98.13 ++     && !defined(__ia64__) && !defined(__UCLIBC__)
   98.14 + #   ifndef GC_HAVE_BUILTIN_BACKTRACE
   98.15 + #     define GC_HAVE_BUILTIN_BACKTRACE
   98.16 + #   endif
    99.1 --- a/patches/gcc/4.3.0/775-303-c99-complex-ugly-hack.patch	Mon Jul 28 20:17:48 2008 +0000
    99.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    99.3 @@ -1,14 +0,0 @@
    99.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_303-c99-complex-ugly-hack.patch
    99.5 -diff -durN gcc-4.3.0.orig/libstdc++-v3/configure gcc-4.3.0/libstdc++-v3/configure
    99.6 ---- gcc-4.3.0.orig/libstdc++-v3/configure	2008-06-10 14:45:39.000000000 +0200
    99.7 -+++ gcc-4.3.0/libstdc++-v3/configure	2008-06-10 14:45:54.000000000 +0200
    99.8 -@@ -39006,6 +39006,9 @@
    99.9 - cat >>conftest.$ac_ext <<_ACEOF
   99.10 - /* end confdefs.h.  */
   99.11 - #include <complex.h>
   99.12 -+#ifdef __UCLIBC__
   99.13 -+#error ugly hack to make sure configure test fails here for cross until uClibc supports the complex funcs
   99.14 -+#endif
   99.15 - int
   99.16 - main ()
   99.17 - {
   100.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   100.2 +++ b/patches/gcc/4.3.0/775-c99-complex-ugly-hack.patch	Mon Jul 28 21:08:01 2008 +0000
   100.3 @@ -0,0 +1,14 @@
   100.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_303-c99-complex-ugly-hack.patch
   100.5 +diff -durN gcc-4.3.0.orig/libstdc++-v3/configure gcc-4.3.0/libstdc++-v3/configure
   100.6 +--- gcc-4.3.0.orig/libstdc++-v3/configure	2008-06-10 14:45:39.000000000 +0200
   100.7 ++++ gcc-4.3.0/libstdc++-v3/configure	2008-06-10 14:45:54.000000000 +0200
   100.8 +@@ -39006,6 +39006,9 @@
   100.9 + cat >>conftest.$ac_ext <<_ACEOF
  100.10 + /* end confdefs.h.  */
  100.11 + #include <complex.h>
  100.12 ++#ifdef __UCLIBC__
  100.13 ++#error ugly hack to make sure configure test fails here for cross until uClibc supports the complex funcs
  100.14 ++#endif
  100.15 + int
  100.16 + main ()
  100.17 + {
   101.1 --- a/patches/gcc/4.3.0/800-304-index_macro.patch	Mon Jul 28 20:17:48 2008 +0000
   101.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   101.3 @@ -1,27 +0,0 @@
   101.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_304-index_macro.patch
   101.5 -diff -durN gcc-4.3.0.orig/libstdc++-v3/include/ext/rope gcc-4.3.0/libstdc++-v3/include/ext/rope
   101.6 ---- gcc-4.3.0.orig/libstdc++-v3/include/ext/rope	2008-01-31 19:44:55.000000000 +0100
   101.7 -+++ gcc-4.3.0/libstdc++-v3/include/ext/rope	2008-06-10 14:45:58.000000000 +0200
   101.8 -@@ -59,6 +59,9 @@
   101.9 - #include <bits/gthr.h>
  101.10 - #include <tr1/functional>
  101.11 - 
  101.12 -+/* cope w/ index defined as macro, SuSv3 proposal */
  101.13 -+#undef index
  101.14 -+
  101.15 - # ifdef __GC
  101.16 - #   define __GC_CONST const
  101.17 - # else
  101.18 -diff -durN gcc-4.3.0.orig/libstdc++-v3/include/ext/ropeimpl.h gcc-4.3.0/libstdc++-v3/include/ext/ropeimpl.h
  101.19 ---- gcc-4.3.0.orig/libstdc++-v3/include/ext/ropeimpl.h	2007-05-04 17:06:46.000000000 +0200
  101.20 -+++ gcc-4.3.0/libstdc++-v3/include/ext/ropeimpl.h	2008-06-10 14:45:58.000000000 +0200
  101.21 -@@ -54,6 +54,9 @@
  101.22 - #include <ext/memory> // For uninitialized_copy_n
  101.23 - #include <ext/numeric> // For power
  101.24 - 
  101.25 -+/* cope w/ index defined as macro, SuSv3 proposal */
  101.26 -+#undef index
  101.27 -+
  101.28 - _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
  101.29 - 
  101.30 -   using std::size_t;
   102.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   102.2 +++ b/patches/gcc/4.3.0/800-index_macro.patch	Mon Jul 28 21:08:01 2008 +0000
   102.3 @@ -0,0 +1,27 @@
   102.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_304-index_macro.patch
   102.5 +diff -durN gcc-4.3.0.orig/libstdc++-v3/include/ext/rope gcc-4.3.0/libstdc++-v3/include/ext/rope
   102.6 +--- gcc-4.3.0.orig/libstdc++-v3/include/ext/rope	2008-01-31 19:44:55.000000000 +0100
   102.7 ++++ gcc-4.3.0/libstdc++-v3/include/ext/rope	2008-06-10 14:45:58.000000000 +0200
   102.8 +@@ -59,6 +59,9 @@
   102.9 + #include <bits/gthr.h>
  102.10 + #include <tr1/functional>
  102.11 + 
  102.12 ++/* cope w/ index defined as macro, SuSv3 proposal */
  102.13 ++#undef index
  102.14 ++
  102.15 + # ifdef __GC
  102.16 + #   define __GC_CONST const
  102.17 + # else
  102.18 +diff -durN gcc-4.3.0.orig/libstdc++-v3/include/ext/ropeimpl.h gcc-4.3.0/libstdc++-v3/include/ext/ropeimpl.h
  102.19 +--- gcc-4.3.0.orig/libstdc++-v3/include/ext/ropeimpl.h	2007-05-04 17:06:46.000000000 +0200
  102.20 ++++ gcc-4.3.0/libstdc++-v3/include/ext/ropeimpl.h	2008-06-10 14:45:58.000000000 +0200
  102.21 +@@ -54,6 +54,9 @@
  102.22 + #include <ext/memory> // For uninitialized_copy_n
  102.23 + #include <ext/numeric> // For power
  102.24 + 
  102.25 ++/* cope w/ index defined as macro, SuSv3 proposal */
  102.26 ++#undef index
  102.27 ++
  102.28 + _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
  102.29 + 
  102.30 +   using std::size_t;
   103.1 --- a/patches/gcc/4.3.0/825-305-libmudflap-susv3-legacy.patch	Mon Jul 28 20:17:48 2008 +0000
   103.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   103.3 @@ -1,49 +0,0 @@
   103.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_305-libmudflap-susv3-legacy.patch
   103.5 -diff -durN gcc-4.3.0.orig/libmudflap/mf-hooks2.c gcc-4.3.0/libmudflap/mf-hooks2.c
   103.6 ---- gcc-4.3.0.orig/libmudflap/mf-hooks2.c	2005-09-23 23:58:39.000000000 +0200
   103.7 -+++ gcc-4.3.0/libmudflap/mf-hooks2.c	2008-06-10 14:46:02.000000000 +0200
   103.8 -@@ -427,7 +427,7 @@
   103.9 - {
  103.10 -   TRACE ("%s\n", __PRETTY_FUNCTION__);
  103.11 -   MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region");
  103.12 --  bzero (s, n);
  103.13 -+  memset (s, 0, n);
  103.14 - }
  103.15 - 
  103.16 - 
  103.17 -@@ -437,7 +437,7 @@
  103.18 -   TRACE ("%s\n", __PRETTY_FUNCTION__);
  103.19 -   MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src");
  103.20 -   MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest");
  103.21 --  bcopy (src, dest, n);
  103.22 -+  memmove (dest, src, n);
  103.23 - }
  103.24 - 
  103.25 - 
  103.26 -@@ -447,7 +447,7 @@
  103.27 -   TRACE ("%s\n", __PRETTY_FUNCTION__);
  103.28 -   MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg");
  103.29 -   MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg");
  103.30 --  return bcmp (s1, s2, n);
  103.31 -+  return memcmp (s1, s2, n);
  103.32 - }
  103.33 - 
  103.34 - 
  103.35 -@@ -456,7 +456,7 @@
  103.36 -   size_t n = strlen (s);
  103.37 -   TRACE ("%s\n", __PRETTY_FUNCTION__);
  103.38 -   MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region");
  103.39 --  return index (s, c);
  103.40 -+  return strchr (s, c);
  103.41 - }
  103.42 - 
  103.43 - 
  103.44 -@@ -465,7 +465,7 @@
  103.45 -   size_t n = strlen (s);
  103.46 -   TRACE ("%s\n", __PRETTY_FUNCTION__);
  103.47 -   MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region");
  103.48 --  return rindex (s, c);
  103.49 -+  return strrchr (s, c);
  103.50 - }
  103.51 - 
  103.52 - /* XXX:  stpcpy, memccpy */
   104.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   104.2 +++ b/patches/gcc/4.3.0/825-libmudflap-susv3-legacy.patch	Mon Jul 28 21:08:01 2008 +0000
   104.3 @@ -0,0 +1,49 @@
   104.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_305-libmudflap-susv3-legacy.patch
   104.5 +diff -durN gcc-4.3.0.orig/libmudflap/mf-hooks2.c gcc-4.3.0/libmudflap/mf-hooks2.c
   104.6 +--- gcc-4.3.0.orig/libmudflap/mf-hooks2.c	2005-09-23 23:58:39.000000000 +0200
   104.7 ++++ gcc-4.3.0/libmudflap/mf-hooks2.c	2008-06-10 14:46:02.000000000 +0200
   104.8 +@@ -427,7 +427,7 @@
   104.9 + {
  104.10 +   TRACE ("%s\n", __PRETTY_FUNCTION__);
  104.11 +   MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region");
  104.12 +-  bzero (s, n);
  104.13 ++  memset (s, 0, n);
  104.14 + }
  104.15 + 
  104.16 + 
  104.17 +@@ -437,7 +437,7 @@
  104.18 +   TRACE ("%s\n", __PRETTY_FUNCTION__);
  104.19 +   MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src");
  104.20 +   MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest");
  104.21 +-  bcopy (src, dest, n);
  104.22 ++  memmove (dest, src, n);
  104.23 + }
  104.24 + 
  104.25 + 
  104.26 +@@ -447,7 +447,7 @@
  104.27 +   TRACE ("%s\n", __PRETTY_FUNCTION__);
  104.28 +   MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg");
  104.29 +   MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg");
  104.30 +-  return bcmp (s1, s2, n);
  104.31 ++  return memcmp (s1, s2, n);
  104.32 + }
  104.33 + 
  104.34 + 
  104.35 +@@ -456,7 +456,7 @@
  104.36 +   size_t n = strlen (s);
  104.37 +   TRACE ("%s\n", __PRETTY_FUNCTION__);
  104.38 +   MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region");
  104.39 +-  return index (s, c);
  104.40 ++  return strchr (s, c);
  104.41 + }
  104.42 + 
  104.43 + 
  104.44 +@@ -465,7 +465,7 @@
  104.45 +   size_t n = strlen (s);
  104.46 +   TRACE ("%s\n", __PRETTY_FUNCTION__);
  104.47 +   MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region");
  104.48 +-  return rindex (s, c);
  104.49 ++  return strrchr (s, c);
  104.50 + }
  104.51 + 
  104.52 + /* XXX:  stpcpy, memccpy */
   105.1 --- a/patches/gcc/4.3.0/850-306-libstdc++-namespace.patch	Mon Jul 28 20:17:48 2008 +0000
   105.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   105.3 @@ -1,38 +0,0 @@
   105.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_306-libstdc++-namespace.patch
   105.5 -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
   105.6 -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
   105.7 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:45:50.000000000 +0200
   105.8 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:46:05.000000000 +0200
   105.9 -@@ -32,7 +32,8 @@
  105.10 - //
  105.11 - 
  105.12 - // Written by Benjamin Kosnik <bkoz@redhat.com>
  105.13 --
  105.14 -+namespace std
  105.15 -+{
  105.16 - #ifdef __UCLIBC_MJN3_ONLY__
  105.17 - #warning fix prototypes for *textdomain funcs
  105.18 - #endif
  105.19 -@@ -115,3 +116,4 @@
  105.20 - 	   this->_S_create_c_locale(this->_M_c_locale_messages, __s); 
  105.21 - 	 }
  105.22 -      }
  105.23 -+}
  105.24 -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
  105.25 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.h	2008-06-10 14:45:50.000000000 +0200
  105.26 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.h	2008-06-10 14:46:05.000000000 +0200
  105.27 -@@ -33,7 +33,8 @@
  105.28 - //
  105.29 - 
  105.30 - // Written by Benjamin Kosnik <bkoz@redhat.com>
  105.31 --
  105.32 -+namespace std
  105.33 -+{
  105.34 -   template<typename _CharT>
  105.35 -     __timepunct<_CharT>::__timepunct(size_t __refs) 
  105.36 -     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
  105.37 -@@ -74,3 +75,4 @@
  105.38 -       delete _M_data; 
  105.39 -       _S_destroy_c_locale(_M_c_locale_timepunct); 
  105.40 -     }
  105.41 -+}
   106.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   106.2 +++ b/patches/gcc/4.3.0/850-libstdc++-namespace.patch	Mon Jul 28 21:08:01 2008 +0000
   106.3 @@ -0,0 +1,38 @@
   106.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_306-libstdc++-namespace.patch
   106.5 +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
   106.6 +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
   106.7 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:45:50.000000000 +0200
   106.8 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:46:05.000000000 +0200
   106.9 +@@ -32,7 +32,8 @@
  106.10 + //
  106.11 + 
  106.12 + // Written by Benjamin Kosnik <bkoz@redhat.com>
  106.13 +-
  106.14 ++namespace std
  106.15 ++{
  106.16 + #ifdef __UCLIBC_MJN3_ONLY__
  106.17 + #warning fix prototypes for *textdomain funcs
  106.18 + #endif
  106.19 +@@ -115,3 +116,4 @@
  106.20 + 	   this->_S_create_c_locale(this->_M_c_locale_messages, __s); 
  106.21 + 	 }
  106.22 +      }
  106.23 ++}
  106.24 +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
  106.25 +--- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.h	2008-06-10 14:45:50.000000000 +0200
  106.26 ++++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.h	2008-06-10 14:46:05.000000000 +0200
  106.27 +@@ -33,7 +33,8 @@
  106.28 + //
  106.29 + 
  106.30 + // Written by Benjamin Kosnik <bkoz@redhat.com>
  106.31 +-
  106.32 ++namespace std
  106.33 ++{
  106.34 +   template<typename _CharT>
  106.35 +     __timepunct<_CharT>::__timepunct(size_t __refs) 
  106.36 +     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
  106.37 +@@ -74,3 +75,4 @@
  106.38 +       delete _M_data; 
  106.39 +       _S_destroy_c_locale(_M_c_locale_timepunct); 
  106.40 +     }
  106.41 ++}
   107.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   107.2 +++ b/patches/gcc/4.3.0/940-alpha-signal_h.patch	Mon Jul 28 21:08:01 2008 +0000
   107.3 @@ -0,0 +1,17 @@
   107.4 +--- gcc-4.2.1-stock/gcc/config/alpha/linux-unwind.h	2005-06-24 20:22:41.000000000 -0500
   107.5 ++++ gcc-4.2.1/gcc/config/alpha/linux-unwind.h	2007-09-01 20:21:34.000000000 -0500
   107.6 +@@ -29,6 +29,9 @@ Boston, MA 02110-1301, USA.  */
   107.7 + /* Do code reading to identify a signal frame, and set the frame
   107.8 +    state data appropriately.  See unwind-dw2.c for the structs.  */
   107.9 + 
  107.10 ++/* Don't use this if inhibit_libc is set
  107.11 ++   The build for this target will fail trying to include missing headers */
  107.12 ++#ifndef inhibit_libc
  107.13 + #include <signal.h>
  107.14 + #include <sys/ucontext.h>
  107.15 + 
  107.16 +@@ -80,3 +83,4 @@ alpha_fallback_frame_state (struct _Unwi
  107.17 +   fs->retaddr_column = 64;
  107.18 +   return _URC_NO_REASON;
  107.19 + }
  107.20 ++#endif /* inhibit_libc */
   108.1 --- a/patches/gcc/4.3.0/940-gcc-alpha-signal_h.patch	Mon Jul 28 20:17:48 2008 +0000
   108.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   108.3 @@ -1,17 +0,0 @@
   108.4 ---- gcc-4.2.1-stock/gcc/config/alpha/linux-unwind.h	2005-06-24 20:22:41.000000000 -0500
   108.5 -+++ gcc-4.2.1/gcc/config/alpha/linux-unwind.h	2007-09-01 20:21:34.000000000 -0500
   108.6 -@@ -29,6 +29,9 @@ Boston, MA 02110-1301, USA.  */
   108.7 - /* Do code reading to identify a signal frame, and set the frame
   108.8 -    state data appropriately.  See unwind-dw2.c for the structs.  */
   108.9 - 
  108.10 -+/* Don't use this if inhibit_libc is set
  108.11 -+   The build for this target will fail trying to include missing headers */
  108.12 -+#ifndef inhibit_libc
  108.13 - #include <signal.h>
  108.14 - #include <sys/ucontext.h>
  108.15 - 
  108.16 -@@ -80,3 +83,4 @@ alpha_fallback_frame_state (struct _Unwi
  108.17 -   fs->retaddr_column = 64;
  108.18 -   return _URC_NO_REASON;
  108.19 - }
  108.20 -+#endif /* inhibit_libc */
   109.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   109.2 +++ b/patches/gcc/4.3.1/100-alpha-mieee-default.patch	Mon Jul 28 21:08:01 2008 +0000
   109.3 @@ -0,0 +1,34 @@
   109.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/00_all_gcc-4.1-alpha-mieee-default.patch
   109.5 +Set the default behavior on alpha to use -mieee since the large majority of
   109.6 +time we want this (bad/weird things can happen with packages built without
   109.7 +-mieee).
   109.8 +
   109.9 +To satisfy those people who may not want -mieee forced on them all the time,
  109.10 +we also provide -mno-ieee.
  109.11 +
  109.12 +Patch by Mike Frysinger <vapier@gentoo.org>
  109.13 +
  109.14 +diff -durN gcc-4.3.1.orig/gcc/config/alpha/alpha.h gcc-4.3.1/gcc/config/alpha/alpha.h
  109.15 +--- gcc-4.3.1.orig/gcc/config/alpha/alpha.h	2007-12-06 14:25:37.000000000 +0100
  109.16 ++++ gcc-4.3.1/gcc/config/alpha/alpha.h	2008-06-10 14:56:36.000000000 +0200
  109.17 +@@ -95,6 +95,8 @@
  109.18 +   while (0)
  109.19 + #endif
  109.20 + 
  109.21 ++#define CPP_SPEC "%{!no-ieee:-mieee}"
  109.22 ++
  109.23 + #define WORD_SWITCH_TAKES_ARG(STR)		\
  109.24 +  (!strcmp (STR, "rpath") || DEFAULT_WORD_SWITCH_TAKES_ARG(STR))
  109.25 + 
  109.26 +diff -durN gcc-4.3.1.orig/gcc/config/alpha/alpha.opt gcc-4.3.1/gcc/config/alpha/alpha.opt
  109.27 +--- gcc-4.3.1.orig/gcc/config/alpha/alpha.opt	2007-08-02 12:49:31.000000000 +0200
  109.28 ++++ gcc-4.3.1/gcc/config/alpha/alpha.opt	2008-06-10 14:56:36.000000000 +0200
  109.29 +@@ -39,7 +39,7 @@
  109.30 + Request IEEE-conformant math library routines (OSF/1)
  109.31 + 
  109.32 + mieee
  109.33 +-Target Report RejectNegative Mask(IEEE)
  109.34 ++Target Report Mask(IEEE)
  109.35 + Emit IEEE-conformant code, without inexact exceptions
  109.36 + 
  109.37 + mieee-with-inexact
   110.1 --- a/patches/gcc/4.3.1/100-gcc-4.1-alpha-mieee-default.patch	Mon Jul 28 20:17:48 2008 +0000
   110.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   110.3 @@ -1,34 +0,0 @@
   110.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/00_all_gcc-4.1-alpha-mieee-default.patch
   110.5 -Set the default behavior on alpha to use -mieee since the large majority of
   110.6 -time we want this (bad/weird things can happen with packages built without
   110.7 --mieee).
   110.8 -
   110.9 -To satisfy those people who may not want -mieee forced on them all the time,
  110.10 -we also provide -mno-ieee.
  110.11 -
  110.12 -Patch by Mike Frysinger <vapier@gentoo.org>
  110.13 -
  110.14 -diff -durN gcc-4.3.1.orig/gcc/config/alpha/alpha.h gcc-4.3.1/gcc/config/alpha/alpha.h
  110.15 ---- gcc-4.3.1.orig/gcc/config/alpha/alpha.h	2007-12-06 14:25:37.000000000 +0100
  110.16 -+++ gcc-4.3.1/gcc/config/alpha/alpha.h	2008-06-10 14:56:36.000000000 +0200
  110.17 -@@ -95,6 +95,8 @@
  110.18 -   while (0)
  110.19 - #endif
  110.20 - 
  110.21 -+#define CPP_SPEC "%{!no-ieee:-mieee}"
  110.22 -+
  110.23 - #define WORD_SWITCH_TAKES_ARG(STR)		\
  110.24 -  (!strcmp (STR, "rpath") || DEFAULT_WORD_SWITCH_TAKES_ARG(STR))
  110.25 - 
  110.26 -diff -durN gcc-4.3.1.orig/gcc/config/alpha/alpha.opt gcc-4.3.1/gcc/config/alpha/alpha.opt
  110.27 ---- gcc-4.3.1.orig/gcc/config/alpha/alpha.opt	2007-08-02 12:49:31.000000000 +0200
  110.28 -+++ gcc-4.3.1/gcc/config/alpha/alpha.opt	2008-06-10 14:56:36.000000000 +0200
  110.29 -@@ -39,7 +39,7 @@
  110.30 - Request IEEE-conformant math library routines (OSF/1)
  110.31 - 
  110.32 - mieee
  110.33 --Target Report RejectNegative Mask(IEEE)
  110.34 -+Target Report Mask(IEEE)
  110.35 - Emit IEEE-conformant code, without inexact exceptions
  110.36 - 
  110.37 - mieee-with-inexact
   111.1 --- a/patches/gcc/4.3.1/125-gcc-trampolinewarn.patch	Mon Jul 28 20:17:48 2008 +0000
   111.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   111.3 @@ -1,35 +0,0 @@
   111.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/00_all_gcc-trampolinewarn.patch
   111.5 -	This trivial patch causes gcc to emit a warning whenever
   111.6 -	it generates a trampoline.  These are otherwise hard to
   111.7 -	locate.  It is rigged to default ON - to have it default
   111.8 -	to OFF remove the text 'Init(1)' from the common.opt
   111.9 -	patch, leaving just 'Common Var(warn_trampolines)'.
  111.10 -	Kevin F. Quinn <kevquinn@gentoo.org> 17 Jan 2006
  111.11 -
  111.12 -diff -durN gcc-4.3.1.orig/gcc/builtins.c gcc-4.3.1/gcc/builtins.c
  111.13 ---- gcc-4.3.1.orig/gcc/builtins.c	2008-04-23 00:36:27.000000000 +0200
  111.14 -+++ gcc-4.3.1/gcc/builtins.c	2008-06-10 14:56:54.000000000 +0200
  111.15 -@@ -5662,6 +5662,9 @@
  111.16 -   trampolines_created = 1;
  111.17 -   INITIALIZE_TRAMPOLINE (r_tramp, r_func, r_chain);
  111.18 - 
  111.19 -+  if (warn_trampolines)
  111.20 -+    warning (OPT_Wtrampolines, "generating trampoline in object (requires executable stack)");
  111.21 -+
  111.22 -   return const0_rtx;
  111.23 - }
  111.24 - 
  111.25 -diff -durN gcc-4.3.1.orig/gcc/common.opt gcc-4.3.1/gcc/common.opt
  111.26 ---- gcc-4.3.1.orig/gcc/common.opt	2008-01-22 15:11:44.000000000 +0100
  111.27 -+++ gcc-4.3.1/gcc/common.opt	2008-06-10 14:56:54.000000000 +0200
  111.28 -@@ -182,6 +182,10 @@
  111.29 - Common Var(warn_system_headers) Warning
  111.30 - Do not suppress warnings from system headers
  111.31 - 
  111.32 -+Wtrampolines
  111.33 -+Common Var(warn_trampolines) Init(1)
  111.34 -+Warn whenever a trampoline is generated
  111.35 -+
  111.36 - Wuninitialized
  111.37 - Common Var(warn_uninitialized) Warning
  111.38 - Warn about uninitialized automatic variables
   112.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   112.2 +++ b/patches/gcc/4.3.1/125-trampolinewarn.patch	Mon Jul 28 21:08:01 2008 +0000
   112.3 @@ -0,0 +1,35 @@
   112.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/00_all_gcc-trampolinewarn.patch
   112.5 +	This trivial patch causes gcc to emit a warning whenever
   112.6 +	it generates a trampoline.  These are otherwise hard to
   112.7 +	locate.  It is rigged to default ON - to have it default
   112.8 +	to OFF remove the text 'Init(1)' from the common.opt
   112.9 +	patch, leaving just 'Common Var(warn_trampolines)'.
  112.10 +	Kevin F. Quinn <kevquinn@gentoo.org> 17 Jan 2006
  112.11 +
  112.12 +diff -durN gcc-4.3.1.orig/gcc/builtins.c gcc-4.3.1/gcc/builtins.c
  112.13 +--- gcc-4.3.1.orig/gcc/builtins.c	2008-04-23 00:36:27.000000000 +0200
  112.14 ++++ gcc-4.3.1/gcc/builtins.c	2008-06-10 14:56:54.000000000 +0200
  112.15 +@@ -5662,6 +5662,9 @@
  112.16 +   trampolines_created = 1;
  112.17 +   INITIALIZE_TRAMPOLINE (r_tramp, r_func, r_chain);
  112.18 + 
  112.19 ++  if (warn_trampolines)
  112.20 ++    warning (OPT_Wtrampolines, "generating trampoline in object (requires executable stack)");
  112.21 ++
  112.22 +   return const0_rtx;
  112.23 + }
  112.24 + 
  112.25 +diff -durN gcc-4.3.1.orig/gcc/common.opt gcc-4.3.1/gcc/common.opt
  112.26 +--- gcc-4.3.1.orig/gcc/common.opt	2008-01-22 15:11:44.000000000 +0100
  112.27 ++++ gcc-4.3.1/gcc/common.opt	2008-06-10 14:56:54.000000000 +0200
  112.28 +@@ -182,6 +182,10 @@
  112.29 + Common Var(warn_system_headers) Warning
  112.30 + Do not suppress warnings from system headers
  112.31 + 
  112.32 ++Wtrampolines
  112.33 ++Common Var(warn_trampolines) Init(1)
  112.34 ++Warn whenever a trampoline is generated
  112.35 ++
  112.36 + Wuninitialized
  112.37 + Common Var(warn_uninitialized) Warning
  112.38 + Warn about uninitialized automatic variables
   113.1 --- a/patches/gcc/4.3.1/150-gcc43-java-nomulti.patch	Mon Jul 28 20:17:48 2008 +0000
   113.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   113.3 @@ -1,47 +0,0 @@
   113.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/03_all_gcc43-java-nomulti.patch
   113.5 -diff -durN gcc-4.3.1.orig/libjava/configure gcc-4.3.1/libjava/configure
   113.6 ---- gcc-4.3.1.orig/libjava/configure	2008-06-06 16:49:11.000000000 +0200
   113.7 -+++ gcc-4.3.1/libjava/configure	2008-06-10 14:57:38.000000000 +0200
   113.8 -@@ -1018,6 +1018,8 @@
   113.9 -   --enable-gconf-peer     compile GConf native peers for util.preferences
  113.10 -   --enable-java-maintainer-mode
  113.11 -                           allow rebuilding of .class and .h files
  113.12 -+  --enable-libjava-multilib
  113.13 -+                          build libjava as multilib
  113.14 -   --disable-dependency-tracking  speeds up one-time build
  113.15 -   --enable-dependency-tracking   do not reject slow dependency extractors
  113.16 -   --enable-maintainer-mode  enable make rules and dependencies not useful
  113.17 -@@ -1850,6 +1852,16 @@
  113.18 - fi
  113.19 - 
  113.20 - 
  113.21 -+# Check whether --enable-libjava-multilib was given.
  113.22 -+if test "${enable_libjava_multilib+set}" = set; then
  113.23 -+  enableval=$enable_libjava_multilib;
  113.24 -+fi
  113.25 -+
  113.26 -+if test "$enable_libjava_multilib" = no; then
  113.27 -+  multilib=no
  113.28 -+  ac_configure_args="$ac_configure_args --disable-multilib"
  113.29 -+fi
  113.30 -+
  113.31 - # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX.
  113.32 - 
  113.33 - 
  113.34 -diff -durN gcc-4.3.1.orig/libjava/configure.ac gcc-4.3.1/libjava/configure.ac
  113.35 ---- gcc-4.3.1.orig/libjava/configure.ac	2007-12-22 16:48:46.000000000 +0100
  113.36 -+++ gcc-4.3.1/libjava/configure.ac	2008-06-10 14:57:38.000000000 +0200
  113.37 -@@ -82,6 +82,13 @@
  113.38 - 	[allow rebuilding of .class and .h files]))
  113.39 - AM_CONDITIONAL(JAVA_MAINTAINER_MODE, test "$enable_java_maintainer_mode" = yes)
  113.40 - 
  113.41 -+AC_ARG_ENABLE(libjava-multilib,
  113.42 -+	AS_HELP_STRING([--enable-libjava-multilib], [build libjava as multilib]))
  113.43 -+if test "$enable_libjava_multilib" = no; then
  113.44 -+  multilib=no
  113.45 -+  ac_configure_args="$ac_configure_args --disable-multilib"
  113.46 -+fi
  113.47 -+
  113.48 - # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX.
  113.49 - GCC_NO_EXECUTABLES
  113.50 - 
   114.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   114.2 +++ b/patches/gcc/4.3.1/150-java-nomulti.patch	Mon Jul 28 21:08:01 2008 +0000
   114.3 @@ -0,0 +1,47 @@
   114.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/03_all_gcc43-java-nomulti.patch
   114.5 +diff -durN gcc-4.3.1.orig/libjava/configure gcc-4.3.1/libjava/configure
   114.6 +--- gcc-4.3.1.orig/libjava/configure	2008-06-06 16:49:11.000000000 +0200
   114.7 ++++ gcc-4.3.1/libjava/configure	2008-06-10 14:57:38.000000000 +0200
   114.8 +@@ -1018,6 +1018,8 @@
   114.9 +   --enable-gconf-peer     compile GConf native peers for util.preferences
  114.10 +   --enable-java-maintainer-mode
  114.11 +                           allow rebuilding of .class and .h files
  114.12 ++  --enable-libjava-multilib
  114.13 ++                          build libjava as multilib
  114.14 +   --disable-dependency-tracking  speeds up one-time build
  114.15 +   --enable-dependency-tracking   do not reject slow dependency extractors
  114.16 +   --enable-maintainer-mode  enable make rules and dependencies not useful
  114.17 +@@ -1850,6 +1852,16 @@
  114.18 + fi
  114.19 + 
  114.20 + 
  114.21 ++# Check whether --enable-libjava-multilib was given.
  114.22 ++if test "${enable_libjava_multilib+set}" = set; then
  114.23 ++  enableval=$enable_libjava_multilib;
  114.24 ++fi
  114.25 ++
  114.26 ++if test "$enable_libjava_multilib" = no; then
  114.27 ++  multilib=no
  114.28 ++  ac_configure_args="$ac_configure_args --disable-multilib"
  114.29 ++fi
  114.30 ++
  114.31 + # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX.
  114.32 + 
  114.33 + 
  114.34 +diff -durN gcc-4.3.1.orig/libjava/configure.ac gcc-4.3.1/libjava/configure.ac
  114.35 +--- gcc-4.3.1.orig/libjava/configure.ac	2007-12-22 16:48:46.000000000 +0100
  114.36 ++++ gcc-4.3.1/libjava/configure.ac	2008-06-10 14:57:38.000000000 +0200
  114.37 +@@ -82,6 +82,13 @@
  114.38 + 	[allow rebuilding of .class and .h files]))
  114.39 + AM_CONDITIONAL(JAVA_MAINTAINER_MODE, test "$enable_java_maintainer_mode" = yes)
  114.40 + 
  114.41 ++AC_ARG_ENABLE(libjava-multilib,
  114.42 ++	AS_HELP_STRING([--enable-libjava-multilib], [build libjava as multilib]))
  114.43 ++if test "$enable_libjava_multilib" = no; then
  114.44 ++  multilib=no
  114.45 ++  ac_configure_args="$ac_configure_args --disable-multilib"
  114.46 ++fi
  114.47 ++
  114.48 + # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX.
  114.49 + GCC_NO_EXECUTABLES
  114.50 + 
   115.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   115.2 +++ b/patches/gcc/4.3.1/175-cross-compile.patch	Mon Jul 28 21:08:01 2008 +0000
   115.3 @@ -0,0 +1,44 @@
   115.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/08_all_gcc-4.1-cross-compile.patch
   115.5 +Some notes on the 'bootstrap with or without libc headers' debate:
   115.6 +http://linuxfromscratch.org/pipermail/lfs-dev/2005-July/052409.html
   115.7 +http://gcc.gnu.org/ml/gcc/2005-07/msg01195.html
   115.8 +
   115.9 +diff -durN gcc-4.3.1.orig/gcc/configure gcc-4.3.1/gcc/configure
  115.10 +--- gcc-4.3.1.orig/gcc/configure	2008-05-21 10:54:15.000000000 +0200
  115.11 ++++ gcc-4.3.1/gcc/configure	2008-06-10 14:57:42.000000000 +0200
  115.12 +@@ -13283,7 +13283,7 @@
  115.13 + 	    | powerpc*-*-*,powerpc64*-*-*)
  115.14 + 		CROSS="$CROSS -DNATIVE_CROSS" ;;
  115.15 + 	esac
  115.16 +-elif test "x$TARGET_SYSTEM_ROOT" != x; then
  115.17 ++elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then
  115.18 +         SYSTEM_HEADER_DIR=$build_system_header_dir
  115.19 + fi
  115.20 + 
  115.21 +diff -durN gcc-4.3.1.orig/gcc/configure.ac gcc-4.3.1/gcc/configure.ac
  115.22 +--- gcc-4.3.1.orig/gcc/configure.ac	2008-05-21 10:54:15.000000000 +0200
  115.23 ++++ gcc-4.3.1/gcc/configure.ac	2008-06-10 14:57:42.000000000 +0200
  115.24 +@@ -1749,7 +1749,7 @@
  115.25 + 	    | powerpc*-*-*,powerpc64*-*-*)
  115.26 + 		CROSS="$CROSS -DNATIVE_CROSS" ;;
  115.27 + 	esac
  115.28 +-elif test "x$TARGET_SYSTEM_ROOT" != x; then
  115.29 ++elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then
  115.30 +         SYSTEM_HEADER_DIR=$build_system_header_dir 
  115.31 + fi
  115.32 + 
  115.33 +diff -durN gcc-4.3.1.orig/gcc/unwind-dw2.c gcc-4.3.1/gcc/unwind-dw2.c
  115.34 +--- gcc-4.3.1.orig/gcc/unwind-dw2.c	2007-07-25 20:14:57.000000000 +0200
  115.35 ++++ gcc-4.3.1/gcc/unwind-dw2.c	2008-06-10 14:57:42.000000000 +0200
  115.36 +@@ -334,9 +334,11 @@
  115.37 + }
  115.38 + #endif
  115.39 + 
  115.40 ++#ifndef inhibit_libc
  115.41 + #ifdef MD_UNWIND_SUPPORT
  115.42 + #include MD_UNWIND_SUPPORT
  115.43 + #endif
  115.44 ++#endif
  115.45 + 
  115.46 + /* Extract any interesting information from the CIE for the translation
  115.47 +    unit F belongs to.  Return a pointer to the byte after the augmentation,
   116.1 --- a/patches/gcc/4.3.1/175-gcc-4.1-cross-compile.patch	Mon Jul 28 20:17:48 2008 +0000
   116.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   116.3 @@ -1,44 +0,0 @@
   116.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/08_all_gcc-4.1-cross-compile.patch
   116.5 -Some notes on the 'bootstrap with or without libc headers' debate:
   116.6 -http://linuxfromscratch.org/pipermail/lfs-dev/2005-July/052409.html
   116.7 -http://gcc.gnu.org/ml/gcc/2005-07/msg01195.html
   116.8 -
   116.9 -diff -durN gcc-4.3.1.orig/gcc/configure gcc-4.3.1/gcc/configure
  116.10 ---- gcc-4.3.1.orig/gcc/configure	2008-05-21 10:54:15.000000000 +0200
  116.11 -+++ gcc-4.3.1/gcc/configure	2008-06-10 14:57:42.000000000 +0200
  116.12 -@@ -13283,7 +13283,7 @@
  116.13 - 	    | powerpc*-*-*,powerpc64*-*-*)
  116.14 - 		CROSS="$CROSS -DNATIVE_CROSS" ;;
  116.15 - 	esac
  116.16 --elif test "x$TARGET_SYSTEM_ROOT" != x; then
  116.17 -+elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then
  116.18 -         SYSTEM_HEADER_DIR=$build_system_header_dir
  116.19 - fi
  116.20 - 
  116.21 -diff -durN gcc-4.3.1.orig/gcc/configure.ac gcc-4.3.1/gcc/configure.ac
  116.22 ---- gcc-4.3.1.orig/gcc/configure.ac	2008-05-21 10:54:15.000000000 +0200
  116.23 -+++ gcc-4.3.1/gcc/configure.ac	2008-06-10 14:57:42.000000000 +0200
  116.24 -@@ -1749,7 +1749,7 @@
  116.25 - 	    | powerpc*-*-*,powerpc64*-*-*)
  116.26 - 		CROSS="$CROSS -DNATIVE_CROSS" ;;
  116.27 - 	esac
  116.28 --elif test "x$TARGET_SYSTEM_ROOT" != x; then
  116.29 -+elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then
  116.30 -         SYSTEM_HEADER_DIR=$build_system_header_dir 
  116.31 - fi
  116.32 - 
  116.33 -diff -durN gcc-4.3.1.orig/gcc/unwind-dw2.c gcc-4.3.1/gcc/unwind-dw2.c
  116.34 ---- gcc-4.3.1.orig/gcc/unwind-dw2.c	2007-07-25 20:14:57.000000000 +0200
  116.35 -+++ gcc-4.3.1/gcc/unwind-dw2.c	2008-06-10 14:57:42.000000000 +0200
  116.36 -@@ -334,9 +334,11 @@
  116.37 - }
  116.38 - #endif
  116.39 - 
  116.40 -+#ifndef inhibit_libc
  116.41 - #ifdef MD_UNWIND_SUPPORT
  116.42 - #include MD_UNWIND_SUPPORT
  116.43 - #endif
  116.44 -+#endif
  116.45 - 
  116.46 - /* Extract any interesting information from the CIE for the translation
  116.47 -    unit F belongs to.  Return a pointer to the byte after the augmentation,
   117.1 --- a/patches/gcc/4.3.1/200-gcc-netbsd-symbolic.patch	Mon Jul 28 20:17:48 2008 +0000
   117.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   117.3 @@ -1,14 +0,0 @@
   117.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/11_all_gcc-netbsd-symbolic.patch
   117.5 -http://bugs.gentoo.org/122698
   117.6 -
   117.7 -diff -durN gcc-4.3.1.orig/gcc/config/netbsd-elf.h gcc-4.3.1/gcc/config/netbsd-elf.h
   117.8 ---- gcc-4.3.1.orig/gcc/config/netbsd-elf.h	2007-09-03 18:14:04.000000000 +0200
   117.9 -+++ gcc-4.3.1/gcc/config/netbsd-elf.h	2008-06-10 14:57:48.000000000 +0200
  117.10 -@@ -82,6 +82,7 @@
  117.11 - #define NETBSD_LINK_SPEC_ELF \
  117.12 -   "%{assert*} %{R*} %{rpath*} \
  117.13 -    %{shared:-shared} \
  117.14 -+   %{symbolic:-Bsymbolic} \
  117.15 -    %{!shared: \
  117.16 -      -dc -dp \
  117.17 -      %{!nostdlib: \
   118.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   118.2 +++ b/patches/gcc/4.3.1/200-netbsd-symbolic.patch	Mon Jul 28 21:08:01 2008 +0000
   118.3 @@ -0,0 +1,14 @@
   118.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/11_all_gcc-netbsd-symbolic.patch
   118.5 +http://bugs.gentoo.org/122698
   118.6 +
   118.7 +diff -durN gcc-4.3.1.orig/gcc/config/netbsd-elf.h gcc-4.3.1/gcc/config/netbsd-elf.h
   118.8 +--- gcc-4.3.1.orig/gcc/config/netbsd-elf.h	2007-09-03 18:14:04.000000000 +0200
   118.9 ++++ gcc-4.3.1/gcc/config/netbsd-elf.h	2008-06-10 14:57:48.000000000 +0200
  118.10 +@@ -82,6 +82,7 @@
  118.11 + #define NETBSD_LINK_SPEC_ELF \
  118.12 +   "%{assert*} %{R*} %{rpath*} \
  118.13 +    %{shared:-shared} \
  118.14 ++   %{symbolic:-Bsymbolic} \
  118.15 +    %{!shared: \
  118.16 +      -dc -dp \
  118.17 +      %{!nostdlib: \
   119.1 --- a/patches/gcc/4.3.1/225-gcc-sparc64-bsd.patch	Mon Jul 28 20:17:48 2008 +0000
   119.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   119.3 @@ -1,30 +0,0 @@
   119.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/14_all_gcc-sparc64-bsd.patch
   119.5 -diff -durN gcc-4.3.1.orig/gcc/config/sparc/freebsd.h gcc-4.3.1/gcc/config/sparc/freebsd.h
   119.6 ---- gcc-4.3.1.orig/gcc/config/sparc/freebsd.h	2007-08-02 12:49:31.000000000 +0200
   119.7 -+++ gcc-4.3.1/gcc/config/sparc/freebsd.h	2008-06-10 14:57:54.000000000 +0200
   119.8 -@@ -25,9 +25,22 @@
   119.9 - /* FreeBSD needs the platform name (sparc64) defined.
  119.10 -    Emacs needs to know if the arch is 64 or 32-bits.  */
  119.11 - 
  119.12 --#undef  CPP_CPU64_DEFAULT_SPEC
  119.13 --#define CPP_CPU64_DEFAULT_SPEC \
  119.14 --  "-D__sparc64__ -D__sparc_v9__ -D__sparcv9 -D__arch64__"
  119.15 -+#undef  FBSD_TARGET_CPU_CPP_BUILTINS
  119.16 -+#define FBSD_TARGET_CPU_CPP_BUILTINS()                  \
  119.17 -+  do                                                    \
  119.18 -+    {                                                   \
  119.19 -+      if (TARGET_ARCH64)                                \
  119.20 -+        {                                               \
  119.21 -+          builtin_define ("__sparc64__");               \
  119.22 -+          builtin_define ("__sparc_v9__");              \
  119.23 -+          builtin_define ("__sparcv9");                 \
  119.24 -+        }                                               \
  119.25 -+      else                                              \
  119.26 -+        builtin_define ("__sparc");                     \
  119.27 -+      builtin_define ("__sparc__");                     \
  119.28 -+    }                                                   \
  119.29 -+  while (0)
  119.30 -+
  119.31 - 
  119.32 - #define LINK_SPEC "%(link_arch)						\
  119.33 -   %{!mno-relax:%{!r:-relax}}						\
   120.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   120.2 +++ b/patches/gcc/4.3.1/225-sparc64-bsd.patch	Mon Jul 28 21:08:01 2008 +0000
   120.3 @@ -0,0 +1,30 @@
   120.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/14_all_gcc-sparc64-bsd.patch
   120.5 +diff -durN gcc-4.3.1.orig/gcc/config/sparc/freebsd.h gcc-4.3.1/gcc/config/sparc/freebsd.h
   120.6 +--- gcc-4.3.1.orig/gcc/config/sparc/freebsd.h	2007-08-02 12:49:31.000000000 +0200
   120.7 ++++ gcc-4.3.1/gcc/config/sparc/freebsd.h	2008-06-10 14:57:54.000000000 +0200
   120.8 +@@ -25,9 +25,22 @@
   120.9 + /* FreeBSD needs the platform name (sparc64) defined.
  120.10 +    Emacs needs to know if the arch is 64 or 32-bits.  */
  120.11 + 
  120.12 +-#undef  CPP_CPU64_DEFAULT_SPEC
  120.13 +-#define CPP_CPU64_DEFAULT_SPEC \
  120.14 +-  "-D__sparc64__ -D__sparc_v9__ -D__sparcv9 -D__arch64__"
  120.15 ++#undef  FBSD_TARGET_CPU_CPP_BUILTINS
  120.16 ++#define FBSD_TARGET_CPU_CPP_BUILTINS()                  \
  120.17 ++  do                                                    \
  120.18 ++    {                                                   \
  120.19 ++      if (TARGET_ARCH64)                                \
  120.20 ++        {                                               \
  120.21 ++          builtin_define ("__sparc64__");               \
  120.22 ++          builtin_define ("__sparc_v9__");              \
  120.23 ++          builtin_define ("__sparcv9");                 \
  120.24 ++        }                                               \
  120.25 ++      else                                              \
  120.26 ++        builtin_define ("__sparc");                     \
  120.27 ++      builtin_define ("__sparc__");                     \
  120.28 ++    }                                                   \
  120.29 ++  while (0)
  120.30 ++
  120.31 + 
  120.32 + #define LINK_SPEC "%(link_arch)						\
  120.33 +   %{!mno-relax:%{!r:-relax}}						\
   121.1 --- a/patches/gcc/4.3.1/250-904-flatten-switch-stmt-00.patch	Mon Jul 28 20:17:48 2008 +0000
   121.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   121.3 @@ -1,76 +0,0 @@
   121.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/18_all_904-flatten-switch-stmt-00.patch
   121.5 -http://gcc.gnu.org/ml/gcc-patches/2007-04/msg00927.html
   121.6 -
   121.7 -Hi,
   121.8 -
   121.9 -The attached patch makes sure that we create smaller object code for
  121.10 -simple switch statements. We just make sure to flatten the switch
  121.11 -statement into an if-else chain, basically.
  121.12 -
  121.13 -This fixes a size-regression as compared to gcc-3.4, as can be seen
  121.14 -below.
  121.15 -
  121.16 -2007-04-15  Bernhard Fischer  <..>
  121.17 -
  121.18 -	* stmt.c (expand_case): Do not create a complex binary tree when
  121.19 -	optimizing for size but rather use the simple ordered list.
  121.20 -	(emit_case_nodes): do not emit jumps to the default_label when
  121.21 -	optimizing for size.
  121.22 -
  121.23 -Not regtested so far.
  121.24 -Comments?
  121.25 -
  121.26 -Attached is the test switch.c mentioned below.
  121.27 -
  121.28 -$ 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
  121.29 -gcc-$i  -DCHAIN -Os -o switch-CHAIN-$i.o -c switch.c ;done
  121.30 -$ 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
  121.31 -gcc-$i  -UCHAIN -Os -o switch-$i.o -c switch.c ;done
  121.32 -
  121.33 -$ size switch-*.o
  121.34 -   text	   data	    bss	    dec	    hex	filename
  121.35 -    169	      0	      0	    169	     a9	switch-2.95.o
  121.36 -    115	      0	      0	    115	     73	switch-3.3.o
  121.37 -    103	      0	      0	    103	     67	switch-3.4.o
  121.38 -    124	      0	      0	    124	     7c	switch-4.0.o
  121.39 -    124	      0	      0	    124	     7c	switch-4.1.o
  121.40 -    124	      0	      0	    124	     7c	switch-4.2.orig-HEAD.o
  121.41 -     95	      0	      0	     95	     5f	switch-4.3-HEAD.o
  121.42 -    124	      0	      0	    124	     7c	switch-4.3.orig-HEAD.o
  121.43 -    166	      0	      0	    166	     a6	switch-CHAIN-2.95.o
  121.44 -    111	      0	      0	    111	     6f	switch-CHAIN-3.3.o
  121.45 -     95	      0	      0	     95	     5f	switch-CHAIN-3.4.o
  121.46 -     95	      0	      0	     95	     5f	switch-CHAIN-4.0.o
  121.47 -     95	      0	      0	     95	     5f	switch-CHAIN-4.1.o
  121.48 -     95	      0	      0	     95	     5f	switch-CHAIN-4.2.orig-HEAD.o
  121.49 -     95	      0	      0	     95	     5f	switch-CHAIN-4.3-HEAD.o
  121.50 -     95	      0	      0	     95	     5f	switch-CHAIN-4.3.orig-HEAD.o
  121.51 -
  121.52 -
  121.53 -Content-Type: text/x-diff; charset=us-ascii
  121.54 -Content-Disposition: attachment; filename="gcc-4.3.gcc-flatten-switch-stmt.00.diff"
  121.55 -
  121.56 -diff -durN gcc-4.3.1.orig/gcc/stmt.c gcc-4.3.1/gcc/stmt.c
  121.57 ---- gcc-4.3.1.orig/gcc/stmt.c	2008-05-09 20:12:13.000000000 +0200
  121.58 -+++ gcc-4.3.1/gcc/stmt.c	2008-06-10 14:57:58.000000000 +0200
  121.59 -@@ -2509,7 +2509,11 @@
  121.60 - 	  use_cost_table
  121.61 - 	    = (TREE_CODE (orig_type) != ENUMERAL_TYPE
  121.62 - 	       && estimate_case_costs (case_list));
  121.63 --	  balance_case_nodes (&case_list, NULL);
  121.64 -+	  /* When optimizing for size, we want a straight list to avoid
  121.65 -+	     jumps as much as possible. This basically creates an if-else
  121.66 -+	     chain.  */
  121.67 -+	  if (!optimize_size)
  121.68 -+	    balance_case_nodes (&case_list, NULL);
  121.69 - 	  emit_case_nodes (index, case_list, default_label, index_type);
  121.70 - 	  emit_jump (default_label);
  121.71 - 	}
  121.72 -@@ -3067,6 +3071,7 @@
  121.73 - 	    {
  121.74 - 	      if (!node_has_low_bound (node, index_type))
  121.75 - 		{
  121.76 -+		  if (!optimize_size) /* don't jl to the .default_label. */
  121.77 - 		  emit_cmp_and_jump_insns (index,
  121.78 - 					   convert_modes
  121.79 - 					   (mode, imode,
   122.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   122.2 +++ b/patches/gcc/4.3.1/250-flatten-switch-stmt-00.patch	Mon Jul 28 21:08:01 2008 +0000
   122.3 @@ -0,0 +1,76 @@
   122.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/18_all_904-flatten-switch-stmt-00.patch
   122.5 +http://gcc.gnu.org/ml/gcc-patches/2007-04/msg00927.html
   122.6 +
   122.7 +Hi,
   122.8 +
   122.9 +The attached patch makes sure that we create smaller object code for
  122.10 +simple switch statements. We just make sure to flatten the switch
  122.11 +statement into an if-else chain, basically.
  122.12 +
  122.13 +This fixes a size-regression as compared to gcc-3.4, as can be seen
  122.14 +below.
  122.15 +
  122.16 +2007-04-15  Bernhard Fischer  <..>
  122.17 +
  122.18 +	* stmt.c (expand_case): Do not create a complex binary tree when
  122.19 +	optimizing for size but rather use the simple ordered list.
  122.20 +	(emit_case_nodes): do not emit jumps to the default_label when
  122.21 +	optimizing for size.
  122.22 +
  122.23 +Not regtested so far.
  122.24 +Comments?
  122.25 +
  122.26 +Attached is the test switch.c mentioned below.
  122.27 +
  122.28 +$ 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
  122.29 +gcc-$i  -DCHAIN -Os -o switch-CHAIN-$i.o -c switch.c ;done
  122.30 +$ 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
  122.31 +gcc-$i  -UCHAIN -Os -o switch-$i.o -c switch.c ;done
  122.32 +
  122.33 +$ size switch-*.o
  122.34 +   text	   data	    bss	    dec	    hex	filename
  122.35 +    169	      0	      0	    169	     a9	switch-2.95.o
  122.36 +    115	      0	      0	    115	     73	switch-3.3.o
  122.37 +    103	      0	      0	    103	     67	switch-3.4.o
  122.38 +    124	      0	      0	    124	     7c	switch-4.0.o
  122.39 +    124	      0	      0	    124	     7c	switch-4.1.o
  122.40 +    124	      0	      0	    124	     7c	switch-4.2.orig-HEAD.o
  122.41 +     95	      0	      0	     95	     5f	switch-4.3-HEAD.o
  122.42 +    124	      0	      0	    124	     7c	switch-4.3.orig-HEAD.o
  122.43 +    166	      0	      0	    166	     a6	switch-CHAIN-2.95.o
  122.44 +    111	      0	      0	    111	     6f	switch-CHAIN-3.3.o
  122.45 +     95	      0	      0	     95	     5f	switch-CHAIN-3.4.o
  122.46 +     95	      0	      0	     95	     5f	switch-CHAIN-4.0.o
  122.47 +     95	      0	      0	     95	     5f	switch-CHAIN-4.1.o
  122.48 +     95	      0	      0	     95	     5f	switch-CHAIN-4.2.orig-HEAD.o
  122.49 +     95	      0	      0	     95	     5f	switch-CHAIN-4.3-HEAD.o
  122.50 +     95	      0	      0	     95	     5f	switch-CHAIN-4.3.orig-HEAD.o
  122.51 +
  122.52 +
  122.53 +Content-Type: text/x-diff; charset=us-ascii
  122.54 +Content-Disposition: attachment; filename="gcc-4.3.gcc-flatten-switch-stmt.00.diff"
  122.55 +
  122.56 +diff -durN gcc-4.3.1.orig/gcc/stmt.c gcc-4.3.1/gcc/stmt.c
  122.57 +--- gcc-4.3.1.orig/gcc/stmt.c	2008-05-09 20:12:13.000000000 +0200
  122.58 ++++ gcc-4.3.1/gcc/stmt.c	2008-06-10 14:57:58.000000000 +0200
  122.59 +@@ -2509,7 +2509,11 @@
  122.60 + 	  use_cost_table
  122.61 + 	    = (TREE_CODE (orig_type) != ENUMERAL_TYPE
  122.62 + 	       && estimate_case_costs (case_list));
  122.63 +-	  balance_case_nodes (&case_list, NULL);
  122.64 ++	  /* When optimizing for size, we want a straight list to avoid
  122.65 ++	     jumps as much as possible. This basically creates an if-else
  122.66 ++	     chain.  */
  122.67 ++	  if (!optimize_size)
  122.68 ++	    balance_case_nodes (&case_list, NULL);
  122.69 + 	  emit_case_nodes (index, case_list, default_label, index_type);
  122.70 + 	  emit_jump (default_label);
  122.71 + 	}
  122.72 +@@ -3067,6 +3071,7 @@
  122.73 + 	    {
  122.74 + 	      if (!node_has_low_bound (node, index_type))
  122.75 + 		{
  122.76 ++		  if (!optimize_size) /* don't jl to the .default_label. */
  122.77 + 		  emit_cmp_and_jump_insns (index,
  122.78 + 					   convert_modes
  122.79 + 					   (mode, imode,
   123.1 --- a/patches/gcc/4.3.1/275-gcc-3.4-libiberty-pic.patch	Mon Jul 28 20:17:48 2008 +0000
   123.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   123.3 @@ -1,12 +0,0 @@
   123.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/51_all_gcc-3.4-libiberty-pic.patch
   123.5 -diff -durN gcc-4.3.1.orig/libiberty/Makefile.in gcc-4.3.1/libiberty/Makefile.in
   123.6 ---- gcc-4.3.1.orig/libiberty/Makefile.in	2007-07-25 08:26:45.000000000 +0200
   123.7 -+++ gcc-4.3.1/libiberty/Makefile.in	2008-06-10 14:58:02.000000000 +0200
   123.8 -@@ -225,6 +225,7 @@
   123.9 - 	  $(AR) $(AR_FLAGS) $(TARGETLIB) \
  123.10 - 	    $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \
  123.11 - 	  $(RANLIB) $(TARGETLIB); \
  123.12 -+	  cp $(TARGETLIB) ../ ; \
  123.13 - 	  cd ..; \
  123.14 - 	else true; fi
  123.15 - 
   124.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   124.2 +++ b/patches/gcc/4.3.1/275-libiberty-pic.patch	Mon Jul 28 21:08:01 2008 +0000
   124.3 @@ -0,0 +1,12 @@
   124.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/51_all_gcc-3.4-libiberty-pic.patch
   124.5 +diff -durN gcc-4.3.1.orig/libiberty/Makefile.in gcc-4.3.1/libiberty/Makefile.in
   124.6 +--- gcc-4.3.1.orig/libiberty/Makefile.in	2007-07-25 08:26:45.000000000 +0200
   124.7 ++++ gcc-4.3.1/libiberty/Makefile.in	2008-06-10 14:58:02.000000000 +0200
   124.8 +@@ -225,6 +225,7 @@
   124.9 + 	  $(AR) $(AR_FLAGS) $(TARGETLIB) \
  124.10 + 	    $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \
  124.11 + 	  $(RANLIB) $(TARGETLIB); \
  124.12 ++	  cp $(TARGETLIB) ../ ; \
  124.13 + 	  cd ..; \
  124.14 + 	else true; fi
  124.15 + 
   125.1 --- a/patches/gcc/4.3.1/300-gcc4-superh-default-multilib.patch	Mon Jul 28 20:17:48 2008 +0000
   125.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   125.3 @@ -1,25 +0,0 @@
   125.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/53_all_gcc4-superh-default-multilib.patch
   125.5 -The gcc-3.x toolchains would contain all the targets by default.  With gcc-4,
   125.6 -you have to actually list out the multilibs you want or you will end up with
   125.7 -just one when using targets like 'sh4-linux-gnu'.
   125.8 -
   125.9 -The resulting toolchain can't even build a kernel as the kernel needs to build
  125.10 -with the nofpu flag to be sure that no fpu ops are generated.
  125.11 -
  125.12 -Here we restore the gcc-3.x behavior; the additional overhead of building all
  125.13 -of these multilibs by default is negligible.
  125.14 -
  125.15 -http://bugs.gentoo.org/140205
  125.16 -
  125.17 -diff -durN gcc-4.3.1.orig/gcc/config.gcc gcc-4.3.1/gcc/config.gcc
  125.18 ---- gcc-4.3.1.orig/gcc/config.gcc	2008-05-21 10:54:15.000000000 +0200
  125.19 -+++ gcc-4.3.1/gcc/config.gcc	2008-06-10 14:58:06.000000000 +0200
  125.20 -@@ -2278,7 +2278,7 @@
  125.21 - 	if test x${sh_multilibs} = x ; then
  125.22 - 		case ${target} in
  125.23 - 		sh64-superh-linux* | \
  125.24 --		sh[1234]*)	sh_multilibs=${sh_cpu_target} ;;
  125.25 -+		sh[1234]*)	sh_multilibs=`cd ${srcdir}/config/sh ; echo t-mlib-sh[1-4]* | sed 's:t-mlib-sh:,m:g;s: ::g'` ;;
  125.26 - 		sh64* | sh5*)	sh_multilibs=m5-32media,m5-32media-nofpu,m5-compact,m5-compact-nofpu,m5-64media,m5-64media-nofpu ;;
  125.27 - 		sh-superh-*)	sh_multilibs=m4,m4-single,m4-single-only,m4-nofpu ;;
  125.28 - 		sh*-*-linux*)	sh_multilibs=m1,m3e,m4 ;;
   126.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   126.2 +++ b/patches/gcc/4.3.1/300-superh-default-multilib.patch	Mon Jul 28 21:08:01 2008 +0000
   126.3 @@ -0,0 +1,25 @@
   126.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/53_all_gcc4-superh-default-multilib.patch
   126.5 +The gcc-3.x toolchains would contain all the targets by default.  With gcc-4,
   126.6 +you have to actually list out the multilibs you want or you will end up with
   126.7 +just one when using targets like 'sh4-linux-gnu'.
   126.8 +
   126.9 +The resulting toolchain can't even build a kernel as the kernel needs to build
  126.10 +with the nofpu flag to be sure that no fpu ops are generated.
  126.11 +
  126.12 +Here we restore the gcc-3.x behavior; the additional overhead of building all
  126.13 +of these multilibs by default is negligible.
  126.14 +
  126.15 +http://bugs.gentoo.org/140205
  126.16 +
  126.17 +diff -durN gcc-4.3.1.orig/gcc/config.gcc gcc-4.3.1/gcc/config.gcc
  126.18 +--- gcc-4.3.1.orig/gcc/config.gcc	2008-05-21 10:54:15.000000000 +0200
  126.19 ++++ gcc-4.3.1/gcc/config.gcc	2008-06-10 14:58:06.000000000 +0200
  126.20 +@@ -2278,7 +2278,7 @@
  126.21 + 	if test x${sh_multilibs} = x ; then
  126.22 + 		case ${target} in
  126.23 + 		sh64-superh-linux* | \
  126.24 +-		sh[1234]*)	sh_multilibs=${sh_cpu_target} ;;
  126.25 ++		sh[1234]*)	sh_multilibs=`cd ${srcdir}/config/sh ; echo t-mlib-sh[1-4]* | sed 's:t-mlib-sh:,m:g;s: ::g'` ;;
  126.26 + 		sh64* | sh5*)	sh_multilibs=m5-32media,m5-32media-nofpu,m5-compact,m5-compact-nofpu,m5-64media,m5-64media-nofpu ;;
  126.27 + 		sh-superh-*)	sh_multilibs=m4,m4-single,m4-single-only,m4-nofpu ;;
  126.28 + 		sh*-*-linux*)	sh_multilibs=m1,m3e,m4 ;;
   127.1 --- a/patches/gcc/4.3.1/325-300-libstdc++-pic.patch	Mon Jul 28 20:17:48 2008 +0000
   127.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   127.3 @@ -1,56 +0,0 @@
   127.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/54_all_300-libstdc++-pic.patch
   127.5 -install libstdc++_pic.a if we have pic objs
   127.6 -
   127.7 -diff -durN gcc-4.3.1.orig/libstdc++-v3/src/Makefile.am gcc-4.3.1/libstdc++-v3/src/Makefile.am
   127.8 ---- gcc-4.3.1.orig/libstdc++-v3/src/Makefile.am	2008-02-29 19:26:50.000000000 +0100
   127.9 -+++ gcc-4.3.1/libstdc++-v3/src/Makefile.am	2008-06-10 14:58:09.000000000 +0200
  127.10 -@@ -289,6 +289,13 @@
  127.11 - 	  $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
  127.12 - 
  127.13 - 
  127.14 -+install-exec-local:
  127.15 -+	pic_objs=`sed -n "s:'::g;s:^pic_object=::p" *.lo | grep -v '^none$$'`; \
  127.16 -+	if [ x"$$pic_objs" != x ]; then \
  127.17 -+		$(AR) cru libstdc++_pic.a $$pic_objs $(top_builddir)/libsupc++/*.o || exit 1; \
  127.18 -+		$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir) || exit 1; \
  127.19 -+	fi
  127.20 -+
  127.21 - # Added bits to build debug library.
  127.22 - if GLIBCXX_BUILD_DEBUG
  127.23 - all-local: build_debug
  127.24 -diff -durN gcc-4.3.1.orig/libstdc++-v3/src/Makefile.in gcc-4.3.1/libstdc++-v3/src/Makefile.in
  127.25 ---- gcc-4.3.1.orig/libstdc++-v3/src/Makefile.in	2008-02-29 19:26:50.000000000 +0100
  127.26 -+++ gcc-4.3.1/libstdc++-v3/src/Makefile.in	2008-06-10 14:58:09.000000000 +0200
  127.27 -@@ -693,7 +693,7 @@
  127.28 - 
  127.29 - install-data-am: install-data-local
  127.30 - 
  127.31 --install-exec-am: install-toolexeclibLTLIBRARIES
  127.32 -+install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local
  127.33 - 
  127.34 - install-info: install-info-am
  127.35 - 
  127.36 -@@ -732,7 +732,7 @@
  127.37 - 	maintainer-clean-generic mostlyclean mostlyclean-compile \
  127.38 - 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
  127.39 - 	tags uninstall uninstall-am uninstall-info-am \
  127.40 --	uninstall-toolexeclibLTLIBRARIES
  127.41 -+	uninstall-toolexeclibLTLIBRARIES install-exec-local
  127.42 - 
  127.43 - 
  127.44 - # Symbol versioning for shared libraries.
  127.45 -@@ -858,6 +858,14 @@
  127.46 - install_debug:
  127.47 - 	(cd ${debugdir} && $(MAKE) \
  127.48 - 	toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install)
  127.49 -+
  127.50 -+install-exec-local:
  127.51 -+	pic_objs=`sed -n "s:'::g;s:^pic_object=::p" *.lo | grep -v '^none$$'`; \
  127.52 -+	if [ x"$$pic_objs" != x ]; then \
  127.53 -+		$(AR) cru libstdc++_pic.a $$pic_objs $(top_builddir)/libsupc++/*.o || exit 1; \
  127.54 -+		$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir) || exit 1; \
  127.55 -+	fi
  127.56 -+
  127.57 - # Tell versions [3.59,3.63) of GNU make to not export all variables.
  127.58 - # Otherwise a system limit (for SysV at least) may be exceeded.
  127.59 - .NOEXPORT:
   128.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   128.2 +++ b/patches/gcc/4.3.1/325-libstdc++-pic.patch	Mon Jul 28 21:08:01 2008 +0000
   128.3 @@ -0,0 +1,56 @@
   128.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/54_all_300-libstdc++-pic.patch
   128.5 +install libstdc++_pic.a if we have pic objs
   128.6 +
   128.7 +diff -durN gcc-4.3.1.orig/libstdc++-v3/src/Makefile.am gcc-4.3.1/libstdc++-v3/src/Makefile.am
   128.8 +--- gcc-4.3.1.orig/libstdc++-v3/src/Makefile.am	2008-02-29 19:26:50.000000000 +0100
   128.9 ++++ gcc-4.3.1/libstdc++-v3/src/Makefile.am	2008-06-10 14:58:09.000000000 +0200
  128.10 +@@ -289,6 +289,13 @@
  128.11 + 	  $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
  128.12 + 
  128.13 + 
  128.14 ++install-exec-local:
  128.15 ++	pic_objs=`sed -n "s:'::g;s:^pic_object=::p" *.lo | grep -v '^none$$'`; \
  128.16 ++	if [ x"$$pic_objs" != x ]; then \
  128.17 ++		$(AR) cru libstdc++_pic.a $$pic_objs $(top_builddir)/libsupc++/*.o || exit 1; \
  128.18 ++		$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir) || exit 1; \
  128.19 ++	fi
  128.20 ++
  128.21 + # Added bits to build debug library.
  128.22 + if GLIBCXX_BUILD_DEBUG
  128.23 + all-local: build_debug
  128.24 +diff -durN gcc-4.3.1.orig/libstdc++-v3/src/Makefile.in gcc-4.3.1/libstdc++-v3/src/Makefile.in
  128.25 +--- gcc-4.3.1.orig/libstdc++-v3/src/Makefile.in	2008-02-29 19:26:50.000000000 +0100
  128.26 ++++ gcc-4.3.1/libstdc++-v3/src/Makefile.in	2008-06-10 14:58:09.000000000 +0200
  128.27 +@@ -693,7 +693,7 @@
  128.28 + 
  128.29 + install-data-am: install-data-local
  128.30 + 
  128.31 +-install-exec-am: install-toolexeclibLTLIBRARIES
  128.32 ++install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local
  128.33 + 
  128.34 + install-info: install-info-am
  128.35 + 
  128.36 +@@ -732,7 +732,7 @@
  128.37 + 	maintainer-clean-generic mostlyclean mostlyclean-compile \
  128.38 + 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
  128.39 + 	tags uninstall uninstall-am uninstall-info-am \
  128.40 +-	uninstall-toolexeclibLTLIBRARIES
  128.41 ++	uninstall-toolexeclibLTLIBRARIES install-exec-local
  128.42 + 
  128.43 + 
  128.44 + # Symbol versioning for shared libraries.
  128.45 +@@ -858,6 +858,14 @@
  128.46 + install_debug:
  128.47 + 	(cd ${debugdir} && $(MAKE) \
  128.48 + 	toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install)
  128.49 ++
  128.50 ++install-exec-local:
  128.51 ++	pic_objs=`sed -n "s:'::g;s:^pic_object=::p" *.lo | grep -v '^none$$'`; \
  128.52 ++	if [ x"$$pic_objs" != x ]; then \
  128.53 ++		$(AR) cru libstdc++_pic.a $$pic_objs $(top_builddir)/libsupc++/*.o || exit 1; \
  128.54 ++		$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir) || exit 1; \
  128.55 ++	fi
  128.56 ++
  128.57 + # Tell versions [3.59,3.63) of GNU make to not export all variables.
  128.58 + # Otherwise a system limit (for SysV at least) may be exceeded.
  128.59 + .NOEXPORT:
   129.1 --- a/patches/gcc/4.3.1/350-gcc43-pr24170.patch	Mon Jul 28 20:17:48 2008 +0000
   129.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   129.3 @@ -1,61 +0,0 @@
   129.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/61_all_gcc43-pr24170.patch
   129.5 -http://gcc.gnu.org/PR24170
   129.6 -
   129.7 -2008-02-20  Tom Tromey  <tromey@redhat.com>
   129.8 -
   129.9 -	PR libgcj/24170:
  129.10 -	* java/io/natFilePosix.cc (File::performList): Don't use
  129.11 -	readdir_r.
  129.12 -	* configure, include/config.h.in: Rebuilt.
  129.13 -	* configure.ac: Don't check for readdir_r.
  129.14 -
  129.15 -diff -durN gcc-4.3.1.orig/libjava/configure.ac gcc-4.3.1/libjava/configure.ac
  129.16 ---- gcc-4.3.1.orig/libjava/configure.ac	2008-06-10 14:57:42.000000000 +0200
  129.17 -+++ gcc-4.3.1/libjava/configure.ac	2008-06-10 14:58:13.000000000 +0200
  129.18 -@@ -1030,7 +1030,7 @@
  129.19 -    PLATFORMNET=NoNet
  129.20 - else
  129.21 -    AC_CHECK_FUNCS([strerror_r select fstat open fsync sleep opendir \
  129.22 --                   localtime_r readdir_r getpwuid_r getcwd \
  129.23 -+                   localtime_r getpwuid_r getcwd \
  129.24 - 		   access stat lstat mkdir rename rmdir unlink utime chmod readlink \
  129.25 - 		   nl_langinfo setlocale \
  129.26 - 		   inet_pton uname inet_ntoa \
  129.27 -diff -durN gcc-4.3.1.orig/libjava/include/config.h.in gcc-4.3.1/libjava/include/config.h.in
  129.28 ---- gcc-4.3.1.orig/libjava/include/config.h.in	2007-07-31 18:17:21.000000000 +0200
  129.29 -+++ gcc-4.3.1/libjava/include/config.h.in	2008-06-10 14:58:13.000000000 +0200
  129.30 -@@ -214,9 +214,6 @@
  129.31 - /* Define to 1 if you have the <pwd.h> header file. */
  129.32 - #undef HAVE_PWD_H
  129.33 - 
  129.34 --/* Define to 1 if you have the `readdir_r' function. */
  129.35 --#undef HAVE_READDIR_R
  129.36 --
  129.37 - /* Define to 1 if you have the `readlink' function. */
  129.38 - #undef HAVE_READLINK
  129.39 - 
  129.40 -diff -durN gcc-4.3.1.orig/libjava/java/io/natFilePosix.cc gcc-4.3.1/libjava/java/io/natFilePosix.cc
  129.41 ---- gcc-4.3.1.orig/libjava/java/io/natFilePosix.cc	2007-08-04 23:50:01.000000000 +0200
  129.42 -+++ gcc-4.3.1/libjava/java/io/natFilePosix.cc	2008-06-10 14:58:13.000000000 +0200
  129.43 -@@ -1,6 +1,6 @@
  129.44 - // natFile.cc - Native part of File class for POSIX.
  129.45 - 
  129.46 --/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2006
  129.47 -+/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2006, 2008
  129.48 -    Free Software Foundation
  129.49 - 
  129.50 -    This file is part of libgcj.
  129.51 -@@ -292,13 +292,7 @@
  129.52 - 
  129.53 -   java::util::ArrayList *list = new java::util::ArrayList ();
  129.54 -   struct dirent *d;
  129.55 --#if defined(HAVE_READDIR_R) && defined(_POSIX_PTHREAD_SEMANTICS)
  129.56 --  int name_max = pathconf (buf, _PC_NAME_MAX);
  129.57 --  char dbuf[sizeof (struct dirent) + name_max + 1];
  129.58 --  while (readdir_r (dir, (struct dirent *) dbuf, &d) == 0 && d != NULL)
  129.59 --#else /* HAVE_READDIR_R */
  129.60 -   while ((d = readdir (dir)) != NULL)
  129.61 --#endif /* HAVE_READDIR_R */
  129.62 -     {
  129.63 -       // Omit "." and "..".
  129.64 -       if (d->d_name[0] == '.'
   130.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   130.2 +++ b/patches/gcc/4.3.1/350-pr24170.patch	Mon Jul 28 21:08:01 2008 +0000
   130.3 @@ -0,0 +1,61 @@
   130.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/61_all_gcc43-pr24170.patch
   130.5 +http://gcc.gnu.org/PR24170
   130.6 +
   130.7 +2008-02-20  Tom Tromey  <tromey@redhat.com>
   130.8 +
   130.9 +	PR libgcj/24170:
  130.10 +	* java/io/natFilePosix.cc (File::performList): Don't use
  130.11 +	readdir_r.
  130.12 +	* configure, include/config.h.in: Rebuilt.
  130.13 +	* configure.ac: Don't check for readdir_r.
  130.14 +
  130.15 +diff -durN gcc-4.3.1.orig/libjava/configure.ac gcc-4.3.1/libjava/configure.ac
  130.16 +--- gcc-4.3.1.orig/libjava/configure.ac	2008-06-10 14:57:42.000000000 +0200
  130.17 ++++ gcc-4.3.1/libjava/configure.ac	2008-06-10 14:58:13.000000000 +0200
  130.18 +@@ -1030,7 +1030,7 @@
  130.19 +    PLATFORMNET=NoNet
  130.20 + else
  130.21 +    AC_CHECK_FUNCS([strerror_r select fstat open fsync sleep opendir \
  130.22 +-                   localtime_r readdir_r getpwuid_r getcwd \
  130.23 ++                   localtime_r getpwuid_r getcwd \
  130.24 + 		   access stat lstat mkdir rename rmdir unlink utime chmod readlink \
  130.25 + 		   nl_langinfo setlocale \
  130.26 + 		   inet_pton uname inet_ntoa \
  130.27 +diff -durN gcc-4.3.1.orig/libjava/include/config.h.in gcc-4.3.1/libjava/include/config.h.in
  130.28 +--- gcc-4.3.1.orig/libjava/include/config.h.in	2007-07-31 18:17:21.000000000 +0200
  130.29 ++++ gcc-4.3.1/libjava/include/config.h.in	2008-06-10 14:58:13.000000000 +0200
  130.30 +@@ -214,9 +214,6 @@
  130.31 + /* Define to 1 if you have the <pwd.h> header file. */
  130.32 + #undef HAVE_PWD_H
  130.33 + 
  130.34 +-/* Define to 1 if you have the `readdir_r' function. */
  130.35 +-#undef HAVE_READDIR_R
  130.36 +-
  130.37 + /* Define to 1 if you have the `readlink' function. */
  130.38 + #undef HAVE_READLINK
  130.39 + 
  130.40 +diff -durN gcc-4.3.1.orig/libjava/java/io/natFilePosix.cc gcc-4.3.1/libjava/java/io/natFilePosix.cc
  130.41 +--- gcc-4.3.1.orig/libjava/java/io/natFilePosix.cc	2007-08-04 23:50:01.000000000 +0200
  130.42 ++++ gcc-4.3.1/libjava/java/io/natFilePosix.cc	2008-06-10 14:58:13.000000000 +0200
  130.43 +@@ -1,6 +1,6 @@
  130.44 + // natFile.cc - Native part of File class for POSIX.
  130.45 + 
  130.46 +-/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2006
  130.47 ++/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2006, 2008
  130.48 +    Free Software Foundation
  130.49 + 
  130.50 +    This file is part of libgcj.
  130.51 +@@ -292,13 +292,7 @@
  130.52 + 
  130.53 +   java::util::ArrayList *list = new java::util::ArrayList ();
  130.54 +   struct dirent *d;
  130.55 +-#if defined(HAVE_READDIR_R) && defined(_POSIX_PTHREAD_SEMANTICS)
  130.56 +-  int name_max = pathconf (buf, _PC_NAME_MAX);
  130.57 +-  char dbuf[sizeof (struct dirent) + name_max + 1];
  130.58 +-  while (readdir_r (dir, (struct dirent *) dbuf, &d) == 0 && d != NULL)
  130.59 +-#else /* HAVE_READDIR_R */
  130.60 +   while ((d = readdir (dir)) != NULL)
  130.61 +-#endif /* HAVE_READDIR_R */
  130.62 +     {
  130.63 +       // Omit "." and "..".
  130.64 +       if (d->d_name[0] == '.'
   131.1 --- a/patches/gcc/4.3.1/375-gcc4-ia64-noteGNUstack.patch	Mon Jul 28 20:17:48 2008 +0000
   131.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   131.3 @@ -1,96 +0,0 @@
   131.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/61_all_gcc4-ia64-noteGNUstack.patch
   131.5 -2004-09-20  Jakub Jelinek  <jakub@redhat.com>
   131.6 -
   131.7 -	* config/rs6000/ppc-asm.h: Add .note.GNU-stack section also
   131.8 -	on ppc64-linux.
   131.9 -
  131.10 -	* config/ia64/lib1funcs.asm: Add .note.GNU-stack section on
  131.11 -	ia64-linux.
  131.12 -	* config/ia64/crtbegin.asm: Likewise.
  131.13 -	* config/ia64/crtend.asm: Likewise.
  131.14 -	* config/ia64/crti.asm: Likewise.
  131.15 -	* config/ia64/crtn.asm: Likewise.
  131.16 -
  131.17 -2004-05-14  Jakub Jelinek  <jakub@redhat.com>
  131.18 -
  131.19 -	* config/ia64/linux.h (TARGET_ASM_FILE_END): Define.
  131.20 -
  131.21 -diff -durN gcc-4.3.1.orig/gcc/config/ia64/crtbegin.asm gcc-4.3.1/gcc/config/ia64/crtbegin.asm
  131.22 ---- gcc-4.3.1.orig/gcc/config/ia64/crtbegin.asm	2005-09-27 02:52:24.000000000 +0200
  131.23 -+++ gcc-4.3.1/gcc/config/ia64/crtbegin.asm	2008-06-10 14:58:17.000000000 +0200
  131.24 -@@ -255,3 +255,7 @@
  131.25 - .weak __cxa_finalize
  131.26 - #endif
  131.27 - .weak _Jv_RegisterClasses
  131.28 -+
  131.29 -+#ifdef __linux__
  131.30 -+.section .note.GNU-stack; .previous
  131.31 -+#endif
  131.32 -diff -durN gcc-4.3.1.orig/gcc/config/ia64/crtend.asm gcc-4.3.1/gcc/config/ia64/crtend.asm
  131.33 ---- gcc-4.3.1.orig/gcc/config/ia64/crtend.asm	2005-09-27 02:52:24.000000000 +0200
  131.34 -+++ gcc-4.3.1/gcc/config/ia64/crtend.asm	2008-06-10 14:58:17.000000000 +0200
  131.35 -@@ -122,3 +122,7 @@
  131.36 - 
  131.37 - 	br.ret.sptk.many rp
  131.38 - 	.endp __do_global_ctors_aux
  131.39 -+
  131.40 -+#ifdef __linux__
  131.41 -+.section .note.GNU-stack; .previous
  131.42 -+#endif
  131.43 -diff -durN gcc-4.3.1.orig/gcc/config/ia64/crti.asm gcc-4.3.1/gcc/config/ia64/crti.asm
  131.44 ---- gcc-4.3.1.orig/gcc/config/ia64/crti.asm	2005-06-25 03:22:41.000000000 +0200
  131.45 -+++ gcc-4.3.1/gcc/config/ia64/crti.asm	2008-06-10 14:58:17.000000000 +0200
  131.46 -@@ -64,3 +64,7 @@
  131.47 - 	.body
  131.48 - 
  131.49 - # end of crti.asm
  131.50 -+
  131.51 -+#ifdef __linux__
  131.52 -+.section .note.GNU-stack; .previous
  131.53 -+#endif
  131.54 -diff -durN gcc-4.3.1.orig/gcc/config/ia64/crtn.asm gcc-4.3.1/gcc/config/ia64/crtn.asm
  131.55 ---- gcc-4.3.1.orig/gcc/config/ia64/crtn.asm	2005-06-25 03:22:41.000000000 +0200
  131.56 -+++ gcc-4.3.1/gcc/config/ia64/crtn.asm	2008-06-10 14:58:17.000000000 +0200
  131.57 -@@ -54,3 +54,7 @@
  131.58 - 	br.ret.sptk.many b0
  131.59 - 
  131.60 - # end of crtn.asm
  131.61 -+
  131.62 -+#ifdef __linux__
  131.63 -+.section .note.GNU-stack; .previous
  131.64 -+#endif
  131.65 -diff -durN gcc-4.3.1.orig/gcc/config/ia64/lib1funcs.asm gcc-4.3.1/gcc/config/ia64/lib1funcs.asm
  131.66 ---- gcc-4.3.1.orig/gcc/config/ia64/lib1funcs.asm	2005-09-27 02:52:24.000000000 +0200
  131.67 -+++ gcc-4.3.1/gcc/config/ia64/lib1funcs.asm	2008-06-10 14:58:17.000000000 +0200
  131.68 -@@ -792,3 +792,7 @@
  131.69 - 	}
  131.70 - 	.endp __floattitf
  131.71 - #endif
  131.72 -+
  131.73 -+#ifdef __linux__
  131.74 -+.section .note.GNU-stack; .previous
  131.75 -+#endif
  131.76 -diff -durN gcc-4.3.1.orig/gcc/config/ia64/linux.h gcc-4.3.1/gcc/config/ia64/linux.h
  131.77 ---- gcc-4.3.1.orig/gcc/config/ia64/linux.h	2006-12-12 16:15:19.000000000 +0100
  131.78 -+++ gcc-4.3.1/gcc/config/ia64/linux.h	2008-06-10 14:58:17.000000000 +0200
  131.79 -@@ -5,6 +5,8 @@
  131.80 - 
  131.81 - #define TARGET_VERSION fprintf (stderr, " (IA-64) Linux");
  131.82 - 
  131.83 -+#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
  131.84 -+
  131.85 - /* This is for -profile to use -lc_p instead of -lc.  */
  131.86 - #undef CC1_SPEC
  131.87 - #define CC1_SPEC "%{profile:-p} %{G*}"
  131.88 -diff -durN gcc-4.3.1.orig/gcc/config/rs6000/ppc-asm.h gcc-4.3.1/gcc/config/rs6000/ppc-asm.h
  131.89 ---- gcc-4.3.1.orig/gcc/config/rs6000/ppc-asm.h	2003-06-04 18:44:51.000000000 +0200
  131.90 -+++ gcc-4.3.1/gcc/config/rs6000/ppc-asm.h	2008-06-10 14:58:17.000000000 +0200
  131.91 -@@ -158,7 +158,7 @@
  131.92 - 	.size FUNC_NAME(name),GLUE(.L,name)-FUNC_NAME(name)
  131.93 - #endif
  131.94 - 
  131.95 --#if defined __linux__ && !defined __powerpc64__
  131.96 -+#if defined __linux__
  131.97 - 	.section .note.GNU-stack
  131.98 - 	.previous
  131.99 - #endif
   132.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   132.2 +++ b/patches/gcc/4.3.1/375-noteGNUstack-00.patch	Mon Jul 28 21:08:01 2008 +0000
   132.3 @@ -0,0 +1,96 @@
   132.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/61_all_gcc4-ia64-noteGNUstack.patch
   132.5 +2004-09-20  Jakub Jelinek  <jakub@redhat.com>
   132.6 +
   132.7 +	* config/rs6000/ppc-asm.h: Add .note.GNU-stack section also
   132.8 +	on ppc64-linux.
   132.9 +
  132.10 +	* config/ia64/lib1funcs.asm: Add .note.GNU-stack section on
  132.11 +	ia64-linux.
  132.12 +	* config/ia64/crtbegin.asm: Likewise.
  132.13 +	* config/ia64/crtend.asm: Likewise.
  132.14 +	* config/ia64/crti.asm: Likewise.
  132.15 +	* config/ia64/crtn.asm: Likewise.
  132.16 +
  132.17 +2004-05-14  Jakub Jelinek  <jakub@redhat.com>
  132.18 +
  132.19 +	* config/ia64/linux.h (TARGET_ASM_FILE_END): Define.
  132.20 +
  132.21 +diff -durN gcc-4.3.1.orig/gcc/config/ia64/crtbegin.asm gcc-4.3.1/gcc/config/ia64/crtbegin.asm
  132.22 +--- gcc-4.3.1.orig/gcc/config/ia64/crtbegin.asm	2005-09-27 02:52:24.000000000 +0200
  132.23 ++++ gcc-4.3.1/gcc/config/ia64/crtbegin.asm	2008-06-10 14:58:17.000000000 +0200
  132.24 +@@ -255,3 +255,7 @@
  132.25 + .weak __cxa_finalize
  132.26 + #endif
  132.27 + .weak _Jv_RegisterClasses
  132.28 ++
  132.29 ++#ifdef __linux__
  132.30 ++.section .note.GNU-stack; .previous
  132.31 ++#endif
  132.32 +diff -durN gcc-4.3.1.orig/gcc/config/ia64/crtend.asm gcc-4.3.1/gcc/config/ia64/crtend.asm
  132.33 +--- gcc-4.3.1.orig/gcc/config/ia64/crtend.asm	2005-09-27 02:52:24.000000000 +0200
  132.34 ++++ gcc-4.3.1/gcc/config/ia64/crtend.asm	2008-06-10 14:58:17.000000000 +0200
  132.35 +@@ -122,3 +122,7 @@
  132.36 + 
  132.37 + 	br.ret.sptk.many rp
  132.38 + 	.endp __do_global_ctors_aux
  132.39 ++
  132.40 ++#ifdef __linux__
  132.41 ++.section .note.GNU-stack; .previous
  132.42 ++#endif
  132.43 +diff -durN gcc-4.3.1.orig/gcc/config/ia64/crti.asm gcc-4.3.1/gcc/config/ia64/crti.asm
  132.44 +--- gcc-4.3.1.orig/gcc/config/ia64/crti.asm	2005-06-25 03:22:41.000000000 +0200
  132.45 ++++ gcc-4.3.1/gcc/config/ia64/crti.asm	2008-06-10 14:58:17.000000000 +0200
  132.46 +@@ -64,3 +64,7 @@
  132.47 + 	.body
  132.48 + 
  132.49 + # end of crti.asm
  132.50 ++
  132.51 ++#ifdef __linux__
  132.52 ++.section .note.GNU-stack; .previous
  132.53 ++#endif
  132.54 +diff -durN gcc-4.3.1.orig/gcc/config/ia64/crtn.asm gcc-4.3.1/gcc/config/ia64/crtn.asm
  132.55 +--- gcc-4.3.1.orig/gcc/config/ia64/crtn.asm	2005-06-25 03:22:41.000000000 +0200
  132.56 ++++ gcc-4.3.1/gcc/config/ia64/crtn.asm	2008-06-10 14:58:17.000000000 +0200
  132.57 +@@ -54,3 +54,7 @@
  132.58 + 	br.ret.sptk.many b0
  132.59 + 
  132.60 + # end of crtn.asm
  132.61 ++
  132.62 ++#ifdef __linux__
  132.63 ++.section .note.GNU-stack; .previous
  132.64 ++#endif
  132.65 +diff -durN gcc-4.3.1.orig/gcc/config/ia64/lib1funcs.asm gcc-4.3.1/gcc/config/ia64/lib1funcs.asm
  132.66 +--- gcc-4.3.1.orig/gcc/config/ia64/lib1funcs.asm	2005-09-27 02:52:24.000000000 +0200
  132.67 ++++ gcc-4.3.1/gcc/config/ia64/lib1funcs.asm	2008-06-10 14:58:17.000000000 +0200
  132.68 +@@ -792,3 +792,7 @@
  132.69 + 	}
  132.70 + 	.endp __floattitf
  132.71 + #endif
  132.72 ++
  132.73 ++#ifdef __linux__
  132.74 ++.section .note.GNU-stack; .previous
  132.75 ++#endif
  132.76 +diff -durN gcc-4.3.1.orig/gcc/config/ia64/linux.h gcc-4.3.1/gcc/config/ia64/linux.h
  132.77 +--- gcc-4.3.1.orig/gcc/config/ia64/linux.h	2006-12-12 16:15:19.000000000 +0100
  132.78 ++++ gcc-4.3.1/gcc/config/ia64/linux.h	2008-06-10 14:58:17.000000000 +0200
  132.79 +@@ -5,6 +5,8 @@
  132.80 + 
  132.81 + #define TARGET_VERSION fprintf (stderr, " (IA-64) Linux");
  132.82 + 
  132.83 ++#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
  132.84 ++
  132.85 + /* This is for -profile to use -lc_p instead of -lc.  */
  132.86 + #undef CC1_SPEC
  132.87 + #define CC1_SPEC "%{profile:-p} %{G*}"
  132.88 +diff -durN gcc-4.3.1.orig/gcc/config/rs6000/ppc-asm.h gcc-4.3.1/gcc/config/rs6000/ppc-asm.h
  132.89 +--- gcc-4.3.1.orig/gcc/config/rs6000/ppc-asm.h	2003-06-04 18:44:51.000000000 +0200
  132.90 ++++ gcc-4.3.1/gcc/config/rs6000/ppc-asm.h	2008-06-10 14:58:17.000000000 +0200
  132.91 +@@ -158,7 +158,7 @@
  132.92 + 	.size FUNC_NAME(name),GLUE(.L,name)-FUNC_NAME(name)
  132.93 + #endif
  132.94 + 
  132.95 +-#if defined __linux__ && !defined __powerpc64__
  132.96 ++#if defined __linux__
  132.97 + 	.section .note.GNU-stack
  132.98 + 	.previous
  132.99 + #endif
   133.1 --- a/patches/gcc/4.3.1/400-gcc4-noteGNUstack.patch	Mon Jul 28 20:17:48 2008 +0000
   133.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   133.3 @@ -1,198 +0,0 @@
   133.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/62_all_gcc4-noteGNUstack.patch
   133.5 -2005-02-08  Jakub Jelinek  <jakub@redhat.com>
   133.6 -
   133.7 -	* src/alpha/osf.S: Add .note.GNU-stack on Linux.
   133.8 -	* src/s390/sysv.S: Likewise.
   133.9 -	* src/powerpc/linux64.S: Likewise.
  133.10 -	* src/powerpc/linux64_closure.S: Likewise.
  133.11 -	* src/powerpc/ppc_closure.S: Likewise.
  133.12 -	* src/powerpc/sysv.S: Likewise.
  133.13 -	* src/x86/unix64.S: Likewise.
  133.14 -	* src/x86/sysv.S: Likewise.
  133.15 -	* src/sparc/v8.S: Likewise.
  133.16 -	* src/sparc/v9.S: Likewise.
  133.17 -	* src/m68k/sysv.S: Likewise.
  133.18 -	* src/ia64/unix.S: Likewise.
  133.19 -	* src/arm/sysv.S: Likewise.
  133.20 -
  133.21 -	* ia64_save_regs_in_stack.s: Moved to...
  133.22 -	* ia64_save_regs_in_stack.S: ... this.  Add .note.GNU-stack
  133.23 -	on Linux.
  133.24 -
  133.25 -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
  133.26 ---- gcc-4.3.1.orig/boehm-gc/ia64_save_regs_in_stack.S	1970-01-01 01:00:00.000000000 +0100
  133.27 -+++ gcc-4.3.1/boehm-gc/ia64_save_regs_in_stack.S	2008-06-10 14:58:21.000000000 +0200
  133.28 -@@ -0,0 +1,15 @@
  133.29 -+        .text
  133.30 -+        .align 16
  133.31 -+        .global GC_save_regs_in_stack
  133.32 -+        .proc GC_save_regs_in_stack
  133.33 -+GC_save_regs_in_stack:
  133.34 -+        .bodyfoo.mpg
  133.35 -+        flushrs
  133.36 -+        ;;
  133.37 -+        mov r8=ar.bsp
  133.38 -+        br.ret.sptk.few rp
  133.39 -+        .endp GC_save_regs_in_stack
  133.40 -+
  133.41 -+#ifdef __linux__
  133.42 -+	.section .note.GNU-stack,"",@progbits
  133.43 -+#endif
  133.44 -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
  133.45 ---- gcc-4.3.1.orig/boehm-gc/ia64_save_regs_in_stack.s	2001-10-15 06:57:59.000000000 +0200
  133.46 -+++ gcc-4.3.1/boehm-gc/ia64_save_regs_in_stack.s	2008-06-10 14:58:21.000000000 +0200
  133.47 -@@ -1,12 +0,0 @@
  133.48 --        .text
  133.49 --        .align 16
  133.50 --        .global GC_save_regs_in_stack
  133.51 --        .proc GC_save_regs_in_stack
  133.52 --GC_save_regs_in_stack:
  133.53 --        .body
  133.54 --        flushrs
  133.55 --        ;;
  133.56 --        mov r8=ar.bsp
  133.57 --        br.ret.sptk.few rp
  133.58 --        .endp GC_save_regs_in_stack
  133.59 --
  133.60 -diff -durN gcc-4.3.1.orig/libffi/src/alpha/osf.S gcc-4.3.1/libffi/src/alpha/osf.S
  133.61 ---- gcc-4.3.1.orig/libffi/src/alpha/osf.S	2007-04-06 18:24:16.000000000 +0200
  133.62 -+++ gcc-4.3.1/libffi/src/alpha/osf.S	2008-06-10 14:58:21.000000000 +0200
  133.63 -@@ -358,4 +358,8 @@
  133.64 - 	.byte	16		# uleb128 offset 16*-8
  133.65 - 	.align 3
  133.66 - $LEFDE3:
  133.67 -+
  133.68 -+#ifdef __linux__
  133.69 -+	.section	.note.GNU-stack,"",@progbits
  133.70 -+#endif
  133.71 - #endif
  133.72 -diff -durN gcc-4.3.1.orig/libffi/src/arm/sysv.S gcc-4.3.1/libffi/src/arm/sysv.S
  133.73 ---- gcc-4.3.1.orig/libffi/src/arm/sysv.S	2007-09-04 19:52:45.000000000 +0200
  133.74 -+++ gcc-4.3.1/libffi/src/arm/sysv.S	2008-06-10 14:58:21.000000000 +0200
  133.75 -@@ -293,3 +293,6 @@
  133.76 - 	UNWIND .fnend
  133.77 -         .size    CNAME(ffi_closure_SYSV),.ffi_closure_SYSV_end-CNAME(ffi_closure_SYSV)
  133.78 - 
  133.79 -+#if defined __ELF__ && defined __linux__
  133.80 -+	.section	.note.GNU-stack,"",%progbits
  133.81 -+#endif
  133.82 -diff -durN gcc-4.3.1.orig/libffi/src/ia64/unix.S gcc-4.3.1/libffi/src/ia64/unix.S
  133.83 ---- gcc-4.3.1.orig/libffi/src/ia64/unix.S	2005-03-30 23:49:19.000000000 +0200
  133.84 -+++ gcc-4.3.1/libffi/src/ia64/unix.S	2008-06-10 14:58:21.000000000 +0200
  133.85 -@@ -553,3 +553,7 @@
  133.86 - 	data8	@pcrel(.Lld_hfa_float)		// FFI_IA64_TYPE_HFA_FLOAT
  133.87 - 	data8	@pcrel(.Lld_hfa_double)		// FFI_IA64_TYPE_HFA_DOUBLE
  133.88 - 	data8	@pcrel(.Lld_hfa_ldouble)	// FFI_IA64_TYPE_HFA_LDOUBLE
  133.89 -+
  133.90 -+#if defined __ELF__ && defined __linux__
  133.91 -+	.section	.note.GNU-stack,"",@progbits
  133.92 -+#endif
  133.93 -diff -durN gcc-4.3.1.orig/libffi/src/m68k/sysv.S gcc-4.3.1/libffi/src/m68k/sysv.S
  133.94 ---- gcc-4.3.1.orig/libffi/src/m68k/sysv.S	2007-05-10 23:29:04.000000000 +0200
  133.95 -+++ gcc-4.3.1/libffi/src/m68k/sysv.S	2008-06-10 14:58:21.000000000 +0200
  133.96 -@@ -207,3 +207,7 @@
  133.97 - 	rts
  133.98 - 	CFI_ENDPROC()
  133.99 - 	.size	ffi_closure_struct_SYSV,.-ffi_closure_struct_SYSV
 133.100 -+
 133.101 -+#if defined __ELF__ && defined __linux__
 133.102 -+	.section	.note.GNU-stack,"",@progbits
 133.103 -+#endif
 133.104 -diff -durN gcc-4.3.1.orig/libffi/src/powerpc/linux64.S gcc-4.3.1/libffi/src/powerpc/linux64.S
 133.105 ---- gcc-4.3.1.orig/libffi/src/powerpc/linux64.S	2007-11-17 00:24:53.000000000 +0100
 133.106 -+++ gcc-4.3.1/libffi/src/powerpc/linux64.S	2008-06-10 14:58:21.000000000 +0200
 133.107 -@@ -179,3 +179,7 @@
 133.108 - 	.align 3
 133.109 - .LEFDE1:
 133.110 - #endif
 133.111 -+
 133.112 -+#if defined __ELF__ && defined __linux__
 133.113 -+	.section	.note.GNU-stack,"",@progbits
 133.114 -+#endif
 133.115 -diff -durN gcc-4.3.1.orig/libffi/src/powerpc/linux64_closure.S gcc-4.3.1/libffi/src/powerpc/linux64_closure.S
 133.116 ---- gcc-4.3.1.orig/libffi/src/powerpc/linux64_closure.S	2005-08-11 23:18:24.000000000 +0200
 133.117 -+++ gcc-4.3.1/libffi/src/powerpc/linux64_closure.S	2008-06-10 14:58:21.000000000 +0200
 133.118 -@@ -204,3 +204,7 @@
 133.119 - 	.align 3
 133.120 - .LEFDE1:
 133.121 - #endif
 133.122 -+
 133.123 -+#if defined __ELF__ && defined __linux__
 133.124 -+	.section	.note.GNU-stack,"",@progbits
 133.125 -+#endif
 133.126 -diff -durN gcc-4.3.1.orig/libffi/src/powerpc/ppc_closure.S gcc-4.3.1/libffi/src/powerpc/ppc_closure.S
 133.127 ---- gcc-4.3.1.orig/libffi/src/powerpc/ppc_closure.S	2007-12-01 22:00:04.000000000 +0100
 133.128 -+++ gcc-4.3.1/libffi/src/powerpc/ppc_closure.S	2008-06-10 14:58:21.000000000 +0200
 133.129 -@@ -295,3 +295,7 @@
 133.130 - .LEFDE1:
 133.131 - 
 133.132 - #endif
 133.133 -+
 133.134 -+#if defined __ELF__ && defined __linux__
 133.135 -+	.section	.note.GNU-stack,"",@progbits
 133.136 -+#endif
 133.137 -diff -durN gcc-4.3.1.orig/libffi/src/powerpc/sysv.S gcc-4.3.1/libffi/src/powerpc/sysv.S
 133.138 ---- gcc-4.3.1.orig/libffi/src/powerpc/sysv.S	2007-12-01 22:00:04.000000000 +0100
 133.139 -+++ gcc-4.3.1/libffi/src/powerpc/sysv.S	2008-06-10 14:58:21.000000000 +0200
 133.140 -@@ -223,3 +223,7 @@
 133.141 -       .align 2
 133.142 - .LEFDE1:
 133.143 - #endif
 133.144 -+
 133.145 -+#if defined __ELF__ && defined __linux__
 133.146 -+	.section	.note.GNU-stack,"",@progbits
 133.147 -+#endif
 133.148 -diff -durN gcc-4.3.1.orig/libffi/src/s390/sysv.S gcc-4.3.1/libffi/src/s390/sysv.S
 133.149 ---- gcc-4.3.1.orig/libffi/src/s390/sysv.S	2003-10-21 21:01:58.000000000 +0200
 133.150 -+++ gcc-4.3.1/libffi/src/s390/sysv.S	2008-06-10 14:58:21.000000000 +0200
 133.151 -@@ -427,3 +427,6 @@
 133.152 - 
 133.153 - #endif
 133.154 - 
 133.155 -+#if defined __ELF__ && defined __linux__
 133.156 -+	.section	.note.GNU-stack,"",@progbits
 133.157 -+#endif
 133.158 -diff -durN gcc-4.3.1.orig/libffi/src/sparc/v8.S gcc-4.3.1/libffi/src/sparc/v8.S
 133.159 ---- gcc-4.3.1.orig/libffi/src/sparc/v8.S	2004-11-22 19:35:16.000000000 +0100
 133.160 -+++ gcc-4.3.1/libffi/src/sparc/v8.S	2008-06-10 14:58:21.000000000 +0200
 133.161 -@@ -265,3 +265,7 @@
 133.162 - 	.byte	0x1f	! uleb128 0x1f
 133.163 - 	.align	WS
 133.164 - .LLEFDE2:
 133.165 -+
 133.166 -+#if defined __ELF__ && defined __linux__
 133.167 -+	.section	.note.GNU-stack,"",@progbits
 133.168 -+#endif
 133.169 -diff -durN gcc-4.3.1.orig/libffi/src/sparc/v9.S gcc-4.3.1/libffi/src/sparc/v9.S
 133.170 ---- gcc-4.3.1.orig/libffi/src/sparc/v9.S	2004-01-25 07:58:33.000000000 +0100
 133.171 -+++ gcc-4.3.1/libffi/src/sparc/v9.S	2008-06-10 14:58:21.000000000 +0200
 133.172 -@@ -300,3 +300,7 @@
 133.173 - 	.align 8
 133.174 - .LLEFDE2:
 133.175 - #endif
 133.176 -+
 133.177 -+#ifdef __linux__
 133.178 -+	.section	.note.GNU-stack,"",@progbits
 133.179 -+#endif
 133.180 -diff -durN gcc-4.3.1.orig/libffi/src/x86/sysv.S gcc-4.3.1/libffi/src/x86/sysv.S
 133.181 ---- gcc-4.3.1.orig/libffi/src/x86/sysv.S	2008-01-30 15:36:58.000000000 +0100
 133.182 -+++ gcc-4.3.1/libffi/src/x86/sysv.S	2008-06-10 14:58:21.000000000 +0200
 133.183 -@@ -430,3 +430,7 @@
 133.184 - #endif
 133.185 - 
 133.186 - #endif /* ifndef __x86_64__ */
 133.187 -+
 133.188 -+#if defined __ELF__ && defined __linux__
 133.189 -+	.section	.note.GNU-stack,"",@progbits
 133.190 -+#endif
 133.191 -diff -durN gcc-4.3.1.orig/libffi/src/x86/unix64.S gcc-4.3.1/libffi/src/x86/unix64.S
 133.192 ---- gcc-4.3.1.orig/libffi/src/x86/unix64.S	2005-05-05 06:06:38.000000000 +0200
 133.193 -+++ gcc-4.3.1/libffi/src/x86/unix64.S	2008-06-10 14:58:21.000000000 +0200
 133.194 -@@ -410,3 +410,7 @@
 133.195 - .LEFDE3:
 133.196 - 
 133.197 - #endif /* __x86_64__ */
 133.198 -+
 133.199 -+#if defined __ELF__ && defined __linux__
 133.200 -+	.section	.note.GNU-stack,"",@progbits
 133.201 -+#endif
   134.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   134.2 +++ b/patches/gcc/4.3.1/400-noteGNUstack-01.patch	Mon Jul 28 21:08:01 2008 +0000
   134.3 @@ -0,0 +1,198 @@
   134.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/62_all_gcc4-noteGNUstack.patch
   134.5 +2005-02-08  Jakub Jelinek  <jakub@redhat.com>
   134.6 +
   134.7 +	* src/alpha/osf.S: Add .note.GNU-stack on Linux.
   134.8 +	* src/s390/sysv.S: Likewise.
   134.9 +	* src/powerpc/linux64.S: Likewise.
  134.10 +	* src/powerpc/linux64_closure.S: Likewise.
  134.11 +	* src/powerpc/ppc_closure.S: Likewise.
  134.12 +	* src/powerpc/sysv.S: Likewise.
  134.13 +	* src/x86/unix64.S: Likewise.
  134.14 +	* src/x86/sysv.S: Likewise.
  134.15 +	* src/sparc/v8.S: Likewise.
  134.16 +	* src/sparc/v9.S: Likewise.
  134.17 +	* src/m68k/sysv.S: Likewise.
  134.18 +	* src/ia64/unix.S: Likewise.
  134.19 +	* src/arm/sysv.S: Likewise.
  134.20 +
  134.21 +	* ia64_save_regs_in_stack.s: Moved to...
  134.22 +	* ia64_save_regs_in_stack.S: ... this.  Add .note.GNU-stack
  134.23 +	on Linux.
  134.24 +
  134.25 +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
  134.26 +--- gcc-4.3.1.orig/boehm-gc/ia64_save_regs_in_stack.S	1970-01-01 01:00:00.000000000 +0100
  134.27 ++++ gcc-4.3.1/boehm-gc/ia64_save_regs_in_stack.S	2008-06-10 14:58:21.000000000 +0200
  134.28 +@@ -0,0 +1,15 @@
  134.29 ++        .text
  134.30 ++        .align 16
  134.31 ++        .global GC_save_regs_in_stack
  134.32 ++        .proc GC_save_regs_in_stack
  134.33 ++GC_save_regs_in_stack:
  134.34 ++        .bodyfoo.mpg
  134.35 ++        flushrs
  134.36 ++        ;;
  134.37 ++        mov r8=ar.bsp
  134.38 ++        br.ret.sptk.few rp
  134.39 ++        .endp GC_save_regs_in_stack
  134.40 ++
  134.41 ++#ifdef __linux__
  134.42 ++	.section .note.GNU-stack,"",@progbits
  134.43 ++#endif
  134.44 +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
  134.45 +--- gcc-4.3.1.orig/boehm-gc/ia64_save_regs_in_stack.s	2001-10-15 06:57:59.000000000 +0200
  134.46 ++++ gcc-4.3.1/boehm-gc/ia64_save_regs_in_stack.s	2008-06-10 14:58:21.000000000 +0200
  134.47 +@@ -1,12 +0,0 @@
  134.48 +-        .text
  134.49 +-        .align 16
  134.50 +-        .global GC_save_regs_in_stack
  134.51 +-        .proc GC_save_regs_in_stack
  134.52 +-GC_save_regs_in_stack:
  134.53 +-        .body
  134.54 +-        flushrs
  134.55 +-        ;;
  134.56 +-        mov r8=ar.bsp
  134.57 +-        br.ret.sptk.few rp
  134.58 +-        .endp GC_save_regs_in_stack
  134.59 +-
  134.60 +diff -durN gcc-4.3.1.orig/libffi/src/alpha/osf.S gcc-4.3.1/libffi/src/alpha/osf.S
  134.61 +--- gcc-4.3.1.orig/libffi/src/alpha/osf.S	2007-04-06 18:24:16.000000000 +0200
  134.62 ++++ gcc-4.3.1/libffi/src/alpha/osf.S	2008-06-10 14:58:21.000000000 +0200
  134.63 +@@ -358,4 +358,8 @@
  134.64 + 	.byte	16		# uleb128 offset 16*-8
  134.65 + 	.align 3
  134.66 + $LEFDE3:
  134.67 ++
  134.68 ++#ifdef __linux__
  134.69 ++	.section	.note.GNU-stack,"",@progbits
  134.70 ++#endif
  134.71 + #endif
  134.72 +diff -durN gcc-4.3.1.orig/libffi/src/arm/sysv.S gcc-4.3.1/libffi/src/arm/sysv.S
  134.73 +--- gcc-4.3.1.orig/libffi/src/arm/sysv.S	2007-09-04 19:52:45.000000000 +0200
  134.74 ++++ gcc-4.3.1/libffi/src/arm/sysv.S	2008-06-10 14:58:21.000000000 +0200
  134.75 +@@ -293,3 +293,6 @@
  134.76 + 	UNWIND .fnend
  134.77 +         .size    CNAME(ffi_closure_SYSV),.ffi_closure_SYSV_end-CNAME(ffi_closure_SYSV)
  134.78 + 
  134.79 ++#if defined __ELF__ && defined __linux__
  134.80 ++	.section	.note.GNU-stack,"",%progbits
  134.81 ++#endif
  134.82 +diff -durN gcc-4.3.1.orig/libffi/src/ia64/unix.S gcc-4.3.1/libffi/src/ia64/unix.S
  134.83 +--- gcc-4.3.1.orig/libffi/src/ia64/unix.S	2005-03-30 23:49:19.000000000 +0200
  134.84 ++++ gcc-4.3.1/libffi/src/ia64/unix.S	2008-06-10 14:58:21.000000000 +0200
  134.85 +@@ -553,3 +553,7 @@
  134.86 + 	data8	@pcrel(.Lld_hfa_float)		// FFI_IA64_TYPE_HFA_FLOAT
  134.87 + 	data8	@pcrel(.Lld_hfa_double)		// FFI_IA64_TYPE_HFA_DOUBLE
  134.88 + 	data8	@pcrel(.Lld_hfa_ldouble)	// FFI_IA64_TYPE_HFA_LDOUBLE
  134.89 ++
  134.90 ++#if defined __ELF__ && defined __linux__
  134.91 ++	.section	.note.GNU-stack,"",@progbits
  134.92 ++#endif
  134.93 +diff -durN gcc-4.3.1.orig/libffi/src/m68k/sysv.S gcc-4.3.1/libffi/src/m68k/sysv.S
  134.94 +--- gcc-4.3.1.orig/libffi/src/m68k/sysv.S	2007-05-10 23:29:04.000000000 +0200
  134.95 ++++ gcc-4.3.1/libffi/src/m68k/sysv.S	2008-06-10 14:58:21.000000000 +0200
  134.96 +@@ -207,3 +207,7 @@
  134.97 + 	rts
  134.98 + 	CFI_ENDPROC()
  134.99 + 	.size	ffi_closure_struct_SYSV,.-ffi_closure_struct_SYSV
 134.100 ++
 134.101 ++#if defined __ELF__ && defined __linux__
 134.102 ++	.section	.note.GNU-stack,"",@progbits
 134.103 ++#endif
 134.104 +diff -durN gcc-4.3.1.orig/libffi/src/powerpc/linux64.S gcc-4.3.1/libffi/src/powerpc/linux64.S
 134.105 +--- gcc-4.3.1.orig/libffi/src/powerpc/linux64.S	2007-11-17 00:24:53.000000000 +0100
 134.106 ++++ gcc-4.3.1/libffi/src/powerpc/linux64.S	2008-06-10 14:58:21.000000000 +0200
 134.107 +@@ -179,3 +179,7 @@
 134.108 + 	.align 3
 134.109 + .LEFDE1:
 134.110 + #endif
 134.111 ++
 134.112 ++#if defined __ELF__ && defined __linux__
 134.113 ++	.section	.note.GNU-stack,"",@progbits
 134.114 ++#endif
 134.115 +diff -durN gcc-4.3.1.orig/libffi/src/powerpc/linux64_closure.S gcc-4.3.1/libffi/src/powerpc/linux64_closure.S
 134.116 +--- gcc-4.3.1.orig/libffi/src/powerpc/linux64_closure.S	2005-08-11 23:18:24.000000000 +0200
 134.117 ++++ gcc-4.3.1/libffi/src/powerpc/linux64_closure.S	2008-06-10 14:58:21.000000000 +0200
 134.118 +@@ -204,3 +204,7 @@
 134.119 + 	.align 3
 134.120 + .LEFDE1:
 134.121 + #endif
 134.122 ++
 134.123 ++#if defined __ELF__ && defined __linux__
 134.124 ++	.section	.note.GNU-stack,"",@progbits
 134.125 ++#endif
 134.126 +diff -durN gcc-4.3.1.orig/libffi/src/powerpc/ppc_closure.S gcc-4.3.1/libffi/src/powerpc/ppc_closure.S
 134.127 +--- gcc-4.3.1.orig/libffi/src/powerpc/ppc_closure.S	2007-12-01 22:00:04.000000000 +0100
 134.128 ++++ gcc-4.3.1/libffi/src/powerpc/ppc_closure.S	2008-06-10 14:58:21.000000000 +0200
 134.129 +@@ -295,3 +295,7 @@
 134.130 + .LEFDE1:
 134.131 + 
 134.132 + #endif
 134.133 ++
 134.134 ++#if defined __ELF__ && defined __linux__
 134.135 ++	.section	.note.GNU-stack,"",@progbits
 134.136 ++#endif
 134.137 +diff -durN gcc-4.3.1.orig/libffi/src/powerpc/sysv.S gcc-4.3.1/libffi/src/powerpc/sysv.S
 134.138 +--- gcc-4.3.1.orig/libffi/src/powerpc/sysv.S	2007-12-01 22:00:04.000000000 +0100
 134.139 ++++ gcc-4.3.1/libffi/src/powerpc/sysv.S	2008-06-10 14:58:21.000000000 +0200
 134.140 +@@ -223,3 +223,7 @@
 134.141 +       .align 2
 134.142 + .LEFDE1:
 134.143 + #endif
 134.144 ++
 134.145 ++#if defined __ELF__ && defined __linux__
 134.146 ++	.section	.note.GNU-stack,"",@progbits
 134.147 ++#endif
 134.148 +diff -durN gcc-4.3.1.orig/libffi/src/s390/sysv.S gcc-4.3.1/libffi/src/s390/sysv.S
 134.149 +--- gcc-4.3.1.orig/libffi/src/s390/sysv.S	2003-10-21 21:01:58.000000000 +0200
 134.150 ++++ gcc-4.3.1/libffi/src/s390/sysv.S	2008-06-10 14:58:21.000000000 +0200
 134.151 +@@ -427,3 +427,6 @@
 134.152 + 
 134.153 + #endif
 134.154 + 
 134.155 ++#if defined __ELF__ && defined __linux__
 134.156 ++	.section	.note.GNU-stack,"",@progbits
 134.157 ++#endif
 134.158 +diff -durN gcc-4.3.1.orig/libffi/src/sparc/v8.S gcc-4.3.1/libffi/src/sparc/v8.S
 134.159 +--- gcc-4.3.1.orig/libffi/src/sparc/v8.S	2004-11-22 19:35:16.000000000 +0100
 134.160 ++++ gcc-4.3.1/libffi/src/sparc/v8.S	2008-06-10 14:58:21.000000000 +0200
 134.161 +@@ -265,3 +265,7 @@
 134.162 + 	.byte	0x1f	! uleb128 0x1f
 134.163 + 	.align	WS
 134.164 + .LLEFDE2:
 134.165 ++
 134.166 ++#if defined __ELF__ && defined __linux__
 134.167 ++	.section	.note.GNU-stack,"",@progbits
 134.168 ++#endif
 134.169 +diff -durN gcc-4.3.1.orig/libffi/src/sparc/v9.S gcc-4.3.1/libffi/src/sparc/v9.S
 134.170 +--- gcc-4.3.1.orig/libffi/src/sparc/v9.S	2004-01-25 07:58:33.000000000 +0100
 134.171 ++++ gcc-4.3.1/libffi/src/sparc/v9.S	2008-06-10 14:58:21.000000000 +0200
 134.172 +@@ -300,3 +300,7 @@
 134.173 + 	.align 8
 134.174 + .LLEFDE2:
 134.175 + #endif
 134.176 ++
 134.177 ++#ifdef __linux__
 134.178 ++	.section	.note.GNU-stack,"",@progbits
 134.179 ++#endif
 134.180 +diff -durN gcc-4.3.1.orig/libffi/src/x86/sysv.S gcc-4.3.1/libffi/src/x86/sysv.S
 134.181 +--- gcc-4.3.1.orig/libffi/src/x86/sysv.S	2008-01-30 15:36:58.000000000 +0100
 134.182 ++++ gcc-4.3.1/libffi/src/x86/sysv.S	2008-06-10 14:58:21.000000000 +0200
 134.183 +@@ -430,3 +430,7 @@
 134.184 + #endif
 134.185 + 
 134.186 + #endif /* ifndef __x86_64__ */
 134.187 ++
 134.188 ++#if defined __ELF__ && defined __linux__
 134.189 ++	.section	.note.GNU-stack,"",@progbits
 134.190 ++#endif
 134.191 +diff -durN gcc-4.3.1.orig/libffi/src/x86/unix64.S gcc-4.3.1/libffi/src/x86/unix64.S
 134.192 +--- gcc-4.3.1.orig/libffi/src/x86/unix64.S	2005-05-05 06:06:38.000000000 +0200
 134.193 ++++ gcc-4.3.1/libffi/src/x86/unix64.S	2008-06-10 14:58:21.000000000 +0200
 134.194 +@@ -410,3 +410,7 @@
 134.195 + .LEFDE3:
 134.196 + 
 134.197 + #endif /* __x86_64__ */
 134.198 ++
 134.199 ++#if defined __ELF__ && defined __linux__
 134.200 ++	.section	.note.GNU-stack,"",@progbits
 134.201 ++#endif
   135.1 --- a/patches/gcc/4.3.1/425-gcc43-pr34571.patch	Mon Jul 28 20:17:48 2008 +0000
   135.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   135.3 @@ -1,35 +0,0 @@
   135.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/64_all_gcc43-pr34571.patch
   135.5 -http://gcc.gnu.org/PR34571
   135.6 -
   135.7 -2007-12-26  Rask Ingemann Lambertsen  <rask@sygehus.dk>
   135.8 -
   135.9 -	PR target/34571
  135.10 -	* config/alpha/alpha.c (alpha_cannot_force_const_mem): Use
  135.11 -	symbolic_operand.
  135.12 -	* varasm.c (output_constant_pool_1): Fix typo.
  135.13 -
  135.14 -diff -durN gcc-4.3.1.orig/gcc/config/alpha/alpha.c gcc-4.3.1/gcc/config/alpha/alpha.c
  135.15 ---- gcc-4.3.1.orig/gcc/config/alpha/alpha.c	2008-02-07 18:45:24.000000000 +0100
  135.16 -+++ gcc-4.3.1/gcc/config/alpha/alpha.c	2008-06-10 14:58:24.000000000 +0200
  135.17 -@@ -1113,8 +1113,7 @@
  135.18 - static bool
  135.19 - alpha_cannot_force_const_mem (rtx x)
  135.20 - {
  135.21 --  enum rtx_code code = GET_CODE (x);
  135.22 --  return code == SYMBOL_REF || code == LABEL_REF || code == CONST;
  135.23 -+  return symbolic_operand (x, GET_MODE (x));
  135.24 - }
  135.25 - 
  135.26 - /* We do not allow indirect calls to be optimized into sibling calls, nor
  135.27 -diff -durN gcc-4.3.1.orig/gcc/varasm.c gcc-4.3.1/gcc/varasm.c
  135.28 ---- gcc-4.3.1.orig/gcc/varasm.c	2007-12-05 22:55:10.000000000 +0100
  135.29 -+++ gcc-4.3.1/gcc/varasm.c	2008-06-10 14:58:24.000000000 +0200
  135.30 -@@ -3710,7 +3710,7 @@
  135.31 -       /* FALLTHRU  */
  135.32 - 
  135.33 -     case LABEL_REF:
  135.34 --      tmp = XEXP (x, 0);
  135.35 -+      tmp = XEXP (tmp, 0);
  135.36 -       gcc_assert (!INSN_DELETED_P (tmp));
  135.37 -       gcc_assert (!NOTE_P (tmp)
  135.38 - 		  || NOTE_KIND (tmp) != NOTE_INSN_DELETED);
   136.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   136.2 +++ b/patches/gcc/4.3.1/425-pr34571.patch	Mon Jul 28 21:08:01 2008 +0000
   136.3 @@ -0,0 +1,35 @@
   136.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/64_all_gcc43-pr34571.patch
   136.5 +http://gcc.gnu.org/PR34571
   136.6 +
   136.7 +2007-12-26  Rask Ingemann Lambertsen  <rask@sygehus.dk>
   136.8 +
   136.9 +	PR target/34571
  136.10 +	* config/alpha/alpha.c (alpha_cannot_force_const_mem): Use
  136.11 +	symbolic_operand.
  136.12 +	* varasm.c (output_constant_pool_1): Fix typo.
  136.13 +
  136.14 +diff -durN gcc-4.3.1.orig/gcc/config/alpha/alpha.c gcc-4.3.1/gcc/config/alpha/alpha.c
  136.15 +--- gcc-4.3.1.orig/gcc/config/alpha/alpha.c	2008-02-07 18:45:24.000000000 +0100
  136.16 ++++ gcc-4.3.1/gcc/config/alpha/alpha.c	2008-06-10 14:58:24.000000000 +0200
  136.17 +@@ -1113,8 +1113,7 @@
  136.18 + static bool
  136.19 + alpha_cannot_force_const_mem (rtx x)
  136.20 + {
  136.21 +-  enum rtx_code code = GET_CODE (x);
  136.22 +-  return code == SYMBOL_REF || code == LABEL_REF || code == CONST;
  136.23 ++  return symbolic_operand (x, GET_MODE (x));
  136.24 + }
  136.25 + 
  136.26 + /* We do not allow indirect calls to be optimized into sibling calls, nor
  136.27 +diff -durN gcc-4.3.1.orig/gcc/varasm.c gcc-4.3.1/gcc/varasm.c
  136.28 +--- gcc-4.3.1.orig/gcc/varasm.c	2007-12-05 22:55:10.000000000 +0100
  136.29 ++++ gcc-4.3.1/gcc/varasm.c	2008-06-10 14:58:24.000000000 +0200
  136.30 +@@ -3710,7 +3710,7 @@
  136.31 +       /* FALLTHRU  */
  136.32 + 
  136.33 +     case LABEL_REF:
  136.34 +-      tmp = XEXP (x, 0);
  136.35 ++      tmp = XEXP (tmp, 0);
  136.36 +       gcc_assert (!INSN_DELETED_P (tmp));
  136.37 +       gcc_assert (!NOTE_P (tmp)
  136.38 + 		  || NOTE_KIND (tmp) != NOTE_INSN_DELETED);
   137.1 --- a/patches/gcc/4.3.1/450-gcc43-pr25343.patch	Mon Jul 28 20:17:48 2008 +0000
   137.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   137.3 @@ -1,21 +0,0 @@
   137.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/66_all_gcc43-pr25343.patch
   137.5 -http://gcc.gnu.org/PR25343
   137.6 -
   137.7 -sniped from Debian
   137.8 -
   137.9 -2008-04-27  Roman Zippel <zippel@linux-m68k.org>
  137.10 -
  137.11 -	* config/host-linux.c (TRY_EMPTY_VM_SPACE): Define for __mc68000__.
  137.12 -
  137.13 -diff -durN gcc-4.3.1.orig/gcc/config/host-linux.c gcc-4.3.1/gcc/config/host-linux.c
  137.14 ---- gcc-4.3.1.orig/gcc/config/host-linux.c	2007-08-02 12:49:31.000000000 +0200
  137.15 -+++ gcc-4.3.1/gcc/config/host-linux.c	2008-06-10 14:58:28.000000000 +0200
  137.16 -@@ -84,6 +84,8 @@
  137.17 - # define TRY_EMPTY_VM_SPACE	0x8000000000
  137.18 - #elif defined(__sparc__)
  137.19 - # define TRY_EMPTY_VM_SPACE	0x60000000
  137.20 -+#elif defined(__mc68000__)
  137.21 -+# define TRY_EMPTY_VM_SPACE	0x40000000
  137.22 - #else
  137.23 - # define TRY_EMPTY_VM_SPACE	0
  137.24 - #endif
   138.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   138.2 +++ b/patches/gcc/4.3.1/450-pr25343.patch	Mon Jul 28 21:08:01 2008 +0000
   138.3 @@ -0,0 +1,21 @@
   138.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/66_all_gcc43-pr25343.patch
   138.5 +http://gcc.gnu.org/PR25343
   138.6 +
   138.7 +sniped from Debian
   138.8 +
   138.9 +2008-04-27  Roman Zippel <zippel@linux-m68k.org>
  138.10 +
  138.11 +	* config/host-linux.c (TRY_EMPTY_VM_SPACE): Define for __mc68000__.
  138.12 +
  138.13 +diff -durN gcc-4.3.1.orig/gcc/config/host-linux.c gcc-4.3.1/gcc/config/host-linux.c
  138.14 +--- gcc-4.3.1.orig/gcc/config/host-linux.c	2007-08-02 12:49:31.000000000 +0200
  138.15 ++++ gcc-4.3.1/gcc/config/host-linux.c	2008-06-10 14:58:28.000000000 +0200
  138.16 +@@ -84,6 +84,8 @@
  138.17 + # define TRY_EMPTY_VM_SPACE	0x8000000000
  138.18 + #elif defined(__sparc__)
  138.19 + # define TRY_EMPTY_VM_SPACE	0x60000000
  138.20 ++#elif defined(__mc68000__)
  138.21 ++# define TRY_EMPTY_VM_SPACE	0x40000000
  138.22 + #else
  138.23 + # define TRY_EMPTY_VM_SPACE	0
  138.24 + #endif
   139.1 --- a/patches/gcc/4.3.1/500-103-uclibc-conf-noupstream.patch	Mon Jul 28 20:17:48 2008 +0000
   139.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   139.3 @@ -1,13 +0,0 @@
   139.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_103-uclibc-conf-noupstream.patch
   139.5 -diff -durN gcc-4.3.1.orig/gcc/config.gcc gcc-4.3.1/gcc/config.gcc
   139.6 ---- gcc-4.3.1.orig/gcc/config.gcc	2008-06-10 14:58:09.000000000 +0200
   139.7 -+++ gcc-4.3.1/gcc/config.gcc	2008-06-10 14:58:36.000000000 +0200
   139.8 -@@ -2149,7 +2149,7 @@
   139.9 -         ;;
  139.10 - sh-*-elf* | sh[12346l]*-*-elf* | sh*-*-kaos* | \
  139.11 - sh-*-symbianelf* | sh[12346l]*-*-symbianelf* | \
  139.12 --  sh-*-linux* | sh[346lbe]*-*-linux* | \
  139.13 -+  sh*-*-linux* | sh[346lbe]*-*-linux* | \
  139.14 -   sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
  139.15 -    sh64-*-netbsd* | sh64l*-*-netbsd*)
  139.16 - 	tmake_file="${tmake_file} sh/t-sh sh/t-elf"
   140.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   140.2 +++ b/patches/gcc/4.3.1/500-uclibc-conf-noupstream.patch	Mon Jul 28 21:08:01 2008 +0000
   140.3 @@ -0,0 +1,13 @@
   140.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_103-uclibc-conf-noupstream.patch
   140.5 +diff -durN gcc-4.3.1.orig/gcc/config.gcc gcc-4.3.1/gcc/config.gcc
   140.6 +--- gcc-4.3.1.orig/gcc/config.gcc	2008-06-10 14:58:09.000000000 +0200
   140.7 ++++ gcc-4.3.1/gcc/config.gcc	2008-06-10 14:58:36.000000000 +0200
   140.8 +@@ -2149,7 +2149,7 @@
   140.9 +         ;;
  140.10 + sh-*-elf* | sh[12346l]*-*-elf* | sh*-*-kaos* | \
  140.11 + sh-*-symbianelf* | sh[12346l]*-*-symbianelf* | \
  140.12 +-  sh-*-linux* | sh[346lbe]*-*-linux* | \
  140.13 ++  sh*-*-linux* | sh[346lbe]*-*-linux* | \
  140.14 +   sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
  140.15 +    sh64-*-netbsd* | sh64l*-*-netbsd*)
  140.16 + 	tmake_file="${tmake_file} sh/t-sh sh/t-elf"
   141.1 --- a/patches/gcc/4.3.1/525-200-uclibc-locale.patch	Mon Jul 28 20:17:48 2008 +0000
   141.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   141.3 @@ -1,2794 +0,0 @@
   141.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_200-uclibc-locale.patch
   141.5 -diff -durN gcc-4.3.1.orig/libstdc++-v3/acinclude.m4 gcc-4.3.1/libstdc++-v3/acinclude.m4
   141.6 ---- gcc-4.3.1.orig/libstdc++-v3/acinclude.m4	2008-04-25 18:52:57.000000000 +0200
   141.7 -+++ gcc-4.3.1/libstdc++-v3/acinclude.m4	2008-06-10 14:58:39.000000000 +0200
   141.8 -@@ -1349,7 +1349,7 @@
   141.9 - AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
  141.10 -   GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
  141.11 -     [use MODEL for target locale package],
  141.12 --    [permit generic|gnu|ieee_1003.1-2001|yes|no|auto])
  141.13 -+    [permit generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto])
  141.14 - 
  141.15 -   # Deal with gettext issues.  Default to not using it (=no) until we detect
  141.16 -   # support for it later.  Let the user turn it off via --e/d, but let that
  141.17 -@@ -1370,6 +1370,9 @@
  141.18 -   # Default to "generic".
  141.19 -   if test $enable_clocale_flag = auto; then
  141.20 -     case ${target_os} in
  141.21 -+      *-uclibc*)
  141.22 -+        enable_clocale_flag=uclibc
  141.23 -+        ;;
  141.24 -       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
  141.25 -         enable_clocale_flag=gnu	
  141.26 -         ;;
  141.27 -@@ -1541,6 +1544,40 @@
  141.28 -       CTIME_CC=config/locale/generic/time_members.cc
  141.29 -       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
  141.30 -       ;;
  141.31 -+    uclibc)
  141.32 -+      AC_MSG_RESULT(uclibc)
  141.33 -+
  141.34 -+      # Declare intention to use gettext, and add support for specific
  141.35 -+      # languages.
  141.36 -+      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
  141.37 -+      ALL_LINGUAS="de fr"
  141.38 -+
  141.39 -+      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
  141.40 -+      AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
  141.41 -+      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
  141.42 -+        USE_NLS=yes
  141.43 -+      fi
  141.44 -+      # Export the build objects.
  141.45 -+      for ling in $ALL_LINGUAS; do \
  141.46 -+        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
  141.47 -+        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
  141.48 -+      done
  141.49 -+      AC_SUBST(glibcxx_MOFILES)
  141.50 -+      AC_SUBST(glibcxx_POFILES)
  141.51 -+
  141.52 -+      CLOCALE_H=config/locale/uclibc/c_locale.h
  141.53 -+      CLOCALE_CC=config/locale/uclibc/c_locale.cc
  141.54 -+      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
  141.55 -+      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
  141.56 -+      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
  141.57 -+      CMESSAGES_H=config/locale/uclibc/messages_members.h
  141.58 -+      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
  141.59 -+      CMONEY_CC=config/locale/uclibc/monetary_members.cc
  141.60 -+      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
  141.61 -+      CTIME_H=config/locale/uclibc/time_members.h
  141.62 -+      CTIME_CC=config/locale/uclibc/time_members.cc
  141.63 -+      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
  141.64 -+      ;;
  141.65 -   esac
  141.66 - 
  141.67 -   # This is where the testsuite looks for locale catalogs, using the
  141.68 -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
  141.69 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	1970-01-01 01:00:00.000000000 +0100
  141.70 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2008-06-10 14:58:39.000000000 +0200
  141.71 -@@ -0,0 +1,63 @@
  141.72 -+// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
  141.73 -+
  141.74 -+// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
  141.75 -+//
  141.76 -+// This file is part of the GNU ISO C++ Library.  This library is free
  141.77 -+// software; you can redistribute it and/or modify it under the
  141.78 -+// terms of the GNU General Public License as published by the
  141.79 -+// Free Software Foundation; either version 2, or (at your option)
  141.80 -+// any later version.
  141.81 -+
  141.82 -+// This library is distributed in the hope that it will be useful,
  141.83 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
  141.84 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  141.85 -+// GNU General Public License for more details.
  141.86 -+
  141.87 -+// You should have received a copy of the GNU General Public License along
  141.88 -+// with this library; see the file COPYING.  If not, write to the Free
  141.89 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  141.90 -+// USA.
  141.91 -+
  141.92 -+// As a special exception, you may use this file as part of a free software
  141.93 -+// library without restriction.  Specifically, if other files instantiate
  141.94 -+// templates or use macros or inline functions from this file, or you compile
  141.95 -+// this file and link it with other files to produce an executable, this
  141.96 -+// file does not by itself cause the resulting executable to be covered by
  141.97 -+// the GNU General Public License.  This exception does not however
  141.98 -+// invalidate any other reasons why the executable file might be covered by
  141.99 -+// the GNU General Public License.
 141.100 -+
 141.101 -+// Written by Jakub Jelinek <jakub@redhat.com>
 141.102 -+
 141.103 -+#include <bits/c++config.h>
 141.104 -+#include <clocale>
 141.105 -+
 141.106 -+#ifdef __UCLIBC_MJN3_ONLY__
 141.107 -+#warning clean this up
 141.108 -+#endif
 141.109 -+
 141.110 -+#ifdef __UCLIBC_HAS_XLOCALE__
 141.111 -+                                                  
 141.112 -+extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
 141.113 -+extern "C" __typeof(strcoll_l) __strcoll_l;
 141.114 -+extern "C" __typeof(strftime_l) __strftime_l;
 141.115 -+extern "C" __typeof(strtod_l) __strtod_l;
 141.116 -+extern "C" __typeof(strtof_l) __strtof_l;
 141.117 -+extern "C" __typeof(strtold_l) __strtold_l;
 141.118 -+extern "C" __typeof(strxfrm_l) __strxfrm_l;
 141.119 -+extern "C" __typeof(newlocale) __newlocale;
 141.120 -+extern "C" __typeof(freelocale) __freelocale;
 141.121 -+extern "C" __typeof(duplocale) __duplocale;
 141.122 -+extern "C" __typeof(uselocale) __uselocale;
 141.123 -+
 141.124 -+#ifdef _GLIBCXX_USE_WCHAR_T
 141.125 -+extern "C" __typeof(iswctype_l) __iswctype_l;
 141.126 -+extern "C" __typeof(towlower_l) __towlower_l;
 141.127 -+extern "C" __typeof(towupper_l) __towupper_l;
 141.128 -+extern "C" __typeof(wcscoll_l) __wcscoll_l;
 141.129 -+extern "C" __typeof(wcsftime_l) __wcsftime_l;
 141.130 -+extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
 141.131 -+extern "C" __typeof(wctype_l) __wctype_l;
 141.132 -+#endif 
 141.133 -+
 141.134 -+#endif // GLIBC 2.3 and later
 141.135 -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
 141.136 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc	1970-01-01 01:00:00.000000000 +0100
 141.137 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.cc	2008-06-10 14:58:39.000000000 +0200
 141.138 -@@ -0,0 +1,160 @@
 141.139 -+// Wrapper for underlying C-language localization -*- C++ -*-
 141.140 -+
 141.141 -+// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
 141.142 -+//
 141.143 -+// This file is part of the GNU ISO C++ Library.  This library is free
 141.144 -+// software; you can redistribute it and/or modify it under the
 141.145 -+// terms of the GNU General Public License as published by the
 141.146 -+// Free Software Foundation; either version 2, or (at your option)
 141.147 -+// any later version.
 141.148 -+
 141.149 -+// This library is distributed in the hope that it will be useful,
 141.150 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 141.151 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 141.152 -+// GNU General Public License for more details.
 141.153 -+
 141.154 -+// You should have received a copy of the GNU General Public License along
 141.155 -+// with this library; see the file COPYING.  If not, write to the Free
 141.156 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 141.157 -+// USA.
 141.158 -+
 141.159 -+// As a special exception, you may use this file as part of a free software
 141.160 -+// library without restriction.  Specifically, if other files instantiate
 141.161 -+// templates or use macros or inline functions from this file, or you compile
 141.162 -+// this file and link it with other files to produce an executable, this
 141.163 -+// file does not by itself cause the resulting executable to be covered by
 141.164 -+// the GNU General Public License.  This exception does not however
 141.165 -+// invalidate any other reasons why the executable file might be covered by
 141.166 -+// the GNU General Public License.
 141.167 -+
 141.168 -+//
 141.169 -+// ISO C++ 14882: 22.8  Standard locale categories.
 141.170 -+//
 141.171 -+
 141.172 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 141.173 -+
 141.174 -+#include <cerrno>  // For errno
 141.175 -+#include <locale>
 141.176 -+#include <stdexcept>
 141.177 -+#include <langinfo.h>
 141.178 -+#include <bits/c++locale_internal.h>
 141.179 -+
 141.180 -+#ifndef __UCLIBC_HAS_XLOCALE__
 141.181 -+#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
 141.182 -+#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
 141.183 -+#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
 141.184 -+#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
 141.185 -+#define __strtof_l(S, E, L)         strtof((S), (E))
 141.186 -+#define __strtod_l(S, E, L)         strtod((S), (E))
 141.187 -+#define __strtold_l(S, E, L)        strtold((S), (E))
 141.188 -+#warning should dummy __newlocale check for C|POSIX ?
 141.189 -+#define __newlocale(a, b, c)        NULL
 141.190 -+#define __freelocale(a)             ((void)0)
 141.191 -+#define __duplocale(a)              __c_locale()
 141.192 -+#endif
 141.193 -+
 141.194 -+namespace std 
 141.195 -+{
 141.196 -+  template<>
 141.197 -+    void
 141.198 -+    __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, 
 141.199 -+		   const __c_locale& __cloc)
 141.200 -+    {
 141.201 -+      if (!(__err & ios_base::failbit))
 141.202 -+	{
 141.203 -+	  char* __sanity;
 141.204 -+	  errno = 0;
 141.205 -+	  float __f = __strtof_l(__s, &__sanity, __cloc);
 141.206 -+          if (__sanity != __s && errno != ERANGE)
 141.207 -+	    __v = __f;
 141.208 -+	  else
 141.209 -+	    __err |= ios_base::failbit;
 141.210 -+	}
 141.211 -+    }
 141.212 -+
 141.213 -+  template<>
 141.214 -+    void
 141.215 -+    __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, 
 141.216 -+		   const __c_locale& __cloc)
 141.217 -+    {
 141.218 -+      if (!(__err & ios_base::failbit))
 141.219 -+	{
 141.220 -+	  char* __sanity;
 141.221 -+	  errno = 0;
 141.222 -+	  double __d = __strtod_l(__s, &__sanity, __cloc);
 141.223 -+          if (__sanity != __s && errno != ERANGE)
 141.224 -+	    __v = __d;
 141.225 -+	  else
 141.226 -+	    __err |= ios_base::failbit;
 141.227 -+	}
 141.228 -+    }
 141.229 -+
 141.230 -+  template<>
 141.231 -+    void
 141.232 -+    __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
 141.233 -+		   const __c_locale& __cloc)
 141.234 -+    {
 141.235 -+      if (!(__err & ios_base::failbit))
 141.236 -+	{
 141.237 -+	  char* __sanity;
 141.238 -+	  errno = 0;
 141.239 -+	  long double __ld = __strtold_l(__s, &__sanity, __cloc);
 141.240 -+          if (__sanity != __s && errno != ERANGE)
 141.241 -+	    __v = __ld;
 141.242 -+	  else
 141.243 -+	    __err |= ios_base::failbit;
 141.244 -+	}
 141.245 -+    }
 141.246 -+
 141.247 -+  void
 141.248 -+  locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s, 
 141.249 -+				    __c_locale __old)
 141.250 -+  {
 141.251 -+    __cloc = __newlocale(1 << LC_ALL, __s, __old);
 141.252 -+#ifdef __UCLIBC_HAS_XLOCALE__
 141.253 -+    if (!__cloc)
 141.254 -+      {
 141.255 -+	// This named locale is not supported by the underlying OS.
 141.256 -+	__throw_runtime_error(__N("locale::facet::_S_create_c_locale "
 141.257 -+			      "name not valid"));
 141.258 -+      }
 141.259 -+#endif
 141.260 -+  }
 141.261 -+  
 141.262 -+  void
 141.263 -+  locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
 141.264 -+  {
 141.265 -+    if (_S_get_c_locale() != __cloc)
 141.266 -+      __freelocale(__cloc); 
 141.267 -+  }
 141.268 -+
 141.269 -+  __c_locale
 141.270 -+  locale::facet::_S_clone_c_locale(__c_locale& __cloc)
 141.271 -+  { return __duplocale(__cloc); }
 141.272 -+} // namespace std
 141.273 -+
 141.274 -+namespace __gnu_cxx
 141.275 -+{
 141.276 -+  const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
 141.277 -+    {
 141.278 -+      "LC_CTYPE", 
 141.279 -+      "LC_NUMERIC",
 141.280 -+      "LC_TIME", 
 141.281 -+      "LC_COLLATE", 
 141.282 -+      "LC_MONETARY",
 141.283 -+      "LC_MESSAGES", 
 141.284 -+#if _GLIBCXX_NUM_CATEGORIES != 0
 141.285 -+      "LC_PAPER", 
 141.286 -+      "LC_NAME", 
 141.287 -+      "LC_ADDRESS",
 141.288 -+      "LC_TELEPHONE", 
 141.289 -+      "LC_MEASUREMENT", 
 141.290 -+      "LC_IDENTIFICATION" 
 141.291 -+#endif
 141.292 -+    };
 141.293 -+}
 141.294 -+
 141.295 -+namespace std
 141.296 -+{
 141.297 -+  const char* const* const locale::_S_categories = __gnu_cxx::category_names;
 141.298 -+}  // namespace std
 141.299 -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
 141.300 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h	1970-01-01 01:00:00.000000000 +0100
 141.301 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.h	2008-06-10 14:58:39.000000000 +0200
 141.302 -@@ -0,0 +1,117 @@
 141.303 -+// Wrapper for underlying C-language localization -*- C++ -*-
 141.304 -+
 141.305 -+// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 141.306 -+//
 141.307 -+// This file is part of the GNU ISO C++ Library.  This library is free
 141.308 -+// software; you can redistribute it and/or modify it under the
 141.309 -+// terms of the GNU General Public License as published by the
 141.310 -+// Free Software Foundation; either version 2, or (at your option)
 141.311 -+// any later version.
 141.312 -+
 141.313 -+// This library is distributed in the hope that it will be useful,
 141.314 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 141.315 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 141.316 -+// GNU General Public License for more details.
 141.317 -+
 141.318 -+// You should have received a copy of the GNU General Public License along
 141.319 -+// with this library; see the file COPYING.  If not, write to the Free
 141.320 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 141.321 -+// USA.
 141.322 -+
 141.323 -+// As a special exception, you may use this file as part of a free software
 141.324 -+// library without restriction.  Specifically, if other files instantiate
 141.325 -+// templates or use macros or inline functions from this file, or you compile
 141.326 -+// this file and link it with other files to produce an executable, this
 141.327 -+// file does not by itself cause the resulting executable to be covered by
 141.328 -+// the GNU General Public License.  This exception does not however
 141.329 -+// invalidate any other reasons why the executable file might be covered by
 141.330 -+// the GNU General Public License.
 141.331 -+
 141.332 -+//
 141.333 -+// ISO C++ 14882: 22.8  Standard locale categories.
 141.334 -+//
 141.335 -+
 141.336 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 141.337 -+
 141.338 -+#ifndef _C_LOCALE_H
 141.339 -+#define _C_LOCALE_H 1
 141.340 -+
 141.341 -+#pragma GCC system_header
 141.342 -+
 141.343 -+#include <cstring>              // get std::strlen
 141.344 -+#include <cstdio>               // get std::snprintf or std::sprintf
 141.345 -+#include <clocale>
 141.346 -+#include <langinfo.h>		// For codecvt
 141.347 -+#ifdef __UCLIBC_MJN3_ONLY__
 141.348 -+#warning fix this
 141.349 -+#endif
 141.350 -+#ifdef __UCLIBC_HAS_LOCALE__
 141.351 -+#include <iconv.h>		// For codecvt using iconv, iconv_t
 141.352 -+#endif
 141.353 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 141.354 -+#include <libintl.h> 		// For messages
 141.355 -+#endif
 141.356 -+
 141.357 -+#ifdef __UCLIBC_MJN3_ONLY__
 141.358 -+#warning what is _GLIBCXX_C_LOCALE_GNU for
 141.359 -+#endif
 141.360 -+#define _GLIBCXX_C_LOCALE_GNU 1
 141.361 -+
 141.362 -+#ifdef __UCLIBC_MJN3_ONLY__
 141.363 -+#warning fix categories
 141.364 -+#endif
 141.365 -+// #define _GLIBCXX_NUM_CATEGORIES 6
 141.366 -+#define _GLIBCXX_NUM_CATEGORIES 0
 141.367 -+ 
 141.368 -+#ifdef __UCLIBC_HAS_XLOCALE__
 141.369 -+namespace __gnu_cxx
 141.370 -+{
 141.371 -+  extern "C" __typeof(uselocale) __uselocale;
 141.372 -+}
 141.373 -+#endif
 141.374 -+
 141.375 -+namespace std
 141.376 -+{
 141.377 -+#ifdef __UCLIBC_HAS_XLOCALE__
 141.378 -+  typedef __locale_t		__c_locale;
 141.379 -+#else
 141.380 -+  typedef int*			__c_locale;
 141.381 -+#endif
 141.382 -+
 141.383 -+  // Convert numeric value of type _Tv to string and return length of
 141.384 -+  // string.  If snprintf is available use it, otherwise fall back to
 141.385 -+  // the unsafe sprintf which, in general, can be dangerous and should
 141.386 -+  // be avoided.
 141.387 -+  template<typename _Tv>
 141.388 -+    int
 141.389 -+    __convert_from_v(char* __out, 
 141.390 -+		     const int __size __attribute__ ((__unused__)),
 141.391 -+		     const char* __fmt,
 141.392 -+#ifdef __UCLIBC_HAS_XCLOCALE__
 141.393 -+		     _Tv __v, const __c_locale& __cloc, int __prec)
 141.394 -+    {
 141.395 -+      __c_locale __old = __gnu_cxx::__uselocale(__cloc);
 141.396 -+#else
 141.397 -+		     _Tv __v, const __c_locale&, int __prec)
 141.398 -+    {
 141.399 -+# ifdef __UCLIBC_HAS_LOCALE__
 141.400 -+      char* __old = std::setlocale(LC_ALL, NULL);
 141.401 -+      char* __sav = new char[std::strlen(__old) + 1];
 141.402 -+      std::strcpy(__sav, __old);
 141.403 -+      std::setlocale(LC_ALL, "C");
 141.404 -+# endif
 141.405 -+#endif
 141.406 -+
 141.407 -+      const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
 141.408 -+
 141.409 -+#ifdef __UCLIBC_HAS_XCLOCALE__
 141.410 -+      __gnu_cxx::__uselocale(__old);
 141.411 -+#elif defined __UCLIBC_HAS_LOCALE__
 141.412 -+      std::setlocale(LC_ALL, __sav);
 141.413 -+      delete [] __sav;
 141.414 -+#endif
 141.415 -+      return __ret;
 141.416 -+    }
 141.417 -+}
 141.418 -+
 141.419 -+#endif
 141.420 -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
 141.421 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/codecvt_members.cc	1970-01-01 01:00:00.000000000 +0100
 141.422 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/codecvt_members.cc	2008-06-10 14:58:39.000000000 +0200
 141.423 -@@ -0,0 +1,306 @@
 141.424 -+// std::codecvt implementation details, GNU version -*- C++ -*-
 141.425 -+
 141.426 -+// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
 141.427 -+//
 141.428 -+// This file is part of the GNU ISO C++ Library.  This library is free
 141.429 -+// software; you can redistribute it and/or modify it under the
 141.430 -+// terms of the GNU General Public License as published by the
 141.431 -+// Free Software Foundation; either version 2, or (at your option)
 141.432 -+// any later version.
 141.433 -+
 141.434 -+// This library is distributed in the hope that it will be useful,
 141.435 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 141.436 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 141.437 -+// GNU General Public License for more details.
 141.438 -+
 141.439 -+// You should have received a copy of the GNU General Public License along
 141.440 -+// with this library; see the file COPYING.  If not, write to the Free
 141.441 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 141.442 -+// USA.
 141.443 -+
 141.444 -+// As a special exception, you may use this file as part of a free software
 141.445 -+// library without restriction.  Specifically, if other files instantiate
 141.446 -+// templates or use macros or inline functions from this file, or you compile
 141.447 -+// this file and link it with other files to produce an executable, this
 141.448 -+// file does not by itself cause the resulting executable to be covered by
 141.449 -+// the GNU General Public License.  This exception does not however
 141.450 -+// invalidate any other reasons why the executable file might be covered by
 141.451 -+// the GNU General Public License.
 141.452 -+
 141.453 -+//
 141.454 -+// ISO C++ 14882: 22.2.1.5 - Template class codecvt
 141.455 -+//
 141.456 -+
 141.457 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 141.458 -+
 141.459 -+#include <locale>
 141.460 -+#include <bits/c++locale_internal.h>
 141.461 -+
 141.462 -+namespace std
 141.463 -+{
 141.464 -+  // Specializations.
 141.465 -+#ifdef _GLIBCXX_USE_WCHAR_T
 141.466 -+  codecvt_base::result
 141.467 -+  codecvt<wchar_t, char, mbstate_t>::
 141.468 -+  do_out(state_type& __state, const intern_type* __from, 
 141.469 -+	 const intern_type* __from_end, const intern_type*& __from_next,
 141.470 -+	 extern_type* __to, extern_type* __to_end,
 141.471 -+	 extern_type*& __to_next) const
 141.472 -+  {
 141.473 -+    result __ret = ok;
 141.474 -+    state_type __tmp_state(__state);
 141.475 -+
 141.476 -+#ifdef __UCLIBC_HAS_XLOCALE__
 141.477 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 141.478 -+#endif
 141.479 -+
 141.480 -+    // wcsnrtombs is *very* fast but stops if encounters NUL characters:
 141.481 -+    // in case we fall back to wcrtomb and then continue, in a loop.
 141.482 -+    // NB: wcsnrtombs is a GNU extension
 141.483 -+    for (__from_next = __from, __to_next = __to;
 141.484 -+	 __from_next < __from_end && __to_next < __to_end
 141.485 -+	 && __ret == ok;)
 141.486 -+      {
 141.487 -+	const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
 141.488 -+						      __from_end - __from_next);
 141.489 -+	if (!__from_chunk_end)
 141.490 -+	  __from_chunk_end = __from_end;
 141.491 -+
 141.492 -+	__from = __from_next;
 141.493 -+	const size_t __conv = wcsnrtombs(__to_next, &__from_next,
 141.494 -+					 __from_chunk_end - __from_next,
 141.495 -+					 __to_end - __to_next, &__state);
 141.496 -+	if (__conv == static_cast<size_t>(-1))
 141.497 -+	  {
 141.498 -+	    // In case of error, in order to stop at the exact place we
 141.499 -+	    // have to start again from the beginning with a series of
 141.500 -+	    // wcrtomb.
 141.501 -+	    for (; __from < __from_next; ++__from)
 141.502 -+	      __to_next += wcrtomb(__to_next, *__from, &__tmp_state);
 141.503 -+	    __state = __tmp_state;
 141.504 -+	    __ret = error;
 141.505 -+	  }
 141.506 -+	else if (__from_next && __from_next < __from_chunk_end)
 141.507 -+	  {
 141.508 -+	    __to_next += __conv;
 141.509 -+	    __ret = partial;
 141.510 -+	  }
 141.511 -+	else
 141.512 -+	  {
 141.513 -+	    __from_next = __from_chunk_end;
 141.514 -+	    __to_next += __conv;
 141.515 -+	  }
 141.516 -+
 141.517 -+	if (__from_next < __from_end && __ret == ok)
 141.518 -+	  {
 141.519 -+	    extern_type __buf[MB_LEN_MAX];
 141.520 -+	    __tmp_state = __state;
 141.521 -+	    const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
 141.522 -+	    if (__conv > static_cast<size_t>(__to_end - __to_next))
 141.523 -+	      __ret = partial;
 141.524 -+	    else
 141.525 -+	      {
 141.526 -+		memcpy(__to_next, __buf, __conv);
 141.527 -+		__state = __tmp_state;
 141.528 -+		__to_next += __conv;
 141.529 -+		++__from_next;
 141.530 -+	      }
 141.531 -+	  }
 141.532 -+      }
 141.533 -+
 141.534 -+#ifdef __UCLIBC_HAS_XLOCALE__
 141.535 -+    __uselocale(__old);
 141.536 -+#endif
 141.537 -+
 141.538 -+    return __ret; 
 141.539 -+  }
 141.540 -+  
 141.541 -+  codecvt_base::result
 141.542 -+  codecvt<wchar_t, char, mbstate_t>::
 141.543 -+  do_in(state_type& __state, const extern_type* __from, 
 141.544 -+	const extern_type* __from_end, const extern_type*& __from_next,
 141.545 -+	intern_type* __to, intern_type* __to_end,
 141.546 -+	intern_type*& __to_next) const
 141.547 -+  {
 141.548 -+    result __ret = ok;
 141.549 -+    state_type __tmp_state(__state);
 141.550 -+
 141.551 -+#ifdef __UCLIBC_HAS_XLOCALE__
 141.552 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 141.553 -+#endif
 141.554 -+
 141.555 -+    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
 141.556 -+    // in case we store a L'\0' and then continue, in a loop.
 141.557 -+    // NB: mbsnrtowcs is a GNU extension
 141.558 -+    for (__from_next = __from, __to_next = __to;
 141.559 -+	 __from_next < __from_end && __to_next < __to_end
 141.560 -+	 && __ret == ok;)
 141.561 -+      {
 141.562 -+	const extern_type* __from_chunk_end;
 141.563 -+	__from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
 141.564 -+								  __from_end
 141.565 -+								  - __from_next));
 141.566 -+	if (!__from_chunk_end)
 141.567 -+	  __from_chunk_end = __from_end;
 141.568 -+
 141.569 -+	__from = __from_next;
 141.570 -+	size_t __conv = mbsnrtowcs(__to_next, &__from_next,
 141.571 -+				   __from_chunk_end - __from_next,
 141.572 -+				   __to_end - __to_next, &__state);
 141.573 -+	if (__conv == static_cast<size_t>(-1))
 141.574 -+	  {
 141.575 -+	    // In case of error, in order to stop at the exact place we
 141.576 -+	    // have to start again from the beginning with a series of
 141.577 -+	    // mbrtowc.
 141.578 -+	    for (;; ++__to_next, __from += __conv)
 141.579 -+	      {
 141.580 -+		__conv = mbrtowc(__to_next, __from, __from_end - __from,
 141.581 -+				 &__tmp_state);
 141.582 -+		if (__conv == static_cast<size_t>(-1)
 141.583 -+		    || __conv == static_cast<size_t>(-2))
 141.584 -+		  break;
 141.585 -+	      }
 141.586 -+	    __from_next = __from;
 141.587 -+	    __state = __tmp_state;	    
 141.588 -+	    __ret = error;
 141.589 -+	  }
 141.590 -+	else if (__from_next && __from_next < __from_chunk_end)
 141.591 -+	  {
 141.592 -+	    // It is unclear what to return in this case (see DR 382). 
 141.593 -+	    __to_next += __conv;
 141.594 -+	    __ret = partial;
 141.595 -+	  }
 141.596 -+	else
 141.597 -+	  {
 141.598 -+	    __from_next = __from_chunk_end;
 141.599 -+	    __to_next += __conv;
 141.600 -+	  }
 141.601 -+
 141.602 -+	if (__from_next < __from_end && __ret == ok)
 141.603 -+	  {
 141.604 -+	    if (__to_next < __to_end)
 141.605 -+	      {
 141.606 -+		// XXX Probably wrong for stateful encodings
 141.607 -+		__tmp_state = __state;		
 141.608 -+		++__from_next;
 141.609 -+		*__to_next++ = L'\0';
 141.610 -+	      }
 141.611 -+	    else
 141.612 -+	      __ret = partial;
 141.613 -+	  }
 141.614 -+      }
 141.615 -+
 141.616 -+#ifdef __UCLIBC_HAS_XLOCALE__
 141.617 -+    __uselocale(__old);
 141.618 -+#endif
 141.619 -+
 141.620 -+    return __ret; 
 141.621 -+  }
 141.622 -+
 141.623 -+  int 
 141.624 -+  codecvt<wchar_t, char, mbstate_t>::
 141.625 -+  do_encoding() const throw()
 141.626 -+  {
 141.627 -+    // XXX This implementation assumes that the encoding is
 141.628 -+    // stateless and is either single-byte or variable-width.
 141.629 -+    int __ret = 0;
 141.630 -+#ifdef __UCLIBC_HAS_XLOCALE__
 141.631 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 141.632 -+#endif
 141.633 -+    if (MB_CUR_MAX == 1)
 141.634 -+      __ret = 1;
 141.635 -+#ifdef __UCLIBC_HAS_XLOCALE__
 141.636 -+    __uselocale(__old);
 141.637 -+#endif
 141.638 -+    return __ret;
 141.639 -+  }  
 141.640 -+
 141.641 -+  int 
 141.642 -+  codecvt<wchar_t, char, mbstate_t>::
 141.643 -+  do_max_length() const throw()
 141.644 -+  {
 141.645 -+#ifdef __UCLIBC_HAS_XLOCALE__
 141.646 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 141.647 -+#endif
 141.648 -+    // XXX Probably wrong for stateful encodings.
 141.649 -+    int __ret = MB_CUR_MAX;
 141.650 -+#ifdef __UCLIBC_HAS_XLOCALE__
 141.651 -+    __uselocale(__old);
 141.652 -+#endif
 141.653 -+    return __ret;
 141.654 -+  }
 141.655 -+  
 141.656 -+  int 
 141.657 -+  codecvt<wchar_t, char, mbstate_t>::
 141.658 -+  do_length(state_type& __state, const extern_type* __from,
 141.659 -+	    const extern_type* __end, size_t __max) const
 141.660 -+  {
 141.661 -+    int __ret = 0;
 141.662 -+    state_type __tmp_state(__state);
 141.663 -+
 141.664 -+#ifdef __UCLIBC_HAS_XLOCALE__
 141.665 -+    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 141.666 -+#endif
 141.667 -+
 141.668 -+    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
 141.669 -+    // in case we advance past it and then continue, in a loop.
 141.670 -+    // NB: mbsnrtowcs is a GNU extension
 141.671 -+  
 141.672 -+    // A dummy internal buffer is needed in order for mbsnrtocws to consider
 141.673 -+    // its fourth parameter (it wouldn't with NULL as first parameter).
 141.674 -+    wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t) 
 141.675 -+							   * __max));
 141.676 -+    while (__from < __end && __max)
 141.677 -+      {
 141.678 -+	const extern_type* __from_chunk_end;
 141.679 -+	__from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
 141.680 -+								  __end
 141.681 -+								  - __from));
 141.682 -+	if (!__from_chunk_end)
 141.683 -+	  __from_chunk_end = __end;
 141.684 -+
 141.685 -+	const extern_type* __tmp_from = __from;
 141.686 -+	size_t __conv = mbsnrtowcs(__to, &__from,
 141.687 -+				   __from_chunk_end - __from,
 141.688 -+				   __max, &__state);
 141.689 -+	if (__conv == static_cast<size_t>(-1))
 141.690 -+	  {
 141.691 -+	    // In case of error, in order to stop at the exact place we
 141.692 -+	    // have to start again from the beginning with a series of
 141.693 -+	    // mbrtowc.
 141.694 -+	    for (__from = __tmp_from;; __from += __conv)
 141.695 -+	      {
 141.696 -+		__conv = mbrtowc(NULL, __from, __end - __from,
 141.697 -+				 &__tmp_state);
 141.698 -+		if (__conv == static_cast<size_t>(-1)
 141.699 -+		    || __conv == static_cast<size_t>(-2))
 141.700 -+		  break;
 141.701 -+	      }
 141.702 -+	    __state = __tmp_state;
 141.703 -+	    __ret += __from - __tmp_from;
 141.704 -+	    break;
 141.705 -+	  }
 141.706 -+	if (!__from)
 141.707 -+	  __from = __from_chunk_end;
 141.708 -+	
 141.709 -+	__ret += __from - __tmp_from;
 141.710 -+	__max -= __conv;
 141.711 -+
 141.712 -+	if (__from < __end && __max)
 141.713 -+	  {
 141.714 -+	    // XXX Probably wrong for stateful encodings
 141.715 -+	    __tmp_state = __state;
 141.716 -+	    ++__from;
 141.717 -+	    ++__ret;
 141.718 -+	    --__max;
 141.719 -+	  }
 141.720 -+      }
 141.721 -+
 141.722 -+#ifdef __UCLIBC_HAS_XLOCALE__
 141.723 -+    __uselocale(__old);
 141.724 -+#endif
 141.725 -+
 141.726 -+    return __ret; 
 141.727 -+  }
 141.728 -+#endif
 141.729 -+}
 141.730 -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
 141.731 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc	1970-01-01 01:00:00.000000000 +0100
 141.732 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/collate_members.cc	2008-06-10 14:58:39.000000000 +0200
 141.733 -@@ -0,0 +1,80 @@
 141.734 -+// std::collate implementation details, GNU version -*- C++ -*-
 141.735 -+
 141.736 -+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
 141.737 -+//
 141.738 -+// This file is part of the GNU ISO C++ Library.  This library is free
 141.739 -+// software; you can redistribute it and/or modify it under the
 141.740 -+// terms of the GNU General Public License as published by the
 141.741 -+// Free Software Foundation; either version 2, or (at your option)
 141.742 -+// any later version.
 141.743 -+
 141.744 -+// This library is distributed in the hope that it will be useful,
 141.745 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 141.746 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 141.747 -+// GNU General Public License for more details.
 141.748 -+
 141.749 -+// You should have received a copy of the GNU General Public License along
 141.750 -+// with this library; see the file COPYING.  If not, write to the Free
 141.751 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 141.752 -+// USA.
 141.753 -+
 141.754 -+// As a special exception, you may use this file as part of a free software
 141.755 -+// library without restriction.  Specifically, if other files instantiate
 141.756 -+// templates or use macros or inline functions from this file, or you compile
 141.757 -+// this file and link it with other files to produce an executable, this
 141.758 -+// file does not by itself cause the resulting executable to be covered by
 141.759 -+// the GNU General Public License.  This exception does not however
 141.760 -+// invalidate any other reasons why the executable file might be covered by
 141.761 -+// the GNU General Public License.
 141.762 -+
 141.763 -+//
 141.764 -+// ISO C++ 14882: 22.2.4.1.2  collate virtual functions
 141.765 -+//
 141.766 -+
 141.767 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 141.768 -+
 141.769 -+#include <locale>
 141.770 -+#include <bits/c++locale_internal.h>
 141.771 -+
 141.772 -+#ifndef __UCLIBC_HAS_XLOCALE__
 141.773 -+#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
 141.774 -+#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
 141.775 -+#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
 141.776 -+#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
 141.777 -+#endif
 141.778 -+
 141.779 -+namespace std
 141.780 -+{
 141.781 -+  // These are basically extensions to char_traits, and perhaps should
 141.782 -+  // be put there instead of here.
 141.783 -+  template<>
 141.784 -+    int 
 141.785 -+    collate<char>::_M_compare(const char* __one, const char* __two) const
 141.786 -+    { 
 141.787 -+      int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
 141.788 -+      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
 141.789 -+    }
 141.790 -+  
 141.791 -+  template<>
 141.792 -+    size_t
 141.793 -+    collate<char>::_M_transform(char* __to, const char* __from, 
 141.794 -+				size_t __n) const 
 141.795 -+    { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
 141.796 -+
 141.797 -+#ifdef _GLIBCXX_USE_WCHAR_T
 141.798 -+  template<>
 141.799 -+    int 
 141.800 -+    collate<wchar_t>::_M_compare(const wchar_t* __one, 
 141.801 -+				 const wchar_t* __two) const
 141.802 -+    {
 141.803 -+      int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
 141.804 -+      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
 141.805 -+    }
 141.806 -+  
 141.807 -+  template<>
 141.808 -+    size_t
 141.809 -+    collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
 141.810 -+				   size_t __n) const
 141.811 -+    { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
 141.812 -+#endif
 141.813 -+}
 141.814 -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
 141.815 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc	1970-01-01 01:00:00.000000000 +0100
 141.816 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2008-06-10 14:58:39.000000000 +0200
 141.817 -@@ -0,0 +1,300 @@
 141.818 -+// std::ctype implementation details, GNU version -*- C++ -*-
 141.819 -+
 141.820 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 141.821 -+//
 141.822 -+// This file is part of the GNU ISO C++ Library.  This library is free
 141.823 -+// software; you can redistribute it and/or modify it under the
 141.824 -+// terms of the GNU General Public License as published by the
 141.825 -+// Free Software Foundation; either version 2, or (at your option)
 141.826 -+// any later version.
 141.827 -+
 141.828 -+// This library is distributed in the hope that it will be useful,
 141.829 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
 141.830 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 141.831 -+// GNU General Public License for more details.
 141.832 -+
 141.833 -+// You should have received a copy of the GNU General Public License along
 141.834 -+// with this library; see the file COPYING.  If not, write to the Free
 141.835 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 141.836 -+// USA.
 141.837 -+
 141.838 -+// As a special exception, you may use this file as part of a free software
 141.839 -+// library without restriction.  Specifically, if other files instantiate
 141.840 -+// templates or use macros or inline functions from this file, or you compile
 141.841 -+// this file and link it with other files to produce an executable, this
 141.842 -+// file does not by itself cause the resulting executable to be covered by
 141.843 -+// the GNU General Public License.  This exception does not however
 141.844 -+// invalidate any other reasons why the executable file might be covered by
 141.845 -+// the GNU General Public License.
 141.846 -+
 141.847 -+//
 141.848 -+// ISO C++ 14882: 22.2.1.1.2  ctype virtual functions.
 141.849 -+//
 141.850 -+
 141.851 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
 141.852 -+
 141.853 -+#define _LIBC
 141.854 -+#include <locale>
 141.855 -+#undef _LIBC
 141.856 -+#include <bits/c++locale_internal.h>
 141.857 -+
 141.858 -+#ifndef __UCLIBC_HAS_XLOCALE__
 141.859 -+#define __wctype_l(S, L)           wctype((S))
 141.860 -+#define __towupper_l(C, L)         towupper((C))
 141.861 -+#define __towlower_l(C, L)         towlower((C))
 141.862 -+#define __iswctype_l(C, M, L)      iswctype((C), (M))
 141.863 -+#endif
 141.864 -+
 141.865 -+namespace std
 141.866 -+{
 141.867 -+  // NB: The other ctype<char> specializations are in src/locale.cc and
 141.868 -+  // various /config/os/* files.
 141.869 -+  template<>
 141.870 -+    ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
 141.871 -+    : ctype<char>(0, false, __refs) 
 141.872 -+    { 		
 141.873 -+      if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
 141.874 -+	{
 141.875 -+	  this->_S_destroy_c_locale(this->_M_c_locale_ctype);
 141.876 -+	  this->_S_create_c_locale(this->_M_c_locale_ctype, __s); 
 141.877 -+#ifdef __UCLIBC_HAS_XLOCALE__
 141.878 -+	  this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
 141.879 -+	  this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
 141.880 -+	  this->_M_table = this->_M_c_locale_ctype->__ctype_b;
 141.881 -+#endif
 141.882 -+	}
 141.883 -+    }
 141.884 -+
 141.885 -+#ifdef _GLIBCXX_USE_WCHAR_T  
 141.886 -+  ctype<wchar_t>::__wmask_type
 141.887 -+  ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
 141.888 -+  {
 141.889 -+    __wmask_type __ret;
 141.890 -+    switch (__m)
 141.891 -+      {
 141.892 -+      case space:
 141.893 -+	__ret = __wctype_l("space", _M_c_locale_ctype);
 141.894 -+	break;
 141.895 -+      case print:
 141.896 -+	__ret = __wctype_l("print", _M_c_locale_ctype);
 141.897 -+	break;
 141.898 -+      case cntrl:
 141.899 -+	__ret = __wctype_l("cntrl", _M_c_locale_ctype);
 141.900 -+	break;
 141.901 -+      case upper:
 141.902 -+	__ret = __wctype_l("upper", _M_c_locale_ctype);
 141.903 -+	break;
 141.904 -+      case lower:
 141.905 -+	__ret = __wctype_l("lower", _M_c_locale_ctype);
 141.906 -+	break;
 141.907 -+      case alpha:
 141.908 -+	__ret = __wctype_l("alpha", _M_c_locale_ctype);
 141.909 -+	break;
 141.910 -+      case digit:
 141.911 -+	__ret = __wctype_l("digit", _M_c_locale_ctype);
 141.912 -+	break;
 141.913 -+      case punct:
 141.914 -+	__ret = __wctype_l("punct", _M_c_locale_ctype);
 141.915 -+	break;
 141.916 -+      case xdigit:
 141.917 -+	__ret = __wctype_l("xdigit", _M_c_locale_ctype);
 141.918 -+	break;
 141.919 -+      case alnum:
 141.920 -+	__ret = __wctype_l("alnum", _M_c_locale_ctype);
 141.921 -+	break;
 141.922 -+      case graph:
 141.923 -+	__ret = __wctype_l("graph", _M_c_locale_ctype);
 141.924 -+	break;
 141.925 -+      default:
 141.926 -+	__ret = __wmask_type();
 141.927 -+      }
 141.928 -+    return __ret;
 141.929 -+  }
 141.930 -+  
 141.931 -+  wchar_t
 141.932 -+  ctype<wchar_t>::do_toupper(wchar_t __c) const
 141.933 -+  { return __towupper_l(__c, _M_c_locale_ctype); }
 141.934 -+
 141.935 -+  const wchar_t*
 141.936 -+  ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
 141.937 -+  {
 141.938 -+    while (__lo < __hi)
 141.939 -+      {
 141.940 -+        *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
 141.941 -+        ++__lo;
 141.942 -+      }
 141.943 -+    return __hi;
 141.944 -+  }
 141.945 -+  
 141.946 -+  wchar_t
 141.947 -+  ctype<wchar_t>::do_tolower(wchar_t __c) const
 141.948 -+  { return __towlower_l(__c, _M_c_locale_ctype); }
 141.949 -+  
 141.950 -+  const wchar_t*
 141.951 -+  ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
 141.952 -+  {
 141.953 -+    while (__lo < __hi)
 141.954 -+      {
 141.955 -+        *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
 141.956 -+        ++__lo;
 141.957 -+      }
 141.958 -+    return __hi;
 141.959 -+  }
 141.960 -+
 141.961 -+  bool
 141.962 -+  ctype<wchar_t>::
 141.963 -+  do_is(mask __m, wchar_t __c) const
 141.964 -+  { 
 141.965 -+    // Highest bitmask in ctype_base == 10, but extra in "C"
 141.966 -+    // library for blank.
 141.967 -+    bool __ret = false;
 141.968 -+    const size_t __bitmasksize = 11; 
 141.969 -+    for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 141.970 -+      if (__m & _M_bit[__bitcur]
 141.971 -+	  && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 141.972 -+	{
 141.973 -+	  __ret = true;
 141.974 -+	  break;
 141.975 -+	}
 141.976 -+    return __ret;    
 141.977 -+  }
 141.978 -+  
 141.979 -+  const wchar_t* 
 141.980 -+  ctype<wchar_t>::
 141.981 -+  do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
 141.982 -+  {
 141.983 -+    for (; __lo < __hi; ++__vec, ++__lo)
 141.984 -+      {
 141.985 -+	// Highest bitmask in ctype_base == 10, but extra in "C"
 141.986 -+	// library for blank.
 141.987 -+	const size_t __bitmasksize = 11; 
 141.988 -+	mask __m = 0;
 141.989 -+	for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 141.990 -+	  if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
 141.991 -+	    __m |= _M_bit[__bitcur];
 141.992 -+	*__vec = __m;
 141.993 -+      }
 141.994 -+    return __hi;
 141.995 -+  }
 141.996 -+  
 141.997 -+  const wchar_t* 
 141.998 -+  ctype<wchar_t>::
 141.999 -+  do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
141.1000 -+  {
141.1001 -+    while (__lo < __hi && !this->do_is(__m, *__lo))
141.1002 -+      ++__lo;
141.1003 -+    return __lo;
141.1004 -+  }
141.1005 -+
141.1006 -+  const wchar_t*
141.1007 -+  ctype<wchar_t>::
141.1008 -+  do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
141.1009 -+  {
141.1010 -+    while (__lo < __hi && this->do_is(__m, *__lo) != 0)
141.1011 -+      ++__lo;
141.1012 -+    return __lo;
141.1013 -+  }
141.1014 -+
141.1015 -+  wchar_t
141.1016 -+  ctype<wchar_t>::
141.1017 -+  do_widen(char __c) const
141.1018 -+  { return _M_widen[static_cast<unsigned char>(__c)]; }
141.1019 -+
141.1020 -+  const char* 
141.1021 -+  ctype<wchar_t>::
141.1022 -+  do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
141.1023 -+  {
141.1024 -+    while (__lo < __hi)
141.1025 -+      {
141.1026 -+	*__dest = _M_widen[static_cast<unsigned char>(*__lo)];
141.1027 -+	++__lo;
141.1028 -+	++__dest;
141.1029 -+      }
141.1030 -+    return __hi;
141.1031 -+  }
141.1032 -+
141.1033 -+  char
141.1034 -+  ctype<wchar_t>::
141.1035 -+  do_narrow(wchar_t __wc, char __dfault) const
141.1036 -+  {
141.1037 -+    if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
141.1038 -+      return _M_narrow[__wc];
141.1039 -+#ifdef __UCLIBC_HAS_XLOCALE__
141.1040 -+    __c_locale __old = __uselocale(_M_c_locale_ctype);
141.1041 -+#endif
141.1042 -+    const int __c = wctob(__wc);
141.1043 -+#ifdef __UCLIBC_HAS_XLOCALE__
141.1044 -+    __uselocale(__old);
141.1045 -+#endif
141.1046 -+    return (__c == EOF ? __dfault : static_cast<char>(__c)); 
141.1047 -+  }
141.1048 -+
141.1049 -+  const wchar_t*
141.1050 -+  ctype<wchar_t>::
141.1051 -+  do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault, 
141.1052 -+	    char* __dest) const
141.1053 -+  {
141.1054 -+#ifdef __UCLIBC_HAS_XLOCALE__
141.1055 -+    __c_locale __old = __uselocale(_M_c_locale_ctype);
141.1056 -+#endif
141.1057 -+    if (_M_narrow_ok)
141.1058 -+      while (__lo < __hi)
141.1059 -+	{
141.1060 -+	  if (*__lo >= 0 && *__lo < 128)
141.1061 -+	    *__dest = _M_narrow[*__lo];
141.1062 -+	  else
141.1063 -+	    {
141.1064 -+	      const int __c = wctob(*__lo);
141.1065 -+	      *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
141.1066 -+	    }
141.1067 -+	  ++__lo;
141.1068 -+	  ++__dest;
141.1069 -+	}
141.1070 -+    else
141.1071 -+      while (__lo < __hi)
141.1072 -+	{
141.1073 -+	  const int __c = wctob(*__lo);
141.1074 -+	  *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
141.1075 -+	  ++__lo;
141.1076 -+	  ++__dest;
141.1077 -+	}
141.1078 -+#ifdef __UCLIBC_HAS_XLOCALE__
141.1079 -+    __uselocale(__old);
141.1080 -+#endif
141.1081 -+    return __hi;
141.1082 -+  }
141.1083 -+
141.1084 -+  void
141.1085 -+  ctype<wchar_t>::_M_initialize_ctype()
141.1086 -+  {
141.1087 -+#ifdef __UCLIBC_HAS_XLOCALE__
141.1088 -+    __c_locale __old = __uselocale(_M_c_locale_ctype);
141.1089 -+#endif
141.1090 -+    wint_t __i;
141.1091 -+    for (__i = 0; __i < 128; ++__i)
141.1092 -+      {
141.1093 -+	const int __c = wctob(__i);
141.1094 -+	if (__c == EOF)
141.1095 -+	  break;
141.1096 -+	else
141.1097 -+	  _M_narrow[__i] = static_cast<char>(__c);
141.1098 -+      }
141.1099 -+    if (__i == 128)
141.1100 -+      _M_narrow_ok = true;
141.1101 -+    else
141.1102 -+      _M_narrow_ok = false;
141.1103 -+    for (size_t __j = 0;
141.1104 -+	 __j < sizeof(_M_widen) / sizeof(wint_t); ++__j)
141.1105 -+      _M_widen[__j] = btowc(__j);
141.1106 -+
141.1107 -+    for (size_t __k = 0; __k <= 11; ++__k)
141.1108 -+      { 
141.1109 -+	_M_bit[__k] = static_cast<mask>(_ISbit(__k));
141.1110 -+	_M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
141.1111 -+      }
141.1112 -+#ifdef __UCLIBC_HAS_XLOCALE__
141.1113 -+    __uselocale(__old);
141.1114 -+#endif
141.1115 -+  }
141.1116 -+#endif //  _GLIBCXX_USE_WCHAR_T
141.1117 -+}
141.1118 -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
141.1119 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc	1970-01-01 01:00:00.000000000 +0100
141.1120 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.cc	2008-06-10 14:58:39.000000000 +0200
141.1121 -@@ -0,0 +1,100 @@
141.1122 -+// std::messages implementation details, GNU version -*- C++ -*-
141.1123 -+
141.1124 -+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
141.1125 -+//
141.1126 -+// This file is part of the GNU ISO C++ Library.  This library is free
141.1127 -+// software; you can redistribute it and/or modify it under the
141.1128 -+// terms of the GNU General Public License as published by the
141.1129 -+// Free Software Foundation; either version 2, or (at your option)
141.1130 -+// any later version.
141.1131 -+
141.1132 -+// This library is distributed in the hope that it will be useful,
141.1133 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
141.1134 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
141.1135 -+// GNU General Public License for more details.
141.1136 -+
141.1137 -+// You should have received a copy of the GNU General Public License along
141.1138 -+// with this library; see the file COPYING.  If not, write to the Free
141.1139 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
141.1140 -+// USA.
141.1141 -+
141.1142 -+// As a special exception, you may use this file as part of a free software
141.1143 -+// library without restriction.  Specifically, if other files instantiate
141.1144 -+// templates or use macros or inline functions from this file, or you compile
141.1145 -+// this file and link it with other files to produce an executable, this
141.1146 -+// file does not by itself cause the resulting executable to be covered by
141.1147 -+// the GNU General Public License.  This exception does not however
141.1148 -+// invalidate any other reasons why the executable file might be covered by
141.1149 -+// the GNU General Public License.
141.1150 -+
141.1151 -+//
141.1152 -+// ISO C++ 14882: 22.2.7.1.2  messages virtual functions
141.1153 -+//
141.1154 -+
141.1155 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
141.1156 -+
141.1157 -+#include <locale>
141.1158 -+#include <bits/c++locale_internal.h>
141.1159 -+
141.1160 -+#ifdef __UCLIBC_MJN3_ONLY__
141.1161 -+#warning fix gettext stuff
141.1162 -+#endif
141.1163 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
141.1164 -+extern "C" char *__dcgettext(const char *domainname,
141.1165 -+			     const char *msgid, int category);
141.1166 -+#undef gettext
141.1167 -+#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
141.1168 -+#else
141.1169 -+#undef gettext
141.1170 -+#define gettext(msgid) (msgid)
141.1171 -+#endif
141.1172 -+
141.1173 -+namespace std
141.1174 -+{
141.1175 -+  // Specializations.
141.1176 -+  template<>
141.1177 -+    string
141.1178 -+    messages<char>::do_get(catalog, int, int, const string& __dfault) const
141.1179 -+    {
141.1180 -+#ifdef __UCLIBC_HAS_XLOCALE__
141.1181 -+      __c_locale __old = __uselocale(_M_c_locale_messages);
141.1182 -+      const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
141.1183 -+      __uselocale(__old);
141.1184 -+      return string(__msg);
141.1185 -+#elif defined __UCLIBC_HAS_LOCALE__
141.1186 -+      char* __old = strdup(setlocale(LC_ALL, NULL));
141.1187 -+      setlocale(LC_ALL, _M_name_messages);
141.1188 -+      const char* __msg = gettext(__dfault.c_str());
141.1189 -+      setlocale(LC_ALL, __old);
141.1190 -+      free(__old);
141.1191 -+      return string(__msg);
141.1192 -+#else
141.1193 -+      const char* __msg = gettext(__dfault.c_str());
141.1194 -+      return string(__msg);
141.1195 -+#endif
141.1196 -+    }
141.1197 -+
141.1198 -+#ifdef _GLIBCXX_USE_WCHAR_T
141.1199 -+  template<>
141.1200 -+    wstring
141.1201 -+    messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
141.1202 -+    {
141.1203 -+# ifdef __UCLIBC_HAS_XLOCALE__
141.1204 -+      __c_locale __old = __uselocale(_M_c_locale_messages);
141.1205 -+      char* __msg = gettext(_M_convert_to_char(__dfault));
141.1206 -+      __uselocale(__old);
141.1207 -+      return _M_convert_from_char(__msg);
141.1208 -+# elif defined __UCLIBC_HAS_LOCALE__
141.1209 -+      char* __old = strdup(setlocale(LC_ALL, NULL));
141.1210 -+      setlocale(LC_ALL, _M_name_messages);
141.1211 -+      char* __msg = gettext(_M_convert_to_char(__dfault));
141.1212 -+      setlocale(LC_ALL, __old);
141.1213 -+      free(__old);
141.1214 -+      return _M_convert_from_char(__msg);
141.1215 -+# else
141.1216 -+      char* __msg = gettext(_M_convert_to_char(__dfault));
141.1217 -+      return _M_convert_from_char(__msg);
141.1218 -+# endif
141.1219 -+    }
141.1220 -+#endif
141.1221 -+}
141.1222 -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
141.1223 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	1970-01-01 01:00:00.000000000 +0100
141.1224 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:58:39.000000000 +0200
141.1225 -@@ -0,0 +1,118 @@
141.1226 -+// std::messages implementation details, GNU version -*- C++ -*-
141.1227 -+
141.1228 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
141.1229 -+//
141.1230 -+// This file is part of the GNU ISO C++ Library.  This library is free
141.1231 -+// software; you can redistribute it and/or modify it under the
141.1232 -+// terms of the GNU General Public License as published by the
141.1233 -+// Free Software Foundation; either version 2, or (at your option)
141.1234 -+// any later version.
141.1235 -+
141.1236 -+// This library is distributed in the hope that it will be useful,
141.1237 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
141.1238 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
141.1239 -+// GNU General Public License for more details.
141.1240 -+
141.1241 -+// You should have received a copy of the GNU General Public License along
141.1242 -+// with this library; see the file COPYING.  If not, write to the Free
141.1243 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
141.1244 -+// USA.
141.1245 -+
141.1246 -+// As a special exception, you may use this file as part of a free software
141.1247 -+// library without restriction.  Specifically, if other files instantiate
141.1248 -+// templates or use macros or inline functions from this file, or you compile
141.1249 -+// this file and link it with other files to produce an executable, this
141.1250 -+// file does not by itself cause the resulting executable to be covered by
141.1251 -+// the GNU General Public License.  This exception does not however
141.1252 -+// invalidate any other reasons why the executable file might be covered by
141.1253 -+// the GNU General Public License.
141.1254 -+
141.1255 -+//
141.1256 -+// ISO C++ 14882: 22.2.7.1.2  messages functions
141.1257 -+//
141.1258 -+
141.1259 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
141.1260 -+
141.1261 -+#ifdef __UCLIBC_MJN3_ONLY__
141.1262 -+#warning fix prototypes for *textdomain funcs
141.1263 -+#endif
141.1264 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
141.1265 -+extern "C" char *__textdomain(const char *domainname);
141.1266 -+extern "C" char *__bindtextdomain(const char *domainname,
141.1267 -+				  const char *dirname);
141.1268 -+#else
141.1269 -+#undef __textdomain
141.1270 -+#undef __bindtextdomain
141.1271 -+#define __textdomain(D)           ((void)0)
141.1272 -+#define __bindtextdomain(D,P)     ((void)0)
141.1273 -+#endif
141.1274 -+
141.1275 -+  // Non-virtual member functions.
141.1276 -+  template<typename _CharT>
141.1277 -+     messages<_CharT>::messages(size_t __refs)
141.1278 -+     : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), 
141.1279 -+     _M_name_messages(_S_get_c_name())
141.1280 -+     { }
141.1281 -+
141.1282 -+  template<typename _CharT>
141.1283 -+     messages<_CharT>::messages(__c_locale __cloc, const char* __s, 
141.1284 -+				size_t __refs) 
141.1285 -+     : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
141.1286 -+     _M_name_messages(__s)
141.1287 -+     {
141.1288 -+       char* __tmp = new char[std::strlen(__s) + 1];
141.1289 -+       std::strcpy(__tmp, __s);
141.1290 -+       _M_name_messages = __tmp;
141.1291 -+     }
141.1292 -+
141.1293 -+  template<typename _CharT>
141.1294 -+    typename messages<_CharT>::catalog 
141.1295 -+    messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, 
141.1296 -+			   const char* __dir) const
141.1297 -+    { 
141.1298 -+      __bindtextdomain(__s.c_str(), __dir);
141.1299 -+      return this->do_open(__s, __loc); 
141.1300 -+    }
141.1301 -+
141.1302 -+  // Virtual member functions.
141.1303 -+  template<typename _CharT>
141.1304 -+    messages<_CharT>::~messages()
141.1305 -+    { 
141.1306 -+      if (_M_name_messages != _S_get_c_name())
141.1307 -+	delete [] _M_name_messages;
141.1308 -+      _S_destroy_c_locale(_M_c_locale_messages); 
141.1309 -+    }
141.1310 -+
141.1311 -+  template<typename _CharT>
141.1312 -+    typename messages<_CharT>::catalog 
141.1313 -+    messages<_CharT>::do_open(const basic_string<char>& __s, 
141.1314 -+			      const locale&) const
141.1315 -+    { 
141.1316 -+      // No error checking is done, assume the catalog exists and can
141.1317 -+      // be used.
141.1318 -+      __textdomain(__s.c_str());
141.1319 -+      return 0;
141.1320 -+    }
141.1321 -+
141.1322 -+  template<typename _CharT>
141.1323 -+    void    
141.1324 -+    messages<_CharT>::do_close(catalog) const 
141.1325 -+    { }
141.1326 -+
141.1327 -+   // messages_byname
141.1328 -+   template<typename _CharT>
141.1329 -+     messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
141.1330 -+     : messages<_CharT>(__refs) 
141.1331 -+     { 
141.1332 -+       if (this->_M_name_messages != locale::facet::_S_get_c_name())
141.1333 -+	 delete [] this->_M_name_messages;
141.1334 -+       char* __tmp = new char[std::strlen(__s) + 1];
141.1335 -+       std::strcpy(__tmp, __s);
141.1336 -+       this->_M_name_messages = __tmp;
141.1337 -+
141.1338 -+       if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
141.1339 -+	 {
141.1340 -+	   this->_S_destroy_c_locale(this->_M_c_locale_messages);
141.1341 -+	   this->_S_create_c_locale(this->_M_c_locale_messages, __s); 
141.1342 -+	 }
141.1343 -+     }
141.1344 -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
141.1345 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	1970-01-01 01:00:00.000000000 +0100
141.1346 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:58:39.000000000 +0200
141.1347 -@@ -0,0 +1,692 @@
141.1348 -+// std::moneypunct implementation details, GNU version -*- C++ -*-
141.1349 -+
141.1350 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
141.1351 -+//
141.1352 -+// This file is part of the GNU ISO C++ Library.  This library is free
141.1353 -+// software; you can redistribute it and/or modify it under the
141.1354 -+// terms of the GNU General Public License as published by the
141.1355 -+// Free Software Foundation; either version 2, or (at your option)
141.1356 -+// any later version.
141.1357 -+
141.1358 -+// This library is distributed in the hope that it will be useful,
141.1359 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
141.1360 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
141.1361 -+// GNU General Public License for more details.
141.1362 -+
141.1363 -+// You should have received a copy of the GNU General Public License along
141.1364 -+// with this library; see the file COPYING.  If not, write to the Free
141.1365 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
141.1366 -+// USA.
141.1367 -+
141.1368 -+// As a special exception, you may use this file as part of a free software
141.1369 -+// library without restriction.  Specifically, if other files instantiate
141.1370 -+// templates or use macros or inline functions from this file, or you compile
141.1371 -+// this file and link it with other files to produce an executable, this
141.1372 -+// file does not by itself cause the resulting executable to be covered by
141.1373 -+// the GNU General Public License.  This exception does not however
141.1374 -+// invalidate any other reasons why the executable file might be covered by
141.1375 -+// the GNU General Public License.
141.1376 -+
141.1377 -+//
141.1378 -+// ISO C++ 14882: 22.2.6.3.2  moneypunct virtual functions
141.1379 -+//
141.1380 -+
141.1381 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
141.1382 -+
141.1383 -+#define _LIBC
141.1384 -+#include <locale>
141.1385 -+#undef _LIBC
141.1386 -+#include <bits/c++locale_internal.h>
141.1387 -+
141.1388 -+#ifdef __UCLIBC_MJN3_ONLY__
141.1389 -+#warning optimize this for uclibc
141.1390 -+#warning tailor for stub locale support
141.1391 -+#endif
141.1392 -+
141.1393 -+#ifndef __UCLIBC_HAS_XLOCALE__
141.1394 -+#define __nl_langinfo_l(N, L)         nl_langinfo((N))
141.1395 -+#endif
141.1396 -+
141.1397 -+namespace std
141.1398 -+{
141.1399 -+  // Construct and return valid pattern consisting of some combination of:
141.1400 -+  // space none symbol sign value
141.1401 -+  money_base::pattern
141.1402 -+  money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
141.1403 -+  { 
141.1404 -+    pattern __ret;
141.1405 -+
141.1406 -+    // This insanely complicated routine attempts to construct a valid
141.1407 -+    // pattern for use with monyepunct. A couple of invariants:
141.1408 -+
141.1409 -+    // if (__precedes) symbol -> value
141.1410 -+    // else value -> symbol
141.1411 -+    
141.1412 -+    // if (__space) space
141.1413 -+    // else none
141.1414 -+
141.1415 -+    // none == never first
141.1416 -+    // space never first or last
141.1417 -+
141.1418 -+    // Any elegant implementations of this are welcome.
141.1419 -+    switch (__posn)
141.1420 -+      {
141.1421 -+      case 0:
141.1422 -+      case 1:
141.1423 -+	// 1 The sign precedes the value and symbol.
141.1424 -+	__ret.field[0] = sign;
141.1425 -+	if (__space)
141.1426 -+	  {
141.1427 -+	    // Pattern starts with sign.
141.1428 -+	    if (__precedes)
141.1429 -+	      {
141.1430 -+		__ret.field[1] = symbol;
141.1431 -+		__ret.field[3] = value;
141.1432 -+	      }
141.1433 -+	    else
141.1434 -+	      {
141.1435 -+		__ret.field[1] = value;
141.1436 -+		__ret.field[3] = symbol;
141.1437 -+	      }
141.1438 -+	    __ret.field[2] = space;
141.1439 -+	  }
141.1440 -+	else
141.1441 -+	  {
141.1442 -+	    // Pattern starts with sign and ends with none.
141.1443 -+	    if (__precedes)
141.1444 -+	      {
141.1445 -+		__ret.field[1] = symbol;
141.1446 -+		__ret.field[2] = value;
141.1447 -+	      }
141.1448 -+	    else
141.1449 -+	      {
141.1450 -+		__ret.field[1] = value;
141.1451 -+		__ret.field[2] = symbol;
141.1452 -+	      }
141.1453 -+	    __ret.field[3] = none;
141.1454 -+	  }
141.1455 -+	break;
141.1456 -+      case 2:
141.1457 -+	// 2 The sign follows the value and symbol.
141.1458 -+	if (__space)
141.1459 -+	  {
141.1460 -+	    // Pattern either ends with sign.
141.1461 -+	    if (__precedes)
141.1462 -+	      {
141.1463 -+		__ret.field[0] = symbol;
141.1464 -+		__ret.field[2] = value;
141.1465 -+	      }
141.1466 -+	    else
141.1467 -+	      {
141.1468 -+		__ret.field[0] = value;
141.1469 -+		__ret.field[2] = symbol;
141.1470 -+	      }
141.1471 -+	    __ret.field[1] = space;
141.1472 -+	    __ret.field[3] = sign;
141.1473 -+	  }
141.1474 -+	else
141.1475 -+	  {
141.1476 -+	    // Pattern ends with sign then none.
141.1477 -+	    if (__precedes)
141.1478 -+	      {
141.1479 -+		__ret.field[0] = symbol;
141.1480 -+		__ret.field[1] = value;
141.1481 -+	      }
141.1482 -+	    else
141.1483 -+	      {
141.1484 -+		__ret.field[0] = value;
141.1485 -+		__ret.field[1] = symbol;
141.1486 -+	      }
141.1487 -+	    __ret.field[2] = sign;
141.1488 -+	    __ret.field[3] = none;
141.1489 -+	  }
141.1490 -+	break;
141.1491 -+      case 3:
141.1492 -+	// 3 The sign immediately precedes the symbol.
141.1493 -+	if (__precedes)
141.1494 -+	  {
141.1495 -+	    __ret.field[0] = sign;
141.1496 -+	    __ret.field[1] = symbol;	    
141.1497 -+	    if (__space)
141.1498 -+	      {
141.1499 -+		__ret.field[2] = space;
141.1500 -+		__ret.field[3] = value;
141.1501 -+	      }
141.1502 -+	    else
141.1503 -+	      {
141.1504 -+		__ret.field[2] = value;		
141.1505 -+		__ret.field[3] = none;
141.1506 -+	      }
141.1507 -+	  }
141.1508 -+	else
141.1509 -+	  {
141.1510 -+	    __ret.field[0] = value;
141.1511 -+	    if (__space)
141.1512 -+	      {
141.1513 -+		__ret.field[1] = space;
141.1514 -+		__ret.field[2] = sign;
141.1515 -+		__ret.field[3] = symbol;
141.1516 -+	      }
141.1517 -+	    else
141.1518 -+	      {
141.1519 -+		__ret.field[1] = sign;
141.1520 -+		__ret.field[2] = symbol;
141.1521 -+		__ret.field[3] = none;
141.1522 -+	      }
141.1523 -+	  }
141.1524 -+	break;
141.1525 -+      case 4:
141.1526 -+	// 4 The sign immediately follows the symbol.
141.1527 -+	if (__precedes)
141.1528 -+	  {
141.1529 -+	    __ret.field[0] = symbol;
141.1530 -+	    __ret.field[1] = sign;
141.1531 -+	    if (__space)
141.1532 -+	      {
141.1533 -+		__ret.field[2] = space;
141.1534 -+		__ret.field[3] = value;
141.1535 -+	      }
141.1536 -+	    else
141.1537 -+	      {
141.1538 -+		__ret.field[2] = value;
141.1539 -+		__ret.field[3] = none;
141.1540 -+	      }
141.1541 -+	  }
141.1542 -+	else
141.1543 -+	  {
141.1544 -+	    __ret.field[0] = value;
141.1545 -+	    if (__space)
141.1546 -+	      {
141.1547 -+		__ret.field[1] = space;
141.1548 -+		__ret.field[2] = symbol;
141.1549 -+		__ret.field[3] = sign;
141.1550 -+	      }
141.1551 -+	    else
141.1552 -+	      {
141.1553 -+		__ret.field[1] = symbol;
141.1554 -+		__ret.field[2] = sign;
141.1555 -+		__ret.field[3] = none;
141.1556 -+	      }
141.1557 -+	  }
141.1558 -+	break;
141.1559 -+      default:
141.1560 -+	;
141.1561 -+      }
141.1562 -+    return __ret;
141.1563 -+  }
141.1564 -+
141.1565 -+  template<> 
141.1566 -+    void
141.1567 -+    moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc, 
141.1568 -+						     const char*)
141.1569 -+    {
141.1570 -+      if (!_M_data)
141.1571 -+	_M_data = new __moneypunct_cache<char, true>;
141.1572 -+
141.1573 -+      if (!__cloc)
141.1574 -+	{
141.1575 -+	  // "C" locale
141.1576 -+	  _M_data->_M_decimal_point = '.';
141.1577 -+	  _M_data->_M_thousands_sep = ',';
141.1578 -+	  _M_data->_M_grouping = "";
141.1579 -+	  _M_data->_M_grouping_size = 0;
141.1580 -+	  _M_data->_M_curr_symbol = "";
141.1581 -+	  _M_data->_M_curr_symbol_size = 0;
141.1582 -+	  _M_data->_M_positive_sign = "";
141.1583 -+	  _M_data->_M_positive_sign_size = 0;
141.1584 -+	  _M_data->_M_negative_sign = "";
141.1585 -+	  _M_data->_M_negative_sign_size = 0;
141.1586 -+	  _M_data->_M_frac_digits = 0;
141.1587 -+	  _M_data->_M_pos_format = money_base::_S_default_pattern;
141.1588 -+	  _M_data->_M_neg_format = money_base::_S_default_pattern;
141.1589 -+
141.1590 -+	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
141.1591 -+	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
141.1592 -+	}
141.1593 -+      else
141.1594 -+	{
141.1595 -+	  // Named locale.
141.1596 -+	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
141.1597 -+							__cloc));
141.1598 -+	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
141.1599 -+							__cloc));
141.1600 -+	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
141.1601 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
141.1602 -+	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
141.1603 -+	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
141.1604 -+
141.1605 -+	  char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
141.1606 -+	  if (!__nposn)
141.1607 -+	    _M_data->_M_negative_sign = "()";
141.1608 -+	  else
141.1609 -+	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, 
141.1610 -+							__cloc);
141.1611 -+	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
141.1612 -+
141.1613 -+	  // _Intl == true
141.1614 -+	  _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
141.1615 -+	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
141.1616 -+	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
141.1617 -+						      __cloc));
141.1618 -+	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
141.1619 -+	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
141.1620 -+	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
141.1621 -+	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
141.1622 -+							__pposn);
141.1623 -+	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
141.1624 -+	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
141.1625 -+	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
141.1626 -+							__nposn);
141.1627 -+	}
141.1628 -+    }
141.1629 -+
141.1630 -+  template<> 
141.1631 -+    void
141.1632 -+    moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc, 
141.1633 -+						      const char*)
141.1634 -+    {
141.1635 -+      if (!_M_data)
141.1636 -+	_M_data = new __moneypunct_cache<char, false>;
141.1637 -+
141.1638 -+      if (!__cloc)
141.1639 -+	{
141.1640 -+	  // "C" locale
141.1641 -+	  _M_data->_M_decimal_point = '.';
141.1642 -+	  _M_data->_M_thousands_sep = ',';
141.1643 -+	  _M_data->_M_grouping = "";
141.1644 -+	  _M_data->_M_grouping_size = 0;
141.1645 -+	  _M_data->_M_curr_symbol = "";
141.1646 -+	  _M_data->_M_curr_symbol_size = 0;
141.1647 -+	  _M_data->_M_positive_sign = "";
141.1648 -+	  _M_data->_M_positive_sign_size = 0;
141.1649 -+	  _M_data->_M_negative_sign = "";
141.1650 -+	  _M_data->_M_negative_sign_size = 0;
141.1651 -+	  _M_data->_M_frac_digits = 0;
141.1652 -+	  _M_data->_M_pos_format = money_base::_S_default_pattern;
141.1653 -+	  _M_data->_M_neg_format = money_base::_S_default_pattern;
141.1654 -+
141.1655 -+	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
141.1656 -+	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
141.1657 -+	}
141.1658 -+      else
141.1659 -+	{
141.1660 -+	  // Named locale.
141.1661 -+	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
141.1662 -+							__cloc));
141.1663 -+	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
141.1664 -+							__cloc));
141.1665 -+	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
141.1666 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
141.1667 -+	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
141.1668 -+	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
141.1669 -+
141.1670 -+	  char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
141.1671 -+	  if (!__nposn)
141.1672 -+	    _M_data->_M_negative_sign = "()";
141.1673 -+	  else
141.1674 -+	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
141.1675 -+							__cloc);
141.1676 -+	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
141.1677 -+
141.1678 -+	  // _Intl == false
141.1679 -+	  _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
141.1680 -+	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
141.1681 -+	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
141.1682 -+	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
141.1683 -+	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
141.1684 -+	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
141.1685 -+	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
141.1686 -+							__pposn);
141.1687 -+	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
141.1688 -+	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
141.1689 -+	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
141.1690 -+							__nposn);
141.1691 -+	}
141.1692 -+    }
141.1693 -+
141.1694 -+  template<> 
141.1695 -+    moneypunct<char, true>::~moneypunct()
141.1696 -+    { delete _M_data; }
141.1697 -+
141.1698 -+  template<> 
141.1699 -+    moneypunct<char, false>::~moneypunct()
141.1700 -+    { delete _M_data; }
141.1701 -+
141.1702 -+#ifdef _GLIBCXX_USE_WCHAR_T
141.1703 -+  template<> 
141.1704 -+    void
141.1705 -+    moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc, 
141.1706 -+#ifdef __UCLIBC_HAS_XLOCALE__
141.1707 -+							const char*)
141.1708 -+#else
141.1709 -+							const char* __name)
141.1710 -+#endif
141.1711 -+    {
141.1712 -+      if (!_M_data)
141.1713 -+	_M_data = new __moneypunct_cache<wchar_t, true>;
141.1714 -+
141.1715 -+      if (!__cloc)
141.1716 -+	{
141.1717 -+	  // "C" locale
141.1718 -+	  _M_data->_M_decimal_point = L'.';
141.1719 -+	  _M_data->_M_thousands_sep = L',';
141.1720 -+	  _M_data->_M_grouping = "";
141.1721 -+	  _M_data->_M_grouping_size = 0;
141.1722 -+	  _M_data->_M_curr_symbol = L"";
141.1723 -+	  _M_data->_M_curr_symbol_size = 0;
141.1724 -+	  _M_data->_M_positive_sign = L"";
141.1725 -+	  _M_data->_M_positive_sign_size = 0;
141.1726 -+	  _M_data->_M_negative_sign = L"";
141.1727 -+	  _M_data->_M_negative_sign_size = 0;
141.1728 -+	  _M_data->_M_frac_digits = 0;
141.1729 -+	  _M_data->_M_pos_format = money_base::_S_default_pattern;
141.1730 -+	  _M_data->_M_neg_format = money_base::_S_default_pattern;
141.1731 -+
141.1732 -+	  // Use ctype::widen code without the facet...
141.1733 -+	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
141.1734 -+	    _M_data->_M_atoms[__i] =
141.1735 -+	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
141.1736 -+	}
141.1737 -+      else
141.1738 -+	{
141.1739 -+	  // Named locale.
141.1740 -+#ifdef __UCLIBC_HAS_XLOCALE__
141.1741 -+	  __c_locale __old = __uselocale(__cloc);
141.1742 -+#else
141.1743 -+	  // Switch to named locale so that mbsrtowcs will work.
141.1744 -+	  char* __old = strdup(setlocale(LC_ALL, NULL));
141.1745 -+	  setlocale(LC_ALL, __name);
141.1746 -+#endif
141.1747 -+
141.1748 -+#ifdef __UCLIBC_MJN3_ONLY__
141.1749 -+#warning fix this... should be monetary
141.1750 -+#endif
141.1751 -+#ifdef __UCLIBC__
141.1752 -+# ifdef __UCLIBC_HAS_XLOCALE__
141.1753 -+	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
141.1754 -+	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
141.1755 -+# else
141.1756 -+	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
141.1757 -+	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
141.1758 -+# endif
141.1759 -+#else
141.1760 -+	  union { char *__s; wchar_t __w; } __u;
141.1761 -+	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
141.1762 -+	  _M_data->_M_decimal_point = __u.__w;
141.1763 -+
141.1764 -+	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
141.1765 -+	  _M_data->_M_thousands_sep = __u.__w;
141.1766 -+#endif
141.1767 -+	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
141.1768 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
141.1769 -+
141.1770 -+	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
141.1771 -+	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
141.1772 -+	  const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
141.1773 -+
141.1774 -+	  wchar_t* __wcs_ps = 0;
141.1775 -+	  wchar_t* __wcs_ns = 0;
141.1776 -+	  const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
141.1777 -+	  try
141.1778 -+	    {
141.1779 -+	      mbstate_t __state;
141.1780 -+	      size_t __len = strlen(__cpossign);
141.1781 -+	      if (__len)
141.1782 -+		{
141.1783 -+		  ++__len;
141.1784 -+		  memset(&__state, 0, sizeof(mbstate_t));
141.1785 -+		  __wcs_ps = new wchar_t[__len];
141.1786 -+		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
141.1787 -+		  _M_data->_M_positive_sign = __wcs_ps;
141.1788 -+		}
141.1789 -+	      else
141.1790 -+		_M_data->_M_positive_sign = L"";
141.1791 -+	      _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
141.1792 -+	      
141.1793 -+	      __len = strlen(__cnegsign);
141.1794 -+	      if (!__nposn)
141.1795 -+		_M_data->_M_negative_sign = L"()";
141.1796 -+	      else if (__len)
141.1797 -+		{ 
141.1798 -+		  ++__len;
141.1799 -+		  memset(&__state, 0, sizeof(mbstate_t));
141.1800 -+		  __wcs_ns = new wchar_t[__len];
141.1801 -+		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
141.1802 -+		  _M_data->_M_negative_sign = __wcs_ns;
141.1803 -+		}
141.1804 -+	      else
141.1805 -+		_M_data->_M_negative_sign = L"";
141.1806 -+	      _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
141.1807 -+	      
141.1808 -+	      // _Intl == true.
141.1809 -+	      __len = strlen(__ccurr);
141.1810 -+	      if (__len)
141.1811 -+		{
141.1812 -+		  ++__len;
141.1813 -+		  memset(&__state, 0, sizeof(mbstate_t));
141.1814 -+		  wchar_t* __wcs = new wchar_t[__len];
141.1815 -+		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
141.1816 -+		  _M_data->_M_curr_symbol = __wcs;
141.1817 -+		}
141.1818 -+	      else
141.1819 -+		_M_data->_M_curr_symbol = L"";
141.1820 -+	      _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
141.1821 -+	    }
141.1822 -+	  catch (...)
141.1823 -+	    {
141.1824 -+	      delete _M_data;
141.1825 -+	      _M_data = 0;
141.1826 -+	      delete __wcs_ps;
141.1827 -+	      delete __wcs_ns;	      
141.1828 -+#ifdef __UCLIBC_HAS_XLOCALE__
141.1829 -+	      __uselocale(__old);
141.1830 -+#else
141.1831 -+	      setlocale(LC_ALL, __old);
141.1832 -+	      free(__old);
141.1833 -+#endif
141.1834 -+	      __throw_exception_again;
141.1835 -+	    } 
141.1836 -+	  
141.1837 -+	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
141.1838 -+						      __cloc));
141.1839 -+	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
141.1840 -+	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
141.1841 -+	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
141.1842 -+	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
141.1843 -+							__pposn);
141.1844 -+	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
141.1845 -+	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
141.1846 -+	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
141.1847 -+							__nposn);
141.1848 -+
141.1849 -+#ifdef __UCLIBC_HAS_XLOCALE__
141.1850 -+	  __uselocale(__old);
141.1851 -+#else
141.1852 -+	  setlocale(LC_ALL, __old);
141.1853 -+	  free(__old);
141.1854 -+#endif
141.1855 -+	}
141.1856 -+    }
141.1857 -+
141.1858 -+  template<> 
141.1859 -+  void
141.1860 -+  moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
141.1861 -+#ifdef __UCLIBC_HAS_XLOCALE__
141.1862 -+						       const char*)
141.1863 -+#else
141.1864 -+                                                       const char* __name)
141.1865 -+#endif
141.1866 -+  {
141.1867 -+    if (!_M_data)
141.1868 -+      _M_data = new __moneypunct_cache<wchar_t, false>;
141.1869 -+
141.1870 -+    if (!__cloc)
141.1871 -+	{
141.1872 -+	  // "C" locale
141.1873 -+	  _M_data->_M_decimal_point = L'.';
141.1874 -+	  _M_data->_M_thousands_sep = L',';
141.1875 -+	  _M_data->_M_grouping = "";
141.1876 -+          _M_data->_M_grouping_size = 0;
141.1877 -+	  _M_data->_M_curr_symbol = L"";
141.1878 -+	  _M_data->_M_curr_symbol_size = 0;
141.1879 -+	  _M_data->_M_positive_sign = L"";
141.1880 -+	  _M_data->_M_positive_sign_size = 0;
141.1881 -+	  _M_data->_M_negative_sign = L"";
141.1882 -+	  _M_data->_M_negative_sign_size = 0;
141.1883 -+	  _M_data->_M_frac_digits = 0;
141.1884 -+	  _M_data->_M_pos_format = money_base::_S_default_pattern;
141.1885 -+	  _M_data->_M_neg_format = money_base::_S_default_pattern;
141.1886 -+
141.1887 -+	  // Use ctype::widen code without the facet...
141.1888 -+	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
141.1889 -+	    _M_data->_M_atoms[__i] =
141.1890 -+	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
141.1891 -+	}
141.1892 -+      else
141.1893 -+	{
141.1894 -+	  // Named locale.
141.1895 -+#ifdef __UCLIBC_HAS_XLOCALE__
141.1896 -+	  __c_locale __old = __uselocale(__cloc);
141.1897 -+#else
141.1898 -+	  // Switch to named locale so that mbsrtowcs will work.
141.1899 -+	  char* __old = strdup(setlocale(LC_ALL, NULL));
141.1900 -+	  setlocale(LC_ALL, __name);
141.1901 -+#endif
141.1902 -+
141.1903 -+#ifdef __UCLIBC_MJN3_ONLY__
141.1904 -+#warning fix this... should be monetary
141.1905 -+#endif
141.1906 -+#ifdef __UCLIBC__
141.1907 -+# ifdef __UCLIBC_HAS_XLOCALE__
141.1908 -+	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
141.1909 -+	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
141.1910 -+# else
141.1911 -+	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
141.1912 -+	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
141.1913 -+# endif
141.1914 -+#else
141.1915 -+          union { char *__s; wchar_t __w; } __u;
141.1916 -+	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
141.1917 -+	  _M_data->_M_decimal_point = __u.__w;
141.1918 -+
141.1919 -+	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
141.1920 -+	  _M_data->_M_thousands_sep = __u.__w;
141.1921 -+#endif
141.1922 -+	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
141.1923 -+          _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
141.1924 -+
141.1925 -+	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
141.1926 -+	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
141.1927 -+	  const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
141.1928 -+
141.1929 -+	  wchar_t* __wcs_ps = 0;
141.1930 -+	  wchar_t* __wcs_ns = 0;
141.1931 -+	  const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
141.1932 -+	  try
141.1933 -+            {
141.1934 -+              mbstate_t __state;
141.1935 -+              size_t __len;
141.1936 -+              __len = strlen(__cpossign);
141.1937 -+              if (__len)
141.1938 -+                {
141.1939 -+		  ++__len;
141.1940 -+		  memset(&__state, 0, sizeof(mbstate_t));
141.1941 -+		  __wcs_ps = new wchar_t[__len];
141.1942 -+		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
141.1943 -+		  _M_data->_M_positive_sign = __wcs_ps;
141.1944 -+		}
141.1945 -+	      else
141.1946 -+		_M_data->_M_positive_sign = L"";
141.1947 -+              _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
141.1948 -+	      
141.1949 -+	      __len = strlen(__cnegsign);
141.1950 -+	      if (!__nposn)
141.1951 -+		_M_data->_M_negative_sign = L"()";
141.1952 -+	      else if (__len)
141.1953 -+		{ 
141.1954 -+		  ++__len;
141.1955 -+		  memset(&__state, 0, sizeof(mbstate_t));
141.1956 -+		  __wcs_ns = new wchar_t[__len];
141.1957 -+		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
141.1958 -+		  _M_data->_M_negative_sign = __wcs_ns;
141.1959 -+		}
141.1960 -+	      else
141.1961 -+		_M_data->_M_negative_sign = L"";
141.1962 -+              _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
141.1963 -+
141.1964 -+	      // _Intl == true.
141.1965 -+	      __len = strlen(__ccurr);
141.1966 -+	      if (__len)
141.1967 -+		{
141.1968 -+		  ++__len;
141.1969 -+		  memset(&__state, 0, sizeof(mbstate_t));
141.1970 -+		  wchar_t* __wcs = new wchar_t[__len];
141.1971 -+		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
141.1972 -+		  _M_data->_M_curr_symbol = __wcs;
141.1973 -+		}
141.1974 -+	      else
141.1975 -+		_M_data->_M_curr_symbol = L"";
141.1976 -+              _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
141.1977 -+	    }
141.1978 -+          catch (...)
141.1979 -+	    {
141.1980 -+	      delete _M_data;
141.1981 -+              _M_data = 0;
141.1982 -+	      delete __wcs_ps;
141.1983 -+	      delete __wcs_ns;	      
141.1984 -+#ifdef __UCLIBC_HAS_XLOCALE__
141.1985 -+	      __uselocale(__old);
141.1986 -+#else
141.1987 -+	      setlocale(LC_ALL, __old);
141.1988 -+	      free(__old);
141.1989 -+#endif
141.1990 -+              __throw_exception_again;
141.1991 -+	    }
141.1992 -+
141.1993 -+	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
141.1994 -+	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
141.1995 -+	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
141.1996 -+	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
141.1997 -+	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
141.1998 -+	                                                __pposn);
141.1999 -+	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
141.2000 -+	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
141.2001 -+	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
141.2002 -+	                                                __nposn);
141.2003 -+
141.2004 -+#ifdef __UCLIBC_HAS_XLOCALE__
141.2005 -+	  __uselocale(__old);
141.2006 -+#else
141.2007 -+	  setlocale(LC_ALL, __old);
141.2008 -+	  free(__old);
141.2009 -+#endif
141.2010 -+	}
141.2011 -+    }
141.2012 -+
141.2013 -+  template<> 
141.2014 -+    moneypunct<wchar_t, true>::~moneypunct()
141.2015 -+    {
141.2016 -+      if (_M_data->_M_positive_sign_size)
141.2017 -+	delete [] _M_data->_M_positive_sign;
141.2018 -+      if (_M_data->_M_negative_sign_size
141.2019 -+          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
141.2020 -+	delete [] _M_data->_M_negative_sign;
141.2021 -+      if (_M_data->_M_curr_symbol_size)
141.2022 -+	delete [] _M_data->_M_curr_symbol;
141.2023 -+      delete _M_data;
141.2024 -+    }
141.2025 -+
141.2026 -+  template<> 
141.2027 -+    moneypunct<wchar_t, false>::~moneypunct()
141.2028 -+    {
141.2029 -+      if (_M_data->_M_positive_sign_size)
141.2030 -+	delete [] _M_data->_M_positive_sign;
141.2031 -+      if (_M_data->_M_negative_sign_size
141.2032 -+          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
141.2033 -+	delete [] _M_data->_M_negative_sign;
141.2034 -+      if (_M_data->_M_curr_symbol_size)
141.2035 -+	delete [] _M_data->_M_curr_symbol;
141.2036 -+      delete _M_data;
141.2037 -+    }
141.2038 -+#endif
141.2039 -+}
141.2040 -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
141.2041 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	1970-01-01 01:00:00.000000000 +0100
141.2042 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:58:39.000000000 +0200
141.2043 -@@ -0,0 +1,160 @@
141.2044 -+// std::numpunct implementation details, GNU version -*- C++ -*-
141.2045 -+
141.2046 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
141.2047 -+//
141.2048 -+// This file is part of the GNU ISO C++ Library.  This library is free
141.2049 -+// software; you can redistribute it and/or modify it under the
141.2050 -+// terms of the GNU General Public License as published by the
141.2051 -+// Free Software Foundation; either version 2, or (at your option)
141.2052 -+// any later version.
141.2053 -+
141.2054 -+// This library is distributed in the hope that it will be useful,
141.2055 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
141.2056 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
141.2057 -+// GNU General Public License for more details.
141.2058 -+
141.2059 -+// You should have received a copy of the GNU General Public License along
141.2060 -+// with this library; see the file COPYING.  If not, write to the Free
141.2061 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
141.2062 -+// USA.
141.2063 -+
141.2064 -+// As a special exception, you may use this file as part of a free software
141.2065 -+// library without restriction.  Specifically, if other files instantiate
141.2066 -+// templates or use macros or inline functions from this file, or you compile
141.2067 -+// this file and link it with other files to produce an executable, this
141.2068 -+// file does not by itself cause the resulting executable to be covered by
141.2069 -+// the GNU General Public License.  This exception does not however
141.2070 -+// invalidate any other reasons why the executable file might be covered by
141.2071 -+// the GNU General Public License.
141.2072 -+
141.2073 -+//
141.2074 -+// ISO C++ 14882: 22.2.3.1.2  numpunct virtual functions
141.2075 -+//
141.2076 -+
141.2077 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
141.2078 -+
141.2079 -+#define _LIBC
141.2080 -+#include <locale>
141.2081 -+#undef _LIBC
141.2082 -+#include <bits/c++locale_internal.h>
141.2083 -+
141.2084 -+#ifdef __UCLIBC_MJN3_ONLY__
141.2085 -+#warning tailor for stub locale support
141.2086 -+#endif
141.2087 -+#ifndef __UCLIBC_HAS_XLOCALE__
141.2088 -+#define __nl_langinfo_l(N, L)         nl_langinfo((N))
141.2089 -+#endif
141.2090 -+
141.2091 -+namespace std
141.2092 -+{
141.2093 -+  template<> 
141.2094 -+    void
141.2095 -+    numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
141.2096 -+    {
141.2097 -+      if (!_M_data)
141.2098 -+	_M_data = new __numpunct_cache<char>;
141.2099 -+
141.2100 -+      if (!__cloc)
141.2101 -+	{
141.2102 -+	  // "C" locale
141.2103 -+	  _M_data->_M_grouping = "";
141.2104 -+	  _M_data->_M_grouping_size = 0;
141.2105 -+	  _M_data->_M_use_grouping = false;
141.2106 -+
141.2107 -+	  _M_data->_M_decimal_point = '.';
141.2108 -+	  _M_data->_M_thousands_sep = ',';
141.2109 -+
141.2110 -+	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
141.2111 -+	    _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
141.2112 -+
141.2113 -+	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
141.2114 -+	    _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j];
141.2115 -+	}
141.2116 -+      else
141.2117 -+	{
141.2118 -+	  // Named locale.
141.2119 -+	  _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT, 
141.2120 -+							__cloc));
141.2121 -+	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP, 
141.2122 -+							__cloc));
141.2123 -+
141.2124 -+	  // Check for NULL, which implies no grouping.
141.2125 -+	  if (_M_data->_M_thousands_sep == '\0')
141.2126 -+	    _M_data->_M_grouping = "";
141.2127 -+	  else
141.2128 -+	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
141.2129 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
141.2130 -+	}
141.2131 -+
141.2132 -+      // NB: There is no way to extact this info from posix locales.
141.2133 -+      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
141.2134 -+      _M_data->_M_truename = "true";
141.2135 -+      _M_data->_M_truename_size = 4;
141.2136 -+      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
141.2137 -+      _M_data->_M_falsename = "false";
141.2138 -+      _M_data->_M_falsename_size = 5;
141.2139 -+    }
141.2140 -+ 
141.2141 -+  template<> 
141.2142 -+    numpunct<char>::~numpunct()
141.2143 -+    { delete _M_data; }
141.2144 -+   
141.2145 -+#ifdef _GLIBCXX_USE_WCHAR_T
141.2146 -+  template<> 
141.2147 -+    void
141.2148 -+    numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
141.2149 -+    {
141.2150 -+      if (!_M_data)
141.2151 -+	_M_data = new __numpunct_cache<wchar_t>;
141.2152 -+
141.2153 -+      if (!__cloc)
141.2154 -+	{
141.2155 -+	  // "C" locale
141.2156 -+	  _M_data->_M_grouping = "";
141.2157 -+	  _M_data->_M_grouping_size = 0;
141.2158 -+	  _M_data->_M_use_grouping = false;
141.2159 -+
141.2160 -+	  _M_data->_M_decimal_point = L'.';
141.2161 -+	  _M_data->_M_thousands_sep = L',';
141.2162 -+
141.2163 -+	  // Use ctype::widen code without the facet...
141.2164 -+	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
141.2165 -+	    _M_data->_M_atoms_out[__i] =
141.2166 -+	      static_cast<wchar_t>(__num_base::_S_atoms_out[__i]);
141.2167 -+
141.2168 -+	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
141.2169 -+	    _M_data->_M_atoms_in[__j] =
141.2170 -+	      static_cast<wchar_t>(__num_base::_S_atoms_in[__j]);
141.2171 -+	}
141.2172 -+      else
141.2173 -+	{
141.2174 -+	  // Named locale.
141.2175 -+	  // NB: In the GNU model wchar_t is always 32 bit wide.
141.2176 -+	  union { char *__s; wchar_t __w; } __u;
141.2177 -+	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
141.2178 -+	  _M_data->_M_decimal_point = __u.__w;
141.2179 -+
141.2180 -+	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
141.2181 -+	  _M_data->_M_thousands_sep = __u.__w;
141.2182 -+
141.2183 -+	  if (_M_data->_M_thousands_sep == L'\0')
141.2184 -+	    _M_data->_M_grouping = "";
141.2185 -+	  else
141.2186 -+	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
141.2187 -+	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
141.2188 -+	}
141.2189 -+
141.2190 -+      // NB: There is no way to extact this info from posix locales.
141.2191 -+      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
141.2192 -+      _M_data->_M_truename = L"true";
141.2193 -+      _M_data->_M_truename_size = 4;
141.2194 -+      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
141.2195 -+      _M_data->_M_falsename = L"false";
141.2196 -+      _M_data->_M_falsename_size = 5;
141.2197 -+    }
141.2198 -+
141.2199 -+  template<> 
141.2200 -+    numpunct<wchar_t>::~numpunct()
141.2201 -+    { delete _M_data; }
141.2202 -+ #endif
141.2203 -+}
141.2204 -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
141.2205 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc	1970-01-01 01:00:00.000000000 +0100
141.2206 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.cc	2008-06-10 14:58:39.000000000 +0200
141.2207 -@@ -0,0 +1,406 @@
141.2208 -+// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
141.2209 -+
141.2210 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
141.2211 -+//
141.2212 -+// This file is part of the GNU ISO C++ Library.  This library is free
141.2213 -+// software; you can redistribute it and/or modify it under the
141.2214 -+// terms of the GNU General Public License as published by the
141.2215 -+// Free Software Foundation; either version 2, or (at your option)
141.2216 -+// any later version.
141.2217 -+
141.2218 -+// This library is distributed in the hope that it will be useful,
141.2219 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
141.2220 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
141.2221 -+// GNU General Public License for more details.
141.2222 -+
141.2223 -+// You should have received a copy of the GNU General Public License along
141.2224 -+// with this library; see the file COPYING.  If not, write to the Free
141.2225 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
141.2226 -+// USA.
141.2227 -+
141.2228 -+// As a special exception, you may use this file as part of a free software
141.2229 -+// library without restriction.  Specifically, if other files instantiate
141.2230 -+// templates or use macros or inline functions from this file, or you compile
141.2231 -+// this file and link it with other files to produce an executable, this
141.2232 -+// file does not by itself cause the resulting executable to be covered by
141.2233 -+// the GNU General Public License.  This exception does not however
141.2234 -+// invalidate any other reasons why the executable file might be covered by
141.2235 -+// the GNU General Public License.
141.2236 -+
141.2237 -+//
141.2238 -+// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
141.2239 -+// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
141.2240 -+//
141.2241 -+
141.2242 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
141.2243 -+
141.2244 -+#include <locale>
141.2245 -+#include <bits/c++locale_internal.h>
141.2246 -+
141.2247 -+#ifdef __UCLIBC_MJN3_ONLY__
141.2248 -+#warning tailor for stub locale support
141.2249 -+#endif
141.2250 -+#ifndef __UCLIBC_HAS_XLOCALE__
141.2251 -+#define __nl_langinfo_l(N, L)         nl_langinfo((N))
141.2252 -+#endif
141.2253 -+
141.2254 -+namespace std
141.2255 -+{
141.2256 -+  template<>
141.2257 -+    void
141.2258 -+    __timepunct<char>::
141.2259 -+    _M_put(char* __s, size_t __maxlen, const char* __format, 
141.2260 -+	   const tm* __tm) const
141.2261 -+    {
141.2262 -+#ifdef __UCLIBC_HAS_XLOCALE__
141.2263 -+      const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
141.2264 -+					_M_c_locale_timepunct);
141.2265 -+#else
141.2266 -+      char* __old = strdup(setlocale(LC_ALL, NULL));
141.2267 -+      setlocale(LC_ALL, _M_name_timepunct);
141.2268 -+      const size_t __len = strftime(__s, __maxlen, __format, __tm);
141.2269 -+      setlocale(LC_ALL, __old);
141.2270 -+      free(__old);
141.2271 -+#endif
141.2272 -+      // Make sure __s is null terminated.
141.2273 -+      if (__len == 0)
141.2274 -+	__s[0] = '\0';
141.2275 -+    }
141.2276 -+
141.2277 -+  template<> 
141.2278 -+    void
141.2279 -+    __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
141.2280 -+    {
141.2281 -+      if (!_M_data)
141.2282 -+	_M_data = new __timepunct_cache<char>;
141.2283 -+
141.2284 -+      if (!__cloc)
141.2285 -+	{
141.2286 -+	  // "C" locale
141.2287 -+	  _M_c_locale_timepunct = _S_get_c_locale();
141.2288 -+
141.2289 -+	  _M_data->_M_date_format = "%m/%d/%y";
141.2290 -+	  _M_data->_M_date_era_format = "%m/%d/%y";
141.2291 -+	  _M_data->_M_time_format = "%H:%M:%S";
141.2292 -+	  _M_data->_M_time_era_format = "%H:%M:%S";
141.2293 -+	  _M_data->_M_date_time_format = "";
141.2294 -+	  _M_data->_M_date_time_era_format = "";
141.2295 -+	  _M_data->_M_am = "AM";
141.2296 -+	  _M_data->_M_pm = "PM";
141.2297 -+	  _M_data->_M_am_pm_format = "";
141.2298 -+
141.2299 -+	  // Day names, starting with "C"'s Sunday.
141.2300 -+	  _M_data->_M_day1 = "Sunday";
141.2301 -+	  _M_data->_M_day2 = "Monday";
141.2302 -+	  _M_data->_M_day3 = "Tuesday";
141.2303 -+	  _M_data->_M_day4 = "Wednesday";
141.2304 -+	  _M_data->_M_day5 = "Thursday";
141.2305 -+	  _M_data->_M_day6 = "Friday";
141.2306 -+	  _M_data->_M_day7 = "Saturday";
141.2307 -+
141.2308 -+	  // Abbreviated day names, starting with "C"'s Sun.
141.2309 -+	  _M_data->_M_aday1 = "Sun";
141.2310 -+	  _M_data->_M_aday2 = "Mon";
141.2311 -+	  _M_data->_M_aday3 = "Tue";
141.2312 -+	  _M_data->_M_aday4 = "Wed";
141.2313 -+	  _M_data->_M_aday5 = "Thu";
141.2314 -+	  _M_data->_M_aday6 = "Fri";
141.2315 -+	  _M_data->_M_aday7 = "Sat";
141.2316 -+
141.2317 -+	  // Month names, starting with "C"'s January.
141.2318 -+	  _M_data->_M_month01 = "January";
141.2319 -+	  _M_data->_M_month02 = "February";
141.2320 -+	  _M_data->_M_month03 = "March";
141.2321 -+	  _M_data->_M_month04 = "April";
141.2322 -+	  _M_data->_M_month05 = "May";
141.2323 -+	  _M_data->_M_month06 = "June";
141.2324 -+	  _M_data->_M_month07 = "July";
141.2325 -+	  _M_data->_M_month08 = "August";
141.2326 -+	  _M_data->_M_month09 = "September";
141.2327 -+	  _M_data->_M_month10 = "October";
141.2328 -+	  _M_data->_M_month11 = "November";
141.2329 -+	  _M_data->_M_month12 = "December";
141.2330 -+
141.2331 -+	  // Abbreviated month names, starting with "C"'s Jan.
141.2332 -+	  _M_data->_M_amonth01 = "Jan";
141.2333 -+	  _M_data->_M_amonth02 = "Feb";
141.2334 -+	  _M_data->_M_amonth03 = "Mar";
141.2335 -+	  _M_data->_M_amonth04 = "Apr";
141.2336 -+	  _M_data->_M_amonth05 = "May";
141.2337 -+	  _M_data->_M_amonth06 = "Jun";
141.2338 -+	  _M_data->_M_amonth07 = "Jul";
141.2339 -+	  _M_data->_M_amonth08 = "Aug";
141.2340 -+	  _M_data->_M_amonth09 = "Sep";
141.2341 -+	  _M_data->_M_amonth10 = "Oct";
141.2342 -+	  _M_data->_M_amonth11 = "Nov";
141.2343 -+	  _M_data->_M_amonth12 = "Dec";
141.2344 -+	}
141.2345 -+      else
141.2346 -+	{
141.2347 -+	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
141.2348 -+
141.2349 -+	  _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
141.2350 -+	  _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
141.2351 -+	  _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
141.2352 -+	  _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
141.2353 -+	  _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
141.2354 -+	  _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT,
141.2355 -+							     __cloc);
141.2356 -+	  _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
141.2357 -+	  _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
141.2358 -+	  _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
141.2359 -+
141.2360 -+	  // Day names, starting with "C"'s Sunday.
141.2361 -+	  _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
141.2362 -+	  _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
141.2363 -+	  _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
141.2364 -+	  _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
141.2365 -+	  _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
141.2366 -+	  _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
141.2367 -+	  _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
141.2368 -+
141.2369 -+	  // Abbreviated day names, starting with "C"'s Sun.
141.2370 -+	  _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
141.2371 -+	  _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
141.2372 -+	  _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
141.2373 -+	  _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
141.2374 -+	  _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
141.2375 -+	  _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
141.2376 -+	  _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
141.2377 -+
141.2378 -+	  // Month names, starting with "C"'s January.
141.2379 -+	  _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
141.2380 -+	  _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
141.2381 -+	  _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
141.2382 -+	  _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
141.2383 -+	  _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
141.2384 -+	  _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
141.2385 -+	  _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
141.2386 -+	  _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
141.2387 -+	  _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
141.2388 -+	  _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
141.2389 -+	  _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
141.2390 -+	  _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
141.2391 -+
141.2392 -+	  // Abbreviated month names, starting with "C"'s Jan.
141.2393 -+	  _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
141.2394 -+	  _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
141.2395 -+	  _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
141.2396 -+	  _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
141.2397 -+	  _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
141.2398 -+	  _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
141.2399 -+	  _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
141.2400 -+	  _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
141.2401 -+	  _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
141.2402 -+	  _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
141.2403 -+	  _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
141.2404 -+	  _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
141.2405 -+	}
141.2406 -+    }
141.2407 -+
141.2408 -+#ifdef _GLIBCXX_USE_WCHAR_T
141.2409 -+  template<>
141.2410 -+    void
141.2411 -+    __timepunct<wchar_t>::
141.2412 -+    _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format, 
141.2413 -+	   const tm* __tm) const
141.2414 -+    {
141.2415 -+#ifdef __UCLIBC_HAS_XLOCALE__
141.2416 -+      __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
141.2417 -+      const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
141.2418 -+					_M_c_locale_timepunct);
141.2419 -+#else
141.2420 -+      char* __old = strdup(setlocale(LC_ALL, NULL));
141.2421 -+      setlocale(LC_ALL, _M_name_timepunct);
141.2422 -+      const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
141.2423 -+      setlocale(LC_ALL, __old);
141.2424 -+      free(__old);
141.2425 -+#endif
141.2426 -+      // Make sure __s is null terminated.
141.2427 -+      if (__len == 0)
141.2428 -+	__s[0] = L'\0';
141.2429 -+    }
141.2430 -+
141.2431 -+  template<> 
141.2432 -+    void
141.2433 -+    __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
141.2434 -+    {
141.2435 -+      if (!_M_data)
141.2436 -+	_M_data = new __timepunct_cache<wchar_t>;
141.2437 -+
141.2438 -+#warning wide time stuff
141.2439 -+//       if (!__cloc)
141.2440 -+	{
141.2441 -+	  // "C" locale
141.2442 -+	  _M_c_locale_timepunct = _S_get_c_locale();
141.2443 -+
141.2444 -+	  _M_data->_M_date_format = L"%m/%d/%y";
141.2445 -+	  _M_data->_M_date_era_format = L"%m/%d/%y";
141.2446 -+	  _M_data->_M_time_format = L"%H:%M:%S";
141.2447 -+	  _M_data->_M_time_era_format = L"%H:%M:%S";
141.2448 -+	  _M_data->_M_date_time_format = L"";
141.2449 -+	  _M_data->_M_date_time_era_format = L"";
141.2450 -+	  _M_data->_M_am = L"AM";
141.2451 -+	  _M_data->_M_pm = L"PM";
141.2452 -+	  _M_data->_M_am_pm_format = L"";
141.2453 -+
141.2454 -+	  // Day names, starting with "C"'s Sunday.
141.2455 -+	  _M_data->_M_day1 = L"Sunday";
141.2456 -+	  _M_data->_M_day2 = L"Monday";
141.2457 -+	  _M_data->_M_day3 = L"Tuesday";
141.2458 -+	  _M_data->_M_day4 = L"Wednesday";
141.2459 -+	  _M_data->_M_day5 = L"Thursday";
141.2460 -+	  _M_data->_M_day6 = L"Friday";
141.2461 -+	  _M_data->_M_day7 = L"Saturday";
141.2462 -+
141.2463 -+	  // Abbreviated day names, starting with "C"'s Sun.
141.2464 -+	  _M_data->_M_aday1 = L"Sun";
141.2465 -+	  _M_data->_M_aday2 = L"Mon";
141.2466 -+	  _M_data->_M_aday3 = L"Tue";
141.2467 -+	  _M_data->_M_aday4 = L"Wed";
141.2468 -+	  _M_data->_M_aday5 = L"Thu";
141.2469 -+	  _M_data->_M_aday6 = L"Fri";
141.2470 -+	  _M_data->_M_aday7 = L"Sat";
141.2471 -+
141.2472 -+	  // Month names, starting with "C"'s January.
141.2473 -+	  _M_data->_M_month01 = L"January";
141.2474 -+	  _M_data->_M_month02 = L"February";
141.2475 -+	  _M_data->_M_month03 = L"March";
141.2476 -+	  _M_data->_M_month04 = L"April";
141.2477 -+	  _M_data->_M_month05 = L"May";
141.2478 -+	  _M_data->_M_month06 = L"June";
141.2479 -+	  _M_data->_M_month07 = L"July";
141.2480 -+	  _M_data->_M_month08 = L"August";
141.2481 -+	  _M_data->_M_month09 = L"September";
141.2482 -+	  _M_data->_M_month10 = L"October";
141.2483 -+	  _M_data->_M_month11 = L"November";
141.2484 -+	  _M_data->_M_month12 = L"December";
141.2485 -+
141.2486 -+	  // Abbreviated month names, starting with "C"'s Jan.
141.2487 -+	  _M_data->_M_amonth01 = L"Jan";
141.2488 -+	  _M_data->_M_amonth02 = L"Feb";
141.2489 -+	  _M_data->_M_amonth03 = L"Mar";
141.2490 -+	  _M_data->_M_amonth04 = L"Apr";
141.2491 -+	  _M_data->_M_amonth05 = L"May";
141.2492 -+	  _M_data->_M_amonth06 = L"Jun";
141.2493 -+	  _M_data->_M_amonth07 = L"Jul";
141.2494 -+	  _M_data->_M_amonth08 = L"Aug";
141.2495 -+	  _M_data->_M_amonth09 = L"Sep";
141.2496 -+	  _M_data->_M_amonth10 = L"Oct";
141.2497 -+	  _M_data->_M_amonth11 = L"Nov";
141.2498 -+	  _M_data->_M_amonth12 = L"Dec";
141.2499 -+	}
141.2500 -+#if 0
141.2501 -+      else
141.2502 -+	{
141.2503 -+	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
141.2504 -+
141.2505 -+	  union { char *__s; wchar_t *__w; } __u;
141.2506 -+
141.2507 -+	  __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc);
141.2508 -+	  _M_data->_M_date_format = __u.__w;
141.2509 -+	  __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc);
141.2510 -+	  _M_data->_M_date_era_format = __u.__w;
141.2511 -+	  __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc);
141.2512 -+	  _M_data->_M_time_format = __u.__w;
141.2513 -+	  __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc);
141.2514 -+	  _M_data->_M_time_era_format = __u.__w;
141.2515 -+	  __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc);
141.2516 -+	  _M_data->_M_date_time_format = __u.__w;
141.2517 -+	  __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc);
141.2518 -+	  _M_data->_M_date_time_era_format = __u.__w;
141.2519 -+	  __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc);
141.2520 -+	  _M_data->_M_am = __u.__w;
141.2521 -+	  __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc);
141.2522 -+	  _M_data->_M_pm = __u.__w;
141.2523 -+	  __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc);
141.2524 -+	  _M_data->_M_am_pm_format = __u.__w;
141.2525 -+
141.2526 -+	  // Day names, starting with "C"'s Sunday.
141.2527 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc);
141.2528 -+	  _M_data->_M_day1 = __u.__w;
141.2529 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc);
141.2530 -+	  _M_data->_M_day2 = __u.__w;
141.2531 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc);
141.2532 -+	  _M_data->_M_day3 = __u.__w;
141.2533 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc);
141.2534 -+	  _M_data->_M_day4 = __u.__w;
141.2535 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc);
141.2536 -+	  _M_data->_M_day5 = __u.__w;
141.2537 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc);
141.2538 -+	  _M_data->_M_day6 = __u.__w;
141.2539 -+	  __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc);
141.2540 -+	  _M_data->_M_day7 = __u.__w;
141.2541 -+
141.2542 -+	  // Abbreviated day names, starting with "C"'s Sun.
141.2543 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc);
141.2544 -+	  _M_data->_M_aday1 = __u.__w;
141.2545 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc);
141.2546 -+	  _M_data->_M_aday2 = __u.__w;
141.2547 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc);
141.2548 -+	  _M_data->_M_aday3 = __u.__w;
141.2549 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc);
141.2550 -+	  _M_data->_M_aday4 = __u.__w;
141.2551 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc);
141.2552 -+	  _M_data->_M_aday5 = __u.__w;
141.2553 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc);
141.2554 -+	  _M_data->_M_aday6 = __u.__w;
141.2555 -+	  __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc);
141.2556 -+	  _M_data->_M_aday7 = __u.__w;
141.2557 -+
141.2558 -+	  // Month names, starting with "C"'s January.
141.2559 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc);
141.2560 -+	  _M_data->_M_month01 = __u.__w;
141.2561 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc);
141.2562 -+	  _M_data->_M_month02 = __u.__w;
141.2563 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc);
141.2564 -+	  _M_data->_M_month03 = __u.__w;
141.2565 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc);
141.2566 -+	  _M_data->_M_month04 = __u.__w;
141.2567 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc);
141.2568 -+	  _M_data->_M_month05 = __u.__w;
141.2569 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc);
141.2570 -+	  _M_data->_M_month06 = __u.__w;
141.2571 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc);
141.2572 -+	  _M_data->_M_month07 = __u.__w;
141.2573 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc);
141.2574 -+	  _M_data->_M_month08 = __u.__w;
141.2575 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc);
141.2576 -+	  _M_data->_M_month09 = __u.__w;
141.2577 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc);
141.2578 -+	  _M_data->_M_month10 = __u.__w;
141.2579 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc);
141.2580 -+	  _M_data->_M_month11 = __u.__w;
141.2581 -+	  __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc);
141.2582 -+	  _M_data->_M_month12 = __u.__w;
141.2583 -+
141.2584 -+	  // Abbreviated month names, starting with "C"'s Jan.
141.2585 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc);
141.2586 -+	  _M_data->_M_amonth01 = __u.__w;
141.2587 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc);
141.2588 -+	  _M_data->_M_amonth02 = __u.__w;
141.2589 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc);
141.2590 -+	  _M_data->_M_amonth03 = __u.__w;
141.2591 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc);
141.2592 -+	  _M_data->_M_amonth04 = __u.__w;
141.2593 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc);
141.2594 -+	  _M_data->_M_amonth05 = __u.__w;
141.2595 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc);
141.2596 -+	  _M_data->_M_amonth06 = __u.__w;
141.2597 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc);
141.2598 -+	  _M_data->_M_amonth07 = __u.__w;
141.2599 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc);
141.2600 -+	  _M_data->_M_amonth08 = __u.__w;
141.2601 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc);
141.2602 -+	  _M_data->_M_amonth09 = __u.__w;
141.2603 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc);
141.2604 -+	  _M_data->_M_amonth10 = __u.__w;
141.2605 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc);
141.2606 -+	  _M_data->_M_amonth11 = __u.__w;
141.2607 -+	  __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc);
141.2608 -+	  _M_data->_M_amonth12 = __u.__w;
141.2609 -+	}
141.2610 -+#endif // 0
141.2611 -+    }
141.2612 -+#endif
141.2613 -+}
141.2614 -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
141.2615 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h	1970-01-01 01:00:00.000000000 +0100
141.2616 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.h	2008-06-10 14:58:39.000000000 +0200
141.2617 -@@ -0,0 +1,68 @@
141.2618 -+// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
141.2619 -+
141.2620 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
141.2621 -+//
141.2622 -+// This file is part of the GNU ISO C++ Library.  This library is free
141.2623 -+// software; you can redistribute it and/or modify it under the
141.2624 -+// terms of the GNU General Public License as published by the
141.2625 -+// Free Software Foundation; either version 2, or (at your option)
141.2626 -+// any later version.
141.2627 -+
141.2628 -+// This library is distributed in the hope that it will be useful,
141.2629 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
141.2630 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
141.2631 -+// GNU General Public License for more details.
141.2632 -+
141.2633 -+// You should have received a copy of the GNU General Public License along
141.2634 -+// with this library; see the file COPYING.  If not, write to the Free
141.2635 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
141.2636 -+// USA.
141.2637 -+
141.2638 -+// As a special exception, you may use this file as part of a free software
141.2639 -+// library without restriction.  Specifically, if other files instantiate
141.2640 -+// templates or use macros or inline functions from this file, or you compile
141.2641 -+// this file and link it with other files to produce an executable, this
141.2642 -+// file does not by itself cause the resulting executable to be covered by
141.2643 -+// the GNU General Public License.  This exception does not however
141.2644 -+// invalidate any other reasons why the executable file might be covered by
141.2645 -+// the GNU General Public License.
141.2646 -+
141.2647 -+//
141.2648 -+// ISO C++ 14882: 22.2.5.1.2 - time_get functions
141.2649 -+// ISO C++ 14882: 22.2.5.3.2 - time_put functions
141.2650 -+//
141.2651 -+
141.2652 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
141.2653 -+
141.2654 -+  template<typename _CharT>
141.2655 -+    __timepunct<_CharT>::__timepunct(size_t __refs) 
141.2656 -+    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
141.2657 -+    _M_name_timepunct(_S_get_c_name())
141.2658 -+    { _M_initialize_timepunct(); }
141.2659 -+
141.2660 -+  template<typename _CharT>
141.2661 -+    __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) 
141.2662 -+    : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), 
141.2663 -+    _M_name_timepunct(_S_get_c_name())
141.2664 -+    { _M_initialize_timepunct(); }
141.2665 -+
141.2666 -+  template<typename _CharT>
141.2667 -+    __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
141.2668 -+				     size_t __refs) 
141.2669 -+    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
141.2670 -+    _M_name_timepunct(__s)
141.2671 -+    { 
141.2672 -+      char* __tmp = new char[std::strlen(__s) + 1];
141.2673 -+      std::strcpy(__tmp, __s);
141.2674 -+      _M_name_timepunct = __tmp;
141.2675 -+      _M_initialize_timepunct(__cloc); 
141.2676 -+    }
141.2677 -+
141.2678 -+  template<typename _CharT>
141.2679 -+    __timepunct<_CharT>::~__timepunct()
141.2680 -+    { 
141.2681 -+      if (_M_name_timepunct != _S_get_c_name())
141.2682 -+	delete [] _M_name_timepunct;
141.2683 -+      delete _M_data; 
141.2684 -+      _S_destroy_c_locale(_M_c_locale_timepunct); 
141.2685 -+    }
141.2686 -diff -durN gcc-4.3.1.orig/libstdc++-v3/configure gcc-4.3.1/libstdc++-v3/configure
141.2687 ---- gcc-4.3.1.orig/libstdc++-v3/configure	2008-04-25 18:52:57.000000000 +0200
141.2688 -+++ gcc-4.3.1/libstdc++-v3/configure	2008-06-10 14:58:39.000000000 +0200
141.2689 -@@ -14001,7 +14001,7 @@
141.2690 -   enableval="$enable_clocale"
141.2691 - 
141.2692 -       case "$enableval" in
141.2693 --       generic|gnu|ieee_1003.1-2001|yes|no|auto) ;;
141.2694 -+       generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto) ;;
141.2695 -        *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable clocale" >&5
141.2696 - echo "$as_me: error: Unknown argument to enable/disable clocale" >&2;}
141.2697 -    { (exit 1); exit 1; }; } ;;
141.2698 -@@ -14034,6 +14034,9 @@
141.2699 -   # Default to "generic".
141.2700 -   if test $enable_clocale_flag = auto; then
141.2701 -     case ${target_os} in
141.2702 -+      linux-uclibc*)
141.2703 -+        enable_clocale_flag=uclibc
141.2704 -+	;;
141.2705 -       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
141.2706 -         enable_clocale_flag=gnu
141.2707 -         ;;
141.2708 -@@ -14422,6 +14425,76 @@
141.2709 -       CTIME_CC=config/locale/generic/time_members.cc
141.2710 -       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
141.2711 -       ;;
141.2712 -+    uclibc)
141.2713 -+      echo "$as_me:$LINENO: result: uclibc" >&5
141.2714 -+echo "${ECHO_T}uclibc" >&6
141.2715 -+
141.2716 -+      # Declare intention to use gettext, and add support for specific
141.2717 -+      # languages.
141.2718 -+      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
141.2719 -+      ALL_LINGUAS="de fr"
141.2720 -+
141.2721 -+      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
141.2722 -+      # Extract the first word of "msgfmt", so it can be a program name with args.
141.2723 -+set dummy msgfmt; ac_word=$2
141.2724 -+echo "$as_me:$LINENO: checking for $ac_word" >&5
141.2725 -+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
141.2726 -+if test "${ac_cv_prog_check_msgfmt+set}" = set; then
141.2727 -+  echo $ECHO_N "(cached) $ECHO_C" >&6
141.2728 -+else
141.2729 -+  if test -n "$check_msgfmt"; then
141.2730 -+  ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
141.2731 -+else
141.2732 -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
141.2733 -+for as_dir in $PATH
141.2734 -+do
141.2735 -+  IFS=$as_save_IFS
141.2736 -+  test -z "$as_dir" && as_dir=.
141.2737 -+  for ac_exec_ext in '' $ac_executable_extensions; do
141.2738 -+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
141.2739 -+    ac_cv_prog_check_msgfmt="yes"
141.2740 -+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
141.2741 -+    break 2
141.2742 -+  fi
141.2743 -+done
141.2744 -+done
141.2745 -+
141.2746 -+  test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
141.2747 -+fi
141.2748 -+fi
141.2749 -+check_msgfmt=$ac_cv_prog_check_msgfmt
141.2750 -+if test -n "$check_msgfmt"; then
141.2751 -+  echo "$as_me:$LINENO: result: $check_msgfmt" >&5
141.2752 -+echo "${ECHO_T}$check_msgfmt" >&6
141.2753 -+else
141.2754 -+  echo "$as_me:$LINENO: result: no" >&5
141.2755 -+echo "${ECHO_T}no" >&6
141.2756 -+fi
141.2757 -+
141.2758 -+      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
141.2759 -+        USE_NLS=yes
141.2760 -+      fi
141.2761 -+      # Export the build objects.
141.2762 -+      for ling in $ALL_LINGUAS; do \
141.2763 -+        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
141.2764 -+        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
141.2765 -+      done
141.2766 -+
141.2767 -+
141.2768 -+
141.2769 -+      CLOCALE_H=config/locale/uclibc/c_locale.h
141.2770 -+      CLOCALE_CC=config/locale/uclibc/c_locale.cc
141.2771 -+      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
141.2772 -+      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
141.2773 -+      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
141.2774 -+      CMESSAGES_H=config/locale/uclibc/messages_members.h
141.2775 -+      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
141.2776 -+      CMONEY_CC=config/locale/uclibc/monetary_members.cc
141.2777 -+      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
141.2778 -+      CTIME_H=config/locale/uclibc/time_members.h
141.2779 -+      CTIME_CC=config/locale/uclibc/time_members.cc
141.2780 -+      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
141.2781 -+      ;;
141.2782 -   esac
141.2783 - 
141.2784 -   # This is where the testsuite looks for locale catalogs, using the
141.2785 -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
141.2786 ---- gcc-4.3.1.orig/libstdc++-v3/include/c_compatibility/wchar.h	2007-03-04 23:59:49.000000000 +0100
141.2787 -+++ gcc-4.3.1/libstdc++-v3/include/c_compatibility/wchar.h	2008-06-10 14:58:39.000000000 +0200
141.2788 -@@ -106,7 +106,9 @@
141.2789 - using std::wmemcpy;
141.2790 - using std::wmemmove;
141.2791 - using std::wmemset;
141.2792 -+#if _GLIBCXX_HAVE_WCSFTIME
141.2793 - using std::wcsftime;
141.2794 -+#endif
141.2795 - 
141.2796 - #if _GLIBCXX_USE_C99
141.2797 - using std::wcstold;
   142.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   142.2 +++ b/patches/gcc/4.3.1/525-uclibc-locale.patch	Mon Jul 28 21:08:01 2008 +0000
   142.3 @@ -0,0 +1,2794 @@
   142.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_200-uclibc-locale.patch
   142.5 +diff -durN gcc-4.3.1.orig/libstdc++-v3/acinclude.m4 gcc-4.3.1/libstdc++-v3/acinclude.m4
   142.6 +--- gcc-4.3.1.orig/libstdc++-v3/acinclude.m4	2008-04-25 18:52:57.000000000 +0200
   142.7 ++++ gcc-4.3.1/libstdc++-v3/acinclude.m4	2008-06-10 14:58:39.000000000 +0200
   142.8 +@@ -1349,7 +1349,7 @@
   142.9 + AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
  142.10 +   GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
  142.11 +     [use MODEL for target locale package],
  142.12 +-    [permit generic|gnu|ieee_1003.1-2001|yes|no|auto])
  142.13 ++    [permit generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto])
  142.14 + 
  142.15 +   # Deal with gettext issues.  Default to not using it (=no) until we detect
  142.16 +   # support for it later.  Let the user turn it off via --e/d, but let that
  142.17 +@@ -1370,6 +1370,9 @@
  142.18 +   # Default to "generic".
  142.19 +   if test $enable_clocale_flag = auto; then
  142.20 +     case ${target_os} in
  142.21 ++      *-uclibc*)
  142.22 ++        enable_clocale_flag=uclibc
  142.23 ++        ;;
  142.24 +       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
  142.25 +         enable_clocale_flag=gnu	
  142.26 +         ;;
  142.27 +@@ -1541,6 +1544,40 @@
  142.28 +       CTIME_CC=config/locale/generic/time_members.cc
  142.29 +       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
  142.30 +       ;;
  142.31 ++    uclibc)
  142.32 ++      AC_MSG_RESULT(uclibc)
  142.33 ++
  142.34 ++      # Declare intention to use gettext, and add support for specific
  142.35 ++      # languages.
  142.36 ++      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
  142.37 ++      ALL_LINGUAS="de fr"
  142.38 ++
  142.39 ++      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
  142.40 ++      AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
  142.41 ++      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
  142.42 ++        USE_NLS=yes
  142.43 ++      fi
  142.44 ++      # Export the build objects.
  142.45 ++      for ling in $ALL_LINGUAS; do \
  142.46 ++        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
  142.47 ++        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
  142.48 ++      done
  142.49 ++      AC_SUBST(glibcxx_MOFILES)
  142.50 ++      AC_SUBST(glibcxx_POFILES)
  142.51 ++
  142.52 ++      CLOCALE_H=config/locale/uclibc/c_locale.h
  142.53 ++      CLOCALE_CC=config/locale/uclibc/c_locale.cc
  142.54 ++      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
  142.55 ++      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
  142.56 ++      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
  142.57 ++      CMESSAGES_H=config/locale/uclibc/messages_members.h
  142.58 ++      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
  142.59 ++      CMONEY_CC=config/locale/uclibc/monetary_members.cc
  142.60 ++      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
  142.61 ++      CTIME_H=config/locale/uclibc/time_members.h
  142.62 ++      CTIME_CC=config/locale/uclibc/time_members.cc
  142.63 ++      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
  142.64 ++      ;;
  142.65 +   esac
  142.66 + 
  142.67 +   # This is where the testsuite looks for locale catalogs, using the
  142.68 +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
  142.69 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	1970-01-01 01:00:00.000000000 +0100
  142.70 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2008-06-10 14:58:39.000000000 +0200
  142.71 +@@ -0,0 +1,63 @@
  142.72 ++// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
  142.73 ++
  142.74 ++// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
  142.75 ++//
  142.76 ++// This file is part of the GNU ISO C++ Library.  This library is free
  142.77 ++// software; you can redistribute it and/or modify it under the
  142.78 ++// terms of the GNU General Public License as published by the
  142.79 ++// Free Software Foundation; either version 2, or (at your option)
  142.80 ++// any later version.
  142.81 ++
  142.82 ++// This library is distributed in the hope that it will be useful,
  142.83 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
  142.84 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  142.85 ++// GNU General Public License for more details.
  142.86 ++
  142.87 ++// You should have received a copy of the GNU General Public License along
  142.88 ++// with this library; see the file COPYING.  If not, write to the Free
  142.89 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  142.90 ++// USA.
  142.91 ++
  142.92 ++// As a special exception, you may use this file as part of a free software
  142.93 ++// library without restriction.  Specifically, if other files instantiate
  142.94 ++// templates or use macros or inline functions from this file, or you compile
  142.95 ++// this file and link it with other files to produce an executable, this
  142.96 ++// file does not by itself cause the resulting executable to be covered by
  142.97 ++// the GNU General Public License.  This exception does not however
  142.98 ++// invalidate any other reasons why the executable file might be covered by
  142.99 ++// the GNU General Public License.
 142.100 ++
 142.101 ++// Written by Jakub Jelinek <jakub@redhat.com>
 142.102 ++
 142.103 ++#include <bits/c++config.h>
 142.104 ++#include <clocale>
 142.105 ++
 142.106 ++#ifdef __UCLIBC_MJN3_ONLY__
 142.107 ++#warning clean this up
 142.108 ++#endif
 142.109 ++
 142.110 ++#ifdef __UCLIBC_HAS_XLOCALE__
 142.111 ++                                                  
 142.112 ++extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
 142.113 ++extern "C" __typeof(strcoll_l) __strcoll_l;
 142.114 ++extern "C" __typeof(strftime_l) __strftime_l;
 142.115 ++extern "C" __typeof(strtod_l) __strtod_l;
 142.116 ++extern "C" __typeof(strtof_l) __strtof_l;
 142.117 ++extern "C" __typeof(strtold_l) __strtold_l;
 142.118 ++extern "C" __typeof(strxfrm_l) __strxfrm_l;
 142.119 ++extern "C" __typeof(newlocale) __newlocale;
 142.120 ++extern "C" __typeof(freelocale) __freelocale;
 142.121 ++extern "C" __typeof(duplocale) __duplocale;
 142.122 ++extern "C" __typeof(uselocale) __uselocale;
 142.123 ++
 142.124 ++#ifdef _GLIBCXX_USE_WCHAR_T
 142.125 ++extern "C" __typeof(iswctype_l) __iswctype_l;
 142.126 ++extern "C" __typeof(towlower_l) __towlower_l;
 142.127 ++extern "C" __typeof(towupper_l) __towupper_l;
 142.128 ++extern "C" __typeof(wcscoll_l) __wcscoll_l;
 142.129 ++extern "C" __typeof(wcsftime_l) __wcsftime_l;
 142.130 ++extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
 142.131 ++extern "C" __typeof(wctype_l) __wctype_l;
 142.132 ++#endif 
 142.133 ++
 142.134 ++#endif // GLIBC 2.3 and later
 142.135 +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
 142.136 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc	1970-01-01 01:00:00.000000000 +0100
 142.137 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.cc	2008-06-10 14:58:39.000000000 +0200
 142.138 +@@ -0,0 +1,160 @@
 142.139 ++// Wrapper for underlying C-language localization -*- C++ -*-
 142.140 ++
 142.141 ++// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
 142.142 ++//
 142.143 ++// This file is part of the GNU ISO C++ Library.  This library is free
 142.144 ++// software; you can redistribute it and/or modify it under the
 142.145 ++// terms of the GNU General Public License as published by the
 142.146 ++// Free Software Foundation; either version 2, or (at your option)
 142.147 ++// any later version.
 142.148 ++
 142.149 ++// This library is distributed in the hope that it will be useful,
 142.150 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 142.151 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 142.152 ++// GNU General Public License for more details.
 142.153 ++
 142.154 ++// You should have received a copy of the GNU General Public License along
 142.155 ++// with this library; see the file COPYING.  If not, write to the Free
 142.156 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 142.157 ++// USA.
 142.158 ++
 142.159 ++// As a special exception, you may use this file as part of a free software
 142.160 ++// library without restriction.  Specifically, if other files instantiate
 142.161 ++// templates or use macros or inline functions from this file, or you compile
 142.162 ++// this file and link it with other files to produce an executable, this
 142.163 ++// file does not by itself cause the resulting executable to be covered by
 142.164 ++// the GNU General Public License.  This exception does not however
 142.165 ++// invalidate any other reasons why the executable file might be covered by
 142.166 ++// the GNU General Public License.
 142.167 ++
 142.168 ++//
 142.169 ++// ISO C++ 14882: 22.8  Standard locale categories.
 142.170 ++//
 142.171 ++
 142.172 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 142.173 ++
 142.174 ++#include <cerrno>  // For errno
 142.175 ++#include <locale>
 142.176 ++#include <stdexcept>
 142.177 ++#include <langinfo.h>
 142.178 ++#include <bits/c++locale_internal.h>
 142.179 ++
 142.180 ++#ifndef __UCLIBC_HAS_XLOCALE__
 142.181 ++#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
 142.182 ++#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
 142.183 ++#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
 142.184 ++#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
 142.185 ++#define __strtof_l(S, E, L)         strtof((S), (E))
 142.186 ++#define __strtod_l(S, E, L)         strtod((S), (E))
 142.187 ++#define __strtold_l(S, E, L)        strtold((S), (E))
 142.188 ++#warning should dummy __newlocale check for C|POSIX ?
 142.189 ++#define __newlocale(a, b, c)        NULL
 142.190 ++#define __freelocale(a)             ((void)0)
 142.191 ++#define __duplocale(a)              __c_locale()
 142.192 ++#endif
 142.193 ++
 142.194 ++namespace std 
 142.195 ++{
 142.196 ++  template<>
 142.197 ++    void
 142.198 ++    __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, 
 142.199 ++		   const __c_locale& __cloc)
 142.200 ++    {
 142.201 ++      if (!(__err & ios_base::failbit))
 142.202 ++	{
 142.203 ++	  char* __sanity;
 142.204 ++	  errno = 0;
 142.205 ++	  float __f = __strtof_l(__s, &__sanity, __cloc);
 142.206 ++          if (__sanity != __s && errno != ERANGE)
 142.207 ++	    __v = __f;
 142.208 ++	  else
 142.209 ++	    __err |= ios_base::failbit;
 142.210 ++	}
 142.211 ++    }
 142.212 ++
 142.213 ++  template<>
 142.214 ++    void
 142.215 ++    __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, 
 142.216 ++		   const __c_locale& __cloc)
 142.217 ++    {
 142.218 ++      if (!(__err & ios_base::failbit))
 142.219 ++	{
 142.220 ++	  char* __sanity;
 142.221 ++	  errno = 0;
 142.222 ++	  double __d = __strtod_l(__s, &__sanity, __cloc);
 142.223 ++          if (__sanity != __s && errno != ERANGE)
 142.224 ++	    __v = __d;
 142.225 ++	  else
 142.226 ++	    __err |= ios_base::failbit;
 142.227 ++	}
 142.228 ++    }
 142.229 ++
 142.230 ++  template<>
 142.231 ++    void
 142.232 ++    __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
 142.233 ++		   const __c_locale& __cloc)
 142.234 ++    {
 142.235 ++      if (!(__err & ios_base::failbit))
 142.236 ++	{
 142.237 ++	  char* __sanity;
 142.238 ++	  errno = 0;
 142.239 ++	  long double __ld = __strtold_l(__s, &__sanity, __cloc);
 142.240 ++          if (__sanity != __s && errno != ERANGE)
 142.241 ++	    __v = __ld;
 142.242 ++	  else
 142.243 ++	    __err |= ios_base::failbit;
 142.244 ++	}
 142.245 ++    }
 142.246 ++
 142.247 ++  void
 142.248 ++  locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s, 
 142.249 ++				    __c_locale __old)
 142.250 ++  {
 142.251 ++    __cloc = __newlocale(1 << LC_ALL, __s, __old);
 142.252 ++#ifdef __UCLIBC_HAS_XLOCALE__
 142.253 ++    if (!__cloc)
 142.254 ++      {
 142.255 ++	// This named locale is not supported by the underlying OS.
 142.256 ++	__throw_runtime_error(__N("locale::facet::_S_create_c_locale "
 142.257 ++			      "name not valid"));
 142.258 ++      }
 142.259 ++#endif
 142.260 ++  }
 142.261 ++  
 142.262 ++  void
 142.263 ++  locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
 142.264 ++  {
 142.265 ++    if (_S_get_c_locale() != __cloc)
 142.266 ++      __freelocale(__cloc); 
 142.267 ++  }
 142.268 ++
 142.269 ++  __c_locale
 142.270 ++  locale::facet::_S_clone_c_locale(__c_locale& __cloc)
 142.271 ++  { return __duplocale(__cloc); }
 142.272 ++} // namespace std
 142.273 ++
 142.274 ++namespace __gnu_cxx
 142.275 ++{
 142.276 ++  const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
 142.277 ++    {
 142.278 ++      "LC_CTYPE", 
 142.279 ++      "LC_NUMERIC",
 142.280 ++      "LC_TIME", 
 142.281 ++      "LC_COLLATE", 
 142.282 ++      "LC_MONETARY",
 142.283 ++      "LC_MESSAGES", 
 142.284 ++#if _GLIBCXX_NUM_CATEGORIES != 0
 142.285 ++      "LC_PAPER", 
 142.286 ++      "LC_NAME", 
 142.287 ++      "LC_ADDRESS",
 142.288 ++      "LC_TELEPHONE", 
 142.289 ++      "LC_MEASUREMENT", 
 142.290 ++      "LC_IDENTIFICATION" 
 142.291 ++#endif
 142.292 ++    };
 142.293 ++}
 142.294 ++
 142.295 ++namespace std
 142.296 ++{
 142.297 ++  const char* const* const locale::_S_categories = __gnu_cxx::category_names;
 142.298 ++}  // namespace std
 142.299 +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
 142.300 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h	1970-01-01 01:00:00.000000000 +0100
 142.301 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.h	2008-06-10 14:58:39.000000000 +0200
 142.302 +@@ -0,0 +1,117 @@
 142.303 ++// Wrapper for underlying C-language localization -*- C++ -*-
 142.304 ++
 142.305 ++// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 142.306 ++//
 142.307 ++// This file is part of the GNU ISO C++ Library.  This library is free
 142.308 ++// software; you can redistribute it and/or modify it under the
 142.309 ++// terms of the GNU General Public License as published by the
 142.310 ++// Free Software Foundation; either version 2, or (at your option)
 142.311 ++// any later version.
 142.312 ++
 142.313 ++// This library is distributed in the hope that it will be useful,
 142.314 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 142.315 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 142.316 ++// GNU General Public License for more details.
 142.317 ++
 142.318 ++// You should have received a copy of the GNU General Public License along
 142.319 ++// with this library; see the file COPYING.  If not, write to the Free
 142.320 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 142.321 ++// USA.
 142.322 ++
 142.323 ++// As a special exception, you may use this file as part of a free software
 142.324 ++// library without restriction.  Specifically, if other files instantiate
 142.325 ++// templates or use macros or inline functions from this file, or you compile
 142.326 ++// this file and link it with other files to produce an executable, this
 142.327 ++// file does not by itself cause the resulting executable to be covered by
 142.328 ++// the GNU General Public License.  This exception does not however
 142.329 ++// invalidate any other reasons why the executable file might be covered by
 142.330 ++// the GNU General Public License.
 142.331 ++
 142.332 ++//
 142.333 ++// ISO C++ 14882: 22.8  Standard locale categories.
 142.334 ++//
 142.335 ++
 142.336 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 142.337 ++
 142.338 ++#ifndef _C_LOCALE_H
 142.339 ++#define _C_LOCALE_H 1
 142.340 ++
 142.341 ++#pragma GCC system_header
 142.342 ++
 142.343 ++#include <cstring>              // get std::strlen
 142.344 ++#include <cstdio>               // get std::snprintf or std::sprintf
 142.345 ++#include <clocale>
 142.346 ++#include <langinfo.h>		// For codecvt
 142.347 ++#ifdef __UCLIBC_MJN3_ONLY__
 142.348 ++#warning fix this
 142.349 ++#endif
 142.350 ++#ifdef __UCLIBC_HAS_LOCALE__
 142.351 ++#include <iconv.h>		// For codecvt using iconv, iconv_t
 142.352 ++#endif
 142.353 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 142.354 ++#include <libintl.h> 		// For messages
 142.355 ++#endif
 142.356 ++
 142.357 ++#ifdef __UCLIBC_MJN3_ONLY__
 142.358 ++#warning what is _GLIBCXX_C_LOCALE_GNU for
 142.359 ++#endif
 142.360 ++#define _GLIBCXX_C_LOCALE_GNU 1
 142.361 ++
 142.362 ++#ifdef __UCLIBC_MJN3_ONLY__
 142.363 ++#warning fix categories
 142.364 ++#endif
 142.365 ++// #define _GLIBCXX_NUM_CATEGORIES 6
 142.366 ++#define _GLIBCXX_NUM_CATEGORIES 0
 142.367 ++ 
 142.368 ++#ifdef __UCLIBC_HAS_XLOCALE__
 142.369 ++namespace __gnu_cxx
 142.370 ++{
 142.371 ++  extern "C" __typeof(uselocale) __uselocale;
 142.372 ++}
 142.373 ++#endif
 142.374 ++
 142.375 ++namespace std
 142.376 ++{
 142.377 ++#ifdef __UCLIBC_HAS_XLOCALE__
 142.378 ++  typedef __locale_t		__c_locale;
 142.379 ++#else
 142.380 ++  typedef int*			__c_locale;
 142.381 ++#endif
 142.382 ++
 142.383 ++  // Convert numeric value of type _Tv to string and return length of
 142.384 ++  // string.  If snprintf is available use it, otherwise fall back to
 142.385 ++  // the unsafe sprintf which, in general, can be dangerous and should
 142.386 ++  // be avoided.
 142.387 ++  template<typename _Tv>
 142.388 ++    int
 142.389 ++    __convert_from_v(char* __out, 
 142.390 ++		     const int __size __attribute__ ((__unused__)),
 142.391 ++		     const char* __fmt,
 142.392 ++#ifdef __UCLIBC_HAS_XCLOCALE__
 142.393 ++		     _Tv __v, const __c_locale& __cloc, int __prec)
 142.394 ++    {
 142.395 ++      __c_locale __old = __gnu_cxx::__uselocale(__cloc);
 142.396 ++#else
 142.397 ++		     _Tv __v, const __c_locale&, int __prec)
 142.398 ++    {
 142.399 ++# ifdef __UCLIBC_HAS_LOCALE__
 142.400 ++      char* __old = std::setlocale(LC_ALL, NULL);
 142.401 ++      char* __sav = new char[std::strlen(__old) + 1];
 142.402 ++      std::strcpy(__sav, __old);
 142.403 ++      std::setlocale(LC_ALL, "C");
 142.404 ++# endif
 142.405 ++#endif
 142.406 ++
 142.407 ++      const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
 142.408 ++
 142.409 ++#ifdef __UCLIBC_HAS_XCLOCALE__
 142.410 ++      __gnu_cxx::__uselocale(__old);
 142.411 ++#elif defined __UCLIBC_HAS_LOCALE__
 142.412 ++      std::setlocale(LC_ALL, __sav);
 142.413 ++      delete [] __sav;
 142.414 ++#endif
 142.415 ++      return __ret;
 142.416 ++    }
 142.417 ++}
 142.418 ++
 142.419 ++#endif
 142.420 +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
 142.421 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/codecvt_members.cc	1970-01-01 01:00:00.000000000 +0100
 142.422 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/codecvt_members.cc	2008-06-10 14:58:39.000000000 +0200
 142.423 +@@ -0,0 +1,306 @@
 142.424 ++// std::codecvt implementation details, GNU version -*- C++ -*-
 142.425 ++
 142.426 ++// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
 142.427 ++//
 142.428 ++// This file is part of the GNU ISO C++ Library.  This library is free
 142.429 ++// software; you can redistribute it and/or modify it under the
 142.430 ++// terms of the GNU General Public License as published by the
 142.431 ++// Free Software Foundation; either version 2, or (at your option)
 142.432 ++// any later version.
 142.433 ++
 142.434 ++// This library is distributed in the hope that it will be useful,
 142.435 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 142.436 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 142.437 ++// GNU General Public License for more details.
 142.438 ++
 142.439 ++// You should have received a copy of the GNU General Public License along
 142.440 ++// with this library; see the file COPYING.  If not, write to the Free
 142.441 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 142.442 ++// USA.
 142.443 ++
 142.444 ++// As a special exception, you may use this file as part of a free software
 142.445 ++// library without restriction.  Specifically, if other files instantiate
 142.446 ++// templates or use macros or inline functions from this file, or you compile
 142.447 ++// this file and link it with other files to produce an executable, this
 142.448 ++// file does not by itself cause the resulting executable to be covered by
 142.449 ++// the GNU General Public License.  This exception does not however
 142.450 ++// invalidate any other reasons why the executable file might be covered by
 142.451 ++// the GNU General Public License.
 142.452 ++
 142.453 ++//
 142.454 ++// ISO C++ 14882: 22.2.1.5 - Template class codecvt
 142.455 ++//
 142.456 ++
 142.457 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 142.458 ++
 142.459 ++#include <locale>
 142.460 ++#include <bits/c++locale_internal.h>
 142.461 ++
 142.462 ++namespace std
 142.463 ++{
 142.464 ++  // Specializations.
 142.465 ++#ifdef _GLIBCXX_USE_WCHAR_T
 142.466 ++  codecvt_base::result
 142.467 ++  codecvt<wchar_t, char, mbstate_t>::
 142.468 ++  do_out(state_type& __state, const intern_type* __from, 
 142.469 ++	 const intern_type* __from_end, const intern_type*& __from_next,
 142.470 ++	 extern_type* __to, extern_type* __to_end,
 142.471 ++	 extern_type*& __to_next) const
 142.472 ++  {
 142.473 ++    result __ret = ok;
 142.474 ++    state_type __tmp_state(__state);
 142.475 ++
 142.476 ++#ifdef __UCLIBC_HAS_XLOCALE__
 142.477 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 142.478 ++#endif
 142.479 ++
 142.480 ++    // wcsnrtombs is *very* fast but stops if encounters NUL characters:
 142.481 ++    // in case we fall back to wcrtomb and then continue, in a loop.
 142.482 ++    // NB: wcsnrtombs is a GNU extension
 142.483 ++    for (__from_next = __from, __to_next = __to;
 142.484 ++	 __from_next < __from_end && __to_next < __to_end
 142.485 ++	 && __ret == ok;)
 142.486 ++      {
 142.487 ++	const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
 142.488 ++						      __from_end - __from_next);
 142.489 ++	if (!__from_chunk_end)
 142.490 ++	  __from_chunk_end = __from_end;
 142.491 ++
 142.492 ++	__from = __from_next;
 142.493 ++	const size_t __conv = wcsnrtombs(__to_next, &__from_next,
 142.494 ++					 __from_chunk_end - __from_next,
 142.495 ++					 __to_end - __to_next, &__state);
 142.496 ++	if (__conv == static_cast<size_t>(-1))
 142.497 ++	  {
 142.498 ++	    // In case of error, in order to stop at the exact place we
 142.499 ++	    // have to start again from the beginning with a series of
 142.500 ++	    // wcrtomb.
 142.501 ++	    for (; __from < __from_next; ++__from)
 142.502 ++	      __to_next += wcrtomb(__to_next, *__from, &__tmp_state);
 142.503 ++	    __state = __tmp_state;
 142.504 ++	    __ret = error;
 142.505 ++	  }
 142.506 ++	else if (__from_next && __from_next < __from_chunk_end)
 142.507 ++	  {
 142.508 ++	    __to_next += __conv;
 142.509 ++	    __ret = partial;
 142.510 ++	  }
 142.511 ++	else
 142.512 ++	  {
 142.513 ++	    __from_next = __from_chunk_end;
 142.514 ++	    __to_next += __conv;
 142.515 ++	  }
 142.516 ++
 142.517 ++	if (__from_next < __from_end && __ret == ok)
 142.518 ++	  {
 142.519 ++	    extern_type __buf[MB_LEN_MAX];
 142.520 ++	    __tmp_state = __state;
 142.521 ++	    const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
 142.522 ++	    if (__conv > static_cast<size_t>(__to_end - __to_next))
 142.523 ++	      __ret = partial;
 142.524 ++	    else
 142.525 ++	      {
 142.526 ++		memcpy(__to_next, __buf, __conv);
 142.527 ++		__state = __tmp_state;
 142.528 ++		__to_next += __conv;
 142.529 ++		++__from_next;
 142.530 ++	      }
 142.531 ++	  }
 142.532 ++      }
 142.533 ++
 142.534 ++#ifdef __UCLIBC_HAS_XLOCALE__
 142.535 ++    __uselocale(__old);
 142.536 ++#endif
 142.537 ++
 142.538 ++    return __ret; 
 142.539 ++  }
 142.540 ++  
 142.541 ++  codecvt_base::result
 142.542 ++  codecvt<wchar_t, char, mbstate_t>::
 142.543 ++  do_in(state_type& __state, const extern_type* __from, 
 142.544 ++	const extern_type* __from_end, const extern_type*& __from_next,
 142.545 ++	intern_type* __to, intern_type* __to_end,
 142.546 ++	intern_type*& __to_next) const
 142.547 ++  {
 142.548 ++    result __ret = ok;
 142.549 ++    state_type __tmp_state(__state);
 142.550 ++
 142.551 ++#ifdef __UCLIBC_HAS_XLOCALE__
 142.552 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 142.553 ++#endif
 142.554 ++
 142.555 ++    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
 142.556 ++    // in case we store a L'\0' and then continue, in a loop.
 142.557 ++    // NB: mbsnrtowcs is a GNU extension
 142.558 ++    for (__from_next = __from, __to_next = __to;
 142.559 ++	 __from_next < __from_end && __to_next < __to_end
 142.560 ++	 && __ret == ok;)
 142.561 ++      {
 142.562 ++	const extern_type* __from_chunk_end;
 142.563 ++	__from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
 142.564 ++								  __from_end
 142.565 ++								  - __from_next));
 142.566 ++	if (!__from_chunk_end)
 142.567 ++	  __from_chunk_end = __from_end;
 142.568 ++
 142.569 ++	__from = __from_next;
 142.570 ++	size_t __conv = mbsnrtowcs(__to_next, &__from_next,
 142.571 ++				   __from_chunk_end - __from_next,
 142.572 ++				   __to_end - __to_next, &__state);
 142.573 ++	if (__conv == static_cast<size_t>(-1))
 142.574 ++	  {
 142.575 ++	    // In case of error, in order to stop at the exact place we
 142.576 ++	    // have to start again from the beginning with a series of
 142.577 ++	    // mbrtowc.
 142.578 ++	    for (;; ++__to_next, __from += __conv)
 142.579 ++	      {
 142.580 ++		__conv = mbrtowc(__to_next, __from, __from_end - __from,
 142.581 ++				 &__tmp_state);
 142.582 ++		if (__conv == static_cast<size_t>(-1)
 142.583 ++		    || __conv == static_cast<size_t>(-2))
 142.584 ++		  break;
 142.585 ++	      }
 142.586 ++	    __from_next = __from;
 142.587 ++	    __state = __tmp_state;	    
 142.588 ++	    __ret = error;
 142.589 ++	  }
 142.590 ++	else if (__from_next && __from_next < __from_chunk_end)
 142.591 ++	  {
 142.592 ++	    // It is unclear what to return in this case (see DR 382). 
 142.593 ++	    __to_next += __conv;
 142.594 ++	    __ret = partial;
 142.595 ++	  }
 142.596 ++	else
 142.597 ++	  {
 142.598 ++	    __from_next = __from_chunk_end;
 142.599 ++	    __to_next += __conv;
 142.600 ++	  }
 142.601 ++
 142.602 ++	if (__from_next < __from_end && __ret == ok)
 142.603 ++	  {
 142.604 ++	    if (__to_next < __to_end)
 142.605 ++	      {
 142.606 ++		// XXX Probably wrong for stateful encodings
 142.607 ++		__tmp_state = __state;		
 142.608 ++		++__from_next;
 142.609 ++		*__to_next++ = L'\0';
 142.610 ++	      }
 142.611 ++	    else
 142.612 ++	      __ret = partial;
 142.613 ++	  }
 142.614 ++      }
 142.615 ++
 142.616 ++#ifdef __UCLIBC_HAS_XLOCALE__
 142.617 ++    __uselocale(__old);
 142.618 ++#endif
 142.619 ++
 142.620 ++    return __ret; 
 142.621 ++  }
 142.622 ++
 142.623 ++  int 
 142.624 ++  codecvt<wchar_t, char, mbstate_t>::
 142.625 ++  do_encoding() const throw()
 142.626 ++  {
 142.627 ++    // XXX This implementation assumes that the encoding is
 142.628 ++    // stateless and is either single-byte or variable-width.
 142.629 ++    int __ret = 0;
 142.630 ++#ifdef __UCLIBC_HAS_XLOCALE__
 142.631 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 142.632 ++#endif
 142.633 ++    if (MB_CUR_MAX == 1)
 142.634 ++      __ret = 1;
 142.635 ++#ifdef __UCLIBC_HAS_XLOCALE__
 142.636 ++    __uselocale(__old);
 142.637 ++#endif
 142.638 ++    return __ret;
 142.639 ++  }  
 142.640 ++
 142.641 ++  int 
 142.642 ++  codecvt<wchar_t, char, mbstate_t>::
 142.643 ++  do_max_length() const throw()
 142.644 ++  {
 142.645 ++#ifdef __UCLIBC_HAS_XLOCALE__
 142.646 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 142.647 ++#endif
 142.648 ++    // XXX Probably wrong for stateful encodings.
 142.649 ++    int __ret = MB_CUR_MAX;
 142.650 ++#ifdef __UCLIBC_HAS_XLOCALE__
 142.651 ++    __uselocale(__old);
 142.652 ++#endif
 142.653 ++    return __ret;
 142.654 ++  }
 142.655 ++  
 142.656 ++  int 
 142.657 ++  codecvt<wchar_t, char, mbstate_t>::
 142.658 ++  do_length(state_type& __state, const extern_type* __from,
 142.659 ++	    const extern_type* __end, size_t __max) const
 142.660 ++  {
 142.661 ++    int __ret = 0;
 142.662 ++    state_type __tmp_state(__state);
 142.663 ++
 142.664 ++#ifdef __UCLIBC_HAS_XLOCALE__
 142.665 ++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
 142.666 ++#endif
 142.667 ++
 142.668 ++    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
 142.669 ++    // in case we advance past it and then continue, in a loop.
 142.670 ++    // NB: mbsnrtowcs is a GNU extension
 142.671 ++  
 142.672 ++    // A dummy internal buffer is needed in order for mbsnrtocws to consider
 142.673 ++    // its fourth parameter (it wouldn't with NULL as first parameter).
 142.674 ++    wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t) 
 142.675 ++							   * __max));
 142.676 ++    while (__from < __end && __max)
 142.677 ++      {
 142.678 ++	const extern_type* __from_chunk_end;
 142.679 ++	__from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
 142.680 ++								  __end
 142.681 ++								  - __from));
 142.682 ++	if (!__from_chunk_end)
 142.683 ++	  __from_chunk_end = __end;
 142.684 ++
 142.685 ++	const extern_type* __tmp_from = __from;
 142.686 ++	size_t __conv = mbsnrtowcs(__to, &__from,
 142.687 ++				   __from_chunk_end - __from,
 142.688 ++				   __max, &__state);
 142.689 ++	if (__conv == static_cast<size_t>(-1))
 142.690 ++	  {
 142.691 ++	    // In case of error, in order to stop at the exact place we
 142.692 ++	    // have to start again from the beginning with a series of
 142.693 ++	    // mbrtowc.
 142.694 ++	    for (__from = __tmp_from;; __from += __conv)
 142.695 ++	      {
 142.696 ++		__conv = mbrtowc(NULL, __from, __end - __from,
 142.697 ++				 &__tmp_state);
 142.698 ++		if (__conv == static_cast<size_t>(-1)
 142.699 ++		    || __conv == static_cast<size_t>(-2))
 142.700 ++		  break;
 142.701 ++	      }
 142.702 ++	    __state = __tmp_state;
 142.703 ++	    __ret += __from - __tmp_from;
 142.704 ++	    break;
 142.705 ++	  }
 142.706 ++	if (!__from)
 142.707 ++	  __from = __from_chunk_end;
 142.708 ++	
 142.709 ++	__ret += __from - __tmp_from;
 142.710 ++	__max -= __conv;
 142.711 ++
 142.712 ++	if (__from < __end && __max)
 142.713 ++	  {
 142.714 ++	    // XXX Probably wrong for stateful encodings
 142.715 ++	    __tmp_state = __state;
 142.716 ++	    ++__from;
 142.717 ++	    ++__ret;
 142.718 ++	    --__max;
 142.719 ++	  }
 142.720 ++      }
 142.721 ++
 142.722 ++#ifdef __UCLIBC_HAS_XLOCALE__
 142.723 ++    __uselocale(__old);
 142.724 ++#endif
 142.725 ++
 142.726 ++    return __ret; 
 142.727 ++  }
 142.728 ++#endif
 142.729 ++}
 142.730 +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
 142.731 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc	1970-01-01 01:00:00.000000000 +0100
 142.732 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/collate_members.cc	2008-06-10 14:58:39.000000000 +0200
 142.733 +@@ -0,0 +1,80 @@
 142.734 ++// std::collate implementation details, GNU version -*- C++ -*-
 142.735 ++
 142.736 ++// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
 142.737 ++//
 142.738 ++// This file is part of the GNU ISO C++ Library.  This library is free
 142.739 ++// software; you can redistribute it and/or modify it under the
 142.740 ++// terms of the GNU General Public License as published by the
 142.741 ++// Free Software Foundation; either version 2, or (at your option)
 142.742 ++// any later version.
 142.743 ++
 142.744 ++// This library is distributed in the hope that it will be useful,
 142.745 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 142.746 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 142.747 ++// GNU General Public License for more details.
 142.748 ++
 142.749 ++// You should have received a copy of the GNU General Public License along
 142.750 ++// with this library; see the file COPYING.  If not, write to the Free
 142.751 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 142.752 ++// USA.
 142.753 ++
 142.754 ++// As a special exception, you may use this file as part of a free software
 142.755 ++// library without restriction.  Specifically, if other files instantiate
 142.756 ++// templates or use macros or inline functions from this file, or you compile
 142.757 ++// this file and link it with other files to produce an executable, this
 142.758 ++// file does not by itself cause the resulting executable to be covered by
 142.759 ++// the GNU General Public License.  This exception does not however
 142.760 ++// invalidate any other reasons why the executable file might be covered by
 142.761 ++// the GNU General Public License.
 142.762 ++
 142.763 ++//
 142.764 ++// ISO C++ 14882: 22.2.4.1.2  collate virtual functions
 142.765 ++//
 142.766 ++
 142.767 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 142.768 ++
 142.769 ++#include <locale>
 142.770 ++#include <bits/c++locale_internal.h>
 142.771 ++
 142.772 ++#ifndef __UCLIBC_HAS_XLOCALE__
 142.773 ++#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
 142.774 ++#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
 142.775 ++#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
 142.776 ++#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
 142.777 ++#endif
 142.778 ++
 142.779 ++namespace std
 142.780 ++{
 142.781 ++  // These are basically extensions to char_traits, and perhaps should
 142.782 ++  // be put there instead of here.
 142.783 ++  template<>
 142.784 ++    int 
 142.785 ++    collate<char>::_M_compare(const char* __one, const char* __two) const
 142.786 ++    { 
 142.787 ++      int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
 142.788 ++      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
 142.789 ++    }
 142.790 ++  
 142.791 ++  template<>
 142.792 ++    size_t
 142.793 ++    collate<char>::_M_transform(char* __to, const char* __from, 
 142.794 ++				size_t __n) const 
 142.795 ++    { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
 142.796 ++
 142.797 ++#ifdef _GLIBCXX_USE_WCHAR_T
 142.798 ++  template<>
 142.799 ++    int 
 142.800 ++    collate<wchar_t>::_M_compare(const wchar_t* __one, 
 142.801 ++				 const wchar_t* __two) const
 142.802 ++    {
 142.803 ++      int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
 142.804 ++      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
 142.805 ++    }
 142.806 ++  
 142.807 ++  template<>
 142.808 ++    size_t
 142.809 ++    collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
 142.810 ++				   size_t __n) const
 142.811 ++    { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
 142.812 ++#endif
 142.813 ++}
 142.814 +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
 142.815 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc	1970-01-01 01:00:00.000000000 +0100
 142.816 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2008-06-10 14:58:39.000000000 +0200
 142.817 +@@ -0,0 +1,300 @@
 142.818 ++// std::ctype implementation details, GNU version -*- C++ -*-
 142.819 ++
 142.820 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 142.821 ++//
 142.822 ++// This file is part of the GNU ISO C++ Library.  This library is free
 142.823 ++// software; you can redistribute it and/or modify it under the
 142.824 ++// terms of the GNU General Public License as published by the
 142.825 ++// Free Software Foundation; either version 2, or (at your option)
 142.826 ++// any later version.
 142.827 ++
 142.828 ++// This library is distributed in the hope that it will be useful,
 142.829 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
 142.830 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 142.831 ++// GNU General Public License for more details.
 142.832 ++
 142.833 ++// You should have received a copy of the GNU General Public License along
 142.834 ++// with this library; see the file COPYING.  If not, write to the Free
 142.835 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 142.836 ++// USA.
 142.837 ++
 142.838 ++// As a special exception, you may use this file as part of a free software
 142.839 ++// library without restriction.  Specifically, if other files instantiate
 142.840 ++// templates or use macros or inline functions from this file, or you compile
 142.841 ++// this file and link it with other files to produce an executable, this
 142.842 ++// file does not by itself cause the resulting executable to be covered by
 142.843 ++// the GNU General Public License.  This exception does not however
 142.844 ++// invalidate any other reasons why the executable file might be covered by
 142.845 ++// the GNU General Public License.
 142.846 ++
 142.847 ++//
 142.848 ++// ISO C++ 14882: 22.2.1.1.2  ctype virtual functions.
 142.849 ++//
 142.850 ++
 142.851 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
 142.852 ++
 142.853 ++#define _LIBC
 142.854 ++#include <locale>
 142.855 ++#undef _LIBC
 142.856 ++#include <bits/c++locale_internal.h>
 142.857 ++
 142.858 ++#ifndef __UCLIBC_HAS_XLOCALE__
 142.859 ++#define __wctype_l(S, L)           wctype((S))
 142.860 ++#define __towupper_l(C, L)         towupper((C))
 142.861 ++#define __towlower_l(C, L)         towlower((C))
 142.862 ++#define __iswctype_l(C, M, L)      iswctype((C), (M))
 142.863 ++#endif
 142.864 ++
 142.865 ++namespace std
 142.866 ++{
 142.867 ++  // NB: The other ctype<char> specializations are in src/locale.cc and
 142.868 ++  // various /config/os/* files.
 142.869 ++  template<>
 142.870 ++    ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
 142.871 ++    : ctype<char>(0, false, __refs) 
 142.872 ++    { 		
 142.873 ++      if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
 142.874 ++	{
 142.875 ++	  this->_S_destroy_c_locale(this->_M_c_locale_ctype);
 142.876 ++	  this->_S_create_c_locale(this->_M_c_locale_ctype, __s); 
 142.877 ++#ifdef __UCLIBC_HAS_XLOCALE__
 142.878 ++	  this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
 142.879 ++	  this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
 142.880 ++	  this->_M_table = this->_M_c_locale_ctype->__ctype_b;
 142.881 ++#endif
 142.882 ++	}
 142.883 ++    }
 142.884 ++
 142.885 ++#ifdef _GLIBCXX_USE_WCHAR_T  
 142.886 ++  ctype<wchar_t>::__wmask_type
 142.887 ++  ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
 142.888 ++  {
 142.889 ++    __wmask_type __ret;
 142.890 ++    switch (__m)
 142.891 ++      {
 142.892 ++      case space:
 142.893 ++	__ret = __wctype_l("space", _M_c_locale_ctype);
 142.894 ++	break;
 142.895 ++      case print:
 142.896 ++	__ret = __wctype_l("print", _M_c_locale_ctype);
 142.897 ++	break;
 142.898 ++      case cntrl:
 142.899 ++	__ret = __wctype_l("cntrl", _M_c_locale_ctype);
 142.900 ++	break;
 142.901 ++      case upper:
 142.902 ++	__ret = __wctype_l("upper", _M_c_locale_ctype);
 142.903 ++	break;
 142.904 ++      case lower:
 142.905 ++	__ret = __wctype_l("lower", _M_c_locale_ctype);
 142.906 ++	break;
 142.907 ++      case alpha:
 142.908 ++	__ret = __wctype_l("alpha", _M_c_locale_ctype);
 142.909 ++	break;
 142.910 ++      case digit:
 142.911 ++	__ret = __wctype_l("digit", _M_c_locale_ctype);
 142.912 ++	break;
 142.913 ++      case punct:
 142.914 ++	__ret = __wctype_l("punct", _M_c_locale_ctype);
 142.915 ++	break;
 142.916 ++      case xdigit:
 142.917 ++	__ret = __wctype_l("xdigit", _M_c_locale_ctype);
 142.918 ++	break;
 142.919 ++      case alnum:
 142.920 ++	__ret = __wctype_l("alnum", _M_c_locale_ctype);
 142.921 ++	break;
 142.922 ++      case graph:
 142.923 ++	__ret = __wctype_l("graph", _M_c_locale_ctype);
 142.924 ++	break;
 142.925 ++      default:
 142.926 ++	__ret = __wmask_type();
 142.927 ++      }
 142.928 ++    return __ret;
 142.929 ++  }
 142.930 ++  
 142.931 ++  wchar_t
 142.932 ++  ctype<wchar_t>::do_toupper(wchar_t __c) const
 142.933 ++  { return __towupper_l(__c, _M_c_locale_ctype); }
 142.934 ++
 142.935 ++  const wchar_t*
 142.936 ++  ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
 142.937 ++  {
 142.938 ++    while (__lo < __hi)
 142.939 ++      {
 142.940 ++        *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
 142.941 ++        ++__lo;
 142.942 ++      }
 142.943 ++    return __hi;
 142.944 ++  }
 142.945 ++  
 142.946 ++  wchar_t
 142.947 ++  ctype<wchar_t>::do_tolower(wchar_t __c) const
 142.948 ++  { return __towlower_l(__c, _M_c_locale_ctype); }
 142.949 ++  
 142.950 ++  const wchar_t*
 142.951 ++  ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
 142.952 ++  {
 142.953 ++    while (__lo < __hi)
 142.954 ++      {
 142.955 ++        *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
 142.956 ++        ++__lo;
 142.957 ++      }
 142.958 ++    return __hi;
 142.959 ++  }
 142.960 ++
 142.961 ++  bool
 142.962 ++  ctype<wchar_t>::
 142.963 ++  do_is(mask __m, wchar_t __c) const
 142.964 ++  { 
 142.965 ++    // Highest bitmask in ctype_base == 10, but extra in "C"
 142.966 ++    // library for blank.
 142.967 ++    bool __ret = false;
 142.968 ++    const size_t __bitmasksize = 11; 
 142.969 ++    for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 142.970 ++      if (__m & _M_bit[__bitcur]
 142.971 ++	  && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 142.972 ++	{
 142.973 ++	  __ret = true;
 142.974 ++	  break;
 142.975 ++	}
 142.976 ++    return __ret;    
 142.977 ++  }
 142.978 ++  
 142.979 ++  const wchar_t* 
 142.980 ++  ctype<wchar_t>::
 142.981 ++  do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
 142.982 ++  {
 142.983 ++    for (; __lo < __hi; ++__vec, ++__lo)
 142.984 ++      {
 142.985 ++	// Highest bitmask in ctype_base == 10, but extra in "C"
 142.986 ++	// library for blank.
 142.987 ++	const size_t __bitmasksize = 11; 
 142.988 ++	mask __m = 0;
 142.989 ++	for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 142.990 ++	  if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
 142.991 ++	    __m |= _M_bit[__bitcur];
 142.992 ++	*__vec = __m;
 142.993 ++      }
 142.994 ++    return __hi;
 142.995 ++  }
 142.996 ++  
 142.997 ++  const wchar_t* 
 142.998 ++  ctype<wchar_t>::
 142.999 ++  do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
142.1000 ++  {
142.1001 ++    while (__lo < __hi && !this->do_is(__m, *__lo))
142.1002 ++      ++__lo;
142.1003 ++    return __lo;
142.1004 ++  }
142.1005 ++
142.1006 ++  const wchar_t*
142.1007 ++  ctype<wchar_t>::
142.1008 ++  do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
142.1009 ++  {
142.1010 ++    while (__lo < __hi && this->do_is(__m, *__lo) != 0)
142.1011 ++      ++__lo;
142.1012 ++    return __lo;
142.1013 ++  }
142.1014 ++
142.1015 ++  wchar_t
142.1016 ++  ctype<wchar_t>::
142.1017 ++  do_widen(char __c) const
142.1018 ++  { return _M_widen[static_cast<unsigned char>(__c)]; }
142.1019 ++
142.1020 ++  const char* 
142.1021 ++  ctype<wchar_t>::
142.1022 ++  do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
142.1023 ++  {
142.1024 ++    while (__lo < __hi)
142.1025 ++      {
142.1026 ++	*__dest = _M_widen[static_cast<unsigned char>(*__lo)];
142.1027 ++	++__lo;
142.1028 ++	++__dest;
142.1029 ++      }
142.1030 ++    return __hi;
142.1031 ++  }
142.1032 ++
142.1033 ++  char
142.1034 ++  ctype<wchar_t>::
142.1035 ++  do_narrow(wchar_t __wc, char __dfault) const
142.1036 ++  {
142.1037 ++    if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
142.1038 ++      return _M_narrow[__wc];
142.1039 ++#ifdef __UCLIBC_HAS_XLOCALE__
142.1040 ++    __c_locale __old = __uselocale(_M_c_locale_ctype);
142.1041 ++#endif
142.1042 ++    const int __c = wctob(__wc);
142.1043 ++#ifdef __UCLIBC_HAS_XLOCALE__
142.1044 ++    __uselocale(__old);
142.1045 ++#endif
142.1046 ++    return (__c == EOF ? __dfault : static_cast<char>(__c)); 
142.1047 ++  }
142.1048 ++
142.1049 ++  const wchar_t*
142.1050 ++  ctype<wchar_t>::
142.1051 ++  do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault, 
142.1052 ++	    char* __dest) const
142.1053 ++  {
142.1054 ++#ifdef __UCLIBC_HAS_XLOCALE__
142.1055 ++    __c_locale __old = __uselocale(_M_c_locale_ctype);
142.1056 ++#endif
142.1057 ++    if (_M_narrow_ok)
142.1058 ++      while (__lo < __hi)
142.1059 ++	{
142.1060 ++	  if (*__lo >= 0 && *__lo < 128)
142.1061 ++	    *__dest = _M_narrow[*__lo];
142.1062 ++	  else
142.1063 ++	    {
142.1064 ++	      const int __c = wctob(*__lo);
142.1065 ++	      *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
142.1066 ++	    }
142.1067 ++	  ++__lo;
142.1068 ++	  ++__dest;
142.1069 ++	}
142.1070 ++    else
142.1071 ++      while (__lo < __hi)
142.1072 ++	{
142.1073 ++	  const int __c = wctob(*__lo);
142.1074 ++	  *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
142.1075 ++	  ++__lo;
142.1076 ++	  ++__dest;
142.1077 ++	}
142.1078 ++#ifdef __UCLIBC_HAS_XLOCALE__
142.1079 ++    __uselocale(__old);
142.1080 ++#endif
142.1081 ++    return __hi;
142.1082 ++  }
142.1083 ++
142.1084 ++  void
142.1085 ++  ctype<wchar_t>::_M_initialize_ctype()
142.1086 ++  {
142.1087 ++#ifdef __UCLIBC_HAS_XLOCALE__
142.1088 ++    __c_locale __old = __uselocale(_M_c_locale_ctype);
142.1089 ++#endif
142.1090 ++    wint_t __i;
142.1091 ++    for (__i = 0; __i < 128; ++__i)
142.1092 ++      {
142.1093 ++	const int __c = wctob(__i);
142.1094 ++	if (__c == EOF)
142.1095 ++	  break;
142.1096 ++	else
142.1097 ++	  _M_narrow[__i] = static_cast<char>(__c);
142.1098 ++      }
142.1099 ++    if (__i == 128)
142.1100 ++      _M_narrow_ok = true;
142.1101 ++    else
142.1102 ++      _M_narrow_ok = false;
142.1103 ++    for (size_t __j = 0;
142.1104 ++	 __j < sizeof(_M_widen) / sizeof(wint_t); ++__j)
142.1105 ++      _M_widen[__j] = btowc(__j);
142.1106 ++
142.1107 ++    for (size_t __k = 0; __k <= 11; ++__k)
142.1108 ++      { 
142.1109 ++	_M_bit[__k] = static_cast<mask>(_ISbit(__k));
142.1110 ++	_M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
142.1111 ++      }
142.1112 ++#ifdef __UCLIBC_HAS_XLOCALE__
142.1113 ++    __uselocale(__old);
142.1114 ++#endif
142.1115 ++  }
142.1116 ++#endif //  _GLIBCXX_USE_WCHAR_T
142.1117 ++}
142.1118 +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
142.1119 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc	1970-01-01 01:00:00.000000000 +0100
142.1120 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.cc	2008-06-10 14:58:39.000000000 +0200
142.1121 +@@ -0,0 +1,100 @@
142.1122 ++// std::messages implementation details, GNU version -*- C++ -*-
142.1123 ++
142.1124 ++// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
142.1125 ++//
142.1126 ++// This file is part of the GNU ISO C++ Library.  This library is free
142.1127 ++// software; you can redistribute it and/or modify it under the
142.1128 ++// terms of the GNU General Public License as published by the
142.1129 ++// Free Software Foundation; either version 2, or (at your option)
142.1130 ++// any later version.
142.1131 ++
142.1132 ++// This library is distributed in the hope that it will be useful,
142.1133 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
142.1134 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
142.1135 ++// GNU General Public License for more details.
142.1136 ++
142.1137 ++// You should have received a copy of the GNU General Public License along
142.1138 ++// with this library; see the file COPYING.  If not, write to the Free
142.1139 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
142.1140 ++// USA.
142.1141 ++
142.1142 ++// As a special exception, you may use this file as part of a free software
142.1143 ++// library without restriction.  Specifically, if other files instantiate
142.1144 ++// templates or use macros or inline functions from this file, or you compile
142.1145 ++// this file and link it with other files to produce an executable, this
142.1146 ++// file does not by itself cause the resulting executable to be covered by
142.1147 ++// the GNU General Public License.  This exception does not however
142.1148 ++// invalidate any other reasons why the executable file might be covered by
142.1149 ++// the GNU General Public License.
142.1150 ++
142.1151 ++//
142.1152 ++// ISO C++ 14882: 22.2.7.1.2  messages virtual functions
142.1153 ++//
142.1154 ++
142.1155 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
142.1156 ++
142.1157 ++#include <locale>
142.1158 ++#include <bits/c++locale_internal.h>
142.1159 ++
142.1160 ++#ifdef __UCLIBC_MJN3_ONLY__
142.1161 ++#warning fix gettext stuff
142.1162 ++#endif
142.1163 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
142.1164 ++extern "C" char *__dcgettext(const char *domainname,
142.1165 ++			     const char *msgid, int category);
142.1166 ++#undef gettext
142.1167 ++#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
142.1168 ++#else
142.1169 ++#undef gettext
142.1170 ++#define gettext(msgid) (msgid)
142.1171 ++#endif
142.1172 ++
142.1173 ++namespace std
142.1174 ++{
142.1175 ++  // Specializations.
142.1176 ++  template<>
142.1177 ++    string
142.1178 ++    messages<char>::do_get(catalog, int, int, const string& __dfault) const
142.1179 ++    {
142.1180 ++#ifdef __UCLIBC_HAS_XLOCALE__
142.1181 ++      __c_locale __old = __uselocale(_M_c_locale_messages);
142.1182 ++      const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
142.1183 ++      __uselocale(__old);
142.1184 ++      return string(__msg);
142.1185 ++#elif defined __UCLIBC_HAS_LOCALE__
142.1186 ++      char* __old = strdup(setlocale(LC_ALL, NULL));
142.1187 ++      setlocale(LC_ALL, _M_name_messages);
142.1188 ++      const char* __msg = gettext(__dfault.c_str());
142.1189 ++      setlocale(LC_ALL, __old);
142.1190 ++      free(__old);
142.1191 ++      return string(__msg);
142.1192 ++#else
142.1193 ++      const char* __msg = gettext(__dfault.c_str());
142.1194 ++      return string(__msg);
142.1195 ++#endif
142.1196 ++    }
142.1197 ++
142.1198 ++#ifdef _GLIBCXX_USE_WCHAR_T
142.1199 ++  template<>
142.1200 ++    wstring
142.1201 ++    messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
142.1202 ++    {
142.1203 ++# ifdef __UCLIBC_HAS_XLOCALE__
142.1204 ++      __c_locale __old = __uselocale(_M_c_locale_messages);
142.1205 ++      char* __msg = gettext(_M_convert_to_char(__dfault));
142.1206 ++      __uselocale(__old);
142.1207 ++      return _M_convert_from_char(__msg);
142.1208 ++# elif defined __UCLIBC_HAS_LOCALE__
142.1209 ++      char* __old = strdup(setlocale(LC_ALL, NULL));
142.1210 ++      setlocale(LC_ALL, _M_name_messages);
142.1211 ++      char* __msg = gettext(_M_convert_to_char(__dfault));
142.1212 ++      setlocale(LC_ALL, __old);
142.1213 ++      free(__old);
142.1214 ++      return _M_convert_from_char(__msg);
142.1215 ++# else
142.1216 ++      char* __msg = gettext(_M_convert_to_char(__dfault));
142.1217 ++      return _M_convert_from_char(__msg);
142.1218 ++# endif
142.1219 ++    }
142.1220 ++#endif
142.1221 ++}
142.1222 +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
142.1223 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	1970-01-01 01:00:00.000000000 +0100
142.1224 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:58:39.000000000 +0200
142.1225 +@@ -0,0 +1,118 @@
142.1226 ++// std::messages implementation details, GNU version -*- C++ -*-
142.1227 ++
142.1228 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
142.1229 ++//
142.1230 ++// This file is part of the GNU ISO C++ Library.  This library is free
142.1231 ++// software; you can redistribute it and/or modify it under the
142.1232 ++// terms of the GNU General Public License as published by the
142.1233 ++// Free Software Foundation; either version 2, or (at your option)
142.1234 ++// any later version.
142.1235 ++
142.1236 ++// This library is distributed in the hope that it will be useful,
142.1237 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
142.1238 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
142.1239 ++// GNU General Public License for more details.
142.1240 ++
142.1241 ++// You should have received a copy of the GNU General Public License along
142.1242 ++// with this library; see the file COPYING.  If not, write to the Free
142.1243 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
142.1244 ++// USA.
142.1245 ++
142.1246 ++// As a special exception, you may use this file as part of a free software
142.1247 ++// library without restriction.  Specifically, if other files instantiate
142.1248 ++// templates or use macros or inline functions from this file, or you compile
142.1249 ++// this file and link it with other files to produce an executable, this
142.1250 ++// file does not by itself cause the resulting executable to be covered by
142.1251 ++// the GNU General Public License.  This exception does not however
142.1252 ++// invalidate any other reasons why the executable file might be covered by
142.1253 ++// the GNU General Public License.
142.1254 ++
142.1255 ++//
142.1256 ++// ISO C++ 14882: 22.2.7.1.2  messages functions
142.1257 ++//
142.1258 ++
142.1259 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
142.1260 ++
142.1261 ++#ifdef __UCLIBC_MJN3_ONLY__
142.1262 ++#warning fix prototypes for *textdomain funcs
142.1263 ++#endif
142.1264 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
142.1265 ++extern "C" char *__textdomain(const char *domainname);
142.1266 ++extern "C" char *__bindtextdomain(const char *domainname,
142.1267 ++				  const char *dirname);
142.1268 ++#else
142.1269 ++#undef __textdomain
142.1270 ++#undef __bindtextdomain
142.1271 ++#define __textdomain(D)           ((void)0)
142.1272 ++#define __bindtextdomain(D,P)     ((void)0)
142.1273 ++#endif
142.1274 ++
142.1275 ++  // Non-virtual member functions.
142.1276 ++  template<typename _CharT>
142.1277 ++     messages<_CharT>::messages(size_t __refs)
142.1278 ++     : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), 
142.1279 ++     _M_name_messages(_S_get_c_name())
142.1280 ++     { }
142.1281 ++
142.1282 ++  template<typename _CharT>
142.1283 ++     messages<_CharT>::messages(__c_locale __cloc, const char* __s, 
142.1284 ++				size_t __refs) 
142.1285 ++     : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
142.1286 ++     _M_name_messages(__s)
142.1287 ++     {
142.1288 ++       char* __tmp = new char[std::strlen(__s) + 1];
142.1289 ++       std::strcpy(__tmp, __s);
142.1290 ++       _M_name_messages = __tmp;
142.1291 ++     }
142.1292 ++
142.1293 ++  template<typename _CharT>
142.1294 ++    typename messages<_CharT>::catalog 
142.1295 ++    messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, 
142.1296 ++			   const char* __dir) const
142.1297 ++    { 
142.1298 ++      __bindtextdomain(__s.c_str(), __dir);
142.1299 ++      return this->do_open(__s, __loc); 
142.1300 ++    }
142.1301 ++
142.1302 ++  // Virtual member functions.
142.1303 ++  template<typename _CharT>
142.1304 ++    messages<_CharT>::~messages()
142.1305 ++    { 
142.1306 ++      if (_M_name_messages != _S_get_c_name())
142.1307 ++	delete [] _M_name_messages;
142.1308 ++      _S_destroy_c_locale(_M_c_locale_messages); 
142.1309 ++    }
142.1310 ++
142.1311 ++  template<typename _CharT>
142.1312 ++    typename messages<_CharT>::catalog 
142.1313 ++    messages<_CharT>::do_open(const basic_string<char>& __s, 
142.1314 ++			      const locale&) const
142.1315 ++    { 
142.1316 ++      // No error checking is done, assume the catalog exists and can
142.1317 ++      // be used.
142.1318 ++      __textdomain(__s.c_str());
142.1319 ++      return 0;
142.1320 ++    }
142.1321 ++
142.1322 ++  template<typename _CharT>
142.1323 ++    void    
142.1324 ++    messages<_CharT>::do_close(catalog) const 
142.1325 ++    { }
142.1326 ++
142.1327 ++   // messages_byname
142.1328 ++   template<typename _CharT>
142.1329 ++     messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
142.1330 ++     : messages<_CharT>(__refs) 
142.1331 ++     { 
142.1332 ++       if (this->_M_name_messages != locale::facet::_S_get_c_name())
142.1333 ++	 delete [] this->_M_name_messages;
142.1334 ++       char* __tmp = new char[std::strlen(__s) + 1];
142.1335 ++       std::strcpy(__tmp, __s);
142.1336 ++       this->_M_name_messages = __tmp;
142.1337 ++
142.1338 ++       if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
142.1339 ++	 {
142.1340 ++	   this->_S_destroy_c_locale(this->_M_c_locale_messages);
142.1341 ++	   this->_S_create_c_locale(this->_M_c_locale_messages, __s); 
142.1342 ++	 }
142.1343 ++     }
142.1344 +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
142.1345 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	1970-01-01 01:00:00.000000000 +0100
142.1346 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:58:39.000000000 +0200
142.1347 +@@ -0,0 +1,692 @@
142.1348 ++// std::moneypunct implementation details, GNU version -*- C++ -*-
142.1349 ++
142.1350 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
142.1351 ++//
142.1352 ++// This file is part of the GNU ISO C++ Library.  This library is free
142.1353 ++// software; you can redistribute it and/or modify it under the
142.1354 ++// terms of the GNU General Public License as published by the
142.1355 ++// Free Software Foundation; either version 2, or (at your option)
142.1356 ++// any later version.
142.1357 ++
142.1358 ++// This library is distributed in the hope that it will be useful,
142.1359 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
142.1360 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
142.1361 ++// GNU General Public License for more details.
142.1362 ++
142.1363 ++// You should have received a copy of the GNU General Public License along
142.1364 ++// with this library; see the file COPYING.  If not, write to the Free
142.1365 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
142.1366 ++// USA.
142.1367 ++
142.1368 ++// As a special exception, you may use this file as part of a free software
142.1369 ++// library without restriction.  Specifically, if other files instantiate
142.1370 ++// templates or use macros or inline functions from this file, or you compile
142.1371 ++// this file and link it with other files to produce an executable, this
142.1372 ++// file does not by itself cause the resulting executable to be covered by
142.1373 ++// the GNU General Public License.  This exception does not however
142.1374 ++// invalidate any other reasons why the executable file might be covered by
142.1375 ++// the GNU General Public License.
142.1376 ++
142.1377 ++//
142.1378 ++// ISO C++ 14882: 22.2.6.3.2  moneypunct virtual functions
142.1379 ++//
142.1380 ++
142.1381 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
142.1382 ++
142.1383 ++#define _LIBC
142.1384 ++#include <locale>
142.1385 ++#undef _LIBC
142.1386 ++#include <bits/c++locale_internal.h>
142.1387 ++
142.1388 ++#ifdef __UCLIBC_MJN3_ONLY__
142.1389 ++#warning optimize this for uclibc
142.1390 ++#warning tailor for stub locale support
142.1391 ++#endif
142.1392 ++
142.1393 ++#ifndef __UCLIBC_HAS_XLOCALE__
142.1394 ++#define __nl_langinfo_l(N, L)         nl_langinfo((N))
142.1395 ++#endif
142.1396 ++
142.1397 ++namespace std
142.1398 ++{
142.1399 ++  // Construct and return valid pattern consisting of some combination of:
142.1400 ++  // space none symbol sign value
142.1401 ++  money_base::pattern
142.1402 ++  money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
142.1403 ++  { 
142.1404 ++    pattern __ret;
142.1405 ++
142.1406 ++    // This insanely complicated routine attempts to construct a valid
142.1407 ++    // pattern for use with monyepunct. A couple of invariants:
142.1408 ++
142.1409 ++    // if (__precedes) symbol -> value
142.1410 ++    // else value -> symbol
142.1411 ++    
142.1412 ++    // if (__space) space
142.1413 ++    // else none
142.1414 ++
142.1415 ++    // none == never first
142.1416 ++    // space never first or last
142.1417 ++
142.1418 ++    // Any elegant implementations of this are welcome.
142.1419 ++    switch (__posn)
142.1420 ++      {
142.1421 ++      case 0:
142.1422 ++      case 1:
142.1423 ++	// 1 The sign precedes the value and symbol.
142.1424 ++	__ret.field[0] = sign;
142.1425 ++	if (__space)
142.1426 ++	  {
142.1427 ++	    // Pattern starts with sign.
142.1428 ++	    if (__precedes)
142.1429 ++	      {
142.1430 ++		__ret.field[1] = symbol;
142.1431 ++		__ret.field[3] = value;
142.1432 ++	      }
142.1433 ++	    else
142.1434 ++	      {
142.1435 ++		__ret.field[1] = value;
142.1436 ++		__ret.field[3] = symbol;
142.1437 ++	      }
142.1438 ++	    __ret.field[2] = space;
142.1439 ++	  }
142.1440 ++	else
142.1441 ++	  {
142.1442 ++	    // Pattern starts with sign and ends with none.
142.1443 ++	    if (__precedes)
142.1444 ++	      {
142.1445 ++		__ret.field[1] = symbol;
142.1446 ++		__ret.field[2] = value;
142.1447 ++	      }
142.1448 ++	    else
142.1449 ++	      {
142.1450 ++		__ret.field[1] = value;
142.1451 ++		__ret.field[2] = symbol;
142.1452 ++	      }
142.1453 ++	    __ret.field[3] = none;
142.1454 ++	  }
142.1455 ++	break;
142.1456 ++      case 2:
142.1457 ++	// 2 The sign follows the value and symbol.
142.1458 ++	if (__space)
142.1459 ++	  {
142.1460 ++	    // Pattern either ends with sign.
142.1461 ++	    if (__precedes)
142.1462 ++	      {
142.1463 ++		__ret.field[0] = symbol;
142.1464 ++		__ret.field[2] = value;
142.1465 ++	      }
142.1466 ++	    else
142.1467 ++	      {
142.1468 ++		__ret.field[0] = value;
142.1469 ++		__ret.field[2] = symbol;
142.1470 ++	      }
142.1471 ++	    __ret.field[1] = space;
142.1472 ++	    __ret.field[3] = sign;
142.1473 ++	  }
142.1474 ++	else
142.1475 ++	  {
142.1476 ++	    // Pattern ends with sign then none.
142.1477 ++	    if (__precedes)
142.1478 ++	      {
142.1479 ++		__ret.field[0] = symbol;
142.1480 ++		__ret.field[1] = value;
142.1481 ++	      }
142.1482 ++	    else
142.1483 ++	      {
142.1484 ++		__ret.field[0] = value;
142.1485 ++		__ret.field[1] = symbol;
142.1486 ++	      }
142.1487 ++	    __ret.field[2] = sign;
142.1488 ++	    __ret.field[3] = none;
142.1489 ++	  }
142.1490 ++	break;
142.1491 ++      case 3:
142.1492 ++	// 3 The sign immediately precedes the symbol.
142.1493 ++	if (__precedes)
142.1494 ++	  {
142.1495 ++	    __ret.field[0] = sign;
142.1496 ++	    __ret.field[1] = symbol;	    
142.1497 ++	    if (__space)
142.1498 ++	      {
142.1499 ++		__ret.field[2] = space;
142.1500 ++		__ret.field[3] = value;
142.1501 ++	      }
142.1502 ++	    else
142.1503 ++	      {
142.1504 ++		__ret.field[2] = value;		
142.1505 ++		__ret.field[3] = none;
142.1506 ++	      }
142.1507 ++	  }
142.1508 ++	else
142.1509 ++	  {
142.1510 ++	    __ret.field[0] = value;
142.1511 ++	    if (__space)
142.1512 ++	      {
142.1513 ++		__ret.field[1] = space;
142.1514 ++		__ret.field[2] = sign;
142.1515 ++		__ret.field[3] = symbol;
142.1516 ++	      }
142.1517 ++	    else
142.1518 ++	      {
142.1519 ++		__ret.field[1] = sign;
142.1520 ++		__ret.field[2] = symbol;
142.1521 ++		__ret.field[3] = none;
142.1522 ++	      }
142.1523 ++	  }
142.1524 ++	break;
142.1525 ++      case 4:
142.1526 ++	// 4 The sign immediately follows the symbol.
142.1527 ++	if (__precedes)
142.1528 ++	  {
142.1529 ++	    __ret.field[0] = symbol;
142.1530 ++	    __ret.field[1] = sign;
142.1531 ++	    if (__space)
142.1532 ++	      {
142.1533 ++		__ret.field[2] = space;
142.1534 ++		__ret.field[3] = value;
142.1535 ++	      }
142.1536 ++	    else
142.1537 ++	      {
142.1538 ++		__ret.field[2] = value;
142.1539 ++		__ret.field[3] = none;
142.1540 ++	      }
142.1541 ++	  }
142.1542 ++	else
142.1543 ++	  {
142.1544 ++	    __ret.field[0] = value;
142.1545 ++	    if (__space)
142.1546 ++	      {
142.1547 ++		__ret.field[1] = space;
142.1548 ++		__ret.field[2] = symbol;
142.1549 ++		__ret.field[3] = sign;
142.1550 ++	      }
142.1551 ++	    else
142.1552 ++	      {
142.1553 ++		__ret.field[1] = symbol;
142.1554 ++		__ret.field[2] = sign;
142.1555 ++		__ret.field[3] = none;
142.1556 ++	      }
142.1557 ++	  }
142.1558 ++	break;
142.1559 ++      default:
142.1560 ++	;
142.1561 ++      }
142.1562 ++    return __ret;
142.1563 ++  }
142.1564 ++
142.1565 ++  template<> 
142.1566 ++    void
142.1567 ++    moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc, 
142.1568 ++						     const char*)
142.1569 ++    {
142.1570 ++      if (!_M_data)
142.1571 ++	_M_data = new __moneypunct_cache<char, true>;
142.1572 ++
142.1573 ++      if (!__cloc)
142.1574 ++	{
142.1575 ++	  // "C" locale
142.1576 ++	  _M_data->_M_decimal_point = '.';
142.1577 ++	  _M_data->_M_thousands_sep = ',';
142.1578 ++	  _M_data->_M_grouping = "";
142.1579 ++	  _M_data->_M_grouping_size = 0;
142.1580 ++	  _M_data->_M_curr_symbol = "";
142.1581 ++	  _M_data->_M_curr_symbol_size = 0;
142.1582 ++	  _M_data->_M_positive_sign = "";
142.1583 ++	  _M_data->_M_positive_sign_size = 0;
142.1584 ++	  _M_data->_M_negative_sign = "";
142.1585 ++	  _M_data->_M_negative_sign_size = 0;
142.1586 ++	  _M_data->_M_frac_digits = 0;
142.1587 ++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
142.1588 ++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
142.1589 ++
142.1590 ++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
142.1591 ++	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
142.1592 ++	}
142.1593 ++      else
142.1594 ++	{
142.1595 ++	  // Named locale.
142.1596 ++	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
142.1597 ++							__cloc));
142.1598 ++	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
142.1599 ++							__cloc));
142.1600 ++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
142.1601 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
142.1602 ++	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
142.1603 ++	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
142.1604 ++
142.1605 ++	  char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
142.1606 ++	  if (!__nposn)
142.1607 ++	    _M_data->_M_negative_sign = "()";
142.1608 ++	  else
142.1609 ++	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, 
142.1610 ++							__cloc);
142.1611 ++	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
142.1612 ++
142.1613 ++	  // _Intl == true
142.1614 ++	  _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
142.1615 ++	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
142.1616 ++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
142.1617 ++						      __cloc));
142.1618 ++	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
142.1619 ++	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
142.1620 ++	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
142.1621 ++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
142.1622 ++							__pposn);
142.1623 ++	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
142.1624 ++	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
142.1625 ++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
142.1626 ++							__nposn);
142.1627 ++	}
142.1628 ++    }
142.1629 ++
142.1630 ++  template<> 
142.1631 ++    void
142.1632 ++    moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc, 
142.1633 ++						      const char*)
142.1634 ++    {
142.1635 ++      if (!_M_data)
142.1636 ++	_M_data = new __moneypunct_cache<char, false>;
142.1637 ++
142.1638 ++      if (!__cloc)
142.1639 ++	{
142.1640 ++	  // "C" locale
142.1641 ++	  _M_data->_M_decimal_point = '.';
142.1642 ++	  _M_data->_M_thousands_sep = ',';
142.1643 ++	  _M_data->_M_grouping = "";
142.1644 ++	  _M_data->_M_grouping_size = 0;
142.1645 ++	  _M_data->_M_curr_symbol = "";
142.1646 ++	  _M_data->_M_curr_symbol_size = 0;
142.1647 ++	  _M_data->_M_positive_sign = "";
142.1648 ++	  _M_data->_M_positive_sign_size = 0;
142.1649 ++	  _M_data->_M_negative_sign = "";
142.1650 ++	  _M_data->_M_negative_sign_size = 0;
142.1651 ++	  _M_data->_M_frac_digits = 0;
142.1652 ++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
142.1653 ++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
142.1654 ++
142.1655 ++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
142.1656 ++	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
142.1657 ++	}
142.1658 ++      else
142.1659 ++	{
142.1660 ++	  // Named locale.
142.1661 ++	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, 
142.1662 ++							__cloc));
142.1663 ++	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, 
142.1664 ++							__cloc));
142.1665 ++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
142.1666 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
142.1667 ++	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
142.1668 ++	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
142.1669 ++
142.1670 ++	  char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
142.1671 ++	  if (!__nposn)
142.1672 ++	    _M_data->_M_negative_sign = "()";
142.1673 ++	  else
142.1674 ++	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
142.1675 ++							__cloc);
142.1676 ++	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
142.1677 ++
142.1678 ++	  // _Intl == false
142.1679 ++	  _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
142.1680 ++	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
142.1681 ++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
142.1682 ++	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
142.1683 ++	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
142.1684 ++	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
142.1685 ++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
142.1686 ++							__pposn);
142.1687 ++	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
142.1688 ++	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
142.1689 ++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
142.1690 ++							__nposn);
142.1691 ++	}
142.1692 ++    }
142.1693 ++
142.1694 ++  template<> 
142.1695 ++    moneypunct<char, true>::~moneypunct()
142.1696 ++    { delete _M_data; }
142.1697 ++
142.1698 ++  template<> 
142.1699 ++    moneypunct<char, false>::~moneypunct()
142.1700 ++    { delete _M_data; }
142.1701 ++
142.1702 ++#ifdef _GLIBCXX_USE_WCHAR_T
142.1703 ++  template<> 
142.1704 ++    void
142.1705 ++    moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc, 
142.1706 ++#ifdef __UCLIBC_HAS_XLOCALE__
142.1707 ++							const char*)
142.1708 ++#else
142.1709 ++							const char* __name)
142.1710 ++#endif
142.1711 ++    {
142.1712 ++      if (!_M_data)
142.1713 ++	_M_data = new __moneypunct_cache<wchar_t, true>;
142.1714 ++
142.1715 ++      if (!__cloc)
142.1716 ++	{
142.1717 ++	  // "C" locale
142.1718 ++	  _M_data->_M_decimal_point = L'.';
142.1719 ++	  _M_data->_M_thousands_sep = L',';
142.1720 ++	  _M_data->_M_grouping = "";
142.1721 ++	  _M_data->_M_grouping_size = 0;
142.1722 ++	  _M_data->_M_curr_symbol = L"";
142.1723 ++	  _M_data->_M_curr_symbol_size = 0;
142.1724 ++	  _M_data->_M_positive_sign = L"";
142.1725 ++	  _M_data->_M_positive_sign_size = 0;
142.1726 ++	  _M_data->_M_negative_sign = L"";
142.1727 ++	  _M_data->_M_negative_sign_size = 0;
142.1728 ++	  _M_data->_M_frac_digits = 0;
142.1729 ++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
142.1730 ++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
142.1731 ++
142.1732 ++	  // Use ctype::widen code without the facet...
142.1733 ++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
142.1734 ++	    _M_data->_M_atoms[__i] =
142.1735 ++	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
142.1736 ++	}
142.1737 ++      else
142.1738 ++	{
142.1739 ++	  // Named locale.
142.1740 ++#ifdef __UCLIBC_HAS_XLOCALE__
142.1741 ++	  __c_locale __old = __uselocale(__cloc);
142.1742 ++#else
142.1743 ++	  // Switch to named locale so that mbsrtowcs will work.
142.1744 ++	  char* __old = strdup(setlocale(LC_ALL, NULL));
142.1745 ++	  setlocale(LC_ALL, __name);
142.1746 ++#endif
142.1747 ++
142.1748 ++#ifdef __UCLIBC_MJN3_ONLY__
142.1749 ++#warning fix this... should be monetary
142.1750 ++#endif
142.1751 ++#ifdef __UCLIBC__
142.1752 ++# ifdef __UCLIBC_HAS_XLOCALE__
142.1753 ++	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
142.1754 ++	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
142.1755 ++# else
142.1756 ++	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
142.1757 ++	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
142.1758 ++# endif
142.1759 ++#else
142.1760 ++	  union { char *__s; wchar_t __w; } __u;
142.1761 ++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
142.1762 ++	  _M_data->_M_decimal_point = __u.__w;
142.1763 ++
142.1764 ++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
142.1765 ++	  _M_data->_M_thousands_sep = __u.__w;
142.1766 ++#endif
142.1767 ++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
142.1768 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
142.1769 ++
142.1770 ++	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
142.1771 ++	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
142.1772 ++	  const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
142.1773 ++
142.1774 ++	  wchar_t* __wcs_ps = 0;
142.1775 ++	  wchar_t* __wcs_ns = 0;
142.1776 ++	  const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
142.1777 ++	  try
142.1778 ++	    {
142.1779 ++	      mbstate_t __state;
142.1780 ++	      size_t __len = strlen(__cpossign);
142.1781 ++	      if (__len)
142.1782 ++		{
142.1783 ++		  ++__len;
142.1784 ++		  memset(&__state, 0, sizeof(mbstate_t));
142.1785 ++		  __wcs_ps = new wchar_t[__len];
142.1786 ++		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
142.1787 ++		  _M_data->_M_positive_sign = __wcs_ps;
142.1788 ++		}
142.1789 ++	      else
142.1790 ++		_M_data->_M_positive_sign = L"";
142.1791 ++	      _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
142.1792 ++	      
142.1793 ++	      __len = strlen(__cnegsign);
142.1794 ++	      if (!__nposn)
142.1795 ++		_M_data->_M_negative_sign = L"()";
142.1796 ++	      else if (__len)
142.1797 ++		{ 
142.1798 ++		  ++__len;
142.1799 ++		  memset(&__state, 0, sizeof(mbstate_t));
142.1800 ++		  __wcs_ns = new wchar_t[__len];
142.1801 ++		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
142.1802 ++		  _M_data->_M_negative_sign = __wcs_ns;
142.1803 ++		}
142.1804 ++	      else
142.1805 ++		_M_data->_M_negative_sign = L"";
142.1806 ++	      _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
142.1807 ++	      
142.1808 ++	      // _Intl == true.
142.1809 ++	      __len = strlen(__ccurr);
142.1810 ++	      if (__len)
142.1811 ++		{
142.1812 ++		  ++__len;
142.1813 ++		  memset(&__state, 0, sizeof(mbstate_t));
142.1814 ++		  wchar_t* __wcs = new wchar_t[__len];
142.1815 ++		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
142.1816 ++		  _M_data->_M_curr_symbol = __wcs;
142.1817 ++		}
142.1818 ++	      else
142.1819 ++		_M_data->_M_curr_symbol = L"";
142.1820 ++	      _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
142.1821 ++	    }
142.1822 ++	  catch (...)
142.1823 ++	    {
142.1824 ++	      delete _M_data;
142.1825 ++	      _M_data = 0;
142.1826 ++	      delete __wcs_ps;
142.1827 ++	      delete __wcs_ns;	      
142.1828 ++#ifdef __UCLIBC_HAS_XLOCALE__
142.1829 ++	      __uselocale(__old);
142.1830 ++#else
142.1831 ++	      setlocale(LC_ALL, __old);
142.1832 ++	      free(__old);
142.1833 ++#endif
142.1834 ++	      __throw_exception_again;
142.1835 ++	    } 
142.1836 ++	  
142.1837 ++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, 
142.1838 ++						      __cloc));
142.1839 ++	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
142.1840 ++	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
142.1841 ++	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
142.1842 ++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
142.1843 ++							__pposn);
142.1844 ++	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
142.1845 ++	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
142.1846 ++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
142.1847 ++							__nposn);
142.1848 ++
142.1849 ++#ifdef __UCLIBC_HAS_XLOCALE__
142.1850 ++	  __uselocale(__old);
142.1851 ++#else
142.1852 ++	  setlocale(LC_ALL, __old);
142.1853 ++	  free(__old);
142.1854 ++#endif
142.1855 ++	}
142.1856 ++    }
142.1857 ++
142.1858 ++  template<> 
142.1859 ++  void
142.1860 ++  moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
142.1861 ++#ifdef __UCLIBC_HAS_XLOCALE__
142.1862 ++						       const char*)
142.1863 ++#else
142.1864 ++                                                       const char* __name)
142.1865 ++#endif
142.1866 ++  {
142.1867 ++    if (!_M_data)
142.1868 ++      _M_data = new __moneypunct_cache<wchar_t, false>;
142.1869 ++
142.1870 ++    if (!__cloc)
142.1871 ++	{
142.1872 ++	  // "C" locale
142.1873 ++	  _M_data->_M_decimal_point = L'.';
142.1874 ++	  _M_data->_M_thousands_sep = L',';
142.1875 ++	  _M_data->_M_grouping = "";
142.1876 ++          _M_data->_M_grouping_size = 0;
142.1877 ++	  _M_data->_M_curr_symbol = L"";
142.1878 ++	  _M_data->_M_curr_symbol_size = 0;
142.1879 ++	  _M_data->_M_positive_sign = L"";
142.1880 ++	  _M_data->_M_positive_sign_size = 0;
142.1881 ++	  _M_data->_M_negative_sign = L"";
142.1882 ++	  _M_data->_M_negative_sign_size = 0;
142.1883 ++	  _M_data->_M_frac_digits = 0;
142.1884 ++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
142.1885 ++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
142.1886 ++
142.1887 ++	  // Use ctype::widen code without the facet...
142.1888 ++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
142.1889 ++	    _M_data->_M_atoms[__i] =
142.1890 ++	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
142.1891 ++	}
142.1892 ++      else
142.1893 ++	{
142.1894 ++	  // Named locale.
142.1895 ++#ifdef __UCLIBC_HAS_XLOCALE__
142.1896 ++	  __c_locale __old = __uselocale(__cloc);
142.1897 ++#else
142.1898 ++	  // Switch to named locale so that mbsrtowcs will work.
142.1899 ++	  char* __old = strdup(setlocale(LC_ALL, NULL));
142.1900 ++	  setlocale(LC_ALL, __name);
142.1901 ++#endif
142.1902 ++
142.1903 ++#ifdef __UCLIBC_MJN3_ONLY__
142.1904 ++#warning fix this... should be monetary
142.1905 ++#endif
142.1906 ++#ifdef __UCLIBC__
142.1907 ++# ifdef __UCLIBC_HAS_XLOCALE__
142.1908 ++	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
142.1909 ++	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
142.1910 ++# else
142.1911 ++	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
142.1912 ++	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
142.1913 ++# endif
142.1914 ++#else
142.1915 ++          union { char *__s; wchar_t __w; } __u;
142.1916 ++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
142.1917 ++	  _M_data->_M_decimal_point = __u.__w;
142.1918 ++
142.1919 ++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
142.1920 ++	  _M_data->_M_thousands_sep = __u.__w;
142.1921 ++#endif
142.1922 ++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
142.1923 ++          _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
142.1924 ++
142.1925 ++	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
142.1926 ++	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
142.1927 ++	  const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
142.1928 ++
142.1929 ++	  wchar_t* __wcs_ps = 0;
142.1930 ++	  wchar_t* __wcs_ns = 0;
142.1931 ++	  const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
142.1932 ++	  try
142.1933 ++            {
142.1934 ++              mbstate_t __state;
142.1935 ++              size_t __len;
142.1936 ++              __len = strlen(__cpossign);
142.1937 ++              if (__len)
142.1938 ++                {
142.1939 ++		  ++__len;
142.1940 ++		  memset(&__state, 0, sizeof(mbstate_t));
142.1941 ++		  __wcs_ps = new wchar_t[__len];
142.1942 ++		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
142.1943 ++		  _M_data->_M_positive_sign = __wcs_ps;
142.1944 ++		}
142.1945 ++	      else
142.1946 ++		_M_data->_M_positive_sign = L"";
142.1947 ++              _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
142.1948 ++	      
142.1949 ++	      __len = strlen(__cnegsign);
142.1950 ++	      if (!__nposn)
142.1951 ++		_M_data->_M_negative_sign = L"()";
142.1952 ++	      else if (__len)
142.1953 ++		{ 
142.1954 ++		  ++__len;
142.1955 ++		  memset(&__state, 0, sizeof(mbstate_t));
142.1956 ++		  __wcs_ns = new wchar_t[__len];
142.1957 ++		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
142.1958 ++		  _M_data->_M_negative_sign = __wcs_ns;
142.1959 ++		}
142.1960 ++	      else
142.1961 ++		_M_data->_M_negative_sign = L"";
142.1962 ++              _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
142.1963 ++
142.1964 ++	      // _Intl == true.
142.1965 ++	      __len = strlen(__ccurr);
142.1966 ++	      if (__len)
142.1967 ++		{
142.1968 ++		  ++__len;
142.1969 ++		  memset(&__state, 0, sizeof(mbstate_t));
142.1970 ++		  wchar_t* __wcs = new wchar_t[__len];
142.1971 ++		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
142.1972 ++		  _M_data->_M_curr_symbol = __wcs;
142.1973 ++		}
142.1974 ++	      else
142.1975 ++		_M_data->_M_curr_symbol = L"";
142.1976 ++              _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
142.1977 ++	    }
142.1978 ++          catch (...)
142.1979 ++	    {
142.1980 ++	      delete _M_data;
142.1981 ++              _M_data = 0;
142.1982 ++	      delete __wcs_ps;
142.1983 ++	      delete __wcs_ns;	      
142.1984 ++#ifdef __UCLIBC_HAS_XLOCALE__
142.1985 ++	      __uselocale(__old);
142.1986 ++#else
142.1987 ++	      setlocale(LC_ALL, __old);
142.1988 ++	      free(__old);
142.1989 ++#endif
142.1990 ++              __throw_exception_again;
142.1991 ++	    }
142.1992 ++
142.1993 ++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
142.1994 ++	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
142.1995 ++	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
142.1996 ++	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
142.1997 ++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, 
142.1998 ++	                                                __pposn);
142.1999 ++	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
142.2000 ++	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
142.2001 ++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, 
142.2002 ++	                                                __nposn);
142.2003 ++
142.2004 ++#ifdef __UCLIBC_HAS_XLOCALE__
142.2005 ++	  __uselocale(__old);
142.2006 ++#else
142.2007 ++	  setlocale(LC_ALL, __old);
142.2008 ++	  free(__old);
142.2009 ++#endif
142.2010 ++	}
142.2011 ++    }
142.2012 ++
142.2013 ++  template<> 
142.2014 ++    moneypunct<wchar_t, true>::~moneypunct()
142.2015 ++    {
142.2016 ++      if (_M_data->_M_positive_sign_size)
142.2017 ++	delete [] _M_data->_M_positive_sign;
142.2018 ++      if (_M_data->_M_negative_sign_size
142.2019 ++          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
142.2020 ++	delete [] _M_data->_M_negative_sign;
142.2021 ++      if (_M_data->_M_curr_symbol_size)
142.2022 ++	delete [] _M_data->_M_curr_symbol;
142.2023 ++      delete _M_data;
142.2024 ++    }
142.2025 ++
142.2026 ++  template<> 
142.2027 ++    moneypunct<wchar_t, false>::~moneypunct()
142.2028 ++    {
142.2029 ++      if (_M_data->_M_positive_sign_size)
142.2030 ++	delete [] _M_data->_M_positive_sign;
142.2031 ++      if (_M_data->_M_negative_sign_size
142.2032 ++          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
142.2033 ++	delete [] _M_data->_M_negative_sign;
142.2034 ++      if (_M_data->_M_curr_symbol_size)
142.2035 ++	delete [] _M_data->_M_curr_symbol;
142.2036 ++      delete _M_data;
142.2037 ++    }
142.2038 ++#endif
142.2039 ++}
142.2040 +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
142.2041 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	1970-01-01 01:00:00.000000000 +0100
142.2042 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:58:39.000000000 +0200
142.2043 +@@ -0,0 +1,160 @@
142.2044 ++// std::numpunct implementation details, GNU version -*- C++ -*-
142.2045 ++
142.2046 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
142.2047 ++//
142.2048 ++// This file is part of the GNU ISO C++ Library.  This library is free
142.2049 ++// software; you can redistribute it and/or modify it under the
142.2050 ++// terms of the GNU General Public License as published by the
142.2051 ++// Free Software Foundation; either version 2, or (at your option)
142.2052 ++// any later version.
142.2053 ++
142.2054 ++// This library is distributed in the hope that it will be useful,
142.2055 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
142.2056 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
142.2057 ++// GNU General Public License for more details.
142.2058 ++
142.2059 ++// You should have received a copy of the GNU General Public License along
142.2060 ++// with this library; see the file COPYING.  If not, write to the Free
142.2061 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
142.2062 ++// USA.
142.2063 ++
142.2064 ++// As a special exception, you may use this file as part of a free software
142.2065 ++// library without restriction.  Specifically, if other files instantiate
142.2066 ++// templates or use macros or inline functions from this file, or you compile
142.2067 ++// this file and link it with other files to produce an executable, this
142.2068 ++// file does not by itself cause the resulting executable to be covered by
142.2069 ++// the GNU General Public License.  This exception does not however
142.2070 ++// invalidate any other reasons why the executable file might be covered by
142.2071 ++// the GNU General Public License.
142.2072 ++
142.2073 ++//
142.2074 ++// ISO C++ 14882: 22.2.3.1.2  numpunct virtual functions
142.2075 ++//
142.2076 ++
142.2077 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
142.2078 ++
142.2079 ++#define _LIBC
142.2080 ++#include <locale>
142.2081 ++#undef _LIBC
142.2082 ++#include <bits/c++locale_internal.h>
142.2083 ++
142.2084 ++#ifdef __UCLIBC_MJN3_ONLY__
142.2085 ++#warning tailor for stub locale support
142.2086 ++#endif
142.2087 ++#ifndef __UCLIBC_HAS_XLOCALE__
142.2088 ++#define __nl_langinfo_l(N, L)         nl_langinfo((N))
142.2089 ++#endif
142.2090 ++
142.2091 ++namespace std
142.2092 ++{
142.2093 ++  template<> 
142.2094 ++    void
142.2095 ++    numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
142.2096 ++    {
142.2097 ++      if (!_M_data)
142.2098 ++	_M_data = new __numpunct_cache<char>;
142.2099 ++
142.2100 ++      if (!__cloc)
142.2101 ++	{
142.2102 ++	  // "C" locale
142.2103 ++	  _M_data->_M_grouping = "";
142.2104 ++	  _M_data->_M_grouping_size = 0;
142.2105 ++	  _M_data->_M_use_grouping = false;
142.2106 ++
142.2107 ++	  _M_data->_M_decimal_point = '.';
142.2108 ++	  _M_data->_M_thousands_sep = ',';
142.2109 ++
142.2110 ++	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
142.2111 ++	    _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
142.2112 ++
142.2113 ++	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
142.2114 ++	    _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j];
142.2115 ++	}
142.2116 ++      else
142.2117 ++	{
142.2118 ++	  // Named locale.
142.2119 ++	  _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT, 
142.2120 ++							__cloc));
142.2121 ++	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP, 
142.2122 ++							__cloc));
142.2123 ++
142.2124 ++	  // Check for NULL, which implies no grouping.
142.2125 ++	  if (_M_data->_M_thousands_sep == '\0')
142.2126 ++	    _M_data->_M_grouping = "";
142.2127 ++	  else
142.2128 ++	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
142.2129 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
142.2130 ++	}
142.2131 ++
142.2132 ++      // NB: There is no way to extact this info from posix locales.
142.2133 ++      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
142.2134 ++      _M_data->_M_truename = "true";
142.2135 ++      _M_data->_M_truename_size = 4;
142.2136 ++      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
142.2137 ++      _M_data->_M_falsename = "false";
142.2138 ++      _M_data->_M_falsename_size = 5;
142.2139 ++    }
142.2140 ++ 
142.2141 ++  template<> 
142.2142 ++    numpunct<char>::~numpunct()
142.2143 ++    { delete _M_data; }
142.2144 ++   
142.2145 ++#ifdef _GLIBCXX_USE_WCHAR_T
142.2146 ++  template<> 
142.2147 ++    void
142.2148 ++    numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
142.2149 ++    {
142.2150 ++      if (!_M_data)
142.2151 ++	_M_data = new __numpunct_cache<wchar_t>;
142.2152 ++
142.2153 ++      if (!__cloc)
142.2154 ++	{
142.2155 ++	  // "C" locale
142.2156 ++	  _M_data->_M_grouping = "";
142.2157 ++	  _M_data->_M_grouping_size = 0;
142.2158 ++	  _M_data->_M_use_grouping = false;
142.2159 ++
142.2160 ++	  _M_data->_M_decimal_point = L'.';
142.2161 ++	  _M_data->_M_thousands_sep = L',';
142.2162 ++
142.2163 ++	  // Use ctype::widen code without the facet...
142.2164 ++	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
142.2165 ++	    _M_data->_M_atoms_out[__i] =
142.2166 ++	      static_cast<wchar_t>(__num_base::_S_atoms_out[__i]);
142.2167 ++
142.2168 ++	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
142.2169 ++	    _M_data->_M_atoms_in[__j] =
142.2170 ++	      static_cast<wchar_t>(__num_base::_S_atoms_in[__j]);
142.2171 ++	}
142.2172 ++      else
142.2173 ++	{
142.2174 ++	  // Named locale.
142.2175 ++	  // NB: In the GNU model wchar_t is always 32 bit wide.
142.2176 ++	  union { char *__s; wchar_t __w; } __u;
142.2177 ++	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
142.2178 ++	  _M_data->_M_decimal_point = __u.__w;
142.2179 ++
142.2180 ++	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
142.2181 ++	  _M_data->_M_thousands_sep = __u.__w;
142.2182 ++
142.2183 ++	  if (_M_data->_M_thousands_sep == L'\0')
142.2184 ++	    _M_data->_M_grouping = "";
142.2185 ++	  else
142.2186 ++	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
142.2187 ++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
142.2188 ++	}
142.2189 ++
142.2190 ++      // NB: There is no way to extact this info from posix locales.
142.2191 ++      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
142.2192 ++      _M_data->_M_truename = L"true";
142.2193 ++      _M_data->_M_truename_size = 4;
142.2194 ++      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
142.2195 ++      _M_data->_M_falsename = L"false";
142.2196 ++      _M_data->_M_falsename_size = 5;
142.2197 ++    }
142.2198 ++
142.2199 ++  template<> 
142.2200 ++    numpunct<wchar_t>::~numpunct()
142.2201 ++    { delete _M_data; }
142.2202 ++ #endif
142.2203 ++}
142.2204 +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
142.2205 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc	1970-01-01 01:00:00.000000000 +0100
142.2206 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.cc	2008-06-10 14:58:39.000000000 +0200
142.2207 +@@ -0,0 +1,406 @@
142.2208 ++// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
142.2209 ++
142.2210 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
142.2211 ++//
142.2212 ++// This file is part of the GNU ISO C++ Library.  This library is free
142.2213 ++// software; you can redistribute it and/or modify it under the
142.2214 ++// terms of the GNU General Public License as published by the
142.2215 ++// Free Software Foundation; either version 2, or (at your option)
142.2216 ++// any later version.
142.2217 ++
142.2218 ++// This library is distributed in the hope that it will be useful,
142.2219 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
142.2220 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
142.2221 ++// GNU General Public License for more details.
142.2222 ++
142.2223 ++// You should have received a copy of the GNU General Public License along
142.2224 ++// with this library; see the file COPYING.  If not, write to the Free
142.2225 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
142.2226 ++// USA.
142.2227 ++
142.2228 ++// As a special exception, you may use this file as part of a free software
142.2229 ++// library without restriction.  Specifically, if other files instantiate
142.2230 ++// templates or use macros or inline functions from this file, or you compile
142.2231 ++// this file and link it with other files to produce an executable, this
142.2232 ++// file does not by itself cause the resulting executable to be covered by
142.2233 ++// the GNU General Public License.  This exception does not however
142.2234 ++// invalidate any other reasons why the executable file might be covered by
142.2235 ++// the GNU General Public License.
142.2236 ++
142.2237 ++//
142.2238 ++// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
142.2239 ++// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
142.2240 ++//
142.2241 ++
142.2242 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
142.2243 ++
142.2244 ++#include <locale>
142.2245 ++#include <bits/c++locale_internal.h>
142.2246 ++
142.2247 ++#ifdef __UCLIBC_MJN3_ONLY__
142.2248 ++#warning tailor for stub locale support
142.2249 ++#endif
142.2250 ++#ifndef __UCLIBC_HAS_XLOCALE__
142.2251 ++#define __nl_langinfo_l(N, L)         nl_langinfo((N))
142.2252 ++#endif
142.2253 ++
142.2254 ++namespace std
142.2255 ++{
142.2256 ++  template<>
142.2257 ++    void
142.2258 ++    __timepunct<char>::
142.2259 ++    _M_put(char* __s, size_t __maxlen, const char* __format, 
142.2260 ++	   const tm* __tm) const
142.2261 ++    {
142.2262 ++#ifdef __UCLIBC_HAS_XLOCALE__
142.2263 ++      const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
142.2264 ++					_M_c_locale_timepunct);
142.2265 ++#else
142.2266 ++      char* __old = strdup(setlocale(LC_ALL, NULL));
142.2267 ++      setlocale(LC_ALL, _M_name_timepunct);
142.2268 ++      const size_t __len = strftime(__s, __maxlen, __format, __tm);
142.2269 ++      setlocale(LC_ALL, __old);
142.2270 ++      free(__old);
142.2271 ++#endif
142.2272 ++      // Make sure __s is null terminated.
142.2273 ++      if (__len == 0)
142.2274 ++	__s[0] = '\0';
142.2275 ++    }
142.2276 ++
142.2277 ++  template<> 
142.2278 ++    void
142.2279 ++    __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
142.2280 ++    {
142.2281 ++      if (!_M_data)
142.2282 ++	_M_data = new __timepunct_cache<char>;
142.2283 ++
142.2284 ++      if (!__cloc)
142.2285 ++	{
142.2286 ++	  // "C" locale
142.2287 ++	  _M_c_locale_timepunct = _S_get_c_locale();
142.2288 ++
142.2289 ++	  _M_data->_M_date_format = "%m/%d/%y";
142.2290 ++	  _M_data->_M_date_era_format = "%m/%d/%y";
142.2291 ++	  _M_data->_M_time_format = "%H:%M:%S";
142.2292 ++	  _M_data->_M_time_era_format = "%H:%M:%S";
142.2293 ++	  _M_data->_M_date_time_format = "";
142.2294 ++	  _M_data->_M_date_time_era_format = "";
142.2295 ++	  _M_data->_M_am = "AM";
142.2296 ++	  _M_data->_M_pm = "PM";
142.2297 ++	  _M_data->_M_am_pm_format = "";
142.2298 ++
142.2299 ++	  // Day names, starting with "C"'s Sunday.
142.2300 ++	  _M_data->_M_day1 = "Sunday";
142.2301 ++	  _M_data->_M_day2 = "Monday";
142.2302 ++	  _M_data->_M_day3 = "Tuesday";
142.2303 ++	  _M_data->_M_day4 = "Wednesday";
142.2304 ++	  _M_data->_M_day5 = "Thursday";
142.2305 ++	  _M_data->_M_day6 = "Friday";
142.2306 ++	  _M_data->_M_day7 = "Saturday";
142.2307 ++
142.2308 ++	  // Abbreviated day names, starting with "C"'s Sun.
142.2309 ++	  _M_data->_M_aday1 = "Sun";
142.2310 ++	  _M_data->_M_aday2 = "Mon";
142.2311 ++	  _M_data->_M_aday3 = "Tue";
142.2312 ++	  _M_data->_M_aday4 = "Wed";
142.2313 ++	  _M_data->_M_aday5 = "Thu";
142.2314 ++	  _M_data->_M_aday6 = "Fri";
142.2315 ++	  _M_data->_M_aday7 = "Sat";
142.2316 ++
142.2317 ++	  // Month names, starting with "C"'s January.
142.2318 ++	  _M_data->_M_month01 = "January";
142.2319 ++	  _M_data->_M_month02 = "February";
142.2320 ++	  _M_data->_M_month03 = "March";
142.2321 ++	  _M_data->_M_month04 = "April";
142.2322 ++	  _M_data->_M_month05 = "May";
142.2323 ++	  _M_data->_M_month06 = "June";
142.2324 ++	  _M_data->_M_month07 = "July";
142.2325 ++	  _M_data->_M_month08 = "August";
142.2326 ++	  _M_data->_M_month09 = "September";
142.2327 ++	  _M_data->_M_month10 = "October";
142.2328 ++	  _M_data->_M_month11 = "November";
142.2329 ++	  _M_data->_M_month12 = "December";
142.2330 ++
142.2331 ++	  // Abbreviated month names, starting with "C"'s Jan.
142.2332 ++	  _M_data->_M_amonth01 = "Jan";
142.2333 ++	  _M_data->_M_amonth02 = "Feb";
142.2334 ++	  _M_data->_M_amonth03 = "Mar";
142.2335 ++	  _M_data->_M_amonth04 = "Apr";
142.2336 ++	  _M_data->_M_amonth05 = "May";
142.2337 ++	  _M_data->_M_amonth06 = "Jun";
142.2338 ++	  _M_data->_M_amonth07 = "Jul";
142.2339 ++	  _M_data->_M_amonth08 = "Aug";
142.2340 ++	  _M_data->_M_amonth09 = "Sep";
142.2341 ++	  _M_data->_M_amonth10 = "Oct";
142.2342 ++	  _M_data->_M_amonth11 = "Nov";
142.2343 ++	  _M_data->_M_amonth12 = "Dec";
142.2344 ++	}
142.2345 ++      else
142.2346 ++	{
142.2347 ++	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
142.2348 ++
142.2349 ++	  _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
142.2350 ++	  _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
142.2351 ++	  _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
142.2352 ++	  _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
142.2353 ++	  _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
142.2354 ++	  _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT,
142.2355 ++							     __cloc);
142.2356 ++	  _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
142.2357 ++	  _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
142.2358 ++	  _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
142.2359 ++
142.2360 ++	  // Day names, starting with "C"'s Sunday.
142.2361 ++	  _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
142.2362 ++	  _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
142.2363 ++	  _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
142.2364 ++	  _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
142.2365 ++	  _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
142.2366 ++	  _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
142.2367 ++	  _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
142.2368 ++
142.2369 ++	  // Abbreviated day names, starting with "C"'s Sun.
142.2370 ++	  _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
142.2371 ++	  _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
142.2372 ++	  _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
142.2373 ++	  _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
142.2374 ++	  _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
142.2375 ++	  _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
142.2376 ++	  _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
142.2377 ++
142.2378 ++	  // Month names, starting with "C"'s January.
142.2379 ++	  _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
142.2380 ++	  _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
142.2381 ++	  _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
142.2382 ++	  _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
142.2383 ++	  _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
142.2384 ++	  _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
142.2385 ++	  _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
142.2386 ++	  _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
142.2387 ++	  _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
142.2388 ++	  _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
142.2389 ++	  _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
142.2390 ++	  _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
142.2391 ++
142.2392 ++	  // Abbreviated month names, starting with "C"'s Jan.
142.2393 ++	  _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
142.2394 ++	  _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
142.2395 ++	  _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
142.2396 ++	  _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
142.2397 ++	  _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
142.2398 ++	  _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
142.2399 ++	  _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
142.2400 ++	  _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
142.2401 ++	  _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
142.2402 ++	  _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
142.2403 ++	  _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
142.2404 ++	  _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
142.2405 ++	}
142.2406 ++    }
142.2407 ++
142.2408 ++#ifdef _GLIBCXX_USE_WCHAR_T
142.2409 ++  template<>
142.2410 ++    void
142.2411 ++    __timepunct<wchar_t>::
142.2412 ++    _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format, 
142.2413 ++	   const tm* __tm) const
142.2414 ++    {
142.2415 ++#ifdef __UCLIBC_HAS_XLOCALE__
142.2416 ++      __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
142.2417 ++      const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
142.2418 ++					_M_c_locale_timepunct);
142.2419 ++#else
142.2420 ++      char* __old = strdup(setlocale(LC_ALL, NULL));
142.2421 ++      setlocale(LC_ALL, _M_name_timepunct);
142.2422 ++      const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
142.2423 ++      setlocale(LC_ALL, __old);
142.2424 ++      free(__old);
142.2425 ++#endif
142.2426 ++      // Make sure __s is null terminated.
142.2427 ++      if (__len == 0)
142.2428 ++	__s[0] = L'\0';
142.2429 ++    }
142.2430 ++
142.2431 ++  template<> 
142.2432 ++    void
142.2433 ++    __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
142.2434 ++    {
142.2435 ++      if (!_M_data)
142.2436 ++	_M_data = new __timepunct_cache<wchar_t>;
142.2437 ++
142.2438 ++#warning wide time stuff
142.2439 ++//       if (!__cloc)
142.2440 ++	{
142.2441 ++	  // "C" locale
142.2442 ++	  _M_c_locale_timepunct = _S_get_c_locale();
142.2443 ++
142.2444 ++	  _M_data->_M_date_format = L"%m/%d/%y";
142.2445 ++	  _M_data->_M_date_era_format = L"%m/%d/%y";
142.2446 ++	  _M_data->_M_time_format = L"%H:%M:%S";
142.2447 ++	  _M_data->_M_time_era_format = L"%H:%M:%S";
142.2448 ++	  _M_data->_M_date_time_format = L"";
142.2449 ++	  _M_data->_M_date_time_era_format = L"";
142.2450 ++	  _M_data->_M_am = L"AM";
142.2451 ++	  _M_data->_M_pm = L"PM";
142.2452 ++	  _M_data->_M_am_pm_format = L"";
142.2453 ++
142.2454 ++	  // Day names, starting with "C"'s Sunday.
142.2455 ++	  _M_data->_M_day1 = L"Sunday";
142.2456 ++	  _M_data->_M_day2 = L"Monday";
142.2457 ++	  _M_data->_M_day3 = L"Tuesday";
142.2458 ++	  _M_data->_M_day4 = L"Wednesday";
142.2459 ++	  _M_data->_M_day5 = L"Thursday";
142.2460 ++	  _M_data->_M_day6 = L"Friday";
142.2461 ++	  _M_data->_M_day7 = L"Saturday";
142.2462 ++
142.2463 ++	  // Abbreviated day names, starting with "C"'s Sun.
142.2464 ++	  _M_data->_M_aday1 = L"Sun";
142.2465 ++	  _M_data->_M_aday2 = L"Mon";
142.2466 ++	  _M_data->_M_aday3 = L"Tue";
142.2467 ++	  _M_data->_M_aday4 = L"Wed";
142.2468 ++	  _M_data->_M_aday5 = L"Thu";
142.2469 ++	  _M_data->_M_aday6 = L"Fri";
142.2470 ++	  _M_data->_M_aday7 = L"Sat";
142.2471 ++
142.2472 ++	  // Month names, starting with "C"'s January.
142.2473 ++	  _M_data->_M_month01 = L"January";
142.2474 ++	  _M_data->_M_month02 = L"February";
142.2475 ++	  _M_data->_M_month03 = L"March";
142.2476 ++	  _M_data->_M_month04 = L"April";
142.2477 ++	  _M_data->_M_month05 = L"May";
142.2478 ++	  _M_data->_M_month06 = L"June";
142.2479 ++	  _M_data->_M_month07 = L"July";
142.2480 ++	  _M_data->_M_month08 = L"August";
142.2481 ++	  _M_data->_M_month09 = L"September";
142.2482 ++	  _M_data->_M_month10 = L"October";
142.2483 ++	  _M_data->_M_month11 = L"November";
142.2484 ++	  _M_data->_M_month12 = L"December";
142.2485 ++
142.2486 ++	  // Abbreviated month names, starting with "C"'s Jan.
142.2487 ++	  _M_data->_M_amonth01 = L"Jan";
142.2488 ++	  _M_data->_M_amonth02 = L"Feb";
142.2489 ++	  _M_data->_M_amonth03 = L"Mar";
142.2490 ++	  _M_data->_M_amonth04 = L"Apr";
142.2491 ++	  _M_data->_M_amonth05 = L"May";
142.2492 ++	  _M_data->_M_amonth06 = L"Jun";
142.2493 ++	  _M_data->_M_amonth07 = L"Jul";
142.2494 ++	  _M_data->_M_amonth08 = L"Aug";
142.2495 ++	  _M_data->_M_amonth09 = L"Sep";
142.2496 ++	  _M_data->_M_amonth10 = L"Oct";
142.2497 ++	  _M_data->_M_amonth11 = L"Nov";
142.2498 ++	  _M_data->_M_amonth12 = L"Dec";
142.2499 ++	}
142.2500 ++#if 0
142.2501 ++      else
142.2502 ++	{
142.2503 ++	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc); 
142.2504 ++
142.2505 ++	  union { char *__s; wchar_t *__w; } __u;
142.2506 ++
142.2507 ++	  __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc);
142.2508 ++	  _M_data->_M_date_format = __u.__w;
142.2509 ++	  __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc);
142.2510 ++	  _M_data->_M_date_era_format = __u.__w;
142.2511 ++	  __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc);
142.2512 ++	  _M_data->_M_time_format = __u.__w;
142.2513 ++	  __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc);
142.2514 ++	  _M_data->_M_time_era_format = __u.__w;
142.2515 ++	  __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc);
142.2516 ++	  _M_data->_M_date_time_format = __u.__w;
142.2517 ++	  __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc);
142.2518 ++	  _M_data->_M_date_time_era_format = __u.__w;
142.2519 ++	  __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc);
142.2520 ++	  _M_data->_M_am = __u.__w;
142.2521 ++	  __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc);
142.2522 ++	  _M_data->_M_pm = __u.__w;
142.2523 ++	  __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc);
142.2524 ++	  _M_data->_M_am_pm_format = __u.__w;
142.2525 ++
142.2526 ++	  // Day names, starting with "C"'s Sunday.
142.2527 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc);
142.2528 ++	  _M_data->_M_day1 = __u.__w;
142.2529 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc);
142.2530 ++	  _M_data->_M_day2 = __u.__w;
142.2531 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc);
142.2532 ++	  _M_data->_M_day3 = __u.__w;
142.2533 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc);
142.2534 ++	  _M_data->_M_day4 = __u.__w;
142.2535 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc);
142.2536 ++	  _M_data->_M_day5 = __u.__w;
142.2537 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc);
142.2538 ++	  _M_data->_M_day6 = __u.__w;
142.2539 ++	  __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc);
142.2540 ++	  _M_data->_M_day7 = __u.__w;
142.2541 ++
142.2542 ++	  // Abbreviated day names, starting with "C"'s Sun.
142.2543 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc);
142.2544 ++	  _M_data->_M_aday1 = __u.__w;
142.2545 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc);
142.2546 ++	  _M_data->_M_aday2 = __u.__w;
142.2547 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc);
142.2548 ++	  _M_data->_M_aday3 = __u.__w;
142.2549 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc);
142.2550 ++	  _M_data->_M_aday4 = __u.__w;
142.2551 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc);
142.2552 ++	  _M_data->_M_aday5 = __u.__w;
142.2553 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc);
142.2554 ++	  _M_data->_M_aday6 = __u.__w;
142.2555 ++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc);
142.2556 ++	  _M_data->_M_aday7 = __u.__w;
142.2557 ++
142.2558 ++	  // Month names, starting with "C"'s January.
142.2559 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc);
142.2560 ++	  _M_data->_M_month01 = __u.__w;
142.2561 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc);
142.2562 ++	  _M_data->_M_month02 = __u.__w;
142.2563 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc);
142.2564 ++	  _M_data->_M_month03 = __u.__w;
142.2565 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc);
142.2566 ++	  _M_data->_M_month04 = __u.__w;
142.2567 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc);
142.2568 ++	  _M_data->_M_month05 = __u.__w;
142.2569 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc);
142.2570 ++	  _M_data->_M_month06 = __u.__w;
142.2571 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc);
142.2572 ++	  _M_data->_M_month07 = __u.__w;
142.2573 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc);
142.2574 ++	  _M_data->_M_month08 = __u.__w;
142.2575 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc);
142.2576 ++	  _M_data->_M_month09 = __u.__w;
142.2577 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc);
142.2578 ++	  _M_data->_M_month10 = __u.__w;
142.2579 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc);
142.2580 ++	  _M_data->_M_month11 = __u.__w;
142.2581 ++	  __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc);
142.2582 ++	  _M_data->_M_month12 = __u.__w;
142.2583 ++
142.2584 ++	  // Abbreviated month names, starting with "C"'s Jan.
142.2585 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc);
142.2586 ++	  _M_data->_M_amonth01 = __u.__w;
142.2587 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc);
142.2588 ++	  _M_data->_M_amonth02 = __u.__w;
142.2589 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc);
142.2590 ++	  _M_data->_M_amonth03 = __u.__w;
142.2591 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc);
142.2592 ++	  _M_data->_M_amonth04 = __u.__w;
142.2593 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc);
142.2594 ++	  _M_data->_M_amonth05 = __u.__w;
142.2595 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc);
142.2596 ++	  _M_data->_M_amonth06 = __u.__w;
142.2597 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc);
142.2598 ++	  _M_data->_M_amonth07 = __u.__w;
142.2599 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc);
142.2600 ++	  _M_data->_M_amonth08 = __u.__w;
142.2601 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc);
142.2602 ++	  _M_data->_M_amonth09 = __u.__w;
142.2603 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc);
142.2604 ++	  _M_data->_M_amonth10 = __u.__w;
142.2605 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc);
142.2606 ++	  _M_data->_M_amonth11 = __u.__w;
142.2607 ++	  __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc);
142.2608 ++	  _M_data->_M_amonth12 = __u.__w;
142.2609 ++	}
142.2610 ++#endif // 0
142.2611 ++    }
142.2612 ++#endif
142.2613 ++}
142.2614 +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
142.2615 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h	1970-01-01 01:00:00.000000000 +0100
142.2616 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.h	2008-06-10 14:58:39.000000000 +0200
142.2617 +@@ -0,0 +1,68 @@
142.2618 ++// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
142.2619 ++
142.2620 ++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
142.2621 ++//
142.2622 ++// This file is part of the GNU ISO C++ Library.  This library is free
142.2623 ++// software; you can redistribute it and/or modify it under the
142.2624 ++// terms of the GNU General Public License as published by the
142.2625 ++// Free Software Foundation; either version 2, or (at your option)
142.2626 ++// any later version.
142.2627 ++
142.2628 ++// This library is distributed in the hope that it will be useful,
142.2629 ++// but WITHOUT ANY WARRANTY; without even the implied warranty of
142.2630 ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
142.2631 ++// GNU General Public License for more details.
142.2632 ++
142.2633 ++// You should have received a copy of the GNU General Public License along
142.2634 ++// with this library; see the file COPYING.  If not, write to the Free
142.2635 ++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
142.2636 ++// USA.
142.2637 ++
142.2638 ++// As a special exception, you may use this file as part of a free software
142.2639 ++// library without restriction.  Specifically, if other files instantiate
142.2640 ++// templates or use macros or inline functions from this file, or you compile
142.2641 ++// this file and link it with other files to produce an executable, this
142.2642 ++// file does not by itself cause the resulting executable to be covered by
142.2643 ++// the GNU General Public License.  This exception does not however
142.2644 ++// invalidate any other reasons why the executable file might be covered by
142.2645 ++// the GNU General Public License.
142.2646 ++
142.2647 ++//
142.2648 ++// ISO C++ 14882: 22.2.5.1.2 - time_get functions
142.2649 ++// ISO C++ 14882: 22.2.5.3.2 - time_put functions
142.2650 ++//
142.2651 ++
142.2652 ++// Written by Benjamin Kosnik <bkoz@redhat.com>
142.2653 ++
142.2654 ++  template<typename _CharT>
142.2655 ++    __timepunct<_CharT>::__timepunct(size_t __refs) 
142.2656 ++    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
142.2657 ++    _M_name_timepunct(_S_get_c_name())
142.2658 ++    { _M_initialize_timepunct(); }
142.2659 ++
142.2660 ++  template<typename _CharT>
142.2661 ++    __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) 
142.2662 ++    : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), 
142.2663 ++    _M_name_timepunct(_S_get_c_name())
142.2664 ++    { _M_initialize_timepunct(); }
142.2665 ++
142.2666 ++  template<typename _CharT>
142.2667 ++    __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
142.2668 ++				     size_t __refs) 
142.2669 ++    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
142.2670 ++    _M_name_timepunct(__s)
142.2671 ++    { 
142.2672 ++      char* __tmp = new char[std::strlen(__s) + 1];
142.2673 ++      std::strcpy(__tmp, __s);
142.2674 ++      _M_name_timepunct = __tmp;
142.2675 ++      _M_initialize_timepunct(__cloc); 
142.2676 ++    }
142.2677 ++
142.2678 ++  template<typename _CharT>
142.2679 ++    __timepunct<_CharT>::~__timepunct()
142.2680 ++    { 
142.2681 ++      if (_M_name_timepunct != _S_get_c_name())
142.2682 ++	delete [] _M_name_timepunct;
142.2683 ++      delete _M_data; 
142.2684 ++      _S_destroy_c_locale(_M_c_locale_timepunct); 
142.2685 ++    }
142.2686 +diff -durN gcc-4.3.1.orig/libstdc++-v3/configure gcc-4.3.1/libstdc++-v3/configure
142.2687 +--- gcc-4.3.1.orig/libstdc++-v3/configure	2008-04-25 18:52:57.000000000 +0200
142.2688 ++++ gcc-4.3.1/libstdc++-v3/configure	2008-06-10 14:58:39.000000000 +0200
142.2689 +@@ -14001,7 +14001,7 @@
142.2690 +   enableval="$enable_clocale"
142.2691 + 
142.2692 +       case "$enableval" in
142.2693 +-       generic|gnu|ieee_1003.1-2001|yes|no|auto) ;;
142.2694 ++       generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto) ;;
142.2695 +        *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable clocale" >&5
142.2696 + echo "$as_me: error: Unknown argument to enable/disable clocale" >&2;}
142.2697 +    { (exit 1); exit 1; }; } ;;
142.2698 +@@ -14034,6 +14034,9 @@
142.2699 +   # Default to "generic".
142.2700 +   if test $enable_clocale_flag = auto; then
142.2701 +     case ${target_os} in
142.2702 ++      linux-uclibc*)
142.2703 ++        enable_clocale_flag=uclibc
142.2704 ++	;;
142.2705 +       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
142.2706 +         enable_clocale_flag=gnu
142.2707 +         ;;
142.2708 +@@ -14422,6 +14425,76 @@
142.2709 +       CTIME_CC=config/locale/generic/time_members.cc
142.2710 +       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
142.2711 +       ;;
142.2712 ++    uclibc)
142.2713 ++      echo "$as_me:$LINENO: result: uclibc" >&5
142.2714 ++echo "${ECHO_T}uclibc" >&6
142.2715 ++
142.2716 ++      # Declare intention to use gettext, and add support for specific
142.2717 ++      # languages.
142.2718 ++      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
142.2719 ++      ALL_LINGUAS="de fr"
142.2720 ++
142.2721 ++      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
142.2722 ++      # Extract the first word of "msgfmt", so it can be a program name with args.
142.2723 ++set dummy msgfmt; ac_word=$2
142.2724 ++echo "$as_me:$LINENO: checking for $ac_word" >&5
142.2725 ++echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
142.2726 ++if test "${ac_cv_prog_check_msgfmt+set}" = set; then
142.2727 ++  echo $ECHO_N "(cached) $ECHO_C" >&6
142.2728 ++else
142.2729 ++  if test -n "$check_msgfmt"; then
142.2730 ++  ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
142.2731 ++else
142.2732 ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
142.2733 ++for as_dir in $PATH
142.2734 ++do
142.2735 ++  IFS=$as_save_IFS
142.2736 ++  test -z "$as_dir" && as_dir=.
142.2737 ++  for ac_exec_ext in '' $ac_executable_extensions; do
142.2738 ++  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
142.2739 ++    ac_cv_prog_check_msgfmt="yes"
142.2740 ++    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
142.2741 ++    break 2
142.2742 ++  fi
142.2743 ++done
142.2744 ++done
142.2745 ++
142.2746 ++  test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
142.2747 ++fi
142.2748 ++fi
142.2749 ++check_msgfmt=$ac_cv_prog_check_msgfmt
142.2750 ++if test -n "$check_msgfmt"; then
142.2751 ++  echo "$as_me:$LINENO: result: $check_msgfmt" >&5
142.2752 ++echo "${ECHO_T}$check_msgfmt" >&6
142.2753 ++else
142.2754 ++  echo "$as_me:$LINENO: result: no" >&5
142.2755 ++echo "${ECHO_T}no" >&6
142.2756 ++fi
142.2757 ++
142.2758 ++      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
142.2759 ++        USE_NLS=yes
142.2760 ++      fi
142.2761 ++      # Export the build objects.
142.2762 ++      for ling in $ALL_LINGUAS; do \
142.2763 ++        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
142.2764 ++        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
142.2765 ++      done
142.2766 ++
142.2767 ++
142.2768 ++
142.2769 ++      CLOCALE_H=config/locale/uclibc/c_locale.h
142.2770 ++      CLOCALE_CC=config/locale/uclibc/c_locale.cc
142.2771 ++      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
142.2772 ++      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
142.2773 ++      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
142.2774 ++      CMESSAGES_H=config/locale/uclibc/messages_members.h
142.2775 ++      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
142.2776 ++      CMONEY_CC=config/locale/uclibc/monetary_members.cc
142.2777 ++      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
142.2778 ++      CTIME_H=config/locale/uclibc/time_members.h
142.2779 ++      CTIME_CC=config/locale/uclibc/time_members.cc
142.2780 ++      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
142.2781 ++      ;;
142.2782 +   esac
142.2783 + 
142.2784 +   # This is where the testsuite looks for locale catalogs, using the
142.2785 +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
142.2786 +--- gcc-4.3.1.orig/libstdc++-v3/include/c_compatibility/wchar.h	2007-03-04 23:59:49.000000000 +0100
142.2787 ++++ gcc-4.3.1/libstdc++-v3/include/c_compatibility/wchar.h	2008-06-10 14:58:39.000000000 +0200
142.2788 +@@ -106,7 +106,9 @@
142.2789 + using std::wmemcpy;
142.2790 + using std::wmemmove;
142.2791 + using std::wmemset;
142.2792 ++#if _GLIBCXX_HAVE_WCSFTIME
142.2793 + using std::wcsftime;
142.2794 ++#endif
142.2795 + 
142.2796 + #if _GLIBCXX_USE_C99
142.2797 + using std::wcstold;
   143.1 --- a/patches/gcc/4.3.1/550-203-uclibc-locale-no__x.patch	Mon Jul 28 20:17:48 2008 +0000
   143.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   143.3 @@ -1,224 +0,0 @@
   143.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_203-uclibc-locale-no__x.patch
   143.5 -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
   143.6 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2008-06-10 14:58:43.000000000 +0200
   143.7 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2008-06-10 14:58:43.000000000 +0200
   143.8 -@@ -60,4 +60,49 @@
   143.9 - extern "C" __typeof(wctype_l) __wctype_l;
  143.10 - #endif 
  143.11 - 
  143.12 -+# define __nl_langinfo_l nl_langinfo_l
  143.13 -+# define __strcoll_l strcoll_l
  143.14 -+# define __strftime_l strftime_l
  143.15 -+# define __strtod_l strtod_l
  143.16 -+# define __strtof_l strtof_l
  143.17 -+# define __strtold_l strtold_l
  143.18 -+# define __strxfrm_l strxfrm_l
  143.19 -+# define __newlocale newlocale
  143.20 -+# define __freelocale freelocale
  143.21 -+# define __duplocale duplocale
  143.22 -+# define __uselocale uselocale
  143.23 -+
  143.24 -+# ifdef _GLIBCXX_USE_WCHAR_T
  143.25 -+#  define __iswctype_l iswctype_l
  143.26 -+#  define __towlower_l towlower_l
  143.27 -+#  define __towupper_l towupper_l
  143.28 -+#  define __wcscoll_l wcscoll_l
  143.29 -+#  define __wcsftime_l wcsftime_l
  143.30 -+#  define __wcsxfrm_l wcsxfrm_l
  143.31 -+#  define __wctype_l wctype_l
  143.32 -+# endif
  143.33 -+
  143.34 -+#else
  143.35 -+# define __nl_langinfo_l(N, L)       nl_langinfo((N))
  143.36 -+# define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
  143.37 -+# define __strtod_l(S, E, L)         strtod((S), (E))
  143.38 -+# define __strtof_l(S, E, L)         strtof((S), (E))
  143.39 -+# define __strtold_l(S, E, L)        strtold((S), (E))
  143.40 -+# define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
  143.41 -+# warning should dummy __newlocale check for C|POSIX ?
  143.42 -+# define __newlocale(a, b, c)        NULL
  143.43 -+# define __freelocale(a)             ((void)0)
  143.44 -+# define __duplocale(a)              __c_locale()
  143.45 -+//# define __uselocale ?
  143.46 -+//
  143.47 -+# ifdef _GLIBCXX_USE_WCHAR_T
  143.48 -+#  define __iswctype_l(C, M, L)       iswctype((C), (M))
  143.49 -+#  define __towlower_l(C, L)          towlower((C))
  143.50 -+#  define __towupper_l(C, L)          towupper((C))
  143.51 -+#  define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
  143.52 -+//#  define __wcsftime_l(S, M, F, T, L)  wcsftime((S), (M), (F), (T)) 
  143.53 -+#  define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
  143.54 -+#  define __wctype_l(S, L)            wctype((S))
  143.55 -+# endif
  143.56 -+
  143.57 - #endif // GLIBC 2.3 and later
  143.58 -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
  143.59 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc	2008-06-10 14:58:43.000000000 +0200
  143.60 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.cc	2008-06-10 14:58:43.000000000 +0200
  143.61 -@@ -39,20 +39,6 @@
  143.62 - #include <langinfo.h>
  143.63 - #include <bits/c++locale_internal.h>
  143.64 - 
  143.65 --#ifndef __UCLIBC_HAS_XLOCALE__
  143.66 --#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
  143.67 --#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
  143.68 --#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
  143.69 --#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
  143.70 --#define __strtof_l(S, E, L)         strtof((S), (E))
  143.71 --#define __strtod_l(S, E, L)         strtod((S), (E))
  143.72 --#define __strtold_l(S, E, L)        strtold((S), (E))
  143.73 --#warning should dummy __newlocale check for C|POSIX ?
  143.74 --#define __newlocale(a, b, c)        NULL
  143.75 --#define __freelocale(a)             ((void)0)
  143.76 --#define __duplocale(a)              __c_locale()
  143.77 --#endif
  143.78 --
  143.79 - namespace std 
  143.80 - {
  143.81 -   template<>
  143.82 -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
  143.83 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h	2008-06-10 14:58:43.000000000 +0200
  143.84 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.h	2008-06-10 14:58:43.000000000 +0200
  143.85 -@@ -68,6 +68,7 @@
  143.86 - {
  143.87 -   extern "C" __typeof(uselocale) __uselocale;
  143.88 - }
  143.89 -+#define __uselocale uselocale
  143.90 - #endif
  143.91 - 
  143.92 - namespace std
  143.93 -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
  143.94 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc	2008-06-10 14:58:43.000000000 +0200
  143.95 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/collate_members.cc	2008-06-10 14:58:43.000000000 +0200
  143.96 -@@ -36,13 +36,6 @@
  143.97 - #include <locale>
  143.98 - #include <bits/c++locale_internal.h>
  143.99 - 
 143.100 --#ifndef __UCLIBC_HAS_XLOCALE__
 143.101 --#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
 143.102 --#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
 143.103 --#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
 143.104 --#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
 143.105 --#endif
 143.106 --
 143.107 - namespace std
 143.108 - {
 143.109 -   // These are basically extensions to char_traits, and perhaps should
 143.110 -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
 143.111 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2008-06-10 14:58:43.000000000 +0200
 143.112 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2008-06-10 14:58:43.000000000 +0200
 143.113 -@@ -38,13 +38,6 @@
 143.114 - #undef _LIBC
 143.115 - #include <bits/c++locale_internal.h>
 143.116 - 
 143.117 --#ifndef __UCLIBC_HAS_XLOCALE__
 143.118 --#define __wctype_l(S, L)           wctype((S))
 143.119 --#define __towupper_l(C, L)         towupper((C))
 143.120 --#define __towlower_l(C, L)         towlower((C))
 143.121 --#define __iswctype_l(C, M, L)      iswctype((C), (M))
 143.122 --#endif
 143.123 --
 143.124 - namespace std
 143.125 - {
 143.126 -   // NB: The other ctype<char> specializations are in src/locale.cc and
 143.127 -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
 143.128 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc	2008-06-10 14:58:43.000000000 +0200
 143.129 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.cc	2008-06-10 14:58:43.000000000 +0200
 143.130 -@@ -39,13 +39,10 @@
 143.131 - #ifdef __UCLIBC_MJN3_ONLY__
 143.132 - #warning fix gettext stuff
 143.133 - #endif
 143.134 --#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 143.135 --extern "C" char *__dcgettext(const char *domainname,
 143.136 --			     const char *msgid, int category);
 143.137 - #undef gettext
 143.138 --#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
 143.139 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 143.140 -+#define gettext(msgid) dcgettext(NULL, msgid, LC_MESSAGES)
 143.141 - #else
 143.142 --#undef gettext
 143.143 - #define gettext(msgid) (msgid)
 143.144 - #endif
 143.145 - 
 143.146 -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
 143.147 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:58:43.000000000 +0200
 143.148 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:58:43.000000000 +0200
 143.149 -@@ -36,15 +36,11 @@
 143.150 - #ifdef __UCLIBC_MJN3_ONLY__
 143.151 - #warning fix prototypes for *textdomain funcs
 143.152 - #endif
 143.153 --#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 143.154 --extern "C" char *__textdomain(const char *domainname);
 143.155 --extern "C" char *__bindtextdomain(const char *domainname,
 143.156 --				  const char *dirname);
 143.157 --#else
 143.158 --#undef __textdomain
 143.159 --#undef __bindtextdomain
 143.160 --#define __textdomain(D)           ((void)0)
 143.161 --#define __bindtextdomain(D,P)     ((void)0)
 143.162 -+#ifndef __UCLIBC_HAS_GETTEXT_AWARENESS__
 143.163 -+#undef textdomain
 143.164 -+#undef bindtextdomain
 143.165 -+#define textdomain(D)           ((void)0)
 143.166 -+#define bindtextdomain(D,P)     ((void)0)
 143.167 - #endif
 143.168 - 
 143.169 -   // Non-virtual member functions.
 143.170 -@@ -70,7 +66,7 @@
 143.171 -     messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, 
 143.172 - 			   const char* __dir) const
 143.173 -     { 
 143.174 --      __bindtextdomain(__s.c_str(), __dir);
 143.175 -+      bindtextdomain(__s.c_str(), __dir);
 143.176 -       return this->do_open(__s, __loc); 
 143.177 -     }
 143.178 - 
 143.179 -@@ -90,7 +86,7 @@
 143.180 -     { 
 143.181 -       // No error checking is done, assume the catalog exists and can
 143.182 -       // be used.
 143.183 --      __textdomain(__s.c_str());
 143.184 -+      textdomain(__s.c_str());
 143.185 -       return 0;
 143.186 -     }
 143.187 - 
 143.188 -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
 143.189 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:58:43.000000000 +0200
 143.190 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:58:43.000000000 +0200
 143.191 -@@ -43,10 +43,6 @@
 143.192 - #warning tailor for stub locale support
 143.193 - #endif
 143.194 - 
 143.195 --#ifndef __UCLIBC_HAS_XLOCALE__
 143.196 --#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 143.197 --#endif
 143.198 --
 143.199 - namespace std
 143.200 - {
 143.201 -   // Construct and return valid pattern consisting of some combination of:
 143.202 -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
 143.203 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:58:43.000000000 +0200
 143.204 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:58:43.000000000 +0200
 143.205 -@@ -41,9 +41,6 @@
 143.206 - #ifdef __UCLIBC_MJN3_ONLY__
 143.207 - #warning tailor for stub locale support
 143.208 - #endif
 143.209 --#ifndef __UCLIBC_HAS_XLOCALE__
 143.210 --#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 143.211 --#endif
 143.212 - 
 143.213 - namespace std
 143.214 - {
 143.215 -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
 143.216 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc	2008-06-10 14:58:43.000000000 +0200
 143.217 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.cc	2008-06-10 14:58:43.000000000 +0200
 143.218 -@@ -40,9 +40,6 @@
 143.219 - #ifdef __UCLIBC_MJN3_ONLY__
 143.220 - #warning tailor for stub locale support
 143.221 - #endif
 143.222 --#ifndef __UCLIBC_HAS_XLOCALE__
 143.223 --#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 143.224 --#endif
 143.225 - 
 143.226 - namespace std
 143.227 - {
   144.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   144.2 +++ b/patches/gcc/4.3.1/550-uclibc-locale-no__x.patch	Mon Jul 28 21:08:01 2008 +0000
   144.3 @@ -0,0 +1,224 @@
   144.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_203-uclibc-locale-no__x.patch
   144.5 +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
   144.6 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2008-06-10 14:58:43.000000000 +0200
   144.7 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h	2008-06-10 14:58:43.000000000 +0200
   144.8 +@@ -60,4 +60,49 @@
   144.9 + extern "C" __typeof(wctype_l) __wctype_l;
  144.10 + #endif 
  144.11 + 
  144.12 ++# define __nl_langinfo_l nl_langinfo_l
  144.13 ++# define __strcoll_l strcoll_l
  144.14 ++# define __strftime_l strftime_l
  144.15 ++# define __strtod_l strtod_l
  144.16 ++# define __strtof_l strtof_l
  144.17 ++# define __strtold_l strtold_l
  144.18 ++# define __strxfrm_l strxfrm_l
  144.19 ++# define __newlocale newlocale
  144.20 ++# define __freelocale freelocale
  144.21 ++# define __duplocale duplocale
  144.22 ++# define __uselocale uselocale
  144.23 ++
  144.24 ++# ifdef _GLIBCXX_USE_WCHAR_T
  144.25 ++#  define __iswctype_l iswctype_l
  144.26 ++#  define __towlower_l towlower_l
  144.27 ++#  define __towupper_l towupper_l
  144.28 ++#  define __wcscoll_l wcscoll_l
  144.29 ++#  define __wcsftime_l wcsftime_l
  144.30 ++#  define __wcsxfrm_l wcsxfrm_l
  144.31 ++#  define __wctype_l wctype_l
  144.32 ++# endif
  144.33 ++
  144.34 ++#else
  144.35 ++# define __nl_langinfo_l(N, L)       nl_langinfo((N))
  144.36 ++# define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
  144.37 ++# define __strtod_l(S, E, L)         strtod((S), (E))
  144.38 ++# define __strtof_l(S, E, L)         strtof((S), (E))
  144.39 ++# define __strtold_l(S, E, L)        strtold((S), (E))
  144.40 ++# define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
  144.41 ++# warning should dummy __newlocale check for C|POSIX ?
  144.42 ++# define __newlocale(a, b, c)        NULL
  144.43 ++# define __freelocale(a)             ((void)0)
  144.44 ++# define __duplocale(a)              __c_locale()
  144.45 ++//# define __uselocale ?
  144.46 ++//
  144.47 ++# ifdef _GLIBCXX_USE_WCHAR_T
  144.48 ++#  define __iswctype_l(C, M, L)       iswctype((C), (M))
  144.49 ++#  define __towlower_l(C, L)          towlower((C))
  144.50 ++#  define __towupper_l(C, L)          towupper((C))
  144.51 ++#  define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
  144.52 ++//#  define __wcsftime_l(S, M, F, T, L)  wcsftime((S), (M), (F), (T)) 
  144.53 ++#  define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
  144.54 ++#  define __wctype_l(S, L)            wctype((S))
  144.55 ++# endif
  144.56 ++
  144.57 + #endif // GLIBC 2.3 and later
  144.58 +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
  144.59 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc	2008-06-10 14:58:43.000000000 +0200
  144.60 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.cc	2008-06-10 14:58:43.000000000 +0200
  144.61 +@@ -39,20 +39,6 @@
  144.62 + #include <langinfo.h>
  144.63 + #include <bits/c++locale_internal.h>
  144.64 + 
  144.65 +-#ifndef __UCLIBC_HAS_XLOCALE__
  144.66 +-#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
  144.67 +-#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
  144.68 +-#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
  144.69 +-#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
  144.70 +-#define __strtof_l(S, E, L)         strtof((S), (E))
  144.71 +-#define __strtod_l(S, E, L)         strtod((S), (E))
  144.72 +-#define __strtold_l(S, E, L)        strtold((S), (E))
  144.73 +-#warning should dummy __newlocale check for C|POSIX ?
  144.74 +-#define __newlocale(a, b, c)        NULL
  144.75 +-#define __freelocale(a)             ((void)0)
  144.76 +-#define __duplocale(a)              __c_locale()
  144.77 +-#endif
  144.78 +-
  144.79 + namespace std 
  144.80 + {
  144.81 +   template<>
  144.82 +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
  144.83 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h	2008-06-10 14:58:43.000000000 +0200
  144.84 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.h	2008-06-10 14:58:43.000000000 +0200
  144.85 +@@ -68,6 +68,7 @@
  144.86 + {
  144.87 +   extern "C" __typeof(uselocale) __uselocale;
  144.88 + }
  144.89 ++#define __uselocale uselocale
  144.90 + #endif
  144.91 + 
  144.92 + namespace std
  144.93 +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
  144.94 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc	2008-06-10 14:58:43.000000000 +0200
  144.95 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/collate_members.cc	2008-06-10 14:58:43.000000000 +0200
  144.96 +@@ -36,13 +36,6 @@
  144.97 + #include <locale>
  144.98 + #include <bits/c++locale_internal.h>
  144.99 + 
 144.100 +-#ifndef __UCLIBC_HAS_XLOCALE__
 144.101 +-#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
 144.102 +-#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
 144.103 +-#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
 144.104 +-#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
 144.105 +-#endif
 144.106 +-
 144.107 + namespace std
 144.108 + {
 144.109 +   // These are basically extensions to char_traits, and perhaps should
 144.110 +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
 144.111 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2008-06-10 14:58:43.000000000 +0200
 144.112 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2008-06-10 14:58:43.000000000 +0200
 144.113 +@@ -38,13 +38,6 @@
 144.114 + #undef _LIBC
 144.115 + #include <bits/c++locale_internal.h>
 144.116 + 
 144.117 +-#ifndef __UCLIBC_HAS_XLOCALE__
 144.118 +-#define __wctype_l(S, L)           wctype((S))
 144.119 +-#define __towupper_l(C, L)         towupper((C))
 144.120 +-#define __towlower_l(C, L)         towlower((C))
 144.121 +-#define __iswctype_l(C, M, L)      iswctype((C), (M))
 144.122 +-#endif
 144.123 +-
 144.124 + namespace std
 144.125 + {
 144.126 +   // NB: The other ctype<char> specializations are in src/locale.cc and
 144.127 +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
 144.128 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc	2008-06-10 14:58:43.000000000 +0200
 144.129 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.cc	2008-06-10 14:58:43.000000000 +0200
 144.130 +@@ -39,13 +39,10 @@
 144.131 + #ifdef __UCLIBC_MJN3_ONLY__
 144.132 + #warning fix gettext stuff
 144.133 + #endif
 144.134 +-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 144.135 +-extern "C" char *__dcgettext(const char *domainname,
 144.136 +-			     const char *msgid, int category);
 144.137 + #undef gettext
 144.138 +-#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
 144.139 ++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 144.140 ++#define gettext(msgid) dcgettext(NULL, msgid, LC_MESSAGES)
 144.141 + #else
 144.142 +-#undef gettext
 144.143 + #define gettext(msgid) (msgid)
 144.144 + #endif
 144.145 + 
 144.146 +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
 144.147 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:58:43.000000000 +0200
 144.148 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:58:43.000000000 +0200
 144.149 +@@ -36,15 +36,11 @@
 144.150 + #ifdef __UCLIBC_MJN3_ONLY__
 144.151 + #warning fix prototypes for *textdomain funcs
 144.152 + #endif
 144.153 +-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 144.154 +-extern "C" char *__textdomain(const char *domainname);
 144.155 +-extern "C" char *__bindtextdomain(const char *domainname,
 144.156 +-				  const char *dirname);
 144.157 +-#else
 144.158 +-#undef __textdomain
 144.159 +-#undef __bindtextdomain
 144.160 +-#define __textdomain(D)           ((void)0)
 144.161 +-#define __bindtextdomain(D,P)     ((void)0)
 144.162 ++#ifndef __UCLIBC_HAS_GETTEXT_AWARENESS__
 144.163 ++#undef textdomain
 144.164 ++#undef bindtextdomain
 144.165 ++#define textdomain(D)           ((void)0)
 144.166 ++#define bindtextdomain(D,P)     ((void)0)
 144.167 + #endif
 144.168 + 
 144.169 +   // Non-virtual member functions.
 144.170 +@@ -70,7 +66,7 @@
 144.171 +     messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, 
 144.172 + 			   const char* __dir) const
 144.173 +     { 
 144.174 +-      __bindtextdomain(__s.c_str(), __dir);
 144.175 ++      bindtextdomain(__s.c_str(), __dir);
 144.176 +       return this->do_open(__s, __loc); 
 144.177 +     }
 144.178 + 
 144.179 +@@ -90,7 +86,7 @@
 144.180 +     { 
 144.181 +       // No error checking is done, assume the catalog exists and can
 144.182 +       // be used.
 144.183 +-      __textdomain(__s.c_str());
 144.184 ++      textdomain(__s.c_str());
 144.185 +       return 0;
 144.186 +     }
 144.187 + 
 144.188 +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
 144.189 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:58:43.000000000 +0200
 144.190 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:58:43.000000000 +0200
 144.191 +@@ -43,10 +43,6 @@
 144.192 + #warning tailor for stub locale support
 144.193 + #endif
 144.194 + 
 144.195 +-#ifndef __UCLIBC_HAS_XLOCALE__
 144.196 +-#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 144.197 +-#endif
 144.198 +-
 144.199 + namespace std
 144.200 + {
 144.201 +   // Construct and return valid pattern consisting of some combination of:
 144.202 +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
 144.203 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:58:43.000000000 +0200
 144.204 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:58:43.000000000 +0200
 144.205 +@@ -41,9 +41,6 @@
 144.206 + #ifdef __UCLIBC_MJN3_ONLY__
 144.207 + #warning tailor for stub locale support
 144.208 + #endif
 144.209 +-#ifndef __UCLIBC_HAS_XLOCALE__
 144.210 +-#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 144.211 +-#endif
 144.212 + 
 144.213 + namespace std
 144.214 + {
 144.215 +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
 144.216 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc	2008-06-10 14:58:43.000000000 +0200
 144.217 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.cc	2008-06-10 14:58:43.000000000 +0200
 144.218 +@@ -40,9 +40,6 @@
 144.219 + #ifdef __UCLIBC_MJN3_ONLY__
 144.220 + #warning tailor for stub locale support
 144.221 + #endif
 144.222 +-#ifndef __UCLIBC_HAS_XLOCALE__
 144.223 +-#define __nl_langinfo_l(N, L)         nl_langinfo((N))
 144.224 +-#endif
 144.225 + 
 144.226 + namespace std
 144.227 + {
   145.1 --- a/patches/gcc/4.3.1/575-204-uclibc-locale-wchar_fix.patch	Mon Jul 28 20:17:48 2008 +0000
   145.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   145.3 @@ -1,51 +0,0 @@
   145.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_204-uclibc-locale-wchar_fix.patch
   145.5 -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
   145.6 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:58:47.000000000 +0200
   145.7 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:58:47.000000000 +0200
   145.8 -@@ -401,7 +401,7 @@
   145.9 - # ifdef __UCLIBC_HAS_XLOCALE__
  145.10 - 	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
  145.11 - 	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
  145.12 --# else
  145.13 -+# elif defined __UCLIBC_HAS_LOCALE__
  145.14 - 	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
  145.15 - 	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
  145.16 - # endif
  145.17 -@@ -556,7 +556,7 @@
  145.18 - # ifdef __UCLIBC_HAS_XLOCALE__
  145.19 - 	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
  145.20 - 	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
  145.21 --# else
  145.22 -+# elif defined __UCLIBC_HAS_LOCALE__
  145.23 - 	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
  145.24 - 	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
  145.25 - # endif
  145.26 -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
  145.27 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:58:47.000000000 +0200
  145.28 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:58:47.000000000 +0200
  145.29 -@@ -127,12 +127,25 @@
  145.30 - 	{
  145.31 - 	  // Named locale.
  145.32 - 	  // NB: In the GNU model wchar_t is always 32 bit wide.
  145.33 -+#ifdef __UCLIBC_MJN3_ONLY__
  145.34 -+#warning fix this... should be numeric
  145.35 -+#endif
  145.36 -+#ifdef __UCLIBC__
  145.37 -+# ifdef __UCLIBC_HAS_XLOCALE__
  145.38 -+	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
  145.39 -+	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
  145.40 -+# elif defined __UCLIBC_HAS_LOCALE__
  145.41 -+	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
  145.42 -+	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
  145.43 -+# endif
  145.44 -+#else
  145.45 - 	  union { char *__s; wchar_t __w; } __u;
  145.46 - 	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
  145.47 - 	  _M_data->_M_decimal_point = __u.__w;
  145.48 - 
  145.49 - 	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
  145.50 - 	  _M_data->_M_thousands_sep = __u.__w;
  145.51 -+#endif
  145.52 - 
  145.53 - 	  if (_M_data->_M_thousands_sep == L'\0')
  145.54 - 	    _M_data->_M_grouping = "";
   146.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   146.2 +++ b/patches/gcc/4.3.1/575-uclibc-locale-wchar_fix.patch	Mon Jul 28 21:08:01 2008 +0000
   146.3 @@ -0,0 +1,51 @@
   146.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_204-uclibc-locale-wchar_fix.patch
   146.5 +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
   146.6 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:58:47.000000000 +0200
   146.7 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:58:47.000000000 +0200
   146.8 +@@ -401,7 +401,7 @@
   146.9 + # ifdef __UCLIBC_HAS_XLOCALE__
  146.10 + 	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
  146.11 + 	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
  146.12 +-# else
  146.13 ++# elif defined __UCLIBC_HAS_LOCALE__
  146.14 + 	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
  146.15 + 	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
  146.16 + # endif
  146.17 +@@ -556,7 +556,7 @@
  146.18 + # ifdef __UCLIBC_HAS_XLOCALE__
  146.19 + 	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
  146.20 + 	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
  146.21 +-# else
  146.22 ++# elif defined __UCLIBC_HAS_LOCALE__
  146.23 + 	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
  146.24 + 	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
  146.25 + # endif
  146.26 +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
  146.27 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:58:47.000000000 +0200
  146.28 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:58:47.000000000 +0200
  146.29 +@@ -127,12 +127,25 @@
  146.30 + 	{
  146.31 + 	  // Named locale.
  146.32 + 	  // NB: In the GNU model wchar_t is always 32 bit wide.
  146.33 ++#ifdef __UCLIBC_MJN3_ONLY__
  146.34 ++#warning fix this... should be numeric
  146.35 ++#endif
  146.36 ++#ifdef __UCLIBC__
  146.37 ++# ifdef __UCLIBC_HAS_XLOCALE__
  146.38 ++	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
  146.39 ++	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
  146.40 ++# elif defined __UCLIBC_HAS_LOCALE__
  146.41 ++	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
  146.42 ++	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
  146.43 ++# endif
  146.44 ++#else
  146.45 + 	  union { char *__s; wchar_t __w; } __u;
  146.46 + 	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
  146.47 + 	  _M_data->_M_decimal_point = __u.__w;
  146.48 + 
  146.49 + 	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
  146.50 + 	  _M_data->_M_thousands_sep = __u.__w;
  146.51 ++#endif
  146.52 + 
  146.53 + 	  if (_M_data->_M_thousands_sep == L'\0')
  146.54 + 	    _M_data->_M_grouping = "";
   147.1 --- a/patches/gcc/4.3.1/600-205-uclibc-locale-update.patch	Mon Jul 28 20:17:48 2008 +0000
   147.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   147.3 @@ -1,355 +0,0 @@
   147.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_205-uclibc-locale-update.patch
   147.5 -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
   147.6 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc	2008-06-10 14:58:47.000000000 +0200
   147.7 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.cc	2008-06-10 14:58:51.000000000 +0200
   147.8 -@@ -46,16 +46,13 @@
   147.9 -     __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, 
  147.10 - 		   const __c_locale& __cloc)
  147.11 -     {
  147.12 --      if (!(__err & ios_base::failbit))
  147.13 --	{
  147.14 --	  char* __sanity;
  147.15 --	  errno = 0;
  147.16 --	  float __f = __strtof_l(__s, &__sanity, __cloc);
  147.17 --          if (__sanity != __s && errno != ERANGE)
  147.18 --	    __v = __f;
  147.19 --	  else
  147.20 --	    __err |= ios_base::failbit;
  147.21 --	}
  147.22 -+      char* __sanity;
  147.23 -+      errno = 0;
  147.24 -+      float __f = __strtof_l(__s, &__sanity, __cloc);
  147.25 -+      if (__sanity != __s && errno != ERANGE)
  147.26 -+	__v = __f;
  147.27 -+      else
  147.28 -+	__err |= ios_base::failbit;
  147.29 -     }
  147.30 - 
  147.31 -   template<>
  147.32 -@@ -63,16 +60,13 @@
  147.33 -     __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, 
  147.34 - 		   const __c_locale& __cloc)
  147.35 -     {
  147.36 --      if (!(__err & ios_base::failbit))
  147.37 --	{
  147.38 --	  char* __sanity;
  147.39 --	  errno = 0;
  147.40 --	  double __d = __strtod_l(__s, &__sanity, __cloc);
  147.41 --          if (__sanity != __s && errno != ERANGE)
  147.42 --	    __v = __d;
  147.43 --	  else
  147.44 --	    __err |= ios_base::failbit;
  147.45 --	}
  147.46 -+      char* __sanity;
  147.47 -+      errno = 0;
  147.48 -+      double __d = __strtod_l(__s, &__sanity, __cloc);
  147.49 -+      if (__sanity != __s && errno != ERANGE)
  147.50 -+	__v = __d;
  147.51 -+      else
  147.52 -+	__err |= ios_base::failbit;
  147.53 -     }
  147.54 - 
  147.55 -   template<>
  147.56 -@@ -80,16 +74,13 @@
  147.57 -     __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
  147.58 - 		   const __c_locale& __cloc)
  147.59 -     {
  147.60 --      if (!(__err & ios_base::failbit))
  147.61 --	{
  147.62 --	  char* __sanity;
  147.63 --	  errno = 0;
  147.64 --	  long double __ld = __strtold_l(__s, &__sanity, __cloc);
  147.65 --          if (__sanity != __s && errno != ERANGE)
  147.66 --	    __v = __ld;
  147.67 --	  else
  147.68 --	    __err |= ios_base::failbit;
  147.69 --	}
  147.70 -+      char* __sanity;
  147.71 -+      errno = 0;
  147.72 -+      long double __ld = __strtold_l(__s, &__sanity, __cloc);
  147.73 -+      if (__sanity != __s && errno != ERANGE)
  147.74 -+	__v = __ld;
  147.75 -+      else
  147.76 -+	__err |= ios_base::failbit;
  147.77 -     }
  147.78 - 
  147.79 -   void
  147.80 -@@ -110,7 +101,7 @@
  147.81 -   void
  147.82 -   locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
  147.83 -   {
  147.84 --    if (_S_get_c_locale() != __cloc)
  147.85 -+    if (__cloc && _S_get_c_locale() != __cloc)
  147.86 -       __freelocale(__cloc); 
  147.87 -   }
  147.88 - 
  147.89 -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
  147.90 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h	2008-06-10 14:58:47.000000000 +0200
  147.91 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.h	2008-06-10 14:58:51.000000000 +0200
  147.92 -@@ -39,21 +39,23 @@
  147.93 - #pragma GCC system_header
  147.94 - 
  147.95 - #include <cstring>              // get std::strlen
  147.96 --#include <cstdio>               // get std::snprintf or std::sprintf
  147.97 -+#include <cstdio>               // get std::vsnprintf or std::vsprintf
  147.98 - #include <clocale>
  147.99 - #include <langinfo.h>		// For codecvt
 147.100 - #ifdef __UCLIBC_MJN3_ONLY__
 147.101 - #warning fix this
 147.102 - #endif
 147.103 --#ifdef __UCLIBC_HAS_LOCALE__
 147.104 -+#ifdef _GLIBCXX_USE_ICONV
 147.105 - #include <iconv.h>		// For codecvt using iconv, iconv_t
 147.106 - #endif
 147.107 --#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 147.108 --#include <libintl.h> 		// For messages
 147.109 -+#ifdef HAVE_LIBINTL_H
 147.110 -+#include <libintl.h>		// For messages
 147.111 - #endif
 147.112 -+#include <cstdarg>
 147.113 - 
 147.114 - #ifdef __UCLIBC_MJN3_ONLY__
 147.115 - #warning what is _GLIBCXX_C_LOCALE_GNU for
 147.116 -+// psm: used in os/gnu-linux/ctype_noninline.h
 147.117 - #endif
 147.118 - #define _GLIBCXX_C_LOCALE_GNU 1
 147.119 - 
 147.120 -@@ -62,7 +64,7 @@
 147.121 - #endif
 147.122 - // #define _GLIBCXX_NUM_CATEGORIES 6
 147.123 - #define _GLIBCXX_NUM_CATEGORIES 0
 147.124 -- 
 147.125 -+
 147.126 - #ifdef __UCLIBC_HAS_XLOCALE__
 147.127 - namespace __gnu_cxx
 147.128 - {
 147.129 -@@ -79,22 +81,24 @@
 147.130 -   typedef int*			__c_locale;
 147.131 - #endif
 147.132 - 
 147.133 --  // Convert numeric value of type _Tv to string and return length of
 147.134 --  // string.  If snprintf is available use it, otherwise fall back to
 147.135 --  // the unsafe sprintf which, in general, can be dangerous and should
 147.136 -+  // Convert numeric value of type double to string and return length of
 147.137 -+  // string.  If vsnprintf is available use it, otherwise fall back to
 147.138 -+  // the unsafe vsprintf which, in general, can be dangerous and should
 147.139 -   // be avoided.
 147.140 --  template<typename _Tv>
 147.141 --    int
 147.142 --    __convert_from_v(char* __out, 
 147.143 --		     const int __size __attribute__ ((__unused__)),
 147.144 --		     const char* __fmt,
 147.145 --#ifdef __UCLIBC_HAS_XCLOCALE__
 147.146 --		     _Tv __v, const __c_locale& __cloc, int __prec)
 147.147 -+    inline int
 147.148 -+    __convert_from_v(const __c_locale&
 147.149 -+#ifndef __UCLIBC_HAS_XCLOCALE__
 147.150 -+					__cloc __attribute__ ((__unused__))
 147.151 -+#endif
 147.152 -+		     ,
 147.153 -+		     char* __out,
 147.154 -+		     const int __size,
 147.155 -+		     const char* __fmt, ...)
 147.156 -     {
 147.157 -+      va_list __args;
 147.158 -+#ifdef __UCLIBC_HAS_XCLOCALE__
 147.159 -       __c_locale __old = __gnu_cxx::__uselocale(__cloc);
 147.160 - #else
 147.161 --		     _Tv __v, const __c_locale&, int __prec)
 147.162 --    {
 147.163 - # ifdef __UCLIBC_HAS_LOCALE__
 147.164 -       char* __old = std::setlocale(LC_ALL, NULL);
 147.165 -       char* __sav = new char[std::strlen(__old) + 1];
 147.166 -@@ -103,7 +107,9 @@
 147.167 - # endif
 147.168 - #endif
 147.169 - 
 147.170 --      const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
 147.171 -+      va_start(__args, __fmt);
 147.172 -+      const int __ret = std::vsnprintf(__out, __size, __fmt, __args);
 147.173 -+      va_end(__args);
 147.174 - 
 147.175 - #ifdef __UCLIBC_HAS_XCLOCALE__
 147.176 -       __gnu_cxx::__uselocale(__old);
 147.177 -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
 147.178 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2008-06-10 14:58:47.000000000 +0200
 147.179 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2008-06-10 14:58:51.000000000 +0200
 147.180 -@@ -33,9 +33,14 @@
 147.181 - 
 147.182 - // Written by Benjamin Kosnik <bkoz@redhat.com>
 147.183 - 
 147.184 -+#include <features.h>
 147.185 -+#ifdef __UCLIBC_HAS_LOCALE__
 147.186 - #define _LIBC
 147.187 - #include <locale>
 147.188 - #undef _LIBC
 147.189 -+#else
 147.190 -+#include <locale>
 147.191 -+#endif
 147.192 - #include <bits/c++locale_internal.h>
 147.193 - 
 147.194 - namespace std
 147.195 -@@ -138,20 +143,34 @@
 147.196 -   ctype<wchar_t>::
 147.197 -   do_is(mask __m, wchar_t __c) const
 147.198 -   { 
 147.199 --    // Highest bitmask in ctype_base == 10, but extra in "C"
 147.200 --    // library for blank.
 147.201 -+    // The case of __m == ctype_base::space is particularly important,
 147.202 -+    // due to its use in many istream functions.  Therefore we deal with
 147.203 -+    // it first, exploiting the knowledge that on GNU systems _M_bit[5]
 147.204 -+    // is the mask corresponding to ctype_base::space.  NB: an encoding
 147.205 -+    // change would not affect correctness!
 147.206 -     bool __ret = false;
 147.207 --    const size_t __bitmasksize = 11; 
 147.208 --    for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 147.209 --      if (__m & _M_bit[__bitcur]
 147.210 --	  && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 147.211 --	{
 147.212 --	  __ret = true;
 147.213 --	  break;
 147.214 --	}
 147.215 -+    if (__m == _M_bit[5])
 147.216 -+      __ret = __iswctype_l(__c, _M_wmask[5], _M_c_locale_ctype);
 147.217 -+    else
 147.218 -+      {
 147.219 -+	// Highest bitmask in ctype_base == 10, but extra in "C"
 147.220 -+	// library for blank.
 147.221 -+	const size_t __bitmasksize = 11;
 147.222 -+	for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 147.223 -+	  if (__m & _M_bit[__bitcur])
 147.224 -+	    {
 147.225 -+	      if (__iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 147.226 -+		{
 147.227 -+		  __ret = true;
 147.228 -+		  break;
 147.229 -+		}
 147.230 -+	      else if (__m == _M_bit[__bitcur])
 147.231 -+		break;
 147.232 -+	    }
 147.233 -+      }
 147.234 -     return __ret;    
 147.235 -   }
 147.236 --  
 147.237 -+
 147.238 -   const wchar_t* 
 147.239 -   ctype<wchar_t>::
 147.240 -   do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
 147.241 -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
 147.242 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:58:47.000000000 +0200
 147.243 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:58:51.000000000 +0200
 147.244 -@@ -47,18 +47,21 @@
 147.245 -   template<typename _CharT>
 147.246 -      messages<_CharT>::messages(size_t __refs)
 147.247 -      : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), 
 147.248 --     _M_name_messages(_S_get_c_name())
 147.249 -+       _M_name_messages(_S_get_c_name())
 147.250 -      { }
 147.251 - 
 147.252 -   template<typename _CharT>
 147.253 -      messages<_CharT>::messages(__c_locale __cloc, const char* __s, 
 147.254 - 				size_t __refs) 
 147.255 --     : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
 147.256 --     _M_name_messages(__s)
 147.257 -+     : facet(__refs), _M_c_locale_messages(NULL), _M_name_messages(NULL)
 147.258 -      {
 147.259 --       char* __tmp = new char[std::strlen(__s) + 1];
 147.260 --       std::strcpy(__tmp, __s);
 147.261 -+       const size_t __len = std::strlen(__s) + 1;
 147.262 -+       char* __tmp = new char[__len];
 147.263 -+       std::memcpy(__tmp, __s, __len);
 147.264 -        _M_name_messages = __tmp;
 147.265 -+
 147.266 -+       // Last to avoid leaking memory if new throws.
 147.267 -+       _M_c_locale_messages = _S_clone_c_locale(__cloc);
 147.268 -      }
 147.269 - 
 147.270 -   template<typename _CharT>
 147.271 -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
 147.272 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:58:51.000000000 +0200
 147.273 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:58:51.000000000 +0200
 147.274 -@@ -33,9 +33,14 @@
 147.275 - 
 147.276 - // Written by Benjamin Kosnik <bkoz@redhat.com>
 147.277 - 
 147.278 -+#include <features.h>
 147.279 -+#ifdef __UCLIBC_HAS_LOCALE__
 147.280 - #define _LIBC
 147.281 - #include <locale>
 147.282 - #undef _LIBC
 147.283 -+#else
 147.284 -+#include <locale>
 147.285 -+#endif
 147.286 - #include <bits/c++locale_internal.h>
 147.287 - 
 147.288 - #ifdef __UCLIBC_MJN3_ONLY__
 147.289 -@@ -206,7 +211,7 @@
 147.290 - 	  }
 147.291 - 	break;
 147.292 -       default:
 147.293 --	;
 147.294 -+	__ret = pattern();
 147.295 -       }
 147.296 -     return __ret;
 147.297 -   }
 147.298 -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
 147.299 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:58:51.000000000 +0200
 147.300 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:58:51.000000000 +0200
 147.301 -@@ -33,9 +33,14 @@
 147.302 - 
 147.303 - // Written by Benjamin Kosnik <bkoz@redhat.com>
 147.304 - 
 147.305 -+#include <features.h>
 147.306 -+#ifdef __UCLIBC_HAS_LOCALE__
 147.307 - #define _LIBC
 147.308 - #include <locale>
 147.309 - #undef _LIBC
 147.310 -+#else
 147.311 -+#include <locale>
 147.312 -+#endif
 147.313 - #include <bits/c++locale_internal.h>
 147.314 - 
 147.315 - #ifdef __UCLIBC_MJN3_ONLY__
 147.316 -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
 147.317 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h	2008-06-10 14:58:43.000000000 +0200
 147.318 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.h	2008-06-10 14:58:51.000000000 +0200
 147.319 -@@ -37,25 +37,33 @@
 147.320 -   template<typename _CharT>
 147.321 -     __timepunct<_CharT>::__timepunct(size_t __refs) 
 147.322 -     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
 147.323 --    _M_name_timepunct(_S_get_c_name())
 147.324 -+      _M_name_timepunct(_S_get_c_name())
 147.325 -     { _M_initialize_timepunct(); }
 147.326 - 
 147.327 -   template<typename _CharT>
 147.328 -     __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) 
 147.329 -     : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), 
 147.330 --    _M_name_timepunct(_S_get_c_name())
 147.331 -+      _M_name_timepunct(_S_get_c_name())
 147.332 -     { _M_initialize_timepunct(); }
 147.333 - 
 147.334 -   template<typename _CharT>
 147.335 -     __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
 147.336 - 				     size_t __refs) 
 147.337 -     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
 147.338 --    _M_name_timepunct(__s)
 147.339 -+      _M_name_timepunct(NULL)
 147.340 -     { 
 147.341 --      char* __tmp = new char[std::strlen(__s) + 1];
 147.342 --      std::strcpy(__tmp, __s);
 147.343 -+      const size_t __len = std::strlen(__s) + 1;
 147.344 -+      char* __tmp = new char[__len];
 147.345 -+      std::memcpy(__tmp, __s, __len);
 147.346 -       _M_name_timepunct = __tmp;
 147.347 --      _M_initialize_timepunct(__cloc); 
 147.348 -+
 147.349 -+      try
 147.350 -+	{ _M_initialize_timepunct(__cloc); }
 147.351 -+      catch(...)
 147.352 -+	{
 147.353 -+	  delete [] _M_name_timepunct;
 147.354 -+	  __throw_exception_again;
 147.355 -+	}
 147.356 -     }
 147.357 - 
 147.358 -   template<typename _CharT>
   148.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   148.2 +++ b/patches/gcc/4.3.1/600-uclibc-locale-update.patch	Mon Jul 28 21:08:01 2008 +0000
   148.3 @@ -0,0 +1,355 @@
   148.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_205-uclibc-locale-update.patch
   148.5 +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
   148.6 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc	2008-06-10 14:58:47.000000000 +0200
   148.7 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.cc	2008-06-10 14:58:51.000000000 +0200
   148.8 +@@ -46,16 +46,13 @@
   148.9 +     __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, 
  148.10 + 		   const __c_locale& __cloc)
  148.11 +     {
  148.12 +-      if (!(__err & ios_base::failbit))
  148.13 +-	{
  148.14 +-	  char* __sanity;
  148.15 +-	  errno = 0;
  148.16 +-	  float __f = __strtof_l(__s, &__sanity, __cloc);
  148.17 +-          if (__sanity != __s && errno != ERANGE)
  148.18 +-	    __v = __f;
  148.19 +-	  else
  148.20 +-	    __err |= ios_base::failbit;
  148.21 +-	}
  148.22 ++      char* __sanity;
  148.23 ++      errno = 0;
  148.24 ++      float __f = __strtof_l(__s, &__sanity, __cloc);
  148.25 ++      if (__sanity != __s && errno != ERANGE)
  148.26 ++	__v = __f;
  148.27 ++      else
  148.28 ++	__err |= ios_base::failbit;
  148.29 +     }
  148.30 + 
  148.31 +   template<>
  148.32 +@@ -63,16 +60,13 @@
  148.33 +     __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, 
  148.34 + 		   const __c_locale& __cloc)
  148.35 +     {
  148.36 +-      if (!(__err & ios_base::failbit))
  148.37 +-	{
  148.38 +-	  char* __sanity;
  148.39 +-	  errno = 0;
  148.40 +-	  double __d = __strtod_l(__s, &__sanity, __cloc);
  148.41 +-          if (__sanity != __s && errno != ERANGE)
  148.42 +-	    __v = __d;
  148.43 +-	  else
  148.44 +-	    __err |= ios_base::failbit;
  148.45 +-	}
  148.46 ++      char* __sanity;
  148.47 ++      errno = 0;
  148.48 ++      double __d = __strtod_l(__s, &__sanity, __cloc);
  148.49 ++      if (__sanity != __s && errno != ERANGE)
  148.50 ++	__v = __d;
  148.51 ++      else
  148.52 ++	__err |= ios_base::failbit;
  148.53 +     }
  148.54 + 
  148.55 +   template<>
  148.56 +@@ -80,16 +74,13 @@
  148.57 +     __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
  148.58 + 		   const __c_locale& __cloc)
  148.59 +     {
  148.60 +-      if (!(__err & ios_base::failbit))
  148.61 +-	{
  148.62 +-	  char* __sanity;
  148.63 +-	  errno = 0;
  148.64 +-	  long double __ld = __strtold_l(__s, &__sanity, __cloc);
  148.65 +-          if (__sanity != __s && errno != ERANGE)
  148.66 +-	    __v = __ld;
  148.67 +-	  else
  148.68 +-	    __err |= ios_base::failbit;
  148.69 +-	}
  148.70 ++      char* __sanity;
  148.71 ++      errno = 0;
  148.72 ++      long double __ld = __strtold_l(__s, &__sanity, __cloc);
  148.73 ++      if (__sanity != __s && errno != ERANGE)
  148.74 ++	__v = __ld;
  148.75 ++      else
  148.76 ++	__err |= ios_base::failbit;
  148.77 +     }
  148.78 + 
  148.79 +   void
  148.80 +@@ -110,7 +101,7 @@
  148.81 +   void
  148.82 +   locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
  148.83 +   {
  148.84 +-    if (_S_get_c_locale() != __cloc)
  148.85 ++    if (__cloc && _S_get_c_locale() != __cloc)
  148.86 +       __freelocale(__cloc); 
  148.87 +   }
  148.88 + 
  148.89 +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
  148.90 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h	2008-06-10 14:58:47.000000000 +0200
  148.91 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.h	2008-06-10 14:58:51.000000000 +0200
  148.92 +@@ -39,21 +39,23 @@
  148.93 + #pragma GCC system_header
  148.94 + 
  148.95 + #include <cstring>              // get std::strlen
  148.96 +-#include <cstdio>               // get std::snprintf or std::sprintf
  148.97 ++#include <cstdio>               // get std::vsnprintf or std::vsprintf
  148.98 + #include <clocale>
  148.99 + #include <langinfo.h>		// For codecvt
 148.100 + #ifdef __UCLIBC_MJN3_ONLY__
 148.101 + #warning fix this
 148.102 + #endif
 148.103 +-#ifdef __UCLIBC_HAS_LOCALE__
 148.104 ++#ifdef _GLIBCXX_USE_ICONV
 148.105 + #include <iconv.h>		// For codecvt using iconv, iconv_t
 148.106 + #endif
 148.107 +-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
 148.108 +-#include <libintl.h> 		// For messages
 148.109 ++#ifdef HAVE_LIBINTL_H
 148.110 ++#include <libintl.h>		// For messages
 148.111 + #endif
 148.112 ++#include <cstdarg>
 148.113 + 
 148.114 + #ifdef __UCLIBC_MJN3_ONLY__
 148.115 + #warning what is _GLIBCXX_C_LOCALE_GNU for
 148.116 ++// psm: used in os/gnu-linux/ctype_noninline.h
 148.117 + #endif
 148.118 + #define _GLIBCXX_C_LOCALE_GNU 1
 148.119 + 
 148.120 +@@ -62,7 +64,7 @@
 148.121 + #endif
 148.122 + // #define _GLIBCXX_NUM_CATEGORIES 6
 148.123 + #define _GLIBCXX_NUM_CATEGORIES 0
 148.124 +- 
 148.125 ++
 148.126 + #ifdef __UCLIBC_HAS_XLOCALE__
 148.127 + namespace __gnu_cxx
 148.128 + {
 148.129 +@@ -79,22 +81,24 @@
 148.130 +   typedef int*			__c_locale;
 148.131 + #endif
 148.132 + 
 148.133 +-  // Convert numeric value of type _Tv to string and return length of
 148.134 +-  // string.  If snprintf is available use it, otherwise fall back to
 148.135 +-  // the unsafe sprintf which, in general, can be dangerous and should
 148.136 ++  // Convert numeric value of type double to string and return length of
 148.137 ++  // string.  If vsnprintf is available use it, otherwise fall back to
 148.138 ++  // the unsafe vsprintf which, in general, can be dangerous and should
 148.139 +   // be avoided.
 148.140 +-  template<typename _Tv>
 148.141 +-    int
 148.142 +-    __convert_from_v(char* __out, 
 148.143 +-		     const int __size __attribute__ ((__unused__)),
 148.144 +-		     const char* __fmt,
 148.145 +-#ifdef __UCLIBC_HAS_XCLOCALE__
 148.146 +-		     _Tv __v, const __c_locale& __cloc, int __prec)
 148.147 ++    inline int
 148.148 ++    __convert_from_v(const __c_locale&
 148.149 ++#ifndef __UCLIBC_HAS_XCLOCALE__
 148.150 ++					__cloc __attribute__ ((__unused__))
 148.151 ++#endif
 148.152 ++		     ,
 148.153 ++		     char* __out,
 148.154 ++		     const int __size,
 148.155 ++		     const char* __fmt, ...)
 148.156 +     {
 148.157 ++      va_list __args;
 148.158 ++#ifdef __UCLIBC_HAS_XCLOCALE__
 148.159 +       __c_locale __old = __gnu_cxx::__uselocale(__cloc);
 148.160 + #else
 148.161 +-		     _Tv __v, const __c_locale&, int __prec)
 148.162 +-    {
 148.163 + # ifdef __UCLIBC_HAS_LOCALE__
 148.164 +       char* __old = std::setlocale(LC_ALL, NULL);
 148.165 +       char* __sav = new char[std::strlen(__old) + 1];
 148.166 +@@ -103,7 +107,9 @@
 148.167 + # endif
 148.168 + #endif
 148.169 + 
 148.170 +-      const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
 148.171 ++      va_start(__args, __fmt);
 148.172 ++      const int __ret = std::vsnprintf(__out, __size, __fmt, __args);
 148.173 ++      va_end(__args);
 148.174 + 
 148.175 + #ifdef __UCLIBC_HAS_XCLOCALE__
 148.176 +       __gnu_cxx::__uselocale(__old);
 148.177 +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
 148.178 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2008-06-10 14:58:47.000000000 +0200
 148.179 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc	2008-06-10 14:58:51.000000000 +0200
 148.180 +@@ -33,9 +33,14 @@
 148.181 + 
 148.182 + // Written by Benjamin Kosnik <bkoz@redhat.com>
 148.183 + 
 148.184 ++#include <features.h>
 148.185 ++#ifdef __UCLIBC_HAS_LOCALE__
 148.186 + #define _LIBC
 148.187 + #include <locale>
 148.188 + #undef _LIBC
 148.189 ++#else
 148.190 ++#include <locale>
 148.191 ++#endif
 148.192 + #include <bits/c++locale_internal.h>
 148.193 + 
 148.194 + namespace std
 148.195 +@@ -138,20 +143,34 @@
 148.196 +   ctype<wchar_t>::
 148.197 +   do_is(mask __m, wchar_t __c) const
 148.198 +   { 
 148.199 +-    // Highest bitmask in ctype_base == 10, but extra in "C"
 148.200 +-    // library for blank.
 148.201 ++    // The case of __m == ctype_base::space is particularly important,
 148.202 ++    // due to its use in many istream functions.  Therefore we deal with
 148.203 ++    // it first, exploiting the knowledge that on GNU systems _M_bit[5]
 148.204 ++    // is the mask corresponding to ctype_base::space.  NB: an encoding
 148.205 ++    // change would not affect correctness!
 148.206 +     bool __ret = false;
 148.207 +-    const size_t __bitmasksize = 11; 
 148.208 +-    for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 148.209 +-      if (__m & _M_bit[__bitcur]
 148.210 +-	  && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 148.211 +-	{
 148.212 +-	  __ret = true;
 148.213 +-	  break;
 148.214 +-	}
 148.215 ++    if (__m == _M_bit[5])
 148.216 ++      __ret = __iswctype_l(__c, _M_wmask[5], _M_c_locale_ctype);
 148.217 ++    else
 148.218 ++      {
 148.219 ++	// Highest bitmask in ctype_base == 10, but extra in "C"
 148.220 ++	// library for blank.
 148.221 ++	const size_t __bitmasksize = 11;
 148.222 ++	for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
 148.223 ++	  if (__m & _M_bit[__bitcur])
 148.224 ++	    {
 148.225 ++	      if (__iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
 148.226 ++		{
 148.227 ++		  __ret = true;
 148.228 ++		  break;
 148.229 ++		}
 148.230 ++	      else if (__m == _M_bit[__bitcur])
 148.231 ++		break;
 148.232 ++	    }
 148.233 ++      }
 148.234 +     return __ret;    
 148.235 +   }
 148.236 +-  
 148.237 ++
 148.238 +   const wchar_t* 
 148.239 +   ctype<wchar_t>::
 148.240 +   do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
 148.241 +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
 148.242 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:58:47.000000000 +0200
 148.243 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:58:51.000000000 +0200
 148.244 +@@ -47,18 +47,21 @@
 148.245 +   template<typename _CharT>
 148.246 +      messages<_CharT>::messages(size_t __refs)
 148.247 +      : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), 
 148.248 +-     _M_name_messages(_S_get_c_name())
 148.249 ++       _M_name_messages(_S_get_c_name())
 148.250 +      { }
 148.251 + 
 148.252 +   template<typename _CharT>
 148.253 +      messages<_CharT>::messages(__c_locale __cloc, const char* __s, 
 148.254 + 				size_t __refs) 
 148.255 +-     : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
 148.256 +-     _M_name_messages(__s)
 148.257 ++     : facet(__refs), _M_c_locale_messages(NULL), _M_name_messages(NULL)
 148.258 +      {
 148.259 +-       char* __tmp = new char[std::strlen(__s) + 1];
 148.260 +-       std::strcpy(__tmp, __s);
 148.261 ++       const size_t __len = std::strlen(__s) + 1;
 148.262 ++       char* __tmp = new char[__len];
 148.263 ++       std::memcpy(__tmp, __s, __len);
 148.264 +        _M_name_messages = __tmp;
 148.265 ++
 148.266 ++       // Last to avoid leaking memory if new throws.
 148.267 ++       _M_c_locale_messages = _S_clone_c_locale(__cloc);
 148.268 +      }
 148.269 + 
 148.270 +   template<typename _CharT>
 148.271 +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
 148.272 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:58:51.000000000 +0200
 148.273 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc	2008-06-10 14:58:51.000000000 +0200
 148.274 +@@ -33,9 +33,14 @@
 148.275 + 
 148.276 + // Written by Benjamin Kosnik <bkoz@redhat.com>
 148.277 + 
 148.278 ++#include <features.h>
 148.279 ++#ifdef __UCLIBC_HAS_LOCALE__
 148.280 + #define _LIBC
 148.281 + #include <locale>
 148.282 + #undef _LIBC
 148.283 ++#else
 148.284 ++#include <locale>
 148.285 ++#endif
 148.286 + #include <bits/c++locale_internal.h>
 148.287 + 
 148.288 + #ifdef __UCLIBC_MJN3_ONLY__
 148.289 +@@ -206,7 +211,7 @@
 148.290 + 	  }
 148.291 + 	break;
 148.292 +       default:
 148.293 +-	;
 148.294 ++	__ret = pattern();
 148.295 +       }
 148.296 +     return __ret;
 148.297 +   }
 148.298 +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
 148.299 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:58:51.000000000 +0200
 148.300 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc	2008-06-10 14:58:51.000000000 +0200
 148.301 +@@ -33,9 +33,14 @@
 148.302 + 
 148.303 + // Written by Benjamin Kosnik <bkoz@redhat.com>
 148.304 + 
 148.305 ++#include <features.h>
 148.306 ++#ifdef __UCLIBC_HAS_LOCALE__
 148.307 + #define _LIBC
 148.308 + #include <locale>
 148.309 + #undef _LIBC
 148.310 ++#else
 148.311 ++#include <locale>
 148.312 ++#endif
 148.313 + #include <bits/c++locale_internal.h>
 148.314 + 
 148.315 + #ifdef __UCLIBC_MJN3_ONLY__
 148.316 +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
 148.317 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h	2008-06-10 14:58:43.000000000 +0200
 148.318 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.h	2008-06-10 14:58:51.000000000 +0200
 148.319 +@@ -37,25 +37,33 @@
 148.320 +   template<typename _CharT>
 148.321 +     __timepunct<_CharT>::__timepunct(size_t __refs) 
 148.322 +     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
 148.323 +-    _M_name_timepunct(_S_get_c_name())
 148.324 ++      _M_name_timepunct(_S_get_c_name())
 148.325 +     { _M_initialize_timepunct(); }
 148.326 + 
 148.327 +   template<typename _CharT>
 148.328 +     __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) 
 148.329 +     : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), 
 148.330 +-    _M_name_timepunct(_S_get_c_name())
 148.331 ++      _M_name_timepunct(_S_get_c_name())
 148.332 +     { _M_initialize_timepunct(); }
 148.333 + 
 148.334 +   template<typename _CharT>
 148.335 +     __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
 148.336 + 				     size_t __refs) 
 148.337 +     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
 148.338 +-    _M_name_timepunct(__s)
 148.339 ++      _M_name_timepunct(NULL)
 148.340 +     { 
 148.341 +-      char* __tmp = new char[std::strlen(__s) + 1];
 148.342 +-      std::strcpy(__tmp, __s);
 148.343 ++      const size_t __len = std::strlen(__s) + 1;
 148.344 ++      char* __tmp = new char[__len];
 148.345 ++      std::memcpy(__tmp, __s, __len);
 148.346 +       _M_name_timepunct = __tmp;
 148.347 +-      _M_initialize_timepunct(__cloc); 
 148.348 ++
 148.349 ++      try
 148.350 ++	{ _M_initialize_timepunct(__cloc); }
 148.351 ++      catch(...)
 148.352 ++	{
 148.353 ++	  delete [] _M_name_timepunct;
 148.354 ++	  __throw_exception_again;
 148.355 ++	}
 148.356 +     }
 148.357 + 
 148.358 +   template<typename _CharT>
   149.1 --- a/patches/gcc/4.3.1/625-301-missing-execinfo_h.patch	Mon Jul 28 20:17:48 2008 +0000
   149.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   149.3 @@ -1,13 +0,0 @@
   149.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_301-missing-execinfo_h.patch
   149.5 -diff -durN gcc-4.3.1.orig/boehm-gc/include/gc.h gcc-4.3.1/boehm-gc/include/gc.h
   149.6 ---- gcc-4.3.1.orig/boehm-gc/include/gc.h	2007-04-23 23:10:09.000000000 +0200
   149.7 -+++ gcc-4.3.1/boehm-gc/include/gc.h	2008-06-10 14:58:54.000000000 +0200
   149.8 -@@ -503,7 +503,7 @@
   149.9 - #if defined(__linux__) || defined(__GLIBC__)
  149.10 - # include <features.h>
  149.11 - # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
  149.12 --     && !defined(__ia64__)
  149.13 -+     && !defined(__ia64__) && !defined(__UCLIBC__)
  149.14 - #   ifndef GC_HAVE_BUILTIN_BACKTRACE
  149.15 - #     define GC_HAVE_BUILTIN_BACKTRACE
  149.16 - #   endif
   150.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   150.2 +++ b/patches/gcc/4.3.1/625-missing-execinfo_h.patch	Mon Jul 28 21:08:01 2008 +0000
   150.3 @@ -0,0 +1,13 @@
   150.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_301-missing-execinfo_h.patch
   150.5 +diff -durN gcc-4.3.1.orig/boehm-gc/include/gc.h gcc-4.3.1/boehm-gc/include/gc.h
   150.6 +--- gcc-4.3.1.orig/boehm-gc/include/gc.h	2007-04-23 23:10:09.000000000 +0200
   150.7 ++++ gcc-4.3.1/boehm-gc/include/gc.h	2008-06-10 14:58:54.000000000 +0200
   150.8 +@@ -503,7 +503,7 @@
   150.9 + #if defined(__linux__) || defined(__GLIBC__)
  150.10 + # include <features.h>
  150.11 + # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
  150.12 +-     && !defined(__ia64__)
  150.13 ++     && !defined(__ia64__) && !defined(__UCLIBC__)
  150.14 + #   ifndef GC_HAVE_BUILTIN_BACKTRACE
  150.15 + #     define GC_HAVE_BUILTIN_BACKTRACE
  150.16 + #   endif
   151.1 --- a/patches/gcc/4.3.1/650-303-c99-complex-ugly-hack.patch	Mon Jul 28 20:17:48 2008 +0000
   151.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   151.3 @@ -1,14 +0,0 @@
   151.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_303-c99-complex-ugly-hack.patch
   151.5 -diff -durN gcc-4.3.1.orig/libstdc++-v3/configure gcc-4.3.1/libstdc++-v3/configure
   151.6 ---- gcc-4.3.1.orig/libstdc++-v3/configure	2008-06-10 14:58:43.000000000 +0200
   151.7 -+++ gcc-4.3.1/libstdc++-v3/configure	2008-06-10 14:58:58.000000000 +0200
   151.8 -@@ -39006,6 +39006,9 @@
   151.9 - cat >>conftest.$ac_ext <<_ACEOF
  151.10 - /* end confdefs.h.  */
  151.11 - #include <complex.h>
  151.12 -+#ifdef __UCLIBC__
  151.13 -+#error ugly hack to make sure configure test fails here for cross until uClibc supports the complex funcs
  151.14 -+#endif
  151.15 - int
  151.16 - main ()
  151.17 - {
   152.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   152.2 +++ b/patches/gcc/4.3.1/650-c99-complex-ugly-hack.patch	Mon Jul 28 21:08:01 2008 +0000
   152.3 @@ -0,0 +1,14 @@
   152.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_303-c99-complex-ugly-hack.patch
   152.5 +diff -durN gcc-4.3.1.orig/libstdc++-v3/configure gcc-4.3.1/libstdc++-v3/configure
   152.6 +--- gcc-4.3.1.orig/libstdc++-v3/configure	2008-06-10 14:58:43.000000000 +0200
   152.7 ++++ gcc-4.3.1/libstdc++-v3/configure	2008-06-10 14:58:58.000000000 +0200
   152.8 +@@ -39006,6 +39006,9 @@
   152.9 + cat >>conftest.$ac_ext <<_ACEOF
  152.10 + /* end confdefs.h.  */
  152.11 + #include <complex.h>
  152.12 ++#ifdef __UCLIBC__
  152.13 ++#error ugly hack to make sure configure test fails here for cross until uClibc supports the complex funcs
  152.14 ++#endif
  152.15 + int
  152.16 + main ()
  152.17 + {
   153.1 --- a/patches/gcc/4.3.1/675-304-index_macro.patch	Mon Jul 28 20:17:48 2008 +0000
   153.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   153.3 @@ -1,27 +0,0 @@
   153.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_304-index_macro.patch
   153.5 -diff -durN gcc-4.3.1.orig/libstdc++-v3/include/ext/rope gcc-4.3.1/libstdc++-v3/include/ext/rope
   153.6 ---- gcc-4.3.1.orig/libstdc++-v3/include/ext/rope	2008-01-31 19:44:55.000000000 +0100
   153.7 -+++ gcc-4.3.1/libstdc++-v3/include/ext/rope	2008-06-10 14:59:02.000000000 +0200
   153.8 -@@ -59,6 +59,9 @@
   153.9 - #include <bits/gthr.h>
  153.10 - #include <tr1/functional>
  153.11 - 
  153.12 -+/* cope w/ index defined as macro, SuSv3 proposal */
  153.13 -+#undef index
  153.14 -+
  153.15 - # ifdef __GC
  153.16 - #   define __GC_CONST const
  153.17 - # else
  153.18 -diff -durN gcc-4.3.1.orig/libstdc++-v3/include/ext/ropeimpl.h gcc-4.3.1/libstdc++-v3/include/ext/ropeimpl.h
  153.19 ---- gcc-4.3.1.orig/libstdc++-v3/include/ext/ropeimpl.h	2007-05-04 17:06:46.000000000 +0200
  153.20 -+++ gcc-4.3.1/libstdc++-v3/include/ext/ropeimpl.h	2008-06-10 14:59:02.000000000 +0200
  153.21 -@@ -54,6 +54,9 @@
  153.22 - #include <ext/memory> // For uninitialized_copy_n
  153.23 - #include <ext/numeric> // For power
  153.24 - 
  153.25 -+/* cope w/ index defined as macro, SuSv3 proposal */
  153.26 -+#undef index
  153.27 -+
  153.28 - _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
  153.29 - 
  153.30 -   using std::size_t;
   154.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   154.2 +++ b/patches/gcc/4.3.1/675-index_macro.patch	Mon Jul 28 21:08:01 2008 +0000
   154.3 @@ -0,0 +1,27 @@
   154.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_304-index_macro.patch
   154.5 +diff -durN gcc-4.3.1.orig/libstdc++-v3/include/ext/rope gcc-4.3.1/libstdc++-v3/include/ext/rope
   154.6 +--- gcc-4.3.1.orig/libstdc++-v3/include/ext/rope	2008-01-31 19:44:55.000000000 +0100
   154.7 ++++ gcc-4.3.1/libstdc++-v3/include/ext/rope	2008-06-10 14:59:02.000000000 +0200
   154.8 +@@ -59,6 +59,9 @@
   154.9 + #include <bits/gthr.h>
  154.10 + #include <tr1/functional>
  154.11 + 
  154.12 ++/* cope w/ index defined as macro, SuSv3 proposal */
  154.13 ++#undef index
  154.14 ++
  154.15 + # ifdef __GC
  154.16 + #   define __GC_CONST const
  154.17 + # else
  154.18 +diff -durN gcc-4.3.1.orig/libstdc++-v3/include/ext/ropeimpl.h gcc-4.3.1/libstdc++-v3/include/ext/ropeimpl.h
  154.19 +--- gcc-4.3.1.orig/libstdc++-v3/include/ext/ropeimpl.h	2007-05-04 17:06:46.000000000 +0200
  154.20 ++++ gcc-4.3.1/libstdc++-v3/include/ext/ropeimpl.h	2008-06-10 14:59:02.000000000 +0200
  154.21 +@@ -54,6 +54,9 @@
  154.22 + #include <ext/memory> // For uninitialized_copy_n
  154.23 + #include <ext/numeric> // For power
  154.24 + 
  154.25 ++/* cope w/ index defined as macro, SuSv3 proposal */
  154.26 ++#undef index
  154.27 ++
  154.28 + _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
  154.29 + 
  154.30 +   using std::size_t;
   155.1 --- a/patches/gcc/4.3.1/700-305-libmudflap-susv3-legacy.patch	Mon Jul 28 20:17:48 2008 +0000
   155.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   155.3 @@ -1,49 +0,0 @@
   155.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_305-libmudflap-susv3-legacy.patch
   155.5 -diff -durN gcc-4.3.1.orig/libmudflap/mf-hooks2.c gcc-4.3.1/libmudflap/mf-hooks2.c
   155.6 ---- gcc-4.3.1.orig/libmudflap/mf-hooks2.c	2005-09-23 23:58:39.000000000 +0200
   155.7 -+++ gcc-4.3.1/libmudflap/mf-hooks2.c	2008-06-10 14:59:05.000000000 +0200
   155.8 -@@ -427,7 +427,7 @@
   155.9 - {
  155.10 -   TRACE ("%s\n", __PRETTY_FUNCTION__);
  155.11 -   MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region");
  155.12 --  bzero (s, n);
  155.13 -+  memset (s, 0, n);
  155.14 - }
  155.15 - 
  155.16 - 
  155.17 -@@ -437,7 +437,7 @@
  155.18 -   TRACE ("%s\n", __PRETTY_FUNCTION__);
  155.19 -   MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src");
  155.20 -   MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest");
  155.21 --  bcopy (src, dest, n);
  155.22 -+  memmove (dest, src, n);
  155.23 - }
  155.24 - 
  155.25 - 
  155.26 -@@ -447,7 +447,7 @@
  155.27 -   TRACE ("%s\n", __PRETTY_FUNCTION__);
  155.28 -   MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg");
  155.29 -   MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg");
  155.30 --  return bcmp (s1, s2, n);
  155.31 -+  return memcmp (s1, s2, n);
  155.32 - }
  155.33 - 
  155.34 - 
  155.35 -@@ -456,7 +456,7 @@
  155.36 -   size_t n = strlen (s);
  155.37 -   TRACE ("%s\n", __PRETTY_FUNCTION__);
  155.38 -   MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region");
  155.39 --  return index (s, c);
  155.40 -+  return strchr (s, c);
  155.41 - }
  155.42 - 
  155.43 - 
  155.44 -@@ -465,7 +465,7 @@
  155.45 -   size_t n = strlen (s);
  155.46 -   TRACE ("%s\n", __PRETTY_FUNCTION__);
  155.47 -   MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region");
  155.48 --  return rindex (s, c);
  155.49 -+  return strrchr (s, c);
  155.50 - }
  155.51 - 
  155.52 - /* XXX:  stpcpy, memccpy */
   156.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   156.2 +++ b/patches/gcc/4.3.1/700-libmudflap-susv3-legacy.patch	Mon Jul 28 21:08:01 2008 +0000
   156.3 @@ -0,0 +1,49 @@
   156.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_305-libmudflap-susv3-legacy.patch
   156.5 +diff -durN gcc-4.3.1.orig/libmudflap/mf-hooks2.c gcc-4.3.1/libmudflap/mf-hooks2.c
   156.6 +--- gcc-4.3.1.orig/libmudflap/mf-hooks2.c	2005-09-23 23:58:39.000000000 +0200
   156.7 ++++ gcc-4.3.1/libmudflap/mf-hooks2.c	2008-06-10 14:59:05.000000000 +0200
   156.8 +@@ -427,7 +427,7 @@
   156.9 + {
  156.10 +   TRACE ("%s\n", __PRETTY_FUNCTION__);
  156.11 +   MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region");
  156.12 +-  bzero (s, n);
  156.13 ++  memset (s, 0, n);
  156.14 + }
  156.15 + 
  156.16 + 
  156.17 +@@ -437,7 +437,7 @@
  156.18 +   TRACE ("%s\n", __PRETTY_FUNCTION__);
  156.19 +   MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src");
  156.20 +   MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest");
  156.21 +-  bcopy (src, dest, n);
  156.22 ++  memmove (dest, src, n);
  156.23 + }
  156.24 + 
  156.25 + 
  156.26 +@@ -447,7 +447,7 @@
  156.27 +   TRACE ("%s\n", __PRETTY_FUNCTION__);
  156.28 +   MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg");
  156.29 +   MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg");
  156.30 +-  return bcmp (s1, s2, n);
  156.31 ++  return memcmp (s1, s2, n);
  156.32 + }
  156.33 + 
  156.34 + 
  156.35 +@@ -456,7 +456,7 @@
  156.36 +   size_t n = strlen (s);
  156.37 +   TRACE ("%s\n", __PRETTY_FUNCTION__);
  156.38 +   MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region");
  156.39 +-  return index (s, c);
  156.40 ++  return strchr (s, c);
  156.41 + }
  156.42 + 
  156.43 + 
  156.44 +@@ -465,7 +465,7 @@
  156.45 +   size_t n = strlen (s);
  156.46 +   TRACE ("%s\n", __PRETTY_FUNCTION__);
  156.47 +   MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region");
  156.48 +-  return rindex (s, c);
  156.49 ++  return strrchr (s, c);
  156.50 + }
  156.51 + 
  156.52 + /* XXX:  stpcpy, memccpy */
   157.1 --- a/patches/gcc/4.3.1/725-306-libstdc++-namespace.patch	Mon Jul 28 20:17:48 2008 +0000
   157.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   157.3 @@ -1,38 +0,0 @@
   157.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_306-libstdc++-namespace.patch
   157.5 -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
   157.6 -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
   157.7 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:58:54.000000000 +0200
   157.8 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:59:09.000000000 +0200
   157.9 -@@ -32,7 +32,8 @@
  157.10 - //
  157.11 - 
  157.12 - // Written by Benjamin Kosnik <bkoz@redhat.com>
  157.13 --
  157.14 -+namespace std
  157.15 -+{
  157.16 - #ifdef __UCLIBC_MJN3_ONLY__
  157.17 - #warning fix prototypes for *textdomain funcs
  157.18 - #endif
  157.19 -@@ -115,3 +116,4 @@
  157.20 - 	   this->_S_create_c_locale(this->_M_c_locale_messages, __s); 
  157.21 - 	 }
  157.22 -      }
  157.23 -+}
  157.24 -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
  157.25 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h	2008-06-10 14:58:54.000000000 +0200
  157.26 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.h	2008-06-10 14:59:09.000000000 +0200
  157.27 -@@ -33,7 +33,8 @@
  157.28 - //
  157.29 - 
  157.30 - // Written by Benjamin Kosnik <bkoz@redhat.com>
  157.31 --
  157.32 -+namespace std
  157.33 -+{
  157.34 -   template<typename _CharT>
  157.35 -     __timepunct<_CharT>::__timepunct(size_t __refs) 
  157.36 -     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
  157.37 -@@ -74,3 +75,4 @@
  157.38 -       delete _M_data; 
  157.39 -       _S_destroy_c_locale(_M_c_locale_timepunct); 
  157.40 -     }
  157.41 -+}
   158.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   158.2 +++ b/patches/gcc/4.3.1/725-libstdc++-namespace.patch	Mon Jul 28 21:08:01 2008 +0000
   158.3 @@ -0,0 +1,38 @@
   158.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_306-libstdc++-namespace.patch
   158.5 +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
   158.6 +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
   158.7 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:58:54.000000000 +0200
   158.8 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h	2008-06-10 14:59:09.000000000 +0200
   158.9 +@@ -32,7 +32,8 @@
  158.10 + //
  158.11 + 
  158.12 + // Written by Benjamin Kosnik <bkoz@redhat.com>
  158.13 +-
  158.14 ++namespace std
  158.15 ++{
  158.16 + #ifdef __UCLIBC_MJN3_ONLY__
  158.17 + #warning fix prototypes for *textdomain funcs
  158.18 + #endif
  158.19 +@@ -115,3 +116,4 @@
  158.20 + 	   this->_S_create_c_locale(this->_M_c_locale_messages, __s); 
  158.21 + 	 }
  158.22 +      }
  158.23 ++}
  158.24 +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
  158.25 +--- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h	2008-06-10 14:58:54.000000000 +0200
  158.26 ++++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.h	2008-06-10 14:59:09.000000000 +0200
  158.27 +@@ -33,7 +33,8 @@
  158.28 + //
  158.29 + 
  158.30 + // Written by Benjamin Kosnik <bkoz@redhat.com>
  158.31 +-
  158.32 ++namespace std
  158.33 ++{
  158.34 +   template<typename _CharT>
  158.35 +     __timepunct<_CharT>::__timepunct(size_t __refs) 
  158.36 +     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), 
  158.37 +@@ -74,3 +75,4 @@
  158.38 +       delete _M_data; 
  158.39 +       _S_destroy_c_locale(_M_c_locale_timepunct); 
  158.40 +     }
  158.41 ++}
   159.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   159.2 +++ b/patches/gcc/4.3.1/940-alpha-signal_h.patch	Mon Jul 28 21:08:01 2008 +0000
   159.3 @@ -0,0 +1,17 @@
   159.4 +--- gcc-4.2.1-stock/gcc/config/alpha/linux-unwind.h	2005-06-24 20:22:41.000000000 -0500
   159.5 ++++ gcc-4.2.1/gcc/config/alpha/linux-unwind.h	2007-09-01 20:21:34.000000000 -0500
   159.6 +@@ -29,6 +29,9 @@ Boston, MA 02110-1301, USA.  */
   159.7 + /* Do code reading to identify a signal frame, and set the frame
   159.8 +    state data appropriately.  See unwind-dw2.c for the structs.  */
   159.9 + 
  159.10 ++/* Don't use this if inhibit_libc is set
  159.11 ++   The build for this target will fail trying to include missing headers */
  159.12 ++#ifndef inhibit_libc
  159.13 + #include <signal.h>
  159.14 + #include <sys/ucontext.h>
  159.15 + 
  159.16 +@@ -80,3 +83,4 @@ alpha_fallback_frame_state (struct _Unwi
  159.17 +   fs->retaddr_column = 64;
  159.18 +   return _URC_NO_REASON;
  159.19 + }
  159.20 ++#endif /* inhibit_libc */
   160.1 --- a/patches/gcc/4.3.1/940-gcc-alpha-signal_h.patch	Mon Jul 28 20:17:48 2008 +0000
   160.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   160.3 @@ -1,17 +0,0 @@
   160.4 ---- gcc-4.2.1-stock/gcc/config/alpha/linux-unwind.h	2005-06-24 20:22:41.000000000 -0500
   160.5 -+++ gcc-4.2.1/gcc/config/alpha/linux-unwind.h	2007-09-01 20:21:34.000000000 -0500
   160.6 -@@ -29,6 +29,9 @@ Boston, MA 02110-1301, USA.  */
   160.7 - /* Do code reading to identify a signal frame, and set the frame
   160.8 -    state data appropriately.  See unwind-dw2.c for the structs.  */
   160.9 - 
  160.10 -+/* Don't use this if inhibit_libc is set
  160.11 -+   The build for this target will fail trying to include missing headers */
  160.12 -+#ifndef inhibit_libc
  160.13 - #include <signal.h>
  160.14 - #include <sys/ucontext.h>
  160.15 - 
  160.16 -@@ -80,3 +83,4 @@ alpha_fallback_frame_state (struct _Unwi
  160.17 -   fs->retaddr_column = 64;
  160.18 -   return _URC_NO_REASON;
  160.19 - }
  160.20 -+#endif /* inhibit_libc */
   161.1 --- a/patches/gdb/6.7.1/150-gdb-6.3-security-errata-20050610.patch	Mon Jul 28 20:17:48 2008 +0000
   161.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   161.3 @@ -1,205 +0,0 @@
   161.4 -Original patch from gentoo: gentoo/src/patchsets/gdb/6.7.1/35_all_gdb-6.3-security-errata-20050610.patch
   161.5 --= BEGIN original header =-
   161.6 -2005-06-09  Jeff Johnston  <jjohnstn@redhat.com>
   161.7 -
   161.8 -        * gdb.base/gdbinit.exp: New testcase.
   161.9 -        * gdb.base/gdbinit.sample: Sample .gdbinit for gdbinit.exp.
  161.10 -
  161.11 -2005-06-08  Daniel Jacobowitz  <dan@codesourcery.com>
  161.12 -            Jeff Johnston  <jjohnstn@redhat.com>
  161.13 -
  161.14 -        * Makefile.in (cli-cmds.o): Update.
  161.15 -        * configure.in: Add check for getuid.
  161.16 -        * configure: Regenerated.
  161.17 -        * config.in: Ditto.
  161.18 -        * main.c (captured_main): Pass -1 to source_command when loading
  161.19 -        gdbinit files.
  161.20 -        * cli/cli-cmds.c: Include "gdb_stat.h" and <fcntl.h>.
  161.21 -        (source_command): Update documentation.  Check permissions if
  161.22 -        FROM_TTY is -1.
  161.23 -
  161.24 --= END original header =-
  161.25 -diff -durN gdb-6.7.1.orig/gdb/cli/cli-cmds.c gdb-6.7.1/gdb/cli/cli-cmds.c
  161.26 ---- gdb-6.7.1.orig/gdb/cli/cli-cmds.c	2007-08-23 20:08:47.000000000 +0200
  161.27 -+++ gdb-6.7.1/gdb/cli/cli-cmds.c	2008-06-17 23:27:44.000000000 +0200
  161.28 -@@ -36,6 +36,7 @@
  161.29 - #include "objfiles.h"
  161.30 - #include "source.h"
  161.31 - #include "disasm.h"
  161.32 -+#include "gdb_stat.h"
  161.33 - 
  161.34 - #include "ui-out.h"
  161.35 - 
  161.36 -@@ -459,12 +460,31 @@
  161.37 - 
  161.38 -   if (fd == -1)
  161.39 -     {
  161.40 --      if (from_tty)
  161.41 -+      if (from_tty > 0)
  161.42 - 	perror_with_name (file);
  161.43 -       else
  161.44 - 	return;
  161.45 -     }
  161.46 - 
  161.47 -+#ifdef HAVE_GETUID
  161.48 -+  if (from_tty == -1)
  161.49 -+    {
  161.50 -+      struct stat statbuf;
  161.51 -+      if (fstat (fd, &statbuf) < 0)
  161.52 -+	{
  161.53 -+	  perror_with_name (file);
  161.54 -+	  close (fd);
  161.55 -+	  return;
  161.56 -+	}
  161.57 -+      if (statbuf.st_uid != getuid () || (statbuf.st_mode & S_IWOTH))
  161.58 -+	{
  161.59 -+          warning (_("not using untrusted file \"%s\""), file);
  161.60 -+	  close (fd);
  161.61 -+	  return;
  161.62 -+	}
  161.63 -+    }
  161.64 -+#endif
  161.65 -+
  161.66 -   stream = fdopen (fd, FOPEN_RT);
  161.67 -   script_from_file (stream, file);
  161.68 - 
  161.69 -diff -durN gdb-6.7.1.orig/gdb/main.c gdb-6.7.1/gdb/main.c
  161.70 ---- gdb-6.7.1.orig/gdb/main.c	2007-08-23 20:08:36.000000000 +0200
  161.71 -+++ gdb-6.7.1/gdb/main.c	2008-06-17 23:27:44.000000000 +0200
  161.72 -@@ -688,7 +688,7 @@
  161.73 - 
  161.74 -       if (!inhibit_gdbinit)
  161.75 - 	{
  161.76 --	  catch_command_errors (source_script, homeinit, 0, RETURN_MASK_ALL);
  161.77 -+	  catch_command_errors (source_script, homeinit, -1, RETURN_MASK_ALL);
  161.78 - 	}
  161.79 - 
  161.80 -       /* Do stats; no need to do them elsewhere since we'll only
  161.81 -@@ -766,7 +766,7 @@
  161.82 -       || memcmp ((char *) &homebuf, (char *) &cwdbuf, sizeof (struct stat)))
  161.83 -     if (!inhibit_gdbinit)
  161.84 -       {
  161.85 --	catch_command_errors (source_script, gdbinit, 0, RETURN_MASK_ALL);
  161.86 -+	catch_command_errors (source_script, gdbinit, -1, RETURN_MASK_ALL);
  161.87 -       }
  161.88 - 
  161.89 -   for (i = 0; i < ncmd; i++)
  161.90 -diff -durN gdb-6.7.1.orig/gdb/Makefile.in gdb-6.7.1/gdb/Makefile.in
  161.91 ---- gdb-6.7.1.orig/gdb/Makefile.in	2008-06-17 23:27:44.000000000 +0200
  161.92 -+++ gdb-6.7.1/gdb/Makefile.in	2008-06-17 23:27:44.000000000 +0200
  161.93 -@@ -2885,7 +2885,7 @@
  161.94 - 	$(expression_h) $(frame_h) $(value_h) $(language_h) $(filenames_h) \
  161.95 - 	$(objfiles_h) $(source_h) $(disasm_h) $(ui_out_h) $(top_h) \
  161.96 - 	$(cli_decode_h) $(cli_script_h) $(cli_setshow_h) $(cli_cmds_h) \
  161.97 --	$(tui_h)
  161.98 -+	$(tui_h) $(gdb_stat_h)
  161.99 - 	$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-cmds.c
 161.100 - cli-decode.o: $(srcdir)/cli/cli-decode.c $(defs_h) $(symtab_h) \
 161.101 - 	$(gdb_regex_h) $(gdb_string_h) $(completer_h) $(ui_out_h) \
 161.102 -diff -durN gdb-6.7.1.orig/gdb/testsuite/gdb.base/gdbinit.exp gdb-6.7.1/gdb/testsuite/gdb.base/gdbinit.exp
 161.103 ---- gdb-6.7.1.orig/gdb/testsuite/gdb.base/gdbinit.exp	1970-01-01 01:00:00.000000000 +0100
 161.104 -+++ gdb-6.7.1/gdb/testsuite/gdb.base/gdbinit.exp	2008-06-17 23:27:44.000000000 +0200
 161.105 -@@ -0,0 +1,98 @@
 161.106 -+#   Copyright 2005
 161.107 -+#   Free Software Foundation, Inc.
 161.108 -+
 161.109 -+# This program is free software; you can redistribute it and/or modify
 161.110 -+# it under the terms of the GNU General Public License as published by
 161.111 -+# the Free Software Foundation; either version 2 of the License, or
 161.112 -+# (at your option) any later version.
 161.113 -+# 
 161.114 -+# This program is distributed in the hope that it will be useful,
 161.115 -+# but WITHOUT ANY WARRANTY; without even the implied warranty of
 161.116 -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 161.117 -+# GNU General Public License for more details.
 161.118 -+# 
 161.119 -+# You should have received a copy of the GNU General Public License
 161.120 -+# along with this program; if not, write to the Free Software
 161.121 -+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
 161.122 -+
 161.123 -+# Please email any bugs, comments, and/or additions to this file to:
 161.124 -+# bug-gdb@prep.ai.mit.edu
 161.125 -+
 161.126 -+# This file was written by Jeff Johnston <jjohnstn@redhat.com>.
 161.127 -+
 161.128 -+if $tracelevel then {
 161.129 -+    strace $tracelevel
 161.130 -+}
 161.131 -+
 161.132 -+set prms_id 0
 161.133 -+set bug_id 0
 161.134 -+
 161.135 -+# are we on a target board
 161.136 -+if [is_remote target] {
 161.137 -+    return
 161.138 -+}
 161.139 -+
 161.140 -+
 161.141 -+global verbose
 161.142 -+global GDB
 161.143 -+global GDBFLAGS
 161.144 -+global gdb_prompt
 161.145 -+global timeout
 161.146 -+global gdb_spawn_id;
 161.147 -+                                                                                
 161.148 -+gdb_stop_suppressing_tests;
 161.149 -+                                                                                
 161.150 -+verbose "Spawning $GDB -nw"
 161.151 -+                                                                                
 161.152 -+if [info exists gdb_spawn_id] {
 161.153 -+    return 0;
 161.154 -+}
 161.155 -+                                                                                
 161.156 -+if ![is_remote host] {
 161.157 -+   if { [which $GDB] == 0 } then {
 161.158 -+        perror "$GDB does not exist."
 161.159 -+        exit 1
 161.160 -+    }
 161.161 -+}
 161.162 -+
 161.163 -+set env(HOME) [pwd]
 161.164 -+remote_exec build "rm .gdbinit"
 161.165 -+remote_exec build "cp ${srcdir}/${subdir}/gdbinit.sample .gdbinit"
 161.166 -+remote_exec build "chmod 646 .gdbinit"
 161.167 -+
 161.168 -+set res [remote_spawn host "$GDB -nw [host_info gdb_opts]"];
 161.169 -+if { $res < 0 || $res == "" } {
 161.170 -+    perror "Spawning $GDB failed."
 161.171 -+    return 1;
 161.172 -+}
 161.173 -+gdb_expect 360 {
 161.174 -+    -re "warning: not using untrusted file.*\.gdbinit.*\[\r\n\]$gdb_prompt $" {
 161.175 -+        pass "untrusted .gdbinit caught."
 161.176 -+    }
 161.177 -+    -re "$gdb_prompt $"     {
 161.178 -+        fail "untrusted .gdbinit caught."
 161.179 -+    }
 161.180 -+    timeout {
 161.181 -+        fail "(timeout) untrusted .gdbinit caught."
 161.182 -+    }
 161.183 -+}
 161.184 -+
 161.185 -+remote_exec build "chmod 644 .gdbinit"
 161.186 -+set res [remote_spawn host "$GDB -nw [host_info gdb_opts]"];
 161.187 -+if { $res < 0 || $res == "" } {
 161.188 -+    perror "Spawning $GDB failed."
 161.189 -+    return 1;
 161.190 -+}
 161.191 -+gdb_expect 360 {
 161.192 -+    -re "warning: not using untrusted file.*\.gdbinit.*\[\r\n\]$gdb_prompt $" {
 161.193 -+        fail "trusted .gdbinit allowed."
 161.194 -+    }
 161.195 -+    -re "in gdbinit.*$gdb_prompt $"     {
 161.196 -+        pass "trusted .gdbinit allowed."
 161.197 -+    }
 161.198 -+    timeout {
 161.199 -+        fail "(timeout) trusted .gdbinit allowed."
 161.200 -+    }
 161.201 -+}
 161.202 -+
 161.203 -+remote_exec build "rm .gdbinit"
 161.204 -diff -durN gdb-6.7.1.orig/gdb/testsuite/gdb.base/gdbinit.sample gdb-6.7.1/gdb/testsuite/gdb.base/gdbinit.sample
 161.205 ---- gdb-6.7.1.orig/gdb/testsuite/gdb.base/gdbinit.sample	1970-01-01 01:00:00.000000000 +0100
 161.206 -+++ gdb-6.7.1/gdb/testsuite/gdb.base/gdbinit.sample	2008-06-17 23:27:44.000000000 +0200
 161.207 -@@ -0,0 +1 @@
 161.208 -+echo "\nin gdbinit"
   162.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   162.2 +++ b/patches/gdb/6.7.1/150-security-errata-20050610.patch	Mon Jul 28 21:08:01 2008 +0000
   162.3 @@ -0,0 +1,205 @@
   162.4 +Original patch from gentoo: gentoo/src/patchsets/gdb/6.7.1/35_all_gdb-6.3-security-errata-20050610.patch
   162.5 +-= BEGIN original header =-
   162.6 +2005-06-09  Jeff Johnston  <jjohnstn@redhat.com>
   162.7 +
   162.8 +        * gdb.base/gdbinit.exp: New testcase.
   162.9 +        * gdb.base/gdbinit.sample: Sample .gdbinit for gdbinit.exp.
  162.10 +
  162.11 +2005-06-08  Daniel Jacobowitz  <dan@codesourcery.com>
  162.12 +            Jeff Johnston  <jjohnstn@redhat.com>
  162.13 +
  162.14 +        * Makefile.in (cli-cmds.o): Update.
  162.15 +        * configure.in: Add check for getuid.
  162.16 +        * configure: Regenerated.
  162.17 +        * config.in: Ditto.
  162.18 +        * main.c (captured_main): Pass -1 to source_command when loading
  162.19 +        gdbinit files.
  162.20 +        * cli/cli-cmds.c: Include "gdb_stat.h" and <fcntl.h>.
  162.21 +        (source_command): Update documentation.  Check permissions if
  162.22 +        FROM_TTY is -1.
  162.23 +
  162.24 +-= END original header =-
  162.25 +diff -durN gdb-6.7.1.orig/gdb/cli/cli-cmds.c gdb-6.7.1/gdb/cli/cli-cmds.c
  162.26 +--- gdb-6.7.1.orig/gdb/cli/cli-cmds.c	2007-08-23 20:08:47.000000000 +0200
  162.27 ++++ gdb-6.7.1/gdb/cli/cli-cmds.c	2008-06-17 23:27:44.000000000 +0200
  162.28 +@@ -36,6 +36,7 @@
  162.29 + #include "objfiles.h"
  162.30 + #include "source.h"
  162.31 + #include "disasm.h"
  162.32 ++#include "gdb_stat.h"
  162.33 + 
  162.34 + #include "ui-out.h"
  162.35 + 
  162.36 +@@ -459,12 +460,31 @@
  162.37 + 
  162.38 +   if (fd == -1)
  162.39 +     {
  162.40 +-      if (from_tty)
  162.41 ++      if (from_tty > 0)
  162.42 + 	perror_with_name (file);
  162.43 +       else
  162.44 + 	return;
  162.45 +     }
  162.46 + 
  162.47 ++#ifdef HAVE_GETUID
  162.48 ++  if (from_tty == -1)
  162.49 ++    {
  162.50 ++      struct stat statbuf;
  162.51 ++      if (fstat (fd, &statbuf) < 0)
  162.52 ++	{
  162.53 ++	  perror_with_name (file);
  162.54 ++	  close (fd);
  162.55 ++	  return;
  162.56 ++	}
  162.57 ++      if (statbuf.st_uid != getuid () || (statbuf.st_mode & S_IWOTH))
  162.58 ++	{
  162.59 ++          warning (_("not using untrusted file \"%s\""), file);
  162.60 ++	  close (fd);
  162.61 ++	  return;
  162.62 ++	}
  162.63 ++    }
  162.64 ++#endif
  162.65 ++
  162.66 +   stream = fdopen (fd, FOPEN_RT);
  162.67 +   script_from_file (stream, file);
  162.68 + 
  162.69 +diff -durN gdb-6.7.1.orig/gdb/main.c gdb-6.7.1/gdb/main.c
  162.70 +--- gdb-6.7.1.orig/gdb/main.c	2007-08-23 20:08:36.000000000 +0200
  162.71 ++++ gdb-6.7.1/gdb/main.c	2008-06-17 23:27:44.000000000 +0200
  162.72 +@@ -688,7 +688,7 @@
  162.73 + 
  162.74 +       if (!inhibit_gdbinit)
  162.75 + 	{
  162.76 +-	  catch_command_errors (source_script, homeinit, 0, RETURN_MASK_ALL);
  162.77 ++	  catch_command_errors (source_script, homeinit, -1, RETURN_MASK_ALL);
  162.78 + 	}
  162.79 + 
  162.80 +       /* Do stats; no need to do them elsewhere since we'll only
  162.81 +@@ -766,7 +766,7 @@
  162.82 +       || memcmp ((char *) &homebuf, (char *) &cwdbuf, sizeof (struct stat)))
  162.83 +     if (!inhibit_gdbinit)
  162.84 +       {
  162.85 +-	catch_command_errors (source_script, gdbinit, 0, RETURN_MASK_ALL);
  162.86 ++	catch_command_errors (source_script, gdbinit, -1, RETURN_MASK_ALL);
  162.87 +       }
  162.88 + 
  162.89 +   for (i = 0; i < ncmd; i++)
  162.90 +diff -durN gdb-6.7.1.orig/gdb/Makefile.in gdb-6.7.1/gdb/Makefile.in
  162.91 +--- gdb-6.7.1.orig/gdb/Makefile.in	2008-06-17 23:27:44.000000000 +0200
  162.92 ++++ gdb-6.7.1/gdb/Makefile.in	2008-06-17 23:27:44.000000000 +0200
  162.93 +@@ -2885,7 +2885,7 @@
  162.94 + 	$(expression_h) $(frame_h) $(value_h) $(language_h) $(filenames_h) \
  162.95 + 	$(objfiles_h) $(source_h) $(disasm_h) $(ui_out_h) $(top_h) \
  162.96 + 	$(cli_decode_h) $(cli_script_h) $(cli_setshow_h) $(cli_cmds_h) \
  162.97 +-	$(tui_h)
  162.98 ++	$(tui_h) $(gdb_stat_h)
  162.99 + 	$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-cmds.c
 162.100 + cli-decode.o: $(srcdir)/cli/cli-decode.c $(defs_h) $(symtab_h) \
 162.101 + 	$(gdb_regex_h) $(gdb_string_h) $(completer_h) $(ui_out_h) \
 162.102 +diff -durN gdb-6.7.1.orig/gdb/testsuite/gdb.base/gdbinit.exp gdb-6.7.1/gdb/testsuite/gdb.base/gdbinit.exp
 162.103 +--- gdb-6.7.1.orig/gdb/testsuite/gdb.base/gdbinit.exp	1970-01-01 01:00:00.000000000 +0100
 162.104 ++++ gdb-6.7.1/gdb/testsuite/gdb.base/gdbinit.exp	2008-06-17 23:27:44.000000000 +0200
 162.105 +@@ -0,0 +1,98 @@
 162.106 ++#   Copyright 2005
 162.107 ++#   Free Software Foundation, Inc.
 162.108 ++
 162.109 ++# This program is free software; you can redistribute it and/or modify
 162.110 ++# it under the terms of the GNU General Public License as published by
 162.111 ++# the Free Software Foundation; either version 2 of the License, or
 162.112 ++# (at your option) any later version.
 162.113 ++# 
 162.114 ++# This program is distributed in the hope that it will be useful,
 162.115 ++# but WITHOUT ANY WARRANTY; without even the implied warranty of
 162.116 ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 162.117 ++# GNU General Public License for more details.
 162.118 ++# 
 162.119 ++# You should have received a copy of the GNU General Public License
 162.120 ++# along with this program; if not, write to the Free Software
 162.121 ++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
 162.122 ++
 162.123 ++# Please email any bugs, comments, and/or additions to this file to:
 162.124 ++# bug-gdb@prep.ai.mit.edu
 162.125 ++
 162.126 ++# This file was written by Jeff Johnston <jjohnstn@redhat.com>.
 162.127 ++
 162.128 ++if $tracelevel then {
 162.129 ++    strace $tracelevel
 162.130 ++}
 162.131 ++
 162.132 ++set prms_id 0
 162.133 ++set bug_id 0
 162.134 ++
 162.135 ++# are we on a target board
 162.136 ++if [is_remote target] {
 162.137 ++    return
 162.138 ++}
 162.139 ++
 162.140 ++
 162.141 ++global verbose
 162.142 ++global GDB
 162.143 ++global GDBFLAGS
 162.144 ++global gdb_prompt
 162.145 ++global timeout
 162.146 ++global gdb_spawn_id;
 162.147 ++                                                                                
 162.148 ++gdb_stop_suppressing_tests;
 162.149 ++                                                                                
 162.150 ++verbose "Spawning $GDB -nw"
 162.151 ++                                                                                
 162.152 ++if [info exists gdb_spawn_id] {
 162.153 ++    return 0;
 162.154 ++}
 162.155 ++                                                                                
 162.156 ++if ![is_remote host] {
 162.157 ++   if { [which $GDB] == 0 } then {
 162.158 ++        perror "$GDB does not exist."
 162.159 ++        exit 1
 162.160 ++    }
 162.161 ++}
 162.162 ++
 162.163 ++set env(HOME) [pwd]
 162.164 ++remote_exec build "rm .gdbinit"
 162.165 ++remote_exec build "cp ${srcdir}/${subdir}/gdbinit.sample .gdbinit"
 162.166 ++remote_exec build "chmod 646 .gdbinit"
 162.167 ++
 162.168 ++set res [remote_spawn host "$GDB -nw [host_info gdb_opts]"];
 162.169 ++if { $res < 0 || $res == "" } {
 162.170 ++    perror "Spawning $GDB failed."
 162.171 ++    return 1;
 162.172 ++}
 162.173 ++gdb_expect 360 {
 162.174 ++    -re "warning: not using untrusted file.*\.gdbinit.*\[\r\n\]$gdb_prompt $" {
 162.175 ++        pass "untrusted .gdbinit caught."
 162.176 ++    }
 162.177 ++    -re "$gdb_prompt $"     {
 162.178 ++        fail "untrusted .gdbinit caught."
 162.179 ++    }
 162.180 ++    timeout {
 162.181 ++        fail "(timeout) untrusted .gdbinit caught."
 162.182 ++    }
 162.183 ++}
 162.184 ++
 162.185 ++remote_exec build "chmod 644 .gdbinit"
 162.186 ++set res [remote_spawn host "$GDB -nw [host_info gdb_opts]"];
 162.187 ++if { $res < 0 || $res == "" } {
 162.188 ++    perror "Spawning $GDB failed."
 162.189 ++    return 1;
 162.190 ++}
 162.191 ++gdb_expect 360 {
 162.192 ++    -re "warning: not using untrusted file.*\.gdbinit.*\[\r\n\]$gdb_prompt $" {
 162.193 ++        fail "trusted .gdbinit allowed."
 162.194 ++    }
 162.195 ++    -re "in gdbinit.*$gdb_prompt $"     {
 162.196 ++        pass "trusted .gdbinit allowed."
 162.197 ++    }
 162.198 ++    timeout {
 162.199 ++        fail "(timeout) trusted .gdbinit allowed."
 162.200 ++    }
 162.201 ++}
 162.202 ++
 162.203 ++remote_exec build "rm .gdbinit"
 162.204 +diff -durN gdb-6.7.1.orig/gdb/testsuite/gdb.base/gdbinit.sample gdb-6.7.1/gdb/testsuite/gdb.base/gdbinit.sample
 162.205 +--- gdb-6.7.1.orig/gdb/testsuite/gdb.base/gdbinit.sample	1970-01-01 01:00:00.000000000 +0100
 162.206 ++++ gdb-6.7.1/gdb/testsuite/gdb.base/gdbinit.sample	2008-06-17 23:27:44.000000000 +0200
 162.207 +@@ -0,0 +1 @@
 162.208 ++echo "\nin gdbinit"
   163.1 --- a/patches/gdb/6.7.1/175-gdb-hppa-offsets.patch	Mon Jul 28 20:17:48 2008 +0000
   163.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   163.3 @@ -1,272 +0,0 @@
   163.4 -Original patch from gentoo: gentoo/src/patchsets/gdb/6.7.1/45_all_gdb-hppa-offsets.patch
   163.5 --= BEGIN original header =-
   163.6 -sanitized headers dont include asm/offsets.h, so cache a local copy 
   163.7 -
   163.8 -http://bugs.gentoo.org/180476
   163.9 -http://lists.parisc-linux.org/pipermail/parisc-linux/2007-February/031162.html
  163.10 -
  163.11 --= END original header =-
  163.12 -diff -durN gdb-6.7.1.orig/gdb/hppa-linux-nat.c gdb-6.7.1/gdb/hppa-linux-nat.c
  163.13 ---- gdb-6.7.1.orig/gdb/hppa-linux-nat.c	2007-08-23 20:08:33.000000000 +0200
  163.14 -+++ gdb-6.7.1/gdb/hppa-linux-nat.c	2008-06-17 23:27:45.000000000 +0200
  163.15 -@@ -32,7 +32,7 @@
  163.16 - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,43)
  163.17 - #include <asm/offset.h>
  163.18 - #else
  163.19 --#include <asm/offsets.h>
  163.20 -+#include <hppa-offsets.h>
  163.21 - #endif
  163.22 - 
  163.23 - #include "hppa-tdep.h"
  163.24 -diff -durN gdb-6.7.1.orig/gdb/hppa-offsets.h gdb-6.7.1/gdb/hppa-offsets.h
  163.25 ---- gdb-6.7.1.orig/gdb/hppa-offsets.h	1970-01-01 01:00:00.000000000 +0100
  163.26 -+++ gdb-6.7.1/gdb/hppa-offsets.h	2008-06-17 23:27:45.000000000 +0200
  163.27 -@@ -0,0 +1,248 @@
  163.28 -+#ifndef __ASM_OFFSETS_H__
  163.29 -+#define __ASM_OFFSETS_H__
  163.30 -+/*
  163.31 -+ * DO NOT MODIFY.
  163.32 -+ *
  163.33 -+ * This file was generated by arch/parisc/Makefile
  163.34 -+ *
  163.35 -+ */
  163.36 -+
  163.37 -+#define TASK_THREAD_INFO 4 /* offsetof(struct task_struct, thread_info) */
  163.38 -+#define TASK_STATE 0 /* offsetof(struct task_struct, state) */
  163.39 -+#define TASK_FLAGS 12 /* offsetof(struct task_struct, flags) */
  163.40 -+#define TASK_SIGPENDING 1188 /* offsetof(struct task_struct, pending) */
  163.41 -+#define TASK_PTRACE 16 /* offsetof(struct task_struct, ptrace) */
  163.42 -+#define TASK_MM 108 /* offsetof(struct task_struct, mm) */
  163.43 -+#define TASK_PERSONALITY 132 /* offsetof(struct task_struct, personality) */
  163.44 -+#define TASK_PID 140 /* offsetof(struct task_struct, pid) */
  163.45 -+
  163.46 -+#define TASK_REGS 664 /* offsetof(struct task_struct, thread.regs) */
  163.47 -+#define TASK_PT_PSW 664 /* offsetof(struct task_struct, thread.regs.gr[ 0]) */
  163.48 -+#define TASK_PT_GR1 668 /* offsetof(struct task_struct, thread.regs.gr[ 1]) */
  163.49 -+#define TASK_PT_GR2 672 /* offsetof(struct task_struct, thread.regs.gr[ 2]) */
  163.50 -+#define TASK_PT_GR3 676 /* offsetof(struct task_struct, thread.regs.gr[ 3]) */
  163.51 -+#define TASK_PT_GR4 680 /* offsetof(struct task_struct, thread.regs.gr[ 4]) */
  163.52 -+#define TASK_PT_GR5 684 /* offsetof(struct task_struct, thread.regs.gr[ 5]) */
  163.53 -+#define TASK_PT_GR6 688 /* offsetof(struct task_struct, thread.regs.gr[ 6]) */
  163.54 -+#define TASK_PT_GR7 692 /* offsetof(struct task_struct, thread.regs.gr[ 7]) */
  163.55 -+#define TASK_PT_GR8 696 /* offsetof(struct task_struct, thread.regs.gr[ 8]) */
  163.56 -+#define TASK_PT_GR9 700 /* offsetof(struct task_struct, thread.regs.gr[ 9]) */
  163.57 -+#define TASK_PT_GR10 704 /* offsetof(struct task_struct, thread.regs.gr[10]) */
  163.58 -+#define TASK_PT_GR11 708 /* offsetof(struct task_struct, thread.regs.gr[11]) */
  163.59 -+#define TASK_PT_GR12 712 /* offsetof(struct task_struct, thread.regs.gr[12]) */
  163.60 -+#define TASK_PT_GR13 716 /* offsetof(struct task_struct, thread.regs.gr[13]) */
  163.61 -+#define TASK_PT_GR14 720 /* offsetof(struct task_struct, thread.regs.gr[14]) */
  163.62 -+#define TASK_PT_GR15 724 /* offsetof(struct task_struct, thread.regs.gr[15]) */
  163.63 -+#define TASK_PT_GR16 728 /* offsetof(struct task_struct, thread.regs.gr[16]) */
  163.64 -+#define TASK_PT_GR17 732 /* offsetof(struct task_struct, thread.regs.gr[17]) */
  163.65 -+#define TASK_PT_GR18 736 /* offsetof(struct task_struct, thread.regs.gr[18]) */
  163.66 -+#define TASK_PT_GR19 740 /* offsetof(struct task_struct, thread.regs.gr[19]) */
  163.67 -+#define TASK_PT_GR20 744 /* offsetof(struct task_struct, thread.regs.gr[20]) */
  163.68 -+#define TASK_PT_GR21 748 /* offsetof(struct task_struct, thread.regs.gr[21]) */
  163.69 -+#define TASK_PT_GR22 752 /* offsetof(struct task_struct, thread.regs.gr[22]) */
  163.70 -+#define TASK_PT_GR23 756 /* offsetof(struct task_struct, thread.regs.gr[23]) */
  163.71 -+#define TASK_PT_GR24 760 /* offsetof(struct task_struct, thread.regs.gr[24]) */
  163.72 -+#define TASK_PT_GR25 764 /* offsetof(struct task_struct, thread.regs.gr[25]) */
  163.73 -+#define TASK_PT_GR26 768 /* offsetof(struct task_struct, thread.regs.gr[26]) */
  163.74 -+#define TASK_PT_GR27 772 /* offsetof(struct task_struct, thread.regs.gr[27]) */
  163.75 -+#define TASK_PT_GR28 776 /* offsetof(struct task_struct, thread.regs.gr[28]) */
  163.76 -+#define TASK_PT_GR29 780 /* offsetof(struct task_struct, thread.regs.gr[29]) */
  163.77 -+#define TASK_PT_GR30 784 /* offsetof(struct task_struct, thread.regs.gr[30]) */
  163.78 -+#define TASK_PT_GR31 788 /* offsetof(struct task_struct, thread.regs.gr[31]) */
  163.79 -+#define TASK_PT_FR0 792 /* offsetof(struct task_struct, thread.regs.fr[ 0]) */
  163.80 -+#define TASK_PT_FR1 800 /* offsetof(struct task_struct, thread.regs.fr[ 1]) */
  163.81 -+#define TASK_PT_FR2 808 /* offsetof(struct task_struct, thread.regs.fr[ 2]) */
  163.82 -+#define TASK_PT_FR3 816 /* offsetof(struct task_struct, thread.regs.fr[ 3]) */
  163.83 -+#define TASK_PT_FR4 824 /* offsetof(struct task_struct, thread.regs.fr[ 4]) */
  163.84 -+#define TASK_PT_FR5 832 /* offsetof(struct task_struct, thread.regs.fr[ 5]) */
  163.85 -+#define TASK_PT_FR6 840 /* offsetof(struct task_struct, thread.regs.fr[ 6]) */
  163.86 -+#define TASK_PT_FR7 848 /* offsetof(struct task_struct, thread.regs.fr[ 7]) */
  163.87 -+#define TASK_PT_FR8 856 /* offsetof(struct task_struct, thread.regs.fr[ 8]) */
  163.88 -+#define TASK_PT_FR9 864 /* offsetof(struct task_struct, thread.regs.fr[ 9]) */
  163.89 -+#define TASK_PT_FR10 872 /* offsetof(struct task_struct, thread.regs.fr[10]) */
  163.90 -+#define TASK_PT_FR11 880 /* offsetof(struct task_struct, thread.regs.fr[11]) */
  163.91 -+#define TASK_PT_FR12 888 /* offsetof(struct task_struct, thread.regs.fr[12]) */
  163.92 -+#define TASK_PT_FR13 896 /* offsetof(struct task_struct, thread.regs.fr[13]) */
  163.93 -+#define TASK_PT_FR14 904 /* offsetof(struct task_struct, thread.regs.fr[14]) */
  163.94 -+#define TASK_PT_FR15 912 /* offsetof(struct task_struct, thread.regs.fr[15]) */
  163.95 -+#define TASK_PT_FR16 920 /* offsetof(struct task_struct, thread.regs.fr[16]) */
  163.96 -+#define TASK_PT_FR17 928 /* offsetof(struct task_struct, thread.regs.fr[17]) */
  163.97 -+#define TASK_PT_FR18 936 /* offsetof(struct task_struct, thread.regs.fr[18]) */
  163.98 -+#define TASK_PT_FR19 944 /* offsetof(struct task_struct, thread.regs.fr[19]) */
  163.99 -+#define TASK_PT_FR20 952 /* offsetof(struct task_struct, thread.regs.fr[20]) */
 163.100 -+#define TASK_PT_FR21 960 /* offsetof(struct task_struct, thread.regs.fr[21]) */
 163.101 -+#define TASK_PT_FR22 968 /* offsetof(struct task_struct, thread.regs.fr[22]) */
 163.102 -+#define TASK_PT_FR23 976 /* offsetof(struct task_struct, thread.regs.fr[23]) */
 163.103 -+#define TASK_PT_FR24 984 /* offsetof(struct task_struct, thread.regs.fr[24]) */
 163.104 -+#define TASK_PT_FR25 992 /* offsetof(struct task_struct, thread.regs.fr[25]) */
 163.105 -+#define TASK_PT_FR26 1000 /* offsetof(struct task_struct, thread.regs.fr[26]) */
 163.106 -+#define TASK_PT_FR27 1008 /* offsetof(struct task_struct, thread.regs.fr[27]) */
 163.107 -+#define TASK_PT_FR28 1016 /* offsetof(struct task_struct, thread.regs.fr[28]) */
 163.108 -+#define TASK_PT_FR29 1024 /* offsetof(struct task_struct, thread.regs.fr[29]) */
 163.109 -+#define TASK_PT_FR30 1032 /* offsetof(struct task_struct, thread.regs.fr[30]) */
 163.110 -+#define TASK_PT_FR31 1040 /* offsetof(struct task_struct, thread.regs.fr[31]) */
 163.111 -+#define TASK_PT_SR0 1048 /* offsetof(struct task_struct, thread.regs.sr[ 0]) */
 163.112 -+#define TASK_PT_SR1 1052 /* offsetof(struct task_struct, thread.regs.sr[ 1]) */
 163.113 -+#define TASK_PT_SR2 1056 /* offsetof(struct task_struct, thread.regs.sr[ 2]) */
 163.114 -+#define TASK_PT_SR3 1060 /* offsetof(struct task_struct, thread.regs.sr[ 3]) */
 163.115 -+#define TASK_PT_SR4 1064 /* offsetof(struct task_struct, thread.regs.sr[ 4]) */
 163.116 -+#define TASK_PT_SR5 1068 /* offsetof(struct task_struct, thread.regs.sr[ 5]) */
 163.117 -+#define TASK_PT_SR6 1072 /* offsetof(struct task_struct, thread.regs.sr[ 6]) */
 163.118 -+#define TASK_PT_SR7 1076 /* offsetof(struct task_struct, thread.regs.sr[ 7]) */
 163.119 -+#define TASK_PT_IASQ0 1080 /* offsetof(struct task_struct, thread.regs.iasq[0]) */
 163.120 -+#define TASK_PT_IASQ1 1084 /* offsetof(struct task_struct, thread.regs.iasq[1]) */
 163.121 -+#define TASK_PT_IAOQ0 1088 /* offsetof(struct task_struct, thread.regs.iaoq[0]) */
 163.122 -+#define TASK_PT_IAOQ1 1092 /* offsetof(struct task_struct, thread.regs.iaoq[1]) */
 163.123 -+#define TASK_PT_CR27 1096 /* offsetof(struct task_struct, thread.regs.cr27) */
 163.124 -+#define TASK_PT_ORIG_R28 1104 /* offsetof(struct task_struct, thread.regs.orig_r28) */
 163.125 -+#define TASK_PT_KSP 1108 /* offsetof(struct task_struct, thread.regs.ksp) */
 163.126 -+#define TASK_PT_KPC 1112 /* offsetof(struct task_struct, thread.regs.kpc) */
 163.127 -+#define TASK_PT_SAR 1116 /* offsetof(struct task_struct, thread.regs.sar) */
 163.128 -+#define TASK_PT_IIR 1120 /* offsetof(struct task_struct, thread.regs.iir) */
 163.129 -+#define TASK_PT_ISR 1124 /* offsetof(struct task_struct, thread.regs.isr) */
 163.130 -+#define TASK_PT_IOR 1128 /* offsetof(struct task_struct, thread.regs.ior) */
 163.131 -+
 163.132 -+#define TASK_SZ 1272 /* sizeof(struct task_struct) */
 163.133 -+#define TASK_SZ_ALGN 1344 /* align(sizeof(struct task_struct), 64) */
 163.134 -+
 163.135 -+#define PT_PSW 0 /* offsetof(struct pt_regs, gr[ 0]) */
 163.136 -+#define PT_GR1 4 /* offsetof(struct pt_regs, gr[ 1]) */
 163.137 -+#define PT_GR2 8 /* offsetof(struct pt_regs, gr[ 2]) */
 163.138 -+#define PT_GR3 12 /* offsetof(struct pt_regs, gr[ 3]) */
 163.139 -+#define PT_GR4 16 /* offsetof(struct pt_regs, gr[ 4]) */
 163.140 -+#define PT_GR5 20 /* offsetof(struct pt_regs, gr[ 5]) */
 163.141 -+#define PT_GR6 24 /* offsetof(struct pt_regs, gr[ 6]) */
 163.142 -+#define PT_GR7 28 /* offsetof(struct pt_regs, gr[ 7]) */
 163.143 -+#define PT_GR8 32 /* offsetof(struct pt_regs, gr[ 8]) */
 163.144 -+#define PT_GR9 36 /* offsetof(struct pt_regs, gr[ 9]) */
 163.145 -+#define PT_GR10 40 /* offsetof(struct pt_regs, gr[10]) */
 163.146 -+#define PT_GR11 44 /* offsetof(struct pt_regs, gr[11]) */
 163.147 -+#define PT_GR12 48 /* offsetof(struct pt_regs, gr[12]) */
 163.148 -+#define PT_GR13 52 /* offsetof(struct pt_regs, gr[13]) */
 163.149 -+#define PT_GR14 56 /* offsetof(struct pt_regs, gr[14]) */
 163.150 -+#define PT_GR15 60 /* offsetof(struct pt_regs, gr[15]) */
 163.151 -+#define PT_GR16 64 /* offsetof(struct pt_regs, gr[16]) */
 163.152 -+#define PT_GR17 68 /* offsetof(struct pt_regs, gr[17]) */
 163.153 -+#define PT_GR18 72 /* offsetof(struct pt_regs, gr[18]) */
 163.154 -+#define PT_GR19 76 /* offsetof(struct pt_regs, gr[19]) */
 163.155 -+#define PT_GR20 80 /* offsetof(struct pt_regs, gr[20]) */
 163.156 -+#define PT_GR21 84 /* offsetof(struct pt_regs, gr[21]) */
 163.157 -+#define PT_GR22 88 /* offsetof(struct pt_regs, gr[22]) */
 163.158 -+#define PT_GR23 92 /* offsetof(struct pt_regs, gr[23]) */
 163.159 -+#define PT_GR24 96 /* offsetof(struct pt_regs, gr[24]) */
 163.160 -+#define PT_GR25 100 /* offsetof(struct pt_regs, gr[25]) */
 163.161 -+#define PT_GR26 104 /* offsetof(struct pt_regs, gr[26]) */
 163.162 -+#define PT_GR27 108 /* offsetof(struct pt_regs, gr[27]) */
 163.163 -+#define PT_GR28 112 /* offsetof(struct pt_regs, gr[28]) */
 163.164 -+#define PT_GR29 116 /* offsetof(struct pt_regs, gr[29]) */
 163.165 -+#define PT_GR30 120 /* offsetof(struct pt_regs, gr[30]) */
 163.166 -+#define PT_GR31 124 /* offsetof(struct pt_regs, gr[31]) */
 163.167 -+#define PT_FR0 128 /* offsetof(struct pt_regs, fr[ 0]) */
 163.168 -+#define PT_FR1 136 /* offsetof(struct pt_regs, fr[ 1]) */
 163.169 -+#define PT_FR2 144 /* offsetof(struct pt_regs, fr[ 2]) */
 163.170 -+#define PT_FR3 152 /* offsetof(struct pt_regs, fr[ 3]) */
 163.171 -+#define PT_FR4 160 /* offsetof(struct pt_regs, fr[ 4]) */
 163.172 -+#define PT_FR5 168 /* offsetof(struct pt_regs, fr[ 5]) */
 163.173 -+#define PT_FR6 176 /* offsetof(struct pt_regs, fr[ 6]) */
 163.174 -+#define PT_FR7 184 /* offsetof(struct pt_regs, fr[ 7]) */
 163.175 -+#define PT_FR8 192 /* offsetof(struct pt_regs, fr[ 8]) */
 163.176 -+#define PT_FR9 200 /* offsetof(struct pt_regs, fr[ 9]) */
 163.177 -+#define PT_FR10 208 /* offsetof(struct pt_regs, fr[10]) */
 163.178 -+#define PT_FR11 216 /* offsetof(struct pt_regs, fr[11]) */
 163.179 -+#define PT_FR12 224 /* offsetof(struct pt_regs, fr[12]) */
 163.180 -+#define PT_FR13 232 /* offsetof(struct pt_regs, fr[13]) */
 163.181 -+#define PT_FR14 240 /* offsetof(struct pt_regs, fr[14]) */
 163.182 -+#define PT_FR15 248 /* offsetof(struct pt_regs, fr[15]) */
 163.183 -+#define PT_FR16 256 /* offsetof(struct pt_regs, fr[16]) */
 163.184 -+#define PT_FR17 264 /* offsetof(struct pt_regs, fr[17]) */
 163.185 -+#define PT_FR18 272 /* offsetof(struct pt_regs, fr[18]) */
 163.186 -+#define PT_FR19 280 /* offsetof(struct pt_regs, fr[19]) */
 163.187 -+#define PT_FR20 288 /* offsetof(struct pt_regs, fr[20]) */
 163.188 -+#define PT_FR21 296 /* offsetof(struct pt_regs, fr[21]) */
 163.189 -+#define PT_FR22 304 /* offsetof(struct pt_regs, fr[22]) */
 163.190 -+#define PT_FR23 312 /* offsetof(struct pt_regs, fr[23]) */
 163.191 -+#define PT_FR24 320 /* offsetof(struct pt_regs, fr[24]) */
 163.192 -+#define PT_FR25 328 /* offsetof(struct pt_regs, fr[25]) */
 163.193 -+#define PT_FR26 336 /* offsetof(struct pt_regs, fr[26]) */
 163.194 -+#define PT_FR27 344 /* offsetof(struct pt_regs, fr[27]) */
 163.195 -+#define PT_FR28 352 /* offsetof(struct pt_regs, fr[28]) */
 163.196 -+#define PT_FR29 360 /* offsetof(struct pt_regs, fr[29]) */
 163.197 -+#define PT_FR30 368 /* offsetof(struct pt_regs, fr[30]) */
 163.198 -+#define PT_FR31 376 /* offsetof(struct pt_regs, fr[31]) */
 163.199 -+#define PT_SR0 384 /* offsetof(struct pt_regs, sr[ 0]) */
 163.200 -+#define PT_SR1 388 /* offsetof(struct pt_regs, sr[ 1]) */
 163.201 -+#define PT_SR2 392 /* offsetof(struct pt_regs, sr[ 2]) */
 163.202 -+#define PT_SR3 396 /* offsetof(struct pt_regs, sr[ 3]) */
 163.203 -+#define PT_SR4 400 /* offsetof(struct pt_regs, sr[ 4]) */
 163.204 -+#define PT_SR5 404 /* offsetof(struct pt_regs, sr[ 5]) */
 163.205 -+#define PT_SR6 408 /* offsetof(struct pt_regs, sr[ 6]) */
 163.206 -+#define PT_SR7 412 /* offsetof(struct pt_regs, sr[ 7]) */
 163.207 -+#define PT_IASQ0 416 /* offsetof(struct pt_regs, iasq[0]) */
 163.208 -+#define PT_IASQ1 420 /* offsetof(struct pt_regs, iasq[1]) */
 163.209 -+#define PT_IAOQ0 424 /* offsetof(struct pt_regs, iaoq[0]) */
 163.210 -+#define PT_IAOQ1 428 /* offsetof(struct pt_regs, iaoq[1]) */
 163.211 -+#define PT_CR27 432 /* offsetof(struct pt_regs, cr27) */
 163.212 -+#define PT_ORIG_R28 440 /* offsetof(struct pt_regs, orig_r28) */
 163.213 -+#define PT_KSP 444 /* offsetof(struct pt_regs, ksp) */
 163.214 -+#define PT_KPC 448 /* offsetof(struct pt_regs, kpc) */
 163.215 -+#define PT_SAR 452 /* offsetof(struct pt_regs, sar) */
 163.216 -+#define PT_IIR 456 /* offsetof(struct pt_regs, iir) */
 163.217 -+#define PT_ISR 460 /* offsetof(struct pt_regs, isr) */
 163.218 -+#define PT_IOR 464 /* offsetof(struct pt_regs, ior) */
 163.219 -+#define PT_SIZE 472 /* sizeof(struct pt_regs) */
 163.220 -+#define PT_SZ_ALGN 576 /* align(sizeof(struct pt_regs), 64) */
 163.221 -+
 163.222 -+#define TI_TASK 0 /* offsetof(struct thread_info, task) */
 163.223 -+#define TI_EXEC_DOMAIN 4 /* offsetof(struct thread_info, exec_domain) */
 163.224 -+#define TI_FLAGS 8 /* offsetof(struct thread_info, flags) */
 163.225 -+#define TI_CPU 16 /* offsetof(struct thread_info, cpu) */
 163.226 -+#define TI_SEGMENT 12 /* offsetof(struct thread_info, addr_limit) */
 163.227 -+#define TI_PRE_COUNT 20 /* offsetof(struct thread_info, preempt_count) */
 163.228 -+#define THREAD_SZ 44 /* sizeof(struct thread_info) */
 163.229 -+#define THREAD_SZ_ALGN 128 /* align(sizeof(struct thread_info), 64) */
 163.230 -+
 163.231 -+#define IRQSTAT_SIRQ_PEND 0 /* offsetof(irq_cpustat_t, __softirq_pending) */
 163.232 -+#define IRQSTAT_SZ 64 /* sizeof(irq_cpustat_t) */
 163.233 -+
 163.234 -+#define ICACHE_BASE 8 /* offsetof(struct pdc_cache_info, ic_base) */
 163.235 -+#define ICACHE_STRIDE 12 /* offsetof(struct pdc_cache_info, ic_stride) */
 163.236 -+#define ICACHE_COUNT 16 /* offsetof(struct pdc_cache_info, ic_count) */
 163.237 -+#define ICACHE_LOOP 20 /* offsetof(struct pdc_cache_info, ic_loop) */
 163.238 -+#define DCACHE_BASE 32 /* offsetof(struct pdc_cache_info, dc_base) */
 163.239 -+#define DCACHE_STRIDE 36 /* offsetof(struct pdc_cache_info, dc_stride) */
 163.240 -+#define DCACHE_COUNT 40 /* offsetof(struct pdc_cache_info, dc_count) */
 163.241 -+#define DCACHE_LOOP 44 /* offsetof(struct pdc_cache_info, dc_loop) */
 163.242 -+#define ITLB_SID_BASE 56 /* offsetof(struct pdc_cache_info, it_sp_base) */
 163.243 -+#define ITLB_SID_STRIDE 60 /* offsetof(struct pdc_cache_info, it_sp_stride) */
 163.244 -+#define ITLB_SID_COUNT 64 /* offsetof(struct pdc_cache_info, it_sp_count) */
 163.245 -+#define ITLB_OFF_BASE 68 /* offsetof(struct pdc_cache_info, it_off_base) */
 163.246 -+#define ITLB_OFF_STRIDE 72 /* offsetof(struct pdc_cache_info, it_off_stride) */
 163.247 -+#define ITLB_OFF_COUNT 76 /* offsetof(struct pdc_cache_info, it_off_count) */
 163.248 -+#define ITLB_LOOP 80 /* offsetof(struct pdc_cache_info, it_loop) */
 163.249 -+#define DTLB_SID_BASE 92 /* offsetof(struct pdc_cache_info, dt_sp_base) */
 163.250 -+#define DTLB_SID_STRIDE 96 /* offsetof(struct pdc_cache_info, dt_sp_stride) */
 163.251 -+#define DTLB_SID_COUNT 100 /* offsetof(struct pdc_cache_info, dt_sp_count) */
 163.252 -+#define DTLB_OFF_BASE 104 /* offsetof(struct pdc_cache_info, dt_off_base) */
 163.253 -+#define DTLB_OFF_STRIDE 108 /* offsetof(struct pdc_cache_info, dt_off_stride) */
 163.254 -+#define DTLB_OFF_COUNT 112 /* offsetof(struct pdc_cache_info, dt_off_count) */
 163.255 -+#define DTLB_LOOP 116 /* offsetof(struct pdc_cache_info, dt_loop) */
 163.256 -+
 163.257 -+#define PA_BLOCKSTEP_BIT 1 /* 31-PT_BLOCKSTEP_BIT */
 163.258 -+#define PA_SINGLESTEP_BIT 0 /* 31-PT_SINGLESTEP_BIT */
 163.259 -+
 163.260 -+#define ASM_PMD_SHIFT 21 /* PMD_SHIFT */
 163.261 -+#define ASM_PGDIR_SHIFT 21 /* PGDIR_SHIFT */
 163.262 -+#define ASM_BITS_PER_PGD 11 /* BITS_PER_PGD */
 163.263 -+#define ASM_BITS_PER_PMD 0 /* BITS_PER_PMD */
 163.264 -+#define ASM_BITS_PER_PTE 9 /* BITS_PER_PTE */
 163.265 -+#define ASM_PGD_PMD_OFFSET -8192 /* -(PAGE_SIZE << PGD_ORDER) */
 163.266 -+#define ASM_PMD_ENTRY 128 /* ((PAGE_OFFSET & PMD_MASK) >> PMD_SHIFT) */
 163.267 -+#define ASM_PGD_ENTRY 128 /* PAGE_OFFSET >> PGDIR_SHIFT */
 163.268 -+#define ASM_PGD_ENTRY_SIZE 4 /* PGD_ENTRY_SIZE */
 163.269 -+#define ASM_PMD_ENTRY_SIZE 4 /* PMD_ENTRY_SIZE */
 163.270 -+#define ASM_PTE_ENTRY_SIZE 8 /* PTE_ENTRY_SIZE */
 163.271 -+#define ASM_PT_INITIAL 4 /* PT_INITIAL */
 163.272 -+#define ASM_PAGE_SIZE 4096 /* PAGE_SIZE */
 163.273 -+
 163.274 -+
 163.275 -+#endif
   164.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   164.2 +++ b/patches/gdb/6.7.1/175-hppa-offsets.patch	Mon Jul 28 21:08:01 2008 +0000
   164.3 @@ -0,0 +1,272 @@
   164.4 +Original patch from gentoo: gentoo/src/patchsets/gdb/6.7.1/45_all_gdb-hppa-offsets.patch
   164.5 +-= BEGIN original header =-
   164.6 +sanitized headers dont include asm/offsets.h, so cache a local copy 
   164.7 +
   164.8 +http://bugs.gentoo.org/180476
   164.9 +http://lists.parisc-linux.org/pipermail/parisc-linux/2007-February/031162.html
  164.10 +
  164.11 +-= END original header =-
  164.12 +diff -durN gdb-6.7.1.orig/gdb/hppa-linux-nat.c gdb-6.7.1/gdb/hppa-linux-nat.c
  164.13 +--- gdb-6.7.1.orig/gdb/hppa-linux-nat.c	2007-08-23 20:08:33.000000000 +0200
  164.14 ++++ gdb-6.7.1/gdb/hppa-linux-nat.c	2008-06-17 23:27:45.000000000 +0200
  164.15 +@@ -32,7 +32,7 @@
  164.16 + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,43)
  164.17 + #include <asm/offset.h>
  164.18 + #else
  164.19 +-#include <asm/offsets.h>
  164.20 ++#include <hppa-offsets.h>
  164.21 + #endif
  164.22 + 
  164.23 + #include "hppa-tdep.h"
  164.24 +diff -durN gdb-6.7.1.orig/gdb/hppa-offsets.h gdb-6.7.1/gdb/hppa-offsets.h
  164.25 +--- gdb-6.7.1.orig/gdb/hppa-offsets.h	1970-01-01 01:00:00.000000000 +0100
  164.26 ++++ gdb-6.7.1/gdb/hppa-offsets.h	2008-06-17 23:27:45.000000000 +0200
  164.27 +@@ -0,0 +1,248 @@
  164.28 ++#ifndef __ASM_OFFSETS_H__
  164.29 ++#define __ASM_OFFSETS_H__
  164.30 ++/*
  164.31 ++ * DO NOT MODIFY.
  164.32 ++ *
  164.33 ++ * This file was generated by arch/parisc/Makefile
  164.34 ++ *
  164.35 ++ */
  164.36 ++
  164.37 ++#define TASK_THREAD_INFO 4 /* offsetof(struct task_struct, thread_info) */
  164.38 ++#define TASK_STATE 0 /* offsetof(struct task_struct, state) */
  164.39 ++#define TASK_FLAGS 12 /* offsetof(struct task_struct, flags) */
  164.40 ++#define TASK_SIGPENDING 1188 /* offsetof(struct task_struct, pending) */
  164.41 ++#define TASK_PTRACE 16 /* offsetof(struct task_struct, ptrace) */
  164.42 ++#define TASK_MM 108 /* offsetof(struct task_struct, mm) */
  164.43 ++#define TASK_PERSONALITY 132 /* offsetof(struct task_struct, personality) */
  164.44 ++#define TASK_PID 140 /* offsetof(struct task_struct, pid) */
  164.45 ++
  164.46 ++#define TASK_REGS 664 /* offsetof(struct task_struct, thread.regs) */
  164.47 ++#define TASK_PT_PSW 664 /* offsetof(struct task_struct, thread.regs.gr[ 0]) */
  164.48 ++#define TASK_PT_GR1 668 /* offsetof(struct task_struct, thread.regs.gr[ 1]) */
  164.49 ++#define TASK_PT_GR2 672 /* offsetof(struct task_struct, thread.regs.gr[ 2]) */
  164.50 ++#define TASK_PT_GR3 676 /* offsetof(struct task_struct, thread.regs.gr[ 3]) */
  164.51 ++#define TASK_PT_GR4 680 /* offsetof(struct task_struct, thread.regs.gr[ 4]) */
  164.52 ++#define TASK_PT_GR5 684 /* offsetof(struct task_struct, thread.regs.gr[ 5]) */
  164.53 ++#define TASK_PT_GR6 688 /* offsetof(struct task_struct, thread.regs.gr[ 6]) */
  164.54 ++#define TASK_PT_GR7 692 /* offsetof(struct task_struct, thread.regs.gr[ 7]) */
  164.55 ++#define TASK_PT_GR8 696 /* offsetof(struct task_struct, thread.regs.gr[ 8]) */
  164.56 ++#define TASK_PT_GR9 700 /* offsetof(struct task_struct, thread.regs.gr[ 9]) */
  164.57 ++#define TASK_PT_GR10 704 /* offsetof(struct task_struct, thread.regs.gr[10]) */
  164.58 ++#define TASK_PT_GR11 708 /* offsetof(struct task_struct, thread.regs.gr[11]) */
  164.59 ++#define TASK_PT_GR12 712 /* offsetof(struct task_struct, thread.regs.gr[12]) */
  164.60 ++#define TASK_PT_GR13 716 /* offsetof(struct task_struct, thread.regs.gr[13]) */
  164.61 ++#define TASK_PT_GR14 720 /* offsetof(struct task_struct, thread.regs.gr[14]) */
  164.62 ++#define TASK_PT_GR15 724 /* offsetof(struct task_struct, thread.regs.gr[15]) */
  164.63 ++#define TASK_PT_GR16 728 /* offsetof(struct task_struct, thread.regs.gr[16]) */
  164.64 ++#define TASK_PT_GR17 732 /* offsetof(struct task_struct, thread.regs.gr[17]) */
  164.65 ++#define TASK_PT_GR18 736 /* offsetof(struct task_struct, thread.regs.gr[18]) */
  164.66 ++#define TASK_PT_GR19 740 /* offsetof(struct task_struct, thread.regs.gr[19]) */
  164.67 ++#define TASK_PT_GR20 744 /* offsetof(struct task_struct, thread.regs.gr[20]) */
  164.68 ++#define TASK_PT_GR21 748 /* offsetof(struct task_struct, thread.regs.gr[21]) */
  164.69 ++#define TASK_PT_GR22 752 /* offsetof(struct task_struct, thread.regs.gr[22]) */
  164.70 ++#define TASK_PT_GR23 756 /* offsetof(struct task_struct, thread.regs.gr[23]) */
  164.71 ++#define TASK_PT_GR24 760 /* offsetof(struct task_struct, thread.regs.gr[24]) */
  164.72 ++#define TASK_PT_GR25 764 /* offsetof(struct task_struct, thread.regs.gr[25]) */
  164.73 ++#define TASK_PT_GR26 768 /* offsetof(struct task_struct, thread.regs.gr[26]) */
  164.74 ++#define TASK_PT_GR27 772 /* offsetof(struct task_struct, thread.regs.gr[27]) */
  164.75 ++#define TASK_PT_GR28 776 /* offsetof(struct task_struct, thread.regs.gr[28]) */
  164.76 ++#define TASK_PT_GR29 780 /* offsetof(struct task_struct, thread.regs.gr[29]) */
  164.77 ++#define TASK_PT_GR30 784 /* offsetof(struct task_struct, thread.regs.gr[30]) */
  164.78 ++#define TASK_PT_GR31 788 /* offsetof(struct task_struct, thread.regs.gr[31]) */
  164.79 ++#define TASK_PT_FR0 792 /* offsetof(struct task_struct, thread.regs.fr[ 0]) */
  164.80 ++#define TASK_PT_FR1 800 /* offsetof(struct task_struct, thread.regs.fr[ 1]) */
  164.81 ++#define TASK_PT_FR2 808 /* offsetof(struct task_struct, thread.regs.fr[ 2]) */
  164.82 ++#define TASK_PT_FR3 816 /* offsetof(struct task_struct, thread.regs.fr[ 3]) */
  164.83 ++#define TASK_PT_FR4 824 /* offsetof(struct task_struct, thread.regs.fr[ 4]) */
  164.84 ++#define TASK_PT_FR5 832 /* offsetof(struct task_struct, thread.regs.fr[ 5]) */
  164.85 ++#define TASK_PT_FR6 840 /* offsetof(struct task_struct, thread.regs.fr[ 6]) */
  164.86 ++#define TASK_PT_FR7 848 /* offsetof(struct task_struct, thread.regs.fr[ 7]) */
  164.87 ++#define TASK_PT_FR8 856 /* offsetof(struct task_struct, thread.regs.fr[ 8]) */
  164.88 ++#define TASK_PT_FR9 864 /* offsetof(struct task_struct, thread.regs.fr[ 9]) */
  164.89 ++#define TASK_PT_FR10 872 /* offsetof(struct task_struct, thread.regs.fr[10]) */
  164.90 ++#define TASK_PT_FR11 880 /* offsetof(struct task_struct, thread.regs.fr[11]) */
  164.91 ++#define TASK_PT_FR12 888 /* offsetof(struct task_struct, thread.regs.fr[12]) */
  164.92 ++#define TASK_PT_FR13 896 /* offsetof(struct task_struct, thread.regs.fr[13]) */
  164.93 ++#define TASK_PT_FR14 904 /* offsetof(struct task_struct, thread.regs.fr[14]) */
  164.94 ++#define TASK_PT_FR15 912 /* offsetof(struct task_struct, thread.regs.fr[15]) */
  164.95 ++#define TASK_PT_FR16 920 /* offsetof(struct task_struct, thread.regs.fr[16]) */
  164.96 ++#define TASK_PT_FR17 928 /* offsetof(struct task_struct, thread.regs.fr[17]) */
  164.97 ++#define TASK_PT_FR18 936 /* offsetof(struct task_struct, thread.regs.fr[18]) */
  164.98 ++#define TASK_PT_FR19 944 /* offsetof(struct task_struct, thread.regs.fr[19]) */
  164.99 ++#define TASK_PT_FR20 952 /* offsetof(struct task_struct, thread.regs.fr[20]) */
 164.100 ++#define TASK_PT_FR21 960 /* offsetof(struct task_struct, thread.regs.fr[21]) */
 164.101 ++#define TASK_PT_FR22 968 /* offsetof(struct task_struct, thread.regs.fr[22]) */
 164.102 ++#define TASK_PT_FR23 976 /* offsetof(struct task_struct, thread.regs.fr[23]) */
 164.103 ++#define TASK_PT_FR24 984 /* offsetof(struct task_struct, thread.regs.fr[24]) */
 164.104 ++#define TASK_PT_FR25 992 /* offsetof(struct task_struct, thread.regs.fr[25]) */
 164.105 ++#define TASK_PT_FR26 1000 /* offsetof(struct task_struct, thread.regs.fr[26]) */
 164.106 ++#define TASK_PT_FR27 1008 /* offsetof(struct task_struct, thread.regs.fr[27]) */
 164.107 ++#define TASK_PT_FR28 1016 /* offsetof(struct task_struct, thread.regs.fr[28]) */
 164.108 ++#define TASK_PT_FR29 1024 /* offsetof(struct task_struct, thread.regs.fr[29]) */
 164.109 ++#define TASK_PT_FR30 1032 /* offsetof(struct task_struct, thread.regs.fr[30]) */
 164.110 ++#define TASK_PT_FR31 1040 /* offsetof(struct task_struct, thread.regs.fr[31]) */
 164.111 ++#define TASK_PT_SR0 1048 /* offsetof(struct task_struct, thread.regs.sr[ 0]) */
 164.112 ++#define TASK_PT_SR1 1052 /* offsetof(struct task_struct, thread.regs.sr[ 1]) */
 164.113 ++#define TASK_PT_SR2 1056 /* offsetof(struct task_struct, thread.regs.sr[ 2]) */
 164.114 ++#define TASK_PT_SR3 1060 /* offsetof(struct task_struct, thread.regs.sr[ 3]) */
 164.115 ++#define TASK_PT_SR4 1064 /* offsetof(struct task_struct, thread.regs.sr[ 4]) */
 164.116 ++#define TASK_PT_SR5 1068 /* offsetof(struct task_struct, thread.regs.sr[ 5]) */
 164.117 ++#define TASK_PT_SR6 1072 /* offsetof(struct task_struct, thread.regs.sr[ 6]) */
 164.118 ++#define TASK_PT_SR7 1076 /* offsetof(struct task_struct, thread.regs.sr[ 7]) */
 164.119 ++#define TASK_PT_IASQ0 1080 /* offsetof(struct task_struct, thread.regs.iasq[0]) */
 164.120 ++#define TASK_PT_IASQ1 1084 /* offsetof(struct task_struct, thread.regs.iasq[1]) */
 164.121 ++#define TASK_PT_IAOQ0 1088 /* offsetof(struct task_struct, thread.regs.iaoq[0]) */
 164.122 ++#define TASK_PT_IAOQ1 1092 /* offsetof(struct task_struct, thread.regs.iaoq[1]) */
 164.123 ++#define TASK_PT_CR27 1096 /* offsetof(struct task_struct, thread.regs.cr27) */
 164.124 ++#define TASK_PT_ORIG_R28 1104 /* offsetof(struct task_struct, thread.regs.orig_r28) */
 164.125 ++#define TASK_PT_KSP 1108 /* offsetof(struct task_struct, thread.regs.ksp) */
 164.126 ++#define TASK_PT_KPC 1112 /* offsetof(struct task_struct, thread.regs.kpc) */
 164.127 ++#define TASK_PT_SAR 1116 /* offsetof(struct task_struct, thread.regs.sar) */
 164.128 ++#define TASK_PT_IIR 1120 /* offsetof(struct task_struct, thread.regs.iir) */
 164.129 ++#define TASK_PT_ISR 1124 /* offsetof(struct task_struct, thread.regs.isr) */
 164.130 ++#define TASK_PT_IOR 1128 /* offsetof(struct task_struct, thread.regs.ior) */
 164.131 ++
 164.132 ++#define TASK_SZ 1272 /* sizeof(struct task_struct) */
 164.133 ++#define TASK_SZ_ALGN 1344 /* align(sizeof(struct task_struct), 64) */
 164.134 ++
 164.135 ++#define PT_PSW 0 /* offsetof(struct pt_regs, gr[ 0]) */
 164.136 ++#define PT_GR1 4 /* offsetof(struct pt_regs, gr[ 1]) */
 164.137 ++#define PT_GR2 8 /* offsetof(struct pt_regs, gr[ 2]) */
 164.138 ++#define PT_GR3 12 /* offsetof(struct pt_regs, gr[ 3]) */
 164.139 ++#define PT_GR4 16 /* offsetof(struct pt_regs, gr[ 4]) */
 164.140 ++#define PT_GR5 20 /* offsetof(struct pt_regs, gr[ 5]) */
 164.141 ++#define PT_GR6 24 /* offsetof(struct pt_regs, gr[ 6]) */
 164.142 ++#define PT_GR7 28 /* offsetof(struct pt_regs, gr[ 7]) */
 164.143 ++#define PT_GR8 32 /* offsetof(struct pt_regs, gr[ 8]) */
 164.144 ++#define PT_GR9 36 /* offsetof(struct pt_regs, gr[ 9]) */
 164.145 ++#define PT_GR10 40 /* offsetof(struct pt_regs, gr[10]) */
 164.146 ++#define PT_GR11 44 /* offsetof(struct pt_regs, gr[11]) */
 164.147 ++#define PT_GR12 48 /* offsetof(struct pt_regs, gr[12]) */
 164.148 ++#define PT_GR13 52 /* offsetof(struct pt_regs, gr[13]) */
 164.149 ++#define PT_GR14 56 /* offsetof(struct pt_regs, gr[14]) */
 164.150 ++#define PT_GR15 60 /* offsetof(struct pt_regs, gr[15]) */
 164.151 ++#define PT_GR16 64 /* offsetof(struct pt_regs, gr[16]) */
 164.152 ++#define PT_GR17 68 /* offsetof(struct pt_regs, gr[17]) */
 164.153 ++#define PT_GR18 72 /* offsetof(struct pt_regs, gr[18]) */
 164.154 ++#define PT_GR19 76 /* offsetof(struct pt_regs, gr[19]) */
 164.155 ++#define PT_GR20 80 /* offsetof(struct pt_regs, gr[20]) */
 164.156 ++#define PT_GR21 84 /* offsetof(struct pt_regs, gr[21]) */
 164.157 ++#define PT_GR22 88 /* offsetof(struct pt_regs, gr[22]) */
 164.158 ++#define PT_GR23 92 /* offsetof(struct pt_regs, gr[23]) */
 164.159 ++#define PT_GR24 96 /* offsetof(struct pt_regs, gr[24]) */
 164.160 ++#define PT_GR25 100 /* offsetof(struct pt_regs, gr[25]) */
 164.161 ++#define PT_GR26 104 /* offsetof(struct pt_regs, gr[26]) */
 164.162 ++#define PT_GR27 108 /* offsetof(struct pt_regs, gr[27]) */
 164.163 ++#define PT_GR28 112 /* offsetof(struct pt_regs, gr[28]) */
 164.164 ++#define PT_GR29 116 /* offsetof(struct pt_regs, gr[29]) */
 164.165 ++#define PT_GR30 120 /* offsetof(struct pt_regs, gr[30]) */
 164.166 ++#define PT_GR31 124 /* offsetof(struct pt_regs, gr[31]) */
 164.167 ++#define PT_FR0 128 /* offsetof(struct pt_regs, fr[ 0]) */
 164.168 ++#define PT_FR1 136 /* offsetof(struct pt_regs, fr[ 1]) */
 164.169 ++#define PT_FR2 144 /* offsetof(struct pt_regs, fr[ 2]) */
 164.170 ++#define PT_FR3 152 /* offsetof(struct pt_regs, fr[ 3]) */
 164.171 ++#define PT_FR4 160 /* offsetof(struct pt_regs, fr[ 4]) */
 164.172 ++#define PT_FR5 168 /* offsetof(struct pt_regs, fr[ 5]) */
 164.173 ++#define PT_FR6 176 /* offsetof(struct pt_regs, fr[ 6]) */
 164.174 ++#define PT_FR7 184 /* offsetof(struct pt_regs, fr[ 7]) */
 164.175 ++#define PT_FR8 192 /* offsetof(struct pt_regs, fr[ 8]) */
 164.176 ++#define PT_FR9 200 /* offsetof(struct pt_regs, fr[ 9]) */
 164.177 ++#define PT_FR10 208 /* offsetof(struct pt_regs, fr[10]) */
 164.178 ++#define PT_FR11 216 /* offsetof(struct pt_regs, fr[11]) */
 164.179 ++#define PT_FR12 224 /* offsetof(struct pt_regs, fr[12]) */
 164.180 ++#define PT_FR13 232 /* offsetof(struct pt_regs, fr[13]) */
 164.181 ++#define PT_FR14 240 /* offsetof(struct pt_regs, fr[14]) */
 164.182 ++#define PT_FR15 248 /* offsetof(struct pt_regs, fr[15]) */
 164.183 ++#define PT_FR16 256 /* offsetof(struct pt_regs, fr[16]) */
 164.184 ++#define PT_FR17 264 /* offsetof(struct pt_regs, fr[17]) */
 164.185 ++#define PT_FR18 272 /* offsetof(struct pt_regs, fr[18]) */
 164.186 ++#define PT_FR19 280 /* offsetof(struct pt_regs, fr[19]) */
 164.187 ++#define PT_FR20 288 /* offsetof(struct pt_regs, fr[20]) */
 164.188 ++#define PT_FR21 296 /* offsetof(struct pt_regs, fr[21]) */
 164.189 ++#define PT_FR22 304 /* offsetof(struct pt_regs, fr[22]) */
 164.190 ++#define PT_FR23 312 /* offsetof(struct pt_regs, fr[23]) */
 164.191 ++#define PT_FR24 320 /* offsetof(struct pt_regs, fr[24]) */
 164.192 ++#define PT_FR25 328 /* offsetof(struct pt_regs, fr[25]) */
 164.193 ++#define PT_FR26 336 /* offsetof(struct pt_regs, fr[26]) */
 164.194 ++#define PT_FR27 344 /* offsetof(struct pt_regs, fr[27]) */
 164.195 ++#define PT_FR28 352 /* offsetof(struct pt_regs, fr[28]) */
 164.196 ++#define PT_FR29 360 /* offsetof(struct pt_regs, fr[29]) */
 164.197 ++#define PT_FR30 368 /* offsetof(struct pt_regs, fr[30]) */
 164.198 ++#define PT_FR31 376 /* offsetof(struct pt_regs, fr[31]) */
 164.199 ++#define PT_SR0 384 /* offsetof(struct pt_regs, sr[ 0]) */
 164.200 ++#define PT_SR1 388 /* offsetof(struct pt_regs, sr[ 1]) */
 164.201 ++#define PT_SR2 392 /* offsetof(struct pt_regs, sr[ 2]) */
 164.202 ++#define PT_SR3 396 /* offsetof(struct pt_regs, sr[ 3]) */
 164.203 ++#define PT_SR4 400 /* offsetof(struct pt_regs, sr[ 4]) */
 164.204 ++#define PT_SR5 404 /* offsetof(struct pt_regs, sr[ 5]) */
 164.205 ++#define PT_SR6 408 /* offsetof(struct pt_regs, sr[ 6]) */
 164.206 ++#define PT_SR7 412 /* offsetof(struct pt_regs, sr[ 7]) */
 164.207 ++#define PT_IASQ0 416 /* offsetof(struct pt_regs, iasq[0]) */
 164.208 ++#define PT_IASQ1 420 /* offsetof(struct pt_regs, iasq[1]) */
 164.209 ++#define PT_IAOQ0 424 /* offsetof(struct pt_regs, iaoq[0]) */
 164.210 ++#define PT_IAOQ1 428 /* offsetof(struct pt_regs, iaoq[1]) */
 164.211 ++#define PT_CR27 432 /* offsetof(struct pt_regs, cr27) */
 164.212 ++#define PT_ORIG_R28 440 /* offsetof(struct pt_regs, orig_r28) */
 164.213 ++#define PT_KSP 444 /* offsetof(struct pt_regs, ksp) */
 164.214 ++#define PT_KPC 448 /* offsetof(struct pt_regs, kpc) */
 164.215 ++#define PT_SAR 452 /* offsetof(struct pt_regs, sar) */
 164.216 ++#define PT_IIR 456 /* offsetof(struct pt_regs, iir) */
 164.217 ++#define PT_ISR 460 /* offsetof(struct pt_regs, isr) */
 164.218 ++#define PT_IOR 464 /* offsetof(struct pt_regs, ior) */
 164.219 ++#define PT_SIZE 472 /* sizeof(struct pt_regs) */
 164.220 ++#define PT_SZ_ALGN 576 /* align(sizeof(struct pt_regs), 64) */
 164.221 ++
 164.222 ++#define TI_TASK 0 /* offsetof(struct thread_info, task) */
 164.223 ++#define TI_EXEC_DOMAIN 4 /* offsetof(struct thread_info, exec_domain) */
 164.224 ++#define TI_FLAGS 8 /* offsetof(struct thread_info, flags) */
 164.225 ++#define TI_CPU 16 /* offsetof(struct thread_info, cpu) */
 164.226 ++#define TI_SEGMENT 12 /* offsetof(struct thread_info, addr_limit) */
 164.227 ++#define TI_PRE_COUNT 20 /* offsetof(struct thread_info, preempt_count) */
 164.228 ++#define THREAD_SZ 44 /* sizeof(struct thread_info) */
 164.229 ++#define THREAD_SZ_ALGN 128 /* align(sizeof(struct thread_info), 64) */
 164.230 ++
 164.231 ++#define IRQSTAT_SIRQ_PEND 0 /* offsetof(irq_cpustat_t, __softirq_pending) */
 164.232 ++#define IRQSTAT_SZ 64 /* sizeof(irq_cpustat_t) */
 164.233 ++
 164.234 ++#define ICACHE_BASE 8 /* offsetof(struct pdc_cache_info, ic_base) */
 164.235 ++#define ICACHE_STRIDE 12 /* offsetof(struct pdc_cache_info, ic_stride) */
 164.236 ++#define ICACHE_COUNT 16 /* offsetof(struct pdc_cache_info, ic_count) */
 164.237 ++#define ICACHE_LOOP 20 /* offsetof(struct pdc_cache_info, ic_loop) */
 164.238 ++#define DCACHE_BASE 32 /* offsetof(struct pdc_cache_info, dc_base) */
 164.239 ++#define DCACHE_STRIDE 36 /* offsetof(struct pdc_cache_info, dc_stride) */
 164.240 ++#define DCACHE_COUNT 40 /* offsetof(struct pdc_cache_info, dc_count) */
 164.241 ++#define DCACHE_LOOP 44 /* offsetof(struct pdc_cache_info, dc_loop) */
 164.242 ++#define ITLB_SID_BASE 56 /* offsetof(struct pdc_cache_info, it_sp_base) */
 164.243 ++#define ITLB_SID_STRIDE 60 /* offsetof(struct pdc_cache_info, it_sp_stride) */
 164.244 ++#define ITLB_SID_COUNT 64 /* offsetof(struct pdc_cache_info, it_sp_count) */
 164.245 ++#define ITLB_OFF_BASE 68 /* offsetof(struct pdc_cache_info, it_off_base) */
 164.246 ++#define ITLB_OFF_STRIDE 72 /* offsetof(struct pdc_cache_info, it_off_stride) */
 164.247 ++#define ITLB_OFF_COUNT 76 /* offsetof(struct pdc_cache_info, it_off_count) */
 164.248 ++#define ITLB_LOOP 80 /* offsetof(struct pdc_cache_info, it_loop) */
 164.249 ++#define DTLB_SID_BASE 92 /* offsetof(struct pdc_cache_info, dt_sp_base) */
 164.250 ++#define DTLB_SID_STRIDE 96 /* offsetof(struct pdc_cache_info, dt_sp_stride) */
 164.251 ++#define DTLB_SID_COUNT 100 /* offsetof(struct pdc_cache_info, dt_sp_count) */
 164.252 ++#define DTLB_OFF_BASE 104 /* offsetof(struct pdc_cache_info, dt_off_base) */
 164.253 ++#define DTLB_OFF_STRIDE 108 /* offsetof(struct pdc_cache_info, dt_off_stride) */
 164.254 ++#define DTLB_OFF_COUNT 112 /* offsetof(struct pdc_cache_info, dt_off_count) */
 164.255 ++#define DTLB_LOOP 116 /* offsetof(struct pdc_cache_info, dt_loop) */
 164.256 ++
 164.257 ++#define PA_BLOCKSTEP_BIT 1 /* 31-PT_BLOCKSTEP_BIT */
 164.258 ++#define PA_SINGLESTEP_BIT 0 /* 31-PT_SINGLESTEP_BIT */
 164.259 ++
 164.260 ++#define ASM_PMD_SHIFT 21 /* PMD_SHIFT */
 164.261 ++#define ASM_PGDIR_SHIFT 21 /* PGDIR_SHIFT */
 164.262 ++#define ASM_BITS_PER_PGD 11 /* BITS_PER_PGD */
 164.263 ++#define ASM_BITS_PER_PMD 0 /* BITS_PER_PMD */
 164.264 ++#define ASM_BITS_PER_PTE 9 /* BITS_PER_PTE */
 164.265 ++#define ASM_PGD_PMD_OFFSET -8192 /* -(PAGE_SIZE << PGD_ORDER) */
 164.266 ++#define ASM_PMD_ENTRY 128 /* ((PAGE_OFFSET & PMD_MASK) >> PMD_SHIFT) */
 164.267 ++#define ASM_PGD_ENTRY 128 /* PAGE_OFFSET >> PGDIR_SHIFT */
 164.268 ++#define ASM_PGD_ENTRY_SIZE 4 /* PGD_ENTRY_SIZE */
 164.269 ++#define ASM_PMD_ENTRY_SIZE 4 /* PMD_ENTRY_SIZE */
 164.270 ++#define ASM_PTE_ENTRY_SIZE 8 /* PTE_ENTRY_SIZE */
 164.271 ++#define ASM_PT_INITIAL 4 /* PT_INITIAL */
 164.272 ++#define ASM_PAGE_SIZE 4096 /* PAGE_SIZE */
 164.273 ++
 164.274 ++
 164.275 ++#endif
   165.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   165.2 +++ b/patches/gdb/6.7.1/200-deleted-children.patch	Mon Jul 28 21:08:01 2008 +0000
   165.3 @@ -0,0 +1,26 @@
   165.4 +Original patch from gentoo: gentoo/src/patchsets/gdb/6.7.1/50_all_gdb-deleted-children.patch
   165.5 +-= BEGIN original header =-
   165.6 +http://bugs.gentoo.org/210636
   165.7 +http://sourceware.org/ml/gdb-patches/2007-11/msg00136.html
   165.8 +
   165.9 +2007-11-07  Vladimir Prus  <vladimir@codesourcery.com>
  165.10 +
  165.11 +	Fix crash when a variable object being deleted
  165.12 +	has any of its children deleted previously.
  165.13 +	
  165.14 +	* varobj.c (delete_variable_1): Don't recurse
  165.15 +	into deleted children.
  165.16 +
  165.17 +-= END original header =-
  165.18 +diff -durN gdb-6.7.1.orig/gdb/varobj.c gdb-6.7.1/gdb/varobj.c
  165.19 +--- gdb-6.7.1.orig/gdb/varobj.c	2007-08-31 21:01:17.000000000 +0200
  165.20 ++++ gdb-6.7.1/gdb/varobj.c	2008-06-17 23:27:45.000000000 +0200
  165.21 +@@ -1295,6 +1295,8 @@
  165.22 +   for (i = 0; i < VEC_length (varobj_p, var->children); ++i)
  165.23 +     {   
  165.24 +       varobj_p child = VEC_index (varobj_p, var->children, i);
  165.25 ++      if (!child)
  165.26 ++	continue;
  165.27 +       if (!remove_from_parent_p)
  165.28 + 	child->parent = NULL;
  165.29 +       delete_variable_1 (resultp, delcountp, child, 0, only_children_p);
   166.1 --- a/patches/gdb/6.7.1/200-gdb-deleted-children.patch	Mon Jul 28 20:17:48 2008 +0000
   166.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   166.3 @@ -1,26 +0,0 @@
   166.4 -Original patch from gentoo: gentoo/src/patchsets/gdb/6.7.1/50_all_gdb-deleted-children.patch
   166.5 --= BEGIN original header =-
   166.6 -http://bugs.gentoo.org/210636
   166.7 -http://sourceware.org/ml/gdb-patches/2007-11/msg00136.html
   166.8 -
   166.9 -2007-11-07  Vladimir Prus  <vladimir@codesourcery.com>
  166.10 -
  166.11 -	Fix crash when a variable object being deleted
  166.12 -	has any of its children deleted previously.
  166.13 -	
  166.14 -	* varobj.c (delete_variable_1): Don't recurse
  166.15 -	into deleted children.
  166.16 -
  166.17 --= END original header =-
  166.18 -diff -durN gdb-6.7.1.orig/gdb/varobj.c gdb-6.7.1/gdb/varobj.c
  166.19 ---- gdb-6.7.1.orig/gdb/varobj.c	2007-08-31 21:01:17.000000000 +0200
  166.20 -+++ gdb-6.7.1/gdb/varobj.c	2008-06-17 23:27:45.000000000 +0200
  166.21 -@@ -1295,6 +1295,8 @@
  166.22 -   for (i = 0; i < VEC_length (varobj_p, var->children); ++i)
  166.23 -     {   
  166.24 -       varobj_p child = VEC_index (varobj_p, var->children, i);
  166.25 -+      if (!child)
  166.26 -+	continue;
  166.27 -       if (!remove_from_parent_p)
  166.28 - 	child->parent = NULL;
  166.29 -       delete_variable_1 (resultp, delcountp, child, 0, only_children_p);
   167.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   167.2 +++ b/patches/gdb/6.7.1/225-dwarf-stack-overflow.patch	Mon Jul 28 21:08:01 2008 +0000
   167.3 @@ -0,0 +1,52 @@
   167.4 +Original patch from gentoo: gentoo/src/patchsets/gdb/6.7.1/80_all_gdb-6.5-dwarf-stack-overflow.patch
   167.5 +-= BEGIN original header =-
   167.6 +http://bugs.gentoo.org/144833
   167.7 +
   167.8 +for gdb/ChangeLog:
   167.9 +2006-08-22  Will Drewry <wad@google.com>
  167.10 +	    Tavis Ormandy <taviso@google.com>
  167.11 +
  167.12 +	* dwarf2read.c (decode_locdesc): Enforce location description stack
  167.13 +	boundaries.
  167.14 +	* dwarfread.c (locval): Likewise.
  167.15 +
  167.16 +-= END original header =-
  167.17 +diff -durN gdb-6.7.1.orig/gdb/dwarf2read.c gdb-6.7.1/gdb/dwarf2read.c
  167.18 +--- gdb-6.7.1.orig/gdb/dwarf2read.c	2007-09-05 02:51:48.000000000 +0200
  167.19 ++++ gdb-6.7.1/gdb/dwarf2read.c	2008-06-17 23:27:46.000000000 +0200
  167.20 +@@ -9061,8 +9061,7 @@
  167.21 +    callers will only want a very basic result and this can become a
  167.22 +    complaint.
  167.23 + 
  167.24 +-   Note that stack[0] is unused except as a default error return.
  167.25 +-   Note that stack overflow is not yet handled.  */
  167.26 ++   Note that stack[0] is unused except as a default error return. */
  167.27 + 
  167.28 + static CORE_ADDR
  167.29 + decode_locdesc (struct dwarf_block *blk, struct dwarf2_cu *cu)
  167.30 +@@ -9079,7 +9078,7 @@
  167.31 + 
  167.32 +   i = 0;
  167.33 +   stacki = 0;
  167.34 +-  stack[stacki] = 0;
  167.35 ++  stack[++stacki] = 0;
  167.36 + 
  167.37 +   while (i < size)
  167.38 +     {
  167.39 +@@ -9261,6 +9260,16 @@
  167.40 + 		     dwarf_stack_op_name (op));
  167.41 + 	  return (stack[stacki]);
  167.42 + 	}
  167.43 ++      /* Enforce maximum stack depth of size-1 to avoid ++stacki writing
  167.44 ++         outside of the allocated space. Also enforce minimum > 0.
  167.45 ++         -- wad@google.com 14 Aug 2006 */
  167.46 ++      if (stacki >= sizeof (stack) / sizeof (*stack) - 1)
  167.47 ++	internal_error (__FILE__, __LINE__,
  167.48 ++	                _("location description stack too deep: %d"),
  167.49 ++	                stacki);
  167.50 ++      if (stacki <= 0)
  167.51 ++	internal_error (__FILE__, __LINE__,
  167.52 ++	                _("location description stack too shallow"));
  167.53 +     }
  167.54 +   return (stack[stacki]);
  167.55 + }
   168.1 --- a/patches/gdb/6.7.1/225-gdb-6.5-dwarf-stack-overflow.patch	Mon Jul 28 20:17:48 2008 +0000
   168.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   168.3 @@ -1,52 +0,0 @@
   168.4 -Original patch from gentoo: gentoo/src/patchsets/gdb/6.7.1/80_all_gdb-6.5-dwarf-stack-overflow.patch
   168.5 --= BEGIN original header =-
   168.6 -http://bugs.gentoo.org/144833
   168.7 -
   168.8 -for gdb/ChangeLog:
   168.9 -2006-08-22  Will Drewry <wad@google.com>
  168.10 -	    Tavis Ormandy <taviso@google.com>
  168.11 -
  168.12 -	* dwarf2read.c (decode_locdesc): Enforce location description stack
  168.13 -	boundaries.
  168.14 -	* dwarfread.c (locval): Likewise.
  168.15 -
  168.16 --= END original header =-
  168.17 -diff -durN gdb-6.7.1.orig/gdb/dwarf2read.c gdb-6.7.1/gdb/dwarf2read.c
  168.18 ---- gdb-6.7.1.orig/gdb/dwarf2read.c	2007-09-05 02:51:48.000000000 +0200
  168.19 -+++ gdb-6.7.1/gdb/dwarf2read.c	2008-06-17 23:27:46.000000000 +0200
  168.20 -@@ -9061,8 +9061,7 @@
  168.21 -    callers will only want a very basic result and this can become a
  168.22 -    complaint.
  168.23 - 
  168.24 --   Note that stack[0] is unused except as a default error return.
  168.25 --   Note that stack overflow is not yet handled.  */
  168.26 -+   Note that stack[0] is unused except as a default error return. */
  168.27 - 
  168.28 - static CORE_ADDR
  168.29 - decode_locdesc (struct dwarf_block *blk, struct dwarf2_cu *cu)
  168.30 -@@ -9079,7 +9078,7 @@
  168.31 - 
  168.32 -   i = 0;
  168.33 -   stacki = 0;
  168.34 --  stack[stacki] = 0;
  168.35 -+  stack[++stacki] = 0;
  168.36 - 
  168.37 -   while (i < size)
  168.38 -     {
  168.39 -@@ -9261,6 +9260,16 @@
  168.40 - 		     dwarf_stack_op_name (op));
  168.41 - 	  return (stack[stacki]);
  168.42 - 	}
  168.43 -+      /* Enforce maximum stack depth of size-1 to avoid ++stacki writing
  168.44 -+         outside of the allocated space. Also enforce minimum > 0.
  168.45 -+         -- wad@google.com 14 Aug 2006 */
  168.46 -+      if (stacki >= sizeof (stack) / sizeof (*stack) - 1)
  168.47 -+	internal_error (__FILE__, __LINE__,
  168.48 -+	                _("location description stack too deep: %d"),
  168.49 -+	                stacki);
  168.50 -+      if (stacki <= 0)
  168.51 -+	internal_error (__FILE__, __LINE__,
  168.52 -+	                _("location description stack too shallow"));
  168.53 -     }
  168.54 -   return (stack[stacki]);
  168.55 - }
   169.1 --- a/patches/gdb/6.7/100-gdb-6.3-security-errata-20050610.patch	Mon Jul 28 20:17:48 2008 +0000
   169.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   169.3 @@ -1,205 +0,0 @@
   169.4 -Original patch from gentoo: gentoo/src/patchsets/gdb/6.7/35_all_gdb-6.3-security-errata-20050610.patch
   169.5 --= BEGIN original header =-
   169.6 -2005-06-09  Jeff Johnston  <jjohnstn@redhat.com>
   169.7 -
   169.8 -        * gdb.base/gdbinit.exp: New testcase.
   169.9 -        * gdb.base/gdbinit.sample: Sample .gdbinit for gdbinit.exp.
  169.10 -
  169.11 -2005-06-08  Daniel Jacobowitz  <dan@codesourcery.com>
  169.12 -            Jeff Johnston  <jjohnstn@redhat.com>
  169.13 -
  169.14 -        * Makefile.in (cli-cmds.o): Update.
  169.15 -        * configure.in: Add check for getuid.
  169.16 -        * configure: Regenerated.
  169.17 -        * config.in: Ditto.
  169.18 -        * main.c (captured_main): Pass -1 to source_command when loading
  169.19 -        gdbinit files.
  169.20 -        * cli/cli-cmds.c: Include "gdb_stat.h" and <fcntl.h>.
  169.21 -        (source_command): Update documentation.  Check permissions if
  169.22 -        FROM_TTY is -1.
  169.23 -
  169.24 --= END original header =-
  169.25 -diff -durN gdb-6.7.orig/gdb/cli/cli-cmds.c gdb-6.7/gdb/cli/cli-cmds.c
  169.26 ---- gdb-6.7.orig/gdb/cli/cli-cmds.c	2007-08-23 20:08:47.000000000 +0200
  169.27 -+++ gdb-6.7/gdb/cli/cli-cmds.c	2008-06-17 23:25:23.000000000 +0200
  169.28 -@@ -36,6 +36,7 @@
  169.29 - #include "objfiles.h"
  169.30 - #include "source.h"
  169.31 - #include "disasm.h"
  169.32 -+#include "gdb_stat.h"
  169.33 - 
  169.34 - #include "ui-out.h"
  169.35 - 
  169.36 -@@ -459,12 +460,31 @@
  169.37 - 
  169.38 -   if (fd == -1)
  169.39 -     {
  169.40 --      if (from_tty)
  169.41 -+      if (from_tty > 0)
  169.42 - 	perror_with_name (file);
  169.43 -       else
  169.44 - 	return;
  169.45 -     }
  169.46 - 
  169.47 -+#ifdef HAVE_GETUID
  169.48 -+  if (from_tty == -1)
  169.49 -+    {
  169.50 -+      struct stat statbuf;
  169.51 -+      if (fstat (fd, &statbuf) < 0)
  169.52 -+	{
  169.53 -+	  perror_with_name (file);
  169.54 -+	  close (fd);
  169.55 -+	  return;
  169.56 -+	}
  169.57 -+      if (statbuf.st_uid != getuid () || (statbuf.st_mode & S_IWOTH))
  169.58 -+	{
  169.59 -+          warning (_("not using untrusted file \"%s\""), file);
  169.60 -+	  close (fd);
  169.61 -+	  return;
  169.62 -+	}
  169.63 -+    }
  169.64 -+#endif
  169.65 -+
  169.66 -   stream = fdopen (fd, FOPEN_RT);
  169.67 -   script_from_file (stream, file);
  169.68 - 
  169.69 -diff -durN gdb-6.7.orig/gdb/main.c gdb-6.7/gdb/main.c
  169.70 ---- gdb-6.7.orig/gdb/main.c	2007-08-23 20:08:36.000000000 +0200
  169.71 -+++ gdb-6.7/gdb/main.c	2008-06-17 23:25:23.000000000 +0200
  169.72 -@@ -688,7 +688,7 @@
  169.73 - 
  169.74 -       if (!inhibit_gdbinit)
  169.75 - 	{
  169.76 --	  catch_command_errors (source_script, homeinit, 0, RETURN_MASK_ALL);
  169.77 -+	  catch_command_errors (source_script, homeinit, -1, RETURN_MASK_ALL);
  169.78 - 	}
  169.79 - 
  169.80 -       /* Do stats; no need to do them elsewhere since we'll only
  169.81 -@@ -766,7 +766,7 @@
  169.82 -       || memcmp ((char *) &homebuf, (char *) &cwdbuf, sizeof (struct stat)))
  169.83 -     if (!inhibit_gdbinit)
  169.84 -       {
  169.85 --	catch_command_errors (source_script, gdbinit, 0, RETURN_MASK_ALL);
  169.86 -+	catch_command_errors (source_script, gdbinit, -1, RETURN_MASK_ALL);
  169.87 -       }
  169.88 - 
  169.89 -   for (i = 0; i < ncmd; i++)
  169.90 -diff -durN gdb-6.7.orig/gdb/Makefile.in gdb-6.7/gdb/Makefile.in
  169.91 ---- gdb-6.7.orig/gdb/Makefile.in	2007-09-05 02:14:02.000000000 +0200
  169.92 -+++ gdb-6.7/gdb/Makefile.in	2008-06-17 23:25:23.000000000 +0200
  169.93 -@@ -2882,7 +2882,7 @@
  169.94 - 	$(expression_h) $(frame_h) $(value_h) $(language_h) $(filenames_h) \
  169.95 - 	$(objfiles_h) $(source_h) $(disasm_h) $(ui_out_h) $(top_h) \
  169.96 - 	$(cli_decode_h) $(cli_script_h) $(cli_setshow_h) $(cli_cmds_h) \
  169.97 --	$(tui_h)
  169.98 -+	$(tui_h) $(gdb_stat_h)
  169.99 - 	$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-cmds.c
 169.100 - cli-decode.o: $(srcdir)/cli/cli-decode.c $(defs_h) $(symtab_h) \
 169.101 - 	$(gdb_regex_h) $(gdb_string_h) $(completer_h) $(ui_out_h) \
 169.102 -diff -durN gdb-6.7.orig/gdb/testsuite/gdb.base/gdbinit.exp gdb-6.7/gdb/testsuite/gdb.base/gdbinit.exp
 169.103 ---- gdb-6.7.orig/gdb/testsuite/gdb.base/gdbinit.exp	1970-01-01 01:00:00.000000000 +0100
 169.104 -+++ gdb-6.7/gdb/testsuite/gdb.base/gdbinit.exp	2008-06-17 23:25:23.000000000 +0200
 169.105 -@@ -0,0 +1,98 @@
 169.106 -+#   Copyright 2005
 169.107 -+#   Free Software Foundation, Inc.
 169.108 -+
 169.109 -+# This program is free software; you can redistribute it and/or modify
 169.110 -+# it under the terms of the GNU General Public License as published by
 169.111 -+# the Free Software Foundation; either version 2 of the License, or
 169.112 -+# (at your option) any later version.
 169.113 -+# 
 169.114 -+# This program is distributed in the hope that it will be useful,
 169.115 -+# but WITHOUT ANY WARRANTY; without even the implied warranty of
 169.116 -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 169.117 -+# GNU General Public License for more details.
 169.118 -+# 
 169.119 -+# You should have received a copy of the GNU General Public License
 169.120 -+# along with this program; if not, write to the Free Software
 169.121 -+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
 169.122 -+
 169.123 -+# Please email any bugs, comments, and/or additions to this file to:
 169.124 -+# bug-gdb@prep.ai.mit.edu
 169.125 -+
 169.126 -+# This file was written by Jeff Johnston <jjohnstn@redhat.com>.
 169.127 -+
 169.128 -+if $tracelevel then {
 169.129 -+    strace $tracelevel
 169.130 -+}
 169.131 -+
 169.132 -+set prms_id 0
 169.133 -+set bug_id 0
 169.134 -+
 169.135 -+# are we on a target board
 169.136 -+if [is_remote target] {
 169.137 -+    return
 169.138 -+}
 169.139 -+
 169.140 -+
 169.141 -+global verbose
 169.142 -+global GDB
 169.143 -+global GDBFLAGS
 169.144 -+global gdb_prompt
 169.145 -+global timeout
 169.146 -+global gdb_spawn_id;
 169.147 -+                                                                                
 169.148 -+gdb_stop_suppressing_tests;
 169.149 -+                                                                                
 169.150 -+verbose "Spawning $GDB -nw"
 169.151 -+                                                                                
 169.152 -+if [info exists gdb_spawn_id] {
 169.153 -+    return 0;
 169.154 -+}
 169.155 -+                                                                                
 169.156 -+if ![is_remote host] {
 169.157 -+   if { [which $GDB] == 0 } then {
 169.158 -+        perror "$GDB does not exist."
 169.159 -+        exit 1
 169.160 -+    }
 169.161 -+}
 169.162 -+
 169.163 -+set env(HOME) [pwd]
 169.164 -+remote_exec build "rm .gdbinit"
 169.165 -+remote_exec build "cp ${srcdir}/${subdir}/gdbinit.sample .gdbinit"
 169.166 -+remote_exec build "chmod 646 .gdbinit"
 169.167 -+
 169.168 -+set res [remote_spawn host "$GDB -nw [host_info gdb_opts]"];
 169.169 -+if { $res < 0 || $res == "" } {
 169.170 -+    perror "Spawning $GDB failed."
 169.171 -+    return 1;
 169.172 -+}
 169.173 -+gdb_expect 360 {
 169.174 -+    -re "warning: not using untrusted file.*\.gdbinit.*\[\r\n\]$gdb_prompt $" {
 169.175 -+        pass "untrusted .gdbinit caught."
 169.176 -+    }
 169.177 -+    -re "$gdb_prompt $"     {
 169.178 -+        fail "untrusted .gdbinit caught."
 169.179 -+    }
 169.180 -+    timeout {
 169.181 -+        fail "(timeout) untrusted .gdbinit caught."
 169.182 -+    }
 169.183 -+}
 169.184 -+
 169.185 -+remote_exec build "chmod 644 .gdbinit"
 169.186 -+set res [remote_spawn host "$GDB -nw [host_info gdb_opts]"];
 169.187 -+if { $res < 0 || $res == "" } {
 169.188 -+    perror "Spawning $GDB failed."
 169.189 -+    return 1;
 169.190 -+}
 169.191 -+gdb_expect 360 {
 169.192 -+    -re "warning: not using untrusted file.*\.gdbinit.*\[\r\n\]$gdb_prompt $" {
 169.193 -+        fail "trusted .gdbinit allowed."
 169.194 -+    }
 169.195 -+    -re "in gdbinit.*$gdb_prompt $"     {
 169.196 -+        pass "trusted .gdbinit allowed."
 169.197 -+    }
 169.198 -+    timeout {
 169.199 -+        fail "(timeout) trusted .gdbinit allowed."
 169.200 -+    }
 169.201 -+}
 169.202 -+
 169.203 -+remote_exec build "rm .gdbinit"
 169.204 -diff -durN gdb-6.7.orig/gdb/testsuite/gdb.base/gdbinit.sample gdb-6.7/gdb/testsuite/gdb.base/gdbinit.sample
 169.205 ---- gdb-6.7.orig/gdb/testsuite/gdb.base/gdbinit.sample	1970-01-01 01:00:00.000000000 +0100
 169.206 -+++ gdb-6.7/gdb/testsuite/gdb.base/gdbinit.sample	2008-06-17 23:25:23.000000000 +0200
 169.207 -@@ -0,0 +1 @@
 169.208 -+echo "\nin gdbinit"
   170.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   170.2 +++ b/patches/gdb/6.7/100-security-errata-20050610.patch	Mon Jul 28 21:08:01 2008 +0000
   170.3 @@ -0,0 +1,205 @@
   170.4 +Original patch from gentoo: gentoo/src/patchsets/gdb/6.7/35_all_gdb-6.3-security-errata-20050610.patch
   170.5 +-= BEGIN original header =-
   170.6 +2005-06-09  Jeff Johnston  <jjohnstn@redhat.com>
   170.7 +
   170.8 +        * gdb.base/gdbinit.exp: New testcase.
   170.9 +        * gdb.base/gdbinit.sample: Sample .gdbinit for gdbinit.exp.
  170.10 +
  170.11 +2005-06-08  Daniel Jacobowitz  <dan@codesourcery.com>
  170.12 +            Jeff Johnston  <jjohnstn@redhat.com>
  170.13 +
  170.14 +        * Makefile.in (cli-cmds.o): Update.
  170.15 +        * configure.in: Add check for getuid.
  170.16 +        * configure: Regenerated.
  170.17 +        * config.in: Ditto.
  170.18 +        * main.c (captured_main): Pass -1 to source_command when loading
  170.19 +        gdbinit files.
  170.20 +        * cli/cli-cmds.c: Include "gdb_stat.h" and <fcntl.h>.
  170.21 +        (source_command): Update documentation.  Check permissions if
  170.22 +        FROM_TTY is -1.
  170.23 +
  170.24 +-= END original header =-
  170.25 +diff -durN gdb-6.7.orig/gdb/cli/cli-cmds.c gdb-6.7/gdb/cli/cli-cmds.c
  170.26 +--- gdb-6.7.orig/gdb/cli/cli-cmds.c	2007-08-23 20:08:47.000000000 +0200
  170.27 ++++ gdb-6.7/gdb/cli/cli-cmds.c	2008-06-17 23:25:23.000000000 +0200
  170.28 +@@ -36,6 +36,7 @@
  170.29 + #include "objfiles.h"
  170.30 + #include "source.h"
  170.31 + #include "disasm.h"
  170.32 ++#include "gdb_stat.h"
  170.33 + 
  170.34 + #include "ui-out.h"
  170.35 + 
  170.36 +@@ -459,12 +460,31 @@
  170.37 + 
  170.38 +   if (fd == -1)
  170.39 +     {
  170.40 +-      if (from_tty)
  170.41 ++      if (from_tty > 0)
  170.42 + 	perror_with_name (file);
  170.43 +       else
  170.44 + 	return;
  170.45 +     }
  170.46 + 
  170.47 ++#ifdef HAVE_GETUID
  170.48 ++  if (from_tty == -1)
  170.49 ++    {
  170.50 ++      struct stat statbuf;
  170.51 ++      if (fstat (fd, &statbuf) < 0)
  170.52 ++	{
  170.53 ++	  perror_with_name (file);
  170.54 ++	  close (fd);
  170.55 ++	  return;
  170.56 ++	}
  170.57 ++      if (statbuf.st_uid != getuid () || (statbuf.st_mode & S_IWOTH))
  170.58 ++	{
  170.59 ++          warning (_("not using untrusted file \"%s\""), file);
  170.60 ++	  close (fd);
  170.61 ++	  return;
  170.62 ++	}
  170.63 ++    }
  170.64 ++#endif
  170.65 ++
  170.66 +   stream = fdopen (fd, FOPEN_RT);
  170.67 +   script_from_file (stream, file);
  170.68 + 
  170.69 +diff -durN gdb-6.7.orig/gdb/main.c gdb-6.7/gdb/main.c
  170.70 +--- gdb-6.7.orig/gdb/main.c	2007-08-23 20:08:36.000000000 +0200
  170.71 ++++ gdb-6.7/gdb/main.c	2008-06-17 23:25:23.000000000 +0200
  170.72 +@@ -688,7 +688,7 @@
  170.73 + 
  170.74 +       if (!inhibit_gdbinit)
  170.75 + 	{
  170.76 +-	  catch_command_errors (source_script, homeinit, 0, RETURN_MASK_ALL);
  170.77 ++	  catch_command_errors (source_script, homeinit, -1, RETURN_MASK_ALL);
  170.78 + 	}
  170.79 + 
  170.80 +       /* Do stats; no need to do them elsewhere since we'll only
  170.81 +@@ -766,7 +766,7 @@
  170.82 +       || memcmp ((char *) &homebuf, (char *) &cwdbuf, sizeof (struct stat)))
  170.83 +     if (!inhibit_gdbinit)
  170.84 +       {
  170.85 +-	catch_command_errors (source_script, gdbinit, 0, RETURN_MASK_ALL);
  170.86 ++	catch_command_errors (source_script, gdbinit, -1, RETURN_MASK_ALL);
  170.87 +       }
  170.88 + 
  170.89 +   for (i = 0; i < ncmd; i++)
  170.90 +diff -durN gdb-6.7.orig/gdb/Makefile.in gdb-6.7/gdb/Makefile.in
  170.91 +--- gdb-6.7.orig/gdb/Makefile.in	2007-09-05 02:14:02.000000000 +0200
  170.92 ++++ gdb-6.7/gdb/Makefile.in	2008-06-17 23:25:23.000000000 +0200
  170.93 +@@ -2882,7 +2882,7 @@
  170.94 + 	$(expression_h) $(frame_h) $(value_h) $(language_h) $(filenames_h) \
  170.95 + 	$(objfiles_h) $(source_h) $(disasm_h) $(ui_out_h) $(top_h) \
  170.96 + 	$(cli_decode_h) $(cli_script_h) $(cli_setshow_h) $(cli_cmds_h) \
  170.97 +-	$(tui_h)
  170.98 ++	$(tui_h) $(gdb_stat_h)
  170.99 + 	$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-cmds.c
 170.100 + cli-decode.o: $(srcdir)/cli/cli-decode.c $(defs_h) $(symtab_h) \
 170.101 + 	$(gdb_regex_h) $(gdb_string_h) $(completer_h) $(ui_out_h) \
 170.102 +diff -durN gdb-6.7.orig/gdb/testsuite/gdb.base/gdbinit.exp gdb-6.7/gdb/testsuite/gdb.base/gdbinit.exp
 170.103 +--- gdb-6.7.orig/gdb/testsuite/gdb.base/gdbinit.exp	1970-01-01 01:00:00.000000000 +0100
 170.104 ++++ gdb-6.7/gdb/testsuite/gdb.base/gdbinit.exp	2008-06-17 23:25:23.000000000 +0200
 170.105 +@@ -0,0 +1,98 @@
 170.106 ++#   Copyright 2005
 170.107 ++#   Free Software Foundation, Inc.
 170.108 ++
 170.109 ++# This program is free software; you can redistribute it and/or modify
 170.110 ++# it under the terms of the GNU General Public License as published by
 170.111 ++# the Free Software Foundation; either version 2 of the License, or
 170.112 ++# (at your option) any later version.
 170.113 ++# 
 170.114 ++# This program is distributed in the hope that it will be useful,
 170.115 ++# but WITHOUT ANY WARRANTY; without even the implied warranty of
 170.116 ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 170.117 ++# GNU General Public License for more details.
 170.118 ++# 
 170.119 ++# You should have received a copy of the GNU General Public License
 170.120 ++# along with this program; if not, write to the Free Software
 170.121 ++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
 170.122 ++
 170.123 ++# Please email any bugs, comments, and/or additions to this file to:
 170.124 ++# bug-gdb@prep.ai.mit.edu
 170.125 ++
 170.126 ++# This file was written by Jeff Johnston <jjohnstn@redhat.com>.
 170.127 ++
 170.128 ++if $tracelevel then {
 170.129 ++    strace $tracelevel
 170.130 ++}
 170.131 ++
 170.132 ++set prms_id 0
 170.133 ++set bug_id 0
 170.134 ++
 170.135 ++# are we on a target board
 170.136 ++if [is_remote target] {
 170.137 ++    return
 170.138 ++}
 170.139 ++
 170.140 ++
 170.141 ++global verbose
 170.142 ++global GDB
 170.143 ++global GDBFLAGS
 170.144 ++global gdb_prompt
 170.145 ++global timeout
 170.146 ++global gdb_spawn_id;
 170.147 ++                                                                                
 170.148 ++gdb_stop_suppressing_tests;
 170.149 ++                                                                                
 170.150 ++verbose "Spawning $GDB -nw"
 170.151 ++                                                                                
 170.152 ++if [info exists gdb_spawn_id] {
 170.153 ++    return 0;
 170.154 ++}
 170.155 ++                                                                                
 170.156 ++if ![is_remote host] {
 170.157 ++   if { [which $GDB] == 0 } then {
 170.158 ++        perror "$GDB does not exist."
 170.159 ++        exit 1
 170.160 ++    }
 170.161 ++}
 170.162 ++
 170.163 ++set env(HOME) [pwd]
 170.164 ++remote_exec build "rm .gdbinit"
 170.165 ++remote_exec build "cp ${srcdir}/${subdir}/gdbinit.sample .gdbinit"
 170.166 ++remote_exec build "chmod 646 .gdbinit"
 170.167 ++
 170.168 ++set res [remote_spawn host "$GDB -nw [host_info gdb_opts]"];
 170.169 ++if { $res < 0 || $res == "" } {
 170.170 ++    perror "Spawning $GDB failed."
 170.171 ++    return 1;
 170.172 ++}
 170.173 ++gdb_expect 360 {
 170.174 ++    -re "warning: not using untrusted file.*\.gdbinit.*\[\r\n\]$gdb_prompt $" {
 170.175 ++        pass "untrusted .gdbinit caught."
 170.176 ++    }
 170.177 ++    -re "$gdb_prompt $"     {
 170.178 ++        fail "untrusted .gdbinit caught."
 170.179 ++    }
 170.180 ++    timeout {
 170.181 ++        fail "(timeout) untrusted .gdbinit caught."
 170.182 ++    }
 170.183 ++}
 170.184 ++
 170.185 ++remote_exec build "chmod 644 .gdbinit"
 170.186 ++set res [remote_spawn host "$GDB -nw [host_info gdb_opts]"];
 170.187 ++if { $res < 0 || $res == "" } {
 170.188 ++    perror "Spawning $GDB failed."
 170.189 ++    return 1;
 170.190 ++}
 170.191 ++gdb_expect 360 {
 170.192 ++    -re "warning: not using untrusted file.*\.gdbinit.*\[\r\n\]$gdb_prompt $" {
 170.193 ++        fail "trusted .gdbinit allowed."
 170.194 ++    }
 170.195 ++    -re "in gdbinit.*$gdb_prompt $"     {
 170.196 ++        pass "trusted .gdbinit allowed."
 170.197 ++    }
 170.198 ++    timeout {
 170.199 ++        fail "(timeout) trusted .gdbinit allowed."
 170.200 ++    }
 170.201 ++}
 170.202 ++
 170.203 ++remote_exec build "rm .gdbinit"
 170.204 +diff -durN gdb-6.7.orig/gdb/testsuite/gdb.base/gdbinit.sample gdb-6.7/gdb/testsuite/gdb.base/gdbinit.sample
 170.205 +--- gdb-6.7.orig/gdb/testsuite/gdb.base/gdbinit.sample	1970-01-01 01:00:00.000000000 +0100
 170.206 ++++ gdb-6.7/gdb/testsuite/gdb.base/gdbinit.sample	2008-06-17 23:25:23.000000000 +0200
 170.207 +@@ -0,0 +1 @@
 170.208 ++echo "\nin gdbinit"
   171.1 --- a/patches/gdb/6.7/125-gdb-hppa-offsets.patch	Mon Jul 28 20:17:48 2008 +0000
   171.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   171.3 @@ -1,272 +0,0 @@
   171.4 -Original patch from gentoo: gentoo/src/patchsets/gdb/6.7/45_all_gdb-hppa-offsets.patch
   171.5 --= BEGIN original header =-
   171.6 -sanitized headers dont include asm/offsets.h, so cache a local copy 
   171.7 -
   171.8 -http://bugs.gentoo.org/180476
   171.9 -http://lists.parisc-linux.org/pipermail/parisc-linux/2007-February/031162.html
  171.10 -
  171.11 --= END original header =-
  171.12 -diff -durN gdb-6.7.orig/gdb/hppa-linux-nat.c gdb-6.7/gdb/hppa-linux-nat.c
  171.13 ---- gdb-6.7.orig/gdb/hppa-linux-nat.c	2007-08-23 20:08:33.000000000 +0200
  171.14 -+++ gdb-6.7/gdb/hppa-linux-nat.c	2008-06-17 23:25:28.000000000 +0200
  171.15 -@@ -32,7 +32,7 @@
  171.16 - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,43)
  171.17 - #include <asm/offset.h>
  171.18 - #else
  171.19 --#include <asm/offsets.h>
  171.20 -+#include <hppa-offsets.h>
  171.21 - #endif
  171.22 - 
  171.23 - #include "hppa-tdep.h"
  171.24 -diff -durN gdb-6.7.orig/gdb/hppa-offsets.h gdb-6.7/gdb/hppa-offsets.h
  171.25 ---- gdb-6.7.orig/gdb/hppa-offsets.h	1970-01-01 01:00:00.000000000 +0100
  171.26 -+++ gdb-6.7/gdb/hppa-offsets.h	2008-06-17 23:25:28.000000000 +0200
  171.27 -@@ -0,0 +1,248 @@
  171.28 -+#ifndef __ASM_OFFSETS_H__
  171.29 -+#define __ASM_OFFSETS_H__
  171.30 -+/*
  171.31 -+ * DO NOT MODIFY.
  171.32 -+ *
  171.33 -+ * This file was generated by arch/parisc/Makefile
  171.34 -+ *
  171.35 -+ */
  171.36 -+
  171.37 -+#define TASK_THREAD_INFO 4 /* offsetof(struct task_struct, thread_info) */
  171.38 -+#define TASK_STATE 0 /* offsetof(struct task_struct, state) */
  171.39 -+#define TASK_FLAGS 12 /* offsetof(struct task_struct, flags) */
  171.40 -+#define TASK_SIGPENDING 1188 /* offsetof(struct task_struct, pending) */
  171.41 -+#define TASK_PTRACE 16 /* offsetof(struct task_struct, ptrace) */
  171.42 -+#define TASK_MM 108 /* offsetof(struct task_struct, mm) */
  171.43 -+#define TASK_PERSONALITY 132 /* offsetof(struct task_struct, personality) */
  171.44 -+#define TASK_PID 140 /* offsetof(struct task_struct, pid) */
  171.45 -+
  171.46 -+#define TASK_REGS 664 /* offsetof(struct task_struct, thread.regs) */
  171.47 -+#define TASK_PT_PSW 664 /* offsetof(struct task_struct, thread.regs.gr[ 0]) */
  171.48 -+#define TASK_PT_GR1 668 /* offsetof(struct task_struct, thread.regs.gr[ 1]) */
  171.49 -+#define TASK_PT_GR2 672 /* offsetof(struct task_struct, thread.regs.gr[ 2]) */
  171.50 -+#define TASK_PT_GR3 676 /* offsetof(struct task_struct, thread.regs.gr[ 3]) */
  171.51 -+#define TASK_PT_GR4 680 /* offsetof(struct task_struct, thread.regs.gr[ 4]) */
  171.52 -+#define TASK_PT_GR5 684 /* offsetof(struct task_struct, thread.regs.gr[ 5]) */
  171.53 -+#define TASK_PT_GR6 688 /* offsetof(struct task_struct, thread.regs.gr[ 6]) */
  171.54 -+#define TASK_PT_GR7 692 /* offsetof(struct task_struct, thread.regs.gr[ 7]) */
  171.55 -+#define TASK_PT_GR8 696 /* offsetof(struct task_struct, thread.regs.gr[ 8]) */
  171.56 -+#define TASK_PT_GR9 700 /* offsetof(struct task_struct, thread.regs.gr[ 9]) */
  171.57 -+#define TASK_PT_GR10 704 /* offsetof(struct task_struct, thread.regs.gr[10]) */
  171.58 -+#define TASK_PT_GR11 708 /* offsetof(struct task_struct, thread.regs.gr[11]) */
  171.59 -+#define TASK_PT_GR12 712 /* offsetof(struct task_struct, thread.regs.gr[12]) */
  171.60 -+#define TASK_PT_GR13 716 /* offsetof(struct task_struct, thread.regs.gr[13]) */
  171.61 -+#define TASK_PT_GR14 720 /* offsetof(struct task_struct, thread.regs.gr[14]) */
  171.62 -+#define TASK_PT_GR15 724 /* offsetof(struct task_struct, thread.regs.gr[15]) */
  171.63 -+#define TASK_PT_GR16 728 /* offsetof(struct task_struct, thread.regs.gr[16]) */
  171.64 -+#define TASK_PT_GR17 732 /* offsetof(struct task_struct, thread.regs.gr[17]) */
  171.65 -+#define TASK_PT_GR18 736 /* offsetof(struct task_struct, thread.regs.gr[18]) */
  171.66 -+#define TASK_PT_GR19 740 /* offsetof(struct task_struct, thread.regs.gr[19]) */
  171.67 -+#define TASK_PT_GR20 744 /* offsetof(struct task_struct, thread.regs.gr[20]) */
  171.68 -+#define TASK_PT_GR21 748 /* offsetof(struct task_struct, thread.regs.gr[21]) */
  171.69 -+#define TASK_PT_GR22 752 /* offsetof(struct task_struct, thread.regs.gr[22]) */
  171.70 -+#define TASK_PT_GR23 756 /* offsetof(struct task_struct, thread.regs.gr[23]) */
  171.71 -+#define TASK_PT_GR24 760 /* offsetof(struct task_struct, thread.regs.gr[24]) */
  171.72 -+#define TASK_PT_GR25 764 /* offsetof(struct task_struct, thread.regs.gr[25]) */
  171.73 -+#define TASK_PT_GR26 768 /* offsetof(struct task_struct, thread.regs.gr[26]) */
  171.74 -+#define TASK_PT_GR27 772 /* offsetof(struct task_struct, thread.regs.gr[27]) */
  171.75 -+#define TASK_PT_GR28 776 /* offsetof(struct task_struct, thread.regs.gr[28]) */
  171.76 -+#define TASK_PT_GR29 780 /* offsetof(struct task_struct, thread.regs.gr[29]) */
  171.77 -+#define TASK_PT_GR30 784 /* offsetof(struct task_struct, thread.regs.gr[30]) */
  171.78 -+#define TASK_PT_GR31 788 /* offsetof(struct task_struct, thread.regs.gr[31]) */
  171.79 -+#define TASK_PT_FR0 792 /* offsetof(struct task_struct, thread.regs.fr[ 0]) */
  171.80 -+#define TASK_PT_FR1 800 /* offsetof(struct task_struct, thread.regs.fr[ 1]) */
  171.81 -+#define TASK_PT_FR2 808 /* offsetof(struct task_struct, thread.regs.fr[ 2]) */
  171.82 -+#define TASK_PT_FR3 816 /* offsetof(struct task_struct, thread.regs.fr[ 3]) */
  171.83 -+#define TASK_PT_FR4 824 /* offsetof(struct task_struct, thread.regs.fr[ 4]) */
  171.84 -+#define TASK_PT_FR5 832 /* offsetof(struct task_struct, thread.regs.fr[ 5]) */
  171.85 -+#define TASK_PT_FR6 840 /* offsetof(struct task_struct, thread.regs.fr[ 6]) */
  171.86 -+#define TASK_PT_FR7 848 /* offsetof(struct task_struct, thread.regs.fr[ 7]) */
  171.87 -+#define TASK_PT_FR8 856 /* offsetof(struct task_struct, thread.regs.fr[ 8]) */
  171.88 -+#define TASK_PT_FR9 864 /* offsetof(struct task_struct, thread.regs.fr[ 9]) */
  171.89 -+#define TASK_PT_FR10 872 /* offsetof(struct task_struct, thread.regs.fr[10]) */
  171.90 -+#define TASK_PT_FR11 880 /* offsetof(struct task_struct, thread.regs.fr[11]) */
  171.91 -+#define TASK_PT_FR12 888 /* offsetof(struct task_struct, thread.regs.fr[12]) */
  171.92 -+#define TASK_PT_FR13 896 /* offsetof(struct task_struct, thread.regs.fr[13]) */
  171.93 -+#define TASK_PT_FR14 904 /* offsetof(struct task_struct, thread.regs.fr[14]) */
  171.94 -+#define TASK_PT_FR15 912 /* offsetof(struct task_struct, thread.regs.fr[15]) */
  171.95 -+#define TASK_PT_FR16 920 /* offsetof(struct task_struct, thread.regs.fr[16]) */
  171.96 -+#define TASK_PT_FR17 928 /* offsetof(struct task_struct, thread.regs.fr[17]) */
  171.97 -+#define TASK_PT_FR18 936 /* offsetof(struct task_struct, thread.regs.fr[18]) */
  171.98 -+#define TASK_PT_FR19 944 /* offsetof(struct task_struct, thread.regs.fr[19]) */
  171.99 -+#define TASK_PT_FR20 952 /* offsetof(struct task_struct, thread.regs.fr[20]) */
 171.100 -+#define TASK_PT_FR21 960 /* offsetof(struct task_struct, thread.regs.fr[21]) */
 171.101 -+#define TASK_PT_FR22 968 /* offsetof(struct task_struct, thread.regs.fr[22]) */
 171.102 -+#define TASK_PT_FR23 976 /* offsetof(struct task_struct, thread.regs.fr[23]) */
 171.103 -+#define TASK_PT_FR24 984 /* offsetof(struct task_struct, thread.regs.fr[24]) */
 171.104 -+#define TASK_PT_FR25 992 /* offsetof(struct task_struct, thread.regs.fr[25]) */
 171.105 -+#define TASK_PT_FR26 1000 /* offsetof(struct task_struct, thread.regs.fr[26]) */
 171.106 -+#define TASK_PT_FR27 1008 /* offsetof(struct task_struct, thread.regs.fr[27]) */
 171.107 -+#define TASK_PT_FR28 1016 /* offsetof(struct task_struct, thread.regs.fr[28]) */
 171.108 -+#define TASK_PT_FR29 1024 /* offsetof(struct task_struct, thread.regs.fr[29]) */
 171.109 -+#define TASK_PT_FR30 1032 /* offsetof(struct task_struct, thread.regs.fr[30]) */
 171.110 -+#define TASK_PT_FR31 1040 /* offsetof(struct task_struct, thread.regs.fr[31]) */
 171.111 -+#define TASK_PT_SR0 1048 /* offsetof(struct task_struct, thread.regs.sr[ 0]) */
 171.112 -+#define TASK_PT_SR1 1052 /* offsetof(struct task_struct, thread.regs.sr[ 1]) */
 171.113 -+#define TASK_PT_SR2 1056 /* offsetof(struct task_struct, thread.regs.sr[ 2]) */
 171.114 -+#define TASK_PT_SR3 1060 /* offsetof(struct task_struct, thread.regs.sr[ 3]) */
 171.115 -+#define TASK_PT_SR4 1064 /* offsetof(struct task_struct, thread.regs.sr[ 4]) */
 171.116 -+#define TASK_PT_SR5 1068 /* offsetof(struct task_struct, thread.regs.sr[ 5]) */
 171.117 -+#define TASK_PT_SR6 1072 /* offsetof(struct task_struct, thread.regs.sr[ 6]) */
 171.118 -+#define TASK_PT_SR7 1076 /* offsetof(struct task_struct, thread.regs.sr[ 7]) */
 171.119 -+#define TASK_PT_IASQ0 1080 /* offsetof(struct task_struct, thread.regs.iasq[0]) */
 171.120 -+#define TASK_PT_IASQ1 1084 /* offsetof(struct task_struct, thread.regs.iasq[1]) */
 171.121 -+#define TASK_PT_IAOQ0 1088 /* offsetof(struct task_struct, thread.regs.iaoq[0]) */
 171.122 -+#define TASK_PT_IAOQ1 1092 /* offsetof(struct task_struct, thread.regs.iaoq[1]) */
 171.123 -+#define TASK_PT_CR27 1096 /* offsetof(struct task_struct, thread.regs.cr27) */
 171.124 -+#define TASK_PT_ORIG_R28 1104 /* offsetof(struct task_struct, thread.regs.orig_r28) */
 171.125 -+#define TASK_PT_KSP 1108 /* offsetof(struct task_struct, thread.regs.ksp) */
 171.126 -+#define TASK_PT_KPC 1112 /* offsetof(struct task_struct, thread.regs.kpc) */
 171.127 -+#define TASK_PT_SAR 1116 /* offsetof(struct task_struct, thread.regs.sar) */
 171.128 -+#define TASK_PT_IIR 1120 /* offsetof(struct task_struct, thread.regs.iir) */
 171.129 -+#define TASK_PT_ISR 1124 /* offsetof(struct task_struct, thread.regs.isr) */
 171.130 -+#define TASK_PT_IOR 1128 /* offsetof(struct task_struct, thread.regs.ior) */
 171.131 -+
 171.132 -+#define TASK_SZ 1272 /* sizeof(struct task_struct) */
 171.133 -+#define TASK_SZ_ALGN 1344 /* align(sizeof(struct task_struct), 64) */
 171.134 -+
 171.135 -+#define PT_PSW 0 /* offsetof(struct pt_regs, gr[ 0]) */
 171.136 -+#define PT_GR1 4 /* offsetof(struct pt_regs, gr[ 1]) */
 171.137 -+#define PT_GR2 8 /* offsetof(struct pt_regs, gr[ 2]) */
 171.138 -+#define PT_GR3 12 /* offsetof(struct pt_regs, gr[ 3]) */
 171.139 -+#define PT_GR4 16 /* offsetof(struct pt_regs, gr[ 4]) */
 171.140 -+#define PT_GR5 20 /* offsetof(struct pt_regs, gr[ 5]) */
 171.141 -+#define PT_GR6 24 /* offsetof(struct pt_regs, gr[ 6]) */
 171.142 -+#define PT_GR7 28 /* offsetof(struct pt_regs, gr[ 7]) */
 171.143 -+#define PT_GR8 32 /* offsetof(struct pt_regs, gr[ 8]) */
 171.144 -+#define PT_GR9 36 /* offsetof(struct pt_regs, gr[ 9]) */
 171.145 -+#define PT_GR10 40 /* offsetof(struct pt_regs, gr[10]) */
 171.146 -+#define PT_GR11 44 /* offsetof(struct pt_regs, gr[11]) */
 171.147 -+#define PT_GR12 48 /* offsetof(struct pt_regs, gr[12]) */
 171.148 -+#define PT_GR13 52 /* offsetof(struct pt_regs, gr[13]) */
 171.149 -+#define PT_GR14 56 /* offsetof(struct pt_regs, gr[14]) */
 171.150 -+#define PT_GR15 60 /* offsetof(struct pt_regs, gr[15]) */
 171.151 -+#define PT_GR16 64 /* offsetof(struct pt_regs, gr[16]) */
 171.152 -+#define PT_GR17 68 /* offsetof(struct pt_regs, gr[17]) */
 171.153 -+#define PT_GR18 72 /* offsetof(struct pt_regs, gr[18]) */
 171.154 -+#define PT_GR19 76 /* offsetof(struct pt_regs, gr[19]) */
 171.155 -+#define PT_GR20 80 /* offsetof(struct pt_regs, gr[20]) */
 171.156 -+#define PT_GR21 84 /* offsetof(struct pt_regs, gr[21]) */
 171.157 -+#define PT_GR22 88 /* offsetof(struct pt_regs, gr[22]) */
 171.158 -+#define PT_GR23 92 /* offsetof(struct pt_regs, gr[23]) */
 171.159 -+#define PT_GR24 96 /* offsetof(struct pt_regs, gr[24]) */
 171.160 -+#define PT_GR25 100 /* offsetof(struct pt_regs, gr[25]) */
 171.161 -+#define PT_GR26 104 /* offsetof(struct pt_regs, gr[26]) */
 171.162 -+#define PT_GR27 108 /* offsetof(struct pt_regs, gr[27]) */
 171.163 -+#define PT_GR28 112 /* offsetof(struct pt_regs, gr[28]) */
 171.164 -+#define PT_GR29 116 /* offsetof(struct pt_regs, gr[29]) */
 171.165 -+#define PT_GR30 120 /* offsetof(struct pt_regs, gr[30]) */
 171.166 -+#define PT_GR31 124 /* offsetof(struct pt_regs, gr[31]) */
 171.167 -+#define PT_FR0 128 /* offsetof(struct pt_regs, fr[ 0]) */
 171.168 -+#define PT_FR1 136 /* offsetof(struct pt_regs, fr[ 1]) */
 171.169 -+#define PT_FR2 144 /* offsetof(struct pt_regs, fr[ 2]) */
 171.170 -+#define PT_FR3 152 /* offsetof(struct pt_regs, fr[ 3]) */
 171.171 -+#define PT_FR4 160 /* offsetof(struct pt_regs, fr[ 4]) */
 171.172 -+#define PT_FR5 168 /* offsetof(struct pt_regs, fr[ 5]) */
 171.173 -+#define PT_FR6 176 /* offsetof(struct pt_regs, fr[ 6]) */
 171.174 -+#define PT_FR7 184 /* offsetof(struct pt_regs, fr[ 7]) */
 171.175 -+#define PT_FR8 192 /* offsetof(struct pt_regs, fr[ 8]) */
 171.176 -+#define PT_FR9 200 /* offsetof(struct pt_regs, fr[ 9]) */
 171.177 -+#define PT_FR10 208 /* offsetof(struct pt_regs, fr[10]) */
 171.178 -+#define PT_FR11 216 /* offsetof(struct pt_regs, fr[11]) */
 171.179 -+#define PT_FR12 224 /* offsetof(struct pt_regs, fr[12]) */
 171.180 -+#define PT_FR13 232 /* offsetof(struct pt_regs, fr[13]) */
 171.181 -+#define PT_FR14 240 /* offsetof(struct pt_regs, fr[14]) */
 171.182 -+#define PT_FR15 248 /* offsetof(struct pt_regs, fr[15]) */
 171.183 -+#define PT_FR16 256 /* offsetof(struct pt_regs, fr[16]) */
 171.184 -+#define PT_FR17 264 /* offsetof(struct pt_regs, fr[17]) */
 171.185 -+#define PT_FR18 272 /* offsetof(struct pt_regs, fr[18]) */
 171.186 -+#define PT_FR19 280 /* offsetof(struct pt_regs, fr[19]) */
 171.187 -+#define PT_FR20 288 /* offsetof(struct pt_regs, fr[20]) */
 171.188 -+#define PT_FR21 296 /* offsetof(struct pt_regs, fr[21]) */
 171.189 -+#define PT_FR22 304 /* offsetof(struct pt_regs, fr[22]) */
 171.190 -+#define PT_FR23 312 /* offsetof(struct pt_regs, fr[23]) */
 171.191 -+#define PT_FR24 320 /* offsetof(struct pt_regs, fr[24]) */
 171.192 -+#define PT_FR25 328 /* offsetof(struct pt_regs, fr[25]) */
 171.193 -+#define PT_FR26 336 /* offsetof(struct pt_regs, fr[26]) */
 171.194 -+#define PT_FR27 344 /* offsetof(struct pt_regs, fr[27]) */
 171.195 -+#define PT_FR28 352 /* offsetof(struct pt_regs, fr[28]) */
 171.196 -+#define PT_FR29 360 /* offsetof(struct pt_regs, fr[29]) */
 171.197 -+#define PT_FR30 368 /* offsetof(struct pt_regs, fr[30]) */
 171.198 -+#define PT_FR31 376 /* offsetof(struct pt_regs, fr[31]) */
 171.199 -+#define PT_SR0 384 /* offsetof(struct pt_regs, sr[ 0]) */
 171.200 -+#define PT_SR1 388 /* offsetof(struct pt_regs, sr[ 1]) */
 171.201 -+#define PT_SR2 392 /* offsetof(struct pt_regs, sr[ 2]) */
 171.202 -+#define PT_SR3 396 /* offsetof(struct pt_regs, sr[ 3]) */
 171.203 -+#define PT_SR4 400 /* offsetof(struct pt_regs, sr[ 4]) */
 171.204 -+#define PT_SR5 404 /* offsetof(struct pt_regs, sr[ 5]) */
 171.205 -+#define PT_SR6 408 /* offsetof(struct pt_regs, sr[ 6]) */
 171.206 -+#define PT_SR7 412 /* offsetof(struct pt_regs, sr[ 7]) */
 171.207 -+#define PT_IASQ0 416 /* offsetof(struct pt_regs, iasq[0]) */
 171.208 -+#define PT_IASQ1 420 /* offsetof(struct pt_regs, iasq[1]) */
 171.209 -+#define PT_IAOQ0 424 /* offsetof(struct pt_regs, iaoq[0]) */
 171.210 -+#define PT_IAOQ1 428 /* offsetof(struct pt_regs, iaoq[1]) */
 171.211 -+#define PT_CR27 432 /* offsetof(struct pt_regs, cr27) */
 171.212 -+#define PT_ORIG_R28 440 /* offsetof(struct pt_regs, orig_r28) */
 171.213 -+#define PT_KSP 444 /* offsetof(struct pt_regs, ksp) */
 171.214 -+#define PT_KPC 448 /* offsetof(struct pt_regs, kpc) */
 171.215 -+#define PT_SAR 452 /* offsetof(struct pt_regs, sar) */
 171.216 -+#define PT_IIR 456 /* offsetof(struct pt_regs, iir) */
 171.217 -+#define PT_ISR 460 /* offsetof(struct pt_regs, isr) */
 171.218 -+#define PT_IOR 464 /* offsetof(struct pt_regs, ior) */
 171.219 -+#define PT_SIZE 472 /* sizeof(struct pt_regs) */
 171.220 -+#define PT_SZ_ALGN 576 /* align(sizeof(struct pt_regs), 64) */
 171.221 -+
 171.222 -+#define TI_TASK 0 /* offsetof(struct thread_info, task) */
 171.223 -+#define TI_EXEC_DOMAIN 4 /* offsetof(struct thread_info, exec_domain) */
 171.224 -+#define TI_FLAGS 8 /* offsetof(struct thread_info, flags) */
 171.225 -+#define TI_CPU 16 /* offsetof(struct thread_info, cpu) */
 171.226 -+#define TI_SEGMENT 12 /* offsetof(struct thread_info, addr_limit) */
 171.227 -+#define TI_PRE_COUNT 20 /* offsetof(struct thread_info, preempt_count) */
 171.228 -+#define THREAD_SZ 44 /* sizeof(struct thread_info) */
 171.229 -+#define THREAD_SZ_ALGN 128 /* align(sizeof(struct thread_info), 64) */
 171.230 -+
 171.231 -+#define IRQSTAT_SIRQ_PEND 0 /* offsetof(irq_cpustat_t, __softirq_pending) */
 171.232 -+#define IRQSTAT_SZ 64 /* sizeof(irq_cpustat_t) */
 171.233 -+
 171.234 -+#define ICACHE_BASE 8 /* offsetof(struct pdc_cache_info, ic_base) */
 171.235 -+#define ICACHE_STRIDE 12 /* offsetof(struct pdc_cache_info, ic_stride) */
 171.236 -+#define ICACHE_COUNT 16 /* offsetof(struct pdc_cache_info, ic_count) */
 171.237 -+#define ICACHE_LOOP 20 /* offsetof(struct pdc_cache_info, ic_loop) */
 171.238 -+#define DCACHE_BASE 32 /* offsetof(struct pdc_cache_info, dc_base) */
 171.239 -+#define DCACHE_STRIDE 36 /* offsetof(struct pdc_cache_info, dc_stride) */
 171.240 -+#define DCACHE_COUNT 40 /* offsetof(struct pdc_cache_info, dc_count) */
 171.241 -+#define DCACHE_LOOP 44 /* offsetof(struct pdc_cache_info, dc_loop) */
 171.242 -+#define ITLB_SID_BASE 56 /* offsetof(struct pdc_cache_info, it_sp_base) */
 171.243 -+#define ITLB_SID_STRIDE 60 /* offsetof(struct pdc_cache_info, it_sp_stride) */
 171.244 -+#define ITLB_SID_COUNT 64 /* offsetof(struct pdc_cache_info, it_sp_count) */
 171.245 -+#define ITLB_OFF_BASE 68 /* offsetof(struct pdc_cache_info, it_off_base) */
 171.246 -+#define ITLB_OFF_STRIDE 72 /* offsetof(struct pdc_cache_info, it_off_stride) */
 171.247 -+#define ITLB_OFF_COUNT 76 /* offsetof(struct pdc_cache_info, it_off_count) */
 171.248 -+#define ITLB_LOOP 80 /* offsetof(struct pdc_cache_info, it_loop) */
 171.249 -+#define DTLB_SID_BASE 92 /* offsetof(struct pdc_cache_info, dt_sp_base) */
 171.250 -+#define DTLB_SID_STRIDE 96 /* offsetof(struct pdc_cache_info, dt_sp_stride) */
 171.251 -+#define DTLB_SID_COUNT 100 /* offsetof(struct pdc_cache_info, dt_sp_count) */
 171.252 -+#define DTLB_OFF_BASE 104 /* offsetof(struct pdc_cache_info, dt_off_base) */
 171.253 -+#define DTLB_OFF_STRIDE 108 /* offsetof(struct pdc_cache_info, dt_off_stride) */
 171.254 -+#define DTLB_OFF_COUNT 112 /* offsetof(struct pdc_cache_info, dt_off_count) */
 171.255 -+#define DTLB_LOOP 116 /* offsetof(struct pdc_cache_info, dt_loop) */
 171.256 -+
 171.257 -+#define PA_BLOCKSTEP_BIT 1 /* 31-PT_BLOCKSTEP_BIT */
 171.258 -+#define PA_SINGLESTEP_BIT 0 /* 31-PT_SINGLESTEP_BIT */
 171.259 -+
 171.260 -+#define ASM_PMD_SHIFT 21 /* PMD_SHIFT */
 171.261 -+#define ASM_PGDIR_SHIFT 21 /* PGDIR_SHIFT */
 171.262 -+#define ASM_BITS_PER_PGD 11 /* BITS_PER_PGD */
 171.263 -+#define ASM_BITS_PER_PMD 0 /* BITS_PER_PMD */
 171.264 -+#define ASM_BITS_PER_PTE 9 /* BITS_PER_PTE */
 171.265 -+#define ASM_PGD_PMD_OFFSET -8192 /* -(PAGE_SIZE << PGD_ORDER) */
 171.266 -+#define ASM_PMD_ENTRY 128 /* ((PAGE_OFFSET & PMD_MASK) >> PMD_SHIFT) */
 171.267 -+#define ASM_PGD_ENTRY 128 /* PAGE_OFFSET >> PGDIR_SHIFT */
 171.268 -+#define ASM_PGD_ENTRY_SIZE 4 /* PGD_ENTRY_SIZE */
 171.269 -+#define ASM_PMD_ENTRY_SIZE 4 /* PMD_ENTRY_SIZE */
 171.270 -+#define ASM_PTE_ENTRY_SIZE 8 /* PTE_ENTRY_SIZE */
 171.271 -+#define ASM_PT_INITIAL 4 /* PT_INITIAL */
 171.272 -+#define ASM_PAGE_SIZE 4096 /* PAGE_SIZE */
 171.273 -+
 171.274 -+
 171.275 -+#endif
   172.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   172.2 +++ b/patches/gdb/6.7/125-hppa-offsets.patch	Mon Jul 28 21:08:01 2008 +0000
   172.3 @@ -0,0 +1,272 @@
   172.4 +Original patch from gentoo: gentoo/src/patchsets/gdb/6.7/45_all_gdb-hppa-offsets.patch
   172.5 +-= BEGIN original header =-
   172.6 +sanitized headers dont include asm/offsets.h, so cache a local copy 
   172.7 +
   172.8 +http://bugs.gentoo.org/180476
   172.9 +http://lists.parisc-linux.org/pipermail/parisc-linux/2007-February/031162.html
  172.10 +
  172.11 +-= END original header =-
  172.12 +diff -durN gdb-6.7.orig/gdb/hppa-linux-nat.c gdb-6.7/gdb/hppa-linux-nat.c
  172.13 +--- gdb-6.7.orig/gdb/hppa-linux-nat.c	2007-08-23 20:08:33.000000000 +0200
  172.14 ++++ gdb-6.7/gdb/hppa-linux-nat.c	2008-06-17 23:25:28.000000000 +0200
  172.15 +@@ -32,7 +32,7 @@
  172.16 + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,43)
  172.17 + #include <asm/offset.h>
  172.18 + #else
  172.19 +-#include <asm/offsets.h>
  172.20 ++#include <hppa-offsets.h>
  172.21 + #endif
  172.22 + 
  172.23 + #include "hppa-tdep.h"
  172.24 +diff -durN gdb-6.7.orig/gdb/hppa-offsets.h gdb-6.7/gdb/hppa-offsets.h
  172.25 +--- gdb-6.7.orig/gdb/hppa-offsets.h	1970-01-01 01:00:00.000000000 +0100
  172.26 ++++ gdb-6.7/gdb/hppa-offsets.h	2008-06-17 23:25:28.000000000 +0200
  172.27 +@@ -0,0 +1,248 @@
  172.28 ++#ifndef __ASM_OFFSETS_H__
  172.29 ++#define __ASM_OFFSETS_H__
  172.30 ++/*
  172.31 ++ * DO NOT MODIFY.
  172.32 ++ *
  172.33 ++ * This file was generated by arch/parisc/Makefile
  172.34 ++ *
  172.35 ++ */
  172.36 ++
  172.37 ++#define TASK_THREAD_INFO 4 /* offsetof(struct task_struct, thread_info) */
  172.38 ++#define TASK_STATE 0 /* offsetof(struct task_struct, state) */
  172.39 ++#define TASK_FLAGS 12 /* offsetof(struct task_struct, flags) */
  172.40 ++#define TASK_SIGPENDING 1188 /* offsetof(struct task_struct, pending) */
  172.41 ++#define TASK_PTRACE 16 /* offsetof(struct task_struct, ptrace) */
  172.42 ++#define TASK_MM 108 /* offsetof(struct task_struct, mm) */
  172.43 ++#define TASK_PERSONALITY 132 /* offsetof(struct task_struct, personality) */
  172.44 ++#define TASK_PID 140 /* offsetof(struct task_struct, pid) */
  172.45 ++
  172.46 ++#define TASK_REGS 664 /* offsetof(struct task_struct, thread.regs) */
  172.47 ++#define TASK_PT_PSW 664 /* offsetof(struct task_struct, thread.regs.gr[ 0]) */
  172.48 ++#define TASK_PT_GR1 668 /* offsetof(struct task_struct, thread.regs.gr[ 1]) */
  172.49 ++#define TASK_PT_GR2 672 /* offsetof(struct task_struct, thread.regs.gr[ 2]) */
  172.50 ++#define TASK_PT_GR3 676 /* offsetof(struct task_struct, thread.regs.gr[ 3]) */
  172.51 ++#define TASK_PT_GR4 680 /* offsetof(struct task_struct, thread.regs.gr[ 4]) */
  172.52 ++#define TASK_PT_GR5 684 /* offsetof(struct task_struct, thread.regs.gr[ 5]) */
  172.53 ++#define TASK_PT_GR6 688 /* offsetof(struct task_struct, thread.regs.gr[ 6]) */
  172.54 ++#define TASK_PT_GR7 692 /* offsetof(struct task_struct, thread.regs.gr[ 7]) */
  172.55 ++#define TASK_PT_GR8 696 /* offsetof(struct task_struct, thread.regs.gr[ 8]) */
  172.56 ++#define TASK_PT_GR9 700 /* offsetof(struct task_struct, thread.regs.gr[ 9]) */
  172.57 ++#define TASK_PT_GR10 704 /* offsetof(struct task_struct, thread.regs.gr[10]) */
  172.58 ++#define TASK_PT_GR11 708 /* offsetof(struct task_struct, thread.regs.gr[11]) */
  172.59 ++#define TASK_PT_GR12 712 /* offsetof(struct task_struct, thread.regs.gr[12]) */
  172.60 ++#define TASK_PT_GR13 716 /* offsetof(struct task_struct, thread.regs.gr[13]) */
  172.61 ++#define TASK_PT_GR14 720 /* offsetof(struct task_struct, thread.regs.gr[14]) */
  172.62 ++#define TASK_PT_GR15 724 /* offsetof(struct task_struct, thread.regs.gr[15]) */
  172.63 ++#define TASK_PT_GR16 728 /* offsetof(struct task_struct, thread.regs.gr[16]) */
  172.64 ++#define TASK_PT_GR17 732 /* offsetof(struct task_struct, thread.regs.gr[17]) */
  172.65 ++#define TASK_PT_GR18 736 /* offsetof(struct task_struct, thread.regs.gr[18]) */
  172.66 ++#define TASK_PT_GR19 740 /* offsetof(struct task_struct, thread.regs.gr[19]) */
  172.67 ++#define TASK_PT_GR20 744 /* offsetof(struct task_struct, thread.regs.gr[20]) */
  172.68 ++#define TASK_PT_GR21 748 /* offsetof(struct task_struct, thread.regs.gr[21]) */
  172.69 ++#define TASK_PT_GR22 752 /* offsetof(struct task_struct, thread.regs.gr[22]) */
  172.70 ++#define TASK_PT_GR23 756 /* offsetof(struct task_struct, thread.regs.gr[23]) */
  172.71 ++#define TASK_PT_GR24 760 /* offsetof(struct task_struct, thread.regs.gr[24]) */
  172.72 ++#define TASK_PT_GR25 764 /* offsetof(struct task_struct, thread.regs.gr[25]) */
  172.73 ++#define TASK_PT_GR26 768 /* offsetof(struct task_struct, thread.regs.gr[26]) */
  172.74 ++#define TASK_PT_GR27 772 /* offsetof(struct task_struct, thread.regs.gr[27]) */
  172.75 ++#define TASK_PT_GR28 776 /* offsetof(struct task_struct, thread.regs.gr[28]) */
  172.76 ++#define TASK_PT_GR29 780 /* offsetof(struct task_struct, thread.regs.gr[29]) */
  172.77 ++#define TASK_PT_GR30 784 /* offsetof(struct task_struct, thread.regs.gr[30]) */
  172.78 ++#define TASK_PT_GR31 788 /* offsetof(struct task_struct, thread.regs.gr[31]) */
  172.79 ++#define TASK_PT_FR0 792 /* offsetof(struct task_struct, thread.regs.fr[ 0]) */
  172.80 ++#define TASK_PT_FR1 800 /* offsetof(struct task_struct, thread.regs.fr[ 1]) */
  172.81 ++#define TASK_PT_FR2 808 /* offsetof(struct task_struct, thread.regs.fr[ 2]) */
  172.82 ++#define TASK_PT_FR3 816 /* offsetof(struct task_struct, thread.regs.fr[ 3]) */
  172.83 ++#define TASK_PT_FR4 824 /* offsetof(struct task_struct, thread.regs.fr[ 4]) */
  172.84 ++#define TASK_PT_FR5 832 /* offsetof(struct task_struct, thread.regs.fr[ 5]) */
  172.85 ++#define TASK_PT_FR6 840 /* offsetof(struct task_struct, thread.regs.fr[ 6]) */
  172.86 ++#define TASK_PT_FR7 848 /* offsetof(struct task_struct, thread.regs.fr[ 7]) */
  172.87 ++#define TASK_PT_FR8 856 /* offsetof(struct task_struct, thread.regs.fr[ 8]) */
  172.88 ++#define TASK_PT_FR9 864 /* offsetof(struct task_struct, thread.regs.fr[ 9]) */
  172.89 ++#define TASK_PT_FR10 872 /* offsetof(struct task_struct, thread.regs.fr[10]) */
  172.90 ++#define TASK_PT_FR11 880 /* offsetof(struct task_struct, thread.regs.fr[11]) */
  172.91 ++#define TASK_PT_FR12 888 /* offsetof(struct task_struct, thread.regs.fr[12]) */
  172.92 ++#define TASK_PT_FR13 896 /* offsetof(struct task_struct, thread.regs.fr[13]) */
  172.93 ++#define TASK_PT_FR14 904 /* offsetof(struct task_struct, thread.regs.fr[14]) */
  172.94 ++#define TASK_PT_FR15 912 /* offsetof(struct task_struct, thread.regs.fr[15]) */
  172.95 ++#define TASK_PT_FR16 920 /* offsetof(struct task_struct, thread.regs.fr[16]) */
  172.96 ++#define TASK_PT_FR17 928 /* offsetof(struct task_struct, thread.regs.fr[17]) */
  172.97 ++#define TASK_PT_FR18 936 /* offsetof(struct task_struct, thread.regs.fr[18]) */
  172.98 ++#define TASK_PT_FR19 944 /* offsetof(struct task_struct, thread.regs.fr[19]) */
  172.99 ++#define TASK_PT_FR20 952 /* offsetof(struct task_struct, thread.regs.fr[20]) */
 172.100 ++#define TASK_PT_FR21 960 /* offsetof(struct task_struct, thread.regs.fr[21]) */
 172.101 ++#define TASK_PT_FR22 968 /* offsetof(struct task_struct, thread.regs.fr[22]) */
 172.102 ++#define TASK_PT_FR23 976 /* offsetof(struct task_struct, thread.regs.fr[23]) */
 172.103 ++#define TASK_PT_FR24 984 /* offsetof(struct task_struct, thread.regs.fr[24]) */
 172.104 ++#define TASK_PT_FR25 992 /* offsetof(struct task_struct, thread.regs.fr[25]) */
 172.105 ++#define TASK_PT_FR26 1000 /* offsetof(struct task_struct, thread.regs.fr[26]) */
 172.106 ++#define TASK_PT_FR27 1008 /* offsetof(struct task_struct, thread.regs.fr[27]) */
 172.107 ++#define TASK_PT_FR28 1016 /* offsetof(struct task_struct, thread.regs.fr[28]) */
 172.108 ++#define TASK_PT_FR29 1024 /* offsetof(struct task_struct, thread.regs.fr[29]) */
 172.109 ++#define TASK_PT_FR30 1032 /* offsetof(struct task_struct, thread.regs.fr[30]) */
 172.110 ++#define TASK_PT_FR31 1040 /* offsetof(struct task_struct, thread.regs.fr[31]) */
 172.111 ++#define TASK_PT_SR0 1048 /* offsetof(struct task_struct, thread.regs.sr[ 0]) */
 172.112 ++#define TASK_PT_SR1 1052 /* offsetof(struct task_struct, thread.regs.sr[ 1]) */
 172.113 ++#define TASK_PT_SR2 1056 /* offsetof(struct task_struct, thread.regs.sr[ 2]) */
 172.114 ++#define TASK_PT_SR3 1060 /* offsetof(struct task_struct, thread.regs.sr[ 3]) */
 172.115 ++#define TASK_PT_SR4 1064 /* offsetof(struct task_struct, thread.regs.sr[ 4]) */
 172.116 ++#define TASK_PT_SR5 1068 /* offsetof(struct task_struct, thread.regs.sr[ 5]) */
 172.117 ++#define TASK_PT_SR6 1072 /* offsetof(struct task_struct, thread.regs.sr[ 6]) */
 172.118 ++#define TASK_PT_SR7 1076 /* offsetof(struct task_struct, thread.regs.sr[ 7]) */
 172.119 ++#define TASK_PT_IASQ0 1080 /* offsetof(struct task_struct, thread.regs.iasq[0]) */
 172.120 ++#define TASK_PT_IASQ1 1084 /* offsetof(struct task_struct, thread.regs.iasq[1]) */
 172.121 ++#define TASK_PT_IAOQ0 1088 /* offsetof(struct task_struct, thread.regs.iaoq[0]) */
 172.122 ++#define TASK_PT_IAOQ1 1092 /* offsetof(struct task_struct, thread.regs.iaoq[1]) */
 172.123 ++#define TASK_PT_CR27 1096 /* offsetof(struct task_struct, thread.regs.cr27) */
 172.124 ++#define TASK_PT_ORIG_R28 1104 /* offsetof(struct task_struct, thread.regs.orig_r28) */
 172.125 ++#define TASK_PT_KSP 1108 /* offsetof(struct task_struct, thread.regs.ksp) */
 172.126 ++#define TASK_PT_KPC 1112 /* offsetof(struct task_struct, thread.regs.kpc) */
 172.127 ++#define TASK_PT_SAR 1116 /* offsetof(struct task_struct, thread.regs.sar) */
 172.128 ++#define TASK_PT_IIR 1120 /* offsetof(struct task_struct, thread.regs.iir) */
 172.129 ++#define TASK_PT_ISR 1124 /* offsetof(struct task_struct, thread.regs.isr) */
 172.130 ++#define TASK_PT_IOR 1128 /* offsetof(struct task_struct, thread.regs.ior) */
 172.131 ++
 172.132 ++#define TASK_SZ 1272 /* sizeof(struct task_struct) */
 172.133 ++#define TASK_SZ_ALGN 1344 /* align(sizeof(struct task_struct), 64) */
 172.134 ++
 172.135 ++#define PT_PSW 0 /* offsetof(struct pt_regs, gr[ 0]) */
 172.136 ++#define PT_GR1 4 /* offsetof(struct pt_regs, gr[ 1]) */
 172.137 ++#define PT_GR2 8 /* offsetof(struct pt_regs, gr[ 2]) */
 172.138 ++#define PT_GR3 12 /* offsetof(struct pt_regs, gr[ 3]) */
 172.139 ++#define PT_GR4 16 /* offsetof(struct pt_regs, gr[ 4]) */
 172.140 ++#define PT_GR5 20 /* offsetof(struct pt_regs, gr[ 5]) */
 172.141 ++#define PT_GR6 24 /* offsetof(struct pt_regs, gr[ 6]) */
 172.142 ++#define PT_GR7 28 /* offsetof(struct pt_regs, gr[ 7]) */
 172.143 ++#define PT_GR8 32 /* offsetof(struct pt_regs, gr[ 8]) */
 172.144 ++#define PT_GR9 36 /* offsetof(struct pt_regs, gr[ 9]) */
 172.145 ++#define PT_GR10 40 /* offsetof(struct pt_regs, gr[10]) */
 172.146 ++#define PT_GR11 44 /* offsetof(struct pt_regs, gr[11]) */
 172.147 ++#define PT_GR12 48 /* offsetof(struct pt_regs, gr[12]) */
 172.148 ++#define PT_GR13 52 /* offsetof(struct pt_regs, gr[13]) */
 172.149 ++#define PT_GR14 56 /* offsetof(struct pt_regs, gr[14]) */
 172.150 ++#define PT_GR15 60 /* offsetof(struct pt_regs, gr[15]) */
 172.151 ++#define PT_GR16 64 /* offsetof(struct pt_regs, gr[16]) */
 172.152 ++#define PT_GR17 68 /* offsetof(struct pt_regs, gr[17]) */
 172.153 ++#define PT_GR18 72 /* offsetof(struct pt_regs, gr[18]) */
 172.154 ++#define PT_GR19 76 /* offsetof(struct pt_regs, gr[19]) */
 172.155 ++#define PT_GR20 80 /* offsetof(struct pt_regs, gr[20]) */
 172.156 ++#define PT_GR21 84 /* offsetof(struct pt_regs, gr[21]) */
 172.157 ++#define PT_GR22 88 /* offsetof(struct pt_regs, gr[22]) */
 172.158 ++#define PT_GR23 92 /* offsetof(struct pt_regs, gr[23]) */
 172.159 ++#define PT_GR24 96 /* offsetof(struct pt_regs, gr[24]) */
 172.160 ++#define PT_GR25 100 /* offsetof(struct pt_regs, gr[25]) */
 172.161 ++#define PT_GR26 104 /* offsetof(struct pt_regs, gr[26]) */
 172.162 ++#define PT_GR27 108 /* offsetof(struct pt_regs, gr[27]) */
 172.163 ++#define PT_GR28 112 /* offsetof(struct pt_regs, gr[28]) */
 172.164 ++#define PT_GR29 116 /* offsetof(struct pt_regs, gr[29]) */
 172.165 ++#define PT_GR30 120 /* offsetof(struct pt_regs, gr[30]) */
 172.166 ++#define PT_GR31 124 /* offsetof(struct pt_regs, gr[31]) */
 172.167 ++#define PT_FR0 128 /* offsetof(struct pt_regs, fr[ 0]) */
 172.168 ++#define PT_FR1 136 /* offsetof(struct pt_regs, fr[ 1]) */
 172.169 ++#define PT_FR2 144 /* offsetof(struct pt_regs, fr[ 2]) */
 172.170 ++#define PT_FR3 152 /* offsetof(struct pt_regs, fr[ 3]) */
 172.171 ++#define PT_FR4 160 /* offsetof(struct pt_regs, fr[ 4]) */
 172.172 ++#define PT_FR5 168 /* offsetof(struct pt_regs, fr[ 5]) */
 172.173 ++#define PT_FR6 176 /* offsetof(struct pt_regs, fr[ 6]) */
 172.174 ++#define PT_FR7 184 /* offsetof(struct pt_regs, fr[ 7]) */
 172.175 ++#define PT_FR8 192 /* offsetof(struct pt_regs, fr[ 8]) */
 172.176 ++#define PT_FR9 200 /* offsetof(struct pt_regs, fr[ 9]) */
 172.177 ++#define PT_FR10 208 /* offsetof(struct pt_regs, fr[10]) */
 172.178 ++#define PT_FR11 216 /* offsetof(struct pt_regs, fr[11]) */
 172.179 ++#define PT_FR12 224 /* offsetof(struct pt_regs, fr[12]) */
 172.180 ++#define PT_FR13 232 /* offsetof(struct pt_regs, fr[13]) */
 172.181 ++#define PT_FR14 240 /* offsetof(struct pt_regs, fr[14]) */
 172.182 ++#define PT_FR15 248 /* offsetof(struct pt_regs, fr[15]) */
 172.183 ++#define PT_FR16 256 /* offsetof(struct pt_regs, fr[16]) */
 172.184 ++#define PT_FR17 264 /* offsetof(struct pt_regs, fr[17]) */
 172.185 ++#define PT_FR18 272 /* offsetof(struct pt_regs, fr[18]) */
 172.186 ++#define PT_FR19 280 /* offsetof(struct pt_regs, fr[19]) */
 172.187 ++#define PT_FR20 288 /* offsetof(struct pt_regs, fr[20]) */
 172.188 ++#define PT_FR21 296 /* offsetof(struct pt_regs, fr[21]) */
 172.189 ++#define PT_FR22 304 /* offsetof(struct pt_regs, fr[22]) */
 172.190 ++#define PT_FR23 312 /* offsetof(struct pt_regs, fr[23]) */
 172.191 ++#define PT_FR24 320 /* offsetof(struct pt_regs, fr[24]) */
 172.192 ++#define PT_FR25 328 /* offsetof(struct pt_regs, fr[25]) */
 172.193 ++#define PT_FR26 336 /* offsetof(struct pt_regs, fr[26]) */
 172.194 ++#define PT_FR27 344 /* offsetof(struct pt_regs, fr[27]) */
 172.195 ++#define PT_FR28 352 /* offsetof(struct pt_regs, fr[28]) */
 172.196 ++#define PT_FR29 360 /* offsetof(struct pt_regs, fr[29]) */
 172.197 ++#define PT_FR30 368 /* offsetof(struct pt_regs, fr[30]) */
 172.198 ++#define PT_FR31 376 /* offsetof(struct pt_regs, fr[31]) */
 172.199 ++#define PT_SR0 384 /* offsetof(struct pt_regs, sr[ 0]) */
 172.200 ++#define PT_SR1 388 /* offsetof(struct pt_regs, sr[ 1]) */
 172.201 ++#define PT_SR2 392 /* offsetof(struct pt_regs, sr[ 2]) */
 172.202 ++#define PT_SR3 396 /* offsetof(struct pt_regs, sr[ 3]) */
 172.203 ++#define PT_SR4 400 /* offsetof(struct pt_regs, sr[ 4]) */
 172.204 ++#define PT_SR5 404 /* offsetof(struct pt_regs, sr[ 5]) */
 172.205 ++#define PT_SR6 408 /* offsetof(struct pt_regs, sr[ 6]) */
 172.206 ++#define PT_SR7 412 /* offsetof(struct pt_regs, sr[ 7]) */
 172.207 ++#define PT_IASQ0 416 /* offsetof(struct pt_regs, iasq[0]) */
 172.208 ++#define PT_IASQ1 420 /* offsetof(struct pt_regs, iasq[1]) */
 172.209 ++#define PT_IAOQ0 424 /* offsetof(struct pt_regs, iaoq[0]) */
 172.210 ++#define PT_IAOQ1 428 /* offsetof(struct pt_regs, iaoq[1]) */
 172.211 ++#define PT_CR27 432 /* offsetof(struct pt_regs, cr27) */
 172.212 ++#define PT_ORIG_R28 440 /* offsetof(struct pt_regs, orig_r28) */
 172.213 ++#define PT_KSP 444 /* offsetof(struct pt_regs, ksp) */
 172.214 ++#define PT_KPC 448 /* offsetof(struct pt_regs, kpc) */
 172.215 ++#define PT_SAR 452 /* offsetof(struct pt_regs, sar) */
 172.216 ++#define PT_IIR 456 /* offsetof(struct pt_regs, iir) */
 172.217 ++#define PT_ISR 460 /* offsetof(struct pt_regs, isr) */
 172.218 ++#define PT_IOR 464 /* offsetof(struct pt_regs, ior) */
 172.219 ++#define PT_SIZE 472 /* sizeof(struct pt_regs) */
 172.220 ++#define PT_SZ_ALGN 576 /* align(sizeof(struct pt_regs), 64) */
 172.221 ++
 172.222 ++#define TI_TASK 0 /* offsetof(struct thread_info, task) */
 172.223 ++#define TI_EXEC_DOMAIN 4 /* offsetof(struct thread_info, exec_domain) */
 172.224 ++#define TI_FLAGS 8 /* offsetof(struct thread_info, flags) */
 172.225 ++#define TI_CPU 16 /* offsetof(struct thread_info, cpu) */
 172.226 ++#define TI_SEGMENT 12 /* offsetof(struct thread_info, addr_limit) */
 172.227 ++#define TI_PRE_COUNT 20 /* offsetof(struct thread_info, preempt_count) */
 172.228 ++#define THREAD_SZ 44 /* sizeof(struct thread_info) */
 172.229 ++#define THREAD_SZ_ALGN 128 /* align(sizeof(struct thread_info), 64) */
 172.230 ++
 172.231 ++#define IRQSTAT_SIRQ_PEND 0 /* offsetof(irq_cpustat_t, __softirq_pending) */
 172.232 ++#define IRQSTAT_SZ 64 /* sizeof(irq_cpustat_t) */
 172.233 ++
 172.234 ++#define ICACHE_BASE 8 /* offsetof(struct pdc_cache_info, ic_base) */
 172.235 ++#define ICACHE_STRIDE 12 /* offsetof(struct pdc_cache_info, ic_stride) */
 172.236 ++#define ICACHE_COUNT 16 /* offsetof(struct pdc_cache_info, ic_count) */
 172.237 ++#define ICACHE_LOOP 20 /* offsetof(struct pdc_cache_info, ic_loop) */
 172.238 ++#define DCACHE_BASE 32 /* offsetof(struct pdc_cache_info, dc_base) */
 172.239 ++#define DCACHE_STRIDE 36 /* offsetof(struct pdc_cache_info, dc_stride) */
 172.240 ++#define DCACHE_COUNT 40 /* offsetof(struct pdc_cache_info, dc_count) */
 172.241 ++#define DCACHE_LOOP 44 /* offsetof(struct pdc_cache_info, dc_loop) */
 172.242 ++#define ITLB_SID_BASE 56 /* offsetof(struct pdc_cache_info, it_sp_base) */
 172.243 ++#define ITLB_SID_STRIDE 60 /* offsetof(struct pdc_cache_info, it_sp_stride) */
 172.244 ++#define ITLB_SID_COUNT 64 /* offsetof(struct pdc_cache_info, it_sp_count) */
 172.245 ++#define ITLB_OFF_BASE 68 /* offsetof(struct pdc_cache_info, it_off_base) */
 172.246 ++#define ITLB_OFF_STRIDE 72 /* offsetof(struct pdc_cache_info, it_off_stride) */
 172.247 ++#define ITLB_OFF_COUNT 76 /* offsetof(struct pdc_cache_info, it_off_count) */
 172.248 ++#define ITLB_LOOP 80 /* offsetof(struct pdc_cache_info, it_loop) */
 172.249 ++#define DTLB_SID_BASE 92 /* offsetof(struct pdc_cache_info, dt_sp_base) */
 172.250 ++#define DTLB_SID_STRIDE 96 /* offsetof(struct pdc_cache_info, dt_sp_stride) */
 172.251 ++#define DTLB_SID_COUNT 100 /* offsetof(struct pdc_cache_info, dt_sp_count) */
 172.252 ++#define DTLB_OFF_BASE 104 /* offsetof(struct pdc_cache_info, dt_off_base) */
 172.253 ++#define DTLB_OFF_STRIDE 108 /* offsetof(struct pdc_cache_info, dt_off_stride) */
 172.254 ++#define DTLB_OFF_COUNT 112 /* offsetof(struct pdc_cache_info, dt_off_count) */
 172.255 ++#define DTLB_LOOP 116 /* offsetof(struct pdc_cache_info, dt_loop) */
 172.256 ++
 172.257 ++#define PA_BLOCKSTEP_BIT 1 /* 31-PT_BLOCKSTEP_BIT */
 172.258 ++#define PA_SINGLESTEP_BIT 0 /* 31-PT_SINGLESTEP_BIT */
 172.259 ++
 172.260 ++#define ASM_PMD_SHIFT 21 /* PMD_SHIFT */
 172.261 ++#define ASM_PGDIR_SHIFT 21 /* PGDIR_SHIFT */
 172.262 ++#define ASM_BITS_PER_PGD 11 /* BITS_PER_PGD */
 172.263 ++#define ASM_BITS_PER_PMD 0 /* BITS_PER_PMD */
 172.264 ++#define ASM_BITS_PER_PTE 9 /* BITS_PER_PTE */
 172.265 ++#define ASM_PGD_PMD_OFFSET -8192 /* -(PAGE_SIZE << PGD_ORDER) */
 172.266 ++#define ASM_PMD_ENTRY 128 /* ((PAGE_OFFSET & PMD_MASK) >> PMD_SHIFT) */
 172.267 ++#define ASM_PGD_ENTRY 128 /* PAGE_OFFSET >> PGDIR_SHIFT */
 172.268 ++#define ASM_PGD_ENTRY_SIZE 4 /* PGD_ENTRY_SIZE */
 172.269 ++#define ASM_PMD_ENTRY_SIZE 4 /* PMD_ENTRY_SIZE */
 172.270 ++#define ASM_PTE_ENTRY_SIZE 8 /* PTE_ENTRY_SIZE */
 172.271 ++#define ASM_PT_INITIAL 4 /* PT_INITIAL */
 172.272 ++#define ASM_PAGE_SIZE 4096 /* PAGE_SIZE */
 172.273 ++
 172.274 ++
 172.275 ++#endif
   173.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   173.2 +++ b/patches/gdb/6.7/150-dwarf-stack-overflow.patch	Mon Jul 28 21:08:01 2008 +0000
   173.3 @@ -0,0 +1,52 @@
   173.4 +Original patch from gentoo: gentoo/src/patchsets/gdb/6.7/80_all_gdb-6.5-dwarf-stack-overflow.patch
   173.5 +-= BEGIN original header =-
   173.6 +http://bugs.gentoo.org/144833
   173.7 +
   173.8 +for gdb/ChangeLog:
   173.9 +2006-08-22  Will Drewry <wad@google.com>
  173.10 +	    Tavis Ormandy <taviso@google.com>
  173.11 +
  173.12 +	* dwarf2read.c (decode_locdesc): Enforce location description stack
  173.13 +	boundaries.
  173.14 +	* dwarfread.c (locval): Likewise.
  173.15 +
  173.16 +-= END original header =-
  173.17 +diff -durN gdb-6.7.orig/gdb/dwarf2read.c gdb-6.7/gdb/dwarf2read.c
  173.18 +--- gdb-6.7.orig/gdb/dwarf2read.c	2007-09-05 02:51:48.000000000 +0200
  173.19 ++++ gdb-6.7/gdb/dwarf2read.c	2008-06-17 23:25:38.000000000 +0200
  173.20 +@@ -9061,8 +9061,7 @@
  173.21 +    callers will only want a very basic result and this can become a
  173.22 +    complaint.
  173.23 + 
  173.24 +-   Note that stack[0] is unused except as a default error return.
  173.25 +-   Note that stack overflow is not yet handled.  */
  173.26 ++   Note that stack[0] is unused except as a default error return. */
  173.27 + 
  173.28 + static CORE_ADDR
  173.29 + decode_locdesc (struct dwarf_block *blk, struct dwarf2_cu *cu)
  173.30 +@@ -9079,7 +9078,7 @@
  173.31 + 
  173.32 +   i = 0;
  173.33 +   stacki = 0;
  173.34 +-  stack[stacki] = 0;
  173.35 ++  stack[++stacki] = 0;
  173.36 + 
  173.37 +   while (i < size)
  173.38 +     {
  173.39 +@@ -9261,6 +9260,16 @@
  173.40 + 		     dwarf_stack_op_name (op));
  173.41 + 	  return (stack[stacki]);
  173.42 + 	}
  173.43 ++      /* Enforce maximum stack depth of size-1 to avoid ++stacki writing
  173.44 ++         outside of the allocated space. Also enforce minimum > 0.
  173.45 ++         -- wad@google.com 14 Aug 2006 */
  173.46 ++      if (stacki >= sizeof (stack) / sizeof (*stack) - 1)
  173.47 ++	internal_error (__FILE__, __LINE__,
  173.48 ++	                _("location description stack too deep: %d"),
  173.49 ++	                stacki);
  173.50 ++      if (stacki <= 0)
  173.51 ++	internal_error (__FILE__, __LINE__,
  173.52 ++	                _("location description stack too shallow"));
  173.53 +     }
  173.54 +   return (stack[stacki]);
  173.55 + }
   174.1 --- a/patches/gdb/6.7/150-gdb-6.5-dwarf-stack-overflow.patch	Mon Jul 28 20:17:48 2008 +0000
   174.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   174.3 @@ -1,52 +0,0 @@
   174.4 -Original patch from gentoo: gentoo/src/patchsets/gdb/6.7/80_all_gdb-6.5-dwarf-stack-overflow.patch
   174.5 --= BEGIN original header =-
   174.6 -http://bugs.gentoo.org/144833
   174.7 -
   174.8 -for gdb/ChangeLog:
   174.9 -2006-08-22  Will Drewry <wad@google.com>
  174.10 -	    Tavis Ormandy <taviso@google.com>
  174.11 -
  174.12 -	* dwarf2read.c (decode_locdesc): Enforce location description stack
  174.13 -	boundaries.
  174.14 -	* dwarfread.c (locval): Likewise.
  174.15 -
  174.16 --= END original header =-
  174.17 -diff -durN gdb-6.7.orig/gdb/dwarf2read.c gdb-6.7/gdb/dwarf2read.c
  174.18 ---- gdb-6.7.orig/gdb/dwarf2read.c	2007-09-05 02:51:48.000000000 +0200
  174.19 -+++ gdb-6.7/gdb/dwarf2read.c	2008-06-17 23:25:38.000000000 +0200
  174.20 -@@ -9061,8 +9061,7 @@
  174.21 -    callers will only want a very basic result and this can become a
  174.22 -    complaint.
  174.23 - 
  174.24 --   Note that stack[0] is unused except as a default error return.
  174.25 --   Note that stack overflow is not yet handled.  */
  174.26 -+   Note that stack[0] is unused except as a default error return. */
  174.27 - 
  174.28 - static CORE_ADDR
  174.29 - decode_locdesc (struct dwarf_block *blk, struct dwarf2_cu *cu)
  174.30 -@@ -9079,7 +9078,7 @@
  174.31 - 
  174.32 -   i = 0;
  174.33 -   stacki = 0;
  174.34 --  stack[stacki] = 0;
  174.35 -+  stack[++stacki] = 0;
  174.36 - 
  174.37 -   while (i < size)
  174.38 -     {
  174.39 -@@ -9261,6 +9260,16 @@
  174.40 - 		     dwarf_stack_op_name (op));
  174.41 - 	  return (stack[stacki]);
  174.42 - 	}
  174.43 -+      /* Enforce maximum stack depth of size-1 to avoid ++stacki writing
  174.44 -+         outside of the allocated space. Also enforce minimum > 0.
  174.45 -+         -- wad@google.com 14 Aug 2006 */
  174.46 -+      if (stacki >= sizeof (stack) / sizeof (*stack) - 1)
  174.47 -+	internal_error (__FILE__, __LINE__,
  174.48 -+	                _("location description stack too deep: %d"),
  174.49 -+	                stacki);
  174.50 -+      if (stacki <= 0)
  174.51 -+	internal_error (__FILE__, __LINE__,
  174.52 -+	                _("location description stack too shallow"));
  174.53 -     }
  174.54 -   return (stack[stacki]);
  174.55 - }
   175.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   175.2 +++ b/patches/gdb/6.8/100-dwarf-stack-overflow.patch	Mon Jul 28 21:08:01 2008 +0000
   175.3 @@ -0,0 +1,52 @@
   175.4 +Original patch from gentoo: gentoo/src/patchsets/gdb/6.8/80_all_gdb-6.5-dwarf-stack-overflow.patch
   175.5 +-= BEGIN original header =-
   175.6 +http://bugs.gentoo.org/144833
   175.7 +
   175.8 +for gdb/ChangeLog:
   175.9 +2006-08-22  Will Drewry <wad@google.com>
  175.10 +	    Tavis Ormandy <taviso@google.com>
  175.11 +
  175.12 +	* dwarf2read.c (decode_locdesc): Enforce location description stack
  175.13 +	boundaries.
  175.14 +	* dwarfread.c (locval): Likewise.
  175.15 +
  175.16 +-= END original header =-
  175.17 +diff -durN gdb-6.8.orig/gdb/dwarf2read.c gdb-6.8/gdb/dwarf2read.c
  175.18 +--- gdb-6.8.orig/gdb/dwarf2read.c	2008-03-10 15:18:10.000000000 +0100
  175.19 ++++ gdb-6.8/gdb/dwarf2read.c	2008-06-17 16:07:31.000000000 +0200
  175.20 +@@ -9124,8 +9124,7 @@
  175.21 +    callers will only want a very basic result and this can become a
  175.22 +    complaint.
  175.23 + 
  175.24 +-   Note that stack[0] is unused except as a default error return.
  175.25 +-   Note that stack overflow is not yet handled.  */
  175.26 ++   Note that stack[0] is unused except as a default error return. */
  175.27 + 
  175.28 + static CORE_ADDR
  175.29 + decode_locdesc (struct dwarf_block *blk, struct dwarf2_cu *cu)
  175.30 +@@ -9142,7 +9141,7 @@
  175.31 + 
  175.32 +   i = 0;
  175.33 +   stacki = 0;
  175.34 +-  stack[stacki] = 0;
  175.35 ++  stack[++stacki] = 0;
  175.36 + 
  175.37 +   while (i < size)
  175.38 +     {
  175.39 +@@ -9324,6 +9323,16 @@
  175.40 + 		     dwarf_stack_op_name (op));
  175.41 + 	  return (stack[stacki]);
  175.42 + 	}
  175.43 ++      /* Enforce maximum stack depth of size-1 to avoid ++stacki writing
  175.44 ++         outside of the allocated space. Also enforce minimum > 0.
  175.45 ++         -- wad@google.com 14 Aug 2006 */
  175.46 ++      if (stacki >= sizeof (stack) / sizeof (*stack) - 1)
  175.47 ++	internal_error (__FILE__, __LINE__,
  175.48 ++	                _("location description stack too deep: %d"),
  175.49 ++	                stacki);
  175.50 ++      if (stacki <= 0)
  175.51 ++	internal_error (__FILE__, __LINE__,
  175.52 ++	                _("location description stack too shallow"));
  175.53 +     }
  175.54 +   return (stack[stacki]);
  175.55 + }
   176.1 --- a/patches/gdb/6.8/100-gdb-6.5-dwarf-stack-overflow.patch	Mon Jul 28 20:17:48 2008 +0000
   176.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   176.3 @@ -1,52 +0,0 @@
   176.4 -Original patch from gentoo: gentoo/src/patchsets/gdb/6.8/80_all_gdb-6.5-dwarf-stack-overflow.patch
   176.5 --= BEGIN original header =-
   176.6 -http://bugs.gentoo.org/144833
   176.7 -
   176.8 -for gdb/ChangeLog:
   176.9 -2006-08-22  Will Drewry <wad@google.com>
  176.10 -	    Tavis Ormandy <taviso@google.com>
  176.11 -
  176.12 -	* dwarf2read.c (decode_locdesc): Enforce location description stack
  176.13 -	boundaries.
  176.14 -	* dwarfread.c (locval): Likewise.
  176.15 -
  176.16 --= END original header =-
  176.17 -diff -durN gdb-6.8.orig/gdb/dwarf2read.c gdb-6.8/gdb/dwarf2read.c
  176.18 ---- gdb-6.8.orig/gdb/dwarf2read.c	2008-03-10 15:18:10.000000000 +0100
  176.19 -+++ gdb-6.8/gdb/dwarf2read.c	2008-06-17 16:07:31.000000000 +0200
  176.20 -@@ -9124,8 +9124,7 @@
  176.21 -    callers will only want a very basic result and this can become a
  176.22 -    complaint.
  176.23 - 
  176.24 --   Note that stack[0] is unused except as a default error return.
  176.25 --   Note that stack overflow is not yet handled.  */
  176.26 -+   Note that stack[0] is unused except as a default error return. */
  176.27 - 
  176.28 - static CORE_ADDR
  176.29 - decode_locdesc (struct dwarf_block *blk, struct dwarf2_cu *cu)
  176.30 -@@ -9142,7 +9141,7 @@
  176.31 - 
  176.32 -   i = 0;
  176.33 -   stacki = 0;
  176.34 --  stack[stacki] = 0;
  176.35 -+  stack[++stacki] = 0;
  176.36 - 
  176.37 -   while (i < size)
  176.38 -     {
  176.39 -@@ -9324,6 +9323,16 @@
  176.40 - 		     dwarf_stack_op_name (op));
  176.41 - 	  return (stack[stacki]);
  176.42 - 	}
  176.43 -+      /* Enforce maximum stack depth of size-1 to avoid ++stacki writing
  176.44 -+         outside of the allocated space. Also enforce minimum > 0.
  176.45 -+         -- wad@google.com 14 Aug 2006 */
  176.46 -+      if (stacki >= sizeof (stack) / sizeof (*stack) - 1)
  176.47 -+	internal_error (__FILE__, __LINE__,
  176.48 -+	                _("location description stack too deep: %d"),
  176.49 -+	                stacki);
  176.50 -+      if (stacki <= 0)
  176.51 -+	internal_error (__FILE__, __LINE__,
  176.52 -+	                _("location description stack too shallow"));
  176.53 -     }
  176.54 -   return (stack[stacki]);
  176.55 - }
   177.1 --- a/patches/gdb/6.8/150-gdb-6.3-security-errata-20050610.patch	Mon Jul 28 20:17:48 2008 +0000
   177.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   177.3 @@ -1,205 +0,0 @@
   177.4 -Original patch from gentoo: gentoo/src/patchsets/gdb/6.8/35_all_gdb-6.3-security-errata-20050610.patch
   177.5 --= BEGIN original header =-
   177.6 -2005-06-09  Jeff Johnston  <jjohnstn@redhat.com>
   177.7 -
   177.8 -        * gdb.base/gdbinit.exp: New testcase.
   177.9 -        * gdb.base/gdbinit.sample: Sample .gdbinit for gdbinit.exp.
  177.10 -
  177.11 -2005-06-08  Daniel Jacobowitz  <dan@codesourcery.com>
  177.12 -            Jeff Johnston  <jjohnstn@redhat.com>
  177.13 -
  177.14 -        * Makefile.in (cli-cmds.o): Update.
  177.15 -        * configure.in: Add check for getuid.
  177.16 -        * configure: Regenerated.
  177.17 -        * config.in: Ditto.
  177.18 -        * main.c (captured_main): Pass -1 to source_command when loading
  177.19 -        gdbinit files.
  177.20 -        * cli/cli-cmds.c: Include "gdb_stat.h" and <fcntl.h>.
  177.21 -        (source_command): Update documentation.  Check permissions if
  177.22 -        FROM_TTY is -1.
  177.23 -
  177.24 --= END original header =-
  177.25 -diff -durN gdb-6.8.orig/gdb/Makefile.in gdb-6.8/gdb/Makefile.in
  177.26 ---- gdb-6.8.orig/gdb/Makefile.in	2008-03-17 13:15:08.000000000 +0100
  177.27 -+++ gdb-6.8/gdb/Makefile.in	2008-06-17 16:07:33.000000000 +0200
  177.28 -@@ -3004,7 +3004,7 @@
  177.29 - 	$(expression_h) $(frame_h) $(value_h) $(language_h) $(filenames_h) \
  177.30 - 	$(objfiles_h) $(source_h) $(disasm_h) $(ui_out_h) $(top_h) \
  177.31 - 	$(cli_decode_h) $(cli_script_h) $(cli_setshow_h) $(cli_cmds_h) \
  177.32 --	$(tui_h)
  177.33 -+	$(tui_h) $(gdb_stat_h)
  177.34 - 	$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-cmds.c
  177.35 - cli-decode.o: $(srcdir)/cli/cli-decode.c $(defs_h) $(symtab_h) \
  177.36 - 	$(gdb_regex_h) $(gdb_string_h) $(completer_h) $(ui_out_h) \
  177.37 -diff -durN gdb-6.8.orig/gdb/cli/cli-cmds.c gdb-6.8/gdb/cli/cli-cmds.c
  177.38 ---- gdb-6.8.orig/gdb/cli/cli-cmds.c	2008-01-01 23:53:14.000000000 +0100
  177.39 -+++ gdb-6.8/gdb/cli/cli-cmds.c	2008-06-17 16:07:33.000000000 +0200
  177.40 -@@ -36,6 +36,7 @@
  177.41 - #include "objfiles.h"
  177.42 - #include "source.h"
  177.43 - #include "disasm.h"
  177.44 -+#include "gdb_stat.h"
  177.45 - 
  177.46 - #include "ui-out.h"
  177.47 - 
  177.48 -@@ -459,12 +460,31 @@
  177.49 - 
  177.50 -   if (fd == -1)
  177.51 -     {
  177.52 --      if (from_tty)
  177.53 -+      if (from_tty > 0)
  177.54 - 	perror_with_name (file);
  177.55 -       else
  177.56 - 	return;
  177.57 -     }
  177.58 - 
  177.59 -+#ifdef HAVE_GETUID
  177.60 -+  if (from_tty == -1)
  177.61 -+    {
  177.62 -+      struct stat statbuf;
  177.63 -+      if (fstat (fd, &statbuf) < 0)
  177.64 -+	{
  177.65 -+	  perror_with_name (file);
  177.66 -+	  close (fd);
  177.67 -+	  return;
  177.68 -+	}
  177.69 -+      if (statbuf.st_uid != getuid () || (statbuf.st_mode & S_IWOTH))
  177.70 -+	{
  177.71 -+          warning (_("not using untrusted file \"%s\""), file);
  177.72 -+	  close (fd);
  177.73 -+	  return;
  177.74 -+	}
  177.75 -+    }
  177.76 -+#endif
  177.77 -+
  177.78 -   stream = fdopen (fd, FOPEN_RT);
  177.79 -   script_from_file (stream, file);
  177.80 - 
  177.81 -diff -durN gdb-6.8.orig/gdb/main.c gdb-6.8/gdb/main.c
  177.82 ---- gdb-6.8.orig/gdb/main.c	2008-01-05 17:49:53.000000000 +0100
  177.83 -+++ gdb-6.8/gdb/main.c	2008-06-17 16:07:33.000000000 +0200
  177.84 -@@ -690,7 +690,7 @@
  177.85 - 
  177.86 -       if (!inhibit_gdbinit)
  177.87 - 	{
  177.88 --	  catch_command_errors (source_script, homeinit, 0, RETURN_MASK_ALL);
  177.89 -+	  catch_command_errors (source_script, homeinit, -1, RETURN_MASK_ALL);
  177.90 - 	}
  177.91 - 
  177.92 -       /* Do stats; no need to do them elsewhere since we'll only
  177.93 -@@ -778,7 +778,7 @@
  177.94 -       || memcmp ((char *) &homebuf, (char *) &cwdbuf, sizeof (struct stat)))
  177.95 -     if (!inhibit_gdbinit)
  177.96 -       {
  177.97 --	catch_command_errors (source_script, gdbinit, 0, RETURN_MASK_ALL);
  177.98 -+	catch_command_errors (source_script, gdbinit, -1, RETURN_MASK_ALL);
  177.99 -       }
 177.100 - 
 177.101 -   for (i = 0; i < ncmd; i++)
 177.102 -diff -durN gdb-6.8.orig/gdb/testsuite/gdb.base/gdbinit.exp gdb-6.8/gdb/testsuite/gdb.base/gdbinit.exp
 177.103 ---- gdb-6.8.orig/gdb/testsuite/gdb.base/gdbinit.exp	1970-01-01 01:00:00.000000000 +0100
 177.104 -+++ gdb-6.8/gdb/testsuite/gdb.base/gdbinit.exp	2008-06-17 16:07:33.000000000 +0200
 177.105 -@@ -0,0 +1,98 @@
 177.106 -+#   Copyright 2005
 177.107 -+#   Free Software Foundation, Inc.
 177.108 -+
 177.109 -+# This program is free software; you can redistribute it and/or modify
 177.110 -+# it under the terms of the GNU General Public License as published by
 177.111 -+# the Free Software Foundation; either version 2 of the License, or
 177.112 -+# (at your option) any later version.
 177.113 -+# 
 177.114 -+# This program is distributed in the hope that it will be useful,
 177.115 -+# but WITHOUT ANY WARRANTY; without even the implied warranty of
 177.116 -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 177.117 -+# GNU General Public License for more details.
 177.118 -+# 
 177.119 -+# You should have received a copy of the GNU General Public License
 177.120 -+# along with this program; if not, write to the Free Software
 177.121 -+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
 177.122 -+
 177.123 -+# Please email any bugs, comments, and/or additions to this file to:
 177.124 -+# bug-gdb@prep.ai.mit.edu
 177.125 -+
 177.126 -+# This file was written by Jeff Johnston <jjohnstn@redhat.com>.
 177.127 -+
 177.128 -+if $tracelevel then {
 177.129 -+    strace $tracelevel
 177.130 -+}
 177.131 -+
 177.132 -+set prms_id 0
 177.133 -+set bug_id 0
 177.134 -+
 177.135 -+# are we on a target board
 177.136 -+if [is_remote target] {
 177.137 -+    return
 177.138 -+}
 177.139 -+
 177.140 -+
 177.141 -+global verbose
 177.142 -+global GDB
 177.143 -+global GDBFLAGS
 177.144 -+global gdb_prompt
 177.145 -+global timeout
 177.146 -+global gdb_spawn_id;
 177.147 -+                                                                                
 177.148 -+gdb_stop_suppressing_tests;
 177.149 -+                                                                                
 177.150 -+verbose "Spawning $GDB -nw"
 177.151 -+                                                                                
 177.152 -+if [info exists gdb_spawn_id] {
 177.153 -+    return 0;
 177.154 -+}
 177.155 -+                                                                                
 177.156 -+if ![is_remote host] {
 177.157 -+   if { [which $GDB] == 0 } then {
 177.158 -+        perror "$GDB does not exist."
 177.159 -+        exit 1
 177.160 -+    }
 177.161 -+}
 177.162 -+
 177.163 -+set env(HOME) [pwd]
 177.164 -+remote_exec build "rm .gdbinit"
 177.165 -+remote_exec build "cp ${srcdir}/${subdir}/gdbinit.sample .gdbinit"
 177.166 -+remote_exec build "chmod 646 .gdbinit"
 177.167 -+
 177.168 -+set res [remote_spawn host "$GDB -nw [host_info gdb_opts]"];
 177.169 -+if { $res < 0 || $res == "" } {
 177.170 -+    perror "Spawning $GDB failed."
 177.171 -+    return 1;
 177.172 -+}
 177.173 -+gdb_expect 360 {
 177.174 -+    -re "warning: not using untrusted file.*\.gdbinit.*\[\r\n\]$gdb_prompt $" {
 177.175 -+        pass "untrusted .gdbinit caught."
 177.176 -+    }
 177.177 -+    -re "$gdb_prompt $"     {
 177.178 -+        fail "untrusted .gdbinit caught."
 177.179 -+    }
 177.180 -+    timeout {
 177.181 -+        fail "(timeout) untrusted .gdbinit caught."
 177.182 -+    }
 177.183 -+}
 177.184 -+
 177.185 -+remote_exec build "chmod 644 .gdbinit"
 177.186 -+set res [remote_spawn host "$GDB -nw [host_info gdb_opts]"];
 177.187 -+if { $res < 0 || $res == "" } {
 177.188 -+    perror "Spawning $GDB failed."
 177.189 -+    return 1;
 177.190 -+}
 177.191 -+gdb_expect 360 {
 177.192 -+    -re "warning: not using untrusted file.*\.gdbinit.*\[\r\n\]$gdb_prompt $" {
 177.193 -+        fail "trusted .gdbinit allowed."
 177.194 -+    }
 177.195 -+    -re "in gdbinit.*$gdb_prompt $"     {
 177.196 -+        pass "trusted .gdbinit allowed."
 177.197 -+    }
 177.198 -+    timeout {
 177.199 -+        fail "(timeout) trusted .gdbinit allowed."
 177.200 -+    }
 177.201 -+}
 177.202 -+
 177.203 -+remote_exec build "rm .gdbinit"
 177.204 -diff -durN gdb-6.8.orig/gdb/testsuite/gdb.base/gdbinit.sample gdb-6.8/gdb/testsuite/gdb.base/gdbinit.sample
 177.205 ---- gdb-6.8.orig/gdb/testsuite/gdb.base/gdbinit.sample	1970-01-01 01:00:00.000000000 +0100
 177.206 -+++ gdb-6.8/gdb/testsuite/gdb.base/gdbinit.sample	2008-06-17 16:07:33.000000000 +0200
 177.207 -@@ -0,0 +1 @@
 177.208 -+echo "\nin gdbinit"
   178.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   178.2 +++ b/patches/gdb/6.8/150-security-errata-20050610.patch	Mon Jul 28 21:08:01 2008 +0000
   178.3 @@ -0,0 +1,205 @@
   178.4 +Original patch from gentoo: gentoo/src/patchsets/gdb/6.8/35_all_gdb-6.3-security-errata-20050610.patch
   178.5 +-= BEGIN original header =-
   178.6 +2005-06-09  Jeff Johnston  <jjohnstn@redhat.com>
   178.7 +
   178.8 +        * gdb.base/gdbinit.exp: New testcase.
   178.9 +        * gdb.base/gdbinit.sample: Sample .gdbinit for gdbinit.exp.
  178.10 +
  178.11 +2005-06-08  Daniel Jacobowitz  <dan@codesourcery.com>
  178.12 +            Jeff Johnston  <jjohnstn@redhat.com>
  178.13 +
  178.14 +        * Makefile.in (cli-cmds.o): Update.
  178.15 +        * configure.in: Add check for getuid.
  178.16 +        * configure: Regenerated.
  178.17 +        * config.in: Ditto.
  178.18 +        * main.c (captured_main): Pass -1 to source_command when loading
  178.19 +        gdbinit files.
  178.20 +        * cli/cli-cmds.c: Include "gdb_stat.h" and <fcntl.h>.
  178.21 +        (source_command): Update documentation.  Check permissions if
  178.22 +        FROM_TTY is -1.
  178.23 +
  178.24 +-= END original header =-
  178.25 +diff -durN gdb-6.8.orig/gdb/Makefile.in gdb-6.8/gdb/Makefile.in
  178.26 +--- gdb-6.8.orig/gdb/Makefile.in	2008-03-17 13:15:08.000000000 +0100
  178.27 ++++ gdb-6.8/gdb/Makefile.in	2008-06-17 16:07:33.000000000 +0200
  178.28 +@@ -3004,7 +3004,7 @@
  178.29 + 	$(expression_h) $(frame_h) $(value_h) $(language_h) $(filenames_h) \
  178.30 + 	$(objfiles_h) $(source_h) $(disasm_h) $(ui_out_h) $(top_h) \
  178.31 + 	$(cli_decode_h) $(cli_script_h) $(cli_setshow_h) $(cli_cmds_h) \
  178.32 +-	$(tui_h)
  178.33 ++	$(tui_h) $(gdb_stat_h)
  178.34 + 	$(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-cmds.c
  178.35 + cli-decode.o: $(srcdir)/cli/cli-decode.c $(defs_h) $(symtab_h) \
  178.36 + 	$(gdb_regex_h) $(gdb_string_h) $(completer_h) $(ui_out_h) \
  178.37 +diff -durN gdb-6.8.orig/gdb/cli/cli-cmds.c gdb-6.8/gdb/cli/cli-cmds.c
  178.38 +--- gdb-6.8.orig/gdb/cli/cli-cmds.c	2008-01-01 23:53:14.000000000 +0100
  178.39 ++++ gdb-6.8/gdb/cli/cli-cmds.c	2008-06-17 16:07:33.000000000 +0200
  178.40 +@@ -36,6 +36,7 @@
  178.41 + #include "objfiles.h"
  178.42 + #include "source.h"
  178.43 + #include "disasm.h"
  178.44 ++#include "gdb_stat.h"
  178.45 + 
  178.46 + #include "ui-out.h"
  178.47 + 
  178.48 +@@ -459,12 +460,31 @@
  178.49 + 
  178.50 +   if (fd == -1)
  178.51 +     {
  178.52 +-      if (from_tty)
  178.53 ++      if (from_tty > 0)
  178.54 + 	perror_with_name (file);
  178.55 +       else
  178.56 + 	return;
  178.57 +     }
  178.58 + 
  178.59 ++#ifdef HAVE_GETUID
  178.60 ++  if (from_tty == -1)
  178.61 ++    {
  178.62 ++      struct stat statbuf;
  178.63 ++      if (fstat (fd, &statbuf) < 0)
  178.64 ++	{
  178.65 ++	  perror_with_name (file);
  178.66 ++	  close (fd);
  178.67 ++	  return;
  178.68 ++	}
  178.69 ++      if (statbuf.st_uid != getuid () || (statbuf.st_mode & S_IWOTH))
  178.70 ++	{
  178.71 ++          warning (_("not using untrusted file \"%s\""), file);
  178.72 ++	  close (fd);
  178.73 ++	  return;
  178.74 ++	}
  178.75 ++    }
  178.76 ++#endif
  178.77 ++
  178.78 +   stream = fdopen (fd, FOPEN_RT);
  178.79 +   script_from_file (stream, file);
  178.80 + 
  178.81 +diff -durN gdb-6.8.orig/gdb/main.c gdb-6.8/gdb/main.c
  178.82 +--- gdb-6.8.orig/gdb/main.c	2008-01-05 17:49:53.000000000 +0100
  178.83 ++++ gdb-6.8/gdb/main.c	2008-06-17 16:07:33.000000000 +0200
  178.84 +@@ -690,7 +690,7 @@
  178.85 + 
  178.86 +       if (!inhibit_gdbinit)
  178.87 + 	{
  178.88 +-	  catch_command_errors (source_script, homeinit, 0, RETURN_MASK_ALL);
  178.89 ++	  catch_command_errors (source_script, homeinit, -1, RETURN_MASK_ALL);
  178.90 + 	}
  178.91 + 
  178.92 +       /* Do stats; no need to do them elsewhere since we'll only
  178.93 +@@ -778,7 +778,7 @@
  178.94 +       || memcmp ((char *) &homebuf, (char *) &cwdbuf, sizeof (struct stat)))
  178.95 +     if (!inhibit_gdbinit)
  178.96 +       {
  178.97 +-	catch_command_errors (source_script, gdbinit, 0, RETURN_MASK_ALL);
  178.98 ++	catch_command_errors (source_script, gdbinit, -1, RETURN_MASK_ALL);
  178.99 +       }
 178.100 + 
 178.101 +   for (i = 0; i < ncmd; i++)
 178.102 +diff -durN gdb-6.8.orig/gdb/testsuite/gdb.base/gdbinit.exp gdb-6.8/gdb/testsuite/gdb.base/gdbinit.exp
 178.103 +--- gdb-6.8.orig/gdb/testsuite/gdb.base/gdbinit.exp	1970-01-01 01:00:00.000000000 +0100
 178.104 ++++ gdb-6.8/gdb/testsuite/gdb.base/gdbinit.exp	2008-06-17 16:07:33.000000000 +0200
 178.105 +@@ -0,0 +1,98 @@
 178.106 ++#   Copyright 2005
 178.107 ++#   Free Software Foundation, Inc.
 178.108 ++
 178.109 ++# This program is free software; you can redistribute it and/or modify
 178.110 ++# it under the terms of the GNU General Public License as published by
 178.111 ++# the Free Software Foundation; either version 2 of the License, or
 178.112 ++# (at your option) any later version.
 178.113 ++# 
 178.114 ++# This program is distributed in the hope that it will be useful,
 178.115 ++# but WITHOUT ANY WARRANTY; without even the implied warranty of
 178.116 ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 178.117 ++# GNU General Public License for more details.
 178.118 ++# 
 178.119 ++# You should have received a copy of the GNU General Public License
 178.120 ++# along with this program; if not, write to the Free Software
 178.121 ++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
 178.122 ++
 178.123 ++# Please email any bugs, comments, and/or additions to this file to:
 178.124 ++# bug-gdb@prep.ai.mit.edu
 178.125 ++
 178.126 ++# This file was written by Jeff Johnston <jjohnstn@redhat.com>.
 178.127 ++
 178.128 ++if $tracelevel then {
 178.129 ++    strace $tracelevel
 178.130 ++}
 178.131 ++
 178.132 ++set prms_id 0
 178.133 ++set bug_id 0
 178.134 ++
 178.135 ++# are we on a target board
 178.136 ++if [is_remote target] {
 178.137 ++    return
 178.138 ++}
 178.139 ++
 178.140 ++
 178.141 ++global verbose
 178.142 ++global GDB
 178.143 ++global GDBFLAGS
 178.144 ++global gdb_prompt
 178.145 ++global timeout
 178.146 ++global gdb_spawn_id;
 178.147 ++                                                                                
 178.148 ++gdb_stop_suppressing_tests;
 178.149 ++                                                                                
 178.150 ++verbose "Spawning $GDB -nw"
 178.151 ++                                                                                
 178.152 ++if [info exists gdb_spawn_id] {
 178.153 ++    return 0;
 178.154 ++}
 178.155 ++                                                                                
 178.156 ++if ![is_remote host] {
 178.157 ++   if { [which $GDB] == 0 } then {
 178.158 ++        perror "$GDB does not exist."
 178.159 ++        exit 1
 178.160 ++    }
 178.161 ++}
 178.162 ++
 178.163 ++set env(HOME) [pwd]
 178.164 ++remote_exec build "rm .gdbinit"
 178.165 ++remote_exec build "cp ${srcdir}/${subdir}/gdbinit.sample .gdbinit"
 178.166 ++remote_exec build "chmod 646 .gdbinit"
 178.167 ++
 178.168 ++set res [remote_spawn host "$GDB -nw [host_info gdb_opts]"];
 178.169 ++if { $res < 0 || $res == "" } {
 178.170 ++    perror "Spawning $GDB failed."
 178.171 ++    return 1;
 178.172 ++}
 178.173 ++gdb_expect 360 {
 178.174 ++    -re "warning: not using untrusted file.*\.gdbinit.*\[\r\n\]$gdb_prompt $" {
 178.175 ++        pass "untrusted .gdbinit caught."
 178.176 ++    }
 178.177 ++    -re "$gdb_prompt $"     {
 178.178 ++        fail "untrusted .gdbinit caught."
 178.179 ++    }
 178.180 ++    timeout {
 178.181 ++        fail "(timeout) untrusted .gdbinit caught."
 178.182 ++    }
 178.183 ++}
 178.184 ++
 178.185 ++remote_exec build "chmod 644 .gdbinit"
 178.186 ++set res [remote_spawn host "$GDB -nw [host_info gdb_opts]"];
 178.187 ++if { $res < 0 || $res == "" } {
 178.188 ++    perror "Spawning $GDB failed."
 178.189 ++    return 1;
 178.190 ++}
 178.191 ++gdb_expect 360 {
 178.192 ++    -re "warning: not using untrusted file.*\.gdbinit.*\[\r\n\]$gdb_prompt $" {
 178.193 ++        fail "trusted .gdbinit allowed."
 178.194 ++    }
 178.195 ++    -re "in gdbinit.*$gdb_prompt $"     {
 178.196 ++        pass "trusted .gdbinit allowed."
 178.197 ++    }
 178.198 ++    timeout {
 178.199 ++        fail "(timeout) trusted .gdbinit allowed."
 178.200 ++    }
 178.201 ++}
 178.202 ++
 178.203 ++remote_exec build "rm .gdbinit"
 178.204 +diff -durN gdb-6.8.orig/gdb/testsuite/gdb.base/gdbinit.sample gdb-6.8/gdb/testsuite/gdb.base/gdbinit.sample
 178.205 +--- gdb-6.8.orig/gdb/testsuite/gdb.base/gdbinit.sample	1970-01-01 01:00:00.000000000 +0100
 178.206 ++++ gdb-6.8/gdb/testsuite/gdb.base/gdbinit.sample	2008-06-17 16:07:33.000000000 +0200
 178.207 +@@ -0,0 +1 @@
 178.208 ++echo "\nin gdbinit"
   179.1 --- a/patches/gdb/6.8/200-gdb-tdep-opcode-include-workaround.patch	Mon Jul 28 20:17:48 2008 +0000
   179.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   179.3 @@ -1,33 +0,0 @@
   179.4 -Original patch from gentoo: gentoo/src/patchsets/gdb/6.8/20_all_gdb-tdep-opcode-include-workaround.patch
   179.5 --= BEGIN original header =-
   179.6 -workaround build failure
   179.7 -
   179.8 -http://bugs.gentoo.org/216368
   179.9 -
  179.10 --= END original header =-
  179.11 -diff -durN gdb-6.8.orig/gdb/frv-tdep.c gdb-6.8/gdb/frv-tdep.c
  179.12 ---- gdb-6.8.orig/gdb/frv-tdep.c	2008-01-11 14:19:59.000000000 +0100
  179.13 -+++ gdb-6.8/gdb/frv-tdep.c	2008-06-17 16:07:34.000000000 +0200
  179.14 -@@ -32,7 +32,7 @@
  179.15 - #include "gdb_assert.h"
  179.16 - #include "sim-regno.h"
  179.17 - #include "gdb/sim-frv.h"
  179.18 --#include "opcodes/frv-desc.h"	/* for the H_SPR_... enums */
  179.19 -+#include "../opcodes/frv-desc.h"	/* for the H_SPR_... enums */
  179.20 - #include "symtab.h"
  179.21 - #include "elf-bfd.h"
  179.22 - #include "elf/frv.h"
  179.23 -diff -durN gdb-6.8.orig/gdb/mep-tdep.c gdb-6.8/gdb/mep-tdep.c
  179.24 ---- gdb-6.8.orig/gdb/mep-tdep.c	2008-01-11 14:20:02.000000000 +0100
  179.25 -+++ gdb-6.8/gdb/mep-tdep.c	2008-06-17 16:07:34.000000000 +0200
  179.26 -@@ -53,8 +53,8 @@
  179.27 - 
  179.28 - /* Get the user's customized MeP coprocessor register names from
  179.29 -    libopcodes.  */
  179.30 --#include "opcodes/mep-desc.h"
  179.31 --#include "opcodes/mep-opc.h"
  179.32 -+#include "../opcodes/mep-desc.h"
  179.33 -+#include "../opcodes/mep-opc.h"
  179.34 - 
  179.35 - 
  179.36 - /* The gdbarch_tdep structure.  */
   180.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   180.2 +++ b/patches/gdb/6.8/200-tdep-opcode-include-workaround.patch	Mon Jul 28 21:08:01 2008 +0000
   180.3 @@ -0,0 +1,33 @@
   180.4 +Original patch from gentoo: gentoo/src/patchsets/gdb/6.8/20_all_gdb-tdep-opcode-include-workaround.patch
   180.5 +-= BEGIN original header =-
   180.6 +workaround build failure
   180.7 +
   180.8 +http://bugs.gentoo.org/216368
   180.9 +
  180.10 +-= END original header =-
  180.11 +diff -durN gdb-6.8.orig/gdb/frv-tdep.c gdb-6.8/gdb/frv-tdep.c
  180.12 +--- gdb-6.8.orig/gdb/frv-tdep.c	2008-01-11 14:19:59.000000000 +0100
  180.13 ++++ gdb-6.8/gdb/frv-tdep.c	2008-06-17 16:07:34.000000000 +0200
  180.14 +@@ -32,7 +32,7 @@
  180.15 + #include "gdb_assert.h"
  180.16 + #include "sim-regno.h"
  180.17 + #include "gdb/sim-frv.h"
  180.18 +-#include "opcodes/frv-desc.h"	/* for the H_SPR_... enums */
  180.19 ++#include "../opcodes/frv-desc.h"	/* for the H_SPR_... enums */
  180.20 + #include "symtab.h"
  180.21 + #include "elf-bfd.h"
  180.22 + #include "elf/frv.h"
  180.23 +diff -durN gdb-6.8.orig/gdb/mep-tdep.c gdb-6.8/gdb/mep-tdep.c
  180.24 +--- gdb-6.8.orig/gdb/mep-tdep.c	2008-01-11 14:20:02.000000000 +0100
  180.25 ++++ gdb-6.8/gdb/mep-tdep.c	2008-06-17 16:07:34.000000000 +0200
  180.26 +@@ -53,8 +53,8 @@
  180.27 + 
  180.28 + /* Get the user's customized MeP coprocessor register names from
  180.29 +    libopcodes.  */
  180.30 +-#include "opcodes/mep-desc.h"
  180.31 +-#include "opcodes/mep-opc.h"
  180.32 ++#include "../opcodes/mep-desc.h"
  180.33 ++#include "../opcodes/mep-opc.h"
  180.34 + 
  180.35 + 
  180.36 + /* The gdbarch_tdep structure.  */
   181.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   181.2 +++ b/patches/strace/4.5.15/100-autoreconf.patch	Mon Jul 28 21:08:01 2008 +0000
   181.3 @@ -0,0 +1,761 @@
   181.4 +diff -dur strace-4.5.15.orig/configure strace-4.5.15/configure
   181.5 +--- strace-4.5.15.orig/configure	2007-01-11 23:23:33.000000000 +0100
   181.6 ++++ strace-4.5.15/configure	2007-07-14 19:18:43.000000000 +0200
   181.7 +@@ -956,7 +956,7 @@
   181.8 +     else
   181.9 +       echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
  181.10 +     fi
  181.11 +-    cd $ac_popdir
  181.12 ++    cd "$ac_popdir"
  181.13 +   done
  181.14 + fi
  181.15 + 
  181.16 +@@ -2660,8 +2660,7 @@
  181.17 +   cat conftest.err >&5
  181.18 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
  181.19 +   (exit $ac_status); } &&
  181.20 +-	 { ac_try='test -z "$ac_c_werror_flag"
  181.21 +-			 || test ! -s conftest.err'
  181.22 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
  181.23 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  181.24 +   (eval $ac_try) 2>&5
  181.25 +   ac_status=$?
  181.26 +@@ -2719,8 +2718,7 @@
  181.27 +   cat conftest.err >&5
  181.28 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
  181.29 +   (exit $ac_status); } &&
  181.30 +-	 { ac_try='test -z "$ac_c_werror_flag"
  181.31 +-			 || test ! -s conftest.err'
  181.32 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
  181.33 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  181.34 +   (eval $ac_try) 2>&5
  181.35 +   ac_status=$?
  181.36 +@@ -2836,8 +2834,7 @@
  181.37 +   cat conftest.err >&5
  181.38 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
  181.39 +   (exit $ac_status); } &&
  181.40 +-	 { ac_try='test -z "$ac_c_werror_flag"
  181.41 +-			 || test ! -s conftest.err'
  181.42 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
  181.43 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  181.44 +   (eval $ac_try) 2>&5
  181.45 +   ac_status=$?
  181.46 +@@ -2891,8 +2888,7 @@
  181.47 +   cat conftest.err >&5
  181.48 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
  181.49 +   (exit $ac_status); } &&
  181.50 +-	 { ac_try='test -z "$ac_c_werror_flag"
  181.51 +-			 || test ! -s conftest.err'
  181.52 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
  181.53 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  181.54 +   (eval $ac_try) 2>&5
  181.55 +   ac_status=$?
  181.56 +@@ -2937,8 +2933,7 @@
  181.57 +   cat conftest.err >&5
  181.58 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
  181.59 +   (exit $ac_status); } &&
  181.60 +-	 { ac_try='test -z "$ac_c_werror_flag"
  181.61 +-			 || test ! -s conftest.err'
  181.62 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
  181.63 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  181.64 +   (eval $ac_try) 2>&5
  181.65 +   ac_status=$?
  181.66 +@@ -2982,8 +2977,7 @@
  181.67 +   cat conftest.err >&5
  181.68 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
  181.69 +   (exit $ac_status); } &&
  181.70 +-	 { ac_try='test -z "$ac_c_werror_flag"
  181.71 +-			 || test ! -s conftest.err'
  181.72 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
  181.73 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  181.74 +   (eval $ac_try) 2>&5
  181.75 +   ac_status=$?
  181.76 +@@ -3721,8 +3715,7 @@
  181.77 +   cat conftest.err >&5
  181.78 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
  181.79 +   (exit $ac_status); } &&
  181.80 +-	 { ac_try='test -z "$ac_c_werror_flag"
  181.81 +-			 || test ! -s conftest.err'
  181.82 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
  181.83 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  181.84 +   (eval $ac_try) 2>&5
  181.85 +   ac_status=$?
  181.86 +@@ -3786,8 +3779,7 @@
  181.87 +   cat conftest.err >&5
  181.88 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
  181.89 +   (exit $ac_status); } &&
  181.90 +-	 { ac_try='test -z "$ac_c_werror_flag"
  181.91 +-			 || test ! -s conftest.err'
  181.92 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
  181.93 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  181.94 +   (eval $ac_try) 2>&5
  181.95 +   ac_status=$?
  181.96 +@@ -3959,8 +3951,7 @@
  181.97 +   cat conftest.err >&5
  181.98 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
  181.99 +   (exit $ac_status); } &&
 181.100 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.101 +-			 || test ! -s conftest.err'
 181.102 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.103 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.104 +   (eval $ac_try) 2>&5
 181.105 +   ac_status=$?
 181.106 +@@ -4032,8 +4023,7 @@
 181.107 +   cat conftest.err >&5
 181.108 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.109 +   (exit $ac_status); } &&
 181.110 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.111 +-			 || test ! -s conftest.err'
 181.112 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.113 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.114 +   (eval $ac_try) 2>&5
 181.115 +   ac_status=$?
 181.116 +@@ -4087,8 +4077,7 @@
 181.117 +   cat conftest.err >&5
 181.118 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.119 +   (exit $ac_status); } &&
 181.120 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.121 +-			 || test ! -s conftest.err'
 181.122 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.123 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.124 +   (eval $ac_try) 2>&5
 181.125 +   ac_status=$?
 181.126 +@@ -4159,8 +4148,7 @@
 181.127 +   cat conftest.err >&5
 181.128 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.129 +   (exit $ac_status); } &&
 181.130 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.131 +-			 || test ! -s conftest.err'
 181.132 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.133 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.134 +   (eval $ac_try) 2>&5
 181.135 +   ac_status=$?
 181.136 +@@ -4214,8 +4202,7 @@
 181.137 +   cat conftest.err >&5
 181.138 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.139 +   (exit $ac_status); } &&
 181.140 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.141 +-			 || test ! -s conftest.err'
 181.142 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.143 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.144 +   (eval $ac_try) 2>&5
 181.145 +   ac_status=$?
 181.146 +@@ -4345,8 +4332,7 @@
 181.147 +   cat conftest.err >&5
 181.148 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.149 +   (exit $ac_status); } &&
 181.150 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.151 +-			 || test ! -s conftest.err'
 181.152 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.153 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.154 +   (eval $ac_try) 2>&5
 181.155 +   ac_status=$?
 181.156 +@@ -4410,8 +4396,7 @@
 181.157 +   cat conftest.err >&5
 181.158 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.159 +   (exit $ac_status); } &&
 181.160 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.161 +-			 || test ! -s conftest.err'
 181.162 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.163 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.164 +   (eval $ac_try) 2>&5
 181.165 +   ac_status=$?
 181.166 +@@ -4454,8 +4439,7 @@
 181.167 +   cat conftest.err >&5
 181.168 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.169 +   (exit $ac_status); } &&
 181.170 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.171 +-			 || test ! -s conftest.err'
 181.172 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.173 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.174 +   (eval $ac_try) 2>&5
 181.175 +   ac_status=$?
 181.176 +@@ -4519,8 +4503,7 @@
 181.177 +   cat conftest.err >&5
 181.178 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.179 +   (exit $ac_status); } &&
 181.180 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.181 +-			 || test ! -s conftest.err'
 181.182 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.183 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.184 +   (eval $ac_try) 2>&5
 181.185 +   ac_status=$?
 181.186 +@@ -4563,8 +4546,7 @@
 181.187 +   cat conftest.err >&5
 181.188 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.189 +   (exit $ac_status); } &&
 181.190 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.191 +-			 || test ! -s conftest.err'
 181.192 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.193 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.194 +   (eval $ac_try) 2>&5
 181.195 +   ac_status=$?
 181.196 +@@ -4628,8 +4610,7 @@
 181.197 +   cat conftest.err >&5
 181.198 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.199 +   (exit $ac_status); } &&
 181.200 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.201 +-			 || test ! -s conftest.err'
 181.202 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.203 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.204 +   (eval $ac_try) 2>&5
 181.205 +   ac_status=$?
 181.206 +@@ -4672,8 +4653,7 @@
 181.207 +   cat conftest.err >&5
 181.208 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.209 +   (exit $ac_status); } &&
 181.210 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.211 +-			 || test ! -s conftest.err'
 181.212 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.213 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.214 +   (eval $ac_try) 2>&5
 181.215 +   ac_status=$?
 181.216 +@@ -4737,8 +4717,7 @@
 181.217 +   cat conftest.err >&5
 181.218 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.219 +   (exit $ac_status); } &&
 181.220 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.221 +-			 || test ! -s conftest.err'
 181.222 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.223 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.224 +   (eval $ac_try) 2>&5
 181.225 +   ac_status=$?
 181.226 +@@ -4781,8 +4760,7 @@
 181.227 +   cat conftest.err >&5
 181.228 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.229 +   (exit $ac_status); } &&
 181.230 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.231 +-			 || test ! -s conftest.err'
 181.232 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.233 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.234 +   (eval $ac_try) 2>&5
 181.235 +   ac_status=$?
 181.236 +@@ -4846,8 +4824,7 @@
 181.237 +   cat conftest.err >&5
 181.238 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.239 +   (exit $ac_status); } &&
 181.240 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.241 +-			 || test ! -s conftest.err'
 181.242 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.243 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.244 +   (eval $ac_try) 2>&5
 181.245 +   ac_status=$?
 181.246 +@@ -4890,8 +4867,7 @@
 181.247 +   cat conftest.err >&5
 181.248 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.249 +   (exit $ac_status); } &&
 181.250 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.251 +-			 || test ! -s conftest.err'
 181.252 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.253 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.254 +   (eval $ac_try) 2>&5
 181.255 +   ac_status=$?
 181.256 +@@ -4955,8 +4931,7 @@
 181.257 +   cat conftest.err >&5
 181.258 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.259 +   (exit $ac_status); } &&
 181.260 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.261 +-			 || test ! -s conftest.err'
 181.262 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.263 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.264 +   (eval $ac_try) 2>&5
 181.265 +   ac_status=$?
 181.266 +@@ -4999,8 +4974,7 @@
 181.267 +   cat conftest.err >&5
 181.268 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.269 +   (exit $ac_status); } &&
 181.270 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.271 +-			 || test ! -s conftest.err'
 181.272 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.273 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.274 +   (eval $ac_try) 2>&5
 181.275 +   ac_status=$?
 181.276 +@@ -5064,8 +5038,7 @@
 181.277 +   cat conftest.err >&5
 181.278 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.279 +   (exit $ac_status); } &&
 181.280 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.281 +-			 || test ! -s conftest.err'
 181.282 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.283 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.284 +   (eval $ac_try) 2>&5
 181.285 +   ac_status=$?
 181.286 +@@ -5108,8 +5081,7 @@
 181.287 +   cat conftest.err >&5
 181.288 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.289 +   (exit $ac_status); } &&
 181.290 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.291 +-			 || test ! -s conftest.err'
 181.292 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.293 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.294 +   (eval $ac_try) 2>&5
 181.295 +   ac_status=$?
 181.296 +@@ -5173,8 +5145,7 @@
 181.297 +   cat conftest.err >&5
 181.298 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.299 +   (exit $ac_status); } &&
 181.300 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.301 +-			 || test ! -s conftest.err'
 181.302 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.303 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.304 +   (eval $ac_try) 2>&5
 181.305 +   ac_status=$?
 181.306 +@@ -5217,8 +5188,7 @@
 181.307 +   cat conftest.err >&5
 181.308 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.309 +   (exit $ac_status); } &&
 181.310 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.311 +-			 || test ! -s conftest.err'
 181.312 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.313 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.314 +   (eval $ac_try) 2>&5
 181.315 +   ac_status=$?
 181.316 +@@ -5286,8 +5256,7 @@
 181.317 +   cat conftest.err >&5
 181.318 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.319 +   (exit $ac_status); } &&
 181.320 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.321 +-			 || test ! -s conftest.err'
 181.322 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.323 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.324 +   (eval $ac_try) 2>&5
 181.325 +   ac_status=$?
 181.326 +@@ -5320,6 +5289,73 @@
 181.327 + 
 181.328 + fi
 181.329 + 
 181.330 ++echo "$as_me:$LINENO: checking for statfs64 in sys/(statfs|vfs).h" >&5
 181.331 ++echo $ECHO_N "checking for statfs64 in sys/(statfs|vfs).h... $ECHO_C" >&6
 181.332 ++if test "${ac_cv_type_statfs64+set}" = set; then
 181.333 ++  echo $ECHO_N "(cached) $ECHO_C" >&6
 181.334 ++else
 181.335 ++  cat >conftest.$ac_ext <<_ACEOF
 181.336 ++/* confdefs.h.  */
 181.337 ++_ACEOF
 181.338 ++cat confdefs.h >>conftest.$ac_ext
 181.339 ++cat >>conftest.$ac_ext <<_ACEOF
 181.340 ++/* end confdefs.h.  */
 181.341 ++#ifdef LINUX
 181.342 ++#include <linux/types.h>
 181.343 ++#include <sys/statfs.h>
 181.344 ++#else
 181.345 ++#include <sys/vfs.h>
 181.346 ++#endif
 181.347 ++int
 181.348 ++main ()
 181.349 ++{
 181.350 ++struct statfs64 st;
 181.351 ++  ;
 181.352 ++  return 0;
 181.353 ++}
 181.354 ++_ACEOF
 181.355 ++rm -f conftest.$ac_objext
 181.356 ++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
 181.357 ++  (eval $ac_compile) 2>conftest.er1
 181.358 ++  ac_status=$?
 181.359 ++  grep -v '^ *+' conftest.er1 >conftest.err
 181.360 ++  rm -f conftest.er1
 181.361 ++  cat conftest.err >&5
 181.362 ++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.363 ++  (exit $ac_status); } &&
 181.364 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.365 ++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.366 ++  (eval $ac_try) 2>&5
 181.367 ++  ac_status=$?
 181.368 ++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.369 ++  (exit $ac_status); }; } &&
 181.370 ++	 { ac_try='test -s conftest.$ac_objext'
 181.371 ++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.372 ++  (eval $ac_try) 2>&5
 181.373 ++  ac_status=$?
 181.374 ++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.375 ++  (exit $ac_status); }; }; then
 181.376 ++  ac_cv_type_statfs64=yes
 181.377 ++else
 181.378 ++  echo "$as_me: failed program was:" >&5
 181.379 ++sed 's/^/| /' conftest.$ac_ext >&5
 181.380 ++
 181.381 ++ac_cv_type_statfs64=no
 181.382 ++fi
 181.383 ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 181.384 ++fi
 181.385 ++
 181.386 ++echo "$as_me:$LINENO: result: $ac_cv_type_statfs64" >&5
 181.387 ++echo "${ECHO_T}$ac_cv_type_statfs64" >&6
 181.388 ++if test "$ac_cv_type_statfs64" = yes
 181.389 ++then
 181.390 ++
 181.391 ++cat >>confdefs.h <<\_ACEOF
 181.392 ++#define HAVE_STATFS64 1
 181.393 ++_ACEOF
 181.394 ++
 181.395 ++fi
 181.396 ++
 181.397 + 
 181.398 + echo "$as_me:$LINENO: checking return type of signal handlers" >&5
 181.399 + echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6
 181.400 +@@ -5360,8 +5396,7 @@
 181.401 +   cat conftest.err >&5
 181.402 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.403 +   (exit $ac_status); } &&
 181.404 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.405 +-			 || test ! -s conftest.err'
 181.406 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.407 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.408 +   (eval $ac_try) 2>&5
 181.409 +   ac_status=$?
 181.410 +@@ -5460,8 +5495,7 @@
 181.411 +   cat conftest.err >&5
 181.412 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.413 +   (exit $ac_status); } &&
 181.414 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.415 +-			 || test ! -s conftest.err'
 181.416 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.417 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.418 +   (eval $ac_try) 2>&5
 181.419 +   ac_status=$?
 181.420 +@@ -5610,8 +5644,7 @@
 181.421 +   cat conftest.err >&5
 181.422 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.423 +   (exit $ac_status); } &&
 181.424 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.425 +-			 || test ! -s conftest.err'
 181.426 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.427 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.428 +   (eval $ac_try) 2>&5
 181.429 +   ac_status=$?
 181.430 +@@ -5668,8 +5701,7 @@
 181.431 +   cat conftest.err >&5
 181.432 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.433 +   (exit $ac_status); } &&
 181.434 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.435 +-			 || test ! -s conftest.err'
 181.436 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.437 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.438 +   (eval $ac_try) 2>&5
 181.439 +   ac_status=$?
 181.440 +@@ -5816,8 +5848,7 @@
 181.441 +   cat conftest.err >&5
 181.442 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.443 +   (exit $ac_status); } &&
 181.444 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.445 +-			 || test ! -s conftest.err'
 181.446 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.447 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.448 +   (eval $ac_try) 2>&5
 181.449 +   ac_status=$?
 181.450 +@@ -5968,8 +5999,7 @@
 181.451 +   cat conftest.err >&5
 181.452 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.453 +   (exit $ac_status); } &&
 181.454 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.455 +-			 || test ! -s conftest.err'
 181.456 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.457 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.458 +   (eval $ac_try) 2>&5
 181.459 +   ac_status=$?
 181.460 +@@ -6033,8 +6063,7 @@
 181.461 +   cat conftest.err >&5
 181.462 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.463 +   (exit $ac_status); } &&
 181.464 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.465 +-			 || test ! -s conftest.err'
 181.466 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.467 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.468 +   (eval $ac_try) 2>&5
 181.469 +   ac_status=$?
 181.470 +@@ -6100,8 +6129,7 @@
 181.471 +   cat conftest.err >&5
 181.472 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.473 +   (exit $ac_status); } &&
 181.474 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.475 +-			 || test ! -s conftest.err'
 181.476 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.477 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.478 +   (eval $ac_try) 2>&5
 181.479 +   ac_status=$?
 181.480 +@@ -6147,8 +6175,7 @@
 181.481 +   cat conftest.err >&5
 181.482 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.483 +   (exit $ac_status); } &&
 181.484 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.485 +-			 || test ! -s conftest.err'
 181.486 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.487 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.488 +   (eval $ac_try) 2>&5
 181.489 +   ac_status=$?
 181.490 +@@ -6214,8 +6241,7 @@
 181.491 +   cat conftest.err >&5
 181.492 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.493 +   (exit $ac_status); } &&
 181.494 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.495 +-			 || test ! -s conftest.err'
 181.496 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.497 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.498 +   (eval $ac_try) 2>&5
 181.499 +   ac_status=$?
 181.500 +@@ -6466,8 +6492,7 @@
 181.501 +   cat conftest.err >&5
 181.502 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.503 +   (exit $ac_status); } &&
 181.504 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.505 +-			 || test ! -s conftest.err'
 181.506 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.507 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.508 +   (eval $ac_try) 2>&5
 181.509 +   ac_status=$?
 181.510 +@@ -6532,8 +6557,7 @@
 181.511 +   cat conftest.err >&5
 181.512 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.513 +   (exit $ac_status); } &&
 181.514 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.515 +-			 || test ! -s conftest.err'
 181.516 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.517 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.518 +   (eval $ac_try) 2>&5
 181.519 +   ac_status=$?
 181.520 +@@ -6600,8 +6624,7 @@
 181.521 +   cat conftest.err >&5
 181.522 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.523 +   (exit $ac_status); } &&
 181.524 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.525 +-			 || test ! -s conftest.err'
 181.526 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.527 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.528 +   (eval $ac_try) 2>&5
 181.529 +   ac_status=$?
 181.530 +@@ -6717,8 +6740,7 @@
 181.531 +   cat conftest.err >&5
 181.532 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.533 +   (exit $ac_status); } &&
 181.534 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.535 +-			 || test ! -s conftest.err'
 181.536 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.537 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.538 +   (eval $ac_try) 2>&5
 181.539 +   ac_status=$?
 181.540 +@@ -6812,8 +6834,7 @@
 181.541 +   cat conftest.err >&5
 181.542 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.543 +   (exit $ac_status); } &&
 181.544 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.545 +-			 || test ! -s conftest.err'
 181.546 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.547 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.548 +   (eval $ac_try) 2>&5
 181.549 +   ac_status=$?
 181.550 +@@ -6959,8 +6980,7 @@
 181.551 +   cat conftest.err >&5
 181.552 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.553 +   (exit $ac_status); } &&
 181.554 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.555 +-			 || test ! -s conftest.err'
 181.556 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.557 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.558 +   (eval $ac_try) 2>&5
 181.559 +   ac_status=$?
 181.560 +@@ -7020,8 +7040,7 @@
 181.561 +   cat conftest.err >&5
 181.562 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.563 +   (exit $ac_status); } &&
 181.564 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.565 +-			 || test ! -s conftest.err'
 181.566 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.567 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.568 +   (eval $ac_try) 2>&5
 181.569 +   ac_status=$?
 181.570 +@@ -7082,8 +7101,7 @@
 181.571 +   cat conftest.err >&5
 181.572 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.573 +   (exit $ac_status); } &&
 181.574 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.575 +-			 || test ! -s conftest.err'
 181.576 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.577 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.578 +   (eval $ac_try) 2>&5
 181.579 +   ac_status=$?
 181.580 +@@ -7356,8 +7374,7 @@
 181.581 +   cat conftest.err >&5
 181.582 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.583 +   (exit $ac_status); } &&
 181.584 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.585 +-			 || test ! -s conftest.err'
 181.586 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.587 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.588 +   (eval $ac_try) 2>&5
 181.589 +   ac_status=$?
 181.590 +@@ -7401,8 +7418,7 @@
 181.591 +   cat conftest.err >&5
 181.592 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.593 +   (exit $ac_status); } &&
 181.594 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.595 +-			 || test ! -s conftest.err'
 181.596 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.597 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.598 +   (eval $ac_try) 2>&5
 181.599 +   ac_status=$?
 181.600 +@@ -7471,8 +7487,7 @@
 181.601 +   cat conftest.err >&5
 181.602 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.603 +   (exit $ac_status); } &&
 181.604 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.605 +-			 || test ! -s conftest.err'
 181.606 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.607 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.608 +   (eval $ac_try) 2>&5
 181.609 +   ac_status=$?
 181.610 +@@ -7539,8 +7554,7 @@
 181.611 +   cat conftest.err >&5
 181.612 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.613 +   (exit $ac_status); } &&
 181.614 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.615 +-			 || test ! -s conftest.err'
 181.616 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.617 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.618 +   (eval $ac_try) 2>&5
 181.619 +   ac_status=$?
 181.620 +@@ -7585,8 +7599,7 @@
 181.621 +   cat conftest.err >&5
 181.622 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.623 +   (exit $ac_status); } &&
 181.624 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.625 +-			 || test ! -s conftest.err'
 181.626 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.627 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.628 +   (eval $ac_try) 2>&5
 181.629 +   ac_status=$?
 181.630 +@@ -7652,8 +7665,7 @@
 181.631 +   cat conftest.err >&5
 181.632 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.633 +   (exit $ac_status); } &&
 181.634 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.635 +-			 || test ! -s conftest.err'
 181.636 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.637 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.638 +   (eval $ac_try) 2>&5
 181.639 +   ac_status=$?
 181.640 +@@ -7698,8 +7710,7 @@
 181.641 +   cat conftest.err >&5
 181.642 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.643 +   (exit $ac_status); } &&
 181.644 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.645 +-			 || test ! -s conftest.err'
 181.646 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.647 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.648 +   (eval $ac_try) 2>&5
 181.649 +   ac_status=$?
 181.650 +@@ -7767,8 +7778,7 @@
 181.651 +   cat conftest.err >&5
 181.652 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.653 +   (exit $ac_status); } &&
 181.654 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.655 +-			 || test ! -s conftest.err'
 181.656 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.657 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.658 +   (eval $ac_try) 2>&5
 181.659 +   ac_status=$?
 181.660 +@@ -7834,8 +7844,7 @@
 181.661 +   cat conftest.err >&5
 181.662 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.663 +   (exit $ac_status); } &&
 181.664 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.665 +-			 || test ! -s conftest.err'
 181.666 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.667 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.668 +   (eval $ac_try) 2>&5
 181.669 +   ac_status=$?
 181.670 +@@ -7899,8 +7908,7 @@
 181.671 +   cat conftest.err >&5
 181.672 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.673 +   (exit $ac_status); } &&
 181.674 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.675 +-			 || test ! -s conftest.err'
 181.676 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.677 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.678 +   (eval $ac_try) 2>&5
 181.679 +   ac_status=$?
 181.680 +@@ -7966,8 +7974,7 @@
 181.681 +   cat conftest.err >&5
 181.682 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.683 +   (exit $ac_status); } &&
 181.684 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.685 +-			 || test ! -s conftest.err'
 181.686 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.687 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.688 +   (eval $ac_try) 2>&5
 181.689 +   ac_status=$?
 181.690 +@@ -8032,8 +8039,7 @@
 181.691 +   cat conftest.err >&5
 181.692 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.693 +   (exit $ac_status); } &&
 181.694 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.695 +-			 || test ! -s conftest.err'
 181.696 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.697 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.698 +   (eval $ac_try) 2>&5
 181.699 +   ac_status=$?
 181.700 +@@ -8077,8 +8083,7 @@
 181.701 +   cat conftest.err >&5
 181.702 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.703 +   (exit $ac_status); } &&
 181.704 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.705 +-			 || test ! -s conftest.err'
 181.706 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.707 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.708 +   (eval $ac_try) 2>&5
 181.709 +   ac_status=$?
 181.710 +@@ -8145,8 +8150,7 @@
 181.711 +   cat conftest.err >&5
 181.712 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.713 +   (exit $ac_status); } &&
 181.714 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.715 +-			 || test ! -s conftest.err'
 181.716 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.717 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.718 +   (eval $ac_try) 2>&5
 181.719 +   ac_status=$?
 181.720 +@@ -8218,8 +8222,7 @@
 181.721 +   cat conftest.err >&5
 181.722 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.723 +   (exit $ac_status); } &&
 181.724 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.725 +-			 || test ! -s conftest.err'
 181.726 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.727 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.728 +   (eval $ac_try) 2>&5
 181.729 +   ac_status=$?
 181.730 +@@ -8289,8 +8292,7 @@
 181.731 +   cat conftest.err >&5
 181.732 +   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 181.733 +   (exit $ac_status); } &&
 181.734 +-	 { ac_try='test -z "$ac_c_werror_flag"
 181.735 +-			 || test ! -s conftest.err'
 181.736 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 181.737 +   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 181.738 +   (eval $ac_try) 2>&5
 181.739 +   ac_status=$?
 181.740 +@@ -9293,11 +9295,6 @@
 181.741 +   *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
 181.742 +   esac
 181.743 + 
 181.744 +-  if test x"$ac_file" != x-; then
 181.745 +-    { echo "$as_me:$LINENO: creating $ac_file" >&5
 181.746 +-echo "$as_me: creating $ac_file" >&6;}
 181.747 +-    rm -f "$ac_file"
 181.748 +-  fi
 181.749 +   # Let's still pretend it is `configure' which instantiates (i.e., don't
 181.750 +   # use $as_me), people would be surprised to read:
 181.751 +   #    /* config.h.  Generated by config.status.  */
 181.752 +@@ -9336,6 +9333,12 @@
 181.753 + 	 fi;;
 181.754 +       esac
 181.755 +     done` || { (exit 1); exit 1; }
 181.756 ++
 181.757 ++  if test x"$ac_file" != x-; then
 181.758 ++    { echo "$as_me:$LINENO: creating $ac_file" >&5
 181.759 ++echo "$as_me: creating $ac_file" >&6;}
 181.760 ++    rm -f "$ac_file"
 181.761 ++  fi
 181.762 + _ACEOF
 181.763 + cat >>$CONFIG_STATUS <<_ACEOF
 181.764 +   sed "$ac_vpsub
   182.1 --- a/patches/strace/4.5.15/100-strace-autoreconf.patch	Mon Jul 28 20:17:48 2008 +0000
   182.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   182.3 @@ -1,761 +0,0 @@
   182.4 -diff -dur strace-4.5.15.orig/configure strace-4.5.15/configure
   182.5 ---- strace-4.5.15.orig/configure	2007-01-11 23:23:33.000000000 +0100
   182.6 -+++ strace-4.5.15/configure	2007-07-14 19:18:43.000000000 +0200
   182.7 -@@ -956,7 +956,7 @@
   182.8 -     else
   182.9 -       echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
  182.10 -     fi
  182.11 --    cd $ac_popdir
  182.12 -+    cd "$ac_popdir"
  182.13 -   done
  182.14 - fi
  182.15 - 
  182.16 -@@ -2660,8 +2660,7 @@
  182.17 -   cat conftest.err >&5
  182.18 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
  182.19 -   (exit $ac_status); } &&
  182.20 --	 { ac_try='test -z "$ac_c_werror_flag"
  182.21 --			 || test ! -s conftest.err'
  182.22 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
  182.23 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  182.24 -   (eval $ac_try) 2>&5
  182.25 -   ac_status=$?
  182.26 -@@ -2719,8 +2718,7 @@
  182.27 -   cat conftest.err >&5
  182.28 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
  182.29 -   (exit $ac_status); } &&
  182.30 --	 { ac_try='test -z "$ac_c_werror_flag"
  182.31 --			 || test ! -s conftest.err'
  182.32 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
  182.33 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  182.34 -   (eval $ac_try) 2>&5
  182.35 -   ac_status=$?
  182.36 -@@ -2836,8 +2834,7 @@
  182.37 -   cat conftest.err >&5
  182.38 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
  182.39 -   (exit $ac_status); } &&
  182.40 --	 { ac_try='test -z "$ac_c_werror_flag"
  182.41 --			 || test ! -s conftest.err'
  182.42 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
  182.43 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  182.44 -   (eval $ac_try) 2>&5
  182.45 -   ac_status=$?
  182.46 -@@ -2891,8 +2888,7 @@
  182.47 -   cat conftest.err >&5
  182.48 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
  182.49 -   (exit $ac_status); } &&
  182.50 --	 { ac_try='test -z "$ac_c_werror_flag"
  182.51 --			 || test ! -s conftest.err'
  182.52 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
  182.53 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  182.54 -   (eval $ac_try) 2>&5
  182.55 -   ac_status=$?
  182.56 -@@ -2937,8 +2933,7 @@
  182.57 -   cat conftest.err >&5
  182.58 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
  182.59 -   (exit $ac_status); } &&
  182.60 --	 { ac_try='test -z "$ac_c_werror_flag"
  182.61 --			 || test ! -s conftest.err'
  182.62 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
  182.63 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  182.64 -   (eval $ac_try) 2>&5
  182.65 -   ac_status=$?
  182.66 -@@ -2982,8 +2977,7 @@
  182.67 -   cat conftest.err >&5
  182.68 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
  182.69 -   (exit $ac_status); } &&
  182.70 --	 { ac_try='test -z "$ac_c_werror_flag"
  182.71 --			 || test ! -s conftest.err'
  182.72 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
  182.73 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  182.74 -   (eval $ac_try) 2>&5
  182.75 -   ac_status=$?
  182.76 -@@ -3721,8 +3715,7 @@
  182.77 -   cat conftest.err >&5
  182.78 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
  182.79 -   (exit $ac_status); } &&
  182.80 --	 { ac_try='test -z "$ac_c_werror_flag"
  182.81 --			 || test ! -s conftest.err'
  182.82 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
  182.83 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  182.84 -   (eval $ac_try) 2>&5
  182.85 -   ac_status=$?
  182.86 -@@ -3786,8 +3779,7 @@
  182.87 -   cat conftest.err >&5
  182.88 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
  182.89 -   (exit $ac_status); } &&
  182.90 --	 { ac_try='test -z "$ac_c_werror_flag"
  182.91 --			 || test ! -s conftest.err'
  182.92 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
  182.93 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  182.94 -   (eval $ac_try) 2>&5
  182.95 -   ac_status=$?
  182.96 -@@ -3959,8 +3951,7 @@
  182.97 -   cat conftest.err >&5
  182.98 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
  182.99 -   (exit $ac_status); } &&
 182.100 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.101 --			 || test ! -s conftest.err'
 182.102 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.103 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.104 -   (eval $ac_try) 2>&5
 182.105 -   ac_status=$?
 182.106 -@@ -4032,8 +4023,7 @@
 182.107 -   cat conftest.err >&5
 182.108 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.109 -   (exit $ac_status); } &&
 182.110 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.111 --			 || test ! -s conftest.err'
 182.112 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.113 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.114 -   (eval $ac_try) 2>&5
 182.115 -   ac_status=$?
 182.116 -@@ -4087,8 +4077,7 @@
 182.117 -   cat conftest.err >&5
 182.118 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.119 -   (exit $ac_status); } &&
 182.120 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.121 --			 || test ! -s conftest.err'
 182.122 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.123 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.124 -   (eval $ac_try) 2>&5
 182.125 -   ac_status=$?
 182.126 -@@ -4159,8 +4148,7 @@
 182.127 -   cat conftest.err >&5
 182.128 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.129 -   (exit $ac_status); } &&
 182.130 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.131 --			 || test ! -s conftest.err'
 182.132 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.133 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.134 -   (eval $ac_try) 2>&5
 182.135 -   ac_status=$?
 182.136 -@@ -4214,8 +4202,7 @@
 182.137 -   cat conftest.err >&5
 182.138 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.139 -   (exit $ac_status); } &&
 182.140 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.141 --			 || test ! -s conftest.err'
 182.142 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.143 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.144 -   (eval $ac_try) 2>&5
 182.145 -   ac_status=$?
 182.146 -@@ -4345,8 +4332,7 @@
 182.147 -   cat conftest.err >&5
 182.148 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.149 -   (exit $ac_status); } &&
 182.150 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.151 --			 || test ! -s conftest.err'
 182.152 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.153 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.154 -   (eval $ac_try) 2>&5
 182.155 -   ac_status=$?
 182.156 -@@ -4410,8 +4396,7 @@
 182.157 -   cat conftest.err >&5
 182.158 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.159 -   (exit $ac_status); } &&
 182.160 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.161 --			 || test ! -s conftest.err'
 182.162 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.163 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.164 -   (eval $ac_try) 2>&5
 182.165 -   ac_status=$?
 182.166 -@@ -4454,8 +4439,7 @@
 182.167 -   cat conftest.err >&5
 182.168 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.169 -   (exit $ac_status); } &&
 182.170 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.171 --			 || test ! -s conftest.err'
 182.172 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.173 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.174 -   (eval $ac_try) 2>&5
 182.175 -   ac_status=$?
 182.176 -@@ -4519,8 +4503,7 @@
 182.177 -   cat conftest.err >&5
 182.178 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.179 -   (exit $ac_status); } &&
 182.180 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.181 --			 || test ! -s conftest.err'
 182.182 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.183 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.184 -   (eval $ac_try) 2>&5
 182.185 -   ac_status=$?
 182.186 -@@ -4563,8 +4546,7 @@
 182.187 -   cat conftest.err >&5
 182.188 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.189 -   (exit $ac_status); } &&
 182.190 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.191 --			 || test ! -s conftest.err'
 182.192 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.193 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.194 -   (eval $ac_try) 2>&5
 182.195 -   ac_status=$?
 182.196 -@@ -4628,8 +4610,7 @@
 182.197 -   cat conftest.err >&5
 182.198 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.199 -   (exit $ac_status); } &&
 182.200 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.201 --			 || test ! -s conftest.err'
 182.202 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.203 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.204 -   (eval $ac_try) 2>&5
 182.205 -   ac_status=$?
 182.206 -@@ -4672,8 +4653,7 @@
 182.207 -   cat conftest.err >&5
 182.208 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.209 -   (exit $ac_status); } &&
 182.210 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.211 --			 || test ! -s conftest.err'
 182.212 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.213 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.214 -   (eval $ac_try) 2>&5
 182.215 -   ac_status=$?
 182.216 -@@ -4737,8 +4717,7 @@
 182.217 -   cat conftest.err >&5
 182.218 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.219 -   (exit $ac_status); } &&
 182.220 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.221 --			 || test ! -s conftest.err'
 182.222 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.223 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.224 -   (eval $ac_try) 2>&5
 182.225 -   ac_status=$?
 182.226 -@@ -4781,8 +4760,7 @@
 182.227 -   cat conftest.err >&5
 182.228 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.229 -   (exit $ac_status); } &&
 182.230 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.231 --			 || test ! -s conftest.err'
 182.232 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.233 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.234 -   (eval $ac_try) 2>&5
 182.235 -   ac_status=$?
 182.236 -@@ -4846,8 +4824,7 @@
 182.237 -   cat conftest.err >&5
 182.238 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.239 -   (exit $ac_status); } &&
 182.240 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.241 --			 || test ! -s conftest.err'
 182.242 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.243 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.244 -   (eval $ac_try) 2>&5
 182.245 -   ac_status=$?
 182.246 -@@ -4890,8 +4867,7 @@
 182.247 -   cat conftest.err >&5
 182.248 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.249 -   (exit $ac_status); } &&
 182.250 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.251 --			 || test ! -s conftest.err'
 182.252 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.253 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.254 -   (eval $ac_try) 2>&5
 182.255 -   ac_status=$?
 182.256 -@@ -4955,8 +4931,7 @@
 182.257 -   cat conftest.err >&5
 182.258 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.259 -   (exit $ac_status); } &&
 182.260 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.261 --			 || test ! -s conftest.err'
 182.262 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.263 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.264 -   (eval $ac_try) 2>&5
 182.265 -   ac_status=$?
 182.266 -@@ -4999,8 +4974,7 @@
 182.267 -   cat conftest.err >&5
 182.268 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.269 -   (exit $ac_status); } &&
 182.270 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.271 --			 || test ! -s conftest.err'
 182.272 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.273 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.274 -   (eval $ac_try) 2>&5
 182.275 -   ac_status=$?
 182.276 -@@ -5064,8 +5038,7 @@
 182.277 -   cat conftest.err >&5
 182.278 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.279 -   (exit $ac_status); } &&
 182.280 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.281 --			 || test ! -s conftest.err'
 182.282 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.283 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.284 -   (eval $ac_try) 2>&5
 182.285 -   ac_status=$?
 182.286 -@@ -5108,8 +5081,7 @@
 182.287 -   cat conftest.err >&5
 182.288 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.289 -   (exit $ac_status); } &&
 182.290 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.291 --			 || test ! -s conftest.err'
 182.292 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.293 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.294 -   (eval $ac_try) 2>&5
 182.295 -   ac_status=$?
 182.296 -@@ -5173,8 +5145,7 @@
 182.297 -   cat conftest.err >&5
 182.298 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.299 -   (exit $ac_status); } &&
 182.300 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.301 --			 || test ! -s conftest.err'
 182.302 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.303 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.304 -   (eval $ac_try) 2>&5
 182.305 -   ac_status=$?
 182.306 -@@ -5217,8 +5188,7 @@
 182.307 -   cat conftest.err >&5
 182.308 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.309 -   (exit $ac_status); } &&
 182.310 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.311 --			 || test ! -s conftest.err'
 182.312 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.313 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.314 -   (eval $ac_try) 2>&5
 182.315 -   ac_status=$?
 182.316 -@@ -5286,8 +5256,7 @@
 182.317 -   cat conftest.err >&5
 182.318 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.319 -   (exit $ac_status); } &&
 182.320 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.321 --			 || test ! -s conftest.err'
 182.322 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.323 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.324 -   (eval $ac_try) 2>&5
 182.325 -   ac_status=$?
 182.326 -@@ -5320,6 +5289,73 @@
 182.327 - 
 182.328 - fi
 182.329 - 
 182.330 -+echo "$as_me:$LINENO: checking for statfs64 in sys/(statfs|vfs).h" >&5
 182.331 -+echo $ECHO_N "checking for statfs64 in sys/(statfs|vfs).h... $ECHO_C" >&6
 182.332 -+if test "${ac_cv_type_statfs64+set}" = set; then
 182.333 -+  echo $ECHO_N "(cached) $ECHO_C" >&6
 182.334 -+else
 182.335 -+  cat >conftest.$ac_ext <<_ACEOF
 182.336 -+/* confdefs.h.  */
 182.337 -+_ACEOF
 182.338 -+cat confdefs.h >>conftest.$ac_ext
 182.339 -+cat >>conftest.$ac_ext <<_ACEOF
 182.340 -+/* end confdefs.h.  */
 182.341 -+#ifdef LINUX
 182.342 -+#include <linux/types.h>
 182.343 -+#include <sys/statfs.h>
 182.344 -+#else
 182.345 -+#include <sys/vfs.h>
 182.346 -+#endif
 182.347 -+int
 182.348 -+main ()
 182.349 -+{
 182.350 -+struct statfs64 st;
 182.351 -+  ;
 182.352 -+  return 0;
 182.353 -+}
 182.354 -+_ACEOF
 182.355 -+rm -f conftest.$ac_objext
 182.356 -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
 182.357 -+  (eval $ac_compile) 2>conftest.er1
 182.358 -+  ac_status=$?
 182.359 -+  grep -v '^ *+' conftest.er1 >conftest.err
 182.360 -+  rm -f conftest.er1
 182.361 -+  cat conftest.err >&5
 182.362 -+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.363 -+  (exit $ac_status); } &&
 182.364 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.365 -+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.366 -+  (eval $ac_try) 2>&5
 182.367 -+  ac_status=$?
 182.368 -+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.369 -+  (exit $ac_status); }; } &&
 182.370 -+	 { ac_try='test -s conftest.$ac_objext'
 182.371 -+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.372 -+  (eval $ac_try) 2>&5
 182.373 -+  ac_status=$?
 182.374 -+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.375 -+  (exit $ac_status); }; }; then
 182.376 -+  ac_cv_type_statfs64=yes
 182.377 -+else
 182.378 -+  echo "$as_me: failed program was:" >&5
 182.379 -+sed 's/^/| /' conftest.$ac_ext >&5
 182.380 -+
 182.381 -+ac_cv_type_statfs64=no
 182.382 -+fi
 182.383 -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 182.384 -+fi
 182.385 -+
 182.386 -+echo "$as_me:$LINENO: result: $ac_cv_type_statfs64" >&5
 182.387 -+echo "${ECHO_T}$ac_cv_type_statfs64" >&6
 182.388 -+if test "$ac_cv_type_statfs64" = yes
 182.389 -+then
 182.390 -+
 182.391 -+cat >>confdefs.h <<\_ACEOF
 182.392 -+#define HAVE_STATFS64 1
 182.393 -+_ACEOF
 182.394 -+
 182.395 -+fi
 182.396 -+
 182.397 - 
 182.398 - echo "$as_me:$LINENO: checking return type of signal handlers" >&5
 182.399 - echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6
 182.400 -@@ -5360,8 +5396,7 @@
 182.401 -   cat conftest.err >&5
 182.402 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.403 -   (exit $ac_status); } &&
 182.404 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.405 --			 || test ! -s conftest.err'
 182.406 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.407 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.408 -   (eval $ac_try) 2>&5
 182.409 -   ac_status=$?
 182.410 -@@ -5460,8 +5495,7 @@
 182.411 -   cat conftest.err >&5
 182.412 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.413 -   (exit $ac_status); } &&
 182.414 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.415 --			 || test ! -s conftest.err'
 182.416 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.417 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.418 -   (eval $ac_try) 2>&5
 182.419 -   ac_status=$?
 182.420 -@@ -5610,8 +5644,7 @@
 182.421 -   cat conftest.err >&5
 182.422 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.423 -   (exit $ac_status); } &&
 182.424 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.425 --			 || test ! -s conftest.err'
 182.426 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.427 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.428 -   (eval $ac_try) 2>&5
 182.429 -   ac_status=$?
 182.430 -@@ -5668,8 +5701,7 @@
 182.431 -   cat conftest.err >&5
 182.432 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.433 -   (exit $ac_status); } &&
 182.434 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.435 --			 || test ! -s conftest.err'
 182.436 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.437 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.438 -   (eval $ac_try) 2>&5
 182.439 -   ac_status=$?
 182.440 -@@ -5816,8 +5848,7 @@
 182.441 -   cat conftest.err >&5
 182.442 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.443 -   (exit $ac_status); } &&
 182.444 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.445 --			 || test ! -s conftest.err'
 182.446 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.447 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.448 -   (eval $ac_try) 2>&5
 182.449 -   ac_status=$?
 182.450 -@@ -5968,8 +5999,7 @@
 182.451 -   cat conftest.err >&5
 182.452 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.453 -   (exit $ac_status); } &&
 182.454 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.455 --			 || test ! -s conftest.err'
 182.456 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.457 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.458 -   (eval $ac_try) 2>&5
 182.459 -   ac_status=$?
 182.460 -@@ -6033,8 +6063,7 @@
 182.461 -   cat conftest.err >&5
 182.462 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.463 -   (exit $ac_status); } &&
 182.464 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.465 --			 || test ! -s conftest.err'
 182.466 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.467 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.468 -   (eval $ac_try) 2>&5
 182.469 -   ac_status=$?
 182.470 -@@ -6100,8 +6129,7 @@
 182.471 -   cat conftest.err >&5
 182.472 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.473 -   (exit $ac_status); } &&
 182.474 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.475 --			 || test ! -s conftest.err'
 182.476 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.477 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.478 -   (eval $ac_try) 2>&5
 182.479 -   ac_status=$?
 182.480 -@@ -6147,8 +6175,7 @@
 182.481 -   cat conftest.err >&5
 182.482 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.483 -   (exit $ac_status); } &&
 182.484 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.485 --			 || test ! -s conftest.err'
 182.486 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.487 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.488 -   (eval $ac_try) 2>&5
 182.489 -   ac_status=$?
 182.490 -@@ -6214,8 +6241,7 @@
 182.491 -   cat conftest.err >&5
 182.492 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.493 -   (exit $ac_status); } &&
 182.494 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.495 --			 || test ! -s conftest.err'
 182.496 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.497 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.498 -   (eval $ac_try) 2>&5
 182.499 -   ac_status=$?
 182.500 -@@ -6466,8 +6492,7 @@
 182.501 -   cat conftest.err >&5
 182.502 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.503 -   (exit $ac_status); } &&
 182.504 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.505 --			 || test ! -s conftest.err'
 182.506 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.507 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.508 -   (eval $ac_try) 2>&5
 182.509 -   ac_status=$?
 182.510 -@@ -6532,8 +6557,7 @@
 182.511 -   cat conftest.err >&5
 182.512 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.513 -   (exit $ac_status); } &&
 182.514 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.515 --			 || test ! -s conftest.err'
 182.516 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.517 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.518 -   (eval $ac_try) 2>&5
 182.519 -   ac_status=$?
 182.520 -@@ -6600,8 +6624,7 @@
 182.521 -   cat conftest.err >&5
 182.522 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.523 -   (exit $ac_status); } &&
 182.524 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.525 --			 || test ! -s conftest.err'
 182.526 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.527 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.528 -   (eval $ac_try) 2>&5
 182.529 -   ac_status=$?
 182.530 -@@ -6717,8 +6740,7 @@
 182.531 -   cat conftest.err >&5
 182.532 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.533 -   (exit $ac_status); } &&
 182.534 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.535 --			 || test ! -s conftest.err'
 182.536 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.537 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.538 -   (eval $ac_try) 2>&5
 182.539 -   ac_status=$?
 182.540 -@@ -6812,8 +6834,7 @@
 182.541 -   cat conftest.err >&5
 182.542 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.543 -   (exit $ac_status); } &&
 182.544 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.545 --			 || test ! -s conftest.err'
 182.546 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.547 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.548 -   (eval $ac_try) 2>&5
 182.549 -   ac_status=$?
 182.550 -@@ -6959,8 +6980,7 @@
 182.551 -   cat conftest.err >&5
 182.552 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.553 -   (exit $ac_status); } &&
 182.554 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.555 --			 || test ! -s conftest.err'
 182.556 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.557 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.558 -   (eval $ac_try) 2>&5
 182.559 -   ac_status=$?
 182.560 -@@ -7020,8 +7040,7 @@
 182.561 -   cat conftest.err >&5
 182.562 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.563 -   (exit $ac_status); } &&
 182.564 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.565 --			 || test ! -s conftest.err'
 182.566 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.567 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.568 -   (eval $ac_try) 2>&5
 182.569 -   ac_status=$?
 182.570 -@@ -7082,8 +7101,7 @@
 182.571 -   cat conftest.err >&5
 182.572 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.573 -   (exit $ac_status); } &&
 182.574 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.575 --			 || test ! -s conftest.err'
 182.576 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.577 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.578 -   (eval $ac_try) 2>&5
 182.579 -   ac_status=$?
 182.580 -@@ -7356,8 +7374,7 @@
 182.581 -   cat conftest.err >&5
 182.582 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.583 -   (exit $ac_status); } &&
 182.584 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.585 --			 || test ! -s conftest.err'
 182.586 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.587 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.588 -   (eval $ac_try) 2>&5
 182.589 -   ac_status=$?
 182.590 -@@ -7401,8 +7418,7 @@
 182.591 -   cat conftest.err >&5
 182.592 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.593 -   (exit $ac_status); } &&
 182.594 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.595 --			 || test ! -s conftest.err'
 182.596 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.597 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.598 -   (eval $ac_try) 2>&5
 182.599 -   ac_status=$?
 182.600 -@@ -7471,8 +7487,7 @@
 182.601 -   cat conftest.err >&5
 182.602 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.603 -   (exit $ac_status); } &&
 182.604 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.605 --			 || test ! -s conftest.err'
 182.606 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.607 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.608 -   (eval $ac_try) 2>&5
 182.609 -   ac_status=$?
 182.610 -@@ -7539,8 +7554,7 @@
 182.611 -   cat conftest.err >&5
 182.612 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.613 -   (exit $ac_status); } &&
 182.614 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.615 --			 || test ! -s conftest.err'
 182.616 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.617 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.618 -   (eval $ac_try) 2>&5
 182.619 -   ac_status=$?
 182.620 -@@ -7585,8 +7599,7 @@
 182.621 -   cat conftest.err >&5
 182.622 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.623 -   (exit $ac_status); } &&
 182.624 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.625 --			 || test ! -s conftest.err'
 182.626 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.627 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.628 -   (eval $ac_try) 2>&5
 182.629 -   ac_status=$?
 182.630 -@@ -7652,8 +7665,7 @@
 182.631 -   cat conftest.err >&5
 182.632 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.633 -   (exit $ac_status); } &&
 182.634 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.635 --			 || test ! -s conftest.err'
 182.636 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.637 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.638 -   (eval $ac_try) 2>&5
 182.639 -   ac_status=$?
 182.640 -@@ -7698,8 +7710,7 @@
 182.641 -   cat conftest.err >&5
 182.642 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.643 -   (exit $ac_status); } &&
 182.644 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.645 --			 || test ! -s conftest.err'
 182.646 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.647 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.648 -   (eval $ac_try) 2>&5
 182.649 -   ac_status=$?
 182.650 -@@ -7767,8 +7778,7 @@
 182.651 -   cat conftest.err >&5
 182.652 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.653 -   (exit $ac_status); } &&
 182.654 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.655 --			 || test ! -s conftest.err'
 182.656 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.657 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.658 -   (eval $ac_try) 2>&5
 182.659 -   ac_status=$?
 182.660 -@@ -7834,8 +7844,7 @@
 182.661 -   cat conftest.err >&5
 182.662 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.663 -   (exit $ac_status); } &&
 182.664 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.665 --			 || test ! -s conftest.err'
 182.666 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.667 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.668 -   (eval $ac_try) 2>&5
 182.669 -   ac_status=$?
 182.670 -@@ -7899,8 +7908,7 @@
 182.671 -   cat conftest.err >&5
 182.672 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.673 -   (exit $ac_status); } &&
 182.674 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.675 --			 || test ! -s conftest.err'
 182.676 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.677 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.678 -   (eval $ac_try) 2>&5
 182.679 -   ac_status=$?
 182.680 -@@ -7966,8 +7974,7 @@
 182.681 -   cat conftest.err >&5
 182.682 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.683 -   (exit $ac_status); } &&
 182.684 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.685 --			 || test ! -s conftest.err'
 182.686 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.687 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.688 -   (eval $ac_try) 2>&5
 182.689 -   ac_status=$?
 182.690 -@@ -8032,8 +8039,7 @@
 182.691 -   cat conftest.err >&5
 182.692 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.693 -   (exit $ac_status); } &&
 182.694 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.695 --			 || test ! -s conftest.err'
 182.696 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.697 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.698 -   (eval $ac_try) 2>&5
 182.699 -   ac_status=$?
 182.700 -@@ -8077,8 +8083,7 @@
 182.701 -   cat conftest.err >&5
 182.702 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.703 -   (exit $ac_status); } &&
 182.704 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.705 --			 || test ! -s conftest.err'
 182.706 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.707 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.708 -   (eval $ac_try) 2>&5
 182.709 -   ac_status=$?
 182.710 -@@ -8145,8 +8150,7 @@
 182.711 -   cat conftest.err >&5
 182.712 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.713 -   (exit $ac_status); } &&
 182.714 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.715 --			 || test ! -s conftest.err'
 182.716 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.717 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.718 -   (eval $ac_try) 2>&5
 182.719 -   ac_status=$?
 182.720 -@@ -8218,8 +8222,7 @@
 182.721 -   cat conftest.err >&5
 182.722 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.723 -   (exit $ac_status); } &&
 182.724 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.725 --			 || test ! -s conftest.err'
 182.726 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.727 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.728 -   (eval $ac_try) 2>&5
 182.729 -   ac_status=$?
 182.730 -@@ -8289,8 +8292,7 @@
 182.731 -   cat conftest.err >&5
 182.732 -   echo "$as_me:$LINENO: \$? = $ac_status" >&5
 182.733 -   (exit $ac_status); } &&
 182.734 --	 { ac_try='test -z "$ac_c_werror_flag"
 182.735 --			 || test ! -s conftest.err'
 182.736 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
 182.737 -   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 182.738 -   (eval $ac_try) 2>&5
 182.739 -   ac_status=$?
 182.740 -@@ -9293,11 +9295,6 @@
 182.741 -   *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
 182.742 -   esac
 182.743 - 
 182.744 --  if test x"$ac_file" != x-; then
 182.745 --    { echo "$as_me:$LINENO: creating $ac_file" >&5
 182.746 --echo "$as_me: creating $ac_file" >&6;}
 182.747 --    rm -f "$ac_file"
 182.748 --  fi
 182.749 -   # Let's still pretend it is `configure' which instantiates (i.e., don't
 182.750 -   # use $as_me), people would be surprised to read:
 182.751 -   #    /* config.h.  Generated by config.status.  */
 182.752 -@@ -9336,6 +9333,12 @@
 182.753 - 	 fi;;
 182.754 -       esac
 182.755 -     done` || { (exit 1); exit 1; }
 182.756 -+
 182.757 -+  if test x"$ac_file" != x-; then
 182.758 -+    { echo "$as_me:$LINENO: creating $ac_file" >&5
 182.759 -+echo "$as_me: creating $ac_file" >&6;}
 182.760 -+    rm -f "$ac_file"
 182.761 -+  fi
 182.762 - _ACEOF
 182.763 - cat >>$CONFIG_STATUS <<_ACEOF
 182.764 -   sed "$ac_vpsub
   183.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   183.2 +++ b/patches/strace/4.5.15/150-dont-use-REG_SYSCALL-for-sh.patch	Mon Jul 28 21:08:01 2008 +0000
   183.3 @@ -0,0 +1,11 @@
   183.4 +diff -dur strace-4.5.15.orig/process.c strace-4.5.15/process.c
   183.5 +--- strace-4.5.15.orig/process.c	2007-01-11 23:08:38.000000000 +0100
   183.6 ++++ strace-4.5.15/process.c	2007-07-14 19:19:58.000000000 +0200
   183.7 +@@ -2679,7 +2679,6 @@
   183.8 +        { 4*REG_GBR,            "4*REG_GBR"                             },
   183.9 +        { 4*REG_MACH,           "4*REG_MACH"                            },
  183.10 +        { 4*REG_MACL,           "4*REG_MACL"                            },
  183.11 +-       { 4*REG_SYSCALL,        "4*REG_SYSCALL"                         },
  183.12 +        { 4*REG_FPUL,           "4*REG_FPUL"                            },
  183.13 +        { 4*REG_FPREG0,         "4*REG_FPREG0"                          },
  183.14 +        { 4*(REG_FPREG0+1),     "4*REG_FPREG1"                          },
   184.1 --- a/patches/strace/4.5.15/150-strace-dont-use-REG_SYSCALL-for-sh.patch	Mon Jul 28 20:17:48 2008 +0000
   184.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   184.3 @@ -1,11 +0,0 @@
   184.4 -diff -dur strace-4.5.15.orig/process.c strace-4.5.15/process.c
   184.5 ---- strace-4.5.15.orig/process.c	2007-01-11 23:08:38.000000000 +0100
   184.6 -+++ strace-4.5.15/process.c	2007-07-14 19:19:58.000000000 +0200
   184.7 -@@ -2679,7 +2679,6 @@
   184.8 -        { 4*REG_GBR,            "4*REG_GBR"                             },
   184.9 -        { 4*REG_MACH,           "4*REG_MACH"                            },
  184.10 -        { 4*REG_MACL,           "4*REG_MACL"                            },
  184.11 --       { 4*REG_SYSCALL,        "4*REG_SYSCALL"                         },
  184.12 -        { 4*REG_FPUL,           "4*REG_FPUL"                            },
  184.13 -        { 4*REG_FPREG0,         "4*REG_FPREG0"                          },
  184.14 -        { 4*(REG_FPREG0+1),     "4*REG_FPREG1"                          },
   185.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   185.2 +++ b/patches/strace/4.5.15/200-fix-arm-bad-syscall.patch	Mon Jul 28 21:08:01 2008 +0000
   185.3 @@ -0,0 +1,19 @@
   185.4 +diff -dur strace-4.5.15.orig/syscall.c strace-4.5.15/syscall.c
   185.5 +--- strace-4.5.15.orig/syscall.c	2006-12-21 23:13:33.000000000 +0100
   185.6 ++++ strace-4.5.15/syscall.c	2007-07-14 19:21:44.000000000 +0200
   185.7 +@@ -1045,6 +1045,15 @@
   185.8 + 		/*
   185.9 + 		 * Note: we only deal with only 32-bit CPUs here.
  185.10 + 		 */
  185.11 ++
  185.12 ++		if (!(tcp->flags & TCB_INSYSCALL) &&
  185.13 ++		    (tcp->flags & TCB_WAITEXECVE)) {
  185.14 ++			/* caught a fake syscall from the execve's exit */
  185.15 ++			tcp->flags &= ~TCB_WAITEXECVE;
  185.16 ++			return 0;
  185.17 ++		}
  185.18 ++ 
  185.19 ++
  185.20 + 		if (regs.ARM_cpsr & 0x20) {
  185.21 + 			/*
  185.22 + 			 * Get the Thumb-mode system call number
   186.1 --- a/patches/strace/4.5.15/200-strace-fix-arm-bad-syscall.patch	Mon Jul 28 20:17:48 2008 +0000
   186.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   186.3 @@ -1,19 +0,0 @@
   186.4 -diff -dur strace-4.5.15.orig/syscall.c strace-4.5.15/syscall.c
   186.5 ---- strace-4.5.15.orig/syscall.c	2006-12-21 23:13:33.000000000 +0100
   186.6 -+++ strace-4.5.15/syscall.c	2007-07-14 19:21:44.000000000 +0200
   186.7 -@@ -1045,6 +1045,15 @@
   186.8 - 		/*
   186.9 - 		 * Note: we only deal with only 32-bit CPUs here.
  186.10 - 		 */
  186.11 -+
  186.12 -+		if (!(tcp->flags & TCB_INSYSCALL) &&
  186.13 -+		    (tcp->flags & TCB_WAITEXECVE)) {
  186.14 -+			/* caught a fake syscall from the execve's exit */
  186.15 -+			tcp->flags &= ~TCB_WAITEXECVE;
  186.16 -+			return 0;
  186.17 -+		}
  186.18 -+ 
  186.19 -+
  186.20 - 		if (regs.ARM_cpsr & 0x20) {
  186.21 - 			/*
  186.22 - 			 * Get the Thumb-mode system call number
   187.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   187.2 +++ b/patches/strace/4.5.15/250-fix-disabled-largefile-syscalls.patch	Mon Jul 28 21:08:01 2008 +0000
   187.3 @@ -0,0 +1,22 @@
   187.4 +diff -dur strace-4.5.15.orig/syscall.c strace-4.5.15/syscall.c
   187.5 +--- strace-4.5.15.orig/syscall.c	2007-07-14 19:21:44.000000000 +0200
   187.6 ++++ strace-4.5.15/syscall.c	2007-07-14 19:22:49.000000000 +0200
   187.7 +@@ -125,6 +125,18 @@
   187.8 + #define TP TRACE_PROCESS
   187.9 + #define TS TRACE_SIGNAL
  187.10 + 
  187.11 ++#ifndef HAVE_STATFS64
  187.12 ++/*
  187.13 ++ * Ugly hacks for systems that do not have LFS
  187.14 ++ */
  187.15 ++
  187.16 ++#define sys_truncate64  sys_truncate
  187.17 ++#define sys_ftruncate64 sys_ftruncate
  187.18 ++#define sys_getdents64  sys_getdents
  187.19 ++#define sys_statfs64    sys_statfs
  187.20 ++#define sys_fstatfs64   sys_fstatfs
  187.21 ++#endif
  187.22 ++
  187.23 + static const struct sysent sysent0[] = {
  187.24 + #include "syscallent.h"
  187.25 + };
   188.1 --- a/patches/strace/4.5.15/250-strace-fix-disabled-largefile-syscalls.patch	Mon Jul 28 20:17:48 2008 +0000
   188.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   188.3 @@ -1,22 +0,0 @@
   188.4 -diff -dur strace-4.5.15.orig/syscall.c strace-4.5.15/syscall.c
   188.5 ---- strace-4.5.15.orig/syscall.c	2007-07-14 19:21:44.000000000 +0200
   188.6 -+++ strace-4.5.15/syscall.c	2007-07-14 19:22:49.000000000 +0200
   188.7 -@@ -125,6 +125,18 @@
   188.8 - #define TP TRACE_PROCESS
   188.9 - #define TS TRACE_SIGNAL
  188.10 - 
  188.11 -+#ifndef HAVE_STATFS64
  188.12 -+/*
  188.13 -+ * Ugly hacks for systems that do not have LFS
  188.14 -+ */
  188.15 -+
  188.16 -+#define sys_truncate64  sys_truncate
  188.17 -+#define sys_ftruncate64 sys_ftruncate
  188.18 -+#define sys_getdents64  sys_getdents
  188.19 -+#define sys_statfs64    sys_statfs
  188.20 -+#define sys_fstatfs64   sys_fstatfs
  188.21 -+#endif
  188.22 -+
  188.23 - static const struct sysent sysent0[] = {
  188.24 - #include "syscallent.h"
  188.25 - };
   189.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   189.2 +++ b/patches/strace/4.5.15/300-mips-sprintsigmask-fix.patch	Mon Jul 28 21:08:01 2008 +0000
   189.3 @@ -0,0 +1,12 @@
   189.4 +diff -dur strace-4.5.15.orig/signal.c strace-4.5.15/signal.c
   189.5 +--- strace-4.5.15.orig/signal.c	2007-01-11 23:08:38.000000000 +0100
   189.6 ++++ strace-4.5.15/signal.c	2007-07-14 19:24:43.000000000 +0200
   189.7 +@@ -1440,7 +1440,7 @@
   189.8 + 	  	tcp->u_rval = tcp->u_error = 0;
   189.9 + 		if(tcp->u_arg[0] == 0)
  189.10 + 		  	return 0;
  189.11 +-		tcp->auxstr = sprintsigmask("mask now ", tcp->u_arg[1]);
  189.12 ++		tcp->auxstr = sprintsigmask("mask now ", tcp->u_arg[1], 0);
  189.13 + 		return RVAL_NONE | RVAL_STR;
  189.14 + 	}
  189.15 + 	return 0;
   190.1 --- a/patches/strace/4.5.15/300-strace-mips-sprintsigmask-fix.patch	Mon Jul 28 20:17:48 2008 +0000
   190.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   190.3 @@ -1,12 +0,0 @@
   190.4 -diff -dur strace-4.5.15.orig/signal.c strace-4.5.15/signal.c
   190.5 ---- strace-4.5.15.orig/signal.c	2007-01-11 23:08:38.000000000 +0100
   190.6 -+++ strace-4.5.15/signal.c	2007-07-14 19:24:43.000000000 +0200
   190.7 -@@ -1440,7 +1440,7 @@
   190.8 - 	  	tcp->u_rval = tcp->u_error = 0;
   190.9 - 		if(tcp->u_arg[0] == 0)
  190.10 - 		  	return 0;
  190.11 --		tcp->auxstr = sprintsigmask("mask now ", tcp->u_arg[1]);
  190.12 -+		tcp->auxstr = sprintsigmask("mask now ", tcp->u_arg[1], 0);
  190.13 - 		return RVAL_NONE | RVAL_STR;
  190.14 - 	}
  190.15 - 	return 0;
   191.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   191.2 +++ b/patches/strace/4.5.15/350-statfs64-check.patch	Mon Jul 28 21:08:01 2008 +0000
   191.3 @@ -0,0 +1,53 @@
   191.4 +diff -dur strace-4.5.15.orig/acinclude.m4 strace-4.5.15/acinclude.m4
   191.5 +--- strace-4.5.15.orig/acinclude.m4	2004-04-14 04:21:01.000000000 +0200
   191.6 ++++ strace-4.5.15/acinclude.m4	2007-07-14 19:25:25.000000000 +0200
   191.7 +@@ -210,6 +210,26 @@
   191.8 + fi
   191.9 + ])
  191.10 + 
  191.11 ++dnl ### A macro to determine whether statfs64 is defined.
  191.12 ++AC_DEFUN([AC_STATFS64],
  191.13 ++[AC_MSG_CHECKING(for statfs64 in sys/(statfs|vfs).h)
  191.14 ++AC_CACHE_VAL(ac_cv_type_statfs64,
  191.15 ++[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef LINUX
  191.16 ++#include <linux/types.h>
  191.17 ++#include <sys/statfs.h>
  191.18 ++#else
  191.19 ++#include <sys/vfs.h>
  191.20 ++#endif]], [[struct statfs64 st;]])],[ac_cv_type_statfs64=yes],[ac_cv_type_statfs64=no])])
  191.21 ++AC_MSG_RESULT($ac_cv_type_statfs64)
  191.22 ++if test "$ac_cv_type_statfs64" = yes
  191.23 ++then
  191.24 ++	AC_DEFINE([HAVE_STATFS64], 1,
  191.25 ++[Define if statfs64 is available in sys/statfs.h or sys/vfs.h.])
  191.26 ++fi
  191.27 ++])
  191.28 ++
  191.29 ++
  191.30 ++
  191.31 + dnl ### A macro to determine if off_t is a long long
  191.32 + AC_DEFUN([AC_OFF_T_IS_LONG_LONG],
  191.33 + [AC_MSG_CHECKING(for long long off_t)
  191.34 +diff -dur strace-4.5.15.orig/configure.ac strace-4.5.15/configure.ac
  191.35 +--- strace-4.5.15.orig/configure.ac	2007-01-11 12:37:55.000000000 +0100
  191.36 ++++ strace-4.5.15/configure.ac	2007-07-14 19:25:25.000000000 +0200
  191.37 +@@ -169,6 +169,7 @@
  191.38 + 		  struct stat.st_level,
  191.39 + 		  struct stat.st_rdev])
  191.40 + AC_STAT64
  191.41 ++AC_STATFS64
  191.42 + 
  191.43 + AC_TYPE_SIGNAL
  191.44 + AC_TYPE_UID_T
  191.45 +diff -dur strace-4.5.15.orig/file.c strace-4.5.15/file.c
  191.46 +--- strace-4.5.15.orig/file.c	2007-01-15 21:25:52.000000000 +0100
  191.47 ++++ strace-4.5.15/file.c	2007-07-14 19:25:25.000000000 +0200
  191.48 +@@ -1635,7 +1635,7 @@
  191.49 + 	return 0;
  191.50 + }
  191.51 + 
  191.52 +-#ifdef LINUX
  191.53 ++#ifdef HAVE_STATFS64
  191.54 + static void
  191.55 + printstatfs64(tcp, addr)
  191.56 + struct tcb *tcp;
   192.1 --- a/patches/strace/4.5.15/350-strace-statfs64-check.patch	Mon Jul 28 20:17:48 2008 +0000
   192.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   192.3 @@ -1,53 +0,0 @@
   192.4 -diff -dur strace-4.5.15.orig/acinclude.m4 strace-4.5.15/acinclude.m4
   192.5 ---- strace-4.5.15.orig/acinclude.m4	2004-04-14 04:21:01.000000000 +0200
   192.6 -+++ strace-4.5.15/acinclude.m4	2007-07-14 19:25:25.000000000 +0200
   192.7 -@@ -210,6 +210,26 @@
   192.8 - fi
   192.9 - ])
  192.10 - 
  192.11 -+dnl ### A macro to determine whether statfs64 is defined.
  192.12 -+AC_DEFUN([AC_STATFS64],
  192.13 -+[AC_MSG_CHECKING(for statfs64 in sys/(statfs|vfs).h)
  192.14 -+AC_CACHE_VAL(ac_cv_type_statfs64,
  192.15 -+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef LINUX
  192.16 -+#include <linux/types.h>
  192.17 -+#include <sys/statfs.h>
  192.18 -+#else
  192.19 -+#include <sys/vfs.h>
  192.20 -+#endif]], [[struct statfs64 st;]])],[ac_cv_type_statfs64=yes],[ac_cv_type_statfs64=no])])
  192.21 -+AC_MSG_RESULT($ac_cv_type_statfs64)
  192.22 -+if test "$ac_cv_type_statfs64" = yes
  192.23 -+then
  192.24 -+	AC_DEFINE([HAVE_STATFS64], 1,
  192.25 -+[Define if statfs64 is available in sys/statfs.h or sys/vfs.h.])
  192.26 -+fi
  192.27 -+])
  192.28 -+
  192.29 -+
  192.30 -+
  192.31 - dnl ### A macro to determine if off_t is a long long
  192.32 - AC_DEFUN([AC_OFF_T_IS_LONG_LONG],
  192.33 - [AC_MSG_CHECKING(for long long off_t)
  192.34 -diff -dur strace-4.5.15.orig/configure.ac strace-4.5.15/configure.ac
  192.35 ---- strace-4.5.15.orig/configure.ac	2007-01-11 12:37:55.000000000 +0100
  192.36 -+++ strace-4.5.15/configure.ac	2007-07-14 19:25:25.000000000 +0200
  192.37 -@@ -169,6 +169,7 @@
  192.38 - 		  struct stat.st_level,
  192.39 - 		  struct stat.st_rdev])
  192.40 - AC_STAT64
  192.41 -+AC_STATFS64
  192.42 - 
  192.43 - AC_TYPE_SIGNAL
  192.44 - AC_TYPE_UID_T
  192.45 -diff -dur strace-4.5.15.orig/file.c strace-4.5.15/file.c
  192.46 ---- strace-4.5.15.orig/file.c	2007-01-15 21:25:52.000000000 +0100
  192.47 -+++ strace-4.5.15/file.c	2007-07-14 19:25:25.000000000 +0200
  192.48 -@@ -1635,7 +1635,7 @@
  192.49 - 	return 0;
  192.50 - }
  192.51 - 
  192.52 --#ifdef LINUX
  192.53 -+#ifdef HAVE_STATFS64
  192.54 - static void
  192.55 - printstatfs64(tcp, addr)
  192.56 - struct tcb *tcp;
   193.1 --- a/patches/strace/4.5.15/400-strace-superh-update.ac.patch	Mon Jul 28 20:17:48 2008 +0000
   193.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   193.3 @@ -1,22 +0,0 @@
   193.4 -diff -dur strace-4.5.15.orig/configure.ac strace-4.5.15/configure.ac
   193.5 ---- strace-4.5.15.orig/configure.ac	2007-07-14 19:25:25.000000000 +0200
   193.6 -+++ strace-4.5.15/configure.ac	2007-07-14 19:27:35.000000000 +0200
   193.7 -@@ -91,14 +91,14 @@
   193.8 - 	arch=hppa
   193.9 - 	AC_DEFINE([HPPA], 1, [Define for the HPPA architecture.])
  193.10 - 	;;
  193.11 --sh)
  193.12 --	arch=sh
  193.13 --	AC_DEFINE([SH], 1, [Define for the SH architecture.])
  193.14 --	;;
  193.15 - sh64)
  193.16 - 	arch=sh64
  193.17 - 	AC_DEFINE([SH64], 1, [Define for the SH64 architecture.])
  193.18 - 	;;
  193.19 -+sh*)
  193.20 -+	arch=sh
  193.21 -+	AC_DEFINE([SH], 1, [Define for the SH architecture.])
  193.22 -+	;;
  193.23 - x86?64*)
  193.24 - 	arch=x86_64
  193.25 - 	AC_DEFINE([X86_64], 1, [Define for the AMD x86-64 architecture.])
   194.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   194.2 +++ b/patches/strace/4.5.15/400-superh-update.ac.patch	Mon Jul 28 21:08:01 2008 +0000
   194.3 @@ -0,0 +1,22 @@
   194.4 +diff -dur strace-4.5.15.orig/configure.ac strace-4.5.15/configure.ac
   194.5 +--- strace-4.5.15.orig/configure.ac	2007-07-14 19:25:25.000000000 +0200
   194.6 ++++ strace-4.5.15/configure.ac	2007-07-14 19:27:35.000000000 +0200
   194.7 +@@ -91,14 +91,14 @@
   194.8 + 	arch=hppa
   194.9 + 	AC_DEFINE([HPPA], 1, [Define for the HPPA architecture.])
  194.10 + 	;;
  194.11 +-sh)
  194.12 +-	arch=sh
  194.13 +-	AC_DEFINE([SH], 1, [Define for the SH architecture.])
  194.14 +-	;;
  194.15 + sh64)
  194.16 + 	arch=sh64
  194.17 + 	AC_DEFINE([SH64], 1, [Define for the SH64 architecture.])
  194.18 + 	;;
  194.19 ++sh*)
  194.20 ++	arch=sh
  194.21 ++	AC_DEFINE([SH], 1, [Define for the SH architecture.])
  194.22 ++	;;
  194.23 + x86?64*)
  194.24 + 	arch=x86_64
  194.25 + 	AC_DEFINE([X86_64], 1, [Define for the AMD x86-64 architecture.])
   195.1 --- a/patches/strace/4.5.15/450-strace-undef-CTL_PROC.patch	Mon Jul 28 20:17:48 2008 +0000
   195.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   195.3 @@ -1,13 +0,0 @@
   195.4 -diff -dur strace-4.5.15.orig/system.c strace-4.5.15/system.c
   195.5 ---- strace-4.5.15.orig/system.c	2007-01-17 00:22:36.000000000 +0100
   195.6 -+++ strace-4.5.15/system.c	2007-07-14 19:28:41.000000000 +0200
   195.7 -@@ -1612,7 +1612,9 @@
   195.8 - 	{ CTL_KERN, "CTL_KERN" },
   195.9 - 	{ CTL_VM, "CTL_VM" },
  195.10 - 	{ CTL_NET, "CTL_NET" },
  195.11 -+#ifdef CTL_PROC
  195.12 - 	{ CTL_PROC, "CTL_PROC" },
  195.13 -+#endif
  195.14 - 	{ CTL_FS, "CTL_FS" },
  195.15 - 	{ CTL_DEBUG, "CTL_DEBUG" },
  195.16 - 	{ CTL_DEV, "CTL_DEV" },
   196.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   196.2 +++ b/patches/strace/4.5.15/450-undef-CTL_PROC.patch	Mon Jul 28 21:08:01 2008 +0000
   196.3 @@ -0,0 +1,13 @@
   196.4 +diff -dur strace-4.5.15.orig/system.c strace-4.5.15/system.c
   196.5 +--- strace-4.5.15.orig/system.c	2007-01-17 00:22:36.000000000 +0100
   196.6 ++++ strace-4.5.15/system.c	2007-07-14 19:28:41.000000000 +0200
   196.7 +@@ -1612,7 +1612,9 @@
   196.8 + 	{ CTL_KERN, "CTL_KERN" },
   196.9 + 	{ CTL_VM, "CTL_VM" },
  196.10 + 	{ CTL_NET, "CTL_NET" },
  196.11 ++#ifdef CTL_PROC
  196.12 + 	{ CTL_PROC, "CTL_PROC" },
  196.13 ++#endif
  196.14 + 	{ CTL_FS, "CTL_FS" },
  196.15 + 	{ CTL_DEBUG, "CTL_DEBUG" },
  196.16 + 	{ CTL_DEV, "CTL_DEV" },
   197.1 --- a/patches/strace/4.5.15/500-strace-undef-PACKET_MEMBERSHIP.patch	Mon Jul 28 20:17:48 2008 +0000
   197.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   197.3 @@ -1,16 +0,0 @@
   197.4 -diff -dur strace-4.5.15.orig/net.c strace-4.5.15/net.c
   197.5 ---- strace-4.5.15.orig/net.c	2006-12-13 20:57:23.000000000 +0100
   197.6 -+++ strace-4.5.15/net.c	2007-07-14 19:29:36.000000000 +0200
   197.7 -@@ -800,8 +800,12 @@
   197.8 - 
   197.9 - #ifdef SOL_PACKET
  197.10 - static const struct xlat sockpacketoptions[] = {
  197.11 -+#if defined(PACKET_ADD_MEMBERSHIP)
  197.12 - 	{ PACKET_ADD_MEMBERSHIP,	"PACKET_ADD_MEMBERSHIP"	},
  197.13 -+#endif
  197.14 -+#if defined(PACKET_DROP_MEMBERSHIP)
  197.15 - 	{ PACKET_DROP_MEMBERSHIP,	"PACKET_DROP_MEMBERSHIP"},
  197.16 -+#endif
  197.17 - #if defined(PACKET_RECV_OUTPUT)
  197.18 - 	{ PACKET_RECV_OUTPUT,		"PACKET_RECV_OUTPUT"	},
  197.19 - #endif
   198.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   198.2 +++ b/patches/strace/4.5.15/500-undef-PACKET_MEMBERSHIP.patch	Mon Jul 28 21:08:01 2008 +0000
   198.3 @@ -0,0 +1,16 @@
   198.4 +diff -dur strace-4.5.15.orig/net.c strace-4.5.15/net.c
   198.5 +--- strace-4.5.15.orig/net.c	2006-12-13 20:57:23.000000000 +0100
   198.6 ++++ strace-4.5.15/net.c	2007-07-14 19:29:36.000000000 +0200
   198.7 +@@ -800,8 +800,12 @@
   198.8 + 
   198.9 + #ifdef SOL_PACKET
  198.10 + static const struct xlat sockpacketoptions[] = {
  198.11 ++#if defined(PACKET_ADD_MEMBERSHIP)
  198.12 + 	{ PACKET_ADD_MEMBERSHIP,	"PACKET_ADD_MEMBERSHIP"	},
  198.13 ++#endif
  198.14 ++#if defined(PACKET_DROP_MEMBERSHIP)
  198.15 + 	{ PACKET_DROP_MEMBERSHIP,	"PACKET_DROP_MEMBERSHIP"},
  198.16 ++#endif
  198.17 + #if defined(PACKET_RECV_OUTPUT)
  198.18 + 	{ PACKET_RECV_OUTPUT,		"PACKET_RECV_OUTPUT"	},
  198.19 + #endif
   199.1 --- a/patches/strace/4.5.15/550-strace-undef-syscall.patch	Mon Jul 28 20:17:48 2008 +0000
   199.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   199.3 @@ -1,64 +0,0 @@
   199.4 -diff -dur strace-4.5.15.orig/linux/syscallent.h strace-4.5.15/linux/syscallent.h
   199.5 ---- strace-4.5.15.orig/linux/syscallent.h	2006-10-16 03:17:52.000000000 +0200
   199.6 -+++ strace-4.5.15/linux/syscallent.h	2007-07-14 19:30:16.000000000 +0200
   199.7 -@@ -130,7 +130,11 @@
   199.8 - 	{ 2,	TF,	sys_statfs,		"statfs"	}, /* 99 */
   199.9 - 	{ 2,	TD,	sys_fstatfs,		"fstatfs"	}, /* 100 */
  199.10 - 	{ 3,	0,	sys_ioperm,		"ioperm"	}, /* 101 */
  199.11 --	{ 2,	TD,	sys_socketcall,		"socketcall", SYS_socketcall }, /* 102 */
  199.12 -+	{ 2,	TD,	sys_socketcall,		"socketcall"
  199.13 -+#ifdef __NR_socketcall
  199.14 -+	    , SYS_socketcall
  199.15 -+#endif
  199.16 -+								}, /* 102 */
  199.17 - 	{ 3,	0,	sys_syslog,		"syslog"	}, /* 103 */
  199.18 - 	{ 3,	0,	sys_setitimer,		"setitimer"	}, /* 104 */
  199.19 - 	{ 2,	0,	sys_getitimer,		"getitimer"	}, /* 105 */
  199.20 -@@ -145,7 +149,11 @@
  199.21 - 	{ 4,	TP,	sys_wait4,		"wait4", SYS_wait4 }, /* 114 */
  199.22 - 	{ 1,	0,	sys_swapoff,		"swapoff"	}, /* 115 */
  199.23 - 	{ 1,	0,	sys_sysinfo,		"sysinfo"	}, /* 116 */
  199.24 --	{ 6,	0,	sys_ipc,		"ipc", SYS_ipc }, /* 117 */
  199.25 -+	{ 6,	0,	sys_ipc,		"ipc"
  199.26 -+#ifdef __NR_ipc
  199.27 -+	    , SYS_ipc
  199.28 -+#endif
  199.29 -+								}, /* 117 */
  199.30 - 	{ 1,	TD,	sys_fsync,		"fsync"		}, /* 118 */
  199.31 - 	{ 1,	TS,	sys_sigreturn,		"sigreturn"	}, /* 119 */
  199.32 - 	{ 5,	TP,	sys_clone,		"clone", SYS_clone }, /* 120 */
  199.33 -@@ -282,7 +290,11 @@
  199.34 - 	{ 3,	0,	sys_io_cancel,		"io_cancel"	}, /* 249 */
  199.35 - 	{ 5,	0,	sys_fadvise64,		"fadvise64"	}, /* 250 */
  199.36 - 	{ 5,	0,	printargs,		"SYS_251"	}, /* 251 */
  199.37 --	{ 1,	TP,	sys_exit,		"exit_group", __NR_exit_group }, /* 252 */
  199.38 -+	{ 1,	TP,	sys_exit,		"exit_group"
  199.39 -+#ifdef __NR_exit_group
  199.40 -+	    , __NR_exit_group
  199.41 -+#endif
  199.42 -+								}, /* 252 */
  199.43 - 	{ 4,	0,	printargs,		"lookup_dcookie"}, /* 253 */
  199.44 - 	{ 1,	0,	sys_epoll_create,	"epoll_create"	}, /* 254 */
  199.45 - 	{ 4,	TD,	sys_epoll_ctl,		"epoll_ctl"	}, /* 255 */
  199.46 -diff -dur strace-4.5.15.orig/syscall.c strace-4.5.15/syscall.c
  199.47 ---- strace-4.5.15.orig/syscall.c	2007-07-14 19:22:49.000000000 +0200
  199.48 -+++ strace-4.5.15/syscall.c	2007-07-14 19:30:16.000000000 +0200
  199.49 -@@ -2404,14 +2404,18 @@
  199.50 - 	switch (known_scno(tcp)) {
  199.51 - #ifdef LINUX
  199.52 - #if !defined (ALPHA) && !defined(SPARC) && !defined(SPARC64) && !defined(MIPS) && !defined(HPPA)
  199.53 -+#ifdef __NR_socketcall
  199.54 - 	case SYS_socketcall:
  199.55 - 		decode_subcall(tcp, SYS_socket_subcall,
  199.56 - 			SYS_socket_nsubcalls, deref_style);
  199.57 - 		break;
  199.58 -+#endif
  199.59 -+#ifdef __NR_ipc
  199.60 - 	case SYS_ipc:
  199.61 - 		decode_subcall(tcp, SYS_ipc_subcall,
  199.62 - 			SYS_ipc_nsubcalls, shift_style);
  199.63 - 		break;
  199.64 -+#endif
  199.65 - #endif /* !ALPHA && !MIPS && !SPARC && !SPARC64 && !HPPA */
  199.66 - #if defined (SPARC) || defined (SPARC64)
  199.67 - 	case SYS_socketcall:
   200.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   200.2 +++ b/patches/strace/4.5.15/550-undef-syscall.patch	Mon Jul 28 21:08:01 2008 +0000
   200.3 @@ -0,0 +1,64 @@
   200.4 +diff -dur strace-4.5.15.orig/linux/syscallent.h strace-4.5.15/linux/syscallent.h
   200.5 +--- strace-4.5.15.orig/linux/syscallent.h	2006-10-16 03:17:52.000000000 +0200
   200.6 ++++ strace-4.5.15/linux/syscallent.h	2007-07-14 19:30:16.000000000 +0200
   200.7 +@@ -130,7 +130,11 @@
   200.8 + 	{ 2,	TF,	sys_statfs,		"statfs"	}, /* 99 */
   200.9 + 	{ 2,	TD,	sys_fstatfs,		"fstatfs"	}, /* 100 */
  200.10 + 	{ 3,	0,	sys_ioperm,		"ioperm"	}, /* 101 */
  200.11 +-	{ 2,	TD,	sys_socketcall,		"socketcall", SYS_socketcall }, /* 102 */
  200.12 ++	{ 2,	TD,	sys_socketcall,		"socketcall"
  200.13 ++#ifdef __NR_socketcall
  200.14 ++	    , SYS_socketcall
  200.15 ++#endif
  200.16 ++								}, /* 102 */
  200.17 + 	{ 3,	0,	sys_syslog,		"syslog"	}, /* 103 */
  200.18 + 	{ 3,	0,	sys_setitimer,		"setitimer"	}, /* 104 */
  200.19 + 	{ 2,	0,	sys_getitimer,		"getitimer"	}, /* 105 */
  200.20 +@@ -145,7 +149,11 @@
  200.21 + 	{ 4,	TP,	sys_wait4,		"wait4", SYS_wait4 }, /* 114 */
  200.22 + 	{ 1,	0,	sys_swapoff,		"swapoff"	}, /* 115 */
  200.23 + 	{ 1,	0,	sys_sysinfo,		"sysinfo"	}, /* 116 */
  200.24 +-	{ 6,	0,	sys_ipc,		"ipc", SYS_ipc }, /* 117 */
  200.25 ++	{ 6,	0,	sys_ipc,		"ipc"
  200.26 ++#ifdef __NR_ipc
  200.27 ++	    , SYS_ipc
  200.28 ++#endif
  200.29 ++								}, /* 117 */
  200.30 + 	{ 1,	TD,	sys_fsync,		"fsync"		}, /* 118 */
  200.31 + 	{ 1,	TS,	sys_sigreturn,		"sigreturn"	}, /* 119 */
  200.32 + 	{ 5,	TP,	sys_clone,		"clone", SYS_clone }, /* 120 */
  200.33 +@@ -282,7 +290,11 @@
  200.34 + 	{ 3,	0,	sys_io_cancel,		"io_cancel"	}, /* 249 */
  200.35 + 	{ 5,	0,	sys_fadvise64,		"fadvise64"	}, /* 250 */
  200.36 + 	{ 5,	0,	printargs,		"SYS_251"	}, /* 251 */
  200.37 +-	{ 1,	TP,	sys_exit,		"exit_group", __NR_exit_group }, /* 252 */
  200.38 ++	{ 1,	TP,	sys_exit,		"exit_group"
  200.39 ++#ifdef __NR_exit_group
  200.40 ++	    , __NR_exit_group
  200.41 ++#endif
  200.42 ++								}, /* 252 */
  200.43 + 	{ 4,	0,	printargs,		"lookup_dcookie"}, /* 253 */
  200.44 + 	{ 1,	0,	sys_epoll_create,	"epoll_create"	}, /* 254 */
  200.45 + 	{ 4,	TD,	sys_epoll_ctl,		"epoll_ctl"	}, /* 255 */
  200.46 +diff -dur strace-4.5.15.orig/syscall.c strace-4.5.15/syscall.c
  200.47 +--- strace-4.5.15.orig/syscall.c	2007-07-14 19:22:49.000000000 +0200
  200.48 ++++ strace-4.5.15/syscall.c	2007-07-14 19:30:16.000000000 +0200
  200.49 +@@ -2404,14 +2404,18 @@
  200.50 + 	switch (known_scno(tcp)) {
  200.51 + #ifdef LINUX
  200.52 + #if !defined (ALPHA) && !defined(SPARC) && !defined(SPARC64) && !defined(MIPS) && !defined(HPPA)
  200.53 ++#ifdef __NR_socketcall
  200.54 + 	case SYS_socketcall:
  200.55 + 		decode_subcall(tcp, SYS_socket_subcall,
  200.56 + 			SYS_socket_nsubcalls, deref_style);
  200.57 + 		break;
  200.58 ++#endif
  200.59 ++#ifdef __NR_ipc
  200.60 + 	case SYS_ipc:
  200.61 + 		decode_subcall(tcp, SYS_ipc_subcall,
  200.62 + 			SYS_ipc_nsubcalls, shift_style);
  200.63 + 		break;
  200.64 ++#endif
  200.65 + #endif /* !ALPHA && !MIPS && !SPARC && !SPARC64 && !HPPA */
  200.66 + #if defined (SPARC) || defined (SPARC64)
  200.67 + 	case SYS_socketcall:
   201.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   201.2 +++ b/patches/strace/4.5.16/100-autoreconf.patch	Mon Jul 28 21:08:01 2008 +0000
   201.3 @@ -0,0 +1,77 @@
   201.4 +diff -dur strace-4.5.16.orig/configure strace-4.5.16/configure
   201.5 +--- strace-4.5.16.orig/configure	2007-01-11 23:23:33.000000000 +0100
   201.6 ++++ strace-4.5.16/configure	2007-07-14 19:18:43.000000000 +0200
   201.7 +@@ -5808,6 +5777,73 @@
   201.8 +
   201.9 + fi
  201.10 +
  201.11 ++echo "$as_me:$LINENO: checking for statfs64 in sys/(statfs|vfs).h" >&5
  201.12 ++echo $ECHO_N "checking for statfs64 in sys/(statfs|vfs).h... $ECHO_C" >&6
  201.13 ++if test "${ac_cv_type_statfs64+set}" = set; then
  201.14 ++  echo $ECHO_N "(cached) $ECHO_C" >&6
  201.15 ++else
  201.16 ++  cat >conftest.$ac_ext <<_ACEOF
  201.17 ++/* confdefs.h.  */
  201.18 ++_ACEOF
  201.19 ++cat confdefs.h >>conftest.$ac_ext
  201.20 ++cat >>conftest.$ac_ext <<_ACEOF
  201.21 ++/* end confdefs.h.  */
  201.22 ++#ifdef LINUX
  201.23 ++#include <linux/types.h>
  201.24 ++#include <sys/statfs.h>
  201.25 ++#else
  201.26 ++#include <sys/vfs.h>
  201.27 ++#endif
  201.28 ++int
  201.29 ++main ()
  201.30 ++{
  201.31 ++struct statfs64 st;
  201.32 ++  ;
  201.33 ++  return 0;
  201.34 ++}
  201.35 ++_ACEOF
  201.36 ++rm -f conftest.$ac_objext
  201.37 ++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  201.38 ++  (eval $ac_compile) 2>conftest.er1
  201.39 ++  ac_status=$?
  201.40 ++  grep -v '^ *+' conftest.er1 >conftest.err
  201.41 ++  rm -f conftest.er1
  201.42 ++  cat conftest.err >&5
  201.43 ++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  201.44 ++  (exit $ac_status); } &&
  201.45 ++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
  201.46 ++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  201.47 ++  (eval $ac_try) 2>&5
  201.48 ++  ac_status=$?
  201.49 ++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  201.50 ++  (exit $ac_status); }; } &&
  201.51 ++	 { ac_try='test -s conftest.$ac_objext'
  201.52 ++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  201.53 ++  (eval $ac_try) 2>&5
  201.54 ++  ac_status=$?
  201.55 ++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  201.56 ++  (exit $ac_status); }; }; then
  201.57 ++  ac_cv_type_statfs64=yes
  201.58 ++else
  201.59 ++  echo "$as_me: failed program was:" >&5
  201.60 ++sed 's/^/| /' conftest.$ac_ext >&5
  201.61 ++
  201.62 ++ac_cv_type_statfs64=no
  201.63 ++fi
  201.64 ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  201.65 ++fi
  201.66 ++
  201.67 ++echo "$as_me:$LINENO: result: $ac_cv_type_statfs64" >&5
  201.68 ++echo "${ECHO_T}$ac_cv_type_statfs64" >&6
  201.69 ++if test "$ac_cv_type_statfs64" = yes
  201.70 ++then
  201.71 ++
  201.72 ++cat >>confdefs.h <<\_ACEOF
  201.73 ++#define HAVE_STATFS64 1
  201.74 ++_ACEOF
  201.75 ++
  201.76 ++fi
  201.77 ++
  201.78 +
  201.79 + { echo "$as_me:$LINENO: checking return type of signal handlers" >&5
  201.80 + echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6; }
   202.1 --- a/patches/strace/4.5.16/100-strace-autoreconf.patch	Mon Jul 28 20:17:48 2008 +0000
   202.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   202.3 @@ -1,77 +0,0 @@
   202.4 -diff -dur strace-4.5.16.orig/configure strace-4.5.16/configure
   202.5 ---- strace-4.5.16.orig/configure	2007-01-11 23:23:33.000000000 +0100
   202.6 -+++ strace-4.5.16/configure	2007-07-14 19:18:43.000000000 +0200
   202.7 -@@ -5808,6 +5777,73 @@
   202.8 -
   202.9 - fi
  202.10 -
  202.11 -+echo "$as_me:$LINENO: checking for statfs64 in sys/(statfs|vfs).h" >&5
  202.12 -+echo $ECHO_N "checking for statfs64 in sys/(statfs|vfs).h... $ECHO_C" >&6
  202.13 -+if test "${ac_cv_type_statfs64+set}" = set; then
  202.14 -+  echo $ECHO_N "(cached) $ECHO_C" >&6
  202.15 -+else
  202.16 -+  cat >conftest.$ac_ext <<_ACEOF
  202.17 -+/* confdefs.h.  */
  202.18 -+_ACEOF
  202.19 -+cat confdefs.h >>conftest.$ac_ext
  202.20 -+cat >>conftest.$ac_ext <<_ACEOF
  202.21 -+/* end confdefs.h.  */
  202.22 -+#ifdef LINUX
  202.23 -+#include <linux/types.h>
  202.24 -+#include <sys/statfs.h>
  202.25 -+#else
  202.26 -+#include <sys/vfs.h>
  202.27 -+#endif
  202.28 -+int
  202.29 -+main ()
  202.30 -+{
  202.31 -+struct statfs64 st;
  202.32 -+  ;
  202.33 -+  return 0;
  202.34 -+}
  202.35 -+_ACEOF
  202.36 -+rm -f conftest.$ac_objext
  202.37 -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  202.38 -+  (eval $ac_compile) 2>conftest.er1
  202.39 -+  ac_status=$?
  202.40 -+  grep -v '^ *+' conftest.er1 >conftest.err
  202.41 -+  rm -f conftest.er1
  202.42 -+  cat conftest.err >&5
  202.43 -+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  202.44 -+  (exit $ac_status); } &&
  202.45 -+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
  202.46 -+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  202.47 -+  (eval $ac_try) 2>&5
  202.48 -+  ac_status=$?
  202.49 -+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  202.50 -+  (exit $ac_status); }; } &&
  202.51 -+	 { ac_try='test -s conftest.$ac_objext'
  202.52 -+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  202.53 -+  (eval $ac_try) 2>&5
  202.54 -+  ac_status=$?
  202.55 -+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  202.56 -+  (exit $ac_status); }; }; then
  202.57 -+  ac_cv_type_statfs64=yes
  202.58 -+else
  202.59 -+  echo "$as_me: failed program was:" >&5
  202.60 -+sed 's/^/| /' conftest.$ac_ext >&5
  202.61 -+
  202.62 -+ac_cv_type_statfs64=no
  202.63 -+fi
  202.64 -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  202.65 -+fi
  202.66 -+
  202.67 -+echo "$as_me:$LINENO: result: $ac_cv_type_statfs64" >&5
  202.68 -+echo "${ECHO_T}$ac_cv_type_statfs64" >&6
  202.69 -+if test "$ac_cv_type_statfs64" = yes
  202.70 -+then
  202.71 -+
  202.72 -+cat >>confdefs.h <<\_ACEOF
  202.73 -+#define HAVE_STATFS64 1
  202.74 -+_ACEOF
  202.75 -+
  202.76 -+fi
  202.77 -+
  202.78 -
  202.79 - { echo "$as_me:$LINENO: checking return type of signal handlers" >&5
  202.80 - echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6; }
   203.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   203.2 +++ b/patches/strace/4.5.16/150-dont-use-REG_SYSCALL-for-sh.patch	Mon Jul 28 21:08:01 2008 +0000
   203.3 @@ -0,0 +1,11 @@
   203.4 +diff -dur strace-4.5.16.orig/process.c strace-4.5.16/process.c
   203.5 +--- strace-4.5.16.orig/process.c	2007-01-11 23:08:38.000000000 +0100
   203.6 ++++ strace-4.5.16/process.c	2007-07-14 19:19:58.000000000 +0200
   203.7 +@@ -2685,7 +2685,6 @@
   203.8 +        { 4*REG_GBR,            "4*REG_GBR"                             },
   203.9 +        { 4*REG_MACH,           "4*REG_MACH"                            },
  203.10 +        { 4*REG_MACL,           "4*REG_MACL"                            },
  203.11 +-       { 4*REG_SYSCALL,        "4*REG_SYSCALL"                         },
  203.12 +        { 4*REG_FPUL,           "4*REG_FPUL"                            },
  203.13 +        { 4*REG_FPREG0,         "4*REG_FPREG0"                          },
  203.14 +        { 4*(REG_FPREG0+1),     "4*REG_FPREG1"                          },
   204.1 --- a/patches/strace/4.5.16/150-strace-dont-use-REG_SYSCALL-for-sh.patch	Mon Jul 28 20:17:48 2008 +0000
   204.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   204.3 @@ -1,11 +0,0 @@
   204.4 -diff -dur strace-4.5.16.orig/process.c strace-4.5.16/process.c
   204.5 ---- strace-4.5.16.orig/process.c	2007-01-11 23:08:38.000000000 +0100
   204.6 -+++ strace-4.5.16/process.c	2007-07-14 19:19:58.000000000 +0200
   204.7 -@@ -2685,7 +2685,6 @@
   204.8 -        { 4*REG_GBR,            "4*REG_GBR"                             },
   204.9 -        { 4*REG_MACH,           "4*REG_MACH"                            },
  204.10 -        { 4*REG_MACL,           "4*REG_MACL"                            },
  204.11 --       { 4*REG_SYSCALL,        "4*REG_SYSCALL"                         },
  204.12 -        { 4*REG_FPUL,           "4*REG_FPUL"                            },
  204.13 -        { 4*REG_FPREG0,         "4*REG_FPREG0"                          },
  204.14 -        { 4*(REG_FPREG0+1),     "4*REG_FPREG1"                          },
   205.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   205.2 +++ b/patches/strace/4.5.16/200-fix-arm-bad-syscall.patch	Mon Jul 28 21:08:01 2008 +0000
   205.3 @@ -0,0 +1,19 @@
   205.4 +diff -dur strace-4.5.16.orig/syscall.c strace-4.5.16/syscall.c
   205.5 +--- strace-4.5.16.orig/syscall.c	2006-12-21 23:13:33.000000000 +0100
   205.6 ++++ strace-4.5.16/syscall.c	2007-07-14 19:21:44.000000000 +0200
   205.7 +@@ -1045,6 +1045,15 @@
   205.8 + 		/*
   205.9 + 		 * Note: we only deal with only 32-bit CPUs here.
  205.10 + 		 */
  205.11 ++
  205.12 ++		if (!(tcp->flags & TCB_INSYSCALL) &&
  205.13 ++		    (tcp->flags & TCB_WAITEXECVE)) {
  205.14 ++			/* caught a fake syscall from the execve's exit */
  205.15 ++			tcp->flags &= ~TCB_WAITEXECVE;
  205.16 ++			return 0;
  205.17 ++		}
  205.18 ++
  205.19 ++
  205.20 + 		if (regs.ARM_cpsr & 0x20) {
  205.21 + 			/*
  205.22 + 			 * Get the Thumb-mode system call number
   206.1 --- a/patches/strace/4.5.16/200-strace-fix-arm-bad-syscall.patch	Mon Jul 28 20:17:48 2008 +0000
   206.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   206.3 @@ -1,19 +0,0 @@
   206.4 -diff -dur strace-4.5.16.orig/syscall.c strace-4.5.16/syscall.c
   206.5 ---- strace-4.5.16.orig/syscall.c	2006-12-21 23:13:33.000000000 +0100
   206.6 -+++ strace-4.5.16/syscall.c	2007-07-14 19:21:44.000000000 +0200
   206.7 -@@ -1045,6 +1045,15 @@
   206.8 - 		/*
   206.9 - 		 * Note: we only deal with only 32-bit CPUs here.
  206.10 - 		 */
  206.11 -+
  206.12 -+		if (!(tcp->flags & TCB_INSYSCALL) &&
  206.13 -+		    (tcp->flags & TCB_WAITEXECVE)) {
  206.14 -+			/* caught a fake syscall from the execve's exit */
  206.15 -+			tcp->flags &= ~TCB_WAITEXECVE;
  206.16 -+			return 0;
  206.17 -+		}
  206.18 -+
  206.19 -+
  206.20 - 		if (regs.ARM_cpsr & 0x20) {
  206.21 - 			/*
  206.22 - 			 * Get the Thumb-mode system call number
   207.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   207.2 +++ b/patches/strace/4.5.16/250-fix-disabled-largefile-syscalls.patch	Mon Jul 28 21:08:01 2008 +0000
   207.3 @@ -0,0 +1,22 @@
   207.4 +diff -dur strace-4.5.16.orig/syscall.c strace-4.5.16/syscall.c
   207.5 +--- strace-4.5.16.orig/syscall.c	2007-07-14 19:21:44.000000000 +0200
   207.6 ++++ strace-4.5.16/syscall.c	2007-07-14 19:22:49.000000000 +0200
   207.7 +@@ -125,6 +125,18 @@
   207.8 + #define TP TRACE_PROCESS
   207.9 + #define TS TRACE_SIGNAL
  207.10 +
  207.11 ++#ifndef HAVE_STATFS64
  207.12 ++/*
  207.13 ++ * Ugly hacks for systems that do not have LFS
  207.14 ++ */
  207.15 ++
  207.16 ++#define sys_truncate64  sys_truncate
  207.17 ++#define sys_ftruncate64 sys_ftruncate
  207.18 ++#define sys_getdents64  sys_getdents
  207.19 ++#define sys_statfs64    sys_statfs
  207.20 ++#define sys_fstatfs64   sys_fstatfs
  207.21 ++#endif
  207.22 ++
  207.23 + static const struct sysent sysent0[] = {
  207.24 + #include "syscallent.h"
  207.25 + };
   208.1 --- a/patches/strace/4.5.16/250-strace-fix-disabled-largefile-syscalls.patch	Mon Jul 28 20:17:48 2008 +0000
   208.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   208.3 @@ -1,22 +0,0 @@
   208.4 -diff -dur strace-4.5.16.orig/syscall.c strace-4.5.16/syscall.c
   208.5 ---- strace-4.5.16.orig/syscall.c	2007-07-14 19:21:44.000000000 +0200
   208.6 -+++ strace-4.5.16/syscall.c	2007-07-14 19:22:49.000000000 +0200
   208.7 -@@ -125,6 +125,18 @@
   208.8 - #define TP TRACE_PROCESS
   208.9 - #define TS TRACE_SIGNAL
  208.10 -
  208.11 -+#ifndef HAVE_STATFS64
  208.12 -+/*
  208.13 -+ * Ugly hacks for systems that do not have LFS
  208.14 -+ */
  208.15 -+
  208.16 -+#define sys_truncate64  sys_truncate
  208.17 -+#define sys_ftruncate64 sys_ftruncate
  208.18 -+#define sys_getdents64  sys_getdents
  208.19 -+#define sys_statfs64    sys_statfs
  208.20 -+#define sys_fstatfs64   sys_fstatfs
  208.21 -+#endif
  208.22 -+
  208.23 - static const struct sysent sysent0[] = {
  208.24 - #include "syscallent.h"
  208.25 - };
   209.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   209.2 +++ b/patches/strace/4.5.16/350-statfs64-check.patch	Mon Jul 28 21:08:01 2008 +0000
   209.3 @@ -0,0 +1,53 @@
   209.4 +diff -dur strace-4.5.16.orig/acinclude.m4 strace-4.5.16/acinclude.m4
   209.5 +--- strace-4.5.16.orig/acinclude.m4	2004-04-14 04:21:01.000000000 +0200
   209.6 ++++ strace-4.5.16/acinclude.m4	2007-07-14 19:25:25.000000000 +0200
   209.7 +@@ -210,6 +210,26 @@
   209.8 + fi
   209.9 + ])
  209.10 +
  209.11 ++dnl ### A macro to determine whether statfs64 is defined.
  209.12 ++AC_DEFUN([AC_STATFS64],
  209.13 ++[AC_MSG_CHECKING(for statfs64 in sys/(statfs|vfs).h)
  209.14 ++AC_CACHE_VAL(ac_cv_type_statfs64,
  209.15 ++[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef LINUX
  209.16 ++#include <linux/types.h>
  209.17 ++#include <sys/statfs.h>
  209.18 ++#else
  209.19 ++#include <sys/vfs.h>
  209.20 ++#endif]], [[struct statfs64 st;]])],[ac_cv_type_statfs64=yes],[ac_cv_type_statfs64=no])])
  209.21 ++AC_MSG_RESULT($ac_cv_type_statfs64)
  209.22 ++if test "$ac_cv_type_statfs64" = yes
  209.23 ++then
  209.24 ++	AC_DEFINE([HAVE_STATFS64], 1,
  209.25 ++[Define if statfs64 is available in sys/statfs.h or sys/vfs.h.])
  209.26 ++fi
  209.27 ++])
  209.28 ++
  209.29 ++
  209.30 ++
  209.31 + dnl ### A macro to determine if off_t is a long long
  209.32 + AC_DEFUN([AC_OFF_T_IS_LONG_LONG],
  209.33 + [AC_MSG_CHECKING(for long long off_t)
  209.34 +diff -dur strace-4.5.16.orig/configure.ac strace-4.5.16/configure.ac
  209.35 +--- strace-4.5.16.orig/configure.ac	2007-01-11 12:37:55.000000000 +0100
  209.36 ++++ strace-4.5.16/configure.ac	2007-07-14 19:25:25.000000000 +0200
  209.37 +@@ -169,6 +169,7 @@
  209.38 + 		  struct stat.st_level,
  209.39 + 		  struct stat.st_rdev])
  209.40 + AC_STAT64
  209.41 ++AC_STATFS64
  209.42 +
  209.43 + AC_TYPE_SIGNAL
  209.44 + AC_TYPE_UID_T
  209.45 +diff -dur strace-4.5.16.orig/file.c strace-4.5.16/file.c
  209.46 +--- strace-4.5.16.orig/file.c	2007-01-15 21:25:52.000000000 +0100
  209.47 ++++ strace-4.5.16/file.c	2007-07-14 19:25:25.000000000 +0200
  209.48 +@@ -1636,7 +1636,7 @@
  209.49 + 	return 0;
  209.50 + }
  209.51 +
  209.52 +-#ifdef LINUX
  209.53 ++#ifdef HAVE_STATFS64
  209.54 + static void
  209.55 + printstatfs64(tcp, addr)
  209.56 + struct tcb *tcp;
   210.1 --- a/patches/strace/4.5.16/350-strace-statfs64-check.patch	Mon Jul 28 20:17:48 2008 +0000
   210.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   210.3 @@ -1,53 +0,0 @@
   210.4 -diff -dur strace-4.5.16.orig/acinclude.m4 strace-4.5.16/acinclude.m4
   210.5 ---- strace-4.5.16.orig/acinclude.m4	2004-04-14 04:21:01.000000000 +0200
   210.6 -+++ strace-4.5.16/acinclude.m4	2007-07-14 19:25:25.000000000 +0200
   210.7 -@@ -210,6 +210,26 @@
   210.8 - fi
   210.9 - ])
  210.10 -
  210.11 -+dnl ### A macro to determine whether statfs64 is defined.
  210.12 -+AC_DEFUN([AC_STATFS64],
  210.13 -+[AC_MSG_CHECKING(for statfs64 in sys/(statfs|vfs).h)
  210.14 -+AC_CACHE_VAL(ac_cv_type_statfs64,
  210.15 -+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef LINUX
  210.16 -+#include <linux/types.h>
  210.17 -+#include <sys/statfs.h>
  210.18 -+#else
  210.19 -+#include <sys/vfs.h>
  210.20 -+#endif]], [[struct statfs64 st;]])],[ac_cv_type_statfs64=yes],[ac_cv_type_statfs64=no])])
  210.21 -+AC_MSG_RESULT($ac_cv_type_statfs64)
  210.22 -+if test "$ac_cv_type_statfs64" = yes
  210.23 -+then
  210.24 -+	AC_DEFINE([HAVE_STATFS64], 1,
  210.25 -+[Define if statfs64 is available in sys/statfs.h or sys/vfs.h.])
  210.26 -+fi
  210.27 -+])
  210.28 -+
  210.29 -+
  210.30 -+
  210.31 - dnl ### A macro to determine if off_t is a long long
  210.32 - AC_DEFUN([AC_OFF_T_IS_LONG_LONG],
  210.33 - [AC_MSG_CHECKING(for long long off_t)
  210.34 -diff -dur strace-4.5.16.orig/configure.ac strace-4.5.16/configure.ac
  210.35 ---- strace-4.5.16.orig/configure.ac	2007-01-11 12:37:55.000000000 +0100
  210.36 -+++ strace-4.5.16/configure.ac	2007-07-14 19:25:25.000000000 +0200
  210.37 -@@ -169,6 +169,7 @@
  210.38 - 		  struct stat.st_level,
  210.39 - 		  struct stat.st_rdev])
  210.40 - AC_STAT64
  210.41 -+AC_STATFS64
  210.42 -
  210.43 - AC_TYPE_SIGNAL
  210.44 - AC_TYPE_UID_T
  210.45 -diff -dur strace-4.5.16.orig/file.c strace-4.5.16/file.c
  210.46 ---- strace-4.5.16.orig/file.c	2007-01-15 21:25:52.000000000 +0100
  210.47 -+++ strace-4.5.16/file.c	2007-07-14 19:25:25.000000000 +0200
  210.48 -@@ -1636,7 +1636,7 @@
  210.49 - 	return 0;
  210.50 - }
  210.51 -
  210.52 --#ifdef LINUX
  210.53 -+#ifdef HAVE_STATFS64
  210.54 - static void
  210.55 - printstatfs64(tcp, addr)
  210.56 - struct tcb *tcp;
   211.1 --- a/patches/strace/4.5.16/400-strace-superh-update.ac.patch	Mon Jul 28 20:17:48 2008 +0000
   211.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   211.3 @@ -1,22 +0,0 @@
   211.4 -diff -dur strace-4.5.16.orig/configure.ac strace-4.5.16/configure.ac
   211.5 ---- strace-4.5.16.orig/configure.ac	2007-07-14 19:25:25.000000000 +0200
   211.6 -+++ strace-4.5.16/configure.ac	2007-07-14 19:27:35.000000000 +0200
   211.7 -@@ -91,14 +91,14 @@
   211.8 - 	arch=hppa
   211.9 - 	AC_DEFINE([HPPA], 1, [Define for the HPPA architecture.])
  211.10 - 	;;
  211.11 --sh)
  211.12 --	arch=sh
  211.13 --	AC_DEFINE([SH], 1, [Define for the SH architecture.])
  211.14 --	;;
  211.15 - sh64)
  211.16 - 	arch=sh64
  211.17 - 	AC_DEFINE([SH64], 1, [Define for the SH64 architecture.])
  211.18 - 	;;
  211.19 -+sh*)
  211.20 -+	arch=sh
  211.21 -+	AC_DEFINE([SH], 1, [Define for the SH architecture.])
  211.22 -+	;;
  211.23 - x86?64*)
  211.24 - 	arch=x86_64
  211.25 - 	AC_DEFINE([X86_64], 1, [Define for the AMD x86-64 architecture.])
   212.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   212.2 +++ b/patches/strace/4.5.16/400-superh-update.ac.patch	Mon Jul 28 21:08:01 2008 +0000
   212.3 @@ -0,0 +1,22 @@
   212.4 +diff -dur strace-4.5.16.orig/configure.ac strace-4.5.16/configure.ac
   212.5 +--- strace-4.5.16.orig/configure.ac	2007-07-14 19:25:25.000000000 +0200
   212.6 ++++ strace-4.5.16/configure.ac	2007-07-14 19:27:35.000000000 +0200
   212.7 +@@ -91,14 +91,14 @@
   212.8 + 	arch=hppa
   212.9 + 	AC_DEFINE([HPPA], 1, [Define for the HPPA architecture.])
  212.10 + 	;;
  212.11 +-sh)
  212.12 +-	arch=sh
  212.13 +-	AC_DEFINE([SH], 1, [Define for the SH architecture.])
  212.14 +-	;;
  212.15 + sh64)
  212.16 + 	arch=sh64
  212.17 + 	AC_DEFINE([SH64], 1, [Define for the SH64 architecture.])
  212.18 + 	;;
  212.19 ++sh*)
  212.20 ++	arch=sh
  212.21 ++	AC_DEFINE([SH], 1, [Define for the SH architecture.])
  212.22 ++	;;
  212.23 + x86?64*)
  212.24 + 	arch=x86_64
  212.25 + 	AC_DEFINE([X86_64], 1, [Define for the AMD x86-64 architecture.])
   213.1 --- a/patches/strace/4.5.16/450-strace-undef-CTL_PROC.patch	Mon Jul 28 20:17:48 2008 +0000
   213.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   213.3 @@ -1,13 +0,0 @@
   213.4 -diff -dur strace-4.5.16.orig/system.c strace-4.5.16/system.c
   213.5 ---- strace-4.5.16.orig/system.c	2007-01-17 00:22:36.000000000 +0100
   213.6 -+++ strace-4.5.16/system.c	2007-07-14 19:28:41.000000000 +0200
   213.7 -@@ -1612,7 +1612,9 @@
   213.8 - 	{ CTL_KERN, "CTL_KERN" },
   213.9 - 	{ CTL_VM, "CTL_VM" },
  213.10 - 	{ CTL_NET, "CTL_NET" },
  213.11 -+#ifdef CTL_PROC
  213.12 - 	{ CTL_PROC, "CTL_PROC" },
  213.13 -+#endif
  213.14 - 	{ CTL_FS, "CTL_FS" },
  213.15 - 	{ CTL_DEBUG, "CTL_DEBUG" },
  213.16 - 	{ CTL_DEV, "CTL_DEV" },
   214.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   214.2 +++ b/patches/strace/4.5.16/450-undef-CTL_PROC.patch	Mon Jul 28 21:08:01 2008 +0000
   214.3 @@ -0,0 +1,13 @@
   214.4 +diff -dur strace-4.5.16.orig/system.c strace-4.5.16/system.c
   214.5 +--- strace-4.5.16.orig/system.c	2007-01-17 00:22:36.000000000 +0100
   214.6 ++++ strace-4.5.16/system.c	2007-07-14 19:28:41.000000000 +0200
   214.7 +@@ -1612,7 +1612,9 @@
   214.8 + 	{ CTL_KERN, "CTL_KERN" },
   214.9 + 	{ CTL_VM, "CTL_VM" },
  214.10 + 	{ CTL_NET, "CTL_NET" },
  214.11 ++#ifdef CTL_PROC
  214.12 + 	{ CTL_PROC, "CTL_PROC" },
  214.13 ++#endif
  214.14 + 	{ CTL_FS, "CTL_FS" },
  214.15 + 	{ CTL_DEBUG, "CTL_DEBUG" },
  214.16 + 	{ CTL_DEV, "CTL_DEV" },
   215.1 --- a/patches/strace/4.5.16/500-strace-undef-PACKET_MEMBERSHIP.patch	Mon Jul 28 20:17:48 2008 +0000
   215.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   215.3 @@ -1,16 +0,0 @@
   215.4 -diff -dur strace-4.5.16.orig/net.c strace-4.5.16/net.c
   215.5 ---- strace-4.5.16.orig/net.c	2006-12-13 20:57:23.000000000 +0100
   215.6 -+++ strace-4.5.16/net.c	2007-07-14 19:29:36.000000000 +0200
   215.7 -@@ -800,8 +800,12 @@
   215.8 -
   215.9 - #ifdef SOL_PACKET
  215.10 - static const struct xlat sockpacketoptions[] = {
  215.11 -+#if defined(PACKET_ADD_MEMBERSHIP)
  215.12 - 	{ PACKET_ADD_MEMBERSHIP,	"PACKET_ADD_MEMBERSHIP"	},
  215.13 -+#endif
  215.14 -+#if defined(PACKET_DROP_MEMBERSHIP)
  215.15 - 	{ PACKET_DROP_MEMBERSHIP,	"PACKET_DROP_MEMBERSHIP"},
  215.16 -+#endif
  215.17 - #if defined(PACKET_RECV_OUTPUT)
  215.18 - 	{ PACKET_RECV_OUTPUT,		"PACKET_RECV_OUTPUT"	},
  215.19 - #endif
   216.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   216.2 +++ b/patches/strace/4.5.16/500-undef-PACKET_MEMBERSHIP.patch	Mon Jul 28 21:08:01 2008 +0000
   216.3 @@ -0,0 +1,16 @@
   216.4 +diff -dur strace-4.5.16.orig/net.c strace-4.5.16/net.c
   216.5 +--- strace-4.5.16.orig/net.c	2006-12-13 20:57:23.000000000 +0100
   216.6 ++++ strace-4.5.16/net.c	2007-07-14 19:29:36.000000000 +0200
   216.7 +@@ -800,8 +800,12 @@
   216.8 +
   216.9 + #ifdef SOL_PACKET
  216.10 + static const struct xlat sockpacketoptions[] = {
  216.11 ++#if defined(PACKET_ADD_MEMBERSHIP)
  216.12 + 	{ PACKET_ADD_MEMBERSHIP,	"PACKET_ADD_MEMBERSHIP"	},
  216.13 ++#endif
  216.14 ++#if defined(PACKET_DROP_MEMBERSHIP)
  216.15 + 	{ PACKET_DROP_MEMBERSHIP,	"PACKET_DROP_MEMBERSHIP"},
  216.16 ++#endif
  216.17 + #if defined(PACKET_RECV_OUTPUT)
  216.18 + 	{ PACKET_RECV_OUTPUT,		"PACKET_RECV_OUTPUT"	},
  216.19 + #endif
   217.1 --- a/patches/strace/4.5.16/550-strace-undef-syscall.patch	Mon Jul 28 20:17:48 2008 +0000
   217.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   217.3 @@ -1,64 +0,0 @@
   217.4 -diff -dur strace-4.5.16.orig/linux/syscallent.h strace-4.5.16/linux/syscallent.h
   217.5 ---- strace-4.5.16.orig/linux/syscallent.h	2006-10-16 03:17:52.000000000 +0200
   217.6 -+++ strace-4.5.16/linux/syscallent.h	2007-07-14 19:30:16.000000000 +0200
   217.7 -@@ -130,7 +130,11 @@
   217.8 - 	{ 2,	TF,	sys_statfs,		"statfs"	}, /* 99 */
   217.9 - 	{ 2,	TD,	sys_fstatfs,		"fstatfs"	}, /* 100 */
  217.10 - 	{ 3,	0,	sys_ioperm,		"ioperm"	}, /* 101 */
  217.11 --	{ 2,	TD,	sys_socketcall,		"socketcall", SYS_socketcall }, /* 102 */
  217.12 -+	{ 2,	TD,	sys_socketcall,		"socketcall"
  217.13 -+#ifdef __NR_socketcall
  217.14 -+	    , SYS_socketcall
  217.15 -+#endif
  217.16 -+								}, /* 102 */
  217.17 - 	{ 3,	0,	sys_syslog,		"syslog"	}, /* 103 */
  217.18 - 	{ 3,	0,	sys_setitimer,		"setitimer"	}, /* 104 */
  217.19 - 	{ 2,	0,	sys_getitimer,		"getitimer"	}, /* 105 */
  217.20 -@@ -145,7 +149,11 @@
  217.21 - 	{ 4,	TP,	sys_wait4,		"wait4", SYS_wait4 }, /* 114 */
  217.22 - 	{ 1,	0,	sys_swapoff,		"swapoff"	}, /* 115 */
  217.23 - 	{ 1,	0,	sys_sysinfo,		"sysinfo"	}, /* 116 */
  217.24 --	{ 6,	0,	sys_ipc,		"ipc", SYS_ipc }, /* 117 */
  217.25 -+	{ 6,	0,	sys_ipc,		"ipc"
  217.26 -+#ifdef __NR_ipc
  217.27 -+	    , SYS_ipc
  217.28 -+#endif
  217.29 -+								}, /* 117 */
  217.30 - 	{ 1,	TD,	sys_fsync,		"fsync"		}, /* 118 */
  217.31 - 	{ 1,	TS,	sys_sigreturn,		"sigreturn"	}, /* 119 */
  217.32 - 	{ 5,	TP,	sys_clone,		"clone", SYS_clone }, /* 120 */
  217.33 -@@ -282,7 +290,11 @@
  217.34 - 	{ 3,	0,	sys_io_cancel,		"io_cancel"	}, /* 249 */
  217.35 - 	{ 5,	0,	sys_fadvise64,		"fadvise64"	}, /* 250 */
  217.36 - 	{ 5,	0,	printargs,		"SYS_251"	}, /* 251 */
  217.37 --	{ 1,	TP,	sys_exit,		"exit_group", __NR_exit_group }, /* 252 */
  217.38 -+	{ 1,	TP,	sys_exit,		"exit_group"
  217.39 -+#ifdef __NR_exit_group
  217.40 -+	    , __NR_exit_group
  217.41 -+#endif
  217.42 -+								}, /* 252 */
  217.43 - 	{ 4,	0,	printargs,		"lookup_dcookie"}, /* 253 */
  217.44 - 	{ 1,	0,	sys_epoll_create,	"epoll_create"	}, /* 254 */
  217.45 - 	{ 4,	TD,	sys_epoll_ctl,		"epoll_ctl"	}, /* 255 */
  217.46 -diff -dur strace-4.5.16.orig/syscall.c strace-4.5.16/syscall.c
  217.47 ---- strace-4.5.16.orig/syscall.c	2007-07-14 19:22:49.000000000 +0200
  217.48 -+++ strace-4.5.16/syscall.c	2007-07-14 19:30:16.000000000 +0200
  217.49 -@@ -2383,14 +2383,18 @@
  217.50 - 	switch (known_scno(tcp)) {
  217.51 - #ifdef LINUX
  217.52 - #if !defined (ALPHA) && !defined(SPARC) && !defined(SPARC64) && !defined(MIPS) && !defined(HPPA)
  217.53 -+#ifdef __NR_socketcall
  217.54 - 	case SYS_socketcall:
  217.55 - 		decode_subcall(tcp, SYS_socket_subcall,
  217.56 - 			SYS_socket_nsubcalls, deref_style);
  217.57 - 		break;
  217.58 -+#endif
  217.59 -+#ifdef __NR_ipc
  217.60 - 	case SYS_ipc:
  217.61 - 		decode_subcall(tcp, SYS_ipc_subcall,
  217.62 - 			SYS_ipc_nsubcalls, shift_style);
  217.63 - 		break;
  217.64 -+#endif
  217.65 - #endif /* !ALPHA && !MIPS && !SPARC && !SPARC64 && !HPPA */
  217.66 - #if defined (SPARC) || defined (SPARC64)
  217.67 - 	case SYS_socketcall:
   218.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   218.2 +++ b/patches/strace/4.5.16/550-undef-syscall.patch	Mon Jul 28 21:08:01 2008 +0000
   218.3 @@ -0,0 +1,64 @@
   218.4 +diff -dur strace-4.5.16.orig/linux/syscallent.h strace-4.5.16/linux/syscallent.h
   218.5 +--- strace-4.5.16.orig/linux/syscallent.h	2006-10-16 03:17:52.000000000 +0200
   218.6 ++++ strace-4.5.16/linux/syscallent.h	2007-07-14 19:30:16.000000000 +0200
   218.7 +@@ -130,7 +130,11 @@
   218.8 + 	{ 2,	TF,	sys_statfs,		"statfs"	}, /* 99 */
   218.9 + 	{ 2,	TD,	sys_fstatfs,		"fstatfs"	}, /* 100 */
  218.10 + 	{ 3,	0,	sys_ioperm,		"ioperm"	}, /* 101 */
  218.11 +-	{ 2,	TD,	sys_socketcall,		"socketcall", SYS_socketcall }, /* 102 */
  218.12 ++	{ 2,	TD,	sys_socketcall,		"socketcall"
  218.13 ++#ifdef __NR_socketcall
  218.14 ++	    , SYS_socketcall
  218.15 ++#endif
  218.16 ++								}, /* 102 */
  218.17 + 	{ 3,	0,	sys_syslog,		"syslog"	}, /* 103 */
  218.18 + 	{ 3,	0,	sys_setitimer,		"setitimer"	}, /* 104 */
  218.19 + 	{ 2,	0,	sys_getitimer,		"getitimer"	}, /* 105 */
  218.20 +@@ -145,7 +149,11 @@
  218.21 + 	{ 4,	TP,	sys_wait4,		"wait4", SYS_wait4 }, /* 114 */
  218.22 + 	{ 1,	0,	sys_swapoff,		"swapoff"	}, /* 115 */
  218.23 + 	{ 1,	0,	sys_sysinfo,		"sysinfo"	}, /* 116 */
  218.24 +-	{ 6,	0,	sys_ipc,		"ipc", SYS_ipc }, /* 117 */
  218.25 ++	{ 6,	0,	sys_ipc,		"ipc"
  218.26 ++#ifdef __NR_ipc
  218.27 ++	    , SYS_ipc
  218.28 ++#endif
  218.29 ++								}, /* 117 */
  218.30 + 	{ 1,	TD,	sys_fsync,		"fsync"		}, /* 118 */
  218.31 + 	{ 1,	TS,	sys_sigreturn,		"sigreturn"	}, /* 119 */
  218.32 + 	{ 5,	TP,	sys_clone,		"clone", SYS_clone }, /* 120 */
  218.33 +@@ -282,7 +290,11 @@
  218.34 + 	{ 3,	0,	sys_io_cancel,		"io_cancel"	}, /* 249 */
  218.35 + 	{ 5,	0,	sys_fadvise64,		"fadvise64"	}, /* 250 */
  218.36 + 	{ 5,	0,	printargs,		"SYS_251"	}, /* 251 */
  218.37 +-	{ 1,	TP,	sys_exit,		"exit_group", __NR_exit_group }, /* 252 */
  218.38 ++	{ 1,	TP,	sys_exit,		"exit_group"
  218.39 ++#ifdef __NR_exit_group
  218.40 ++	    , __NR_exit_group
  218.41 ++#endif
  218.42 ++								}, /* 252 */
  218.43 + 	{ 4,	0,	printargs,		"lookup_dcookie"}, /* 253 */
  218.44 + 	{ 1,	0,	sys_epoll_create,	"epoll_create"	}, /* 254 */
  218.45 + 	{ 4,	TD,	sys_epoll_ctl,		"epoll_ctl"	}, /* 255 */
  218.46 +diff -dur strace-4.5.16.orig/syscall.c strace-4.5.16/syscall.c
  218.47 +--- strace-4.5.16.orig/syscall.c	2007-07-14 19:22:49.000000000 +0200
  218.48 ++++ strace-4.5.16/syscall.c	2007-07-14 19:30:16.000000000 +0200
  218.49 +@@ -2383,14 +2383,18 @@
  218.50 + 	switch (known_scno(tcp)) {
  218.51 + #ifdef LINUX
  218.52 + #if !defined (ALPHA) && !defined(SPARC) && !defined(SPARC64) && !defined(MIPS) && !defined(HPPA)
  218.53 ++#ifdef __NR_socketcall
  218.54 + 	case SYS_socketcall:
  218.55 + 		decode_subcall(tcp, SYS_socket_subcall,
  218.56 + 			SYS_socket_nsubcalls, deref_style);
  218.57 + 		break;
  218.58 ++#endif
  218.59 ++#ifdef __NR_ipc
  218.60 + 	case SYS_ipc:
  218.61 + 		decode_subcall(tcp, SYS_ipc_subcall,
  218.62 + 			SYS_ipc_nsubcalls, shift_style);
  218.63 + 		break;
  218.64 ++#endif
  218.65 + #endif /* !ALPHA && !MIPS && !SPARC && !SPARC64 && !HPPA */
  218.66 + #if defined (SPARC) || defined (SPARC64)
  218.67 + 	case SYS_socketcall:
   219.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   219.2 +++ b/patches/uClibc/0.9.28.1/004-ctype.patch	Mon Jul 28 21:08:01 2008 +0000
   219.3 @@ -0,0 +1,17 @@
   219.4 +diff -urN uClibc-dist/libc/sysdeps/linux/common/bits/uClibc_touplow.h uClibc/libc/sysdeps/linux/common/bits/uClibc_touplow.h
   219.5 +--- uClibc-dist/libc/sysdeps/linux/common/bits/uClibc_touplow.h   Fri Jun  3 13:30:25 2005
   219.6 ++++ uClibc/libc/sysdeps/linux/common/bits/uClibc_touplow.h   Fri Jun  3 13:30:39 2005
   219.7 +@@ -34,11 +34,11 @@
   219.8 +
   219.9 + /* glibc uses the equivalent of - typedef __int32_t __ctype_touplow_t; */
  219.10 +
  219.11 +-typedef __uint16_t __ctype_mask_t;
  219.12 ++typedef __uint32_t __ctype_mask_t;
  219.13 +
  219.14 + #ifdef __UCLIBC_HAS_CTYPE_SIGNED__
  219.15 +
  219.16 +-typedef __int16_t __ctype_touplow_t;
  219.17 ++typedef __int32_t __ctype_touplow_t;
  219.18 + #define __UCLIBC_CTYPE_B_TBL_OFFSET       128
  219.19 + #define __UCLIBC_CTYPE_TO_TBL_OFFSET      128
  219.20 +
   220.1 --- a/patches/uClibc/0.9.28.1/004-uClibc_ctype.patch	Mon Jul 28 20:17:48 2008 +0000
   220.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   220.3 @@ -1,17 +0,0 @@
   220.4 -diff -urN uClibc-dist/libc/sysdeps/linux/common/bits/uClibc_touplow.h uClibc/libc/sysdeps/linux/common/bits/uClibc_touplow.h
   220.5 ---- uClibc-dist/libc/sysdeps/linux/common/bits/uClibc_touplow.h   Fri Jun  3 13:30:25 2005
   220.6 -+++ uClibc/libc/sysdeps/linux/common/bits/uClibc_touplow.h   Fri Jun  3 13:30:39 2005
   220.7 -@@ -34,11 +34,11 @@
   220.8 -
   220.9 - /* glibc uses the equivalent of - typedef __int32_t __ctype_touplow_t; */
  220.10 -
  220.11 --typedef __uint16_t __ctype_mask_t;
  220.12 -+typedef __uint32_t __ctype_mask_t;
  220.13 -
  220.14 - #ifdef __UCLIBC_HAS_CTYPE_SIGNED__
  220.15 -
  220.16 --typedef __int16_t __ctype_touplow_t;
  220.17 -+typedef __int32_t __ctype_touplow_t;
  220.18 - #define __UCLIBC_CTYPE_B_TBL_OFFSET       128
  220.19 - #define __UCLIBC_CTYPE_TO_TBL_OFFSET      128
  220.20 -
   221.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   221.2 +++ b/patches/uClibc/0.9.28.2/004-ctype.patch	Mon Jul 28 21:08:01 2008 +0000
   221.3 @@ -0,0 +1,17 @@
   221.4 +diff -urN uClibc-dist/libc/sysdeps/linux/common/bits/uClibc_touplow.h uClibc/libc/sysdeps/linux/common/bits/uClibc_touplow.h
   221.5 +--- uClibc-dist/libc/sysdeps/linux/common/bits/uClibc_touplow.h   Fri Jun  3 13:30:25 2005
   221.6 ++++ uClibc/libc/sysdeps/linux/common/bits/uClibc_touplow.h   Fri Jun  3 13:30:39 2005
   221.7 +@@ -34,11 +34,11 @@
   221.8 +
   221.9 + /* glibc uses the equivalent of - typedef __int32_t __ctype_touplow_t; */
  221.10 +
  221.11 +-typedef __uint16_t __ctype_mask_t;
  221.12 ++typedef __uint32_t __ctype_mask_t;
  221.13 +
  221.14 + #ifdef __UCLIBC_HAS_CTYPE_SIGNED__
  221.15 +
  221.16 +-typedef __int16_t __ctype_touplow_t;
  221.17 ++typedef __int32_t __ctype_touplow_t;
  221.18 + #define __UCLIBC_CTYPE_B_TBL_OFFSET       128
  221.19 + #define __UCLIBC_CTYPE_TO_TBL_OFFSET      128
  221.20 +
   222.1 --- a/patches/uClibc/0.9.28.2/004-uClibc_ctype.patch	Mon Jul 28 20:17:48 2008 +0000
   222.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   222.3 @@ -1,17 +0,0 @@
   222.4 -diff -urN uClibc-dist/libc/sysdeps/linux/common/bits/uClibc_touplow.h uClibc/libc/sysdeps/linux/common/bits/uClibc_touplow.h
   222.5 ---- uClibc-dist/libc/sysdeps/linux/common/bits/uClibc_touplow.h   Fri Jun  3 13:30:25 2005
   222.6 -+++ uClibc/libc/sysdeps/linux/common/bits/uClibc_touplow.h   Fri Jun  3 13:30:39 2005
   222.7 -@@ -34,11 +34,11 @@
   222.8 -
   222.9 - /* glibc uses the equivalent of - typedef __int32_t __ctype_touplow_t; */
  222.10 -
  222.11 --typedef __uint16_t __ctype_mask_t;
  222.12 -+typedef __uint32_t __ctype_mask_t;
  222.13 -
  222.14 - #ifdef __UCLIBC_HAS_CTYPE_SIGNED__
  222.15 -
  222.16 --typedef __int16_t __ctype_touplow_t;
  222.17 -+typedef __int32_t __ctype_touplow_t;
  222.18 - #define __UCLIBC_CTYPE_B_TBL_OFFSET       128
  222.19 - #define __UCLIBC_CTYPE_TO_TBL_OFFSET      128
  222.20 -
   223.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   223.2 +++ b/patches/uClibc/0.9.28.3/004-ctype.patch	Mon Jul 28 21:08:01 2008 +0000
   223.3 @@ -0,0 +1,17 @@
   223.4 +diff -urN uClibc-dist/libc/sysdeps/linux/common/bits/uClibc_touplow.h uClibc/libc/sysdeps/linux/common/bits/uClibc_touplow.h
   223.5 +--- uClibc-dist/libc/sysdeps/linux/common/bits/uClibc_touplow.h   Fri Jun  3 13:30:25 2005
   223.6 ++++ uClibc/libc/sysdeps/linux/common/bits/uClibc_touplow.h   Fri Jun  3 13:30:39 2005
   223.7 +@@ -34,11 +34,11 @@
   223.8 +
   223.9 + /* glibc uses the equivalent of - typedef __int32_t __ctype_touplow_t; */
  223.10 +
  223.11 +-typedef __uint16_t __ctype_mask_t;
  223.12 ++typedef __uint32_t __ctype_mask_t;
  223.13 +
  223.14 + #ifdef __UCLIBC_HAS_CTYPE_SIGNED__
  223.15 +
  223.16 +-typedef __int16_t __ctype_touplow_t;
  223.17 ++typedef __int32_t __ctype_touplow_t;
  223.18 + #define __UCLIBC_CTYPE_B_TBL_OFFSET       128
  223.19 + #define __UCLIBC_CTYPE_TO_TBL_OFFSET      128
  223.20 +
   224.1 --- a/patches/uClibc/0.9.28.3/004-uClibc_ctype.patch	Mon Jul 28 20:17:48 2008 +0000
   224.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   224.3 @@ -1,17 +0,0 @@
   224.4 -diff -urN uClibc-dist/libc/sysdeps/linux/common/bits/uClibc_touplow.h uClibc/libc/sysdeps/linux/common/bits/uClibc_touplow.h
   224.5 ---- uClibc-dist/libc/sysdeps/linux/common/bits/uClibc_touplow.h   Fri Jun  3 13:30:25 2005
   224.6 -+++ uClibc/libc/sysdeps/linux/common/bits/uClibc_touplow.h   Fri Jun  3 13:30:39 2005
   224.7 -@@ -34,11 +34,11 @@
   224.8 -
   224.9 - /* glibc uses the equivalent of - typedef __int32_t __ctype_touplow_t; */
  224.10 -
  224.11 --typedef __uint16_t __ctype_mask_t;
  224.12 -+typedef __uint32_t __ctype_mask_t;
  224.13 -
  224.14 - #ifdef __UCLIBC_HAS_CTYPE_SIGNED__
  224.15 -
  224.16 --typedef __int16_t __ctype_touplow_t;
  224.17 -+typedef __int32_t __ctype_touplow_t;
  224.18 - #define __UCLIBC_CTYPE_B_TBL_OFFSET       128
  224.19 - #define __UCLIBC_CTYPE_TO_TBL_OFFSET      128
  224.20 -
   225.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   225.2 +++ b/patches/uClibc/0.9.28/004-ctype.patch	Mon Jul 28 21:08:01 2008 +0000
   225.3 @@ -0,0 +1,17 @@
   225.4 +diff -urN uClibc-dist/libc/sysdeps/linux/common/bits/uClibc_touplow.h uClibc/libc/sysdeps/linux/common/bits/uClibc_touplow.h
   225.5 +--- uClibc-dist/libc/sysdeps/linux/common/bits/uClibc_touplow.h   Fri Jun  3 13:30:25 2005
   225.6 ++++ uClibc/libc/sysdeps/linux/common/bits/uClibc_touplow.h   Fri Jun  3 13:30:39 2005
   225.7 +@@ -34,11 +34,11 @@
   225.8 +
   225.9 + /* glibc uses the equivalent of - typedef __int32_t __ctype_touplow_t; */
  225.10 +
  225.11 +-typedef __uint16_t __ctype_mask_t;
  225.12 ++typedef __uint32_t __ctype_mask_t;
  225.13 +
  225.14 + #ifdef __UCLIBC_HAS_CTYPE_SIGNED__
  225.15 +
  225.16 +-typedef __int16_t __ctype_touplow_t;
  225.17 ++typedef __int32_t __ctype_touplow_t;
  225.18 + #define __UCLIBC_CTYPE_B_TBL_OFFSET       128
  225.19 + #define __UCLIBC_CTYPE_TO_TBL_OFFSET      128
  225.20 +
   226.1 --- a/patches/uClibc/0.9.28/004-uClibc_ctype.patch	Mon Jul 28 20:17:48 2008 +0000
   226.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   226.3 @@ -1,17 +0,0 @@
   226.4 -diff -urN uClibc-dist/libc/sysdeps/linux/common/bits/uClibc_touplow.h uClibc/libc/sysdeps/linux/common/bits/uClibc_touplow.h
   226.5 ---- uClibc-dist/libc/sysdeps/linux/common/bits/uClibc_touplow.h   Fri Jun  3 13:30:25 2005
   226.6 -+++ uClibc/libc/sysdeps/linux/common/bits/uClibc_touplow.h   Fri Jun  3 13:30:39 2005
   226.7 -@@ -34,11 +34,11 @@
   226.8 -
   226.9 - /* glibc uses the equivalent of - typedef __int32_t __ctype_touplow_t; */
  226.10 -
  226.11 --typedef __uint16_t __ctype_mask_t;
  226.12 -+typedef __uint32_t __ctype_mask_t;
  226.13 -
  226.14 - #ifdef __UCLIBC_HAS_CTYPE_SIGNED__
  226.15 -
  226.16 --typedef __int16_t __ctype_touplow_t;
  226.17 -+typedef __int32_t __ctype_touplow_t;
  226.18 - #define __UCLIBC_CTYPE_B_TBL_OFFSET       128
  226.19 - #define __UCLIBC_CTYPE_TO_TBL_OFFSET      128
  226.20 -