source: chapter05/binutils-pass1.xml@ e727ee5

6.1.1
Last change on this file since e727ee5 was e727ee5, checked in by Manuel Canales Esparcia <manuel@…>, 19 years ago

Added -v switches.

git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/6.1.1/BOOK@7059 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 5.0 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
3 <!ENTITY % general-entities SYSTEM "../general.ent">
4 %general-entities;
5]>
6<sect1 id="ch-tools-binutils-pass1" role="wrap">
7<title>Binutils-&binutils-version; - Pass 1</title>
8<?dbhtml filename="binutils-pass1.html"?>
9
10<indexterm zone="ch-tools-binutils-pass1">
11<primary sortas="a-Binutils">Binutils</primary>
12<secondary>tools, pass 1</secondary></indexterm>
13
14<sect2 role="package"><title/>
15<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="../chapter06/binutils.xml" xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
16
17<segmentedlist>
18<segtitle>&buildtime;</segtitle>
19<segtitle>&diskspace;</segtitle>
20<seglistitem><seg>1.0 SBU</seg><seg>179 MB</seg></seglistitem>
21</segmentedlist>
22
23<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="../chapter06/binutils.xml" xpointer="xpointer(/sect1/sect2[1]/segmentedlist[2])"/>
24
25</sect2>
26
27<sect2 role="installation">
28<title>Installation of Binutils</title>
29
30<para>It is important that Binutils be the first package compiled
31because both Glibc and GCC perform various tests on the available
32linker and assembler to determine which of their own features to
33enable.</para>
34
35<para>This package is known to have issues when its default
36optimization flags (including the <parameter>-march</parameter> and
37<parameter>-mcpu</parameter> options) are changed. If any environment
38variables that override default optimizations have been defined, such
39as <envar>CFLAGS</envar> and <envar>CXXFLAGS</envar>,
40unset them when building Binutils.</para>
41
42<para>If you are building from a host running Gcc-4 or later, it is necessary
43to patch the first build of this version of Binutils so that it can be
44compiled by the host system.</para>
45
46<screen><userinput>patch -Np1 -i ../&binutils-gcc4-patch;</userinput></screen>
47
48<para>The Binutils documentation recommends building Binutils outside of the
49source directory in a dedicated build directory:</para>
50
51<screen><userinput>mkdir -v ../binutils-build
52cd ../binutils-build</userinput></screen>
53
54<note><para>In order for the SBU values listed in the rest of the book
55to be of any use, measure the time it takes to build this package from
56the configuration, up to and including the first install. To achieve
57this easily, wrap the three commands in a <command>time</command>
58command like this: <userinput>time { ./configure ... &amp;&amp; make
59&amp;&amp; make install; }</userinput>.</para></note>
60
61<para>Now prepare Binutils for compilation:</para>
62
63<screen><userinput>../binutils-&binutils-version;/configure --prefix=/tools --disable-nls</userinput></screen>
64
65<para>The meaning of the configure options:</para>
66
67<variablelist>
68<varlistentry>
69<term><parameter>--prefix=/tools</parameter></term>
70<listitem><para>This tells the configure script to prepare to install the Binutils
71programs in the <filename class="directory">/tools</filename> directory.</para></listitem>
72</varlistentry>
73
74<varlistentry>
75<term><parameter>--disable-nls</parameter></term>
76<listitem><para>This disables internationalization as i18n is not needed for the
77temporary tools.</para></listitem>
78</varlistentry>
79</variablelist>
80
81<para>Continue with compiling the package:</para>
82
83<screen><userinput>make</userinput></screen>
84
85<para>Compilation is now complete. Ordinarily we would now run the
86test suite, but at this early stage the test suite framework (Tcl,
87Expect, and DejaGNU) is not yet in place. The benefits of running the
88tests at this point are minimal since the programs from this
89first pass will soon be replaced by those from the second.</para>
90
91<para>Install the package:</para>
92
93<screen><userinput>make install</userinput></screen>
94
95<para>Next, prepare the linker for the <quote>Adjusting</quote> phase
96later on:</para>
97
98<screen><userinput>make -C ld clean
99make -C ld LIB_PATH=/tools/lib</userinput></screen>
100
101<para>The meaning of the make parameters:</para>
102
103<variablelist>
104<varlistentry>
105<term><parameter>-C ld clean</parameter></term>
106<listitem><para>This tells the make program to remove all compiled
107files in the <filename class="directory">ld</filename>
108subdirectory.</para></listitem>
109</varlistentry>
110
111<varlistentry>
112<term><parameter>-C ld LIB_PATH=/tools/lib</parameter></term>
113<listitem><para>This option rebuilds everything in the
114<filename class="directory">ld</filename> subdirectory. Specifying
115the <envar>LIB_PATH</envar> Makefile variable on the command
116line allows us to override the default value
117and point it to the temporary tools location. The value of this variable
118specifies the linker's default library search path. This preparation
119is used later in the chapter.</para></listitem>
120</varlistentry>
121</variablelist>
122
123<warning><para><emphasis>Do not</emphasis> remove the Binutils
124build and source directories yet. These will be needed again in their
125current state later in this chapter.</para></warning>
126
127</sect2>
128
129<sect2 role="content"><title/>
130<para>Details on this package are located in <xref
131linkend="contents-binutils" role="."/></para>
132</sect2>
133
134</sect1>
135
Note: See TracBrowser for help on using the repository browser.