Search:  
Gentoo Wiki

TIP_Testing_GCC_4.1

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.

Contents

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"
CHOST="x86_64-pc-linux-gnu"
CXXFLAGS="${CFLAGS}"
LINGUAS="pt_BR en"
MAKEOPTS="-j2"
PORTAGE_NICENESS="10"
PORTAGE_TMPFS="/dev/shm"
USE="-doc symlink"

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

File: /etc/portage/package.unmask
~sys-devel/gcc-4.1.0
~sys-libs/glibc-2.3.6
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

Status

emerge -e system finished successfuly.

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

Finishing

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"
CHOST="x86_64-pc-linux-gnu"
CXXFLAGS="${CFLAGS} -fvisibility-inlines-hidden "
LINGUAS="pt_BR en"
MAKEOPTS="-j2"
PORTAGE_NICENESS="10"
PORTAGE_TMPFS="/dev/shm"
#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:
~x11-apps/xmessage-1.0.1
~x11-apps/xsetroot-1.0.1
~x11-apps/xset-1.0.1
~x11-libs/libXv-1.0.1
~x11-apps/xwininfo-1.0.1

#Firefox 1.5.0.1
~x11-apps/xdpyinfo-1.0.1

#OpenOffice 2.0.2
~app-office/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.


#MySQL:
~dev-db/mysql-5.0.18
~app-admin/eselect-mysql-1.1.0
~app-admin/eselect-1.0
#Firebird:
~dev-db/firebird-1.5.3

#Firefox 1.5.0.1
~www-client/mozilla-firefox-1.5.0.1-r2
~www-client/mozilla-launcher-1.50
~dev-libs/nss-3.11
~x11-apps/xdpyinfo-1.0.1

#PHP:
~dev-lang/php-5.1.1
#KDE:
~kde-base/kde-3.5.1
~kde-base/kdeaddons-3.5.1
~kde-base/kdelibs-3.5.1
~kde-base/kdebase-3.5.1
~kde-base/kdeadmin-3.5.1
~kde-base/kdemultimedia-3.5.1
~kde-base/kdetoys-3.5.1
~kde-base/kdepim-3.5.1
~kde-base/kdegames-3.5.1
~media-libs/akode-2.0_rc1
~kde-base/kdenetwork-3.5.1
~kde-base/kdewebdev-3.5.1
~kde-base/kdegraphics-3.5.1
~kde-base/kdeedu-3.5.1
~kde-base/kdeutils-3.5.1
~kde-base/kdeartwork-3.5.1
~dev-lang/swig-1.3.25
~kde-base/kdesdk-3.5.1
~dev-util/kdevelop-3.3.1


#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:
~x11-apps/xmessage-1.0.1
~x11-apps/xsetroot-1.0.1
~x11-apps/xset-1.0.1
~x11-libs/libXv-1.0.1
~x11-apps/xwininfo-1.0.1

#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 -*

#chromium
~media-libs/smpeg-0.4.4
 
Retrieved from "http://www.gentoo-wiki.info/TIP_Testing_GCC_4.1"

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