https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89494

            Bug ID: 89494
           Summary: Bootstrap error when using GCC 4.2.1
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: bootstrap
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pkubaj at anongoth dot pl
  Target Milestone: ---

I use FreeBSD on powerpc64 architecture, which has GCC 4.2.1 as a system
compiler.

It does support C++98 which, according to
https://gcc.gnu.org/install/prerequisites.html is enough to bootstrap GCC.

I can compile GCC 6.5 at most. GCC 7 and newer are broken. FreeBSD ports tree
has a work around for that to use newer GCC release from FreeBSD's ports, but
it means that to compile GCC 7 or newer, we need to compile 5 or 6.

Building GCC 9 fails with:
/usr/local/poudriere/ports/default/lang/gcc9-devel/work/.build/./gcc/xgcc
-B/usr/local/poudriere/ports/default/lang/gcc9-devel/work/.build/./gcc/ -xc
-nostdinc /dev/null -S -o /dev/null
-fself-test=/usr/local/poudriere/ports/default/lang/g
cc9-devel/work/gcc-9-20190217/gcc/testsuite/selftests
cc1: internal compiler error: Segmentation fault
no stack trace because unwind library not available


Building GCC 7 is more verbose:
/usr/local/poudriere/ports/default/lang/gcc7/work/.build/./gcc/xgcc
-B/usr/local/poudriere/ports/default/lang/gcc7/work/.build/./gcc/
-B/usr/local/powerpc64-portbld-freebsd12.0/bin/
-B/usr/local/powerpc64-portbld-freebsd12.0/lib/ -isystem
/usr/local/powerpc64-portbld-freebsd12.0/include -isystem
/usr/local/powerpc64-portbld-freebsd12.0/sys-include    -g -O2 -pipe
-DLIBICONV_PLUG -fno-strict-aliasing -m32 -fPIC -mstrict-align -O2  -g -O2
-pipe  -DLIBICONV_PLUG -fno-strict-aliasing  -DIN_GCC    -W -Wall
-Wwrite-strings -Wcast-qual -Wno-format -Wstrict-prototypes
-Wmissing-prototypes -Wold-style-definition  -isystem ./include   -fPIC
-pthread -mno-minimal-toc -g -DIN_LIBGCC2 -fbuilding-libgcc
-fno-stack-protector   -fPIC -pthread -mno-minimal-toc -I. -I. -I../../.././gcc
-I/usr/local/poudriere/ports/default/lang/gcc7/work/gcc-7.4.0/libgcc
-I/usr/local/poudriere/ports/default/lang/gcc7/work/gcc-7.4.0/libgcc/.
-I/usr/local/poudriere/ports/default/lang/gcc7/work/gcc-7.4.0/libgcc/../gcc
-I/usr/local/poudriere/ports/default/lang/gcc7/work/gcc-7.4.0/libgcc/../include
 -DHAVE_CC_TLS  -o _muldi3.o -MT _muldi3.o -MD -MP -MF _muldi3.dep -DL_muldi3
-c /usr/local/poudriere/ports/default/lang/gcc7/work/gcc-7.4.0/libgcc/libgcc2.c
-fvisibility=hidden -DHIDE_EXPORTS
In file included from
/usr/local/poudriere/ports/default/lang/gcc7/work/gcc-7.4.0/libgcc/libgcc2.c:56:0:
/usr/local/poudriere/ports/default/lang/gcc7/work/gcc-7.4.0/libgcc/libgcc2.c:
In function '__muldi3':
/usr/local/poudriere/ports/default/lang/gcc7/work/gcc-7.4.0/libgcc/libgcc2.h:219:20:
internal compiler error: Segmentation fault
 #define __NDW(a,b) __ ## a ## di ## b
                    ^
/usr/local/poudriere/ports/default/lang/gcc7/work/gcc-7.4.0/libgcc/libgcc2.h:273:18:
note: in expansion of macro '__NDW'
 #define __muldi3 __NDW(mul,3)
                  ^~~~~
/usr/local/poudriere/ports/default/lang/gcc7/work/gcc-7.4.0/libgcc/libgcc2.c:548:1:
note: in expansion of macro '__muldi3'
 __muldi3 (DWtype u, DWtype v)
 ^~~~~~~~
no stack trace because unwind library not available

Obviously, I'm not asking to fix GCC 4.2.1, but to make a workaround for newer
releases

Reply via email to