r7306 - in trunk/BOOK: chapter01 chapter05 chapter06

jhuntwork at linuxfromscratch.org jhuntwork at linuxfromscratch.org
Wed Jan 25 19:45:19 PST 2006


Author: jhuntwork
Date: 2006-01-25 20:45:12 -0700 (Wed, 25 Jan 2006)
New Revision: 7306

Modified:
   trunk/BOOK/chapter01/changelog.xml
   trunk/BOOK/chapter05/binutils-pass2.xml
   trunk/BOOK/chapter06/gcc.xml
   trunk/BOOK/chapter06/introduction.xml
   trunk/BOOK/chapter06/readjusting.xml
   trunk/BOOK/chapter06/revisedchroot.xml
Log:
Fixed the re-adjusting of the toolchain in chapter 6 so that chapter 6 GCC and Binutils links against the proper Glibc and so that we don't have to keep the binutils directories from chapter 5.
Also moved a note about saving the /tools directory to the beginning of chapter 6.
Fixes bug 1677. Thanks to Chris Staub, Alexander Patrakov, Greg Schafer and Tushar Teredesai for reporting and resolving this issue.


Modified: trunk/BOOK/chapter01/changelog.xml
===================================================================
--- trunk/BOOK/chapter01/changelog.xml	2006-01-26 02:35:40 UTC (rev 7305)
+++ trunk/BOOK/chapter01/changelog.xml	2006-01-26 03:45:12 UTC (rev 7306)
@@ -48,6 +48,14 @@
 	  the correct Glibc. Fixes bug 1675. Thanks to Dan Nicholson for the report
 	  and Greg Schafer for the fix.</para>
 	</listitem>
+	<listitem>
+	  <para>[jhuntwork] - Fixed the re-adjusting of the toolchain in chapter 6
+	  so that chapter 6 GCC and Binutils links against the proper Glibc and so
+	  that we don't have to keep the binutils directories from chapter 5. Also
+	  moved a note about saving the /tools directory to the beginning of chapter 6.
+	  Fixes bug 1677. Thanks to Chris Staub, Alexander Patrakov, Greg Schafer and
+	  Tushar Teredesai for reporting and resolving this issue.</para>
+	</listitem>
       </itemizedlist>
     </listitem>
 

Modified: trunk/BOOK/chapter05/binutils-pass2.xml
===================================================================
--- trunk/BOOK/chapter05/binutils-pass2.xml	2006-01-26 02:35:40 UTC (rev 7305)
+++ trunk/BOOK/chapter05/binutils-pass2.xml	2006-01-26 03:45:12 UTC (rev 7306)
@@ -82,18 +82,6 @@
 
 <screen><userinput>make install</userinput></screen>
 
-    <para>Now prepare the linker for the <quote>Re-adjusting</quote> phase in
-    the next chapter:</para>
-
-<screen><userinput>make -C ld clean
-make -C ld LIB_PATH=/usr/lib:/lib</userinput></screen>
-
-    <warning>
-      <para><emphasis>Do not</emphasis> remove the Binutils source and build
-      directories yet. These directories will be needed again in the next
-      chapter in their current state.</para>
-    </warning>
-
   </sect2>
 
   <sect2 role="content">

Modified: trunk/BOOK/chapter06/gcc.xml
===================================================================
--- trunk/BOOK/chapter06/gcc.xml	2006-01-26 02:35:40 UTC (rev 7305)
+++ trunk/BOOK/chapter06/gcc.xml	2006-01-26 03:45:12 UTC (rev 7306)
@@ -99,11 +99,6 @@
 
 <screen><userinput>ln -sv ../usr/bin/cpp /lib</userinput></screen>
 
-<para>Many packages use the name <command>cc</command> to call the C
-compiler. To satisfy those packages, create a symlink:</para>
-
-<screen><userinput>ln -sv gcc /usr/bin/cc</userinput></screen>
-
 <note><para>At this point, it is strongly recommended to repeat the
 sanity check performed earlier in this chapter. Refer back to <xref
 linkend="ch-system-readjusting" role=","/> and repeat the check. If the results

Modified: trunk/BOOK/chapter06/introduction.xml
===================================================================
--- trunk/BOOK/chapter06/introduction.xml	2006-01-26 02:35:40 UTC (rev 7305)
+++ trunk/BOOK/chapter06/introduction.xml	2006-01-26 03:45:12 UTC (rev 7306)
@@ -58,5 +58,10 @@
 programs and libraries (along with brief descriptions of these) that
 the package installs.</para>
 
+<note><para>At this point, you may wish to keep your finished temporary
+tools for use in future LFS builds by creating a tarball of the
+<filename class="directory">/tools</filename> directory and
+storing it in a safe location.</para></note>
+
 </sect1>
 

Modified: trunk/BOOK/chapter06/readjusting.xml
===================================================================
--- trunk/BOOK/chapter06/readjusting.xml	2006-01-26 02:35:40 UTC (rev 7305)
+++ trunk/BOOK/chapter06/readjusting.xml	2006-01-26 03:45:12 UTC (rev 7306)
@@ -9,7 +9,7 @@
 
 <para>Now that the final C libraries have been installed, it is time to adjust
 the toolchain again. The toolchain will be adjusted so that it will link any
-newly compiled program against these new libraries. This is the same process
+newly compiled program against these new libraries. This is a similar process
 used in the <quote>Adjusting</quote> phase in the beginning of <xref
 linkend="chapter-temporary-tools"/>, but with the adjustments reversed. In <xref
 linkend="chapter-temporary-tools"/>, the chain was guided from the host's
@@ -19,38 +19,7 @@
 directory to the LFS <filename class="directory">/{,usr/}lib</filename>
 directories.</para>
 
-<para>Start by adjusting the linker. The source and build directories from the
-second pass of Binutils were retained for this purpose. Install the adjusted
-linker by running the following command from within the <filename
-class="directory">binutils-build</filename> directory:</para>
-
-<screen><userinput>make -C ld INSTALL=/tools/bin/install install</userinput></screen>
-
-<note><para>If the earlier warning to retain the Binutils source and
-build directories from the second pass in <xref
-linkend="chapter-temporary-tools"/> was missed, or if they were
-accidentally deleted or are inaccessible, ignore the above command.
-The result will be that the next package, Binutils, will link against
-the C libraries in <filename class="directory">/tools</filename>
-rather than in <filename class="directory">/{,usr/}lib</filename>.
-This is not ideal, however, testing has shown that the resulting
-Binutils program binaries should be identical.</para></note>
-
-<para>From now on, every compiled program will link only against the
-libraries in <filename class="directory">/usr/lib</filename> and
-<filename class="directory">/lib</filename>. The extra
-<parameter>INSTALL=/tools/bin/install</parameter> option is needed
-because the <filename>Makefile</filename> file created during the
-second pass still contains the reference to
-<command>/usr/bin/install</command>, which has not been installed yet.
-Some host distributions contain a <filename
-class="symlink">ginstall</filename> symbolic link which takes
-precedence in the <filename>Makefile</filename> file and can cause a
-problem. The above command takes care of this issue.</para>
-
-<para>Remove the Binutils source and build directories now.</para>
-
-<para>Next, amend the GCC specs file so that it points to the new
+<para>First, amend the GCC specs file so that it points to the new
 dynamic linker. A <command>sed</command> command accomplishes this:</para>
 
 <screen><userinput>SPECFILE=`dirname $(gcc -print-libgcc-file-name)`/specs &&
@@ -69,6 +38,22 @@
 linkend="ch-tools-toolchaintechnotes" role=","/> if
 necessary.</para></important>
 
+<para>Now create temporary wrapper scripts for <filename>gcc</filename> and
+<filename>ld</filename>. These scripts will point to their real counterparts
+in <filename class="directory">/tools</filename> but with adjusted parameters
+to ensure that GCC in the next section links to our newly installed Glibc.</para>
+
+<screen><userinput>cat > /usr/bin/gcc << "EOF"
+#!/bin/bash
+/tools/bin/gcc -B/usr/lib $@
+EOF
+cat > /usr/bin/ld << "EOF"
+#!/bin/bash
+/tools/bin/ld -nostdlib -L/usr/lib -L/lib $@
+EOF
+chmod 755 /usr/bin/{ld,gcc}
+ln -s gcc /usr/bin/cc</userinput></screen>
+
 <caution><para>It is imperative at this point to stop and ensure that
 the basic functions (compiling and linking) of the adjusted toolchain
 are working as expected. To do this, perform a sanity

Modified: trunk/BOOK/chapter06/revisedchroot.xml
===================================================================
--- trunk/BOOK/chapter06/revisedchroot.xml	2006-01-26 02:35:40 UTC (rev 7305)
+++ trunk/BOOK/chapter06/revisedchroot.xml	2006-01-26 03:45:12 UTC (rev 7306)
@@ -18,8 +18,7 @@
 <para>The reason for this is that the programs in <filename
 class="directory">/tools</filename> are no longer needed.  Since they are no
 longer needed you can delete the <filename class="directory">/tools</filename>
-directory if so desired or tar it up and keep it to build another final
-system.</para>
+directory if so desired.</para>
 
 <note><para>Removing <filename class="directory">/tools</filename> will also
 remove the temporary copies of Tcl, Expect, and DejaGNU which were used for




More information about the lfs-book mailing list