lua-users home
lua-l archive

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


Stern.Jason wrote:
> I currently have a cross-platform project running Lua. I tried to implement LuaJIT on it, and was successful in Windows under Visual Studio 8. However, when I try to compile the project in QNX Momentics 4.6, I receive the following error:
> 
> size of array `check_TVALUE_SIZE_in_ljit_x86_dash_' is too large
> inc/ljit_x86.h	line 367

This indicates that the size of the TValue structure does not
match with the pregenerated DynASM file. It should be 16 bytes,
but is probably only 12 on your target platform due to weak
alignment for doubles.

Apparently the compiler from your toolchain doesn't trigger on the
following part of luaconf.h:

#if defined(LUA_NUMBER_DOUBLE) && defined(__GNUC__) && \
    (defined(__i386) || defined(__i386__)) && !defined(_WIN32)
#define LUA_TVALUE_ALIGN        __attribute__ ((aligned(8)))
#else
#define LUA_TVALUE_ALIGN
#endif

First try to delete the hole #if cruft and only use this line:

#define LUA_TVALUE_ALIGN        __attribute__ ((aligned(8)))

Then recompile everything. If you still get the same error, then
your compiler's alignment directives are disabled or broken. The
next best workaround is to modify lobject.h:

typedef struct lua_TValue {
  TValuefields;
  int dummy;                 /* <--- Insert this line. */
} LUA_TVALUE_ALIGN TValue;

Well, if that doesn't help, then I'm out of clues ...

--Mike