1 |
neysx 06/10/09 10:44:29 |
2 |
|
3 |
Modified: metadoc.xml |
4 |
Added: change-chost.xml |
5 |
Log: |
6 |
#147502 New doc |
7 |
|
8 |
Revision Changes Path |
9 |
1.166 xml/htdocs/doc/en/metadoc.xml |
10 |
|
11 |
file : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/en/metadoc.xml?rev=1.166&view=markup |
12 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/en/metadoc.xml?rev=1.166&content-type=text/plain |
13 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/en/metadoc.xml?r1=1.165&r2=1.166 |
14 |
|
15 |
Index: metadoc.xml |
16 |
=================================================================== |
17 |
RCS file: /var/cvsroot/gentoo/xml/htdocs/doc/en/metadoc.xml,v |
18 |
retrieving revision 1.165 |
19 |
retrieving revision 1.166 |
20 |
diff -u -r1.165 -r1.166 |
21 |
--- metadoc.xml 3 Sep 2006 19:43:07 -0000 1.165 |
22 |
+++ metadoc.xml 9 Oct 2006 10:44:29 -0000 1.166 |
23 |
@@ -1,9 +1,9 @@ |
24 |
<?xml version='1.0' encoding="UTF-8"?> |
25 |
-<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/metadoc.xml,v 1.165 2006/09/03 19:43:07 neysx Exp $ --> |
26 |
+<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/metadoc.xml,v 1.166 2006/10/09 10:44:29 neysx Exp $ --> |
27 |
<!DOCTYPE metadoc SYSTEM "/dtd/metadoc.dtd"> |
28 |
|
29 |
<metadoc lang="en"> |
30 |
-<version>1.92</version> |
31 |
+<version>1.93</version> |
32 |
<members> |
33 |
<lead>neysx</lead> |
34 |
<member>fox2mike</member> |
35 |
@@ -392,6 +392,7 @@ |
36 |
<file id="java-upgrade">/proj/en/java/java-upgrade.xml</file> |
37 |
<file id="kernel-config">/doc/en/kernel-config.xml</file> |
38 |
<file id="zsh">/doc/en/zsh.xml</file> |
39 |
+ <file id="change-chost">/doc/en/change-chost.xml</file> |
40 |
</files> |
41 |
<docs> |
42 |
<doc id="name-logo"> |
43 |
@@ -1227,6 +1228,11 @@ |
44 |
<memberof>upgrade</memberof> |
45 |
<fileid>gcc-upgrading</fileid> |
46 |
</doc> |
47 |
+ <doc id="change-chost"> |
48 |
+ <memberof>sysadmin_specific</memberof> |
49 |
+ <memberof>upgrade</memberof> |
50 |
+ <fileid>change-chost</fileid> |
51 |
+ </doc> |
52 |
<doc id="x86-at-faq"> |
53 |
<memberof>project_base</memberof> |
54 |
<fileid>x86-at-faq</fileid> |
55 |
|
56 |
|
57 |
|
58 |
1.1 xml/htdocs/doc/en/change-chost.xml |
59 |
|
60 |
file : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/en/change-chost.xml?rev=1.1&view=markup |
61 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/en/change-chost.xml?rev=1.1&content-type=text/plain |
62 |
|
63 |
Index: change-chost.xml |
64 |
=================================================================== |
65 |
<?xml version="1.0" encoding="UTF-8"?> |
66 |
<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> |
67 |
<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/change-chost.xml,v 1.1 2006/10/09 10:44:29 neysx Exp $ --> |
68 |
|
69 |
<guide link="/doc/en/change-chost.xml" lang="en"> |
70 |
|
71 |
<title>Changing the CHOST variable</title> |
72 |
|
73 |
<author title="Author"> |
74 |
<mail link="amne@g.o">Wernfried Haas</mail> |
75 |
</author> |
76 |
<author title="Reviewer"> |
77 |
<mail link="vapier@g.o">Mike Frysinger</mail> |
78 |
</author> |
79 |
<author title='"GuideXMLifier"'> |
80 |
<mail link="chriswhite@g.o">Chris White</mail> |
81 |
</author> |
82 |
|
83 |
<abstract> |
84 |
This document explains how to change the CHOST variable of an existing system. |
85 |
</abstract> |
86 |
|
87 |
<!-- The content of this document is licensed under the CC-BY-SA license --> |
88 |
<!-- See http://creativecommons.org/licenses/by-sa/2.5 --> |
89 |
<license/> |
90 |
|
91 |
<version>1</version> |
92 |
<date>2006-10-09</date> |
93 |
|
94 |
<chapter> |
95 |
<title>Introduction</title> |
96 |
<section> |
97 |
<body> |
98 |
|
99 |
<p> |
100 |
Changing the CHOST is a big issue that can seriously screw up your system - so |
101 |
why is there a guide for that it at all? |
102 |
</p> |
103 |
|
104 |
<p> |
105 |
There are certain situations where changing the CHOST is inevitable, e.g. if |
106 |
you want to upgrade to glibc 2.4 which only supports nptl and you find out that |
107 |
your CHOST is i386, which makes it impossible to use nptl. In this case, you |
108 |
don't have a lot of options, and changing CHOST is one of them. |
109 |
</p> |
110 |
|
111 |
<p> |
112 |
Even if following these instructions, problems may arise, so please make sure |
113 |
you read and execute them very carefully. In this example the CHOST will be |
114 |
changed from i386 to i686, if you do another change, please change the commands |
115 |
accordingly. |
116 |
</p> |
117 |
|
118 |
</body> |
119 |
</section> |
120 |
</chapter> |
121 |
|
122 |
<chapter> |
123 |
<title>Changing the CHOST variable</title> |
124 |
<section> |
125 |
<title>Building the packages</title> |
126 |
<body> |
127 |
|
128 |
<p> |
129 |
To start out with the CHOST change, edit the <path>/etc/make.conf</path> file |
130 |
and change <b>CHOST</b> value to suit your needs. Then, rebuild the following |
131 |
packages in this order: |
132 |
</p> |
133 |
|
134 |
<pre caption="Rebuilding important system tools"> |
135 |
# <i>emerge -av1 binutils gcc glibc</i> |
136 |
</pre> |
137 |
|
138 |
<impo> |
139 |
Please be aware that major gcc upgrades at the same time as changing CHOST |
140 |
(e.g. starting with gcc 3.3, CHOST i386 and switching to gcc 4.1, CHOST i686) |
141 |
can lead to severe side effects. While it may not be impossible to do so, it is |
142 |
hard to predict which potential problems may arise and document them in this |
143 |
guide. As a consequence, please do one thing at a time, e.g. upgrade gcc first |
144 |
according to our <uri link="/doc/en/gcc-upgrading.xml">gcc upgrade guide</uri> |
145 |
and change your CHOST afterwards. If you are on a system with CHOST=i386, you |
146 |
will need to mask glibc 2.4 during the gcc upgrade as it cannot be used with |
147 |
i386 and unmask it once you're done. |
148 |
</impo> |
149 |
|
150 |
</body> |
151 |
</section> |
152 |
<section> |
153 |
<title>Verifying things work</title> |
154 |
<body> |
155 |
|
156 |
<p> |
157 |
Now it is time to make sure that your <c>gcc-config</c> and |
158 |
<c>binutils-config</c> settings are sane and you do not have any leftovers in |
159 |
<path>/etc/env.d/</path>. |
160 |
</p> |
161 |
|
162 |
<p> |
163 |
The output of <c>gcc-config</c> and <c>binutils-config</c> should look like |
164 |
this (may differ according to your gcc version and chost, gcc 4.1.1 and i686 |
165 |
here): |
166 |
</p> |
167 |
|
168 |
<pre caption="Verifying a sane setup"> |
169 |
# <i>gcc-config -l</i> |
170 |
[1] i686-pc-linux-gnu-4.1.1 * |
171 |
# <i>gcc-config -c</i> |
172 |
i686-pc-linux-gnu-4.1.1 |
173 |
|
174 |
# <i>binutils-config -l</i> |
175 |
[1] i686-pc-linux-gnu-2.16.1 * |
176 |
# <i>binutils-config -c</i> |
177 |
i686-pc-linux-gnu-2.16.1 |
178 |
</pre> |
179 |
|
180 |
<p> |
181 |
Next, check to see if there are references to the old CHOST in |
182 |
<path>/etc/env.d/</path>: |
183 |
</p> |
184 |
|
185 |
<pre caption="Checking for old CHOST references"> |
186 |
# <i>cd /etc/env.d/</i> |
187 |
# <i>grep 386 *</i> |
188 |
05gcc-i386-pc-linux-gnu:PATH="/usr/i386-pc-linux-gnu/gcc-bin/4.1.1" |
189 |
05gcc-i386-pc-linux-gnu:ROOTPATH="/usr/i386-pc-linux-gnu/gcc-bin/4.1.1" |
190 |
</pre> |
191 |
|
192 |
<note> |
193 |
This may not happen to you, but in this case 05gcc-i386-pc-linux-gnu contains |
194 |
references to the old CHOST. Things may look differently on your system |
195 |
depending on which CHOST you are changing to/from, or even be just fine. The |
196 |
name may also be 05gcc-your_new_CHOST-pc-linux-gnu. |
197 |
</note> |
198 |
|
199 |
<p> |
200 |
Before deleting the file, let's check for files with the updated CHOST: |
201 |
</p> |
202 |
|
203 |
<pre caption="Checking for files with the updated CHOST"> |
204 |
# <i>grep 686 *</i> |
205 |
05binutils:MANPATH=/usr/share/binutils-data/i686-pc-linux-gnu/2.16.1/man |
206 |
05binutils:INFOPATH=/usr/share/binutils-data/i686-pc-linux-gnu/2.16.1/info |
207 |
05binutils:LDPATH=/usr/i686-pc-linux-gnu/lib |
208 |
05gcc:PATH="/usr/i686-pc-linux-gnu/gcc-bin/4.1.1" |
209 |
05gcc:ROOTPATH="/usr/i686-pc-linux-gnu/gcc-bin/4.1.1" |
210 |
05gcc:MANPATH="/usr/share/gcc-data/i686-pc-linux-gnu/4.1.1/man" |
211 |
05gcc:INFOPATH="/usr/share/gcc-data/i686-pc-linux-gnu/4.1.1/info" |
212 |
05gcc:LDPATH="/usr/lib/gcc/i686-pc-linux-gnu/4.1.1" |
213 |
</pre> |
214 |
|
215 |
<p> |
216 |
This one looks good as there should always be only one file for <c>gcc</c> in |
217 |
<path>/etc/env.d/</path> (05gcc in this example), so let's delete the one with |
218 |
the wrong references: |
219 |
</p> |
220 |
|
221 |
<pre caption="Removing the files with incorrect references"> |
222 |
# <i>rm 05gcc-i386-pc-linux-gnu</i> |
223 |
</pre> |
224 |
|
225 |
<p> |
226 |
The same also applies to <c>binutils</c> - if there's an extra one, see which |
227 |
is the outdated one and delete it. Next, check your |
228 |
<path>/etc/env.d/binutils/</path> |
229 |
</p> |
230 |
|
231 |
<pre caption="Checking for correct binutils"> |
232 |
# <i>cd /etc/env.d/binutils/</i> |
233 |
# <i>ls -la</i> |
234 |
total 8 |
235 |
-rw-r--r-- 1 root root 15 Sep 3 13:48 config-i686-pc-linux-gnu |
236 |
-rw-r--r-- 1 root root 126 Sep 3 13:48 i686-pc-linux-gnu-2.16.1 |
237 |
|
238 |
# <i>cat config-i686-pc-linux-gnu</i> |
239 |
CURRENT=2.16.1 |
240 |
# <i>cat i686-pc-linux-gnu-2.16.1</i> |
241 |
TARGET="i686-pc-linux-gnu" |
242 |
VER="2.16.1" |
243 |
LIBPATH="/usr/lib/binutils/i686-pc-linux-gnu/2.16.1" |
244 |
FAKE_TARGETS="i686-pc-linux-gnu" |
245 |
</pre> |
246 |
|
247 |
<p> |
248 |
That one looks good, those two files actually should be there. Time to move on |
249 |
to the gcc directory. |
250 |
</p> |
251 |
|
252 |
<pre caption="Checking for correct gcc"> |
253 |
# <i>cd /etc/env.d/gcc</i> |
254 |
# <i>ls -la</i> |
255 |
total 12 |
256 |
-rw-r--r-- 1 root root 32 Sep 3 16:43 config |
257 |
-rw-r--r-- 1 root root 32 Aug 3 14:25 config-i386-pc-linux-gnu |
258 |
-rw-r--r-- 1 root root 292 Sep 3 16:43 i686-pc-linux-gnu-4.1.1 |
259 |
|
260 |
# <i>cat config</i> |
261 |
CURRENT=i686-pc-linux-gnu-4.1.1 |
262 |
|
263 |
# <i>cat config-i386-pc-linux-gnu</i> |
264 |
CURRENT=i386-pc-linux-gnu-4.1.1 |
265 |
|
266 |
# <i>cat i686-pc-linux-gnu-4.1.1</i> |
267 |
PATH="/usr/i686-pc-linux-gnu/gcc-bin/4.1.1" |
268 |
ROOTPATH="/usr/i686-pc-linux-gnu/gcc-bin/4.1.1" |
269 |
LDPATH="/usr/lib/gcc/i686-pc-linux-gnu/4.1.1" |
270 |
GCCBITS="32" |
271 |
MANPATH="/usr/share/gcc-data/i686-pc-linux-gnu/4.1.1/man" |
272 |
INFOPATH="/usr/share/gcc-data/i686-pc-linux-gnu/4.1.1/info" |
273 |
STDCXX_INCDIR="g++-v4" |
274 |
</pre> |
275 |
|
276 |
<p> |
277 |
<path>config</path> and <path>i686-pc-linux-gnu-4.1.1</path> are fine, but |
278 |
<path>config-i386-pc-linux-gnu</path> is another leftover that needs removal. |
279 |
</p> |
280 |
|
281 |
<note> |
282 |
Again, the name of the file containing references to an outdated gcc version |
283 |
may have a different name, e.g. config-i686-pc-linux-gnu even though you are |
284 |
changing to i686. It is important you identify the file on its content, not |
285 |
only the name. |
286 |
</note> |
287 |
|
288 |
<pre caption="Removing the incorrect gcc config file"> |
289 |
# <i>rm config-i386-pc-linux-gnu</i> |
290 |
</pre> |
291 |
|
292 |
<p> |
293 |
Now run the following commands to update your environment: |
294 |
</p> |
295 |
|
296 |
<pre caption="Updating the environment"> |
297 |
# <i>env-update && source /etc/profile</i> |
298 |
</pre> |
299 |
|
300 |
<p> |
301 |
Then verify everything is fixed: |
302 |
</p> |
303 |
|
304 |
<pre caption="Verifying refernces to the old CHOST are removed"> |
305 |
# <i>grep -r 386 /etc/env.d/</i> |
306 |
</pre> |
307 |
|
308 |
<p> |
309 |
If you still find something, you must have missed some file, try to track it |
310 |
down before going on. |
311 |
</p> |
312 |
|
313 |
</body> |
314 |
</section> |
315 |
<section> |
316 |
<title>Finishing The Change</title> |
317 |
<body> |
318 |
|
319 |
<p> |
320 |
Now it is necessary to re-emerge <c>libtool</c> and run |
321 |
<c>fix_libtool_files.sh</c>. Make sure to use the correct gcc version: (your |
322 |
current one, 4.1.1 here, and the old architecture, i386 here). |
323 |
</p> |
324 |
|
325 |
<pre caption="Ensuring library sanity"> |
326 |
# <i>emerge -av1 libtool</i> |
327 |
# <i>fix_libtool_files.sh 4.1.1 --oldarch i386-pc-linux-gnu</i> |
328 |
</pre> |
329 |
|
330 |
<p> |
331 |
You may want to rebuild all your packages: |
332 |
</p> |
333 |
|
334 |
<pre caption="Rebuilding world"> |
335 |
# <i>emerge -e world</i> |
336 |
</pre> |
337 |
|
338 |
<p> |
339 |
Now, in theory it should not be necessary to do so, but it can not be 100% |
340 |
guaranteed that this is actually the case. If you do not recompile the world |
341 |
target, I have been told at least some packages need recompiling, so you should |
342 |
do: |
343 |
</p> |
344 |
|
345 |
<pre caption="Remerging python"> |
346 |
# <i>emerge -av1 python</i> |
347 |
</pre> |
348 |
|
349 |
<p> |
350 |
All packages using perl install to the CHOST directory and hence need |
351 |
remerging. In case you haven't installed <c>qfile</c>, you will need to install |
352 |
<c>app-portage/portage-utils</c> first. |
353 |
</p> |
354 |
|
355 |
<pre caption="Remerging perl packages"> |
356 |
# <i>emerge -av portage-utils</i> |
357 |
# <i>emerge -av1 `qfile /usr/lib/perl* -Cq | sort -u`</i> |
358 |
</pre> |
359 |
|
360 |
<p> |
361 |
If you encounter other packages that need recompiling, please let the author of |
362 |
this document know. |
363 |
</p> |
364 |
|
365 |
</body> |
366 |
</section> |
367 |
<section> |
368 |
<title>Common problems</title> |
369 |
<body> |
370 |
|
371 |
<p> |
372 |
When upgrading from gcc 3.3 to 4.1 at the same time as changing the CHOST |
373 |
(please don't do that anyway), a couple of users reported broken packages that |
374 |
need recompiling, such as groff and courier: |
375 |
</p> |
376 |
|
377 |
<pre caption="Error messsage"> |
378 |
error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory |
379 |
</pre> |
380 |
|
381 |
<p> |
382 |
This happens because during the upgrade, the CHOST doesn't exactly match |
383 |
CTARGET and the compiler assumes cross-compiling. As a consequence, LDPATH |
384 |
isn't inserted into <path>ld.so.conf</path>, resulting in this error. |
385 |
</p> |
386 |
|
387 |
<p> |
388 |
Please see our <uri link="/doc/en/gcc-upgrading.xml">gcc upgrade guide</uri> |
389 |
for what needs to be rebuilt after a gcc upgrade. |
390 |
</p> |
391 |
|
392 |
<p> |
393 |
In some rare cases, this can break old versions of python, too. This may be |
394 |
fixed by adding <path>/usr/lib/gcc-lib/i386-pc-linux-gnu/3.3.6</path> (change |
395 |
accordingly to your old chost and gcc version) to <path>/etc/ld.so.conf</path>, |
396 |
running <c>ldconfig</c> and then <c>emerge libstdc++-v3</c>. However, as you |
397 |
can see, you really should avoid running into this problem - don't change CHOST |
398 |
and your gcc version at the same time. |
399 |
</p> |
400 |
|
401 |
</body> |
402 |
</section> |
403 |
<section> |
404 |
<title>Feedback</title> |
405 |
<body> |
406 |
|
407 |
<p> |
408 |
That should be all, feedback (both if it worked, failed or other problems were |
409 |
encountered) is welcome, please send an email to <mail>amne@g.o</mail> |
410 |
or post to <uri link="http://forums.gentoo.org/viewtopic-t-494147.html">this |
411 |
forums thread</uri>. Much in this howto comes from vapier, thanks for your |
412 |
help! |
413 |
</p> |
414 |
|
415 |
</body> |
416 |
</section> |
417 |
</chapter> |
418 |
</guide> |
419 |
|
420 |
|
421 |
|
422 |
-- |
423 |
gentoo-doc-cvs@g.o mailing list |