Skip to content

Commit

Permalink
luajit: update Makefile to build from git
Browse files Browse the repository at this point in the history
LuaJIT has a "rolling release" where we should follow git HEAD[1].
I believe that the currently tagged version is tracking code from
2017.  This PR updates the Makefile to latest HEAD.

Closes openwrt#25299

1. https://luajit.org/download.html

Build system: x86/64
Build-tested: x86/64/AMD Cezanne
Run-tested: x86/64/AMD Cezanne

Signed-off-by: John Audia <[email protected]>
  • Loading branch information
graysky2 committed Nov 16, 2024
1 parent 2a139f8 commit 218a0b0
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 3,601 deletions.
16 changes: 7 additions & 9 deletions lang/luajit/Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=luajit
PKG_VERSION:=2.1.0
PKG_REAL_VERSION:=$(PKG_VERSION)-beta3
PKG_RELEASE:=8
PKG_SOURCE_DATE:=2024-11-13
PKG_VERSION:=2.1.$(subst -,,$(PKG_SOURCE_DATE))
PKG_RELEASE:=1

PKG_SOURCE:=LuaJIT-$(PKG_REAL_VERSION).tar.gz
PKG_SOURCE_URL:=https://luajit.org/download
PKG_HASH:=1ad2e34b111c802f9d0cdf019e986909123237a28c746b21295b63c9e785d9c3
PKG_BUILD_DIR:=$(BUILD_DIR)/LuaJIT-$(PKG_REAL_VERSION)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/LuaJIT/LuaJIT.git
PKG_SOURCE_VERSION:=69bbf3c1b01de8239444b0c430a89fa868978fea
PKG_MIRROR_HASH:=617aafabe07715e80019f0dc3b9bc28c77e95f5c390d2015ef386c4c58da17a0

PKG_MAINTAINER:=Morteza Milani <[email protected]>
PKG_LICENSE:=MIT
Expand Down Expand Up @@ -70,14 +70,12 @@ define Build/InstallDev
$(CP) $(PKG_INSTALL_DIR)/usr/lib/*so* $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/luajit.pc $(1)/usr/lib/pkgconfig/
$(CP) $(PKG_INSTALL_DIR)/usr/bin/luajit-$(PKG_REAL_VERSION) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME)
endef

define Package/luajit/install
$(INSTALL_DIR) $(1)/usr/lib/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/bin
$(CP) $(PKG_INSTALL_DIR)/usr/bin/luajit-$(PKG_REAL_VERSION) $(1)/usr/bin/$(PKG_NAME)
endef

define Host/Compile
Expand Down
2 changes: 1 addition & 1 deletion lang/luajit/patches/010-lua-path.patch
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
-#define LUA_LUADIR "/lua/5.1/"
+#define LUA_LROOT "/usr"
+#define LUA_LUADIR "/lua/"
#define LUA_LJDIR "/luajit-2.1.0-beta3/"

#ifdef LUA_ROOT
#define LUA_JROOT LUA_ROOT
12 changes: 0 additions & 12 deletions lang/luajit/patches/020-clang.patch

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Subject: [PATCH] Have powerpc use fake GOT like MIPS
/* Initialize instruction dispatch table and hot counters. */
void lj_dispatch_init(GG_State *GG)
{
@@ -77,6 +89,9 @@ void lj_dispatch_init(GG_State *GG)
@@ -79,6 +91,9 @@ void lj_dispatch_init(GG_State *GG)
#if LJ_TARGET_MIPS
memcpy(GG->got, dispatch_got, LJ_GOT__MAX*sizeof(ASMFunction *));
#endif
Expand Down Expand Up @@ -76,18 +76,19 @@ Subject: [PATCH] Have powerpc use fake GOT like MIPS
/* Type of hot counter. Must match the code in the assembler VM. */
/* 16 bits are sufficient. Only 0.0015% overhead with maximum slot penalty. */
typedef uint16_t HotCount;
@@ -89,7 +116,7 @@ typedef uint16_t HotCount;
typedef struct GG_State {
lua_State L; /* Main thread. */
global_State g; /* Global state. */
-#if LJ_TARGET_MIPS
+#if LJ_TARGET_MIPS || LJ_TARGET_PPC
@@ -96,6 +123,9 @@ typedef struct GG_State {
#if LJ_TARGET_MIPS
ASMFunction got[LJ_GOT__MAX]; /* Global offset table. */
#endif
+#if LJ_TARGET_PPC
+ memcpy(GG->got, dispatch_got, LJ_GOT__MAX*4);
+#endif
#if LJ_HASJIT
jit_State J; /* JIT state. */
HotCount hotcount[HOTCOUNT_SIZE]; /* Hot counters. */
--- a/src/vm_ppc.dasc
+++ b/src/vm_ppc.dasc
@@ -59,7 +59,12 @@
@@ -58,7 +58,12 @@
|.define ENV_OFS, 8
|.endif
|.else // No TOC.
Expand All @@ -101,7 +102,7 @@ Subject: [PATCH] Have powerpc use fake GOT like MIPS
|.macro .toc, a, b; .endmacro
|.endif
|.macro .tocenv, a, b; .if TOCENV; a, b; .endif; .endmacro
@@ -482,6 +487,8 @@
@@ -481,6 +486,8 @@
|// Assumes DISPATCH is relative to GL.
#define DISPATCH_GL(field) (GG_DISP2G + (int)offsetof(global_State, field))
#define DISPATCH_J(field) (GG_DISP2J + (int)offsetof(jit_State, field))
Expand Down

This file was deleted.

Loading

0 comments on commit 218a0b0

Please sign in to comment.