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