source: clfs-embedded/BOOK/cross-tools/common/binutils.xml @ 62fdf1a

Last change on this file since 62fdf1a was 62fdf1a, checked in by Andrew Bradford <andrew@…>, 11 years ago

binutils & mpfr: Remove --enable-shared

Not needed.

  • Property mode set to 100644
File size: 12.3 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-cross-tools-binutils" role="wrap">
9  <?dbhtml filename="binutils.html"?>
10
11  <title>Cross Binutils-&binutils-version;</title>
12
13  <indexterm zone="ch-cross-tools-binutils">
14    <primary sortas="a-Binutils">Binutils</primary>
15    <secondary>cross tools</secondary>
16  </indexterm>
17
18  <sect2 role="package">
19    <title/>
20
21    <para>The Binutils package contains a linker, an assembler, and other
22    tools for handling object files.</para>
23
24  </sect2>
25
26  <sect2 role="installation">
27    <title>Installation of Cross Binutils</title>
28
29    <para os="a">It is important that Binutils be the first package compiled
30    because both the C library and GCC perform various tests on the available
31    linker and assembler to determine which of their own features to
32    enable.</para>
33
34    <para os="ab">Fix a couple of syntax errors that prevent the documentation
35    from building with some versions of Texinfo:</para>
36
37<screen os="ac"><userinput>sed -i -e 's/@colophon/@@colophon/' \
38    -e 's/doc@cygnus.com/doc@@cygnus.com/' bfd/doc/bfd.texinfo</userinput></screen>
39
40    <para os="b">The Binutils documentation recommends building Binutils outside of the
41    source directory in a dedicated build directory:</para>
42
43<screen os="c"><userinput>mkdir -v ../binutils-build
44cd ../binutils-build</userinput></screen>
45
46    <para os="d">Prepare Binutils for compilation:</para>
47
48<screen os="e"><userinput>../binutils-&binutils-version;/configure --prefix=${CLFS}/cross-tools \
49   --target=${CLFS_TARGET} --with-sysroot=${CLFS} --disable-nls \
50   --disable-multilib</userinput></screen>
51
52    <variablelist os="f">
53      <title>The meaning of the configure options:</title>
54
55      <varlistentry os="f1">
56        <term><parameter>--prefix=${CLFS}/cross-tools</parameter></term>
57        <listitem>
58          <para>This tells the configure script to prepare to install the
59          package in the <filename class="directory">${CLFS}/cross-tools</filename>
60          directory.</para>
61        </listitem>
62      </varlistentry>
63
64      <varlistentry os="f3">
65        <term><parameter>--target=${CLFS_TARGET}</parameter></term>
66        <listitem>
67          <para>When used with --host, this creates a cross-architecture
68          executable that creates files for ${CLFS_TARGET} but runs on
69          the host system.</para>
70        </listitem>
71      </varlistentry>
72
73      <varlistentry os="f4">
74        <term><parameter>--with-sysroot=${CLFS}</parameter></term>
75        <listitem>
76          <para>This tells configure that ${CLFS} is going to be the root
77          of our system. It will now use the specified sysroot, ${CLFS}, as
78          a prefix of the default search paths.</para>
79        </listitem>
80      </varlistentry>
81
82      <varlistentry os="f5">
83        <term><parameter>--disable-nls</parameter></term>
84        <listitem>
85          <para>This disables internationalization as i18n is not needed for the
86          cross-compile tools.</para>
87        </listitem>
88      </varlistentry>
89
90      <varlistentry os="f7">
91        <term><parameter>--disable-multilib</parameter></term>
92        <listitem>
93          <para>This option disables the building of a multilib
94          capable binutils.</para>
95        </listitem>
96      </varlistentry>
97
98    </variablelist>
99
100    <para os="g">Compile the package:</para>
101
102<screen os="h"><userinput>make configure-host
103make</userinput></screen>
104
105    <variablelist os="i">
106      <title>The meaning of the make options:</title>
107
108      <varlistentry os="i1">
109        <term><parameter>configure-host</parameter></term>
110        <listitem>
111          <para>This checks the host environment and makes sure all the
112          necessary tools are available to compile Binutils.</para>
113        </listitem>
114      </varlistentry>
115
116    </variablelist>
117
118    <para os="j">Install the package:</para>
119
120<screen os="k"><userinput>make install</userinput></screen>
121
122  </sect2>
123
124  <sect2 id="contents-binutils" role="content">
125    <title>Contents of Binutils</title>
126
127    <segmentedlist>
128      <segtitle>Installed programs</segtitle>
129      <segtitle>Installed libraries</segtitle>
130
131      <seglistitem>
132        <seg>addr2line, ar, as, c++filt, elfedit, gprof, ld, nm, objcopy,
133        objdump, ranlib, readelf, size, strings, and strip</seg>
134        <seg>libiberty.a, libbfd.[a,so], and libopcodes.[a,so]</seg>
135      </seglistitem>
136    </segmentedlist>
137
138    <variablelist>
139      <bridgehead renderas="sect3">Short Descriptions</bridgehead>
140      <?dbfo list-presentation="list"?>
141      <?dbhtml list-presentation="table"?>
142
143      <varlistentry id="addr2line">
144        <term><command>addr2line</command></term>
145        <listitem>
146          <para>Translates program addresses to file names and line numbers;
147          given an address and the name of an executable, it uses the debugging
148          information in the executable to determine which source file and line
149          number are associated with the address</para>
150          <indexterm zone="ch-cross-tools-binutils addr2line">
151            <primary sortas="b-addr2line">addr2line</primary>
152          </indexterm>
153        </listitem>
154      </varlistentry>
155
156      <varlistentry id="ar">
157        <term><command>ar</command></term>
158        <listitem>
159          <para>Creates, modifies, and extracts from archives</para>
160          <indexterm zone="ch-cross-tools-binutils ar">
161            <primary sortas="b-ar">ar</primary>
162          </indexterm>
163        </listitem>
164      </varlistentry>
165
166      <varlistentry id="as">
167        <term><command>as</command></term>
168        <listitem>
169          <para>An assembler that assembles the output of <command>gcc</command>
170          into object files</para>
171          <indexterm zone="ch-cross-tools-binutils as">
172            <primary sortas="b-as">as</primary>
173          </indexterm>
174        </listitem>
175      </varlistentry>
176
177      <varlistentry id="c-filt">
178        <term><command>c++filt</command></term>
179        <listitem>
180          <para>Used by the linker to de-mangle C++ and Java symbols and to keep
181          overloaded functions from clashing</para>
182          <indexterm zone="ch-cross-tools-binutils c-filt">
183            <primary sortas="b-c++filt">c++filt</primary>
184          </indexterm>
185        </listitem>
186      </varlistentry>
187
188      <varlistentry id="elfedit">
189        <term><command>elfedit</command></term>
190        <listitem>
191          <para>Examine and modify ELF metadata within an ELF object</para>
192          <indexterm zone="ch-cross-tools-binutils elfedit">
193            <primary sortas="b-elfedit">elfedit</primary>
194          </indexterm>
195        </listitem>
196      </varlistentry>
197
198      <varlistentry id="gprof">
199        <term><command>gprof</command></term>
200        <listitem>
201          <para>Displays call graph profile data</para>
202          <indexterm zone="ch-cross-tools-binutils gprof">
203            <primary sortas="b-gprof">gprof</primary>
204          </indexterm>
205        </listitem>
206      </varlistentry>
207
208      <varlistentry id="ld">
209        <term><command>ld</command></term>
210        <listitem>
211          <para>A linker that combines a number of object and archive files
212          into a single file, relocating their data and tying up symbol
213          references</para>
214          <indexterm zone="ch-cross-tools-binutils ld">
215            <primary sortas="b-ld">ld</primary>
216          </indexterm>
217        </listitem>
218      </varlistentry>
219
220      <varlistentry id="nm">
221        <term><command>nm</command></term>
222        <listitem>
223          <para>Lists the symbols occurring in a given object file</para>
224          <indexterm zone="ch-cross-tools-binutils nm">
225            <primary sortas="b-nm">nm</primary>
226          </indexterm>
227        </listitem>
228      </varlistentry>
229
230      <varlistentry id="objcopy">
231        <term><command>objcopy</command></term>
232        <listitem>
233          <para>Copy the contents of one object file to another</para>
234          <indexterm zone="ch-cross-tools-binutils objcopy">
235            <primary sortas="b-objcopy">objcopy</primary>
236          </indexterm>
237        </listitem>
238      </varlistentry>
239
240      <varlistentry id="objdump">
241        <term><command>objdump</command></term>
242        <listitem>
243          <para>Displays information about the given object file, with options
244          controlling the particular information to display; the information
245          shown is useful to programmers who are working on the compilation
246          tools</para>
247          <indexterm zone="ch-cross-tools-binutils objdump">
248            <primary sortas="b-objdump">objdump</primary>
249          </indexterm>
250        </listitem>
251      </varlistentry>
252
253      <varlistentry id="ranlib">
254        <term><command>ranlib</command></term>
255        <listitem>
256          <para>Generates an index of the contents of an archive and stores it
257          in the archive; the index lists all of the symbols defined by archive
258          members that are relocatable object files</para>
259          <indexterm zone="ch-cross-tools-binutils ranlib">
260            <primary sortas="b-ranlib">ranlib</primary>
261          </indexterm>
262        </listitem>
263      </varlistentry>
264
265      <varlistentry id="readelf">
266        <term><command>readelf</command></term>
267        <listitem>
268          <para>Displays information about ELF type binaries</para>
269          <indexterm zone="ch-cross-tools-binutils readelf">
270            <primary sortas="b-readelf">readelf</primary>
271          </indexterm>
272        </listitem>
273      </varlistentry>
274
275      <varlistentry id="size">
276        <term><command>size</command></term>
277        <listitem>
278          <para>Lists the section sizes and the total size for the given
279          object files</para>
280          <indexterm zone="ch-cross-tools-binutils size">
281            <primary sortas="b-size">size</primary>
282          </indexterm>
283        </listitem>
284      </varlistentry>
285
286      <varlistentry id="strings">
287        <term><command>strings</command></term>
288        <listitem>
289          <para>Outputs, for each given file, the sequences of printable
290          characters that are of at least the specified length (defaulting to
291          four); for object files, it prints, by default, only the strings from
292          the initializing and loading sections while for other types of files,
293          it scans the entire file</para>
294          <indexterm zone="ch-cross-tools-binutils strings">
295            <primary sortas="b-strings">strings</primary>
296          </indexterm>
297        </listitem>
298      </varlistentry>
299
300      <varlistentry id="strip">
301        <term><command>strip</command></term>
302        <listitem>
303          <para>Discards symbols from object files</para>
304          <indexterm zone="ch-cross-tools-binutils strip">
305            <primary sortas="b-strip">strip</primary>
306          </indexterm>
307        </listitem>
308      </varlistentry>
309
310      <varlistentry id="libiberty">
311        <term><filename class="libraryfile">libiberty</filename></term>
312        <listitem>
313          <para>Contains routines used by various GNU programs, including
314          <command>getopt</command>, <command>obstack</command>,
315          <command>strerror</command>, <command>strtol</command>, and
316          <command>strtoul</command></para>
317          <indexterm zone="ch-cross-tools-binutils libiberty">
318            <primary sortas="c-libiberty">libiberty</primary>
319          </indexterm>
320        </listitem>
321      </varlistentry>
322
323      <varlistentry id="libbfd">
324        <term><filename class="libraryfile">libbfd</filename></term>
325        <listitem>
326          <para>The Binary File Descriptor library</para>
327          <indexterm zone="ch-cross-tools-binutils libbfd">
328            <primary sortas="c-libbfd">libbfd</primary>
329          </indexterm>
330        </listitem>
331      </varlistentry>
332
333      <varlistentry id="libopcodes">
334        <term><filename class="libraryfile">libopcodes</filename></term>
335        <listitem>
336          <para>A library for dealing with opcodes&mdash;the <quote>readable
337          text</quote> versions of instructions for the processor;
338          it is used for building utilities like
339          <command>objdump</command>.</para>
340          <indexterm zone="ch-cross-tools-binutils libopcodes">
341            <primary sortas="c-libopcodes">libopcodes</primary>
342          </indexterm>
343        </listitem>
344      </varlistentry>
345
346    </variablelist>
347
348  </sect2>
349
350</sect1>
Note: See TracBrowser for help on using the repository browser.