Bug 37799 - SEGV compiling ada/ada.ads in stage2
Summary: SEGV compiling ada/ada.ads in stage2
Status: RESOLVED WORKSFORME
Alias: None
Product: gcc
Classification: Unclassified
Component: ada (show other bugs)
Version: 4.4.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-10 16:10 UTC by Rainer Orth
Modified: 2008-12-03 17:42 UTC (History)
2 users (show)

See Also:
Host: sparc64-sun-solaris2.11
Target: sparc64-sun-solaris2.11
Build: sparc64-sun-solaris2.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 Rainer Orth 2008-10-10 16:10:30 UTC
Current mainline as of 20081002 fails to bootstrap on sparcv9-sun-solaris2.11:

/vol/gccsrc/obj/gcc-4.4.0-20081002/11-gcc-v9/./prev-gcc/xgcc -B/vol/gccsrc/obj/gcc-4.4.0-20081002/11-gcc-v9/./prev-gcc/ -B/vol/gcc/sparcv9-sun-solaris2.11/bin/ -c -g -O2  -gnatpg -gnata -nostdinc -I- -I. -Iada -I/vol/gcc/src/gcc-hg/gcc/ada -I/vol/gcc/src/gcc-hg/gcc/ada/gcc-interface /vol/gcc/src/gcc-hg/gcc/ada/ada.ads -o ada/ada.o
+===========================GNAT BUG DETECTED==============================+
| 4.4.0 20081002 (experimental) (sparcv9-sun-solaris2.11) Program_Error SIGBUS|
| Error detected at system.ads:1:1                                         |
| Please submit a bug report; see http://gcc.gnu.org/bugs.html.            |
| Use a subject line meaningful to you and us to track the bug.            |
| Include the entire contents of this bug box in the report.               |
| Include the exact gcc or gnatmake command that you entered.              |
| Also include sources listed below in gnatchop format                     |
| (concatenated together with no headers between files).                   |
+==========================================================================+
make[3]: *** [ada/ada.o] Error 1

Running gnat1 under gdb reveals:

(gdb) run -I- -I. -Iada -I/vol/gcc/src/gcc-hg/gcc/ada -I/vol/gcc/src/gcc-hg/gcc/ada/gcc-interface -quiet -nostdinc -dumpbase ada.ads -O2 -g -gnatpg -gnata -mcpu=v9 -gnatO ada/ada.o /vol/gcc/src/gcc-hg/gcc/ada/ada.ads
Starting program: /vol/gccsrc/obj/gcc-4.4.0-20081002/11-gcc-v9/gcc/gnat1 -I- -I. -Iada -I/vol/gcc/src/gcc-hg/gcc/ada -I/vol/gcc/src/gcc-hg/gcc/ada/gcc-interface -quiet -nostdinc -dumpbase ada.ads -O2 -g -gnatpg -gnata -mcpu=v9 -gnatO ada/ada.o /vol/gcc/src/gcc-hg/gcc/ada/ada.ads
warning: Temporarily disabling breakpoints for unloaded shared library "/usr/lib/sparcv9/ld.so.1"

Program received signal SIGSEGV, Segmentation fault.
0x0000000100866de8 in targparm.get_target_parameters (system_text=0x1021454a0, source_first=0, source_last=9005) at /vol/gcc/src/gcc-hg/gcc/ada/targparm.adb:253
Current language:  auto; currently ada
(gdb) where
#0  0x0000000100866de8 in targparm.get_target_parameters (system_text=0x1021454a0, source_first=0, source_last=9005) at /vol/gcc/src/gcc-hg/gcc/ada/targparm.adb:253
#1  0x000000010089980c in gnat1drv () at /vol/gcc/src/gcc-hg/gcc/ada/gnat1drv.adb:318
#2  0x000000010023d1e8 in gnat_parse_file (set_yydebug=0) at /vol/gcc/src/gcc-hg/gcc/ada/gcc-interface/misc.c:208
#3  0x0000000100eff9d8 in compile_file () at /vol/gcc/src/gcc-hg/gcc/toplev.c:968
#4  0x0000000100f043ec in do_compile () at /vol/gcc/src/gcc-hg/gcc/toplev.c:2190
#5  0x0000000100f044c8 in toplev_main (argc=18, argv=0xffffffff7ffff438) at /vol/gcc/src/gcc-hg/gcc/toplev.c:2222
#6  0x000000010089b584 in main (argc=18, argv=0xffffffff7ffff438) at /vol/gcc/src/gcc-hg/gcc/main.c:35
Comment 1 Eric Botcazou 2008-10-11 20:56:16 UTC
This works for me with GCC 4.4.0 20081011 + GAS 2.18.92 + Sun ld on Solaris 9.
Comment 2 Eric Botcazou 2008-10-12 19:47:10 UTC
> This works for me with GCC 4.4.0 20081011 + GAS 2.18.92 + Sun ld on Solaris 9.

