On Wed, Jan 02, 2013 at 04:54:58PM -0800, Josh Elsasser wrote:
> On Wed, Jan 02, 2013 at 07:50:05PM -0500, James Turner wrote:
> > On Wed, Jan 02, 2013 at 04:43:45PM -0800, Josh Elsasser wrote:
> > > On Wed, Jan 02, 2013 at 07:37:56PM -0500, James Turner wrote:
> > > > Joshua (and ports@),
> > > > 
> > > > With the attached diff I am able to build and use clisp on mips64el
> > > > (loongson). However, I had to disable ffi support in order to achieve
> > > > this.
> > > > 
> > > > I have ran into one problem where I could use some guidance on how best
> > > > to move forward. Because ffi support has to be disabled, readline 
> > > > support
> > > > is also disabled. Due to this, 2 files have to be removed from
> > > > pkg/PLIST: lib/clisp/base/readline.o and lib/clisp/full/readline.o in
> > > > order for clisp to package correctly.
> > > > 
> > > > What is the best way to handle this on mips64el since these files should
> > > > be there for the other supported platforms? Should I create a no_ffi
> > > > flavor and make mips64el use that by default? Suggestions welcome.
> > > > Thanks.
> > > 
> > > I would prefer to see ffcall fixed on mips64el, as painful as that
> > > might be.
> > > 
> > 
> > Understandable. I'll take a look at ffcall. A package is provided for
> > mips64el, but for whatever reason, avcall.h isn't usable according to
> > clisp's configure script even though at the end it says it will build
> > ffi support, but fails during the make process.
> > 
> > -- 
> > James Turner | 0x560B0C49
> 
> Try running ffcall's tests, it's quite likely that it builds but
> doesn't actually work. None of the non-x86 arches I tried it on
> actually worked at first.
> 

Attached is an updated patch for clisp and a new patch for ffcall.
ffcall was just missing a couple things to make it work correctly.

clisp is now being compiled with ffi support on mips64el. I'm new to
list so my limit testing abilities have all worked.

-- 
James Turner | 0x560B0C49
Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/ffcall/Makefile,v
retrieving revision 1.20
diff -u -p Makefile
--- Makefile    18 Aug 2012 12:41:38 -0000      1.20
+++ Makefile    3 Jan 2013 01:28:39 -0000
@@ -7,7 +7,7 @@ ONLY_FOR_ARCHS= alpha amd64 hppa i386 mips64 mips64el 
 COMMENT=       foreign function call libraries
 
 DISTNAME=      ffcall-1.10
-REVISION =     1
+REVISION =     2
 SHARED_LIBS=   avcall          1.0 \
                callback        1.0
 CATEGORIES=    devel
Index: patches/patch-avcall_avcall_h_in
===================================================================
RCS file: /cvs/ports/devel/ffcall/patches/patch-avcall_avcall_h_in,v
retrieving revision 1.1
diff -u -p patches/patch-avcall_avcall_h_in
--- patches/patch-avcall_avcall_h_in    23 Sep 2010 13:38:33 -0000      1.1
+++ patches/patch-avcall_avcall_h_in    3 Jan 2013 01:28:39 -0000
@@ -1,6 +1,51 @@
 $OpenBSD: patch-avcall_avcall_h_in,v 1.1 2010/09/23 13:38:33 joshe Exp $
