add support for NetBSD/mips

This commit is contained in:
jmcneill 2010-04-01 08:25:07 +00:00
parent 94afe164ee
commit e282aee8d0
7 changed files with 247 additions and 12 deletions

View file

@ -1,4 +1,4 @@
$NetBSD: distinfo,v 1.27 2010/03/23 12:43:38 tnn Exp $
$NetBSD: distinfo,v 1.28 2010/04/01 08:25:07 jmcneill Exp $
SHA1 (firefox-3.6.2.source.tar.bz2) = 7befdbcc2bd658c136bdce1c1bd8b54201c1d1d1
RMD160 (firefox-3.6.2.source.tar.bz2) = 89243e2815351e132ad7d139808d3c89b5524762
@ -13,7 +13,7 @@ SHA1 (patch-ag) = 62e55040130d5e6cfb10b839fce6abd40a902f08
SHA1 (patch-ah) = 5f8bf19d5ac5ea7e263366a56d10d2eeeee61bac
SHA1 (patch-ai) = 3444882b0f7f4b63273d8888af88be35ae60933a
SHA1 (patch-aj) = 0e357b477aef423e7688dfb0be93cc8abc35e6e0
SHA1 (patch-ak) = 9c7d909d786791829bdcdb7155af66bae079683c
SHA1 (patch-ak) = d9aca1f9e143d600d8bc841984a2244a50b0ac8c
SHA1 (patch-al) = ca1a1fb5f875ab9c84c0afea5d913172a6f7ab57
SHA1 (patch-am) = 75eb92d1941309ffc13f01d7f1946a2f09170220
SHA1 (patch-an) = e975941955b578f1d3336d546e99f0c464cdd9d7
@ -33,8 +33,10 @@ SHA1 (patch-ba) = 9d4058f2a3a290429b26cb8335dd5b188bccc96d
SHA1 (patch-bb) = a764014f7aee2ecb75584ee652fd4a35ab647527
SHA1 (patch-bc) = 6ea633380f427a24098129afa68fcd0112e68ca1
SHA1 (patch-be) = cad5bc4ac3e83b6e098edfbf0aadc845d97a6032
SHA1 (patch-bf) = 6295d27762eb91162c00362306acbd47eeda61ac
SHA1 (patch-bg) = ab79e04b5ac1453157cfb57754613210c74c3b90
SHA1 (patch-ma) = a20b263ff14c841fd0ae1634962b90a41173b524
SHA1 (patch-mb) = 5b41f75ec70ef494c58af9eb4eaf4546a5d62e3a
SHA1 (patch-mb) = b3ba0de4c70d9892a5427fe493e132bad72ae905
SHA1 (patch-md) = 6bf5242245b17fbd868a6a978eb5849726f81393
SHA1 (patch-me) = f5a8e29fc004ef7696b67d260384ab23fd1658c2
SHA1 (patch-mf) = 153dfd5cd611e4364fe1c540f4e8eb500115baff
@ -66,3 +68,5 @@ SHA1 (patch-xj) = 7e237668aa4dfa55833d125d2a1464fb97ae3ada
SHA1 (patch-xk) = 16ac8dc3bb5c241452eae6833d40aaf876453761
SHA1 (patch-xl) = afd74085c01d207907d0b3bfc040bf92fd1ba8b1
SHA1 (patch-xm) = 072240b71e4738e96d258fcd481698464623735e
SHA1 (patch-xn) = b0d0943b2bc39d8395055550c0fedfa447a5de01
SHA1 (patch-xo) = 437cbc7e0ed8777ae2313165f8754759d8eee01d

View file

@ -1,8 +1,18 @@
$NetBSD: patch-ak,v 1.2 2010/03/16 15:57:02 tnn Exp $
$NetBSD: patch-ak,v 1.3 2010/04/01 08:25:07 jmcneill Exp $
--- js/ctypes/libffi/configure.orig 2010-01-21 03:30:16.000000000 +0000
+++ js/ctypes/libffi/configure
@@ -21033,7 +21033,7 @@ case "$host" in
--- js/ctypes/libffi/configure.orig 2010-03-16 05:55:17.000000000 -0400
+++ js/ctypes/libffi/configure 2010-03-31 04:08:48.000000000 -0400
@@ -21020,6 +21020,9 @@ case "$host" in
mips*-*-linux*)
TARGET=MIPS; TARGETDIR=mips
;;
+ mips*-*-netbsd*)
+ TARGET=MIPS; TARGETDIR=mips
+ ;;
powerpc*-*-linux* | powerpc-*-sysv*)
TARGET=POWERPC; TARGETDIR=powerpc
@@ -21033,7 +21036,7 @@ case "$host" in
powerpc-*-aix* | rs6000-*-aix*)
TARGET=POWERPC_AIX; TARGETDIR=powerpc
;;

