binutils-inst.xml 2.9 KB

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