build failed on ppc64 (big endian)
mcepl opened this issue · comments
When building moonjit as a package for openSUSE, it failed on PPC64 (that’s Big Endian):
[ 52s] gcc -O2 -fomit-frame-pointer -Wall -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -g -DLUAJIT_ENABLE_LUA52COMPAT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -U_FORTIFY_SOURCE -DLUA_ROOT=\"/usr\" -DLUA_MULTILIB=\"lib64\" -fno-stack-protector -c -o lj_cdata.o lj_cdata.c
[ 52s] lj_ccallback.c: In function 'lj_ccallback_new':
[ 52s] lj_ccallback.c:854:1: error: unable to generate reloads for:
[ 52s] 854 | }
[ 52s] | ^
[ 52s] (insn 360 11 381 34 (set (reg/f:DI 200 [ _141 ])
[ 52s] (unspec:DI [
[ 52s] (symbol_ref:DI ("lj_vm_ffi_callback") [flags 0x43] <function_decl 0x7fff88fb8a00 lj_vm_ffi_callback>)
[ 52s] (reg/f:DI 205 [ vm_toc.18_148 ])
[ 52s] ] UNSPEC_TOCREL)) 717 {*tocrefdi}
[ 52s] (expr_list:REG_EQUIV (symbol_ref:DI ("lj_vm_ffi_callback") [flags 0x43] <function_decl 0x7fff88fb8a00 lj_vm_ffi_callback>)
[ 52s] (nil)))
[ 52s] during RTL pass: reload
[ 52s] lj_ccallback.c:854:1: internal compiler error: in curr_insn_transform, at lra-constraints.c:3962
[ 52s] gcc -O2 -fomit-frame-pointer -Wall -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -g -DLUAJIT_ENABLE_LUA52COMPAT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -U_FORTIFY_SOURCE -DLUA_ROOT=\"/usr\" -DLUA_MULTILIB=\"lib64\" -fno-stack-protector -c -o lj_ccall.o lj_ccall.c
[ 52s] Please submit a full bug report,
[ 52s] with preprocessed source if appropriate.
[ 52s] See <https://bugs.opensuse.org/> for instructions.
[ 52s] make[1]: *** [Makefile:711: lj_ccallback.o] Error 1
[ 52s] make[1]: *** Waiting for unfinished jobs....
Complete build log with all details
It is moonjit 2.2.0 from the tarball from GitHub together with the patch from #105.
That's a gcc bug; it's an internal compiler error in gcc. See also #74.
I just noticed that the previous report was also from an OpenSUSE build. Perhaps the builders need to be updated to fix the gcc bug.
OK, according to our GCC people, it is gcc bug, but a new one, https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94420 (the other one you pointed out was really solved many years ago).
Thanks for getting this reduced and reported. I'll close this once you confirm that the patch in the bz fixes your build.