source: clfs-embedded/BOOK/cross-tools/common/gcc-final.xml@ 7f42027

Last change on this file since 7f42027 was c4b2364, checked in by Andrew Bradford <andrew@…>, 10 years ago

gcc: Add notes for static vs final builds

To clarify that the first pass is mainly to build the libc and the
second pass uses that libc to build the actual cross compiler.

  • Property mode set to 100644
File size: 5.4 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<!-- Common GCC-Final -->
9
10<sect1 id="ch-cross-tools-gcc-final" role="wrap">
11 <?dbhtml filename="gcc-final.html"?>
12
13 <title>GCC-&gcc-version; - Final</title>
14
15 <indexterm zone="ch-cross-tools-gcc-final">
16 <primary sortas="a-GCC">GCC</primary>
17 <secondary>cross tools, final</secondary>
18 </indexterm>
19
20 <sect2 role="package">
21 <title/>
22
23 <para>The GCC package contains the GNU compiler collection, which includes
24 the C compiler. This second build of GCC will produce the final cross
25 compiler which will use the previously built C library.</para>
26
27 </sect2>
28
29 <sect2 role="installation">
30 <title>Installation of GCC Cross Compiler</title>
31
32 <xi:include os="c" xmlns:xi="http://www.w3.org/2003/XInclude"
33 href="gcc-static.xml"
34 xpointer="xpointer(//*[@os='ab'])"/>
35
36 <para os="b">GCC requires the GMP, MPFR, and MPC packages to either be
37 present on the host or to be present in source form within the gcc source
38 tree. Unpack these into the GCC directory after unpacking GCC:</para>
39
40<screen os="ba"><userinput>tar xf ../mpfr-&mpfr-version;.tar.bz2
41mv -v mpfr-&mpfr-version; mpfr
42tar xf ../gmp-&gmp-version;.tar.bz2
43mv -v gmp-&gmp-version; gmp
44tar xf ../mpc-&mpc-version;.tar.gz
45mv -v mpc-&mpc-version; mpc</userinput></screen>
46
47 <xi:include os="c" xmlns:xi="http://www.w3.org/2003/XInclude"
48 href="gcc-static.xml"
49 xpointer="xpointer(//*[@os='c'])"/>
50
51 <xi:include os="d" xmlns:xi="http://www.w3.org/2003/XInclude"
52 href="gcc-static.xml"
53 xpointer="xpointer(//*[@os='d'])"/>
54
55 <xi:include os="e" xmlns:xi="http://www.w3.org/2003/XInclude"
56 href="gcc-static.xml"
57 xpointer="xpointer(//*[@os='e'])"/>
58
59 <note os="f"><para>If you would like to build a C++ compiler in addition
60 to the C compiler, change the following --enable-languages=c option to be
61 --enable-languages=c,c++ instead. A C++ compiler is not required for
62 any of the software included in this book.</para></note>
63
64<!-- This is the common configure line for GCC-Final -->
65<!-- It's not actually used by any arch but is here for reference. -->
66<screen os="ae"><userinput>../gcc-&gcc-version;/configure \
67 --prefix=${CLFS}/cross-tools \
68 --build=${CLFS_HOST} \
69 --target=${CLFS_TARGET} \
70 --host=${CLFS_HOST} \
71 --with-sysroot=${CLFS}/cross-tools/${CLFS_TARGET} \
72 --disable-nls \
73 --enable-languages=c \
74 --enable-c99 \
75 --enable-long-long \
76 --disable-libmudflap \
77 --with-mpfr=${CLFS}/cross-tools \
78 --with-gmp=${CLFS}/cross-tools \
79 --with-mpc=${CLFS}/cross-tools \
80 --disable-multilib \
81 --with-mpfr-include=$(pwd)/../gcc-&gcc-version;/mpfr/src \
82 --with-mpfr-lib=$(pwd)/mpfr/src/.libs</userinput></screen>
83
84 <variablelist os="af">
85 <title>The meaning of the configure options not used previously:</title>
86
87 <varlistentry os="af2">
88 <term><parameter>--enable-c99</parameter></term>
89 <listitem>
90 <para>Enable C99 support for C programs.</para>
91 </listitem>
92 </varlistentry>
93
94 <varlistentry os="af3">
95 <term><parameter>--enable-long-long</parameter></term>
96 <listitem>
97 <para>Enables long long support in the compiler.</para>
98 </listitem>
99 </varlistentry>
100
101 </variablelist>
102
103 <xi:include os="ah" xmlns:xi="http://www.w3.org/2003/XInclude"
104 href="gcc-static.xml"
105 xpointer="xpointer(//*[@os='ah'])"/>
106
107<screen os="ai"><userinput>make</userinput></screen>
108
109 <xi:include os="aj" xmlns:xi="http://www.w3.org/2003/XInclude"
110 href="gcc-static.xml"
111 xpointer="xpointer(//*[@os='aj'])"/>
112
113<screen os="ak"><userinput>make install</userinput></screen>
114
115 </sect2>
116
117 <sect2 id="contents-gcc" role="content">
118 <title>Contents of GCC</title>
119
120 <segmentedlist>
121 <segtitle>Installed programs</segtitle>
122 <segtitle>Installed libraries</segtitle>
123
124 <seglistitem>
125 <seg>gcc, and gcov</seg>
126 <seg>libgcc.a, libgcc_eh.a, and libgcc_s.so</seg>
127 </seglistitem>
128 </segmentedlist>
129
130 <variablelist>
131 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
132 <?dbfo list-presentation="list"?>
133 <?dbhtml list-presentation="table"?>
134
135 <varlistentry id="gcc">
136 <term><command>gcc</command></term>
137 <listitem>
138 <para>The C compiler</para>
139 <indexterm zone="ch-cross-tools-gcc-final gcc">
140 <primary sortas="b-gcc">gcc</primary>
141 </indexterm>
142 </listitem>
143 </varlistentry>
144
145 <varlistentry id="gcov">
146 <term><command>gcov</command></term>
147 <listitem>
148 <para>A coverage testing tool; it is used to analyze programs to
149 determine where optimizations will have the most effect</para>
150 <indexterm zone="ch-cross-tools-gcc-final gcov">
151 <primary sortas="b-gcov">gcov</primary>
152 </indexterm>
153 </listitem>
154 </varlistentry>
155
156 <varlistentry id="libgcc">
157 <term><filename class="libraryfile">libgcc</filename></term>
158 <listitem>
159 <para>Contains run-time support for <command>gcc</command></para>
160 <indexterm zone="ch-cross-tools-gcc-final libgcc">
161 <primary sortas="c-libgcc*">libgcc*</primary>
162 </indexterm>
163 </listitem>
164 </varlistentry>
165
166 </variablelist>
167
168 </sect2>
169
170</sect1>
Note: See TracBrowser for help on using the repository browser.