Bug 32894 - Segmentation fault bootstrapping on HP-UX 11.11
Summary: Segmentation fault bootstrapping on HP-UX 11.11
Status: RESOLVED WONTFIX
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.2.1
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-25 20:36 UTC by Paul A.
Modified: 2009-01-15 23:09 UTC (History)
4 users (show)

See Also:
Host: hppa64-hp-hpux11.11
Target: hppa64-hp-hpux11.11
Build: hppa64-hp-hpux11.11
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul A. 2007-07-25 20:36:38 UTC
There's no code to attach, as this failure is simply for a gcc-4.2.1 build, using binutils-2.17 and initiated with gcc-3.3.6; to be specific:
CC=gcc336 CFLAGS="-O2 -g -mpa-risc-2-0" /usr/local/src/gcc-4.2.1/configure \
--host=hppa64-hp-hpux11.11 --with-local-prefix=/usr/local/64bit \
--with-mpfr=/usr/local/64bit --with-gmp=/usr/local/64bit --with-gnu-as \
--with-as=/usr/local/64bit/hppa64-hp-hpux11.11/bin/as --with-gnu-ld \
--with-ld=/usr/local/64bit/hppa64-hp-hpux11.11/bin/ld --with-stabs \
--enable-languages=c,c++ --enable-shared --enable-threads=posix \
--enable-checking=yes --prefix=/usr/local/64bit

The tail end of my gnumake output follows.

/usr/local/src/64.obj/gcc-4.2.1/./gcc/xgcc -B/usr/local/src/64.obj/gcc-4.2.1/./gcc/ -B/usr/local/64bit/hppa64-hp-hpux11.11/bin/ -B/usr/local/64bit/hppa64-hp-hpux11.11/lib/ -isystem /usr/local/64bit/hppa64-hp-hpux11.11/include -isystem /usr/local/64bit/hppa64-hp-hpux11.11/sys-include -O2 -O2 -O2 -g -mpa-risc-2-0  -DIN_GCC    -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include  -I. -I. -I/usr/local/src/gcc-4.2.1/gcc -I/usr/local/src/gcc-4.2.1/gcc/. -I/usr/local/src/gcc-4.2.1/gcc/../include -I/usr/local/src/gcc-4.2.1/gcc/../libcpp/include -I/usr/local/64bit/include -I/usr/local/64bit/include -I/usr/local/src/gcc-4.2.1/gcc/../libdecnumber -I../libdecnumber  -g0 -finhibit-size-directive -fno-inline-functions -fno-exceptions -fno-zero-initialized-in-bss -fno-toplevel-reorder   \
  -c /usr/local/src/gcc-4.2.1/gcc/crtstuff.c -DCRT_BEGIN \
  -o crtbegin.o
