[gambit-list] Strange Gambit error problems DS

Marc Feeley feeley at iro.umontreal.ca
Tue Oct 24 07:37:40 EDT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 24-Oct-06, at 5:52 AM, Andrew Lentvorski wrote:

> Andrew Lentvorski wrote:
>> I'm wondering if this is some form of endianness/type size failure  
>> due
>> to the cross compile:
>
> It was indeed an endianness failure.

Can you explain how you fixed the problem?  The file include/gambit.h  
contains ifdefs to automatically figure out what the endianness is.   
In particular it contains:

#ifndef CPU_arm

#ifdef arm
#define ___CPU_arm
#else
#ifdef __arm
#define ___CPU_arm
#else
#ifdef __arm__
#define ___CPU_arm
#endif
#endif
#endif

#endif

#ifdef ___CPU_arm
#ifdef _LITTLE_ENDIAN
#define ___LITTLE_ENDIAN
#endif
#ifdef __LITTLE_ENDIAN__
#define ___LITTLE_ENDIAN
#endif
#ifdef __LITTLE_ENDIAN_DATA__
#define ___LITTLE_ENDIAN
#endif
#endif

The endianness (and word size) of the build and execution  
environments are completely unrelated.  The C code produced by the  
compiler can be compiled for an execution environment that is either  
big endian or little endian, and with 32 or 64 bit words.  However,  
if the processor is not recognized by gambit.h, it will assume the  
processor is big endian with 32 bit addressing.

Marc

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (Darwin)

iD8DBQFFPfsE//V9Zc2T/v4RAkrZAKC7f51QoJlEbMwnzSBvy4MlsqoVLwCfVRdg
k8bNe7vk/QgZJxmhEnGtIJQ=
=sAqB
-----END PGP SIGNATURE-----



More information about the Gambit-list mailing list