Author: matthew
Date: 2005-09-09 14:34:44 -0600 (Fri, 09 Sep 2005)
New Revision: 6819

Modified:
   trunk/BOOK/chapter01/changelog.xml
   trunk/BOOK/chapter03/packages.xml
   trunk/BOOK/chapter03/patches.xml
   trunk/BOOK/chapter05/adjusting.xml
   trunk/BOOK/chapter05/gcc-pass2.xml
   trunk/BOOK/chapter05/glibc.xml
   trunk/BOOK/chapter05/tar.xml
   trunk/BOOK/chapter06/gcc.xml
   trunk/BOOK/chapter06/glibc.xml
   trunk/BOOK/chapter06/grub.xml
   trunk/BOOK/chapter06/inetutils.xml
   trunk/BOOK/chapter06/kbd.xml
   trunk/BOOK/chapter06/readjusting.xml
   trunk/BOOK/chapter06/tar.xml
   trunk/BOOK/chapter08/kernel.xml
   trunk/BOOK/general.ent
   trunk/BOOK/patches.ent
Log:
Upgrade to gcc-4.0.1 (merge of gcc4 branch)

Modified: trunk/BOOK/chapter01/changelog.xml
===================================================================
--- trunk/BOOK/chapter01/changelog.xml  2005-09-08 12:35:52 UTC (rev 6818)
+++ trunk/BOOK/chapter01/changelog.xml  2005-09-09 20:34:44 UTC (rev 6819)
@@ -89,12 +89,18 @@
 <itemizedlist>
 <listitem><para>&bzip2-bzgrep-patch;</para></listitem>
 <listitem><para>&bzip2-docs-patch;</para></listitem>
-<listitem><para>&gcc-linkonce-patch;</para></listitem>
-<listitem><para>&gcc-no_fixincludes-patch;</para></listitem>
 <listitem><para>&gcc-specs-patch;</para></listitem>
+<listitem><para>&glibc-gcc4_elf-patch;</para></listitem>
+<listitem><para>&glibc-gcc4_iconvdata-patch;</para></listitem>
+<listitem><para>&glibc-gcc4_mathtest-patch;</para></listitem>
+<listitem><para>&glibc-gcc4_string-patch;</para></listitem>
+<listitem><para>&glibc-gcc4_symbols-patch;</para></listitem>
 <listitem><para>&glibc-testfix-patch;</para></listitem>
+<listitem><para>&inetutils-gcc4_fixes-patch;</para></listitem>
+<listitem><para>&kbd-gcc4_fixes-patch;</para></listitem>
+<listitem><para>&mktemp-tempfile-patch;</para></listitem>
 <listitem><para>&perl-libc-patch;</para></listitem>
-<listitem><para>&mktemp-tempfile-patch;</para></listitem>
+<listitem><para>&tar-gcc4_fix-patch;</para></listitem>
 <listitem><para>&util-linux-reiser_crash-patch;</para></listitem>
 <listitem><para>&vim-security_fix-patch;</para></listitem>
 </itemizedlist>
@@ -118,6 +124,12 @@
 <listitem><para>September 8, 2005 [jhuntwork]: Upgrade to groff-1.19.2</para>
 </listitem>
 
+<listitem><para>September 6, 2005 [ken]: Reworded the glibc text to expect
+test failures.</para></listitem>
+ 
+<listitem><para>September 5, 2005 [ken]: Add patch to fix some of the math
+tests in glibc.</para></listitem>
+
 <listitem><para>September 4, 2005 [matt]: Add patch to stop
 <command>cfdisk</command> segfaulting when invoked on devices with partitions
 that don't contain an ext2, ext3, xfs or jfs filesystem (see bug 1604)</para>
@@ -129,12 +141,36 @@
 <listitem><para>September 4, 2005 [matt]: Upgrade to findutils-4.2.25</para>
 </listitem>
 
+<listitem><para>September 2, 2005 [matt]: The optimization flag for util-linux
+comes from <filename>configure</filename> rather than
+<filename>MCONFIG</filename>, so adjust the <command>sed</command> in order for
+the segfault fix to actually work.</para></listitem>
+
+<listitem><para>September 2, 2005 [matt]: Avoid the potential race condition
+when invoking <command>find</command> to remove GCC's fixed headers.</para>
+</listitem>
+
+<listitem><para>August 30th, 2005 [matt]: Work around a segfault in cfdisk by
+compiling with -O instead of the default -O2 optimization setting (fixes bug
+1604).</para></listitem>
+
+<listitem><para>August 30th, 2005 [matt]: Update the inetutils patch to use the
+upstream fix for GCC-4.x compilation problems (fixes bug 
1602).</para></listitem>
+
 <listitem><para>August 30th, 2005 [matt]: Upgrade to shadow-2.0.12</para>
 </listitem>
 
+<listitem><para>August 30th, 2005 [ken]: Remove <command>sed -i</command>
+ commands from gcc-pass2.</para></listitem>
+
 <listitem><para>August 28th, 2005 [jhuntwork]: Adjusted tar commands in Bash
 and Glibc chapter six builds for consistency</para></listitem>
 
