Bug 25740 - Bus Error compiling gcc/config/sparc/sol2-c1.asm
Summary: Bus Error compiling gcc/config/sparc/sol2-c1.asm
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: bootstrap (show other bugs)
Version: 3.4.5
: P3 major
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-10 15:37 UTC by Darren Holloway
Modified: 2006-01-12 15:47 UTC (History)
2 users (show)

See Also:
Host: sparc-sun-solaris2.10
Target: sparc-sun-solaris2.10
Build: sparc-sun-solaris2.10
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 Darren Holloway 2006-01-10 15:37:43 UTC
Building GCC 3.4.5 on Solaris 2.10

Configure line: configure --prefix=/usr/local --enable-languages=c,c++

Directory: gcc-3.4.5/build/gcc

Triggering line:
/opt/apps/src/gcc-3.4.5/build/gcc/xgcc -B/opt/apps/src/gcc-3.4.5/build/gcc/ -B/usr/local/sparc-sun-solaris2.10/bin/ -B/usr/local/sparc-sun-solaris2.10/lib/ -isystem /usr/local/sparc-sun-solaris2.10/include -isystem /usr/local/sparc-sun-solaris2.10/sys-include  -c -o crt1.o -x assembler-with-cpp ../../gcc/config/sparc/sol2-c1.asm

Compiler Output:
cc1: internal compiler error: Bus Error
Please submit a full bug report,
with preprocessed source if appropriate.

Preprocessed source:
None available from -save-temps
Comment 1 Eric Botcazou 2006-01-10 16:05:19 UTC
Please try again, GCC 3.4.5 is known to bootstrap fine on SPARC/Solaris 10.  If it's reproducible, post a backtrace at the crashpoint.
Comment 2 Darren Holloway 2006-01-10 16:12:40 UTC
Backtrace will take a few days - I'm on a deadline to get this system installed, so right now I'm compiling 3.4.4 and hoping it doesn't have the same bug.

Once the system's ready, I'll re-try compiling 3.4.5
Comment 3 Eric Botcazou 2006-01-10 16:58:05 UTC
> Backtrace will take a few days - I'm on a deadline to get this system
> installed, so right now I'm compiling 3.4.4 and hoping it doesn't have
> the same bug.

Well, unless proven otherwise, GCC 3.4.5 has no bug either.

hikaru% uname -a
SunOS hikaru 5.10 Generic sun4u sparc SUNW,Sun-Fire-V240
hikaru% gcc/xgcc -v
Using built-in specs.
Configured with: /home/eric/gcc-3.4.5/configure --prefix=/usr/local --enable-languages=c
Thread model: posix
gcc version 3.4.5

> Once the system's ready, I'll re-try compiling 3.4.5

Thanks.
Comment 4 Darren Holloway 2006-01-10 17:52:34 UTC
Well, 3.4.4 craps out on the same file, unable to malloc after exhausting the 8Gb swap space.

Note that the difference between your system and this one is I have "--enable-languages=c,c++".  I do have a running gcc 3.4.4 on the same system where I only had "--enable-languages=c"

-bash-3.00$ /usr/local/bin/gcc -v ## Running version
Reading specs from /usr/local/lib/gcc/sparcv9-sun-solaris2.10/3.4.4/specs
Configured with: ./configure --prefix=/usr/local --enable-languages=c sparcv9-sun-solaris2.10
Thread model: posix
gcc version 3.4.4

-bash-3.00$ uname -a
SunOS challenger 5.10 Generic_118822-20 sun4u sparc SUNW,Ultra-250

Line that dies:
/opt/apps/src/gcc-3.4.4/build/gcc/xgcc -B/opt/apps/src/gcc-3.4.4/build/gcc/ -B/usr/local/sparc-sun-solaris2.10/bin/ -B/usr/local/sparc-sun-solaris2.10/lib/ -isystem /usr/local/sparc-sun-solaris2.10/include -isystem /usr/local/sparc-sun-solaris2.10/sys-include  -c -o crt1.o -x assembler-with-cpp ../../gcc/config/sparc/sol2-c1.asm

