1 | <sect1 id="ch05-locking-glibc">
|
---|
2 | <title>"Locking in" Glibc</title>
|
---|
3 | <?dbhtml filename="lockingglibc.html" dir="chapter05"?>
|
---|
4 |
|
---|
5 | <sect2><title> </title><para> </para></sect2>
|
---|
6 |
|
---|
7 | <sect2>
|
---|
8 | <title>Installation of the linker scripts</title>
|
---|
9 |
|
---|
10 | <para>Run the following command from within the <filename
|
---|
11 | class="directory">binutils-build</filename> directory:</para>
|
---|
12 |
|
---|
13 | <para><screen><userinput>make -C ld install-data-local</userinput></screen></para>
|
---|
14 |
|
---|
15 | <para>This installs the adjusted linker scripts. Remember they were adjusted
|
---|
16 | a little while back, at the end of the first pass of Binutils? The linker
|
---|
17 | scripts now 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 | </sect2>
|
---|
25 |
|
---|
26 | <sect2>
|
---|
27 | <title>Amending GCC's specs file</title>
|
---|
28 |
|
---|
29 | <para>The final thing to do is to amend our GCC specs file so that it points
|
---|
30 | to the new dynamic linker. A simple sed will accomplish this:</para>
|
---|
31 |
|
---|
32 | <para><screen><userinput>SPECFILE=/stage1/lib/gcc-lib/*/*/specs
|
---|
33 | sed -e 's@/lib/ld.so.1@/stage1/lib/ld.so.1@g' \
|
---|
34 | -e 's@/lib/ld-linux.so.2@/stage1/lib/ld-linux.so.2@g' \
|
---|
35 | $SPECFILE > XX
|
---|
36 | mv XX $SPECFILE
|
---|
37 | unset SPECFILE</userinput></screen></para>
|
---|
38 |
|
---|
39 | <para>We recommend that you cut-and-paste the above rather than try and type
|
---|
40 | it all in. Or you can edit the specs file by hand if you want to: just replace
|
---|
41 | "/lib/ld-linux.so.2" with "/stage1/lib/ld-linux.so.2".</para>
|
---|
42 |
|
---|
43 | <para>This completes the installation of the self-contained toolchain, which
|
---|
44 | can now be used to build the rest of the temporary tools.</para>
|
---|
45 |
|
---|
46 | </sect2>
|
---|
47 |
|
---|
48 | </sect1>
|
---|
49 |
|
---|