Gentoo Archives: gentoo-commits

From: "Mike Frysinger (vapier)" <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo commit in xml/htdocs/proj/en/base/embedded/handbook: cross-compiler.xml
Date: Mon, 24 Dec 2007 19:33:52
Message-Id: E1J6t3Y-0000n9-87@stork.gentoo.org
1 vapier 07/12/24 19:33:44
2
3 Modified: cross-compiler.xml
4 Log:
5 add an overview and <i> markings to all user run commands
6
7 Revision Changes Path
8 1.4 xml/htdocs/proj/en/base/embedded/handbook/cross-compiler.xml
9
10 file : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/proj/en/base/embedded/handbook/cross-compiler.xml?rev=1.4&view=markup
11 plain: http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/proj/en/base/embedded/handbook/cross-compiler.xml?rev=1.4&content-type=text/plain
12 diff : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/proj/en/base/embedded/handbook/cross-compiler.xml?r1=1.3&r2=1.4
13
14 Index: cross-compiler.xml
15 ===================================================================
16 RCS file: /var/cvsroot/gentoo/xml/htdocs/proj/en/base/embedded/handbook/cross-compiler.xml,v
17 retrieving revision 1.3
18 retrieving revision 1.4
19 diff -u -r1.3 -r1.4
20 --- cross-compiler.xml 6 Nov 2007 15:48:43 -0000 1.3
21 +++ cross-compiler.xml 24 Dec 2007 19:33:43 -0000 1.4
22 @@ -1,7 +1,7 @@
23 <?xml version='1.0' encoding='UTF-8'?>
24 <!DOCTYPE sections SYSTEM "/dtd/book.dtd">
25
26 -<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/proj/en/base/embedded/handbook/cross-compiler.xml,v 1.3 2007/11/06 15:48:43 neysx Exp $ -->
27 +<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/proj/en/base/embedded/handbook/cross-compiler.xml,v 1.4 2007/12/24 19:33:43 vapier Exp $ -->
28
29 <sections>
30
31 @@ -13,6 +13,31 @@
32 <date>2007-08-12</date>
33
34 <section>
35 +<title>Overview</title>
36 +<body>
37 +
38 +<p>
39 +The first thing you should know about building a toolchain is that some
40 +versions of toolchain components refuse to work together. Exactly which
41 +combinations are problematic is a matter that's constantly in flux as the
42 +Portage tree evolves. The only reliable way to determine what works is to run
43 +crossdev, adjusting individual component versions as necessary, until crossdev
44 +completes the toolchain build successfully. Even then, the cross toolchain
45 +may build binaries which break on the target system. Only through trial and
46 +error and patience will you arrive at a favorable combination of all factors.
47 +</p>
48 +
49 +<p>
50 +Also, do not worry about the cross-compiler interfering with your native build
51 +system. All of the toolchain packages are designed such that they are isolated
52 +from each other based on the target. This way you can install cross-compilers
53 +for whatever architecture you wish without breaking the rest of your system.
54 +</p>
55 +
56 +</body>
57 +</section>
58 +
59 +<section>
60 <title>crossdev</title>
61
62 <subsection>
63 @@ -39,7 +64,7 @@
64 </p>
65
66 <pre caption="Generating SH4 cross-compiler">
67 -# crossdev --target sh4-unknown-linux-gnu
68 +# <i>crossdev --target sh4-unknown-linux-gnu</i>
69 -----------------------------------------------------------------------------------------------------
70 * Host Portage ARCH: ppc
71 * Target Portage ARCH: sh
72 @@ -80,14 +105,14 @@
73 </p>
74
75 <pre caption="Using SH4 cross-compiler">
76 -$ sh4-unknown-linux-gnu-gcc --version
77 +$ <i>sh4-unknown-linux-gnu-gcc --version</i>
78 sh4-unknown-linux-gnu-gcc (GCC) 4.2.0 (Gentoo 4.2.0 p1.4)
79 Copyright (C) 2007 Free Software Foundation, Inc.
80 This is free software; see the source for copying conditions. There is NO
81 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
82 -$ echo 'int main(){return 0;}' > sh4-test.c
83 -$ sh4-unknown-linux-gnu-gcc -Wall sh4-test.c -o sh4-test
84 -$ file sh4-test
85 +$ <i>echo 'int main(){return 0;}' > sh4-test.c</i>
86 +$ <i>sh4-unknown-linux-gnu-gcc -Wall sh4-test.c -o sh4-test</i>
87 +$ <i>file sh4-test</i>
88 sh4-test: ELF 32-bit LSB executable, Renesas SH, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), not stripped
89 </pre>
90
91 @@ -110,7 +135,7 @@
92 </p>
93
94 <pre caption="Uninstalling cross-compiler">
95 -# crossdev --clean sh4-unknown-linux-gnu
96 +# <i>crossdev --clean sh4-unknown-linux-gnu</i>
97 </pre>
98 </body>
99 </subsection>
100 @@ -268,13 +293,13 @@
101 </p>
102
103 <pre caption="configure and build binutils">
104 -$ ./configure \
105 +$ <i>./configure \
106 --target=$CTARGET \
107 --prefix=/usr \
108 --with-sysroot=/usr/$CTARGET \
109 - --disable-werror
110 -$ make
111 -$ make install DESTDIR=$PWD/install-root
112 + --disable-werror</i>
113 +$ <i>make</i>
114 +$ <i>make install DESTDIR=$PWD/install-root</i>
115 </pre>
116
117 <p>
118 @@ -285,7 +310,7 @@
119 </p>
120
121 <pre caption="cleaning binutils">
122 -$ rm -rf install-root/usr/{info,lib,man,share}
123 +$ <i>rm -rf install-root/usr/{info,lib,man,share}</i>
124 </pre>
125
126 <p>
127 @@ -293,7 +318,7 @@
128 </p>
129
130 <pre caption="install binutils">
131 -# cp -a install-root/* /
132 +# <i>cp -a install-root/* /</i>
133 </pre>
134 </body>
135 </subsection>
136 @@ -314,14 +339,14 @@
137 </note>
138
139 <pre caption="building/installing unsanitized headers">
140 -$ yes "" | make ARCH=$ARCH oldconfig prepare
141 -# mkdir -p /usr/$CTARGET/usr/include
142 -# cp -a include/linux include/asm-generic /usr/$CTARGET/usr/include/
143 -# cp -a include/asm-$ARCH /usr/$CTARGET/usr/include/asm
144 +$ <i>yes "" | make ARCH=$ARCH oldconfig prepare</i>
145 +# <i>mkdir -p /usr/$CTARGET/usr/include</i>
146 +# <i>cp -a include/linux include/asm-generic /usr/$CTARGET/usr/include/</i>
147 +# <i>cp -a include/asm-$ARCH /usr/$CTARGET/usr/include/asm</i>
148 </pre>
149
150 <pre caption="building/installing sanitized headers">
151 -# make ARCH=$ARCH headers_install INSTALL_HDR_PATH=/usr/$CTARGET/usr
152 +# <i>make ARCH=$ARCH headers_install INSTALL_HDR_PATH=/usr/$CTARGET/usr</i>
153 </pre>
154 </body>
155 </subsection>
156 @@ -335,14 +360,14 @@
157 </p>
158
159 <pre caption="building/installing glibc headers">
160 -$ mkdir build
161 -$ cd build
162 -$ ../configure \
163 +$ <i>mkdir build</i>
164 +$ <i>cd build</i>
165 +$ <i>../configure \
166 --host=$CTARGET \
167 --prefix=/usr \
168 --with-headers=/usr/$CTARGET/usr/include \
169 - --disable-sanity-checks
170 -# make -k install-headers install_root=/usr/$CTARGET
171 + --disable-sanity-checks</i>
172 +# <i>make -k install-headers install_root=/usr/$CTARGET</i>
173 </pre>
174
175 <p>
176 @@ -350,9 +375,9 @@
177 </p>
178
179 <pre caption="help glibc">
180 -# mkdir -p /usr/$CTARGET/usr/include/gnu
181 -# touch /usr/$CTARGET/usr/include/gnu/stubs.h
182 -# cp bits/stdio_lim.h /usr/$CTARGET/usr/include/bits/
183 +# <i>mkdir -p /usr/$CTARGET/usr/include/gnu</i>
184 +# <i>touch /usr/$CTARGET/usr/include/gnu/stubs.h</i>
185 +# <i>cp bits/stdio_lim.h /usr/$CTARGET/usr/include/bits/</i>
186 </pre>
187 </body>
188 </subsection>
189 @@ -365,7 +390,7 @@
190 </p>
191
192 <pre caption="help gcc">
193 -# ln -s usr/include /usr/$CTARGET/sys-include
194 +# <i>ln -s usr/include /usr/$CTARGET/sys-include</i>
195 </pre>
196
197 <p>
198 @@ -373,9 +398,9 @@
199 </p>
200
201 <pre caption="building gcc stage 1">
202 -$ mkdir build
203 -$ cd build
204 -$ ../configure \
205 +$ <i>mkdir build</i>
206 +$ <i>cd build</i>
207 +$ <i>../configure \
208 --target=$CTARGET \
209 --prefix=/usr \
210 --with-sysroot=/usr/$CTARGET \
211 @@ -384,9 +409,9 @@
212 --disable-checking \
213 --disable-werror \
214 --disable-libmudflap \
215 - --disable-libssp
216 -$ make
217 -$ make install DESTDIR=$PWD/install-root
218 + --disable-libssp</i>
219 +$ <i>make</i>
220 +$ <i>make install DESTDIR=$PWD/install-root</i>
221 </pre>
222
223 <p>
224 @@ -394,7 +419,7 @@
225 </p>
226
227 <pre caption="cleaning gcc stage 1">
228 -$ rm -rf install-root/usr/{info,include,lib/libiberty.a,man,share}
229 +$ <i>rm -rf install-root/usr/{info,include,lib/libiberty.a,man,share}</i>
230 </pre>
231
232 <p>
233 @@ -403,7 +428,7 @@
234 </p>
235
236 <pre caption="installing gcc stage 1">
237 -# cp -a install-root/* /
238 +# <i>cp -a install-root/* /</i>
239 </pre>
240 </body>
241 </subsection>
242 @@ -416,14 +441,14 @@
243 </p>
244
245 <pre caption="building/installing glibc">
246 -$ rm -rf build
247 -$ mkdir build
248 -$ cd build
249 -$ ../configure \
250 +$ <i>rm -rf build</i>
251 +$ <i>mkdir build</i>
252 +$ <i>cd build</i>
253 +$ <i>../configure \
254 --host=$CTARGET \
255 - --prefix=/usr
256 -$ make
257 -# make install install_root=/usr/$CTARGET
258 + --prefix=/usr</i>
259 +$ <i>make</i>
260 +# <i>make install install_root=/usr/$CTARGET</i>
261 </pre>
262 </body>
263 </subsection>
264 @@ -437,16 +462,16 @@
265 </p>
266
267 <pre caption="building/installing gcc stage 2">
268 -$ ./configure \
269 +$ <i>./configure \
270 --target=$CTARGET \
271 --prefix=/usr \
272 --with-sysroot=/usr/$CTARGET \
273 --enable-languages=c,c++ \
274 --enable-shared \
275 --disable-checking \
276 - --disable-werror
277 -$ make
278 -# make install
279 + --disable-werror</i>
280 +$ <i>make</i>
281 +# <i>make install</i>
282 </pre>
283 </body>
284 </subsection>
285
286
287
288 --
289 gentoo-commits@g.o mailing list