+<listitem><para>August 23rd, 2005 [matt]: <command>find</command> may fail due
+to a race condition when deleting files.  Remove the &amp;&amp; construct in
+chapter05/adjusting.xml so that the rest of the commands for removing fixed
+headers will be executed (fixes bug 1621).</para></listitem>
+
 <listitem><para>August 23rd, 2005 [matt]: Install Udev's documentation relating
 to configuring rules (fixes bug 1622)</para></listitem>
 
@@ -149,9 +185,9 @@
 
 <listitem><para>August 19th, 2005 [matt]: Upgrade to 
file-4.15</para></listitem>
 
-<listitem><para>August 18th, 2005 [matt]: Refrain from using the undocumented
---print-file switch for GCC's spec file edit.  Use -print-file-name=specs
-instead (Greg Schafer).</para></listitem>
+<listitem><para>August 18th, 2005 [matt]: Simplify the method for finding where
+GCC's default specs file and private include directory live.  Additionally,
+don't assume the host's sed supports the -i switch.</para></listitem>
 
 <listitem><para>August 18th, 2005 [ken]: Add a patch to sanitise bzgrep's
 handling of filenames.</para></listitem>
@@ -163,11 +199,14 @@
 <listitem><para>August 16th, 2005 [matt]: Upgraded to linux-2.6.12.5.</para>
 </listitem>
 
+<listitem><para>August 15th, 2005 [matt]: Alter the GCC -fomit-frame-pointer 
sed
+to protect from multiple invocations (Greg Schafer)</para></listitem>
+
 <listitem><para>August 14th, 2005 [ken]: Upgrade shadow to 4.0.11.1 with
 --enable-shadowgrp as advised by Greg Schafer.</para></listitem>
 
-<listitem><para>August 14th, 2005 [matt]: Add a sed to prevent the UFS test
-from being run (fixes bug 1595).</para></listitem>
+<listitem><para>August 14th, 2005 [matt]: Mention the common libmudflap test
+failures in GCC (fixes bug 1615).</para></listitem>
 
 <listitem><para>August 14th, 2005 [matt]: Added patch to install documentation
 for bzip2 (fixes bug 1603).</para>
@@ -176,6 +215,9 @@
 <listitem><para>August 14th, 2005 [matt]: Upgrade to linux-2.6.12.4.</para>
 </listitem>
 
+<listitem><para>August 14th, 2005 [matt]: Add sed to chapter05/gcc-pass2 and 
chapter06/gcc to ensure they get built with -fomit-frame-pointer so it matches 
the
+bootstrap build in chapter05/gcc-pass1 (fixes bug 1609).</para></listitem>
+
 <listitem><para>August 14th, 2005 [matt]: Upgrade to udev-067 including a fix
 for the failing test (bug 1611).</para></listitem>
 
@@ -207,9 +249,19 @@
 <listitem><para>July  30th, 2005 [matt]: Added instructions for installing Bash
 documentation (Randy McMurchy).</para></listitem>
 
+<listitem><para>July 30th, 2005 [matt]: Remove GCC linkonce patch from 
chapter03/patches.xml as it's no longer used in the book</para></listitem>
+
 <listitem><para>July  29th, 2005 [manuel]: Removed the text about defining
 gvimrc.</para></listitem>
 
+<listitem><para>July 28th, 2005 [matt]: Add GCC-4 related patch for 
kbd</para></listitem>
+
+<listitem><para>July 28th, 2005 [matt]: Add GCC-4 related patch for 
inetutils</para></listitem>
+
+<listitem><para>July 28th, 2005 [matt]: Remove the note regarding a known test 
failure in GRUB.  The test no longer fails under GCC-4</para></listitem>
+
+<listitem><para>July 28th, 2005 [matt]: Add GCC-4 related patch to chapter06 
tar</para></listitem>
+
 <listitem><para>July  27th, 2005 [matt]: Don't define gvim's configuration file
 as we don't compile gvim in LFS (Bruce Dubbs).</para></listitem>
 
@@ -232,10 +284,46 @@
 <listitem><para>July  22nd, 2005 [manuel]: Added obfuscate.sh and modified the
 Makefile to obfuscate e-mail addresses in XHTML output.</para></listitem>
 
+<listitem><para>July 21st, 2005 [matt]: Add GCC-4 related patches to chapter06 
glibc</para></listitem>
+
+<listitem><para>July 21st, 2005 [matt]: Unset the GCC_INCLUDEDIR variable once
+it's no longer needed.</para></listitem>
+
 <listitem><para>July  19th, 2005 [matt]: Removed flex++ from the list of 
installed files, as it is no longer present (Randy McMurchy)</para></listitem>
 
