Monday, October 22, 2018

Fix luajit

From naddy@'s lld ports failure list:

benchmarks/wrk string table non-null terminated

This is caused by an off-by-one in luajit that has been fixed
upstream.

https://repo.or.cz/luajit-2.0.git/commitdiff/7dbf0b05f1228c1c719866db5e5f3d58f87f74c8

Apparently ld.lld checks the validity of its inputs a bit better than
ld.bfd.


Index: lang/luajit/Makefile
===================================================================
RCS file: /cvs/ports/lang/luajit/Makefile,v
retrieving revision 1.28
diff -u -p -r1.28 Makefile
--- lang/luajit/Makefile 21 Aug 2018 16:20:40 -0000 1.28
+++ lang/luajit/Makefile 22 Oct 2018 10:00:04 -0000
@@ -11,7 +11,7 @@ SHARED_LIBS += luajit-${MODLUA_VERSION}

COMMENT = just-in-time compiler for Lua
V = 2.0.5
-REVISION = 0
+REVISION = 1
DISTNAME = LuaJIT-${V}
PKGNAME = ${DISTNAME:L}

Index: lang/luajit/patches/patch-src_jit_bcsave_lua
===================================================================
RCS file: lang/luajit/patches/patch-src_jit_bcsave_lua
diff -N lang/luajit/patches/patch-src_jit_bcsave_lua
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lang/luajit/patches/patch-src_jit_bcsave_lua 22 Oct 2018 10:00:04 -0000
@@ -0,0 +1,14 @@
+$OpenBSD$
+
+Index: src/jit/bcsave.lua
+--- src/jit/bcsave.lua.orig
++++ src/jit/bcsave.lua
+@@ -275,7 +275,7 @@ typedef struct {
+ o.sect[2].size = fofs(ofs)
+ o.sect[3].type = f32(3) -- .strtab
+ o.sect[3].ofs = fofs(sofs + ofs)
+- o.sect[3].size = fofs(#symname+1)
++ o.sect[3].size = fofs(#symname+2)
+ ffi.copy(o.space+ofs+1, symname)
+ ofs = ofs + #symname + 2
+ o.sect[4].type = f32(1) -- .rodata

No comments:

Post a Comment