lua-users home
lua-l archive

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


Hi,

Sorry for the top post. Is there a reason you don't just cross compile luac then run it in qemu to generate the Arm byte code?

https://www.qemu.org/

Cheers
Russ

Sent from my BlackBerry 10 smartphone on the Virgin Mobile network.
From: Matthias
Sent: Sunday, March 31, 2019 11:03 PM
To: lua-l@lists.lua.org
Reply To: Lua mailing list
Subject: Cross-compiling Lua byte code for specific target hardware

Hi,

in search of an example on how to cross-compile Lua byte code for a specific target architecture, I came across this post: http://lua-users.org/lists/lua-l/2006-06/msg00205.html. 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.

In order to realize that, I would like to patch the Lua sources accordingly. Unfortunately, I was not able to find any concrete example which demonstrates on how to change the existing code base for a specific target architecture. I already had a look at the ldump.c file as mentioned in the post above. As far as I understand I (only) have to adapt DumpBlock() since any data produced by the higher-layer functions finally go through this function. However, I am not sure how to exactly do that. Is there any concrete example available that demonstrates the required steps?

Thank you very much in advance.

With kind regards,
Matthias