Index: BOOK/introduction/common/changelog.xml
===================================================================
--- BOOK/introduction/common/changelog.xml	(revision 477d8bb2ad0ea3c81b6894753870b0ca92c74757)
+++ BOOK/introduction/common/changelog.xml	(revision bfb94b23cbeefc6473fe019454031982abb60d03)
@@ -42,4 +42,7 @@
         <listitem>
           <para>[jim] - Updated the bootscripts to 1.1-pre7.</para>
+        </listitem>
+        <listitem>
+          <para>[jim] - Updated to Glibc 2.7.</para>
         </listitem>
       </itemizedlist>
Index: BOOK/packages.ent
===================================================================
--- BOOK/packages.ent	(revision 477d8bb2ad0ea3c81b6894753870b0ca92c74757)
+++ BOOK/packages.ent	(revision bfb94b23cbeefc6473fe019454031982abb60d03)
@@ -158,15 +158,15 @@
 <!ENTITY gettext-home "&gnu-software;gettext">
 
-<!ENTITY glibc-version "2.6.1">
-<!ENTITY glibc-size "20,488 KB">
+<!ENTITY glibc-version "2.7">
+<!ENTITY glibc-size "15624 KB">
 <!ENTITY glibc-url "&gnu;glibc/glibc-&glibc-version;.tar.bz2">
-<!ENTITY glibc-md5 "11cf6d3fc86dbe0890b8d00372eb6286">
+<!ENTITY glibc-md5 "065c5952b439deba40083ccd67bcc8f7">
 <!ENTITY glibc-home "&gnu-software;libc">
 <!ENTITY glibc-ld-name "ld-&glibc-version;.so">
 
 <!ENTITY glibc-ports-version "&glibc-version;">
-<!ENTITY glibc-ports-size "428 KB">
+<!ENTITY glibc-ports-size "432 KB">
 <!ENTITY glibc-ports-url "&gnu;glibc/glibc-ports-&glibc-ports-version;.tar.bz2">
-<!ENTITY glibc-ports-md5 "53d88ca624642dd267752ccce77b19d0">
+<!ENTITY glibc-ports-md5 "eaeb8527b8fa286c2d887157214f9998">
 <!ENTITY glibc-ports-home " ">
 
Index: BOOK/patches.ent
===================================================================
--- BOOK/patches.ent	(revision 477d8bb2ad0ea3c81b6894753870b0ca92c74757)
+++ BOOK/patches.ent	(revision bfb94b23cbeefc6473fe019454031982abb60d03)
@@ -46,10 +46,10 @@
 
 <!ENTITY glibc-libgcc_eh-patch "glibc-&glibc-version;-libgcc_eh-1.patch">
-<!ENTITY glibc-libgcc_eh-patch-md5 "9488f9caf4e05fc9d1128b203c7a0680">
+<!ENTITY glibc-libgcc_eh-patch-md5 "f868605171066a0d8f572314feea415c">
 <!ENTITY glibc-libgcc_eh-patch-size "8 KB">
 
 <!ENTITY glibc-localedef_segfault-patch "glibc-&glibc-version;-localedef_segfault-1.patch">
 <!ENTITY glibc-localedef_segfault-patch-md5 "3ce6946b16e90a73d90ac701a5940709">
-<!ENTITY glibc-localedef_segfault-patch-size "1.9 KB">
+<!ENTITY glibc-localedef_segfault-patch-size "4 KB">
 
 <!ENTITY mktemp-tempfile-patch "mktemp-&mktemp-version;-add_tempfile-3.patch">
