Compiled Lua scripts and incompatibilities with different OS and Cpus
 

News:

11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

Compiled Lua scripts and incompatibilities with different OS and Cpus

Started by PPK, 08 August, 2009, 00:23:34

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

PPK

Few weeks ago someone have problem with compiled script on 32bit system that was not working for unknown reason on 64bit version. I don't know why it was not working, but today on lua mailing list was some info about that problem. So here it is, why compiled lua script is not working on different OSes and Cpu architectures.
QuotePrecompiled chunks are dependant upon several factors:
* Lua version
* Endianness
* sizeof(int)
* sizeof(size_t)
* sizeof(Instruction) (which is typically a typedef onto lu_int32)
* lua_Number type
What that means ?
1) Lua script compiled with 32bit x86 lua should work with 32bit x86 PtokaX on windoze, linux or freebsd (that is where i know that PtokaX is working). It will not work with any 64bit amd64 version. On windoze because size_t have different sizes. On linux and freebsd because int and size_t have different sizes.
2 ) Lua script compiled with 64bit amd64 lua on windoze will work only with 64bit amd64 PtokaX on windoze. It will not work on 32bit version for same reasons as above. And it should not work on linux or freebsd because theyr int is 64bit when windoze have int always 32bit.
3 ) Lua script compiled with 64bit amd64 lua on linux or freebsd will work only with 64bit amd64 PtokaX on linux or freebsd. Again it will not work on 32bit and should not work on 64bit amd64 PtokaX on windoze.
Any other Oses or Cpu architectures probably have similar or more reasons why compiled script will not work ::)
"Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris." - Larry Wall

SMF spam blocked by CleanTalk