lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi Gustavo,

I am also running Ubuntu on PowerPC8 LittleEndian.

I believe the reason I'm seeing the issue is that I'm building with clang/LLVM rather rather than installing the version compiled with gcc. clang/LLVM is defining both __POWERPC__ and __ppc__:
$ clang -dM -E -x c /dev/null | grep __POWERPC__ #define __POWERPC__ 1 $ clang -dM -E -x c /dev/null grep __ppc__ #define __ppc__ 1

However, I suspect that based on your gcc preprocessor defines, which specify both __powerpc__ and __PPC__, but not __POWERPC__ or __ppc__, the reason you're not seeing an issue is that you're falling through to the else case:

src/luaconf.h:
<snip>
#elif defined(__POWERPC__) || defined(__ppc__)                  /* }{ */

#define LUA_IEEE754TRICK
#define LUA_IEEEENDIAN          1

#else                                                           /* }{ */

/* assume IEEE754 and a 32-bit integer type */
#define LUA_IEEE754TRICK

#endif                                                          /* } */
</snip>

Since the Open Power ABI Specification only specifies __powerpc__ and __PPC__, in addition to adding a check for endianness, 

src/luaconf.h:
<snip>
#elif defined(__POWERPC__) || defined(__ppc__)      /* }{ */
</snip>

should be:
<snip>
#elif defined(__POWERPC__)  || defined(__powerpc__) || defined(__ppc__) || defined(__PPC__)      /* }{ */
</snip>

Thanks,
Liz