aboutsummaryrefslogtreecommitdiffstats
path: root/chapter06/binutils-inst.xml
blob: 0c2d4f97319cd6a837d7369dfb7fcc807e987769 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<sect2><title>&nbsp;</title><para>&nbsp;</para></sect2>

<sect2><title>Installation of Binutils</title>

<para>This package is known to behave badly when you have changed its
default optimization flags (including the -march and -mcpu options).
Therefore, if you have defined any environment variables that override
default optimizations, such as CFLAGS and CXXFLAGS, we recommend unsetting
or modifying them when building binutils.</para>

<para>It is recommended by the Binutils installation documentation to build
Binutils outside of the source directory:</para>

<para><screen><userinput>mkdir ../binutils-build &amp;&amp;
cd ../binutils-build</userinput></screen></para>

<para>Next, prepare Binutils to be compiled:</para>

<para><screen><userinput>../binutils-&binutils-version;/configure \
&nbsp;&nbsp;&nbsp;&nbsp;--prefix=/usr --mandir=/usr/share/man \
&nbsp;&nbsp;&nbsp;&nbsp;--infodir=/usr/share/info --enable-shared</userinput></screen></para>

<para>Continue with compiling the package:</para>

<para><screen><userinput>make tooldir=/usr</userinput></screen></para>

<para><screen><userinput>make check</userinput></screen></para>

<para>Normally, the <emphasis>tooldir</emphasis> (the directory where the
executables end up) is set to $(exec_prefix)/$(target_alias) which expands
into, for example, /usr/i686-pc-linux-gnu. Since we only build for our
own system, we don't need this target specific directory in /usr. That
setup would be used if the system was used to cross-compile (for example
compiling a package on the Intel machine that generates code that can be
executed on Apple PowerPC machines).</para>

<para>Install the package:</para>

<para><screen><userinput>make tooldir=/usr install</userinput></screen></para>

<para><screen><userinput>rm /usr/lib/libiberty.a</userinput></screen></para>

</sect2>