[bc82645e] | 1 | <sect1 id="ch05-locking-glibc">
|
---|
| 2 | <title>"Locking in" Glibc</title>
|
---|
| 3 | <?dbhtml filename="lockingglibc.html" dir="chapter05"?>
|
---|
| 4 |
|
---|
[1f30432] | 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>
|
---|
[bc82645e] | 9 |
|
---|
[1f30432] | 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>
|
---|
[2cff2cc] | 13 |
|
---|
[e91d8ce] | 14 | <para><screen><userinput>make -C ld install-data-local</userinput></screen></para>
|
---|
[bc82645e] | 15 |
|
---|
[1f30432] | 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>,
|
---|
[66e4325] | 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>
|
---|
[78deb7d] | 21 |
|
---|
[ab6f1859] | 22 | <para>You can now remove Binutils' build and source directories.</para>
|
---|
[66e4325] | 23 |
|
---|
[1f30432] | 24 | <para>The other thing to do is to amend our GCC specs file so that it points
|
---|
[66e4325] | 25 | to the new dynamic linker. A simple sed will accomplish this:</para>
|
---|
| 26 |
|
---|
[585ce08] | 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' \
|
---|
[1f30432] | 30 | $SPECFILE > tempspecfile
|
---|
| 31 | mv tempspecfile $SPECFILE
|
---|
[585ce08] | 32 | unset SPECFILE</userinput></screen></para>
|
---|
[bc82645e] | 33 |
|
---|
[66e4325] | 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 |
|
---|
[bc82645e] | 41 | </sect1>
|
---|
| 42 |
|
---|