Building a gentoo prefix on a fedora 17 i386 host. i am using the interactive bootstrap-prefix.sh with the default options. stage 3 fails in building sys-devel/gcc-4.6.3 (also tried fudging it to use 4.7.1 but hit the same error). checking for fread_unlocked... if [ x"-fpic" != x ]; then \ /home/sam/gentoo/var/tmp/portage/sys-devel/gcc-4.6.3/work/build/./prev-gcc/xgcc -B/home/sam/gentoo/var/tmp/portage/sys-devel/gcc-4.6.3/work/build/./prev-gcc/ -B/home/sam/gentoo/usr/i686-pc-linux-gnu/bin/ -B/home/sam/gentoo/usr/i686-pc-linux-gnu/bin/ -B/home/sam/gentoo/usr/i686-pc-linux-gnu/lib/ -isystem /home/sam/gentoo/usr/i686-pc-linux-gnu/include -isystem /home/sam/gentoo/usr/i686-pc-linux-gnu/sys-include -c -DHAVE_CONFIG_H -O2 -march=i686 -pipe -gtoggle -I. -I/home/sam/gentoo/var/tmp/portage/sys-devel/gcc-4.6.3/work/gcc-4.6.3/libiberty/../include -W -Wall -Wwrite-strings -Wc++-compat -Wstrict-prototypes -pedantic -fpic /home/sam/gentoo/var/tmp/portage/sys-devel/gcc-4.6.3/work/gcc-4.6.3/libiberty/unlink-if-ordinary.c -o pic/unlink-if-ordinary.o; \ else true; fi yes /home/sam/gentoo/var/tmp/portage/sys-devel/gcc-4.6.3/work/gcc-4.6.3/libiberty/unlink-if-ordinary.c: In function unlink_if_ordinary: /home/sam/gentoo/var/tmp/portage/sys-devel/gcc-4.6.3/work/gcc-4.6.3/libiberty/unlink-if-ordinary.c:65:15: error: storage size of st isnt known /home/sam/gentoo/var/tmp/portage/sys-devel/gcc-4.6.3/work/gcc-4.6.3/libiberty/unlink-if-ordinary.c:67:3: warning: implicit declaration of function stat [-Wimplicit-function-declaration] /home/sam/gentoo/var/tmp/portage/sys-devel/gcc-4.6.3/work/gcc-4.6.3/libiberty/unlink-if-ordinary.c:68:7: warning: implicit declaration of function S_ISREG [-Wimplicit-function-declaration] /home/sam/gentoo/var/tmp/portage/sys-devel/gcc-4.6.3/work/gcc-4.6.3/libiberty/unlink-if-ordinary.c:69:5: warning: implicit declaration of function unlink [-Wimplicit-function-declaration] /home/sam/gentoo/var/tmp/portage/sys-devel/gcc-4.6.3/work/gcc-4.6.3/libiberty/unlink-if-ordinary.c:65:15: warning: unused variable st [-Wunused-variable] make[3]: *** [unlink-if-ordinary.o] Error 1 make[3]: Leaving directory `/home/sam/gentoo/var/tmp/portage/sys-devel/gcc-4.6.3/work/build/libiberty' make[2]: *** [all-stage2-libiberty] Error 2 with a bit of poking that source file, it seems that if i error is due to not including sys/stat.h, implying that HAVE_SYS_STAT_H is not defined. Reproducible: Always
so unlink-if-ordinary.c has #if HAVE_SYS_STAT_H #include <sys/stat.h> #endif HAVE_SYS_STAT_H comes from the config.h file. there are 2 of these libiberty/config.h and prev-libiberty/config.h (i assume for the different stages of building gcc). but only the prev version defines HAVE_SYS_STAT_H libiberty/config.h:/* #undef HAVE_SYS_STAT_H */ prev-libiberty/config.h:#define HAVE_SYS_STAT_H 1 in gcc's build output soon after "Configuring stage 2 in ./libiberty" it says checking for sys/stat.h... no looking at libiberty/config.log i find: configure:4495: checking for sys/stat.h configure:4495: /home/sam/gentoo/var/tmp/portage/sys-devel/gcc-4.7.1/work/build/./prev-gcc/xgcc -B/home/sam/gentoo/var/tmp/portage/sys-dev el/gcc-4.7.1/work/build/./prev-gcc/ -B/home/sam/gentoo/usr/i686-pc-linux-gnu/bin/ -B/home/sam/gentoo/usr/i686-pc-linux-gnu/bin/ -B/home/sam /gentoo/usr/i686-pc-linux-gnu/lib/ -isystem /home/sam/gentoo/usr/i686-pc-linux-gnu/include -isystem /home/sam/gentoo/usr/i686-pc-linux-gnu/ sys-include -E conftest.c In file included from /usr/include/sys/stat.h:27:0, from conftest.c:11: /usr/include/features.h:314:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp] configure:4495: $? = 0 configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "" | #define PACKAGE_TARNAME "" | #define PACKAGE_VERSION "" | #define PACKAGE_STRING "" | #define PACKAGE_BUGREPORT "" | #define PACKAGE_URL "" | #define _FILE_OFFSET_BITS 64 | #define STDC_HEADERS 1 | /* end confdefs.h. */ | #include <sys/stat.h> configure:4495: result: no
Fixed, Fedora/RedHat injected some fugly crap in their /usr/include/features.h. We now skip our fortify-source patch if this is present.
thanks. had to restart the bootstrap from the beginning for some reason, but it has made it past the gcc 4.6.3 stage. hopefully by morning it will be done.