Could the same luajit compile code both run on 32bit and 64bit devices?


#1

I have used luajit 2.1.0 in my project and use "cocos luacompile " to generate luajit compile code, but it could only run on 32bit device. When I use “cocos luacompile --bytecode-64bit” and this could run on 64bit device but not on 32bit device.
So my question is does different device use different luajit compile code? Could they run the same luajit compile code? If they use different code, how could I judge which code to use??


#2

64bit and 32bit bytecode are different, if you want same bytecode, plz use Lua 5.1.5.

Ref to https://github.com/c0i/lua32


#3

what do you mean? I change my lua to 5.1.5 , 32bit and 64bit device can use the same luajit compile code? Is this right? If this is true, I should 32bit or 64bit code?


#4

Or you mean I should use the origin lua code without luajit compile.


#5

just use Lua bytecode not LuaJIT in your game.


#6

Ok, thanks, I know what u mean.