Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makefile-created dylib not working on macOS #21

Open
aleclarson opened this issue Mar 4, 2018 · 2 comments
Open

Makefile-created dylib not working on macOS #21

aleclarson opened this issue Mar 4, 2018 · 2 comments

Comments

@aleclarson
Copy link
Contributor

aleclarson commented Mar 4, 2018

git clone https://github.com/hoelzro/lua-linenoise.git
cd lua-linenoise
make

The .dylib produced by make is complaining about missing symbols.

Question: Why doesn't the Makefile produce a .so file instead?

Using tarantool v1.9.0:

error loading module 'linenoise' from file '/path/to/lua-linenoise/linenoise.dylib':
	dlopen(/path/to/lua-linenoise/linenoise.dylib, 6): Symbol not found: _lua_callk
  Referenced from: /path/to/lua-linenoise/linenoise.dylib
  Expected in: flat namespace
 in /path/to/lua-linenoise/linenoise.dylib

Using lua5.1:

lua5.1: error loading module 'linenoise' from file '/path/to/lua-linenoise/linenoise.dylib':
	dlopen(/path/to/lua-linenoise/linenoise.dylib, 2): Symbol not found: _luaL_setfuncs
  Referenced from: /path/to/lua-linenoise/linenoise.dylib
  Expected in: flat namespace
 in /path/to/lua-linenoise/linenoise.dylib
stack traceback:
	[C]: ?
	[C]: in function 'require'
	test.lua:11: in main chunk
	[C]: ?

Repro:

function add_cpath(cpath)
  package.cpath = cpath .. ';' .. package.cpath
end

add_cpath('/path/to/lua-linenoise/?.dylib')
require('linenoise')
@hoelzro
Copy link
Owner

hoelzro commented Mar 5, 2018

make produces a dylib on macOS, since that's the standard shared library extension there (if I remember correctly? It's been a while since I used macOS on my own hardware!). As far as the symbol resolution failures, which version(s) of Lua do you have installed, and which version is tarantool using? make is going to build against whatever version of Lua comes up in your header include path first, so you might need to adjust CFLAGS in the Makefile.

@hoelzro
Copy link
Owner

hoelzro commented Mar 5, 2018

macOS support in the Makefile could be better - I only really use the Makefile for personal debugging. Any improvements would be appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants