Subject: Re: cross-compiler for sparc64
To: ali (Anders Lindgren) <dat94ali@ludat.lth.se>
From: Eduardo Horvath <eeh@turbolinux.com>
List: port-sparc64
Date: 07/10/2000 13:08:46
On Mon, 10 Jul 2000, ali (Anders Lindgren) wrote:

> After browsing through the mailing-list archives I recently
> joined port-sparc64, maybe someone here can help (sorry if
> this is not directly related to port-sparc64.. :/ ):
> 
> 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
of gcc quite poor.

> I am working on a low-level project on an Ultra1 (well, 
> at the moment on a U10 in fact...). So far I am not having
> much luck, and the cross-gcc FAQ didn't do me much good. Basically
> all goes well until the xgcc binary is going through the testsuite
> at which point it barfs on some assembly-code it has generated
> (floatconv.c, illegal operand or somesuch). Since people are
> actually getting port-sparc64 up and running, I assume someone
> might have succeeded? 

You also need to be certain that your assembler groks SPARC V9
instructions and that gcc enables that support.  The kernel makefile
has an argument that makes gcc enable V9 support in gas.  You may be able
to get by with the Solaris assembler and linker, but it would be easier if
you installed GNU binutils(2.9.1+patch).

N.B. the in-tree toolchain should be good enough to build kernels if you
can figure out how to get it on to Solaris.

> I have been trying this using a 32bit gcc-2.8.1 (and briefly with
> an egcs-2.91.60). To further(?) complicate things, I am trying
> to build one without building glibc. I have heard this tends to
> complicate things (althought there not existing a sparc64-elf
> glibc target, it should be good in my case. :-) ).

You do not want glibc at all.  Kernels do not require an external
libraries, and NetBSD userland programs depend on certain unique features
of the NetBSD libc.

> Is it worth the hassle, or should I settle for the 64bit-capable
> SUN cc? (I prefer gcc, and hrrm could I get into license issues
> using SUN cc for free software?)

The SunPRO compilers are unlikely to work, especially for the kernel.  The
kernel header files are full of gcc-isms like in-line assembly.  OTOH, I
would consider getting the kernel to build with the SunPRO compilers A
Good Thing, considering the disasterous state of gcc and g++ on V9 code.


Eduardo Horvath