[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: LuaJIT 2 vs. C modules built for Lua
- From: Geoff Leyland <geoff_leyland@...>
- Date: Tue, 10 Nov 2009 21:09:08 +1300
On 10/11/2009, at 9:01 PM, Alexander Gladysh wrote:
Hi, list!
This looks like a silly question, and I feel that it should be
documented somewhere, but anyway:
Can LJ2 be used with C modules, linked with Lua (on Linux / OS X
platforms)?
Yes, it works for me. The API is the same.
My intuition says "no". Then I feel that LJ2 should ignore LUA_CPATH
and have its own environment variable.
I use the exact same modules from the same path for lua and luajit.
Looks like practice says "yes" — what I've tried worked. But this is
strange. What am I missing? What are the consequences? What if modules
are accidentally compiled as 64-bit code?
(I think you mentioned earlier you were on OS X?)
Since snow leopard, upgrading macports and LJ2 I keep tripping over
32/64 bit issues. I *think* I've got it fixed now - lua and all my
modules are built as fat binaries for both 32 and 64 bit. LJ2 is 32
bit. I assume Lua uses the 64 bit half of the binary and LJ2 the 32
bit half.
The last hiccup I had was that up until a couple of weeks ago,
macports failed to build lua +universal as a universal binary, and I
needed to do a "macport selfupdate" to get the fix. Using "lipo -
info" to check that you actually got fat binaries is a very good idea.
Cheers,
Geoff