cross-compiling with different bitness

my previous post about cross-compiling on Buildroot was optimistic
(see http://www.freelists.org/post/luajit/LuaJIT-on-Buildroot).
because my first test was with i386 as host & arm as target, both are 32 bits.

it works too with x86_64 as host & i386 as target. the package
gcc-multilib (lib32) is needed and HOST_CC="gcc -m32".
$ make HOST_CC="gcc -m32" CROSS="i686-unknown-linux-uclibc-"

but it fails with i386 as host & x86_64 as target
(the package gcc-multilib (lib64) is installed)

with the release beta10 :
$ make HOST_CC="gcc -m64" CROSS="x86_64-unknown-linux-uclibc-"
==== Building LuaJIT 2.0.0-beta10 ====
make -C src
make[1]: Entering directory `.../LuaJIT-2.0.0-beta10/src'
HOSTCC    buildvm.o
HOSTCC    buildvm_asm.o
HOSTCC    buildvm_peobj.o
HOSTCC    buildvm_lib.o
HOSTCC    buildvm_fold.o
HOSTLINK  buildvm
BUILDVM   lj_vm.s
./buildvm: 1: ./buildvm: Syntax error: ")" unexpected
make[1]: *** [lj_vm.s] Error 2
make[1]: Leaving directory `.../LuaJIT-2.0.0-beta10/src'
make: *** [default] Error 2

with the HEAD from git :
$ make HOST_CC="gcc -m64" CROSS="x86_64-unknown-linux-uclibc-"
==== Building LuaJIT 2.0.0-beta10 ====
make -C src
make[1]: Entering directory `.../luajit-2.0/src'
HOSTCC    host/minilua.o
HOSTLINK  host/minilua
DYNASM    host/buildvm_arch.h
host/minilua: 1: host/minilua: Syntax error: ")" unexpected
make[1]: *** [host/buildvm_arch.h] Error 2
make[1]: Leaving directory `.../luajit-2.0/src'
make: *** [default] Error 2

François

Other related posts: