Building 64 bit drivers, what compiler to use

Building 64 bit drivers, what compiler to use

Post by Steve We » Mon, 29 Oct 2001 00:37:55



I need to build 64 bit drivers for Solaris 8 Sparc. I have GCC 2.95.3
installed. Will GCC build a 64 bit driver? I looked in the GCC source
tree, but I could not find any documentation on GCC compiler flags. I
also have a Forte C 6 compiler that I have not installed. Does the
Forte C build 64 bit drivers?

Steve West

 
 
 

Building 64 bit drivers, what compiler to use

Post by Axel Neuman » Mon, 29 Oct 2001 01:09:29



> I need to build 64 bit drivers for Solaris 8 Sparc. I have GCC 2.95.3
> installed. Will GCC build a 64 bit driver? I looked in the GCC source
> tree, but I could not find any documentation on GCC compiler flags. I
> also have a Forte C 6 compiler that I have not installed. Does the
> Forte C build 64 bit drivers?

> Steve West


Hi,

GCC 3.x will produce 64-bit code maybe not in the way you will ned it. The
actual Forte Compiler will do it better.

HTH,

Axel Neumann

 
 
 

Building 64 bit drivers, what compiler to use

Post by Mark Mentova » Mon, 29 Oct 2001 02:25:21



> I need to build 64 bit drivers for Solaris 8 Sparc. I have GCC 2.95.3
> installed. Will GCC build a 64 bit driver? I looked in the GCC source
> tree, but I could not find any documentation on GCC compiler flags. I
> also have a Forte C 6 compiler that I have not installed. Does the
> Forte C build 64 bit drivers?

gcc 2.95.3 compiling for sparcv9 (64-bit) should do the trick.  gcc
3.0.1 can do it for sure.  I don't recall whether or not the sparcv9
support in 2.95.3 was "mature" enough, my gut feeling is that it wasn't.  
In either case, you need a compiler that generates sparcv9 code: either
a sparcv9 compiler, or a bi-arch compiler.  If you have the bi-arch
variant, you will need to specify "-m64" to request the 64-bit sparcv9
ABI.

You will also need to specify "-ffreestanding" which informs gcc that it
is building for a freestanding, rather than standard, environment.  The
compiler sometimes makes assumptions (especially with optimizations on)
that are not true in a freestanding environment.  For example, the
certain optimizations use standard C library functions that are not
available in the kernel.

And, for those of you that are curious, this will work even if gcc is
using the GNU binutils variants of as and ld instead of the Solaris
variants in /usr/ccs.

Mark