luaL_newstate() fails on 64-bit Mac, can't set linker flags

  • From: Coda Highland <chighland@xxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Thu, 17 May 2012 11:39:58 -0500

In my application, when compiled 64-bit on Mac, luaL_newstate() is
returning 0. I understand the normal requirements for this from the
documentation at http://luajit.org/install.html:

"If you're building a 64 bit application on OSX which links directly
or indirectly against LuaJIT, you need to link your main executable
with these flags:

-pagezero_size 10000 -image_base 100000000

Also, it's recommended to rebase all (self-compiled) shared libraries
which are loaded at runtime on OSX/x64 (e.g. C extension modules for
Lua). See: man rebase"

Unfortunately, I CAN'T do this -- I don't control the main
application, as I'm developing a plugin. Is there any possible way to
sidestep this requirement? Or am I going to be stuck using stock Lua?
I've already had to drop the FFI (more on this in another thread) but
I'd still like the performance benefit of LuaJIT's faster interpreter
core (and ideally of JIT) -- but if it's not feasible, I'll make the
switch.

/s/ Adam

Other related posts: