swaldhoer/native-lua

Update to Lua 5.3.5

Closed this issue · 6 comments

Download: Lua 5.3.5

  • Update sources
  • Change build instructions for FreeBSD
  • Change build instructions for macOS (nothing to do)
diff --git a/Makefile5.3.4 b/Makefile5.3.5
index d71c75c..64c78f7 100644
--- a/Makefile5.3.4
+++ b/Makefile5.3.5
@@ -102,7 +102,7 @@ c89:


 freebsd:
-       $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -lreadline"
+       $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX -DLUA_USE_READLINE -I/usr/include/edit" SYSLIBS="-Wl,-E -ledit" CC="cc"

 generic: $(ALL)

@@ -110,7 +110,7 @@ linux:
        $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline"

 macosx:
-       $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX" SYSLIBS="-lreadline" CC=cc
+       $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX" SYSLIBS="-lreadline"

 mingw:
        $(MAKE) "LUA_A=lua53.dll" "LUA_T=lua.exe" \

The diff of the Makefile shows that the setup for FreeBSD is wrong in the original sources. FreeBSD defines LUA_USE_LINUX and this implicitly redefines LUA_USE_READLINE:

luaconf.h

#if defined(LUA_USE_LINUX)
#define LUA_USE_POSIX
#define LUA_USE_DLOPEN		/* needs an extra library: -ldl */
#define LUA_USE_READLINE	/* needs some extra libraries */
#endif

LUA_USE_LINUX defines LUA_USE_DLOPEN, and thus should need dl library (dynamic linking library). However, building with LUA_USE_DLOPEN and not specifying the dl library works (see
this 8cbc1b5 or more precise this bf0ac2d)
Linking with dl library also works (see 314b978).

Running full tests on version 5.3.4 works locally (not on cirrus, not sure why). Running full tests fails in main.lua line 239 (https://github.com/swaldhoer/native-lua/runs/212079729).
Building the official release with make, leads to the same error, therefore there must be something wrong on the official build instructions.

The Makefile bug is known https://www.lua.org/bugs.html#5.3.5-1.

Fixed in #49