Gentoo Wiki


This page is a candidate for deletion 
Reason given: Requested on the mailing list, because GCC 4.1 is already stable
If you disagree with its deletion, please explain why on its discussion page.
If you intend to fix it, please remove this notice, but do not remove this notice from articles that you have created yourself.
Make sure no other pages link here and check the page's history before deleting.

This page aims to gather experience on the wonderful adventure of installing gentoo with the brand new GCC 4.1.

Warning: Apply to a production system at your own risk. Latest Ubuntu uses GCC4, though. You have been warned.


Long Story Short

It works! It slices! It dices!

It doesn't mean it is stable. It may slice and dice all your data too...

With minimal hassle, a base gentoo system can be recompiled with gcc 4.1 using gentoo 2006.0 as a starting point.

This is Great! As time goes by, more packages are being added to the list at the bottom of this page with their status as of whether they are working with gcc 4.1 or not.

Intrepid adventurers are welcome to contribute with more tests! :-)

Work in progress

Note: This is work in progress. If you are willing to test, please add your software experience to the list at the bottom of this page.

Preparing for testing

To test GCC 4.1 I have built a chrooted environment. I just untarred a 2006.0 stage3 to a directory, and then a portage snapshot. Then I updated portage and the system. I have also compiled a kernel with the same config of my real kernel, because Glibc didn't like an unconfigured kernel when I tested 4.0. I am not describing in detail because you should know how to do it. If you don't, you shouldn't even be trying a test version of gcc.

My first aim is to have a working system, so i am going to be very minimalistic on my settings:

File: /etc/make.conf
CFLAGS="-O2 -march=k8 -ftracer -fprefetch-loop-arrays -pipe"
LINGUAS="pt_BR en"
USE="-doc symlink"

It looks so simple I'm suspicious. Just a few packages to unmask:

File: /etc/portage/package.unmask
File: /etc/portage/package.keywords
 ~sys-devel/gcc-4.1.0 ~*
 ~sys-libs/glibc-2.3.6 ~*
 ~sys-libs/timezone-data-2006b ~*
 #gcc 4.1 does not like older groff syntax
 ~sys-apps/groff-1.19.2 ~*

Now that gcc 4.1 + dependencies are unmasked, let's emerge them:

emerge -uavD gcc

Emerge was successful (I like when things 'just work'), as it was done using gcc 3.4.4. Now, to the fun: recompile the system using gcc 4.1.

List all available gcc versions:

gcc-config -l

Choose version 4.1 (in my case it was number 6)

gcc-config 6

Update the system config:

source /etc/profile

Recompile the system:

emerge -e system

emerge -e world


emerge -e system finished successfuly.

emerge -e world went out without hiccups! Therefore I will outline my next steps...


Having a base gentoo system is nearly useless. So, I will go on emerging new stuff to make a useable system.

Being reckless and using a chroot led me to push up my CFLAGS a bit, because gcc 4.x has a new optimizer, and -ftree-vectorize is one of the things which may provide a performance benefit.

File: /etc/make.conf
CFLAGS="-O2  -march=k8 -ftracer -fprefetch-loop-arrays -mfpmath=sse -ffast-math -ftree-vectorize -floop-optimize2 -pipe"
CXXFLAGS="${CFLAGS} -fvisibility-inlines-hidden "
LINGUAS="pt_BR en"
#will push up the USE flags later, to emerge  X,kde & co.
USE="-doc symlinks"

Finalize installation:

Emergeing the last packages ...

USE="-gtk -X" emerge -uDav syslog-ng vixie-cron slocate evms dhcpcd evms rp-pppoe reiserfsprogs vim

Compiling Applications

This section is out of date the information here is no newwer that Octuber 17 2006.

After that, there is some more fun stuff to emerge. I will tweak my USE flags now:

USE="3dnow 3dnowex 3dnowext a52 aac acl acpi apache2 artswrappersuid automount bluetooth browserplugin cdparanoia chroot cli curl curlwrappers dbus dba dga divx4linux cairo doc dri dvd dvdr dvdread firefox fglrx gd iconv imap innodb interbase java javascript jpeg2k kde kdeenablefinal ldap kerberos lm_sensors maildir mailwrapper mime mozdevelop mozsvg mozilla mpeg2 mpeg4 mplayer mpm-worker mppe-mppc mysql mysqli nptl nsplugin ntfs oggvorbis php pic posix postgres qemu-fast rdesktop screen sensord session snmp samba sql sqlite subversion theora threads tidy truetype transcode unicode utf8 vcd vcdimager vhosts vim wifi win32 win32codecs xmlrpc xscreensaver xsl xml xml2"

The fun packages (that have been built under gcc 4.1 on gentoo):

Testers please add the result to the program description as either compiles, does not compile, working, or not working, and a description, possibly with a nice bugzilla bug :)

File: /etc/portage/package.unmask
##KDE wants these additional xorg-7.0 packages,
#they might not have been included using the xorg 7.0 HOWTO:


#OpenOffice 2.0.2

File: /etc/portage/package.keywords
#This is not the complete file, these are only the dependencies for mysql, firebird, php and kde.
#for instructions on how to unmask xorg-7.0 painlessly, see the aforementioned HOWTO.
#SOME of the packages below belong to Xorg 7.0, but have not been included by the HOWTO automated process for some reason.
#Check to not unmask a dependency twice, to avoid clutter in the files.




#OpenOffice 2.0.2
~app-office/openoffice-2.0.2 ~x86
~app-text/hunspell-1.1.4 ~x86

##KDE wants these additional xorg-7.0 packages, they might not have been included using the xorg 7.0 HOWTO:

#E17 (cvs)
x11-wm/e -*
x11-libs/ewl -*
x11-libs/evas -*
x11-libs/ecore -*
x11-libs/esmart -*
x11-libs/etk -*
x11-misc/engage -*
x11-misc/iconbar -*
x11-misc/entrance -*
x11-plugins/e_modules -*
media-libs/imlib2 -*
media-libs/etox -*
media-libs/edje -*
media-libs/epsilon -*
media-libs/epeg -*
media-libs/emotion -*
dev-libs/eet -*
dev-libs/embryo -*
dev-libs/engrave -*
dev-db/edb -*
dev-util/e_utils -*
net-news/erss -*
app-misc/examine -*
app-misc/evidence -*
media-gfx/elicit -*
media-gfx/entice -*
media-gfx/exhibit -*
media-video/eclair -*
x11-misc/e17genmenu -*
app-misc/entropy -*
dev-libs/exml -*
dev-util/enhance -*
media-video/elation -*
media-video/envision -*
sys-fs/evfs -*
x11-terms/enterminus -*
x11-apps/elapse -*
media-gfx/eclips -*

Retrieved from ""

Last modified: Wed, 27 Jun 2007 10:55:00 +0000 Hits: 13,769