+<listitem><para>July 18th, 2005 [matt]: Re-added the explanation of the 
fixincludes process and rewording where necessary (Chris Staub), and reworded 
description of the specs patch.</para></listitem>
+
+<listitem><para>July 18th, 2005 [matt]: Remove all host headers brought in via 
the fixincludes process, not just pthread.h and sigaction.h</para></listitem>
+
+<listitem><para>July 17th, 2005 [matt]: Slightly adjusted the specs file seds,
+to prevent multiple seds from adversely affecting them.</para></listitem>
+
+<listitem><para>July 17th, 2005 [matt]: Removed the fixincludes sed from
+gcc-pass1 as we may need to fix up host's headers.  Also reinstate the
+associated removal of pthread.h and sigthread.h.</para></listitem>
+
+<listitem><para>July  16th, 2005 [jhuntwork]: Added sed to chapter 5 gcc builds
+to force the fixincludes to use the headers in /tools and not the 
host.</para></listitem>
+
+<listitem><para>July  16th, 2005 [jhuntwork]: Removed no_fixincludes and 
linkonce
+patches for gcc4. Also removed the command to remove the fixed 
pthread.h.</para></listitem>
+
+<listitem><para>July  16th, 2005 [jhuntwork]: Fixed adjusting toolchain sed 
for both
+chapters 5 and 6.</para></listitem>
+
 <listitem><para>July  15th, 2005 [matt]: Updated to 
Linux-2.6.12.3.</para></listitem>
 
+<listitem><para>July  15th, 2005 [matt]: Added a patch to enable tar to build
+with gcc-4.0.1</para></listitem>
+
+<listitem><para>July  15th, 2005 [matt]: GCC-4.x no longer installs its
+specs file by default.  Alter the toolchain adjustment stage to first
+dump the specs file where GCC will find it, then alter it.</para></listitem>
+
+<listitem><para>July  15th, 2005 [matt]: Added patches for chapter 5's Glibc 
to build with gcc-4.0.1</para></listitem>
+
+<listitem><para>July  15th, 2005 [matt]: Updated to 
gcc-4.0.1.</para></listitem>
+
 <listitem><para>July  15th, 2005 [matt]: Updated to udev-063.</para></listitem>
 
 <listitem><para>July  13th, 2005 [matt]: Updated to 
automake-1.9.6.</para></listitem>

Modified: trunk/BOOK/chapter03/packages.xml
===================================================================
--- trunk/BOOK/chapter03/packages.xml   2005-09-08 12:35:52 UTC (rev 6818)
+++ trunk/BOOK/chapter03/packages.xml   2005-09-09 20:34:44 UTC (rev 6819)
@@ -130,7 +130,7 @@
 </varlistentry>
 
 <varlistentry>
-<term>GCC (&gcc-version;) - 26,952 KB:</term>
+<term>GCC (&gcc-version;) - 31,001 KB:</term>
 <listitem>
 <para><ulink url="&gnu;gcc/"/></para>
 </listitem>

Modified: trunk/BOOK/chapter03/patches.xml
===================================================================
--- trunk/BOOK/chapter03/patches.xml    2005-09-08 12:35:52 UTC (rev 6818)
+++ trunk/BOOK/chapter03/patches.xml    2005-09-09 20:34:44 UTC (rev 6819)
@@ -74,40 +74,75 @@
 </varlistentry>
 
 <varlistentry>
-<term> GCC Linkonce Patch - 12 KB:</term>
+<term>GCC Specs Patch - 14 KB:</term>
 <listitem>
-<para><ulink url="&patches-root;&gcc-linkonce-patch;"/></para>
+<para><ulink url="&patches-root;&gcc-specs-patch;"/></para>
 </listitem>
 </varlistentry>
 
 <varlistentry>
-<term>GCC No-Fixincludes Patch - 1 KB:</term>
+<term>Glibc Fix Testsuite Patch - 1 KB:</term>
 <listitem>
-<para><ulink url="&patches-root;&gcc-no_fixincludes-patch;"/></para>
+<para><ulink url="&patches-root;&glibc-testfix-patch;"/></para>
 </listitem>
 </varlistentry>
 
 <varlistentry>
-<term>GCC Specs Patch - 14 KB:</term>
+<term>Glibc GCC-4.x Symbols Patch - 5 KB:</term>
 <listitem>
-<para><ulink url="&patches-root;&gcc-specs-patch;"/></para>
+<para><ulink url="&patches-root;&glibc-gcc4_symbols-patch;"/></para>
 </listitem>
 </varlistentry>
 
 <varlistentry>
-<term>Glibc Fix Testsuite Patch - 1 KB:</term>
+<term>Glibc GCC-4.x String Patch - 2 KB:</term>
 <listitem>
-<para><ulink url="&patches-root;&glibc-testfix-patch;"/></para>
+<para><ulink url="&patches-root;&glibc-gcc4_string-patch;"/></para>
 </listitem>
 </varlistentry>
 
 <varlistentry>
+<term>Glibc GCC-4.x ELF Patch - 15KB:</term>
+<listitem>
+<para><ulink url="&patches-root;&glibc-gcc4_elf-patch;"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Glibc GCC-4.x Iconvdata Patch - 1 KB:</term>
+<listitem>
+<para><ulink url="&patches-root;&glibc-gcc4_iconvdata-patch;"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Glibc GCC-4.x Mathtest Patch - 9 KB:</term>
+<listitem>
+<para><ulink url="&patches-root;&glibc-gcc4_mathtest-patch;"/></para>
+</listitem>
+</varlistentry> 
+
+<varlistentry>
 <term>Gzip Security Patch - 2 KB:</term><listitem>
 <para><ulink url="&patches-root;&gzip-security_fix-patch;"/></para>
 </listitem>
 </varlistentry>
 
 <varlistentry>
