Hi, I just tried to compile gcc-4.1.0 on a power3 machine and it failed. It build just fine on power5 and G5. Here comes the output: [...] make[4]: Entering directory `/var/tmp/portage/gcc-4.1.0/work/build/gcc' make[4]: `crtend.o' is up to date. make[4]: `crtbeginS.o' is up to date. make[4]: `crtendS.o' is up to date. make[4]: `crtbeginT.o' is up to date. make[4]: `ecrti.o' is up to date. make[4]: `ecrtn.o' is up to date. make[4]: `ncrti.o' is up to date. make[4]: `ncrtn.o' is up to date. make[4]: `crtsavres.o' is up to date. make[4]: Leaving directory `/var/tmp/portage/gcc-4.1.0/work/build/gcc' ./xgcc -B./ -B/usr/powerpc64-unknown-linux-gnu/bin/ -isystem /usr/powerpc64-unknown-linux-gnu/include -isystem /usr/powerpc64-unknown-linux-gnu/sys-include -L/var/tmp/portage/gcc-4.1.0/work/build/gcc/../ld -O2 -O2 -O2 -pipe -mtune=power3 -mcpu=power3 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fPIC -specs=ldblspecs -mno-minimal-toc -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -I. -I. -I/var/tmp/portage/gcc-4.1.0/work/gcc-4.1.0/gcc -I/var/tmp/portage/gcc-4.1.0/work/gcc-4.1.0/gcc/. -I/var/tmp/portage/gcc-4.1.0/work/gcc-4.1.0/gcc/../include -I/var/tmp/portage/gcc-4.1.0/work/gcc-4.1.0/gcc/../libcpp/include -fPIC -mstrict-align -DL_muldi3 -c /var/tmp/portage/gcc-4.1.0/work/gcc-4.1.0/gcc/libgcc2.c -o libgcc/./_muldi3.o /var/tmp/portage/gcc-4.1.0/work/gcc-4.1.0/gcc/libgcc2.c:520: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://bugs.gentoo.org/> for instructions. Preprocessed source stored into /var/tmp/portage/gcc-4.1.0/temp/cc5bgxoP.out file, please attach this to your bugreport. make[3]: *** [libgcc/./_muldi3.o] Error 1 make[3]: Leaving directory `/var/tmp/portage/gcc-4.1.0/work/build/gcc' make[2]: *** [stmp-multilib] Error 2 make[2]: Leaving directory `/var/tmp/portage/gcc-4.1.0/work/build/gcc' make[1]: *** [stageprofile_build] Error 2 make[1]: Leaving directory `/var/tmp/portage/gcc-4.1.0/work/build/gcc' make: *** [profiledbootstrap] Error 2 !!! ERROR: sys-devel/gcc-4.1.0 failed. !!! Function gcc_do_make, Line 1361, Exitcode 2 !!! emake failed with profiledbootstrap !!! If you need support, post the topmost build error, NOT this status message. $ emerge --info Portage 2.0.54 (default-linux/ppc/ppc64/2006.0/64bit-userland/power3, gcc-3.4.5, glibc-2.3.4.20041102-r2, 2.6.15-gentoo-r7 ppc64) ================================================================= System uname: 2.6.15-gentoo-r7 ppc64 POWER3 (630+) Gentoo Base System version 1.6.14 dev-lang/python: 2.4.2 sys-apps/sandbox: 1.2.12 sys-devel/autoconf: 2.13, 2.59-r7 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1 sys-devel/binutils: 2.16.1 sys-devel/libtool: 1.5.22 virtual/os-headers: 2.6.11-r2 ACCEPT_KEYWORDS="ppc64" AUTOCLEAN="yes" CBUILD="powerpc64-unknown-linux-gnu" CFLAGS="-O2 -pipe -mtune=power3 -mcpu=power3" CHOST="powerpc64-unknown-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-O2 -pipe -mtune=power3 -mcpu=power3" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig distlocks sandbox sfperms strict" GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="ppc64 alsa apache2 apm arts berkdb bitmap-fonts bzip2 cli ctype cups curl dba dri eds emboss encode esd expat fastbuild foomaticdb force-cgi-redirect fortran ftp gd gdbm gif gmp gnome gnutls gpm gstreamer gtk2 ibm imlib ipv6 jpeg kde libg++ libwww mad memlimit mikmod motif mp3 mpeg ncurses nls nptl nptlonly ogg opengl oss pam pcre pdflib perl png posix python qt quicktime readline sdl session simplexml soap sockets spell spl ssl tcpd tokenizer truetype truetype-fonts type1-fonts udev unicode vorbis webdav xml xmms xsl xv zlib userland_GNU kernel_linux elibc_glibc" Unset: ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, MAKEOPTS, PORTDIR_OVERLAY
Created attachment 82663 [details] cc5bgxoP.out
CFLAGS="-O2 -pipe" and it builds fine. should we filter out CFLAGS="-mtune=power3 -mcpu=power3"?
should I report this upstream?
Created attachment 83447 [details, diff] gcc-4.1.0.ebuild.diff how about this?
gcc shouldnt ICE filtering flags ignores the problem
Did you try building a vanilla tarball? I'll look into this and see if I can track down a fix, or get a bug submitted upstream with the testcase if there is none.
would USE="vanilla" emerge =gcc-4.1.0 do it?
ok. I did it by hand: $ mkdir gcc-4.1.0-temp $ cd gcc-4.1.0-temp/ $ tar xfj /usr/portage/distfiles/gcc-4.1.0.tar.bz2 $ mkdir build $ cd build/ $ ../gcc-4.1.0/configure --prefix=/usr --bindir=/usr/powerpc64-unknown-linux-gnu/gcc-bin/4.1.0 --includedir=/usr/lib/gcc/powerpc64-unknown-linux-gnu/4.1.0/include --datadir=/usr/share/gcc-data/powerpc64-unknown-linux-gnu/4.1.0 --mandir=/usr/share/gcc-data/powerpc64-unknown-linux-gnu/4.1.0/man --infodir=/usr/share/gcc-data/powerpc64-unknown-linux-gnu/4.1.0/info --with-gxx-include-dir=/usr/lib/gcc/powerpc64-unknown-linux-gnu/4.1.0/include/g++-v4 --host=powerpc64-unknown-linux-gnu --build=powerpc64-unknown-linux-gnu --disable-altivec --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --disable-libunwind-exceptions --disable-multilib --disable-libmudflap --disable-libssp --disable-libgcj --enable-languages=c,c++,fortran --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu [...] $ make LDFLAGS="" STAGE1_CFLAGS="-O" LIBPATH="/usr/lib/gcc/powerpc64-unknown-linux-gnu/4.1.0" BOOT_CFLAGS="-m64 -O2 -pipe -mtune=power3 -mcpu=power3" profiledbootstrap [...] make[4]: Entering directory `/root/gcc-4.1.0-temp/build/gcc' make[4]: `crtend.o' is up to date. make[4]: `crtbeginS.o' is up to date. make[4]: `crtendS.o' is up to date. make[4]: `crtbeginT.o' is up to date. make[4]: `ecrti.o' is up to date. make[4]: `ecrtn.o' is up to date. make[4]: `ncrti.o' is up to date. make[4]: `ncrtn.o' is up to date. make[4]: `crtsavres.o' is up to date. make[4]: Leaving directory `/root/gcc-4.1.0-temp/build/gcc' ./xgcc -B./ -B/usr/powerpc64-unknown-linux-gnu/bin/ -isystem /usr/powerpc64-unknown-linux-gnu/include -isystem /usr/powerpc64-unknown-linux-gnu/sys-include -L/root/gcc-4.1.0-temp/build/gcc/../ld -O2 -O2 -O2 -pipe -mtune=power3 -mcpu=power3 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fPIC -specs=ldblspecs -mno-minimal-toc -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -I. -I. -I../../gcc-4.1.0/gcc -I../../gcc-4.1.0/gcc/. -I../../gcc-4.1.0/gcc/../include -I../../gcc-4.1.0/gcc/../libcpp/include -fPIC -mstrict-align -DL_muldi3 -c ../../gcc-4.1.0/gcc/libgcc2.c -o libgcc/./_muldi3.o {standard input}: Assembler messages: {standard input}:85: Warning: Unary operator - ignored because bad operand follows {standard input}:85: Warning: zero assumed for missing expression {standard input}:86: Error: Unrecognized opcode: `m' {standard input}:96: Error: Unrecognized opcode: `m' {standard input}:1199: Error: unassigned file number 2 make[3]: *** [libgcc/./_muldi3.o] Error 1 make[3]: Leaving directory `/root/gcc-4.1.0-temp/build/gcc' make[2]: *** [stmp-multilib] Error 2 make[2]: Leaving directory `/root/gcc-4.1.0-temp/build/gcc' make[1]: *** [stageprofile_build] Error 2 make[1]: Leaving directory `/root/gcc-4.1.0-temp/build/gcc' make: *** [profiledbootstrap] Error 2 So... unless it is not a bug in the way gentoo is building gcc the bug the bug is in gcc, is it? (because I didn't patched anything)
oh... I just saw that the message actualy isn't the same, but the error happens at the same file. Sorry.. what does this mean?
Can you try 4.1.1 for me?
same result with gcc-4.1.1
report this bug upstream?
If you have a reduced testcase and such, sure. I'm going to hopefully have time to get to this in the next few days. I've been pretty busy with my new job.
(In reply to comment #5) > gcc shouldnt ICE > > filtering flags ignores the problem > According to my tests gcc 4.2 builds fine with those CFLAGS/BOOT_CFLAGS. Would this be a reson for filtering them out in 4.1.1? I mean, it is fixed in next major release. if the upstream bug will resolve the issue in 4.1 series then we can still remove that filter. Sounds reasonable?
sys-devel/gcc-4.2.0_alpha20060902 merges just fine. can I add the ebuild hack (CFLAGS filter) to gcc-4.1?
does the 4.1.2 snaps work ? if not, then this can be reported upstream
-mtune=power3 -mcpu=power3 is the problem here. (least for gcc 4.1.1 which I've marked stable) It's not a great work around but it at least gets us moving forward. I've captured the mtune and mcpu problem and forwarded it off to a gcc maintainer friend of mine. We'll see if he comes back with anything. I'm going to mark this one as an upstream resolution given the 4.2 information.
stick a fork in it