summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiclas Zeising <zeising@FreeBSD.org>2020-07-04 18:09:38 +0000
committerNiclas Zeising <zeising@FreeBSD.org>2020-07-04 18:09:38 +0000
commitebc9067a31c6dc63b90eb56ad1bb59250c31b1f5 (patch)
tree03b2e671d5fc678491cabb73fa07ebbed3314720
parentUpdate to 4.4.10 (diff)
devel/libffi: Update to 3.3.0
Update devel/libffi to 3.3.0 This adds support for RISC-V Changelog: https://github.com/libffi/libffi/releases/tag/v3.3 PR: 247028 (exp-run) Reviewed by: kp, linimon, arrowd exp-run by: antoine Differential Revision: https://reviews.freebsd.org/D25163
-rw-r--r--devel/libffi/Makefile11
-rw-r--r--devel/libffi/distinfo5
-rw-r--r--devel/libffi/files/patch-Makefile.in16
-rw-r--r--devel/libffi/files/patch-b5ade2112
-rw-r--r--devel/libffi/files/patch-configure124
-rw-r--r--devel/libffi/files/patch-configure.host22
-rw-r--r--devel/libffi/files/patch-src__arm__ffi.c26
-rw-r--r--devel/libffi/files/patch-src_arm_sysv.S55
-rw-r--r--devel/libffi/pkg-descr2
-rw-r--r--devel/libffi/pkg-plist6
10 files changed, 59 insertions, 320 deletions
diff --git a/devel/libffi/Makefile b/devel/libffi/Makefile
index 288cc0d970c7..c9c7d0376e5e 100644
--- a/devel/libffi/Makefile
+++ b/devel/libffi/Makefile
@@ -2,8 +2,7 @@
# $FreeBSD$
PORTNAME= libffi
-PORTVERSION= 3.2.1
-PORTREVISION= 3
+PORTVERSION= 3.3
CATEGORIES= devel
MASTER_SITES= SOURCEWARE/${PORTNAME}
@@ -19,19 +18,13 @@ USES= libtool pathfix
USE_LDCONFIG= yes
GNU_CONFIGURE= yes
+CONFIGURE_ARGS= --disable-multi-os-directory
INSTALL_TARGET= install-strip
INFO= libffi
-PLIST_SUB= PORTVERSION=${PORTVERSION}
TEST_TARGET= check
post-patch:
@${REINPLACE_CMD} -e 's| -Wno-psabi||g' \
${WRKSRC}/testsuite/lib/libffi.exp
-post-install:
- @${LN} -sf ../lib/libffi-${PORTVERSION}/include/ffi.h \
- ${STAGEDIR}${PREFIX}/include/
- @${LN} -sf ../lib/libffi-${PORTVERSION}/include/ffitarget.h \
- ${STAGEDIR}${PREFIX}/include/
-
.include <bsd.port.mk>
diff --git a/devel/libffi/distinfo b/devel/libffi/distinfo
index b388b79c5261..adbf0a6e58e4 100644
--- a/devel/libffi/distinfo
+++ b/devel/libffi/distinfo
@@ -1,2 +1,3 @@
-SHA256 (libffi-3.2.1.tar.gz) = d06ebb8e1d9a22d19e38d63fdb83954253f39bedc5d46232a05645685722ca37
-SIZE (libffi-3.2.1.tar.gz) = 940837
+TIMESTAMP = 1575540897
+SHA256 (libffi-3.3.tar.gz) = 72fba7922703ddfa7a028d513ac15a85c8d54c8d67f55fa5a4802885dc652056
+SIZE (libffi-3.3.tar.gz) = 1305466
diff --git a/devel/libffi/files/patch-Makefile.in b/devel/libffi/files/patch-Makefile.in
new file mode 100644
index 000000000000..731e61881f65
--- /dev/null
+++ b/devel/libffi/files/patch-Makefile.in
@@ -0,0 +1,16 @@
+This patch is based on the following upstream patch
+From 0027b072627aa9d3ada71c4374561966064ecd5a Mon Sep 17 00:00:00 2001
+From: "M. Herdiansyah"
+Date: Thu, 11 Jun 2020 19:40:24 +0700
+Subject: [PATCH] Makefile: increase compatibility with bmake (#551)
+--- Makefile.in.orig 2020-07-04 16:53:39 UTC
++++ Makefile.in
+@@ -2012,7 +2012,7 @@ uninstall-am: uninstall-pkgconfigDATA uninstall-toolex
+ @LIBFFI_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBFFI_BUILD_VERSIONED_SHLIB_TRUE@ > $@ || (rm -f $@ ; exit 1)
+
+ libffi.map: $(top_srcdir)/libffi.map.in
+- $(COMPILE) -D$(TARGET) -E -x assembler-with-cpp -o $@ $<
++ $(COMPILE) -D$(TARGET) -E -x assembler-with-cpp -o $@ $(top_srcdir)/libffi.map.in
+
+ dist-hook:
+ d=`(cd $(distdir); pwd)`; (cd doc; make pdf; cp *.pdf $$d/doc)
diff --git a/devel/libffi/files/patch-b5ade2 b/devel/libffi/files/patch-b5ade2
deleted file mode 100644
index e6933f7e224a..000000000000
--- a/devel/libffi/files/patch-b5ade2
+++ /dev/null
@@ -1,112 +0,0 @@
-# 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 {
- ""
diff --git a/devel/libffi/files/patch-configure b/devel/libffi/files/patch-configure
deleted file mode 100644
index 996b0998a34b..000000000000
--- a/devel/libffi/files/patch-configure
+++ /dev/null
@@ -1,124 +0,0 @@
---- configure.orig 2014-11-12 11:59:57 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
-@@ -17255,6 +17255,10 @@ case "$host" in
- TARGET=POWERPC_FREEBSD; TARGETDIR=powerpc
- HAVE_LONG_DOUBLE_VARIANT=1
- ;;
-+ powerpcspe-*-freebsd*)
-+ TARGET=POWERPC_FREEBSD; TARGETDIR=powerpc
-+ CFLAGS="$CFLAGS -D__NO_FPRS__"
-+ ;;
- powerpc64-*-freebsd*)
- TARGET=POWERPC; TARGETDIR=powerpc
- ;;
-@@ -18289,7 +18293,8 @@ $as_echo "#define HAVE_AS_CFI_PSEUDO_OP 1" >>confdefs.
- fi
-
-
--if test x$TARGET = xSPARC; then
-+case "$TARGET" in
-+ SPARC)
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler and linker support unaligned pc related relocs" >&5
- $as_echo_n "checking assembler and linker support unaligned pc related relocs... " >&6; }
- if ${libffi_cv_as_sparc_ua_pcrel+:} false; then :
-@@ -18363,9 +18368,9 @@ $as_echo "$libffi_cv_as_register_pseudo_op" >&6; }
- $as_echo "#define HAVE_AS_REGISTER_PSEUDO_OP 1" >>confdefs.h
-
- fi
--fi
-+ ;;
-
--if test x$TARGET = xX86 || test x$TARGET = xX86_WIN32 || test x$TARGET = xX86_64; then
-+ X86*)
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler supports pc related relocs" >&5
- $as_echo_n "checking assembler supports pc related relocs... " >&6; }
- if ${libffi_cv_as_x86_pcrel+:} false; then :
-@@ -18386,77 +18391,8 @@ $as_echo "$libffi_cv_as_x86_pcrel" >&6; }
- $as_echo "#define HAVE_AS_X86_PCREL 1" >>confdefs.h
-
- fi
--
-- { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler .ascii pseudo-op support" >&5
--$as_echo_n "checking assembler .ascii pseudo-op support... " >&6; }
--if ${libffi_cv_as_ascii_pseudo_op+:} false; then :
-- $as_echo_n "(cached) " >&6
--else
--
-- libffi_cv_as_ascii_pseudo_op=unknown
-- # Check if we have .ascii
-- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
--/* end confdefs.h. */
--
--int
--main ()
--{
--asm (".ascii \\"string\\"");
-- ;
-- return 0;
--}
--_ACEOF
--if ac_fn_c_try_compile "$LINENO"; then :
-- libffi_cv_as_ascii_pseudo_op=yes
--else
-- libffi_cv_as_ascii_pseudo_op=no
--fi
--rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
--
--fi
--{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libffi_cv_as_ascii_pseudo_op" >&5
--$as_echo "$libffi_cv_as_ascii_pseudo_op" >&6; }
-- if test "x$libffi_cv_as_ascii_pseudo_op" = xyes; then
--
--$as_echo "#define HAVE_AS_ASCII_PSEUDO_OP 1" >>confdefs.h
--
-- fi
--
-- { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler .string pseudo-op support" >&5
--$as_echo_n "checking assembler .string pseudo-op support... " >&6; }
--if ${libffi_cv_as_string_pseudo_op+:} false; then :
-- $as_echo_n "(cached) " >&6
--else
--
-- libffi_cv_as_string_pseudo_op=unknown
-- # Check if we have .string
-- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
--/* end confdefs.h. */
--
--int
--main ()
--{
--asm (".string \\"string\\"");
-- ;
-- return 0;
--}
--_ACEOF
--if ac_fn_c_try_compile "$LINENO"; then :
-- libffi_cv_as_string_pseudo_op=yes
--else
-- libffi_cv_as_string_pseudo_op=no
--fi
--rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
--
--fi
--{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libffi_cv_as_string_pseudo_op" >&5
--$as_echo "$libffi_cv_as_string_pseudo_op" >&6; }
-- if test "x$libffi_cv_as_string_pseudo_op" = xyes; then
--
--$as_echo "#define HAVE_AS_STRING_PSEUDO_OP 1" >>confdefs.h
--
-- fi
--fi
-+ ;;
-+esac
-
- # On PaX enable kernels that have MPROTECT enable we can't use PROT_EXEC.
- # Check whether --enable-pax_emutramp was given.
diff --git a/devel/libffi/files/patch-configure.host b/devel/libffi/files/patch-configure.host
new file mode 100644
index 000000000000..549a9bb54a41
--- /dev/null
+++ b/devel/libffi/files/patch-configure.host
@@ -0,0 +1,22 @@
+--- configure.host.orig 2019-11-22 23:55:36 UTC
++++ configure.host
+@@ -167,7 +167,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
+@@ -202,6 +202,10 @@ case "${host}" in
+ powerpc-*-freebsd* | powerpc-*-openbsd* | powerpc-*-netbsd*)
+ TARGET=POWERPC_FREEBSD; TARGETDIR=powerpc
+ HAVE_LONG_DOUBLE_VARIANT=1
++ ;;
++ powerpcspe-*-freebsd*)
++ TARGET=POWERPC_FREEBSD; TARGETDIR=powerpc
++ CFLAGS="$CFLAGS -D__NO_FPRS__"
+ ;;
+ powerpc64-*-freebsd*)
+ TARGET=POWERPC; TARGETDIR=powerpc
diff --git a/devel/libffi/files/patch-src__arm__ffi.c b/devel/libffi/files/patch-src__arm__ffi.c
index d3058a087101..02141745c36c 100644
--- a/devel/libffi/files/patch-src__arm__ffi.c
+++ b/devel/libffi/files/patch-src__arm__ffi.c
@@ -3,11 +3,11 @@
# 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>
+--- src/arm/ffi.c.orig 2019-10-31 14:49:54 UTC
++++ src/arm/ffi.c
+@@ -55,6 +55,11 @@ extern unsigned int ffi_arm_trampoline[3] FFI_HIDDEN;
+ #endif
+ #endif
+#if defined(__FreeBSD__) && defined(__arm__)
+#include <sys/types.h>
@@ -15,12 +15,13 @@
+#endif
+
/* Forward declares. */
- static int vfp_type_p (ffi_type *);
+ static int vfp_type_p (const ffi_type *);
static void layout_vfp_args (ffi_cif *);
-@@ -582,6 +587,16 @@
-
- #else
+@@ -568,6 +573,16 @@ void ffi_go_closure_SYSV (void) FFI_HIDDEN;
+ void ffi_go_closure_VFP (void) FFI_HIDDEN;
+ /* the cif must already be prep'ed */
++
+#if defined(__FreeBSD__) && defined(__arm__)
+#define __clear_cache(start, end) do { \
+ struct arm_sync_icache_args ua; \
@@ -30,7 +31,6 @@
+ 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); \
+
+ ffi_status
+ ffi_prep_closure_loc (ffi_closure * closure,
diff --git a/devel/libffi/files/patch-src_arm_sysv.S b/devel/libffi/files/patch-src_arm_sysv.S
deleted file mode 100644
index 9681c4ba15ae..000000000000
--- a/devel/libffi/files/patch-src_arm_sysv.S
+++ /dev/null
@@ -1,55 +0,0 @@
-# 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
-@@ -360,7 +360,7 @@ ARM_FUNC_START(ffi_call_VFP)
- cmp r0, #3
- sub ip, fp, #64
- flddle d0, [ip]
-- fldmiadgt ip, {d0-d7}
-+ vldmiagt ip, {d0-d7}
-
- LSYM(Lbase_args):
- @ move first 4 parameters in registers
-@@ -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
-@@ -409,7 +409,7 @@ LSYM(Lbase_args):
-
- cmp r3, #FFI_TYPE_STRUCT_VFP_FLOAT
- cmpne r3, #FFI_TYPE_STRUCT_VFP_DOUBLE
-- fstmiadeq r2, {d0-d3}
-+ vstmiaeq r2, {d0-d3}
-
- LSYM(Lepilogue_vfp):
- RETLDM "r0-r3,fp"
-@@ -420,7 +420,7 @@ LSYM(Lepilogue_vfp):
-
-
- ARM_FUNC_START(ffi_closure_VFP)
-- fstmfdd sp!, {d0-d7}
-+ vstmdb sp!, {d0-d7}
- @ r0-r3, then d0-d7
- UNWIND .pad #80
- add ip, sp, #80
-@@ -470,10 +470,10 @@ ARM_FUNC_START(ffi_closure_VFP)
- ldmia sp, {r0, r1}
- b .Lclosure_epilogue_vfp
- .Lretfloat_struct_vfp:
-- fldmiad sp, {d0-d1}
-+ vldmia sp, {d0-d1}
- b .Lclosure_epilogue_vfp
- .Lretdouble_struct_vfp:
-- fldmiad sp, {d0-d3}
-+ vldmia sp, {d0-d3}
- b .Lclosure_epilogue_vfp
-
- .ffi_closure_VFP_end:
diff --git a/devel/libffi/pkg-descr b/devel/libffi/pkg-descr
index 15514cb81826..db7bfcd2a6fe 100644
--- a/devel/libffi/pkg-descr
+++ b/devel/libffi/pkg-descr
@@ -3,4 +3,4 @@ interface to various calling conventions. This allows a programmer to
call any function specified by a call interface description at run
time.
-WWW: http://sources.redhat.com/libffi/
+WWW: https://sourceware.org/libffi/
diff --git a/devel/libffi/pkg-plist b/devel/libffi/pkg-plist
index f4629c73a487..cdea449ead1b 100644
--- a/devel/libffi/pkg-plist
+++ b/devel/libffi/pkg-plist
@@ -1,11 +1,9 @@
include/ffi.h
include/ffitarget.h
-lib/libffi-%%PORTVERSION%%/include/ffi.h
-lib/libffi-%%PORTVERSION%%/include/ffitarget.h
lib/libffi.a
lib/libffi.so
-lib/libffi.so.6
-lib/libffi.so.6.0.4
+lib/libffi.so.7
+lib/libffi.so.7.1.0
libdata/pkgconfig/libffi.pc
man/man3/ffi.3.gz
man/man3/ffi_call.3.gz