+<term>Kbd GCC-4.x Fix Patch - 1 KB:</term>
+<listitem>
+<para><ulink url="&patches-root;&kbd-gcc4_fixes-patch;"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Inetutils GCC-4.x Fix Patch - 2 KB:</term>
+<listitem>
+<para><ulink url="&patches-root;&inetutils-gcc4_fixes-patch;"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
 <term>Inetutils No-Server-Man-Pages Patch - 4 KB:</term>
 <listitem>
 <para><ulink url="&patches-root;&inetutils-man_pages-patch;"/></para>
@@ -150,6 +185,13 @@
 </varlistentry>
 
 <varlistentry>
+<term>Tar GCC-4.x Fix Patch - 1 KB:</term>
+<listitem>
+<para><ulink url="&patches-root;&tar-gcc4_fix-patch;"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
 <term>Util-linux Cramfs Patch - 3 KB:</term> <listitem>
 <para><ulink url="&patches-root;&util-linux-cramfs-patch;"/></para>
 </listitem>

Modified: trunk/BOOK/chapter05/adjusting.xml
===================================================================
--- trunk/BOOK/chapter05/adjusting.xml  2005-09-08 12:35:52 UTC (rev 6818)
+++ trunk/BOOK/chapter05/adjusting.xml  2005-09-09 20:34:44 UTC (rev 6819)
@@ -31,14 +31,16 @@
 <para>Now that the adjusted linker is installed, the Binutils build and source
 directories should be removed.</para>
 
-<para>The next task is to amend the GCC specs file so that it points
-to the new dynamic linker. A simple sed script will accomplish this:</para>
+<para>The next task is to point GCC to the new dynamic linker.  This is done by
+dumping GCC's <quote>specs</quote> file to a location where GCC will look for 
it
+by default.  A simple <command>sed</command> substitution then alters the
+dynamic linker that GCC will use:</para>
 
 <!-- Ampersands are needed to allow copy and paste -->
 
-<screen><userinput>SPECFILE=`gcc -print-file-name=specs` &amp;&amp;
-sed 's@ /lib/ld-linux.so.2@ /tools/lib/[EMAIL PROTECTED]' \
-    $SPECFILE &gt; tempspecfile &amp;&amp;
+<screen><userinput>SPECFILE=`dirname $(gcc -print-libgcc-file-name)`/specs 
&amp;&amp;
+gcc -dumpspecs > $SPECFILE &amp;&amp;
+sed '[EMAIL PROTECTED]/lib/ld-linux.so.2@/tools&amp;@g' $SPECFILE &gt; 
tempspecfile &amp;&amp;
 mv -f tempspecfile $SPECFILE &amp;&amp;
 unset SPECFILE</userinput></screen>
 
@@ -59,14 +61,16 @@
 linkend="ch-tools-toolchaintechnotes" role=","/> if
 necessary.</para></important>
 
-<para>There is a possibility that some include files from the host
-system have found their way into GCC's private include dir. This can
-happen as a result of GCC's <quote>fixincludes</quote> process, which runs as 
part
-of the GCC build. This is explained in more detail later in this
-chapter. Run the following command to eliminate this
-possibility:</para>
+<para>There is a possibility that some header files from the host system have
+found their way into GCC's private include dir. This can happen as a result of
+GCC's <quote>fixincludes</quote> process, which runs as part of the GCC build.
+This is explained in more detail later in this chapter. Run the following 
commands to remove those header files (you may find it easier to copy and paste 
these commands, rather than typing them by hand, due to their length):</para>
 
