source: clfs-embedded/BOOK/cross-tools/common/gcc-static.xml@ 71ee1d9

Last change on this file since 71ee1d9 was 299e552, checked in by Jim Gifford <clfs@…>, 18 years ago

Fixed Typos in GCC Static

  • Property mode set to 100644
File size: 3.8 KB
RevLine 
[a9e389d]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-gcc-static" role="wrap">
9 <?dbhtml filename="gcc-static.html"?>
10
11 <title>Cross GCC-&gcc-version; - Static</title>
12
13 <indexterm zone="ch-cross-tools-gcc-static">
14 <primary sortas="a-GCC">GCC</primary>
15 <secondary>cross tools, static</secondary>
16 </indexterm>
17
18 <sect2 role="package">
19 <title/>
20
21 <para>The GCC package contains the GNU compiler collection, which includes
22 the C and C++ compilers.</para>
23
24 </sect2>
25
26 <sect2 role="installation">
27 <title>Installation of Cross GCC Compiler with Static libgcc
28 and no Threads</title>
29
30 <para os="p1">To make sure that a couple of tools use the proper syntax,
31 apply the following patch:</para>
32
[841271e]33<screen os="p2"><userinput>patch -Np1 -i ../&gcc-posix-patch;</userinput></screen>
[a9e389d]34
[00c8a02]35 <para os="p3">The following patch is needed for GCC to build against uClibc:</para>
[841271e]36
37<screen os="p4"><userinput>patch -Np1 -i ../&gcc-uclibc-patch;</userinput></screen>
38
39 <para os="p5">The following patch fixes the searching of multilib dirs for
[a9e389d]40 specs file.The patch standardizes the gcc drivers path iteration functions,
41 ensuring multilib directories are searched in the correct order. This fixes
42 various issues, most noticably with libtool on multilib systems:</para>
43
[841271e]44<screen os="p6"><userinput>patch -Np1 -i ../&gcc-PR20425-patch;</userinput></screen>
[a9e389d]45
[841271e]46 <para os="p7">The following patch ensures that <command>gcc</command> does not
[a9e389d]47 search the <filename class="directory">/usr</filename> directory for
48 <filename class="libraryfile">libgcc_s.so</filename> when
49 cross-compiling:</para>
50
[841271e]51<screen os="p8"><userinput>patch -Np1 -i ../&gcc-cross_search-patch;</userinput></screen>
[a9e389d]52
53 <para os="c">The GCC documentation recommends building GCC outside of the source
54 directory in a dedicated build directory:</para>
55
56<screen os="d"><userinput>mkdir -v ../gcc-build
57cd ../gcc-build</userinput></screen>
58
59 <para os="e">Prepare GCC for compilation:</para>
60
61<screen os="ae"><userinput>../gcc-&gcc-version;/configure --prefix=${CLFS}/cross-tools \
62 --host=${CLFS_HOST} --target=${CLFS_TARGET} --disable-multilib \
[1864993]63 --with-sysroot=${CLFS} --disable-nls --disable-shared --disable-threads \
[299e552]64 --enable-languages=c</userinput></screen>
[a9e389d]65
66 <variablelist os="af">
67 <title>The meaning of the configure options:</title>
68
69 <varlistentry>
70 <term><parameter>--disable-shared</parameter></term>
71 <listitem>
72 <para>Disables the creation of the shared libraries.</para>
73 </listitem>
74 </varlistentry>
75
76 <varlistentry>
77 <term><parameter>--disable-threads</parameter></term>
78 <listitem>
79 <para>This will prevent GCC from looking for the multi-thread
80 include files, since they haven't been created for this architecture
81 yet. GCC will be able to find the multi-thread information after
82 the Glibc headers are created.</para>
83 </listitem>
84 </varlistentry>
85
86 <varlistentry>
87 <term><parameter>--enable-languages=c</parameter></term>
88 <listitem>
89 <para>This option ensures that only the C compiler is built.</para>
90 </listitem>
91 </varlistentry>
92
93 </variablelist>
94
95 <para os="ag">Continue with compiling the package:</para>
96
97<screen os="ah"><userinput>make all-gcc</userinput></screen>
98
99 <para os="ai">Install the package:</para>
100
101<screen os="aj"><userinput>make install-gcc</userinput></screen>
102
103 </sect2>
104
105 <sect2 role="content">
106 <title/>
107
108 <para>Details on this package are located in <xref
109 linkend="contents-gcc" role="."/></para>
110
111 </sect2>
112
113</sect1>
Note: See TracBrowser for help on using the repository browser.