aboutsummaryrefslogtreecommitdiffstats
path: root/chapter05/adjusting.xml
diff options
context:
space:
mode:
authorMatthew Burgess <matthew@linuxfromscratch.org>2005-09-09 20:34:44 +0000
committerMatthew Burgess <matthew@linuxfromscratch.org>2005-09-09 20:34:44 +0000
commit2e02c35ad71fcbd0b932edf49eb9a8d5e49179b1 (patch)
treee5a6a1882b04b9bf8d427bc3dfa27398b38f3b46 /chapter05/adjusting.xml
parent98fe721a0601f13d3659b84ef88fd788418491dc (diff)
Upgrade to gcc-4.0.1 (merge of gcc4 branch)
git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@6819 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
Diffstat (limited to 'chapter05/adjusting.xml')
-rw-r--r--chapter05/adjusting.xml28
1 files changed, 16 insertions, 12 deletions
diff --git a/chapter05/adjusting.xml b/chapter05/adjusting.xml
index 3f5ff2958..1991bd36d 100644
--- a/chapter05/adjusting.xml
+++ b/chapter05/adjusting.xml
@@ -31,14 +31,16 @@ second pass of Binutils is installed later.</para></note>
<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/ld-linux.so.2@g' \
- $SPECFILE &gt; tempspecfile &amp;&amp;
+<screen><userinput>SPECFILE=`dirname $(gcc -print-libgcc-file-name)`/specs &amp;&amp;
+gcc -dumpspecs > $SPECFILE &amp;&amp;
+sed 's@^/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 @@ dynamic linker in the above commands. Refer back to <xref
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