Gentoo Wiki


This page is a candidate for deletion 
Reason given: Covered better by official guide. Out of date?
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.

The process is simple, all you have to do is to follow the steps described on TIP Testing GCC 4.1. i will not re-describe it here in detail, as it is pretty well described there. Instead, i will put up some considerations about the process and decide for yourself if you really want to do the switch.

As of Gentoo 2006.0, it is trivial to update the base system to GCC 4.1. The problem relies on the applications you are using.

GCC 4.x are stricter on source code syntax, and as a consequence, code which compiles under gcc 3.4 might throw an error.

As time goes by, however, more and more software compiles and runs with GCC 4.1.

Be warned that doing such an upgrade right now, you are paying the price of living with potentially unstable software, and possibly being unable to use some apps you are used to, because they still do not compile with GCC 4.1. Even if you use software which is marked as 'stable' on portage, it may not work properly because it has been compiled with an 'unstable' compiler. Even if it compiles properly, it might be generating buggy code.

The official Gentoo Linux GCC Upgrade Guide is here, please follow it:

(The next method is not the official one.) The upgrade process is a simple algorithm:

  1. unmask base stuff
  2. compile gcc 4.1
  3. Confirm that you are using gcc 4.1 with gcc-config -l
  4. emerge -e system
  5. #of previous gcc version
  6. emerge -e system (can stop after gcc 4.1) (Not needed according to the official guide)
  7. try to emerge -e world; if it fails on a certain package then:
    • look for a newer package version on unstable (~arch) OR
    • forfeit using that software until a stable version works with gcc 4.1
    • go to step 4.

At the bottom of the TIP Testing GCC 4.1 page you have a list of several packages which have been reported to work (or not work) with GCC 4.1. You might want to look there first to check if your favorite app has been tested, before taking the leap of faith into GCC 4.1.

Happy compiling!

Problems with Nvidia

You can't compile nvidia-drivers with gcc4.1 unless your kernel is compiled with gcc4 or newer. Gcc3.2-compiled kernel won't work with gcc4-compiled nvidia-drivers, it'll tell you that the kernel module is "invalid module format." So recompile your kernel before recompiling your nvidia kernel module.

Retrieved from ""

Last modified: Wed, 26 Dec 2007 10:55:00 +0000 Hits: 11,943