Broken for Lua 5.1

89 views
Skip to first unread message

Jörg Krause

unread,
Jul 31, 2017, 4:06:42 PM7/31/17
to swupdate
Hi Stefano,

since version 2017.07 swupdate cannot be build with Lua 5.1 anymore, but could before:

Output of:
/home/joerg/Development/git/buildroot/output/host/bin/armv7-ctng-linux-gnueabihf-gcc -Wall -Wshadow -Wwrite-strings -Wundef -Wstrict-prototypes -Wunused -Wunused-parameter -Wunused-function -Wunused-value -Wmissing-prototypes -Wmissing-declarations -Wno-format-security -Wold-style-definition -finline-limit=0 -fno-builtin-strlen -fomit-frame-pointer -ffunction-sections -fdata-sections -fno-guess-branch-probability -funsigned-char -falign-functions=1 -falign-jumps=1 -falign-labels=1 -falign-loops=1 -static-libgcc -fno-unwind-tables -fno-asynchronous-unwind-tables -Os -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os --sysroot=/home/joerg/Development/git/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot -I/home/joerg/Development/git/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/luajit-2.0 -DNO_SSL -DUSE_LUA -DUSE_IPV6 -Wl,-E -o swupdate_unstripped -Wl,--sort-common -Wl,--sort-section,alignment -Wl,--gc-sections -Wl,--start-group core/built-in.o handlers/built-in.o archival/lib.a corelib/lib.a ipc/lib.a mongoose/lib.a parser/lib.a suricatta/lib.a bootloader/lib.a -Wl,--end-group -Wl,--start-group -lpthread -lluajit-5.1 -lconfig -Wl,--end-group
==========
corelib/lib.a(lua_interface.o): In function `luaopen_swupdate':
lua_interface.c:(.text.luaopen_swupdate+0xc): undefined reference to `luaL_newlib'
corelib/lib.a(lua_interface.o): In function `lua_parser_init':
lua_interface.c:(.text.lua_parser_init+0x30): undefined reference to `luaL_requiref'
collect2: error: ld returned 1 exit status


Not sure, if dropping support for Lua 5.1 is intended.

Best regards,
Jörg Krause

Stefano Babic

unread,
Jul 31, 2017, 4:44:59 PM7/31/17
to Jörg Krause, swupdate
Hi Jörg,
It was not intended, but it is difficult to be compatible with all
version of external libraries. I test a new release together with
current release of Yocto, and I use versions of libraries provided by
that release. 2017.07 is supported by -pyro and -master, and both
provide LUA 5.3.

I guess that it worked for you with 5.1 just because you have not set
CONFIG_HANDLER_IN_LUA. I suspect that your build fails as well if you
set it, because there is no big changes in 2017.07, but that code was
previously compiled just if CONFIG_HANDLER_IN_LUA is set.

Anyway, 2017.07 allows to have LUA script directly into sw-description,
and for this reason the code in lua_interface is now built if just
CONFIG_LUA is set.

Best regards,
Stefano

--
=====================================================================
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=====================================================================

Jörg Krause

unread,
Aug 2, 2017, 2:31:55 AM8/2/17
to Stefano Babic, swupdate
Hi Stefano,
So, do you plan to support Lua 5.1 to 5.3, or just 5.3?

> I guess that it worked for you with 5.1 just because you have not set
> CONFIG_HANDLER_IN_LUA. I suspect that your build fails as well if you
> set it, because there is no big changes in 2017.07, but that code was
> previously compiled just if CONFIG_HANDLER_IN_LUA is set.

Yes, it worked as long as CONFIG_HANDLER_IN_LUA was not selected.

> Anyway, 2017.07 allows to have LUA script directly into sw-
> description,
> and for this reason the code in lua_interface is now built if just
> CONFIG_LUA is set.

I see!


Best regards,
Jörg Krause

Stefano Babic

unread,
Aug 2, 2017, 3:11:38 AM8/2/17
to Jörg Krause, Stefano Babic, swupdate
Hi Jörg,
No, my projects use 5.2 or 5.3. I have no projects with older LUA's
versions and according to LUA's ML is recommended to take one on the
last versions.

As far as I understand, the main reason to remain with 5.1 is LUAJit
because it is not supported after 5.1.

>
>> I guess that it worked for you with 5.1 just because you have not set
>> CONFIG_HANDLER_IN_LUA. I suspect that your build fails as well if you
>> set it, because there is no big changes in 2017.07, but that code was
>> previously compiled just if CONFIG_HANDLER_IN_LUA is set.
>
> Yes, it worked as long as CONFIG_HANDLER_IN_LUA was not selected.
>
>> Anyway, 2017.07 allows to have LUA script directly into sw-
>> description,
>> and for this reason the code in lua_interface is now built if just
>> CONFIG_LUA is set.
>
> I see!

Best regards,

Jörg Krause

unread,
Aug 2, 2017, 3:25:48 AM8/2/17
to Stefano Babic, swupdate
Hi Stefano,
Yes, the main reason with Lua 5.1 is to support LuaJIT. I am using
LuaJIT for my projects, but I am not using SWupdate with Lua support.
So, if someone is interested in enabling support for Lua 5.1, would you
accept the changes?

Jörg

Stefano Babic

unread,
Aug 2, 2017, 3:34:05 AM8/2/17
to Jörg Krause, Stefano Babic, swupdate
Hi Jörg,

On 02/08/2017 09:25, Jörg Krause wrote:

>> As far as I understand, the main reason to remain with 5.1 is LUAJit
>> because it is not supported after 5.1.
>
> Yes, the main reason with Lua 5.1 is to support LuaJIT. I am using
> LuaJIT for my projects, but I am not using SWupdate with Lua support.
> So, if someone is interested in enabling support for Lua 5.1, would you
> accept the changes?

A new feature, including support for older version, is always well
accepted - if it does not break the current behavior :-). I have nothing
against it.

Regards,
Reply all
Reply to author
Forward
0 new messages