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

Last change on this file since f67564c was dabbced, checked in by Joe Ciccone <jciccone@…>, 14 years ago

Change the XInclude schema path from 2003 to 2001. 2003 is depreciated
according to w3.org and 2001 should be used instead.

  • Property mode set to 100644
File size: 5.0 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<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="aa">Make a couple of essential adjustments to the
27 <filename>specs</filename> file to ensure GCC uses our build
28 environment:</para>
29
30<screen os="ab"><userinput>patch -Np1 -i ../&gcc-specs-patch;</userinput></screen>
31
32 <para os="ag">Change the StartFile Spec and Standard Include Dir so that
33 GCC looks in <filename class="directory">/tools</filename>:</para>
34
35<screen os="ah"><userinput>echo -en '#undef STANDARD_INCLUDE_DIR\n#define STANDARD_INCLUDE_DIR "/tools/include/"\n\n' >> gcc/config/linux.h
36echo -en '\n#undef STANDARD_STARTFILE_PREFIX_1\n#define STANDARD_STARTFILE_PREFIX_1 "/tools/lib/"\n' >> gcc/config/linux.h
37echo -en '\n#undef STANDARD_STARTFILE_PREFIX_2\n#define STANDARD_STARTFILE_PREFIX_2 ""\n' >> gcc/config/linux.h</userinput></screen>
38
39 <para os="ai">Now alter <command>gcc</command>'s c preprocessor's default
40 include search path to use <filename class="directory">/tools</filename> only:</para>
41
42<screen os="aj"><userinput>cp -v gcc/Makefile.in{,.orig}
43sed -e "s@\(^CROSS_SYSTEM_HEADER_DIR =\).*@\1 /tools/include@g" \
44 gcc/Makefile.in.orig &gt; gcc/Makefile.in</userinput></screen>
45
46 <para os="t1">We will create a dummy <filename>limits.h</filename> so
47 the build will not use the one provided by the host distro:</para>
48
49<screen os="t2"><userinput>touch /tools/include/limits.h</userinput></screen>
50
51 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
52 href="../../final-system/common/gcc.xml"
53 xpointer="xpointer(//*[@os='f'])"/>
54
55 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
56 href="../../final-system/common/gcc.xml"
57 xpointer="xpointer(//*[@os='g'])"/>
58
59 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
60 href="../../final-system/common/gcc.xml"
61 xpointer="xpointer(//*[@os='h'])"/>
62
63<screen os="al"><userinput>AR=ar LDFLAGS="-Wl,-rpath,/cross-tools/lib" \
64 ../gcc-&gcc-version;/configure --prefix=/cross-tools \
65 --build=${CLFS_HOST} --host=${CLFS_HOST} --target=${CLFS_TARGET} \
66 --with-sysroot=${CLFS} --with-local-prefix=/tools --disable-nls \
67 --disable-shared --with-mpfr=/cross-tools --with-gmp=/cross-tools \
68 --with-ppl=/cross-tools --with-cloog=/cross-tools \
69 --without-headers --with-newlib --disable-decimal-float \
70 --disable-libgomp --disable-libmudflap --disable-libssp \
71 --disable-threads --enable-languages=c --disable-multilib</userinput></screen>
72
73 <variablelist os="am">
74 <title>The meaning of the configure options:</title>
75
76 <varlistentry>
77 <term><parameter>--with-local-prefix=/tools</parameter></term>
78 <listitem>
79 <para>The purpose of this switch is to remove <filename
80 class="directory">/usr/local/include</filename> from
81 <command>gcc</command>'s include search path. This is not
82 absolutely essential, however, it helps to minimize the
83 influence of the host system.</para>
84 </listitem>
85 </varlistentry>
86
87 <varlistentry>
88 <term><parameter>--disable-shared</parameter></term>
89 <listitem>
90 <para>Disables the creation of the shared libraries.</para>
91 </listitem>
92 </varlistentry>
93
94 <varlistentry>
95 <term><parameter>--disable-threads</parameter></term>
96 <listitem>
97 <para>This will prevent GCC from looking for the multi-thread
98 include files, since they haven't been created for this architecture
99 yet. GCC will be able to find the multi-thread information after
100 the Glibc headers are created.</para>
101 </listitem>
102 </varlistentry>
103
104 <varlistentry>
105 <term><parameter>--enable-languages=c</parameter></term>
106 <listitem>
107 <para>This option ensures that only the C compiler is built.</para>
108 </listitem>
109 </varlistentry>
110
111 </variablelist>
112
113 <para os="an">Continue with compiling the package:</para>
114
115<screen os="ao"><userinput>make all-gcc all-target-libgcc</userinput></screen>
116
117 <para os="ap">Install the package:</para>
118
119<screen os="aq"><userinput>make install-gcc install-target-libgcc</userinput></screen>
120
121 </sect2>
122
123 <sect2 role="content">
124 <title/>
125
126 <para>Details on this package are located in <xref
127 linkend="contents-gcc" role="."/></para>
128
129 </sect2>
130
131</sect1>
Note: See TracBrowser for help on using the repository browser.