summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Pall <mike>2023-08-21 03:18:35 +0200
committerMike Pall <mike>2023-08-21 03:18:35 +0200
commit2090842410e0ba6f81fad310a77bf5432488249a (patch)
tree2845b2d74f15cbb524801a53687151bb797a8e78 /src
parentf0ff869bc2fffa17bb765c4c773457578da125a9 (diff)
parent50e0fa03c48cb9af03c3efdc3100f12687651a2e (diff)
downloadluajit-2.1.ROLLING.tar.gz
luajit-2.1.ROLLING.tar.bz2
luajit-2.1.ROLLING.zip
Merge branch 'master' into v2.1v2.1.ROLLING
Diffstat (limited to '')
-rw-r--r--src/.gitignore2
-rw-r--r--src/Makefile23
-rw-r--r--src/host/buildvm.c1
-rw-r--r--src/host/genversion.lua43
-rw-r--r--src/jit/bc.lua1
-rw-r--r--src/jit/bcsave.lua2
-rw-r--r--src/jit/dump.lua1
-rw-r--r--src/jit/p.lua1
-rw-r--r--src/jit/v.lua1
-rw-r--r--src/lib_jit.c2
-rw-r--r--src/luaconf.h2
-rw-r--r--src/luajit_rolling.h (renamed from src/luajit.h)6
12 files changed, 68 insertions, 17 deletions
diff --git a/src/.gitignore b/src/.gitignore
index 1a30573c..736a729a 100644
--- a/src/.gitignore
+++ b/src/.gitignore
@@ -1,4 +1,6 @@
1luajit 1luajit
2luajit.h
3luajit_relver.txt
2lj_bcdef.h 4lj_bcdef.h
3lj_ffdef.h 5lj_ffdef.h
4lj_libdef.h 6lj_libdef.h
diff --git a/src/Makefile b/src/Makefile
index cc520fc8..3a6a4329 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -12,7 +12,6 @@
12 12
13MAJVER= 2 13MAJVER= 2
14MINVER= 1 14MINVER= 1
15RELVER= 0
16ABIVER= 5.1 15ABIVER= 5.1
17NODOTABIVER= 51 16NODOTABIVER= 51
18 17
@@ -323,13 +322,13 @@ ifeq (Darwin,$(TARGET_SYS))
323 TARGET_XCFLAGS+= -DLUAJIT_UNWIND_EXTERNAL 322 TARGET_XCFLAGS+= -DLUAJIT_UNWIND_EXTERNAL
324 TARGET_XSHLDFLAGS= -dynamiclib -single_module -undefined dynamic_lookup -fPIC 323 TARGET_XSHLDFLAGS= -dynamiclib -single_module -undefined dynamic_lookup -fPIC
325 TARGET_DYNXLDOPTS= 324 TARGET_DYNXLDOPTS=
326 TARGET_XSHLDFLAGS+= -install_name $(TARGET_DYLIBPATH) -compatibility_version $(MAJVER).$(MINVER) -current_version $(MAJVER).$(MINVER).$(RELVER) 325 TARGET_XSHLDFLAGS+= -install_name $(TARGET_DYLIBPATH) -compatibility_version $(MAJVER).$(MINVER) -current_version $(MAJVER).$(MINVER).255
327else 326else
328ifeq (iOS,$(TARGET_SYS)) 327ifeq (iOS,$(TARGET_SYS))
329 TARGET_STRIP+= -x 328 TARGET_STRIP+= -x
330 TARGET_XSHLDFLAGS= -dynamiclib -single_module -undefined dynamic_lookup -fPIC 329 TARGET_XSHLDFLAGS= -dynamiclib -single_module -undefined dynamic_lookup -fPIC
331 TARGET_DYNXLDOPTS= 330 TARGET_DYNXLDOPTS=
332 TARGET_XSHLDFLAGS+= -install_name $(TARGET_DYLIBPATH) -compatibility_version $(MAJVER).$(MINVER) -current_version $(MAJVER).$(MINVER).$(RELVER) 331 TARGET_XSHLDFLAGS+= -install_name $(TARGET_DYLIBPATH) -compatibility_version $(MAJVER).$(MINVER) -current_version $(MAJVER).$(MINVER).255
333 ifeq (arm64,$(TARGET_LJARCH)) 332 ifeq (arm64,$(TARGET_LJARCH))
334 TARGET_XCFLAGS+= -fno-omit-frame-pointer 333 TARGET_XCFLAGS+= -fno-omit-frame-pointer
335 endif 334 endif
@@ -388,10 +387,11 @@ MINILUA_O= host/minilua.o
388MINILUA_LIBS= -lm 387MINILUA_LIBS= -lm
389MINILUA_T= host/minilua 388MINILUA_T= host/minilua
390MINILUA_X= $(MINILUA_T) 389MINILUA_X= $(MINILUA_T)
390MINILUA_DEP=
391 391
392ifeq (,$(HOST_LUA)) 392ifeq (,$(HOST_LUA))
393 HOST_LUA= $(MINILUA_X) 393 HOST_LUA= $(MINILUA_X)
394 DASM_DEP= $(MINILUA_T) 394 MINILUA_DEP= $(MINILUA_T)
395endif 395endif
396 396
397DASM_DIR= ../dynasm 397DASM_DIR= ../dynasm
@@ -474,6 +474,10 @@ endif
474DASM_FLAGS= $(DASM_XFLAGS) $(DASM_AFLAGS) 474DASM_FLAGS= $(DASM_XFLAGS) $(DASM_AFLAGS)
475DASM_DASC= vm_$(DASM_ARCH).dasc 475DASM_DASC= vm_$(DASM_ARCH).dasc
476 476
477GIT= git
478GIT_RELVER= [ -d ../.git ] && $(GIT) show -s --format=%ct >luajit_relver.txt 2>/dev/null || cat ../.relver >luajit_relver.txt 2>/dev/null || :
479GIT_DEP= $(wildcard ../.git/HEAD ../.git/refs/heads/*)
480
477BUILDVM_O= host/buildvm.o host/buildvm_asm.o host/buildvm_peobj.o \ 481BUILDVM_O= host/buildvm.o host/buildvm_asm.o host/buildvm_peobj.o \
478 host/buildvm_lib.o host/buildvm_fold.o 482 host/buildvm_lib.o host/buildvm_fold.o
479BUILDVM_T= host/buildvm 483BUILDVM_T= host/buildvm
@@ -520,8 +524,8 @@ LUAJIT_T= luajit
520 524
521ALL_T= $(LUAJIT_T) $(LUAJIT_A) $(LUAJIT_SO) $(HOST_T) 525ALL_T= $(LUAJIT_T) $(LUAJIT_A) $(LUAJIT_SO) $(HOST_T)
522ALL_HDRGEN= lj_bcdef.h lj_ffdef.h lj_libdef.h lj_recdef.h lj_folddef.h \ 526ALL_HDRGEN= lj_bcdef.h lj_ffdef.h lj_libdef.h lj_recdef.h lj_folddef.h \
523 host/buildvm_arch.h 527 host/buildvm_arch.h luajit.h
524ALL_GEN= $(LJVM_S) $(ALL_HDRGEN) $(LIB_VMDEFP) 528ALL_GEN= $(LJVM_S) $(ALL_HDRGEN) luajit_relver.txt $(LIB_VMDEFP)
525WIN_RM= *.obj *.lib *.exp *.dll *.exe *.manifest *.pdb *.ilk 529WIN_RM= *.obj *.lib *.exp *.dll *.exe *.manifest *.pdb *.ilk
526ALL_RM= $(ALL_T) $(ALL_GEN) *.o host/*.o $(WIN_RM) 530ALL_RM= $(ALL_T) $(ALL_GEN) *.o host/*.o $(WIN_RM)
527 531
@@ -645,7 +649,12 @@ $(MINILUA_T): $(MINILUA_O)
645 $(E) "HOSTLINK $@" 649 $(E) "HOSTLINK $@"
646 $(Q)$(HOST_CC) $(HOST_ALDFLAGS) -o $@ $(MINILUA_O) $(MINILUA_LIBS) $(HOST_ALIBS) 650 $(Q)$(HOST_CC) $(HOST_ALDFLAGS) -o $@ $(MINILUA_O) $(MINILUA_LIBS) $(HOST_ALIBS)
647 651
648host/buildvm_arch.h: $(DASM_DASC) $(DASM_DEP) $(DASM_DIR)/*.lua lj_arch.h lua.h luaconf.h 652luajit.h: $(MINILUA_DEP) $(GIT_DEP) luajit_rolling.h
653 $(E) "VERSION $@"
654 $(Q)$(GIT_RELVER)
655 $(Q)$(HOST_LUA) host/genversion.lua
656
657host/buildvm_arch.h: $(DASM_DASC) $(MINILUA_DEP) lj_arch.h lua.h luaconf.h
649 $(E) "DYNASM $@" 658 $(E) "DYNASM $@"
650 $(Q)$(DASM) $(DASM_FLAGS) -o $@ $(DASM_DASC) 659 $(Q)$(DASM) $(DASM_FLAGS) -o $@ $(DASM_DASC)
651 660
diff --git a/src/host/buildvm.c b/src/host/buildvm.c
index 6e96bffa..ec99e501 100644
--- a/src/host/buildvm.c
+++ b/src/host/buildvm.c
@@ -329,6 +329,7 @@ static void emit_vmdef(BuildCtx *ctx)
329#endif 329#endif
330 int i; 330 int i;
331 fprintf(ctx->fp, "-- This is a generated file. DO NOT EDIT!\n\n"); 331 fprintf(ctx->fp, "-- This is a generated file. DO NOT EDIT!\n\n");
332 fprintf(ctx->fp, "assert(require(\"jit\").version == \"%s\", \"LuaJIT core/library version mismatch\")\n\n", LUAJIT_VERSION);
332 fprintf(ctx->fp, "return {\n\n"); 333 fprintf(ctx->fp, "return {\n\n");
333 334
334 fprintf(ctx->fp, "bcnames = \""); 335 fprintf(ctx->fp, "bcnames = \"");
diff --git a/src/host/genversion.lua b/src/host/genversion.lua
new file mode 100644
index 00000000..a38cec56
--- /dev/null
+++ b/src/host/genversion.lua
@@ -0,0 +1,43 @@
1----------------------------------------------------------------------------
2-- Lua script to embed the rolling release version in luajit.h.
3----------------------------------------------------------------------------
4-- Copyright (C) 2005-2023 Mike Pall. All rights reserved.
5-- Released under the MIT license. See Copyright Notice in luajit.h
6----------------------------------------------------------------------------
7
8local FILE_INPUT_H = "luajit_rolling.h"
9local FILE_INPUT_R = "luajit_relver.txt"
10local FILE_OUTPUT_H = "luajit.h"
11
12local function file_read(file)
13 local fp = assert(io.open(file, "rb"), "run from the wrong directory")
14 local data = assert(fp:read("*a"))
15 fp:close()
16 return data
17end
18
19local function file_write_mod(file, data)
20 local fp = io.open(file, "rb")
21 if fp then
22 local odata = assert(fp:read("*a"))
23 fp:close()
24 if odata == data then return end
25 end
26 fp = assert(io.open(file, "wb"))
27 assert(fp:write(data))
28 assert(fp:close())
29end
30
31local text = file_read(FILE_INPUT_H)
32local relver = file_read(FILE_INPUT_R):match("(%d+)")
33
34if relver then
35 text = text:gsub("ROLLING", relver)
36else
37 io.stderr:write([[
38**** WARNING Cannot determine rolling release version from git log.
39**** WARNING The 'git' command must be available during the build.
40]])
41end
42
43file_write_mod(FILE_OUTPUT_H, text)
diff --git a/src/jit/bc.lua b/src/jit/bc.lua
index bf0812d8..f1a63b9c 100644
--- a/src/jit/bc.lua
+++ b/src/jit/bc.lua
@@ -41,7 +41,6 @@
41 41
42-- Cache some library functions and objects. 42-- Cache some library functions and objects.
43local jit = require("jit") 43local jit = require("jit")
44assert(jit.version_num == 20100, "LuaJIT core/library version mismatch")
45local jutil = require("jit.util") 44local jutil = require("jit.util")
46local vmdef = require("jit.vmdef") 45local vmdef = require("jit.vmdef")
47local bit = require("bit") 46local bit = require("bit")
diff --git a/src/jit/bcsave.lua b/src/jit/bcsave.lua
index 0f046669..74699f3d 100644
--- a/src/jit/bcsave.lua
+++ b/src/jit/bcsave.lua
@@ -11,7 +11,7 @@
11------------------------------------------------------------------------------ 11------------------------------------------------------------------------------
12 12
13local jit = require("jit") 13local jit = require("jit")
14assert(jit.version_num == 20100, "LuaJIT core/library version mismatch") 14assert(jit.version_num == 20199, "LuaJIT core/library version mismatch")
15local bit = require("bit") 15local bit = require("bit")
16 16
17-- Symbol name prefix for LuaJIT bytecode. 17-- Symbol name prefix for LuaJIT bytecode.
diff --git a/src/jit/dump.lua b/src/jit/dump.lua
index 364df151..746732f9 100644
--- a/src/jit/dump.lua
+++ b/src/jit/dump.lua
@@ -55,7 +55,6 @@
55 55
56-- Cache some library functions and objects. 56-- Cache some library functions and objects.
57local jit = require("jit") 57local jit = require("jit")
58assert(jit.version_num == 20100, "LuaJIT core/library version mismatch")
59local jutil = require("jit.util") 58local jutil = require("jit.util")
60local vmdef = require("jit.vmdef") 59local vmdef = require("jit.vmdef")
61local funcinfo, funcbc = jutil.funcinfo, jutil.funcbc 60local funcinfo, funcbc = jutil.funcinfo, jutil.funcbc
diff --git a/src/jit/p.lua b/src/jit/p.lua
index 3daa9291..36f836c5 100644
--- a/src/jit/p.lua
+++ b/src/jit/p.lua
@@ -41,7 +41,6 @@
41 41
42-- Cache some library functions and objects. 42-- Cache some library functions and objects.
43local jit = require("jit") 43local jit = require("jit")
44assert(jit.version_num == 20100, "LuaJIT core/library version mismatch")
45local profile = require("jit.profile") 44local profile = require("jit.profile")
46local vmdef = require("jit.vmdef") 45local vmdef = require("jit.vmdef")
47local math = math 46local math = math
diff --git a/src/jit/v.lua b/src/jit/v.lua
index 790ea3b2..8e91f494 100644
--- a/src/jit/v.lua
+++ b/src/jit/v.lua
@@ -59,7 +59,6 @@
59 59
60-- Cache some library functions and objects. 60-- Cache some library functions and objects.
61local jit = require("jit") 61local jit = require("jit")
62assert(jit.version_num == 20100, "LuaJIT core/library version mismatch")
63local jutil = require("jit.util") 62local jutil = require("jit.util")
64local vmdef = require("jit.vmdef") 63local vmdef = require("jit.vmdef")
65local funcinfo, traceinfo = jutil.funcinfo, jutil.traceinfo 64local funcinfo, traceinfo = jutil.funcinfo, jutil.traceinfo
diff --git a/src/lib_jit.c b/src/lib_jit.c
index 2f2bc3b2..c0294927 100644
--- a/src/lib_jit.c
+++ b/src/lib_jit.c
@@ -743,7 +743,7 @@ LUALIB_API int luaopen_jit(lua_State *L)
743#endif 743#endif
744 lua_pushliteral(L, LJ_OS_NAME); 744 lua_pushliteral(L, LJ_OS_NAME);
745 lua_pushliteral(L, LJ_ARCH_NAME); 745 lua_pushliteral(L, LJ_ARCH_NAME);
746 lua_pushinteger(L, LUAJIT_VERSION_NUM); 746 lua_pushinteger(L, LUAJIT_VERSION_NUM); /* Deprecated. */
747 lua_pushliteral(L, LUAJIT_VERSION); 747 lua_pushliteral(L, LUAJIT_VERSION);
748 LJ_LIB_REG(L, LUA_JITLIBNAME, jit); 748 LJ_LIB_REG(L, LUA_JITLIBNAME, jit);
749#if LJ_HASPROFILE 749#if LJ_HASPROFILE
diff --git a/src/luaconf.h b/src/luaconf.h
index fc7b4aae..f47f0680 100644
--- a/src/luaconf.h
+++ b/src/luaconf.h
@@ -37,7 +37,7 @@
37#endif 37#endif
38#define LUA_LROOT "/usr/local" 38#define LUA_LROOT "/usr/local"
39#define LUA_LUADIR "/lua/5.1/" 39#define LUA_LUADIR "/lua/5.1/"
40#define LUA_LJDIR "/luajit-2.1.0-beta3/" 40#define LUA_LJDIR "/luajit-2.1/"
41 41
42#ifdef LUA_ROOT 42#ifdef LUA_ROOT
43#define LUA_JROOT LUA_ROOT 43#define LUA_JROOT LUA_ROOT
diff --git a/src/luajit.h b/src/luajit_rolling.h
index f01771ae..e564477a 100644
--- a/src/luajit.h
+++ b/src/luajit_rolling.h
@@ -30,9 +30,9 @@
30 30
31#include "lua.h" 31#include "lua.h"
32 32
33#define LUAJIT_VERSION "LuaJIT 2.1.0-beta3" 33#define LUAJIT_VERSION "LuaJIT 2.1.ROLLING"
34#define LUAJIT_VERSION_NUM 20100 /* Version 2.1.0 = 02.01.00. */ 34#define LUAJIT_VERSION_NUM 20199 /* Deprecated. */
35#define LUAJIT_VERSION_SYM luaJIT_version_2_1_0_beta3 35#define LUAJIT_VERSION_SYM luaJIT_version_2_1_ROLLING
36#define LUAJIT_COPYRIGHT "Copyright (C) 2005-2023 Mike Pall" 36#define LUAJIT_COPYRIGHT "Copyright (C) 2005-2023 Mike Pall"
37#define LUAJIT_URL "https://luajit.org/" 37#define LUAJIT_URL "https://luajit.org/"
38 38