source: BOOK/cross-tools/native64/toolchain.xml@ e4fd845

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

Second Commit for Native Build

  • Property mode set to 100644
File size: 6.9 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-toolchain" role="wrap">
9 <?dbhtml filename="toolchain.html"?>
10
11 <title>Toolchain</title>
12
13 <indexterm zone="ch-cross-tools-toolchain">
14 <primary sortas="a-toolchain">ToolChain</primary>
15 <secondary>cross tools</secondary>
16 </indexterm>
17
18 <sect2 role="package">
19 <title/>
20
21 <para>This section combines Binutils, GCC, GMP, and MPFR packages
22 to create a clean toolchain.</para>
23
24 </sect2>
25
26 <sect2 role="installation">
27 <title>Installation of our Toolchain</title>
28
29 <para os="na">We are going to extract all the files needed
30 to create our toolchain:</para>
31
32<screen os="nb"><userinput>tar -jxf ../gcc-&gcc-version;.tar.bz2
33tar -jxf ../binutils-&binutils-version;.tar.bz2
34tar -jxf ../mfpr-&mpfr-version;.tar.bz2
35tar -jxf ../gmp-&gmp-version;.tar.bz2</userinput></screen>
36
37 <para os="nc">We are going to create a combined directory for
38 or build:</para>
39
40<screen os="nd"><userinput>mkdir -pv sysroot-toolchain
41cd gcc-&gcc-version;; tar -c * | \
42 ( cd ../sysroot-toolchain ; tar xf - )
43cd ../binutils-&binutils-version;; tar -c * | \
44 ( cd ../sysroot-toolchain ; tar xf - )
45cd ../sysroot-toolchain
46mv ../mpfr-&mpfr-version; ./mpfr
47mv ../gmp-&gmp-version; ./gmp</userinput></screen>
48
49 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
50 href="../common/gcc-static.xml"
51 xpointer="xpointer(//*[@os='p1'])"/>
52
53 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
54 href="../common/gcc-static.xml"
55 xpointer="xpointer(//*[@os='p2'])"/>
56
57 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
58 href="../common/binutils.xml"
59 xpointer="xpointer(//*[@os='ba'])"/>
60
61 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
62 href="../common/binutils.xml"
63 xpointer="xpointer(//*[@os='bb'])"/>
64
65 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
66 href="../common/binutils.xml"
67 xpointer="xpointer(//*[@os='p1'])"/>
68
69 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
70 href="../common/binutils.xml"
71 xpointer="xpointer(//*[@os='p2'])"/>
72
73 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
74 href="../multilib/binutils.xml"
75 xpointer="xpointer(//*[@os='aa'])"/>
76
77 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
78 href="../multilib/binutils.xml"
79 xpointer="xpointer(//*[@os='ab'])"/>
80
81 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
82 href="../common/gcc-static.xml"
83 xpointer="xpointer(//*[@os='p1'])"/>
84
85 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
86 href="../common/gcc-static.xml"
87 xpointer="xpointer(//*[@os='p2'])"/>
88
89 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
90 href="../common/gcc-static.xml"
91 xpointer="xpointer(//*[@os='aa'])"/>
92
93 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
94 href="../common/gcc-static.xml"
95 xpointer="xpointer(//*[@os='ab'])"/>
96
97 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
98 href="../common/gcc-static.xml"
99 xpointer="xpointer(//*[@os='ac'])"/>
100
101 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
102 href="../common/gcc-static.xml"
103 xpointer="xpointer(//*[@os='ad'])"/>
104
105 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
106 href="../common/gcc-static.xml"
107 xpointer="xpointer(//*[@os='ag'])"/>
108
109 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
110 href="../common/gcc-static.xml"
111 xpointer="xpointer(//*[@os='ah'])"/>
112
113 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
114 href="../common/gcc-static.xml"
115 xpointer="xpointer(//*[@os='ai'])"/>
116
117 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
118 href="../common/gcc-static.xml"
119 xpointer="xpointer(//*[@os='aj'])"/>
120
121 <para os="bd">Finally, disable <option>-B</option> in <filename>configure</filename>,
122 so it doesn't pick up the host's header files:</para>
123
124<screen os="be"><userinput>cp -v configure{,.orig}
125sed -e '/FLAGS_FOR_TARGET.*\/lib\//s@-B[^ ]*/lib/@@g' configure.orig > \
126 configure</userinput></screen>
127
128 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
129 href="../common/gcc-static.xml"
130 xpointer="xpointer(//*[@os='f'])"/>
131
132 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
133 href="../common/gcc-static.xml"
134 xpointer="xpointer(//*[@os='g'])"/>
135
136 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
137 href="../common/gcc-static.xml"
138 xpointer="xpointer(//*[@os='h'])"/>
139
140<screen os="bf"><userinput>AR=ar AS=as ../sysroot-toolchain/configure \
141 --with-sysroot=${CLFS} --prefix=/cross-tools \
142 --target=x86_64-pc-linux-gnu --with-local-prefix=/tools \
143 --without-headers --with-newlib --disable-nls \
144 --disable-shared --disable-decimal-float --disable-libgomp \
145 --disable-libmudflap --disable-libssp --disable-threads \
146 --enable-languages=c --enable-64-bit-bfd --with-lib-path=/tools/lib</userinput></screen>
147
148 <variablelist os="bg">
149 <title>The meaning of the new configure options:</title>
150
151 <varlistentry os="bg1">
152 <term><parameter>--enable-languages=c,c++</parameter></term>
153 <listitem>
154 <para>This option ensures that only the C and C++ compilers are built.</para>
155 </listitem>
156 </varlistentry>
157
158 <varlistentry os="bg2">
159 <term><parameter>--enable-__cxa_atexit</parameter></term>
160 <listitem>
161 <para>This option allows use of __cxa_atexit, rather than atexit,
162 to register C++ destructors for local statics and global objects
163 and is essential for fully standards-compliant handling of destructors.
164 It also affects the C++ ABI and therefore results in C++ shared libraries
165 and C++ programs that are interoperable with other Linux distributions.</para>
166 </listitem>
167 </varlistentry>
168
169 <varlistentry os="bg3">
170 <term><parameter>--enable-c99</parameter></term>
171 <listitem>
172 <para>Enable C99 support for C programs.</para>
173 </listitem>
174 </varlistentry>
175
176 <varlistentry os="bg4">
177 <term><parameter>--enable-long-long</parameter></term>
178 <listitem>
179 <para>Enables long long support in the compiler.</para>
180 </listitem>
181 </varlistentry>
182
183 <varlistentry os="bg5">
184 <term><parameter>--enable-threads=posix</parameter></term>
185 <listitem>
186 <para>This enables C++ exception handling for multi-threaded code.</para>
187 </listitem>
188 </varlistentry>
189
190 </variablelist>
191
192 <para os="bh">Continue with compiling the package:</para>
193
194<screen os="bi"><userinput>make</userinput></screen>
195
196 <para os="bj">Install the package:</para>
197
198<screen os="bk"><userinput>make install</userinput></screen>
199
200 </sect2>
201
202 <sect2 role="content">
203 <title/>
204
205 <para>Details on this package are located in <xref
206 linkend="contents-gcc" role="."/></para>
207
208 </sect2>
209
210</sect1>
Note: See TracBrowser for help on using the repository browser.