libffi: update to 3.3

This commit is contained in:
Jürgen Buchmüller 2020-03-23 17:28:52 +01:00
parent b1a70d3fba
commit f0cb35d5e2
11 changed files with 5 additions and 287 deletions

View file

@ -199,7 +199,8 @@ libtextstyle.so.0 gettext-libs-0.20.1_1
libattr.so.1 attr-2.4.43_1
libacl.so.1 acl-2.2.47_1
libpython2.7.so.1.0 python-2.7_1
libffi.so.6 libffi-3.1_1
libffi.so.6 libffi-3.3_1
libffi.so.7 libffi-3.3_1
libffcall.so.0 ffcall-2.1_1
libavcall.so.1 ffcall-2.1_1
libtrampoline.so.1 ffcall-2.1_1

View file

@ -1,15 +0,0 @@
Description: fixes issue with aarch64
Author: Debian packagers
Origin: libffi_3.2.1-9.debian.tar.xz
--- src/aarch64/ffi.c
+++ src/aarch64/ffi.c
@@ -731,7 +731,7 @@
state.ngrn = N_X_ARG_REG;
memcpy (allocate_to_stack (&state, stack, ty->alignment,
- ty->size), ecif->avalue + i, ty->size);
+ ty->size), ecif->avalue[i], ty->size);
}
break;

View file

@ -1,11 +0,0 @@
--- testsuite/lib/libffi.old 2014-11-08 06:47:24.000000000 -0600
+++ testsuite/lib/libffi.exp 2019-07-22 13:29:32.086840387 -0500
@@ -281,7 +281,7 @@
global using_gcc
if { [string match $using_gcc "yes"] } {
set common "-W -Wall -Wno-psabi"
- set optimizations { "-O0" "-O2" "-O3" "-Os" "-O2 -fomit-frame-pointer" }
+ set optimizations { "-O0" "-O2 -fno-inline-small-functions" "-O3 -fno-inline-small-functions" "-Os" "-O2 -fno-inline-small-functions -fomit-frame-pointer" }
} else {
# Assume we are using the vendor compiler.
set common ""

View file

@ -1,20 +0,0 @@
--- include/Makefile.in.orig 2010-05-11 19:03:20.645903854 +0200
+++ include/Makefile.in 2010-05-11 19:04:02.930565181 +0200
@@ -44,7 +44,7 @@ am__aclocal_m4_deps = $(top_srcdir)/acin
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/fficonfig.h
+CONFIG_HEADER = $(builddir)/fficonfig.h
CONFIG_CLEAN_FILES = ffi.h ffitarget.h
CONFIG_CLEAN_VPATH_FILES =
SOURCES =
@@ -203,7 +203,7 @@ top_srcdir = @top_srcdir@
AUTOMAKE_OPTIONS = foreign
DISTCLEANFILES = ffitarget.h
EXTRA_DIST = ffi.h.in ffi_common.h
-includesdir = $(libdir)/@PACKAGE_NAME@-@PACKAGE_VERSION@/include
+includesdir = @prefix@/include
nodist_includes_HEADERS = ffi.h ffitarget.h
all: all-am

View file

@ -1,13 +0,0 @@
http://bugs.alpinelinux.org/issues/4275
--- src/closures.c.orig
+++ src/closures.c
@@ -34,7 +34,7 @@
#include <ffi_common.h>
#if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
-# if __gnu_linux__ && !defined(__ANDROID__)
+# if __linux__ && !defined(__ANDROID__)
/* This macro indicates it may be forbidden to map anonymous memory
with both write and execute permission. Code compiled when this
option is defined will attempt to map such pages once, but if it

View file

@ -1,33 +0,0 @@
Description: fixes issue with aarch64
Author: Anthony Green <green@moxielogic.com>
Origin: libffi_3.2.1-9.debian.tar.xz
https://github.com/libffi/libffi/pull/401
--- src/mips/ffi.c
+++ src/mips/ffi.c
@@ -715,7 +715,11 @@ ffi_prep_closure_loc (ffi_closure *closure,
/* lui $12,high(codeloc) */
tramp[2] = 0x3c0c0000 | ((unsigned)codeloc >> 16);
/* jr $25 */
+#if !defined(__mips_isa_rev) || (__mips_isa_rev<6)
tramp[3] = 0x03200008;
+#else
+ tramp[3] = 0x03200009;
+#endif
/* ori $12,low(codeloc) */
tramp[4] = 0x358c0000 | ((unsigned)codeloc & 0xffff);
#else
@@ -743,7 +747,11 @@ ffi_prep_closure_loc (ffi_closure *closure,
/* ori $25,low(fn) */
tramp[10] = 0x37390000 | ((unsigned long)fn & 0xffff);
/* jr $25 */
+#if !defined(__mips_isa_rev) || (__mips_isa_rev<6)
tramp[11] = 0x03200008;
+#else
+ tramp[11] = 0x03200009;
+#endif
/* ori $12,low(codeloc) */
tramp[12] = 0x358c0000 | ((unsigned long)codeloc & 0xffff);

View file

@ -1,83 +0,0 @@
Taken from the Optware fork Optware-ng:
alllexx88 libffi: mips: fix build for soft-float
https://raw.githubusercontent.com/Optware/Optware-ng/master/sources/libffi/mips.softfloat.patch
--- src/mips/o32.S.orig 2014-11-08 14:47:24.000000000 +0200
+++ src/mips/o32.S 2015-04-16 12:03:11.302116104 +0300
@@ -82,13 +82,16 @@
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 @@
# 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 @@
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 @@
li $13, 1 # FFI_O32
bne $16, $13, 1f # Skip fp save if FFI_O32_SOFT_FLOAT
+#ifndef __mips_soft_float
# Store all possible float/double registers.
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 @@
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 @@
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)

View file

@ -1,17 +0,0 @@
Description: fixes issue with aarch64
Author: Debian packagers
Origin: libffi_3.2.1-9.debian.tar.xz
--- src/mips/n32.S
+++ src/mips/n32.S
@@ -47,7 +47,9 @@
#ifdef __GNUC__
.abicalls
#endif
+#if !defined(__mips_isa_rev) || (__mips_isa_rev<6)
.set mips4
+#endif
.text
.align 2
.globl ffi_call_N32

View file

@ -1,79 +0,0 @@
From bf6946074b948540e4147154041ea244bafb38c4 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sat, 13 Oct 2018 01:14:03 +0000
Subject: [PATCH] powerpc: Fix alignment after float structs
---
src/powerpc/ffi_linux64.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/src/powerpc/ffi_linux64.c b/src/powerpc/ffi_linux64.c
index 2534ecf3..197a270d 100644
--- src/powerpc/ffi_linux64.c
+++ src/powerpc/ffi_linux64.c
@@ -580,11 +580,9 @@ ffi_prep_args64 (extended_cif *ecif, unsigned long *const stack)
fparg_count++;
}
while (--elnum != 0);
- if ((next_arg.p & 3) != 0)
- {
- if (++next_arg.f == gpr_end.f)
- next_arg.f = rest.f;
- }
+ if ((next_arg.p & 7) != 0)
+ if (++next_arg.f == gpr_end.f)
+ next_arg.f = rest.f;
}
else
do
From 49a1bbadfa0b5ad5c373271c8ba7a5d8911a85d9 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sat, 13 Oct 2018 01:14:20 +0000
Subject: [PATCH] powerpc: Don't pad rvalues copied from FP regs
---
src/powerpc/ffi.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/powerpc/ffi.c b/src/powerpc/ffi.c
index 7eb543e4..94a11700 100644
--- src/powerpc/ffi.c
+++ src/powerpc/ffi.c
@@ -121,8 +121,9 @@ ffi_call_int (ffi_cif *cif,
# endif
/* The SYSV ABI returns a structure of up to 8 bytes in size
left-padded in r3/r4, and the ELFv2 ABI similarly returns a
- structure of up to 8 bytes in size left-padded in r3. */
- if (rsize <= 8)
+ structure of up to 8 bytes in size left-padded in r3. But
+ note that a structure of a single float is not paddded. */
+ if (rsize <= 8 && (cif->flags & FLAG_RETURNS_FP) == 0)
memcpy (rvalue, (char *) smst_buffer + 8 - rsize, rsize);
else
#endif
From b0c598d5d6b653a3ea87a2d04afb6b35441e5f7e Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sat, 13 Oct 2018 01:14:58 +0000
Subject: [PATCH] powerpc: Add missing check in struct alignment
---
src/powerpc/ffi_linux64.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/powerpc/ffi_linux64.c b/src/powerpc/ffi_linux64.c
index 197a270d..d755c712 100644
--- src/powerpc/ffi_linux64.c
+++ src/powerpc/ffi_linux64.c
@@ -536,7 +536,11 @@ ffi_prep_args64 (extended_cif *ecif, unsigned long *const stack)
if (align > 16)
align = 16;
if (align > 1)
- next_arg.p = ALIGN (next_arg.p, align);
+ {
+ next_arg.p = ALIGN (next_arg.p, align);
+ if (next_arg.ul == gpr_end.ul)
+ next_arg.ul = rest.ul;
+ }
}
#if _CALL_ELF == 2
elt = discover_homogeneous_aggregate (*ptr, &elnum);

View file

@ -1,12 +0,0 @@
--- configure
+++ configure
@@ -17235,6 +17235,9 @@ case "$host" in
TARGET=OR1K; TARGETDIR=or1k
;;
+ powerpc*-*-linux*-musl*)
+ TARGET=POWERPC; TARGETDIR=powerpc
+ ;;
powerpc*-*-linux* | powerpc-*-sysv*)
TARGET=POWERPC; TARGETDIR=powerpc
HAVE_LONG_DOUBLE_VARIANT=1

View file

@ -1,7 +1,7 @@
# Template file for 'libffi'
pkgname=libffi
version=3.2.1
revision=6
version=3.3
revision=1
build_style=gnu-configure
configure_args="--includedir=/usr/include --with-pic"
checkdepends="dejagnu"
@ -10,7 +10,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
license="MIT"
homepage="http://sourceware.org/libffi"
distfiles="ftp://sourceware.org/pub/$pkgname/$pkgname-$version.tar.gz"
checksum=d06ebb8e1d9a22d19e38d63fdb83954253f39bedc5d46232a05645685722ca37
checksum=72fba7922703ddfa7a028d513ac15a85c8d54c8d67f55fa5a4802885dc652056
pre_install() {
vmkdir usr/lib