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-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 | <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" |
---|
19 | href="../../final-system/common/gcc.xml" |
---|
20 | xpointer="xpointer(//*[@role='package'])"/> |
---|
21 | |
---|
22 | <sect2 role="installation"> |
---|
23 | <title>Installation of Cross GCC Compiler with Static libgcc |
---|
24 | and no Threads</title> |
---|
25 | |
---|
26 | <!-- <para os="p1">The following patch contains a number of updates to the |
---|
27 | &gcc-version; branch by the GCC developers:</para> |
---|
28 | |
---|
29 | <screen os="p2"><userinput>patch -Np1 -i ../&gcc-branch_update-patch;</userinput></screen> --> |
---|
30 | |
---|
31 | <para os="aa">Make a couple of essential adjustments to the |
---|
32 | <filename>specs</filename> file to ensure GCC uses our build |
---|
33 | environment:</para> |
---|
34 | |
---|
35 | <screen os="ab"><userinput>patch -Np1 -i ../&gcc-specs-patch;</userinput></screen> |
---|
36 | |
---|
37 | <para os="ag">Change the StartFile Spec and Standard Include Dir so that |
---|
38 | GCC looks in <filename class="directory">/tools</filename>:</para> |
---|
39 | |
---|
40 | <screen os="ah"><userinput>echo -en '#undef STANDARD_INCLUDE_DIR\n#define STANDARD_INCLUDE_DIR "/tools/include/"\n\n' >> gcc/config/linux.h |
---|
41 | echo -en '\n#undef STANDARD_STARTFILE_PREFIX_1\n#define STANDARD_STARTFILE_PREFIX_1 "/tools/lib/"\n' >> gcc/config/linux.h |
---|
42 | echo -en '\n#undef STANDARD_STARTFILE_PREFIX_2\n#define STANDARD_STARTFILE_PREFIX_2 ""\n' >> gcc/config/linux.h</userinput></screen> |
---|
43 | |
---|
44 | <para os="ai">Now alter <command>gcc</command>'s c preprocessor's default |
---|
45 | include search path to use <filename class="directory">/tools</filename> only:</para> |
---|
46 | |
---|
47 | <screen os="aj"><userinput>cp -v gcc/Makefile.in{,.orig} |
---|
48 | sed -e "s@\(^CROSS_SYSTEM_HEADER_DIR =\).*@\1 /tools/include@g" \ |
---|
49 | gcc/Makefile.in.orig > gcc/Makefile.in</userinput></screen> |
---|
50 | |
---|
51 | <para os="t1">We will create a dummy <filename>limits.h</filename> so |
---|
52 | the build will not use the one provided by the host distro:</para> |
---|
53 | |
---|
54 | <screen os="t2"><userinput>touch /tools/include/limits.h</userinput></screen> |
---|
55 | |
---|
56 | <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" |
---|
57 | href="../../final-system/common/gcc.xml" |
---|
58 | xpointer="xpointer(//*[@os='f'])"/> |
---|
59 | |
---|
60 | <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" |
---|
61 | href="../../final-system/common/gcc.xml" |
---|
62 | xpointer="xpointer(//*[@os='g'])"/> |
---|
63 | |
---|
64 | <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" |
---|
65 | href="../../final-system/common/gcc.xml" |
---|
66 | xpointer="xpointer(//*[@os='h'])"/> |
---|
67 | |
---|
68 | <screen os="al"><userinput>AR=ar LDFLAGS="-Wl,-rpath,/cross-tools/lib" \ |
---|
69 | ../gcc-&gcc-version;/configure --prefix=/cross-tools \ |
---|
70 | --build=${CLFS_HOST} --host=${CLFS_HOST} --target=${CLFS_TARGET} \ |
---|
71 | --with-sysroot=${CLFS} --with-local-prefix=/tools --disable-nls \ |
---|
72 | --disable-shared --with-mpfr=/cross-tools --with-gmp=/cross-tools \ |
---|
73 | --with-ppl=/cross-tools --with-cloog=/cross-tools \ |
---|
74 | --without-headers --with-newlib --disable-decimal-float \ |
---|
75 | --disable-libgomp --disable-libmudflap --disable-libssp \ |
---|
76 | --disable-threads --enable-languages=c --disable-multilib \ |
---|
77 | --enable-cloog-backend=isl</userinput></screen> |
---|
78 | |
---|
79 | <variablelist os="am"> |
---|
80 | <title>The meaning of the configure options:</title> |
---|
81 | |
---|
82 | <varlistentry> |
---|
83 | <term><parameter>--prefix=/cross-tools</parameter></term> |
---|
84 | <listitem> |
---|
85 | <para>This tells the configure script to prepare to install the |
---|
86 | package in the <filename class="directory">/cross-tools</filename> |
---|
87 | directory.</para> |
---|
88 | </listitem> |
---|
89 | </varlistentry> |
---|
90 | |
---|
91 | <varlistentry> |
---|
92 | <term><parameter>--host=${CLFS_HOST}</parameter></term> |
---|
93 | <listitem> |
---|
94 | <para>When used with --target, this creates a cross-architecture |
---|
95 | executable that creates files for ${CLFS_TARGET} but runs on ${CLFS_HOST}.</para> |
---|
96 | </listitem> |
---|
97 | </varlistentry> |
---|
98 | |
---|
99 | <varlistentry> |
---|
100 | <term><parameter>--target=${CLFS_TARGET}</parameter></term> |
---|
101 | <listitem> |
---|
102 | <para>When used with --host, this creates a cross-architecture |
---|
103 | executable that creates files for ${CLFS_TARGET} but runs on ${CLFS_HOST}.</para> |
---|
104 | </listitem> |
---|
105 | </varlistentry> |
---|
106 | |
---|
107 | <varlistentry> |
---|
108 | <term><parameter>--with-sysroot=${CLFS}</parameter></term> |
---|
109 | <listitem> |
---|
110 | <para>Tells GCC to concider ${CLFS} as the root file system.</para> |
---|
111 | </listitem> |
---|
112 | </varlistentry> |
---|
113 | |
---|
114 | <varlistentry> |
---|
115 | <term><parameter>--with-local-prefix=/tools</parameter></term> |
---|
116 | <listitem> |
---|
117 | <para>The purpose of this switch is to remove <filename |
---|
118 | class="directory">/usr/local/include</filename> from |
---|
119 | <command>gcc</command>'s include search path. This is not |
---|
120 | absolutely essential, however, it helps to minimize the |
---|
121 | influence of the host system.</para> |
---|
122 | </listitem> |
---|
123 | </varlistentry> |
---|
124 | |
---|
125 | <varlistentry> |
---|
126 | <term><parameter>--disable-nls</parameter></term> |
---|
127 | <listitem> |
---|
128 | <para>This disables internationalization as i18n is not needed for the |
---|
129 | cross-compile tools.</para> |
---|
130 | </listitem> |
---|
131 | </varlistentry> |
---|
132 | |
---|
133 | <varlistentry> |
---|
134 | <term><parameter>--disable-shared</parameter></term> |
---|
135 | <listitem> |
---|
136 | <para>Disables the creation of the shared libraries.</para> |
---|
137 | </listitem> |
---|
138 | </varlistentry> |
---|
139 | |
---|
140 | <varlistentry> |
---|
141 | <term><parameter>--without-headers</parameter></term> |
---|
142 | <listitem> |
---|
143 | <para>Disables GCC from using the target's Libc when cross compiling.</para> |
---|
144 | </listitem> |
---|
145 | </varlistentry> |
---|
146 | |
---|
147 | <varlistentry> |
---|
148 | <term><parameter>--with-newlib</parameter></term> |
---|
149 | <listitem> |
---|
150 | <para>Tells GCC that the target libc will use 'newlib'.</para> |
---|
151 | </listitem> |
---|
152 | </varlistentry> |
---|
153 | |
---|
154 | <varlistentry> |
---|
155 | <term><parameter>--disable-decimal-float</parameter></term> |
---|
156 | <listitem> |
---|
157 | <para>Disables support for the C decimal floating point extension.</para> |
---|
158 | </listitem> |
---|
159 | </varlistentry> |
---|
160 | |
---|
161 | <varlistentry> |
---|
162 | <term><parameter>--disable-libgomp</parameter></term> |
---|
163 | <listitem> |
---|
164 | <para>Disables the creation of runtime libraries used by GOMP.</para> |
---|
165 | </listitem> |
---|
166 | </varlistentry> |
---|
167 | |
---|
168 | <varlistentry> |
---|
169 | <term><parameter>--disable-libmudflap</parameter></term> |
---|
170 | <listitem> |
---|
171 | <para>Disables the creation of runtime libaries used by libmudflap.</para> |
---|
172 | </listitem> |
---|
173 | </varlistentry> |
---|
174 | |
---|
175 | <varlistentry> |
---|
176 | <term><parameter>--disable-libssp</parameter></term> |
---|
177 | <listitem> |
---|
178 | <para>Disables the use of Stack Smashing Protection for runtime libraries.</para> |
---|
179 | </listitem> |
---|
180 | </varlistentry> |
---|
181 | |
---|
182 | <varlistentry> |
---|
183 | <term><parameter>--disable-threads</parameter></term> |
---|
184 | <listitem> |
---|
185 | <para>This will prevent GCC from looking for the multi-thread |
---|
186 | include files, since they haven't been created for this architecture |
---|
187 | yet. GCC will be able to find the multi-thread information after |
---|
188 | the Glibc headers are created.</para> |
---|
189 | </listitem> |
---|
190 | </varlistentry> |
---|
191 | |
---|
192 | <varlistentry> |
---|
193 | <term><parameter>--enable-languages=c</parameter></term> |
---|
194 | <listitem> |
---|
195 | <para>This option ensures that only the C compiler is built.</para> |
---|
196 | </listitem> |
---|
197 | </varlistentry> |
---|
198 | |
---|
199 | </variablelist> |
---|
200 | |
---|
201 | <para os="an">Continue with compiling the package:</para> |
---|
202 | |
---|
203 | <screen os="ao"><userinput>make all-gcc all-target-libgcc</userinput></screen> |
---|
204 | |
---|
205 | <para os="ap">Install the package:</para> |
---|
206 | |
---|
207 | <screen os="aq"><userinput>make install-gcc install-target-libgcc</userinput></screen> |
---|
208 | |
---|
209 | </sect2> |
---|
210 | |
---|
211 | <sect2 role="content"> |
---|
212 | <title/> |
---|
213 | |
---|
214 | <para>Details on this package are located in <xref |
---|
215 | linkend="contents-gcc" role="."/></para> |
---|
216 | |
---|
217 | </sect2> |
---|
218 | |
---|
219 | </sect1> |
---|