diff --git a/srcpkgs/libffi/patches/fix-aarch64.patch b/srcpkgs/libffi/patches/fix-aarch64.patch new file mode 100644 index 00000000000..a0668a4a0f9 --- /dev/null +++ b/srcpkgs/libffi/patches/fix-aarch64.patch @@ -0,0 +1,15 @@ +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; + diff --git a/srcpkgs/libffi/patches/libffi-pr401.patch b/srcpkgs/libffi/patches/libffi-pr401.patch new file mode 100644 index 00000000000..18baa2ca39c --- /dev/null +++ b/srcpkgs/libffi/patches/libffi-pr401.patch @@ -0,0 +1,33 @@ +Description: fixes issue with aarch64 +Author: Anthony Green +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); + + diff --git a/srcpkgs/libffi/patches/libffi-race-condition.patch b/srcpkgs/libffi/patches/libffi-race-condition.patch new file mode 100644 index 00000000000..4d401ebcffa --- /dev/null +++ b/srcpkgs/libffi/patches/libffi-race-condition.patch @@ -0,0 +1,38 @@ +Description: fixes race condition +Author: Stefan Bühler +Origin: libffi_3.2.1-9.debian.tar.xz + +From 48d2e46528fb6e621d95a7fa194069fd136b712d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20B=C3=BChler?= +Date: Wed, 7 Sep 2016 15:49:48 +0200 +Subject: [PATCH 1/2] dlmmap_locked always needs locking as it always modifies + execsize + +--- + src/closures.c | 13 ++++--------- + 1 file changed, 4 insertions(+), 9 deletions(-) + +--- src/closures.c ++++ src/closures.c +@@ -568,16 +568,11 @@ + MREMAP_DUP and prot at this point. */ + } + +- if (execsize == 0 || execfd == -1) +- { +- pthread_mutex_lock (&open_temp_exec_file_mutex); +- ptr = dlmmap_locked (start, length, prot, flags, offset); +- pthread_mutex_unlock (&open_temp_exec_file_mutex); ++ pthread_mutex_lock (&open_temp_exec_file_mutex); ++ ptr = dlmmap_locked (start, length, prot, flags, offset); ++ pthread_mutex_unlock (&open_temp_exec_file_mutex); + +- return ptr; +- } +- +- return dlmmap_locked (start, length, prot, flags, offset); ++ return ptr; + } + + /* Release memory at the given address, as well as the corresponding + diff --git a/srcpkgs/libffi/patches/mipsen-r6.diff b/srcpkgs/libffi/patches/mipsen-r6.diff new file mode 100644 index 00000000000..3dc4620bad0 --- /dev/null +++ b/srcpkgs/libffi/patches/mipsen-r6.diff @@ -0,0 +1,17 @@ +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 + diff --git a/srcpkgs/libffi/template b/srcpkgs/libffi/template index 24ffe53b573..9b3e04e8f42 100644 --- a/srcpkgs/libffi/template +++ b/srcpkgs/libffi/template @@ -1,7 +1,7 @@ # Template file for 'libffi' pkgname=libffi version=3.2.1 -revision=5 +revision=6 build_style=gnu-configure configure_args="--includedir=/usr/include --with-pic" checkdepends="dejagnu"