[Midnightbsd-cvs] mports [18072] trunk/devel/libffi/files: libffi 3.2.1
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Sat Mar 7 16:29:35 EST 2015
Revision: 18072
http://svnweb.midnightbsd.org/mports/?rev=18072
Author: laffer1
Date: 2015-03-07 16:29:34 -0500 (Sat, 07 Mar 2015)
Log Message:
-----------
libffi 3.2.1
Added Paths:
-----------
trunk/devel/libffi/files/
trunk/devel/libffi/files/patch-b5ade2
trunk/devel/libffi/files/patch-configure
trunk/devel/libffi/files/patch-src__arm__ffi.c
trunk/devel/libffi/files/patch-src__mips__ffi.c
trunk/devel/libffi/files/patch-src__mips__ffitarget.h
trunk/devel/libffi/files/patch-src_arm_sysv.S
Added: trunk/devel/libffi/files/patch-b5ade2
===================================================================
--- trunk/devel/libffi/files/patch-b5ade2 (rev 0)
+++ trunk/devel/libffi/files/patch-b5ade2 2015-03-07 21:29:34 UTC (rev 18072)
@@ -0,0 +1,112 @@
+# Clang doesn't like the -Wno-psabi argument that we want to pass to GCC.
+# Since clang is detected as GCC via __GNUC__, use ax_cv_c_compiler_vendor.
+# https://github.com/atgreen/libffi/commit/b5ade2fb5d9ba06519484677a5474e5dad48c2e3
+
+diff --git a/testsuite/lib/libffi.exp b/testsuite/lib/libffi.exp
+index 5051d31..0e92bb0 100644
+--- testsuite/lib/libffi.exp
++++ testsuite/lib/libffi.exp
+@@ -100,46 +100,39 @@ proc libffi-init { args } {
+ global libffi_link_flags
+ global tool_root_dir
+ global ld_library_path
+-
+- global using_gcc
++ global compiler_vendor
+
+ set blddirffi [pwd]/..
+ verbose "libffi $blddirffi"
+
+- # Are we building with GCC?
+- set tmp [grep ../config.status "GCC='yes'"]
+- if { [string match $tmp "GCC='yes'"] } {
+-
+- set using_gcc "yes"
++ # Which compiler are we building with?
++ set tmp [grep ../config.log "^ax_cv_c_compiler_vendor.*$"]
++ regexp -- {^[^=]*=(.*)$} $tmp nil compiler_vendor
+
+- set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a]
+- if {$gccdir != ""} {
+- set gccdir [file dirname $gccdir]
+- }
+- verbose "gccdir $gccdir"
+-
+- set ld_library_path "."
+- append ld_library_path ":${gccdir}"
+-
+- set compiler "${gccdir}/xgcc"
+- if { [is_remote host] == 0 && [which $compiler] != 0 } {
+- foreach i "[exec $compiler --print-multi-lib]" {
+- set mldir ""
+- regexp -- "\[a-z0-9=_/\.-\]*;" $i mldir
+- set mldir [string trimright $mldir "\;@"]
+- if { "$mldir" == "." } {
+- continue
+- }
+- if { [llength [glob -nocomplain ${gccdir}/${mldir}/libgcc_s*.so.*]] >= 1 } {
+- append ld_library_path ":${gccdir}/${mldir}"
++ if { [string match $compiler_vendor "gnu"] } {
++ set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a]
++ if {$gccdir != ""} {
++ set gccdir [file dirname $gccdir]
++ }
++ verbose "gccdir $gccdir"
++
++ set ld_library_path "."
++ append ld_library_path ":${gccdir}"
++
++ set compiler "${gccdir}/xgcc"
++ if { [is_remote host] == 0 && [which $compiler] != 0 } {
++ foreach i "[exec $compiler --print-multi-lib]" {
++ set mldir ""
++ regexp -- "\[a-z0-9=_/\.-\]*;" $i mldir
++ set mldir [string trimright $mldir "\;@"]
++ if { "$mldir" == "." } {
++ continue
++ }
++ if { [llength [glob -nocomplain ${gccdir}/${mldir}/libgcc_s*.so.*]] >= 1 } {
++ append ld_library_path ":${gccdir}/${mldir}"
++ }
+ }
+- }
+- }
+-
+- } else {
+-
+- set using_gcc "no"
+-
++ }
+ }
+
+ # add the library path for libffi.
+@@ -278,18 +271,25 @@ proc libffi-dg-runtest { testcases default-extra-flags } {
+ }
+
+ proc run-many-tests { testcases extra_flags } {
+- global using_gcc
+- if { [string match $using_gcc "yes"] } {
++ global compiler_vendor
++ switch $compiler_vendor {
++ "clang" {
++ set common "-W -Wall"
++ set optimizations { "-O0" "-O1" "-O2" "-O3" "-Os" }
++ }
++ "gnu" {
+ set common "-W -Wall -Wno-psabi"
+ set optimizations { "-O0" "-O2" "-O3" "-Os" "-O2 -fomit-frame-pointer" }
+- } else {
++ }
++ default {
+ # Assume we are using the vendor compiler.
+ set common ""
+ set optimizations { "" }
++ }
+ }
+
+ set targetabis { "" }
+- if [string match $using_gcc "yes"] {
++ if [string match $compiler_vendor "gnu"] {
+ if [istarget "i?86-*-*"] {
+ set targetabis {
+ ""
Property changes on: trunk/devel/libffi/files/patch-b5ade2
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/devel/libffi/files/patch-configure
===================================================================
--- trunk/devel/libffi/files/patch-configure (rev 0)
+++ trunk/devel/libffi/files/patch-configure 2015-03-07 21:29:34 UTC (rev 18072)
@@ -0,0 +1,11 @@
+--- configure.orig 2015-01-01 10:56:10 UTC
++++ configure
+@@ -17221,7 +17221,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
Property changes on: trunk/devel/libffi/files/patch-configure
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/devel/libffi/files/patch-src__arm__ffi.c
===================================================================
--- trunk/devel/libffi/files/patch-src__arm__ffi.c (rev 0)
+++ trunk/devel/libffi/files/patch-src__arm__ffi.c 2015-03-07 21:29:34 UTC (rev 18072)
@@ -0,0 +1,36 @@
+# Description: Fix abort() on ARM related to __clear_cache(). This is an issue
+# for anything !apple that is using the libcompiler_rt provided by clang on ARM
+# PR: ports/149167 ports/184517
+# Patch by: cognet@ (to be upstreamed @ LLVM)
+
+--- ./src/arm/ffi.c.orig 2013-03-16 22:19:39.000000000 +1100
++++ ./src/arm/ffi.c 2013-12-03 19:30:58.440924300 +1100
+@@ -33,6 +33,11 @@
+
+ #include <stdlib.h>
+
++#if defined(__FreeBSD__) && defined(__arm__)
++#include <sys/types.h>
++#include <machine/sysarch.h>
++#endif
++
+ /* Forward declares. */
+ static int vfp_type_p (ffi_type *);
+ static void layout_vfp_args (ffi_cif *);
+@@ -582,6 +587,16 @@
+
+ #else
+
++#if defined(__FreeBSD__) && defined(__arm__)
++#define __clear_cache(start, end) do { \
++ struct arm_sync_icache_args ua; \
++ \
++ ua.addr = (uintptr_t)(start); \
++ ua.len = (char *)(end) - (char *)start; \
++ sysarch(ARM_SYNC_ICACHE, &ua); \
++ } while (0);
++#endif
++
+ #define FFI_INIT_TRAMPOLINE(TRAMP,FUN,CTX) \
+ ({ unsigned char *__tramp = (unsigned char*)(TRAMP); \
+ unsigned int __fun = (unsigned int)(FUN); \
Property changes on: trunk/devel/libffi/files/patch-src__arm__ffi.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/devel/libffi/files/patch-src__mips__ffi.c
===================================================================
--- trunk/devel/libffi/files/patch-src__mips__ffi.c (rev 0)
+++ trunk/devel/libffi/files/patch-src__mips__ffi.c 2015-03-07 21:29:34 UTC (rev 18072)
@@ -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 <machine/sysarch.h>
++# elif defined(__OpenBSD__)
+ # include <mips64/sysarch.h>
+ # else
+ # include <sys/cachectl.h>
+@@ -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;
+ }
+
Property changes on: trunk/devel/libffi/files/patch-src__mips__ffi.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/devel/libffi/files/patch-src__mips__ffitarget.h
===================================================================
--- trunk/devel/libffi/files/patch-src__mips__ffitarget.h (rev 0)
+++ trunk/devel/libffi/files/patch-src__mips__ffitarget.h 2015-03-07 21:29:34 UTC (rev 18072)
@@ -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 <sgidefs.h>
+ #endif
+
Property changes on: trunk/devel/libffi/files/patch-src__mips__ffitarget.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/devel/libffi/files/patch-src_arm_sysv.S
===================================================================
--- trunk/devel/libffi/files/patch-src_arm_sysv.S (rev 0)
+++ trunk/devel/libffi/files/patch-src_arm_sysv.S 2015-03-07 21:29:34 UTC (rev 18072)
@@ -0,0 +1,15 @@
+# Description: 3.2.1 fails to build with clang 3.5.0 on arm
+# Issue ID: https://github.com/atgreen/libffi/issues/162
+# Submitted by: sbruno
+
+--- src/arm/sysv.S.orig 2015-01-01 10:47:51 UTC
++++ src/arm/sysv.S
+@@ -396,7 +396,7 @@ LSYM(Lbase_args):
+ beq LSYM(Lepilogue_vfp)
+
+ cmp r3, #FFI_TYPE_SINT64
+- stmeqia r2, {r0, r1}
++ stmiaeq r2, {r0, r1}
+ beq LSYM(Lepilogue_vfp)
+
+ cmp r3, #FFI_TYPE_FLOAT
Property changes on: trunk/devel/libffi/files/patch-src_arm_sysv.S
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
More information about the Midnightbsd-cvs
mailing list