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