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]

Re: add support for OpenBSD/mips64*


On Mon, Apr 25, 2011 at 08:04:18PM +0200, Jasper Lievisse Adriaanse wrote:
> This has been tested and used for more than a year now in OpenBSD ports.
> Please commit.
> 
> 2011-04-25 Jasper Lievisse Adriaanse <jasper@openbsd.org>
> 
> 	* configure.ac: Add OpenBSD/mips64* support.
> 	  src/mips/ffi.c: Same.
> 
> --- configure.ac.orig	Mon Apr 25 19:49:43 2011
> +++ configure.ac	Mon Apr 25 19:50:36 2011
> @@ -133,7 +133,7 @@ case "$host" in
>    mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*)
>  	TARGET=MIPS; TARGETDIR=mips
>  	;;
> -  mips*-*-linux*)
> +  mips*-*-linux* | mips*-*-openbsd*)
>  	# Support 128-bit long double for NewABI.
>  	HAVE_LONG_DOUBLE='defined(__mips64)'
>  	TARGET=MIPS; TARGETDIR=mips
> --- src/mips/ffi.c.orig	Fri Feb 25 22:22:05 2011
> +++ src/mips/ffi.c	Mon Apr 25 19:46:59 2011
> @@ -38,7 +38,11 @@
>  #endif
>  
>  #ifndef USE__BUILTIN___CLEAR_CACHE
> -#include <sys/cachectl.h>
> +#  if defined(__OpenBSD__)
> +#    include <mips64/sysarch.h>
> +#  else
> +#    include <sys/cachectl.h>
> +#  endif
>  #endif
>  
>  #ifdef FFI_DEBUG
> 
> -- 
> Cheers,
> Jasper
> 
> "Capable, generous men do not create victims, they nurture them."

Please use this diff instead, there are still quite some failing tests but at
least it's building now.

2011-04-25 Jasper Lievisse Adriaanse <jasper@openbsd.org>

	* configure.ac: Add OpenBSD/mips64* support.
	  src/mips/ffi.c: Same.
	  src/mips/ffitarget.h: Same

--- configure.orig	Fri Feb 25 22:22:16 2011
+++ configure	Mon Apr 25 19:46:59 2011
@@ -13115,7 +13115,7 @@ case "$host" in
   mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*)
 	TARGET=MIPS; TARGETDIR=mips
 	;;
-  mips*-*-linux*)
+  mips*-*-linux* | mips*-*-openbsd*)
 	# Support 128-bit long double for NewABI.
 	HAVE_LONG_DOUBLE='defined(__mips64)'
 	TARGET=MIPS; TARGETDIR=mips
--- src/mips/ffi.c.orig	Fri Feb 25 22:22:05 2011
+++ src/mips/ffi.c	Mon Apr 25 20:02:33 2011
@@ -38,7 +38,11 @@
 #endif
 
 #ifndef USE__BUILTIN___CLEAR_CACHE
-#include <sys/cachectl.h>
+#  if defined(__OpenBSD__)
+#    include <mips64/sysarch.h>
+#  else
+#    include <sys/cachectl.h>
+#  endif
 #endif
 
 #ifdef FFI_DEBUG
--- src/mips/ffitarget.h.orig	Tue Apr 26 14:54:19 2011
+++ src/mips/ffitarget.h	Tue Apr 26 14:55:00 2011
@@ -36,7 +36,7 @@
 #define _MIPS_SIM_ABI32		1
 #define _MIPS_SIM_NABI32	2
 #define _MIPS_SIM_ABI64		3
-#else
+#elif !defined(__OpenBSD__)
 # include <sgidefs.h>
 #endif
 


-- 
Cheers,
Jasper

"Capable, generous men do not create victims, they nurture them."


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