Project

Profile

Help

HostedRedmine.com has moved to the Planio platform. All logins and passwords remained the same. All users will be able to login and use Redmine just as before. Read more...

Bug #912390

tolua cmd fails to link with -llua?

Added by Luc Schrijvers over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
% Done:

0%

Estimated time:

Description

Trying a build from the S3_0 branch on Haiku, the library is building ok, the binary builds also but fails with a lot of undefined references:

configure runs: CFLAGS="-O2 -pipe" ./configure --prefix=/boot/home/destdir/ --enable-client=sdl2 --enable-fcmp=no --enable-sys-lua --enable-shared --disable-static --enable-sdl-mixer=sdl2

Output for tolua:
[x86] /Opslag/freeciv/dependencies/tolua-5.2> make
Making all in src
make1: Entering directory '/Opslag/freeciv/dependencies/tolua-5.2/src'
Making all in lib
make2: Entering directory '/Opslag/freeciv/dependencies/tolua-5.2/src/lib'
CC tolua_event.lo
CC tolua_is.lo
CC tolua_map.lo
CC tolua_push.lo
CC tolua_to.lo
CCLD libtolua.la
make2: Leaving directory '/Opslag/freeciv/dependencies/tolua-5.2/src/lib'
Making all in bin
make2: Entering directory '/Opslag/freeciv/dependencies/tolua-5.2/src/bin'
CC tolua.o
CC toluabind.o
CCLD tolua
tolua.o: In function `main':
tolua.c:(.text.startup+0x57): undefined reference to `lua_setglobal'
tolua.c:(.text.startup+0x85): undefined reference to `lua_setglobal'
toluabind.o: In function `luaopen_tolua':
toluabind.c:(.text+0x50): undefined reference to `luaL_loadbufferx'
toluabind.c:(.text+0x73): undefined reference to `luaL_loadbufferx'
toluabind.c:(.text+0x96): undefined reference to `luaL_loadbufferx'
toluabind.c:(.text+0xb9): undefined reference to `luaL_loadbufferx'
toluabind.c:(.text+0xdc): undefined reference to `luaL_loadbufferx'
toluabind.o:toluabind.c:(.text+0xff): more undefined references to `luaL_loadbufferx' follow
toluabind.o: In function `luaopen_tolua':
toluabind.c:(.text+0x334): undefined reference to `lua_pcallk'
toluabind.c:(.text+0x34e): undefined reference to `lua_pcallk'
toluabind.c:(.text+0x365): undefined reference to `lua_pcallk'
toluabind.c:(.text+0x37e): undefined reference to `lua_pcallk'
toluabind.c:(.text+0x39e): undefined reference to `lua_pcallk'
toluabind.o:toluabind.c:(.text+0x3be): more undefined references to `lua_pcallk' follow
toluabind.o: In function `tolua_tolua_open':
toluabind.c:(.text+0x5f1): undefined reference to `lua_callk'
../lib/.libs/libtolua.a(tolua_map.o): In function `tolua_push_globals_table':
tolua_map.c:(.text+0x122): undefined reference to `lua_rotate'
../lib/.libs/libtolua.a(tolua_map.o): In function `mapsuper':
tolua_map.c:(.text+0x4d3): undefined reference to `lua_rotate'
../lib/.libs/libtolua.a(tolua_push.o): In function `tolua_pushusertype':
tolua_push.c:(.text+0x19d): undefined reference to `lua_rotate'
tolua_push.c:(.text+0x252): undefined reference to `lua_rotate'
../lib/.libs/libtolua.a(tolua_to.o): In function `tolua_tonumber':
tolua_to.c:(.text+0x4b): undefined reference to `lua_tonumberx'
../lib/.libs/libtolua.a(tolua_to.o): In function `tolua_tofieldnumber':
tolua_to.c:(.text+0x297): undefined reference to `lua_tonumberx'
../lib/.libs/libtolua.a(tolua_event.o): In function `module_newindex_event':
tolua_event.c:(.text+0xb8): undefined reference to `lua_callk'
tolua_event.c:(.text+0x132): undefined reference to `lua_callk'
../lib/.libs/libtolua.a(tolua_event.o): In function `module_index_event':
tolua_event.c:(.text+0x24e): undefined reference to `lua_callk'
tolua_event.c:(.text+0x26e): undefined reference to `lua_callk'
../lib/.libs/libtolua.a(tolua_event.o): In function `class_len_event':
tolua_event.c:(.text+0x2e7): undefined reference to `lua_rotate'
tolua_event.c:(.text+0x36e): undefined reference to `lua_callk'
../lib/.libs/libtolua.a(tolua_event.o): In function `do_operator':
tolua_event.c:(.text+0x462): undefined reference to `lua_rotate'
tolua_event.c:(.text+0x4bb): undefined reference to `lua_callk'
../lib/.libs/libtolua.a(tolua_event.o): In function `class_gc_event':
tolua_event.c:(.text+0x6d9): undefined reference to `lua_callk'
../lib/.libs/libtolua.a(tolua_event.o): In function `storeatpeer.constprop.3':
tolua_event.c:(.text+0x783): undefined reference to `lua_rotate'
../lib/.libs/libtolua.a(tolua_event.o): In function `class_index_event':
tolua_event.c:(.text+0x8c2): undefined reference to `lua_rotate'
tolua_event.c:(.text+0x9c3): undefined reference to `lua_rotate'
tolua_event.c:(.text+0x9ee): undefined reference to `lua_rotate'
tolua_event.c:(.text+0xa73): undefined reference to `lua_callk'
../lib/.libs/libtolua.a(tolua_event.o): In function `class_newindex_event':
tolua_event.c:(.text+0xaf7): undefined reference to `lua_rotate'
tolua_event.c:(.text+0xbba): undefined reference to `lua_rotate'
tolua_event.c:(.text+0xc35): undefined reference to `lua_callk'
tolua_event.c:(.text+0xc84): undefined reference to `lua_callk'
../lib/.libs/libtolua.a(tolua_is.o): In function `tolua_typename':
tolua_is.c:(.text+0xf8): undefined reference to `lua_rotate'
../lib/.libs/libtolua.a(tolua_is.o): In function `tolua_isusertable':
tolua_is.c:(.text+0x668): undefined reference to `lua_rotate'
collect2: error: ld returned 1 exit status
Makefile:666: recipe for target 'tolua' failed
make2: * [tolua] Error 1
make2: Leaving directory '/Opslag/freeciv/dependencies/tolua-5.2/src/bin'
Makefile:636: recipe for target 'all-recursive' failed
make1:
[all-recursive] Error 1
make1: Leaving directory '/Opslag/freeciv/dependencies/tolua-5.2/src'
Makefile:640: recipe for target 'all-recursive' failed
make: *
* [all-recursive] Error 1
[x86] /Opslag/freeciv/dependencies/tolua-5.2>