-<screen><userinput>rm -f 
/tools/lib/gcc/*/*/include/{pthread.h,bits/sigthread.h}</userinput></screen>
+<!-- && used to ease copy and pasting -->
+<screen><userinput>GCC_INCLUDEDIR=`dirname $(gcc 
-print-libgcc-file-name)`/include &amp;&amp;
+find ${GCC_INCLUDEDIR}/* -maxdepth 0 -xtype d -exec rm -rf '{}' \; &amp;&amp;
+rm -f `grep -l "DO NOT EDIT THIS FILE" ${GCC_INCLUDEDIR}/*` &amp;&amp;
+unset GCC_INCLUDEDIR</userinput></screen>
 
 <caution><para>At this point, it is imperative to stop and ensure that
 the basic functions (compiling and linking) of the new toolchain are

Modified: trunk/BOOK/chapter05/gcc-pass2.xml
===================================================================
--- trunk/BOOK/chapter05/gcc-pass2.xml  2005-09-08 12:35:52 UTC (rev 6818)
+++ trunk/BOOK/chapter05/gcc-pass2.xml  2005-09-09 20:34:44 UTC (rev 6819)
@@ -58,36 +58,50 @@
 url="&lfs-root;/lfs/faq.html#no-ptys"/> for more information on how to get PTYs
 working.</para>
 
-<para>First correct a known problem and make an essential adjustment:</para>
+<para>Under normal circumstances, the GCC <command>fixincludes</command> script
+scans the system for header files that need to be fixed (they may contain 
syntax
+errors, for example).  The script might find that some Glibc header files on 
the
+host system need to be fixed, so fixes them and puts them in the GCC private
+include directory. In <xref linkend="chapter-building-system"/>, after the
+newer Glibc has been installed, this private include directory will be searched
+before the system include directory.  This may result in GCC finding the fixed
+headers from the host system, which most likely will not match the Glibc 
version
+used for the LFS system.</para>
 
-<screen><userinput>patch -Np1 -i ../&gcc-no_fixincludes-patch;
-patch -Np1 -i ../&gcc-specs-patch;</userinput></screen>
+<para>The following command adjusts where the GCC 
<command>fixincludes</command>
+script searches for headers, so that it fixes only the new headers under
+<filename class="directory">/tools</filename>, not the ones from your host
+system.</para>
 
-<para>The first patch disables the GCC <command>fixincludes</command>
-script. This was briefly mentioned earlier, but a more in-depth
-explanation of the fixincludes process is warranted here. Under normal
-circumstances, the GCC <command>fixincludes</command> script scans the
-system for header files that need to be fixed. It might find that some
-Glibc header files on the host system need to be fixed, and will fix
-them and put them in the GCC private include directory. In <xref
-linkend="chapter-building-system"/>, after the newer Glibc has been
-installed, this private include directory will be searched before the
-system include directory.  This may result in GCC finding the fixed
-headers from the host system, which most likely will not match the
-Glibc version used for the LFS system.</para>
+<screen><userinput>cp gcc/Makefile.in{,.orig} &amp;&amp;
+sed '[EMAIL PROTECTED](^NATIVE_SYSTEM_HEADER_DIR =\)[EMAIL PROTECTED] 
/tools/[EMAIL PROTECTED]' \
+      gcc/Makefile.in.orig &gt; gcc/Makefile.in</userinput></screen>
 
-<para>The second patch changes GCC's default location of the dynamic
-linker (typically <filename class="libraryfile">ld-linux.so.2</filename>). It 
also removes
-<filename class="directory">/usr/include</filename> from GCC's include
-search path. Patching now rather than adjusting the specs file after
-installation ensures that the new dynamic linker is used during the
-actual build of GCC. That is, all of the final (and temporary)
-binaries created during the build will link against the new
+<para>The bootstrap build performed in <xref linkend="ch-tools-gcc-pass1"/>
+built GCC with the <option>-fomit-frame-pointer</option> compiler flag.
+Non-bootstrap builds omit this flag by default, so apply the following
+<command>sed</command> to use it in order to ensure consistent compiler builds.
+</para>
+
+<screen><userinput>cp gcc/Makefile.in{,.tmp} &amp;&amp;
+sed 's/^XCFLAGS =$/&amp; -fomit-frame-pointer/' gcc/Makefile.in.tmp \
+       &gt; gcc/Makefile.in</userinput></screen>
+
+<para>Apply the following patch to change the location of GCC's default dynamic
+linker (typically <filename 
class="libraryfile">ld-linux.so.2</filename>):</para>
+
+<screen><userinput>patch -Np1 -i ../&gcc-specs-patch;</userinput></screen>
+
+<para>The above patch also removes
+<filename class="directory">/usr/include</filename> from GCC's include search
+path. Patching now rather than adjusting the specs file after installation
+ensures that the new dynamic linker is used during the actual build of GCC. 
That
+is, all of the binaries created during the build will link against the new
 Glibc.</para>
 
-<important><para>The above patches are critical in ensuring a
+<important><para>The above patch is critical in ensuring a
 successful overall build. Do not forget to apply
-them.</para></important>
+it.</para></important>
 
 <para>Create a separate build directory again:</para>
 
@@ -180,10 +194,13 @@
 <para>Results can be compared with those located at <ulink
 url="&test-results;"/>.</para>
 
-<para>A few unexpected failures cannot always be avoided. The
-GCC developers are usually aware of these issues, but have not
-resolved them yet. Unless the test results are vastly different from
-those at the above URL, it is safe to continue.</para>
+<para>A few unexpected failures cannot always be avoided. The GCC developers 
are
+usually aware of these issues, but have not resolved them yet. In particular,
+the <filename class="libraryfile">libmudflap</filename> tests are known be
+particularly problematic as a result of a bug in GCC (<ulink
+url="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20003"/>).  Unless the test
+results are vastly different from those at the above URL, it is safe to
+continue.</para>
 
 <para>Install the package:</para>
 

Modified: trunk/BOOK/chapter05/glibc.xml
===================================================================
--- trunk/BOOK/chapter05/glibc.xml      2005-09-08 12:35:52 UTC (rev 6818)
+++ trunk/BOOK/chapter05/glibc.xml      2005-09-09 20:34:44 UTC (rev 6819)
@@ -45,6 +45,15 @@
 
 <screen><userinput>patch -Np1 -i ../&glibc-testfix-patch;</userinput></screen>
 
+<para>Apply the following patches to enable Glibc to compile with
+GCC-&gcc-version;:</para>
+
+
+<screen><userinput>patch -Np1 -i ../&glibc-gcc4_symbols-patch;
+patch -Np1 -i ../&glibc-gcc4_string-patch;
+patch -Np1 -i ../&glibc-gcc4_elf-patch;
+patch -Np1 -i ../&glibc-gcc4_iconvdata-patch;</userinput></screen>
+
 <para>The Glibc documentation recommends building Glibc outside of the source
 directory in a dedicated build directory:</para>
 

Modified: trunk/BOOK/chapter05/tar.xml
===================================================================
--- trunk/BOOK/chapter05/tar.xml        2005-09-08 12:35:52 UTC (rev 6818)
+++ trunk/BOOK/chapter05/tar.xml        2005-09-09 20:34:44 UTC (rev 6819)
@@ -29,6 +29,11 @@
 <sect2 role="installation">
 <title>Installation of Tar</title>
 
+<para>If you wish to run the test suite, apply the following patch to fix
+some issues with GCC-&gcc-version;:</para>
+
+<screen><userinput>patch -Np1 -i ../&tar-gcc4_fix-patch;</userinput></screen>
+
 <para>Prepare Tar for compilation:</para>
 
 <screen><userinput>./configure --prefix=/tools</userinput></screen>

Modified: trunk/BOOK/chapter06/gcc.xml
===================================================================
--- trunk/BOOK/chapter06/gcc.xml        2005-09-08 12:35:52 UTC (rev 6818)
+++ trunk/BOOK/chapter06/gcc.xml        2005-09-09 20:34:44 UTC (rev 6819)
@@ -38,17 +38,6 @@
 as <envar>CFLAGS</envar> and <envar>CXXFLAGS</envar>,
 unset them when building GCC.</para>
 
-<para>Apply only the No-Fixincludes patch (not the Specs patch) also
-used in the previous chapter:</para>
-
-<screen><userinput>patch -Np1 -i 
../&gcc-no_fixincludes-patch;</userinput></screen>
-
-<para>GCC fails to compile some packages outside of a base Linux From Scratch
-install (e.g., Mozilla and kdegraphics) when used in conjunction with newer
-versions of Binutils.  Apply the following patch to fix this issue:</para>
-
-<screen><userinput>patch -Np1 -i ../&gcc-linkonce-patch;</userinput></screen>
-
 <para>Apply a <command>sed</command> substitution that will suppress the
 installation of <filename class="libraryfile">libiberty.a</filename>. The
 version of <filename class="libraryfile">libiberty.a</filename> provided by
@@ -56,6 +45,14 @@
 
 <screen><userinput>sed -i 's/install_to_$(INSTALL_DEST) //' 
libiberty/Makefile.in</userinput></screen>
 
+<para>The bootstrap build performed in <xref linkend="ch-tools-gcc-pass1"/>
+built GCC with the <option>-fomit-frame-pointer</option> compiler flag.
+Non-bootstrap builds omit this flag by default, so apply the following
+<command>sed</command> to use it in order to ensure consistent compiler builds.
+</para>
+
+<screen><userinput>sed -i 's/^XCFLAGS =$/&amp; -fomit-frame-pointer/' 
gcc/Makefile.in</userinput></screen>
+
 <para>The GCC documentation recommends building GCC outside of the source
 directory in a dedicated build directory:</para>
 

Modified: trunk/BOOK/chapter06/glibc.xml
===================================================================
--- trunk/BOOK/chapter06/glibc.xml      2005-09-08 12:35:52 UTC (rev 6818)
+++ trunk/BOOK/chapter06/glibc.xml      2005-09-09 20:34:44 UTC (rev 6819)
@@ -20,7 +20,7 @@
 <segmentedlist>
 <segtitle>&buildtime;</segtitle>
 <segtitle>&diskspace;</segtitle>
-<seglistitem><seg>12.3 SBU</seg><seg>476</seg></seglistitem>
+<seglistitem><seg>16.7 SBU</seg><seg>500</seg></seglistitem>
 </segmentedlist>
 
 <segmentedlist>
@@ -68,6 +68,19 @@
 
 <screen><userinput>patch -Np1 -i ../&glibc-testfix-patch;</userinput></screen>
 
+<para>Apply the following patches to enable Glibc to compile with
+GCC-&gcc-version;:</para>
+
+<screen><userinput>patch -Np1 -i ../&glibc-gcc4_symbols-patch;
+patch -Np1 -i ../&glibc-gcc4_string-patch;
+patch -Np1 -i ../&glibc-gcc4_elf-patch;
+patch -Np1 -i ../&glibc-gcc4_iconvdata-patch;</userinput></screen>
+
+<para>The following patch corrects the expected results for some of the math
+tests on x86 processors when compiled with GCC-&gcc-version;:</para>
+
+<screen><userinput>patch -Np1 -i 
../&glibc-gcc4_mathtest-patch;</userinput></screen>
+
 <para>The Glibc documentation recommends building Glibc outside of the source
 directory in a dedicated build directory:</para>
 
@@ -102,16 +115,24 @@
 
 <para>Test the results:</para>
 
-<screen><userinput>make check</userinput></screen>
+<screen><userinput>
+make -k check &gt;glibc-check-log 2&gt;&amp;1 ; grep Error glibc-check-log
+</userinput></screen>
 
+<para>On at least i686 you can expect to see failures in the 
<emphasis>test-double
+</emphasis> and <emphasis>test-idouble</emphasis> math tests with 
+gcc-&gcc-version;, as well as an expected (ignored) failure in <emphasis>
+posix/annexc</emphasis>.  These two failures in the math tests appear to be
+harmless.</para>
+
 <para>The Glibc test suite is highly dependent on certain functions of
-the host system, in particular the kernel. In general, the Glibc test
-suite is always expected to pass. However, in certain circumstances,
+the host system, in particular the kernel. In certain circumstances,
 some failures are unavoidable. This is a list of the most common
 issues:</para>
 
 <itemizedlist>
-<listitem><para>The <emphasis>math</emphasis> tests sometimes fail when running
+<listitem><para>The <emphasis>math</emphasis> tests sometimes fail in other 
tests
+when running
 on systems where the CPU is not a relatively new genuine Intel or authentic 
AMD.
 Certain optimization settings are also known to be a factor 
here.</para></listitem>
 

Modified: trunk/BOOK/chapter06/grub.xml
===================================================================
--- trunk/BOOK/chapter06/grub.xml       2005-09-08 12:35:52 UTC (rev 6818)
+++ trunk/BOOK/chapter06/grub.xml       2005-09-09 20:34:44 UTC (rev 6819)
@@ -46,15 +46,8 @@
 <screen><userinput>make</userinput></screen>
 
 <para>To test the results, issue:
-<userinput>sed -i '/ufs2/d' stage2/size_test &amp;&amp;
-make check</userinput>.</para>
+<userinput>make check</userinput>.</para>
 
-<para>The UFS test is known to fail due to a compiler issue.  The failure
-prevents the rest of the tests from being run, so the <command>sed</command>
-command is used to avoid the failure.  The UFS test failure can be ignored
-unless you plan to boot from a UFS partition.  The partitions are normally only
-used by Sun workstations.</para>
-
 <para>Install the package:</para>
 
 <screen><userinput>make install

Modified: trunk/BOOK/chapter06/inetutils.xml
===================================================================
--- trunk/BOOK/chapter06/inetutils.xml  2005-09-08 12:35:52 UTC (rev 6818)
+++ trunk/BOOK/chapter06/inetutils.xml  2005-09-09 20:34:44 UTC (rev 6819)
@@ -30,6 +30,10 @@
 <sect2 role="installation">
 <title>Installation of Inetutils</title>
 
+<para>Apply a patch to Inetutils to enable it to compile with 
GCC-&gcc-version;:</para>
+
+<screen><userinput>patch -Np1 -i 
../&inetutils-gcc4_fixes-patch;</userinput></screen>
+
 <para>All programs that come with Inetutils will not be installed.
 However, the Inetutils build system will insist on installing all the
 man pages anyway. The following patch will correct this

Modified: trunk/BOOK/chapter06/kbd.xml
===================================================================
--- trunk/BOOK/chapter06/kbd.xml        2005-09-08 12:35:52 UTC (rev 6818)
+++ trunk/BOOK/chapter06/kbd.xml        2005-09-09 20:34:44 UTC (rev 6819)
@@ -30,6 +30,11 @@
 <sect2 role="installation">
 <title>Installation of Kbd</title>
 
+<para>Patch Kbd to fix a bug in <command>setfont</command> that is triggered
+when compiling with GCC-&gcc-version;:</para>
+
+<screen><userinput>patch -Np1 -i ../&kbd-gcc4_fixes-patch;</userinput></screen>
+
 <para>Prepare Kbd for compilation:</para>
 
 <screen><userinput>./configure</userinput></screen>

Modified: trunk/BOOK/chapter06/readjusting.xml
===================================================================
--- trunk/BOOK/chapter06/readjusting.xml        2005-09-08 12:35:52 UTC (rev 
6818)
+++ trunk/BOOK/chapter06/readjusting.xml        2005-09-09 20:34:44 UTC (rev 
6819)
@@ -51,11 +51,12 @@
 <para>Remove the Binutils source and build directories now.</para>
 
 <para>Next, amend the GCC specs file so that it points to the new
-dynamic linker. A <command>perl</command> command accomplishes this:</para>
+dynamic linker. A <command>sed</command> command accomplishes this:</para>
 
-<screen><userinput>perl -pi -e 's@ /tools/lib/ld-linux.so.2@ /lib/[EMAIL 
PROTECTED];' \
-    -e '[EMAIL PROTECTED]:[EMAIL PROTECTED]/usr/lib/ @g;' \
-        `gcc -print-file-name=specs`</userinput></screen>
+<screen><userinput>SPECFILE=`dirname $(gcc -print-libgcc-file-name)`/specs 
&amp;&amp;
+gcc -dumpspecs > $SPECFILE &amp;&amp;
+sed -i '[EMAIL PROTECTED]/tools/lib/ld-linux.so.2@/lib/[EMAIL PROTECTED]' 
$SPECFILE &amp;&amp;
+unset SPECFILE</userinput></screen>
 
 <para>It is a good idea to visually inspect the specs file to verify the 
intended 
 change was actually made.</para>

Modified: trunk/BOOK/chapter06/tar.xml
===================================================================
--- trunk/BOOK/chapter06/tar.xml        2005-09-08 12:35:52 UTC (rev 6818)
+++ trunk/BOOK/chapter06/tar.xml        2005-09-09 20:34:44 UTC (rev 6819)
@@ -30,6 +30,11 @@
 <sect2 role="installation">
 <title>Installation of Tar</title>
 
+<para>Apply a patch to fix some issues with the test suite when using 
+GCC-&gcc-version;:</para>
+
+<screen><userinput>patch -Np1 -i ../&tar-gcc4_fix-patch;</userinput></screen>
+
 <para>Tar has a bug when the <parameter>-S</parameter> option is used
 with files larger than 4 GB. The following patch properly fixes this 
issue:</para>
 

Modified: trunk/BOOK/chapter08/kernel.xml
===================================================================
--- trunk/BOOK/chapter08/kernel.xml     2005-09-08 12:35:52 UTC (rev 6818)
+++ trunk/BOOK/chapter08/kernel.xml     2005-09-09 20:34:44 UTC (rev 6819)
@@ -70,7 +70,7 @@
 configuration menus and create the kernel configuration from
 scratch.</para>
 
-<note><para>NPTL requires the kernel to be compiled with GCC-3.x, in this case
+<note><para>NPTL requires the kernel to be compiled with GCC-3.x or later, in 
this case
 &gcc-version;. It is not recommended to compile the kernel with GCC-2.95.x, as
 this causes failures in the Glibc test suite. Normally, this wouldn't be
 mentioned as LFS doesn't build GCC-2.95.x. Unfortunately, the kernel

Modified: trunk/BOOK/general.ent
===================================================================
--- trunk/BOOK/general.ent      2005-09-08 12:35:52 UTC (rev 6818)
+++ trunk/BOOK/general.ent      2005-09-09 20:34:44 UTC (rev 6819)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
-<!ENTITY version "SVN-20050908">
-<!ENTITY releasedate "September 8, 2005">
+<!ENTITY version "SVN-20050909">
+<!ENTITY releasedate "September 9, 2005">
 <!ENTITY milestone "6.2">
 <!ENTITY generic-version "development"> <!-- Use "development", "testing", or 
"x.y[-pre{x}]" -->
 
@@ -40,7 +40,7 @@
 <!ENTITY findutils-version "4.2.25">
 <!ENTITY flex-version "2.5.31">
 <!ENTITY gawk-version "3.1.4">
-<!ENTITY gcc-version "3.4.4">
+<!ENTITY gcc-version "4.0.1">
 <!ENTITY gettext-version "0.14.5">
 <!ENTITY glibc-version "2.3.5">
 <!ENTITY grep-version "2.5.1a">

Modified: trunk/BOOK/patches.ent
===================================================================
--- trunk/BOOK/patches.ent      2005-09-08 12:35:52 UTC (rev 6818)
+++ trunk/BOOK/patches.ent      2005-09-09 20:34:44 UTC (rev 6819)
@@ -14,14 +14,20 @@
 
 <!ENTITY flex-fixes-patch "flex-&flex-version;-debian_fixes-3.patch">
 
-<!ENTITY gcc-no_fixincludes-patch "gcc-&gcc-version;-no_fixincludes-1.patch">
-<!ENTITY gcc-linkonce-patch "gcc-&gcc-version;-linkonce-1.patch">
-<!ENTITY gcc-specs-patch "gcc-&gcc-version;-specs-2.patch">
+<!ENTITY gcc-specs-patch "gcc-&gcc-version;-specs-1.patch">
 
 <!ENTITY glibc-testfix-patch "glibc-&glibc-version;-fix_test-1.patch">
+<!ENTITY glibc-gcc4_symbols-patch 
"glibc-&glibc-version;-gcc4_fix_symbols-1.patch">
+<!ENTITY glibc-gcc4_string-patch 
"glibc-&glibc-version;-gcc4_fix_string-1.patch">
+<!ENTITY glibc-gcc4_elf-patch "glibc-&glibc-version;-gcc4_fix_elf-1.patch">
+<!ENTITY glibc-gcc4_iconvdata-patch 
"glibc-&glibc-version;-gcc4_fix_iconvdata-1.patch">
+<!ENTITY glibc-gcc4_mathtest-patch 
"glibc-&glibc-version;-gcc4_fix_math_tests-1.patch">
 
 <!ENTITY gzip-security_fix-patch "gzip-&gzip-version;-security_fixes-1.patch">
 
+<!ENTITY kbd-gcc4_fixes-patch "kbd-&kbd-version;-gcc4_fixes-1.patch">
+
+<!ENTITY inetutils-gcc4_fixes-patch 
"inetutils-&inetutils-version;-gcc4_fixes-3.patch">
 <!ENTITY inetutils-man_pages-patch 
"inetutils-&inetutils-version;-no_server_man_pages-1.patch">
 
 <!ENTITY mktemp-tempfile-patch "mktemp-&mktemp-version;-add_tempfile-3.patch">
@@ -33,6 +39,7 @@
 <!ENTITY sysklogd-fixes-patch "sysklogd-&sysklogd-version;-fixes-1.patch">
 
 <!ENTITY tar-sparse_fix-patch "tar-&tar-version;-sparse_fix-1.patch">
+<!ENTITY tar-gcc4_fix-patch "tar-&tar-version;-gcc4_fix_tests-1.patch">
 
 <!ENTITY util-linux-cramfs-patch 
"util-linux-&util-linux-version;-cramfs-1.patch">
 

-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-book
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page

Reply via email to