[MacPorts] #64853: luajit: blacklist gcc <4.3, remove ppc64, add a patch
MacPorts
noreply at macports.org
Sat Mar 19 18:27:17 UTC 2022
#64853: luajit: blacklist gcc <4.3, remove ppc64, add a patch
-------------------------------------+--------------------
Reporter: barracuda156 | Owner: (none)
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version: 2.7.2
Keywords: powerpc, leopard, ppc64 | Port: luajit
-------------------------------------+--------------------
When trying to build `luajit` on 10.5.8 default gcc-4.2 compiler is
chosen, but it is not supported:
{{{
lj_arch.h:453:2: error: #error "Need at least GCC 4.3 or newer"
}}}
Specifying a newer compiler, build for ppc64 fails:
{{{
lj_arch.h:313:2: error: #error "No support for PPC64"
#error "No support for PPC64"
^~~~~
make[2]: Entering directory
`/opt/local/var/macports/build/_opt_PPCLeopardPorts_lang_luajit/luajit/work
/LuaJIT-LuaJIT-b4b2dce/src'
HOSTCC host/minilua.o
/opt/local/bin/gcc-mp-7 -O2 -fomit-frame-pointer -Wall
-I/opt/local/include -Os -arch ppc64 -DLUAJIT_ENABLE_LUA52COMPAT -I.
-DLJ_ARCH_ENDIAN=LUAJIT_BE -DLUAJIT_TARGET=LUAJIT_ARCH_ppc
-DLJ_ARCH_HASFPU=1 -DLJ_ABI_SOFTFP=0 -c -o host/minilua.o host/minilua.c
HOSTCC host/buildvm_asm.o
/opt/local/bin/gcc-mp-7 -O2 -fomit-frame-pointer -Wall
-I/opt/local/include -Os -arch ppc64 -DLUAJIT_ENABLE_LUA52COMPAT -I.
-DLJ_ARCH_ENDIAN=LUAJIT_BE -DLUAJIT_TARGET=LUAJIT_ARCH_ppc
-DLJ_ARCH_HASFPU=1 -DLJ_ABI_SOFTFP=0 -c -o host/buildvm_asm.o
host/buildvm_asm.c
HOSTCC host/buildvm_peobj.o
HOSTCC host/buildvm_lib.o
/opt/local/bin/gcc-mp-7 -O2 -fomit-frame-pointer -Wall
-I/opt/local/include -Os -arch ppc64 -DLUAJIT_ENABLE_LUA52COMPAT -I.
-DLJ_ARCH_ENDIAN=LUAJIT_BE -DLUAJIT_TARGET=LUAJIT_ARCH_ppc
-DLJ_ARCH_HASFPU=1 -DLJ_ABI_SOFTFP=0 -c -o host/buildvm_lib.o
host/buildvm_lib.c
/opt/local/bin/gcc-mp-7 -O2 -fomit-frame-pointer -Wall
-I/opt/local/include -Os -arch ppc64 -DLUAJIT_ENABLE_LUA52COMPAT -I.
-DLJ_ARCH_ENDIAN=LUAJIT_BE -DLUAJIT_TARGET=LUAJIT_ARCH_ppc
-DLJ_ARCH_HASFPU=1 -DLJ_ABI_SOFTFP=0 -c -o host/buildvm_peobj.o
host/buildvm_peobj.c
In file included from host/buildvm.h:16:0,
from host/buildvm_asm.c:6:
./lj_arch.h:313:2: error: #error "No support for PPC64"
#error "No support for PPC64"
^~~~~
In file included from host/buildvm.h:16:0,
from host/buildvm_peobj.c:9:
./lj_arch.h:313:2: error: #error "No support for PPC64"
#error "No support for PPC64"
^~~~~
In file included from host/buildvm.h:16:0,
from host/buildvm_lib.c:6:
./lj_arch.h:313:2: error: #error "No support for PPC64"
#error "No support for PPC64"
^~~~~
make[2]: *** [host/buildvm_peobj.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [host/buildvm_asm.o] Error 1
make[2]: *** [host/buildvm_lib.o] Error 1
make[2]: Leaving directory
`/opt/local/var/macports/build/_opt_PPCLeopardPorts_lang_luajit/luajit/work
/LuaJIT-LuaJIT-b4b2dce/src'
make[1]: *** [amalg] Error 2
}}}
There is also a patch to be added for it to build for ppc:
https://www.freelists.org/post/luajit/LuaJIT-on-OS-X-Leopard-PowerPC,3
{{{
--- src/host/buildvm.c.orig 2021-10-28 03:56:07.000000000 +0800
+++ src/host/buildvm.c 2022-03-20 01:06:32.000000000 +0800
@@ -113,7 +113,7 @@
name[0] = name[1] == 'R' ? '_' : '@'; /* Just for _RtlUnwind at 16.
*/
else
*p = '\0';
-#elif LJ_TARGET_PPC && !LJ_TARGET_CONSOLE
+#elif LJ_TARGET_PPC && !LJ_TARGET_CONSOLE && !LJ_TARGET_OSX
/* Keep @plt etc. */
#else
*p = '\0';
}}}
After that it installs:
{{{
36-85:~ svacchanda$ port -v installed luajit
The following ports are currently installed:
luajit @2.1.0-beta3_5 (active) requested_variants='' platform='darwin 9'
archs='ppc' date='2022-03-20T02:25:28+0800'
}}}
It also works for 10.6 PPC with the same corrections and patch.
--
Ticket URL: <https://trac.macports.org/ticket/64853>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list