Gentoo - error: gcc must provide the header

GCC steht für GNU Compiler Collection und ist eines der wichtigsten Systemwerkzeuge in einem Linux-System. So beinhalt die Sammlung doch alle wichtigen Komponenten, um Quellcode (sprich Programme in ihrem ursprünglichen Programmiercode) in funktionsfähige Anwendungen zu kompilieren. GCC bzw. Programme sind in der Regel abwärtskompatibel, aber irgendwann sind auch die alten GCC-Versionen zu alt.

Schauen wir uns folgende Fehlermeldung beim Kompilieren auf einem Gentoo-System an:

checking for string.h... (cached) yes  
checking for memory.h... (cached) yes
checking for strings.h... (cached) yes
checking for inttypes.h... (cached) yes
checking for stdint.h... (cached) yes
checking for unistd.h... (cached) yes
checking cpuid.h usability... no
checking cpuid.h presence... no
checking for cpuid.h... no
configure: error: gcc must provide the <cpuid.h> header
 * ERROR: sys-libs/glibc-2.11.2 failed:
 *   failed to configure glibc
 *
 * Call stack:
 *                  ebuild.sh, line   54:  Called src_compile                        
 *                environment, line 3740:  Called eblit-run 'src_compile'            
 *                environment, line 1178:  Called eblit-glibc-src_compile            
 *   src_compile-2.11.2.eblit, line  207:  Called toolchain-glibc_src_compile        
 *   src_compile-2.11.2.eblit, line  121:  Called glibc_do_configure 'nptl'          
 *   src_compile-2.11.2.eblit, line   98:  Called die                                
 * The specific snippet of code:
 *      "${S}"/configure ${myconf} || die "failed to configure glibc"
 *
 * If you need support, post the output of 'emerge --info =sys-libs/glibc-2.11.2',
 * the complete build log and the output of 'emerge -pqv =sys-libs/glibc-2.11.2'.
 * The complete build log is located at '/var/tmp/portage/sys-libs/glibc-2.11.2/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-libs/glibc-2.11.2/temp/environment'.
 * S: '/var/tmp/portage/sys-libs/glibc-2.11.2/work/glibc-2.11.2'

>>> Failed to emerge sys-libs/glibc-2.11.2,

Entscheidend ist die Zeile "configure: error: gcc must provide the <cpuid.h> ", die eindeutig sagt, dass die aktuell eingesetzte GCC-Version eine bestimmte Funktion (cpuid.h) nicht unterstützt. Das bedeutet, dass man GCC aktualisieren muss.

// Aktuelle GCC-Version anzeigen lassen
# gcc -v
gcc version 4.1.2 (Gentoo 4.1.2 p1.1)

// Verfügbare GCC-Version anzeigen
# emerge -av gcc
[ebuild  NS   ] sys-devel/gcc-4.4.3-r2 [4.1.2, 4.3.4]

Doch vorsicht! Ein Upgrade der GCC-Version ist nicht trivial und sollte mit sorgfalt durchgeführt werden. Eine Anleitung findet man hier: Gentoo GCC Upgrade Guide