source: chapter08/binutils.xml@ b094e3f

multilib
Last change on this file since b094e3f was b094e3f, checked in by Thomas Trepl <thomas@…>, 18 months ago

Automatic merge of trunk into multilib

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