[b7d9d404] | 1 | <sect2><title> </title><para> </para></sect2>
|
---|
| 2 |
|
---|
[6370fa6] | 3 | <sect2><title>Installation of Binutils</title>
|
---|
| 4 |
|
---|
[39dbad2] | 5 | <note><para>The test suite for Binutils in this chapter is considered
|
---|
[1f53626] | 6 | <emphasis>critical</emphasis>. Do not skip it under any circumstances.</para>
|
---|
| 7 | </note>
|
---|
| 8 |
|
---|
[28360cb] | 9 | <para>This package is known to behave badly when you have changed its
|
---|
[2b114b25] | 10 | default optimization flags (including the -march and -mcpu options).
|
---|
| 11 | Therefore, if you have defined any environment variables that override
|
---|
| 12 | default optimizations, such as CFLAGS and CXXFLAGS, we recommend unsetting
|
---|
[ae581da] | 13 | or modifying them when building Binutils.</para>
|
---|
[b43aab1] | 14 |
|
---|
[677aef3] | 15 | <para>The Binutils documentation recommends building Binutils outside of the
|
---|
| 16 | source directory in a dedicated build directory:</para>
|
---|
[6370fa6] | 17 |
|
---|
[4a7a683] | 18 | <para><screen><userinput>mkdir ../binutils-build
|
---|
[b7d9d404] | 19 | cd ../binutils-build</userinput></screen></para>
|
---|
| 20 |
|
---|
[ae581da] | 21 | <para>Now prepare Binutils for compilation:</para>
|
---|
[b7d9d404] | 22 |
|
---|
[84a7dc2] | 23 | <para><screen><userinput>../binutils-&binutils-version;/configure \
|
---|
[4a7a683] | 24 | --prefix=/usr --enable-shared</userinput></screen></para>
|
---|
[b7d9d404] | 25 |
|
---|
[ae581da] | 26 | <para>Compile the package:</para>
|
---|
[b7d9d404] | 27 |
|
---|
[84a7dc2] | 28 | <para><screen><userinput>make tooldir=/usr</userinput></screen></para>
|
---|
[bc82645e] | 29 |
|
---|
[b7d9d404] | 30 | <para>Normally, the <emphasis>tooldir</emphasis> (the directory where the
|
---|
[ae581da] | 31 | executables end up) is set to $(exec_prefix)/$(target_alias), which expands
|
---|
| 32 | into, for example, <filename>/usr/i686-pc-linux-gnu</filename>. Since we only
|
---|
| 33 | build for our own system, we don't need this target specific directory in
|
---|
| 34 | <filename>/usr</filename>. That setup would be used if the system was used to
|
---|
| 35 | cross-compile (for example compiling a package on an Intel machine that
|
---|
| 36 | generates code that can be executed on PowerPC machines).</para>
|
---|
| 37 |
|
---|
[89fcc34] | 38 | <para>Test the results:</para>
|
---|
[ae581da] | 39 |
|
---|
| 40 | <para><screen><userinput>make check</userinput></screen></para>
|
---|
[b7d9d404] | 41 |
|
---|
| 42 | <para>Install the package:</para>
|
---|
| 43 |
|
---|
[6ab7740] | 44 | <para><screen><userinput>make tooldir=/usr install</userinput></screen></para>
|
---|
[b7d9d404] | 45 |
|
---|
[fdce923] | 46 | <para>Install the <emphasis>libiberty</emphasis> header file that is needed by
|
---|
| 47 | some packages:</para>
|
---|
| 48 |
|
---|
| 49 | <para><screen><userinput>cp ../binutils-&binutils-version;/include/libiberty.h /usr/include</userinput></screen></para>
|
---|
| 50 |
|
---|
[6370fa6] | 51 | </sect2>
|
---|
| 52 |
|
---|