Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 433333 - gcc 4.6.3 fails to build. unlink-if-ordinary.c error storage size of st isnt known
Summary: gcc 4.6.3 fails to build. unlink-if-ordinary.c error storage size of st isnt ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-29 20:23 UTC by samtygier
Modified: 2012-09-02 21:33 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description samtygier 2012-08-29 20:23:24 UTC
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
Comment 1 samtygier 2012-08-30 12:56:06 UTC
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
Comment 2 Fabian Groffen gentoo-dev 2012-09-02 18:18:34 UTC
Fixed, Fedora/RedHat injected some fugly crap in their /usr/include/features.h.  We now skip our fortify-source patch if this is present.
Comment 3 samtygier 2012-09-02 21:33:18 UTC
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.