diff options
author | Mike Pall <mike> | 2010-03-04 19:07:38 +0100 |
---|---|---|
committer | Mike Pall <mike> | 2010-03-04 19:07:38 +0100 |
commit | af92a143132ab8f39d9d7893fe4797b67b72bc98 (patch) | |
tree | 1004d369ad7a1ac4ff731271acd96ee680522ac0 /doc | |
parent | f76e5a311ba543ae174acd3b585fb672fde8a3b5 (diff) | |
download | luajit-af92a143132ab8f39d9d7893fe4797b67b72bc98.tar.gz luajit-af92a143132ab8f39d9d7893fe4797b67b72bc98.tar.bz2 luajit-af92a143132ab8f39d9d7893fe4797b67b72bc98.zip |
Update docs: native build default, cross-compilation, embedding.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/changes.html | 4 | ||||
-rw-r--r-- | doc/install.html | 75 | ||||
-rw-r--r-- | doc/luajit.html | 6 | ||||
-rw-r--r-- | doc/status.html | 14 |
4 files changed, 65 insertions, 34 deletions
diff --git a/doc/changes.html b/doc/changes.html index 16cda402..c733e5d1 100644 --- a/doc/changes.html +++ b/doc/changes.html | |||
@@ -55,9 +55,9 @@ to see whether newer versions are available. | |||
55 | <div class="major" style="background: #d0d0d0;"> | 55 | <div class="major" style="background: #d0d0d0;"> |
56 | <h2 id="snap">Development Snapshot</h2> | 56 | <h2 id="snap">Development Snapshot</h2> |
57 | <ul> | 57 | <ul> |
58 | <li>CPU support: | 58 | <li>Portability: |
59 | <ul> | 59 | <ul> |
60 | <li>Port integrated memory allocator to Linux/x64 and Windows/x64.</li> | 60 | <li>Port integrated memory allocator to Linux/x64, Windows/x64 and OSX/x64.</li> |
61 | <li>Port interpreter and JIT compiler to x64.</li> | 61 | <li>Port interpreter and JIT compiler to x64.</li> |
62 | <li>Port DynASM to x64.</li> | 62 | <li>Port DynASM to x64.</li> |
63 | <li>Many 32/64 bit cleanups in the VM.</li> | 63 | <li>Many 32/64 bit cleanups in the VM.</li> |
diff --git a/doc/install.html b/doc/install.html index 102f3417..727668cf 100644 --- a/doc/install.html +++ b/doc/install.html | |||
@@ -50,14 +50,8 @@ For the impatient (on POSIX systems): | |||
50 | make && sudo make install | 50 | make && sudo make install |
51 | </pre> | 51 | </pre> |
52 | <p> | 52 | <p> |
53 | LuaJIT currently builds out-of-the box on all popular x86 systems | 53 | LuaJIT currently builds out-of-the box on all popular x86 or x64 systems |
54 | (Linux, Windows, OSX etc.). It builds and runs fine as a 32 bit | 54 | (Linux, Windows, OSX etc.). |
55 | application under x64-based systems, too. | ||
56 | </p> | ||
57 | <p style="color: #00a000;"> | ||
58 | The x64 port of LuaJIT is still preliminary and not enabled by default. | ||
59 | It only builds on Linux/x64 and Windows/x64 right now. If you want to | ||
60 | give it a try, please follow the special build instructions below. | ||
61 | </p> | 55 | </p> |
62 | 56 | ||
63 | <h2>Configuring LuaJIT</h2> | 57 | <h2>Configuring LuaJIT</h2> |
@@ -85,13 +79,8 @@ any settings. | |||
85 | <p> | 79 | <p> |
86 | Depending on your distribution, you may need to install a package for | 80 | Depending on your distribution, you may need to install a package for |
87 | GCC (GCC 3.4 or later required), the development headers and/or a | 81 | GCC (GCC 3.4 or later required), the development headers and/or a |
88 | complete SDK. | 82 | complete SDK. E.g. on a current Debian/Ubuntu, install <tt>libc6-dev</tt> |
89 | </p> | 83 | with the package manager. |
90 | <p> | ||
91 | E.g. on a current Debian/Ubuntu, install <tt>libc6-dev</tt> | ||
92 | with the package manager. Currently LuaJIT builds as a 32 bit | ||
93 | application by default, so you actually need to install <tt>libc6-dev-i386</tt> | ||
94 | when building on an x64 OS. | ||
95 | </p> | 84 | </p> |
96 | <p> | 85 | <p> |
97 | Download the current source package (pick the .tar.gz), if you haven't | 86 | Download the current source package (pick the .tar.gz), if you haven't |
@@ -111,14 +100,9 @@ which is probably the default on your system, anyway. Simply run: | |||
111 | <pre class="code"> | 100 | <pre class="code"> |
112 | make | 101 | make |
113 | </pre> | 102 | </pre> |
114 | <div style="color: #00a000;"> | ||
115 | <p> | 103 | <p> |
116 | You can force a native x64 build on Linux/x64 with the following command: | 104 | This always builds a native x86 or x64 binary, depending on your OS. |
117 | </p> | 105 | </p> |
118 | <pre class="code"> | ||
119 | make CC="gcc -m64" | ||
120 | </pre> | ||
121 | </div> | ||
122 | <p> | 106 | <p> |
123 | By default modules are only searched under the prefix <tt>/usr/local</tt>. | 107 | By default modules are only searched under the prefix <tt>/usr/local</tt>. |
124 | You can add an extra prefix to the search paths by appending the | 108 | You can add an extra prefix to the search paths by appending the |
@@ -203,14 +187,12 @@ Open a "Windows SDK Command Shell" and select the x86 compiler: | |||
203 | <pre class="code"> | 187 | <pre class="code"> |
204 | setenv /release /x86 | 188 | setenv /release /x86 |
205 | </pre> | 189 | </pre> |
206 | <div style="color: #00a000;"> | ||
207 | <p> | 190 | <p> |
208 | Or select the x64 compiler: | 191 | Or select the x64 compiler: |
209 | </p> | 192 | </p> |
210 | <pre class="code"> | 193 | <pre class="code"> |
211 | setenv /release /x64 | 194 | setenv /release /x64 |
212 | </pre> | 195 | </pre> |
213 | </div> | ||
214 | <p> | 196 | <p> |
215 | Then <tt>cd</tt> to the directory where you've unpacked the sources | 197 | Then <tt>cd</tt> to the directory where you've unpacked the sources |
216 | and run these commands: | 198 | and run these commands: |
@@ -254,6 +236,53 @@ absolute path names — all modules are loaded relative to the | |||
254 | directory where <tt>luajit.exe</tt> is installed | 236 | directory where <tt>luajit.exe</tt> is installed |
255 | (see <tt>src/luaconf.h</tt>). | 237 | (see <tt>src/luaconf.h</tt>). |
256 | </p> | 238 | </p> |
239 | |||
240 | <h2>Cross-compiling LuaJIT</h2> | ||
241 | <p> | ||
242 | The build system has limited support for cross-compilation. For details | ||
243 | check the comments in <tt>src/Makefile</tt>. Here are some popular examples: | ||
244 | </p> | ||
245 | <p> | ||
246 | You can cross-compile to a 32 bit binary on a multilib x64 OS by | ||
247 | installing the multilib development pacakges (e.g. <tt>libc6-dev-i386</tt> | ||
248 | on Debian/Ubuntu) and running: | ||
249 | </p> | ||
250 | <pre class="code"> | ||
251 | make CC="gcc -m32" | ||
252 | </pre> | ||
253 | <p> | ||
254 | You can cross-compile for a Windows target on Debian/Ubuntu by | ||
255 | installing the <tt>mingw32</tt> package and running: | ||
256 | </p> | ||
257 | <pre class="code"> | ||
258 | make CC="gcc -m32" CROSS=i586-mingw32msvc- TARGET_SYS=Windows | ||
259 | </pre> | ||
260 | |||
261 | <h2>Embedding LuaJIT</h2> | ||
262 | <p> | ||
263 | LuaJIT is API-compatible with Lua 5.1. If you've already embedded Lua | ||
264 | into your application, you probably don't need to do anything to switch | ||
265 | to LuaJIT, except link with a different library. Additional hints: | ||
266 | </p> | ||
267 | <ul> | ||
268 | <li>Make sure you use <tt>luaL_newstate</tt>. Avoid using | ||
269 | <tt>lua_newstate</tt>, since this uses the (slower) default memory | ||
270 | allocator from your system (no support for this on x64).</tt></li> | ||
271 | <li>Make sure you use <tt>luaL_openlibs</tt> and not the old Lua 5.0 style | ||
272 | of calling <tt>luaopen_base</tt> etc. directly.</li> | ||
273 | <li>To change which standard libraries to load, copy <tt>src/lib_init.c</tt> | ||
274 | to your project and modify it accordingly. Make sure the <tt>jit</tt> | ||
275 | library is loaded or the JIT compiler will not be activated.</li> | ||
276 | <li>Here's a | ||
277 | <a href="http://lua-users.org/wiki/SimpleLuaApiExample"><span class="ext">»</span> simple example</a>.</li> | ||
278 | </ul> | ||
279 | <p> | ||
280 | 64 bit applications on OSX must be linked with these options | ||
281 | (only the main executable): | ||
282 | </p> | ||
283 | <pre class="code"> | ||
284 | -pagezero_size 10000 -image_base 100000000 | ||
285 | </pre> | ||
257 | <br class="flush"> | 286 | <br class="flush"> |
258 | </div> | 287 | </div> |
259 | <div id="foot"> | 288 | <div id="foot"> |
diff --git a/doc/luajit.html b/doc/luajit.html index 66032fdf..fce49a68 100644 --- a/doc/luajit.html +++ b/doc/luajit.html | |||
@@ -62,10 +62,8 @@ standard Lua interpreter and can be deployed as a drop-in replacement. | |||
62 | </p> | 62 | </p> |
63 | <p> | 63 | <p> |
64 | LuaJIT offers more performance, at the expense of portability. It | 64 | LuaJIT offers more performance, at the expense of portability. It |
65 | currently runs on all popular operating systems based on <b>x86 CPUs</b> | 65 | currently runs on all popular operating systems based on |
66 | (Linux, Windows, OSX etc.). A preliminary port to Linux/x64 and Windows/x64 | 66 | <b>x86 or x64 CPUs</b> (Linux, Windows, OSX etc.). |
67 | is already available (follow the <a href="install.html">build instructions</a> | ||
68 | to enable it). | ||
69 | Other platforms will be supported in the future, based on user demand | 67 | Other platforms will be supported in the future, based on user demand |
70 | and sponsoring. | 68 | and sponsoring. |
71 | </p> | 69 | </p> |
diff --git a/doc/status.html b/doc/status.html index 2d750ee1..c4d9170f 100644 --- a/doc/status.html +++ b/doc/status.html | |||
@@ -53,10 +53,8 @@ page. | |||
53 | <span style="color: #c00000;">LuaJIT 2.0</span> is the currently active | 53 | <span style="color: #c00000;">LuaJIT 2.0</span> is the currently active |
54 | <span style="color: #c00000;">development branch</span>. | 54 | <span style="color: #c00000;">development branch</span>. |
55 | It has <b>Beta Test</b> status and is still undergoing | 55 | It has <b>Beta Test</b> status and is still undergoing |
56 | substantial changes. It's expected to quickly mature within the next | 56 | substantial changes. It's maturing quickly, so you should definitely |
57 | months. You should definitely start to evaluate it for new projects | 57 | start to evaluate it for new projects right now. |
58 | right now. But deploying it in production environments is not yet | ||
59 | recommended. | ||
60 | </p> | 58 | </p> |
61 | 59 | ||
62 | <h2>Current Status</h2> | 60 | <h2>Current Status</h2> |
@@ -153,6 +151,12 @@ with <b>open upvalues aliasing</b> one of the SSA slots later on (or | |||
153 | vice versa). Bonus points, if you can find a real world test case for | 151 | vice versa). Bonus points, if you can find a real world test case for |
154 | this. | 152 | this. |
155 | </li> | 153 | </li> |
154 | <li> | ||
155 | Currently some <b>out-of-memory</b> errors from <b>on-trace code</b> are not | ||
156 | handled correctly. The error may fall through an on-trace | ||
157 | <tt>pcall</tt> (x86) or it may be passed on to the function set with | ||
158 | <tt>lua_atpanic</tt> (x64). | ||
159 | </li> | ||
156 | </ul> | 160 | </ul> |
157 | </li> | 161 | </li> |
158 | </ul> | 162 | </ul> |
@@ -194,7 +198,7 @@ Nonetheless, it compiles to native code and needs to be adapted to each | |||
194 | architecture. Porting the compiler backend is probably the easier task, | 198 | architecture. Porting the compiler backend is probably the easier task, |
195 | but a key element of its design is the fast interpreter, written in | 199 | but a key element of its design is the fast interpreter, written in |
196 | machine-specific assembler.<br> | 200 | machine-specific assembler.<br> |
197 | A preliminary x64 port is already available, thanks to the | 201 | An x64 port is already available, thanks to the |
198 | <a href="sponsors.html">LuaJIT sponsorship program</a>. | 202 | <a href="sponsors.html">LuaJIT sponsorship program</a>. |
199 | Other ports will follow — companies which are | 203 | Other ports will follow — companies which are |
200 | interested in sponsoring a port to a particular architecture, please | 204 | interested in sponsoring a port to a particular architecture, please |