This is a list of changes between the released versions of LuaJIT.
-The current stable version is LuaJIT 2.0.4.
+The current stable version is LuaJIT 2.0.5.
Please check the @@ -72,6 +72,48 @@ to see whether newer versions are available.
LuaJIT 2.0.5 — 2017-05-01
+-
+
- Add workaround for MSVC 2015 stdio changes. +
- Limit mcode alloc probing, depending on the available pool size. +
- Fix overly restrictive range calculation in mcode allocation. +
- Fix out-of-scope goto handling in parser. +
- Remove internal __mode = "K" and replace with safe check. +
- Add "proto" field to jit.util.funcinfo(). +
- Fix GC step size calculation. +
- Initialize uv->immutable for upvalues of loaded chunks. +
- Fix for cdata vs. non-cdata arithmetics/comparisons. +
- Drop leftover regs in 'for' iterator assignment, too. +
- Fix PHI remarking in SINK pass. +
- Don't try to record outermost pcall() return to lower frame. +
- Add guard for obscure aliasing between open upvalues and SSA slots. +
- Remove assumption that lj_math_random_step() doesn't clobber FPRs. +
- Fix handling of non-numeric strings in arithmetic coercions. +
- Fix recording of select(n, ...) with off-trace varargs +
- Fix install for cross-builds. +
- Don't allocate unused 2nd result register in JIT compiler backend. +
- Drop marks from replayed instructions when sinking. +
- Fix unsinking check. +
- Properly handle OOM in trace_save(). +
- Limit number of arguments given to io.lines() and fp:lines(). +
- Fix narrowing of TOBIT. +
- OSX: Fix build with recent XCode. +
- x86/x64: Don't spill an explicit REF_BASE in the IR. +
- x86/x64: Fix instruction length decoder. +
- x86/x64: Search for exit jumps with instruction length decoder. +
- ARM: Fix BLX encoding for Thumb interworking calls. +
- MIPS: Don't use RID_GP as a scratch register. +
- MIPS: Fix emitted code for U32 to float conversion. +
- MIPS: Backport workaround for compact unwind tables. +
- MIPS: Fix cross-endian jit.bcsave. +
- MIPS: Fix BC_ISNEXT fallback path. +
- MIPS: Fix use of ffgccheck delay slots in interpreter. +
- FFI: Fix FOLD rules for int64_t comparisons. +
- FFI: Fix SPLIT pass for CONV i64.u64. +
- FFI: Fix ipairs() recording. +
- FFI: Don't propagate qualifiers into subtypes of complex. +
LuaJIT 2.0.4 — 2015-05-14
- Fix stack check in narrowing optimization. @@ -968,7 +1010,7 @@ This is the initial non-public release of LuaJIT.
-Copyright © 2005-2015 Mike Pall +Copyright © 2005-2017 Mike Pall · Contact diff --git a/libs/LuaJIT/doc/contact.html b/libs/LuaJIT/doc/contact.html index 0ef01a7c..5e07bded 100644 --- a/libs/LuaJIT/doc/contact.html +++ b/libs/LuaJIT/doc/contact.html @@ -4,7 +4,7 @@
+If you want to report bugs, propose fixes or suggest enhancements, +please use the +GitHub issue tracker. +
+Please send general questions to the » LuaJIT mailing list. +
+You can also send any questions you have directly to me:
@@ -84,7 +91,7 @@ xD("fyZKB8xv\"FJytmz8.KAB0u52D")Copyright
All documentation is -Copyright © 2005-2015 Mike Pall. +Copyright © 2005-2017 Mike Pall.
@@ -92,7 +99,7 @@ Copyright © 2005-2015 Mike Pall.-Copyright © 2005-2015 Mike Pall +Copyright © 2005-2017 Mike Pall · Contact diff --git a/libs/LuaJIT/doc/ext_c_api.html b/libs/LuaJIT/doc/ext_c_api.html index 65981806..041a7220 100644 --- a/libs/LuaJIT/doc/ext_c_api.html +++ b/libs/LuaJIT/doc/ext_c_api.html @@ -4,7 +4,7 @@
-Copyright © 2005-2015 Mike Pall +Copyright © 2005-2017 Mike Pall · Contact diff --git a/libs/LuaJIT/doc/ext_ffi.html b/libs/LuaJIT/doc/ext_ffi.html index 77b8e26c..d48d77fa 100644 --- a/libs/LuaJIT/doc/ext_ffi.html +++ b/libs/LuaJIT/doc/ext_ffi.html @@ -4,7 +4,7 @@
-Copyright © 2005-2015 Mike Pall +Copyright © 2005-2017 Mike Pall · Contact diff --git a/libs/LuaJIT/doc/ext_ffi_api.html b/libs/LuaJIT/doc/ext_ffi_api.html index 8f577e9f..566897c8 100644 --- a/libs/LuaJIT/doc/ext_ffi_api.html +++ b/libs/LuaJIT/doc/ext_ffi_api.html @@ -4,7 +4,7 @@
-Copyright © 2005-2015 Mike Pall +Copyright © 2005-2017 Mike Pall · Contact diff --git a/libs/LuaJIT/doc/ext_ffi_semantics.html b/libs/LuaJIT/doc/ext_ffi_semantics.html index c267b555..899640ce 100644 --- a/libs/LuaJIT/doc/ext_ffi_semantics.html +++ b/libs/LuaJIT/doc/ext_ffi_semantics.html @@ -4,7 +4,7 @@
-Copyright © 2005-2015 Mike Pall +Copyright © 2005-2017 Mike Pall · Contact diff --git a/libs/LuaJIT/doc/ext_ffi_tutorial.html b/libs/LuaJIT/doc/ext_ffi_tutorial.html index 8f99bfb1..29cf549e 100644 --- a/libs/LuaJIT/doc/ext_ffi_tutorial.html +++ b/libs/LuaJIT/doc/ext_ffi_tutorial.html @@ -4,7 +4,7 @@
-Copyright © 2005-2015 Mike Pall +Copyright © 2005-2017 Mike Pall · Contact diff --git a/libs/LuaJIT/doc/ext_jit.html b/libs/LuaJIT/doc/ext_jit.html index 27351dd6..5017e3cd 100644 --- a/libs/LuaJIT/doc/ext_jit.html +++ b/libs/LuaJIT/doc/ext_jit.html @@ -4,7 +4,7 @@
-Copyright © 2005-2015 Mike Pall +Copyright © 2005-2017 Mike Pall · Contact diff --git a/libs/LuaJIT/doc/extensions.html b/libs/LuaJIT/doc/extensions.html index e9cd136c..3d9e82ba 100644 --- a/libs/LuaJIT/doc/extensions.html +++ b/libs/LuaJIT/doc/extensions.html @@ -4,7 +4,7 @@
Note: this provides only partial compatibility with Lua 5.2 at the @@ -398,7 +398,7 @@ lead to the termination of the process.
-Copyright © 2005-2015 Mike Pall +Copyright © 2005-2017 Mike Pall · Contact diff --git a/libs/LuaJIT/doc/faq.html b/libs/LuaJIT/doc/faq.html index 9902f090..afeff940 100644 --- a/libs/LuaJIT/doc/faq.html +++ b/libs/LuaJIT/doc/faq.html @@ -4,7 +4,7 @@
-Copyright © 2005-2015 Mike Pall +Copyright © 2005-2017 Mike Pall · Contact diff --git a/libs/LuaJIT/doc/install.html b/libs/LuaJIT/doc/install.html index 7a878b1c..4bcc506a 100644 --- a/libs/LuaJIT/doc/install.html +++ b/libs/LuaJIT/doc/install.html @@ -4,7 +4,7 @@
GCC 3.4
GCC 3.4
GCC 3.4
GCC 3.4
GCC 3.4
Clang
WinSDK
MinGW, Cygwin
Clang
WinSDK v7.0
ARM9E+
PSP2 (PS VITA)
Clang
-tar zxf LuaJIT-2.0.4.tar.gz -cd LuaJIT-2.0.4+tar zxf LuaJIT-2.0.5.tar.gz +cd LuaJIT-2.0.5
Building LuaJIT
The supplied Makefiles try to auto-detect the settings needed for your @@ -344,9 +344,12 @@ 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. For a minimal target OS, you may need to disable the built-in allocator in -src/Makefile and use TARGET_SYS=Other. The examples -below only show some popular targets — please check the comments -in src/Makefile for more details. +src/Makefile and use TARGET_SYS=Other. Don't forget to +specify the same TARGET_SYS for the install step, too. +
++The examples below only show some popular targets — please check +the comments in src/Makefile for more details.
# Cross-compile to a 32 bit binary on a multilib x64 OS @@ -439,8 +442,7 @@ NDKF="--sysroot $NDK/platforms/android-$NDKABI/arch-x86" make HOST_CC="gcc -m32" CROSS=$NDKP TARGET_FLAGS="$NDKF"
-You can cross-compile for iOS 3.0+ (iPhone/iPad) using the » iOS SDK. -The environment variables need to match the iOS SDK version: +You can cross-compile for iOS 3.0+ (iPhone/iPad) using the » iOS SDK:
Note: the JIT compiler is disabled for iOS, because regular iOS Apps @@ -450,13 +452,11 @@ much slower than the JIT compiler. Please complain to Apple, not me. Or use Android. :-p
-IXCODE=`xcode-select -print-path` -ISDK=$IXCODE/Platforms/iPhoneOS.platform/Developer -ISDKVER=iPhoneOS6.0.sdk -ISDKP=$ISDK/usr/bin/ -ISDKF="-arch armv7 -isysroot $ISDK/SDKs/$ISDKVER" -make HOST_CC="gcc -m32 -arch i386" CROSS=$ISDKP TARGET_FLAGS="$ISDKF" \ - TARGET_SYS=iOS +ISDKP=$(xcrun --sdk iphoneos --show-sdk-path) +ICC=$(xcrun --sdk iphoneos --find clang) +ISDKF="-arch armv7 -isysroot $ISDKP" +make DEFAULT_CC=clang HOST_CC="clang -m32 -arch i386" \ + CROSS="$(dirname $ICC)/" TARGET_FLAGS="$ISDKF" TARGET_SYS=iOS
Cross-compiling for consoles
@@ -636,7 +636,7 @@ to me (the upstream) and not you (the package maintainer), anyway.-Copyright © 2005-2015 Mike Pall +Copyright © 2005-2017 Mike Pall · Contact diff --git a/libs/LuaJIT/doc/luajit.html b/libs/LuaJIT/doc/luajit.html index 45507c12..00030081 100644 --- a/libs/LuaJIT/doc/luajit.html +++ b/libs/LuaJIT/doc/luajit.html @@ -4,7 +4,7 @@
-LuaJIT is Copyright © 2005-2015 Mike Pall, released under the +LuaJIT is Copyright © 2005-2017 Mike Pall, released under the » MIT open source license.
@@ -224,7 +224,7 @@ Please select a sub-topic in the navigation bar to learn more about LuaJIT.
-Copyright © 2005-2015 Mike Pall +Copyright © 2005-2017 Mike Pall · Contact diff --git a/libs/LuaJIT/doc/running.html b/libs/LuaJIT/doc/running.html index c6e1c296..331c22df 100644 --- a/libs/LuaJIT/doc/running.html +++ b/libs/LuaJIT/doc/running.html @@ -4,7 +4,7 @@
-Copyright © 2005-2015 Mike Pall +Copyright © 2005-2017 Mike Pall · Contact diff --git a/libs/LuaJIT/doc/status.html b/libs/LuaJIT/doc/status.html index b4bbec79..aa8df93e 100644 --- a/libs/LuaJIT/doc/status.html +++ b/libs/LuaJIT/doc/status.html @@ -4,7 +4,7 @@
-Copyright © 2005-2015 Mike Pall +Copyright © 2005-2017 Mike Pall · Contact diff --git a/libs/LuaJIT/dynasm/dasm_arm.h b/libs/LuaJIT/dynasm/dasm_arm.h index 57e0116f..a43f7c66 100644 --- a/libs/LuaJIT/dynasm/dasm_arm.h +++ b/libs/LuaJIT/dynasm/dasm_arm.h @@ -1,6 +1,6 @@ /* ** DynASM ARM encoding engine. -** Copyright (C) 2005-2015 Mike Pall. All rights reserved. +** Copyright (C) 2005-2017 Mike Pall. All rights reserved. ** Released under the MIT license. See dynasm.lua for full copyright notice. */ diff --git a/libs/LuaJIT/dynasm/dasm_arm.lua b/libs/LuaJIT/dynasm/dasm_arm.lua index 90a259c5..9ece1d7f 100644 --- a/libs/LuaJIT/dynasm/dasm_arm.lua +++ b/libs/LuaJIT/dynasm/dasm_arm.lua @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ -- DynASM ARM module. -- --- Copyright (C) 2005-2015 Mike Pall. All rights reserved. +-- Copyright (C) 2005-2017 Mike Pall. All rights reserved. -- See dynasm.lua for full copyright notice. ------------------------------------------------------------------------------ diff --git a/libs/LuaJIT/dynasm/dasm_mips.h b/libs/LuaJIT/dynasm/dasm_mips.h index 2f4c2d22..7eac6694 100644 --- a/libs/LuaJIT/dynasm/dasm_mips.h +++ b/libs/LuaJIT/dynasm/dasm_mips.h @@ -1,6 +1,6 @@ /* ** DynASM MIPS encoding engine. -** Copyright (C) 2005-2015 Mike Pall. All rights reserved. +** Copyright (C) 2005-2017 Mike Pall. All rights reserved. ** Released under the MIT license. See dynasm.lua for full copyright notice. */ diff --git a/libs/LuaJIT/dynasm/dasm_mips.lua b/libs/LuaJIT/dynasm/dasm_mips.lua index ae0dbd7a..8e250cef 100644 --- a/libs/LuaJIT/dynasm/dasm_mips.lua +++ b/libs/LuaJIT/dynasm/dasm_mips.lua @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ -- DynASM MIPS module. -- --- Copyright (C) 2005-2015 Mike Pall. All rights reserved. +-- Copyright (C) 2005-2017 Mike Pall. All rights reserved. -- See dynasm.lua for full copyright notice. ------------------------------------------------------------------------------ diff --git a/libs/LuaJIT/dynasm/dasm_ppc.h b/libs/LuaJIT/dynasm/dasm_ppc.h index 7df49365..61103612 100644 --- a/libs/LuaJIT/dynasm/dasm_ppc.h +++ b/libs/LuaJIT/dynasm/dasm_ppc.h @@ -1,6 +1,6 @@ /* ** DynASM PPC encoding engine. -** Copyright (C) 2005-2015 Mike Pall. All rights reserved. +** Copyright (C) 2005-2017 Mike Pall. All rights reserved. ** Released under the MIT license. See dynasm.lua for full copyright notice. */ diff --git a/libs/LuaJIT/dynasm/dasm_ppc.lua b/libs/LuaJIT/dynasm/dasm_ppc.lua index 91f4ff9a..4e1656e3 100644 --- a/libs/LuaJIT/dynasm/dasm_ppc.lua +++ b/libs/LuaJIT/dynasm/dasm_ppc.lua @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ -- DynASM PPC module. -- --- Copyright (C) 2005-2015 Mike Pall. All rights reserved. +-- Copyright (C) 2005-2017 Mike Pall. All rights reserved. -- See dynasm.lua for full copyright notice. ------------------------------------------------------------------------------ diff --git a/libs/LuaJIT/dynasm/dasm_proto.h b/libs/LuaJIT/dynasm/dasm_proto.h index a8bc6fd2..f5e79c7a 100644 --- a/libs/LuaJIT/dynasm/dasm_proto.h +++ b/libs/LuaJIT/dynasm/dasm_proto.h @@ -1,6 +1,6 @@ /* ** DynASM encoding engine prototypes. -** Copyright (C) 2005-2015 Mike Pall. All rights reserved. +** Copyright (C) 2005-2017 Mike Pall. All rights reserved. ** Released under the MIT license. See dynasm.lua for full copyright notice. */ diff --git a/libs/LuaJIT/dynasm/dasm_x64.lua b/libs/LuaJIT/dynasm/dasm_x64.lua index b1b62022..e8bdeb37 100644 --- a/libs/LuaJIT/dynasm/dasm_x64.lua +++ b/libs/LuaJIT/dynasm/dasm_x64.lua @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ -- DynASM x64 module. -- --- Copyright (C) 2005-2015 Mike Pall. All rights reserved. +-- Copyright (C) 2005-2017 Mike Pall. All rights reserved. -- See dynasm.lua for full copyright notice. ------------------------------------------------------------------------------ -- This module just sets 64 bit mode for the combined x86/x64 module. diff --git a/libs/LuaJIT/dynasm/dasm_x86.h b/libs/LuaJIT/dynasm/dasm_x86.h index 652e8c99..90dc5d15 100644 --- a/libs/LuaJIT/dynasm/dasm_x86.h +++ b/libs/LuaJIT/dynasm/dasm_x86.h @@ -1,6 +1,6 @@ /* ** DynASM x86 encoding engine. -** Copyright (C) 2005-2015 Mike Pall. All rights reserved. +** Copyright (C) 2005-2017 Mike Pall. All rights reserved. ** Released under the MIT license. See dynasm.lua for full copyright notice. */ @@ -204,7 +204,8 @@ void dasm_put(Dst_DECL, int start, ...) case DASM_SPACE: p++; ofs += n; break; case DASM_SETLABEL: b[pos-2] = -0x40000000; break; /* Neg. label ofs. */ case DASM_VREG: CK((n&-8) == 0 && (n != 4 || (*p&1) == 0), RANGE_VREG); - if (*p++ == 1 && *p == DASM_DISP) mrm = n; continue; + if (*p++ == 1 && *p == DASM_DISP) mrm = n; + continue; } mrm = 4; } else { diff --git a/libs/LuaJIT/dynasm/dasm_x86.lua b/libs/LuaJIT/dynasm/dasm_x86.lua index 7ca061d2..21c20865 100644 --- a/libs/LuaJIT/dynasm/dasm_x86.lua +++ b/libs/LuaJIT/dynasm/dasm_x86.lua @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ -- DynASM x86/x64 module. -- --- Copyright (C) 2005-2015 Mike Pall. All rights reserved. +-- Copyright (C) 2005-2017 Mike Pall. All rights reserved. -- See dynasm.lua for full copyright notice. ------------------------------------------------------------------------------ @@ -1081,10 +1081,11 @@ local map_op = { btr_2 = "mrqdw:0FB3Rm|miqdw:0FBA6mU", bts_2 = "mrqdw:0FABRm|miqdw:0FBA5mU", - shld_3 = "mriqdw:0FA4RmU|mrCqdw:0FA5Rm", - shrd_3 = "mriqdw:0FACRmU|mrCqdw:0FADRm", + shld_3 = "mriqdw:0FA4RmU|mrC/qq:0FA5Rm|mrC/dd:|mrC/ww:", + shrd_3 = "mriqdw:0FACRmU|mrC/qq:0FADRm|mrC/dd:|mrC/ww:", rdtsc_0 = "0F31", -- P1+ + rdpmc_0 = "0F33", -- P6+ cpuid_0 = "0FA2", -- P1+ -- floating point ops @@ -1190,7 +1191,7 @@ local map_op = { cvtsi2sd_2 = "rm/od:F20F2ArM|rm/oq:F20F2ArXM", cvtsi2ss_2 = "rm/od:F30F2ArM|rm/oq:F30F2ArXM", cvtss2sd_2 = "rro:F30F5ArM|rx/od:", - cvtss2si_2 = "rr/do:F20F2CrM|rr/qo:|rxd:|rx/qd:", + cvtss2si_2 = "rr/do:F30F2DrM|rr/qo:|rxd:|rx/qd:", cvttpd2dq_2 = "rmo:660FE6rM", cvttps2dq_2 = "rmo:F30F5BrM", cvttsd2si_2 = "rr/do:F20F2CrM|rr/qo:|rx/dq:|rxq:", @@ -1247,7 +1248,7 @@ local map_op = { pcmpgtb_2 = "rmo:660F64rM", pcmpgtd_2 = "rmo:660F66rM", pcmpgtw_2 = "rmo:660F65rM", - pextrw_3 = "rri/do:660FC5rMU|xri/wo:660F3A15nrMU", -- Mem op: SSE4.1 only. + pextrw_3 = "rri/do:660FC5rMU|xri/wo:660F3A15nRmU", -- Mem op: SSE4.1 only. pinsrw_3 = "rri/od:660FC4rMU|rxi/ow:", pmaddwd_2 = "rmo:660FF5rM", pmaxsw_2 = "rmo:660FEErM", @@ -1352,7 +1353,7 @@ local map_op = { dpps_3 = "rmio:660F3A40rMU", extractps_3 = "mri/do:660F3A17RmU|rri/qo:660F3A17RXmU", insertps_3 = "rrio:660F3A41rMU|rxi/od:", - movntdqa_2 = "rmo:660F382ArM", + movntdqa_2 = "rxo:660F382ArM", mpsadbw_3 = "rmio:660F3A42rMU", packusdw_2 = "rmo:660F382BrM", pblendvb_3 = "rmRo:660F3810rM", diff --git a/libs/LuaJIT/dynasm/dynasm.lua b/libs/LuaJIT/dynasm/dynasm.lua index fffda751..c46e956e 100644 --- a/libs/LuaJIT/dynasm/dynasm.lua +++ b/libs/LuaJIT/dynasm/dynasm.lua @@ -2,7 +2,7 @@ -- DynASM. A dynamic assembler for code generation engines. -- Originally designed and implemented for LuaJIT. -- --- Copyright (C) 2005-2015 Mike Pall. All rights reserved. +-- Copyright (C) 2005-2017 Mike Pall. All rights reserved. -- See below for full copyright notice. ------------------------------------------------------------------------------ @@ -17,7 +17,7 @@ local _info = { url = "http://luajit.org/dynasm.html", license = "MIT", copyright = [[ -Copyright (C) 2005-2015 Mike Pall. All rights reserved. +Copyright (C) 2005-2017 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 diff --git a/libs/LuaJIT/etc/luajit.1 b/libs/LuaJIT/etc/luajit.1 index fd38b0a9..0d263db7 100644 --- a/libs/LuaJIT/etc/luajit.1 +++ b/libs/LuaJIT/etc/luajit.1 @@ -74,7 +74,7 @@ luajit \-jv \-e "for i=1,10 do for j=1,10 do for k=1,100 do end end end" Runs some nested loops and shows the resulting traces. .SH COPYRIGHT .PP -\fBLuaJIT\fR is Copyright \(co 2005-2015 Mike Pall. +\fBLuaJIT\fR is Copyright \(co 2005-2017 Mike Pall. .br \fBLuaJIT\fR is open source software, released under the MIT license. .SH SEE ALSO diff --git a/libs/LuaJIT/etc/luajit.pc b/libs/LuaJIT/etc/luajit.pc index a652b40d..36840ab8 100644 --- a/libs/LuaJIT/etc/luajit.pc +++ b/libs/LuaJIT/etc/luajit.pc @@ -1,7 +1,7 @@ # Package information for LuaJIT to be used by pkg-config. majver=2 minver=0 -relver=4 +relver=5 version=${majver}.${minver}.${relver} abiver=5.1 diff --git a/libs/LuaJIT/src/Makefile b/libs/LuaJIT/src/Makefile index 1d38fa25..f7f81a4e 100644 --- a/libs/LuaJIT/src/Makefile +++ b/libs/LuaJIT/src/Makefile @@ -7,12 +7,12 @@ # Also works with MinGW and Cygwin on Windows. # Please check msvcbuild.bat for building with MSVC on Windows. # -# Copyright (C) 2005-2015 Mike Pall. See Copyright Notice in luajit.h +# Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h ############################################################################## MAJVER= 2 MINVER= 0 -RELVER= 4 +RELVER= 5 ABIVER= 5.1 NODOTABIVER= 51 @@ -24,11 +24,13 @@ NODOTABIVER= 51 # removing the '#' in front of them. Make sure you force a full recompile # with "make clean", followed by "make" if you change any options. # +DEFAULT_CC = gcc +# # LuaJIT builds as a native 32 or 64 bit binary by default. -CC= gcc +CC= $(DEFAULT_CC) # # Use this if you want to force a 32 bit build on a 64 bit multilib OS. -#CC= gcc -m32 +#CC= $(DEFAULT_CC) -m32 # # Since the assembler part does NOT maintain a frame pointer, it's pointless # to slow down the C part by not omitting it. Debugging, tracebacks and @@ -150,6 +152,25 @@ XCFLAGS= # You probably don't need to change anything below this line! ############################################################################## +############################################################################## +# Host system detection. +############################################################################## + +ifeq (Windows,$(findstring Windows,$(OS))$(MSYSTEM)$(TERM)) + HOST_SYS= Windows + HOST_RM= del +else + HOST_SYS:= $(shell uname -s) + ifneq (,$(findstring MINGW,$(HOST_SYS))) + HOST_SYS= Windows + HOST_MSYS= mingw + endif + ifneq (,$(findstring CYGWIN,$(HOST_SYS))) + HOST_SYS= Windows + HOST_MSYS= cygwin + endif +endif + ############################################################################## # Flags and options for host and target. ############################################################################## @@ -187,7 +208,7 @@ TARGET_CC= $(STATIC_CC) TARGET_STCC= $(STATIC_CC) TARGET_DYNCC= $(DYNAMIC_CC) TARGET_LD= $(CROSS)$(CC) -TARGET_AR= $(CROSS)ar rcus +TARGET_AR= $(CROSS)ar rcus 2>/dev/null TARGET_STRIP= $(CROSS)strip TARGET_LIBPATH= $(or $(PREFIX),/usr/local)/$(or $(MULTILIB),lib) @@ -243,9 +264,6 @@ ifneq (,$(findstring LJ_TARGET_PS3 1,$(TARGET_TESTARCH))) TARGET_ARCH+= -D__CELLOS_LV2__ TARGET_XCFLAGS+= -DLUAJIT_USE_SYSMALLOC endif -ifneq (,$(findstring LJ_NO_UNWIND 1,$(TARGET_TESTARCH))) - TARGET_ARCH+= -DLUAJIT_NO_UNWIND -endif TARGET_XCFLAGS+= $(CCOPT_$(TARGET_LJARCH)) TARGET_ARCH+= $(patsubst %,-DLUAJIT_TARGET=LUAJIT_ARCH_%,$(TARGET_LJARCH)) @@ -266,24 +284,9 @@ ifneq (,$(LMULTILIB)) endif ############################################################################## -# System detection. +# Target system detection. ############################################################################## -ifeq (Windows,$(findstring Windows,$(OS))$(MSYSTEM)$(TERM)) - HOST_SYS= Windows - HOST_RM= del -else - HOST_SYS:= $(shell uname -s) - ifneq (,$(findstring MINGW,$(HOST_SYS))) - HOST_SYS= Windows - HOST_MSYS= mingw - endif - ifneq (,$(findstring CYGWIN,$(HOST_SYS))) - HOST_SYS= Windows - HOST_MSYS= cygwin - endif -endif - TARGET_SYS?= $(HOST_SYS) ifeq (Windows,$(TARGET_SYS)) TARGET_STRIP+= --strip-unneeded @@ -298,7 +301,6 @@ ifeq (Darwin,$(TARGET_SYS)) export MACOSX_DEPLOYMENT_TARGET=10.4 endif TARGET_STRIP+= -x - TARGET_AR+= 2>/dev/null 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) @@ -309,7 +311,6 @@ ifeq (Darwin,$(TARGET_SYS)) else ifeq (iOS,$(TARGET_SYS)) TARGET_STRIP+= -x - TARGET_AR+= 2>/dev/null 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) @@ -397,6 +398,10 @@ ifeq (,$(findstring LJ_ABI_SOFTFP 1,$(TARGET_TESTARCH))) else TARGET_ARCH+= -DLJ_ABI_SOFTFP=1 endif +ifneq (,$(findstring LJ_NO_UNWIND 1,$(TARGET_TESTARCH))) + DASM_AFLAGS+= -D NO_UNWIND + TARGET_ARCH+= -DLUAJIT_NO_UNWIND +endif DASM_AFLAGS+= -D VER=$(subst LJ_ARCH_VERSION_,,$(filter LJ_ARCH_VERSION_%,$(subst LJ_ARCH_VERSION ,LJ_ARCH_VERSION_,$(TARGET_TESTARCH)))) ifeq (Windows,$(TARGET_SYS)) DASM_AFLAGS+= -D WIN diff --git a/libs/LuaJIT/src/host/buildvm.c b/libs/LuaJIT/src/host/buildvm.c index 07122a64..b9560f31 100644 --- a/libs/LuaJIT/src/host/buildvm.c +++ b/libs/LuaJIT/src/host/buildvm.c @@ -1,6 +1,6 @@ /* ** LuaJIT VM builder. -** Copyright (C) 2005-2015 Mike Pall. See Copyright Notice in luajit.h +** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h ** ** This is a tool to build the hand-tuned assembler code required for ** LuaJIT's bytecode interpreter. It supports a variety of output formats diff --git a/libs/LuaJIT/src/host/buildvm.h b/libs/LuaJIT/src/host/buildvm.h index b2621850..e6dd3dcb 100644 --- a/libs/LuaJIT/src/host/buildvm.h +++ b/libs/LuaJIT/src/host/buildvm.h @@ -1,6 +1,6 @@ /* ** LuaJIT VM builder. -** Copyright (C) 2005-2015 Mike Pall. See Copyright Notice in luajit.h +** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h */ #ifndef _BUILDVM_H diff --git a/libs/LuaJIT/src/host/buildvm_asm.c b/libs/LuaJIT/src/host/buildvm_asm.c index 2c9a2d48..81a3969a 100644 --- a/libs/LuaJIT/src/host/buildvm_asm.c +++ b/libs/LuaJIT/src/host/buildvm_asm.c @@ -1,6 +1,6 @@ /* ** LuaJIT VM builder: Assembler source code emitter. -** Copyright (C) 2005-2015 Mike Pall. See Copyright Notice in luajit.h +** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h */ #include "buildvm.h" @@ -183,7 +183,8 @@ static void emit_asm_label(BuildCtx *ctx, const char *name, int size, int isfunc case BUILD_machasm: fprintf(ctx->fp, "\n\t.private_extern %s\n" - "%s:\n", name, name); + "\t.no_dead_strip %s\n" + "%s:\n", name, name, name); break; default: break; diff --git a/libs/LuaJIT/src/host/buildvm_fold.c b/libs/LuaJIT/src/host/buildvm_fold.c index daed7ecc..d579f4d4 100644 --- a/libs/LuaJIT/src/host/buildvm_fold.c +++ b/libs/LuaJIT/src/host/buildvm_fold.c @@ -1,6 +1,6 @@ /* ** LuaJIT VM builder: IR folding hash table generator. -** Copyright (C) 2005-2015 Mike Pall. See Copyright Notice in luajit.h +** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h */ #include "buildvm.h" @@ -9,7 +9,7 @@ /* Context for the folding hash table generator. */ static int lineno; -static int funcidx; +static uint32_t funcidx; static uint32_t foldkeys[BUILD_MAX_FOLD]; static uint32_t nkeys; diff --git a/libs/LuaJIT/src/host/buildvm_lib.c b/libs/LuaJIT/src/host/buildvm_lib.c index c37301d4..569e2caf 100644 --- a/libs/LuaJIT/src/host/buildvm_lib.c +++ b/libs/LuaJIT/src/host/buildvm_lib.c @@ -1,6 +1,6 @@ /* ** LuaJIT VM builder: library definition compiler. -** Copyright (C) 2005-2015 Mike Pall. See Copyright Notice in luajit.h +** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h */ #include "buildvm.h" diff --git a/libs/LuaJIT/src/host/buildvm_peobj.c b/libs/LuaJIT/src/host/buildvm_peobj.c index 4279f500..aab00d68 100644 --- a/libs/LuaJIT/src/host/buildvm_peobj.c +++ b/libs/LuaJIT/src/host/buildvm_peobj.c @@ -1,6 +1,6 @@ /* ** LuaJIT VM builder: PE object emitter. -** Copyright (C) 2005-2015 Mike Pall. See Copyright Notice in luajit.h +** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h ** ** Only used for building on Windows, since we cannot assume the presence ** of a suitable assembler. The host and target byte order must match. diff --git a/libs/LuaJIT/src/host/genminilua.lua b/libs/LuaJIT/src/host/genminilua.lua index cd0d9466..50feff01 100644 --- a/libs/LuaJIT/src/host/genminilua.lua +++ b/libs/LuaJIT/src/host/genminilua.lua @@ -2,7 +2,7 @@ -- Lua script to generate a customized, minified version of Lua. -- The resulting 'minilua' is used for the build process of LuaJIT. ---------------------------------------------------------------------------- --- Copyright (C) 2005-2015 Mike Pall. All rights reserved. +-- Copyright (C) 2005-2017 Mike Pall. All rights reserved. -- Released under the MIT license. See Copyright Notice in luajit.h ---------------------------------------------------------------------------- @@ -157,11 +157,11 @@ local function merge_includes(src) if includes[name] then return "" end includes[name] = true local fp = assert(io.open(LUA_SOURCE..name, "r")) - local src = fp:read("*a") + local inc = fp:read("*a") assert(fp:close()) - src = gsub(src, "#ifndef%s+%w+_h\n#define%s+%w+_h\n", "") - src = gsub(src, "#endif%s*$", "") - return merge_includes(src) + inc = gsub(inc, "#ifndef%s+%w+_h\n#define%s+%w+_h\n", "") + inc = gsub(inc, "#endif%s*$", "") + return merge_includes(inc) end) end @@ -300,6 +300,7 @@ local function strip_unused3(src) src = gsub(src, "if%([^\n]*hookmask[^\n]*&&\n[^\n]*%b{}\n", "") src = gsub(src, "(twoto%b()%()", "%1(size_t)") src = gsub(src, "i