[vlc-devel] [vlc-commits] Contribs: lua, remove unneeded patch

Andrey Gursky andrey.gursky at e-mail.ua
Fri Apr 8 02:00:04 CEST 2016


On Tue, 5 Apr 2016 11:11:26 +0200
Rafaël Carré <funman at videolan.org> wrote:

> On 03/24/2016 02:05 PM, Ludovic Fauvet wrote:
> > On Wed, Mar 16, 2016, at 23:55, Rémi Denis-Courmont wrote:
> >> Le 2016-03-16 16:55, git at videolan.org a écrit :
> >>> vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Wed
> >>> Mar 16 15:50:45 2016 +0100| 
> >>> [c4dd067cac733eb934667b34e84e3eb4e722f277]
> >>> | committer: Jean-Baptiste Kempf
> >>>
> >>> Contribs: lua, remove unneeded patch
> >>
> >> Seems very much still needed to me.
> > 
> > I'm not sure to understand everything this patch was doing but it seems
> > that Lua 5.3 have fixed most (if not all) of the problems related to
> > 32/64 bits we had.
> 
> From luac-5.3.2/doc/luac.1 :
> 
> Precompiled chunks are
> .I not
> portable across different architectures.

Indeed.
 
> > As a matter of fact, I compiled a 32 and 64-bit luac binary from the
> > contribs and built the youtube.lua script with them resulting in the
> > exact same bytecode. Therefore I guess we can get rid of the constraint
> > of 32-bit luac for cross-compilation (if lua >= 5.3).
> 
> Could be a pure luck as far as I know.
> 
> Here I compile on Ubuntu 15.10 x86_64
> 
> [fun at dell ~]% cat foo.lua
> a=4294967296
> print(a)
> [fun at dell ~]% luac -o foo.luac foo.lua
> [fun at dell ~]% luac -v
> Lua 5.2.4  Copyright (C) 1994-2015 Lua.org, PUC-Rio
> 
> 
> Run on x86_64 :
> 11:07 root at altair /home/funman# lua foo.luac
> 4294967296
> 
> Run on i686 :
> 11:08 root at altair ~# lua foo.luac
> zsh: segmentation fault  lua foo.luac
> 
> 
> Same version (5.2.4 debian) on both arches

There is at least one step forward with lua 5.3 regarding 32/64-bit:
It is possible to run i386 bytecode with i386 lua (on amd64 Debian):

$ i386/usr/bin/luac5.1 -o foo.luac.i386 foo.lua
$ amd64/usr/bin/lua5.1 foo.luac.i386
amd64/usr/bin/lua5.1: foo.luac.i386: bad header in precompiled chunk
$ i386/usr/bin/lua5.1 foo.luac.i386
Segmentation fault

$ i386/usr/bin/luac5.3 -o foo.luac.i386 foo.lua
$ amd64/usr/bin/lua5.3 foo.luac.i386
amd64/usr/bin/lua5.3: foo.luac.i386: size_t size mismatch in precompiled chunk
$ i386/usr/bin/lua5.3 foo.luac.i386
4294967296

Regards,
Andrey


More information about the vlc-devel mailing list