(botcazou@nile) ~ $ gcc -v
Using built-in specs.
Target: sparc64-sun-solaris2.9
Configured with: /nile.build/botcazou/gcc-head/src/configure --build=sparc64-sun-solaris2.9 --prefix=/nile.build/botcazou/gcc-head/install_sparc64 --with-as=/nile.build/botcazou/gcc-head/install_sparc64/bin/as --with-gmp=/nile.build/botcazou/gcc-head/install_sparc64 --with-gmp-lib=/nile.build/botcazou/gcc-head/install_sparc64/lib/sparcv9 --with-mpfr=/nile.build/botcazou/gcc-head/install_sparc64 --with-mpfr-lib=/nile.build/botcazou/gcc-head/install_sparc64/lib/sparcv9 --enable-languages=c,ada --disable-nls
Thread model: posix
gcc version 4.4.0 20081011 for GNAT Pro 6.2.0w (20081010) (GCC)
(botcazou@nile) ~ $ gnatmake -f -q ma
(botcazou@nile) ~ $ file ma
ma:             ELF 64-bit MSB executable SPARCV9 Version 1, dynamically linked, not stripped
(botcazou@nile) ~ $ gnatmake -f -q ma -m32 --RTS=sparcv7
(botcazou@nile) ~ $ file ma
ma:             ELF 32-bit MSB executable SPARC Version 1, dynamically linked, not stripped
Comment 3 Eric Botcazou 2008-11-30 09:27:44 UTC
Works for me on Solaris 10 as well.
Comment 4 Rainer Orth 2008-12-02 21:38:00 UTC
Subject: Re:  SEGV compiling ada/ada.ads in stage2

ebotcazou at gcc dot gnu dot org writes:

> Works for me on Solaris 10 as well.

I've just tried again on current mainline (trunk revision 142371) on
Solaris 11 (snv_103), both with Sun as and GNU as 2.19, and get the same
error in both cases.

The compilers were configured as follows:

Target: sparc-sun-solaris2.11
Configured with: /vol/gcc/src/gcc-dist/configure CC=/vol/gcc/obj/gcc-4.4.0-20081202/11-gcc-v9/gccv9 --with-gmp-include=/vol/gcc/obj/gmp-4.2.1-v9 --with-gmp-lib=/vol/gcc/obj/gmp-4.2.1-v9/.libs --with-mpfr-include=/vol/gcc/obj/mpfr-2.3.2-v9 --with-mpfr-lib=/vol/gcc/obj/mpfr-2.3.2-v9/.libs --with-gnu-as --with-as=/vol/gcc/lib/gas-2.19 --enable-languages=c,ada --prefix=/vol/gcc --with-local-prefix=/vol/gcc --disable-nls
Thread model: posix
gcc version 4.4.0 20081202 (experimental) [trunk revision 142371] (GCC) 

resp.

Target: sparc-sun-solaris2.11
Configured with: /vol/gcc/src/gcc-dist/configure CC=/vol/gcc/obj/gcc-4.4.0-20081202/11-gcc-v9/gccv9 --with-gmp-include=/vol/gcc/obj/gmp-4.2.1-v9 --with-gmp-lib=/vol/gcc/obj/gmp-4.2.1-v9/.libs --with-mpfr-include=/vol/gcc/obj/mpfr-2.3.2-v9 --with-mpfr-lib=/vol/gcc/obj/mpfr-2.3.2-v9/.libs --enable-languages=c,ada --prefix=/vol/gcc --with-local-prefix=/vol/gcc --disable-nls
Thread model: posix
gcc version 4.4.0 20081202 (experimental) [trunk revision 142371] (GCC) 

