From owner-freebsd-mips@FreeBSD.ORG Wed Jul 16 22:55:39 2014 Return-Path: Delivered-To: mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0D29BF47 for ; Wed, 16 Jul 2014 22:55:39 +0000 (UTC) Received: from cdptpa-oedge-vip.email.rr.com (cdptpa-outbound-snat.email.rr.com [107.14.166.229]) by mx1.freebsd.org (Postfix) with ESMTP id C5FCF2D09 for ; Wed, 16 Jul 2014 22:55:38 +0000 (UTC) Received: from [76.187.139.93] ([76.187.139.93:62707] helo=[192.168.0.30]) by cdptpa-oedge02 (envelope-from ) (ecelerity 3.5.0.35861 r(Momo-dev:tip)) with ESMTP id AE/56-07747-3E207C35; Wed, 16 Jul 2014 22:55:31 +0000 From: Stacey Son Content-Type: multipart/mixed; boundary="Apple-Mail=_47288A42-05AC-4D41-8704-770989000ED7" Subject: mips devel/libffi port patches Date: Wed, 16 Jul 2014 17:55:30 -0500 Message-Id: <4B49A41F-DE03-4FD7-9FFB-6EC878EB8D70@FreeBSD.org> To: mips@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) X-Mailer: Apple Mail (2.1874) X-RR-Connecting-IP: 107.14.168.130:25 X-Cloudmark-Score: 0 Cc: zeising@FreeBSD.org X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jul 2014 22:55:39 -0000 --Apple-Mail=_47288A42-05AC-4D41-8704-770989000ED7 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii FYI, The following attached diff fixes the devel/libffi for FreeBSD/mips64 so = it builds. It modifies 'configure' to recognize 'mips*-*-freebsd*' and = removes the call to cacheflush(), which doesn't seem to exist currently = on FreeBSD/mips64 in any form. Regards, -stacey. --Apple-Mail=_47288A42-05AC-4D41-8704-770989000ED7 Content-Disposition: attachment; filename=devel_libffi_port.diff Content-Type: application/octet-stream; name="devel_libffi_port.diff" Content-Transfer-Encoding: 7bit commit 26d21ea2b14d059aafc288929f3d1bea6a07b13f Author: Stacey Son Date: Wed Jul 16 22:43:38 2014 +0000 Additional patches so devel/libffi builds on mips64. Adds mips*-*-freebsd* to configure and #ifdef's out call to cacheflush(), which doesn't seem to exist currently on FreeBSD/mips64 in any form. diff --git a/files/patch-configure b/files/patch-configure new file mode 100644 index 0000000..1e29bb2 --- /dev/null +++ b/files/patch-configure @@ -0,0 +1,13 @@ +diff --git ./configure.orig ./configure +index 4b04db7..0d94fbd 100755 +--- ./configure.orig ++++ ./configure +@@ -13428,7 +13428,7 @@ case "$host" in + mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*) + TARGET=MIPS; TARGETDIR=mips + ;; +- mips*-*-linux* | mips*-*-openbsd*) ++ mips*-*-linux* | mips*-*-openbsd* | mips*-*-freebsd*) + # Support 128-bit long double for NewABI. + HAVE_LONG_DOUBLE='defined(__mips64)' + TARGET=MIPS; TARGETDIR=mips diff --git a/files/patch-src__mips__ffi.c b/files/patch-src__mips__ffi.c new file mode 100644 index 0000000..d93f373 --- /dev/null +++ b/files/patch-src__mips__ffi.c @@ -0,0 +1,29 @@ +diff --git ./src/mips/ffi.c.orig ./src/mips/ffi.c +index 03121e3..8b7881f 100644 +--- ./src/mips/ffi.c.orig ++++ ./src/mips/ffi.c +@@ -38,7 +38,9 @@ + #endif + + #ifndef USE__BUILTIN___CLEAR_CACHE +-# if defined(__OpenBSD__) ++# if defined(__FreeBSD__) ++# include ++# elif defined(__OpenBSD__) + # include + # else + # include +@@ -729,11 +731,13 @@ ffi_prep_closure_loc (ffi_closure *closure, + closure->fun = fun; + closure->user_data = user_data; + ++#if !defined(__FreeBSD__) + #ifdef USE__BUILTIN___CLEAR_CACHE + __builtin___clear_cache(clear_location, clear_location + FFI_TRAMPOLINE_SIZE); + #else + cacheflush (clear_location, FFI_TRAMPOLINE_SIZE, ICACHE); + #endif ++#endif /* ! __FreeBSD__ */ + return FFI_OK; + } + diff --git a/files/patch-src__mips__ffitarget.h b/files/patch-src__mips__ffitarget.h new file mode 100644 index 0000000..4c52e32 --- /dev/null +++ b/files/patch-src__mips__ffitarget.h @@ -0,0 +1,13 @@ +diff --git ./src/mips/ffitarget.h.orig ./src/mips/ffitarget.h +index 717d659..5a0c2b1 100644 +--- ./src/mips/ffitarget.h.orig ++++ ./src/mips/ffitarget.h +@@ -41,7 +41,7 @@ + #define _MIPS_SIM_ABI32 1 + #define _MIPS_SIM_NABI32 2 + #define _MIPS_SIM_ABI64 3 +-#elif !defined(__OpenBSD__) ++#elif !defined(__OpenBSD__) && !defined(__FreeBSD__) + # include + #endif + --Apple-Mail=_47288A42-05AC-4D41-8704-770989000ED7--