/home/js/gcc-build/./prev-gcc/xgcc -B/home/js/gcc-build/./prev-gcc/ -B/usr/local/x86_64-unknown-netbsd5.1./bin/ -B/usr/local/x86_64-unknown-netbsd5.1./bin/ -B/usr/local/x86_64-unknown-netbsd5.1./lib/ -isystem /usr/local/x86_64-unknown-netbsd5.1./include -isystem /usr/local/x86_64-unknown-netbsd5.1./sys-include -c -DHAVE_CONFIG_H -g -O2 -gtoggle -I. -I/home/js/gcc-trunk/libiberty/../include -W -Wall -Wwrite-strings -Wc++-compat -Wstrict-prototypes -pedantic -fpic /home/js/gcc-trunk/libiberty/mempcpy.c -o pic/mempcpy.o; \ else true; fi /home/js/gcc-trunk/libiberty/mempcpy.c:35:36: error: unknown type name ‘size_t’ /home/js/gcc-trunk/libiberty/mempcpy.c:38:34: error: unknown type name ‘size_t’ Looking at the file, it includes stddef.h, which does define size_t on NetBSD: webkeks:/tmp$ cat test.c #include <stddef.h> size_t foo; webkeks:/tmp$ gcc -c test.c webkeks:/tmp$ So it seems that uding the build process, different headers are used which are broken.
I can't verify it myself but I've had this reported to me in private too, so am going to confirm it. Please provide your full configure command, thanks
/home/js/gcc-trunk/configure --enable-long-long --disable-multilib --enable-threads --disable-symvers --enable-__cxa_atexit --enable-languages=c,c++,objc,obj-c++ --with-mpfr=/usr/local --with-mpc=/usr/local --with-gmp=/usr/local
Can you attach output of the failing command when '-o <FILE>' is removed and -c is replaced with -E? And please post the full failing command, the one you posted has '; else true; fi' but no 'if' part. Thanks.
Still waiting for feedback I'll investigate this myself (to expedite PR 47045) if there's a public NetBSD machine available in a compile farm somewhere, or if someone is able to give me ssh access to a box
Created attachment 22952 [details] preprocessed source configured with ../gcc-4.6-20110108/configure --prefix=/home/redi/work/sandbox --disable-libgomp --disable-bootstrap --disable-multilib on netbsd-current build fails in libstdc++-v3/libsupc++ with these errors: In file included from ../../../../gcc-4.6-20110108/libstdc++-v3/libsupc++/tinfo.h:31:0, from ../../../../gcc-4.6-20110108/libstdc++-v3/libsupc++/array_type_info.cc:25: /disk/1/archive/tmp/redi/gcc-4.6-20110108/libstdc++-v3/libsupc++/cxxabi.h:70:17: error: 'size_t' was not declared in this scope /disk/1/archive/tmp/redi/gcc-4.6-20110108/libstdc++-v3/libsupc++/cxxabi.h:70:17: note: suggested alternative: /disk/1/archive/tmp/redi/objdir-4.6-20110108/x86_64-unknown-netbsd5.99.43/libstdc++-v3/include/x86_64-unknown-netbsd5.99.43/bits/c++config.h:88:26: note: 'std::size_t' preprocessed source attached I'll look into it more later and try a build without --disable-boostrap too ...
./gcc/include/stddef.h is being included, but it doesn't define size_t <machine/ansi.h> has the header guard _X86_64_ANSI_H_ but it appears that gcc's stddef.h is expecting _MACHINE_ANSI_H_
Created attachment 22953 [details] fix bootstrap on NetBSD by checking for _X86_64_ANSI_H
the include guard changed here: http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/amd64/include/ansi.h.diff?r1=1.6&r2=1.7&only_with_tag=MAIN by this commit: http://mail-index.netbsd.org/source-changes/2008/10/26/msg211757.html Looking at src/sys/arch/i386/include/ansi.h it seems that <machine/ansi.h> has a different include guard for every arch, which is a lot of arch's for NetBSD e.g. _I386_ANSI_H_ for x86 http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/i386/include/ansi.h.diff?r1=1.21&r2=1.22&only_with_tag=MAIN
actually it's not every arch - most still use _ANSI_H_ it's just x86 and x86-64 that are different
Created attachment 22954 [details] handle _I386_ANSI_H as well as _X86_64_ANSI_H
Sorry for the late reply. Your patch worked fine.
patch posted for review: http://gcc.gnu.org/ml/gcc-patches/2011-01/msg00881.html
Author: redi Date: Sat Jan 29 22:15:52 2011 New Revision: 169395 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=169395 Log: 2011-01-29 Jonathan Wakely <jwakely.gcc@gmail.com> PR bootstrap/47147 * ginclude/stddef.h: Check for _X86_64_ANSI_H_ and _I386_ANSI_H_ as used by NetBSD. Modified: trunk/gcc/ChangeLog trunk/gcc/ginclude/stddef.h
Fixed for 4.6.0, although as noted at http://gcc.gnu.org/ml/gcc/2011-01/msg00433.html there are other architectures (landisk, hpcsh, dreamcast and evbsh3) which don't use _ANSI_H_
Author: dnovillo Date: Wed Feb 2 18:03:04 2011 New Revision: 169690 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=169690 Log: 2011-01-29 Jonathan Wakely <jwakely.gcc@gmail.com> PR bootstrap/47147 * ginclude/stddef.h: Check for _X86_64_ANSI_H_ and _I386_ANSI_H_ as used by NetBSD. Modified: branches/google/integration/gcc/ChangeLog branches/google/integration/gcc/ginclude/stddef.h