binutils.xml 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <sect1 id="ch-system-binutils" xreflabel="Binutils">
  2. <title>Installing Binutils-&binutils-version;</title>
  3. <?dbhtml filename="binutils.html" dir="chapter06"?>
  4. <para>The Binutils package contains a linker, an assembler, and other tools for
  5. handling object files.</para>
  6. <screen>&buildtime; &binutils-time;
  7. &diskspace; &binutils-compsize;</screen>
  8. &aa-binutils-down;
  9. &aa-binutils-dep;
  10. <sect2><title>&nbsp;</title><para>&nbsp;</para></sect2>
  11. <sect2><title>Installation of Binutils</title>
  12. <para>Now is an appropriate time to verify that your pseudo terminals (PTYs) are
  13. working properly inside the chroot environment. We will again quickly check that
  14. everything is set up correctly by performing a simple test:</para>
  15. <screen><userinput>expect -c "spawn ls"</userinput></screen>
  16. <para>If you receive the message:</para>
  17. <blockquote><screen>The system has no more ptys. Ask your system administrator to create more.</screen></blockquote>
  18. <para>Your chroot environment is not set up for proper PTY operation. In this
  19. case there is no point in running the test suites for Binutils and GCC until you
  20. are able to resolve the issue. Please refer back to <xref linkend="ch-system-proc"/>
  21. and the <xref linkend="ch-system-MAKEDEV"/> section and perform the recommended steps
  22. to fix the problem.</para>
  23. <para>This package is known to behave badly when you have changed its
  24. default optimization flags (including the -march and -mcpu options).
  25. Therefore, if you have defined any environment variables that override
  26. default optimizations, such as CFLAGS and CXXFLAGS, we recommend unsetting
  27. or modifying them when building Binutils.</para>
  28. <para>The Binutils documentation recommends building Binutils outside of the
  29. source directory in a dedicated build directory:</para>
  30. <screen><userinput>mkdir ../binutils-build
  31. cd ../binutils-build</userinput></screen>
  32. <para>Now prepare Binutils for compilation:</para>
  33. <screen><userinput>../&binutils-dir;/configure --prefix=/usr --enable-shared</userinput></screen>
  34. <para>Compile the package:</para>
  35. <screen><userinput>make tooldir=/usr</userinput></screen>
  36. <para>Normally, the <emphasis>tooldir</emphasis> (the directory where the
  37. executables end up) is set to $(exec_prefix)/$(target_alias), which expands
  38. into, for example, <filename>/usr/i686-pc-linux-gnu</filename>. Since we only
  39. build for our own system, we don't need this target specific directory in
  40. <filename>/usr</filename>. That setup would be used if the system was used to
  41. cross-compile (for example compiling a package on an Intel machine that
  42. generates code that can be executed on PowerPC machines).</para>
  43. <important><para>The test suite for Binutils in this section is considered
  44. <emphasis>critical</emphasis>. Our advice is to not skip it under any
  45. circumstances.</para></important>
  46. <para>Test the results:</para>
  47. <screen><userinput>make check</userinput></screen>
  48. <para>The test suite notes from <xref linkend="ch-tools-binutils-pass2"/> are still
  49. very much appropriate here. Be sure to refer back there should you have any
  50. doubts.</para>
  51. <para>Install the package:</para>
  52. <screen><userinput>make tooldir=/usr install</userinput></screen>
  53. <para>Install the <emphasis>libiberty</emphasis> header file that is needed by
  54. some packages:</para>
  55. <screen><userinput>cp ../&binutils-dir;/include/libiberty.h /usr/include</userinput></screen>
  56. </sect2>
  57. &aa-binutils-shortdesc;
  58. &aa-binutils-desc;
  59. </sect1>