binutils.xml 3.2 KB

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