| Gentoo Linux GCC/GLIBC Updates |
| Written by Bryan | |
|
DISCLAIMER: Only an experienced Linux professional should perform updates to Linux servers. Doing it yourself can cause severe damage. These notes do not come with any warranty of any kind so please don't blow up your server and blame us. Gentoo GCC Upgrade Page: Gentoo GCC Upgrade GuideAbout how long this takes: Many, many more hours longer then you think, if you are not a Valley Technologies client with access to the binary depot. Step 1 - Prepare the SystemSync portage first...# emerge --syncIf need be update portage itself to the latest version... # emerge -ua portage(Optional) Recompile wget with USE="static" just in case... # USE="static" emerge wgetDownload the dist files for everything you will need now just in case... # emerge --fetchonly systemStep 2 - Update GCCUpgrade the GCC compiler...# emerge -uav gcc glibcBe sure to replace "i686-pc-linux-gnu-4.1.2" with YOUR GCC version and CHOST settings. You can verify your CHOST settings by viewing /etc/make.conf. # gcc-config i686-pc-linux-gnu-4.1.2Fix and Re-build libtool # fix_libtool_files.sh 4.1.1 [Replace 4.1.1 with your old gcc version]Step 3 - Recompile EverythingRe-compile System and then WorldImportant: Please note that this is the part that takes forever if you're not a Valley Technologies client with access to the binary depot. # emerge -gkeav system [Valley Technologies clients have access to a Gentoo binary depot to finish these steps without any compiling at all.]Step 4 - (optional) Mask your new GCC and GLIBCImportant: Doing this can save you a lot of time and headache later in life.Add the following lines to /etc/portage/package.mask to prevent them from being updated without you knowing. Replace the versions with the current version you just installed.
>sys-devel/gcc-4.1.2
Step 5 - (optional) Update/Recompile your kernelImportant: You can probably get by without recompiling your kernel if you used the Valley Technologies 2.6 Gentoo Kernel.Recompile your Kernel... Recompile your kernel against your new GCC. For more information see the Gentoo Handbook.
Step 6 - (optional) Remove Old GCC VersionsAs usual, substitute =sys-devel/gcc-3.4* with the version you want to uninstall.Important: In case you're upgrading from GCC-3.3, you should run emerge --oneshot sys-libs/libstdc++-v3 to provide compatibility with older binary C++ applications. Important: Please note that the GCC 4.1 and newer can't compile a 2.4 kernel. Don't remove your old GCC version if you want to use an older kernel. # emerge -aC =sys-devel/gcc-3.4* |