Need help compiling gpgme fat

David Shaw dshaw at jabberwocky.com
Sat Mar 11 20:47:52 CET 2006


On Sat, Mar 11, 2006 at 08:07:58PM +0100, Stéphane Corthésy wrote:

> >Here's how to do it - edit config.h.in (not config.h) and remove this:
> >
> >  /* Defined if the host has big endian byte ordering */
> >  #undef BIG_ENDIAN_HOST
> >
> >and this:
> >
> >  /* Defined if the host has little endian byte ordering */
> >  #undef LITTLE_ENDIAN_HOST
> >
> >Then add this:
> >
> >  #define BIG_ENDIAN_HOST __BIG_ENDIAN__
> >  #define LITTLE_ENDIAN_HOST __LITTLE_ENDIAN__
> 
> 
> I finally solved it like that: I modified config.h and added
> 
> #include <machine/endian.h>
> #ifdef BIG_ENDIAN && LITTLE_ENDIAN
>   #if BYTE_ORDER==BIG_ENDIAN
>     #define BIG_ENDIAN_HOST 1
>     #undef LITTLE_ENDIAN_HOST
>   #elif BYTE_ORDER==LITTLE_ENDIAN
>     #undef BIG_ENDIAN_HOST
>     #define LITTLE_ENDIAN_HOST 1
>   #else
>     #error Unsupported endianness
>   #endif
> #else
>   #error Endianness macros are undefined!
> #endif
> 
> 
> Maybe it's portable for other platforms?

No.  There is no guarantee that any of machine/endian.h, BIG_ENDIAN,
or LITTLE_ENDIAN exists.  If any of those are missing, that code will
break.  There are safe ways to do this in autoconf.

> I don't need to disable asm, do I? I didn't and it worked.

On ppc it will work, since there aren't ppc asm modules in the code
(it uses straight C).  On i386, there are asm modules, so if you
compile the fat binary on ppc, it'll work, but if you compile the fat
binary on i386 configure will detect the i386 and use the asm modules
which would break ppc.  --disable-asm fixes all that that and makes
the MPI code processor agnostic.

> BTW, is it better or not to enable memory-guard and noexecstack? Why  
> aren't they enabled by default?

Experimental and gcc specific.

> >Let me know if this works for you.
> 
> It probably does, as it solves the endiannes problem, and doesn't use  
> any special lib.
> I'll see that tomorrow.

Ok, let me know.

David



More information about the Gnupg-devel mailing list