View file

@ -0,0 +1,42 @@
$NetBSD: patch-bf,v 1.1 2010/04/01 08:25:07 jmcneill Exp $
--- js/ctypes/libffi/src/mips/ffitarget.h.orig 2010-03-31 04:09:31.000000000 -0400
+++ js/ctypes/libffi/src/mips/ffitarget.h 2010-03-31 04:12:52.000000000 -0400
@@ -29,15 +29,28 @@
#ifdef linux
#include <asm/sgidefs.h>
-# ifndef _ABIN32
-# define _ABIN32 _MIPS_SIM_NABI32
-# endif
-# ifndef _ABI64
-# define _ABI64 _MIPS_SIM_ABI64
-# endif
-# ifndef _ABIO32
-# define _ABIO32 _MIPS_SIM_ABI32
-# endif
+#elif defined(irix)
+#include <sgidefs.h>
+#else
+#include <sys/cdefs.h>
+#endif
+
+#ifndef _ABIN32
+# define _ABIN32 _MIPS_SIM_NABI32
+#endif
+#ifndef _ABI64
+# define _ABI64 _MIPS_SIM_ABI64
+#endif
+#ifndef _ABIO32
+# define _ABIO32 _MIPS_SIM_ABI32
+#endif
+
+#ifndef _MIPS_SIM
+# ifdef _MIPS_BSD_API
+# define _MIPS_SIM _MIPS_BSD_API
+# else
+# define _MIPS_SIM _ABIO32
+# endif
#endif
#if !defined(_MIPS_SIM)

View file

