binutils-pass1.xml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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. <!ENTITY % patches-entities SYSTEM "../patches.ent">
  5. %general-entities;
  6. %patches-entities;
  7. ]>
  8. <sect1 id="ch-tools-binutils-pass1" role="wrap">
  9. <title>Binutils-&binutils-version; - Pass 1</title>
  10. <?dbhtml filename="binutils-pass1.html"?>
  11. <indexterm zone="ch-tools-binutils-pass1">
  12. <primary sortas="a-Binutils">Binutils</primary>
  13. <secondary>tools, pass 1</secondary></indexterm>
  14. <sect2 role="package"><title/>
  15. <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="../chapter06/binutils.xml" xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
  16. <segmentedlist>
  17. <segtitle>&buildtime;</segtitle>
  18. <segtitle>&diskspace;</segtitle>
  19. <seglistitem><seg>1.0 SBU</seg><seg>170 MB</seg></seglistitem>
  20. </segmentedlist>
  21. <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="../chapter06/binutils.xml" xpointer="xpointer(/sect1/sect2[1]/segmentedlist[2])"/>
  22. </sect2>
  23. <sect2 role="installation">
  24. <title>Installation of Binutils</title>
  25. <para>It is important that Binutils be the first package compiled
  26. because both Glibc and GCC perform various tests on the available
  27. linker and assembler to determine which of their own features to
  28. enable.</para>
  29. <para>The Binutils documentation recommends building Binutils outside of the
  30. source directory in a dedicated build directory:</para>
  31. <screen><userinput>mkdir -v ../binutils-build
  32. cd ../binutils-build</userinput></screen>
  33. <note><para>In order for the SBU values listed in the rest of the book
  34. to be of any use, measure the time it takes to build this package from
  35. the configuration, up to and including the first install. To achieve
  36. this easily, wrap the three commands in a <command>time</command>
  37. command like this: <userinput>time { ./configure ... &amp;&amp; make
  38. &amp;&amp; make install; }</userinput>.</para></note>
  39. <para>Now prepare Binutils for compilation:</para>
  40. <screen><userinput>../binutils-&binutils-version;/configure --prefix=/tools --disable-nls</userinput></screen>
  41. <para>The meaning of the configure options:</para>
  42. <variablelist>
  43. <varlistentry>
  44. <term><parameter>--prefix=/tools</parameter></term>
  45. <listitem><para>This tells the configure script to prepare to install the Binutils
  46. programs in the <filename class="directory">/tools</filename> directory.</para></listitem>
  47. </varlistentry>
  48. <varlistentry>
  49. <term><parameter>--disable-nls</parameter></term>
  50. <listitem><para>This disables internationalization as i18n is not needed for the
  51. temporary tools.</para></listitem>
  52. </varlistentry>
  53. </variablelist>
  54. <para>Continue with compiling the package:</para>
  55. <screen><userinput>make</userinput></screen>
  56. <para>Compilation is now complete. Ordinarily we would now run the
  57. test suite, but at this early stage the test suite framework (Tcl,
  58. Expect, and DejaGNU) is not yet in place. The benefits of running the
  59. tests at this point are minimal since the programs from this
  60. first pass will soon be replaced by those from the second.</para>
  61. <para>Install the package:</para>
  62. <screen><userinput>make install</userinput></screen>
  63. <para>Next, prepare the linker for the <quote>Adjusting</quote> phase
  64. later on:</para>
  65. <screen><userinput>make -C ld clean
  66. make -C ld LIB_PATH=/tools/lib</userinput></screen>
  67. <para>The meaning of the make parameters:</para>
  68. <variablelist>
  69. <varlistentry>
  70. <term><parameter>-C ld clean</parameter></term>
  71. <listitem><para>This tells the make program to remove all compiled
  72. files in the <filename class="directory">ld</filename>
  73. subdirectory.</para></listitem>
  74. </varlistentry>
  75. <varlistentry>
  76. <term><parameter>-C ld LIB_PATH=/tools/lib</parameter></term>
  77. <listitem><para>This option rebuilds everything in the
  78. <filename class="directory">ld</filename> subdirectory. Specifying
  79. the <envar>LIB_PATH</envar> Makefile variable on the command
  80. line allows us to override the default value
  81. and point it to the temporary tools location. The value of this variable
  82. specifies the linker's default library search path. This preparation
  83. is used later in the chapter.</para></listitem>
  84. </varlistentry>
  85. </variablelist>
  86. <warning><para><emphasis>Do not</emphasis> remove the Binutils
  87. build and source directories yet. These will be needed again in their
  88. current state later in this chapter.</para></warning>
  89. </sect2>
  90. <sect2 role="content"><title/>
  91. <para>Details on this package are located in <xref
  92. linkend="contents-binutils" role="."/></para>
  93. </sect2>
  94. </sect1>