LuaJIT is fully upwards-compatible with Lua 5.1. It supports all » standard Lua @@ -462,7 +463,7 @@ C++ destructors.
diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..c048531e --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +/.relver export-subst diff --git a/.relver b/.relver new file mode 100644 index 00000000..2707647a --- /dev/null +++ b/.relver @@ -0,0 +1 @@ +$Format:%ct$ diff --git a/COPYRIGHT b/COPYRIGHT index c74216c3..d7620314 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -1,7 +1,7 @@ =============================================================================== LuaJIT -- a Just-In-Time Compiler for Lua. https://luajit.org/ -Copyright (C) 2005-2022 Mike Pall. All rights reserved. +Copyright (C) 2005-2023 Mike Pall. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/Makefile b/Makefile index f9952b43..3aed365d 100644 --- a/Makefile +++ b/Makefile @@ -10,16 +10,21 @@ # For MSVC, please follow the instructions given in src/msvcbuild.bat. # For MinGW and Cygwin, cd to src and run make with the Makefile there. # -# Copyright (C) 2005-2022 Mike Pall. See Copyright Notice in luajit.h +# Copyright (C) 2005-2023 Mike Pall. See Copyright Notice in luajit.h ############################################################################## MAJVER= 2 MINVER= 1 -RELVER= 0 -PREREL= -beta3 -VERSION= $(MAJVER).$(MINVER).$(RELVER)$(PREREL) ABIVER= 5.1 +# LuaJIT uses rolling releases. The release version is based on the time of +# the latest git commit. The 'git' command must be available during the build. +RELVER= $(shell cat src/luajit_relver.txt 2>/dev/null || : ) +# Note: setting it with := doesn't work, since it will change during the build. + +MMVERSION= $(MAJVER).$(MINVER) +VERSION= $(MMVERSION).$(RELVER) + ############################################################################## # # Change the installation path as needed. This automatically adjusts @@ -33,10 +38,10 @@ DPREFIX= $(DESTDIR)$(PREFIX) INSTALL_BIN= $(DPREFIX)/bin INSTALL_LIB= $(DPREFIX)/$(MULTILIB) INSTALL_SHARE= $(DPREFIX)/share -INSTALL_DEFINC= $(DPREFIX)/include/luajit-$(MAJVER).$(MINVER) +INSTALL_DEFINC= $(DPREFIX)/include/luajit-$(MMVERSION) INSTALL_INC= $(INSTALL_DEFINC) -INSTALL_LJLIBD= $(INSTALL_SHARE)/luajit-$(VERSION) +INSTALL_LJLIBD= $(INSTALL_SHARE)/luajit-$(MMVERSION) INSTALL_JITLIB= $(INSTALL_LJLIBD)/jit INSTALL_LMODD= $(INSTALL_SHARE)/lua INSTALL_LMOD= $(INSTALL_LMODD)/$(ABIVER) @@ -50,10 +55,10 @@ INSTALL_TSYMNAME= luajit INSTALL_ANAME= libluajit-$(ABIVER).a INSTALL_SOSHORT1= libluajit-$(ABIVER).so INSTALL_SOSHORT2= libluajit-$(ABIVER).so.$(MAJVER) -INSTALL_SONAME= $(INSTALL_SOSHORT2).$(MINVER).$(RELVER) +INSTALL_SONAME= libluajit-$(ABIVER).so.$(VERSION) INSTALL_DYLIBSHORT1= libluajit-$(ABIVER).dylib INSTALL_DYLIBSHORT2= libluajit-$(ABIVER).$(MAJVER).dylib -INSTALL_DYLIBNAME= libluajit-$(ABIVER).$(MAJVER).$(MINVER).$(RELVER).dylib +INSTALL_DYLIBNAME= libluajit-$(ABIVER).$(VERSION).dylib INSTALL_PCNAME= luajit.pc INSTALL_STATIC= $(INSTALL_LIB)/$(INSTALL_ANAME) @@ -78,7 +83,8 @@ INSTALL_F= install -m 0644 UNINSTALL= $(RM) LDCONFIG= ldconfig -n 2>/dev/null SED_PC= sed -e "s|^prefix=.*|prefix=$(PREFIX)|" \ - -e "s|^multilib=.*|multilib=$(MULTILIB)|" + -e "s|^multilib=.*|multilib=$(MULTILIB)|" \ + -e "s|^relver=.*|relver=$(RELVER)|" ifneq ($(INSTALL_DEFINC),$(INSTALL_INC)) SED_PC+= -e "s|^includedir=.*|includedir=$(INSTALL_INC)|" endif @@ -115,9 +121,9 @@ endif INSTALL_DEP= src/luajit default all $(INSTALL_DEP): - @echo "==== Building LuaJIT $(VERSION) ====" + @echo "==== Building LuaJIT $(MMVERSION) ====" $(MAKE) -C src - @echo "==== Successfully built LuaJIT $(VERSION) ====" + @echo "==== Successfully built LuaJIT $(MMVERSION) ====" install: $(INSTALL_DEP) @echo "==== Installing LuaJIT $(VERSION) to $(PREFIX) ====" @@ -136,18 +142,12 @@ install: $(INSTALL_DEP) $(RM) $(FILE_PC).tmp cd src && $(INSTALL_F) $(FILES_INC) $(INSTALL_INC) cd src/jit && $(INSTALL_F) $(FILES_JITLIB) $(INSTALL_JITLIB) + $(SYMLINK) $(INSTALL_TNAME) $(INSTALL_TSYM) @echo "==== Successfully installed LuaJIT $(VERSION) to $(PREFIX) ====" - @echo "" - @echo "Note: the development releases deliberately do NOT install a symlink for luajit" - @echo "You can do this now by running this command (with sudo):" - @echo "" - @echo " $(SYMLINK) $(INSTALL_TNAME) $(INSTALL_TSYM)" - @echo "" - uninstall: @echo "==== Uninstalling LuaJIT $(VERSION) from $(PREFIX) ====" - $(UNINSTALL) $(INSTALL_T) $(INSTALL_STATIC) $(INSTALL_DYN) $(INSTALL_SHORT1) $(INSTALL_SHORT2) $(INSTALL_MAN)/$(FILE_MAN) $(INSTALL_PC) + $(UNINSTALL) $(INSTALL_TSYM) $(INSTALL_T) $(INSTALL_STATIC) $(INSTALL_DYN) $(INSTALL_SHORT1) $(INSTALL_SHORT2) $(INSTALL_MAN)/$(FILE_MAN) $(INSTALL_PC) for file in $(FILES_JITLIB); do \ $(UNINSTALL) $(INSTALL_JITLIB)/$$file; \ done @@ -161,8 +161,9 @@ uninstall: ############################################################################## amalg: - @echo "Building LuaJIT $(VERSION)" + @echo "==== Building LuaJIT $(MMVERSION) (amalgamation) ====" $(MAKE) -C src amalg + @echo "==== Successfully built LuaJIT $(MMVERSION) (amalgamation) ====" clean: $(MAKE) -C src clean diff --git a/README b/README index 1faef255..e4a69265 100644 --- a/README +++ b/README @@ -1,11 +1,11 @@ -README for LuaJIT 2.1.0-beta3 ------------------------------ +README for LuaJIT 2.1 +--------------------- LuaJIT is a Just-In-Time (JIT) compiler for the Lua programming language. Project Homepage: https://luajit.org/ -LuaJIT is Copyright (C) 2005-2022 Mike Pall. +LuaJIT is Copyright (C) 2005-2023 Mike Pall. LuaJIT is free software, released under the MIT license. See full Copyright Notice in the COPYRIGHT file or in luajit.h. diff --git a/doc/bluequad-print.css b/doc/bluequad-print.css index a49d309f..4a139278 100644 --- a/doc/bluequad-print.css +++ b/doc/bluequad-print.css @@ -1,4 +1,4 @@ -/* Copyright (C) 2004-2022 Mike Pall. +/* Copyright (C) 2004-2023 Mike Pall. * * You are welcome to use the general ideas of this design for your own sites. * But please do not steal the stylesheet, the layout or the color scheme. diff --git a/doc/bluequad.css b/doc/bluequad.css index 4c1a9082..7399f625 100644 --- a/doc/bluequad.css +++ b/doc/bluequad.css @@ -1,4 +1,4 @@ -/* Copyright (C) 2004-2022 Mike Pall. +/* Copyright (C) 2004-2023 Mike Pall. * * You are welcome to use the general ideas of this design for your own sites. * But please do not steal the stylesheet, the layout or the color scheme. @@ -206,11 +206,9 @@ img.right { .ext { color: #ff8000; } -.new { - font-size: 6pt; - vertical-align: middle; - background: #ff8000; - color: #ffffff; +.note { + padding: 0.5em 1em; + border-left: 3px solid #bfcfff; } #site { clear: both; diff --git a/doc/contact.html b/doc/contact.html index 6d609286..cc4d8c72 100644 --- a/doc/contact.html +++ b/doc/contact.html @@ -3,7 +3,7 @@
All documentation is -Copyright © 2005-2022 Mike Pall. +Copyright © 2005-2023 Mike Pall.
@@ -102,7 +102,7 @@ Copyright © 2005-2022 Mike Pall.-This library is a work in progress. More -functionality will be added soon. -
-The string buffer library is built into LuaJIT by default, but it's not @@ -685,7 +679,7 @@ mappings of files are OK, but only if the file does not change.
Contains the version number of the LuaJIT core. Version xx.yy.zz
-is represented by the decimal number xxyyzz.
+is represented by the decimal number xxyyzz.
+DEPRECATED after the switch to
+» rolling releases. zz is frozen at 99.
LuaJIT is fully upwards-compatible with Lua 5.1. It supports all » standard Lua @@ -462,7 +463,7 @@ C++ destructors.
-LuaJIT is only distributed as a source package. This page explains -how to build and install LuaJIT with different operating systems -and C compilers. +LuaJIT is only distributed as source code — get it from the +» git repository. This page explains how to build +and install the LuaJIT binary and library for different operating systems.
For the impatient (on POSIX systems): @@ -90,201 +90,21 @@ make && sudo make install
-LuaJIT currently builds out-of-the box on most systems: +LuaJIT currently builds out-of-the box on most systems. Please check the +supported operating systems and CPU architectures on the +» status page.
-OS | -Min. Version | -Requirements | -LuaJIT Versions | -
Windows | -7 | -x86 or x64, ARM64: TBA | -v2.0 – | -
Linux | -- | - | v2.0 – | -
*BSD | -- | - | v2.0 – | -
macOS (OSX) | -10.4 | -- | v2.1 – | -
POSIX | -- | mmap, dlopen | -v2.0 – | -
Android | -4.0 | -Recent Android NDK | -v2.0 – | -
iOS | -3.0 | -Xcode iOS SDK | -v2.1 – | -
PS3 | -- | PS3 SDK | -v2.0 – v2.1 EOL | -
PS4 | -- | PS4 SDK (ORBIS) | -v2.0 – | -
PS5 | -- | PS5 SDK (PROSPERO) | -v2.1 – | -
PS Vita | -- | PS Vita SDK (PSP2) | -v2.0 – v2.1 EOL | -
Xbox 360 | -- | Xbox 360 SDK (XEDK) | -v2.0 – v2.1 EOL | -
Xbox One | -- | Xbox One SDK (DURANGO) | -v2.1 – | -
Nintendo Switch | -- | NintendoSDK + NX Addon | -v2.1 – | -
-The codebase has compatibility defines for some more systems, but -without official support. -
-Building LuaJIT requires a recent toolchain based on GCC, Clang/LLVM or MSVC++.
The Makefile-based build system requires GNU Make and supports -cross-builds. Batch files are provided for MSVC++ builds and console cross-builds.
-CPU | -Bits | -Requirements | -Variants | -LuaJIT Versions | -
x86 | -32 | -v2.1+: SSE2 | -- | v2.0 – | -
x64 | -64 | -- | - | v2.0 – | -
ARM | -32 | -ARMv5+, ARM9E+ | -hard-fp + soft-fp | -v2.0 – | -
ARM64 | -64 | -- | ARM64le + ARM64be | -v2.1 – | -
PPC32 | -32 | -- | hard-fp + soft-fp | -v2.0 – v2.1 EOL | -
PPC/e500 | -32 | -e500v2 | -- | v2.0 EOL | -
MIPS32 | -32 | -MIPS32r1 – r5 | -hard-fp + soft-fp | -v2.0 – | -
MIPS64 | -64 | -MIPS64r1 – r5 | -hard-fp + soft-fp | -v2.1 – | -
MIPS64 | -64 | -MIPS64r6 | -hard-fp + soft-fp | -v2.1 EOL | -
RISC-V | -64 | -RVA22+ | -- | TBA | -
-There are no plans to add historic architectures or to continue support -for end-of-life (EOL) architectures, for which no new CPUs are commonly -available anymore. Likewise, there are no plans to support marginal -and/or de-facto-dead architectures. +Batch files are provided for MSVC++ builds and console cross-builds.
-Depending on your distribution, you may need to install a package for -GCC, the development headers and/or a complete SDK. E.g. on a current -Debian/Ubuntu, install libc6-dev with the package manager. +Depending on your distribution, you may need to install a package for a +compiler (GCC or Clang/LLVM), the development headers and/or a complete SDK. +E.g. on a current Debian/Ubuntu, install build-essential with the +package manager.
--The recommended way to fetch the latest version is to do a pull from -the git repository. -
--Alternatively, download the latest source package of LuaJIT (pick the .tar.gz). -Move it to a directory of your choice, open a terminal window and change -to this directory. Now unpack the archive and change to the newly created -directory (replace XX.YY.ZZ with the version you downloaded): -
--tar zxf LuaJIT-XX.YY.ZZ.tar.gz -cd LuaJIT-XX.YY.ZZ
@@ -394,15 +201,10 @@ Either install one of the open source SDKs GCC plus the required development headers. Or install Microsoft's Visual Studio (MSVC).
--Next, pull from the git repository or download the source package and -unpack it using an archive manager (e.g. the Windows Explorer) to -a directory of your choice. -
Open a "Visual Studio Command Prompt" (either x86 or x64), cd to the -directory where you've unpacked the sources and run these commands: +directory with the source code and run these commands:
cd src @@ -415,8 +217,8 @@ Then follow the installation instructions below.Building with MinGW or Cygwin
Open a command prompt window and make sure the MinGW or Cygwin programs -are in your path. Then cd to the directory of the git repository -or where you've unpacked the sources. Then run this command for MinGW: +are in your path. Then cd to the directory of the git repository. +Then run this command for MinGW:
mingw32-make @@ -518,15 +320,15 @@ make HOST_CC="gcc -m32" CROSS=arm-linux-gnueabi- \ make HOST_CC="gcc -m32" CROSS=arm-linux-gnueabihf- # ARM64 -make CROSS=aarch64-linux- +make CROSS=aarch64-linux-gnu- # PPC make HOST_CC="gcc -m32" CROSS=powerpc-linux-gnu- # MIPS32 big-endian -make HOST_CC="gcc -m32" CROSS=mips-linux- +make HOST_CC="gcc -m32" CROSS=mips-linux-gnu- # MIPS32 little-endian -make HOST_CC="gcc -m32" CROSS=mipsel-linux- +make HOST_CC="gcc -m32" CROSS=mipsel-linux-gnu- # MIPS64 big-endian make CROSS=mips-linux- TARGET_CFLAGS="-mips64r2 -mabi=64" @@ -605,8 +407,8 @@ make HOST_CC="gcc -m32" CROSS=ppu-lv2- To cross-compile for the other consoles from a Windows host, open a "Native Tools Command Prompt for VS". You need to choose either the 32 or the 64 bit version of the host compiler to match the target. -Then cd to the src directory below where you've -unpacked the sources and run the build command given in the table: +Then cd to the src directory below the source code +and run the build command given in the table:
3x - 100x |
-115 KB VM |
-90 KB JIT |
-63 KLOC C |
-24 KLOC ASM |
-11 KLOC Lua |
-
LuaJIT has been successfully used as a scripting middleware in games, appliances, network and graphics apps, numerical simulations, -trading platforms and many other specialty applications. It scales from -embedded devices, smartphones, desktops up to server farms. It combines -high flexibility with high performance -and an unmatched low memory footprint. +trading platforms and many other specialty applications. +
++LuaJIT is part of a hundred million web sites, huge SaaS installations, +network switches, set-top boxes and other embedded devices. You've probably +already used LuaJIT without knowing about it. +
++LuaJIT scales from embedded devices, smartphones, desktops up to server +farms. It combines high flexibility with high performance and an unmatched +low memory footprint.
LuaJIT has been in continuous development since 2005. It's widely @@ -220,7 +193,7 @@ Please select a sub-topic in the navigation bar to learn more about LuaJIT.
LuaJIT has only a single stand-alone executable, called luajit on POSIX systems or luajit.exe on Windows. It can be used to run simple @@ -302,7 +303,7 @@ Here are the parameters and their default settings:
-This documentation is for LuaJIT 2.1.0-beta3. Please check the doc -directory in each git branch for the version-specific documentation. -
--The currently developed branches are LuaJIT 2.1 and LuaJIT 2.0. -
--LuaJIT 2.0 is in feature-freeze — new features will only -be added to LuaJIT 2.1. -
- --LuaJIT ought to run all Lua 5.1-compatible source code just fine. -It's considered a serious bug if the VM crashes or produces unexpected -results — please report this. -
--Known incompatibilities and issues in LuaJIT 2.0: -
-