@ -0,0 +1,58 @@
$NetBSD: patch-bg,v 1.1 2010/04/01 08:25:07 jmcneill Exp $
--- js/ctypes/libffi/src/mips/ffi.c.orig 2010-03-31 08:23:20.000000000 -0400
+++ js/ctypes/libffi/src/mips/ffi.c 2010-03-31 08:25:28.000000000 -0400
@@ -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
@@ -419,6 +426,7 @@ ffi_status ffi_prep_cif_machdep(ffi_cif
((cif->arg_types)[index]->type << (arg_reg * FFI_FLAG_BITS));
arg_reg++;
break;
+#ifdef __mips64
case FFI_TYPE_LONGDOUBLE:
/* Align it. */
arg_reg = ALIGN(arg_reg, 2);
@@ -430,6 +438,7 @@ ffi_status ffi_prep_cif_machdep(ffi_cif
(FFI_TYPE_DOUBLE << (arg_reg * FFI_FLAG_BITS));
arg_reg++;
break;
+#endif
case FFI_TYPE_STRUCT:
loc = arg_reg * FFI_SIZEOF_ARG;
@@ -474,6 +483,7 @@ ffi_status ffi_prep_cif_machdep(ffi_cif
case FFI_TYPE_DOUBLE:
cif->flags += cif->rtype->type << (FFI_FLAG_BITS * 8);
break;
+#ifdef __mips64
case FFI_TYPE_LONGDOUBLE:
/* Long double is returned as if it were a struct containing
two doubles. */
@@ -481,6 +491,7 @@ ffi_status ffi_prep_cif_machdep(ffi_cif
cif->flags += (FFI_TYPE_DOUBLE + (FFI_TYPE_DOUBLE << FFI_FLAG_BITS))
<< (4 + (FFI_FLAG_BITS * 8));
break;
+#endif
default:
cif->flags += FFI_TYPE_INT << (FFI_FLAG_BITS * 8);
break;

View file

@ -1,7 +1,7 @@
$NetBSD: patch-mb,v 1.3 2010/03/17 14:02:14 tnn Exp $
$NetBSD: patch-mb,v 1.4 2010/04/01 08:25:07 jmcneill Exp $
--- xpcom/reflect/xptcall/src/md/unix/Makefile.in.orig 2010-03-15 14:56:04.000000000 +0000
+++ xpcom/reflect/xptcall/src/md/unix/Makefile.in
--- xpcom/reflect/xptcall/src/md/unix/Makefile.in.orig 2010-03-16 05:57:24.000000000 -0400
+++ xpcom/reflect/xptcall/src/md/unix/Makefile.in 2010-03-31 05:09:52.000000000 -0400
@@ -76,7 +76,7 @@ endif
endif
endif
@ -57,7 +57,22 @@ $NetBSD: patch-mb,v 1.3 2010/03/17 14:02:14 tnn Exp $
CPPSRCS := xptcinvoke_netbsd_m68k.cpp xptcstubs_netbsd_m68k.cpp
endif
endif
@@ -340,9 +328,10 @@ endif
@@ -295,6 +283,14 @@ ASFLAGS += -I$(DIST)/include -x assembl
endif
endif
+ifeq ($(OS_ARCH),NetBSD)
+ifneq (,$(findstring mips, $(OS_TEST)))
+CPPSRCS := xptcinvoke_mips.cpp xptcstubs_mips.cpp
+ASFILES := xptcinvoke_asm_mips.s xptcstubs_asm_mips.s
+ASFLAGS += -I$(DIST)/include -x assembler-with-cpp
+endif
+endif
+
######################################################################
# PowerPC
######################################################################
@@ -340,9 +336,10 @@ endif
#
# NetBSD/PPC
#
@ -69,7 +84,7 @@ $NetBSD: patch-mb,v 1.3 2010/03/17 14:02:14 tnn Exp $
endif
#
@@ -414,6 +403,13 @@ CPPSRCS := xptcinvoke_sparc64_openbsd.c
@@ -414,6 +411,13 @@ CPPSRCS := xptcinvoke_sparc64_openbsd.c
ASFILES := xptcinvoke_asm_sparc64_openbsd.s xptcstubs_asm_sparc64_openbsd.s
endif
#

View file

@ -0,0 +1,53 @@
$NetBSD: patch-xn,v 1.1 2010/04/01 08:25:07 jmcneill Exp $
--- xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_mips.s.orig 2010-03-31 05:56:51.000000000 -0400
+++ xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_mips.s 2010-03-31 06:28:51.000000000 -0400
@@ -42,8 +42,46 @@
/* This code is for MIPS using the O32 ABI. */
-#include <sys/regdef.h>
-#include <sys/asm.h>
+#ifdef __NetBSD__
+# include <machine/regdef.h>
+# include <machine/asm.h>
+# ifndef fp
+# define fp s8
+# endif
+# ifndef PTRLOG
+# if SZREG == 4
+# define PTRLOG 2
+# else
+# define PTRLOG 3
+# endif
+# endif
+# ifndef SETUP_GP
+# if defined(__mips_o32)
+# define SETUP_GP \
+ .set push; \
+ .set noreorder; \
+ .cpload t9; \
+ .set pop
+# define SAVE_GP(x) \
+ .cprestore x
+# else
+# define SETUP_GP
+# define SAVE_GP(x)
+# endif
+# endif
+# ifndef ALSZ
+# if defined(__mips_n32) || defined(__mips_n64)
+# define ALSZ 15
+# define ALMASK ~15
+# else
+# define ALSZ 7
+# define ALMASK ~7
+# endif
+# endif
+#else
+# include <sys/regdef.h>
+# include <sys/asm.h>
+#endif
# NARGSAVE is the argument space in the callers frame, including extra
# 'shadowed' space for the argument registers. The minimum of 4

View file

@ -0,0 +1,53 @@
$NetBSD: patch-xo,v 1.1 2010/04/01 08:25:07 jmcneill Exp $
--- xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_mips.s.orig 2010-03-31 06:23:31.000000000 -0400
+++ xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_mips.s 2010-03-31 06:28:23.000000000 -0400
@@ -26,8 +26,46 @@
/* This code is for MIPS using the O32 ABI. */
-#include <sys/regdef.h>
-#include <sys/asm.h>
+#ifdef __NetBSD__
+# include <machine/regdef.h>
+# include <machine/asm.h>
+# ifndef fp
+# define fp s8
+# endif
+# ifndef PTRLOG
+# if SZREG == 4
+# define PTRLOG 2
+# else
+# define PTRLOG 3
+# endif
+# endif
+# ifndef SETUP_GP
+# if defined(__mips_o32)
+# define SETUP_GP \
+ .set push; \
+ .set noreorder; \
+ .cpload t9; \
+ .set pop
+# define SAVE_GP(x) \
+ .cprestore x
+# else
+# define SETUP_GP
+# define SAVE_GP(x)
+# endif
+# endif
+# ifndef ALSZ
+# if defined(__mips_n32) || defined(__mips_n64)
+# define ALSZ 15
+# define ALMASK ~15
+# else
+# define ALSZ 7
+# define ALMASK ~7
+# endif
+# endif
+#else
+# include <sys/regdef.h>
+# include <sys/asm.h>
+#endif
# NARGSAVE is the argument space in the callers frame, including extra
# 'shadowed' space for the argument registers. The minimum of 4