User account creation filtered due to spam.

Bug 23158 - building GCC 3.3.6 fails on ppc64 with gcc4 and gcc4.1
Summary: building GCC 3.3.6 fails on ppc64 with gcc4 and gcc4.1
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: bootstrap (show other bugs)
Version: 3.3.6
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-31 09:20 UTC by Markus Rothe
Modified: 2007-04-04 14:34 UTC (History)
5 users (show)

See Also:
Host: powerpc64-unknown-linux-gnu
Target: powerpc64-unknown-linux-gnu
Build: powerpc64-unknown-linux-gnu
Known to work:
Known to fail:
Last reconfirmed:


Attachments
preprocessed source (6.93 KB, text/plain)
2005-07-31 17:22 UTC, Markus Rothe
Details
stdio.h (1.54 KB, text/plain)
2005-07-31 17:30 UTC, Markus Rothe
Details
preprocessed sourced outside of emerge (6.90 KB, text/plain)
2005-07-31 18:56 UTC, Markus Rothe
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Rothe 2005-07-31 09:20:40 UTC
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
Comment 1 Andrew Pinski 2005-07-31 16:16:37 UTC
Can you attach the preprocessed source?
Comment 2 Andrew Pinski 2005-07-31 16:33:07 UTC
Note you are building the full GCC 3.3.6
Comment 3 Markus Rothe 2005-07-31 17:11:57 UTC
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 #
Comment 4 Andrew Pinski 2005-07-31 17:13:43 UTC
I am starting to think you have a memory/hardware issue.
Comment 5 Markus Rothe 2005-07-31 17:22:19 UTC
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.
Comment 6 Andrew Pinski 2005-07-31 17:24:58 UTC
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?
Comment 7 Markus Rothe 2005-07-31 17:30:07 UTC
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.
Comment 8 Andrew Pinski 2005-07-31 17:34:20 UTC
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.
Comment 9 Markus Rothe 2005-07-31 17:40:15 UTC
ok. thx for the info.
Comment 10 Markus Rothe 2005-07-31 18:55:25 UTC
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
Comment 11 Markus Rothe 2005-07-31 18:56:23 UTC
Created attachment 9400 [details]
preprocessed sourced outside of emerge
Comment 12 Andrew Pinski 2005-07-31 18:57:06 UTC
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
Comment 13 Andrew Pinski 2005-07-31 19:00:27 UTC
This is where I say if gentoo does not stop using STAGE1_CFLAGS="-O", then gentoo is fucked.
Comment 14 Andrew Pinski 2005-07-31 19:01:35 UTC
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.
Comment 15 Markus Rothe 2005-07-31 19:11:37 UTC
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"
Comment 16 Andrew Pinski 2005-07-31 19:15:26 UTC
Use make bootstrap instead.
Comment 17 Yang Dehua 2006-08-24 23:55:16 UTC
Any progress in solving this problem? I still have the same problem with my G5 running ppc64 linux.
Comment 18 Andrew Pinski 2006-08-25 00:02:56 UTC
(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.
Comment 19 Tom Gall 2006-11-13 22:32:09 UTC
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. 
Comment 20 Sean Parsons 2007-04-04 14:34:48 UTC
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.