2004-05-03 11:59:46 +01:00
|
|
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
2007-03-21 18:42:58 +00:00
|
|
|
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
|
|
|
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
2004-05-03 11:59:46 +01:00
|
|
|
<!ENTITY % general-entities SYSTEM "../general.ent">
|
|
|
|
%general-entities;
|
|
|
|
]>
|
2006-01-17 19:37:53 +00:00
|
|
|
|
2004-05-16 01:06:08 +01:00
|
|
|
<sect1 id="ch-tools-binutils-pass2" role="wrap">
|
2006-01-17 19:37:53 +00:00
|
|
|
<?dbhtml filename="binutils-pass2.html"?>
|
|
|
|
|
2007-09-07 20:16:43 +01:00
|
|
|
<sect1info condition="script">
|
|
|
|
<productname>binutils</productname>
|
|
|
|
<productnumber>&binutils-version;</productnumber>
|
|
|
|
<address>&binutils-url;</address>
|
|
|
|
</sect1info>
|
|
|
|
|
2006-01-17 19:37:53 +00:00
|
|
|
<title>Binutils-&binutils-version; - Pass 2</title>
|
|
|
|
|
|
|
|
<indexterm zone="ch-tools-binutils-pass2">
|
|
|
|
<primary sortas="a-Binutils">Binutils</primary>
|
|
|
|
<secondary>tools, pass 2</secondary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<sect2 role="package">
|
|
|
|
<title/>
|
2003-05-02 19:20:20 +01:00
|
|
|
|
2010-04-21 21:16:28 +01:00
|
|
|
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
|
2006-01-17 19:37:53 +00:00
|
|
|
href="../chapter06/binutils.xml"
|
|
|
|
xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
|
2005-02-19 22:16:42 +00:00
|
|
|
|
2006-01-17 19:37:53 +00:00
|
|
|
<segmentedlist>
|
|
|
|
<segtitle>&buildtime;</segtitle>
|
|
|
|
<segtitle>&diskspace;</segtitle>
|
2004-01-12 23:23:50 +00:00
|
|
|
|
2006-01-17 19:37:53 +00:00
|
|
|
<seglistitem>
|
2006-05-14 21:16:56 +01:00
|
|
|
<seg>&binutils-ch5p2-sbu;</seg>
|
|
|
|
<seg>&binutils-ch5p2-du;</seg>
|
2006-01-17 19:37:53 +00:00
|
|
|
</seglistitem>
|
|
|
|
</segmentedlist>
|
2003-11-01 22:31:50 +00:00
|
|
|
|
2006-01-17 19:37:53 +00:00
|
|
|
</sect2>
|
2004-05-16 01:06:08 +01:00
|
|
|
|
2006-01-17 19:37:53 +00:00
|
|
|
<sect2 role="installation">
|
2008-12-05 20:46:02 +00:00
|
|
|
<title>Installation of Binutils</title>
|
2003-11-01 22:31:50 +00:00
|
|
|
|
2006-01-17 19:37:53 +00:00
|
|
|
<para>Create a separate build directory again:</para>
|
2003-11-01 22:31:50 +00:00
|
|
|
|
2007-09-18 22:11:00 +01:00
|
|
|
<screen><userinput remap="pre">mkdir -v ../binutils-build
|
2003-11-01 22:31:50 +00:00
|
|
|
cd ../binutils-build</userinput></screen>
|
|
|
|
|
2006-01-17 19:37:53 +00:00
|
|
|
<para>Prepare Binutils for compilation:</para>
|
2003-11-01 22:31:50 +00:00
|
|
|
|
2008-12-05 20:46:02 +00:00
|
|
|
<screen><userinput remap="configure">CC="$LFS_TGT-gcc -B/tools/lib/" \
|
|
|
|
AR=$LFS_TGT-ar RANLIB=$LFS_TGT-ranlib \
|
|
|
|
../binutils-&binutils-version;/configure --prefix=/tools \
|
|
|
|
--disable-nls --with-lib-path=/tools/lib</userinput></screen>
|
2003-11-01 22:31:50 +00:00
|
|
|
|
2006-01-17 19:37:53 +00:00
|
|
|
<variablelist>
|
|
|
|
<title>The meaning of the new configure options:</title>
|
2003-11-01 22:31:50 +00:00
|
|
|
|
2008-12-05 20:46:02 +00:00
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>CC="$LFS_TGT-gcc -B/tools/lib/" AR=$LFS_TGT-ar RANLIB=$LFS_TGT-ranlib</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>Because this is really a native build of Binutils, setting these
|
|
|
|
variables ensures that the build system uses the cross-compiler and
|
|
|
|
associated tools instead of the ones on the host system.</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
2006-01-17 19:37:53 +00:00
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>--with-lib-path=/tools/lib</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>This tells the configure script to specify the library
|
|
|
|
search path during the compilation of Binutils, resulting in
|
|
|
|
<filename class="directory">/tools/lib</filename> being passed
|
|
|
|
to the linker. This prevents the linker from searching through
|
|
|
|
library directories on the host.</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2003-11-01 22:31:50 +00:00
|
|
|
|
2006-01-17 19:37:53 +00:00
|
|
|
</variablelist>
|
|
|
|
|
|
|
|
<para>Compile the package:</para>
|
2004-12-22 12:06:22 +00:00
|
|
|
|
2007-09-18 22:11:00 +01:00
|
|
|
<screen><userinput remap="make">make</userinput></screen>
|
2004-05-03 22:28:58 +01:00
|
|
|
|
2006-01-17 19:37:53 +00:00
|
|
|
<para>Install the package:</para>
|
2003-11-01 22:31:50 +00:00
|
|
|
|
2007-09-18 22:11:00 +01:00
|
|
|
<screen><userinput remap="install">make install</userinput></screen>
|
2006-01-26 15:08:48 +00:00
|
|
|
|
2006-01-26 14:45:36 +00:00
|
|
|
<para>Now prepare the linker for the <quote>Re-adjusting</quote> phase in
|
|
|
|
the next chapter:</para>
|
|
|
|
|
2007-09-18 22:11:00 +01:00
|
|
|
<screen><userinput remap="adjust">make -C ld clean
|
2006-01-31 01:50:44 +00:00
|
|
|
make -C ld LIB_PATH=/usr/lib:/lib
|
2006-01-26 14:45:36 +00:00
|
|
|
cp -v ld/ld-new /tools/bin</userinput></screen>
|
|
|
|
|
2008-12-05 20:46:02 +00:00
|
|
|
<variablelist>
|
|
|
|
<title>The meaning of the make parameters:</title>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>-C ld clean</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>This tells the make program to remove all compiled
|
|
|
|
files in the <filename class="directory">ld</filename>
|
|
|
|
subdirectory.</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>-C ld LIB_PATH=/usr/lib:/lib</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>This option rebuilds everything in the <filename
|
|
|
|
class="directory">ld</filename> subdirectory. Specifying the
|
|
|
|
<envar>LIB_PATH</envar> Makefile variable on the command line
|
|
|
|
allows us to override the default value of the temporary tools
|
|
|
|
and point it to the proper final path. The value of this variable
|
|
|
|
specifies the linker's default library search path. This
|
|
|
|
preparation is used in the next chapter.</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
</variablelist>
|
|
|
|
|
2006-01-17 19:37:53 +00:00
|
|
|
</sect2>
|
2003-11-01 22:31:50 +00:00
|
|
|
|
2006-01-17 19:37:53 +00:00
|
|
|
<sect2 role="content">
|
|
|
|
<title/>
|
2004-01-12 23:23:50 +00:00
|
|
|
|
2006-01-17 19:37:53 +00:00
|
|
|
<para>Details on this package are located in
|
|
|
|
<xref linkend="contents-binutils" role="."/></para>
|
2005-02-19 22:16:42 +00:00
|
|
|
|
2006-01-17 19:37:53 +00:00
|
|
|
</sect2>
|
2005-02-19 22:16:42 +00:00
|
|
|
|
2006-01-17 19:37:53 +00:00
|
|
|
</sect1>
|