---- avcall/avcall.h.in.orig    Mon Jan 26 06:58:41 2004
-+++ avcall/avcall.h.in Sat Apr 25 16:17:43 2009
+--- avcall/avcall.h.in.orig    Mon Jan 26 09:58:41 2004
++++ avcall/avcall.h.in Wed Jan  2 20:17:51 2013
+@@ -367,7 +367,7 @@ typedef struct
+   __avword*           iaptr;
+   __avword            iargs[6];
+ #endif
+-#if defined(__mips__) && !defined(__mipsn32__)
++#if defined(__mips__) && !defined(__mipsn32__) && !defined(__mips64__)
+   /* store the floating-point arguments in an extra array */
+   int                 anum;
+   double              floatarg[2];
+@@ -447,7 +447,7 @@ typedef struct
+ #define __av_start1(LIST)                                             \
+    (LIST).aptr = &(LIST).args[0],
+ #endif
+-#if defined(__mips__) && !defined(__mipsn32__)
++#if defined(__mips__) && !defined(__mipsn32__) && !defined(__mips64__)
+ #define __av_start1(LIST)                                             \
+    (LIST).anum = 0,                                                   \
+    (LIST).aptr = &(LIST).args[0],
+@@ -606,7 +606,7 @@ typedef struct
+ #define __av_start_struct3(LIST)  \
+   0
+ #endif
+-#if defined(__mips__) && !defined(__mipsn32__)
++#if defined(__mips__) && !defined(__mipsn32__) && !defined(__mips64__)
+ #define __av_reg_struct_return(LIST,TYPE_SIZE,TYPE_SPLITTABLE)  \
+   ((TYPE_SIZE) == 1 || (TYPE_SIZE) == 2 || (TYPE_SIZE) == 4)
+ /* Test __AV_SMALL_STRUCT_RETURN instead of __AV_REGISTER_STRUCT_RETURN. */
+@@ -840,7 +840,7 @@ typedef struct
+ 
+ #endif
+ 
+-#if defined(__mips__) && !defined(__mipsn32__)
++#if defined(__mips__) && !defined(__mipsn32__) && !defined(__mips64__)
+ 
+ /* Up to 2 leading float or double non-varargs args can be passed in
+  * float registers, but we also push them into the corresponding int
+@@ -1145,7 +1145,7 @@ typedef struct
+           0)))
+ #endif
+ /* small structures < 1 word are adjusted depending on compiler */
+-#if defined(__mips__) && !defined(__mipsn32__)
++#if defined(__mips__) && !defined(__mipsn32__) && !defined(__mips64__)
+ #define __av_struct_leftadjusted(LIST,TYPE,TYPE_SIZE,TYPE_ALIGN,ASSIGN,VAL) \
+   (((LIST).aptr =                                                     \
+     (__avword*)(((__avword)(LIST).aptr+(TYPE_SIZE)+(TYPE_ALIGN)-1) & 
-(long)(TYPE_ALIGN)))\
 @@ -1307,8 +1307,9 @@ typedef struct
        ? -1 : 
(ASSIGN(TYPE,TYPE_SIZE,TYPE_ALIGN,(void*)((__avword)(LIST).aptr-(TYPE_SIZE)),VAL),\
              (LIST).aptr = 
(__avword*)(((__avword)(LIST).aptr+sizeof(__avword)-1) & 
-(long)sizeof(__avword)),\
Index: Makefile
===================================================================
RCS file: /cvs/ports/lang/clisp/Makefile,v
retrieving revision 1.41
diff -u -p Makefile
--- Makefile    11 Oct 2012 18:12:53 -0000      1.41
+++ Makefile    3 Jan 2013 02:19:23 -0000
@@ -1,6 +1,6 @@
 # $OpenBSD: Makefile,v 1.41 2012/10/11 18:12:53 pascal Exp $
 
-ONLY_FOR_ARCHS =       amd64 i386 powerpc sparc64
+ONLY_FOR_ARCHS =       amd64 i386 mips64el powerpc sparc64
 
 COMMENT =              ANSI Common Lisp implementation
 
Index: patches/patch-src_makemake_in
===================================================================
RCS file: /cvs/ports/lang/clisp/patches/patch-src_makemake_in,v
retrieving revision 1.11
diff -u -p patches/patch-src_makemake_in
--- patches/patch-src_makemake_in       23 Sep 2010 13:42:22 -0000      1.11
+++ patches/patch-src_makemake_in       3 Jan 2013 02:19:23 -0000
@@ -3,8 +3,17 @@ $OpenBSD: patch-src_makemake_in,v 1.11 2010/09/23 13:4
 Override broken compiler test, attempting to build 32-bit clisp on a
 64-bit patform will not work out very well.
 
---- src/makemake.in.orig       Tue Jul 28 06:58:03 2009
-+++ src/makemake.in    Mon Sep 20 16:32:15 2010
+--- src/makemake.in.orig       Tue Jul 28 09:58:03 2009
++++ src/makemake.in    Wed Jan  2 17:24:30 2013
+@@ -1090,7 +1090,7 @@ esac
+ if [ "$host_cpu" = mips ] ; then
+   cpu=mips
+ fi
+-if [ "$host_cpu" = mips64 ] ; then
++if [ "$host_cpu" = mips64 -o "$host_cpu" = mips64el ] ; then
+   cpu=mips64
+ fi
+ if [ "$host_cpu" = i386 -o "$host_cpu" = i486 -o "$host_cpu" = i586 -o 
"$host_cpu" = i686 -o "$host_cpu" = i786 -o $TSYS = i386 -o $TSYS = i486 -o 
$TSYS = i586 -o $TSYS = i686 -o $TSYS = i786 -o $TOS = win32 ] ; then
 @@ -1108,6 +1108,8 @@ esac
  #   cpu=hppa ;;
  # esac

Reply via email to