History

#1 Updated by Luc Schrijvers over 1 year ago

Using "--enable-sys-tolua-cmd=true" seems to solve the problem, even though there is no tolua cmd?

#2 Updated by Luc Schrijvers over 1 year ago

Seems to be needed for scriptcore:

Making all in scriptcore
make3: Entering directory '/Opslag/freeciv/common/scriptcore'
unavailable -n common_a -o ./tolua_common_a_gen.c \
-H ./tolua_common_a_gen.h ./tolua_common_a.pkg
make3: unavailable: Command not found
Makefile:1018: recipe for target 'tolua_common_a_gen.c' failed
make3: * [tolua_common_a_gen.c] Error 127
make3: Leaving directory '/Opslag/freeciv/common/scriptcore'
Makefile:1015: recipe for target 'all-recursive' failed
make2:
[all-recursive] Error 1
make2: Leaving directory '/Opslag/freeciv/common'
Makefile:839: recipe for target 'all' failed
make1:
[all] Error 2
rm packets_generate
make1: Leaving directory '/Opslag/freeciv/common'
Makefile:808: recipe for target 'all-recursive' failed
make: *
[all-recursive] Error 1

#3 Updated by Marko Lindqvist over 1 year ago

The explanation to why it was working with 2.6.4 and not with S3_0 is that former is build from a tarball which already has all the files generated, and tolua is not needed. So assuming also S2_6 would be affected, if built directly from git.

What is the value of LUA_LIBS in Makefiles? Does build with --disable-sys-lua work better?

#4 Updated by Luc Schrijvers over 1 year ago

Values in the Makefiles for LUA_LIBS/LUA_INCLUDES is fine, need to check without sys-lua then ....
PS using http://files.freeciv.org/packages/windows/testing/cazfi/tarballs/alphas/S3_0-alpha5/freeciv-3.0.0-alpha5.tar.xz led to the same thing

Edit using "--enable-sys-lua=no" seems to do the trick

#5 Updated by Luc Schrijvers over 1 year ago

Seems there was some misinterpretation of the lua library, I had lua5.1 and lua5.2 co-installed, after removing it's ok, so this can be closed (sorry for the noise but thanks for taking the time to investigate!) :)

#6 Updated by Marko Lindqvist over 1 year ago

  • Tracker changed from Task to Bug
  • Status changed from New to Closed

Assuming the bug to be in how Haiku handles co-existing lua installations, so closing this freeciv ticket.

Also available in: Atom PDF