Re: luajit + dependencies in a single executable

  • From: Justin Cormack <justin@xxxxxxxxxxxxxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Sun, 2 Nov 2014 14:44:53 +0000

You can link a static executable with your own definition of dlopen
etc that provides the symbols. Really hacky example
https://github.com/justincormack/ljsyscall/blob/master/examples/dl.c -
you might have to be careful if your libc (eg glibc, Musl might be
easier and is better for static linking anyway) includes dlopen in a
static executable, but you can work around that  too if you feel so
inclined (my example was to run on an environment that didnt have
dynamic linking at all).

On Sun, Nov 2, 2014 at 9:41 AM, Dmitry Ivanov <jimon.j1m0n@xxxxxxxxx> wrote:
> Hi,
>
> I've tried to add lookup table in lj_clib.c, so luajit will first check a
> function in lookup table and if there are none it will go to dynamic symbol
> lookup.
>
> Example of usage : http://pastebin.com/Pe6qfyQc
>
> If you are interested - poke me, we can fork luajit and finalize it =)
>
>
> 2014-11-02 2:55 GMT+01:00 Cosmin Apreutesei <cosmin.apreutesei@xxxxxxxxx>:
>>
>> Btw, does it mean I have to get around this: "You may link LuaJIT
>> statically on Windows only if you don't intend to load Lua/C modules
>> at runtime." ?
>>
>

Other related posts: