This is the mail archive of the libffi-discuss@sourceware.org mailing list for the libffi project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Extending to support NetBSD mips ports


Hi,

after applying the attached changes to libffi version 3.0.8,
"make check" reports:

# of expected passes            1389
# of unsupported tests          15

The test was run on an SGI O2 running NetBSD 4.0.

True, the patch in the second attachment is not exactly elegant,
but it's a minimal adptation to what was already there...

Best regards,

- Håvard
$NetBSD: patch-aa,v 1.8 2009/05/26 12:27:12 he Exp $

Extend which ports we accept to deal with.

--- configure.orig	2008-12-19 17:12:45.000000000 +0100
+++ configure
@@ -21017,7 +21017,7 @@ case "$host" in
   mips-sgi-irix5.* | mips-sgi-irix6.*)
 	TARGET=MIPS; TARGETDIR=mips
 	;;
-  mips*-*-linux*)
+  mips*-*-linux* | mips*-*-netbsd*)
 	TARGET=MIPS; TARGETDIR=mips
 	;;
 
$NetBSD: patch-ae,v 1.1 2009/05/26 12:27:12 he Exp $

Make a minimal adjustment to support the various NetBSD mips ports.

--- src/mips/ffitarget.h.orig	2008-02-15 19:43:40.000000000 +0100
+++ src/mips/ffitarget.h
@@ -39,6 +39,11 @@
 #    define _ABIO32 _MIPS_SIM_ABI32
 #  endif
 #endif
+#ifdef __NetBSD__
+/* Let's cheat a bit... */   
+#  define _ABIO32 1     
+#  define _MIPS_SIM _ABIO32
+#endif
 
 #if !defined(_MIPS_SIM)
 -- something is very wrong --
$NetBSD: patch-af,v 1.1 2009/05/26 12:27:12 he Exp $

Fixes to support the various NetBSD mips ports.

--- src/mips/ffi.c.orig	2008-02-26 18:34:36.000000000 +0100
+++ src/mips/ffi.c
@@ -32,12 +32,19 @@
 
 #ifdef __GNUC__
 #  if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3))
-#    define USE__BUILTIN___CLEAR_CACHE 1
+#    if !defined(__NetBSD__)
+#      define USE__BUILTIN___CLEAR_CACHE 1
+#    endif
 #  endif
 #endif
 
 #ifndef USE__BUILTIN___CLEAR_CACHE
-#include <sys/cachectl.h>
+#  if !defined(__NetBSD__)
+#    include <sys/cachectl.h>
+#  else
+#    include <mips/cachectl.h>
+#    define cacheflush _cacheflush
+#  endif
 #endif
 
 #ifdef FFI_DEBUG

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]