source: chapter08/binutils.xml@ f4e814c

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

Merge changes

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