Subject: Re: cross-compiler for sparc64
To: None <>
From: ali (Anders Lindgren) <>
List: port-sparc64
Date: 08/18/2000 02:30:47
Bringing up an ancient subject...
(again, sorry if this isn't directly sparc64-related, but I'm
running out of places to look).

On Mon, 10 Jul 2000, David O'Brien wrote:

> On Mon, Jul 10, 2000 at 01:08:46PM -0700, Eduardo Horvath wrote:
      [ I wrote ]
> > > I'm trying to build a cross-gcc that is able to build
> > > 64bit Sparc v9 ELF binaries on SUN UltraSparc running Slowaris 2.7
> > > in 32bit mode. I am trying to build it with gcc 2.8.1
> > 
> > I would recommend using gcc 2.9.5.  sparc64 support in pre-egcs versions
>                              ^^^^^^
> 2.95.2.

Right. I'm still on it, with 2.95.2. Since there's obviously a working
port-sparc64 I assume there's some way of abusing gcc into producing
64bit binaries. :-) I first configured and built 64bit binutils without
any problems (with --program-suffix=64). Then I did the following:

$ export PATH=/where/my/binutils/are:${PATH}
$ export LD_LIBRARY_PATH=/where/my/libs/go/lib:${LD_LIBRARY_PATH}
$ export AR=`which ar64`
$ export RANLIB=`which ranlib64`
$ export LD=`which ld64`
$ export CFLAGS="-mpcu=ultrasparc -O2"

When trying to build on..

$ uname -a
SunOS orff-6 5.7 Generic_106541-11 sun4u sparc SUNW,Ultra-5_10

..I occassionally get to the point where I get an "xgcc" binary which
fails the test-suite on floating-point tests. Tonight I've been at it
again, but the gcc build fails with the message:

$ uname -a
SunOS roman 5.7 Generic_106541-07 sun4m sparc SUNW,SPARCstation-5
$ gmake

<lotsajunk here>

gcc -DCROSS_COMPILE -DIN_GCC -DHAIFA  -DSVR4  -mcpu=ultrasparc -O2
-DHAVE_CONFIG_H  -o gencheck \
 gencheck.o ` case "obstack.o" in ?*) echo obstack.o ;; esac ` ` case
"alloca.o" in ?*) echo alloca.o ;; esac ` ` case "" in ?*) echo  ;; esac `
` case "" in ?*) echo  ;; esac ` ` case "" in ?*) echo  ;; esac ` 
./gencheck > tmp-check.h
./gencheck: syntax error at line 1: `(' unexpected
gmake[1]: *** [s-check] Error 2
gmake[1]: Leaving directory
gmake: *** [all-gcc] Error 2

..and that's about it. "gencheck" is some ELF-object that won't
execute in the shell...

So, it seems building works better if I do it on an UltraSparc
(albeit running a 32bit kernel w/ 32bit tools) than cross-building
on a Sparc5 (using the exact same tools).

I'm not sure how to continue from here. Are there any NetBSD
patches I could apply without patching it out of working
on Solaris? (I will be doing development on a Solaris box on
which I have no possibility to install NetBSD)

Any ideas appreciated.

/ali: Computer Science Major and aspiring cartoonist. :-) 
(dept) -
(home) -
* A4000/040-40/CV3D/Ariadne·AmigaOS·NetBSD·A3000/040-25/Ariadne *