Closed daurnimator closed 9 years ago
The inflate symbol should come from libz.so. Perhaps the problem is when linking zlib.so, you need to pass the -lz flag to the linker to tell it that the libz.so is NEEDED. Perhaps this means the rockspec needs to be updated to tell the linker to pass the -lz flag, but I'm no expert in rockspec's, so I'm not sure how to do that. Perhaps if you just use make
to do the build all will be well?
You can use objdump -x zlib.so
to see if the appropriate NEEDED field exists in the elf file.
If you know how to update the rockspec, please send me a patch.
Thanks, -Brian
The inflate symbol should come from libz.so. Perhaps the problem is when linking zlib.so, you need to pass the -lz flag to the linker to tell it that the libz.so is NEEDED.
That seems to work.
Perhaps this means the rockspec needs to be updated to tell the linker to pass the -lz flag, but I'm no expert in rockspec's, so I'm not sure how to do that.
Add 'z' to the libraries array, so instead of
zlib = "lua_zlib.c"`
Have:
zlib = {
sources = { "lua_zlib.c" };
libraries = { "z" },
};
Okay, I think this is fixed (and I finally got around to using luarocks a bit).
luarocks install lua-zlib
will install the latest which has the fix (0.4-1 version).
On my Mac, I can now properly see the NEEDED field is set for libz:
otool -L /usr/local/lib/lua/5.2/zlib.so
/usr/local/lib/lua/5.2/zlib.so: /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0) /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 283.0.0)
Thanks, -Brian
luarocks install lua-zlib will install the latest which has the fix (0.4-1 version).
The new rockspec has not been uploaded to moonrocks yet? https://rocks.moonscript.org/search?q=lua-zlib
It appears that @guilhem currently has ownership over that rock, will you (@brimworks) take that over?
It is there: https://rocks.moonscript.org/search?q=lua-zlib&non_root=on
I would like to take ownership of this rock, just not sure how I should do that.
Thanks, -Brian
It is there: https://rocks.moonscript.org/search?q=lua-zlib&non_root=on
Ah ha, I forgot to include non-root.
I would like to take ownership of this rock, just not sure how I should do that.
You can to poke @leafo and/or @hishamhm who will fix it up for you. Otherwise I think if @guilhem withdraws his version from the root manifest, you can then promote yours.
I can manage it next week if you are asking gently ;)
I can transfer it right now now, sound good @brimworks
Thanks! No big rush :).
Alright, good to go: http://rocks.moonscript.org/modules/brimworks/lua-zlib
I also copied the older versions into your copy of the module
I deleted mine for less confusion
I compiled/installed via luarocks:
However, when trying to run (e.g, via
lua -lzlib
), I get:The fix seems to be renaming the shared object, e.g. to
lua-zlib.so
. I assume this is due to the dynamic linker getting confused?