Skip to content

Commit 05c4102

Browse files
committed
Update LuaJIT to mainline 2.1 via Meson WrapDB
Turns out, Meson has a whole system for managing non-Meson dependencies with a bunch of prebuilt patches they maintain. One of them is LuaJIT, and it's newer than the rather ancient Meson-compatible LuaJIT fork by franko that lingered in this repo. The game builds and runs fine, (even with `--force-fallback-for=luajit`) and undefined behavior sanitizer no longer spews lots of errors about misaligned memory reads and stores. It might even have other bugfixes or performance improvements too, I don't know lmao One nice thing about this Wrap thing is that the new source folder, `LuaJit-04dca7911ea255f37be799c18d74c305b921c1a6`, can be deleted entirely. On build, if needed, Meson fetches it automatically from the luajit.wrap file (via external/sources/packagecache dir, which I .gitignore'd). I kept the folder though because, as I understand, it's the style of this repo to have all the dependencies self-contained for offline building or whatever. This commit also adds the .wraplock file to .gitignore. Meson adds this file there on every build ever since version 1.9.0 (released in this August), and it's getting annoying removing it or making sure it's not staged every time lol
1 parent 2906eb8 commit 05c4102

File tree

261 files changed

+3188
-6054
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

261 files changed

+3188
-6054
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ compile_commands.json
1818

1919
**/build*
2020

21+
# Meson Wrap cache stuff
22+
/external/sources/packagecache
23+
/external/sources/.wraplock
24+
2125
/enc_temp_folder
2226

2327
.vs/
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/.relver export-subst
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
*.[oa]
2+
*.so
3+
*.obj
4+
*.lib
5+
*.exp
6+
*.dll
7+
*.exe
8+
*.manifest
9+
*.dmp
10+
*.swp
11+
.tags
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
b5ac9c2f34c2925cf001559c753919425c5f86500fe1a1c02383c9b0eace9985
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1720049189

external/sources/LuaJIT-2.1/COPYRIGHT renamed to external/sources/LuaJIT-04dca7911ea255f37be799c18d74c305b921c1a6/COPYRIGHT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
===============================================================================
22
LuaJIT -- a Just-In-Time Compiler for Lua. https://luajit.org/
33

4-
Copyright (C) 2005-2022 Mike Pall. All rights reserved.
4+
Copyright (C) 2005-2023 Mike Pall. All rights reserved.
55

66
Permission is hereby granted, free of charge, to any person obtaining a copy
77
of this software and associated documentation files (the "Software"), to deal
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2021 The Meson development team
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19+
SOFTWARE.

external/sources/LuaJIT-2.1/Makefile renamed to external/sources/LuaJIT-04dca7911ea255f37be799c18d74c305b921c1a6/Makefile

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,21 @@
1010
# For MSVC, please follow the instructions given in src/msvcbuild.bat.
1111
# For MinGW and Cygwin, cd to src and run make with the Makefile there.
1212
#
13-
# Copyright (C) 2005-2022 Mike Pall. See Copyright Notice in luajit.h
13+
# Copyright (C) 2005-2023 Mike Pall. See Copyright Notice in luajit.h
1414
##############################################################################
1515

1616
MAJVER= 2
1717
MINVER= 1
18-
RELVER= 0
19-
PREREL= -beta3
20-
VERSION= $(MAJVER).$(MINVER).$(RELVER)$(PREREL)
2118
ABIVER= 5.1
2219

20+
# LuaJIT uses rolling releases. The release version is based on the time of
21+
# the latest git commit. The 'git' command must be available during the build.
22+
RELVER= $(shell cat src/luajit_relver.txt 2>/dev/null || : )
23+
# Note: setting it with := doesn't work, since it will change during the build.
24+
25+
MMVERSION= $(MAJVER).$(MINVER)
26+
VERSION= $(MMVERSION).$(RELVER)
27+
2328
##############################################################################
2429
#
2530
# Change the installation path as needed. This automatically adjusts
@@ -33,10 +38,10 @@ DPREFIX= $(DESTDIR)$(PREFIX)
3338
INSTALL_BIN= $(DPREFIX)/bin
3439
INSTALL_LIB= $(DPREFIX)/$(MULTILIB)
3540
INSTALL_SHARE= $(DPREFIX)/share
36-
INSTALL_DEFINC= $(DPREFIX)/include/luajit-$(MAJVER).$(MINVER)
41+
INSTALL_DEFINC= $(DPREFIX)/include/luajit-$(MMVERSION)
3742
INSTALL_INC= $(INSTALL_DEFINC)
3843

39-
INSTALL_LJLIBD= $(INSTALL_SHARE)/luajit-$(VERSION)
44+
INSTALL_LJLIBD= $(INSTALL_SHARE)/luajit-$(MMVERSION)
4045
INSTALL_JITLIB= $(INSTALL_LJLIBD)/jit
4146
INSTALL_LMODD= $(INSTALL_SHARE)/lua
4247
INSTALL_LMOD= $(INSTALL_LMODD)/$(ABIVER)
@@ -50,10 +55,10 @@ INSTALL_TSYMNAME= luajit
5055
INSTALL_ANAME= libluajit-$(ABIVER).a
5156
INSTALL_SOSHORT1= libluajit-$(ABIVER).so
5257
INSTALL_SOSHORT2= libluajit-$(ABIVER).so.$(MAJVER)
53-
INSTALL_SONAME= $(INSTALL_SOSHORT2).$(MINVER).$(RELVER)
58+
INSTALL_SONAME= libluajit-$(ABIVER).so.$(VERSION)
5459
INSTALL_DYLIBSHORT1= libluajit-$(ABIVER).dylib
5560
INSTALL_DYLIBSHORT2= libluajit-$(ABIVER).$(MAJVER).dylib
56-
INSTALL_DYLIBNAME= libluajit-$(ABIVER).$(MAJVER).$(MINVER).$(RELVER).dylib
61+
INSTALL_DYLIBNAME= libluajit-$(ABIVER).$(VERSION).dylib
5762
INSTALL_PCNAME= luajit.pc
5863

5964
INSTALL_STATIC= $(INSTALL_LIB)/$(INSTALL_ANAME)
@@ -78,7 +83,8 @@ INSTALL_F= install -m 0644
7883
UNINSTALL= $(RM)
7984
LDCONFIG= ldconfig -n 2>/dev/null
8085
SED_PC= sed -e "s|^prefix=.*|prefix=$(PREFIX)|" \
81-
-e "s|^multilib=.*|multilib=$(MULTILIB)|"
86+
-e "s|^multilib=.*|multilib=$(MULTILIB)|" \
87+
-e "s|^relver=.*|relver=$(RELVER)|"
8288
ifneq ($(INSTALL_DEFINC),$(INSTALL_INC))
8389
SED_PC+= -e "s|^includedir=.*|includedir=$(INSTALL_INC)|"
8490
endif
@@ -92,7 +98,9 @@ FILES_INC= lua.h lualib.h lauxlib.h luaconf.h lua.hpp luajit.h
9298
FILES_JITLIB= bc.lua bcsave.lua dump.lua p.lua v.lua zone.lua \
9399
dis_x86.lua dis_x64.lua dis_arm.lua dis_arm64.lua \
94100
dis_arm64be.lua dis_ppc.lua dis_mips.lua dis_mipsel.lua \
95-
dis_mips64.lua dis_mips64el.lua vmdef.lua
101+
dis_mips64.lua dis_mips64el.lua \
102+
dis_mips64r6.lua dis_mips64r6el.lua \
103+
vmdef.lua
96104

97105
ifeq (,$(findstring Windows,$(OS)))
98106
HOST_SYS:= $(shell uname -s)
@@ -106,16 +114,17 @@ ifeq (Darwin,$(TARGET_SYS))
106114
INSTALL_SOSHORT1= $(INSTALL_DYLIBSHORT1)
107115
INSTALL_SOSHORT2= $(INSTALL_DYLIBSHORT2)
108116
LDCONFIG= :
117+
SED_PC+= -e "s| -Wl,-E||"
109118
endif
110119

111120
##############################################################################
112121

113122
INSTALL_DEP= src/luajit
114123

115124
default all $(INSTALL_DEP):
116-
@echo "==== Building LuaJIT $(VERSION) ===="
125+
@echo "==== Building LuaJIT $(MMVERSION) ===="
117126
$(MAKE) -C src
118-
@echo "==== Successfully built LuaJIT $(VERSION) ===="
127+
@echo "==== Successfully built LuaJIT $(MMVERSION) ===="
119128

120129
install: $(INSTALL_DEP)
121130
@echo "==== Installing LuaJIT $(VERSION) to $(PREFIX) ===="
@@ -134,18 +143,12 @@ install: $(INSTALL_DEP)
134143
$(RM) $(FILE_PC).tmp
135144
cd src && $(INSTALL_F) $(FILES_INC) $(INSTALL_INC)
136145
cd src/jit && $(INSTALL_F) $(FILES_JITLIB) $(INSTALL_JITLIB)
146+
$(SYMLINK) $(INSTALL_TNAME) $(INSTALL_TSYM)
137147
@echo "==== Successfully installed LuaJIT $(VERSION) to $(PREFIX) ===="
138-
@echo ""
139-
@echo "Note: the development releases deliberately do NOT install a symlink for luajit"
140-
@echo "You can do this now by running this command (with sudo):"
141-
@echo ""
142-
@echo " $(SYMLINK) $(INSTALL_TNAME) $(INSTALL_TSYM)"
143-
@echo ""
144-
145148

146149
uninstall:
147150
@echo "==== Uninstalling LuaJIT $(VERSION) from $(PREFIX) ===="
148-
$(UNINSTALL) $(INSTALL_T) $(INSTALL_STATIC) $(INSTALL_DYN) $(INSTALL_SHORT1) $(INSTALL_SHORT2) $(INSTALL_MAN)/$(FILE_MAN) $(INSTALL_PC)
151+
$(UNINSTALL) $(INSTALL_TSYM) $(INSTALL_T) $(INSTALL_STATIC) $(INSTALL_DYN) $(INSTALL_SHORT1) $(INSTALL_SHORT2) $(INSTALL_MAN)/$(FILE_MAN) $(INSTALL_PC)
149152
for file in $(FILES_JITLIB); do \
150153
$(UNINSTALL) $(INSTALL_JITLIB)/$$file; \
151154
done
@@ -159,8 +162,9 @@ uninstall:
159162
##############################################################################
160163

161164
amalg:
162-
@echo "Building LuaJIT $(VERSION)"
165+
@echo "==== Building LuaJIT $(MMVERSION) (amalgamation) ===="
163166
$(MAKE) -C src amalg
167+
@echo "==== Successfully built LuaJIT $(MMVERSION) (amalgamation) ===="
164168

165169
clean:
166170
$(MAKE) -C src clean

external/sources/LuaJIT-2.1/README.md renamed to external/sources/LuaJIT-04dca7911ea255f37be799c18d74c305b921c1a6/README

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
README for LuaJIT 2.1.0-beta3
2-
-----------------------------
1+
README for LuaJIT 2.1
2+
---------------------
33

44
LuaJIT is a Just-In-Time (JIT) compiler for the Lua programming language.
55

66
Project Homepage: https://luajit.org/
77

8-
LuaJIT is Copyright (C) 2005-2022 Mike Pall.
8+
LuaJIT is Copyright (C) 2005-2023 Mike Pall.
99
LuaJIT is free software, released under the MIT license.
1010
See full Copyright Notice in the COPYRIGHT file or in luajit.h.
1111

external/sources/LuaJIT-2.1/doc/bluequad-print.css renamed to external/sources/LuaJIT-04dca7911ea255f37be799c18d74c305b921c1a6/doc/bluequad-print.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (C) 2004-2022 Mike Pall.
1+
/* Copyright (C) 2004-2023 Mike Pall.
22
*
33
* You are welcome to use the general ideas of this design for your own sites.
44
* But please do not steal the stylesheet, the layout or the color scheme.

0 commit comments

Comments
 (0)