|
CrossCompile
How to use llvm-lua to cross-compile Lua scripts to native code for target architecture like arm/powerpc from a different host architecture.
Featured Introductionllvm-lua now has support for native cross-compiling support. Required software
See this page for how to compile LLVM & Clang. Compiling llvm-luac as a cross-compiler1. Setup build folder for cmake:
2. Set the following cmake variables using the "ccmake" GUI:
For good performance it is important to select the correct CROSS_CPU that matches the target cpu you will be compiling for. You can change this later in the "lua-cross-compiler" script, in case you need to compile for different arm cpus. 3. Compile llvm-luac
You should now have the following files for llvm-luac: /usr/local/bin/arm-linux-llvm-luac /usr/local/bin/lua-cross-compiler Cross compiling a Lua script.To native compile a single Lua script into a standalone execute for the target architecture:
To native compile sub-modules into the same standalone execute:
|
► Sign in to add a comment
"lua-cross-compiler" script doesn't exist.