source: BOOK/cross-tools/common/gcc-static.xml@ 772b321

clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 772b321 was d755bc7, checked in by Chris Staub <chris@…>, 12 years ago

Updated several command explanations

  • Property mode set to 100644
File size: 7.2 KB
RevLine 
[3f8be484]1<?xml version="1.0" encoding="ISO-8859-1"?>
[aa18ac0]2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
[3f8be484]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
[dabbced]18 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
[cf66ceae]19 href="../../final-system/common/gcc.xml"
20 xpointer="xpointer(//*[@role='package'])"/>
[3f8be484]21
22 <sect2 role="installation">
23 <title>Installation of Cross GCC Compiler with Static libgcc
24 and no Threads</title>
25
[3e0fdeb]26 <para os="p1">The following patch contains a number of updates to the
[e05c4f0]27 &gcc-version; branch by the GCC developers:</para>
28
[3e0fdeb]29 <screen os="p2"><userinput>patch -Np1 -i ../&gcc-branch_update-patch;</userinput></screen>
[e05c4f0]30
[3cf4292]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>
[3f8be484]34
35<screen os="ab"><userinput>patch -Np1 -i ../&gcc-specs-patch;</userinput></screen>
36
[e53465ee]37 <para os="ag">Change the StartFile Spec and Standard Include Dir so that
38 GCC looks in <filename class="directory">/tools</filename>:</para>
[d04ed61]39
[1e16d91]40<screen os="ah"><userinput>echo -en '#undef STANDARD_INCLUDE_DIR\n#define STANDARD_INCLUDE_DIR "/tools/include/"\n\n' >> gcc/config/linux.h
41echo -en '\n#undef STANDARD_STARTFILE_PREFIX_1\n#define STANDARD_STARTFILE_PREFIX_1 "/tools/lib/"\n' >> gcc/config/linux.h
[c1832da]42echo -en '\n#undef STANDARD_STARTFILE_PREFIX_2\n#define STANDARD_STARTFILE_PREFIX_2 ""\n' >> gcc/config/linux.h</userinput></screen>
[d04ed61]43
[121c48a]44 <para os="ai">Now alter <command>gcc</command>'s c preprocessor's default
[12d030c]45 include search path to use <filename class="directory">/tools</filename> only:</para>
[3f8be484]46
[0b637f1]47<screen os="aj"><userinput>cp -v gcc/Makefile.in{,.orig}
[bc2e3fa]48sed -e "s@\(^CROSS_SYSTEM_HEADER_DIR =\).*@\1 /tools/include@g" \
[1b274255]49 gcc/Makefile.in.orig &gt; gcc/Makefile.in</userinput></screen>
[3f8be484]50
[3cf4292]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>
[562a0ae]53
[3309623]54<screen os="t2"><userinput>touch /tools/include/limits.h</userinput></screen>
[562a0ae]55
[dabbced]56 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
[3f8be484]57 href="../../final-system/common/gcc.xml"
58 xpointer="xpointer(//*[@os='f'])"/>
59
[dabbced]60 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
[3f8be484]61 href="../../final-system/common/gcc.xml"
62 xpointer="xpointer(//*[@os='g'])"/>
63
[dabbced]64 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
[3f8be484]65 href="../../final-system/common/gcc.xml"
66 xpointer="xpointer(//*[@os='h'])"/>
67
[88958a8]68<screen os="al"><userinput>AR=ar LDFLAGS="-Wl,-rpath,/cross-tools/lib" \
[c1832da]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 \
[12049296]72 --disable-shared --with-mpfr=/cross-tools --with-gmp=/cross-tools \
73 --with-ppl=/cross-tools --with-cloog=/cross-tools --without-headers \
74 --with-newlib --disable-decimal-float --disable-libgomp \
75 --disable-libmudflap --disable-libssp --disable-threads \
76 --enable-languages=c --disable-multilib --enable-cloog-backend=isl</userinput></screen>
[3f8be484]77
[d55f00bc]78 <variablelist os="am">
[d755bc7]79 <title>The meaning of the new configure options:</title>
[26b5617]80
81 <varlistentry>
82 <term><parameter>--with-sysroot=${CLFS}</parameter></term>
83 <listitem>
[d755bc7]84 <para>Tells GCC to consider ${CLFS} as the root file system.</para>
[26b5617]85 </listitem>
86 </varlistentry>
87
[3f8be484]88 <varlistentry>
89 <term><parameter>--with-local-prefix=/tools</parameter></term>
90 <listitem>
91 <para>The purpose of this switch is to remove <filename
92 class="directory">/usr/local/include</filename> from
93 <command>gcc</command>'s include search path. This is not
94 absolutely essential, however, it helps to minimize the
95 influence of the host system.</para>
96 </listitem>
97 </varlistentry>
98
[26b5617]99 <varlistentry>
100 <term><parameter>--disable-nls</parameter></term>
101 <listitem>
102 <para>This disables internationalization as i18n is not needed for the
103 cross-compile tools.</para>
104 </listitem>
105 </varlistentry>
106
107 <varlistentry>
108 <term><parameter>--without-headers</parameter></term>
109 <listitem>
110 <para>Disables GCC from using the target's Libc when cross compiling.</para>
111 </listitem>
112 </varlistentry>
113
114 <varlistentry>
115 <term><parameter>--with-newlib</parameter></term>
116 <listitem>
117 <para>Tells GCC that the target libc will use 'newlib'.</para>
118 </listitem>
119 </varlistentry>
120
121 <varlistentry>
122 <term><parameter>--disable-decimal-float</parameter></term>
123 <listitem>
124 <para>Disables support for the C decimal floating point extension.</para>
125 </listitem>
126 </varlistentry>
127
128 <varlistentry>
129 <term><parameter>--disable-libgomp</parameter></term>
130 <listitem>
131 <para>Disables the creation of runtime libraries used by GOMP.</para>
132 </listitem>
133 </varlistentry>
134
135 <varlistentry>
136 <term><parameter>--disable-libmudflap</parameter></term>
137 <listitem>
138 <para>Disables the creation of runtime libaries used by libmudflap.</para>
139 </listitem>
140 </varlistentry>
141
142 <varlistentry>
143 <term><parameter>--disable-libssp</parameter></term>
144 <listitem>
145 <para>Disables the use of Stack Smashing Protection for runtime libraries.</para>
146 </listitem>
147 </varlistentry>
148
[3f8be484]149 <varlistentry>
150 <term><parameter>--disable-threads</parameter></term>
151 <listitem>
[193315c]152 <para>This will prevent GCC from looking for the multi-thread
[6d4c909]153 include files, since they haven't been created for this architecture
154 yet. GCC will be able to find the multi-thread information after
155 the Glibc headers are created.</para>
[3f8be484]156 </listitem>
157 </varlistentry>
158
159 <varlistentry>
160 <term><parameter>--enable-languages=c</parameter></term>
161 <listitem>
162 <para>This option ensures that only the C compiler is built.</para>
163 </listitem>
164 </varlistentry>
165
166 </variablelist>
167
[d55f00bc]168 <para os="an">Continue with compiling the package:</para>
[3f8be484]169
[4651341]170<screen os="ao"><userinput>make all-gcc all-target-libgcc</userinput></screen>
[3f8be484]171
[d755bc7]172 <variablelist os="ap">
173 <title>The meaning of the new make options:</title>
174
175 <varlistentry>
176 <term><parameter>all-gcc all-target-libgcc</parameter></term>
177 <listitem>
178 <para>Compiles only the parts of GCC that are needed at this time,
179 rather than the full package.</para>
180 </listitem>
181 </varlistentry>
182
183 </variablelist>
184
185 <para os="aq">Install the package:</para>
[3f8be484]186
[d755bc7]187<screen os="ar"><userinput>make install-gcc install-target-libgcc</userinput></screen>
[3f8be484]188
189 </sect2>
190
191 <sect2 role="content">
192 <title/>
193
194 <para>Details on this package are located in <xref
195 linkend="contents-gcc" role="."/></para>
196
197 </sect2>
198
199</sect1>
Note: See TracBrowser for help on using the repository browser.