[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: LuaJIT 2 vs. C modules built for Lua
- From: Mike Pall <mikelu-0911@...>
- Date: Tue, 10 Nov 2009 09:24:57 +0100
Alexander Gladysh wrote:
> 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)?
The very first section in http://luajit.org/luajit.html says:
LuaJIT implements the full set of language features defined by
Lua 5.1. The virtual machine (VM) is API- and ABI-compatible to
the standard Lua interpreter and can be deployed as a drop-in
The 'B' in "ABI-compatible" means binary module compatibility.
> My intuition says "no". Then I feel that LJ2 should ignore LUA_CPATH
> and have its own environment variable.
Alas, your intuition is wrong. It's deliberately using the same
> 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?
This is not specific to LuaJIT. The 32/64 bit issues are going to
hurt you with a mixed 32 bit/64 bit Lua installation, too:
lua64: error loading module 'test' from file './test.so':
./test.so: wrong ELF class: ELFCLASS32