Index: cross-tools/ppc64-chapter.xml
===================================================================
--- cross-tools/ppc64-chapter.xml	(revision eea58e3c23fc1596e9e43f9467b60a36cec66221)
+++ cross-tools/ppc64-chapter.xml	(revision b90ddb176fa123fa6e328957ece7cfa0a8c1948f)
@@ -20,6 +20,6 @@
   <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="ppc64/glibc-headers.xml"/>
   <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="ppc64/gcc-static.xml"/>
-  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="multilib/glibc.xml"/>
-  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="multilib/glibc-64bit.xml"/>
+  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="ppc64/glibc.xml"/>
+  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="ppc64/glibc-64bit.xml"/>
   <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="ppc64/gcc-final.xml"/>
 
Index: cross-tools/ppc64/glibc-64bit.xml
===================================================================
--- cross-tools/ppc64/glibc-64bit.xml	(revision b90ddb176fa123fa6e328957ece7cfa0a8c1948f)
+++ cross-tools/ppc64/glibc-64bit.xml	(revision b90ddb176fa123fa6e328957ece7cfa0a8c1948f)
@@ -0,0 +1,151 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+  "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
+  <!ENTITY % general-entities SYSTEM "../../general.ent">
+  %general-entities;
+]>
+
+<sect1 id="ch-cross-tools-glibc-64" role="wrap">
+  <?dbhtml filename="glibc-64.html"?>
+
+  <title>Glibc-&glibc-version; 64-Bit</title>
+
+  <indexterm zone="ch-cross-tools-glibc-64">
+    <primary sortas="a-Glibc">Glibc</primary>
+    <secondary>cross tools, 64 Bit</secondary>
+  </indexterm>
+
+  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+  href="../../final-system/common/glibc.xml"
+  xpointer="xpointer(//*[@role='package'])"/>
+
+  <sect2 role="installation">
+    <title>Installation of Glibc</title>
+
+    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+    href="glibc.xml"
+    xpointer="xpointer(//*[@os='da'])"/>
+
+    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+    href="glibc.xml"
+    xpointer="xpointer(//*[@os='db'])"/>
+
+    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+    href="glibc.xml"
+    xpointer="xpointer(//*[@os='dc'])"/>
+
+    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+    href="../../final-system/common/glibc.xml"
+    xpointer="xpointer(//*[@os='c'])"/>
+
+    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+    href="../../final-system/common/glibc.xml"
+    xpointer="xpointer(//*[@os='d'])"/>
+
+    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+    href="glibc.xml"
+    xpointer="xpointer(//*[@os='s1'])"/>
+
+    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+    href="glibc.xml"
+    xpointer="xpointer(//*[@os='s2'])"/>
+
+    <para os="t1">Repeat the sed to fix <filename>procfs.h</filename>.</para>
+
+    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+    href="glibc.xml"
+    xpointer="xpointer(//*[@os='t2'])"/>
+
+    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+    href="glibc.xml"
+    xpointer="xpointer(//*[@os='e'])"/>
+
+    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+    href="glibc.xml"
+    xpointer="xpointer(//*[@os='f'])"/>
+
+    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+    href="glibc.xml"
+    xpointer="xpointer(//*[@os='dd'])"/>
+
+    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+    href="glibc.xml"
+    xpointer="xpointer(//*[@os='de'])"/>
+
+    <para os="n1">Now we make sure the Glibc goes into <filename
+    class="directory">/tools/lib64</filename>:</para>
+
+<screen os="n2"><userinput>echo "slibdir=/tools/lib64" &gt;&gt; configparms</userinput></screen>
+
+    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+    href="glibc.xml"
+    xpointer="xpointer(//*[@os='g'])"/>
+
+<screen os="df"><userinput>BUILD_CC="gcc" CC="${LFS_TARGET}-gcc ${BUILD64}" \
+    AR="${LFS_TARGET}-ar" RANLIB="${LFS_TARGET}-ranlib" \
+    ../glibc-&glibc-version;/configure --prefix=/tools \
+    --host=${LFS_TARGET} --build=${LFS_HOST} --libdir=/tools/lib64 \
+    --disable-profile --enable-add-ons \
+    --with-tls --enable-kernel=2.6.0 --with-__thread \
+    --with-binutils=/cross-tools/bin --with-headers=/tools/include \
+    --cache-file=config.cache</userinput></screen>
+
+    <variablelist os="dg">
+      <title>The meaning of the new configure options:</title>
+
+      <varlistentry os="fa1">
+        <term><parameter>CC="${LFS_TARGET}-gcc ${BUILD64}"</parameter></term>
+        <listitem>
+          <para>Forces Glibc to utilize our target architecture GCC utilizing
+          the 64 Bit flags.</para>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry os="fa2">
+        <term><parameter>--libdir=/tools/lib64</parameter></term>
+        <listitem>
+          <para>Puts Glibc into /tools/lib64 instead of /tools/lib.</para>
+        </listitem>
+      </varlistentry>
+
+    </variablelist>
+
+    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+    href="glibc.xml"
+    xpointer="xpointer(//*[@os='dh'])"/>
+
+    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+    href="glibc.xml"
+    xpointer="xpointer(//*[@os='di'])"/>
+
+    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+    href="glibc.xml"
+    xpointer="xpointer(//*[@os='dj'])"/>
+
+    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+    href="glibc.xml"
+    xpointer="xpointer(//*[@os='dk'])"/>
+
+    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+    href="glibc.xml"
+    xpointer="xpointer(//*[@os='dl'])"/>
+
+    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+    href="glibc.xml"
+    xpointer="xpointer(//*[@os='dm'])"/>
+
+    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+    href="glibc.xml"
+    xpointer="xpointer(//*[@os='dn'])"/>
+
+  </sect2>
+
+  <sect2 role="content">
+    <title/>
+
+    <para>Details on this package are located in <xref
+    linkend="contents-glibc" role="."/></para>
+
+  </sect2>
+
+</sect1>
Index: cross-tools/ppc64/glibc-headers.xml
===================================================================
--- cross-tools/ppc64/glibc-headers.xml	(revision eea58e3c23fc1596e9e43f9467b60a36cec66221)
+++ cross-tools/ppc64/glibc-headers.xml	(revision b90ddb176fa123fa6e328957ece7cfa0a8c1948f)
@@ -46,4 +46,17 @@
     href="../ppc/glibc.xml"
     xpointer="xpointer(//*[@os='de'])"/>
