The attached patch fixes ffcall on powerpc, at least enough for the
tests to pass. Note that this adds several files in patches/.

Index: devel/ffcall/Makefile
===================================================================
RCS file: /home/cvsync/openbsd/ports/devel/ffcall/Makefile,v
retrieving revision 1.14
diff -u -N devel/ffcall/Makefile
--- devel/ffcall/Makefile       10 Jan 2010 13:10:36 -0000      1.14
+++ devel/ffcall/Makefile       31 Jul 2010 14:04:27 -0000
@@ -9,6 +9,7 @@
 COMMENT=       foreign function call libraries
 
 DISTNAME=      ffcall-1.10
+REVISION =     0
 SHARED_LIBS=   avcall          1.0 \
                callback        1.0
 CATEGORIES=    devel
Index: devel/ffcall/patches/patch-avcall_Makefile_in
===================================================================
RCS file: 
/home/cvsync/openbsd/ports/devel/ffcall/patches/Attic/patch-avcall_Makefile_in,v
diff -u -N devel/ffcall/patches/patch-avcall_Makefile_in
--- /dev/null   31 Jul 2010 07:45:40 -0000
+++ devel/ffcall/patches/patch-avcall_Makefile_in       31 Jul 2010 14:04:16 
-0000
@@ -0,0 +1,12 @@
+$OpenBSD$
+--- avcall/Makefile.in.orig    Sun Jan 25 09:34:21 2004
++++ avcall/Makefile.in Sat Apr 25 21:42:02 2009
+@@ -120,7 +120,7 @@ avcall-rs6000.lo : $(srcdir)/avcall-rs6000-aix.old.s $
+       case "$(OS)" in \
+         aix3*) syntax=aix.old;; \
+         aix*) syntax=aix.new;; \
+-        linux* | netbsd*) syntax=linux;; \
++        linux* | netbsd* | openbsd*) syntax=linux;; \
+         macos* | darwin*) syntax=macos;; \
+         *) syntax=sysv4;; \
+       esac; \
Index: devel/ffcall/patches/patch-callback_trampoline_r_test1_c
===================================================================
RCS file: devel/ffcall/patches/patch-callback_trampoline_r_test1_c
diff -u -N devel/ffcall/patches/patch-callback_trampoline_r_test1_c
--- /dev/null   31 Jul 2010 07:45:40 -0000
+++ devel/ffcall/patches/patch-callback_trampoline_r_test1_c    31 Jul 2010 
14:04:16 -0000
@@ -0,0 +1,12 @@
+$OpenBSD$
+--- callback/trampoline_r/test1.c.orig Sun Apr 26 06:46:30 2009
++++ callback/trampoline_r/test1.c      Sun Apr 26 06:46:30 2009
+@@ -70,7 +70,7 @@ register void* env __asm__("%r29");
+ register void* env __asm__("r12");
+ #endif
+ #ifdef __rs6000__
+-#ifdef __NetBSD__
++#if defined(__NetBSD__) || defined(__OpenBSD__)
+ register void* env __asm__("r13");
+ #else
+ register void* env __asm__("r11");
Index: devel/ffcall/patches/patch-callback_trampoline_r_trampoline_c
===================================================================
RCS file: 
/home/cvsync/openbsd/ports/devel/ffcall/patches/patch-callback_trampoline_r_trampoline_c,v
retrieving revision 1.1
diff -u -N devel/ffcall/patches/patch-callback_trampoline_r_trampoline_c
--- devel/ffcall/patches/patch-callback_trampoline_r_trampoline_c       23 Feb 
2010 20:11:15 -0000      1.1
+++ devel/ffcall/patches/patch-callback_trampoline_r_trampoline_c       31 Jul 
2010 14:04:16 -0000
@@ -1,6 +1,15 @@
 $OpenBSD: patch-callback_trampoline_r_trampoline_c,v 1.1 2010/02/23 20:11:15 
