diff --git a/lib/luajit/.gitattributes b/lib/luajit/.gitattributes
new file mode 100644
index 0000000000..c048531e27
--- /dev/null
+++ b/lib/luajit/.gitattributes
@@ -0,0 +1 @@
+/.relver export-subst
diff --git a/lib/luajit/.relver b/lib/luajit/.relver
new file mode 100644
index 0000000000..2707647aac
--- /dev/null
+++ b/lib/luajit/.relver
@@ -0,0 +1 @@
+$Format:%ct$
diff --git a/lib/luajit/COPYRIGHT b/lib/luajit/COPYRIGHT
index 58b5b96e68..d615ca9d3f 100644
--- a/lib/luajit/COPYRIGHT
+++ b/lib/luajit/COPYRIGHT
@@ -8,7 +8,7 @@ Copyright is retained by the individual authors and contributors.
===============================================================================
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/lib/luajit/Makefile b/lib/luajit/Makefile
index 9d38e99bf0..fdc7ca094d 100644
--- a/lib/luajit/Makefile
+++ b/lib/luajit/Makefile
@@ -10,7 +10,7 @@
# 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= 1
@@ -71,7 +71,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
@@ -126,8 +127,7 @@ install: $(INSTALL_DEP)
cd src && $(INSTALL_F) $(FILES_INC) $(INSTALL_INC)
cd src/jit && $(INSTALL_F) $(FILES_JITLIB) $(INSTALL_JITLIB)
$(SYMLINK) $(INSTALL_TNAME) $(INSTALL_TSYM)
- @echo ""
-
+ @echo "==== Successfully installed LuaJIT $(VERSION) to $(PREFIX) ===="
uninstall:
@echo "==== Uninstalling RaptorJIT $(VERSION) from $(PREFIX) ===="
diff --git a/lib/luajit/doc/bluequad-print.css b/lib/luajit/doc/bluequad-print.css
index a49d309ff1..4a1392789e 100644
--- a/lib/luajit/doc/bluequad-print.css
+++ b/lib/luajit/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/lib/luajit/doc/bluequad.css b/lib/luajit/doc/bluequad.css
index 4c1a9082e8..7399f62517 100644
--- a/lib/luajit/doc/bluequad.css
+++ b/lib/luajit/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/lib/luajit/doc/contact.html b/lib/luajit/doc/contact.html
index ef44e9dea2..d1cc86fa9e 100644
--- a/lib/luajit/doc/contact.html
+++ b/lib/luajit/doc/contact.html
@@ -2,8 +2,8 @@
All documentation is
-Copyright © 2005-2022 Mike Pall.
+Copyright © 2005-2023 Mike Pall.
@@ -100,7 +100,7 @@
+
LuaJIT is fully upwards-compatible with Lua 5.1. It supports all
» standard Lua
@@ -149,13 +150,33 @@ xpcall(f, err [,args...]) passes arguments
which is called in a protected context.
-
loadfile() etc. handle UTF-8 source code
+
load*() handle UTF-8 source code
Non-ASCII characters are handled transparently by the Lua source code parser.
This allows the use of UTF-8 characters in identifiers and strings.
A UTF-8 BOM is skipped at the start of the source code.
+
load*() add a mode parameter
+
+As an extension from Lua 5.2, the functions loadstring(),
+loadfile() and (new) load() add an optional
+mode parameter.
+
+
+The default mode string is "bt", which allows loading of both
+source code and bytecode. Use "t" to allow only source code
+or "b" to allow only bytecode to be loaded.
+
+
+By default, the load* functions generate the native bytecode format.
+For cross-compilation purposes, add W to the mode string to
+force the 32 bit format and X to force the 64 bit format.
+Add both to force the opposite format. Note that non-native bytecode
+generated by load* cannot be run, but can still be passed
+to string.dump.
+
+
tostring() etc. canonicalize NaN and ±Inf
All number-to-string conversions consistently convert non-finite numbers
@@ -175,26 +196,33 @@
tonumber() etc. use builtin string to number conversi
numbers (e.g. 0x1.5p-3).
-string.dump(f [,strip]) generates portable bytecode
+string.dump(f [,mode]) generates portable bytecode
An extra argument has been added to string.dump(). If set to
-true, 'stripped' bytecode without debug information is
-generated. This speeds up later bytecode loading and reduces memory
-usage. See also the
+true or to a string which contains the character s,
+'stripped' bytecode without debug information is generated. This speeds
+up later bytecode loading and reduces memory usage. See also the
-b command line option.
The generated bytecode is portable and can be loaded on any architecture
-that LuaJIT supports, independent of word size or endianess. However, the
-bytecode compatibility versions must match. Bytecode stays compatible
-for dot releases (x.y.0 → x.y.1), but may change with major or
-minor releases (2.0 → 2.1) or between any beta release. Foreign
-bytecode (e.g. from Lua 5.1) is incompatible and cannot be loaded.
+that LuaJIT supports. However, the bytecode compatibility versions must
+match. Bytecode only stays compatible within a major+minor version
+(x.y.aaa → x.y.bbb), except for development branches. Foreign bytecode
+(e.g. from Lua 5.1) is incompatible and cannot be loaded.
Note: LJ_GC64 mode requires a different frame layout, which implies
-a different, incompatible bytecode format for all 64 bit ports. This may be
-rectified in the future.
+a different, incompatible bytecode format between 32 bit and 64 bit ports.
+This may be rectified in the future. In the meantime, use the W
+and X modes of the load* functions
+for cross-compilation purposes.
+
+
+Due to VM hardening, bytecode is not deterministic. Add d to the
+mode string to dump it in a deterministic manner: identical source code
+always gives a byte-for-byte identical bytecode dump. This feature is
+mainly useful for reproducible builds.
table.new(narray, nhash) allocates a pre-sized table
@@ -227,7 +255,7 @@
Enhanced PRNG for math.random()
LuaJIT uses a Tausworthe PRNG with period 2^223 to implement
math.random() and
math.randomseed(). The quality of
the PRNG results is much superior compared to the standard Lua
-implementation, which uses the platform-specific ANSI rand().
+implementation, which uses the platform-specific ANSI
rand().
The PRNG generates the same sequences from the same seeds on all
@@ -238,6 +266,10 @@
Enhanced PRNG for math.random()
preserve uniformity.
+Call math.randomseed() without any arguments to seed it from
+system entropy.
+
+
Important: Neither this nor any other PRNG based on the simplistic
math.random() API is suitable for cryptographic use.
@@ -275,7 +307,7 @@
Extensions from Lua 5.2
- goto and ::labels::.
-- Hex escapes '\x3F' and '\*' escape in strings.
+- Hex escapes '\x3F' and '\z' escape in strings.
- load(string|reader [, chunkname [,mode [,env]]]).
- loadstring() is an alias for load().
- loadfile(filename [,mode [,env]]).
@@ -415,9 +447,7 @@ C++ Exception Interoperability
on the C stack. The contents of the C++ exception object
pass through unmodified.
- Lua errors can be caught on the C++ side with catch(...).
-The corresponding Lua error message can be retrieved from the Lua stack.
-For MSVC for Windows 64 bit this requires compilation of your C++ code
-with /EHa.
+The corresponding Lua error message can be retrieved from the Lua stack.
- Throwing Lua errors across C++ frames is safe. C++ destructors
will be called.
@@ -452,7 +482,7 @@
C++ Exception Interoperability
-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):
@@ -88,201 +88,21 @@
Installation
Requirements
-
Systems
-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 Architectures
-
-
-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.
Configuring LuaJIT
@@ -292,7 +112,6 @@
Configuring LuaJIT
hold all user-configurable settings:
-- src/luaconf.h sets some configuration variables.
- Makefile has settings for installing LuaJIT (POSIX
only).
- src/Makefile has settings for compiling LuaJIT
@@ -315,23 +134,11 @@
Configuring LuaJIT
POSIX Systems (Linux, macOS, *BSD etc.)
Prerequisites
-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
Building LuaJIT
@@ -389,15 +196,10 @@
Prerequisites
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.
-
Building with MSVC
-Open a "Visual Studio Command Prompt" (either x86 or x64), cd to the
-directory where you've unpacked the sources and run these commands:
+Open a "Visual Studio Command Prompt" (x86, x64 or ARM64), cd to the
+directory with the source code and run these commands:
cd src
@@ -407,11 +209,14 @@ Building with MSVC
Check the msvcbuild.bat file for more options.
Then follow the installation instructions below.
+
+For an x64 to ARM64 cross-build run this first: vcvarsall.bat x64_arm64
+
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
@@ -442,7 +247,15 @@ Installing LuaJIT
Cross-compiling LuaJIT
-First, let's clear up some terminology:
+The GNU Makefile-based build system allows cross-compiling on any host
+for any supported target, as long as both architectures have the same
+pointer size. If you want to cross-compile to any 32 bit target on an
+x64 OS, you need to install the multilib development package (e.g.
+libc6-dev-i386 on Debian/Ubuntu) and build a 32 bit host part
+(HOST_CC="gcc -m32"). On some distro versions, multilib conflicts
+with cross-compilers. The workaround is to install the x86 cross-compiler
+package gcc-i686-linux-gnu and use it to build the host part
+(HOST_CC=i686-linux-gnu-gcc).
- Host: This is your development system, usually based on a x64 or x86 CPU.
@@ -588,8 +401,8 @@ Cross-compiling for consoles
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:
@@ -729,7 +542,7 @@ Hints for Distribution Maintainers
Overview
-
-
-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
@@ -218,7 +191,7 @@
More ...
+
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
@@ -103,6 +104,9 @@
-b[options] input output
-l — Only list bytecode.
-s — Strip debug info (this is the default).
-g — Keep debug info.
+
-W — Generate 32 bit (non-GC64) bytecode.
+
-X — Generate 64 bit (GC64) bytecode.
+
-d — Generate bytecode in deterministic manner.
-n name — Set module name (default: auto-detect from input name)
-t type — Set output file type (default: auto-detect from output name).
-a arch — Override architecture for object files (default: native).
@@ -117,7 +121,8 @@
-b[options] input output
- c — C source file, exported bytecode data.
-- h — C header file, static bytecode data.
+- cc — C++ source file, exported bytecode data.
+- h — C/C++ header file, static bytecode data.
- obj or o — Object file, exported bytecode data
(OS- and architecture-specific).
- raw or any other extension — Raw bytecode file (portable).
@@ -293,7 +298,7 @@
-O[level]