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

Issues building on Debian for armhf #23

Closed
MockbaTheBorg opened this issue Nov 5, 2020 · 14 comments
Closed

Issues building on Debian for armhf #23

MockbaTheBorg opened this issue Nov 5, 2020 · 14 comments

Comments

@MockbaTheBorg
Copy link

Hi There,

I have built this one on an armhf environment, together with Lua 5.3.6.
All seems to build fine, but when I try to do:

local cffi = require("cffi")

I get an error message:

lua: error loading module 'cffi' from file '/usr/local/lib/lua/5.3/cffi.so':
        /usr/local/lib/lua/5.3/cffi.so: unexpected reloc type 0x03

The process I am following is:
. Extract lua5.3.6
. build lua with make linux && make install
. then build cffi using -Dlua_version=vendor (I have copied the relevant files to deps folder)

cffi.so builds with no error, but gives me the message above when I try to use it.

I have no idea of what can be the issue, though I have a feeling it might be something simple I am missing.
Any help would be much appreciated.

Thanks,
Marcelo.

@q66
Copy link
Owner

q66 commented Nov 5, 2020

what meson version? this would seem like it's compiling without -fPIC in CFLAGS, even though it should, always (meson should imply it for shared libs)

also, are you building git master or the last release?

@MockbaTheBorg
Copy link
Author

MockbaTheBorg commented Nov 5, 2020

Hi there,

Meson is 0.56.0
Python is 3.5.5
Ninja is 1.7.2
I just did a git clone this morning.
I see -fPIC inside the compile_commands.json, except for the tests/runner, but I do not think that is needed.
I was trying this example:

local cffi = require("cffi")

This is all that's inside my minimum.lua.

I do not understand meson much, but I did some research and saw -fPIC there, that was my expectation to find the issue, but now I am lost.

Thanks,
Marcelo.

(update: I build the same way under Windows WSL and works fine, so it seems to be specific to armhf environment)

@q66
Copy link
Owner

q66 commented Nov 5, 2020

compile with ninja --verbose and you should see -fPIC in the gcc calls

unfortunately we don't have 32-bit ARM CI, so testing it is a bit tricky, Travis does not support any kind of 32-bit platform and all 32-bit machines I have here are PowerPC (which works fine here) so not much I can do in terms of reproducing it easily

@MockbaTheBorg
Copy link
Author

Tried it... I see -fPIC on all build lines but the one for runner.
When I try ninja test all tests fail with killed by signal 6 SIGIOT
(sorry for the big attachment below)

root@force:~/cffi-lua/build# ninja -v all
[1/10] c++ -Icffi.so.p -I. -I.. -I../deps/include -I/usr/local/include -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -Wextra -Wpedantic -std=c++14 -fno-exceptions -fno-rtti -O2 -g -fPIC -DCFFI_LUA_DLL -Wshadow -Wold-style-cast -fvisibility=hidden -DHAVE_CONFIG_H=1 -MD -MQ cffi.so.p/src_util.cc.o -MF cffi.so.p/src_util.cc.o.d -o cffi.so.p/src_util.cc.o -c ../src/util.cc
[2/10] c++ -Icffi.so.p -I. -I.. -I../deps/include -I/usr/local/include -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -Wextra -Wpedantic -std=c++14 -fno-exceptions -fno-rtti -O2 -g -fPIC -DCFFI_LUA_DLL -Wshadow -Wold-style-cast -fvisibility=hidden -DHAVE_CONFIG_H=1 -MD -MQ cffi.so.p/src_lib.cc.o -MF cffi.so.p/src_lib.cc.o.d -o cffi.so.p/src_lib.cc.o -c ../src/lib.cc
[3/10] c++ -Icffi.so.p -I. -I.. -I../deps/include -I/usr/local/include -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -Wextra -Wpedantic -std=c++14 -fno-exceptions -fno-rtti -O2 -g -fPIC -DCFFI_LUA_DLL -Wshadow -Wold-style-cast -fvisibility=hidden -DHAVE_CONFIG_H=1 -MD -MQ cffi.so.p/src_main.cc.o -MF cffi.so.p/src_main.cc.o.d -o cffi.so.p/src_main.cc.o -c ../src/main.cc
[4/10] c++ -Itests/runner.p -Itests -I../tests -I. -I.. -I../src -I../deps/include -I/usr/local/include -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -Wextra -Wpedantic -std=c++14 -fno-exceptions -fno-rtti -O2 -g -Wshadow -Wold-style-cast -fvisibility=hidden -DHAVE_CONFIG_H=1 -MD -MQ tests/runner.p/runner.cc.o -MF tests/runner.p/runner.cc.o.d -o tests/runner.p/runner.cc.o -c ../tests/runner.cc
[5/10] c++  -o tests/runner tests/runner.p/runner.cc.o -I/usr/local/include -Wl,--as-needed -Wl,--no-undefined -Wl,-export-dynamic -Wl,--start-group -llua -ldl /root/cffi-lua/deps/liblua.a -Wl,--end-group
[6/10] c++ -Icffi.so.p -I. -I.. -I../deps/include -I/usr/local/include -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -Wextra -Wpedantic -std=c++14 -fno-exceptions -fno-rtti -O2 -g -fPIC -DCFFI_LUA_DLL -Wshadow -Wold-style-cast -fvisibility=hidden -DHAVE_CONFIG_H=1 -MD -MQ cffi.so.p/src_ffi.cc.o -MF cffi.so.p/src_ffi.cc.o.d -o cffi.so.p/src_ffi.cc.o -c ../src/ffi.cc
In file included from ../src/ffi.hh:10:0,
                 from ../src/ffi.cc:3:
