libffi: Fix allocation of non-executable memory for functions.

Fixes #5109.
This commit is contained in:
Michael Lotz
2020-06-12 13:21:02 +00:00
parent d6ebfca40c
commit 34f92fca43
2 changed files with 27 additions and 1 deletions

View File

@@ -7,7 +7,7 @@ plugins."
HOMEPAGE="http://sourceware.org/libffi"
COPYRIGHT="1996-2013 Anthony Green, Red Hat, Inc and others."
LICENSE="MIT"
REVISION="5"
REVISION="6"
SOURCE_URI="ftp://sourceware.org/pub/libffi/libffi-$portVersion.tar.gz"
CHECKSUM_SHA256="d06ebb8e1d9a22d19e38d63fdb83954253f39bedc5d46232a05645685722ca37"
PATCHES="libffi-$portVersion.patchset"

View File

@@ -20,3 +20,29 @@ index 650ca69..02a1913 100644
--
1.8.3.4
From 46ac95d3636b845de417cc97c426b98c89d9ea54 Mon Sep 17 00:00:00 2001
From: Michael Lotz <mmlr@mlotz.ch>
Date: Fri, 12 Jun 2020 13:14:57 +0000
Subject: Mark Haiku as needing PROT_WRITE | PROTO_EXEC for allocations.
It uses the heap as a fallback, but its areas are marked non-executable
in Haiku so function calls into there will segfault with a permission
denied error.
diff --git a/configure b/configure
index c6da467..d856e1a 100755
--- a/configure
+++ b/configure
@@ -18530,7 +18530,7 @@ case "$target" in
$as_echo "#define FFI_EXEC_TRAMPOLINE_TABLE 1" >>confdefs.h
;;
- *-apple-darwin1* | *-*-freebsd* | *-*-kfreebsd* | *-*-openbsd* | *-pc-solaris*)
+ *-apple-darwin1* | *-*-freebsd* | *-*-kfreebsd* | *-*-openbsd* | *-pc-solaris* | *-*-haiku*)
$as_echo "#define FFI_MMAP_EXEC_WRIT 1" >>confdefs.h
--
2.26.0