I'm currently running bootstraps on Solaris 10 (both with Sun as and GNU as
2.19) to verify if this makes a difference.

	Rainer
Comment 5 Rainer Orth 2008-12-02 21:39:33 UTC
Still crashes for me.
Comment 6 Rainer Orth 2008-12-02 22:28:50 UTC
Subject: Re:  SEGV compiling ada/ada.ads in stage2

ro at techfak dot uni-bielefeld dot de writes:

> I'm currently running bootstraps on Solaris 10 (both with Sun as and GNU as
> 2.19) to verify if this makes a difference.

It doesn't: I get exactly the same error.

	Rainer
Comment 7 Eric Botcazou 2008-12-03 08:58:24 UTC
> The compilers were configured as follows:
> 
> Target: sparc-sun-solaris2.11
> Configured with: /vol/gcc/src/gcc-dist/configure
> CC=/vol/gcc/obj/gcc-4.4.0-20081202/11-gcc-v9/gccv9
> --with-gmp-include=/vol/gcc/obj/gmp-4.2.1-v9
> --with-gmp-lib=/vol/gcc/obj/gmp-4.2.1-v9/.libs
> --with-mpfr-include=/vol/gcc/obj/mpfr-2.3.2-v9
> --with-mpfr-lib=/vol/gcc/obj/mpfr-2.3.2-v9/.libs --with-gnu-as
> --with-as=/vol/gcc/lib/gas-2.19 --enable-languages=c,ada --prefix=/vol/gcc
> --with-local-prefix=/vol/gcc --disable-nls
> Thread model: posix
> gcc version 4.4.0 20081202 (experimental) [trunk revision 142371] (GCC) 
> 
> resp.
> 
> Target: sparc-sun-solaris2.11
> Configured with: /vol/gcc/src/gcc-dist/configure
> CC=/vol/gcc/obj/gcc-4.4.0-20081202/11-gcc-v9/gccv9
> --with-gmp-include=/vol/gcc/obj/gmp-4.2.1-v9
> --with-gmp-lib=/vol/gcc/obj/gmp-4.2.1-v9/.libs
> --with-mpfr-include=/vol/gcc/obj/mpfr-2.3.2-v9
> --with-mpfr-lib=/vol/gcc/obj/mpfr-2.3.2-v9/.libs --enable-languages=c,ada
> --prefix=/vol/gcc --with-local-prefix=/vol/gcc --disable-nls
> Thread model: posix
> gcc version 4.4.0 20081202 (experimental) [trunk revision 142371] (GCC) 

But these are not 64-bit compilers, see the target triplet.  You need to pass
--build=sparc64-sun-solaris2.11 and start with a 64-bit compiler.
Comment 8 Rainer Orth 2008-12-03 14:31:49 UTC
Subject: Re:  SEGV compiling ada/ada.ads in stage2

ebotcazou at gcc dot gnu dot org writes:

> But these are not 64-bit compilers, see the target triplet.  You need to pass
> --build=sparc64-sun-solaris2.11 and start with a 64-bit compiler.

I fear you're right: it occured to me that the GCC 3.4.3 I started with
didn't have proper multilib support.  I had started with gcc3.4.3 -m64
(which would have been a 64-bit compiler), but forgot to specify the
correct target triplet, though I'm pretty sure I did so when I first
reported the bug.

I've now used a 32-bit gcc 4.4.0 with -m64 as bootstrap compiler and
specified --build=sparcv9-sun-solaris2.10.  This time, the bootstrap
finished, so this has been pilot error ;-(

	Rainer
Comment 9 Eric Botcazou 2008-12-03 17:42:59 UTC
> I've now used a 32-bit gcc 4.4.0 with -m64 as bootstrap compiler and
> specified --build=sparcv9-sun-solaris2.10.  This time, the bootstrap
> finished, so this has been pilot error ;-(

Thanks for investigating on your side.