source: chapter06/binutils.xml@ 6f227bc

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 7.2 7.3 7.4 7.5 7.5-systemd 7.6 7.6-systemd 7.7 7.7-systemd 7.8 7.8-systemd 7.9 7.9-systemd 8.0 8.1 8.2 8.3 8.4 9.0 9.1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 6f227bc was 6f227bc, checked in by Matthew Burgess <matthew@…>, 12 years ago

Add a patch to fix building Binutils with -O3 optimization

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

  • Property mode set to 100644
File size: 13.4 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-system-binutils" role="wrap">
9 <?dbhtml filename="binutils.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;</title>
18
19 <indexterm zone="ch-system-binutils">
20 <primary sortas="a-Binutils">Binutils</primary>
21 </indexterm>
22
23 <sect2 role="package">
24 <title/>
25
26 <para>The Binutils package contains a linker, an assembler, and other
27 tools for handling object files.</para>
28
29 <segmentedlist>
30 <segtitle>&buildtime;</segtitle>
31 <segtitle>&diskspace;</segtitle>
32
33 <seglistitem>
34 <seg>&binutils-ch6-sbu;</seg>
35 <seg>&binutils-ch6-du;</seg>
36 </seglistitem>
37 </segmentedlist>
38
39 </sect2>
40
41 <sect2 role="installation">
42 <title>Installation of Binutils</title>
43
44 <para>Verify that the PTYs are working properly inside the chroot
45 environment by performing a simple test:</para>
46
47<screen><userinput remap="test">expect -c "spawn ls"</userinput></screen>
48
49 <para>This command should output the following:</para>
50
51<screen><computeroutput>spawn ls</computeroutput></screen>
52
53 <para>If, instead, the output includes the message below, then the environment
54 is not set up for proper PTY operation. This issue needs to be resolved before
55 running the test suites for Binutils and GCC:</para>
56
57<screen><computeroutput>The system has no more ptys.
58Ask your system administrator to create more.</computeroutput></screen>
59
60 <para>Suppress the installation of an outdated
61 <filename>standards.info</filename> file as a newer one is installed later
62 on in the Autoconf instructions:</para>
63
64<screen><userinput remap="pre">rm -fv etc/standards.info
65sed -i.bak '/^INFO/s/standards.info //' etc/Makefile.in</userinput></screen>
66
67 <para>Fix a couple of the tests, which fail when using GCC-&gcc-version;</para>
68
69<screen><userinput remap="pre">sed -i "/exception_defines.h/d" ld/testsuite/ld-elf/new.cc
70sed -i "s/-fvtable-gc //" ld/testsuite/ld-selective/selective.exp</userinput></screen>
71
72 <para>Apply a patch to prevent a build failure when using compiler optimizations:</para>
73
74<screen><userinput remap="pre">patch -Np1 -i ../&binutils-build-patch;</userinput></screen>
75
76 <para>The Binutils documentation recommends building Binutils outside of the
77 source directory in a dedicated build directory:</para>
78
79<screen><userinput remap="pre">mkdir -v ../binutils-build
80cd ../binutils-build</userinput></screen>
81
82 <para>Prepare Binutils for compilation:</para>
83
84<screen><userinput remap="configure">../binutils-&binutils-version;/configure --prefix=/usr --enable-shared</userinput></screen>
85
86 <para>Compile the package:</para>
87
88<screen><userinput remap="make">make tooldir=/usr</userinput></screen>
89
90 <variablelist>
91 <title>The meaning of the make parameter:</title>
92
93 <varlistentry>
94 <term><parameter>tooldir=/usr</parameter></term>
95 <listitem>
96 <para>Normally, the tooldir (the directory where the executables will
97 ultimately be located) is set to <filename
98 class="directory">$(exec_prefix)/$(target_alias)</filename>. For
99 example, x86_64 machines would expand that to <filename
100 class="directory">/usr/x86_64-unknown-linux-gnu</filename>. Because this is
101 a custom system, this target-specific directory in <filename
102 class="directory">/usr</filename> is not required. <filename
103 class="directory">$(exec_prefix)/$(target_alias)</filename> would be
104 used if the system was used to cross-compile (for example, compiling a
105 package on an Intel machine that generates code that can be executed
106 on PowerPC machines).</para>
107 </listitem>
108 </varlistentry>
109
110 </variablelist>
111
112 <important>
113 <para>The test suite for Binutils in this section is considered critical.
114 Do not skip it under any circumstances.</para>
115 </important>
116
117 <para>Test the results:</para>
118
119<screen><userinput remap="test">make -k check</userinput></screen>
120
121 <para>Install the package:</para>
122
123<screen><userinput remap="install">make tooldir=/usr install</userinput></screen>
124
125 <para>Install the <filename class="headerfile">libiberty</filename> header
126 file that is needed by some packages:</para>
127
128<!-- <screen><userinput remap="install">cp -v ../binutils-&binutils-version;/include/libiberty.h /usr/include</userinput></screen> -->
129<screen><userinput remap="install">cp -v ../binutils-&binutils-version;/include/libiberty.h /usr/include</userinput></screen>
130
131 </sect2>
132
133
134 <sect2 id="contents-binutils" role="content">
135 <title>Contents of Binutils</title>
136
137 <segmentedlist>
138 <segtitle>Installed programs</segtitle>
139 <segtitle>Installed libraries</segtitle>
140 <segtitle>Installed directory</segtitle>
141
142 <seglistitem>
143 <seg>addr2line, ar, as, c++filt, elfedit, gprof, ld, ld.bfd, nm,
144 objcopy, objdump, ranlib, readelf, size, strings, and strip</seg>
145 <seg>libiberty.a, libbfd.{a,so}, and libopcodes.{a,so}</seg>
146 <seg>/usr/lib/ldscripts</seg>
147 </seglistitem>
148 </segmentedlist>
149
150 <variablelist>
151 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
152 <?dbfo list-presentation="list"?>
153 <?dbhtml list-presentation="table"?>
154
155 <varlistentry id="addr2line">
156 <term><command>addr2line</command></term>
157 <listitem>
158 <para>Translates program addresses to file names and line numbers;
159 given an address and the name of an executable, it uses the debugging
160 information in the executable to determine which source file and line
161 number are associated with the address</para>
162 <indexterm zone="ch-system-binutils addr2line">
163 <primary sortas="b-addr2line">addr2line</primary>
164 </indexterm>
165 </listitem>
166 </varlistentry>
167
168 <varlistentry id="ar">
169 <term><command>ar</command></term>
170 <listitem>
171 <para>Creates, modifies, and extracts from archives</para>
172 <indexterm zone="ch-system-binutils ar">
173 <primary sortas="b-ar">ar</primary>
174 </indexterm>
175 </listitem>
176 </varlistentry>
177
178 <varlistentry id="as">
179 <term><command>as</command></term>
180 <listitem>
181 <para>An assembler that assembles the output of <command>gcc</command>
182 into object files</para>
183 <indexterm zone="ch-system-binutils as">
184 <primary sortas="b-as">as</primary>
185 </indexterm>
186 </listitem>
187 </varlistentry>
188
189 <varlistentry id="c-filt">
190 <term><command>c++filt</command></term>
191 <listitem>
192 <para>Used by the linker to de-mangle C++ and Java symbols and to keep
193 overloaded functions from clashing</para>
194 <indexterm zone="ch-system-binutils c-filt">
195 <primary sortas="b-c++filt">c++filt</primary>
196 </indexterm>
197 </listitem>
198 </varlistentry>
199
200 <varlistentry id="elfedit">
201 <term><command>elfedit</command></term>
202 <listitem>
203 <para>Updates the ELF header of ELF files</para>
204 <indexterm zone="ch-system-binutils elfedit">
205 <primary sortas="b-elfedit">elfedit</primary>
206 </indexterm>
207 </listitem>
208 </varlistentry>
209
210 <varlistentry id="gprof">
211 <term><command>gprof</command></term>
212 <listitem>
213 <para>Displays call graph profile data</para>
214 <indexterm zone="ch-system-binutils gprof">
215 <primary sortas="b-gprof">gprof</primary>
216 </indexterm>
217 </listitem>
218 </varlistentry>
219
220 <varlistentry id="ld">
221 <term><command>ld</command></term>
222 <listitem>
223 <para>A linker that combines a number of object and archive files
224 into a single file, relocating their data and tying up symbol
225 references</para>
226 <indexterm zone="ch-system-binutils ld">
227 <primary sortas="b-ld">ld</primary>
228 </indexterm>
229 </listitem>
230 </varlistentry>
231
232 <varlistentry id="ld.bfd">
233 <term><command>ld.bfd</command></term>
234 <listitem>
235 <para>Hard link to <command>ld</command></para>
236 <indexterm zone="ch-system-binutils ld.bfd">
237 <primary sortas="b-ld.bfd">ld.bfd</primary>
238 </indexterm>
239 </listitem>
240 </varlistentry>
241
242 <varlistentry id="nm">
243 <term><command>nm</command></term>
244 <listitem>
245 <para>Lists the symbols occurring in a given object file</para>
246 <indexterm zone="ch-system-binutils nm">
247 <primary sortas="b-nm">nm</primary>
248 </indexterm>
249 </listitem>
250 </varlistentry>
251
252 <varlistentry id="objcopy">
253 <term><command>objcopy</command></term>
254 <listitem>
255 <para>Translates one type of object file into another</para>
256 <indexterm zone="ch-system-binutils objcopy">
257 <primary sortas="b-objcopy">objcopy</primary>
258 </indexterm>
259 </listitem>
260 </varlistentry>
261
262 <varlistentry id="objdump">
263 <term><command>objdump</command></term>
264 <listitem>
265 <para>Displays information about the given object file, with options
266 controlling the particular information to display; the information
267 shown is useful to programmers who are working on the compilation
268 tools</para>
269 <indexterm zone="ch-system-binutils objdump">
270 <primary sortas="b-objdump">objdump</primary>
271 </indexterm>
272 </listitem>
273 </varlistentry>
274
275 <varlistentry id="ranlib">
276 <term><command>ranlib</command></term>
277 <listitem>
278 <para>Generates an index of the contents of an archive and stores it
279 in the archive; the index lists all of the symbols defined by archive
280 members that are relocatable object files</para>
281 <indexterm zone="ch-system-binutils ranlib">
282 <primary sortas="b-ranlib">ranlib</primary>
283 </indexterm>
284 </listitem>
285 </varlistentry>
286
287 <varlistentry id="readelf">
288 <term><command>readelf</command></term>
289 <listitem>
290 <para>Displays information about ELF type binaries</para>
291 <indexterm zone="ch-system-binutils readelf">
292 <primary sortas="b-readelf">readelf</primary>
293 </indexterm>
294 </listitem>
295 </varlistentry>
296
297 <varlistentry id="size">
298 <term><command>size</command></term>
299 <listitem>
300 <para>Lists the section sizes and the total size for the given
301 object files</para>
302 <indexterm zone="ch-system-binutils size">
303 <primary sortas="b-size">size</primary>
304 </indexterm>
305 </listitem>
306 </varlistentry>
307
308 <varlistentry id="strings">
309 <term><command>strings</command></term>
310 <listitem>
311 <para>Outputs, for each given file, the sequences of printable
312 characters that are of at least the specified length (defaulting to
313 four); for object files, it prints, by default, only the strings from
314 the initializing and loading sections while for other types of files, it
315 scans the entire file</para>
316 <indexterm zone="ch-system-binutils strings">
317 <primary sortas="b-strings">strings</primary>
318 </indexterm>
319 </listitem>
320 </varlistentry>
321
322 <varlistentry id="strip">
323 <term><command>strip</command></term>
324 <listitem>
325 <para>Discards symbols from object files</para>
326 <indexterm zone="ch-system-binutils strip">
327 <primary sortas="b-strip">strip</primary>
328 </indexterm>
329 </listitem>
330 </varlistentry>
331
332 <varlistentry id="libiberty">
333 <term><filename class="libraryfile">libiberty</filename></term>
334 <listitem>
335 <para>Contains routines used by various GNU programs, including
336 <command>getopt</command>, <command>obstack</command>,
337 <command>strerror</command>, <command>strtol</command>, and
338 <command>strtoul</command></para>
339 <indexterm zone="ch-system-binutils libiberty">
340 <primary sortas="c-libiberty">libiberty</primary>
341 </indexterm>
342 </listitem>
343 </varlistentry>
344
345 <varlistentry id="libbfd">
346 <term><filename class="libraryfile">libbfd</filename></term>
347 <listitem>
348 <para>The Binary File Descriptor library</para>
349 <indexterm zone="ch-system-binutils libbfd">
350 <primary sortas="c-libbfd">libbfd</primary>
351 </indexterm>
352 </listitem>
353 </varlistentry>
354
355 <varlistentry id="libopcodes">
356 <term><filename class="libraryfile">libopcodes</filename></term>
357 <listitem>
358 <para>A library for dealing with opcodes&mdash;the <quote>readable
359 text</quote> versions of instructions for the processor;
360 it is used for building utilities like
361 <command>objdump</command>.</para>
362 <indexterm zone="ch-system-binutils libopcodes">
363 <primary sortas="c-libopcodes">libopcodes</primary>
364 </indexterm>
365 </listitem>
366 </varlistentry>
367
368 </variablelist>
369
370 </sect2>
371
372</sect1>
Note: See TracBrowser for help on using the repository browser.