summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2019-09-19 08:29:10 +0100
committerSergei Trofimovich <slyfox@gentoo.org>2019-09-19 08:29:50 +0100
commit8cd14f3d80746f350e6ffd103cb1f4629c625f2f (patch)
tree43d688b0ff284d63c5e8865f075ee47fb565902b /dev-libs/libffi/files
parentnet-mail/notmuch: drop gpgme hack, it's a dep problem (diff)
downloadgentoo-8cd14f3d80746f350e6ffd103cb1f4629c625f2f.tar.gz
gentoo-8cd14f3d80746f350e6ffd103cb1f4629c625f2f.tar.bz2
gentoo-8cd14f3d80746f350e6ffd103cb1f4629c625f2f.zip
dev-libs/libffi: backport emutramp fix to 3.2.1, bug #694916
Reported-by: spotlight@joscomputing.space Bug: https://bugs.gentoo.org/694916 Package-Manager: Portage-2.3.76, Repoman-2.3.17 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Diffstat (limited to 'dev-libs/libffi/files')
-rw-r--r--dev-libs/libffi/files/libffi-3.2.1-musl-emutramp.patch31
1 files changed, 31 insertions, 0 deletions
diff --git a/dev-libs/libffi/files/libffi-3.2.1-musl-emutramp.patch b/dev-libs/libffi/files/libffi-3.2.1-musl-emutramp.patch
new file mode 100644
index 000000000000..7c011d2b6d07
--- /dev/null
+++ b/dev-libs/libffi/files/libffi-3.2.1-musl-emutramp.patch
@@ -0,0 +1,31 @@
+https://github.com/libffi/libffi/commit/e169ba2b83c780058fe626856cfdb5903a85cb97.patch
+https://bugs.gentoo.org/694916
+
+From e169ba2b83c780058fe626856cfdb5903a85cb97 Mon Sep 17 00:00:00 2001
+From: Kylie McClain <somasis@exherbo.org>
+Date: Fri, 29 Apr 2016 21:04:07 -0400
+Subject: [PATCH] Fix usage on musl libc
+
+A gcc compiled on musl does not define __gnu_linux__, it defines __linux__.
+Only on glibc does __gnu_linux__ get defined, but both define __linux__, so
+we should check for that instead.
+
+With this patch, libffi works perfectly, and passes its testsuite entirely
+on musl libc systems.
+---
+ src/closures.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/closures.c b/src/closures.c
+index 3dec0e31..05849e06 100644
+--- a/src/closures.c
++++ b/src/closures.c
+@@ -35,7 +35,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