source: chapter08/binutils.xml@ bb19832

multilib
Last change on this file since bb19832 was bb19832, checked in by Thomas Trepl (Moody) <thomas@…>, 2 years ago

Automatic merge of trunk into multilib

  • Property mode set to 100644
File size: 16.5 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-fin-sbu;</seg>
35 <seg>&binutils-fin-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>Upstream has made a patch to fix a problem when using binutils
61 for building some BLFS packages with Link Time Optimization (LTO)
62 enabled. Apply that now:</para>
63
64 <screen><userinput remap="pre">patch -Np1 -i ../&binutils-lto-patch;</userinput></screen>
65
66<!--
67 <para>An error in the building system causes the shipped man pages to
68 be empty. Workaround the issue and remove the shipped man pages, so the
69 man pages will be regenerated correctly:</para>
70
71<screen><userinput remap="pre">sed -i '63d' etc/texi2pod.pl
72find -name \*.1 -delete</userinput></screen>
73-->
74
75 <para>
76 Now make a fix identified upstream that affects building some packages:
77 </para>
78
79<screen><userinput remap="pre">sed -e '/R_386_TLS_LE /i \ || (TYPE) == R_386_TLS_IE \\' \
80 -i ./bfd/elfxx-x86.h</userinput></screen>
81
82 <para>The Binutils documentation recommends building Binutils
83 in a dedicated build directory:</para>
84
85<screen><userinput remap="pre">mkdir -v build
86cd build</userinput></screen>
87
88 <para>Prepare Binutils for compilation:</para>
89
90<screen arch="default"><userinput remap="configure">../configure --prefix=/usr \
91 --enable-gold \
92 --enable-ld=default \
93 --enable-plugins \
94 --enable-shared \
95 --disable-werror \
96 --enable-64-bit-bfd \
97 --with-system-zlib</userinput></screen>
98<screen arch="ml_32,ml_x32,ml_all"><userinput remap="configure">../configure --prefix=/usr \
99 --enable-gold \
100 --enable-ld=default \
101 --enable-plugins \
102 --enable-shared \
103 --disable-werror \
104 --enable-64-bit-bfd \
105 --with-system-zlib \
106 --enable-multilib</userinput></screen>
107
108 <variablelist>
109 <title>The meaning of the configure parameters:</title>
110
111 <varlistentry>
112 <term><parameter>--enable-gold</parameter></term>
113 <listitem>
114 <para>Build the gold linker and install it as ld.gold (along side the
115 default linker).</para>
116 </listitem>
117 </varlistentry>
118
119 <varlistentry>
120 <term><parameter>--enable-ld=default</parameter></term>
121 <listitem>
122 <para>Build the original bfd linker and install it as both ld (the
123 default linker) and ld.bfd.</para>
124 </listitem>
125 </varlistentry>
126
127 <varlistentry>
128 <term><parameter>--enable-plugins</parameter></term>
129 <listitem>
130 <para>Enables plugin support for the linker.</para>
131 </listitem>
132 </varlistentry>
133
134 <varlistentry>
135 <term><parameter>--enable-64-bit-bfd</parameter></term>
136 <listitem>
137 <para>Enables 64-bit support (on hosts with narrower word sizes).
138 May not be needed on 64-bit systems, but does no harm.</para>
139 </listitem>
140 </varlistentry>
141
142 <varlistentry arch="ml_32,ml_x32,ml_all">
143 <term><parameter>--enable-multilib</parameter></term>
144 <listitem>
145 <para>Enables multilib support in bintutils.</para>
146 </listitem>
147 </varlistentry>
148
149 <varlistentry>
150 <term><parameter>--with-system-zlib</parameter></term>
151 <listitem>
152 <para>Use the installed zlib library rather than building the
153 included version.</para>
154 </listitem>
155 </varlistentry>
156
157 </variablelist>
158
159 <para>Compile the package:</para>
160
161<screen><userinput remap="make">make tooldir=/usr</userinput></screen>
162
163 <variablelist>
164 <title>The meaning of the make parameter:</title>
165
166 <varlistentry>
167 <term><parameter>tooldir=/usr</parameter></term>
168 <listitem>
169 <para>Normally, the tooldir (the directory where the executables will
170 ultimately be located) is set to <filename
171 class="directory">$(exec_prefix)/$(target_alias)</filename>. For
172 example, x86_64 machines would expand that to <filename
173 class="directory">/usr/x86_64-pc-linux-gnu</filename>. Because this is
174 a custom system, this target-specific directory in <filename
175 class="directory">/usr</filename> is not required. <filename
176 class="directory">$(exec_prefix)/$(target_alias)</filename> would be
177 used if the system was used to cross-compile (for example, compiling a
178 package on an Intel machine that generates code that can be executed
179 on PowerPC machines).</para>
180 </listitem>
181 </varlistentry>
182
183 </variablelist>
184
185 <important>
186 <para>The test suite for Binutils in this section is considered critical.
187 Do not skip it under any circumstances.</para>
188 </important>
189
190 <para>Test the results:</para>
191
192<screen><userinput remap="test">make -k check</userinput></screen>
193
194 <para>Four tests related to zlib are known to fail.</para>
195<!--
196 <para>Seven gold tests are known to fail with gcc-11.1.0</para>
197
198 <para>Four ld tests named <quote>Run property ...</quote> are known to
199 fail.</para>
200 -->
201 <para>Install the package:</para>
202
203<screen><userinput remap="install">make tooldir=/usr install</userinput></screen>
204
205 <para>Remove useless static libraries:</para>
206
207<screen><userinput remap="install">rm -fv /usr/lib/lib{bfd,ctf,ctf-nobfd,opcodes}.a</userinput></screen>
208
209 </sect2>
210
211 <sect2 id="contents-binutils" role="content">
212 <title>Contents of Binutils</title>
213
214 <segmentedlist>
215 <segtitle>Installed programs</segtitle>
216 <segtitle>Installed libraries</segtitle>
217 <segtitle>Installed directory</segtitle>
218
219 <seglistitem>
220 <seg>addr2line, ar, as, c++filt, dwp, elfedit, gprof, ld, ld.bfd, ld.gold, nm,
221 objcopy, objdump, ranlib, readelf, size, strings, and strip</seg>
222 <seg>libbfd.so, libctf.so, libctf-nobfd.so, and libopcodes.so</seg>
223 <seg>/usr/lib/ldscripts</seg>
224 </seglistitem>
225 </segmentedlist>
226
227 <variablelist>
228 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
229 <?dbfo list-presentation="list"?>
230 <?dbhtml list-presentation="table"?>
231
232 <varlistentry id="addr2line">
233 <term><command>addr2line</command></term>
234 <listitem>
235 <para>Translates program addresses to file names and line numbers;
236 given an address and the name of an executable, it uses the debugging
237 information in the executable to determine which source file and line
238 number are associated with the address</para>
239 <indexterm zone="ch-system-binutils addr2line">
240 <primary sortas="b-addr2line">addr2line</primary>
241 </indexterm>
242 </listitem>
243 </varlistentry>
244
245 <varlistentry id="ar">
246 <term><command>ar</command></term>
247 <listitem>
248 <para>Creates, modifies, and extracts from archives</para>
249 <indexterm zone="ch-system-binutils ar">
250 <primary sortas="b-ar">ar</primary>
251 </indexterm>
252 </listitem>
253 </varlistentry>
254
255 <varlistentry id="as">
256 <term><command>as</command></term>
257 <listitem>
258 <para>An assembler that assembles the output of <command>gcc</command>
259 into object files</para>
260 <indexterm zone="ch-system-binutils as">
261 <primary sortas="b-as">as</primary>
262 </indexterm>
263 </listitem>
264 </varlistentry>
265
266 <varlistentry id="c-filt">
267 <term><command>c++filt</command></term>
268 <listitem>
269 <para>Used by the linker to de-mangle C++ and Java symbols and to keep
270 overloaded functions from clashing</para>
271 <indexterm zone="ch-system-binutils c-filt">
272 <primary sortas="b-c++filt">c++filt</primary>
273 </indexterm>
274 </listitem>
275 </varlistentry>
276
277 <varlistentry id="dwp">
278 <term><command>dwp</command></term>
279 <listitem>
280 <para>The DWARF packaging utility</para>
281 <indexterm zone="ch-system-binutils dwp">
282 <primary sortas="dwp">dwp</primary>
283 </indexterm>
284 </listitem>
285 </varlistentry>
286
287 <varlistentry id="elfedit">
288 <term><command>elfedit</command></term>
289 <listitem>
290 <para>Updates the ELF header of ELF files</para>
291 <indexterm zone="ch-system-binutils elfedit">
292 <primary sortas="b-elfedit">elfedit</primary>
293 </indexterm>
294 </listitem>
295 </varlistentry>
296
297 <varlistentry id="gprof">
298 <term><command>gprof</command></term>
299 <listitem>
300 <para>Displays call graph profile data</para>
301 <indexterm zone="ch-system-binutils gprof">
302 <primary sortas="b-gprof">gprof</primary>
303 </indexterm>
304 </listitem>
305 </varlistentry>
306
307 <varlistentry id="ld">
308 <term><command>ld</command></term>
309 <listitem>
310 <para>A linker that combines a number of object and archive files
311 into a single file, relocating their data and tying up symbol
312 references</para>
313 <indexterm zone="ch-system-binutils ld">
314 <primary sortas="b-ld">ld</primary>
315 </indexterm>
316 </listitem>
317 </varlistentry>
318
319 <varlistentry id="ld.gold">
320 <term><command>ld.gold</command></term>
321 <listitem>
322 <para>A cut down version of ld that only supports the
323 elf object file format</para>
324 <indexterm zone="ch-system-binutils ld.gold">
325 <primary sortas="b-ld.gold">ld.gold</primary>
326 </indexterm>
327 </listitem>
328 </varlistentry>
329
330 <varlistentry id="ld.bfd">
331 <term><command>ld.bfd</command></term>
332 <listitem>
333 <para>Hard link to <command>ld</command></para>
334 <indexterm zone="ch-system-binutils ld.bfd">
335 <primary sortas="b-ld.bfd">ld.bfd</primary>
336 </indexterm>
337 </listitem>
338 </varlistentry>
339
340 <varlistentry id="nm">
341 <term><command>nm</command></term>
342 <listitem>
343 <para>Lists the symbols occurring in a given object file</para>
344 <indexterm zone="ch-system-binutils nm">
345 <primary sortas="b-nm">nm</primary>
346 </indexterm>
347 </listitem>
348 </varlistentry>
349
350 <varlistentry id="objcopy">
351 <term><command>objcopy</command></term>
352 <listitem>
353 <para>Translates one type of object file into another</para>
354 <indexterm zone="ch-system-binutils objcopy">
355 <primary sortas="b-objcopy">objcopy</primary>
356 </indexterm>
357 </listitem>
358 </varlistentry>
359
360 <varlistentry id="objdump">
361 <term><command>objdump</command></term>
362 <listitem>
363 <para>Displays information about the given object file, with options
364 controlling the particular information to display; the information
365 shown is useful to programmers who are working on the compilation
366 tools</para>
367 <indexterm zone="ch-system-binutils objdump">
368 <primary sortas="b-objdump">objdump</primary>
369 </indexterm>
370 </listitem>
371 </varlistentry>
372
373 <varlistentry id="ranlib">
374 <term><command>ranlib</command></term>
375 <listitem>
376 <para>Generates an index of the contents of an archive and stores it
377 in the archive; the index lists all of the symbols defined by archive
378 members that are relocatable object files</para>
379 <indexterm zone="ch-system-binutils ranlib">
380 <primary sortas="b-ranlib">ranlib</primary>
381 </indexterm>
382 </listitem>
383 </varlistentry>
384
385 <varlistentry id="readelf">
386 <term><command>readelf</command></term>
387 <listitem>
388 <para>Displays information about ELF type binaries</para>
389 <indexterm zone="ch-system-binutils readelf">
390 <primary sortas="b-readelf">readelf</primary>
391 </indexterm>
392 </listitem>
393 </varlistentry>
394
395 <varlistentry id="size">
396 <term><command>size</command></term>
397 <listitem>
398 <para>Lists the section sizes and the total size for the given
399 object files</para>
400 <indexterm zone="ch-system-binutils size">
401 <primary sortas="b-size">size</primary>
402 </indexterm>
403 </listitem>
404 </varlistentry>
405
406 <varlistentry id="strings">
407 <term><command>strings</command></term>
408 <listitem>
409 <para>Outputs, for each given file, the sequences of printable
410 characters that are of at least the specified length (defaulting to
411 four); for object files, it prints, by default, only the strings from
412 the initializing and loading sections while for other types of files, it
413 scans the entire file</para>
414 <indexterm zone="ch-system-binutils strings">
415 <primary sortas="b-strings">strings</primary>
416 </indexterm>
417 </listitem>
418 </varlistentry>
419
420 <varlistentry id="strip">
421 <term><command>strip</command></term>
422 <listitem>
423 <para>Discards symbols from object files</para>
424 <indexterm zone="ch-system-binutils strip">
425 <primary sortas="b-strip">strip</primary>
426 </indexterm>
427 </listitem>
428 </varlistentry>
429
430 <varlistentry id="libbfd">
431 <term><filename class="libraryfile">libbfd</filename></term>
432 <listitem>
433 <para>The Binary File Descriptor library</para>
434 <indexterm zone="ch-system-binutils libbfd">
435 <primary sortas="c-libbfd">libbfd</primary>
436 </indexterm>
437 </listitem>
438 </varlistentry>
439
440 <varlistentry id="libctf">
441 <term><filename class="libraryfile">libctf</filename></term>
442 <listitem>
443 <para>The Compat ANSI-C Type Format debugging support library</para>
444 <indexterm zone="ch-system-binutils libctf">
445 <primary sortas="c-libctf">libctf</primary>
446 </indexterm>
447 </listitem>
448 </varlistentry>
449
450 <varlistentry id="libctf-nobfd">
451 <term><filename class="libraryfile">libctf-nobfd</filename></term>
452 <listitem>
453 <para>A libctf variant which does not use libbfd functionality</para>
454 <indexterm zone="ch-system-binutils libctf-nobfd">
455 <primary sortas="c-libctf-nobfd">libctf-nobfd</primary>
456 </indexterm>
457 </listitem>
458 </varlistentry>
459
460 <varlistentry id="libopcodes">
461 <term><filename class="libraryfile">libopcodes</filename></term>
462 <listitem>
463 <para>A library for dealing with opcodes&mdash;the <quote>readable
464 text</quote> versions of instructions for the processor;
465 it is used for building utilities like
466 <command>objdump</command></para>
467 <indexterm zone="ch-system-binutils libopcodes">
468 <primary sortas="c-libopcodes">libopcodes</primary>
469 </indexterm>
470 </listitem>
471 </varlistentry>
472
473 </variablelist>
474
475 </sect2>
476
477</sect1>
Note: See TracBrowser for help on using the repository browser.