LuaJIT PS3 port early testing

  • From: Mike Pall <mike-1206@xxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Fri, 15 Jun 2012 14:55:52 +0200

FYI: Current LuaJIT 2.0 git HEAD has a PS3 port! The XBox 360 port
will follow soon.

However, I've used only publicly accessible docs and a clean-room
approach. So I can't be sure it builds with the SDK or actually
runs on the real thing -- I don't even own a PS3. :-)

Anyway, the more adventurous natures interested in testing the
bleeding-edge PS3 port, please fetch the latest LuaJIT git HEAD:

  git clone

Then go to the luajit-2.0 directory and run:

  make HOST_CC="gcc -m32" CROSS=ppu-lv2-

This assumes a (32 bit) host compiler (gcc) and the target
toolchain (ppu-lv2-gcc etc.) are *both* in the path. The build
should work either on a Linux host, or on a Windows host with
MinGW and the MSys shell.

The 'luajit' command line executable that's built by default isn't
too useful, though. You'll need to package it up with a Lua file
et cetera -- I don't know about the details. You'll probably want
to embed libluajit.a in your game binary, anyway.

Ok, so I'm basically throwing it out there in the current state.
Please let me know how well it works or if it works at all. :-)
[But make sure you don't violate any NDAs with whatever you write
in public.]

FAQ#1: Yes, this only runs the LuaJIT interpreter. Sadly, the
console operating systems don't allow JIT compilers. But the fast
LuaJIT interpreter should still offer a considerable speedup over
the Lua interpreter.

FAQ#2: No, the FFI isn't enabled either, due to unimplemented ABI
differences. Not that it would do you much good, since binaries
have no symbols, or without a JIT compiler (no JIT ==> slow FFI).

FAQ#3: Yes, the port _has_ been tested under qemu-ppc64. But that
doesn't have nearly all of the PS3 ABI weirdness, like 32 bit
pointers in 64 bit registers aka PPC32on64, aka __PPC64__, but
without _LP64.

FAQ#4: No, LuaJIT does NOT run on pure PPC64 with 64 bit pointers,
except with some modifications and special QEMU settings. A PPC64
port wasn't a goal (and isn't that useful). I've used it solely
for developing parts of the PS3 port.


Other related posts: