/[gentoo]/xml/htdocs/doc/en/gcc-upgrading.xml
Gentoo

Diff of /xml/htdocs/doc/en/gcc-upgrading.xml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.13 Revision 1.14
1<?xml version='1.0' encoding="UTF-8"?> 1<?xml version='1.0' encoding="UTF-8"?>
2<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/gcc-upgrading.xml,v 1.13 2006/05/26 20:45:35 nightmorph Exp $ --> 2<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/gcc-upgrading.xml,v 1.14 2006/08/31 00:08:57 nightmorph Exp $ -->
3 3
4<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> 4<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
5 5
6<guide link="/doc/en/gcc-upgrading.xml"> 6<guide link="/doc/en/gcc-upgrading.xml">
7<title>Gentoo Linux GCC Upgrade Guide</title> 7<title>Gentoo Linux GCC Upgrade Guide</title>
23 23
24<!-- The content of this document is licensed under the CC-BY-SA license --> 24<!-- The content of this document is licensed under the CC-BY-SA license -->
25<!-- See http://creativecommons.org/licenses/by-sa/2.5 --> 25<!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
26<license/> 26<license/>
27 27
28<version>12</version> 28<version>13</version>
29<date>2006-05-26</date> 29<date>2006-08-30</date>
30 30
31<chapter id="intro"> 31<chapter id="intro">
32<title>Introduction</title> 32<title>Introduction</title>
33<section> 33<section>
34<title>GCC Upgrading</title> 34<title>GCC Upgrading</title>
105</p> 105</p>
106 106
107<pre caption="Upgrading GCC"> 107<pre caption="Upgrading GCC">
108# <i>emerge -uav gcc</i> 108# <i>emerge -uav gcc</i>
109 109
110<comment>(Please substitute "i686-pc-linux-gnu-3.4.5" with the GCC 110<comment>(Please substitute "i686-pc-linux-gnu-4.1.1" with the GCC
111version and CHOST settings you've upgraded to:)</comment> 111version and CHOST settings you've upgraded to:)</comment>
112# <i>gcc-config i686-pc-linux-gnu-3.4.5</i> 112# <i>gcc-config i686-pc-linux-gnu-4.1.1</i>
113# <i>source /etc/profile</i> 113# <i>source /etc/profile</i>
114
115<comment>If you upgraded from gcc 3 to 4 (e.g. from 3.4.6 to 4.1.1 in this
116example) you will have to run fix_libtool_files.sh manually</comment>
117# <i>fix_libtool_files.sh 3.4.6</i>
114 118
115<comment>(Rebuilding libtool)</comment> 119<comment>(Rebuilding libtool)</comment>
116# <i>emerge --oneshot -av libtool</i> 120# <i>emerge --oneshot -av libtool</i>
117</pre> 121</pre>
118 122
119<p> 123<p>
124To be completely safe that your system is in a sane state, you <e>must</e>
120Now let's rebuild toolchain and then world so we will make use of the new 125rebuild the toolchain and then world to make use of the new compiler.
121compiler.
122</p> 126</p>
123 127
124<pre caption="Rebuilding system"> 128<pre caption="Rebuilding system">
125# <i>emerge -eav system</i> 129# <i>emerge -eav system</i>
126# <i>emerge -eav world</i> 130# <i>emerge -eav world</i>
127</pre> 131</pre>
128 132
129<p> 133<p>
130It is safe to remove the older GCC version at this time. If you feel the need, 134It is safe to remove the older GCC version at this time. If you feel the need,
131please issue the following command (as usual, substitute 135please issue the following command (as usual, substitute
132<c>=sys-devel/gcc-3.3*</c> with the version you want to uninstall): 136<c>=sys-devel/gcc-3.4*</c> with the version you want to uninstall):
133</p> 137</p>
134 138
135<pre caption="Removing older GCC version"> 139<pre caption="Removing older GCC version">
136# <i>emerge -aC =sys-devel/gcc-3.3*</i> 140# <i>emerge -aC =sys-devel/gcc-3.4*</i>
137</pre> 141</pre>
138 142
139</body> 143</body>
140</section> 144</section>
141</chapter> 145</chapter>
155</body> 159</body>
156</section> 160</section>
157<section id="upgrade-3.3-to-3.4-choices"> 161<section id="upgrade-3.3-to-3.4-choices">
158<title>The Choices</title> 162<title>The Choices</title>
159<body> 163<body>
164
165<impo>
166If you upgrade from gcc 3.4 to 4.1, please consult the General Update
167instructions.
168</impo>
160 169
161<impo> 170<impo>
162If you're upgrading on a SPARC machine, you will have to take the way of 171If you're upgrading on a SPARC machine, you will have to take the way of
163<uri link="#upgrade-3.3-to-3.4-emerge-e">complete system rebuild</uri> due to 172<uri link="#upgrade-3.3-to-3.4-emerge-e">complete system rebuild</uri> due to
164some internal <uri link="http://gcc.gnu.org/gcc-3.4/sparc-abi.html">ABI 173some internal <uri link="http://gcc.gnu.org/gcc-3.4/sparc-abi.html">ABI
165changes</uri> in GCC's parameter passing. 174changes</uri> in GCC's parameter passing.
166</impo> 175</impo>
167 176
168<p> 177<p>
169You have two possibilities on how to upgrade your system. The <uri 178If you upgrade from gcc 3.3 to 3.4, you have two possibilities on how to
170link="#upgrade-3.3-to-3.4-revdep-rebuild">first method</uri> is faster and 179upgrade your system. The <uri link="#upgrade-3.3-to-3.4-revdep-rebuild">first
171requires use of the <c>revdep-rebuild</c> tool from package <c>gentoolkit</c> 180method</uri> is faster and requires use of the <c>revdep-rebuild</c> tool from
181package <c>gentoolkit</c> while the <uri
172while the <uri link="#upgrade-3.3-to-3.4-emerge-e">second one</uri> rebuilds the 182link="#upgrade-3.3-to-3.4-emerge-e">second one</uri> rebuilds the entire
173entire system from scratch so it will make use of new GCC features. It's up to 183system from scratch so it will make use of new GCC features. It's up to you to decide which of these two ways you will choose. In most cases, the first
174you to decide which of these two ways you will choose. In most cases, the first
175method is sufficient. 184method is sufficient.</p>
185<p>If you upgrade from gcc 3.3 to 4.1, do not use the method based on
186revdep-rebuild, but do a <uri link="#upgrade-3.3-to-3.4-emerge-e">complete
187system rebuild</uri>.
176</p> 188</p>
177 189
178</body> 190</body>
179</section> 191</section>
180<section id="upgrade-3.3-to-3.4-revdep-rebuild"> 192<section id="upgrade-3.3-to-3.4-revdep-rebuild">
246# <i>emerge -uav gcc</i> 258# <i>emerge -uav gcc</i>
247<comment>(Please substitute "i686-pc-linux-gnu-3.4.5" with the GCC 259<comment>(Please substitute "i686-pc-linux-gnu-3.4.5" with the GCC
248version and CHOST settings you've upgraded to:)</comment> 260version and CHOST settings you've upgraded to:)</comment>
249# <i>gcc-config i686-pc-linux-gnu-3.4.5</i> 261# <i>gcc-config i686-pc-linux-gnu-3.4.5</i>
250# <i>source /etc/profile</i> 262# <i>source /etc/profile</i>
263
264<comment>If you upgraded from gcc 3 to 4 (e.g. from 3.3.6 to 4.1.1 in this
265example) you will have to run fix_libtool_files.sh manually</comment>
266# <i>fix_libtool_files.sh 3.3.6</i>
251 267
252<comment>(Rebuilding libtool)</comment> 268<comment>(Rebuilding libtool)</comment>
253# <i>emerge --oneshot -av libtool</i> 269# <i>emerge --oneshot -av libtool</i>
254</pre> 270</pre>
255 271
426</p> 442</p>
427 443
428<p> 444<p>
429Always use same GCC version for your kernel and additional kernel modules. Once 445Always use same GCC version for your kernel and additional kernel modules. Once
430you rebuild your world with new GCC, external modules (like 446you rebuild your world with new GCC, external modules (like
431<c>app-emulation/qemu-softmmu</c>) will fail to load. Please rebuild your kernel 447<c>app-emulation/qemu-softmmu</c>) will fail to load. Please rebuild your
432with new GCC to fix that. 448kernel with the new GCC to fix that.
433</p> 449</p>
434 450
435<p> 451<p>
436If you're upgrading on a SPARC machine, make sure to rerun <c>silo -f</c> after 452If you're upgrading on a SPARC machine, make sure to rerun <c>silo -f</c> after
437re-emerging world to avoid possible issues. 453re-emerging world to avoid possible issues.
449archive</e>, please run <c>/sbin/fix_libtool_files.sh 3.3.6</c> (substitute 465archive</e>, please run <c>/sbin/fix_libtool_files.sh 3.3.6</c> (substitute
450"3.3.6" with the version numbers from the error message). 466"3.3.6" with the version numbers from the error message).
451</p> 467</p>
452 468
453<p> 469<p>
454If you see the <e>error: /usr/bin/gcc-config: line 632: 470If you see <e>error: /usr/bin/gcc-config: line 632:
455/etc/env.d/gcc/i686-pc-linux-gnu-3.3.5: No such file or directory</e>, then try 471/etc/env.d/gcc/i686-pc-linux-gnu-3.3.5: No such file or directory</e>, then try
456deleting <path>/etc/env.d/gcc/config-i686-pc-linux-gnu</path> and running 472deleting <path>/etc/env.d/gcc/config-i686-pc-linux-gnu</path> and running
457<c>gcc-config</c> again, followed by <c>source /etc/profile</c>. Only do this if 473<c>gcc-config</c> again, followed by <c>source /etc/profile</c>. Only do this
458you do not have any cross-compilers set up, though. 474if you do not have any cross-compilers set up, though.
459</p> 475</p>
460 476
461<p> 477<p>
462If a package fails during <c>emerge -e system</c> or <c>emerge -e world</c>, 478If a package fails during <c>emerge -e system</c> or <c>emerge -e world</c>,
463you can resume operation with <c>emerge --resume</c>. If a package fails 479you can resume operation with <c>emerge --resume</c>. If a package fails

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.14

  ViewVC Help
Powered by ViewVC 1.1.20