source: chapter05/binutils-pass1.xml@ 67129a2b

6.0
Last change on this file since 67129a2b was 24a08b9, checked in by Gerard Beekmans <gerard@…>, 20 years ago

General edits. Added bash+readline display_wrap patches

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

  • Property mode set to 100644
File size: 5.6 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/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>194 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 to get compiled,
31because both Glibc and GCC perform various tests on the available linker and
32assembler to determine which of their own features to enable.</para>
33
34<para>This package is known to have issues when its default
35optimization flags (including the <parameter>-march</parameter> and
36<parameter>-mcpu</parameter> options) are changed. If any environment
37variables that override default optimizations have been defined, such
38as <emphasis>CFLAGS</emphasis> and <emphasis>CXXFLAGS</emphasis>,
39unset them when building Binutils.</para>
40
41<para>The Binutils documentation recommends building Binutils outside of the
42source directory in a dedicated build directory:</para>
43
44<screen><userinput>mkdir ../binutils-build
45cd ../binutils-build</userinput></screen>
46
47<note><para>In order for the SBU values listed in the rest of the book
48to be of any use, measure the time it takes to build this package from
49the configuration, up to and including the first install. To achieve
50this easily, wrap the four commands in a <command>time</command>
51command like this: <userinput>time { ./configure ... &amp;&amp; ...
52&amp;&amp; ... &amp;&amp; make install; }</userinput>.</para></note>
53
54<para>Now prepare Binutils for compilation:</para>
55
56<screen><userinput>../binutils-&binutils-version;/configure --prefix=/tools --disable-nls</userinput></screen>
57
58<para>The meaning of the configure options:</para>
59
60<variablelist>
61<varlistentry>
62<term><parameter>--prefix=/tools</parameter></term>
63<listitem><para>This tells the configure script to prepare to install the Binutils
64programs in the <filename class="directory">/tools</filename> directory.</para></listitem>
65</varlistentry>
66
67<varlistentry>
68<term><parameter>--disable-nls</parameter></term>
69<listitem><para>This disables internationalization. This is not needed
70for the static programs, and nls can cause problems when linking
71statically.</para></listitem>
72</varlistentry>
73</variablelist>
74
75<para>Continue with compiling the package:</para>
76
77<screen><userinput>make configure-host
78make LDFLAGS="-all-static"</userinput></screen>
79
80<para>The meaning of the make parameters:</para>
81
82<variablelist>
83<varlistentry>
84<term><parameter>configure-host</parameter></term>
85<listitem><para>This forces all subdirectories to be configured
86immediately. A statically-linked build will fail without it. Use this
87option to work around the problem:</para></listitem>
88</varlistentry>
89
90<varlistentry>
91<term><parameter>LDFLAGS="-all-static"</parameter></term>
92<listitem><para>This tells the linker that all Binutils programs
93should be linked statically. However, strictly speaking,
94<parameter>"-all-static"</parameter> is passed to the
95<command>libtool</command> program, which then passes
96<parameter>"-static"</parameter> to the linker.</para></listitem>
97</varlistentry>
98</variablelist>
99
100<para>Compilation is now complete. Ordinarily we would now run the
101test suite, but at this early stage the test suite framework (Tcl,
102Expect, and DejaGNU) is not yet in place. The benefits of running the
103tests at this point would be minimal since the programs from this
104first pass will soon be replaced by those from the second.</para>
105
106<para>Install the package:</para>
107
108<screen><userinput>make install</userinput></screen>
109
110<para>Next, prepare the linker for the <quote>Adjusting</quote> phase
111later on:</para>
112
113<screen><userinput>make -C ld clean
114make -C ld LDFLAGS="-all-static" LIB_PATH=/tools/lib</userinput></screen>
115
116<para>The meaning of the make parameters:</para>
117
118<variablelist>
119<varlistentry>
120<term><parameter>-C ld clean</parameter></term>
121<listitem><para>This tells the make program to remove all compiled
122files in the <filename class="directory">ld</filename>
123subdirectory.</para></listitem>
124</varlistentry>
125
126<varlistentry>
127<term><parameter>-C ld LDFLAGS="-all-static"
128LIB_PATH=/tools/lib</parameter></term>
129<listitem><para>This option rebuilds everything in the
130<filename class="directory">ld</filename> subdirectory. Specifying the LIB_PATH
131Makefile variable on the command line allows us to override the default value
132and point it to our temporary tools location. The value of this variable
133specifies the linker's default library search path. This preparation
134is used later in the chapter.</para></listitem>
135</varlistentry>
136</variablelist>
137
138<warning><para><emphasis>Do not</emphasis> remove the Binutils
139build and source directories yet. These will be needed again in their
140current state later in this chapter.</para></warning>
141
142</sect2>
143
144<sect2 role="content"><title/>
145<para>The details on this package are found in <xref linkend="contents-binutils"/>.</para>
146</sect2>
147
148</sect1>
149
Note: See TracBrowser for help on using the repository browser.