+
+    <para>We need to persuade <command>configure</command> that the host's
+    compiler has all the necessary modern powerpc64 extensions.  It will still
+    pass flags such as <literal>-mnew-abi</literal> which are likely to trigger
+    error messages on a non-ppc host, but the headers can be built.  We do this
+    by adding the following lines to <filename>config.cache</filename>. Note
+    that one of these has three consecutive underscores.</para>
+
+<screen><userinput>echo "libc_cv_mlong_double_128ibm=yes" >> config.cache
+echo "libc_cv_mlong_double_128=yes" >> config.cache
+echo "libc_cv_powerpc64_tls=yes" >> config.cache
+echo "libc_cv_initfini_array=yes" >>config.cache
+echo "libc_cv_gcc___thread=yes" >>config.cache</userinput></screen>
 
     <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
Index: cross-tools/ppc64/glibc.xml
===================================================================
--- cross-tools/ppc64/glibc.xml	(revision b90ddb176fa123fa6e328957ece7cfa0a8c1948f)
+++ cross-tools/ppc64/glibc.xml	(revision b90ddb176fa123fa6e328957ece7cfa0a8c1948f)
@@ -0,0 +1,186 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+  "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
+  <!ENTITY % general-entities SYSTEM "../../general.ent">
+  %general-entities;
+]>
+
+<sect1 id="ch-cross-tools-glibc" role="wrap">
+  <?dbhtml filename="glibc.html"?>
+
+  <title>Glibc-&glibc-version; 32 Bit</title>
+
+  <indexterm zone="ch-cross-tools-glibc">
+    <primary sortas="a-Glibc">Glibc</primary>
+    <secondary>cross tools, 32 Bit</secondary>
+  </indexterm>
+
+  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+  href="../../final-system/common/glibc.xml"
+  xpointer="xpointer(//*[@role='package'])"/>
+
+  <sect2 role="installation">
+    <title>Installation of Glibc</title>
+
+    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+    href="../common/glibc.xml"
+    xpointer="xpointer(//*[@os='da'])"/>
+
+    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+    href="../common/glibc.xml"
+    xpointer="xpointer(//*[@os='db'])"/>
+
+    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+    href="../common/glibc.xml"
+    xpointer="xpointer(//*[@os='dc'])"/>
+
+    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+    href="../../final-system/common/glibc.xml"
+    xpointer="xpointer(//*[@os='c'])"/>
+
+    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+    href="../../final-system/common/glibc.xml"
+    xpointer="xpointer(//*[@os='d'])"/>
+
+    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+    href="../common/glibc.xml"
+    xpointer="xpointer(//*[@os='s1'])"/>
+
+    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+    href="../common/glibc.xml"
+    xpointer="xpointer(//*[@os='s2'])"/>
+
+    <para >The kernel's <filename class="directory">asm-ppc</filename> and
+    <filename class="directory">asm-ppc64</filename> headers were merged into
+    <filename class="directory">asm-powerpc</filename> during 2.6.15. Glibc for
+    powerpc installs a version of <filename>procfs.h</filename> which looks for
+    the __PPC64_ELF_H symbol to determine if it is running on powerpc64. That
+    symbol disappeared in the merge, its replacement does not indicate if the
+    machine is running as 64 bit.  The absence of the original symbol causes
+    the 32-bit definitions to be used, which leads to compilation failure early
+    in 64-bit glibc when an incompatible kernel definition is included. The
+    following sed will correct this, we need to repeat it every time we install
+    either size of glibc.</para>
+
+<screen os="t2"><userinput>cp sysdeps/unix/sysv/linux/powerpc/sys/procfs.h{,.orig}
+sed 's/__PPC64_ELF_H/__powerpc64__/' \
+    sysdeps/unix/sysv/linux/powerpc/sys/procfs.h.orig \
+    > sysdeps/unix/sysv/linux/powerpc/sys/procfs.h</userinput></screen>
+
+    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+    href="../common/glibc.xml"
+    xpointer="xpointer(//*[@os='e'])"/>
+
+    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+    href="../common/glibc.xml"
+    xpointer="xpointer(//*[@os='f'])"/>
+
+    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+    href="../common/glibc.xml"
+    xpointer="xpointer(//*[@os='dd'])"/>
+
+    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+    href="../common/glibc.xml"
+    xpointer="xpointer(//*[@os='de'])"/>
+
+    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+    href="../common/glibc.xml"
+    xpointer="xpointer(//*[@os='g'])"/>
+
+<screen os="df"><userinput>BUILD_CC="gcc" CC="${LFS_TARGET}-gcc ${BUILD32}" \
+    AR="${LFS_TARGET}-ar" RANLIB="${LFS_TARGET}-ranlib" \
+    ../glibc-&glibc-version;/configure --prefix=/tools \
+    --host=${LFS_TARGET32} --build=${LFS_HOST} \
+    --disable-profile --enable-add-ons \
+    --with-tls --enable-kernel=2.6.0 --with-__thread \
+    --with-binutils=/cross-tools/bin --with-headers=/tools/include \
+    --cache-file=config.cache</userinput></screen>
+
+    <variablelist os="dg">
+      <title>The meaning of the new configure options:</title>
+
+      <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+      href="../common/glibc.xml"
+      xpointer="xpointer(//*[@os='dg1'])"/>
+
+      <varlistentry os="ea1">
+        <term><parameter>CC="${LFS_TARGET}-gcc ${BUILD32}"</parameter></term>
+        <listitem>
+          <para>Forces Glibc to utilize our target architecture GCC utilizing
+          the 32 Bit flags.</para>
+        </listitem>
+      </varlistentry>
+
+      <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+      href="../common/glibc.xml"
+      xpointer="xpointer(//*[@os='dg3'])"/>
+
+      <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+      href="../common/glibc.xml"
+      xpointer="xpointer(//*[@os='dg4'])"/>
+
+      <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+      href="../common/glibc.xml"
+      xpointer="xpointer(//*[@os='dg5'])"/>
+
+      <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+      href="../common/glibc.xml"
+      xpointer="xpointer(//*[@os='dg6'])"/>
+
+      <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+      href="../common/glibc.xml"
+      xpointer="xpointer(//*[@os='dg7'])"/>
+
+      <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+      href="../common/glibc.xml"
+      xpointer="xpointer(//*[@os='dg8'])"/>
+
+      <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+      href="../common/glibc.xml"
+      xpointer="xpointer(//*[@os='dg9'])"/>
+
+      <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+      href="../common/glibc.xml"
+      xpointer="xpointer(//*[@os='dg10'])"/>
+
+    </variablelist>
+
+    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+    href="../common/glibc.xml"
+    xpointer="xpointer(//*[@os='dh'])"/>
+
+    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+    href="../common/glibc.xml"
+    xpointer="xpointer(//*[@os='di'])"/>
+
+    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+    href="../common/glibc.xml"
+    xpointer="xpointer(//*[@os='dj'])"/>
+
+    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+    href="../common/glibc.xml"
+    xpointer="xpointer(//*[@os='dk'])"/>
+
+    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+    href="../common/glibc.xml"
+    xpointer="xpointer(//*[@os='dl'])"/>
+
+    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+    href="../common/glibc.xml"
+    xpointer="xpointer(//*[@os='dm'])"/>
+
+    <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+    href="../common/glibc.xml"
+    xpointer="xpointer(//*[@os='dn'])"/>
+
+  </sect2>
+
+  <sect2 role="content">
+    <title/>
+
+    <para>Details on this package are located in <xref
+    linkend="contents-glibc" role="."/></para>
+
+  </sect2>
+
+</sect1>
