source: chapter08/binutils.xml@ 4f8ae861

10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next 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 4f8ae861 was cd152f22, checked in by Xi Ruoyao <xry111@…>, 3 years ago

remove unneeded static libraries

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@12122 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

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