gvvaughan / lyaml

LibYAML binding for Lua.
gvvaughan.github.io/lyaml
Other
209 stars 34 forks source link

luke: fatal: required symbol 'yaml_document_initialize' not found in any of libc, libyaml #38

Open vsock opened 4 years ago

vsock commented 4 years ago

I have installed luarocks for a customised lua version based on 5.1. and now trying to install specl which depends on lyaml. and getting this error. I thought this was fixed in latest version.

`root@b8b290eb659a:/opt/luarocks5_1/bin# ./luarocks install specl Installing https://luarocks.org/specl-14.1.7-1.src.rock Missing dependencies for specl 14.1.7-1: lyaml >= 5 (not installed) optparse (not installed) stdlib >= 41.2.0, < 42.0 (not installed)

specl 14.1.7-1 depends on luamacro >= 2.0 (2.5.1-1 installed) specl 14.1.7-1 depends on lua >= 5.1, < 5.5 (5.1-1 provided by VM) specl 14.1.7-1 depends on lyaml >= 5 (not installed) Installing https://luarocks.org/lyaml-6.2.5-1.src.rock

lyaml 6.2.5-1 depends on lua >= 5.1, < 5.5 (5.1-1 provided by VM) /<>j/bin/lua build-aux/luke package="lyaml" version="6.2.5" PREFIX="/opt/luarocks5_1/lib/luarocks/rocks-5.1/lyaml/6.2.5-1" CFLAGS="-O2 -fPIC" LIBFLAG="-shared" LIB_EXTENSION="so" OBJ_EXTENSION="o" LUA="/opt/<>j/bin/lua" LUA_DIR="/opt/luarocks5_1/lib/luarocks/rocks-5.1/lyaml/6.2.5-1/lua" LUA_INCDIR="/opt/<>/include/lua" YAML_DIR="/usr" YAML_INCDIR="/usr/include" YAML_LIBDIR="/usr/lib/x86_64-linux-gnu" luke: fatal: required symbol 'yaml_document_initialize' not found in any of libc, libyaml

Error: Failed installing dependency: https://luarocks.org/lyaml-6.2.5-1.src.rock - Build error: Failed building. root@b8b290eb659a:/opt/luarocks5_1/bin# ls `

vsock commented 4 years ago

This isn't an issue in lua version 5.1.5 but not working with customized 5.1.2

gvvaughan commented 4 years ago

please paste the entire output from running: /<>j/bin/lua build-aux/luke package="lyaml" version="6.2.5" PREFIX="/opt/luarocks5_1/lib/luarocks/rocks-5.1/lyaml/6.2.5-1" CFLAGS="-O2 -fPIC" LIBFLAG="-shared" LIB_EXTENSION="so" OBJ_EXTENSION="o" LUA="/opt/<>j/bin/lua" LUA_DIR="/opt/luarocks5_1/lib/luarocks/rocks-5.1/lyaml/6.2.5-1/lua" LUA_INCDIR="/opt/<>/include/lua" YAML_DIR="/usr" YAML_INCDIR="/usr/include" YAML_LIBDIR="/usr/lib/x86_64-linux-gnu" --verbose --debug

vsock commented 4 years ago

`65830:~/luarocks5_1/bin$ ./luarocks install specl --verbose > lyaml_error.log luke: fatal: required symbol 'yaml_document_initialize' not found in any of libc, libyaml

Error: Failed installing dependency: https://luarocks.org/lyaml-6.2.5-1.src.rock - Build error: Failed building. ` lyaml_error.log

vsock commented 4 years ago

The above log obtained when trying to install specl with a fixed version of lua interpreter 5.1.2.

Later, successfully installed specl by replacing 5.1.2 with 5.1.5 interpreter. then switched back to 5.1.2,but not sure about the risk of using older version of lua with latest specl for a project

Also there is no "--debug" option for luarocks, hence only verbose output log attached.

gvvaughan commented 4 years ago

But the command I pasted is an invocation of build-aux/luke from inside an lyaml rock using your Lua interpreter and with the addition of —debug and —verbose flags... nothing to do with luarocks. You will need to fetch and unpack the lyaml rock or download the matching release tarball from github first (e.g. https://github.com/gvvaughan/lyaml/archive/v6.2.5.tar.gz ), and from the top level directory of that run the command I pasted above to get enough debug output to help me understand why you’re experiencing an error :-)

vsock commented 4 years ago

/opt/lyaml/lyaml-6.2.5# /opt/sbengine/linux-x86_64-opengles_2.0-x11-obj/bin/lua build-aux/luke package="lyaml" version="6.2.5" PREFIX="/opt/luarocks5_1/lib/luarocks/rocks-5.1/lyaml/6.2.5-1" CFLAGS="-O2 -fPIC" LIBFLAG="-shared" LIB_EXTENSION="so" OBJ_EXTENSION="o" LUA="/opt/sbengine/linux-x86_64-opengles_2.0-x11-obj/bin/lua" LUA_DIR="/opt/luarocks5_1/lib/luarocks/rocks-5.1/lyaml/6.2.5-1/lua" LUA_INCDIR="/opt/sbengine/linux-x86_64-opengles_2.0-x11-obj/inclde/lua" YAML_DIR="/usr" YAML_INCDIR="/usr/include" YAML_LIBDIR="/usr/lib/x86_64-linux-gnu" --verbose --debug DEBUG: ldoc not found checking for ldoc... no DEBUG: found /bin/true checking for true... yes DEBUG: found /usr/bin/cc checking for cc... yes checking whether cc works... yes DEBUG: cc -O2 -fPIC -I/usr/include -o /tmp/lua_orN4hM /tmp/lua_H3Xafi.c -L/usr/lib/x86_64-linux-gnu
DEBUG: /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crt1.o: In function _start': DEBUG: (.text+0x20): undefined reference tomain' DEBUG: collect2: error: ld returned 1 exit status DEBUG: DEBUG: cc -O2 -fPIC -I/usr/include -o /tmp/lua_4pFrGI /tmp/lua_lLfhxe.c -L/usr/lib/x86_64-linux-gnu -lyaml
DEBUG: /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crt1.o: In function _start': DEBUG: (.text+0x20): undefined reference tomain' DEBUG: collect2: error: ld returned 1 exit status DEBUG: checking for library containing yaml_document_initialize... luke: fatal: required symbol 'yaml_document_initialize' not found in any of libc, libyaml

root@clade-shell:/opt/lyaml/lyaml-6.2.5# objdump -T /usr/lib/x86_64-linux-gnu/libyaml-0.so.2 | grep document_init 0000000000006c00 g DF .text 00000000000003ae Base yaml_document_initialize

gvvaughan commented 4 years ago

Huh, interesting... seems like your compiler is sad about the lack of main in the test program. I need to tweak the link test source generator... please give me a few days to find time, and thanks for the report!