From cbb187aea5e9bbe708faee7f03f92b4c62a74720 Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Sun, 20 Aug 2023 21:14:37 +0200 Subject: [PATCH 01/12] Remove work-in-progress notice in string buffer docs. --- doc/ext_buffer.html | 6 ------ 1 file changed, 6 deletions(-) diff --git a/doc/ext_buffer.html b/doc/ext_buffer.html index 2a82aa97..1c646a71 100644 --- a/doc/ext_buffer.html +++ b/doc/ext_buffer.html @@ -88,12 +88,6 @@ The string buffer library also includes a high-performance serializer for Lua objects.

-

Work in Progress

-

-This library is a work in progress. More -functionality will be added soon. -

-

Using the String Buffer Library

The string buffer library is built into LuaJIT by default, but it's not From 158a284cc9c33ade9054df976018401e4996cfbd Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Sun, 20 Aug 2023 21:25:30 +0200 Subject: [PATCH 02/12] Bump copyright date. --- COPYRIGHT | 2 +- Makefile | 2 +- README | 2 +- doc/bluequad-print.css | 2 +- doc/bluequad.css | 2 +- doc/contact.html | 6 +++--- doc/ext_c_api.html | 4 ++-- doc/ext_ffi.html | 4 ++-- doc/ext_ffi_api.html | 4 ++-- doc/ext_ffi_semantics.html | 4 ++-- doc/ext_ffi_tutorial.html | 4 ++-- doc/ext_jit.html | 4 ++-- doc/extensions.html | 4 ++-- doc/faq.html | 4 ++-- doc/install.html | 4 ++-- doc/luajit.html | 6 +++--- doc/running.html | 4 ++-- doc/status.html | 4 ++-- dynasm/dasm_arm.h | 2 +- dynasm/dasm_arm.lua | 2 +- dynasm/dasm_mips.h | 2 +- dynasm/dasm_mips.lua | 2 +- dynasm/dasm_ppc.h | 2 +- dynasm/dasm_ppc.lua | 2 +- dynasm/dasm_proto.h | 2 +- dynasm/dasm_x64.lua | 2 +- dynasm/dasm_x86.h | 2 +- dynasm/dasm_x86.lua | 2 +- dynasm/dynasm.lua | 4 ++-- etc/luajit.1 | 2 +- src/Makefile | 2 +- src/host/buildvm.c | 2 +- src/host/buildvm.h | 2 +- src/host/buildvm_asm.c | 2 +- src/host/buildvm_fold.c | 2 +- src/host/buildvm_lib.c | 2 +- src/host/buildvm_peobj.c | 2 +- src/host/genminilua.lua | 2 +- src/jit/bc.lua | 2 +- src/jit/bcsave.lua | 2 +- src/jit/dis_arm.lua | 2 +- src/jit/dis_mips.lua | 2 +- src/jit/dis_mipsel.lua | 2 +- src/jit/dis_ppc.lua | 2 +- src/jit/dis_x64.lua | 2 +- src/jit/dis_x86.lua | 2 +- src/jit/dump.lua | 2 +- src/jit/v.lua | 2 +- src/lib_aux.c | 2 +- src/lib_base.c | 2 +- src/lib_bit.c | 2 +- src/lib_debug.c | 2 +- src/lib_ffi.c | 2 +- src/lib_init.c | 2 +- src/lib_io.c | 2 +- src/lib_jit.c | 2 +- src/lib_math.c | 2 +- src/lib_os.c | 2 +- src/lib_package.c | 2 +- src/lib_string.c | 2 +- src/lib_table.c | 2 +- src/lj_api.c | 2 +- src/lj_arch.h | 2 +- src/lj_asm.c | 2 +- src/lj_asm.h | 2 +- src/lj_asm_arm.h | 2 +- src/lj_asm_mips.h | 2 +- src/lj_asm_ppc.h | 2 +- src/lj_asm_x86.h | 2 +- src/lj_bc.c | 2 +- src/lj_bc.h | 2 +- src/lj_bcdump.h | 2 +- src/lj_bcread.c | 2 +- src/lj_bcwrite.c | 2 +- src/lj_carith.c | 2 +- src/lj_carith.h | 2 +- src/lj_ccall.c | 2 +- src/lj_ccall.h | 2 +- src/lj_ccallback.c | 2 +- src/lj_ccallback.h | 2 +- src/lj_cconv.c | 2 +- src/lj_cconv.h | 2 +- src/lj_cdata.c | 2 +- src/lj_cdata.h | 2 +- src/lj_clib.c | 2 +- src/lj_clib.h | 2 +- src/lj_cparse.c | 2 +- src/lj_cparse.h | 2 +- src/lj_crecord.c | 2 +- src/lj_crecord.h | 2 +- src/lj_ctype.c | 2 +- src/lj_ctype.h | 2 +- src/lj_debug.c | 2 +- src/lj_debug.h | 2 +- src/lj_def.h | 2 +- src/lj_dispatch.c | 2 +- src/lj_dispatch.h | 2 +- src/lj_emit_arm.h | 2 +- src/lj_emit_mips.h | 2 +- src/lj_emit_ppc.h | 2 +- src/lj_emit_x86.h | 2 +- src/lj_err.c | 2 +- src/lj_err.h | 2 +- src/lj_errmsg.h | 2 +- src/lj_ff.h | 2 +- src/lj_ffrecord.c | 2 +- src/lj_ffrecord.h | 2 +- src/lj_frame.h | 2 +- src/lj_func.c | 2 +- src/lj_func.h | 2 +- src/lj_gc.c | 2 +- src/lj_gc.h | 2 +- src/lj_gdbjit.c | 2 +- src/lj_gdbjit.h | 2 +- src/lj_ir.c | 2 +- src/lj_ir.h | 2 +- src/lj_ircall.h | 2 +- src/lj_iropt.h | 2 +- src/lj_jit.h | 2 +- src/lj_lex.c | 2 +- src/lj_lex.h | 2 +- src/lj_lib.c | 2 +- src/lj_lib.h | 2 +- src/lj_load.c | 2 +- src/lj_mcode.c | 2 +- src/lj_mcode.h | 2 +- src/lj_meta.c | 2 +- src/lj_meta.h | 2 +- src/lj_obj.c | 2 +- src/lj_obj.h | 2 +- src/lj_opt_dce.c | 2 +- src/lj_opt_fold.c | 2 +- src/lj_opt_loop.c | 2 +- src/lj_opt_mem.c | 2 +- src/lj_opt_narrow.c | 2 +- src/lj_opt_sink.c | 2 +- src/lj_opt_split.c | 2 +- src/lj_parse.c | 2 +- src/lj_parse.h | 2 +- src/lj_record.c | 2 +- src/lj_record.h | 2 +- src/lj_snap.c | 2 +- src/lj_snap.h | 2 +- src/lj_state.c | 2 +- src/lj_state.h | 2 +- src/lj_str.c | 2 +- src/lj_str.h | 2 +- src/lj_strscan.c | 2 +- src/lj_strscan.h | 2 +- src/lj_tab.c | 2 +- src/lj_tab.h | 2 +- src/lj_target.h | 2 +- src/lj_target_arm.h | 2 +- src/lj_target_mips.h | 2 +- src/lj_target_ppc.h | 2 +- src/lj_target_x86.h | 2 +- src/lj_trace.c | 2 +- src/lj_trace.h | 2 +- src/lj_traceerr.h | 2 +- src/lj_udata.c | 2 +- src/lj_udata.h | 2 +- src/lj_vm.h | 2 +- src/lj_vmevent.c | 2 +- src/lj_vmevent.h | 2 +- src/lj_vmmath.c | 2 +- src/ljamalg.c | 2 +- src/luaconf.h | 2 +- src/luajit.c | 2 +- src/luajit.h | 4 ++-- src/lualib.h | 2 +- src/msvcbuild.bat | 2 +- src/vm_arm.dasc | 2 +- src/vm_mips.dasc | 2 +- src/vm_ppc.dasc | 2 +- src/vm_ppcspe.dasc | 2 +- src/vm_x86.dasc | 2 +- 176 files changed, 193 insertions(+), 193 deletions(-) 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 0004c2c5..9fc0032c 100644 --- a/Makefile +++ b/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= 2 diff --git a/README b/README index 107ff66c..7a97df6b 100644 --- a/README +++ b/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-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..14a0d1b9 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. diff --git a/doc/contact.html b/doc/contact.html index b09ef493..7b8cd404 100644 --- a/doc/contact.html +++ b/doc/contact.html @@ -3,7 +3,7 @@ Contact - + @@ -90,7 +90,7 @@ don't like that, please complain to Google or Microsoft, not me.

