summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--system/libffi/APKBUILD14
-rw-r--r--system/libffi/powerpc-fixes.patch79
2 files changed, 84 insertions, 9 deletions
diff --git a/system/libffi/APKBUILD b/system/libffi/APKBUILD
index b37b6226c..1913e0dbc 100644
--- a/system/libffi/APKBUILD
+++ b/system/libffi/APKBUILD
@@ -1,27 +1,24 @@
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=libffi
pkgver=3.2.1
-pkgrel=4
+pkgrel=5
pkgdesc="A portable, high level programming interface to various calling conventions."
url="https://sourceware.org/libffi"
arch="all"
license="MIT"
-depends=
+depends=""
makedepends="texinfo"
checkdepends="dejagnu"
-install=
subpackages="$pkgname-dev $pkgname-doc"
source="https://sourceware.org/pub/$pkgname/$pkgname-$pkgver.tar.gz
disable-ppc-ldvariant.patch
fix-testsuite-longdouble.patch
gnu-linux-define.patch
pax-dlmmap.patch
+ powerpc-fixes.patch
"
-builddir="$srcdir"/$pkgname-$pkgver
-
build () {
- cd "$builddir"
./configure \
--build=$CBUILD \
--host=$CHOST \
@@ -31,12 +28,10 @@ build () {
}
check() {
- cd "$builddir"
make check
}
package() {
- cd "$builddir"
make DESTDIR=""$pkgdir"" install
install -m755 -d ""$pkgdir"/usr/share/licenses/$pkgname"
install -m644 LICENSE ""$pkgdir"/usr/share/licenses/$pkgname/"
@@ -54,4 +49,5 @@ sha512sums="980ca30a8d76f963fca722432b1fe5af77d7a4e4d2eac5144fbc5374d4c596609a29
cfd3b11a0e168fd74da0a6219c95610df3466b0769966351b2a5076c93a75996daf9aed41644bebb80e28793bbe18d62272385afd7813c472104cc6c93dcba41 disable-ppc-ldvariant.patch
de92cb20ded7bfefc3e469ba2ac2d9d869d67dc172ec7e2d1222f8530944eb6d5016ae913baf01ac2e26bee1624c682ae9dd08d0e45d5532d59298dbe7e417eb fix-testsuite-longdouble.patch
264af568ae5388d50f647f891a406945c73cc358692266f65ad341787c0bf5f6bf31203b86c39fa1b338101c1a6d2f4fec60f95a90d379951ff5153f8f9e178f gnu-linux-define.patch
-72486b389db16055ae4d7d33ba0cb05840537e28fe7a86aa89e2cb922592125d99c18c26c5df7ffde6282742e79f2b9126353e58b58f091f0486589e14dd6474 pax-dlmmap.patch"
+72486b389db16055ae4d7d33ba0cb05840537e28fe7a86aa89e2cb922592125d99c18c26c5df7ffde6282742e79f2b9126353e58b58f091f0486589e14dd6474 pax-dlmmap.patch
+bb3eb51a196aac2849fa0d0214e46f1428d55c8ed4375e5f8cf7fc9076927db935f97ac4d6e61a101897ac6ddc137a0a61e210b8d91888e938c6af122700e935 powerpc-fixes.patch"
diff --git a/system/libffi/powerpc-fixes.patch b/system/libffi/powerpc-fixes.patch
new file mode 100644
index 000000000..e62ae32d1
--- /dev/null
+++ b/system/libffi/powerpc-fixes.patch
@@ -0,0 +1,79 @@
+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
+--- a/src/powerpc/ffi_linux64.c
++++ b/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
+--- a/src/powerpc/ffi.c
++++ b/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
+--- a/src/powerpc/ffi_linux64.c
++++ b/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);