Steps to reproduce:
- Install
lrex_posix Lua library
- Make sure your system Lua isn't findable by
pkg-config (a way to do that is remove pkg-config package or used patched lua52-sys which always builds from source).
- Initialize
hlua interpreter
- Run inside:
rex = require "rex_posix"
Expected result: library successfully loads
Observed result:
error loading module 'rex_posix' from file '/home/mkpankov/projects/ciri/lua/lib/lua/5.2/rex_posix.so':
/home/mkpankov/projects/ciri/lua/lib/lua/5.2/rex_posix.so: undefined symbol: lua_checkstack
Workaround: make sure your system has liblua5.2 installed and findable by pkg-config, so that build.rs finds this version - it won't trigger that bug, but requires liblua5.2.so shared library to be installed. So for example on Ubuntu 16.04 you'll need to have both liblua5.2-0 (shared library) and liblua5.2-dev (headers and static library) installed.
What follows is pretty obscure debugging info I gathered while trying to fix this issue. I'll post it in separate comment.