Hi,
Attached are modified versions of ldump.c, lundump.h, and luac.c to
allow for cross-compilation. They should work as drop-in
replacements. I've done some basic testing, but I only have access
to one architecture so I can't test endianness.
This code lets you specify:
* the endianness of the target platform
* the size of int as 8, 16, or 32 (no 64-bit support right now)
* lua_Number as an int (8, 16, or 32 bits) or a float (32 or 64 bits)
ldump.c exports a new function called "luaU_dump_crosscompile" that
works like luaU_dump except that it takes a DumpTargetInfo structure.
luaU_dump_crosscompile supports different sizes of size_t but luac
does not allow it to be set from the command line. Are there any
targets where sizeof(int) is different from sizeof(size_t)?