[vlc-devel] a pitfall when cross-compiling win32 build on 64bit machine

Naohiro KORIYAMA nkoriyama at gmail.com
Wed Dec 14 16:57:02 CET 2011


2011/12/15 Rafaël Carré <funman at videolan.org>:
> Le Thu, 15 Dec 2011 00:20:02 +0900,
> Naohiro KORIYAMA <nkoriyama at gmail.com> a écrit :
>
>> 2011/12/15 Rafaël Carré <funman at videolan.org>:
>> > Le Wed, 14 Dec 2011 09:05:39 +0100,
>> > Rémi Denis-Courmont <remi at remlab.net> a écrit :
>> >
>> >>    Naohiro-san hello,
>> >>
>> >> On Wed, 14 Dec 2011 15:48:54 +0900, Naohiro KORIYAMA <nkoriyama at gmail.com>
>> >> wrote:
>> >> > I compile win32 build on OS X Lion.
>> >> >
>> >> > First, it seemed fine, but lua scripts didn't run at all.
>> >> > I installed lua in /usr/local/bin, and it was built as 64bit
>> >> application.
>> >> > And, I found the following in the LUAC man page:
>> >> > The binary files created by luac are portable only among architectures
>> >> > with the same word size and byte order.
>> >>
>> >> Is that so? I thought it was only byte order.
>> >
>> > lua wiki says it doesn't depend on byte order (it's not in sync with
>> > luac manpage at least)
>>
>> Endianness is checked at header loading.
>>
>> int x=1;
>>  *h++=(char)*(char*)&x;                         /* endianness */
>
> We could see what luac checks exactly and add those checks to
> configure.ac when cross compiling.
>
> gcc has macros for byte order: __BYTE_ORDER__
> and __SIZEOF_INT__ etc so we can check them when cross compiling

compare byteorder and size of long between native gcc and target gcc.
if differences exist, put some warning to config.log.
"Be sure your luac ..."

Anyway, ATM  I think writing some description to the wiki page
(http://wiki.videolan.org/Win32Compile) is enough .

-- 
KORIYAMA, Naohiro
nkoriyama at gmail.com



More information about the vlc-devel mailing list