2003-05-02 19:20:20 +01:00
|
|
|
<sect1 id="ch05-locking-glibc">
|
|
|
|
<title>"Locking in" Glibc</title>
|
|
|
|
<?dbhtml filename="lockingglibc.html" dir="chapter05"?>
|
|
|
|
|
2003-08-25 22:41:50 +01:00
|
|
|
<para>Now that the temporary C libraries have been installed, we want all
|
|
|
|
the tools compiled in the rest of this chapter to be linked against these
|
|
|
|
libraries. To accomplish this, we need to adjust the linker's scripts and the
|
|
|
|
compiler's specs file.</para>
|
2003-05-02 19:20:20 +01:00
|
|
|
|
2003-08-25 22:41:50 +01:00
|
|
|
<para>First install the adjusted linker scripts by running the following from
|
|
|
|
within the <filename class="directory">binutils-build</filename>
|
|
|
|
directory:</para>
|
2003-08-18 17:03:34 +01:00
|
|
|
|
2003-05-11 03:44:11 +01:00
|
|
|
<para><screen><userinput>make -C ld install-data-local</userinput></screen></para>
|
2003-05-02 19:20:20 +01:00
|
|
|
|
2003-08-25 22:41:50 +01:00
|
|
|
<para>These scripts were adjusted a little while back, at the end of the first
|
|
|
|
pass of Binutils, and contain no mention of <filename>/lib</filename>,
|
2003-06-03 23:25:25 +01:00
|
|
|
<filename>/usr/lib</filename> or <filename>/usr/local/lib</filename>.
|
|
|
|
From this point onwards everything will link <emphasis>only</emphasis>
|
|
|
|
against the libraries in <filename>/stage1/lib</filename>.</para>
|
2003-05-06 23:53:37 +01:00
|
|
|
|
2003-08-11 23:49:50 +01:00
|
|
|
<para>You can now remove Binutils' build and source directories.</para>
|
2003-06-03 23:25:25 +01:00
|
|
|
|
2003-08-25 22:41:50 +01:00
|
|
|
<para>The other thing to do is to amend our GCC specs file so that it points
|
2003-06-03 23:25:25 +01:00
|
|
|
to the new dynamic linker. A simple sed will accomplish this:</para>
|
|
|
|
|
2003-05-10 18:20:47 +01:00
|
|
|
<para><screen><userinput>SPECFILE=/stage1/lib/gcc-lib/*/*/specs
|
|
|
|
sed -e 's@/lib/ld.so.1@/stage1/lib/ld.so.1@g' \
|
|
|
|
-e 's@/lib/ld-linux.so.2@/stage1/lib/ld-linux.so.2@g' \
|
2003-08-25 22:41:50 +01:00
|
|
|
$SPECFILE > tempspecfile
|
|
|
|
mv tempspecfile $SPECFILE
|
2003-05-10 18:20:47 +01:00
|
|
|
unset SPECFILE</userinput></screen></para>
|
2003-05-02 19:20:20 +01:00
|
|
|
|
2003-06-03 23:25:25 +01:00
|
|
|
<para>We recommend that you cut-and-paste the above rather than try and type
|
|
|
|
it all in. Or you can edit the specs file by hand if you want to: just replace
|
|
|
|
"/lib/ld-linux.so.2" with "/stage1/lib/ld-linux.so.2".</para>
|
|
|
|
|
|
|
|
<para>This completes the installation of the self-contained toolchain, which
|
|
|
|
can now be used to build the rest of the temporary tools.</para>
|
|
|
|
|
2003-05-02 19:20:20 +01:00
|
|
|
</sect1>
|
|
|
|
|