Author: jhuntwork
Date: 2007-09-15 14:45:13 -0600 (Sat, 15 Sep 2007)
New Revision: 8374

Modified:
   trunk/BOOK/chapter01/changelog.xml
   trunk/BOOK/chapter01/whatsnew.xml
   trunk/BOOK/chapter03/patches.xml
   trunk/BOOK/chapter05/adjusting.xml
   trunk/BOOK/chapter05/gcc-pass1.xml
   trunk/BOOK/chapter05/gcc-pass2.xml
   trunk/BOOK/chapter05/perl.xml
   trunk/BOOK/chapter06/gcc.xml
   trunk/BOOK/chapter06/perl.xml
   trunk/BOOK/packages.ent
   trunk/BOOK/patches.ent
Log:
Upgrade to GCC-4.2.1. Fixes #2002. Merged from jh branch, thanks to Matthew 
Burgess for preparing a discrete patch.

Modified: trunk/BOOK/chapter01/changelog.xml
===================================================================
--- trunk/BOOK/chapter01/changelog.xml  2007-09-15 20:33:13 UTC (rev 8373)
+++ trunk/BOOK/chapter01/changelog.xml  2007-09-15 20:45:13 UTC (rev 8374)
@@ -40,6 +40,11 @@
        <para>2007-09-15</para>
       <itemizedlist>
         <listitem>
+          <para>[jhuntwork] - Upgrade to GCC-4.2.1. Fixes
+          <ulink url="&lfs-ticket-root;2002">#2002</ulink>.
+         Thanks to Matthew Burgess for preparing a discrete patch.</para>
+        </listitem>
+        <listitem>
           <para>[matthew] - Upgrade to DB-4.6.19. Fixes
           <ulink url="&lfs-ticket-root;2051">#2051</ulink>.</para>
         </listitem>

Modified: trunk/BOOK/chapter01/whatsnew.xml
===================================================================
--- trunk/BOOK/chapter01/whatsnew.xml   2007-09-15 20:33:13 UTC (rev 8373)
+++ trunk/BOOK/chapter01/whatsnew.xml   2007-09-15 20:45:13 UTC (rev 8374)
@@ -77,10 +77,10 @@
     <!--<listitem>
       <para>Gawk &gawk-version;</para>
     </listitem>-->
-    <!--<listitem>
+    <listitem>
       <para>GCC &gcc-version;</para>
     </listitem>
-    <listitem>
+    <!--<listitem>
       <para>Gettext &gettext-version;</para>
     </listitem>-->
     <!--<listitem>
@@ -225,6 +225,10 @@
       <para>db-4.5.29-fixes-1.patch</para>
     </listitem>
 
+    <listitem>
+      <para>gcc-4.1.2-specs-1.patch</para>
+    </listitem>
+
   </itemizedlist>
 
 </sect1>

Modified: trunk/BOOK/chapter03/patches.xml
===================================================================
--- trunk/BOOK/chapter03/patches.xml    2007-09-15 20:33:13 UTC (rev 8373)
+++ trunk/BOOK/chapter03/patches.xml    2007-09-15 20:45:13 UTC (rev 8374)
@@ -83,14 +83,6 @@
     </varlistentry>
 
     <varlistentry>
-      <term>GCC Specs Patch - <token>&gcc-specs-patch-size;</token>:</term>
-      <listitem>
-        <para>Download: <ulink url="&patches-root;&gcc-specs-patch;"/></para>
-        <para>MD5 sum: <literal>&gcc-specs-patch-md5;</literal></para>
-      </listitem>
-    </varlistentry>
-
-    <varlistentry>
       <term>Grep RedHat Fixes Patch - 
<token>&grep-fixes-patch-size;</token>:</term>
       <listitem>
         <para>Download: <ulink url="&patches-root;&grep-fixes-patch;"/></para>

Modified: trunk/BOOK/chapter05/adjusting.xml
===================================================================
--- trunk/BOOK/chapter05/adjusting.xml  2007-09-15 20:33:13 UTC (rev 8373)
+++ trunk/BOOK/chapter05/adjusting.xml  2007-09-15 20:45:13 UTC (rev 8374)
@@ -48,7 +48,7 @@
   </important>
 
 <!-- Ampersands are needed to allow copy and paste -->
-<screen><userinput>gcc -dumpspecs | sed '[EMAIL 
PROTECTED]/lib/ld-linux.so.2@/tools&amp;@g' \
+<screen><userinput>gcc -dumpspecs | sed 's@/lib/ld-linux.so.2@/tools&amp;@g' \
   > `dirname $(gcc -print-libgcc-file-name)`/specs</userinput></screen>
 
   <para>During the build process, GCC runs a script