xgcc: Internal error: Segmentation fault (program cc1)
Please submit a full bug report.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
gmake[3]: *** [crtbegin.o] Error 1
gmake[3]: Leaving directory `/opt/datetime/gcc-4.2.1/gcc'
gmake[2]: *** [all-stage1-gcc] Error 2
gmake[2]: Leaving directory `/opt/datetime/gcc-4.2.1'
gmake[1]: *** [stage1-bubble] Error 2
gmake[1]: Leaving directory `/opt/datetime/gcc-4.2.1'
gmake: *** [all] Error 2
Comment 1 John David Anglin 2007-07-31 16:30:45 UTC
Suggest using HP ld and GNU as.  This combination is tested regularly
and known to work.

You don't need to specify CFLAGS.  The assembler code generated for
all hppa64 targets is always PA 2.0w.
Comment 2 Paul A. 2007-08-08 17:10:46 UTC
I tried configuring for HP ld as you suggested, but that didn't make a difference.  However what seems to have done the trick was bootstrapping with HP's C compiler rather than gcc-3.3.6.  My gcc-3.3.6 has been configured to use GNU ld, and generally seems to work quite well except for this usage.
Comment 3 dave 2007-08-08 18:11:47 UTC
Subject: Re:  Segmentation fault bootstrapping on HP-UX 11.11

> ------- Comment #2 from pda at freeshell dot org  2007-08-08 17:10 -------
> I tried configuring for HP ld as you suggested, but that didn't make a
> difference.  However what seems to have done the trick was bootstrapping with
> HP's C compiler rather than gcc-3.3.6.  My gcc-3.3.6 has been configured to use
> GNU ld, and generally seems to work quite well except for this usage.

I assume that your gcc-3.3.6 was built configured to generate 64-bit
code and binaries.  gcc-3.3.6 -v will show how it was configured.
Can you provide this info?  This affects the behavior of configure.

If this shows a hppa64 target, then this is a native build and make
bootstrap should work.  Otherwise, you are trying to do a 32 to 64-bit
cross build.  It would be nice if make bootstrap worked in this
situation, but it's never tested.  I only test native builds.

In trying to reproduce your problem, I find that GNU ld is not going
to work with recent GCC version.  In particular, hidden support is
broken in shared libraries.  This causes a problem with the shared
version of libstdc++.  Also, GCC assumes gnu symbol versioning is
available if you use GNU ld.  This is not supported by the HP-UX
dynamic loader.  There is a configure option to turn symbol versioning
off.  However, configure should be fixed to turn it off on HP-UX
by default.  There's also another bug that you will hit if you
try to build fortran.  I tried to fix some of these problems last
week but it's tricky.

To make any progress on your bug, more information is needed.  We
need more details on your bootstrap compiler.  Then, could you rerun
the failing compilation adding "-v" to the command line that fails.
This will provide more details as to which gcc component failed.  If
you can, rerun the failing command under gdb, provide a backtrace,
a disassembly around the instruction that faults, and register
information for the registers in the faulting instruction.  This will
give a better idea as to what's happening.

Dave
Comment 4 Paul A. 2007-08-10 16:51:30 UTC
I'll get the other info you asked for a little later, but in the meantime here's my output from gcc-3.3.6 -v.  The as and ld referred to are binutils-2.17, and I believe I also tried with binutils-2.16.1.  I may not have yet tried binutils-2.16, which I thing is what my gcc-3.3.6 was originally configured for.  Perhaps that's really the problem?

Reading specs from /usr/local/64bit/lib/gcc-lib/hppa64-hp-hpux11.11/3.3.6/specs
Configured with: /usr/local/src/gcc-3.3.6/configure --host=hppa64-hp-hpux11.11 --enable-languages=c,c++ --enable-threads=posix --enable-shared --with-stabs --with-gnu-as --with-as=/usr/local/64bit/bin/as --with-gnu-ld --with-ld=/usr/local/64bit/bin/ld --disable-nls --prefix=/usr/local/64bit --prefix=/usr/local/64bit
Thread model: posix
gcc version 3.3.6
Comment 5 Paul A. 2007-09-07 20:52:49 UTC
Sorry for the long delay in replying, I've been on vacation.  I'm giving you the output from xgcc -v, but have been unable to trap the core dump with gdb.  I even spent some time writing a little program that did the cc1 invocations under gdb, but I never got this working completely correctly due to gdb seemingly forking a shell for its run command.  Or is it possible the .gdbinit file supplied for my object tree was causing some trouble?

As mentioned before, I'm able to bootstrap with HP's compiler, so if this information doesn't help you I'll just assume there's a problem with my gcc-3.3.6 (although it seems fine for most other purposes).

Without further ado:
gnumake[3]: Entering directory `/opt/datetime/gcc-4.2.1/gcc'
/usr/local/src/64.obj/gcc-4.2.1/./gcc/xgcc -B/usr/local/src/64.obj/gcc-4.2.1/./gcc/ -B/usr/local/64bit/hppa64-hp-hpux11.11/bin/ -B/usr/local/64bit/hppa64-hp-hpux11.11/lib/ -isystem /usr/local/64bit/hppa64-hp-hpux11.11/include -isystem /usr/local/64bit/hppa64-hp-hpux11.11/sys-include -v -O2 -O2 -g  -DIN_GCC    -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include  -I. -I. -I/usr/local/src/gcc-4.2.1/gcc -I/usr/local/src/gcc-4.2.1/gcc/. -I/usr/local/src/gcc-4.2.1/gcc/../include -I/usr/local/src/gcc-4.2.1/gcc/../libcpp/include -I/usr/local/64bit/include -I/usr/local/64bit/include -I/usr/local/src/gcc-4.2.1/gcc/../libdecnumber -I../libdecnumber  -g0 -finhibit-size-directive -fno-inline-functions -fno-exceptions -fno-zero-initialized-in-bss -fno-toplevel-reorder   \
  -c /usr/local/src/gcc-4.2.1/gcc/crtstuff.c -DCRT_BEGIN \
  -o crtbegin.o
