3

I'm using luajit 2.0.3,and I want to use luasocket in myproject.When require socket in jit, it reported an error

"error loading module 'socket.core' from file '/usr/local/lib/lua/5.1/socket/core.so': /usr/local/lib/lua/5.1/socket/core.so: undefined symbol: lua_callk. 

I compiled luasocket 3.0 in debian 5.0 with lua5.1. I searched a lot of answers ,but none helped. I compiled luasocket 3.0 in debian 5.0 with lua5.1.

JoeyMiu
  • 139
  • 10

1 Answers1

1

LuaJIT is ABI-compatible with Lua 5.1, that means, you can compile a C module against the standard Lua headers and either load it from Lua or from LuaJIT.

Judging from the error message, LuaSocket requires the function lua_callk, however, as for today, this function is not implemented in LuaJIT. There has been requests of implementing this function as well as lua_pcallk and lua_yieldk but doing it so would require LuaJIT to switch to the Lua 5.2 ABI [1].

I would suggest you to switch to an older version of LuaSocket (2.0.2, for instance) or check whether LuaSocket can be compiled keeping 5.1 ABI compatibility.

[1] http://www.freelists.org/post/luajit/Yielding-across-C-boundaries,3

Diego Pino
  • 11,278
  • 1
  • 55
  • 57