Modified: trunk/BOOK/chapter05/gcc-pass1.xml
===================================================================
--- trunk/BOOK/chapter05/gcc-pass1.xml  2007-09-15 20:33:13 UTC (rev 8373)
+++ trunk/BOOK/chapter05/gcc-pass1.xml  2007-09-15 20:45:13 UTC (rev 8374)
@@ -101,27 +101,16 @@
 
     </variablelist>
 
-    <para>Continue with compiling the package:</para>
+    <para>The following command will compile GCC not once, but several times. 
It
+    uses the programs compiled in a first round to compile itself a second 
time,
+    and then again a third time. It then compares these second and third 
compiles
+    to make sure it can reproduce itself flawlessly. This is called
+    <quote>bootstrapping</quote>. Building GCC in this way ensures that it was
+    compiled correctly and is now the default configuration for the released
+    package. Continue with compiling by running:</para>
 
-<screen><userinput>make bootstrap</userinput></screen>
+<screen><userinput>make</userinput></screen>
 
-    <variablelist>
-      <title>The meaning of the make parameter:</title>
-
-      <varlistentry>
-        <term><parameter>bootstrap</parameter></term>
-        <listitem>
-          <para>This target does not just compile GCC, but compiles it
-          several times. It uses the programs compiled in a first round
-          to compile itself a second time, and then again a third time.
-          It then compares these second and third compiles to make sure
-          it can reproduce itself flawlessly. This also implies that it
-          was compiled correctly.</para>
-        </listitem>
-      </varlistentry>
-
-    </variablelist>
-
     <para>Compilation is now complete. At this point, the test suite would
     normally be run, but, as mentioned before, the test suite framework is
     not in place yet. The benefits of running the tests at this point

Modified: trunk/BOOK/chapter05/gcc-pass2.xml
===================================================================
--- trunk/BOOK/chapter05/gcc-pass2.xml  2007-09-15 20:33:13 UTC (rev 8373)
+++ trunk/BOOK/chapter05/gcc-pass2.xml  2007-09-15 20:45:13 UTC (rev 8374)
@@ -90,24 +90,40 @@
 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
+    <para>The following command will change the location of GCC's default
+    dynamic linker to use the one we installed in
+    <filename class="directory">/tools</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
+    Doing this 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>
+    against the new Glibc. Issue:</para>
 
-    <important>
-      <para>The above patch is critical in ensuring a successful overall
-      build. Do not forget to apply it.</para>
-    </important>
+<screen><userinput>for file in $(find gcc/config -name linux64.h -o -name 
linux.h)
+do
+  cp -uv $file{,.orig}
+  sed -e 's@/lib\(64\)\?\(32\)\?/ld@/tools&amp;@g' \
+  -e 's@/usr@/[EMAIL PROTECTED]' $file.orig &gt; $file
+  echo "
+#undef STANDARD_INCLUDE_DIR
+#define STANDARD_INCLUDE_DIR 0" &gt;&gt; $file
+  touch $file.orig
+done</userinput></screen>
 
+    <para>In case the above seems hard to follow, let's break it down a bit.
+    First we find all the files under the gcc/config directory that are named
+    either <filename>linux.h</filename> or <filename>linux64.h</filename>.
+    For each file found, we copy it to a file of the same name but with an 
added
+    suffix of <quote>.orig</quote>. Then the first sed expression prepends
+    <quote>/tools</quote> to every instance of <quote>/lib/ld</quote>,
+    <quote>/lib64/ld</quote> or <quote>/lib32/ld</quote>, while the second one
+    replaces hard-coded instances of <quote>/usr</quote>. Then we add our 
define
+    statements which alter the include search path to the end of the file. 
Finally,
+    we use <command>touch</command> to update the timestamp on the copied 
files.
+    When used in conjunction with <command>cp -u</command>, this prevents 
unexpected
+    changes to the original files in case the command is inadvertently run 
twice.
+    </para>
+
     <para>Create a separate build directory again:</para>
 
 <screen><userinput>mkdir -v ../gcc-build
@@ -122,7 +138,7 @@
     --with-local-prefix=/tools --enable-clocale=gnu \
     --enable-shared --enable-threads=posix \
     --enable-__cxa_atexit --enable-languages=c,c++ \
-    --disable-libstdcxx-pch</userinput></screen>
+    --disable-libstdcxx-pch --disable-bootstrap</userinput></screen>
 
     <variablelist>
       <title>The meaning of the new configure options:</title>
@@ -177,6 +193,15 @@
         </listitem>
       </varlistentry>
 
+      <varlistentry>
+        <term><parameter>--disable-bootstrap</parameter></term>
+        <listitem>
+          <para>Bootstrapping the compiler is now the default for GCC. However,
+         our build method should provide us with a solid compiler without the
+         need to bootstrap each time.</para>
+        </listitem>
+      </varlistentry>
+
     </variablelist>
 
     <para>Compile the package:</para>

