aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/extensions.html3
-rw-r--r--doc/install.html15
-rw-r--r--src/Makefile3
-rw-r--r--src/msvcbuild.bat8
4 files changed, 22 insertions, 7 deletions
diff --git a/doc/extensions.html b/doc/extensions.html
index b048f137..cb9be3f4 100644
--- a/doc/extensions.html
+++ b/doc/extensions.html
@@ -210,7 +210,8 @@ bytecode (e.g. from Lua 5.1) is incompatible and cannot be loaded.
210<p> 210<p>
211Note: <tt>LJ_GC64</tt> mode requires a different frame layout, which implies 211Note: <tt>LJ_GC64</tt> mode requires a different frame layout, which implies
212a different, incompatible bytecode format for ports that use this mode (e.g. 212a different, incompatible bytecode format for ports that use this mode (e.g.
213ARM64). This may be rectified in the future. 213ARM64 or MIPS64) or when explicitly enabled for x64. This may be rectified
214in the future.
214</p> 215</p>
215 216
216<h3 id="table_new"><tt>table.new(narray, nhash)</tt> allocates a pre-sized table</h3> 217<h3 id="table_new"><tt>table.new(narray, nhash)</tt> allocates a pre-sized table</h3>
diff --git a/doc/install.html b/doc/install.html
index efeda33c..230e9386 100644
--- a/doc/install.html
+++ b/doc/install.html
@@ -175,6 +175,14 @@ MSVC or WinSDK.</li>
175Please read the instructions given in these files, before changing 175Please read the instructions given in these files, before changing
176any settings. 176any settings.
177</p> 177</p>
178<p>
179LuaJIT on x64 currently uses 32 bit GC objects by default.
180<tt>LJ_GC64</tt> mode may be explicitly enabled:
181add <tt>XCFLAGS=-DLUAJIT_ENABLE_GC64</tt> to the make command or run
182<tt>msvcbuild gc64</tt> for MSVC/WinSDK. Please check the note
183about the <a href="extensions.html#string_dump">bytecode format</a>
184differences, too.
185</p>
178 186
179<h2 id="posix">POSIX Systems (Linux, OSX, *BSD etc.)</h2> 187<h2 id="posix">POSIX Systems (Linux, OSX, *BSD etc.)</h2>
180<h3>Prerequisites</h3> 188<h3>Prerequisites</h3>
@@ -584,14 +592,11 @@ intend to load Lua/C modules at runtime.
584</li> 592</li>
585<li> 593<li>
586If you're building a 64 bit application on OSX which links directly or 594If you're building a 64 bit application on OSX which links directly or
587indirectly against LuaJIT, you need to link your main executable 595indirectly against LuaJIT which is not built for <tt>LJ_GC64</tt> mode,
588with these flags: 596you need to link your main executable with these flags:
589<pre class="code"> 597<pre class="code">
590-pagezero_size 10000 -image_base 100000000 598-pagezero_size 10000 -image_base 100000000
591</pre> 599</pre>
592Also, it's recommended to <tt>rebase</tt> all (self-compiled) shared libraries
593which are loaded at runtime on OSX/x64 (e.g. C extension modules for Lua).
594See: <tt>man rebase</tt>
595</li> 600</li>
596</ul> 601</ul>
597<p>Additional hints for initializing LuaJIT using the C API functions:</p> 602<p>Additional hints for initializing LuaJIT using the C API functions:</p>
diff --git a/src/Makefile b/src/Makefile
index 4e479ae5..21e16a22 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -110,6 +110,9 @@ XCFLAGS=
110#XCFLAGS+= -DLUAJIT_NUMMODE=1 110#XCFLAGS+= -DLUAJIT_NUMMODE=1
111#XCFLAGS+= -DLUAJIT_NUMMODE=2 111#XCFLAGS+= -DLUAJIT_NUMMODE=2
112# 112#
113# Enable GC64 mode for x64.
114#XCFLAGS+= -DLUAJIT_ENABLE_GC64
115#
113############################################################################## 116##############################################################################
114 117
115############################################################################## 118##############################################################################
diff --git a/src/msvcbuild.bat b/src/msvcbuild.bat
index 4334bbde..f7a1addc 100644
--- a/src/msvcbuild.bat
+++ b/src/msvcbuild.bat
@@ -20,6 +20,7 @@
20@set LJLIB=lib /nologo /nodefaultlib 20@set LJLIB=lib /nologo /nodefaultlib
21@set DASMDIR=..\dynasm 21@set DASMDIR=..\dynasm
22@set DASM=%DASMDIR%\dynasm.lua 22@set DASM=%DASMDIR%\dynasm.lua
23@set DASC=vm_x86.dasc
23@set LJDLLNAME=lua51.dll 24@set LJDLLNAME=lua51.dll
24@set LJLIBNAME=lua51.lib 25@set LJLIBNAME=lua51.lib
25@set ALL_LIB=lib_base.c lib_math.c lib_bit.c lib_string.c lib_table.c lib_io.c lib_os.c lib_package.c lib_debug.c lib_jit.c lib_ffi.c 26@set ALL_LIB=lib_base.c lib_math.c lib_bit.c lib_string.c lib_table.c lib_io.c lib_os.c lib_package.c lib_debug.c lib_jit.c lib_ffi.c
@@ -39,7 +40,12 @@ if exist minilua.exe.manifest^
39@set LJARCH=x86 40@set LJARCH=x86
40@set LJCOMPILE=%LJCOMPILE% /arch:SSE2 41@set LJCOMPILE=%LJCOMPILE% /arch:SSE2
41:X64 42:X64
42minilua %DASM% -LN %DASMFLAGS% -o host\buildvm_arch.h vm_x86.dasc 43@if "%1" neq "gc64" goto :NOGC64
44@shift
45@set DASC=vm_x64.dasc
46@set LJCOMPILE=%LJCOMPILE% /DLUAJIT_ENABLE_GC64
47:NOGC64
48minilua %DASM% -LN %DASMFLAGS% -o host\buildvm_arch.h %DASC%
43@if errorlevel 1 goto :BAD 49@if errorlevel 1 goto :BAD
44 50
45%LJCOMPILE% /I "." /I %DASMDIR% host\buildvm*.c 51%LJCOMPILE% /I "." /I %DASMDIR% host\buildvm*.c