cosmopolitan/third_party/lua
Justine Tunney 957c61cbbf
Release Cosmopolitan v3.3
This change upgrades to GCC 12.3 and GNU binutils 2.42. The GNU linker
appears to have changed things so that only a single de-duplicated str
table is present in the binary, and it gets placed wherever the linker
wants, regardless of what the linker script says. To cope with that we
need to stop using .ident to embed licenses. As such, this change does
significant work to revamp how third party licenses are defined in the
codebase, using `.section .notice,"aR",@progbits`.

This new GCC 12.3 toolchain has support for GNU indirect functions. It
lets us support __target_clones__ for the first time. This is used for
optimizing the performance of libc string functions such as strlen and
friends so far on x86, by ensuring AVX systems favor a second codepath
that uses VEX encoding. It shaves some latency off certain operations.
It's a useful feature to have for scientific computing for the reasons
explained by the test/libcxx/openmp_test.cc example which compiles for
fifteen different microarchitectures. Thanks to the upgrades, it's now
also possible to use newer instruction sets, such as AVX512FP16, VNNI.

Cosmo now uses the %gs register on x86 by default for TLS. Doing it is
helpful for any program that links `cosmo_dlopen()`. Such programs had
to recompile their binaries at startup to change the TLS instructions.
That's not great, since it means every page in the executable needs to
be faulted. The work of rewriting TLS-related x86 opcodes, is moved to
fixupobj.com instead. This is great news for MacOS x86 users, since we
previously needed to morph the binary every time for that platform but
now that's no longer necessary. The only platforms where we need fixup
of TLS x86 opcodes at runtime are now Windows, OpenBSD, and NetBSD. On
Windows we morph TLS to point deeper into the TIB, based on a TlsAlloc
assignment, and on OpenBSD/NetBSD we morph %gs back into %fs since the
kernels do not allow us to specify a value for the %gs register.

OpenBSD users are now required to use APE Loader to run Cosmo binaries
and assimilation is no longer possible. OpenBSD kernel needs to change
to allow programs to specify a value for the %gs register, or it needs
to stop marking executable pages loaded by the kernel as mimmutable().

This release fixes __constructor__, .ctor, .init_array, and lastly the
.preinit_array so they behave the exact same way as glibc.

We no longer use hex constants to define math.h symbols like M_PI.
2024-02-20 13:27:59 -08:00
..
test Make fixes and improvements 2023-07-09 05:21:11 -07:00
BUILD.mk Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
cosmo.h Reduce header complexity 2023-11-28 14:39:42 -08:00
lapi.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
lapi.h Reduce header complexity 2023-11-28 14:39:42 -08:00
lauxlib.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
lauxlib.h Reduce header complexity 2023-11-28 14:39:42 -08:00
lbaselib.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
lcode.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
lcode.h Reduce header complexity 2023-11-28 14:39:42 -08:00
lcorolib.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
lctype.h Polish redbean serialization 2022-04-29 06:10:10 -07:00
ldblib.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
ldebug.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
ldebug.h Reduce header complexity 2023-11-28 14:39:42 -08:00
ldo.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
ldo.h Reduce header complexity 2023-11-28 14:39:42 -08:00
ldump.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
lfunc.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
lfunc.h Reduce header complexity 2023-11-28 14:39:42 -08:00
lgc.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
lgc.h Reduce header complexity 2023-11-28 14:39:42 -08:00
linit.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
liolib.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
ljumptab.inc Get Lua to build with all tests passing 2021-03-07 13:31:09 -08:00
llex.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
llex.h Reduce header complexity 2023-11-28 14:39:42 -08:00
llimits.h Reduce header complexity 2023-11-28 14:39:42 -08:00
llock.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
lmathlib.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
lmem.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
lmem.h Reduce header complexity 2023-11-28 14:39:42 -08:00
lnotice.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
loadlib.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
lobject.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
lobject.h Reduce header complexity 2023-11-28 14:39:42 -08:00
lopcodes.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
lopcodes.h Reduce header complexity 2023-11-28 14:39:42 -08:00
lopnames.inc Get Lua to build with all tests passing 2021-03-07 13:31:09 -08:00
loslib.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
lparser.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
lparser.h Reduce header complexity 2023-11-28 14:39:42 -08:00
lprefix.h Make improvements 2022-04-24 10:06:05 -07:00
lrepl.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
lrepl.h Reduce header complexity 2023-11-28 14:39:42 -08:00
lstate.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
lstate.h Reduce header complexity 2023-11-28 14:39:42 -08:00
lstring.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
lstring.h Reduce header complexity 2023-11-28 14:39:42 -08:00
lstrlib.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
ltable.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
ltable.h Reduce header complexity 2023-11-28 14:39:42 -08:00
ltablib.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
ltests.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
ltests.h Reduce header complexity 2023-11-28 14:39:42 -08:00
ltm.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
ltm.h Reduce header complexity 2023-11-28 14:39:42 -08:00
lua.h Reduce header complexity 2023-11-28 14:39:42 -08:00
lua.main.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
luac.main.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
luacallwithtrace.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
luaconf.h Reduce header complexity 2023-11-28 14:39:42 -08:00
luaencodejsondata.c Bring back gc() function 2024-01-08 10:26:28 -08:00
luaencodeluadata.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
luaencodeurl.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
luaformatstack.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
lualib.h Reduce header complexity 2023-11-28 14:39:42 -08:00
luaparseurl.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
luaprintstack.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
luapushheader.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
luapushheaders.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
luapushlatin1.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
luapushurlparams.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
lundump.c Reduce header complexity 2023-11-28 14:39:42 -08:00
lundump.h Reduce header complexity 2023-11-28 14:39:42 -08:00
lunix.c Use DNS implementation from Musl Libc 2023-12-28 23:04:35 -08:00
lunix.h Reduce header complexity 2023-11-28 14:39:42 -08:00
lutf8lib.c Reduce header complexity 2023-11-28 14:39:42 -08:00
lvm.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
lvm.h Reduce header complexity 2023-11-28 14:39:42 -08:00
lzio.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
lzio.h Reduce header complexity 2023-11-28 14:39:42 -08:00
README.cosmo Write more redbean unit tests 2022-07-08 23:10:02 -07:00
serialize.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
tms.h Reduce header complexity 2023-11-28 14:39:42 -08:00
visitor.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
visitor.h Reduce header complexity 2023-11-28 14:39:42 -08:00

DESCRIPTION

  Lua is a language designed for embedded use in native applications. It
  has an impossibly elegant C API and the Lua language itself feels more
  like Python compared to alternatives like Tcl except it's a great deal
  faster and doesn't have strong opinions about character encoding.

PROVENANCE

  https://github.com/lua/lua/

  commit e7803f7dbcdc966ab1f9db143424ee811ab1a398
  Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
  Date:   Wed Mar 3 09:44:20 2021 -0300

      New release number (5.4.3)

  luac.c needed to be sourced from:
  https://www.lua.org/ftp/lua-5.4.3.tar.gz

LOCAL MODIFICATIONS

  Lua now uses a bestline REPL with bash-style code completion.

  Integer literals such as `033` will now be interpreted as octal.

  Integer literals such as `0b10` will now be interpreted as binary.

  The `\e` string literal escape sequence has been added, which is
  equivalent to `\27` (the Lua version of `\033`) or the ASCII ESC
  character. It may be used for teletypewriter control like having
  bold text, which can be encoded elegantly as `\e[1mHELLO\e[0m`.

  Added luaL_traceback2() for function parameters in traceback.

  Added Python-like printf modulus operator for strings.

  Added Python-like printf multiply operator for strings.