Modified: trunk/BOOK/chapter05/perl.xml
===================================================================
--- trunk/BOOK/chapter05/perl.xml       2007-09-15 20:33:13 UTC (rev 8373)
+++ trunk/BOOK/chapter05/perl.xml       2007-09-15 20:45:13 UTC (rev 8374)
@@ -48,6 +48,11 @@
 
 <screen><userinput>patch -Np1 -i ../&perl-libc-patch;</userinput></screen>
 
+    <para>Fix an incompatibility with gcc-&gcc-version;:</para>
+
+<screen><userinput>mv -v makedepend.SH{,.orig}
+sed 's/command /command[ -]/' makedepend.SH.orig &gt; 
makedepend.SH</userinput></screen>
+
     <para>Prepare Perl for compilation (make sure to get the
     'Data/Dumper Fcntl IO POSIX' part of the command correct&mdash;they are all
     letters):</para>

Modified: trunk/BOOK/chapter06/gcc.xml
===================================================================
--- trunk/BOOK/chapter06/gcc.xml        2007-09-15 20:33:13 UTC (rev 8373)
+++ trunk/BOOK/chapter06/gcc.xml        2007-09-15 20:45:13 UTC (rev 8374)
@@ -83,7 +83,8 @@
 <screen><userinput>../gcc-&gcc-version;/configure --prefix=/usr \
     --libexecdir=/usr/lib --enable-shared \
     --enable-threads=posix --enable-__cxa_atexit \
-    --enable-clocale=gnu --enable-languages=c,c++</userinput></screen>
+    --enable-clocale=gnu --enable-languages=c,c++ \
+    --disable-bootstrap</userinput></screen>
 
     <para>Compile the package:</para>
 

Modified: trunk/BOOK/chapter06/perl.xml
===================================================================
--- trunk/BOOK/chapter06/perl.xml       2007-09-15 20:33:13 UTC (rev 8373)
+++ trunk/BOOK/chapter06/perl.xml       2007-09-15 20:45:13 UTC (rev 8374)
@@ -47,6 +47,10 @@
 
 <screen><userinput>echo "127.0.0.1 localhost $(hostname)" &gt; 
/etc/hosts</userinput></screen>
 
+    <para>Fix an incompatibility with gcc-&gcc-version;:</para>
+
+<screen><userinput>sed -i 's/command /command[ -]/' 
makedepend.SH</userinput></screen>
+
     <para>To have full control over the way Perl is set up, you can run the
     interactive <command>Configure</command> script and hand-pick the way this
     package is built. If you prefer, you can use the defaults that Perl

Modified: trunk/BOOK/packages.ent
===================================================================
--- trunk/BOOK/packages.ent     2007-09-15 20:33:13 UTC (rev 8373)
+++ trunk/BOOK/packages.ent     2007-09-15 20:45:13 UTC (rev 8374)
@@ -168,10 +168,10 @@
 <!ENTITY gawk-ch6-du "18.2 MB">
 <!ENTITY gawk-ch6-sbu "0.2 SBU">
 
-<!ENTITY gcc-version "4.1.2">
-<!ENTITY gcc-size "38,777 KB">
+<!ENTITY gcc-version "4.2.1">
+<!ENTITY gcc-size "43,029 KB">
 <!ENTITY gcc-url "&gnu;gcc/gcc-&gcc-version;/gcc-&gcc-version;.tar.bz2">
-<!ENTITY gcc-md5 "a4a3eb15c96030906d8494959eeda23c">
+<!ENTITY gcc-md5 "cba410e6ff70f7d7f4be7a0267707fd0">
 <!ENTITY gcc-home "http://gcc.gnu.org/";>
 <!ENTITY gcc-ch5p1-du "655 MB">
 <!ENTITY gcc-ch5p1-sbu "9.2 SBU">

Modified: trunk/BOOK/patches.ent
===================================================================
--- trunk/BOOK/patches.ent      2007-09-15 20:33:13 UTC (rev 8373)
+++ trunk/BOOK/patches.ent      2007-09-15 20:45:13 UTC (rev 8374)
@@ -39,10 +39,6 @@
 <!ENTITY gawk-segfault-patch-size "1.3 KB">
 
 
-<!ENTITY gcc-specs-patch "gcc-&gcc-version;-specs-1.patch">
-<!ENTITY gcc-specs-patch-md5 "a17be8ccfb978e73f382be5093dd8abd">
-<!ENTITY gcc-specs-patch-size "14.8 KB">
-
 <!ENTITY grep-fixes-patch "grep-&grep-version;-redhat_fixes-2.patch">
 <!ENTITY grep-fixes-patch-md5 "2c67910be2d0a54714f63ce350e6d8a6">
 <!ENTITY grep-fixes-patch-size "55 KB">

-- 
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