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

  • From: Luke Gorrie <lukego@xxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Fri, 26 Oct 2012 18:03:20 +0200

> Use embedded bytecode:
>   http://luajit.org/running.html#opt_b

Thanks! This is just what I wanted.

I find that when I compile with -Wl,-E I end up with this error:

/usr/bin/ld: dynamic STT_GNU_IFUNC symbol `memset' with pointer
equality in 
`/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/libc.a(memset.o)'
can not be used when making an executable; recompile with -fPIE and
relink with -pie

and trying to avoid that, or come up with an immune 'ld' command line,
is driving me mad.

Is there a simple example of a very statically linked executable
including LuaJIT that I can borrow from?

I would like to have libc statically linked but that's not a hard requirement.

Other related posts: