source: chapter05/binutils-pass2.xml@ 50420218

7.5-systemd 7.6-systemd 7.7-systemd 7.8-systemd 7.9-systemd
Last change on this file since 50420218 was 50420218, checked in by Matthew Burgess <matthew@…>, 11 years ago

Sync with latest trunk updates

git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/systemd/BOOK@10255 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.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../general.ent">
5 %general-entities;
6]>
7
8<sect1 id="ch-tools-binutils-pass2" role="wrap">
9 <?dbhtml filename="binutils-pass2.html"?>
10
11 <sect1info condition="script">
12 <productname>binutils</productname>
13 <productnumber>&binutils-version;</productnumber>
14 <address>&binutils-url;</address>
15 </sect1info>
16
17 <title>Binutils-&binutils-version; - Pass 2</title>
18
19 <indexterm zone="ch-tools-binutils-pass2">
20 <primary sortas="a-Binutils">Binutils</primary>
21 <secondary>tools, pass 2</secondary>
22 </indexterm>
23
24 <sect2 role="package">
25 <title/>
26
27 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
28 href="../chapter06/binutils.xml"
29 xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
30
31 <segmentedlist>
32 <segtitle>&buildtime;</segtitle>
33 <segtitle>&diskspace;</segtitle>
34
35 <seglistitem>
36 <seg>&binutils-ch5p2-sbu;</seg>
37 <seg>&binutils-ch5p2-du;</seg>
38 </seglistitem>
39 </segmentedlist>
40
41 </sect2>
42
43 <sect2 role="installation">
44 <title>Installation of Binutils</title>
45
46 <para>Fix a couple of syntax errors that prevent the documentation from
47 building with Texinfo-&texinfo-version;:</para>
48
49<screen><userinput remap="pre">sed -i -e 's/@colophon/@@colophon/' \
50 -e 's/doc@cygnus.com/doc@@cygnus.com/' bfd/doc/bfd.texinfo</userinput></screen>
51
52 <para>Create a separate build directory again:</para>
53
54<screen><userinput remap="pre">mkdir -v ../binutils-build
55cd ../binutils-build</userinput></screen>
56
57 <para>Prepare Binutils for compilation:</para>
58
59<screen><userinput remap="configure">CC=$LFS_TGT-gcc \
60AR=$LFS_TGT-ar \
61RANLIB=$LFS_TGT-ranlib \
62../binutils-&binutils-version;/configure \
63 --prefix=/tools \
64 --disable-nls \
65 --with-lib-path=/tools/lib \
66 --with-sysroot</userinput></screen>
67
68 <variablelist>
69 <title>The meaning of the new configure options:</title>
70
71 <varlistentry>
72 <term><parameter>CC=$LFS_TGT-gcc AR=$LFS_TGT-ar RANLIB=$LFS_TGT-ranlib</parameter></term>
73 <listitem>
74 <para>Because this is really a native build of Binutils, setting these
75 variables ensures that the build system uses the cross-compiler and
76 associated tools instead of the ones on the host system.</para>
77 </listitem>
78 </varlistentry>
79
80 <varlistentry>
81 <term><parameter>--with-lib-path=/tools/lib</parameter></term>
82 <listitem>
83 <para>This tells the configure script to specify the library
84 search path during the compilation of Binutils, resulting in
85 <filename class="directory">/tools/lib</filename> being passed
86 to the linker. This prevents the linker from searching through
87 library directories on the host.</para>
88 </listitem>
89 </varlistentry>
90
91 <varlistentry>
92 <term><parameter>--with-sysroot</parameter></term>
93 <listitem>
94 <para>The sysroot feature enables the linker to find shared objects
95 which are required by other shared objects explicitly included on the
96 linker's command line. Without this, some packages may not build
97 successfully on some hosts.</para>
98 </listitem>
99 </varlistentry>
100
101 </variablelist>
102
103 <para>Compile the package:</para>
104
105<screen><userinput remap="make">make</userinput></screen>
106
107 <para>Install the package:</para>
108
109<screen><userinput remap="install">make install</userinput></screen>
110
111 <para>Now prepare the linker for the <quote>Re-adjusting</quote> phase in
112 the next chapter:</para>
113
114<screen><userinput remap="adjust">make -C ld clean
115make -C ld LIB_PATH=/usr/lib:/lib
116cp -v ld/ld-new /tools/bin</userinput></screen>
117
118 <variablelist>
119 <title>The meaning of the make parameters:</title>
120
121 <varlistentry>
122 <term><parameter>-C ld clean</parameter></term>
123 <listitem>
124 <para>This tells the make program to remove all compiled
125 files in the <filename class="directory">ld</filename>
126 subdirectory.</para>
127 </listitem>
128 </varlistentry>
129
130 <varlistentry>
131 <term><parameter>-C ld LIB_PATH=/usr/lib:/lib</parameter></term>
132 <listitem>
133 <para>This option rebuilds everything in the <filename
134 class="directory">ld</filename> subdirectory. Specifying the
135 <envar>LIB_PATH</envar> Makefile variable on the command line
136 allows us to override the default value of the temporary tools
137 and point it to the proper final path. The value of this variable
138 specifies the linker's default library search path. This
139 preparation is used in the next chapter.</para>
140 </listitem>
141 </varlistentry>
142
143 </variablelist>
144
145 </sect2>
146
147 <sect2 role="content">
148 <title/>
149
150 <para>Details on this package are located in
151 <xref linkend="contents-binutils" role="."/></para>
152
153 </sect2>
154
155</sect1>
Note: See TracBrowser for help on using the repository browser.