Linking with lua5.1 and luajit

30 Views Asked by At

I've a c library with lua bindings, I link the library with -lua5.1 and then uses it from lua5.1 or from openresty on linux and it all works fine.

However on OS X it silently crashes. After some investigation I find out that openresty uses luajit and if I link to luajit instead of lua5.1 it works fine on OS X as well.

Now I'm trying to staticially compile lua5.1 into my library and no longer link with luajit. Which of course don't work.

So my questions is:

  1. Why is there a different between linking with luajit and lua5.1?
  2. Is there any way I can create a library that works with both luajit and lua5.1?
  3. Why is the behavior different between OS X and linux?
0

There are 0 best solutions below