source: chapter08/binutils.xml@ c500323

11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 bdubbs/gcc13 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since c500323 was c500323, checked in by Xi Ruoyao <xry111@…>, 22 months ago

document some newly reported test failures

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