lockingglibc.xml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <sect1 id="ch05-locking-glibc">
  2. <title>"Locking in" Glibc</title>
  3. <?dbhtml filename="lockingglibc.html" dir="chapter05"?>
  4. <sect2><title>&nbsp;</title><para>&nbsp;</para></sect2>
  5. <sect2>
  6. <title>Installation of the linker scripts</title>
  7. <para><screen><userinput>make -C ld install-data-local</userinput></screen></para>
  8. <para>This installs the adjusted linker scripts. Remember they were adjusted
  9. a little while back, at the end of the first pass of Binutils? The linker
  10. scripts now contain no mention of <filename>/lib</filename>,
  11. <filename>/usr/lib</filename> or <filename>/usr/local/lib</filename>.
  12. From this point onwards everything will link <emphasis>only</emphasis>
  13. against the libraries in <filename>/stage1/lib</filename>.</para>
  14. <para>You can now remove Binutils' build and source directories.</para>
  15. </sect2>
  16. <sect2>
  17. <title>Amending GCC's specs file</title>
  18. <para>The final thing to do is to amend our GCC specs file so that it points
  19. to the new dynamic linker. A simple sed will accomplish this:</para>
  20. <para><screen><userinput>SPECFILE=/stage1/lib/gcc-lib/*/*/specs
  21. sed -e 's@/lib/ld.so.1@/stage1/lib/ld.so.1@g' \
  22. &nbsp;&nbsp;&nbsp;&nbsp;-e 's@/lib/ld-linux.so.2@/stage1/lib/ld-linux.so.2@g' \
  23. &nbsp;&nbsp;&nbsp;&nbsp;$SPECFILE > XX
  24. mv XX $SPECFILE
  25. unset SPECFILE</userinput></screen></para>
  26. <para>We recommend that you cut-and-paste the above rather than try and type
  27. it all in. Or you can edit the specs file by hand if you want to: just replace
  28. "/lib/ld-linux.so.2" with "/stage1/lib/ld-linux.so.2".</para>
  29. <para>This completes the installation of the self-contained toolchain, which
  30. can now be used to build the rest of the temporary tools.</para>
  31. </sect2>
  32. </sect1>