binutils-pass2.xml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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-tools-binutils-pass2" role="wrap">
  7. <title>Binutils-&binutils-version; - Pass 2</title>
  8. <?dbhtml filename="binutils-pass2.html"?>
  9. <indexterm zone="ch-tools-binutils-pass2">
  10. <primary sortas="a-Binutils">Binutils</primary>
  11. <secondary>tools, pass 2</secondary></indexterm>
  12. <sect2 role="package"><title/>
  13. <segmentedlist>
  14. <segtitle>&buildtime;</segtitle>
  15. <segtitle>&diskspace;</segtitle>
  16. <seglistitem><seg>1.5 SBU</seg><seg>108 MB</seg></seglistitem>
  17. </segmentedlist>
  18. </sect2>
  19. <sect2 role="installation">
  20. <title>Re-installation of Binutils</title>
  21. <para>The current version of Binutils in use has a bug that causes strip to
  22. remove necessary information from certain library files. This patch fixes
  23. the problem:</para>
  24. <screen><userinput>patch -Np1 -i ../binutils-&binutils-version;-fix_strip-1.patc
  25. h</userinput></screen>
  26. <para>Create a separate build directory again:</para>
  27. <screen><userinput>mkdir ../binutils-build
  28. cd ../binutils-build</userinput></screen>
  29. <para>Now prepare Binutils for compilation:</para>
  30. <screen><userinput>../binutils-&binutils-version;/configure --prefix=/tools \
  31. --enable-shared --with-lib-path=/tools/lib</userinput></screen>
  32. <para>The meaning of the new configure option:</para>
  33. <variablelist>
  34. <varlistentry>
  35. <term><parameter>--with-lib-path=/tools/lib</parameter></term>
  36. <listitem><para>This tells the configure script to specify the library search path
  37. during the compilation of Binutils, resulting in <parameter>/tools/lib</parameter>
  38. to be passed to the linker. This prevents the linker from searching through library
  39. directories on the host.</para></listitem>
  40. </varlistentry>
  41. </variablelist>
  42. <para>Before starting to build Binutils, remember to unset any environment
  43. variables that override the default optimization flags.</para>
  44. <para>Compile the package:</para>
  45. <screen><userinput>make</userinput></screen>
  46. <para>Compilation is now complete. As discussed earlier, running the test suite
  47. isn't mandatory for the temporary tools here in this chapter. If you do want to
  48. run the Binutils test suite though, the following command will do so:</para>
  49. <screen><userinput>make -k check</userinput></screen>
  50. <para>Except for a few known failures, the binutils tests should all pass. The
  51. exceptions to this rule are as follows:</para>
  52. <screen><computeroutput>* 5 FAIL (unexpected failure) for visibility
  53. * 1 FAIL for selective4
  54. * 1 FAIL for selective5</computeroutput></screen>
  55. <!--
  56. <para>There should be no unexpected failures here, expected failures are fine.
  57. Unfortunately, there is no easy way to view the test results summary like there
  58. was for the GCC package. However, if a failure occurs here, it should be easy
  59. to spot. The output shown will contain something like:</para>
  60. <blockquote><screen><computeroutput>make[1]: *** [check-binutils] Error 2</computeroutput></screen></blockquote>
  61. -->
  62. <para>And install the package:</para>
  63. <screen><userinput>make install</userinput></screen>
  64. <para>Now prepare the linker for the <quote>Re-adjusting</quote> phase in the next
  65. chapter:</para>
  66. <screen><userinput>make -C ld clean
  67. make -C ld LIB_PATH=/usr/lib:/lib</userinput></screen>
  68. <warning><para><emphasis>Do not yet remove</emphasis> the Binutils source and
  69. build directories. You will need these directories again in the next chapter
  70. in the state they are in now.</para></warning>
  71. </sect2>
  72. <sect2 role="content"><title/>
  73. <para>The details on this package are found in <xref linkend="contents-binutils"/>.</para>
  74. </sect2>
  75. </sect1>