source: chapter08/binutils.xml@ 8df35e0

xry111/clfs-ng
Last change on this file since 8df35e0 was 01cf150, checked in by Bruce Dubbs <bdubbs@…>, 2 years ago

Remove reference to test failures

  • Property mode set to 100644
File size: 15.9 KB
RevLine 
[673b0d8]1<?xml version="1.0" encoding="ISO-8859-1"?>
[b06ca36]2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
[673b0d8]4 <!ENTITY % general-entities SYSTEM "../general.ent">
5 %general-entities;
6]>
[92474b45]7
[81fd230]8<sect1 id="ch-system-binutils" role="wrap">
[92474b45]9 <?dbhtml filename="binutils.html"?>
10
[e747759]11 <sect1info condition="script">
12 <productname>binutils</productname>
13 <productnumber>&binutils-version;</productnumber>
14 <address>&binutils-url;</address>
15 </sect1info>
16
[92474b45]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/>
[673b0d8]25
[92474b45]26 <para>The Binutils package contains a linker, an assembler, and other
27 tools for handling object files.</para>
[6370fa6]28
[92474b45]29 <segmentedlist>
30 <segtitle>&buildtime;</segtitle>
31 <segtitle>&diskspace;</segtitle>
[5888299]32
[92474b45]33 <seglistitem>
[fb386e0]34 <seg>&binutils-fin-sbu;</seg>
35 <seg>&binutils-fin-du;</seg>
[92474b45]36 </seglistitem>
37 </segmentedlist>
[a001133]38
[92474b45]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
[4d86da9]45 environment by performing a simple test:</para>
[73aedd1d]46
[0445a3d]47<screen><userinput remap="test">expect -c "spawn ls"</userinput></screen>
[73aedd1d]48
[4d86da9]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>
[81fd230]56
[92474b45]57<screen><computeroutput>The system has no more ptys.
[81fd230]58Ask your system administrator to create more.</computeroutput></screen>
[fb8aee8]59
[c5755859]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>
[6af4dab]63
64 <screen><userinput remap="pre">patch -Np1 -i ../&binutils-lto-patch;</userinput></screen>
65
[9c4ff70]66<!--
[ff96923]67 <para>An error in the building system causes the shipped man pages to
[ff5c009]68 be empty. Workaround the issue and remove the shipped man pages, so the
[ff96923]69 man pages will be regenerated correctly:</para>
[ff5c009]70
71<screen><userinput remap="pre">sed -i '63d' etc/texi2pod.pl
72find -name \*.1 -delete</userinput></screen>
[9c4ff70]73-->
[12a27da7]74
[d6f5aab]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
[d672ab7]82 <para>The Binutils documentation recommends building Binutils
[f1dd547]83 in a dedicated build directory:</para>
[73aedd1d]84
[f1dd547]85<screen><userinput remap="pre">mkdir -v build
86cd build</userinput></screen>
[73aedd1d]87
[92474b45]88 <para>Prepare Binutils for compilation:</para>
[73aedd1d]89
[e123025]90<screen><userinput remap="configure">../configure --prefix=/usr \
91 --enable-gold \
92 --enable-ld=default \
93 --enable-plugins \
94 --enable-shared \
95 --disable-werror \
[869b0966]96 --enable-64-bit-bfd \
[512c848]97 --with-system-zlib</userinput></screen>
98 <variablelist>
99 <title>The meaning of the configure parameters:</title>
100
[e123025]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>
[5609769]112 <para>Build the original bfd linker and install it as both ld (the
[e123025]113 default linker) and ld.bfd.</para>
114 </listitem>
115 </varlistentry>
116
[512c848]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
[869b0966]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
[512c848]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>
[73aedd1d]141
[92474b45]142 <para>Compile the package:</para>
[73aedd1d]143
[0445a3d]144<screen><userinput remap="make">make tooldir=/usr</userinput></screen>
[73aedd1d]145
[92474b45]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
[6e88633]155 example, x86_64 machines would expand that to <filename
[1f28ed12]156 class="directory">/usr/x86_64-pc-linux-gnu</filename>. Because this is
[92474b45]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>
[81fd230]174
[42130d6]175<screen><userinput remap="test">make -k check</userinput></screen>
[01cf150]176<!--
[ea0f48e]177 <para>Four tests related to zlib are known to fail.</para>
[01cf150]178-->
[c2d2342]179<!--
[075d35fb]180 <para>Seven gold tests are known to fail with gcc-11.1.0</para>
181
182 <para>Four ld tests named <quote>Run property ...</quote> are known to
[0ceb295]183 fail.</para>
[c2d2342]184 -->
[92474b45]185 <para>Install the package:</para>
[73aedd1d]186
[bca4876]187<screen><userinput remap="install">make tooldir=/usr install</userinput></screen>
[73aedd1d]188
[cd152f22]189 <para>Remove useless static libraries:</para>
190
191<screen><userinput remap="install">rm -fv /usr/lib/lib{bfd,ctf,ctf-nobfd,opcodes}.a</userinput></screen>
192
[92474b45]193 </sect2>
194
195 <sect2 id="contents-binutils" role="content">
196 <title>Contents of Binutils</title>
197
198 <segmentedlist>
199 <segtitle>Installed programs</segtitle>
200 <segtitle>Installed libraries</segtitle>
[fe05b08]201 <segtitle>Installed directory</segtitle>
[92474b45]202
203 <seglistitem>
[78cc3be]204 <seg>addr2line, ar, as, c++filt, dwp, elfedit, gprof, ld, ld.bfd, ld.gold, nm,
[3119ddc]205 objcopy, objdump, ranlib, readelf, size, strings, and strip</seg>
[cd152f22]206 <seg>libbfd.so, libctf.so, libctf-nobfd.so, and libopcodes.so</seg>
[fe05b08]207 <seg>/usr/lib/ldscripts</seg>
[92474b45]208 </seglistitem>
209 </segmentedlist>
210
211 <variablelist>
212 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
213 <?dbfo list-presentation="list"?>
214 <?dbhtml list-presentation="table"?>
215
216 <varlistentry id="addr2line">
217 <term><command>addr2line</command></term>
218 <listitem>
219 <para>Translates program addresses to file names and line numbers;
220 given an address and the name of an executable, it uses the debugging
221 information in the executable to determine which source file and line
222 number are associated with the address</para>
223 <indexterm zone="ch-system-binutils addr2line">
224 <primary sortas="b-addr2line">addr2line</primary>
225 </indexterm>
226 </listitem>
227 </varlistentry>
228
229 <varlistentry id="ar">
230 <term><command>ar</command></term>
231 <listitem>
232 <para>Creates, modifies, and extracts from archives</para>
233 <indexterm zone="ch-system-binutils ar">
234 <primary sortas="b-ar">ar</primary>
235 </indexterm>
236 </listitem>
237 </varlistentry>
238
239 <varlistentry id="as">
240 <term><command>as</command></term>
241 <listitem>
242 <para>An assembler that assembles the output of <command>gcc</command>
243 into object files</para>
244 <indexterm zone="ch-system-binutils as">
245 <primary sortas="b-as">as</primary>
246 </indexterm>
247 </listitem>
248 </varlistentry>
249
250 <varlistentry id="c-filt">
251 <term><command>c++filt</command></term>
252 <listitem>
253 <para>Used by the linker to de-mangle C++ and Java symbols and to keep
254 overloaded functions from clashing</para>
255 <indexterm zone="ch-system-binutils c-filt">
256 <primary sortas="b-c++filt">c++filt</primary>
257 </indexterm>
258 </listitem>
259 </varlistentry>
260
[78cc3be]261 <varlistentry id="dwp">
262 <term><command>dwp</command></term>
263 <listitem>
264 <para>The DWARF packaging utility</para>
265 <indexterm zone="ch-system-binutils dwp">
266 <primary sortas="dwp">dwp</primary>
267 </indexterm>
268 </listitem>
269 </varlistentry>
270
[3119ddc]271 <varlistentry id="elfedit">
272 <term><command>elfedit</command></term>
273 <listitem>
274 <para>Updates the ELF header of ELF files</para>
275 <indexterm zone="ch-system-binutils elfedit">
276 <primary sortas="b-elfedit">elfedit</primary>
277 </indexterm>
278 </listitem>
279 </varlistentry>
280
[92474b45]281 <varlistentry id="gprof">
282 <term><command>gprof</command></term>
283 <listitem>
284 <para>Displays call graph profile data</para>
285 <indexterm zone="ch-system-binutils gprof">
286 <primary sortas="b-gprof">gprof</primary>
287 </indexterm>
288 </listitem>
289 </varlistentry>
290
291 <varlistentry id="ld">
292 <term><command>ld</command></term>
293 <listitem>
294 <para>A linker that combines a number of object and archive files
295 into a single file, relocating their data and tying up symbol
296 references</para>
297 <indexterm zone="ch-system-binutils ld">
298 <primary sortas="b-ld">ld</primary>
299 </indexterm>
300 </listitem>
301 </varlistentry>
302
[98d9003]303 <varlistentry id="ld.gold">
304 <term><command>ld.gold</command></term>
305 <listitem>
[d672ab7]306 <para>A cut down version of ld that only supports the
[98d9003]307 elf object file format</para>
308 <indexterm zone="ch-system-binutils ld.gold">
309 <primary sortas="b-ld.gold">ld.gold</primary>
310 </indexterm>
311 </listitem>
312 </varlistentry>
313
[3119ddc]314 <varlistentry id="ld.bfd">
315 <term><command>ld.bfd</command></term>
316 <listitem>
317 <para>Hard link to <command>ld</command></para>
318 <indexterm zone="ch-system-binutils ld.bfd">
319 <primary sortas="b-ld.bfd">ld.bfd</primary>
320 </indexterm>
321 </listitem>
322 </varlistentry>
323
[92474b45]324 <varlistentry id="nm">
325 <term><command>nm</command></term>
326 <listitem>
327 <para>Lists the symbols occurring in a given object file</para>
328 <indexterm zone="ch-system-binutils nm">
329 <primary sortas="b-nm">nm</primary>
330 </indexterm>
331 </listitem>
332 </varlistentry>
333
334 <varlistentry id="objcopy">
335 <term><command>objcopy</command></term>
336 <listitem>
337 <para>Translates one type of object file into another</para>
338 <indexterm zone="ch-system-binutils objcopy">
339 <primary sortas="b-objcopy">objcopy</primary>
340 </indexterm>
341 </listitem>
342 </varlistentry>
343
344 <varlistentry id="objdump">
345 <term><command>objdump</command></term>
346 <listitem>
347 <para>Displays information about the given object file, with options
348 controlling the particular information to display; the information
349 shown is useful to programmers who are working on the compilation
350 tools</para>
351 <indexterm zone="ch-system-binutils objdump">
352 <primary sortas="b-objdump">objdump</primary>
353 </indexterm>
354 </listitem>
355 </varlistentry>
356
357 <varlistentry id="ranlib">
358 <term><command>ranlib</command></term>
359 <listitem>
360 <para>Generates an index of the contents of an archive and stores it
361 in the archive; the index lists all of the symbols defined by archive
362 members that are relocatable object files</para>
363 <indexterm zone="ch-system-binutils ranlib">
364 <primary sortas="b-ranlib">ranlib</primary>
365 </indexterm>
366 </listitem>
367 </varlistentry>
368
369 <varlistentry id="readelf">
370 <term><command>readelf</command></term>
371 <listitem>
372 <para>Displays information about ELF type binaries</para>
373 <indexterm zone="ch-system-binutils readelf">
374 <primary sortas="b-readelf">readelf</primary>
375 </indexterm>
376 </listitem>
377 </varlistentry>
378
379 <varlistentry id="size">
380 <term><command>size</command></term>
381 <listitem>
382 <para>Lists the section sizes and the total size for the given
383 object files</para>
384 <indexterm zone="ch-system-binutils size">
385 <primary sortas="b-size">size</primary>
386 </indexterm>
387 </listitem>
388 </varlistentry>
389
390 <varlistentry id="strings">
391 <term><command>strings</command></term>
392 <listitem>
393 <para>Outputs, for each given file, the sequences of printable
394 characters that are of at least the specified length (defaulting to
395 four); for object files, it prints, by default, only the strings from
396 the initializing and loading sections while for other types of files, it
397 scans the entire file</para>
398 <indexterm zone="ch-system-binutils strings">
399 <primary sortas="b-strings">strings</primary>
400 </indexterm>
401 </listitem>
402 </varlistentry>
403
404 <varlistentry id="strip">
405 <term><command>strip</command></term>
406 <listitem>
407 <para>Discards symbols from object files</para>
408 <indexterm zone="ch-system-binutils strip">
409 <primary sortas="b-strip">strip</primary>
410 </indexterm>
411 </listitem>
412 </varlistentry>
[7bb9fda]413
[92474b45]414 <varlistentry id="libbfd">
415 <term><filename class="libraryfile">libbfd</filename></term>
416 <listitem>
417 <para>The Binary File Descriptor library</para>
418 <indexterm zone="ch-system-binutils libbfd">
419 <primary sortas="c-libbfd">libbfd</primary>
420 </indexterm>
421 </listitem>
422 </varlistentry>
423
[90af5870]424 <varlistentry id="libctf">
425 <term><filename class="libraryfile">libctf</filename></term>
426 <listitem>
427 <para>The Compat ANSI-C Type Format debugging support library</para>
428 <indexterm zone="ch-system-binutils libctf">
429 <primary sortas="c-libctf">libctf</primary>
430 </indexterm>
431 </listitem>
432 </varlistentry>
433
434 <varlistentry id="libctf-nobfd">
435 <term><filename class="libraryfile">libctf-nobfd</filename></term>
436 <listitem>
437 <para>A libctf variant which does not use libbfd functionality</para>
438 <indexterm zone="ch-system-binutils libctf-nobfd">
439 <primary sortas="c-libctf-nobfd">libctf-nobfd</primary>
440 </indexterm>
441 </listitem>
442 </varlistentry>
443
[92474b45]444 <varlistentry id="libopcodes">
445 <term><filename class="libraryfile">libopcodes</filename></term>
446 <listitem>
447 <para>A library for dealing with opcodes&mdash;the <quote>readable
448 text</quote> versions of instructions for the processor;
449 it is used for building utilities like
[afba93b]450 <command>objdump</command></para>
[92474b45]451 <indexterm zone="ch-system-binutils libopcodes">
452 <primary sortas="c-libopcodes">libopcodes</primary>
453 </indexterm>
454 </listitem>
455 </varlistentry>
456
457 </variablelist>
458
459 </sect2>
[673b0d8]460
461</sect1>
Note: See TracBrowser for help on using the repository browser.