Copyright

All documentation is -Copyright © 2005-2022 Mike Pall. +Copyright © 2005-2023 Mike Pall.

@@ -98,7 +98,7 @@ Copyright © 2005-2022 Mike Pall.
+

LuaJIT is fully upwards-compatible with Lua 5.1. It supports all » standard Lua diff --git a/doc/faq.html b/doc/faq.html deleted file mode 100644 index f160fffe..00000000 --- a/doc/faq.html +++ /dev/null @@ -1,191 +0,0 @@ - - - -Frequently Asked Questions (FAQ) - - - - - - - - -

- - -
-
-
Q: Where can I learn more about LuaJIT and Lua?
-
-
-
- -
-
Q: Where can I learn more about the compiler technology used by LuaJIT?
-
-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. -
-
- -
-
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.
-
-
-
- - - diff --git a/doc/install.html b/doc/install.html index c960e071..21866315 100644 --- a/doc/install.html +++ b/doc/install.html @@ -20,7 +20,7 @@ table.compat tr.compathead td { font-weight: bold; border-bottom: 2px solid #bfcfff; } -td.compatname, td.compatver { +td.compatname { width: 10%; } td.compatbits { @@ -65,18 +65,18 @@ td.compatx { Lua/C API
  • -Status +Status »
  • -FAQ +FAQ »
  • Mailing List »
  • -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.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    OSMin. VersionRequirementsLuaJIT Versions
    Windows7x86 or x64, ARM64: TBAv2.0 –
    Linux  v2.0 –
    *BSD  v2.0 –
    macOS (OSX)10.4 v2.1 –
    POSIX mmap, dlopenv2.0 –
    Android4.0Recent Android NDKv2.0 –
    iOS3.0Xcode iOS SDKv2.1 –
    PS3 PS3 SDKv2.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 Addonv2.1 –
    -

    -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

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    CPUBitsRequirementsVariantsLuaJIT Versions
    x8632v2.1+: SSE2 v2.0 –
    x6464  v2.0 –
    ARM32ARMv5+, ARM9E+hard-fp + soft-fpv2.0 –
    ARM6464 ARM64le + ARM64bev2.1 –
    PPC3232 hard-fp + soft-fpv2.0 – v2.1 EOL
    PPC/e50032e500v2 v2.0 EOL
    MIPS3232MIPS32r1 – r5hard-fp + soft-fpv2.0 –
    MIPS6464MIPS64r1 – r5hard-fp + soft-fpv2.1 –
    MIPS6464MIPS64r6hard-fp + soft-fpv2.1 EOL
    RISC-V64RVA22+ 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:

  • -Status +Status »
  • -FAQ +FAQ »
  • Mailing List »
  • +

    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 @@ - - - -Status - - - - - - - - -

    -Lua -
    - - -
    -

    -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. -
    • -
    -
    -
    - - - From 50e0fa03c48cb9af03c3efdc3100f12687651a2e Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Mon, 21 Aug 2023 03:06:26 +0200 Subject: [PATCH 04/12] Switch build system to rolling releases. --- Makefile | 28 ++++++++++++------- etc/luajit.pc | 2 +- src/.gitignore | 2 ++ src/Makefile | 23 +++++++++++----- src/host/buildvm.c | 1 + src/host/genversion.lua | 43 ++++++++++++++++++++++++++++++ src/jit/bc.lua | 1 - src/jit/bcsave.lua | 2 +- src/jit/dump.lua | 1 - src/jit/v.lua | 1 - src/lib_jit.c | 2 +- src/luaconf.h | 2 +- src/{luajit.h => luajit_rolling.h} | 6 ++--- 13 files changed, 87 insertions(+), 27 deletions(-) create mode 100644 src/host/genversion.lua rename src/{luajit.h => luajit_rolling.h} (94%) diff --git a/Makefile b/Makefile index 9fc0032c..792d7e56 100644 --- a/Makefile +++ b/Makefile @@ -15,10 +15,16 @@ MAJVER= 2 MINVER= 0 -RELVER= 5 -VERSION= $(MAJVER).$(MINVER).$(RELVER) 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 @@ -32,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) @@ -49,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) @@ -77,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 @@ -110,9 +117,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) ====" @@ -150,8 +157,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/etc/luajit.pc b/etc/luajit.pc index 9bac3a8b..68f8d5cc 100644 --- a/etc/luajit.pc +++ b/etc/luajit.pc @@ -1,7 +1,7 @@ # Package information for LuaJIT to be used by pkg-config. majver=2 minver=0 -relver=5 +relver=ROLLING version=${majver}.${minver}.${relver} abiver=5.1 diff --git a/src/.gitignore b/src/.gitignore index fc94e82c..19f2a00e 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -1,4 +1,6 @@ luajit +luajit.h +luajit_relver.txt lj_bcdef.h lj_ffdef.h lj_libdef.h diff --git a/src/Makefile b/src/Makefile index aac78beb..e6954a95 100644 --- a/src/Makefile +++ b/src/Makefile @@ -12,7 +12,6 @@ MAJVER= 2 MINVER= 0 -RELVER= 5 ABIVER= 5.1 NODOTABIVER= 51 @@ -308,7 +307,7 @@ ifeq (Darwin,$(TARGET_SYS)) TARGET_STRIP+= -x TARGET_XSHLDFLAGS= -dynamiclib -single_module -undefined dynamic_lookup -fPIC TARGET_DYNXLDOPTS= - TARGET_XSHLDFLAGS+= -install_name $(TARGET_DYLIBPATH) -compatibility_version $(MAJVER).$(MINVER) -current_version $(MAJVER).$(MINVER).$(RELVER) + TARGET_XSHLDFLAGS+= -install_name $(TARGET_DYLIBPATH) -compatibility_version $(MAJVER).$(MINVER) -current_version $(MAJVER).$(MINVER).255 ifeq (x64,$(TARGET_LJARCH)) TARGET_XLDFLAGS+= -pagezero_size 10000 -image_base 100000000 TARGET_XSHLDFLAGS+= -image_base 7fff04c4a000 @@ -318,7 +317,7 @@ ifeq (iOS,$(TARGET_SYS)) TARGET_STRIP+= -x TARGET_XSHLDFLAGS= -dynamiclib -single_module -undefined dynamic_lookup -fPIC TARGET_DYNXLDOPTS= - TARGET_XSHLDFLAGS+= -install_name $(TARGET_DYLIBPATH) -compatibility_version $(MAJVER).$(MINVER) -current_version $(MAJVER).$(MINVER).$(RELVER) + TARGET_XSHLDFLAGS+= -install_name $(TARGET_DYLIBPATH) -compatibility_version $(MAJVER).$(MINVER) -current_version $(MAJVER).$(MINVER).255 else ifneq (SunOS,$(TARGET_SYS)) ifneq (PS3,$(TARGET_SYS)) @@ -367,10 +366,11 @@ MINILUA_O= host/minilua.o MINILUA_LIBS= -lm MINILUA_T= host/minilua MINILUA_X= $(MINILUA_T) +MINILUA_DEP= ifeq (,$(HOST_LUA)) HOST_LUA= $(MINILUA_X) - DASM_DEP= $(MINILUA_T) + MINILUA_DEP= $(MINILUA_T) endif DASM_DIR= ../dynasm @@ -445,6 +445,10 @@ endif DASM_FLAGS= $(DASM_XFLAGS) $(DASM_AFLAGS) DASM_DASC= vm_$(DASM_ARCH).dasc +GIT= git +GIT_RELVER= [ -d ../.git ] && $(GIT) show -s --format=%ct >luajit_relver.txt 2>/dev/null || cat ../.relver >luajit_relver.txt 2>/dev/null || : +GIT_DEP= $(wildcard ../.git/HEAD ../.git/refs/heads/*) + BUILDVM_O= host/buildvm.o host/buildvm_asm.o host/buildvm_peobj.o \ host/buildvm_lib.o host/buildvm_fold.o BUILDVM_T= host/buildvm @@ -488,8 +492,8 @@ LUAJIT_T= luajit ALL_T= $(LUAJIT_T) $(LUAJIT_A) $(LUAJIT_SO) $(HOST_T) ALL_HDRGEN= lj_bcdef.h lj_ffdef.h lj_libdef.h lj_recdef.h lj_folddef.h \ - host/buildvm_arch.h -ALL_GEN= $(LJVM_S) $(ALL_HDRGEN) $(LIB_VMDEFP) + host/buildvm_arch.h luajit.h +ALL_GEN= $(LJVM_S) $(ALL_HDRGEN) luajit_relver.txt $(LIB_VMDEFP) WIN_RM= *.obj *.lib *.exp *.dll *.exe *.manifest *.pdb *.ilk ALL_RM= $(ALL_T) $(ALL_GEN) *.o host/*.o $(WIN_RM) @@ -610,7 +614,12 @@ $(MINILUA_T): $(MINILUA_O) $(E) "HOSTLINK $@" $(Q)$(HOST_CC) $(HOST_ALDFLAGS) -o $@ $(MINILUA_O) $(MINILUA_LIBS) $(HOST_ALIBS) -host/buildvm_arch.h: $(DASM_DASC) $(DASM_DEP) lj_arch.h lua.h luaconf.h +luajit.h: $(MINILUA_DEP) $(GIT_DEP) luajit_rolling.h + $(E) "VERSION $@" + $(Q)$(GIT_RELVER) + $(Q)$(HOST_LUA) host/genversion.lua + +host/buildvm_arch.h: $(DASM_DASC) $(MINILUA_DEP) lj_arch.h lua.h luaconf.h $(E) "DYNASM $@" $(Q)$(DASM) $(DASM_FLAGS) -o $@ $(DASM_DASC) diff --git a/src/host/buildvm.c b/src/host/buildvm.c index ef393ff8..39c2bc24 100644 --- a/src/host/buildvm.c +++ b/src/host/buildvm.c @@ -320,6 +320,7 @@ static void emit_vmdef(BuildCtx *ctx) char buf[80]; int i; fprintf(ctx->fp, "-- This is a generated file. DO NOT EDIT!\n\n"); + fprintf(ctx->fp, "assert(require(\"jit\").version == \"%s\", \"LuaJIT core/library version mismatch\")\n\n", LUAJIT_VERSION); fprintf(ctx->fp, "module(...)\n\n"); fprintf(ctx->fp, "bcnames = \""); diff --git a/src/host/genversion.lua b/src/host/genversion.lua new file mode 100644 index 00000000..a38cec56 --- /dev/null +++ b/src/host/genversion.lua @@ -0,0 +1,43 @@ +---------------------------------------------------------------------------- +-- Lua script to embed the rolling release version in luajit.h. +---------------------------------------------------------------------------- +-- Copyright (C) 2005-2023 Mike Pall. All rights reserved. +-- Released under the MIT license. See Copyright Notice in luajit.h +---------------------------------------------------------------------------- + +local FILE_INPUT_H = "luajit_rolling.h" +local FILE_INPUT_R = "luajit_relver.txt" +local FILE_OUTPUT_H = "luajit.h" + +local function file_read(file) + local fp = assert(io.open(file, "rb"), "run from the wrong directory") + local data = assert(fp:read("*a")) + fp:close() + return data +end + +local function file_write_mod(file, data) + local fp = io.open(file, "rb") + if fp then + local odata = assert(fp:read("*a")) + fp:close() + if odata == data then return end + end + fp = assert(io.open(file, "wb")) + assert(fp:write(data)) + assert(fp:close()) +end + +local text = file_read(FILE_INPUT_H) +local relver = file_read(FILE_INPUT_R):match("(%d+)") + +if relver then + text = text:gsub("ROLLING", relver) +else + io.stderr:write([[ +**** WARNING Cannot determine rolling release version from git log. +**** WARNING The 'git' command must be available during the build. +]]) +end + +file_write_mod(FILE_OUTPUT_H, text) diff --git a/src/jit/bc.lua b/src/jit/bc.lua index b128d35a..4b384012 100644 --- a/src/jit/bc.lua +++ b/src/jit/bc.lua @@ -41,7 +41,6 @@ -- Cache some library functions and objects. local jit = require("jit") -assert(jit.version_num == 20005, "LuaJIT core/library version mismatch") local jutil = require("jit.util") local vmdef = require("jit.vmdef") local bit = require("bit") diff --git a/src/jit/bcsave.lua b/src/jit/bcsave.lua index fcd80334..55fae993 100644 --- a/src/jit/bcsave.lua +++ b/src/jit/bcsave.lua @@ -11,7 +11,7 @@ ------------------------------------------------------------------------------ local jit = require("jit") -assert(jit.version_num == 20005, "LuaJIT core/library version mismatch") +assert(jit.version_num == 20099, "LuaJIT core/library version mismatch") local bit = require("bit") -- Symbol name prefix for LuaJIT bytecode. diff --git a/src/jit/dump.lua b/src/jit/dump.lua index 87950cb2..86f11e26 100644 --- a/src/jit/dump.lua +++ b/src/jit/dump.lua @@ -55,7 +55,6 @@ -- Cache some library functions and objects. local jit = require("jit") -assert(jit.version_num == 20005, "LuaJIT core/library version mismatch") local jutil = require("jit.util") local vmdef = require("jit.vmdef") local funcinfo, funcbc = jutil.funcinfo, jutil.funcbc diff --git a/src/jit/v.lua b/src/jit/v.lua index 19b6949d..29edcf2b 100644 --- a/src/jit/v.lua +++ b/src/jit/v.lua @@ -59,7 +59,6 @@ -- Cache some library functions and objects. local jit = require("jit") -assert(jit.version_num == 20005, "LuaJIT core/library version mismatch") local jutil = require("jit.util") local vmdef = require("jit.vmdef") local funcinfo, traceinfo = jutil.funcinfo, jutil.traceinfo diff --git a/src/lib_jit.c b/src/lib_jit.c index c2f1ee7c..04a564c7 100644 --- a/src/lib_jit.c +++ b/src/lib_jit.c @@ -648,7 +648,7 @@ LUALIB_API int luaopen_jit(lua_State *L) { lua_pushliteral(L, LJ_OS_NAME); lua_pushliteral(L, LJ_ARCH_NAME); - lua_pushinteger(L, LUAJIT_VERSION_NUM); + lua_pushinteger(L, LUAJIT_VERSION_NUM); /* Deprecated. */ lua_pushliteral(L, LUAJIT_VERSION); LJ_LIB_REG(L, LUA_JITLIBNAME, jit); #ifndef LUAJIT_DISABLE_JITUTIL diff --git a/src/luaconf.h b/src/luaconf.h index c1c9b4d3..8fc3eee5 100644 --- a/src/luaconf.h +++ b/src/luaconf.h @@ -37,7 +37,7 @@ #endif #define LUA_LROOT "/usr/local" #define LUA_LUADIR "/lua/5.1/" -#define LUA_LJDIR "/luajit-2.0.5/" +#define LUA_LJDIR "/luajit-2.0/" #ifdef LUA_ROOT #define LUA_JROOT LUA_ROOT diff --git a/src/luajit.h b/src/luajit_rolling.h similarity index 94% rename from src/luajit.h rename to src/luajit_rolling.h index 8b09f376..27368836 100644 --- a/src/luajit.h +++ b/src/luajit_rolling.h @@ -30,9 +30,9 @@ #include "lua.h" -#define LUAJIT_VERSION "LuaJIT 2.0.5" -#define LUAJIT_VERSION_NUM 20005 /* Version 2.0.5 = 02.00.05. */ -#define LUAJIT_VERSION_SYM luaJIT_version_2_0_5 +#define LUAJIT_VERSION "LuaJIT 2.0.ROLLING" +#define LUAJIT_VERSION_NUM 20099 /* Deprecated. */ +#define LUAJIT_VERSION_SYM luaJIT_version_2_0_ROLLING #define LUAJIT_COPYRIGHT "Copyright (C) 2005-2023 Mike Pall" #define LUAJIT_URL "https://luajit.org/" From 6351abc78f9dfe9c462ed6cc3fc0c512d2fad696 Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Mon, 21 Aug 2023 03:59:03 +0200 Subject: [PATCH 05/12] Switch MSVC and console build scripts to rolling releases. --- src/msvcbuild.bat | 3 +++ src/ps4build.bat | 3 +++ src/psvitabuild.bat | 3 +++ src/xedkbuild.bat | 3 +++ 4 files changed, 12 insertions(+) diff --git a/src/msvcbuild.bat b/src/msvcbuild.bat index 6d6c1aa2..3ab59ea5 100644 --- a/src/msvcbuild.bat +++ b/src/msvcbuild.bat @@ -42,6 +42,9 @@ if exist minilua.exe.manifest^ minilua %DASM% -LN %DASMFLAGS% -o host\buildvm_arch.h vm_x86.dasc @if errorlevel 1 goto :BAD +git show -s --format=%ct >luajit_relver.txt +minilua host\genversion.lua + %LJCOMPILE% /I "." /I %DASMDIR% host\buildvm*.c @if errorlevel 1 goto :BAD %LJLINK% /out:buildvm.exe buildvm*.obj diff --git a/src/ps4build.bat b/src/ps4build.bat index 337a44fa..2fd582e3 100644 --- a/src/ps4build.bat +++ b/src/ps4build.bat @@ -31,6 +31,9 @@ if exist minilua.exe.manifest^ minilua %DASM% -LN %DASMFLAGS% -o host\buildvm_arch.h vm_x86.dasc @if errorlevel 1 goto :BAD +git show -s --format=%ct >luajit_relver.txt +minilua host\genversion.lua + %LJCOMPILE% /I "." /I %DASMDIR% -DLUAJIT_TARGET=LUAJIT_ARCH_X64 -DLUAJIT_OS=LUAJIT_OS_OTHER -DLUAJIT_DISABLE_JIT -DLUAJIT_DISABLE_FFI -DLUAJIT_NO_UNWIND host\buildvm*.c @if errorlevel 1 goto :BAD %LJLINK% /out:buildvm.exe buildvm*.obj diff --git a/src/psvitabuild.bat b/src/psvitabuild.bat index 3991dc65..e26c36e1 100644 --- a/src/psvitabuild.bat +++ b/src/psvitabuild.bat @@ -31,6 +31,9 @@ if exist minilua.exe.manifest^ minilua %DASM% -LN %DASMFLAGS% -o host\buildvm_arch.h vm_arm.dasc @if errorlevel 1 goto :BAD +git show -s --format=%ct >luajit_relver.txt +minilua host\genversion.lua + %LJCOMPILE% /I "." /I %DASMDIR% -DLUAJIT_TARGET=LUAJIT_ARCH_ARM -DLUAJIT_OS=LUAJIT_OS_OTHER -DLUAJIT_DISABLE_JIT -DLUAJIT_DISABLE_FFI -DLJ_TARGET_PSVITA=1 host\buildvm*.c @if errorlevel 1 goto :BAD %LJLINK% /out:buildvm.exe buildvm*.obj diff --git a/src/xedkbuild.bat b/src/xedkbuild.bat index 240ec878..4c2d5cc7 100644 --- a/src/xedkbuild.bat +++ b/src/xedkbuild.bat @@ -31,6 +31,9 @@ if exist minilua.exe.manifest^ minilua %DASM% -LN %DASMFLAGS% -o host\buildvm_arch.h vm_ppc.dasc @if errorlevel 1 goto :BAD +git show -s --format=%ct >luajit_relver.txt +minilua host\genversion.lua + %LJCOMPILE% /I "." /I %DASMDIR% /D_XBOX_VER=200 /DLUAJIT_TARGET=LUAJIT_ARCH_PPC host\buildvm*.c @if errorlevel 1 goto :BAD %LJLINK% /out:buildvm.exe buildvm*.obj From ed21acd86354241a5d1365500336eb47c50ee253 Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Mon, 21 Aug 2023 13:08:00 +0200 Subject: [PATCH 06/12] Fix Windows build scripts for rolling releases. Reported by Miku AuahDark. --- src/msvcbuild.bat | 2 +- src/ps4build.bat | 2 +- src/psvitabuild.bat | 2 +- src/xedkbuild.bat | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/msvcbuild.bat b/src/msvcbuild.bat index 3ab59ea5..44781e10 100644 --- a/src/msvcbuild.bat +++ b/src/msvcbuild.bat @@ -42,7 +42,7 @@ if exist minilua.exe.manifest^ minilua %DASM% -LN %DASMFLAGS% -o host\buildvm_arch.h vm_x86.dasc @if errorlevel 1 goto :BAD -git show -s --format=%ct >luajit_relver.txt +git show -s --format=%%ct >luajit_relver.txt minilua host\genversion.lua %LJCOMPILE% /I "." /I %DASMDIR% host\buildvm*.c diff --git a/src/ps4build.bat b/src/ps4build.bat index 2fd582e3..306b06ef 100644 --- a/src/ps4build.bat +++ b/src/ps4build.bat @@ -31,7 +31,7 @@ if exist minilua.exe.manifest^ minilua %DASM% -LN %DASMFLAGS% -o host\buildvm_arch.h vm_x86.dasc @if errorlevel 1 goto :BAD -git show -s --format=%ct >luajit_relver.txt +git show -s --format=%%ct >luajit_relver.txt minilua host\genversion.lua %LJCOMPILE% /I "." /I %DASMDIR% -DLUAJIT_TARGET=LUAJIT_ARCH_X64 -DLUAJIT_OS=LUAJIT_OS_OTHER -DLUAJIT_DISABLE_JIT -DLUAJIT_DISABLE_FFI -DLUAJIT_NO_UNWIND host\buildvm*.c diff --git a/src/psvitabuild.bat b/src/psvitabuild.bat index e26c36e1..9be485ae 100644 --- a/src/psvitabuild.bat +++ b/src/psvitabuild.bat @@ -31,7 +31,7 @@ if exist minilua.exe.manifest^ minilua %DASM% -LN %DASMFLAGS% -o host\buildvm_arch.h vm_arm.dasc @if errorlevel 1 goto :BAD -git show -s --format=%ct >luajit_relver.txt +git show -s --format=%%ct >luajit_relver.txt minilua host\genversion.lua %LJCOMPILE% /I "." /I %DASMDIR% -DLUAJIT_TARGET=LUAJIT_ARCH_ARM -DLUAJIT_OS=LUAJIT_OS_OTHER -DLUAJIT_DISABLE_JIT -DLUAJIT_DISABLE_FFI -DLJ_TARGET_PSVITA=1 host\buildvm*.c diff --git a/src/xedkbuild.bat b/src/xedkbuild.bat index 4c2d5cc7..145219c8 100644 --- a/src/xedkbuild.bat +++ b/src/xedkbuild.bat @@ -31,7 +31,7 @@ if exist minilua.exe.manifest^ minilua %DASM% -LN %DASMFLAGS% -o host\buildvm_arch.h vm_ppc.dasc @if errorlevel 1 goto :BAD -git show -s --format=%ct >luajit_relver.txt +git show -s --format=%%ct >luajit_relver.txt minilua host\genversion.lua %LJCOMPILE% /I "." /I %DASMDIR% /D_XBOX_VER=200 /DLUAJIT_TARGET=LUAJIT_ARCH_PPC host\buildvm*.c From 748ab9d90a4a8c2d60ce099bffcea1fa524f9db2 Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Tue, 22 Aug 2023 11:13:45 +0200 Subject: [PATCH 07/12] Switch to rolling releases: mark v2.1 as production. --- Makefile | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/Makefile b/Makefile index ae194428..0c49ec23 100644 --- a/Makefile +++ b/Makefile @@ -142,14 +142,8 @@ 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) ====" From 093759d528a9c3f1b69c1ff5fd46b5f52fc4d9aa Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Tue, 22 Aug 2023 11:46:12 +0200 Subject: [PATCH 08/12] Fix for last commit: also remove symlink on uninstall. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 0c49ec23..994b81dd 100644 --- a/Makefile +++ b/Makefile @@ -147,7 +147,7 @@ install: $(INSTALL_DEP) 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_TYSM) $(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 From 33e2a49dbf2ad718d7d5c8e04ca4b955b48d23f2 Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Tue, 22 Aug 2023 15:30:27 +0200 Subject: [PATCH 09/12] Add .gitattributes to dynamically resolve .relver. Thanks to Alexander Shpilkin. --- .gitattributes | 1 + .relver | 1 + 2 files changed, 2 insertions(+) create mode 100644 .gitattributes create mode 100644 .relver 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$ From 6a2163a6b45d6d2515993e829153442f1cdf5631 Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Tue, 22 Aug 2023 15:36:55 +0200 Subject: [PATCH 10/12] Add .gitattributes to dynamically resolve .relver. Thanks to Alexander Shpilkin. --- .gitattributes | 1 + .relver | 1 + 2 files changed, 2 insertions(+) create mode 100644 .gitattributes create mode 100644 .relver 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$ From d0ce82ecdcf0fcfb766e207eac6b7622680817b2 Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Tue, 22 Aug 2023 17:04:22 +0200 Subject: [PATCH 11/12] Handle the case when .git is not a directory. Thanks to Alexander Shpilkin. --- src/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile b/src/Makefile index e6954a95..29c01747 100644 --- a/src/Makefile +++ b/src/Makefile @@ -446,7 +446,7 @@ DASM_FLAGS= $(DASM_XFLAGS) $(DASM_AFLAGS) DASM_DASC= vm_$(DASM_ARCH).dasc GIT= git -GIT_RELVER= [ -d ../.git ] && $(GIT) show -s --format=%ct >luajit_relver.txt 2>/dev/null || cat ../.relver >luajit_relver.txt 2>/dev/null || : +GIT_RELVER= [ -e ../.git ] && $(GIT) show -s --format=%ct >luajit_relver.txt 2>/dev/null || cat ../.relver >luajit_relver.txt 2>/dev/null || : GIT_DEP= $(wildcard ../.git/HEAD ../.git/refs/heads/*) BUILDVM_O= host/buildvm.o host/buildvm_asm.o host/buildvm_peobj.o \ From 03c31124cc3b521ef54fe398e10fa55660a5057d Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Tue, 22 Aug 2023 17:06:34 +0200 Subject: [PATCH 12/12] Fix typo. Thanks to Simon Cooke. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 994b81dd..3aed365d 100644 --- a/Makefile +++ b/Makefile @@ -147,7 +147,7 @@ install: $(INSTALL_DEP) uninstall: @echo "==== Uninstalling LuaJIT $(VERSION) from $(PREFIX) ====" - $(UNINSTALL) $(INSTALL_TYSM) $(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