Gentoo GCC 4.1.1 Upgrade Guide
DISCLAIMER: DO NOT USE THIS GUIDE AS A SUBSTITUE TO THE OFFICIAL GENTOO LINUX DOCUMENTATION! USE IT AS A SUPPLEMENT!
Gentoo Documentation Links:
Gentoo GCC Upgrade Page: Gentoo GCC Upgrade Guide
Gentoo Forum Thread: GCC 4.1.1 and glibc 2.4 stable on x86 and amd64
NOTE: This entire process will take a L O N G time. If you are doing this on a remote terminal, consider using a screen to do this in so if you get disconnected you can re-attach the screen.
UPDATE: One user following these instructions, could not get the 4.1.1 compiler to emerge. REMEMBER, run:
# emerge --sync
so you have the latest portage updates!
Step 1: Use Flags
To avoid missing this later on when the glibc upgrades, add nptl and nptlonly to your use flags.
Step 2: Upgrade GCC
Upgrade the GCC compiler.
# emerge -uav gcc
Step 3: Change the compiler to the 4.1.1
Be sure to replace "i686-pc-linux-gnu-4.1.1" 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.1
# source /etc/profile
Step 4: Fix and Re-build libtool
# fix_libtool_files.sh 3.4.6
# emerge --oneshot -av libtool
Step 5: Re-compile System and World*
The new glibc will be emerged with system.
# emerge -eav system
# emerge -eav world
Step 6: Recompile your Kernel
Recompile your kernel against your new GCC. For more information see the Gentoo Handbook.
Step 7 (optional): Remove Old GCC Versions
# emerge -aC =sys-devel/gcc-3.4*
That's it! You're done! If you have comments, suggestions, or corrections, leave them here.
* I have seen posts on the forum suggesting setting some use flags to avoid double compilation of some code, to be safe I have left this as the documentation suggests. See the forum link at the top of this page for more information.