libffi: import (some) Debian patches
The Debian team has some patches which we were missing. This set does not address the ppc64* failing tests, though. I did not include patches for alpha or riscv becase we do not (yet) support these target architectures. Signed-off-by: Jürgen Buchmüller <pullmoll@t-online.de>
This commit is contained in:
parent
182bc30127
commit
a369f4e48d
5 changed files with 104 additions and 1 deletions
15
srcpkgs/libffi/patches/fix-aarch64.patch
Normal file
15
srcpkgs/libffi/patches/fix-aarch64.patch
Normal file
|
@ -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;
|
||||
|
33
srcpkgs/libffi/patches/libffi-pr401.patch
Normal file
33
srcpkgs/libffi/patches/libffi-pr401.patch
Normal file
|
@ -0,0 +1,33 @@
|
|||
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);
|
||||
|
||||
|
38
srcpkgs/libffi/patches/libffi-race-condition.patch
Normal file
38
srcpkgs/libffi/patches/libffi-race-condition.patch
Normal file
|
@ -0,0 +1,38 @@
|
|||
Description: fixes race condition
|
||||
Author: Stefan Bühler <buehler@cert.uni-stuttgart.de>
|
||||
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?= <buehler@cert.uni-stuttgart.de>
|
||||
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
|
||||
|
17
srcpkgs/libffi/patches/mipsen-r6.diff
Normal file
17
srcpkgs/libffi/patches/mipsen-r6.diff
Normal file
|
@ -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
|
||||
|
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue