aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpsykose <alice@ayaya.dev>2022-09-21 07:33:24 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2022-09-21 07:45:25 +0000
commit7b583a4c8d928fff88d558a1be5f0004802d551d (patch)
treeba2cea12cfcb2abbe87f649ed886b4792d1c29b3
parentaef500c6ee857899e69d896c32df6cdc12222c44 (diff)
downloadaports-7b583a4c8d928fff88d558a1be5f0004802d551d.tar.gz
aports-7b583a4c8d928fff88d558a1be5f0004802d551d.tar.bz2
aports-7b583a4c8d928fff88d558a1be5f0004802d551d.tar.xz
main/libffi: upgrade to 3.4.3
-rw-r--r--main/libffi/APKBUILD11
-rw-r--r--main/libffi/pax-dlmmap.patch120
2 files changed, 4 insertions, 127 deletions
diff --git a/main/libffi/APKBUILD b/main/libffi/APKBUILD
index 227a5568f9..63194f68e2 100644
--- a/main/libffi/APKBUILD
+++ b/main/libffi/APKBUILD
@@ -1,7 +1,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=libffi
-pkgver=3.4.2
-pkgrel=1
+pkgver=3.4.3
+pkgrel=0
pkgdesc="portable, high level programming interface to various calling conventions."
url="https://sourceware.org/libffi/"
arch="all"
@@ -12,9 +12,7 @@ makedepends_build="texinfo automake autoconf libtool"
makedepends_host="linux-headers"
checkdepends="dejagnu"
subpackages="$pkgname-dbg $pkgname-dev $pkgname-doc"
-source="$pkgname-$pkgver.tar.gz::https://github.com/libffi/libffi/archive/refs/tags/v$pkgver.tar.gz
- pax-dlmmap.patch
- "
+source="$pkgname-$pkgver.tar.gz::https://github.com/libffi/libffi/archive/refs/tags/v$pkgver.tar.gz"
[ "$CARCH" = "ppc64le" ] && options="$options !check" # test fails
@@ -44,6 +42,5 @@ package() {
}
sha512sums="
-d399319efcca375fe901b05722e25eca31d11a4261c6a5d5079480bbc552d4e4b42de2026912689d3b2f886ebb3c8bebbea47102e38a2f6acbc526b8d5bba388 libffi-3.4.2.tar.gz
-72486b389db16055ae4d7d33ba0cb05840537e28fe7a86aa89e2cb922592125d99c18c26c5df7ffde6282742e79f2b9126353e58b58f091f0486589e14dd6474 pax-dlmmap.patch
+fb4278388046a20c8de737e3768df3ce1c7f66177f83c90ba9a1c0cd85587915ed29732b72d6dde7ed40225f378af7ae960dbaecf3e9dc36376974f92b264f2a libffi-3.4.3.tar.gz
"
diff --git a/main/libffi/pax-dlmmap.patch b/main/libffi/pax-dlmmap.patch
deleted file mode 100644
index ec4150410d..0000000000
--- a/main/libffi/pax-dlmmap.patch
+++ /dev/null
@@ -1,120 +0,0 @@
-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(-)
-
-diff --git a/src/closures.c b/src/closures.c
-index 2e0ffb45..04d6e27f 100644
---- a/src/closures.c
-+++ b/src/closures.c
-@@ -769,16 +769,11 @@ dlmmap (void *start, size_t length, int prot,
- 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
-
-From 7aad5f895e2dfdb79d2ef67e1b231d21063e6511 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:50:54 +0200
-Subject: [PATCH 2/2] ignore PaX EMUTRAMP flag; instead check for MPROTECT
-
-- code using ffi_closure_alloc doesn't necessarily generate gcc compatible trampolines; only those are allowed by PaX
-- if MPROTECT is enabled use the same workaround as is used for SELinux (double mmap())
----
- src/closures.c | 29 +++++++++++++----------------
- 1 file changed, 13 insertions(+), 16 deletions(-)
-
-diff --git a/src/closures.c b/src/closures.c
-index 04d6e27f..babecc1a 100644
---- a/src/closures.c
-+++ b/src/closures.c
-@@ -401,14 +401,15 @@ selinux_enabled_check (void)
-
- #endif /* !FFI_MMAP_EXEC_SELINUX */
-
--/* On PaX enable kernels that have MPROTECT enable we can't use PROT_EXEC. */
-+/* On PaX enable kernels that have MPROTECT enabled we can't use PROT_EXEC. */
- #ifdef FFI_MMAP_EXEC_EMUTRAMP_PAX
- #include <stdlib.h>
-
--static int emutramp_enabled = -1;
-+/* -1: not read yet; 0: no PaX or MPROTECT disabled; 1: MPROTECT enabled. */
-+static int mprotect_enabled = -1;
-
- static int
--emutramp_enabled_check (void)
-+mprotect_enabled_check (void)
- {
- char *buf = NULL;
- size_t len = 0;
-@@ -422,9 +423,7 @@ emutramp_enabled_check (void)
- while (getline (&buf, &len, f) != -1)
- if (!strncmp (buf, "PaX:", 4))
- {
-- char emutramp;
-- if (sscanf (buf, "%*s %*c%c", &emutramp) == 1)
-- ret = (emutramp == 'E');
-+ ret = (NULL != strchr (buf + 4, 'M'));
- break;
- }
- free (buf);
-@@ -432,8 +431,9 @@ emutramp_enabled_check (void)
- return ret;
- }
-
--#define is_emutramp_enabled() (emutramp_enabled >= 0 ? emutramp_enabled \
-- : (emutramp_enabled = emutramp_enabled_check ()))
-+#define is_mprotect_enabled() (mprotect_enabled >= 0 ? mprotect_enabled \
-+ : (mprotect_enabled = mprotect_enabled_check ()))
-+
- #endif /* FFI_MMAP_EXEC_EMUTRAMP_PAX */
-
- #elif defined (__CYGWIN__) || defined(__INTERIX)
-@@ -446,7 +446,7 @@ emutramp_enabled_check (void)
- #endif /* !defined(X86_WIN32) && !defined(X86_WIN64) */
-
- #ifndef FFI_MMAP_EXEC_EMUTRAMP_PAX
--#define is_emutramp_enabled() 0
-+#define is_mprotect_enabled() 0
- #endif /* FFI_MMAP_EXEC_EMUTRAMP_PAX */
-
- /* Declare all functions defined in dlmalloc.c as static. */
-@@ -750,13 +750,10 @@ dlmmap (void *start, size_t length, int prot,
- && flags == (MAP_PRIVATE | MAP_ANONYMOUS)
- && fd == -1 && offset == 0);
-
-- if (execfd == -1 && is_emutramp_enabled ())
-- {
-- ptr = mmap (start, length, prot & ~PROT_EXEC, flags, fd, offset);
-- return ptr;
-- }
--
-- if (execfd == -1 && !is_selinux_enabled ())
-+ /* -1 != execfd hints that we already decided to use dlmmap_locked
-+ last time. If PaX MPROTECT or SELinux is active fallback to
-+ dlmmap_locked. */
-+ if (execfd == -1 && !is_mprotect_enabled () && !is_selinux_enabled ())
- {
- ptr = mmap (start, length, prot | PROT_EXEC, flags, fd, offset);
-