Hi, I'm trying to bulid libstdc++.so.5 (which comes with gcc-3.3.6) using gcc-4.0.1 and a gcc-4.1.0 snapshot from 20050730, but it fails. This is Gentoo/PPC64. Version output from gcc-4.0.1: # gcc -v Using built-in specs. Target: powerpc64-unknown-linux-gnu Configured with: /var/tmp/portage/gcc-4.0.1/work/gcc-4.0.1/configure --enable-version-specific-runtime-libs --prefix=/usr --bindir=/usr/powerpc64-unknown-linux-gnu/gcc-bin/4.0.1 --includedir=/usr/lib/gcc/powerpc64-unknown-linux-gnu/4.0.1/include --datadir=/usr/share/gcc-data/powerpc64-unknown-linux-gnu/4.0.1 --mandir=/usr/share/gcc-data/powerpc64-unknown-linux-gnu/4.0.1/man --infodir=/usr/share/gcc-data/powerpc64-unknown-linux-gnu/4.0.1/info --with-gxx-include-dir=/usr/lib/gcc/powerpc64-unknown-linux-gnu/4.0.1/include/g++-v4 --host=powerpc64-unknown-linux-gnu --build=powerpc64-unknown-linux-gnu --enable-altivec --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --disable-libunwind-exceptions --disable-multilib --disable-libgcj --enable-languages=c,c++,objc,f95 --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu Thread model: posix gcc version 4.0.1 (Gentoo 4.0.1, pie-8.7.8) Version output from gcc-4.1.0: # gcc -v Using built-in specs. Target: powerpc64-unknown-linux-gnu Configured with: /var/tmp/portage/gcc-4.1.0_beta20050730/work/gcc-4.1-20050730/configure --enable-version-specific-runtime-libs --prefix=/usr --bindir=/usr/powerpc64-unknown-linux-gnu/gcc-bin/4.1.0-beta20050730 --includedir=/usr/lib/gcc/powerpc64-unknown-linux-gnu/4.1.0-beta20050730/include --datadir=/usr/share/gcc-data/powerpc64-unknown-linux-gnu/4.1.0-beta20050730 --mandir=/usr/share/gcc-data/powerpc64-unknown-linux-gnu/4.1.0-beta20050730/man --infodir=/usr/share/gcc-data/powerpc64-unknown-linux-gnu/4.1.0-beta20050730/info --with-gxx-include-dir=/usr/lib/gcc/powerpc64-unknown-linux-gnu/4.1.0-beta20050730/include/g++-v4 --host=powerpc64-unknown-linux-gnu --build=powerpc64-unknown-linux-gnu --enable-altivec --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --disable-libunwind-exceptions --disable-multilib --disable-libgcj --enable-languages=c,c++,objc,f95 --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu Thread model: posix gcc version 4.1.0 20050730 (experimental) I've glibc-2.3.5 installed: # /lib64/libc.so.6 GNU C Library stable release version 2.3.5, by Roland McGrath et al. Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Compiled by GNU CC version 3.4.4 (Gentoo 3.4.4, ssp-3.4.4-1.0, pie-8.7.8). Compiled on a Linux 2.6.11 system on 2005-07-21. Available extensions: GNU libio by Per Bothner crypt add-on version 2.1 by Michael Glad and others Native POSIX Threads Library by Ulrich Drepper et al The C stubs add-on version 2.1.2. GNU Libidn by Simon Josefsson BIND-8.2.3-T5B NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk Thread-local storage support included. For bug reporting instructions, please see: <http://www.gnu.org/software/libc/bugs.html>. And here comes the error message which compiling libstc++ (gcc-4.1.0 snapshot, but gcc-4.0.1 looks almost the same): /var/tmp/portage/libstdc++-v3-3.3.6/work/build/gcc/xgcc -B/var/tmp/portage/libstdc++-v3-3.3.6/work/build/gcc/ -B/usr/powerpc64-unknown-linux-gnu/bin/ -B/usr/powerpc64-unknown-linux-gnu/lib/ -isystem /usr/powerpc64-unknown-linux-gnu/include -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -isystem ./include -I. -I. -I/var/tmp/portage/libstdc++-v3-3.3.6/work/gcc-3.3.6/gcc -I/var/tmp/portage/libstdc++-v3-3.3.6/work/gcc-3.3.6/gcc/. -I/var/tmp/portage/libstdc++-v3-3.3.6/work/gcc-3.3.6/gcc/config -I/var/tmp/portage/libstdc++-v3-3.3.6/work/gcc-3.3.6/gcc/../include -g0 -finhibit-size-directive -fno-inline-functions -fno-exceptions -fno-zero-initialized-in-bss \ -c /var/tmp/portage/libstdc++-v3-3.3.6/work/gcc-3.3.6/gcc/crtstuff.c -DCRT_END -DCRTSTUFFS_O \ -o crtendS.o In file included from /usr/include/stdio.h:828, from /var/tmp/portage/libstdc++-v3-3.3.6/work/gcc-3.3.6/gcc/tsystem.h:72, from /var/tmp/portage/libstdc++-v3-3.3.6/work/gcc-3.3.6/gcc/crtstuff.c:62: /usr/include/bits/stdio.h: In function `vprintf': /usr/include/bits/stdio.h:36: error: syntax error before "__restrict__" /usr/include/bits/stdio.h: In function `getchar': /usr/include/bits/stdio.h:43: error: syntax error before "__restrict__" /usr/include/bits/stdio.h:59: confused by earlier errors, bailing out In file included from /usr/include/stdio.h:828, from /var/tmp/portage/libstdc++-v3-3.3.6/work/gcc-3.3.6/gcc/tsystem.h:72, from /var/tmp/portage/libstdc++-v3-3.3.6/work/gcc-3.3.6/gcc/crtstuff.c:62: /usr/include/bits/stdio.h: In function `vprintf': /usr/include/bits/stdio.h:36: error: syntax error before "__restrict__" /usr/include/bits/stdio.h: In function `getchar': /usr/include/bits/stdio.h:43: error: syntax error before "__restrict__" /usr/include/bits/stdio.h:59: confused by earlier errors, bailing out make[1]: *** [crtbeginS.o] Error 1 make[1]: *** Waiting for unfinished jobs.... make[1]: *** [crtbeginT.o] Error 1 In file included from /usr/include/stdio.h:828, from /var/tmp/portage/libstdc++-v3-3.3.6/work/gcc-3.3.6/gcc/tsystem.h:72, from /var/tmp/portage/libstdc++-v3-3.3.6/work/gcc-3.3.6/gcc/crtstuff.c:62: /usr/include/bits/stdio.h: In function `vprintf': /usr/include/bits/stdio.h:36: error: syntax error before "__restrict__" /usr/include/bits/stdio.h: In function `getchar': /usr/include/bits/stdio.h:43: error: syntax error before "__restrict__" /usr/include/bits/stdio.h:59: confused by earlier errors, bailing out In file included from /usr/include/stdio.h:828, from /var/tmp/portage/libstdc++-v3-3.3.6/work/gcc-3.3.6/gcc/tsystem.h:72, from /var/tmp/portage/libstdc++-v3-3.3.6/work/gcc-3.3.6/gcc/crtstuff.c:62: /usr/include/bits/stdio.h: In function `vprintf': /usr/include/bits/stdio.h:36: error: syntax error before "__restrict__" /usr/include/bits/stdio.h: In function `getchar': /usr/include/bits/stdio.h:43: error: syntax error before "__restrict__" /usr/include/bits/stdio.h:59: confused by earlier errors, bailing out make[1]: *** [crtbegin.o] Error 1 In file included from /usr/include/stdio.h:828, from /var/tmp/portage/libstdc++-v3-3.3.6/work/gcc-3.3.6/gcc/tsystem.h:72, from /var/tmp/portage/libstdc++-v3-3.3.6/work/gcc-3.3.6/gcc/crtstuff.c:62: /usr/include/bits/stdio.h: In function `vprintf': /usr/include/bits/stdio.h:36: error: syntax error before "__restrict__" /usr/include/bits/stdio.h: In function `getchar': /usr/include/bits/stdio.h:43: error: syntax error before "__restrict__" /usr/include/bits/stdio.h:59: confused by earlier errors, bailing out make: *** [all-gcc] Error 2 !!! ERROR: sys-libs/libstdc++-v3-3.3.6 failed. !!! Function src_compile, Line 232, Exitcode 2 !!! (no error message) !!! If you need support, post the topmost build error, NOT this status message. I'm no expert, but the error is triggert by a file, that is installed by glibc (/usr/include/bits/stdio.h) and using exactly the same versions of glibc/gcc/libstdc++ works on i686-pc-linux-gnu, so I assume this is a problem in gcc. Regards, Markus
Can you attach the preprocessed source?
Note you are building the full GCC 3.3.6
I re-ran the compile with -j1 ( instead of -j9 ;-) ) to get the command which was executed before the error. Then I re-ran this command with the -E option, so that the preprocessed source gets written to the file specified by the -o option, right? But all I get is an ICE and the file specified by -o does not get written -- and yes, I am at the right dirctory (hopefully, but find does not find that file, too): gcc # /var/tmp/portage/libstdc++-v3-3.3.6/work/build/gcc/xgcc -B/var/tmp/portage/libstdc++-v3-3.3.6/work/build/gcc/ -B/usr/powerpc64-unknown-linux-gnu/bin/ -B/usr/powerpc64-unknown-linux-gnu/lib/ -isystem /usr/powerpc64-unknown-linux-gnu/include -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -isystem ./include -I. -I. -I/var/tmp/portage/libstdc++-v3-3.3.6/work/gcc-3.3.6/gcc -I/var/tmp/portage/libstdc++-v3-3.3.6/work/gcc-3.3.6/gcc/. -I/var/tmp/portage/libstdc++-v3-3.3.6/work/gcc-3.3.6/gcc/config -I/var/tmp/portage/libstdc++-v3-3.3.6/work/gcc-3.3.6/gcc/../include -g0 -finhibit-size-directive -fno-inline-functions -fno-exceptions -fno-zero-initialized-in-bss -c /var/tmp/portage/libstdc++-v3-3.3.6/work/gcc-3.3.6/gcc/crtstuff.c -DCRT_BEGIN -o crtbegin.o -E cc1: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. gcc # ls crtbegin.o ls: crtbegin.o: No such file or directory gcc #
I am starting to think you have a memory/hardware issue.
Created attachment 9397 [details] preprocessed source I got the preprocced source by removing the -o option. Also I am getting this on a power5 and Apple G5, so I don't think this is an hardware issue.
I cannot reproduce this building gcc-3.3.6. return vfprintf (__restrict, __fmt, __arg); This looks like a glibc bug, could you attach /usr/include/bits/stdio.h?
Created attachment 9398 [details] stdio.h yes, that this is a bug in glibc is what I thought, too, but as stdio.h on ppc64 does not differ from stdio.h on x86 and this can be compiled on x86 using gcc4, I thought the bug is in gcc.
Huh, stdin and stdout are being replaced with restrict. This is not a GCC bug. Try compile gcc 3.3.6 by hand and not using emage at all. I don't trust gentoo's build system right now.
ok. thx for the info.
I have now tried to bulid outside of portage. Or that is to say: a normal bulid. Here is what I did (this is basicly what emerge does): $ cd ~ $ mkdir libstc++-v3-temp2 $ cd libstc++-v3-temp2 $ tar xfj /usr/portage/distfiles/gcc-3.3.6.tar.bz2 $ mkdir build $ cd build $ ../gcc-3.3.6/configure --prefix=/usr --bindir=/usr/powerpc64-unknown-linux-gnu/gcc-bin/4.1.0-beta20050730/ --includedir=/usr/lib/gcc/powerpc64-unknown-linux-gnu/4.1.0-beta20050730/include/ --datadir=/usr/share/gcc-data/powerpc64-unknown-linux-gnu/4.1.0-beta20050730/ --mandir=/usr/share/gcc-data/powerpc64-unknown-linux-gnu/4.1.0-beta20050730/man/ --infodir=/usr/share/gcc-data/powerpc64-unknown-linux-gnu/4.1.0-beta20050730/info/ --enable-shared --host=powerpc64-unknown-linux-gnu --target=powerpc64-unknown-linux-gnu --with-system-zlib --enable-languages=c++ --enable-threads=posix --enable-long-long --disable-checking --enable-cstdio=stdio --enable-__cxa_atexit --enable-version-specific-runtime-libs --with-gxx-include-dir=/usr/lib/gcc/powerpc64-unknown-linux-gnu/4.1.0-beta20050730/include/g++-v4/ --with-local-prefix=/usr/local/ --disable-multilib --enable-nls --without-included-gettext $ touch ../gcc-3.3.6/gcc/c-gperf.h (don't know why this done by the way..) $ make all-target-libstdc++-v3 LIBPATH="/usr/lib/gcc/powerpc64-unknown-linux-gnu/4.1.0-beta20050730/" BOOT_CFLAGS=" -O2 -pipe" STAGE1_CFLAGS="-O" And the I get exactly the same error as before: [...] /root/libstc++-v3-temp2/build/gcc/xgcc -B/root/libstc++-v3-temp2/build/gcc/ -B/usr/powerpc64-unknown-linux-gnu/bin/ -B/usr/powerpc64-unknown-linux-gnu/lib/ -isystem /usr/powerpc64-unknown-linux-gnu/include -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -isystem ./include -I. -I. -I../../gcc-3.3.6/gcc -I../../gcc-3.3.6/gcc/. -I../../gcc-3.3.6/gcc/config -I../../gcc-3.3.6/gcc/../include -g0 -finhibit-size-directive -fno-inline-functions -fno-exceptions -fno-zero-initialized-in-bss \ -c ../../gcc-3.3.6/gcc/crtstuff.c -DCRT_BEGIN \ -o crtbegin.o In file included from /usr/include/stdio.h:828, from ../../gcc-3.3.6/gcc/tsystem.h:72, from ../../gcc-3.3.6/gcc/crtstuff.c:62: /usr/include/bits/stdio.h: In function `vprintf': /usr/include/bits/stdio.h:36: error: syntax error before "__restrict__" /usr/include/bits/stdio.h: In function `getchar': /usr/include/bits/stdio.h:43: error: syntax error before "__restrict__" /usr/include/bits/stdio.h:59: confused by earlier errors, bailing out make[1]: *** [crtbegin.o] Error 1 make[1]: Leaving directory `/root/libstc++-v3-temp2/build/gcc' make: *** [all-gcc] Error 2
Created attachment 9400 [details] preprocessed sourced outside of emerge
Subject: Re: building GCC 3.3.6 fails on ppc64 with gcc4 and gcc4.1 > $ touch ../gcc-3.3.6/gcc/c-gperf.h (don't know why this done by the way..) > $ make all-target-libstdc++-v3 > LIBPATH="/usr/lib/gcc/powerpc64-unknown-linux-gnu/4.1.0-beta20050730/" > BOOT_CFLAGS=" -O2 -pipe" STAGE1_CFLAGS="-O" Can you stop using STAGE1_CFLAGS="-O"? -- Pinski
This is where I say if gentoo does not stop using STAGE1_CFLAGS="-O", then gentoo is fucked.
The whole idea of STAGE1_CFLAGS being -O0 -g is so you don't run into wrong code. Please report this to gentoo, maybe they can reduce the cc1 sources.
sorry to bug you again, but I ran make like this and got exactly the same problem :-( make clean && make all-target-libstdc++-v3 LIBPATH="/usr/lib/gcc/powerpc64-unknown-linux-gnu/4.1.0-beta20050730/" BOOT_CFLAGS=" -O2 -pipe"
Use make bootstrap instead.
Any progress in solving this problem? I still have the same problem with my G5 running ppc64 linux.
(In reply to comment #17) > Any progress in solving this problem? I still have the same problem with my G5 > running ppc64 linux. This was not a bug in the new version of GCC but the older one which is no longer being maintained. Make sure you are using "make bootstrap" and make STAGE1_CFLAGS is not being set.
This is still an issue and I'm seeing it on both my power3 and power4 hardware using gcc 4.1.1 and glibc 2.5, granted using gcc 3.3.6 to build libstdc++.so.5 It's of interest as there are several pieces of proprietary software in the universe that require this shared lib, so I'm motivated. I'll see if I can dig some more this evening.
I've been getting this issue on a Playstation 3 with Gentoo, it's an issue particular to the 64-bit userland as opposed to the 32-bit userland if that's of any particular help.