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

  • From: John Spencer <maillist-luajit@xxxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Sat, 27 Oct 2012 07:26:35 +0200

On 10/26/2012 06:03 PM, Luke Gorrie wrote:
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.



maybe use a libc that is intended to be usable for static linking such as musl ( http://www.musl-libc.org ) ?

glibc is not.

Other related posts: