1
0
mirror of https://git.openwrt.org/feed/packages.git synced 2024-06-16 04:14:01 +02:00

Merge pull request #11690 from neheb/libffi

libffi: update to 3.3
This commit is contained in:
tripolar 2020-04-19 11:40:56 +02:00 committed by GitHub
commit e187ed5072
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 33 additions and 210 deletions

View File

@ -8,18 +8,18 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libffi
PKG_VERSION:=3.2.1
PKG_RELEASE:=4
PKG_VERSION:=3.3
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=ftp://sourceware.org/pub/libffi/
PKG_HASH:=d06ebb8e1d9a22d19e38d63fdb83954253f39bedc5d46232a05645685722ca37
PKG_SOURCE_URL:=https://sourceware.org/pub/libffi/
PKG_HASH:=72fba7922703ddfa7a028d513ac15a85c8d54c8d67f55fa5a4802885dc652056
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
PKG_USE_MIPS16:=0
include $(INCLUDE_DIR)/package.mk
@ -46,6 +46,20 @@ A layer must exist above libffi that handles type conversions for values passed
between the two languages.
endef
HOST_CONFIGURE_ARGS += \
--disable-debug \
--disable-docs \
--disable-multi-os-directory \
--disable-raw-api \
--disable-structs
CONFIGURE_ARGS += \
--disable-debug \
--disable-docs \
--disable-multi-os-directory \
--disable-raw-api \
--disable-structs
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(CP) \
@ -54,11 +68,11 @@ define Build/InstallDev
$(CP) \
$(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* \
$(1)/usr/lib/pkgconfig/
sed -i -e 's,includedir=.*,includedir=$$$${prefix}/include,' $(1)/usr/lib/pkgconfig/libffi.pc
$(SED) 's,includedir=.*,includedir=$$$${prefix}/include,' $(1)/usr/lib/pkgconfig/libffi.pc
$(INSTALL_DIR) $(1)/usr/include
$(CP) \
$(PKG_INSTALL_DIR)/usr/lib/$(PKG_NAME)-$(PKG_VERSION)/include/*.h \
$(PKG_INSTALL_DIR)/usr/include/*.h \
$(1)/usr/include/
endef
@ -69,15 +83,5 @@ define Package/libffi/install
$(1)/usr/lib/
endef
define Host/Install
$(call Host/Install/Default)
# Adjust host libffi headers ; the default rule does
# not seem to install them to the proper include folder
$(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/include
$(CP) \
$(STAGING_DIR_HOSTPKG)/lib/libffi-$(PKG_VERSION)/include/*.h \
$(STAGING_DIR_HOSTPKG)/include
endef
$(eval $(call HostBuild))
$(eval $(call BuildPackage,libffi))

View File

@ -1,31 +0,0 @@
diff -rupN libffi-3.2.1.orig/configure libffi-3.2.1/configure
--- libffi-3.2.1.orig/configure 2014-11-12 12:59:57.000000000 +0100
+++ libffi-3.2.1/configure 2016-05-11 17:14:58.606625260 +0200
@@ -18725,12 +18725,6 @@ if test "x$GCC" = "xyes"; then
toolexecdir="${libdir}"/gcc-lib/'$(target_alias)'
toolexeclibdir="${libdir}"
fi
- multi_os_directory=`$CC $CFLAGS -print-multi-os-directory`
- case $multi_os_directory in
- .) ;; # Avoid trailing /.
- ../*) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
- esac
-
else
toolexeclibdir="${libdir}"
fi
diff -rupN libffi-3.2.1.orig/configure.ac libffi-3.2.1/configure.ac
--- libffi-3.2.1.orig/configure.ac 2014-11-12 12:56:51.000000000 +0100
+++ libffi-3.2.1/configure.ac 2016-05-11 17:15:19.694626266 +0200
@@ -601,11 +601,6 @@ if test "x$GCC" = "xyes"; then
toolexecdir="${libdir}"/gcc-lib/'$(target_alias)'
toolexeclibdir="${libdir}"
fi
- multi_os_directory=`$CC $CFLAGS -print-multi-os-directory`
- case $multi_os_directory in
- .) ;; # Avoid trailing /.
- ../*) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
- esac
AC_SUBST(toolexecdir)
else
toolexeclibdir="${libdir}"

View File

@ -1,149 +1,18 @@
From bfeac1b2d18b12c1c3c64a41a09c90f93d0ed4ca Mon Sep 17 00:00:00 2001
From: Yousong Zhou <yszhou4tech@gmail.com>
Date: Mon, 15 Aug 2016 15:00:13 +0800
Subject: [PATCH] mips: fix MIPS softfloat build issue
From 76c0cfea70f78586231d7994492396eebfb12d5f Mon Sep 17 00:00:00 2001
From: Carl Hurd <carl.m.hurd@gmail.com>
Date: Fri, 29 Nov 2019 14:46:11 -0500
Subject: [PATCH] Fixed missed #ifndef for __mips_soft_float (#442)
The patch for o32.S is taken from OpenWrt packages repo 3a7a4bf "libffi:
fix MIPS softfloat build issue with current binutils"
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
Thank you!
---
src/mips/n32.S | 17 +++++++++++++++++
src/mips/o32.S | 17 +++++++++++++++++
2 files changed, 34 insertions(+)
src/mips/o32.S | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/mips/n32.S b/src/mips/n32.S
index c6985d3..8f25994 100644
--- a/src/mips/n32.S
+++ b/src/mips/n32.S
@@ -107,6 +107,16 @@ loadregs:
REG_L t6, 3*FFI_SIZEOF_ARG($fp) # load the flags word into t6.
+#ifdef __mips_soft_float
+ REG_L a0, 0*FFI_SIZEOF_ARG(t9)
+ REG_L a1, 1*FFI_SIZEOF_ARG(t9)
+ REG_L a2, 2*FFI_SIZEOF_ARG(t9)
+ REG_L a3, 3*FFI_SIZEOF_ARG(t9)
+ REG_L a4, 4*FFI_SIZEOF_ARG(t9)
+ REG_L a5, 5*FFI_SIZEOF_ARG(t9)
+ REG_L a6, 6*FFI_SIZEOF_ARG(t9)
+ REG_L a7, 7*FFI_SIZEOF_ARG(t9)
+#else
and t4, t6, ((1<<FFI_FLAG_BITS)-1)
REG_L a0, 0*FFI_SIZEOF_ARG(t9)
beqz t4, arg1_next
@@ -193,6 +203,7 @@ arg7_next:
arg8_doublep:
l.d $f19, 7*FFI_SIZEOF_ARG(t9)
arg8_next:
+#endif
callit:
# Load the function pointer
@@ -214,6 +225,7 @@ retint:
b epilogue
retfloat:
+#ifndef __mips_soft_float
bne t6, FFI_TYPE_FLOAT, retdouble
jal t9
REG_L t4, 4*FFI_SIZEOF_ARG($fp)
@@ -272,6 +284,7 @@ retstruct_f_d:
s.s $f0, 0(t4)
s.d $f2, 8(t4)
b epilogue
+#endif
retstruct_d_soft:
bne t6, FFI_TYPE_STRUCT_D_SOFT, retstruct_f_soft
@@ -429,6 +442,7 @@ ffi_closure_N32:
REG_S a6, A6_OFF2($sp)
REG_S a7, A7_OFF2($sp)
+#ifndef __mips_soft_float
# Store all possible float/double registers.
s.d $f12, F12_OFF2($sp)
s.d $f13, F13_OFF2($sp)
@@ -438,6 +452,7 @@ ffi_closure_N32:
s.d $f17, F17_OFF2($sp)
s.d $f18, F18_OFF2($sp)
s.d $f19, F19_OFF2($sp)
+#endif
# Call ffi_closure_mips_inner_N32 to do the real work.
LA t9, ffi_closure_mips_inner_N32
@@ -458,6 +473,7 @@ cls_retint:
b cls_epilogue
cls_retfloat:
+#ifndef __mips_soft_float
bne v0, FFI_TYPE_FLOAT, cls_retdouble
l.s $f0, V0_OFF2($sp)
b cls_epilogue
@@ -500,6 +516,7 @@ cls_retstruct_f_d:
l.s $f0, V0_OFF2($sp)
l.d $f2, V1_OFF2($sp)
b cls_epilogue
+#endif
cls_retstruct_small2:
REG_L v0, V0_OFF2($sp)
diff --git a/src/mips/o32.S b/src/mips/o32.S
index eb27981..429dd0a 100644
index 44e74cb9..799139b2 100644
--- a/src/mips/o32.S
+++ b/src/mips/o32.S
@@ -82,13 +82,16 @@ sixteen:
ADDU $sp, 4 * FFI_SIZEOF_ARG # adjust $sp to new args
+#ifndef __mips_soft_float
bnez t0, pass_d # make it quick for int
+#endif
REG_L a0, 0*FFI_SIZEOF_ARG($sp) # just go ahead and load the
REG_L a1, 1*FFI_SIZEOF_ARG($sp) # four regs.
REG_L a2, 2*FFI_SIZEOF_ARG($sp)
REG_L a3, 3*FFI_SIZEOF_ARG($sp)
b call_it
+#ifndef __mips_soft_float
pass_d:
bne t0, FFI_ARGS_D, pass_f
l.d $f12, 0*FFI_SIZEOF_ARG($sp) # load $fp regs from args
@@ -130,6 +133,7 @@ pass_f_d:
# bne t0, FFI_ARGS_F_D, call_it
l.s $f12, 0*FFI_SIZEOF_ARG($sp) # load $fp regs from args
l.d $f14, 2*FFI_SIZEOF_ARG($sp) # passing double and float
+#endif
call_it:
# Load the function pointer
@@ -158,14 +162,23 @@ retfloat:
bne t2, FFI_TYPE_FLOAT, retdouble
jalr t9
REG_L t0, SIZEOF_FRAME + 4*FFI_SIZEOF_ARG($fp)
+#ifndef __mips_soft_float
s.s $f0, 0(t0)
+#else
+ REG_S v0, 0(t0)
+#endif
b epilogue
retdouble:
bne t2, FFI_TYPE_DOUBLE, noretval
jalr t9
REG_L t0, SIZEOF_FRAME + 4*FFI_SIZEOF_ARG($fp)
+#ifndef __mips_soft_float
s.d $f0, 0(t0)
+#else
+ REG_S v1, 4(t0)
+ REG_S v0, 0(t0)
+#endif
b epilogue
noretval:
@@ -261,9 +274,11 @@ $LCFI7:
@@ -282,9 +282,11 @@ $LCFI12:
li $13, 1 # FFI_O32
bne $16, $13, 1f # Skip fp save if FFI_O32_SOFT_FLOAT
@ -152,25 +21,6 @@ index eb27981..429dd0a 100644
s.d $f12, FA_0_0_OFF2($fp)
s.d $f14, FA_1_0_OFF2($fp)
+#endif
1:
# Call ffi_closure_mips_inner_O32 to do the work.
la t9, ffi_closure_mips_inner_O32
@@ -281,6 +296,7 @@ $LCFI7:
li $13, 1 # FFI_O32
bne $16, $13, 1f # Skip fp restore if FFI_O32_SOFT_FLOAT
+#ifndef __mips_soft_float
li $9, FFI_TYPE_FLOAT
l.s $f0, V0_OFF2($fp)
beq $8, $9, closure_done
@@ -288,6 +304,7 @@ $LCFI7:
li $9, FFI_TYPE_DOUBLE
l.d $f0, V0_OFF2($fp)
beq $8, $9, closure_done
+#endif
1:
REG_L $3, V1_OFF2($fp)
REG_L $2, V0_OFF2($fp)
--
2.6.4
1:
# prepare arguments for ffi_closure_mips_inner_O32
REG_L a0, 4($15) # cif