Forum: GHDL Help: compiling for 32-bit SPARC V8 instead of V8+ or V9

Posted by Sanjay Singh (Guest)
on 2008-09-29 08:57
(Received via mailing list)
Hello...

I know most people on the list are Linux people, but I need a little 
help
with fine tuning the compiler flags.

What I want to do is make sure the binaries of GHDL will run on the 
widest
possible range of 32-bit SPARC hardware, which should also run just fine
on 64-bit UltraSPARC hardware too, but I am having problems with forcing
the binaries to be of the right type.


Please see below:

bash-3.1$ file /opt/gcc-4.1.2/bin/ghdl
/opt/gcc-4.1.2/bin/ghdl:        ELF 32-bit MSB executable SPARC32PLUS
Version 1, V8+ Required, UltraSPARC1 Extensions Required, dynamically
linked, not stripped


This is what I WANT to see:

bash-3.1$ file /bin/ls
/bin/ls:        ELF 32-bit MSB executable SPARC Version 1, dynamically
linked, stripped


My compiler flags:

bash-3.1$ echo $CFLAGS
-O2 -mcpu=v8 -mtune=v8 -m32 -pthreads

===

This set of flags does work ... -O3 fails during the bootstrap. And I
don't know which is the best mtune flag to use for the most generic 
SPARC
V8 implementation, so I just used the same as -mcpu ...  -m32 forces it 
to
32-bit, and -pthreads enables posix threading, which I believe is a
Solaris default.

===

If anyone can offer me advice about fine tuning the 32-bit binary I 
would
appreciate it. I could just tar up what I have and upload it, but if I 
am
correct, the binary will only run on an UltraSPARC-1 (ie. Sun Ultra 1
workstation)  processor and higher, which is not what I want. I want 
GHDL
to run on Solaris 2.6 starting with the SuperSPARC or TurboSPARC or
HyperSPARC which powered Sun hardware prior to the introduction of the
Ultra workstation line.

This will ensure that anyone with older hardware will still be able to 
run
GHDL without any problems, as well as compile GHDL with the existing
distribution because it includes language support for C, C++, ada, and
VHDL (ie. GHDL) ... for smaller sized projects this should enable more
people to run GHDL and thereby increase its popularity.

I will see about highly optimized 64-bit binaries after this version is 
up
and available.

Thank you.

S.
Posted by Tristan Gingold (Guest)
on 2008-09-29 21:03
(Received via mailing list)
On Mon, Sep 29, 2008 at 02:54:09AM -0400, Sanjay Singh wrote:
> 
> Hello...
> 
> I know most people on the list are Linux people, but I need a little help
> with fine tuning the compiler flags.
> 
> What I want to do is make sure the binaries of GHDL will run on the widest
> possible range of 32-bit SPARC hardware, which should also run just fine
> on 64-bit UltraSPARC hardware too, but I am having problems with forcing
> the binaries to be of the right type.

Hi,

you must be sure you have build an Ada compiler that target v8.  Adding
-mcpu=v8 is not enough as there is only one version of the Ada run time.

Tristan.
This topic is locked and can not be replied to.