|
|
发表于 2006-2-21 10:39:43
|
显示全部楼层
HOWTO gcc4
Reasoning
GCC is a key development tool, and on a distribution such as gentoo, which compiles everything natively, a key part of user's systems. For this reason, gcc-4, while reaching the esteemed status of "default compiler" on many other distributions, is still left behind on gentoo. This is about to change.
Thanks to the work of multiple gentoo developers, along with the recent release of glibc 2.3.6, gcc4 is just about ready to be unmasked. This howto details the process of upgrading to it.
GCC4 is hoped to hit ~x86, ~amd64, and ~ppc within the next few weeks, so upgrading is going to become easier, for now we need to use a few hoops.
Preparation
Warning: You must be using an up to date ~ARCH system, gcc4 related fixes have not made it to stable
First, if necessary, create the /etc/portage directory, where profile overrides can be placed.
Now, some nasty style hacks to get ebuilds no one wants you to use:
gcc-4.0.2:
- #echo "~sys-devel/gcc-4.0.2 -*" >> /etc/portage/package.keywords
复制代码
glibc-2.3.6:
- #echo "~sys-libs/glibc-2.3.6 -*" >> /etc/portage/package.keywords
复制代码
Warning: If you were using a snapshot of glibc, see gentoo bug 112082
Alrighty, now we are ready for the real fun..
#emerge binutils glibc gcc -av
Make sure the correct versions are showing.. Now take a nap. When you awake, set your gcc-config profile
find the right one
#gcc-config blah
eg:
- #gcc-config i686-pc-linux-gnu-4.1.0_pre20060219
复制代码
Huzzah! now lets rebuild the rest of the system!
- #emerge -e system && emerge -e world
复制代码
Good luck, and happy compiling!
Note that emerging the entire system can take days. Remember emerge --resume will pick up where it left off if you need to fix something.
[Update: 01 Jan 2006 gerdesj@blueloop.net] Packages still not ~x86 so above still necessary. Will report back status when system rebuilt (there are over 800 packages on this laptop).
[Update: 11 Jan 2006 gerdesj@blueloop.net] Took me around 3 days (and several emerge --resume --skipfirst) to rebuild system. Still fixing some broken packages. If you are not familiar with revdep-rebuild and fixing things then don't do this. Overall my system is running fine (KDE 3.5 and OO 2 are OK apart from anything else). As per next comment, broken things are mainly media stuff, so if that is really important to you then I suggest you wait.
[Comment (sschober@web.de): 08 Jan 2006] I just finished updating my system according to this howto. It took me nearly 3 days to compile my >850 packages with GCC-4.02. Now the system is running stable again.
After the firts shot, a couple of packages were broken. Most of them were media based packages. After some research in the forums, I could fix most of the errors and merge those packages to my system. At last only 3 packages remained, which could only be merged by falling back to GCC-3.4.5. These packages are:
media-video/qdvdauthor-0.0.10
media-tv/nuppelvideo-0.52a
net-mail/cyrus-imap-admin-2.2.12
All of the rest compiled with GCC-4. I consider this as success.
Retrieved from "http://gentoo-wiki.com/HOWTO_gcc4" |
|