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

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 0453750 was a9f0cdb, checked in by Jim Gifford <clfs@…>, 17 years ago

Added GCC 4.2.2 Branch Update Patch

  • Property mode set to 100644
File size: 4.9 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
[cf66ceae]18 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
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
[a9f0cdb]26 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
27 href="../../final-system/common/gcc.xml"
28 xpointer="xpointer(//*[@os='p1'])"/>
29
30 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
31 href="../../final-system/common/gcc.xml"
32 xpointer="xpointer(//*[@os='p2'])"/>
33
[5d9d2e5]34 <para os="aa">Make a couple of essential adjustments to the specs file
[fac77fb]35 to ensure GCC uses our build environment:</para>
[3f8be484]36
37<screen os="ab"><userinput>patch -Np1 -i ../&gcc-specs-patch;</userinput></screen>
38
[6d4c909]39 <para os="ac">To make sure that a couple of tools use the proper syntax,
40 apply the following patch:</para>
[3f8be484]41
42<screen os="ad"><userinput>patch -Np1 -i ../&gcc-posix-patch;</userinput></screen>
43
44 <para os="ae">The following patch ensures that <command>gcc</command> does not
45 search the <filename class="directory">/usr</filename> directory for
46 <filename class="libraryfile">libgcc_s.so</filename> when
[6bb43b3]47 cross-compiling:</para>
[3f8be484]48
49<screen os="af"><userinput>patch -Np1 -i ../&gcc-cross_search-patch;</userinput></screen>
50
[0220731]51 <para os="ag">Change the StartFile Spec to point to the correct library
[3f8be484]52 location:</para>
53
54<screen os="ah"><userinput>echo "
55#undef STARTFILE_PREFIX_SPEC
56#define STARTFILE_PREFIX_SPEC \"/tools/lib/\"" &gt;&gt; gcc/config/linux.h</userinput></screen>
57
[121c48a]58 <para os="ai">Now alter <command>gcc</command>'s c preprocessor's default
[12d030c]59 include search path to use <filename class="directory">/tools</filename> only:</para>
[3f8be484]60
[0b637f1]61<screen os="aj"><userinput>cp -v gcc/Makefile.in{,.orig}
[bc2e3fa]62sed -e "s@\(^CROSS_SYSTEM_HEADER_DIR =\).*@\1 /tools/include@g" \
[c3ed84c]63 gcc/Makefile.in.orig > gcc/Makefile.in</userinput></screen>
[3f8be484]64
65 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
66 href="../../final-system/common/gcc.xml"
67 xpointer="xpointer(//*[@os='f'])"/>
68
69 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
70 href="../../final-system/common/gcc.xml"
71 xpointer="xpointer(//*[@os='g'])"/>
72
73 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
74 href="../../final-system/common/gcc.xml"
75 xpointer="xpointer(//*[@os='h'])"/>
76
[bc2e3fa]77<screen os="al"><userinput>../gcc-&gcc-version;/configure --prefix=/cross-tools \
[07114c98]78 --host=${CLFS_HOST} --target=${CLFS_TARGET} --disable-multilib \
[3f8be484]79 --with-local-prefix=/tools --disable-nls --disable-shared \
80 --disable-threads --enable-languages=c</userinput></screen>
81
[d55f00bc]82 <variablelist os="am">
[3f8be484]83 <title>The meaning of the configure options:</title>
84
85 <varlistentry>
86 <term><parameter>--with-local-prefix=/tools</parameter></term>
87 <listitem>
88 <para>The purpose of this switch is to remove <filename
89 class="directory">/usr/local/include</filename> from
90 <command>gcc</command>'s include search path. This is not
91 absolutely essential, however, it helps to minimize the
92 influence of the host system.</para>
93 </listitem>
94 </varlistentry>
95
96 <varlistentry>
97 <term><parameter>--disable-shared</parameter></term>
98 <listitem>
99 <para>Disables the creation of the shared libraries.</para>
100 </listitem>
101 </varlistentry>
102
103 <varlistentry>
104 <term><parameter>--disable-threads</parameter></term>
105 <listitem>
[193315c]106 <para>This will prevent GCC from looking for the multi-thread
[6d4c909]107 include files, since they haven't been created for this architecture
108 yet. GCC will be able to find the multi-thread information after
109 the Glibc headers are created.</para>
[3f8be484]110 </listitem>
111 </varlistentry>
112
113 <varlistentry>
114 <term><parameter>--enable-languages=c</parameter></term>
115 <listitem>
116 <para>This option ensures that only the C compiler is built.</para>
117 </listitem>
118 </varlistentry>
119
120 </variablelist>
121
[d55f00bc]122 <para os="an">Continue with compiling the package:</para>
[3f8be484]123
[d55f00bc]124<screen os="ao"><userinput>make all-gcc</userinput></screen>
[3f8be484]125
[d55f00bc]126 <para os="ap">Install the package:</para>
[3f8be484]127
[d55f00bc]128<screen os="aq"><userinput>make install-gcc</userinput></screen>
[3f8be484]129
130 </sect2>
131
132 <sect2 role="content">
133 <title/>
134
135 <para>Details on this package are located in <xref
136 linkend="contents-gcc" role="."/></para>
137
138 </sect2>
139
140</sect1>
Note: See TracBrowser for help on using the repository browser.