jasper Exp $
---- callback/trampoline_r/trampoline.c.orig    Fri Feb 12 00:00:27 2010
-+++ callback/trampoline_r/trampoline.c Fri Feb 12 00:00:30 2010
+--- callback/trampoline_r/trampoline.c.orig    Mon Jan 26 07:00:05 2004
++++ callback/trampoline_r/trampoline.c Sat Jul 31 06:59:02 2010
+@@ -21,7 +21,7 @@
+ #endif
+ #endif
+ #if defined(__rs6000__)
+-#if defined(__NetBSD__)
++#if defined(__NetBSD__) || defined(__OpenBSD__)
+ #define __rs6000netbsd__
+ #else
+ #if !defined(_AIX)
 @@ -196,8 +196,12 @@ extern RETGETPAGESIZETYPE getpagesize ();
  #ifdef linux
  #include <asm/cachectl.h>
Index: devel/ffcall/patches/patch-callback_vacall_r_Makefile_in
===================================================================
RCS file: 
/home/cvsync/openbsd/ports/devel/ffcall/patches/Attic/patch-callback_vacall_r_Makefile_in,v
diff -u -N devel/ffcall/patches/patch-callback_vacall_r_Makefile_in
--- /dev/null   31 Jul 2010 07:45:40 -0000
+++ devel/ffcall/patches/patch-callback_vacall_r_Makefile_in    31 Jul 2010 
14:04:16 -0000
@@ -0,0 +1,12 @@
+$OpenBSD$
+--- callback/vacall_r/Makefile.in.orig Sun Jan 25 06:17:01 2004
++++ callback/vacall_r/Makefile.in      Sat Apr 25 21:44:58 2009
+@@ -120,7 +120,7 @@ vacall-rs6000.lo : $(srcdir)/vacall-rs6000-aix.old.s $
+       case "$(OS)" in \
+         aix3*) syntax=aix.old;; \
+         aix*) syntax=aix.new;; \
+-        linux*) syntax=linux;; \
++        linux* | openbsd*) syntax=linux;; \
+         macos* | darwin*) syntax=macos;; \
+         *) syntax=sysv4;; \
+       esac; \
Index: devel/ffcall/patches/patch-callback_vacall_r_vacall-rs6000-linux_s
===================================================================
RCS file: devel/ffcall/patches/patch-callback_vacall_r_vacall-rs6000-linux_s
diff -u -N devel/ffcall/patches/patch-callback_vacall_r_vacall-rs6000-linux_s
--- /dev/null   31 Jul 2010 07:45:40 -0000
+++ devel/ffcall/patches/patch-callback_vacall_r_vacall-rs6000-linux_s  31 Jul 
2010 14:04:16 -0000
@@ -0,0 +1,17 @@
+$OpenBSD$
+
+We're using %r13 like on NetBSD instead of %r11.
+
+--- callback/vacall_r/vacall-rs6000-linux.s.orig       Mon Jan 29 13:55:18 2001
++++ callback/vacall_r/vacall-rs6000-linux.s    Sun Apr 26 07:01:24 2009
+@@ -35,8 +35,8 @@ __vacall_r:
+       stw 9,20(1)
+       addi 0,1,48
+       stw 0,40(1)
+-      lwz 9,0(11)
+-      lwz 3,4(11)
++      lwz 9,0(13)
++      lwz 3,4(13)
+       addi 4,1,8
+       mtlr 9
+       blrl
Index: devel/ffcall/patches/patch-vacall_Makefile_in
===================================================================
RCS file: 
/home/cvsync/openbsd/ports/devel/ffcall/patches/Attic/patch-vacall_Makefile_in,v
diff -u -N devel/ffcall/patches/patch-vacall_Makefile_in
--- /dev/null   31 Jul 2010 07:45:40 -0000
+++ devel/ffcall/patches/patch-vacall_Makefile_in       31 Jul 2010 14:04:16 
-0000
@@ -0,0 +1,12 @@
+$OpenBSD$
+--- vacall/Makefile.in.orig    Sun Jan 25 05:46:00 2004
++++ vacall/Makefile.in Sat Apr 25 21:46:06 2009
+@@ -111,7 +111,7 @@ vacall-rs6000.o : $(srcdir)/vacall-rs6000-aix.old.s $(
+       case "$(OS)" in \
+         aix3*) syntax=aix.old;; \
+         aix*) syntax=aix.new;; \
+-        linux* | netbsd*) syntax=linux;; \
++        linux* | netbsd* | openbsd*) syntax=linux;; \
+         macos* | darwin*) syntax=macos;; \
+         *) syntax=sysv4;; \
+       esac; \

Reply via email to