cc1: out of memory allocating 134217728 bytes after a total of 9127182336 bytes
gmake[1]: *** [crt1.o] Error 1
gmake[1]: Leaving directory `/opt/apps/src/gcc-3.4.4/build/gcc'
gmake: *** [all-gcc] Error 2

I will try re-configuring this 3.4.4 with sparcv9-sun-solaris2.10 instead of sparc-sun-solaris and see if that makes a difference.
Comment 5 Eric Botcazou 2006-01-10 18:09:24 UTC
> Note that the difference between your system and this one is I have
> "--enable-languages=c,c++".

That doesn't matter here.

> I will try re-configuring this 3.4.4 with sparcv9-sun-solaris2.10 instead of
> sparc-sun-solaris and see if that makes a difference.

Of course, that makes a big difference!  sparc-sun-solaris2.9 is a 32-bit compiler while sparcv9-sun-solaris2.10 is a 64-bit compiler, you cannot compile one with the other, you need to specify either CC="gcc -m32" or CC="gcc -m64" at configure time.
Comment 6 Darren Holloway 2006-01-10 21:32:35 UTC
Well, I tried 'configure sparcv9-sun-solaris2.10' and it crashed on the same file

I tried 'CC="gcc -m64" configure sparcv9-sun-solaris2.10' and it still crashed on the same file.

I'm beginning to think I imagined ever compiling gcc on this box! :)
Comment 7 Eric Botcazou 2006-01-10 21:38:28 UTC
> I'm beginning to think I imagined ever compiling gcc on this box! :)

What happens if you bootstrap the sparc-sun-solaris2.10 compiler?

CC="gcc -m32" $(scrdir)/configure sparc-sun-solaris2.10 --prefix=...
gmake bootstrap
Comment 8 Eric Botcazou 2006-01-10 22:13:29 UTC
The 64-bit compiler:

hikaru% gcc/xgcc -v
Using built-in specs.
Configured with: /home/eric/gcc-3.4.5/configure sparc64-sun-solaris2.10 --prefix=/usr/local --enable-languages=c
Thread model: posix
gcc version 3.4.5
Comment 9 Eric Botcazou 2006-01-10 22:50:43 UTC
> The 64-bit compiler:

...under another name:

hikaru% gcc/xgcc -v
Using built-in specs.
Configured with: /home/eric/gcc-3.4.5/configure sparcv9-sun-solaris2.10 --prefix=/usr/local --enable-languages=c
Thread model: posix
gcc version 3.4.5
Comment 10 Darren Holloway 2006-01-12 15:30:11 UTC
Well, after about ten tries, I got it to all compile.

The magic required was:

1. Ensure bintools was in path before /usr/ccs/bin
2. Remove gnu ld from system
3. CFLAGS='-m64' configure --disable-multilib --enable-languages=c,c++ sparcv9-sun-solaris2.10
4. gmake

I disabled multilib because otherwise it tried to compile sparcv7 with 'xgcc ... -m32 -m64', requiring too many manual changes of config.status and resulting Makefile's

I guess my final point is that if configure sees that it's on Solaris 2.10 with a v9 processor, shouldn't it at least guess 'sparcv9-sun-solaris2.10' as the triplet instead of the generic 'sparc-sun-solaris', especially since I hadn't specified --host, --target or --build?

Comment 11 Eric Botcazou 2006-01-12 15:47:09 UTC
> The magic required was:
> 
> 1. Ensure bintools was in path before /usr/ccs/bin

What is bintools?

> 2. Remove gnu ld from system
> 3. CFLAGS='-m64' configure --disable-multilib --enable-languages=c,c++
> sparcv9-sun-solaris2.10

Setting CFLAGS on the configure line is a _recipe_for_disaster_, only CC should be set.

> I disabled multilib because otherwise it tried to compile sparcv7 with 'xgcc
> ... -m32 -m64', requiring too many manual changes of config.status and
> resulting Makefile's

!??? See above.

> I guess my final point is that if configure sees that it's on Solaris 2.10
> with a v9 processor, shouldn't it at least guess 'sparcv9-sun-solaris2.10'
> as the triplet instead of the generic 'sparc-sun-solaris', especially since I
> hadn't specified --host, --target or --build?

No, the canonical target triplet is always sparc-sun-solaris2.* on Solaris as the default architecture is V8.

I'm really puzzled by all this mess, you're the first one who reported that.