binutils-pass1.xml 5.1 KB

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