binutils-pass2.xml 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/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. <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
  14. href="../chapter06/binutils.xml"
  15. xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
  16. <segmentedlist>
  17. <segtitle>&buildtime;</segtitle>
  18. <segtitle>&diskspace;</segtitle>
  19. <seglistitem><seg>1.5 SBU</seg><seg>108 MB</seg></seglistitem>
  20. </segmentedlist>
  21. <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
  22. href="../chapter06/binutils.xml"
  23. xpointer="xpointer(/sect1/sect2[1]/segmentedlist[2])"/>
  24. </sect2>
  25. <sect2 role="installation">
  26. <title>Re-installation of Binutils</title>
  27. <para>This package is known to have issues when its default
  28. optimization flags (including the <parameter>-march</parameter> and
  29. <parameter>-mcpu</parameter> options) are changed. If any environment
  30. variables that override default optimizations have been defined, such
  31. as <envar>CFLAGS</envar> and <envar>CXXFLAGS</envar>,
  32. unset them when building Binutils.</para>
  33. <para>Create a separate build directory again:</para>
  34. <screen><userinput>mkdir ../binutils-build
  35. cd ../binutils-build</userinput></screen>
  36. <para>Prepare Binutils for compilation:</para>
  37. <screen><userinput>../binutils-&binutils-version;/configure --prefix=/tools \
  38. --enable-shared --with-lib-path=/tools/lib</userinput></screen>
  39. <para>The meaning of the new configure option:</para>
  40. <variablelist>
  41. <varlistentry>
  42. <term><parameter>--with-lib-path=/tools/lib</parameter></term>
  43. <listitem><para>This tells the configure script to specify the library
  44. search path during the compilation of Binutils, resulting in <filename
  45. class="directory">/tools/lib</filename> being passed to the linker.
  46. This prevents the linker from searching through library directories on
  47. the host.</para></listitem>
  48. </varlistentry>
  49. </variablelist>
  50. <para>Compile the package:</para>
  51. <screen><userinput>make</userinput></screen>
  52. <para>Compilation is now complete. As discussed earlier, running the
  53. test suite is not mandatory for the temporary tools here in this
  54. chapter. To run the Binutils test suite anyway, issue the following
  55. command:</para>
  56. <screen><userinput>make check</userinput></screen>
  57. <para>Install the package:</para>
  58. <screen><userinput>make install</userinput></screen>
  59. <para>Now prepare the linker for the <quote>Re-adjusting</quote> phase in the next
  60. chapter:</para>
  61. <screen><userinput>make -C ld clean
  62. make -C ld LIB_PATH=/usr/lib:/lib</userinput></screen>
  63. <warning><para><emphasis>Do not</emphasis> remove the Binutils source and
  64. build directories yet. These directories will be needed again in the next
  65. chapter in their current state.</para></warning>
  66. </sect2>
  67. <sect2 role="content"><title/>
  68. <para>Details on this package are located in <xref
  69. linkend="contents-binutils" role="."/></para>
  70. </sect2>
  71. </sect1>