binutils-pass1.xml 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
  4. <!ENTITY % general-entities SYSTEM "../general.ent">
  5. %general-entities;
  6. ]>
  7. <sect1 id="ch-tools-binutils-pass1" role="wrap">
  8. <?dbhtml filename="binutils-pass1.html"?>
  9. <sect1info condition="script">
  10. <productname>binutils-pass1</productname>
  11. <productnumber>&binutils-version;</productnumber>
  12. <address>&binutils-url;</address>
  13. </sect1info>
  14. <title>Binutils-&binutils-version; - Pass 1</title>
  15. <indexterm zone="ch-tools-binutils-pass1">
  16. <primary sortas="a-Binutils">Binutils</primary>
  17. <secondary>tools, pass 1</secondary>
  18. </indexterm>
  19. <sect2 role="package">
  20. <title/>
  21. <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
  22. href="../chapter08/binutils.xml"
  23. xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
  24. <segmentedlist>
  25. <segtitle>&buildtime;</segtitle>
  26. <segtitle>&diskspace;</segtitle>
  27. <seglistitem>
  28. <seg>&binutils-tmpp1-sbu;</seg>
  29. <seg>&binutils-tmpp1-du;</seg>
  30. </seglistitem>
  31. </segmentedlist>
  32. </sect2>
  33. <sect2 role="installation">
  34. <title>Installation of Cross Binutils</title>
  35. <note><para>Go back and re-read the notes in the section titled <xref
  36. linkend="ch-tools-generalinstructions"/>.
  37. Understanding the notes labeled important can save you a lot
  38. of problems later.</para></note>
  39. <para>It is important that Binutils be the first package compiled
  40. because both Glibc and GCC perform various tests on the available
  41. linker and assembler to determine which of their own features to
  42. enable.</para>
  43. <para>The Binutils documentation recommends building Binutils
  44. in a dedicated build directory:</para>
  45. <screen><userinput remap="pre">mkdir -v build
  46. cd build</userinput></screen>
  47. <note>
  48. <para>In order for the SBU values listed in the rest of the book
  49. to be of any use, measure the time it takes to build this package from
  50. the configuration, up to and including the first install. To achieve
  51. this easily, wrap the commands in a <command>time</command>
  52. command like this: <userinput>time { ../configure ... &amp;&amp; make
  53. &amp;&amp; make install; }</userinput>.</para>
  54. </note>
  55. <para>Now prepare Binutils for compilation:</para>
  56. <screen><userinput remap="configure">../configure --prefix=$LFS/tools \
  57. --with-sysroot=$LFS \
  58. --target=$LFS_TGT \
  59. --disable-nls \
  60. --disable-werror</userinput></screen>
  61. <variablelist>
  62. <title>The meaning of the configure options:</title>
  63. <varlistentry>
  64. <term><parameter>--prefix=$LFS/tools</parameter></term>
  65. <listitem>
  66. <para>This tells the configure script to prepare to install the
  67. binutils programs in the <filename
  68. class="directory">$LFS/tools</filename> directory.</para>
  69. </listitem>
  70. </varlistentry>
  71. <varlistentry>
  72. <term><parameter>--with-sysroot=$LFS</parameter></term>
  73. <listitem>
  74. <para>For cross compilation, this tells the build system to look in
  75. $LFS for the target system libraries as needed.</para>
  76. </listitem>
  77. </varlistentry>
  78. <varlistentry>
  79. <term><envar>--target=$LFS_TGT</envar></term>
  80. <listitem>
  81. <para>Because the machine description in the <envar>LFS_TGT</envar>
  82. variable is slightly different than the value returned by the
  83. <command>config.guess</command> script, this switch will tell the
  84. <command>configure</command> script to adjust binutil's build system
  85. for building a cross linker. </para>
  86. </listitem>
  87. </varlistentry>
  88. <varlistentry>
  89. <term><parameter>--disable-nls</parameter></term>
  90. <listitem>
  91. <para>This disables internationalization as i18n is not needed for the
  92. temporary tools.</para>
  93. </listitem>
  94. </varlistentry>
  95. <varlistentry>
  96. <term><parameter>--disable-werror</parameter></term>
  97. <listitem>
  98. <para>This prevents the build from stopping in the event that there
  99. are warnings from the host's compiler.</para>
  100. </listitem>
  101. </varlistentry>
  102. </variablelist>
  103. <para>Continue with compiling the package:</para>
  104. <screen><userinput remap="make">make</userinput></screen>
  105. <para>Install the package:</para>
  106. <screen><userinput remap="install">make install</userinput></screen>
  107. </sect2>
  108. <sect2 role="content">
  109. <title/>
  110. <para>Details on this package are located in
  111. <xref linkend="contents-binutils" role="."/></para>
  112. </sect2>
  113. </sect1>