source: chapter08/binutils.xml@ d95ff15

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

Remove remaining merge marker

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