../src/ast.hh: In instantiation of 'ast::c_record::passable() const::<lambda(auto:1*, auto:2&, std::size_t)> [with auto:1 = const char; auto:2 = const ast::c_type; std::size_t = unsigned int]':
../src/ast.hh:1090:23:   required from 'ast::c_record::iter_fields(F&&) const::<lambda(const char*, const ast::c_type&, std::size_t, void*)> [with F = ast::c_record::passable() const::<lambda(auto:1*, auto:2&, std::size_t)>; std::size_t = unsigned int]'
../src/ast.hh:1086:22:   required from 'struct ast::c_record::iter_fields(F&&) const [with F = ast::c_record::passable() const::<lambda(auto:1*, auto:2&, std::size_t)>]::<lambda(const char*, const struct ast::c_type&, std::size_t, void*)>'
../src/ast.hh:1086:9:   required from 'void ast::c_record::iter_fields(F&&) const [with F = ast::c_record::passable() const::<lambda(auto:1*, auto:2&, std::size_t)>]'
../src/ast.hh:1062:10:   required from here
../src/ast.hh:1056:59: warning: declaration of 'const ast::c_type& type' shadows a parameter [-Wshadow]
         iter_fields([&ret](auto *, auto &type, std::size_t) {
                                                           ^
../src/ast.hh:1087:46: note: shadowed declaration is here
             char const *fname, c_type const &type, std::size_t off, void *data
                                              ^~~~
[7/10] c++ -Icffi.so.p -I. -I.. -I../deps/include -I/usr/local/include -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -Wextra -Wpedantic -std=c++14 -fno-exceptions -fno-rtti -O2 -g -fPIC -DCFFI_LUA_DLL -Wshadow -Wold-style-cast -fvisibility=hidden -DHAVE_CONFIG_H=1 -MD -MQ cffi.so.p/src_ffilib.cc.o -MF cffi.so.p/src_ffilib.cc.o.d -o cffi.so.p/src_ffilib.cc.o -c ../src/ffilib.cc
In file included from ../src/parser.hh:5:0,
                 from ../src/ffilib.cc:7:
../src/ast.hh: In instantiation of 'ast::c_record::passable() const::<lambda(auto:1*, auto:2&, std::size_t)> [with auto:1 = const char; auto:2 = const ast::c_type; std::size_t = unsigned int]':
../src/ast.hh:1090:23:   required from 'ast::c_record::iter_fields(F&&) const::<lambda(const char*, const ast::c_type&, std::size_t, void*)> [with F = ast::c_record::passable() const::<lambda(auto:1*, auto:2&, std::size_t)>; std::size_t = unsigned int]'
../src/ast.hh:1086:22:   required from 'struct ast::c_record::iter_fields(F&&) const [with F = ast::c_record::passable() const::<lambda(auto:1*, auto:2&, std::size_t)>]::<lambda(const char*, const struct ast::c_type&, std::size_t, void*)>'
../src/ast.hh:1086:9:   required from 'void ast::c_record::iter_fields(F&&) const [with F = ast::c_record::passable() const::<lambda(auto:1*, auto:2&, std::size_t)>]'
../src/ast.hh:1062:10:   required from here
../src/ast.hh:1056:59: warning: declaration of 'const ast::c_type& type' shadows a parameter [-Wshadow]
         iter_fields([&ret](auto *, auto &type, std::size_t) {
                                                           ^
../src/ast.hh:1087:46: note: shadowed declaration is here
             char const *fname, c_type const &type, std::size_t off, void *data
                                              ^~~~
../src/ffilib.cc: In instantiation of 'cdata_meta::index(lua_State*)::<lambda(auto:3&, void*)> [with auto:3 = const ast::c_type]':
../src/ffilib.cc:254:21:   required from 'static bool cdata_meta::index_common(lua_State*, F&&) [with bool New = false; F = cdata_meta::index(lua_State*)::<lambda(auto:3&, void*)>; lua_State = lua_State]'
../src/ffilib.cc:325:10:   required from here
../src/ffilib.cc:321:61: warning: declaration of 'decl' shadows a previous local [-Wshadow]
         if (index_common<false>(L, [L](auto &decl, void *val) {
                                                             ^
../src/ffilib.cc:216:21: note: shadowed declaration is here
         auto const *decl = &cd.decl;
                     ^~~~
../src/ffilib.cc: In instantiation of 'cdata_meta::newindex(lua_State*)::<lambda(auto:4&, void*)> [with auto:4 = const ast::c_type]':
../src/ffilib.cc:254:21:   required from 'static bool cdata_meta::index_common(lua_State*, F&&) [with bool New = true; F = cdata_meta::newindex(lua_State*)::<lambda(auto:4&, void*)>; lua_State = lua_State]'
../src/ffilib.cc:365:10:   required from here
../src/ffilib.cc:363:60: warning: declaration of 'decl' shadows a previous local [-Wshadow]
         if (index_common<true>(L, [L](auto &decl, void *val) {
                                                            ^
../src/ffilib.cc:216:21: note: shadowed declaration is here
         auto const *decl = &cd.decl;
                     ^~~~
[8/10] c++ -Icffi.so.p -I. -I.. -I../deps/include -I/usr/local/include -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -Wextra -Wpedantic -std=c++14 -fno-exceptions -fno-rtti -O2 -g -fPIC -DCFFI_LUA_DLL -Wshadow -Wold-style-cast -fvisibility=hidden -DHAVE_CONFIG_H=1 -MD -MQ cffi.so.p/src_ast.cc.o -MF cffi.so.p/src_ast.cc.o.d -o cffi.so.p/src_ast.cc.o -c ../src/ast.cc
In file included from ../src/ast.cc:6:0:
../src/ast.hh: In instantiation of 'ast::c_record::passable() const::<lambda(auto:1*, auto:2&, std::size_t)> [with auto:1 = const char; auto:2 = const ast::c_type; std::size_t = unsigned int]':
../src/ast.hh:1090:23:   required from 'ast::c_record::iter_fields(F&&) const::<lambda(const char*, const ast::c_type&, std::size_t, void*)> [with F = ast::c_record::passable() const::<lambda(auto:1*, auto:2&, std::size_t)>; std::size_t = unsigned int]'
../src/ast.hh:1086:22:   required from 'struct ast::c_record::iter_fields(F&&) const [with F = ast::c_record::passable() const::<lambda(auto:1*, auto:2&, std::size_t)>]::<lambda(const char*, const struct ast::c_type&, std::size_t, void*)>'
../src/ast.hh:1086:9:   required from 'void ast::c_record::iter_fields(F&&) const [with F = ast::c_record::passable() const::<lambda(auto:1*, auto:2&, std::size_t)>]'
../src/ast.hh:1062:10:   required from here
../src/ast.hh:1056:59: warning: declaration of 'const ast::c_type& type' shadows a parameter [-Wshadow]
         iter_fields([&ret](auto *, auto &type, std::size_t) {
                                                           ^
../src/ast.hh:1087:46: note: shadowed declaration is here
             char const *fname, c_type const &type, std::size_t off, void *data
                                              ^~~~
[9/10] c++ -Icffi.so.p -I. -I.. -I../deps/include -I/usr/local/include -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -Wextra -Wpedantic -std=c++14 -fno-exceptions -fno-rtti -O2 -g -fPIC -DCFFI_LUA_DLL -Wshadow -Wold-style-cast -fvisibility=hidden -DHAVE_CONFIG_H=1 -MD -MQ cffi.so.p/src_parser.cc.o -MF cffi.so.p/src_parser.cc.o.d -o cffi.so.p/src_parser.cc.o -c ../src/parser.cc
In file included from ../src/parser.hh:5:0,
                 from ../src/parser.cc:6:
../src/ast.hh: In instantiation of 'ast::c_record::passable() const::<lambda(auto:1*, auto:2&, std::size_t)> [with auto:1 = const char; auto:2 = const ast::c_type; std::size_t = unsigned int]':
../src/ast.hh:1090:23:   required from 'ast::c_record::iter_fields(F&&) const::<lambda(const char*, const ast::c_type&, std::size_t, void*)> [with F = ast::c_record::passable() const::<lambda(auto:1*, auto:2&, std::size_t)>; std::size_t = unsigned int]'
../src/ast.hh:1086:22:   required from 'struct ast::c_record::iter_fields(F&&) const [with F = ast::c_record::passable() const::<lambda(auto:1*, auto:2&, std::size_t)>]::<lambda(const char*, const struct ast::c_type&, std::size_t, void*)>'
../src/ast.hh:1086:9:   required from 'void ast::c_record::iter_fields(F&&) const [with F = ast::c_record::passable() const::<lambda(auto:1*, auto:2&, std::size_t)>]'
../src/ast.hh:1062:10:   required from here
../src/ast.hh:1056:59: warning: declaration of 'const ast::c_type& type' shadows a parameter [-Wshadow]
         iter_fields([&ret](auto *, auto &type, std::size_t) {
                                                           ^
../src/ast.hh:1087:46: note: shadowed declaration is here
             char const *fname, c_type const &type, std::size_t off, void *data
                                              ^~~~
[10/10] c++  -o cffi.so cffi.so.p/src_util.cc.o cffi.so.p/src_ffilib.cc.o cffi.so.p/src_parser.cc.o cffi.so.p/src_ast.cc.o cffi.so.p/src_lib.cc.o cffi.so.p/src_ffi.cc.o cffi.so.p/src_main.cc.o -I/usr/local/include -Wl,--as-needed -Wl,--allow-shlib-undefined -shared -fPIC -Wl,--start-group -Wl,-soname,cffi.so -llua -ldl -lffi -Wl,--end-group
root@force:~/cffi-lua/build#

@q66
Copy link
Owner

q66 commented Nov 5, 2020

yeah, the output looks okay

a curious thing is the shadow warnings, they're complete nonsense; what compiler/version is it?

also, i see -llua in linkage, you should not be linking against the lua library

in fact, i now potentailly see the reason; since you are linking against the lua library, and by default lua makes a static library, you're carrying static relocs into the result, and that's why it's busted

that's not the only reason you should not link against lua on unix-likes (windows is another matter), see http://lua-users.org/wiki/BuildingModules, section "Do Not Link Modules to the Lua Core Libraries"

@MockbaTheBorg
Copy link
Author

I will read that.

So what should I do then? I am not sure how to solve it, sorry.
When I build Lua is deploys lualib.a to /usr/local/lib and the .h to /usr/local/include

If I specify -Dlua_version=5.3 when building cffi it still won't find it, that's why I thought building with -Dlua_version=vendor would be the solution.
I copied those files onto the deps folder and then the build goes normal.

The compiler is gcc 6.3.0.

Thanks,
Marcelo.

@q66
Copy link
Owner

q66 commented Nov 5, 2020

wait, it's adding -llua automatically? that makes no sense, the lua dependency in meson is explicitly partial, with only compiler args and includes being added and link args being explicitly skipped

by default it's not found because lua does not ship a pkg-config file like distributions do

you can ditch the deps directory and use custom instead of vendor for now, with CFLAGS=-I/usr/local/include

@q66
Copy link
Owner

q66 commented Nov 5, 2020

i just tested with vendor and it's not linking lua, are you sure you're not setting some custom LDFLAGS

@q66
Copy link
Owner

q66 commented Nov 5, 2020

q66@rimi: /home/q66/cffi-lua/build53$ ninja --verbose
[1/10] c++ -Icffi.so.p -I. -I.. -I../deps/include -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -Wextra -Wpedantic -std=c++14 -fno-exceptions -fno-rtti -O2 -g -fPIC -DCFFI_LUA_DLL -Wshadow -Wold-style-cast -fvisibility=hidden -DHAVE_CONFIG_H=1 -MD -MQ cffi.so.p/src_main.cc.o -MF cffi.so.p/src_main.cc.o.d -o cffi.so.p/src_main.cc.o -c ../src/main.cc
[2/10] c++ -Itests/runner.p -Itests -I../tests -I. -I.. -I../src -I../deps/include -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -Wextra -Wpedantic -std=c++14 -fno-exceptions -fno-rtti -O2 -g -Wshadow -Wold-style-cast -fvisibility=hidden -DHAVE_CONFIG_H=1 -MD -MQ tests/runner.p/runner.cc.o -MF tests/runner.p/runner.cc.o.d -o tests/runner.p/runner.cc.o -c ../tests/runner.cc
[3/10] c++ -Icffi.so.p -I. -I.. -I../deps/include -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -Wextra -Wpedantic -std=c++14 -fno-exceptions -fno-rtti -O2 -g -fPIC -DCFFI_LUA_DLL -Wshadow -Wold-style-cast -fvisibility=hidden -DHAVE_CONFIG_H=1 -MD -MQ cffi.so.p/src_util.cc.o -MF cffi.so.p/src_util.cc.o.d -o cffi.so.p/src_util.cc.o -c ../src/util.cc
[4/10] c++  -o tests/runner tests/runner.p/runner.cc.o -Wl,--as-needed -Wl,--no-undefined -Wl,-export-dynamic -Wl,--start-group -ldl /home/q66/cffi-lua/deps/liblua.a -Wl,--end-group
[5/10] c++ -Icffi.so.p -I. -I.. -I../deps/include -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -Wextra -Wpedantic -std=c++14 -fno-exceptions -fno-rtti -O2 -g -fPIC -DCFFI_LUA_DLL -Wshadow -Wold-style-cast -fvisibility=hidden -DHAVE_CONFIG_H=1 -MD -MQ cffi.so.p/src_lib.cc.o -MF cffi.so.p/src_lib.cc.o.d -o cffi.so.p/src_lib.cc.o -c ../src/lib.cc
[6/10] c++ -Icffi.so.p -I. -I.. -I../deps/include -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -Wextra -Wpedantic -std=c++14 -fno-exceptions -fno-rtti -O2 -g -fPIC -DCFFI_LUA_DLL -Wshadow -Wold-style-cast -fvisibility=hidden -DHAVE_CONFIG_H=1 -MD -MQ cffi.so.p/src_ffi.cc.o -MF cffi.so.p/src_ffi.cc.o.d -o cffi.so.p/src_ffi.cc.o -c ../src/ffi.cc
[7/10] c++ -Icffi.so.p -I. -I.. -I../deps/include -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -Wextra -Wpedantic -std=c++14 -fno-exceptions -fno-rtti -O2 -g -fPIC -DCFFI_LUA_DLL -Wshadow -Wold-style-cast -fvisibility=hidden -DHAVE_CONFIG_H=1 -MD -MQ cffi.so.p/src_ast.cc.o -MF cffi.so.p/src_ast.cc.o.d -o cffi.so.p/src_ast.cc.o -c ../src/ast.cc
[8/10] c++ -Icffi.so.p -I. -I.. -I../deps/include -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -Wextra -Wpedantic -std=c++14 -fno-exceptions -fno-rtti -O2 -g -fPIC -DCFFI_LUA_DLL -Wshadow -Wold-style-cast -fvisibility=hidden -DHAVE_CONFIG_H=1 -MD -MQ cffi.so.p/src_ffilib.cc.o -MF cffi.so.p/src_ffilib.cc.o.d -o cffi.so.p/src_ffilib.cc.o -c ../src/ffilib.cc
[9/10] c++ -Icffi.so.p -I. -I.. -I../deps/include -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -Wextra -Wpedantic -std=c++14 -fno-exceptions -fno-rtti -O2 -g -fPIC -DCFFI_LUA_DLL -Wshadow -Wold-style-cast -fvisibility=hidden -DHAVE_CONFIG_H=1 -MD -MQ cffi.so.p/src_parser.cc.o -MF cffi.so.p/src_parser.cc.o.d -o cffi.so.p/src_parser.cc.o -c ../src/parser.cc
[10/10] c++  -o cffi.so cffi.so.p/src_util.cc.o cffi.so.p/src_ffilib.cc.o cffi.so.p/src_parser.cc.o cffi.so.p/src_ast.cc.o cffi.so.p/src_lib.cc.o cffi.so.p/src_ffi.cc.o cffi.so.p/src_main.cc.o -Wl,--as-needed -Wl,--allow-shlib-undefined -shared -fPIC -Wl,--start-group -Wl,-soname,cffi.so -ldl -lffi -Wl,--end-group

@MockbaTheBorg
Copy link
Author

Let me triple check ... because I have tried so many different things and I might have left some garbage back.
Allow me a few minutes to just clean/rebuild
And thanks a LOT for helping with this.

@q66
Copy link
Owner

q66 commented Nov 5, 2020

could theoretically be a meson regression too, i haven't tested 0.56 yet

@MockbaTheBorg
Copy link
Author

You nailed it ... the -llua was garbage from previous attempts. It works now.
I still got the below:

[1/2] Linking target tests/runner
FAILED: tests/runner
c++  -o tests/runner tests/runner.p/runner.cc.o -Wl,--as-needed -Wl,--no-undefined -Wl,-export-dynamic -Wl,--start-group -ldl -Wl,--end-group
tests/runner.p/runner.cc.o: In function `operator()':
/root/cffi-lua/build/../tests/runner.cc:103: undefined reference to `lua_close'
tests/runner.p/runner.cc.o: In function `main':
/root/cffi-lua/build/../tests/runner.cc:80: undefined reference to `luaL_newstate'
/root/cffi-lua/build/../tests/runner.cc:81: undefined reference to `luaL_openlibs'
/root/cffi-lua/build/../tests/runner.cc:83: undefined reference to `lua_getglobal'
/root/cffi-lua/build/../tests/runner.cc:90: undefined reference to `lua_pushstring'
/root/cffi-lua/build/../tests/runner.cc:91: undefined reference to `lua_pushstring'
/root/cffi-lua/build/../tests/runner.cc:95: undefined reference to `lua_pushstring'
/root/cffi-lua/build/../tests/runner.cc:97: undefined reference to `lua_concat'
/root/cffi-lua/build/../tests/runner.cc:98: undefined reference to `lua_setfield'
/root/cffi-lua/build/../tests/runner.cc:100: undefined reference to `lua_settop'
/root/cffi-lua/build/../tests/runner.cc:106: undefined reference to `lua_pushcclosure'
/root/cffi-lua/build/../tests/runner.cc:107: undefined reference to `lua_setglobal'
/root/cffi-lua/build/../tests/runner.cc:110: undefined reference to `luaL_loadfilex'
/root/cffi-lua/build/../tests/runner.cc:115: undefined reference to `lua_callk'
/root/cffi-lua/build/../tests/runner.cc:116: undefined reference to `lua_close'
/root/cffi-lua/build/../tests/runner.cc:111: undefined reference to `lua_tolstring'
/root/cffi-lua/build/../tests/runner.cc:112: undefined reference to `lua_close'
collect2: error: ld returned 1 exit status
[2/2] Linking target cffi.so

Not sure how to fix it, but I am not too worried about the test itself. I am ok with that as long as the cffi.so works fine.

@q66
Copy link
Owner

q66 commented Nov 5, 2020

that's with vendor or with custom? with vendor it should build fine, with custom you should also pass -Dtests=false as there is no reasonable way to ensure linkage there

@MockbaTheBorg
Copy link
Author

Gotcha ... that's with custom. Makes sense.
Thank you so much for the prompt response and for the assistance. Saved the day.

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