Reading specs from /usr/local/src/64.obj/gcc-4.2.1/./gcc/specs
Target: hppa64-hp-hpux11.11
Configured with: /usr/local/src/gcc-4.2.1/configure --host=hppa64-hp-hpux11.11 --with-local-prefix=/usr/local/64bit --with-mpfr=/usr/local/64bit --with-gmp=/usr/local/64bit --with-gnu-as --with-as=/usr/local/64bit/hppa64-hp-hpux11.11/bin/as --without-gnu-ld --with-ld=/usr/ccs/bin/ld --with-stabs --enable-languages=c,c++ --enable-shared --enable-threads=posix --enable-checking=yes --prefix=/usr/local/64bit --prefix=/usr/local/64bit
Thread model: posix
gcc version 4.2.1
 /usr/local/src/64.obj/gcc-4.2.1/./gcc/cc1 -quiet -v -I. -I. -I/usr/local/src/gcc-4.2.1/gcc -I/usr/local/src/gcc-4.2.1/gcc/. -I/usr/local/src/gcc-4.2.1/gcc/../include -I/usr/local/src/gcc-4.2.1/gcc/../libcpp/include -I/usr/local/64bit/include -I/usr/local/64bit/include -I/usr/local/src/gcc-4.2.1/gcc/../libdecnumber -I../libdecnumber -iprefix /opt/datetime/gcc-4.2.1/gcc/../lib/gcc/hppa64-hp-hpux11.11/4.2.1/ -isystem /usr/local/src/64.obj/gcc-4.2.1/./gcc/include -DIN_GCC -DCRT_BEGIN -isystem /usr/local/64bit/hppa64-hp-hpux11.11/include -isystem /usr/local/64bit/hppa64-hp-hpux11.11/sys-include -isystem ./include /usr/local/src/gcc-4.2.1/gcc/crtstuff.c -quiet -dumpbase crtstuff.c -auxbase-strip crtbegin.o -g -g0 -O2 -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -version -finhibit-size-directive -fno-inline-functions -fno-exceptions -fno-zero-initialized-in-bss -fno-toplevel-reorder -o /var/tmp//ccag2aEs.s
xgcc: Internal error: Segmentation fault (program cc1)
Please submit a full bug report.
Comment 6 dave 2007-09-07 22:05:47 UTC
Subject: Re:  Segmentation fault bootstrapping on HP-UX 11.11

> As mentioned before, I'm able to bootstrap with HP's compiler, so if this
> information doesn't help you I'll just assume there's a problem with my
> gcc-3.3.6 (although it seems fine for most other purposes).

I think that's likely.  The way to confirm this is to bootstrap
just the C language with HP's compiler and install.  Then, do another
bootstrap using the newly built 4.2.1.  A segmentation fault this
early in the build process usually indicates some module has been
miscompiled by the bootstrap compiler.

I don't know how you built 3.3.6.  There were problems with some
gcc binaries distributed by HP.  3.3.6 should work as a bootstrap
compiler.  However, the 3.3 branch is closed and 3.3 problems won't
be fixed.

>  /usr/local/src/64.obj/gcc-4.2.1/./gcc/cc1 -quiet -v -I. -I.
> -I/usr/local/src/gcc-4.2.1/gcc -I/usr/local/src/gcc-4.2.1/gcc/.
> -I/usr/local/src/gcc-4.2.1/gcc/../include
> -I/usr/local/src/gcc-4.2.1/gcc/../libcpp/include -I/usr/local/64bit/include
> -I/usr/local/64bit/include -I/usr/local/src/gcc-4.2.1/gcc/../libdecnumber
> -I../libdecnumber -iprefix
> /opt/datetime/gcc-4.2.1/gcc/../lib/gcc/hppa64-hp-hpux11.11/4.2.1/ -isystem
> /usr/local/src/64.obj/gcc-4.2.1/./gcc/include -DIN_GCC -DCRT_BEGIN -isystem
> /usr/local/64bit/hppa64-hp-hpux11.11/include -isystem
> /usr/local/64bit/hppa64-hp-hpux11.11/sys-include -isystem ./include
> /usr/local/src/gcc-4.2.1/gcc/crtstuff.c -quiet -dumpbase crtstuff.c
> -auxbase-strip crtbegin.o -g -g0 -O2 -O2 -W -Wall -Wwrite-strings
> -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -version
> -finhibit-size-directive -fno-inline-functions -fno-exceptions
> -fno-zero-initialized-in-bss -fno-toplevel-reorder -o /var/tmp//ccag2aEs.s

Run cc1 under gdb.  Use the set args command to set the cc1's arguments
to the above list.  Then, run cc1.  This will duplicate the fault under gdb.

Dave
Comment 7 Steve Ellcey 2009-01-15 23:09:10 UTC
I think this should be closed as WONTFIX.  There may or may not be a 3.3.6 GCC bug that was causing a bootstrap failure but it isn't going to be fixed so we may as well close this defect.  If anyone objects they can reopen it.