source: clfs-embedded/BOOK/cross-tools/common/binutils.xml@ 492e5a3

Last change on this file since 492e5a3 was e666df1, checked in by Jim Gifford <clfs@…>, 18 years ago

Updated Date
Added Busybox
Added Patches
Updated uClibc to build Busybox

  • Property mode set to 100644
File size: 12.4 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
3 "http://www.oasis-open.org/docbook/xml/4.4/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 uClibc 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="p1">To make sure that the proper syntax is used for a couple of
35 tools, apply the following patch:</para>
36
37<screen os="p2"><userinput>patch -Np1 -i ../&binutils-posix-patch;</userinput></screen>
38
39 <para os="b">The Binutils documentation recommends building Binutils outside of the
40 source directory in a dedicated build directory:</para>
41
42<screen os="c"><userinput>mkdir -v ../binutils-build
43cd ../binutils-build</userinput></screen>
44
45 <para os="d">Prepare Binutils for compilation:</para>
46
47<screen os="e"><userinput>../binutils-&binutils-version;/configure --prefix=${CLFS}/cross-tools \
48 --host=${CLFS_HOST} --target=${CLFS_TARGET} --with-sysroot=${CLFS} \
49 --disable-nls --enable-shared --disable-multilib</userinput></screen>
50
51 <variablelist os="f">
52 <title>The meaning of the configure options:</title>
53
54 <varlistentry os="f1">
55 <term><parameter>--prefix=${CLFS}/cross-tools</parameter></term>
56 <listitem>
57 <para>This tells the configure script to prepare to install the
58 package in the <filename class="directory">${CLFS}/cross-tools</filename>
59 directory.</para>
60 </listitem>
61 </varlistentry>
62
63 <varlistentry os="f2">
64 <term><parameter>--host=${CLFS_HOST}</parameter></term>
65 <listitem>
66 <para>When used with --target, this creates a cross-architecture
67 executable that creates files for ${CLFS_TARGET} but runs on
68 ${CLFS_HOST}.</para>
69 </listitem>
70 </varlistentry>
71
72 <varlistentry os="f3">
73 <term><parameter>--target=${CLFS_TARGET}</parameter></term>
74 <listitem>
75 <para>When used with --host, this creates a cross-architecture
76 executable that creates files for ${CLFS_TARGET} but runs on
77 ${CLFS_HOST}.</para>
78 </listitem>
79 </varlistentry>
80
81 <varlistentry os="f4">
82 <term><parameter>--with-sysroot=${CLFS}</parameter></term>
83 <listitem>
84 <para>This tells configure that ${CLFS} is going to be the root
85 of our system. It will now use the specified sysroot, ${CLFS}, as
86 a prefix of the default search paths.</para>
87 </listitem>
88 </varlistentry>
89
90 <varlistentry os="f5">
91 <term><parameter>--disable-nls</parameter></term>
92 <listitem>
93 <para>This disables internationalization as i18n is not needed for the
94 cross-compile tools.</para>
95 </listitem>
96 </varlistentry>
97
98 <varlistentry os="f6">
99 <term><parameter>--enable-shared</parameter></term>
100 <listitem>
101 <para>Enable the creation of the shared libraries.</para>
102 </listitem>
103 </varlistentry>
104
105 <varlistentry os="f7">
106 <term><parameter>--disable-multilib</parameter></term>
107 <listitem>
108 <para>This option disables the building of a multilib
109 capable binutils.</para>
110 </listitem>
111 </varlistentry>
112
113 </variablelist>
114
115 <para os="g">Compile the package:</para>
116
117<screen os="h"><userinput>make configure-host
118make</userinput></screen>
119
120 <variablelist os="i">
121 <title>The meaning of the make options:</title>
122
123 <varlistentry os="i1">
124 <term><parameter>configure-host</parameter></term>
125 <listitem>
126 <para>This checks the host environment and makes sure all the
127 necessary tools are available to compile Binutils.</para>
128 </listitem>
129 </varlistentry>
130
131 </variablelist>
132
133 <para os="j">Install the package:</para>
134
135<screen os="k"><userinput>make install</userinput></screen>
136
137 <para os="l">Copy the <filename class="headerfile">libiberty.h</filename> file to
138 <filename class="directory">${CLFS}/usr/include</filename> directory:</para>
139
140<screen os="m"><userinput>cp -v ../binutils-&binutils-version;/include/libiberty.h ${CLFS}/usr/include</userinput></screen>
141
142 </sect2>
143
144 <sect2 id="contents-binutils" role="content">
145 <title>Contents of Binutils</title>
146
147 <segmentedlist>
148 <segtitle>Installed programs</segtitle>
149 <segtitle>Installed libraries</segtitle>
150
151 <seglistitem>
152 <seg>addr2line, ar, as, c++filt, gprof, ld, nm, objcopy, objdump,
153 ranlib, readelf, size, strings, and strip</seg>
154 <seg>libiberty.a, libbfd.[a,so], and libopcodes.[a,so]</seg>
155 </seglistitem>
156 </segmentedlist>
157
158 <variablelist>
159 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
160 <?dbfo list-presentation="list"?>
161 <?dbhtml list-presentation="table"?>
162
163 <varlistentry id="addr2line">
164 <term><command>addr2line</command></term>
165 <listitem>
166 <para>Translates program addresses to file names and line numbers;
167 given an address and the name of an executable, it uses the debugging
168 information in the executable to determine which source file and line
169 number are associated with the address</para>
170 <indexterm zone="ch-cross-tools-binutils addr2line">
171 <primary sortas="b-addr2line">addr2line</primary>
172 </indexterm>
173 </listitem>
174 </varlistentry>
175
176 <varlistentry id="ar">
177 <term><command>ar</command></term>
178 <listitem>
179 <para>Creates, modifies, and extracts from archives</para>
180 <indexterm zone="ch-cross-tools-binutils ar">
181 <primary sortas="b-ar">ar</primary>
182 </indexterm>
183 </listitem>
184 </varlistentry>
185
186 <varlistentry id="as">
187 <term><command>as</command></term>
188 <listitem>
189 <para>An assembler that assembles the output of <command>gcc</command>
190 into object files</para>
191 <indexterm zone="ch-cross-tools-binutils as">
192 <primary sortas="b-as">as</primary>
193 </indexterm>
194 </listitem>
195 </varlistentry>
196
197 <varlistentry id="c-filt">
198 <term><command>c++filt</command></term>
199 <listitem>
200 <para>Used by the linker to de-mangle C++ and Java symbols and to keep
201 overloaded functions from clashing</para>
202 <indexterm zone="ch-cross-tools-binutils c-filt">
203 <primary sortas="b-c++filt">c++filt</primary>
204 </indexterm>
205 </listitem>
206 </varlistentry>
207
208 <varlistentry id="gprof">
209 <term><command>gprof</command></term>
210 <listitem>
211 <para>Displays call graph profile data</para>
212 <indexterm zone="ch-cross-tools-binutils gprof">
213 <primary sortas="b-gprof">gprof</primary>
214 </indexterm>
215 </listitem>
216 </varlistentry>
217
218 <varlistentry id="ld">
219 <term><command>ld</command></term>
220 <listitem>
221 <para>A linker that combines a number of object and archive files
222 into a single file, relocating their data and tying up symbol
223 references</para>
224 <indexterm zone="ch-cross-tools-binutils ld">
225 <primary sortas="b-ld">ld</primary>
226 </indexterm>
227 </listitem>
228 </varlistentry>
229
230 <varlistentry id="nm">
231 <term><command>nm</command></term>
232 <listitem>
233 <para>Lists the symbols occurring in a given object file</para>
234 <indexterm zone="ch-cross-tools-binutils nm">
235 <primary sortas="b-nm">nm</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.