diff options
author | Matthew Burgess <matthew@linuxfromscratch.org> | 2005-09-09 20:34:44 +0000 |
---|---|---|
committer | Matthew Burgess <matthew@linuxfromscratch.org> | 2005-09-09 20:34:44 +0000 |
commit | 2e02c35ad71fcbd0b932edf49eb9a8d5e49179b1 (patch) | |
tree | e5a6a1882b04b9bf8d427bc3dfa27398b38f3b46 /chapter05/adjusting.xml | |
parent | 98fe721a0601f13d3659b84ef88fd788418491dc (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.xml | 28 |
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` && -sed 's@ /lib/ld-linux.so.2@ /tools/lib/ld-linux.so.2@g' \ - $SPECFILE > tempspecfile && +<screen><userinput>SPECFILE=`dirname $(gcc -print-libgcc-file-name)`/specs && +gcc -dumpspecs > $SPECFILE && +sed 's@^/lib/ld-linux.so.2@/tools&@g' $SPECFILE > tempspecfile && mv -f tempspecfile $SPECFILE && 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 && +find ${GCC_INCLUDEDIR}/* -maxdepth 0 -xtype d -exec rm -rf '{}' \; && +rm -f `grep -l "DO NOT EDIT THIS FILE" ${GCC_INCLUDEDIR}/*` && +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 |