- let this work on powerpc. requires gcc >= 4.3, and I had to patch
away a .gnu_attribute that isn't supported with as(1) from any in-tree
binutils version (was added in 2.18 which is under GPLv3).

- add ONLY_FOR_ARCHS based on the list of arch which luajit supports.
No point even trying to build on unsupported arch, but we should allow
it to build on arm/mips64* to see if it works there.

My armish box isn't working any more, so I can't test arm.
macppc is tested and produces same results for the test programs
in the lua 5.1 distribution as normal lua does.

OK?


Index: Makefile
===================================================================
RCS file: /cvs/ports/lang/luajit/Makefile,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 Makefile
--- Makefile    27 Oct 2012 14:05:33 -0000      1.1.1.1
+++ Makefile    28 Oct 2012 10:47:49 -0000
@@ -1,5 +1,7 @@
 # $OpenBSD: Makefile,v 1.1.1.1 2012/10/27 14:05:33 abieber Exp $
 
+ONLY_FOR_ARCHS = amd64 arm i386 mips64 mips64el powerpc
+
 SHARED_ONLY =  Yes
 SHARED_LIBS += luajit-${MODLUA_VERSION} 0.0 # 2.0.0
 
@@ -25,6 +27,11 @@ WANTLIB =    c m
 MASTER_SITES = ${HOMEPAGE}download/
 
 MODULES =      lang/lua
+
+MODULES +=     gcc4
+MODGCC4_VERSION = 4.6
+MODGCC4_ARCHS =        powerpc
+MODGCC4_LANGS =        c
 
 MAKE_FLAGS += \
        CC="${CC}" \
Index: patches/patch-src_host_buildvm_asm_c
===================================================================
RCS file: patches/patch-src_host_buildvm_asm_c
diff -N patches/patch-src_host_buildvm_asm_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_host_buildvm_asm_c        28 Oct 2012 10:47:49 -0000
@@ -0,0 +1,21 @@
+$OpenBSD$
+
+.gnu_attribute requires binutils 2.18
+
+--- src/host/buildvm_asm.c.orig        Sun Oct 28 10:44:35 2012
++++ src/host/buildvm_asm.c     Sun Oct 28 10:45:15 2012
+@@ -283,12 +283,14 @@ void emit_asm(BuildCtx *ctx)
+ #if !LJ_TARGET_PS3
+     fprintf(ctx->fp, "\t.section .note.GNU-stack,\"\"," ELFASM_PX 
"progbits\n");
+ #endif
++#if 0
+ #if LJ_TARGET_PPCSPE
+     /* Soft-float ABI + SPE. */
+     fprintf(ctx->fp, "\t.gnu_attribute 4, 2\n\t.gnu_attribute 8, 3\n");
+ #elif LJ_TARGET_PPC && !LJ_TARGET_PS3
+     /* Hard-float ABI. */
+     fprintf(ctx->fp, "\t.gnu_attribute 4, 1\n");
++#endif
+ #endif
+     /* fallthrough */
+   case BUILD_coffasm:
Index: patches/patch-src_lj_arch_h
===================================================================
RCS file: patches/patch-src_lj_arch_h
diff -N patches/patch-src_lj_arch_h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_lj_arch_h 28 Oct 2012 10:47:49 -0000
@@ -0,0 +1,13 @@
+$OpenBSD$
+--- src/lj_arch.h.orig Fri Oct 26 11:48:11 2012
++++ src/lj_arch.h      Fri Oct 26 11:48:14 2012
+@@ -314,9 +314,6 @@
+ #if defined(_SOFT_FLOAT) || defined(_SOFT_DOUBLE)
+ #error "No support for PowerPC CPUs without double-precision FPU"
+ #endif
+-#if defined(_LITTLE_ENDIAN)
+-#error "No support for little-endian PowerPC"
+-#endif
+ #if defined(_LP64)
+ #error "No support for PowerPC 64 bit mode"
+ #endif

Reply via email to