@@ -131,7 +131,9 @@ Contains the LuaJIT version string.
jit.version_num
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.
jit.os
diff --git a/doc/extensions.html b/doc/extensions.html
index fc673ef7..f8b45c28 100644
--- a/doc/extensions.html
+++ b/doc/extensions.html
@@ -59,14 +59,15 @@ td.excinterop {
Lua/C API
Q: Why do I get this error: "attempt to index global 'arg' (a nil value)"?
-Q: My vararg functions fail after switching to LuaJIT!
-
LuaJIT is compatible to the Lua 5.1 language standard. It doesn't
-support the implicit arg parameter for old-style vararg
-functions from Lua 5.0. Please convert your code to the
-» Lua 5.1
-vararg syntax.
-
-
-
-
Q: Why do I get this error: "bad FPU precision"?
-
Q: I get weird behavior after initializing Direct3D.
-
Q: Some FPU operations crash after I load a Delphi DLL.
-
-
-
-DirectX/Direct3D (up to version 9) sets the x87 FPU to single-precision
-mode by default. This violates the Windows ABI and interferes with the
-operation of many programs — LuaJIT is affected, too. Please make
-sure you always use the D3DCREATE_FPU_PRESERVE flag when
-initializing Direct3D.
-
-Direct3D version 10 or higher do not show this behavior anymore.
-Consider testing your application with older versions, too.
-
-Similarly, the Borland/Delphi runtime modifies the FPU control word and
-enables FP exceptions. Of course, this violates the Windows ABI, too.
-Please check the Delphi docs for the Set8087CW method.
-
-
-
-
Q: Sometimes Ctrl-C fails to stop my Lua program. Why?
-
The interrupt signal handler sets a Lua debug hook. But this is
-ignored by compiled code. If your program is running in a tight loop
-and never falls back to the interpreter, the debug hook never runs and
-can't throw the "interrupted!" error.
-You have to press Ctrl-C twice to stop your program. That's similar
-to when it's stuck running inside a C function under the Lua interpreter.
-
-
-
-
Q: Table iteration with pairs() does not result in the same order?
-
The order of table iteration is explicitly undefined by
-the Lua language standard.
-Different Lua implementations or versions may use different orders for
-otherwise identical tables. Different ways of constructing a table may
-result in different orders, too.
-Due to improved VM security, LuaJIT 2.1 may even use a different order
-on separate VM invocations or when string keys are newly interned.
-If your program relies on a deterministic order, it has a bug. Rewrite it,
-so it doesn't rely on the key order. Or sort the table keys, if you must.
-
-
-
-
Q: Can Lua code be safely sandboxed?
-
-Maybe for an extremely restricted subset of Lua and if you relentlessly
-scrutinize every single interface function you offer to the untrusted code.
-
-Although Lua provides some sandboxing functionality (setfenv(), hooks),
-it's very hard to get this right even for the Lua core libraries. Of course,
-you'll need to inspect any extension library, too. And there are libraries
-that are inherently unsafe, e.g. the FFI library.
-
-More reading material at the » Lua Wiki and » Wikipedia.
-
-Relatedly, loading untrusted bytecode is not safe!
-
-It's trivial to crash the Lua or LuaJIT VM with maliciously crafted bytecode.
-This is well known and there's no bytecode verification on purpose, so please
-don't report a bug about it. Check the mode parameter for the
-load*() functions to disable loading of bytecode.
-
-In general, the only promising approach is to sandbox Lua code at the
-process level and not the VM level.
-
-
-
-
-
Q: Lua runs everywhere. Why doesn't LuaJIT support my CPU?
-
Because it's a compiler — it needs to generate native
-machine code. This means the code generator must be ported to each
-architecture. And the fast interpreter is written in assembler and
-must be ported, too. This is quite an undertaking.
-The install documentation shows the supported
-architectures.
-Other architectures may follow based on sufficient user demand and
-market-relevance of the architecture. Sponsoring is required to develop
-the port itself, to integrate it and to continuously maintain it in the
-actively developed branches.
-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):
@@ -86,201 +86,21 @@ make && sudo make install
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.
-The codebase has compatibility defines for some more systems, but
-without official support.
-
-
Toolchains
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
@@ -290,7 +110,6 @@ Usually there is no need to tweak the settings. The following files
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
@@ -306,23 +125,11 @@ any settings.
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):
-
@@ -380,15 +187,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.
-
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:
+directory with the source code and run these commands:
cd src
@@ -401,8 +203,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
@@ -547,8 +349,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:
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
diff --git a/doc/running.html b/doc/running.html
index e8c9b1c6..c7d9e9b6 100644
--- a/doc/running.html
+++ b/doc/running.html
@@ -64,14 +64,15 @@ td.param_default {
Lua/C API
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
diff --git a/doc/status.html b/doc/status.html
deleted file mode 100644
index b69a9721..00000000
--- a/doc/status.html
+++ /dev/null
@@ -1,107 +0,0 @@
-
-
-
-This documentation is for LuaJIT 2.0.5. 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.
-
-
-
Current Status
-
-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:
-
-
-
-There are some differences in implementation-defined behavior.
-These either have a good reason, are arbitrary design choices,
-or are due to quirks in the VM. The latter cases may get fixed if a
-demonstrable need is shown.
-
-
-The Lua debug API is missing a couple of features (return
-hooks for non-Lua functions) and shows slightly different behavior
-in LuaJIT (no per-coroutine hooks, no tail call counting).
-
-
-Currently, some out-of-memory errors from on-trace code are not
-handled correctly. The error may fall through an on-trace
-pcall or it may be passed on to the function set with
-lua_atpanic on x64.
-