Index: tches/glibc-2.6.1-alpha_ioperm_fix-1.patch
===================================================================
--- patches/glibc-2.6.1-alpha_ioperm_fix-1.patch	(revision 477d8bb2ad0ea3c81b6894753870b0ca92c74757)
+++ 	(revision )
@@ -1,46 +1,0 @@
-Submitted By: Joe Ciccone <jciccone@linuxfromscratch.org>
-Date: 2007-05-19
-Initial Package Version: 2.6
-Origin: Joe Ciccone
-Upstream Status: Unknown
-Description: Fixes a build issue with alpha on some processors. The
-             instructions being modified are specific to ev56/ev6.
-
-diff -Naur glibc-2.6.orig/sysdeps/unix/sysv/linux/alpha/ioperm.c glibc-2.6/sysdeps/unix/sysv/linux/alpha/ioperm.c
---- glibc-2.6.orig/sysdeps/unix/sysv/linux/alpha/ioperm.c	2007-05-07 15:57:20.000000000 -0700
-+++ glibc-2.6/sysdeps/unix/sysv/linux/alpha/ioperm.c	2007-05-19 13:29:49.000000000 -0700
-@@ -178,13 +178,13 @@
- static inline void
- stb_mb(unsigned char val, unsigned long addr)
- {
--  __asm__("stb %1,%0; mb" : "=m"(*(vucp)addr) : "r"(val));
-+  __asm__(".arch ev6; stb %1,%0; mb" : "=m"(*(vucp)addr) : "r"(val));
- }
- 
- static inline void
- stw_mb(unsigned short val, unsigned long addr)
- {
--  __asm__("stw %1,%0; mb" : "=m"(*(vusp)addr) : "r"(val));
-+  __asm__(".arch ev6; stw %1,%0; mb" : "=m"(*(vusp)addr) : "r"(val));
- }
- 
- static inline void
-@@ -356,7 +356,7 @@
-   unsigned long int addr = dense_port_to_cpu_addr (port);
-   unsigned char r;
- 
--  __asm__ ("ldbu %0,%1" : "=r"(r) : "m"(*(vucp)addr));
-+  __asm__ (".arch ev6; ldbu %0,%1" : "=r"(r) : "m"(*(vucp)addr));
-   return r;
- }
- 
-@@ -366,7 +366,7 @@
-   unsigned long int addr = dense_port_to_cpu_addr (port);
-   unsigned short r;
- 
--  __asm__ ("ldwu %0,%1" : "=r"(r) : "m"(*(vusp)addr));
-+  __asm__ (".arch ev6; ldwu %0,%1" : "=r"(r) : "m"(*(vusp)addr));
-   return r;
- }
- 
- 
Index: tches/glibc-2.6.1-libgcc_eh-1.patch
===================================================================
--- patches/glibc-2.6.1-libgcc_eh-1.patch	(revision 477d8bb2ad0ea3c81b6894753870b0ca92c74757)
+++ 	(revision )
@@ -1,125 +1,0 @@
-Submitted By: Joe Ciccone <jciccone@linuxfromscratch.org>
-Date: 2006-11-09
-Initial Package Version: 2.5
-Origin: Joe Ciccone
-Upstream Status: Unknown
-Description: Checks to see if libgcc_eh has been provided by gcc. If it has
-             the glibc will attempt to link to it.
-
-diff -Naur glibc-2.6.orig/config.make.in glibc-2.6/config.make.in
---- glibc-2.6.orig/config.make.in	2007-06-23 21:26:46.000000000 -0400
-+++ glibc-2.6/config.make.in	2007-06-23 21:27:16.000000000 -0400
-@@ -59,6 +59,7 @@
- have-libaudit = @have_libaudit@
- have-libcap = @have_libcap@
- have-cc-with-libunwind = @libc_cv_cc_with_libunwind@
-+have-cc-with-libgcc_eh = @libc_cv_cc_with_libgcc_eh@
- fno-unit-at-a-time = @fno_unit_at_a_time@
- bind-now = @bindnow@
- have-hash-style = @libc_cv_hashstyle@
-diff -Naur glibc-2.6.orig/configure.in glibc-2.6/configure.in
---- glibc-2.6.orig/configure.in	2007-06-23 21:26:48.000000000 -0400
-+++ glibc-2.6/configure.in	2007-06-23 21:27:16.000000000 -0400
-@@ -1388,6 +1388,23 @@
-     AC_DEFINE(HAVE_CC_WITH_LIBUNWIND)
-   fi
- 
-+  AC_CACHE_CHECK(whether to link against libgcc_eh,
-+                 libc_cv_cc_with_libgcc_eh, [
-+    cat > conftest.c <<EOF
-+int main (void) { return 0; }
-+EOF
-+    if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -static -o conftest \
-+       conftest.c -v 2>&1 >/dev/null | grep -q " -lgcc_eh "; then
-+      libc_cv_cc_with_libgcc_eh=yes
-+    else
-+      libc_cv_cc_with_libgcc_eh=no
-+    fi
-+    rm -f conftest*])
-+  AC_SUBST(libc_cv_cc_with_libgcc_eh)
-+  if test $libc_cv_cc_with_libgcc_eh = yes; then
-+    AC_DEFINE(HAVE_CC_WITH_LIBGCC_EH)
-+  fi
-+
-   AC_CACHE_CHECK(for -z nodelete option,
- 		 libc_cv_z_nodelete, [dnl
-   cat > conftest.c <<EOF
-diff -Naur glibc-2.6.orig/Makeconfig glibc-2.6/Makeconfig
---- glibc-2.6.orig/Makeconfig	2007-06-23 21:26:49.000000000 -0400
-+++ glibc-2.6/Makeconfig	2007-06-23 21:27:16.000000000 -0400
-@@ -524,12 +524,20 @@
-   libunwind = -lunwind
- endif
- ifneq ($(have-as-needed),yes)
-+ifneq ($(have-cc-with-libgcc_eh),yes)
-+ libgcc_eh := $(libunwind)
-+else
-  libgcc_eh := -lgcc_eh $(libunwind)
-+endif
- else
-  libgcc_eh := -Wl,--as-needed -lgcc_s$(libgcc_s_suffix) $(libunwind) -Wl,--no-as-needed
- endif
- gnulib := -lgcc $(libgcc_eh)
--static-gnulib := -lgcc -lgcc_eh $(libunwind)
-+ifneq ($(have-cc-with-libgcc_eh),yes)
-+ static-gnulib := -lgcc $(libunwind)
-+else
-+ static-gnulib := -lgcc -lgcc_eh $(libunwind)
-+endif
- libc.so-gnulib := -lgcc
- endif
- ifeq ($(elf),yes)
-diff -Naur glibc-2.6.orig/configure glibc-2.6/configure
---- glibc-2.6.orig/configure	2007-06-23 21:26:49.000000000 -0400
-+++ glibc-2.6/configure	2007-06-23 21:29:47.000000000 -0400
-@@ -313,7 +313,7 @@
- # include <unistd.h>
- #endif"
- 
--ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS with_fp with_cvs enable_check_abi oldest_abi bindnow force_install all_warnings build build_cpu build_vendor build_os host host_cpu host_vendor host_os subdirs add_ons add_on_subdirs base_machine submachine sysnames sysdeps_add_ons INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC OBJEXT BUILD_CC cross_compiling CPP CXX CXXFLAGS ac_ct_CXX AR OBJDUMP RANLIB ac_ct_RANLIB MIG AS LD PWD_P MAKE MSGFMT MAKEINFO SED AUTOCONF SYSINCLUDES CXX_SYSINCLUDES libc_cv_gcc_static_libgcc BASH libc_cv_have_bash2 KSH libc_cv_have_ksh AWK PERL INSTALL_INFO BISON VERSIONING libc_cv_cc_with_libunwind libc_cv_Bgroup libc_cv_libgcc_s_suffix libc_cv_as_needed ASFLAGS_config libc_cv_z_combreloc libc_cv_z_execstack libc_cv_fpie libc_cv_hashstyle fno_unit_at_a_time libc_cv_ssp libc_cv_gnu89_inline libc_cv_have_initfini no_whole_archive exceptions LIBGD have_libaudit have_libcap have_selinux EGREP sizeof_long_double libc_cv_gcc_unwind_find_fde uname_sysname uname_release uname_version old_glibc_headers libc_cv_slibdir libc_cv_localedir libc_cv_sysconfdir libc_cv_rootsbindir libc_cv_forced_unwind use_ldconfig ldd_rewrite_script elf xcoff static shared pic_default profile omitfp bounded static_nss nopic_initfini DEFINES mach_interface_list VERSION RELEASE LIBOBJS LTLIBOBJS'
-+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS with_fp with_cvs enable_check_abi oldest_abi bindnow force_install all_warnings build build_cpu build_vendor build_os host host_cpu host_vendor host_os subdirs add_ons add_on_subdirs base_machine submachine sysnames sysdeps_add_ons INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC OBJEXT BUILD_CC cross_compiling CPP CXX CXXFLAGS ac_ct_CXX AR OBJDUMP RANLIB ac_ct_RANLIB MIG AS LD PWD_P MAKE MSGFMT MAKEINFO SED AUTOCONF SYSINCLUDES CXX_SYSINCLUDES libc_cv_gcc_static_libgcc BASH libc_cv_have_bash2 KSH libc_cv_have_ksh AWK PERL INSTALL_INFO BISON VERSIONING libc_cv_cc_with_libunwind libc_cv_cc_with_libgcc_eh libc_cv_Bgroup libc_cv_libgcc_s_suffix libc_cv_as_needed ASFLAGS_config libc_cv_z_combreloc libc_cv_z_execstack libc_cv_fpie libc_cv_hashstyle fno_unit_at_a_time libc_cv_ssp libc_cv_gnu89_inline libc_cv_have_initfini no_whole_archive exceptions LIBGD have_libaudit have_libcap have_selinux EGREP sizeof_long_double libc_cv_gcc_unwind_find_fde uname_sysname uname_release uname_version old_glibc_headers libc_cv_slibdir libc_cv_localedir libc_cv_sysconfdir libc_cv_rootsbindir libc_cv_forced_unwind use_ldconfig ldd_rewrite_script elf xcoff static shared pic_default profile omitfp bounded static_nss nopic_initfini DEFINES mach_interface_list VERSION RELEASE LIBOBJS LTLIBOBJS'
- ac_subst_files=''
- 
- # Initialize some variables set by options.
-@@ -5542,6 +5542,33 @@
- 
-   fi
- 
-+  { echo "$as_me:$LINENO: checking whether to link against libgcc_eh" >&5
-+echo $ECHO_N "checking whether to link against libgcc_eh... $ECHO_C" >&6; }
-+if test "${libc_cv_cc_with_libgcc_eh+set}" = set; then
-+  echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+
-+    cat > conftest.c <<EOF
-+int main (void) { return 0; }
-+EOF
-+    if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -static -o conftest \
-+       conftest.c -v 2>&1 >/dev/null | grep -q " -lgcc_eh "; then
-+      libc_cv_cc_with_libgcc_eh=yes
-+    else
-+      libc_cv_cc_with_libgcc_eh=no
-+    fi
-+    rm -f conftest*
-+fi
-+{ echo "$as_me:$LINENO: result: $libc_cv_cc_with_libgcc_eh" >&5
-+echo "${ECHO_T}$libc_cv_cc_with_libgcc_eh" >&6; }
-+
-+  if test $libc_cv_cc_with_libgcc_eh = yes; then
-+    cat >>confdefs.h <<\_ACEOF
-+#define HAVE_CC_WITH_LIBGCC_EH 1
-+_ACEOF
-+
-+  fi
-+
-   echo "$as_me:$LINENO: checking for -z nodelete option" >&5
- echo $ECHO_N "checking for -z nodelete option... $ECHO_C" >&6
- if test "${libc_cv_z_nodelete+set}" = set; then
-@@ -8543,6 +8570,7 @@
- s,@BISON@,$BISON,;t t
- s,@VERSIONING@,$VERSIONING,;t t
- s,@libc_cv_cc_with_libunwind@,$libc_cv_cc_with_libunwind,;t t
-+s,@libc_cv_cc_with_libgcc_eh@,$libc_cv_cc_with_libgcc_eh,;t t
- s,@libc_cv_Bgroup@,$libc_cv_Bgroup,;t t
- s,@libc_cv_libgcc_s_suffix@,$libc_cv_libgcc_s_suffix,;t t
- s,@libc_cv_as_needed@,$libc_cv_as_needed,;t t
Index: tches/glibc-2.6.1-localedef_segfault-1.patch
===================================================================
--- patches/glibc-2.6.1-localedef_segfault-1.patch	(revision 477d8bb2ad0ea3c81b6894753870b0ca92c74757)
+++ 	(revision )
@@ -1,56 +1,0 @@
-Submitted By: Jim Gifford (patches at jg555 dot com)
-Date: 2007-05-19
-Initial Package Version: 2.6
-Origin: Debian
-Upstream Status: Unknown
-Description: Fixes Segfault when using localdef.
-             This problem is only noticed when using PaX
-             and some architectures besides x86.
-	     See debian bug # 231438
-
-diff -Naur glibc-2.6.orig/locale/programs/3level.h glibc-2.6/locale/programs/3level.h
---- glibc-2.6.orig/locale/programs/3level.h	2005-12-06 21:47:27.000000000 -0800
-+++ glibc-2.6/locale/programs/3level.h	2007-05-19 13:38:01.000000000 -0700
-@@ -202,6 +202,42 @@
- 	}
-     }
- }
-+
-+/* GCC ATM seems to do a poor job with pointers to nested functions passed
-+   to inlined functions.  Help it a little bit with this hack.  */
-+#define wchead_table_iterate(tp, fn) \
-+do									      \
-+  {									      \
-+    struct wchead_table *t = (tp);					      \
-+    uint32_t index1;							      \
-+    for (index1 = 0; index1 < t->level1_size; index1++)			      \
-+      {									      \
-+	uint32_t lookup1 = t->level1[index1];				      \
-+	if (lookup1 != ((uint32_t) ~0))					      \
-+	  {								      \
-+	    uint32_t lookup1_shifted = lookup1 << t->q;			      \
-+	    uint32_t index2;						      \
-+	    for (index2 = 0; index2 < (1 << t->q); index2++)		      \
-+	      {								      \
-+		uint32_t lookup2 = t->level2[index2 + lookup1_shifted];	      \
-+		if (lookup2 != ((uint32_t) ~0))				      \
-+		  {							      \
-+		    uint32_t lookup2_shifted = lookup2 << t->p;		      \
-+		    uint32_t index3;					      \
-+		    for (index3 = 0; index3 < (1 << t->p); index3++)	      \
-+		      {							      \
-+			struct element_t *lookup3			      \
-+			  = t->level3[index3 + lookup2_shifted];	      \
-+			if (lookup3 != NULL)				      \
-+			  fn ((((index1 << t->q) + index2) << t->p) + index3, \
-+			      lookup3);					      \
-+		      }							      \
-+		  }							      \
-+	      }								      \
-+	  }								      \
-+      }									      \
-+  } while (0)
-+
- #endif
- 
- #ifndef NO_FINALIZE
Index: tches/glibc-2.6.1-mawk_fix-1.patch
===================================================================
--- patches/glibc-2.6.1-mawk_fix-1.patch	(revision 477d8bb2ad0ea3c81b6894753870b0ca92c74757)
+++ 	(revision )
@@ -1,39 +1,0 @@
-Submitted By: Mark Vels <mark.vels@fundem.net>
-Date: 2007-07-20
-Initial Package Version: 2.6
-Origin: original patch glibc-2.6-mawk_fix-1.patch by Jim Gifford <jim@linuxfromscratch.org>
-Upstream Status: Not submitted
-Description: Fixes build if host distro is using mawk.
-	     Distro's known to have this issue are Debian 
-	     and Ubuntu
-
-	     Changes wrt version 1: added two more cases.
-
-diff -Naur glibc-2.6.orig/scripts/gen-sorted.awk glibc-2.6/scripts/gen-sorted.awk
---- glibc-2.6.orig/scripts/gen-sorted.awk	2006-02-28 07:05:57.000000000 +0000
-+++ glibc-2.6/scripts/gen-sorted.awk	2007-07-20 21:03:50.000000000 +0000
-@@ -16,7 +16,7 @@
- {
-   subdir = type = FILENAME;
-   sub(/^.*\//, "", type);
--  sub(/\/[^/]+$/, "", subdir);
-+  sub(/\/[^\/]+$/, "", subdir);
-   sub(/^.*\//, "", subdir);
-   thisdir = "";
- }
-@@ -56,13 +56,13 @@
-     # The Subdirs file comes from an add-on that should have the subdirectory.
-     dir = FILENAME;
-     do
--      sub(/\/[^/]+$/, "", dir);
-+      sub(/\/[^\/]+$/, "", dir);
-     while (dir !~ /\/sysdeps$/);
-     sub(/\/sysdeps$/, "", dir);
-     if (system("test -d " dir "/" thisdir) == 0)
-       dir = dir "/" thisdir;
-     else {
--      sub(/\/[^/]+$/, "", dir);
-+      sub(/\/[^\/]+$/, "", dir);
-       if (system("test -d " dir "/" thisdir) == 0)
-         dir = dir "/" thisdir;
-       else {
Index: patches/glibc-2.7-alpha_ioperm_fix-1.patch
===================================================================
--- patches/glibc-2.7-alpha_ioperm_fix-1.patch	(revision bfb94b23cbeefc6473fe019454031982abb60d03)
+++ patches/glibc-2.7-alpha_ioperm_fix-1.patch	(revision bfb94b23cbeefc6473fe019454031982abb60d03)
@@ -0,0 +1,46 @@
+Submitted By: Joe Ciccone <jciccone@linuxfromscratch.org>
+Date: 2007-05-19
+Initial Package Version: 2.6
+Origin: Joe Ciccone
+Upstream Status: Unknown
+Description: Fixes a build issue with alpha on some processors. The
+             instructions being modified are specific to ev56/ev6.
+
+diff -Naur glibc-2.6.orig/sysdeps/unix/sysv/linux/alpha/ioperm.c glibc-2.6/sysdeps/unix/sysv/linux/alpha/ioperm.c
+--- glibc-2.6.orig/sysdeps/unix/sysv/linux/alpha/ioperm.c	2007-05-07 15:57:20.000000000 -0700
++++ glibc-2.6/sysdeps/unix/sysv/linux/alpha/ioperm.c	2007-05-19 13:29:49.000000000 -0700
+@@ -178,13 +178,13 @@
+ static inline void
+ stb_mb(unsigned char val, unsigned long addr)
+ {
+-  __asm__("stb %1,%0; mb" : "=m"(*(vucp)addr) : "r"(val));
++  __asm__(".arch ev6; stb %1,%0; mb" : "=m"(*(vucp)addr) : "r"(val));
+ }
+ 
+ static inline void
+ stw_mb(unsigned short val, unsigned long addr)
+ {
+-  __asm__("stw %1,%0; mb" : "=m"(*(vusp)addr) : "r"(val));
++  __asm__(".arch ev6; stw %1,%0; mb" : "=m"(*(vusp)addr) : "r"(val));
+ }
+ 
+ static inline void
+@@ -356,7 +356,7 @@
+   unsigned long int addr = dense_port_to_cpu_addr (port);
+   unsigned char r;
+ 
+-  __asm__ ("ldbu %0,%1" : "=r"(r) : "m"(*(vucp)addr));
++  __asm__ (".arch ev6; ldbu %0,%1" : "=r"(r) : "m"(*(vucp)addr));
+   return r;
+ }
+ 
+@@ -366,7 +366,7 @@
+   unsigned long int addr = dense_port_to_cpu_addr (port);
+   unsigned short r;
+ 
+-  __asm__ ("ldwu %0,%1" : "=r"(r) : "m"(*(vusp)addr));
++  __asm__ (".arch ev6; ldwu %0,%1" : "=r"(r) : "m"(*(vusp)addr));
+   return r;
+ }
+ 
+ 
Index: patches/glibc-2.7-libgcc_eh-1.patch
===================================================================
--- patches/glibc-2.7-libgcc_eh-1.patch	(revision bfb94b23cbeefc6473fe019454031982abb60d03)
+++ patches/glibc-2.7-libgcc_eh-1.patch	(revision bfb94b23cbeefc6473fe019454031982abb60d03)
@@ -0,0 +1,136 @@
+Submitted By: Joe Ciccone <jciccone@linuxfromscratch.org>
+Date: 2006-11-09
+Initial Package Version: 2.5
+Origin: Joe Ciccone
+Upstream Status: Unknown
+Description: Checks to see if libgcc_eh has been provided by gcc. If it has
+             the glibc will attempt to link to it.
+
+	     Rediffed for 2.7 by Jim Gifford
+
+diff -Naur glibc-2.7.orig/Makeconfig glibc-2.7/Makeconfig
+--- glibc-2.7.orig/Makeconfig	2007-07-05 15:03:47.000000000 -0700
++++ glibc-2.7/Makeconfig	2007-10-20 15:23:21.000000000 -0700
+@@ -524,12 +524,20 @@
+   libunwind = -lunwind
+ endif
+ ifneq ($(have-as-needed),yes)
++ifneq ($(have-cc-with-libgcc_eh),yes)
++ libgcc_eh := $(libunwind)
++else
+  libgcc_eh := -lgcc_eh $(libunwind)
++endif
+ else
+  libgcc_eh := -Wl,--as-needed -lgcc_s$(libgcc_s_suffix) $(libunwind) -Wl,--no-as-needed
+ endif
+ gnulib := -lgcc $(libgcc_eh)
+-static-gnulib := -lgcc -lgcc_eh $(libunwind)
++ifneq ($(have-cc-with-libgcc_eh),yes)
++ static-gnulib := -lgcc $(libunwind)
++else
++ static-gnulib := -lgcc -lgcc_eh $(libunwind)
++endif
+ libc.so-gnulib := -lgcc
+ endif
+ ifeq ($(elf),yes)
+diff -Naur glibc-2.7.orig/config.make.in glibc-2.7/config.make.in
+--- glibc-2.7.orig/config.make.in	2007-08-25 15:25:24.000000000 -0700
++++ glibc-2.7/config.make.in	2007-10-20 15:23:21.000000000 -0700
+@@ -60,6 +60,7 @@
+ have-libaudit = @have_libaudit@
+ have-libcap = @have_libcap@
+ have-cc-with-libunwind = @libc_cv_cc_with_libunwind@
++have-cc-with-libgcc_eh = @libc_cv_cc_with_libgcc_eh@
+ fno-unit-at-a-time = @fno_unit_at_a_time@
+ bind-now = @bindnow@
+ have-hash-style = @libc_cv_hashstyle@
+diff -Naur glibc-2.7.orig/configure glibc-2.7/configure
+--- glibc-2.7.orig/configure	2007-10-18 04:22:23.000000000 -0700
++++ glibc-2.7/configure	2007-10-20 21:26:18.000000000 -0700
+@@ -716,6 +716,7 @@
+ BISON
+ VERSIONING
+ libc_cv_cc_with_libunwind
++libc_cv_cc_with_libgcc_eh
+ libc_cv_Bgroup
+ libc_cv_libgcc_s_suffix
+ libc_cv_as_needed
+@@ -6045,6 +6046,33 @@
+ 
+   fi
+ 
++  { echo "$as_me:$LINENO: checking whether to link against libgcc_eh" >&5
++echo $ECHO_N "checking whether to link against libgcc_eh... $ECHO_C" >&6; }
++if test "${libc_cv_cc_with_libgcc_eh+set}" = set; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++
++    cat > conftest.c <<EOF
++int main (void) { return 0; }
++EOF
++    if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -static -o conftest \
++       conftest.c -v 2>&1 >/dev/null | grep -q " -lgcc_eh "; then
++      libc_cv_cc_with_libgcc_eh=yes
++    else
++      libc_cv_cc_with_libgcc_eh=no
++    fi
++    rm -f conftest*
++fi
++{ echo "$as_me:$LINENO: result: $libc_cv_cc_with_libgcc_eh" >&5
++echo "${ECHO_T}$libc_cv_cc_with_libgcc_eh" >&6; }
++
++  if test $libc_cv_cc_with_libgcc_eh = yes; then
++    cat >>confdefs.h <<\_ACEOF
++#define HAVE_CC_WITH_LIBGCC_EH 1
++_ACEOF
++
++  fi
++
+   { echo "$as_me:$LINENO: checking for -z nodelete option" >&5
+ echo $ECHO_N "checking for -z nodelete option... $ECHO_C" >&6; }
+ if test "${libc_cv_z_nodelete+set}" = set; then
+@@ -9243,6 +9271,7 @@
+ BISON!$BISON$ac_delim
+ VERSIONING!$VERSIONING$ac_delim
+ libc_cv_cc_with_libunwind!$libc_cv_cc_with_libunwind$ac_delim
++libc_cv_cc_with_libgcc_eh!$libc_cv_cc_with_libgcc_eh$ac_delim
+ libc_cv_Bgroup!$libc_cv_Bgroup$ac_delim
+ libc_cv_libgcc_s_suffix!$libc_cv_libgcc_s_suffix$ac_delim
+ libc_cv_as_needed!$libc_cv_as_needed$ac_delim
+@@ -9294,7 +9323,7 @@
+ LTLIBOBJS!$LTLIBOBJS$ac_delim
+ _ACEOF
+ 
+-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 52; then
++  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 53; then
+     break
+   elif $ac_last_try; then
+     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+diff -Naur glibc-2.7.orig/configure.in glibc-2.7/configure.in
+--- glibc-2.7.orig/configure.in	2007-06-07 20:16:36.000000000 -0700
++++ glibc-2.7/configure.in	2007-10-20 15:23:21.000000000 -0700
+@@ -1388,6 +1388,23 @@
+     AC_DEFINE(HAVE_CC_WITH_LIBUNWIND)
+   fi
+ 
++  AC_CACHE_CHECK(whether to link against libgcc_eh,
++                 libc_cv_cc_with_libgcc_eh, [
++    cat > conftest.c <<EOF
++int main (void) { return 0; }
++EOF
++    if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -static -o conftest \
++       conftest.c -v 2>&1 >/dev/null | grep -q " -lgcc_eh "; then
++      libc_cv_cc_with_libgcc_eh=yes
++    else
++      libc_cv_cc_with_libgcc_eh=no
++    fi
++    rm -f conftest*])
++  AC_SUBST(libc_cv_cc_with_libgcc_eh)
++  if test $libc_cv_cc_with_libgcc_eh = yes; then
++    AC_DEFINE(HAVE_CC_WITH_LIBGCC_EH)
++  fi
++
+   AC_CACHE_CHECK(for -z nodelete option,
+ 		 libc_cv_z_nodelete, [dnl
+   cat > conftest.c <<EOF
+
Index: patches/glibc-2.7-localedef_segfault-1.patch
===================================================================
--- patches/glibc-2.7-localedef_segfault-1.patch	(revision bfb94b23cbeefc6473fe019454031982abb60d03)
+++ patches/glibc-2.7-localedef_segfault-1.patch	(revision bfb94b23cbeefc6473fe019454031982abb60d03)
@@ -0,0 +1,56 @@
+Submitted By: Jim Gifford (patches at jg555 dot com)
+Date: 2007-05-19
+Initial Package Version: 2.6
+Origin: Debian
+Upstream Status: Unknown
+Description: Fixes Segfault when using localdef.
+             This problem is only noticed when using PaX
+             and some architectures besides x86.
+	     See debian bug # 231438
+
+diff -Naur glibc-2.6.orig/locale/programs/3level.h glibc-2.6/locale/programs/3level.h
+--- glibc-2.6.orig/locale/programs/3level.h	2005-12-06 21:47:27.000000000 -0800
++++ glibc-2.6/locale/programs/3level.h	2007-05-19 13:38:01.000000000 -0700
+@@ -202,6 +202,42 @@
+ 	}
+     }
+ }
++
++/* GCC ATM seems to do a poor job with pointers to nested functions passed
++   to inlined functions.  Help it a little bit with this hack.  */
++#define wchead_table_iterate(tp, fn) \
++do									      \
++  {									      \
++    struct wchead_table *t = (tp);					      \
++    uint32_t index1;							      \
++    for (index1 = 0; index1 < t->level1_size; index1++)			      \
++      {									      \
++	uint32_t lookup1 = t->level1[index1];				      \
++	if (lookup1 != ((uint32_t) ~0))					      \
++	  {								      \
++	    uint32_t lookup1_shifted = lookup1 << t->q;			      \
++	    uint32_t index2;						      \
++	    for (index2 = 0; index2 < (1 << t->q); index2++)		      \
++	      {								      \
++		uint32_t lookup2 = t->level2[index2 + lookup1_shifted];	      \
++		if (lookup2 != ((uint32_t) ~0))				      \
++		  {							      \
++		    uint32_t lookup2_shifted = lookup2 << t->p;		      \
++		    uint32_t index3;					      \
++		    for (index3 = 0; index3 < (1 << t->p); index3++)	      \
++		      {							      \
++			struct element_t *lookup3			      \
++			  = t->level3[index3 + lookup2_shifted];	      \
++			if (lookup3 != NULL)				      \
++			  fn ((((index1 << t->q) + index2) << t->p) + index3, \
++			      lookup3);					      \
++		      }							      \
++		  }							      \
++	      }								      \
++	  }								      \
++      }									      \
++  } while (0)
++
+ #endif
+ 
+ #ifndef NO_FINALIZE
Index: patches/glibc-2.7-mawk_fix-1.patch
===================================================================
--- patches/glibc-2.7-mawk_fix-1.patch	(revision bfb94b23cbeefc6473fe019454031982abb60d03)
+++ patches/glibc-2.7-mawk_fix-1.patch	(revision bfb94b23cbeefc6473fe019454031982abb60d03)
@@ -0,0 +1,39 @@
+Submitted By: Mark Vels <mark.vels@fundem.net>
+Date: 2007-07-20
+Initial Package Version: 2.6
+Origin: original patch glibc-2.6-mawk_fix-1.patch by Jim Gifford <jim@linuxfromscratch.org>
+Upstream Status: Not submitted
+Description: Fixes build if host distro is using mawk.
+	     Distro's known to have this issue are Debian 
+	     and Ubuntu
+
+	     Changes wrt version 1: added two more cases.
+
+diff -Naur glibc-2.6.orig/scripts/gen-sorted.awk glibc-2.6/scripts/gen-sorted.awk
+--- glibc-2.6.orig/scripts/gen-sorted.awk	2006-02-28 07:05:57.000000000 +0000
++++ glibc-2.6/scripts/gen-sorted.awk	2007-07-20 21:03:50.000000000 +0000
+@@ -16,7 +16,7 @@
+ {
+   subdir = type = FILENAME;
+   sub(/^.*\//, "", type);
+-  sub(/\/[^/]+$/, "", subdir);
++  sub(/\/[^\/]+$/, "", subdir);
+   sub(/^.*\//, "", subdir);
+   thisdir = "";
+ }
+@@ -56,13 +56,13 @@
+     # The Subdirs file comes from an add-on that should have the subdirectory.
+     dir = FILENAME;
+     do
+-      sub(/\/[^/]+$/, "", dir);
++      sub(/\/[^\/]+$/, "", dir);
+     while (dir !~ /\/sysdeps$/);
+     sub(/\/sysdeps$/, "", dir);
+     if (system("test -d " dir "/" thisdir) == 0)
+       dir = dir "/" thisdir;
+     else {
+-      sub(/\/[^/]+$/, "", dir);
++      sub(/\/[^\/]+$/, "", dir);
+       if (system("test -d " dir "/" thisdir) == 0)
+         dir = dir "/" thisdir;
+       else {
