[TriLUG] Linux on Sparc

Tom Bryan tbryan at python.net
Tue Mar 12 11:45:57 EST 2002


On Tuesday 12 March 2002 09:26 pm, M. Mueller (bhu5nji) wrote:

> I do have endian sensitivity.  I've dealt with it crudely so far (Intel
> specific implementation with a comment in the code pointing out the
> shortcoming).

Heh.  If you have a small number of sources/inputs and sinks/outputs for your 
data, then it usually isn't too difficult to call a function just after data 
enters your system and just before it leaves to normalize byte order.  On 
Intel, the implementation of this function(s) is #defined to simply return 
the inputs.  On Sparc, you byte swap.  

If you're Linux on both platforms, then you're in pretty good shape.  If 
you're Solaris on Sparc with Sun's compiler/libraries, then you'll need to 
look at man pages for compilers and system calls.  Depending on the switches 
to GCC and Sun's compiler, the behavior of some of the system calls is 
slightly different.  

By the way, you may also want to make sure you're doing something 
(pre-processor magic if necessary) to specify int4, int8, etc.  You never 
know when someone will want a 64-bit application for Sparc. :-)

I hit all three of these issues going the *other* way.  I ported Solaris app 
at work to Linux so that we could demo it easier: IBM Thinkpad + Linux + 
Oracle + application.  

Good luck,
---Tom



More information about the TriLUG mailing list