summaryrefslogtreecommitdiff
path: root/patches/glibc/2.3.3
diff options
context:
space:
mode:
Diffstat (limited to 'patches/glibc/2.3.3')
-rw-r--r--patches/glibc/2.3.3/arm-ctl_bus_isa.patch51
-rw-r--r--patches/glibc/2.3.3/bad/glibc-2.3.3-alpha-pwrite64.patch51
-rw-r--r--patches/glibc/2.3.3/fixup.patch74
-rw-r--r--patches/glibc/2.3.3/glibc-2.2.5-allow-gcc-4.0-malloc.patch48
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.2-allow-gcc-3.4-inline.patch23
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.2-allow-gcc-3.5-elf.patch34
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.2-allow-gcc-3.5-gconv.patch228
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.2-allow-gcc-3.5-msort.patch46
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.2-allow-gcc-3.5-sunrpc.patch233
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.2-allow-gcc-3.5-xdr.patch44
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.2-arm-fix-strlen.patch54
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.2-pr139-fix.patch104
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.2-sparc32-sysdep.patch46
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.2-sparc64-dl-machine.patch29
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.2-without-fp.patch89
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-configure.patch30
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-elf-2.patch53
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-elf-3.patch79
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-i386.patch111
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-iconv.patch24
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-iconvdata-2.patch124
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-iconvdata.patch142
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-locale.patch34
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-posix.patch77
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-powerpc-procfs.patch65
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-x86_64.patch60
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.3-alpha-pwrite64.patch41
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.3-cygwin.patch103
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.3-libeh-kludge.patch75
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.3-s390-fadvise64.patch128
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.3-unwind-dw2.patch66
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.4-allow-gcc-4.0-arm.patch117
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.4-allow-gcc-4.0-elf.patch61
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.4-allow-gcc-4.0-powerpc32.patch42
-rw-r--r--patches/glibc/2.3.3/glibc-2.3.4-allow-gcc-4.0-powerpc64.patch60
-rw-r--r--patches/glibc/2.3.3/glibc-configure-apple-as.patch23
-rw-r--r--patches/glibc/2.3.3/glibc-fp-byteorder.patch203
37 files changed, 2872 insertions, 0 deletions
diff --git a/patches/glibc/2.3.3/arm-ctl_bus_isa.patch b/patches/glibc/2.3.3/arm-ctl_bus_isa.patch
new file mode 100644
index 0000000..3422070
--- /dev/null
+++ b/patches/glibc/2.3.3/arm-ctl_bus_isa.patch
@@ -0,0 +1,51 @@
+Applies to both glibc-2.2.5 and glibc-2.3.2, and probably glibc cvs as of Aug 2004.
+Needed to build glibc with linux kernels 2.4.23 or higher on ARM,
+Fixes following error:
+
+../sysdeps/unix/sysv/linux/arm/ioperm.c: In function `init_iosys':
+../sysdeps/unix/sysv/linux/arm/ioperm.c:103: error: `BUS_ISA' undeclared (first use in this function)
+../sysdeps/unix/sysv/linux/arm/ioperm.c:103: error: (Each undeclared identifier is reported only once
+../sysdeps/unix/sysv/linux/arm/ioperm.c:103: error: for each function it appears in.)
+../sysdeps/unix/sysv/linux/arm/ioperm.c:103: error: initializer element is not constant
+../sysdeps/unix/sysv/linux/arm/ioperm.c:103: error: (near initialization for `iobase_name[1]')
+../sysdeps/unix/sysv/linux/arm/ioperm.c:104: error: initializer element is not constant
+../sysdeps/unix/sysv/linux/arm/ioperm.c:104: error: (near initialization for `ioshift_name[1]')
+make[2]: *** [/home/dank/crosstool-0.28/build/arm-softfloat-linux-gnu/gcc-3.3.4-glibc-2.2.5/build-glibc/misc/ioperm.o] Error 1
+
+cf. "[SYSCTL] BUS_ISA -> CTL_BUS_ISA", http://www.ussg.iu.edu/hypermail/linux/kernel/0311.0/0529.html
+
+--- glibc-2.3.2/sysdeps/unix/sysv/linux/arm/ioperm.c.old 2003-02-20 14:22:24.000000000 -0800
++++ glibc-2.3.2/sysdeps/unix/sysv/linux/arm/ioperm.c 2004-01-31 16:01:50.000000000 -0800
+@@ -47,6 +47,12 @@
+ #include <asm/page.h>
+ #include <sys/sysctl.h>
+
++/* see http://www.ussg.iu.edu/hypermail/linux/kernel/0311.0/0529.html */
++#include <linux/version.h>
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,23))
++#define CTL_BUS_ISA BUS_ISA /* and hope it's not the one from linux/input.h */
++#endif
++
+ #define PATH_ARM_SYSTYPE "/etc/arm_systype"
+ #define PATH_CPUINFO "/proc/cpuinfo"
+
+@@ -80,7 +86,7 @@
+ * Initialize I/O system. There are several ways to get the information
+ * we need. Each is tried in turn until one succeeds.
+ *
+- * 1. Sysctl (CTL_BUS, BUS_ISA, ISA_*). This is the preferred method
++ * 1. Sysctl (CTL_BUS, CTL_BUS_ISA, ISA_*). This is the preferred method
+ * but not all kernels support it.
+ *
+ * 2. Read the value (not the contents) of symlink PATH_ARM_SYSTYPE.
+@@ -100,8 +106,8 @@
+ {
+ char systype[256];
+ int i, n;
+- static int iobase_name[] = { CTL_BUS, BUS_ISA, BUS_ISA_PORT_BASE };
+- static int ioshift_name[] = { CTL_BUS, BUS_ISA, BUS_ISA_PORT_SHIFT };
++ static int iobase_name[] = { CTL_BUS, CTL_BUS_ISA, BUS_ISA_PORT_BASE };
++ static int ioshift_name[] = { CTL_BUS, CTL_BUS_ISA, BUS_ISA_PORT_SHIFT };
+ size_t len = sizeof(io.base);
+
+ if (! sysctl (iobase_name, 3, &io.io_base, &len, NULL, 0)
diff --git a/patches/glibc/2.3.3/bad/glibc-2.3.3-alpha-pwrite64.patch b/patches/glibc/2.3.3/bad/glibc-2.3.3-alpha-pwrite64.patch
new file mode 100644
index 0000000..fadee0e
--- /dev/null
+++ b/patches/glibc/2.3.3/bad/glibc-2.3.3-alpha-pwrite64.patch
@@ -0,0 +1,51 @@
+Attempted fix for this error:
+
+
+crosstool-0.30/build/alpha-unknown-linux-gnu/gcc-3.3.4-glibc-2.3.3/build-glibc/libc_pic.os(.text+0xc8bd0): In function `__posix_fallocate64_l64':
+: undefined reference to `__GI___pwrite64'
+collect2: ld returned 1 exit status
+make[1]: Leaving directory `/home/dank/queue/jobdir.fast2/crosstool-0.30/build/alpha-unknown-linux-gnu/gcc-3.3.4-glibc-2.3.3/glibc-2.3.3'
+make[1]: *** [/home/dank/queue/jobdir.fast2/crosstool-0.30/build/alpha-unknown-linux-gnu/gcc-3.3.4-glibc-2.3.3/build-glibc/libc.so] Error 1
+make: *** [all] Error 2
+
+extracted from GLIBC CVS by Dan Kegel
+wget 'http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/unix/sysv/linux/alpha/sysdep.h.diff?r1=1.14&r2=1.15&cvsroot=glibc'
+(to match context of...)
+wget 'http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/unix/sysv/linux/alpha/sysdep.h.diff?r1=1.16&r2=1.17&cvsroot=glibc'
+and rediffed.
+
+cf.
+http://sources.redhat.com/ml/libc-alpha/2003-10/msg00038.html
+
+Originally thought we needed this hunk, too:
+http://sources.redhat.com/ml/libc-alpha/2003-10/msg00037.html
+but it seems the sysdep.h change is sufficient, and works better
+when compiling against linux-2.4.
+
+And then rediffed again against glibc-2.3.3
+
+--- glibc-2.3.3.orig/sysdeps/unix/sysv/linux/alpha/sysdep.h Fri Jun 20 09:24:36 2003
++++ glibc-2.3.3/sysdeps/unix/sysv/linux/alpha/sysdep.h Wed Mar 23 23:59:58 2005
+@@ -1,4 +1,4 @@
+-/* Copyright (C) 1992, 1993, 1995, 1996, 1997, 2002, 2003
++/* Copyright (C) 1992, 1993, 1995, 1996, 1997, 2002, 2003, 2004
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>, August 1995.
+@@ -63,6 +63,16 @@
+ /* Help old kernel headers where particular syscalls are not available. */
+ #ifndef __NR_semtimedop
+ # define __NR_semtimedop 423
++#endif
++
++/* This is a kludge to make syscalls.list find these under the names
++ pread and pwrite, since some kernel headers define those names
++ and some define the *64 names for the same system calls. */
++#if !defined __NR_pread && defined __NR_pread64
++# define __NR_pread __NR_pread64
++#endif
++#if !defined __NR_pwrite && defined __NR_pwrite64
++# define __NR_pwrite __NR_pwrite64
+ #endif
+
+ /*
diff --git a/patches/glibc/2.3.3/fixup.patch b/patches/glibc/2.3.3/fixup.patch
new file mode 100644
index 0000000..5f1e8a4
--- /dev/null
+++ b/patches/glibc/2.3.3/fixup.patch
@@ -0,0 +1,74 @@
+Fixes
+dl-runtime.c:56: error: conflicting types for 'fixup'
+../sysdeps/i386/dl-machine.h:158: error: previous declaration of 'fixup' was here
+when building with gcc-3.4.0
+
+First hunk:
+Define ARCH_FIXUP_ATTRIBUTE and use it in the fixup function declarations.
+http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/i386/dl-machine.h.diff?r1=1.124&r2=1.125&cvsroot=glibc
+
+Second hunk:
+If ARCH_FIXUP_ATTRIBUTE is not defined, provide dummy definition.
+Use macro in fixup function definitions.
+http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/elf/dl-runtime.c.diff?r1=1.64&r2=1.65&cvsroot=glibc
+[rediffed against glibc-2.3.2]
+
+===================================================================
+RCS file: /cvs/glibc/libc/sysdeps/i386/dl-machine.h,v
+retrieving revision 1.124
+retrieving revision 1.125
+diff -u -r1.124 -r1.125
+--- libc/sysdeps/i386/dl-machine.h 2004/03/05 10:14:49 1.124
++++ libc/sysdeps/i386/dl-machine.h 2004/03/09 07:42:29 1.125
+@@ -154,11 +154,14 @@
+ destroys the passed register information. */
+ /* GKM FIXME: Fix trampoline to pass bounds so we can do
+ without the `__unbounded' qualifier. */
+-static ElfW(Addr) fixup (struct link_map *__unbounded l, ElfW(Word) reloc_offset)
+- __attribute__ ((regparm (2), unused));
++#define ARCH_FIXUP_ATTRIBUTE __attribute__ ((regparm (3), unused))
++
++static ElfW(Addr) fixup (struct link_map *__unbounded l,
++ ElfW(Word) reloc_offset)
++ ARCH_FIXUP_ATTRIBUTE;
+ static ElfW(Addr) profile_fixup (struct link_map *l, ElfW(Word) reloc_offset,
+ ElfW(Addr) retaddr)
+- __attribute__ ((regparm (3), unused));
++ ARCH_FIXUP_ATTRIBUTE;
+ # endif
+
+ /* This code is used in dl-runtime.c to call the `fixup' function
+===================================================================
+--- /home/dank/downloads/glibc-2.3.2/elf/dl-runtime.c Fri Feb 7 11:41:12 2003
++++ glibc-2.3.2/elf/dl-runtime.c Thu Apr 8 22:24:26 2004
+@@ -36,6 +36,12 @@
+ # define VERSYMIDX(sym) (DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGIDX (sym))
+ #endif
+
++/* The fixup functions might have need special attributes. If none
++ are provided define the macro as empty. */
++#ifndef ARCH_FIXUP_ATTRIBUTE
++# define ARCH_FIXUP_ATTRIBUTE
++#endif
++
+
+ /* This function is called through a special trampoline from the PLT the
+ first time each PLT entry is called. We must perform the relocation
+@@ -45,7 +51,7 @@
+ function. */
+
+ #ifndef ELF_MACHINE_NO_PLT
+-static ElfW(Addr) __attribute_used__
++static ElfW(Addr) __attribute_used__ ARCH_FIXUP_ATTRIBUTE
+ fixup (
+ # ifdef ELF_MACHINE_RUNTIME_FIXUP_ARGS
+ ELF_MACHINE_RUNTIME_FIXUP_ARGS,
+@@ -132,7 +138,7 @@
+
+ #if !defined PROF && !defined ELF_MACHINE_NO_PLT && !__BOUNDED_POINTERS__
+
+-static ElfW(Addr) __attribute_used__
++static ElfW(Addr) __attribute_used__ ARCH_FIXUP_ATTRIBUTE
+ profile_fixup (
+ #ifdef ELF_MACHINE_RUNTIME_FIXUP_ARGS
+ ELF_MACHINE_RUNTIME_FIXUP_ARGS,
diff --git a/patches/glibc/2.3.3/glibc-2.2.5-allow-gcc-4.0-malloc.patch b/patches/glibc/2.3.3/glibc-2.2.5-allow-gcc-4.0-malloc.patch
new file mode 100644
index 0000000..2d9f092
--- /dev/null
+++ b/patches/glibc/2.3.3/glibc-2.2.5-allow-gcc-4.0-malloc.patch
@@ -0,0 +1,48 @@
+Fixes
+programs/ld-collate.c: In function 'obstack_int32_grow':
+programs/ld-collate.c:48: error: invalid lvalue in increment
+programs/ld-collate.c: In function 'obstack_int32_grow_fast':
+programs/ld-collate.c:57: error: invalid lvalue in increment
+
+Change taken by eyeball from version 1.20 at
+http://sourceware.org/cgi-bin/cvsweb.cgi/libc/malloc/obstack.h?cvsroot=glibc
+
+--- /home/dank/downloads/glibc-2.2.5/malloc/obstack.h 2001-07-05 21:55:35.000000000 -0700
++++ glibc-2.2.5/malloc/obstack.h 2005-03-11 16:12:16.175812224 -0800
+@@ -423,22 +423,29 @@
+ ({ struct obstack *__o = (OBSTACK); \
+ if (__o->next_free + sizeof (void *) > __o->chunk_limit) \
+ _obstack_newchunk (__o, sizeof (void *)); \
+- *((void **)__o->next_free)++ = (datum); \
+- (void) 0; })
++ obstack_ptr_grow_fast (__o, datum); })
+
+ # define obstack_int_grow(OBSTACK,datum) \
+ __extension__ \
+ ({ struct obstack *__o = (OBSTACK); \
+ if (__o->next_free + sizeof (int) > __o->chunk_limit) \
+ _obstack_newchunk (__o, sizeof (int)); \
+- *((int *)__o->next_free)++ = (datum); \
++ obstack_int_grow_fast (__o, datum); })
++
++# define obstack_ptr_grow_fast(OBSTACK,aptr) \
++__extension__ \
++({ struct obstack *__o1 = (OBSTACK); \
++ *(const void **) __o1->next_free = (aptr); \
++ __o1->next_free += sizeof (const void *); \
+ (void) 0; })
+
+-# define obstack_ptr_grow_fast(h,aptr) \
+- (*((void **) (h)->next_free)++ = (aptr))
++# define obstack_int_grow_fast(OBSTACK,aint) \
++__extension__ \
++({ struct obstack *__o1 = (OBSTACK); \
++ *(int *) __o1->next_free = (aint); \
++ __o1->next_free += sizeof (int); \
++ (void) 0; })
+
+-# define obstack_int_grow_fast(h,aint) \
+- (*((int *) (h)->next_free)++ = (aint))
+
+ # define obstack_blank(OBSTACK,length) \
+ __extension__ \
diff --git a/patches/glibc/2.3.3/glibc-2.3.2-allow-gcc-3.4-inline.patch b/patches/glibc/2.3.3/glibc-2.3.2-allow-gcc-3.4-inline.patch
new file mode 100644
index 0000000..cdcd7ba
--- /dev/null
+++ b/patches/glibc/2.3.3/glibc-2.3.2-allow-gcc-3.4-inline.patch
@@ -0,0 +1,23 @@
+Fixes
+cc1: error: invalid parameter `max-inline-insns'
+make[2]: *** [/home/dank/wk/crosstool-0.28-rc6/build/powerpc64-linux-gnu/gcc-3.4.0-glibc-2.3.2/build-glibc/elf/dl-load.o] Error 1
+when building with gcc-3.4.0, which no longer has a single
+--max-inline-insns parameter.
+
+http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/powerpc/powerpc64/Makefile.diff?r1=1.3&r2=1.4&cvsroot=glibc
+
+===================================================================
+RCS file: /cvs/glibc/libc/sysdeps/powerpc/powerpc64/Makefile,v
+retrieving revision 1.3
+retrieving revision 1.4
+diff -u -r1.3 -r1.4
+--- libc/sysdeps/powerpc/powerpc64/Makefile 2003/10/22 21:30:03 1.3
++++ libc/sysdeps/powerpc/powerpc64/Makefile 2004/02/20 05:43:52 1.4
+@@ -20,5 +20,5 @@
+
+ ifeq ($(subdir),elf)
+ # help gcc inline asm code from dl-machine.h
+-+cflags += --param max-inline-insns=2000
+++cflags += -finline-limit=2000
+ endif
+
diff --git a/patches/glibc/2.3.3/glibc-2.3.2-allow-gcc-3.5-elf.patch b/patches/glibc/2.3.3/glibc-2.3.2-allow-gcc-3.5-elf.patch
new file mode 100644
index 0000000..1bd61e5
--- /dev/null
+++ b/patches/glibc/2.3.3/glibc-2.3.2-allow-gcc-3.5-elf.patch
@@ -0,0 +1,34 @@
+
+http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/elf/dl-load.c.diff?r1=1.235&r2=1.236&cvsroot=glibc
+
+Fixes gcc-3.5 errors
+
+dl-load.c: In function `_dl_map_object_from_fd':
+dl-load.c:1179: error: invalid lvalue in assignment
+dl-load.c:1205: error: invalid lvalue in assignment
+
+===================================================================
+RCS file: /cvs/glibc/libc/elf/dl-load.c,v
+retrieving revision 1.235
+retrieving revision 1.236
+diff -u -r1.235 -r1.236
+--- libc/elf/dl-load.c 2004/02/09 07:03:48 1.235
++++ libc/elf/dl-load.c 2004/02/21 18:25:41 1.236
+@@ -1228,7 +1228,7 @@
+ }
+ else
+ /* Adjust the PT_PHDR value by the runtime load address. */
+- (ElfW(Addr)) l->l_phdr += l->l_addr;
++ l->l_phdr = (ElfW(Phdr) *) ((ElfW(Addr)) l->l_phdr + l->l_addr);
+ }
+
+ #ifdef USE_TLS
+@@ -1254,7 +1254,7 @@
+ }
+ }
+ else
+- (ElfW(Addr)) l->l_ld += l->l_addr;
++ l->l_ld = (ElfW(Dyn) *) ((ElfW(Addr)) l->l_ld + l->l_addr);
+
+ l->l_entry += l->l_addr;
+
diff --git a/patches/glibc/2.3.3/glibc-2.3.2-allow-gcc-3.5-gconv.patch b/patches/glibc/2.3.3/glibc-2.3.2-allow-gcc-3.5-gconv.patch
new file mode 100644
index 0000000..3d6df5b
--- /dev/null
+++ b/patches/glibc/2.3.3/glibc-2.3.2-allow-gcc-3.5-gconv.patch
@@ -0,0 +1,228 @@
+Fixes
+gconv_open.c: In function `__gconv_open':
+gconv_open.c:186: error: invalid lvalue in assignment
+when building glibc-2.3.2 with gcc-3.5.
+
+wget 'http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/iconv/gconv_simple.c.diff?r1=1.59&r2=1.63&cvsroot=glibc'
+ * (internal_ucs4_loop): Fix typo in last change.
+
+ * (internal_ucs4le_loop): Remove cast used as lvalue.
+
+ * Fix last commit.
+
+ * iconv/gconv_simple.c (ucs4le_internal_loop): Remove cast used as lvalue.
+ (internal_ucs4le_loop_single): Likewise.
+ (ucs4_internal_loop): Likewise.
+ (BODY): Likewise.
+ (internal_ucs4_loop_single): Likewise.
+
+wget 'http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/iconv/gconv_open.c.diff?r1=1.32&r2=1.33&cvsroot=glibc'
+ * iconv/gconv_simple.c (ucs4le_internal_loop): Remove cast used as lvalue.
+ (internal_ucs4le_loop_single): Likewise.
+ (ucs4_internal_loop): Likewise.
+ (BODY): Likewise.
+ (internal_ucs4_loop_single): Likewise.
+
+
+===================================================================
+RCS file: /cvs/glibc/libc/iconv/gconv_open.c,v
+retrieving revision 1.32
+retrieving revision 1.33
+diff -u -r1.32 -r1.33
+--- libc/iconv/gconv_open.c 2001/11/29 04:51:58 1.32
++++ libc/iconv/gconv_open.c 2004/02/07 15:56:32 1.33
+@@ -1,5 +1,5 @@
+ /* Find matching transformation algorithms and initialize steps.
+- Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
++ Copyright (C) 1997, 1998, 1999, 2000, 2001, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+@@ -182,8 +182,13 @@
+ || __builtin_expect (__gconv_translit_find (runp), 0) == 0)
+ lastp = runp;
+ else
+- /* This means we haven't found the module. Remove it. */
+- (lastp == NULL ? trans : lastp->next) = runp->next;
++ {
++ /* This means we haven't found the module. Remove it. */
++ if (lastp == NULL)
++ trans = runp->next;
++ else
++ lastp->next = runp->next;
++ }
+ }
+
+ /* Allocate room for handle. */
+===================================================================
+RCS file: /cvs/glibc/libc/iconv/gconv_simple.c,v
+retrieving revision 1.59
+retrieving revision 1.63
+diff -u -r1.59 -r1.63
+--- libc/iconv/gconv_simple.c 2003/06/11 21:36:37 1.59
++++ libc/iconv/gconv_simple.c 2004/03/09 10:00:31 1.63
+@@ -1,5 +1,5 @@
+ /* Simple transformations functions.
+- Copyright (C) 1997-2002, 2003 Free Software Foundation, Inc.
++ Copyright (C) 1997-2003, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+@@ -87,12 +87,13 @@
+ #if __BYTE_ORDER == __LITTLE_ENDIAN
+ /* Sigh, we have to do some real work. */
+ size_t cnt;
++ uint32_t *outptr32 = (uint32_t *) outptr;
+
+ for (cnt = 0; cnt < n_convert; ++cnt, inptr += 4)
+- *((uint32_t *) outptr)++ = bswap_32 (*(const uint32_t *) inptr);
++ *outptr32++ = bswap_32 (*(const uint32_t *) inptr);
+
+ *inptrp = inptr;
+- *outptrp = outptr;
++ *outptrp = (unsigned char *) outptr32;
+ #elif __BYTE_ORDER == __BIG_ENDIAN
+ /* Simply copy the data. */
+ *inptrp = inptr + n_convert * 4;
+@@ -192,13 +193,16 @@
+ (*outptrp)[2] = state->__value.__wchb[1];
+ (*outptrp)[3] = state->__value.__wchb[0];
+
+- *outptrp += 4;
+ #elif __BYTE_ORDER == __BIG_ENDIAN
+ /* XXX unaligned */
+- *(*((uint32_t **) outptrp)++) = state->__value.__wch;
++ (*outptrp)[0] = state->__value.__wchb[0];
++ (*outptrp)[1] = state->__value.__wchb[1];
++ (*outptrp)[2] = state->__value.__wchb[2];
++ (*outptrp)[3] = state->__value.__wchb[3];
+ #else
+ # error "This endianess is not supported."
+ #endif
++ *outptrp += 4;
+
+ /* Clear the state buffer. */
+ state->__count &= ~7;
+@@ -268,7 +272,8 @@
+ return __GCONV_ILLEGAL_INPUT;
+ }
+
+- *((uint32_t *) outptr)++ = inval;
++ *((uint32_t *) outptr) = inval;
++ outptr += sizeof (uint32_t);
+ }
+
+ *inptrp = inptr;
+@@ -447,9 +452,11 @@
+ #if __BYTE_ORDER == __BIG_ENDIAN
+ /* Sigh, we have to do some real work. */
+ size_t cnt;
++ uint32_t *outptr32 = (uint32_t *) outptr;
+
+ for (cnt = 0; cnt < n_convert; ++cnt, inptr += 4)
+- *((uint32_t *) outptr)++ = bswap_32 (*(const uint32_t *) inptr);
++ *outptr32++ = bswap_32 (*(const uint32_t *) inptr);
++ outptr = (unsigned char *) outptr32;
+
+ *inptrp = inptr;
+ *outptrp = outptr;
+@@ -555,12 +562,17 @@
+ (*outptrp)[2] = state->__value.__wchb[1];
+ (*outptrp)[3] = state->__value.__wchb[0];
+
+- *outptrp += 4;
+ #else
+ /* XXX unaligned */
+- *(*((uint32_t **) outptrp)++) = state->__value.__wch;
++ (*outptrp)[0] = state->__value.__wchb[0];
++ (*outptrp)[1] = state->__value.__wchb[1];
++ (*outptrp)[2] = state->__value.__wchb[2];
++ (*outptrp)[3] = state->__value.__wchb[3];
++
+ #endif
+
++ *outptrp += 4;
++
+ /* Clear the state buffer. */
+ state->__count &= ~7;
+
+@@ -626,7 +638,8 @@
+ return __GCONV_ILLEGAL_INPUT;
+ }
+
+- *((uint32_t *) outptr)++ = inval;
++ *((uint32_t *) outptr) = inval;
++ outptr += sizeof (uint32_t);
+ }
+
+ *inptrp = inptr;
+@@ -808,7 +821,8 @@
+ } \
+ else \
+ /* It's an one byte sequence. */ \
+- *((uint32_t *) outptr)++ = *inptr++; \
++ *((uint32_t *) outptr) = *inptr++; \
++ outptr += sizeof (uint32_t); \
+ }
+ #define LOOP_NEED_FLAGS
+ #include <iconv/loop.c>
+@@ -838,7 +852,8 @@
+ } \
+ else \
+ /* It's an one byte sequence. */ \
+- *outptr++ = *((const uint32_t *) inptr)++; \
++ *outptr++ = *((const uint32_t *) inptr); \
++ inptr += sizeof (uint32_t); \
+ }
+ #define LOOP_NEED_FLAGS
+ #include <iconv/loop.c>
+@@ -1032,7 +1047,8 @@
+ } \
+ \
+ /* Now adjust the pointers and store the result. */ \
+- *((uint32_t *) outptr)++ = ch; \
++ *((uint32_t *) outptr) = ch; \
++ outptr += sizeof (uint32_t); \
+ }
+ #define LOOP_NEED_FLAGS
+
+@@ -1153,7 +1169,8 @@
+ STANDARD_FROM_LOOP_ERR_HANDLER (2); \
+ } \
+ \
+- *((uint32_t *) outptr)++ = u1; \
++ *((uint32_t *) outptr) = u1; \
++ outptr += sizeof (uint32_t); \
+ inptr += 2; \
+ }
+ #define LOOP_NEED_FLAGS
+@@ -1201,7 +1218,8 @@
+ } \
+ else \
+ { \
+- *((uint16_t *) outptr)++ = val; \
++ *((uint16_t *) outptr) = val; \
++ outptr += sizeof (uint16_t); \
+ inptr += 4; \
+ } \
+ }
+@@ -1242,7 +1260,8 @@
+ continue; \
+ } \
+ \
+- *((uint32_t *) outptr)++ = u1; \
++ *((uint32_t *) outptr) = u1; \
++ outptr += sizeof (uint32_t); \
+ inptr += 2; \
+ }
+ #define LOOP_NEED_FLAGS
+@@ -1291,7 +1310,8 @@
+ } \
+ else \
+ { \
+- *((uint16_t *) outptr)++ = bswap_16 (val); \
++ *((uint16_t *) outptr) = bswap_16 (val); \
++ outptr += sizeof (uint16_t); \
+ inptr += 4; \
+ } \
+ }
diff --git a/patches/glibc/2.3.3/glibc-2.3.2-allow-gcc-3.5-msort.patch b/patches/glibc/2.3.3/glibc-2.3.2-allow-gcc-3.5-msort.patch
new file mode 100644
index 0000000..e2673de
--- /dev/null
+++ b/patches/glibc/2.3.3/glibc-2.3.2-allow-gcc-3.5-msort.patch
@@ -0,0 +1,46 @@
+http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/stdlib/msort.c.diff?r1=1.20&r2=1.21&cvsroot=glibc
+
+Fixes
+
+msort.c: In function `msort_with_tmp':
+msort.c:59: error: invalid lvalue in increment
+msort.c:59: error: invalid lvalue in increment
+msort.c:64: error: invalid lvalue in increment
+msort.c:64: error: invalid lvalue in increment
+
+when building with gcc-3.5.
+
+===================================================================
+RCS file: /cvs/glibc/libc/stdlib/msort.c,v
+retrieving revision 1.20
+retrieving revision 1.21
+diff -u -r1.20 -r1.21
+--- libc/stdlib/msort.c 2002/09/24 04:20:57 1.20
++++ libc/stdlib/msort.c 2004/02/07 15:57:34 1.21
+@@ -1,6 +1,6 @@
+ /* An alternative to qsort, with an identical interface.
+ This file is part of the GNU C Library.
+- Copyright (C) 1992,95-97,99,2000,01,02 Free Software Foundation, Inc.
++ Copyright (C) 1992,95-97,99,2000,01,02,04 Free Software Foundation, Inc.
+ Written by Mike Haertel, September 1988.
+
+ The GNU C Library is free software; you can redistribute it and/or
+@@ -56,12 +56,16 @@
+ if ((*cmp) (b1, b2) <= 0)
+ {
+ --n1;
+- *((op_t *) tmp)++ = *((op_t *) b1)++;
++ *((op_t *) tmp) = *((op_t *) b1);
++ tmp += sizeof (op_t);
++ b1 += sizeof (op_t);
+ }
+ else
+ {
+ --n2;
+- *((op_t *) tmp)++ = *((op_t *) b2)++;
++ *((op_t *) tmp) = *((op_t *) b2);
++ tmp += sizeof (op_t);
++ b2 += sizeof (op_t);
+ }
+ }
+ else
diff --git a/patches/glibc/2.3.3/glibc-2.3.2-allow-gcc-3.5-sunrpc.patch b/patches/glibc/2.3.3/glibc-2.3.2-allow-gcc-3.5-sunrpc.patch
new file mode 100644
index 0000000..5a68bc2
--- /dev/null
+++ b/patches/glibc/2.3.3/glibc-2.3.2-allow-gcc-3.5-sunrpc.patch
@@ -0,0 +1,233 @@
+http://sources.redhat.com/ml/libc-hacker/2004-02/msg00005.html
+[Also in CVS, but the original patch is easier to get.]
+
+Fixes errors like
+
+clnt_perr.c: In function `_buf':
+clnt_perr.c:67: error: invalid lvalue in assignment
+
+when building with gcc-3.5.
+
+To: libc-hacker at sources dot redhat dot com
+Subject: Fix cast as lvalue in sunrpc
+From: Andreas Schwab <schwab at suse dot de>
+X-Yow: SHHHH!! I hear SIX TATTOOED TRUCK-DRIVERS tossing ENGINE BLOCKS
+ into empty OIL DRUMS dot dot
+Date: Sun, 08 Feb 2004 17:38:31 +0100
+Message-ID: <je4qu1frw8.fsf@sykes.suse.de>
+
+This fixes the uses of casts as lvalue in the sunrpc code.
+
+Andreas.
+
+2004-02-08 Andreas Schwab <schwab@suse.de>
+
+ * include/rpc/rpc.h: Declare thread variables with their correct
+ type.
+ * sunrpc/clnt_perr.c: Don't cast thread variables.
+ * sunrpc/clnt_raw.c: Likewise.
+ * sunrpc/clnt_simp.c: Likewise.
+ * sunrpc/key_call.c: Likewise.
+ * sunrpc/svcauth_des.c: Likewise.
+ * sunrpc/svc.c: Likewise.
+ * sunrpc/svc_raw.c: Likewise.
+ * sunrpc/svc_simple.c: Likewise.
+
+Index: include/rpc/rpc.h
+===================================================================
+RCS file: /cvs/glibc/libc/include/rpc/rpc.h,v
+retrieving revision 1.8
+diff -u -p -a -r1.8 rpc.h
+--- glibc/include/rpc/rpc.h 5 Aug 2002 22:10:59 -0000 1.8
++++ glibc/include/rpc/rpc.h 8 Feb 2004 14:19:14 -0000
+@@ -17,24 +17,24 @@ struct rpc_thread_variables {
+ struct pollfd *svc_pollfd_s; /* Global, rpc_common.c */
+ int svc_max_pollfd_s; /* Global, rpc_common.c */
+
+- void *clnt_perr_buf_s; /* clnt_perr.c */
++ char *clnt_perr_buf_s; /* clnt_perr.c */
+
+- void *clntraw_private_s; /* clnt_raw.c */
++ struct clntraw_private_s *clntraw_private_s; /* clnt_raw.c */
+
+- void *callrpc_private_s; /* clnt_simp.c */
++ struct callrpc_private_s *callrpc_private_s; /* clnt_simp.c */
+
+- void *key_call_private_s; /* key_call.c */
++ struct key_call_private *key_call_private_s; /* key_call.c */
+
+- void *authdes_cache_s; /* svcauth_des.c */
+- void *authdes_lru_s; /* svcauth_des.c */
++ struct cache_entry *authdes_cache_s; /* svcauth_des.c */
++ int *authdes_lru_s; /* svcauth_des.c */
+
+- void *svc_xports_s; /* svc.c */
+- void *svc_head_s; /* svc.c */
++ SVCXPRT **svc_xports_s; /* svc.c */
++ struct svc_callout *svc_head_s; /* svc.c */
+
+- void *svcraw_private_s; /* svc_raw.c */
++ struct svcraw_private_s *svcraw_private_s; /* svc_raw.c */
+
+- void *svcsimple_proglst_s; /* svc_simple.c */
+- void *svcsimple_transp_s; /* svc_simple.c */
++ struct proglst_ *svcsimple_proglst_s; /* svc_simple.c */
++ SVCXPRT *svcsimple_transp_s; /* svc_simple.c */
+ };
+
+ extern struct rpc_thread_variables *__rpc_thread_variables(void)
+Index: sunrpc/clnt_perr.c
+===================================================================
+RCS file: /cvs/glibc/libc/sunrpc/clnt_perr.c,v
+retrieving revision 1.19
+diff -u -p -a -r1.19 clnt_perr.c
+--- glibc/sunrpc/clnt_perr.c 1 Nov 2002 20:43:54 -0000 1.19
++++ glibc/sunrpc/clnt_perr.c 8 Feb 2004 14:19:14 -0000
+@@ -55,7 +55,7 @@ static char *auth_errmsg (enum auth_stat
+ * buf variable in a few functions. Overriding a global variable
+ * with a local variable of the same name is a bad idea, anyway.
+ */
+-#define buf ((char *)RPC_THREAD_VARIABLE(clnt_perr_buf_s))
++#define buf RPC_THREAD_VARIABLE(clnt_perr_buf_s)
+ #else
+ static char *buf;
+ #endif
+Index: sunrpc/clnt_raw.c
+===================================================================
+RCS file: /cvs/glibc/libc/sunrpc/clnt_raw.c,v
+retrieving revision 1.10
+diff -u -p -a -r1.10 clnt_raw.c
+--- glibc/sunrpc/clnt_raw.c 15 May 2002 00:21:00 -0000 1.10
++++ glibc/sunrpc/clnt_raw.c 8 Feb 2004 14:19:14 -0000
+@@ -61,7 +61,7 @@ struct clntraw_private_s
+ u_int mcnt;
+ };
+ #ifdef _RPC_THREAD_SAFE_
+-#define clntraw_private ((struct clntraw_private_s *)RPC_THREAD_VARIABLE(clntraw_private_s))
++#define clntraw_private RPC_THREAD_VARIABLE(clntraw_private_s)
+ #else
+ static struct clntraw_private_s *clntraw_private;
+ #endif
+Index: sunrpc/clnt_simp.c
+===================================================================
+RCS file: /cvs/glibc/libc/sunrpc/clnt_simp.c,v
+retrieving revision 1.14
+diff -u -p -a -r1.14 clnt_simp.c
+--- glibc/sunrpc/clnt_simp.c 15 May 2002 00:21:00 -0000 1.14
++++ glibc/sunrpc/clnt_simp.c 8 Feb 2004 14:19:14 -0000
+@@ -55,7 +55,7 @@ struct callrpc_private_s
+ char *oldhost;
+ };
+ #ifdef _RPC_THREAD_SAFE_
+-#define callrpc_private ((struct callrpc_private_s *)RPC_THREAD_VARIABLE(callrpc_private_s))
++#define callrpc_private RPC_THREAD_VARIABLE(callrpc_private_s)
+ #else
+ static struct callrpc_private_s *callrpc_private;
+ #endif
+Index: sunrpc/key_call.c
+===================================================================
+RCS file: /cvs/glibc/libc/sunrpc/key_call.c,v
+retrieving revision 1.16
+diff -u -p -a -r1.16 key_call.c
+--- glibc/sunrpc/key_call.c 6 Aug 2002 06:08:50 -0000 1.16
++++ glibc/sunrpc/key_call.c 8 Feb 2004 14:19:14 -0000
+@@ -370,7 +370,7 @@ struct key_call_private {
+ uid_t uid; /* user-id at last authorization */
+ };
+ #ifdef _RPC_THREAD_SAFE_
+-#define key_call_private_main ((struct key_call_private *)RPC_THREAD_VARIABLE(key_call_private_s))
++#define key_call_private_main RPC_THREAD_VARIABLE(key_call_private_s)
+ #else
+ static struct key_call_private *key_call_private_main;
+ #endif
+Index: sunrpc/svc.c
+===================================================================
+RCS file: /cvs/glibc/libc/sunrpc/svc.c,v
+retrieving revision 1.17
+diff -u -p -a -r1.17 svc.c
+--- glibc/sunrpc/svc.c 29 Aug 2003 07:45:18 -0000 1.17
++++ glibc/sunrpc/svc.c 8 Feb 2004 14:19:14 -0000
+@@ -44,7 +44,7 @@
+ #include <sys/poll.h>
+
+ #ifdef _RPC_THREAD_SAFE_
+-#define xports ((SVCXPRT **)RPC_THREAD_VARIABLE(svc_xports_s))
++#define xports RPC_THREAD_VARIABLE(svc_xports_s)
+ #else
+ static SVCXPRT **xports;
+ #endif
+@@ -63,7 +63,7 @@ struct svc_callout {
+ void (*sc_dispatch) (struct svc_req *, SVCXPRT *);
+ };
+ #ifdef _RPC_THREAD_SAFE_
+-#define svc_head ((struct svc_callout *)RPC_THREAD_VARIABLE(svc_head_s))
++#define svc_head RPC_THREAD_VARIABLE(svc_head_s)
+ #else
+ static struct svc_callout *svc_head;
+ #endif
+Index: sunrpc/svc_raw.c
+===================================================================
+RCS file: /cvs/glibc/libc/sunrpc/svc_raw.c,v
+retrieving revision 1.5
+diff -u -p -a -r1.5 svc_raw.c
+--- glibc/sunrpc/svc_raw.c 26 Feb 2002 01:43:56 -0000 1.5
++++ glibc/sunrpc/svc_raw.c 8 Feb 2004 14:19:14 -0000
+@@ -54,7 +54,7 @@ struct svcraw_private_s
+ char verf_body[MAX_AUTH_BYTES];
+ };
+ #ifdef _RPC_THREAD_SAFE_
+-#define svcraw_private ((struct svcraw_private_s *)RPC_THREAD_VARIABLE(svcraw_private_s))
++#define svcraw_private RPC_THREAD_VARIABLE(svcraw_private_s)
+ #else
+ static struct svcraw_private_s *svcraw_private;
+ #endif
+Index: sunrpc/svc_simple.c
+===================================================================
+RCS file: /cvs/glibc/libc/sunrpc/svc_simple.c,v
+retrieving revision 1.16
+diff -u -p -a -r1.16 svc_simple.c
+--- glibc/sunrpc/svc_simple.c 6 Aug 2002 05:10:30 -0000 1.16
++++ glibc/sunrpc/svc_simple.c 8 Feb 2004 14:19:14 -0000
+@@ -61,7 +61,7 @@ struct proglst_
+ struct proglst_ *p_nxt;
+ };
+ #ifdef _RPC_THREAD_SAFE_
+-#define proglst ((struct proglst_ *)RPC_THREAD_VARIABLE(svcsimple_proglst_s))
++#define proglst RPC_THREAD_VARIABLE(svcsimple_proglst_s)
+ #else
+ static struct proglst_ *proglst;
+ #endif
+@@ -69,7 +69,7 @@ static struct proglst_ *proglst;
+
+ static void universal (struct svc_req *rqstp, SVCXPRT *transp_s);
+ #ifdef _RPC_THREAD_SAFE_
+-#define transp ((SVCXPRT *)RPC_THREAD_VARIABLE(svcsimple_transp_s))
++#define transp RPC_THREAD_VARIABLE(svcsimple_transp_s)
+ #else
+ static SVCXPRT *transp;
+ #endif
+Index: sunrpc/svcauth_des.c
+===================================================================
+RCS file: /cvs/glibc/libc/sunrpc/svcauth_des.c,v
+retrieving revision 1.8
+diff -u -p -a -r1.8 svcauth_des.c
+--- glibc/sunrpc/svcauth_des.c 20 Aug 2001 06:37:09 -0000 1.8
++++ glibc/sunrpc/svcauth_des.c 8 Feb 2004 14:19:14 -0000
+@@ -72,8 +72,8 @@ struct cache_entry
+ char *localcred; /* generic local credential */
+ };
+ #ifdef _RPC_THREAD_SAFE_
+-#define authdes_cache ((struct cache_entry *)RPC_THREAD_VARIABLE(authdes_cache_s))
+-#define authdes_lru ((int *)RPC_THREAD_VARIABLE(authdes_lru_s))
++#define authdes_cache RPC_THREAD_VARIABLE(authdes_cache_s)
++#define authdes_lru RPC_THREAD_VARIABLE(authdes_lru_s)
+ #else
+ static struct cache_entry *authdes_cache;
+ static int *authdes_lru;
+
+--
+Andreas Schwab, SuSE Labs, schwab@suse.de
+SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany
+Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
+"And now for something completely different."
+
diff --git a/patches/glibc/2.3.3/glibc-2.3.2-allow-gcc-3.5-xdr.patch b/patches/glibc/2.3.3/glibc-2.3.2-allow-gcc-3.5-xdr.patch
new file mode 100644
index 0000000..4d811e9
--- /dev/null
+++ b/patches/glibc/2.3.3/glibc-2.3.2-allow-gcc-3.5-xdr.patch
@@ -0,0 +1,44 @@
+http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sunrpc/rpc/xdr.h.diff?r1=1.27&r2=1.28&cvsroot=glibc
+(but see also http://sources.redhat.com/ml/libc-alpha/2004-03/msg00267.html
+and http://gcc.gnu.org/ml/gcc-patches/2004-03/msg02056.html)
+
+Fixes errors
+
+rpc_cmsg.c: In function `xdr_callmsg':
+rpc_cmsg.c:70: error: invalid lvalue in increment
+rpc_cmsg.c:71: error: invalid lvalue in increment
+rpc_cmsg.c:74: error: invalid lvalue in increment
+rpc_cmsg.c:77: error: invalid lvalue in increment
+rpc_cmsg.c:78: error: invalid lvalue in increment
+rpc_cmsg.c:79: error: invalid lvalue in increment
+rpc_cmsg.c:81: error: invalid lvalue in increment
+rpc_cmsg.c:89: error: invalid lvalue in increment
+rpc_cmsg.c:106: error: invalid lvalue in increment
+rpc_cmsg.c:107: error: invalid lvalue in increment
+rpc_cmsg.c:112: error: invalid lvalue in increment
+rpc_cmsg.c:117: error: invalid lvalue in increment
+rpc_cmsg.c:118: error: invalid lvalue in increment
+rpc_cmsg.c:119: error: invalid lvalue in increment
+rpc_cmsg.c:121: error: invalid lvalue in increment
+rpc_cmsg.c:160: error: invalid lvalue in increment
+
+===================================================================
+RCS file: /cvs/glibc/libc/sunrpc/rpc/xdr.h,v
+retrieving revision 1.27
+retrieving revision 1.28
+diff -u -r1.27 -r1.28
+--- libc/sunrpc/rpc/xdr.h 2002/12/16 02:05:49 1.27
++++ libc/sunrpc/rpc/xdr.h 2004/03/22 10:52:33 1.28
+@@ -262,10 +262,8 @@
+ * and shouldn't be used any longer. Code which use this defines or longs
+ * in the RPC code will not work on 64bit Solaris platforms !
+ */
+-#define IXDR_GET_LONG(buf) \
+- ((long)ntohl((u_long)*__extension__((u_int32_t*)(buf))++))
+-#define IXDR_PUT_LONG(buf, v) \
+- (*__extension__((u_int32_t*)(buf))++ = (long)htonl((u_long)(v)))
++#define IXDR_GET_LONG(buf) ((long)IXDR_GET_U_INT32(buf))
++#define IXDR_PUT_LONG(buf, v) ((long)IXDR_PUT_INT32(buf, (long)(v)))
+ #define IXDR_GET_U_LONG(buf) ((u_long)IXDR_GET_LONG(buf))
+ #define IXDR_PUT_U_LONG(buf, v) IXDR_PUT_LONG(buf, (long)(v))
+
diff --git a/patches/glibc/2.3.3/glibc-2.3.2-arm-fix-strlen.patch b/patches/glibc/2.3.3/glibc-2.3.2-arm-fix-strlen.patch
new file mode 100644
index 0000000..03e5c5b
--- /dev/null
+++ b/patches/glibc/2.3.3/glibc-2.3.2-arm-fix-strlen.patch
@@ -0,0 +1,54 @@
+See also
+http://lists.gnu.org/archive/html/bug-glibc/2002-12/msg00056.html
+http://lists.arm.linux.org.uk/pipermail/linux-arm-toolchain/2004-June/000016.html
+
+2002-12-12 Andreas Schwab <schwab@suse.de>
+ * sysdeps/arm/strlen.S: Fix last word check for big endian.
+
+To: libc-alpha at sources dot redhat dot com
+Subject: [PATCH] REPOST: ARM big-endian strlen() fix
+References: <m3brjy27mo.fsf@defiant.pm.waw.pl>
+From: Krzysztof Halasa <khc at pm dot waw dot pl>
+Date: Thu, 10 Jun 2004 13:41:44 +0200
+Message-ID: <m3r7sn8wsn.fsf@defiant.pm.waw.pl>
+MIME-Version: 1.0
+Content-Type: multipart/mixed; boundary="=-=-="
+
+--=-=-=
+
+The attached patch fixes strlen() on big-endian ARM. Please apply.
+Thanks.
+--
+Krzysztof Halasa, B*FH
+
+--=-=-=
+Content-Type: text/x-patch
+Content-Disposition: inline; filename=glibc-strlen.patch
+
+--- glibc-2.3.3.old/sysdeps/arm/strlen.S 2003-04-30 00:47:20.000000000 +0200
++++ glibc-2.3.3/sysdeps/arm/strlen.S 2004-06-06 03:21:48.351931240 +0200
+@@ -53,12 +53,21 @@
+ ldrne r2, [r1], $4 @ and we continue to the next word
+ bne Laligned @
+ Llastword: @ drop through to here once we find a
++#ifdef __ARMEB__
++ tst r2, $0xff000000 @ word that has a zero byte in it
++ addne r0, r0, $1 @
++ tstne r2, $0x00ff0000 @ and add up to 3 bytes on to it
++ addne r0, r0, $1 @
++ tstne r2, $0x0000ff00 @ (if first three all non-zero, 4th
++ addne r0, r0, $1 @ must be zero)
++#else
+ tst r2, $0x000000ff @ word that has a zero byte in it
+ addne r0, r0, $1 @
+ tstne r2, $0x0000ff00 @ and add up to 3 bytes on to it
+ addne r0, r0, $1 @
+ tstne r2, $0x00ff0000 @ (if first three all non-zero, 4th
+ addne r0, r0, $1 @ must be zero)
++#endif
+ RETINSTR(mov,pc,lr)
+ END(strlen)
+ libc_hidden_builtin_def (strlen)
+
+--=-=-=--
+
diff --git a/patches/glibc/2.3.3/glibc-2.3.2-pr139-fix.patch b/patches/glibc/2.3.3/glibc-2.3.2-pr139-fix.patch
new file mode 100644
index 0000000..96e8fb3
--- /dev/null
+++ b/patches/glibc/2.3.3/glibc-2.3.2-pr139-fix.patch
@@ -0,0 +1,104 @@
+2004-04-29 Jakub Jelinek <jakub@redhat.com>
+
+ * sysdeps/sparc/sparc64/soft-fp/qp_qtoi.c (_Qp_qtoi): Use %f31
+ for single precision register, add it to __asm clobbers [BZ #139].
+ * sysdeps/sparc/sparc64/soft-fp/qp_qtoui.c (_Qp_qtoui): Use %f31
+ for single precision register, add it to __asm clobbers.
+ * sysdeps/sparc/sparc64/soft-fp/qp_qtoux.c (_Qp_qtoux): Use fqtox
+ instead of fqtoi in QP_HANDLE_EXCEPTIONS.
+ * sysdeps/sparc/sparc64/soft-fp/qp_qtox.c (_Qp_qtox): Likewise.
+ Reported by M. H. VanLeeuwen <vanl@megsinet.net>.
+
+See http://sources.redhat.com/bugzilla/show_bug.cgi?id=139
+Fixes error
+qp_qtoi.s:261: Error: Illegal operands: There are only 32 single precision f registers; [0-31]
+plus a couple other things vanl noticed.
+
+diff -ur orig/qp_qtoi.c new/qp_qtoi.c
+--- orig/qp_qtoi.c Sat May 1 00:40:06 2004
++++ libc/sysdeps/sparc/sparc64/soft-fp/qp_qtoi.c Sat May 1 00:39:40 2004
+@@ -1,6 +1,6 @@
+ /* Software floating-point emulation.
+ Return (int)(*a)
+- Copyright (C) 1997,1999 Free Software Foundation, Inc.
++ Copyright (C) 1997, 1999, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Richard Henderson (rth@cygnus.com) and
+ Jakub Jelinek (jj@ultra.linux.cz).
+@@ -38,9 +38,9 @@
+ __asm (
+ " ldd [%1], %%f52\n"
+ " ldd [%1+8], %%f54\n"
+-" fqtoi %%f52, %%f60\n"
+-" st %%f60, [%0]\n"
+-" " : : "r" (&rx), "r" (a) : QP_CLOBBER);
++" fqtoi %%f52, %%f31\n"
++" st %%f31, [%0]\n"
++" " : : "r" (&rx), "r" (a) : QP_CLOBBER, "f31");
+ r = rx);
+
+ return r;
+diff -ur orig/qp_qtoui.c new/qp_qtoui.c
+--- orig/qp_qtoui.c Sat May 1 00:40:06 2004
++++ libc/sysdeps/sparc/sparc64/soft-fp/qp_qtoui.c Sat May 1 00:39:40 2004
+@@ -1,6 +1,6 @@
+ /* Software floating-point emulation.
+ Return (unsigned int)(*a)
+- Copyright (C) 1997,1999 Free Software Foundation, Inc.
++ Copyright (C) 1997, 1999, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Richard Henderson (rth@cygnus.com) and
+ Jakub Jelinek (jj@ultra.linux.cz).
+@@ -38,9 +38,9 @@
+ __asm (
+ " ldd [%1], %%f52\n"
+ " ldd [%1+8], %%f54\n"
+-" fqtoi %%f52, %%f60\n"
+-" st %%f60, [%0]\n"
+-" " : : "r" (&rx), "r" (a) : QP_CLOBBER);
++" fqtoi %%f52, %%f31\n"
++" st %%f31, [%0]\n"
++" " : : "r" (&rx), "r" (a) : QP_CLOBBER, "f31");
+ r = rx);
+
+ return r;
+diff -ur orig/qp_qtoux.c new/qp_qtoux.c
+--- orig/qp_qtoux.c Sat May 1 00:40:06 2004
++++ libc/sysdeps/sparc/sparc64/soft-fp/qp_qtoux.c Sat May 1 00:39:40 2004
+@@ -1,6 +1,6 @@
+ /* Software floating-point emulation.
+ Return (unsigned long)(*a)
+- Copyright (C) 1997,1999 Free Software Foundation, Inc.
++ Copyright (C) 1997, 1999, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Richard Henderson (rth@cygnus.com) and
+ Jakub Jelinek (jj@ultra.linux.cz).
+@@ -38,7 +38,7 @@
+ __asm (
+ " ldd [%1], %%f52\n"
+ " ldd [%1+8], %%f54\n"
+-" fqtoi %%f52, %%f60\n"
++" fqtox %%f52, %%f60\n"
+ " std %%f60, [%0]\n"
+ " " : : "r" (&rx), "r" (a) : QP_CLOBBER);
+ r = rx);
+diff -ur orig/qp_qtox.c new/qp_qtox.c
+--- orig/qp_qtox.c Sat May 1 00:40:06 2004
++++ libc/sysdeps/sparc/sparc64/soft-fp/qp_qtox.c Sat May 1 00:39:40 2004
+@@ -1,6 +1,6 @@
+ /* Software floating-point emulation.
+ Return (long)(*a)
+- Copyright (C) 1997,1999 Free Software Foundation, Inc.
++ Copyright (C) 1997, 1999, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Richard Henderson (rth@cygnus.com) and
+ Jakub Jelinek (jj@ultra.linux.cz).
+@@ -38,7 +38,7 @@
+ __asm (
+ " ldd [%1], %%f52\n"
+ " ldd [%1+8], %%f54\n"
+-" fqtoi %%f52, %%f60\n"
++" fqtox %%f52, %%f60\n"
+ " std %%f60, [%0]\n"
+ " " : : "r" (&rx), "r" (a) : QP_CLOBBER);
+ r = rx);
diff --git a/patches/glibc/2.3.3/glibc-2.3.2-sparc32-sysdep.patch b/patches/glibc/2.3.3/glibc-2.3.2-sparc32-sysdep.patch
new file mode 100644
index 0000000..289f66e
--- /dev/null
+++ b/patches/glibc/2.3.3/glibc-2.3.2-sparc32-sysdep.patch
@@ -0,0 +1,46 @@
+Fixes the error
+
+<stdin>: Assembler messages:
+<stdin>:2: Error: junk at end of line, first unrecognized character is `1' ...
+<stdin>:2: Error: Illegal operands: PC-relative operand can't be a constant
+make[4]: *** [/home/dank/wk/crosstool-0.28-rc13/build/sparc-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/build-glibc/io/rtld-open.os] Error 1
+make[4]: Leaving directory `/home/dank/wk/crosstool-0.28-rc13/build/sparc-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/glibc-2.3.2/io'
+make[3]: *** [/home/dank/wk/crosstool-0.28-rc13/build/sparc-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/build-glibc/io/rtld-xstat64.os] Error 2
+make[3]: Leaving directory `/home/dank/wk/crosstool-0.28-rc13/build/sparc-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/glibc-2.3.2/elf'
+make[2]: *** [/home/dank/wk/crosstool-0.28-rc13/build/sparc-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/build-glibc/elf/rtld-libc.a] Error 2
+make[2]: Leaving directory `/home/dank/wk/crosstool-0.28-rc13/build/sparc-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/glibc-2.3.2/elf'
+make[1]: *** [elf/subdir_lib] Error 2
+
+when building glibc-2.3.2 with gcc-3.4.0 for sparc32.
+
+The .s file left behind by -save-temps contains the big long line
+
+.text; .global __libc_open; .align 4; __libc_open:; .type __libc_open,@function;; mov 5, %g1; ta 0x10; bcs __syscall_error_handler; nop; .section .gnu.linkonce.t. 1 .get_pic.l7,"ax",@progbits; .globl 1 .get_pic.l7; .hidden 1 .get_pic.l7; .type 1 .get_pic.l7,@function; 1 .get_pic.l7: retl; add %o7, %l7, %l7; .previous; .subsection 3; __syscall_error_handler: save %sp,-96,%sp; sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %l7; call 1 .get_pic.l7; add %l7, %lo(_GLOBAL_OFFSET_TABLE_+4), %l7; ld [%l7 + errno], %l0; st %i0, [%l0]; jmpl %i7+8, %g0; restore %g0, -1, %o0; .previous;
+ retl; nop
+
+The error messages appear to refer to the '1 .get_pic.17', e.g.
+ .globl 1 .get_pic.l7; .hidden 1 .get_pic.l7;
+which seems to come from
+glibc-2.3.2/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h
+where it appears originally as
+ .globl __sparc.get_pic.l7; \
+ .hidden __sparc.get_pic.l7; \
+
+Note that __sparc is a predefined symbol on Solaris and some other environments;
+it's not surprising to see it predefined on Linux, too.
+
+
+--- glibc-2.3.2/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h.old 2004-05-15 10:23:11.000000000 -0700
++++ glibc-2.3.2/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h 2004-05-15 10:24:12.000000000 -0700
+@@ -39,6 +39,11 @@
+ #undef END
+ #undef LOC
+
++/* gcc-3.4.0 seems to expand __sparc as a predefined preprocessor symbol, which we don't want here */
++#ifdef __sparc
++#undef __sparc
++#endif
++
+ #define ENTRY(name) \
+ .global C_SYMBOL_NAME(name); \
+ .align 4;\
diff --git a/patches/glibc/2.3.3/glibc-2.3.2-sparc64-dl-machine.patch b/patches/glibc/2.3.3/glibc-2.3.2-sparc64-dl-machine.patch
new file mode 100644
index 0000000..20cb799
--- /dev/null
+++ b/patches/glibc/2.3.3/glibc-2.3.2-sparc64-dl-machine.patch
@@ -0,0 +1,29 @@
+See http://gcc.gnu.org/PR15345
+
+Quick kludge by H.J.Lu
+Works around gcc-3.4.0 error which shows up when building glibc-2.3.2 for sparc64:
+
+.../sparc64-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/build-glibc/libc.a(dl-reloc.o)(.text+0x4b4): In function `elf_machine_load_address.3':
+: undefined reference to `_DYNAMIC'
+collect2: ld returned 1 exit status
+make[2]: *** [/home/dank/wk/crosstool-0.28-rc10/build/sparc64-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/build-glibc/elf/sln] Error 1
+
+
+--- glibc-2.3.2/sysdeps/sparc/sparc64/dl-machine.h.orig Sat May 8 20:54:26 2004
++++ glibc-2.3.2/sysdeps/sparc/sparc64/dl-machine.h Sat May 8 17:18:04 2004
+@@ -65,6 +65,7 @@
+ }
+
+ /* Return the run-time load address of the shared object. */
++#ifdef IS_IN_rtld
+ static inline Elf64_Addr
+ elf_machine_load_address (void)
+ {
+@@ -84,6 +85,7 @@
+ pc[3]*4 is l_addr + _GLOBAL_OFFSET_TABLE_ - (long)pc - 12 */
+ return (Elf64_Addr) got - *got + (Elf32_Sword) ((pc[2] - pc[3]) * 4) - 4;
+ }
++#endif
+
+ /* We have 4 cases to handle. And we code different code sequences
+ for each one. I love V9 code models... */
diff --git a/patches/glibc/2.3.3/glibc-2.3.2-without-fp.patch b/patches/glibc/2.3.3/glibc-2.3.2-without-fp.patch
new file mode 100644
index 0000000..76cdfaa
--- /dev/null
+++ b/patches/glibc/2.3.3/glibc-2.3.2-without-fp.patch
@@ -0,0 +1,89 @@
+Sender: libc-alpha-owner@sources.redhat.com
+Date: Tue, 29 Jul 2003 17:49:47 -0400
+From: Daniel Jacobowitz <drow@mvista.com>
+To: GNU C Library <libc-alpha@sources.redhat.com>
+Subject: Re: __sim_exceptions undefined when linking glibc-2.3.2's libm.so with --without-fp
+Message-ID: <20030729214947.GA29932@nevyn.them.org>
+
+On Tue, Jul 29, 2003 at 02:53:33PM -0700, Dan Kegel wrote:
+> On ppc405, I'm getting the following when linking glibc's libm:
+> /gcc-3.3-glibc-2.3.2/build-glibc/math/libm_pic.a(fclrexcpt.os)(.text+0x1a):
+> In function `feclearexcept@GLIBC_2.1':
+> : undefined reference to `__sim_exceptions'
+>
+> That symbol seems to be present in libc.so. nm shows
+
+--without-fp doesn't work. Try this. Make up a changelog entry if it
+works.
+
+Date: Tue, 29 Jul 2003 14:56:50 -0700
+Message-Id: <200307292156.h6TLuol24356@magilla.sf.frob.com>
+From: Roland McGrath <roland@redhat.com>
+To: Daniel Jacobowitz <drow@mvista.com>
+Cc: GNU C Library <libc-alpha@sources.redhat.com>
+Subject: Re: __sim_exceptions undefined when linking glibc-2.3.2's libm.so with --without-fp
+In-Reply-To: Daniel Jacobowitz's message of Tuesday, 29 July 2003 17:49:47 -0400 <20030729214947.GA29932@nevyn.them.org>
+
+> +int __sim_exceptions __attribute__ ((section(".bss")));
+
+Use __attribute__ ((nocommon)) instead (and please watch the standard
+whitespace conventions, i.e. ``section ('').
+
+diff -purN glibc-2.3.2.orig/sysdeps/powerpc/nofpu/sim-full.c glibc-2.3.2/sysdeps/powerpc/nofpu/sim-full.c
+--- glibc-2.3.2.orig/sysdeps/powerpc/nofpu/sim-full.c 2002-10-19 16:06:29.000000000 -0400
++++ glibc-2.3.2/sysdeps/powerpc/nofpu/sim-full.c 2003-05-14 15:10:42.000000000 -0400
+@@ -24,11 +24,14 @@
+
+ /* Global to store sticky exceptions. */
+-int __sim_exceptions;
++int __sim_exceptions __attribute__ ((nocommon));
++libc_hidden_data_def (__sim_exceptions);
+
+ /* By default, no exceptions should trap. */
+ int __sim_disabled_exceptions = 0xffffffff;
++libc_hidden_data_def (__sim_disabled_exceptions);
+
+-int __sim_round_mode;
++int __sim_round_mode __attribute__ ((nocommon));
++libc_hidden_data_def (__sim_round_mode);
+
+ void
+ __simulate_exceptions (int x)
+diff -purN glibc-2.3.2.orig/sysdeps/powerpc/nofpu/soft-supp.h glibc-2.3.2/sysdeps/powerpc/nofpu/soft-supp.h
+--- glibc-2.3.2.orig/sysdeps/powerpc/nofpu/soft-supp.h 2002-10-19 16:06:29.000000000 -0400
++++ glibc-2.3.2/sysdeps/powerpc/nofpu/soft-supp.h 2003-05-14 15:09:53.000000000 -0400
+@@ -27,7 +27,11 @@ typedef union
+ } fenv_union_t;
+
+
+-extern int __sim_exceptions attribute_hidden;
+-extern int __sim_disabled_exceptions attribute_hidden;
+-extern int __sim_round_mode attribute_hidden;
++extern int __sim_exceptions;
++libc_hidden_proto (__sim_exceptions);
++extern int __sim_disabled_exceptions;
++libc_hidden_proto (__sim_disabled_exceptions);
++extern int __sim_round_mode;
++libc_hidden_proto (__sim_round_mode);
++
+ extern void __simulate_exceptions (int x) attribute_hidden;
+diff -urp glibc-2.3.2.orig/sysdeps/powerpc/soft-fp/sfp-machine.h glibc-2.3.2/sysdeps/powerpc/soft-fp/sfp-machine.h
+--- glibc-2.3.2.orig/sysdeps/powerpc/soft-fp/sfp-machine.h 2002-10-17 18:36:14.000000000 -0400
++++ glibc-2.3.2/sysdeps/powerpc/soft-fp/sfp-machine.h 2003-05-14 16:48:13.000000000 -0400
+@@ -52,7 +52,11 @@
+ #define FP_HANDLE_EXCEPTIONS __simulate_exceptions (_fex)
+ #define FP_ROUNDMODE __sim_round_mode
+
+-extern int __sim_exceptions attribute_hidden;
+-extern int __sim_disabled_exceptions attribute_hidden;
+-extern int __sim_round_mode attribute_hidden;
++extern int __sim_exceptions;
++libc_hidden_proto (__sim_exceptions);
++extern int __sim_disabled_exceptions;
++libc_hidden_proto (__sim_disabled_exceptions);
++extern int __sim_round_mode;
++libc_hidden_proto (__sim_round_mode);
++
+ extern void __simulate_exceptions (int x) attribute_hidden;
+
+
diff --git a/patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-configure.patch b/patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-configure.patch
new file mode 100644
index 0000000..3f568ae
--- /dev/null
+++ b/patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-configure.patch
@@ -0,0 +1,30 @@
+Fixes following problem building glibc-2.3.3 with gcc-4.0:
+
+checking version of i686-unknown-linux-gnu-gcc ... 4.0.0, bad
+checking for gnumake... no
+checking for gmake... gmake
+checking version of gmake... 3.79.1, ok
+checking for gnumsgfmt... no
+checking for gmsgfmt... no
+checking for msgfmt... msgfmt
+checking version of msgfmt... 0.11.4, ok
+checking for makeinfo... makeinfo
+checking version of makeinfo... 4.3, ok
+checking for sed... sed
+checking version of sed... 4.0.5, ok
+checking for autoconf... autoconf
+checking whether autoconf works... yes
+configure: error:
+*** These critical programs are missing or too old: gcc
+
+--- glibc-2.3.3/configure.old Mon Mar 14 12:01:10 2005
++++ glibc-2.3.3/configure Mon Mar 14 12:02:03 2005
+@@ -3899,7 +3899,7 @@
+ ac_prog_version=`$CC -v 2>&1 | sed -n 's/^.*version \([egcygnustpi-]*[0-9.]*\).*$/\1/p'`
+ case $ac_prog_version in
+ '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
+- 3.[2-9]*)
++ 3.[2-9]*|4.[01]*)
+ ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
+ *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
+
diff --git a/patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-elf-2.patch b/patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-elf-2.patch
new file mode 100644
index 0000000..3a235a4
--- /dev/null
+++ b/patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-elf-2.patch
@@ -0,0 +1,53 @@
+Fixes
+
+In file included from dynamic-link.h:310,
+ from dl-reloc.c:265:
+do-rel.h:56: error: invalid storage class for function 'elf_dynamic_do_rela'
+In file included from dl-reloc.c:265:
+dynamic-link.h: In function '_dl_relocate_object':
+dynamic-link.h:33: error: invalid storage class for function 'elf_get_dynamic_info'
+
+when building glibc-2.3.3 with gcc-4.0
+2nd hunk is like http://sourceware.org/cgi-bin/cvsweb.cgi/libc/elf/dynamic-link.h.diff?r1=1.50&r2=1.51&cvsroot=glibc
+but works with older compilers, too
+
+--- glibc-2.3.3/elf/do-rel.h.old 2005-03-16 13:09:37.000000000 -0800
++++ glibc-2.3.3/elf/do-rel.h 2005-03-16 13:10:50.000000000 -0800
+@@ -49,7 +49,14 @@
+ relocations; they should be set up to call _dl_runtime_resolve, rather
+ than fully resolved now. */
+
+-static inline void __attribute__ ((always_inline))
++#if __GNUC__ >= 4
++ auto inline void
++#else
++ static inline void
++#endif
++#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
++ __attribute ((always_inline))
++#endif
+ elf_dynamic_do_rel (struct link_map *map,
+ ElfW(Addr) reladdr, ElfW(Addr) relsize,
+ int lazy)
+--- glibc-2.3.3/elf/dynamic-link.h.old 2005-03-16 13:22:35.000000000 -0800
++++ glibc-2.3.3/elf/dynamic-link.h 2005-03-16 13:26:23.000000000 -0800
+@@ -27,8 +27,17 @@
+
+
+ /* Read the dynamic section at DYN and fill in INFO with indices DT_*. */
+-
+-static inline void __attribute__ ((unused, always_inline))
++#if !defined(RESOLVE) || __GNUC__ < 4
++static
++#else
++auto
++#endif
++inline void
++#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
++ __attribute__ ((unused, always_inline))
++#else
++ __attribute__ ((unused))
++#endif
+ elf_get_dynamic_info (struct link_map *l, ElfW(Dyn) *temp)
+ {
+ ElfW(Dyn) *dyn = l->l_ld;
diff --git a/patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-elf-3.patch b/patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-elf-3.patch
new file mode 100644
index 0000000..354bdee
--- /dev/null
+++ b/patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-elf-3.patch
@@ -0,0 +1,79 @@
+Fixes
+In file included from ldconfig.c:136:
+../sysdeps/i386/dl-procinfo.c:53: error: static declaration of '_dl_x86_cap_flags' follows non-static declaration
+../sysdeps/i386/dl-procinfo.c:61: error: previous declaration of '_dl_x86_cap_flags' was here
+../sysdeps/i386/dl-procinfo.c:72: error: static declaration of '_dl_x86_platforms' follows non-static declaration
+../sysdeps/i386/dl-procinfo.c:77: error: previous declaration of '_dl_x86_platforms' was here
+make[2]: Leaving directory `/home/dank/queue/jobdir.fast2/crosstool-dev/build/i686-unknown-linux-gnu/gcc-4.0-20050305-glibc-2.3.3/glibc-2.3.3/elf'
+when building with gcc-4.0.
+
+2004-07-10 Ulrich Drepper <drepper@redhat.com>
+
+ * elf/ldconfig.c: Define PROCINFO_CLASS as static before including
+ ldsodefs.h.
+ * sysdeps/generic/ldsodefs.h: Only define PROCINFO_CLASS if it is not
+ already defined.
+ * sysdeps/i386/dl-procinfo.c: Define PROCINFO_CALLS only if not
+ already defined.
+
+See
+http://sources.redhat.com/ml/glibc-cvs/2004-q3/msg00093.html
+http://sources.redhat.com/ml/glibc-cvs/2004-q3/msg00097.html
+http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/i386/dl-procinfo.c.diff?cvsroot=glibc&r1=1.1&r2=1.2
+
+rediffed against glibc-2.3.3
+
+diff -ur glibc-2.3.3.orig/elf/ldconfig.c glibc-2.3.3/elf/ldconfig.c
+--- glibc-2.3.3.orig/elf/ldconfig.c Tue Aug 26 01:07:19 2003
++++ glibc-2.3.3/elf/ldconfig.c Sat Mar 19 12:02:08 2005
+@@ -17,6 +17,7 @@
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
++#define PROCINFO_CLASS static
+ #include <alloca.h>
+ #include <argp.h>
+ #include <dirent.h>
+diff -ur glibc-2.3.3.orig/sysdeps/generic/ldsodefs.h glibc-2.3.3/sysdeps/generic/ldsodefs.h
+--- glibc-2.3.3.orig/sysdeps/generic/ldsodefs.h Mon Nov 24 14:56:07 2003
++++ glibc-2.3.3/sysdeps/generic/ldsodefs.h Sat Mar 19 12:02:08 2005
+@@ -348,7 +348,9 @@
+
+ /* Get architecture specific definitions. */
+ #define PROCINFO_DECL
+-#define PROCINFO_CLASS EXTERN
++#ifndef PROCINFO_CLASS
++# define PROCINFO_CLASS EXTERN
++#endif
+ #include <dl-procinfo.c>
+
+ /* Structure describing the dynamic linker itself. */
+Only in glibc-2.3.3/sysdeps/generic: ldsodefs.h~
+diff -ur glibc-2.3.3.orig/sysdeps/i386/dl-procinfo.c glibc-2.3.3/sysdeps/i386/dl-procinfo.c
+--- glibc-2.3.3.orig/sysdeps/i386/dl-procinfo.c Wed Sep 24 20:54:54 2003
++++ glibc-2.3.3/sysdeps/i386/dl-procinfo.c Sat Mar 19 12:02:08 2005
+@@ -1,5 +1,5 @@
+ /* Data for i386 version of processor capability information.
+- Copyright (C) 2001,2002,2003 Free Software Foundation, Inc.
++ Copyright (C) 2001,2002,2003, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@redhat.com>, 2001.
+
+@@ -24,7 +24,7 @@
+ If anything should be added here check whether the size of each string
+ is still ok with the given array size.
+
+- All the #ifdefs in the definitions ar equite irritating but
++ All the #ifdefs in the definitions are quite irritating but
+ necessary if we want to avoid duplicating the information. There
+ are three different modes:
+
+@@ -41,7 +41,7 @@
+ */
+
+ #ifndef PROCINFO_CLASS
+-#define PROCINFO_CLASS
++# define PROCINFO_CLASS
+ #endif
+
+ #if !defined PROCINFO_DECL && defined SHARED
diff --git a/patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-i386.patch b/patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-i386.patch
new file mode 100644
index 0000000..d0ebb13
--- /dev/null
+++ b/patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-i386.patch
@@ -0,0 +1,111 @@
+Fixes
+
+In file included from dynamic-link.h:22,
+ from dl-reloc.c:265:
+../sysdeps/i386/dl-machine.h: In function '_dl_relocate_object':
+../sysdeps/i386/dl-machine.h:395: error: invalid storage class for function 'elf_machine_rel'
+../sysdeps/i386/dl-machine.h:539: error: invalid storage class for function 'elf_machine_rela'
+../sysdeps/i386/dl-machine.h:640: error: invalid storage class for function 'elf_machine_rel_relative'
+../sysdeps/i386/dl-machine.h:650: error: invalid storage class for function 'elf_machine_rela_relative'
+../sysdeps/i386/dl-machine.h:659: error: invalid storage class for function 'elf_machine_lazy_rel'
+../sysdeps/i386/dl-machine.h:680: error: invalid storage class for function 'elf_machine_lazy_rela'
+make[2]: *** [/home/dank/queue/jobdir.dual2/crosstool-dev/build/i686-unknown-linux-gnu/gcc-4.0-20050305-glibc-2.3.3/build-glibc/elf/dl-reloc.o] Error 1
+
+--- glibc-2.3.3/sysdeps/i386/dl-machine.h.old Wed Mar 16 22:24:09 2005
++++ glibc-2.3.3/sysdeps/i386/dl-machine.h Thu Mar 17 01:30:09 2005
+@@ -385,7 +385,14 @@
+ /* Perform the relocation specified by RELOC and SYM (which is fully resolved).
+ MAP is the object containing the reloc. */
+
+-static inline void
++#if __GNUC__ >= 4
++ auto inline void
++#else
++ static inline void
++#endif
++#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
++ __attribute ((always_inline))
++#endif
+ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
+ const Elf32_Sym *sym, const struct r_found_version *version,
+ void *const reloc_addr_arg)
+@@ -529,7 +536,14 @@
+ }
+
+ #ifndef RTLD_BOOTSTRAP
+-static inline void
++#if __GNUC__ >= 4
++ auto inline void
++#else
++ static inline void
++#endif
++#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
++ __attribute ((always_inline))
++#endif
+ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
+ const Elf32_Sym *sym, const struct r_found_version *version,
+ void *const reloc_addr_arg)
+@@ -631,7 +645,14 @@
+ }
+ #endif /* !RTLD_BOOTSTRAP */
+
+-static inline void
++#if __GNUC__ >= 4
++ auto inline void
++#else
++ static inline void
++#endif
++#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
++ __attribute ((always_inline))
++#endif
+ elf_machine_rel_relative (Elf32_Addr l_addr, const Elf32_Rel *reloc,
+ void *const reloc_addr_arg)
+ {
+@@ -641,7 +662,14 @@
+ }
+
+ #ifndef RTLD_BOOTSTRAP
+-static inline void
++#if __GNUC__ >= 4
++ auto inline void
++#else
++ static inline void
++#endif
++#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
++ __attribute ((always_inline))
++#endif
+ elf_machine_rela_relative (Elf32_Addr l_addr, const Elf32_Rela *reloc,
+ void *const reloc_addr_arg)
+ {
+@@ -650,7 +678,14 @@
+ }
+ #endif /* !RTLD_BOOTSTRAP */
+
+-static inline void
++#if __GNUC__ >= 4
++ auto inline void
++#else
++ static inline void
++#endif
++#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
++ __attribute ((always_inline))
++#endif
+ elf_machine_lazy_rel (struct link_map *map,
+ Elf32_Addr l_addr, const Elf32_Rel *reloc)
+ {
+@@ -671,7 +706,14 @@
+
+ #ifndef RTLD_BOOTSTRAP
+
+-static inline void
++#if __GNUC__ >= 4
++ auto inline void
++#else
++ static inline void
++#endif
++#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
++ __attribute ((always_inline))
++#endif
+ elf_machine_lazy_rela (struct link_map *map,
+ Elf32_Addr l_addr, const Elf32_Rela *reloc)
+ {
diff --git a/patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-iconv.patch b/patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-iconv.patch
new file mode 100644
index 0000000..1aa023b
--- /dev/null
+++ b/patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-iconv.patch
@@ -0,0 +1,24 @@
+Fixes
+iconvconfig.c: In function 'write_output':
+iconvconfig.c:1014: error: invalid storage class for function 'name_insert'
+make[2]: Leaving directory `/home/dank/queue/jobdir.fast2/crosstool-dev/build/x86_64-unknown-linux-gnu/gcc-4.0-20050305-glibc-2.3.3/glibc-2.3.3/iconv'
+
+Like http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/iconv/iconvconfig.c.diff?r1=1.19&r2=1.20&cvsroot=glibc
+but works with older compilers
+
+--- glibc-2.3.3/iconv/iconvconfig.c.old Thu Mar 17 01:23:04 2005
++++ glibc-2.3.3/iconv/iconvconfig.c Thu Mar 17 01:24:56 2005
+@@ -1010,7 +1010,12 @@
+ char finalname[prefix_len + sizeof (GCONV_MODULES_CACHE)];
+
+ /* Function to insert the names. */
+- static void name_insert (const void *nodep, VISIT value, int level)
++#if __GNUC__ >= 4
++ auto void
++#else
++ static void
++#endif
++ name_insert (const void *nodep, VISIT value, int level)
+ {
+ struct name *name;
+ unsigned int idx;
diff --git a/patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-iconvdata-2.patch b/patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-iconvdata-2.patch
new file mode 100644
index 0000000..98e9903
--- /dev/null
+++ b/patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-iconvdata-2.patch
@@ -0,0 +1,124 @@
+To: Glibc hackers <libc-hacker at sources dot redhat dot com>
+Subject: iconvdata: Get rid of lvalue casts
+From: Andreas Jaeger <aj at suse dot de>
+Date: Sun, 07 Mar 2004 08:29:47 +0100
+Message-ID: <m3fzclt8r8.fsf@gromit.moeb>
+
+Here's one more patch to get rid of lvalues to make GCC 3.5 happy. It
+generates the same code as before on my machine and passes the
+testsuite.
+
+Ok to commit?
+
+Andreas
+
+2004-03-07 Andreas Jaeger <aj@suse.de>
+
+ * iconvdata/iso-2022-cn-ext.c (BODY): Remove cast used as lvalue.
+ * iconvdata/tcvn5712-1.c (EMIT_SHIFT_TO_INIT): Likewise.
+ * iconvdata/euc-jisx0213.c (EMIT_SHIFT_TO_INIT): Likewise.
+ * iconvdata/shift_jisx0213.c (EMIT_SHIFT_TO_INIT): Likewise.
+ * iconvdata/tscii.c (EMIT_SHIFT_TO_INIT): Likewise.
+
+[rediffed to make crosstool happy]
+
+diff -ur glibc-2.3.3.orig/iconvdata/euc-jisx0213.c glibc-2.3.3.new/iconvdata/euc-jisx0213.c
+--- glibc-2.3.3.orig/iconvdata/euc-jisx0213.c Mon Dec 2 14:07:54 2002
++++ glibc-2.3.3.new/iconvdata/euc-jisx0213.c Fri Mar 18 09:29:22 2005
+@@ -1,5 +1,5 @@
+ /* Conversion from and to EUC-JISX0213.
+- Copyright (C) 2002 Free Software Foundation, Inc.
++ Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Bruno Haible <bruno@clisp.org>, 2002.
+
+@@ -83,7 +83,8 @@
+ if (__builtin_expect (outbuf + 4 <= outend, 1)) \
+ { \
+ /* Write out the last character. */ \
+- *((uint32_t *) outbuf)++ = data->__statep->__count >> 3; \
++ *((uint32_t *) outbuf) = data->__statep->__count >> 3; \
++ outbuf += sizeof (uint32_t); \
+ data->__statep->__count = 0; \
+ } \
+ else \
+diff -ur glibc-2.3.3.orig/iconvdata/iso-2022-cn-ext.c glibc-2.3.3.new/iconvdata/iso-2022-cn-ext.c
+--- glibc-2.3.3.orig/iconvdata/iso-2022-cn-ext.c Fri Jun 28 14:13:14 2002
++++ glibc-2.3.3.new/iconvdata/iso-2022-cn-ext.c Fri Mar 18 09:29:22 2005
+@@ -1,5 +1,5 @@
+ /* Conversion module for ISO-2022-CN-EXT.
+- Copyright (C) 2000-2002 Free Software Foundation, Inc.
++ Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 2000.
+
+@@ -377,7 +377,8 @@
+ } \
+ } \
+ \
+- *((uint32_t *) outptr)++ = ch; \
++ *((uint32_t *) outptr) = ch; \
++ outptr += sizeof (uint32_t); \
+ }
+ #define EXTRA_LOOP_DECLS , int *setp
+ #define INIT_PARAMS int set = (*setp >> 3) & CURRENT_MASK; \
+diff -ur glibc-2.3.3.orig/iconvdata/shift_jisx0213.c glibc-2.3.3.new/iconvdata/shift_jisx0213.c
+--- glibc-2.3.3.orig/iconvdata/shift_jisx0213.c Mon Dec 2 14:07:56 2002
++++ glibc-2.3.3.new/iconvdata/shift_jisx0213.c Fri Mar 18 09:29:22 2005
+@@ -1,5 +1,5 @@
+ /* Conversion from and to Shift_JISX0213.
+- Copyright (C) 2002 Free Software Foundation, Inc.
++ Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Bruno Haible <bruno@clisp.org>, 2002.
+
+@@ -83,7 +83,8 @@
+ if (__builtin_expect (outbuf + 4 <= outend, 1)) \
+ { \
+ /* Write out the last character. */ \
+- *((uint32_t *) outbuf)++ = data->__statep->__count >> 3; \
++ *((uint32_t *) outbuf) = data->__statep->__count >> 3; \
++ outbuf += sizeof (uint32_t); \
+ data->__statep->__count = 0; \
+ } \
+ else \
+diff -ur glibc-2.3.3.orig/iconvdata/tcvn5712-1.c glibc-2.3.3.new/iconvdata/tcvn5712-1.c
+--- glibc-2.3.3.orig/iconvdata/tcvn5712-1.c Mon Dec 2 14:07:52 2002
++++ glibc-2.3.3.new/iconvdata/tcvn5712-1.c Fri Mar 18 09:29:22 2005
+@@ -1,5 +1,5 @@
+ /* Conversion to and from TCVN5712-1.
+- Copyright (C) 2001, 2002 Free Software Foundation, Inc.
++ Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@redhat.com>, 2001.
+
+@@ -68,7 +68,8 @@
+ if (__builtin_expect (outbuf + 4 <= outend, 1)) \
+ { \
+ /* Write out the last character. */ \
+- *((uint32_t *) outbuf)++ = data->__statep->__count >> 3; \
++ *((uint32_t *) outbuf) = data->__statep->__count >> 3; \
++ outbuf += sizeof (uint32_t); \
+ data->__statep->__count = 0; \
+ } \
+ else \
+diff -ur glibc-2.3.3.orig/iconvdata/tscii.c glibc-2.3.3.new/iconvdata/tscii.c
+--- glibc-2.3.3.orig/iconvdata/tscii.c Mon Sep 23 20:39:45 2002
++++ glibc-2.3.3.new/iconvdata/tscii.c Fri Mar 18 09:29:22 2005
+@@ -1,5 +1,5 @@
+ /* Conversion from and to TSCII.
+- Copyright (C) 2002 Free Software Foundation, Inc.
++ Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Bruno Haible <bruno@clisp.org>, 2002.
+
+@@ -98,7 +98,8 @@
+ break; \
+ } \
+ /* Write out the pending character. */ \
+- *((uint32_t *) outbuf)++ = data->__statep->__count >> 8; \
++ *((uint32_t *) outbuf) = data->__statep->__count >> 8; \
++ outbuf += sizeof (uint32_t); \
+ /* Retrieve the successor state. */ \
+ data->__statep->__count = \
+ tscii_next_state[(data->__statep->__count >> 4) & 0x0f]; \
diff --git a/patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-iconvdata.patch b/patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-iconvdata.patch
new file mode 100644
index 0000000..e0ceba6
--- /dev/null
+++ b/patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-iconvdata.patch
@@ -0,0 +1,142 @@
+Fixes
+
+In file included from jis0208.c:23:
+jis0208.h:32: error: array type has incomplete element type
+when building with gcc-4.0
+
+In file included from cp1258.c:869:
+../iconv/skeleton.c: In function 'gconv':
+../iconv/skeleton.c:323: error: invalid lvalue in increment
+
+In file included from cp1255.c:550:
+../iconv/skeleton.c: In function 'gconv':
+../iconv/skeleton.c:323: error: invalid lvalue in increment
+
+In file included from gb18030.c:22114:
+../iconv/loop.c: In function 'from_gb18030':
+../iconv/loop.c:282: error: invalid lvalue in increment
+../iconv/loop.c: In function 'from_gb18030_single':
+../iconv/loop.c:384: error: invalid lvalue in increment
+
+In file included from iso8859-1.c:43:
+../iconv/loop.c: In function 'from_iso8859_1':
+../iconv/loop.c:311: error: invalid lvalue in increment
+
+Rediffed, updated for glibc-2.3.3, added:
+
+In file included from armscii-8.c:85:
+../iconv/loop.c: In function 'from_armscii_8':
+../iconv/loop.c:311: error: invalid lvalue in increment
+../iconv/loop.c:311: error: invalid lvalue in increment
+
+--- glibc-2.3.3.orig/iconvdata/armscii-8.c Mon Dec 2 14:07:52 2002
++++ glibc-2.3.3/iconvdata/armscii-8.c Thu Mar 17 16:01:23 2005
+@@ -57,11 +57,17 @@
+ uint_fast8_t ch = *inptr; \
+ \
+ if (ch <= 0xa0) \
+- /* Upto and including 0xa0 the ARMSCII-8 corresponds to Unicode. */ \
+- *((uint32_t *) outptr)++ = ch; \
++ { \
++ /* Upto and including 0xa0 the ARMSCII-8 corresponds to Unicode. */ \
++ *((uint32_t *) outptr) = ch; \
++ outptr += sizeof (uint32_t); \
++ } \
+ else if (ch >= 0xa2 && ch <= 0xfe) \
+- /* Use the table. */ \
+- *((uint32_t *) outptr)++ = map_from_armscii_8[ch - 0xa2]; \
++ { \
++ /* Use the table. */ \
++ *((uint32_t *) outptr) = map_from_armscii_8[ch - 0xa2]; \
++ outptr += sizeof (uint32_t); \
++ } \
+ else \
+ { \
+ /* This is an illegal character. */ \
+diff -ur glibc-2.3.3.orig/iconvdata/cp1255.c glibc-2.3.3/iconvdata/cp1255.c
+--- glibc-2.3.3.orig/iconvdata/cp1255.c Mon Dec 2 14:07:52 2002
++++ glibc-2.3.3/iconvdata/cp1255.c Thu Mar 17 08:20:13 2005
+@@ -69,7 +69,8 @@
+ if (__builtin_expect (outbuf + 4 <= outend, 1)) \
+ { \
+ /* Write out the last character. */ \
+- *((uint32_t *) outbuf)++ = data->__statep->__count >> 3; \
++ *((uint32_t *) outbuf) = data->__statep->__count >> 3; \
++ outbuf += sizeof (uint32_t); \
+ data->__statep->__count = 0; \
+ } \
+ else \
+diff -ur glibc-2.3.3.orig/iconvdata/cp1258.c glibc-2.3.3/iconvdata/cp1258.c
+--- glibc-2.3.3.orig/iconvdata/cp1258.c Mon Dec 2 14:07:52 2002
++++ glibc-2.3.3/iconvdata/cp1258.c Thu Mar 17 08:20:13 2005
+@@ -70,7 +70,8 @@
+ if (__builtin_expect (outbuf + 4 <= outend, 1)) \
+ { \
+ /* Write out the last character. */ \
+- *((uint32_t *) outbuf)++ = data->__statep->__count >> 3; \
++ *((uint32_t *) outbuf) = data->__statep->__count >> 3; \
++ outbuf += sizeof (uint32_t); \
+ data->__statep->__count = 0; \
+ } \
+ else \
+diff -ur glibc-2.3.3.orig/iconvdata/gb18030.c glibc-2.3.3/iconvdata/gb18030.c
+--- glibc-2.3.3.orig/iconvdata/gb18030.c Mon Dec 2 14:07:54 2002
++++ glibc-2.3.3/iconvdata/gb18030.c Thu Mar 17 08:20:13 2005
+@@ -25769,7 +25769,8 @@
+ } \
+ } \
+ \
+- *((uint32_t *) outptr)++ = ch; \
++ *((uint32_t *) outptr) = ch; \
++ outptr += sizeof (uint32_t); \
+ }
+ #define LOOP_NEED_FLAGS
+ #define ONEBYTE_BODY \
+diff -ur glibc-2.3.3.orig/iconvdata/iso8859-1.c glibc-2.3.3/iconvdata/iso8859-1.c
+--- glibc-2.3.3.orig/iconvdata/iso8859-1.c Mon Dec 2 14:07:56 2002
++++ glibc-2.3.3/iconvdata/iso8859-1.c Thu Mar 17 08:20:47 2005
+@@ -35,7 +35,8 @@
+ #define MIN_NEEDED_OUTPUT MIN_NEEDED_TO
+ #define LOOPFCT FROM_LOOP
+ #define BODY \
+- *((uint32_t *) outptr)++ = *inptr++;
++ *((uint32_t *) outptr) = *inptr++; \
++ outptr += sizeof (uint32_t);
+ #define ONEBYTE_BODY \
+ { \
+ return c; \
+diff -ur glibc-2.3.3.orig/iconvdata/jis0208.h glibc-2.3.3/iconvdata/jis0208.h
+--- glibc-2.3.3.orig/iconvdata/jis0208.h Wed Jun 11 14:40:42 2003
++++ glibc-2.3.3/iconvdata/jis0208.h Thu Mar 17 08:20:13 2005
+@@ -24,15 +24,6 @@
+ #include <gconv.h>
+ #include <stdint.h>
+
+-/* Conversion table. */
+-extern const uint16_t __jis0208_to_ucs[];
+-
+-extern const char __jisx0208_from_ucs4_lat1[256][2];
+-extern const char __jisx0208_from_ucs4_greek[0xc1][2];
+-extern const struct jisx0208_ucs_idx __jisx0208_from_ucs_idx[];
+-extern const char __jisx0208_from_ucs_tab[][2];
+-
+-
+ /* Struct for table with indeces in UCS mapping table. */
+ struct jisx0208_ucs_idx
+ {
+@@ -40,6 +31,15 @@
+ uint16_t end;
+ uint16_t idx;
+ };
++
++
++/* Conversion table. */
++extern const uint16_t __jis0208_to_ucs[];
++
++extern const char __jisx0208_from_ucs4_lat1[256][2];
++extern const char __jisx0208_from_ucs4_greek[0xc1][2];
++extern const struct jisx0208_ucs_idx __jisx0208_from_ucs_idx[];
++extern const char __jisx0208_from_ucs_tab[][2];
+
+
+ static inline uint32_t
diff --git a/patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-locale.patch b/patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-locale.patch
new file mode 100644
index 0000000..a085822
--- /dev/null
+++ b/patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-locale.patch
@@ -0,0 +1,34 @@
+--- glibc-2.3.3/locale/weight.h.old 2003-06-11 14:52:12.000000000 -0700
++++ glibc-2.3.3/locale/weight.h 2005-03-15 12:05:37.000000000 -0800
+@@ -18,8 +18,14 @@
+ 02111-1307 USA. */
+
+ /* Find index of weight. */
++#if __GNUC__ >= 4
++auto inline int32_t
++#else
+ static inline int32_t
++#endif
++#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
+ __attribute ((always_inline))
++#endif
+ findidx (const unsigned char **cpp)
+ {
+ int_fast32_t i = table[*(*cpp)++];
+--- glibc-2.3.3/locale/weightwc.h.old 2003-06-13 13:44:58.000000000 -0700
++++ glibc-2.3.3/locale/weightwc.h 2005-03-15 12:06:46.000000000 -0800
+@@ -18,8 +18,14 @@
+ 02111-1307 USA. */
+
+ /* Find index of weight. */
++#if __GNUC__ >= 4
++auto inline int32_t
++#else
+ static inline int32_t
++#endif
++#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
+ __attribute ((always_inline))
++#endif
+ findidx (const wint_t **cpp)
+ {
+ int32_t i;
diff --git a/patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-posix.patch b/patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-posix.patch
new file mode 100644
index 0000000..20f8825
--- /dev/null
+++ b/patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-posix.patch
@@ -0,0 +1,77 @@
+Fixes errors
+
+regcomp.c: In function 'parse_bracket_exp':
+regcomp.c:2724: error: invalid storage class for function 'seek_collating_symbol_entry'
+regcomp.c:2757: error: invalid storage class for function 'lookup_collation_sequence_value'
+regcomp.c:2826: error: invalid storage class for function 'build_range_exp'
+regcomp.c:2913: error: invalid storage class for function 'build_collating_symbol'
+...
+make[2]: *** [/home/dank/queue/jobdir.fast/crosstool-dev/build/x86_64-unknown-linux-gnu/gcc-4.0-20050305-glibc-2.3.3/build-glibc/posix/regex.o] Error 1
+
+See also http://sources.redhat.com/ml/glibc-cvs/2004-q3/msg01071.html
+That fix requires gcc-4.0, but the fix proposed here works with older compilers, too
+
+--- glibc-2.3.3/posix/regcomp.c.old 2005-03-16 11:40:55.000000000 -0800
++++ glibc-2.3.3/posix/regcomp.c 2005-03-16 11:50:31.000000000 -0800
+@@ -2718,8 +2718,14 @@
+ Seek the collating symbol entry correspondings to NAME.
+ Return the index of the symbol in the SYMB_TABLE. */
+
++#if __GNUC__ >= 4
++ auto inline int32_t
++#else
+ static inline int32_t
++#endif
++#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
+ __attribute ((always_inline))
++#endif
+ seek_collating_symbol_entry (name, name_len)
+ const unsigned char *name;
+ size_t name_len;
+@@ -2751,8 +2757,14 @@
+ Look up the collation sequence value of BR_ELEM.
+ Return the value if succeeded, UINT_MAX otherwise. */
+
++#if __GNUC__ >= 4
++ auto inline unsigned int
++#else
+ static inline unsigned int
++#endif
++#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
+ __attribute ((always_inline))
++#endif
+ lookup_collation_sequence_value (br_elem)
+ bracket_elem_t *br_elem;
+ {
+@@ -2819,8 +2831,14 @@
+ mbcset->range_ends, is a pointer argument sinse we may
+ update it. */
+
+- static inline reg_errcode_t
++#if __GNUC__ >= 4
++ auto inline reg_errcode_t
++#else
++ static inline reg_errcode_t
++#endif
++#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
+ __attribute ((always_inline))
++#endif
+ # ifdef RE_ENABLE_I18N
+ build_range_exp (sbcset, mbcset, range_alloc, start_elem, end_elem)
+ re_charset_t *mbcset;
+@@ -2906,8 +2924,14 @@
+ COLL_SYM_ALLOC is the allocated size of mbcset->coll_sym, is a
+ pointer argument sinse we may update it. */
+
+- static inline reg_errcode_t
++#if __GNUC__ >= 4
++ auto inline reg_errcode_t
++#else
++ static inline reg_errcode_t
++#endif
++#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
+ __attribute ((always_inline))
++#endif
+ # ifdef RE_ENABLE_I18N
+ build_collating_symbol (sbcset, mbcset, coll_sym_alloc, name)
+ re_charset_t *mbcset;
diff --git a/patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-powerpc-procfs.patch b/patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-powerpc-procfs.patch
new file mode 100644
index 0000000..0c824bc
--- /dev/null
+++ b/patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-powerpc-procfs.patch
@@ -0,0 +1,65 @@
+(Combined with earlier fix old/glibc-2.3.2-powerpc-procfs.patch
+from http://sources.redhat.com/ml/libc-alpha/2003-12/msg00101.html)
+
+This fix discussed here:
+http://gcc.gnu.org/ml/gcc/2005-01/msg00509.html
+
+Revision 1.12, Wed Mar 2 20:11:38 2005 UTC by roland
+Branch: MAIN
+CVS Tags: fedora-glibc-20050303T1335, HEAD
+Changes since 1.11: +3 -8 lines
+Diff to previous 1.11 (colored)
+
+2005-02-21 Alan Modra <amodra@bigpond.net.au>
+
+ * sysdeps/unix/sysv/linux/powerpc/sys/procfs.h (elf_vrreg_t): Don't
+ use __uint128_t.
+
+http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/unix/sysv/linux/powerpc/sys/procfs.h?cvsroot=glibc
+http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/unix/sysv/linux/powerpc/sys/procfs.h.diff?r1=1.11&r2=1.12&cvsroot=glibc
+
+Fixes
+
+In file included from ../linuxthreads_db/proc_service.h:20,
+ from ../linuxthreads_db/thread_dbP.h:7,
+ from ../linuxthreads/descr.h:44,
+ from ../linuxthreads/internals.h:30,
+ from ../linuxthreads/sysdeps/pthread/bits/libc-lock.h:27,
+ from ../sysdeps/generic/ldsodefs.h:38,
+ from ../sysdeps/unix/sysv/linux/ldsodefs.h:25,
+ from <stdin>:2:
+../sysdeps/unix/sysv/linux/powerpc/sys/procfs.h:57: error: syntax error before 'elf_vrreg_t'
+../sysdeps/unix/sysv/linux/powerpc/sys/procfs.h:57: warning: type defaults to 'int' in declaration of 'elf_vrreg_t'
+../sysdeps/unix/sysv/linux/powerpc/sys/procfs.h:57: warning: data definition has no type or storage class
+../sysdeps/unix/sysv/linux/powerpc/sys/procfs.h:58: error: syntax error before 'elf_vrregset_t'
+../sysdeps/unix/sysv/linux/powerpc/sys/procfs.h:58: warning: type defaults to 'int' in declaration of 'elf_vrregset_t'
+../sysdeps/unix/sysv/linux/powerpc/sys/procfs.h:58: warning: data definition has no type or storage class
+make[2]: make[2]: Leaving directory `/home/dank/queue/jobdir.fast2/crosstool-dev/build/powerpc-750-linux-gnu/gcc-4.0-20050305-glibc-2.3-20050307/glibc-2.3-20050307/csu'
+
+Rediffed against glibc-2.3.3
+
+--- glibc-2.3.3.orig/sysdeps/unix/sysv/linux/powerpc/sys/procfs.h Sun Jan 12 00:24:23 2003
++++ glibc-2.3.3.new/sysdeps/unix/sysv/linux/powerpc/sys/procfs.h Fri Mar 18 11:20:58 2005
+@@ -45,18 +45,13 @@
+
+ typedef double elf_fpreg_t;
+ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
+-#endif
+-
+-/* gcc 3.1 and newer support __uint128_t. */
+-#if !__GNUC_PREREQ(3,1)
+-typedef struct {
+- unsigned long u[4];
+-} __attribute((aligned(16))) __uint128_t;
+-#endif
+
+ /* Altivec registers */
+-typedef __uint128_t elf_vrreg_t;
++typedef struct {
++ unsigned int u[4];
++} __attribute__ ((aligned (16))) elf_vrreg_t;
+ typedef elf_vrreg_t elf_vrregset_t[ELF_NVRREG];
++#endif
+
+ struct elf_siginfo
+ {
diff --git a/patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-x86_64.patch b/patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-x86_64.patch
new file mode 100644
index 0000000..c85aab9
--- /dev/null
+++ b/patches/glibc/2.3.3/glibc-2.3.3-allow-gcc-4.0-x86_64.patch
@@ -0,0 +1,60 @@
+Fixes
+
+In file included from dynamic-link.h:22,
+ from dl-reloc.c:265:
+../sysdeps/x86_64/dl-machine.h: In function '_dl_relocate_object':
+../sysdeps/x86_64/dl-machine.h:361: error: invalid storage class for function 'elf_machine_rela'
+../sysdeps/x86_64/dl-machine.h:525: error: invalid storage class for function 'elf_machine_rela_relative'
+../sysdeps/x86_64/dl-machine.h:534: error: invalid storage class for function 'elf_machine_lazy_rel'
+make[2]: *** [/home/dank/queue/jobdir.fast/crosstool-dev/build/x86_64-unknown-linux-gnu/gcc-4.0-20050305-glibc-2.3.3/build-glibc/elf/dl-reloc.o] Error 1
+
+--- glibc-2.3.3/sysdeps/x86_64/dl-machine.h.old Wed Mar 16 16:19:15 2005
++++ glibc-2.3.3/sysdeps/x86_64/dl-machine.h Wed Mar 16 16:22:09 2005
+@@ -354,7 +354,14 @@
+ /* Perform the relocation specified by RELOC and SYM (which is fully resolved).
+ MAP is the object containing the reloc. */
+
+-static inline void
++#if __GNUC__ >= 4
++ auto inline void
++#else
++ static inline void
++#endif
++#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
++ __attribute ((always_inline))
++#endif
+ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
+ const Elf64_Sym *sym, const struct r_found_version *version,
+ void *const reloc_addr_arg)
+@@ -519,7 +526,14 @@
+ }
+ }
+
+-static inline void
++#if __GNUC__ >= 4
++ auto inline void
++#else
++ static inline void
++#endif
++#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
++ __attribute ((always_inline))
++#endif
+ elf_machine_rela_relative (Elf64_Addr l_addr, const Elf64_Rela *reloc,
+ void *const reloc_addr_arg)
+ {
+@@ -528,7 +542,14 @@
+ *reloc_addr = l_addr + reloc->r_addend;
+ }
+
+-static inline void
++#if __GNUC__ >= 4
++ auto inline void
++#else
++ static inline void
++#endif
++#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
++ __attribute ((always_inline))
++#endif
+ elf_machine_lazy_rel (struct link_map *map,
+ Elf64_Addr l_addr, const Elf64_Rela *reloc)
+ {
diff --git a/patches/glibc/2.3.3/glibc-2.3.3-alpha-pwrite64.patch b/patches/glibc/2.3.3/glibc-2.3.3-alpha-pwrite64.patch
new file mode 100644
index 0000000..7baea61
--- /dev/null
+++ b/patches/glibc/2.3.3/glibc-2.3.3-alpha-pwrite64.patch
@@ -0,0 +1,41 @@
+Fix for this error:
+
+crosstool-0.32/build/alpha-unknown-linux-gnu/gcc-3.3.5-glibc-2.3.3/build-glibc/libc_pic.os(.text+0xc8bd0): In function `__posix_fallocate64_l64':
+: undefined reference to `__GI___pwrite64'
+collect2: ld returned 1 exit status
+make[1]: *** [crosstool-0.32/build/alpha-unknown-linux-gnu/gcc-3.3.5-glibc-2.3.3/build-glibc/libc.so] Error 1
+make[1]: Leaving directory `crosstool-0.32/build/alpha-unknown-linux-gnu/gcc-3.3.5-glibc-2.3.3/glibc-2.3.3'
+make: *** [all] Error 2
+
+extracted from GLIBC CVS by Dan Kegel
+wget 'http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/unix/sysv/linux/alpha/sysdep.h.diff?r1=1.16&r2=1.17&cvsroot=glibc'
+
+cf.
+http://sources.redhat.com/ml/libc-alpha/2003-10/msg00038.html
+
+
+--- glibc-2.3.3/sysdeps/unix/sysv/linux/alpha/sysdep.h.old 2003-06-20 09:24:36.000000000 -0700
++++ glibc-2.3.3/sysdeps/unix/sysv/linux/alpha/sysdep.h 2005-04-27 11:23:46.000000000 -0700
+@@ -1,4 +1,4 @@
+-/* Copyright (C) 1992, 1993, 1995, 1996, 1997, 2002, 2003
++/* Copyright (C) 1992, 1993, 1995, 1996, 1997, 2002, 2003, 2004
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>, August 1995.
+@@ -65,6 +65,16 @@
+ # define __NR_semtimedop 423
+ #endif
+
++/* This is a kludge to make syscalls.list find these under the names
++ pread and pwrite, since some kernel headers define those names
++ and some define the *64 names for the same system calls. */
++#if !defined __NR_pread && defined __NR_pread64
++# define __NR_pread __NR_pread64
++#endif
++#if !defined __NR_pwrite && defined __NR_pwrite64
++# define __NR_pwrite __NR_pwrite64
++#endif
++
+ /*
+ * In order to get the hidden arguments for rt_sigaction set up
+ * properly, we need to call the assembly version. This shouldn't
diff --git a/patches/glibc/2.3.3/glibc-2.3.3-cygwin.patch b/patches/glibc/2.3.3/glibc-2.3.3-cygwin.patch
new file mode 100644
index 0000000..0ad9a71
--- /dev/null
+++ b/patches/glibc/2.3.3/glibc-2.3.3-cygwin.patch
@@ -0,0 +1,103 @@
+Fixes
+elf/librtld.os: In function `process_envvars': : undefined reference to `__access'
+...
+when building glibc-2.3.3 on cygwin
+
+Idea from
+http://sources.redhat.com/ml/bug-glibc/2002-01/msg00071/glibc-2.2-cygin-shared.patch
+Basically, make glibc use .oST as suffix for 'object static'
+instead of .oS, since cygwin has trouble distinguishing .os from .oS
+(Original patch had .on, but .oST is more mnemonic for 'object static')
+
+glibc-linuxthreads-2.3.3 also requires a patch, see
+../glibc-linuxthreads-2.3.3/glibc-linuxthreads-2.3.3-cygwin.patch
+
+[ Rediffed against glibc-2.3.3 ]
+
+
+diff -aur glibc-2.3.3/Makeconfig glibc-2.3.3-cygwin/Makeconfig
+--- glibc-2.3.3/Makeconfig 2003-09-17 01:36:10.000000000 -0700
++++ glibc-2.3.3-cygwin/Makeconfig 2004-08-27 20:34:43.000000000 -0700
+@@ -439,13 +439,13 @@
+ # run the linked programs.
+ link-libc = -Wl,-rpath-link=$(rpath-link) \
+ $(common-objpfx)libc.so$(libc.so-version) \
+- $(common-objpfx)$(patsubst %,$(libtype.oS),c) $(gnulib)
++ $(common-objpfx)$(patsubst %,$(libtype.oST),c) $(gnulib)
+ # This is how to find at build-time things that will be installed there.
+ rpath-dirs = math elf dlfcn nss nis rt resolv crypt
+ else
+ ifneq (,$(filter aix aix%,$(config-os)))
+ link-libc = $(common-objpfx)libc.a \
+- $(common-objpfx)$(patsubst %,$(libtype.oS),c) $(gnulib)
++ $(common-objpfx)$(patsubst %,$(libtype.oST),c) $(gnulib)
+ rpath-dirs = math dlfcn nss nis rt resolv crypt
+ endif
+ endif
+@@ -658,7 +658,7 @@
+ # The compilation rules use $(CPPFLAGS-${SUFFIX}) and $(CFLAGS-${SUFFIX})
+ # to pass different flags for each flavor.
+ libtypes = $(foreach o,$(object-suffixes-for-libc),$(libtype$o))
+-all-object-suffixes := .o .os .op .og .ob .oS
++all-object-suffixes := .o .os .op .og .ob .oST
+ object-suffixes :=
+ CPPFLAGS-.o = $(pic-default)
+ CFLAGS-.o = $(filter %frame-pointer,$(+cflags))
+@@ -714,14 +714,14 @@
+
+ ifeq (yes,$(build-shared))
+ # Build special library that contains the static-only routines for libc.
+-object-suffixes-for-libc += .oS
++object-suffixes-for-libc += .oST
+
+ # Must build the routines as PIC, though, because they can end up in (users')
+ # shared objects. We don't want to use CFLAGS-os because users may, for
+ # example, make that processor-specific.
+-CFLAGS-.oS = $(CFLAGS-.o) $(PIC-ccflag)
+-CPPFLAGS-.oS = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1
+-libtype.oS = lib%_nonshared.a
++CFLAGS-.oST = $(CFLAGS-.o) $(pic-ccflag)
++CPPFLAGS-.oST = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1
++libtype.oST = lib%_nonshared.a
+ endif
+
+ # The assembler can generate debug information too.
+diff -aur glibc-2.3.3/Makerules glibc-2.3.3-cygwin/Makerules
+--- glibc-2.3.3/Makerules 2003-10-31 16:35:57.000000000 -0800
++++ glibc-2.3.3-cygwin/Makerules 2004-08-27 20:33:47.000000000 -0700
+@@ -414,7 +414,7 @@
+ # Bounded pointer thunks are only built for *.ob
+ elide-bp-thunks = $(addprefix $(bppfx),$(bp-thunks))
+
+-elide-routines.oS += $(filter-out $(static-only-routines),\
++elide-routines.oST += $(filter-out $(static-only-routines),\
+ $(routines) $(aux) $(sysdep_routines)) \
+ $(elide-bp-thunks)
+ elide-routines.os += $(static-only-routines) $(elide-bp-thunks)
+@@ -934,7 +934,7 @@
+ install: $(inst_libdir)/libc.so
+ $(inst_libdir)/libc.so: $(common-objpfx)format.lds \
+ $(common-objpfx)libc.so$(libc.so-version) \
+- $(inst_libdir)/$(patsubst %,$(libtype.oS),\
++ $(inst_libdir)/$(patsubst %,$(libtype.oST),\
+ $(libprefix)$(libc-name)) \
+ $(+force)
+ (echo '/* GNU ld script';\
+@@ -942,7 +942,7 @@
+ echo ' the static library, so try that secondarily. */';\
+ cat $<; \
+ echo 'GROUP ( $(slibdir)/libc.so$(libc.so-version)' \
+- '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)$(libc-name))'\
++ '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)$(libc-name))'\
+ ')' \
+ ) > $@.new
+ mv -f $@.new $@
+diff -aur glibc-2.3.3/sysdeps/sparc/sparc32/sparcv9/Makefile glibc-2.3.3-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile
+--- glibc-2.3.3/sysdeps/sparc/sparc32/sparcv9/Makefile 2002-08-29 03:41:15.000000000 -0700
++++ glibc-2.3.3-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile 2004-08-27 20:35:43.000000000 -0700
+@@ -10,4 +10,4 @@
+ ASFLAGS-.op += -Wa,-Av9a
+ ASFLAGS-.og += -Wa,-Av9a
+ ASFLAGS-.ob += -Wa,-Av9a
+-ASFLAGS-.oS += -Wa,-Av9a
++ASFLAGS-.oST += -Wa,-Av9a
diff --git a/patches/glibc/2.3.3/glibc-2.3.3-libeh-kludge.patch b/patches/glibc/2.3.3/glibc-2.3.3-libeh-kludge.patch
new file mode 100644
index 0000000..6ddc020
--- /dev/null
+++ b/patches/glibc/2.3.3/glibc-2.3.3-libeh-kludge.patch
@@ -0,0 +1,75 @@
+wget "http://sources.redhat.com/cgi-bin/get-raw-msg?listname=libc-alpha&date=2003-09&msgid=20030911190500.GE12344%40sunsite.ms.mff.cuni.cz"
+aka http://sources.redhat.com/ml/libc-alpha/2003-09/msg00104.html
+
+This seems to fix the error
+ gcc-3.4.1-glibc-2.3.3/lib/gcc/powerpc-7400-linux-gnu/3.4.1/../../../../powerpc-7400-linux-gnu/bin/ld: cannot find -lgcc_eh
+ make[1]: *** [build/powerpc-7400-linux-gnu/gcc-3.4.1-glibc-2.3.3/build-glibc/libc.so] Error 1
+but I assume it might cause trouble with nptl
+FIXME: once we figure out why this patch is wrong, fix it right :-)
+
+Date: Thu, 11 Sep 2003 21:05:00 +0200
+From: Jakub Jelinek <jakub at redhat dot com>
+To: libc-alpha at sources dot redhat dot com
+Subject: Re: Another ugly bootstrapping patch for libgcc_eh
+Message-ID: <20030911190500.GE12344@sunsite.ms.mff.cuni.cz>
+Reply-To: Jakub Jelinek <jakub at redhat dot com>
+References: <20030911194944.GA6104@nevyn.them.org> <20030911180703.GD12344@sunsite.ms.mff.cuni.cz> <20030911203621.GA31503@nevyn.them.org>
+In-Reply-To: <20030911203621 dot GA31503 at nevyn dot them dot org>
+
+On Thu, Sep 11, 2003 at 04:36:21PM -0400, Daniel Jacobowitz wrote:
+> > Why exactly do you need that?
+> > What exact library needs the functions from libgcc_eh.a?
+> > There shouldn't be any these days (__register_*/__frame_state_for etc.
+> > functions should come from sysdeps/generic on arches which need them,
+> > _Unwind_* come from unwind*.c).
+> > IMHO both:
+> >
+> > # Force the backward compatibility EH functions to be linked.
+> > LDFLAGS-c.so += -u __register_frame
+> >
+> > in Makerules and -lgcc_eh in Makeconfig should go.
+>
+> If you say so. That -lgcc_eh's been in and out quite a number of
+> times. I was just assuming that it was necessary.
+
+I have been testing following patch on hammer.
+linuxthreads built just fine and NPTL libraries too,
+and in both cases libraries had the same exported symbols as without
+the patch (though its .text slightly shrunk because it no longer contained
+unneeded libgcc_eh routines (and also libc.so has fewer .plt slots).
+Unfortunately, sln in NPTL build doesn't link, as libgcc_eh.a is needed
+in this case.
+So, IMHO we need my Makerules change and Daniel's patch.
+
+2003-09-11 Jakub Jelinek <jakub@redhat.com>
+
+ #* Makerules (LDFLAGS-c.so): Remove -u __register_frame.
+ * Makeconfig (gnulib): Remove -lgcc_eh.
+
+# Ulrich already applied this.
+#--- libc/Makerules.jj 2003-07-23 03:56:16.000000000 -0400
+#+++ libc/Makerules 2003-09-11 16:22:44.000000000 -0400
+#@@ -572,8 +572,6 @@ LDFLAGS-c.so = -nostdlib -nostartfiles
+# LDLIBS-c.so += $(gnulib)
+# # Give libc.so an entry point and make it directly runnable itself.
+# LDFLAGS-c.so += -e __libc_main
+#-# Force the backward compatibility EH functions to be linked.
+#-LDFLAGS-c.so += -u __register_frame
+# # Pre-link the objects of libc_pic.a so that we can locally resolve
+# # COMMON symbols before we link against ld.so. This is because ld.so
+# # contains some of libc_pic.a already, which will prevent the COMMONs
+--- libc/Makeconfig.jj 2003-07-22 08:25:32.000000000 -0400
++++ libc/Makeconfig 2003-09-11 16:23:08.000000000 -0400
+@@ -505,7 +505,7 @@ link-libc-bounded = $(common-objpfx)libc
+ link-extra-libs-bounded = $(foreach lib,$(LDLIBS-$(@F:%-bp=%)),$(common-objpfx)$(lib)_b.a)
+
+ ifndef gnulib
+-gnulib := -lgcc -lgcc_eh
++gnulib := -lgcc
+ endif
+ ifeq ($(elf),yes)
+ +preinit = $(addprefix $(csu-objpfx),crti.o)
+
+
+ Jakub
+
diff --git a/patches/glibc/2.3.3/glibc-2.3.3-s390-fadvise64.patch b/patches/glibc/2.3.3/glibc-2.3.3-s390-fadvise64.patch
new file mode 100644
index 0000000..9f21744
--- /dev/null
+++ b/patches/glibc/2.3.3/glibc-2.3.3-s390-fadvise64.patch
@@ -0,0 +1,128 @@
+See http://sources.redhat.com/ml/libc-hacker/2003-12/msg00023.html
+or http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/unix/sysv/linux/s390/s390-32/posix_fadvise64.c?cvsroot=glibc
+
+Should fix error
+
+../sysdeps/unix/sysv/linux/posix_fadvise64.c: In function `__posix_fadvise64_l64':
+../sysdeps/unix/sysv/linux/posix_fadvise64.c:35: warning: implicit declaration of function `DECLARGS_6'
+../sysdeps/unix/sysv/linux/posix_fadvise64.c:35: error: parse error before "register"
+...
+../sysdeps/unix/sysv/linux/posix_fadvise64.c:35: error: parse error before "ASMFMT_6"
+make[2]: *** [crosstool-0.28-rc34/build/s390-unknown-linux-gnu/gcc-3.4.1-glibc-2.3.3/build-glibc/io/posix_fadvise64.o] Error 1
+
+
+From: Martin Schwidefsky <schwidefsky at de dot ibm dot com>
+Organization: IBM Deutschland GmbH
+To: libc-hacker at sources dot redhat dot com
+Subject: fadvise64_64 for s390-32.
+Date: Fri, 5 Dec 2003 18:46:33 +0100
+
+Hi,
+on s390* system calls can have up to 5 paramters. The generic linux
+implemenation of fadvise64_64 for 32 bit systems needs 6 parameters,
+so we need to have a s390-32 special version of posix_fadvise64.c.
+For s390-64 we do not have the problem because there fadvise64_64
+has only 4 parameters.
+
+blue skies,
+ Martin.
+
+2003-12-05 Martin Schwidefsky <schwidefsky@de.ibm.com>
+
+ * sysdeps/unix/sysv/linux/s390/s390-32/posix_fadvise64.c: New file.
+
+diff -urN libc/sysdeps/unix/sysv/linux/s390/s390-32/posix_fadvise64.c libc-s390/sysdeps/unix/sysv/linux/s390/s390-32/posix_fadvise64.c
+--- libc/sysdeps/unix/sysv/linux/s390/s390-32/posix_fadvise64.c 1970-01-01 01:00:00.000000000 +0100
++++ libc-s390/sysdeps/unix/sysv/linux/s390/s390-32/posix_fadvise64.c 2003-11-13 15:31:40.000000000 +0100
+@@ -0,0 +1,90 @@
++/* Copyright (C) 2003 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <errno.h>
++#include <fcntl.h>
++#include <sysdep.h>
++#include <kernel-features.h>
++
++int __posix_fadvise64_l64 (int fd, off64_t offset, off64_t len, int advise);
++int __posix_fadvise64_l32 (int fd, off64_t offset, size_t len, int advise);
++
++/* Advice the system about the expected behaviour of the application with
++ respect to the file associated with FD. */
++
++struct fadvise64_64_layout
++{
++ int fd;
++ off64_t offset;
++ off64_t len;
++ int advise;
++};
++
++int
++__posix_fadvise64_l64 (int fd, off64_t offset, off64_t len, int advise)
++{
++#ifdef __NR_fadvise64_64
++ struct fadvise64_64_layout parameters;
++ INTERNAL_SYSCALL_DECL (err);
++
++ parameters.fd = fd;
++ parameters.offset = offset;
++ parameters.len = len;
++ parameters.advise = advise;
++ int ret = INTERNAL_SYSCALL (fadvise64_64, err, 1, &parameters);
++ if (!INTERNAL_SYSCALL_ERROR_P (ret, err))
++ return 0;
++# ifndef __ASSUME_FADVISE64_64_SYSCALL
++ if (INTERNAL_SYSCALL_ERRNO (ret, err) != ENOSYS)
++# endif
++ return INTERNAL_SYSCALL_ERRNO (ret, err);
++#endif
++#ifndef __ASSUME_FADVISE64_64_SYSCALL
++# ifdef __NR_fadvise64
++ if (len != (off_t) len)
++ return EOVERFLOW;
++
++ INTERNAL_SYSCALL_DECL (err2);
++ int ret2 = INTERNAL_SYSCALL (fadvise64, err2, 5, fd,
++ __LONG_LONG_PAIR ((long) (offset >> 32),
++ (long) offset),
++ (off_t) len, advise);
++ if (!INTERNAL_SYSCALL_ERROR_P (ret2, err2))
++ return 0;
++ return INTERNAL_SYSCALL_ERRNO (ret2, err2);
++# else
++ return ENOSYS;
++# endif
++#endif
++}
++
++#include <shlib-compat.h>
++
++#if SHLIB_COMPAT(libc, GLIBC_2_2, GLIBC_2_3_3)
++
++int
++__posix_fadvise64_l32 (int fd, off64_t offset, size_t len, int advise)
++{
++ return __posix_fadvise64_l64 (fd, offset, len, advise);
++}
++
++versioned_symbol (libc, __posix_fadvise64_l64, posix_fadvise64, GLIBC_2_3_3);
++compat_symbol (libc, __posix_fadvise64_l32, posix_fadvise64, GLIBC_2_2);
++#else
++strong_alias (__posix_fadvise64_l64, posix_fadvise64);
++#endif
+
diff --git a/patches/glibc/2.3.3/glibc-2.3.3-unwind-dw2.patch b/patches/glibc/2.3.3/glibc-2.3.3-unwind-dw2.patch
new file mode 100644
index 0000000..d75c4ba
--- /dev/null
+++ b/patches/glibc/2.3.3/glibc-2.3.3-unwind-dw2.patch
@@ -0,0 +1,66 @@
+See http://sources.redhat.com/ml/libc-alpha/2004-02/msg00138.html
+aka http://sources.redhat.com/cgi-bin/get-raw-msg?listname=libc-alpha&date=2004-02&msgid=20040220044155.GE22135%40baldric.uwo.ca
+
+In CVS as
+wget 'http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/generic/unwind-dw2.c.diff?r1=1.7&r2=1.8&cvsroot=glibc'
+
+Revision 1.8, Sat Feb 21 09:07:29 2004 UTC (5 months, 3 weeks ago) by drepper
+
+ Allow sjlj enabled compilers to build the code by removing
+ __USING_SJLJ_EXCEPTIONS__ wrapper.
+
+plus
+wget 'http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/generic/framestate.c.diff?r1=1.3&r2=1.4&cvsroot=glibc'
+
+Revision 1.4, Sat Feb 21 09:07:05 2004 UTC (5 months, 3 weeks ago) by drepper
+
+ [__USING_SJLJ_EXCEPTIONS__] (__frame_state_for): Set frame_State_for
+ to abort if the compiler is using sjlj.
+
+Fixes compile error
+
+../sysdeps/generic/framestate.c: In function `__frame_state_for':
+../sysdeps/generic/framestate.c:44: error: `fallback_frame_state_for' undeclared (first use in this function)
+../sysdeps/generic/framestate.c:44: error: (Each undeclared identifier is reported only once
+../sysdeps/generic/framestate.c:44: error: for each function it appears in.)
+make[2]: *** [crosstool-0.28-rc34/build/arm-unknown-linux-gnu/gcc-3.4.1-glibc-2.3.3/build-glibc/elf/framestate.os] Error 1
+
+===================================================================
+RCS file: /cvs/glibc/libc/sysdeps/generic/unwind-dw2.c,v
+retrieving revision 1.7
+retrieving revision 1.8
+diff -u -r1.7 -r1.8
+--- libc/sysdeps/generic/unwind-dw2.c 2003/07/22 23:55:55 1.7
++++ libc/sysdeps/generic/unwind-dw2.c 2004/02/21 09:07:29 1.8
+@@ -39,7 +39,6 @@
+ #endif
+
+
+-#ifndef __USING_SJLJ_EXCEPTIONS__
+
+ #ifndef STACK_GROWS_DOWNWARD
+ #define STACK_GROWS_DOWNWARD 0
+@@ -1287,4 +1286,3 @@
+ #include "unwind.inc"
+
+ #endif /* _LIBC */
+-#endif /* !USING_SJLJ_EXCEPTIONS */
+===================================================================
+RCS file: /cvs/glibc/libc/sysdeps/generic/framestate.c,v
+retrieving revision 1.3
+retrieving revision 1.4
+diff -u -r1.3 -r1.4
+--- libc/sysdeps/generic/framestate.c 2003/01/08 06:46:06 1.3
++++ libc/sysdeps/generic/framestate.c 2004/02/21 09:07:05 1.4
+@@ -41,7 +41,11 @@
+ if (handle == NULL
+ || (frame_state_for
+ = (framesf) __libc_dlsym (handle, "__frame_state_for")) == NULL)
++#ifndef __USING_SJLJ_EXCEPTIONS__
+ frame_state_for = fallback_frame_state_for;
++#else
++ frame_state_for = abort;
++#endif
+ }
+
+ return frame_state_for (pc, frame_state);
diff --git a/patches/glibc/2.3.3/glibc-2.3.4-allow-gcc-4.0-arm.patch b/patches/glibc/2.3.3/glibc-2.3.4-allow-gcc-4.0-arm.patch
new file mode 100644
index 0000000..f3ad0c6
--- /dev/null
+++ b/patches/glibc/2.3.3/glibc-2.3.4-allow-gcc-4.0-arm.patch
@@ -0,0 +1,117 @@
+Fixes
+In file included from dynamic-link.h:22,
+ from dl-reloc.c:265:
+../sysdeps/arm/dl-machine.h: In function '_dl_relocate_object':
+../sysdeps/arm/dl-machine.h:371: error: invalid storage class for function 'fix_bad_pc24'
+../sysdeps/arm/dl-machine.h:406: error: invalid storage class for function 'elf_machine_rel'
+../sysdeps/arm/dl-machine.h:532: error: invalid storage class for function 'elf_machine_rela'
+../sysdeps/arm/dl-machine.h:612: error: invalid storage class for function 'elf_machine_rel_relative'
+../sysdeps/arm/dl-machine.h:621: error: invalid storage class for function 'elf_machine_rela_relative'
+../sysdeps/arm/dl-machine.h:630: error: invalid storage class for function 'elf_machine_lazy_rel'
+make[2]: Leaving directory `/home/dank/queue/jobdir.k8/crosstool-dev/build/arm-unknown-linux-gnu/gcc-4.0-20050305-glibc-2.3.3/glibc-2.3.3/elf'
+
+when building glibc-2.3.[34] with gcc-4.0
+
+Like
+http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/arm/dl-machine.h.diff?r1=1.51&r2=1.52&cvsroot=glibc
+but works with older compilers, and fixes fix_bad_pc24.
+
+
+--- glibc-2.3.4/sysdeps/arm/dl-machine.h.old Sun Mar 20 17:54:37 2005
++++ glibc-2.3.4/sysdeps/arm/dl-machine.h Sun Mar 20 17:57:32 2005
+@@ -359,7 +359,14 @@
+ # endif
+
+ /* Deal with an out-of-range PC24 reloc. */
+-static Elf32_Addr
++#if __GNUC__ >= 4
++ auto inline Elf32_Addr
++#else
++ static inline Elf32_Addr
++#endif
++#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
++ __attribute ((always_inline))
++#endif
+ fix_bad_pc24 (Elf32_Addr *const reloc_addr, Elf32_Addr value)
+ {
+ static void *fix_page;
+@@ -392,7 +399,14 @@
+ /* Perform the relocation specified by RELOC and SYM (which is fully resolved).
+ MAP is the object containing the reloc. */
+
+-static inline void
++#if __GNUC__ >= 4
++ auto inline void
++#else
++ static inline void
++#endif
++#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
++ __attribute ((always_inline))
++#endif
+ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
+ const Elf32_Sym *sym, const struct r_found_version *version,
+ void *const reloc_addr_arg)
+@@ -517,7 +531,14 @@
+ }
+
+ # ifndef RTLD_BOOTSTRAP
+-static inline void
++#if __GNUC__ >= 4
++ auto inline void
++#else
++ static inline void
++#endif
++#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
++ __attribute ((always_inline))
++#endif
+ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
+ const Elf32_Sym *sym, const struct r_found_version *version,
+ void *const reloc_addr_arg)
+@@ -597,7 +618,14 @@
+ }
+ # endif
+
+-static inline void
++#if __GNUC__ >= 4
++ auto inline void
++#else
++ static inline void
++#endif
++#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
++ __attribute ((always_inline))
++#endif
+ elf_machine_rel_relative (Elf32_Addr l_addr, const Elf32_Rel *reloc,
+ void *const reloc_addr_arg)
+ {
+@@ -606,7 +634,14 @@
+ }
+
+ # ifndef RTLD_BOOTSTRAP
+-static inline void
++#if __GNUC__ >= 4
++ auto inline void
++#else
++ static inline void
++#endif
++#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
++ __attribute ((always_inline))
++#endif
+ elf_machine_rela_relative (Elf32_Addr l_addr, const Elf32_Rela *reloc,
+ void *const reloc_addr_arg)
+ {
+@@ -615,7 +650,14 @@
+ }
+ # endif
+
+-static inline void
++#if __GNUC__ >= 4
++ auto inline void
++#else
++ static inline void
++#endif
++#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
++ __attribute ((always_inline))
++#endif
+ elf_machine_lazy_rel (struct link_map *map,
+ Elf32_Addr l_addr, const Elf32_Rel *reloc)
+ {
diff --git a/patches/glibc/2.3.3/glibc-2.3.4-allow-gcc-4.0-elf.patch b/patches/glibc/2.3.3/glibc-2.3.4-allow-gcc-4.0-elf.patch
new file mode 100644
index 0000000..3bbe6ea
--- /dev/null
+++ b/patches/glibc/2.3.3/glibc-2.3.4-allow-gcc-4.0-elf.patch
@@ -0,0 +1,61 @@
+From http://www.mail-archive.com/pld-cvs-commit@pld-linux.org/msg00229.html
+Fixes
+ rtld.c: In function '_dl_start':
+ dynamic-link.h:47: error: nested function 'elf_machine_rela_relative' declared but never defined
+ dynamic-link.h:41: error: nested function 'elf_machine_rela' declared but never defined
+when compiling glibc-2.3.4 with gcc-4.0
+
+But see also
+http://sources.redhat.com/ml/libc-hacker/2005-02/msg00000.html
+and
+http://sources.redhat.com/ml/libc-hacker/2005-03/msg00008.html
+which seem to propose less radical fixes?
+
+Aha. See also http://sources.redhat.com/bugzilla/show_bug.cgi?id=721
+
+--- glibc-2.3-20050307/elf/dynamic-link.h.old 2005-03-12 18:12:37.000000000 -0800
++++ glibc-2.3-20050307/elf/dynamic-link.h 2005-03-12 18:12:59.777820848 -0800
+@@ -19,43 +19,6 @@
+
+ #include <elf.h>
+ #include <assert.h>
+-
+-#ifdef RESOLVE
+-/* We pass reloc_addr as a pointer to void, as opposed to a pointer to
+- ElfW(Addr), because not all architectures can assume that the
+- relocated address is properly aligned, whereas the compiler is
+- entitled to assume that a pointer to a type is properly aligned for
+- the type. Even if we cast the pointer back to some other type with
+- less strict alignment requirements, the compiler might still
+- remember that the pointer was originally more aligned, thereby
+- optimizing away alignment tests or using word instructions for
+- copying memory, breaking the very code written to handle the
+- unaligned cases. */
+-auto void __attribute__((always_inline))
+-elf_machine_rel (struct link_map *map, const ElfW(Rel) *reloc,
+- const ElfW(Sym) *sym, const struct r_found_version *version,
+- void *const reloc_addr);
+-auto void __attribute__((always_inline))
+-elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc,
+- const ElfW(Sym) *sym, const struct r_found_version *version,
+- void *const reloc_addr);
+-auto void __attribute__((always_inline))
+-elf_machine_rel_relative (ElfW(Addr) l_addr, const ElfW(Rel) *reloc,
+- void *const reloc_addr);
+-auto void __attribute__((always_inline))
+-elf_machine_rela_relative (ElfW(Addr) l_addr, const ElfW(Rela) *reloc,
+- void *const reloc_addr);
+-# if ELF_MACHINE_NO_RELA || defined ELF_MACHINE_PLT_REL
+-auto void __attribute__((always_inline))
+-elf_machine_lazy_rel (struct link_map *map,
+- ElfW(Addr) l_addr, const ElfW(Rel) *reloc);
+-# else
+-auto void __attribute__((always_inline))
+-elf_machine_lazy_rel (struct link_map *map,
+- ElfW(Addr) l_addr, const ElfW(Rela) *reloc);
+-# endif
+-#endif
+-
+ #include <dl-machine.h>
+
+ #ifndef VERSYMIDX
diff --git a/patches/glibc/2.3.3/glibc-2.3.4-allow-gcc-4.0-powerpc32.patch b/patches/glibc/2.3.3/glibc-2.3.4-allow-gcc-4.0-powerpc32.patch
new file mode 100644
index 0000000..949a203
--- /dev/null
+++ b/patches/glibc/2.3.3/glibc-2.3.4-allow-gcc-4.0-powerpc32.patch
@@ -0,0 +1,42 @@
+Fixes
+
+../sysdeps/powerpc/powerpc32/dl-machine.h: In function '_dl_relocate_object':
+../sysdeps/powerpc/powerpc32/dl-machine.h:461: error: invalid storage class for function 'elf_machine_rela_relative'
+../sysdeps/powerpc/powerpc32/dl-machine.h:469: error: invalid storage class for function 'elf_machine_lazy_rel'
+make[2]: *** [/home/dank/queue/jobdir.dual2/crosstool-dev/build/powerpc-750-linux-gnu/gcc-4.0-20050305-glibc-2.3-20050307/build-glibc/elf/dl-reloc.o] Error 1
+
+diff -ur glibc-2.3-20050307.orig/sysdeps/powerpc/powerpc32/dl-machine.h glibc-2.3-20050307/sysdeps/powerpc/powerpc32/dl-machine.h
+--- glibc-2.3-20050307.orig/sysdeps/powerpc/powerpc32/dl-machine.h Wed Jul 30 23:33:52 2003
++++ glibc-2.3-20050307/sysdeps/powerpc/powerpc32/dl-machine.h Thu Mar 17 13:19:16 2005
+@@ -455,7 +455,14 @@
+ }
+ }
+
+-static inline void
++#if __GNUC__ >= 4
++ auto inline void
++#else
++ static inline void
++#endif
++#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
++ __attribute ((always_inline))
++#endif
+ elf_machine_rela_relative (Elf32_Addr l_addr, const Elf32_Rela *reloc,
+ void *const reloc_addr_arg)
+ {
+@@ -463,7 +470,14 @@
+ *reloc_addr = l_addr + reloc->r_addend;
+ }
+
+-static inline void
++#if __GNUC__ >= 4
++ auto inline void
++#else
++ static inline void
++#endif
++#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
++ __attribute ((always_inline))
++#endif
+ elf_machine_lazy_rel (struct link_map *map,
+ Elf32_Addr l_addr, const Elf32_Rela *reloc)
+ {
diff --git a/patches/glibc/2.3.3/glibc-2.3.4-allow-gcc-4.0-powerpc64.patch b/patches/glibc/2.3.3/glibc-2.3.4-allow-gcc-4.0-powerpc64.patch
new file mode 100644
index 0000000..6844a9c
--- /dev/null
+++ b/patches/glibc/2.3.3/glibc-2.3.4-allow-gcc-4.0-powerpc64.patch
@@ -0,0 +1,60 @@
+Fixes:
+
+In file included from dynamic-link.h:22,
+ from dl-reloc.c:269:
+../sysdeps/powerpc/powerpc64/dl-machine.h: In function '_dl_relocate_object':
+../sysdeps/powerpc/powerpc64/dl-machine.h:573: error: invalid storage class for function 'elf_machine_rela_relative'
+../sysdeps/powerpc/powerpc64/dl-machine.h:607: error: invalid storage class for function 'elf_machine_rela'
+../sysdeps/powerpc/powerpc64/dl-machine.h:889: error: invalid storage class for function 'elf_machine_lazy_rel'
+make[2]: Leaving directory `/home/dank/queue/jobdir.fast2/crosstool-dev/build/powerpc64-unknown-linux-gnu/gcc-4.0-20050305-glibc-2.3-20050307/glibc-2.3-20050307/elf'
+
+--- glibc-2.3-20050307/sysdeps/powerpc/powerpc64/dl-machine.h.old Thu Mar 17 13:35:23 2005
++++ glibc-2.3-20050307/sysdeps/powerpc/powerpc64/dl-machine.h Thu Mar 17 13:37:12 2005
+@@ -567,7 +567,14 @@
+ const Elf64_Sym *refsym)
+ attribute_hidden;
+
+-static inline void
++#if __GNUC__ >= 4
++ auto inline void
++#else
++ static inline void
++#endif
++#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
++ __attribute ((always_inline))
++#endif
+ elf_machine_rela_relative (Elf64_Addr l_addr, const Elf64_Rela *reloc,
+ void *const reloc_addr_arg)
+ {
+@@ -598,7 +605,14 @@
+
+ /* Perform the relocation specified by RELOC and SYM (which is fully
+ resolved). MAP is the object containing the reloc. */
+-static inline void
++#if __GNUC__ >= 4
++ auto inline void
++#else
++ static inline void
++#endif
++#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
++ __attribute ((always_inline))
++#endif
+ elf_machine_rela (struct link_map *map,
+ const Elf64_Rela *reloc,
+ const Elf64_Sym *sym,
+@@ -883,7 +897,14 @@
+ MODIFIED_CODE_NOQUEUE (reloc_addr);
+ }
+
+-static inline void
++#if __GNUC__ >= 4
++ auto inline void
++#else
++ static inline void
++#endif
++#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
++ __attribute ((always_inline))
++#endif
+ elf_machine_lazy_rel (struct link_map *map,
+ Elf64_Addr l_addr, const Elf64_Rela *reloc)
+ {
diff --git a/patches/glibc/2.3.3/glibc-configure-apple-as.patch b/patches/glibc/2.3.3/glibc-configure-apple-as.patch
new file mode 100644
index 0000000..604c36d
--- /dev/null
+++ b/patches/glibc/2.3.3/glibc-configure-apple-as.patch
@@ -0,0 +1,23 @@
+http://in3www.epfl.ch/~schaffne/glibc-configure-apple-as.patch
+http://sources.redhat.com/ml/crossgcc/2004-02/msg00151.html
+
+The following makes it possible to configure glibc-2.3.2 on Mac OS X,
+where the assembler but doesn't understand the --version flag.
+
+Fixes the symptom
+checking whether ld is GNU ld... no
+checking for /usr/libexec/gcc/darwin/ppc/as... /usr/libexec/gcc/darwin/ppc/as
+checking version of /usr/libexec/gcc/darwin/ppc/as...
+<PAUSES HERE AND JUST SITS THERE DOING NOTHING>
+
+--- glibc-2.3.2/configure~ Wed Feb 26 09:20:48 2003
++++ glibc-2.3.2/configure Fri Feb 27 13:12:53 2004
+@@ -3789,7 +3789,7 @@
+ # Found it, now check the version.
+ echo "$as_me:$LINENO: checking version of $AS" >&5
+ echo $ECHO_N "checking version of $AS... $ECHO_C" >&6
+- ac_prog_version=`$AS --version 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
++ ac_prog_version=`$AS -v </dev/null 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
+ case $ac_prog_version in
+ '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
+ 2.1[3-9]*)
diff --git a/patches/glibc/2.3.3/glibc-fp-byteorder.patch b/patches/glibc/2.3.3/glibc-fp-byteorder.patch
new file mode 100644
index 0000000..f20432e
--- /dev/null
+++ b/patches/glibc/2.3.3/glibc-fp-byteorder.patch
@@ -0,0 +1,203 @@
+Taken from http://sources.redhat.com/ml/crossgcc/2004-02/msg00104.html
+Author: addsub@eyou.com
+Target: ARM
+
+Fixes http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/execute/920501-8.c
+and makes printf("%f", 1.0) work.
+
+Lennert Buytenhek wrote in http://sources.redhat.com/ml/crossgcc/2004-09/msg00115.html :
+ It ... fixes the 'printf("%f\n", 0.5); prints 0.000000' and general 'floating point
+ is broken' on my big-endian hardfloat FPA ARM platform. ...
+ It's definitely needed for hardfloat. So I'd think it's needed for
+ big-endian systems in any case, and for VFP on little-endian systems
+ too. Someone would have to verify that though.
+
+Lennert Buytenhek wrote in http://sources.redhat.com/ml/crossgcc/2004-09/msg00123.html
+ I just had a look at glibc-20040830, and [this patch] is still needed and useful
+ for this version. glibc-20040830 out-of-the-box still contains the
+ following wrong assumptions:
+ - sysdeps/arm/bits/endian.h: float word order is big endian (which it is
+ not on vfp systems)
+ - sysdeps/arm/gmp-mparam.h: IEEE doubles are mixed endian (which they
+ are not on big endian systems, neither on vfp systems)
+ - sysdeps/arm/ieee754.h: IEEE doubles are in little endian byte order
+ (which they are not on big endian systems)
+ [This patch] seems the right solution for all of these issues.
+
+Dimitry Andric wrote in http://sources.redhat.com/ml/crossgcc/2004-09/msg00132.html :
+ It's even needed for glibc CVS, AFAICS.
+ The patch hunk which modifies glibc.new/sysdeps/arm/bits/endian.h
+ (currently at version 1.4) is only needed for proper VFP operation.
+ But the hunk which modifies sysdeps/arm/gmp-mparam.h, and the hunk
+ that deletes sysdeps/arm/ieee754.h (yes, this IS correct), are needed
+ for proper operation of *any* FP model on big endian ARM.
+
+See also discussion in followups to
+http://sources.redhat.com/ml/crossgcc/2004-05/msg00245.html)
+
+Message-ID: <276985760.37584@eyou.com>
+Received: from unknown (HELO eyou.com) (172.16.2.2)
+ by 0.0.0.0 with SMTP; Tue, 17 Feb 2004 10:42:40 +0800
+Received: (qmail 8238 invoked by uid 65534); 17 Feb 2004 10:42:38 +0800
+Date: 17 Feb 2004 10:42:38 +0800
+Message-ID: <20040217104238.8237.qmail@eyou.com>
+From: "add" <addsub@eyou.com>
+To: dank@kegel.com
+Reply-To: "add" <addsub@eyou.com>
+Subject: Re:&nbsp;&nbsp;&nbsp;problem&nbsp;while&nbsp;building&nbsp;arm&nbsp;vfp&nbsp;softfloat&nbsp;gcc&nbsp;`
+
+Hi, Dan, This is a patch I applied to my glibc-2.3.2, then my softfloat
+toolchain can printf("%f\n",1.0). So you may have a try of this
+
+
+diff -uNrp glibc.old/sysdeps/arm/bits/endian.h glibc.new/sysdeps/arm/bits/endian.h
+--- glibc.old/sysdeps/arm/bits/endian.h 1999-04-12 11:59:13.000000000 -0400
++++ glibc.new/sysdeps/arm/bits/endian.h 2004-02-12 09:15:13.000000000 -0500
+@@ -9,4 +9,9 @@
+ #else
+ #define __BYTE_ORDER __LITTLE_ENDIAN
+ #endif
++
++#ifdef __VFP_FP__
++#define __FLOAT_WORD_ORDER __BYTE_ORDER
++#else
+ #define __FLOAT_WORD_ORDER __BIG_ENDIAN
++#endif
+diff -uNrp glibc.old/sysdeps/arm/gmp-mparam.h glibc.new/sysdeps/arm/gmp-mparam.h
+--- glibc.old/sysdeps/arm/gmp-mparam.h 2001-07-07 15:21:19.000000000 -0400
++++ glibc.new/sysdeps/arm/gmp-mparam.h 2004-02-12 09:15:13.000000000 -0500
+@@ -26,5 +26,13 @@ MA 02111-1307, USA. */
+ #define BITS_PER_SHORTINT 16
+ #define BITS_PER_CHAR 8
+
+-#define IEEE_DOUBLE_BIG_ENDIAN 0
+-#define IEEE_DOUBLE_MIXED_ENDIAN 1
++#if defined(__ARMEB__)
++# define IEEE_DOUBLE_MIXED_ENDIAN 0
++# define IEEE_DOUBLE_BIG_ENDIAN 1
++#elif defined(__VFP_FP__)
++# define IEEE_DOUBLE_MIXED_ENDIAN 0
++# define IEEE_DOUBLE_BIG_ENDIAN 0
++#else
++# define IEEE_DOUBLE_BIG_ENDIAN 0
++# define IEEE_DOUBLE_MIXED_ENDIAN 1
++#endif
+diff -uNrp glibc.old/sysdeps/arm/ieee754.h glibc.new/sysdeps/arm/ieee754.h
+--- glibc.old/sysdeps/arm/ieee754.h 2001-07-07 15:21:19.000000000 -0400
++++ glibc.new/sysdeps/arm/ieee754.h 1969-12-31 19:00:00.000000000 -0500
+@@ -1,115 +0,0 @@
+-/* Copyright (C) 1992, 1995, 1996, 1998 Free Software Foundation, Inc.
+- This file is part of the GNU C Library.
+-
+- The GNU C Library is free software; you can redistribute it and/or
+- modify it under the terms of the GNU Lesser General Public
+- License as published by the Free Software Foundation; either
+- version 2.1 of the License, or (at your option) any later version.
+-
+- The GNU C Library is distributed in the hope that it will be useful,
+- but WITHOUT ANY WARRANTY; without even the implied warranty of
+- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+- Lesser General Public License for more details.
+-
+- You should have received a copy of the GNU Lesser General Public
+- License along with the GNU C Library; if not, write to the Free
+- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+- 02111-1307 USA. */
+-
+-#ifndef _IEEE754_H
+-
+-#define _IEEE754_H 1
+-#include <features.h>
+-
+-#include <endian.h>
+-
+-__BEGIN_DECLS
+-
+-union ieee754_float
+- {
+- float f;
+-
+- /* This is the IEEE 754 single-precision format. */
+- struct
+- {
+- unsigned int mantissa:23;
+- unsigned int exponent:8;
+- unsigned int negative:1;
+- } ieee;
+-
+- /* This format makes it easier to see if a NaN is a signalling NaN. */
+- struct
+- {
+- unsigned int mantissa:22;
+- unsigned int quiet_nan:1;
+- unsigned int exponent:8;
+- unsigned int negative:1;
+- } ieee_nan;
+- };
+-
+-#define IEEE754_FLOAT_BIAS 0x7f /* Added to exponent. */
+-
+-
+-union ieee754_double
+- {
+- double d;
+-
+- /* This is the IEEE 754 double-precision format. */
+- struct
+- {
+- unsigned int mantissa0:20;
+- unsigned int exponent:11;
+- unsigned int negative:1;
+- unsigned int mantissa1:32;
+- } ieee;
+-
+- /* This format makes it easier to see if a NaN is a signalling NaN. */
+- struct
+- {
+- unsigned int mantissa0:19;
+- unsigned int quiet_nan:1;
+- unsigned int exponent:11;
+- unsigned int negative:1;
+- unsigned int mantissa1:32;
+- } ieee_nan;
+- };
+-
+-#define IEEE754_DOUBLE_BIAS 0x3ff /* Added to exponent. */
+-
+-
+-/* The following two structures are correct for `new' floating point systems but
+- wrong for the old FPPC. The only solution seems to be to avoid their use on
+- old hardware. */
+-
+-union ieee854_long_double
+- {
+- long double d;
+-
+- /* This is the IEEE 854 double-extended-precision format. */
+- struct
+- {
+- unsigned int exponent:15;
+- unsigned int empty:16;
+- unsigned int negative:1;
+- unsigned int mantissa1:32;
+- unsigned int mantissa0:32;
+- } ieee;
+-
+- /* This is for NaNs in the IEEE 854 double-extended-precision format. */
+- struct
+- {
+- unsigned int exponent:15;
+- unsigned int empty:16;
+- unsigned int negative:1;
+- unsigned int mantissa1:32;
+- unsigned int mantissa0:30;
+- unsigned int quiet_nan:1;
+- unsigned int one:1;
+- } ieee_nan;
+- };
+-
+-#define IEEE854_LONG_DOUBLE_BIAS 0x3fff
+-
+-__END_DECLS
+-
+-#endif /* ieee754.h */