This could be either a gcc bug or a gcc-config bug. Not sure. The error is that when an attempt if made to compile the kernel, it bombs with the inability to find stdarg.h. This is due to an incorrect include path passed to the kernel build from gcc. Running the build with the -v flag results in the following - Generating include/linux/version.h (unchanged) make -f scripts/Makefile.build obj=scripts Starting the build. KBUILD_BUILTIN=1 KBUILD_MODULES= make -f scripts/Makefile.build obj=init gcc -Wp,-MD,init/.main.o.d -D__KERNEL__ -Iinclude -v -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-bou ndary=2 -march=pentium4 -Iinclude/asm-i386/mach-default -fomit-frame-pointer -no stdinc -iwithprefix include -DKBUILD_BASENAME=main -DKBUILD_MODNAME=main -c -o init/main.o init/main.c Reading specs from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.1/specs Configured with: /var/tmp/portage/gcc-3.2.1-r6/work/gcc-3.2.1/configure --prefix =/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/3.2 --exec-prefix=/usr --datadir=/ usr/share/gcc-data/i686-pc-linux-gnu/3.2 --mandir=/usr/share/gcc-data/i686-pc-li nux-gnu/3.2/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/3.2/info --enabl e-shared --host=i686-pc-linux-gnu --target=i686-pc-linux-gnu --with-system-zlib --enable-languages=c,c++,ada,f77,objc,java --enable-threads=posix --enable-long- long --disable-checking --enable-cstdio=stdio --enable-clocale=generic --enable- __cxa_atexit --enable-version-specific-runtime-libs --with-gxx-include-dir=/usr/ lib/gcc-lib/i686-pc-linux-gnu/3.2.1/include/g++-v3 --with-local-prefix=/usr/loca l --enable-shared --enable-nls --without-included-gettext Thread model: posix gcc version 3.2.1 20021207 (Gentoo Linux 3.2.1-20021207) /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.1/cc1 -lang-c -nostdinc -v -Iinclude -Ii nclude/asm-i386/mach-default -iprefix /usr/bin/../../lib/gcc-lib/i686-pc-linux-g nu/3.2.1/ -D__GNUC__=3 -D__GNUC_MINOR__=2 -D__GNUC_PATCHLEVEL__=1 -D__GXX_ABI_VE RSION=102 -D__ELF__ -Dunix -D__gnu_linux__ -Dlinux -D__ELF__ -D__unix__ -D__gnu_ linux__ -D__linux__ -D__unix -D__linux -Asystem=posix -D__OPTIMIZE__ -D__STDC_HO STED__=1 -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__pentium4 -D__p entium4__ -D__tune_pentium4__ -D__SSE__ -D__MMX__ -D__SSE2__ -D__KERNEL__ -DKBUI LD_BASENAME=main -DKBUILD_MODNAME=main -iwithprefix include -MD init/.main.o.d i nit/main.c -quiet -dumpbase main.c -mpreferred-stack-boundary=2 -march=pentium4 -O2 -Wall -Wstrict-prototypes -Wno-trigraphs -version -fno-strict-aliasing -fno- common -fomit-frame-pointer -o - | /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.1/../../../../i686-pc-linux-gnu/bin/as - V -Qy -o init/main.o - ignoring nonexistent directory "/lib/gcc-lib/i686-pc-linux-gnu/3.2.1/include" GNU CPP version 3.2.1 20021207 (Gentoo Linux 3.2.1-20021207) (cpplib) (i386 Linu x/ELF) GNU C version 3.2.1 20021207 (Gentoo Linux 3.2.1-20021207) (i686-pc-linux-gnu) compiled by GNU C version 3.2.1 20021207 (Gentoo Linux 3.2.1-20021207). It seems that gcc 3.2.1-r6 (don't know about the other versions) as installed in gentoo, is searching in the wrong place for the include files (specifically stdarg.h) when it is run with the -nostdinc flag. From the gcc documentation, -iwithprefix INCPATH, uses the prefix specified with -iprefix PREFIX to append it to the INCPATH variable to find the include path to search for the include files. In the kernel build, as far as I can determine, the -iprefix PREFIX is set internally in gcc and the -iwithprefix include is specified in the kernel Makefile. gcc internally seems to be assigning the following path to the PREFIX --- -iprefix /usr/bin/../../lib/gcc-lib/i686-pc-linux-gnu/3.2.1/ As can be seen from the above path, the include files are now searched in /lib/gcc-lib/i686-pc-linux-gnu/3.2.1/ and obviously this path does not exist and the kernel build bombs. The correct prefix should have been -iprefix /usr/bin/../lib/gcc-lib/i686-pc-linux-gnu/3.2.1/ I created a temporary link in /lib to test this out and the kernel builds correctly. I also downloaded and build gcc 3.2.1 from gcc.gnu.org and built it with the same configure command as the ebuild and installed it to a different path. Then I tried to build the kernel (after removing the /lib link above) and the kernel build correctly with no problems. The include paths are correctly set. This points to a problem in the gcc or gcc-config install in gentoo. My emerge info is ------- Portage 2.0.46-r7 (default-x86-1.4, gcc-3.2.1, glibc-2.3.1-r3) ================================================================= System uname: 2.5.57 i686 Intel(R) Xeon(TM) CPU 1.70GHz GENTOO_MIRRORS="http://gentoo.linux.no http://www.ibiblio.org/pub/Linux/distributions/gentoo" CONFIG_PROTECT="/etc /var/qmail/control /usr/kde/2/share/config /usr/kde/3/share/config /usr/kde/3.1/share/config /usr/share/config" CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d" PORTDIR="/usr/portage" DISTDIR="/usr/portage/distfiles" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR_OVERLAY="/opt/portage" USE="x86 oss 3dnow apm avi crypt gif jpeg libg++ mikmod mmx mpeg ncurses nls pdflib png qtmt quicktime spell xml2 xmms xv zlib gtkhtml gdbm berkdb slang readline arts tetex bonobo tcltk java guile X sdl gpm tcpd pam libwww ssl perl python esd imlib gnome gtk qt motif opengl mozilla cdr -alsa -svga cups aalib truetype ldap pda kde encode gtk2 oggvorbis pnp" COMPILER="gcc3" CHOST="i686-pc-linux-gnu" CFLAGS="-march=pentium3 -Os -pipe -fexpensive-optimizations -fpeephole -fgcse -fomit-frame-pointer -funroll-loops" CXXFLAGS="-march=pentium3 -Os -pipe -fexpensive-optimizations -fpeephole -fgcse -fomit-frame-pointer -funroll-loops" ACCEPT_KEYWORDS="x86 ~x86" MAKEOPTS="-j2" AUTOCLEAN="yes" SYNC="rsync://rsync.gentoo.org/gentoo-portage" FEATURES="sandbox ccache prelink"
*** This bug has been marked as a duplicate of 8132 ***