diff --git a/libs/LuaJIT/COPYRIGHT b/libs/LuaJIT/COPYRIGHT
index e2f2cef8..9c2bca55 100644
--- a/libs/LuaJIT/COPYRIGHT
+++ b/libs/LuaJIT/COPYRIGHT
@@ -1,7 +1,7 @@
===============================================================================
LuaJIT -- a Just-In-Time Compiler for Lua. https://luajit.org/
-Copyright (C) 2005-2020 Mike Pall. All rights reserved.
+Copyright (C) 2005-2021 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/libs/LuaJIT/Makefile b/libs/LuaJIT/Makefile
index 45d9f968..aa1b84bd 100644
--- a/libs/LuaJIT/Makefile
+++ b/libs/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-2020 Mike Pall. See Copyright Notice in luajit.h
+# Copyright (C) 2005-2021 Mike Pall. See Copyright Notice in luajit.h
##############################################################################
MAJVER= 2
diff --git a/libs/LuaJIT/README b/libs/LuaJIT/README
index 5bf36b6d..c9f7d9ad 100644
--- a/libs/LuaJIT/README
+++ b/libs/LuaJIT/README
@@ -5,7 +5,7 @@ LuaJIT is a Just-In-Time (JIT) compiler for the Lua programming language.
Project Homepage: https://luajit.org/
-LuaJIT is Copyright (C) 2005-2020 Mike Pall.
+LuaJIT is Copyright (C) 2005-2021 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/libs/LuaJIT/doc/bluequad-print.css b/libs/LuaJIT/doc/bluequad-print.css
index 13ee876f..0b385cee 100644
--- a/libs/LuaJIT/doc/bluequad-print.css
+++ b/libs/LuaJIT/doc/bluequad-print.css
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2020 Mike Pall.
+/* Copyright (C) 2004-2021 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/libs/LuaJIT/doc/bluequad.css b/libs/LuaJIT/doc/bluequad.css
index 978719e8..86cd9ac0 100644
--- a/libs/LuaJIT/doc/bluequad.css
+++ b/libs/LuaJIT/doc/bluequad.css
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2020 Mike Pall.
+/* Copyright (C) 2004-2021 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/libs/LuaJIT/doc/contact.html b/libs/LuaJIT/doc/contact.html
index c2f34283..0c775f98 100644
--- a/libs/LuaJIT/doc/contact.html
+++ b/libs/LuaJIT/doc/contact.html
@@ -3,7 +3,7 @@
Q: Where can I learn more about the compiler technology used by LuaJIT?
-I'm planning to write more documentation about the internals of LuaJIT.
-In the meantime, please use the following Google Scholar searches
-to find relevant papers:
+Please use the following Google Scholar searches to find relevant papers:
Search for: » Trace Compiler
Search for: » JIT Compiler
Search for: » Dynamic Language Optimizations
Search for: » SSA Form
Search for: » Linear Scan Register Allocation
Here is a list of the » innovative features in LuaJIT.
-And, you know, reading the source is of course the only way to enlightenment. :-)
+And, you know, reading the source is of course the only way to enlightenment.
@@ -128,12 +126,11 @@ 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
-currently ignored by compiled code (this will eventually be fixed). 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. In the meantime you have to press Ctrl-C
-twice to get stop your program. That's similar to when it's stuck
-running inside a C function under the Lua interpreter.
+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 get stop your program. That's similar
+to when it's stuck running inside a C function under the Lua interpreter.
@@ -147,30 +144,20 @@ 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.
-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
+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.
+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.
-
-More reading material at the » Lua Wiki and » Wikipedia.
+In general, the only promising approach is to sandbox Lua code at the
+process level and not the VM level.
-
-
Q: Why doesn't my favorite power-patch for Lua apply against LuaJIT?
-
Because it's a completely redesigned VM and has very little code
-in common with Lua anymore. Also, if the patch introduces changes to
-the Lua semantics, these would need to be reflected everywhere in the
-VM, from the interpreter up to all stages of the compiler. Please
-use only standard Lua language constructs. For many common needs you
-can use source transformations or use wrapper or proxy functions.
-The compiler will happily optimize away such indirections.
-
-
Q: Lua runs everywhere. Why doesn't LuaJIT support my CPU?
Because it's a compiler — it needs to generate native
@@ -178,23 +165,17 @@ 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 will follow based on sufficient user
-demand and/or sponsoring.
-
-
-
-
Q: When will feature X be added? When will the next version be released?
-
When it's ready.
-C'mon, it's open source — I'm doing it on my own time and you're
-getting it for free. You can either contribute a patch or sponsor
-the development of certain features, if they are important to you.
-
+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.
@@ -177,7 +177,7 @@ Please check the note about the
bytecode format differences, too.
-
POSIX Systems (Linux, OSX, *BSD etc.)
+
POSIX Systems (Linux, macOS, *BSD etc.)
Prerequisites
Depending on your distribution, you may need to install a package for
@@ -185,14 +185,15 @@ GCC, the development headers and/or a complete SDK. E.g. on a current
Debian/Ubuntu, install libc6-dev with the package manager.
-Download the current source package of LuaJIT (pick the .tar.gz),
-if you haven't already done so. Move it to a directory of your choice,
+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:
The supplied Makefiles try to auto-detect the settings needed for your
@@ -216,9 +217,12 @@ You can add an extra prefix to the search paths by appending the
make PREFIX=/home/myself/lj2
-Note for OSX: you must set the MACOSX_DEPLOYMENT_TARGET
-environment variable to a value supported by your toolchain.
+Note for macOS: you must set the MACOSX_DEPLOYMENT_TARGET
+environment variable to a value supported by your toolchain:
+
+MACOSX_DEPLOYMENT_TARGET=XX.YY make
+
Installing LuaJIT
The top-level Makefile installs LuaJIT by default under
@@ -250,8 +254,9 @@ GCC plus the required development headers.
Or install Microsoft's Visual Studio (MSVC).
-Next, download the source package and unpack it using an archive manager
-(e.g. the Windows Explorer) to a directory of your choice.
+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
@@ -269,8 +274,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 where
-you've unpacked the sources and run this command for MinGW:
+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:
mingw32-make
@@ -325,7 +330,7 @@ You need to specify TARGET_SYS whenever the host OS and the
target OS differ, or you'll get assembler or linker errors:
-
E.g. if you're compiling on a Windows or OSX host for embedded Linux or Android, you need to add TARGET_SYS=Linux to the examples below.
+
E.g. if you're compiling on a Windows or macOS host for embedded Linux or Android, you need to add TARGET_SYS=Linux to the examples below.
For a minimal target OS, you may need to disable the built-in allocator in src/Makefile and use TARGET_SYS=Other.
Don't forget to specify the same TARGET_SYS for the install step, too.
@@ -522,14 +527,6 @@ the DLL). You may link LuaJIT statically on Windows only if you don't
intend to load Lua/C modules at runtime.
-
-If you're building a 64 bit application on OSX which links directly or
-indirectly against LuaJIT which is not built for LJ_GC64 mode,
-you need to link your main executable with these flags:
-
--pagezero_size 10000 -image_base 100000000
-
-
Additional hints for initializing LuaJIT using the C API functions:
@@ -538,7 +535,7 @@ you need to link your main executable with these flags:
for embedding Lua or LuaJIT into your application.
Make sure you use luaL_newstate. Avoid using
lua_newstate, since this uses the (slower) default memory
-allocator from your system (no support for this on x64).
+allocator from your system (no support for this on 64 bit architectures).
Make sure you use luaL_openlibs and not the old Lua 5.0 style
of calling luaopen_base etc. directly.
To change or extend the list of standard libraries to load, copy
@@ -614,7 +611,7 @@ to me (the upstream) and not you (the package maintainer), anyway.
-LuaJIT 2.0 is the current
-stable branch. This branch is in
-feature-freeze — new features will only be added to LuaJIT 2.1.
+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.
Current Status
@@ -88,15 +94,14 @@ 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. This issue will be fixed with the new
-garbage collector.
+lua_atpanic on x64.