Re: Creating a statically linked executable for a LuaJIT+C program

  • From: Mike Pall <mike-1210@xxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Mon, 29 Oct 2012 17:45:14 +0100

Markus Walther wrote:
> I guess the (arguably implicit) question is whether it would make
> sense to generate that wrapper automatically by luajit, which would
> strengthen the case for building standalone apps in a comfortable
> manner?
> 
> E.g. luajit -b module.lua module.app
> 
> Or  a -standalone flag which triggers generating those extra files
> plus a makefile which specifies how to build the standalone app?

Generating simple object files in Lua with the help of the FFI and
without any external dependencies is not that hard (that's what -b
does). But generating shared libraries or executables is rather
difficult. This requires a lot of knowledge that's buried deeply
inside the toolchain. I.e. you'd need to use the (cross-) toolchain
itself, which may not always be present on the host or target
system. And -b promises to produce a valid file for any target
platform on any host platform, too. Tough job.

--Mike

Other related posts: