readjusting.xml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
  3. <!ENTITY % general-entities SYSTEM "../general.ent">
  4. %general-entities;
  5. ]>
  6. <sect1 id="ch-system-readjusting">
  7. <title>Rea-djusting the Toolchain</title>
  8. <?dbhtml filename="readjusting.html"?>
  9. <para>Install the adjusted linker by running the following from within the
  10. <filename class="directory">binutils-build</filename> directory:</para>
  11. <screen><userinput>make -C ld INSTALL=/tools/bin/install install</userinput></screen>
  12. <para>Amend the GCC specs file:</para>
  13. <!-- Ampersands are needed to allow cut and paste -->
  14. <screen><userinput>perl -pi -e 's@ /tools/lib/ld-linux.so.2@ /lib/ld-linux.so.2@g;' \
  15. -e 's@\*startfile_prefix_spec:\n@$_/usr/lib/@g;' \
  16. `gcc --print-file specs`</userinput></screen>
  17. <caution><para>Perform a simple sanity check:</para>
  18. <screen><userinput>echo 'main(){}' &gt; dummy.c
  19. cc dummy.c
  20. readelf -l a.out | grep ': /lib'</userinput></screen>
  21. <para>The output of the last command will be:</para>
  22. <screen><computeroutput>[Requesting program interpreter: /lib/ld-linux.so.2]</computeroutput></screen>
  23. <para>Once you are satisfied that all is well, clean up the test files:</para>
  24. <screen><userinput>rm dummy.c a.out</userinput></screen>
  25. </caution>
  26. </sect1>