aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chapter01/changelog.xml5
-rw-r--r--chapter01/whatsnew.xml8
-rw-r--r--chapter03/patches.xml8
-rw-r--r--chapter05/adjusting.xml2
-rw-r--r--chapter05/gcc-pass1.xml29
-rw-r--r--chapter05/gcc-pass2.xml55
-rw-r--r--chapter05/perl.xml5
-rw-r--r--chapter06/gcc.xml3
-rw-r--r--chapter06/perl.xml4
-rw-r--r--packages.ent6
-rw-r--r--patches.ent4
11 files changed, 75 insertions, 54 deletions
diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml
index 9f2d73f8b..6dabdd7be 100644
--- a/chapter01/changelog.xml
+++ b/chapter01/changelog.xml
@@ -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>
diff --git a/chapter01/whatsnew.xml b/chapter01/whatsnew.xml
index 2afda712a..e8c63c12c 100644
--- a/chapter01/whatsnew.xml
+++ b/chapter01/whatsnew.xml
@@ -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>
diff --git a/chapter03/patches.xml b/chapter03/patches.xml
index 1852980d8..33a80cd03 100644
--- a/chapter03/patches.xml
+++ b/chapter03/patches.xml
@@ -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>
diff --git a/chapter05/adjusting.xml b/chapter05/adjusting.xml
index bad013455..322d82c6b 100644
--- a/chapter05/adjusting.xml
+++ b/chapter05/adjusting.xml
@@ -48,7 +48,7 @@ ln -sv /tools/bin/ld /tools/$(gcc -dumpmachine)/bin/ld</userinput></screen>
</important>
<!-- Ampersands are needed to allow copy and paste -->
-<screen><userinput>gcc -dumpspecs | sed 's@^/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
diff --git a/chapter05/gcc-pass1.xml b/chapter05/gcc-pass1.xml
index 068fdf698..5bbb78173 100644
--- a/chapter05/gcc-pass1.xml
+++ b/chapter05/gcc-pass1.xml
@@ -101,26 +101,15 @@ cd ../gcc-build</userinput></screen>
</variablelist>
- <para>Continue with compiling the package:</para>
-
-<screen><userinput>make bootstrap</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>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</userinput></screen>
<para>Compilation is now complete. At this point, the test suite would
normally be run, but, as mentioned before, the test suite framework is
diff --git a/chapter05/gcc-pass2.xml b/chapter05/gcc-pass2.xml
index 53743acb6..2be683d55 100644
--- a/chapter05/gcc-pass2.xml
+++ b/chapter05/gcc-pass2.xml
@@ -90,23 +90,39 @@ sed 's@\./fixinc\.sh@-c true@' gcc/Makefile.in.orig &gt; gcc/Makefile.in</userin
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>
-
- <important>
- <para>The above patch is critical in ensuring a successful overall
- build. Do not forget to apply it.</para>
- </important>
+ against the new Glibc. Issue:</para>
+
+<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@/tools@g' $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>
@@ -122,7 +138,7 @@ cd ../gcc-build</userinput></screen>
--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 @@ cd ../gcc-build</userinput></screen>
</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>
diff --git a/chapter05/perl.xml b/chapter05/perl.xml
index 6e9a87b76..0885cbbec 100644
--- a/chapter05/perl.xml
+++ b/chapter05/perl.xml
@@ -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>
diff --git a/chapter06/gcc.xml b/chapter06/gcc.xml
index ff6a76116..229c56398 100644
--- a/chapter06/gcc.xml
+++ b/chapter06/gcc.xml
@@ -83,7 +83,8 @@ cd ../gcc-build</userinput></screen>
<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>
diff --git a/chapter06/perl.xml b/chapter06/perl.xml
index 591e90ba8..77d027b89 100644
--- a/chapter06/perl.xml
+++ b/chapter06/perl.xml
@@ -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
diff --git a/packages.ent b/packages.ent
index a91eda630..99d1b743e 100644
--- a/packages.ent
+++ b/packages.ent
@@ -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">
diff --git a/patches.ent b/patches.ent
index 655917296..43c46b305 100644
--- a/patches.ent
+++ b/patches.ent
@@ -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">