lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


 
Hello LHF
 
I am interested in this question too, can I clarify something please ?
 
Ages back I explained I wanted to compile Lua 5.1 to  bytecode on a PC (little endian box) but then run that bytecode on a Freescale (big endian)  Target.
 
You kindly provided a patched version of lundump.c which made things endian agnostic. This was  a nice simple solution and worked very well.
 
Presumably,  due to the radical changes for integers etc in Lua 5.3, that old version of lundump.c would be useless now in 5.3 source code and not even compile ?
 
Is there any chance please of you providing a similar patched version of lundump.c that makes things endian agnostic for Lua 5.3 ?
 
That is a really neat and useful feature to have, it would be a big shame to lose that in moving from 5.1 to 5.3.
 
Thanks.
 
Geoff
 
> Date: Fri, 27 Jun 2014 08:34:49 -0300
> From: lhf@tecgraf.puc-rio.br
> To: lua-l@lists.lua.org
> Subject: Re: Lua 5.3 bytecode control factors?
>
> > In previous Lua versions, I believe the bytecode was subject to:
> > - The endianness of the machine
> > - The sizeof(int) for int x; in LoadInt() in lundump.c
> > - The sizeof(size_t) for size_t size = LoadByte(S); in LoadString() in lundump.c
> >
> > I'm wondering, in Lua 5.3, now with tunable integer and floating point
> > sizes, does this add anything to the list?
>
> Lua 5.3 adds sizeof(lua_Integer) and sample numbers to handle endianness
> and other format changes. See DumpHeader in ldump.c. The layout has
> changed from 5.2 to 5.3.
>
> > Additionally, should it reduce the list, e.g. should lundump.c be
> > using lua_Integer instead of int?
>
> We need both: int is used for the size of arrays, lua_Integer for Lua constants.
>