lua-users home
lua-l archive

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


> We use Lua 5.3.4 in a project which relies on Yocto in order to build a customized Linux operating system image for our target hardware – an ARM Cortex A7 32bit processor. On that hardware, we run some applications that are implemented in Lua. During the build process, we want to compile our Lua application script files into byte code for the mentioned target machine. That is, luac shall generate byte code which can run on the Cortex A7 processor. The whole build process, especially luac, is automatically executed on a 64bit-Ubuntu-based build server backend in which we cannot integrate the target hardware for compilation. This is why we need to have a cross-compilation capable version of luac in our Yocto build system.

One route is to change ldump.c in Lua 5.3 as follows:
- Save the correct ARM values in DumpHeader, especially the sizeof ones.
- Write DumpVector as a function to match the endianness of your ARM processor:

      #define DumpVector(v,n,D)       DumpVectorARM(v,n,sizeof((v)[0]),D)

where DumpVectorARM is a loop that copies each item to a local buffer
in the correct endianness of your ARM processor and calls DumpBlock on
that buffer.

See http://lua-users.org/lists/lua-l/2006-02/msg00507.html for similar
code for loading, instead of dumping.

You'll need to know how floating point numbers are represented in your
ARM processor. Beware that it may use a strange endianness, I don't
know.

Perhaps there are people here in lua-l that know all these details
about that ARM processor.