summaryrefslogtreecommitdiffstats
path: root/external/meta-openembedded/meta-oe/recipes-devtools/lua
diff options
context:
space:
mode:
Diffstat (limited to 'external/meta-openembedded/meta-oe/recipes-devtools/lua')
-rw-r--r--external/meta-openembedded/meta-oe/recipes-devtools/lua/lua/0001-Allow-building-lua-without-readline-on-Linux.patch59
-rw-r--r--external/meta-openembedded/meta-oe/recipes-devtools/lua/lua/CVE-2019-6706.patch32
-rw-r--r--external/meta-openembedded/meta-oe/recipes-devtools/lua/lua_5.3.5.bb (renamed from external/meta-openembedded/meta-oe/recipes-devtools/lua/lua_5.3.4.bb)23
3 files changed, 74 insertions, 40 deletions
diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/lua/lua/0001-Allow-building-lua-without-readline-on-Linux.patch b/external/meta-openembedded/meta-oe/recipes-devtools/lua/lua/0001-Allow-building-lua-without-readline-on-Linux.patch
new file mode 100644
index 00000000..e7679008
--- /dev/null
+++ b/external/meta-openembedded/meta-oe/recipes-devtools/lua/lua/0001-Allow-building-lua-without-readline-on-Linux.patch
@@ -0,0 +1,59 @@
+From 601ef636fc4dfb2af3e7fda88d8ea1c1d92affe4 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Wed, 2 Oct 2019 17:54:15 +0200
+Subject: [PATCH] Allow building lua without readline on Linux
+
+Upstream-Status: Pending
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ Makefile | 2 +-
+ src/Makefile | 3 +++
+ src/luaconf.h | 5 +++++
+ 3 files changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 119110d..9f6df45 100644
+--- a/Makefile
++++ b/Makefile
+@@ -36,7 +36,7 @@ RM= rm -f
+ # == END OF USER SETTINGS -- NO NEED TO CHANGE ANYTHING BELOW THIS LINE =======
+
+ # Convenience platforms targets.
+-PLATS= aix bsd c89 freebsd generic linux macosx mingw posix solaris
++PLATS= aix bsd c89 freebsd generic linux linux-no-readline macosx mingw posix solaris
+
+ # What to install.
+ TO_BIN= lua luac
+diff --git a/src/Makefile b/src/Makefile
+index 64c78f7..5c0428a 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -109,6 +109,9 @@ generic: $(ALL)
+ linux:
+ $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline"
+
++linux-no-readline:
++ $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX_NO_READLINE" SYSLIBS="-Wl,-E -ldl"
++
+ macosx:
+ $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX" SYSLIBS="-lreadline"
+
+diff --git a/src/luaconf.h b/src/luaconf.h
+index 9eeeea6..d71ca25 100644
+--- a/src/luaconf.h
++++ b/src/luaconf.h
+@@ -64,6 +64,11 @@
+ #define LUA_USE_READLINE /* needs some extra libraries */
+ #endif
+
++#if defined(LUA_USE_LINUX_NO_READLINE)
++#define LUA_USE_POSIX
++#define LUA_USE_DLOPEN /* needs an extra library: -ldl */
++#endif
++
+
+ #if defined(LUA_USE_MACOSX)
+ #define LUA_USE_POSIX
+--
+2.17.1
+
diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/lua/lua/CVE-2019-6706.patch b/external/meta-openembedded/meta-oe/recipes-devtools/lua/lua/CVE-2019-6706.patch
deleted file mode 100644
index cfe48af5..00000000
--- a/external/meta-openembedded/meta-oe/recipes-devtools/lua/lua/CVE-2019-6706.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-CVE-2019-6706: use-after-free in lua_upvaluejoin function
-
-Upstream-Status: Backport
-http://lua.2524044.n2.nabble.com/CVE-2019-6706-use-after-free-in-lua-upvaluejoin-function-tc7685575.html
-CVE: CVE-2019-6706
-Affects < 5.3.5
-Signed-off-by: Armin Kuster <akuster@mvista.com>
-
-Index: lua-5.3.4/src/lapi.c
-===================================================================
---- lua-5.3.4.orig/src/lapi.c
-+++ lua-5.3.4/src/lapi.c
-@@ -1285,14 +1285,14 @@ LUA_API void *lua_upvalueid (lua_State *
-
- LUA_API void lua_upvaluejoin (lua_State *L, int fidx1, int n1,
- int fidx2, int n2) {
-- LClosure *f1;
-- UpVal **up1 = getupvalref(L, fidx1, n1, &f1);
-+ UpVal **up1 = getupvalref(L, fidx1, n1, NULL); /* the last parameter not needed */
- UpVal **up2 = getupvalref(L, fidx2, n2, NULL);
-+ if (*up1 == *up2) return; /* Already joined */
-+ (*up2)->refcount++;
-+ if (upisopen(*up2)) (*up2)->u.open.touched = 1;
-+ luaC_upvalbarrier(L, *up2);
- luaC_upvdeccount(L, *up1);
- *up1 = *up2;
-- (*up1)->refcount++;
-- if (upisopen(*up1)) (*up1)->u.open.touched = 1;
-- luaC_upvalbarrier(L, *up1);
- }
-
-
diff --git a/external/meta-openembedded/meta-oe/recipes-devtools/lua/lua_5.3.4.bb b/external/meta-openembedded/meta-oe/recipes-devtools/lua/lua_5.3.5.bb
index 978c2033..a23a4a5d 100644
--- a/external/meta-openembedded/meta-oe/recipes-devtools/lua/lua_5.3.4.bb
+++ b/external/meta-openembedded/meta-oe/recipes-devtools/lua/lua_5.3.5.bb
@@ -4,35 +4,42 @@ LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://doc/readme.html;beginline=318;endline=352;md5=60aa5cfdbd40086501778d9b6ebf29ee"
HOMEPAGE = "http://www.lua.org/"
-DEPENDS = "readline"
SRC_URI = "http://www.lua.org/ftp/lua-${PV}.tar.gz;name=tarballsrc \
file://lua.pc.in \
- file://CVE-2019-6706.patch \
+ file://0001-Allow-building-lua-without-readline-on-Linux.patch \
"
+
+# if no test suite matches PV release of Lua exactly, download the suite for the closest Lua release.
+PV_testsuites = "5.3.4"
+
SRC_URI += "${@bb.utils.contains('DISTRO_FEATURES', 'ptest', \
- 'http://www.lua.org/tests/lua-${PV}-tests.tar.gz;name=tarballtest \
+ 'http://www.lua.org/tests/lua-${PV_testsuites}-tests.tar.gz;name=tarballtest \
file://run-ptest \
', '', d)}"
-SRC_URI[tarballsrc.md5sum] = "53a9c68bcc0eda58bdc2095ad5cdfc63"
-SRC_URI[tarballsrc.sha256sum] = "f681aa518233bc407e23acf0f5887c884f17436f000d453b2491a9f11a52400c"
+SRC_URI[tarballsrc.md5sum] = "4f4b4f323fd3514a68e0ab3da8ce3455"
+SRC_URI[tarballsrc.sha256sum] = "0c2eed3f960446e1a3e4b9a1ca2f3ff893b6ce41942cf54d5dd59ab4b3b058ac"
SRC_URI[tarballtest.md5sum] = "b14fe3748c1cb2d74e3acd1943629ba3"
SRC_URI[tarballtest.sha256sum] = "b80771238271c72565e5a1183292ef31bd7166414cd0d43a8eb79845fa7f599f"
inherit pkgconfig binconfig ptest
+PACKAGECONFIG ??= "readline"
+PACKAGECONFIG[readline] = ",,readline"
+
UCLIBC_PATCHES += "file://uclibc-pthread.patch"
SRC_URI_append_libc-uclibc = "${UCLIBC_PATCHES}"
TARGET_CC_ARCH += " -fPIC ${LDFLAGS}"
-EXTRA_OEMAKE = "'CC=${CC} -fPIC' 'MYCFLAGS=${CFLAGS} -DLUA_USE_LINUX -fPIC' MYLDFLAGS='${LDFLAGS}'"
+EXTRA_OEMAKE = "'CC=${CC} -fPIC' 'MYCFLAGS=${CFLAGS} -fPIC' MYLDFLAGS='${LDFLAGS}'"
do_configure_prepend() {
sed -i -e s:/usr/local:${prefix}:g src/luaconf.h
+ sed -i -e s:lib/lua/:${baselib}/lua/:g src/luaconf.h
}
do_compile () {
- oe_runmake linux
+ oe_runmake ${@bb.utils.contains('PACKAGECONFIG', 'readline', 'linux', 'linux-no-readline', d)}
}
do_install () {
@@ -54,7 +61,7 @@ do_install () {
}
do_install_ptest () {
- cp -R --no-dereference --preserve=mode,links -v ${WORKDIR}/lua-${PV}-tests ${D}${PTEST_PATH}/test
+ cp -R --no-dereference --preserve=mode,links -v ${WORKDIR}/lua-${PV_testsuites}-tests ${D}${PTEST_PATH}/test
}
BBCLASSEXTEND = "native nativesdk"