source: chapter08/binutils.xml@ d672ab7

11.1 11.1-rc1 arm multilib s6-init trunk xry111/clfs-ng xry111/lfs-next
Last change on this file since d672ab7 was d672ab7, checked in by Pierre Labastie <pierre.labastie@…>, 11 months ago

Remove spaces at end o lines - chapter08

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