public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-libs/libffi/files/, dev-libs/libffi/
@ 2017-06-21 21:51 Matthias Maier
  0 siblings, 0 replies; 10+ messages in thread
From: Matthias Maier @ 2017-06-21 21:51 UTC (permalink / raw
  To: gentoo-commits

commit:     6acaa7787fa53d19b19c0f193b24969a5641a315
Author:     Matthias Maier <tamiko <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 21 21:42:23 2017 +0000
Commit:     Matthias Maier <tamiko <AT> gentoo <DOT> org>
CommitDate: Wed Jun 21 21:51:01 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6acaa778

dev-libs/libffi: drop old versions, bug #622226

Package-Manager: Portage-2.3.6, Repoman-2.3.2

 dev-libs/libffi/Manifest                           |  3 -
 .../files/libffi-3.0.13-emutramp_pax_proc.patch    | 37 -------------
 dev-libs/libffi/files/libffi-3.1-execstack.patch   | 12 ----
 .../libffi/files/libffi-3.1-typing_error.patch     | 14 -----
 dev-libs/libffi/libffi-3.0.13-r1.ebuild            | 64 ----------------------
 dev-libs/libffi/libffi-3.1-r3.ebuild               | 62 ---------------------
 dev-libs/libffi/libffi-3.2.ebuild                  | 59 --------------------
 7 files changed, 251 deletions(-)

diff --git a/dev-libs/libffi/Manifest b/dev-libs/libffi/Manifest
index 98cc0cd0b06..e9774e1aba6 100644
--- a/dev-libs/libffi/Manifest
+++ b/dev-libs/libffi/Manifest
@@ -1,4 +1 @@
-DIST libffi-3.0.13.tar.gz 845747 SHA256 1dddde1400c3bcb7749d398071af88c3e4754058d2d4c0b3696c2f82dc5cf11c SHA512 fc47f5d25197c631754efe05a349edb556d072807ecef19b41f17c1a8f39c95221be64926fbd05b1f8439181df1ddff8fc01462ce3a26005b75159ddc27e6f6a WHIRLPOOL d5b14d48a7b35f7349ec938d0deac62db7022ac4d611ab13bc7a6a2766a47e210fc1663fc8c6d7ee48d421c06b66f558010829ac2c215620c76d0bf7650e1308
-DIST libffi-3.1.tar.gz 937214 SHA256 97feeeadca5e21870fa4433bc953d1b3af3f698d5df8a428f68b73cd60aef6eb SHA512 8994973d75facf5ad928c270e17b1a56e24d1543af75b93731a0048e747df27e4190a736b6dc2dca7d43de1d7e88891220304802c10fcccdcebee9c9ffd3d1b9 WHIRLPOOL 19c08cffd39c998fcd762b1e3767b4fd86915427226833411302bebd2d5bcf93d515e6df4a4cab11327595d3966e46442e457fbe09ae986b58bdfb2bb6adb913
 DIST libffi-3.2.1.tar.gz 940837 SHA256 d06ebb8e1d9a22d19e38d63fdb83954253f39bedc5d46232a05645685722ca37 SHA512 980ca30a8d76f963fca722432b1fe5af77d7a4e4d2eac5144fbc5374d4c596609a293440573f4294207e1bdd9fda80ad1e1cafb2ffb543df5a275bc3bd546483 WHIRLPOOL b9d3c86e347029fa9f03fd3813405cc731099812ad6186bd4d2ea646354383803c90912b20e1804a6b7fc12719403b3c0c3b800bdbcab564a2c93fcb4fd722ad
-DIST libffi-3.2.tar.gz 940691 SHA256 6b2680fbf6ae9c2381d381248705857de22e05bae191889298f8e6bfb2ded4ef SHA512 fed5f6eec86144608966857f54bd69a5faa43427f27bc9178ebe2c7a1cecf925c20dbd6df07a207ae469842874efcf5b99fb7e09db59cbd92ebfc0a7e1bb62b7 WHIRLPOOL db7491bc5914eb6691aa366677c63af51979453330373251b1043b53163d1b56dbed65ba23c9f5047257e476e0d216045a06faa346790987047854ae1d04361d

diff --git a/dev-libs/libffi/files/libffi-3.0.13-emutramp_pax_proc.patch b/dev-libs/libffi/files/libffi-3.0.13-emutramp_pax_proc.patch
deleted file mode 100644
index c27bd9bf889..00000000000
--- a/dev-libs/libffi/files/libffi-3.0.13-emutramp_pax_proc.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-2013-05-22  Magnus Granberg  <zorry@gentoo.org>
-
-	#457194
-	* src/closuer.c (emutramp_enabled_check): Check with /proc.
-
---- a/src/closures.c	2013-03-17 23:27:11.000000000 +0100
-+++ b/src/closures.c	2013-04-29 23:26:02.279022022 +0200
-@@ -181,10 +181,26 @@ static int emutramp_enabled = -1;
- static int
- emutramp_enabled_check (void)
- {
--  if (getenv ("FFI_DISABLE_EMUTRAMP") == NULL)
--    return 1;
--  else
-+  char *buf = NULL;
-+  size_t len = 0;
-+  FILE *f;
-+  int ret;
-+  f = fopen ("/proc/self/status", "r");
-+  if (f == NULL)
-     return 0;
-+  ret = 0;
-+
-+  while (getline (&buf, &len, f) != -1)
-+    if (!strncmp (buf, "PaX:", 4))
-+      {
-+        char emutramp;
-+        if (sscanf (buf, "%*s %*c%c", &emutramp) == 1)
-+          ret = (emutramp == 'E');
-+        break;
-+      }
-+  free (buf);
-+  fclose (f);
-+  return ret;
- }
- 
- #define is_emutramp_enabled() (emutramp_enabled >= 0 ? emutramp_enabled \

diff --git a/dev-libs/libffi/files/libffi-3.1-execstack.patch b/dev-libs/libffi/files/libffi-3.1-execstack.patch
deleted file mode 100644
index b9943aa0a13..00000000000
--- a/dev-libs/libffi/files/libffi-3.1-execstack.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-https://bugs.gentoo.org/511634
-https://sourceware.org/ml/libffi-discuss/2014/msg00058.html
-
---- src/x86/win32.S
-+++ src/x86/win32.S
-@@ -1304,3 +1304,6 @@
- 
- #endif /* !_MSC_VER */
- 
-+#if defined __ELF__ && defined __linux__
-+	.section        .note.GNU-stack,"",@progbits
-+#endif

diff --git a/dev-libs/libffi/files/libffi-3.1-typing_error.patch b/dev-libs/libffi/files/libffi-3.1-typing_error.patch
deleted file mode 100644
index 0e917020e91..00000000000
--- a/dev-libs/libffi/files/libffi-3.1-typing_error.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-https://bugs.gentoo.org/511752
-https://sourceware.org/ml/libffi-discuss/2014/msg00059.html
-
---- include/ffi.h.in
-+++ include/ffi.h.in
-@@ -221,7 +221,7 @@ typedef struct {
- #endif
- } ffi_cif;
- 
--#if HAVE_LONG_DOUBLE_VARIANT
-+#if @HAVE_LONG_DOUBLE_VARIANT@
- /* Used to adjust size/alignment of ffi types.  */
- void ffi_prep_types (ffi_abi abi);
- # endif

diff --git a/dev-libs/libffi/libffi-3.0.13-r1.ebuild b/dev-libs/libffi/libffi-3.0.13-r1.ebuild
deleted file mode 100644
index aed09f2e6a8..00000000000
--- a/dev-libs/libffi/libffi-3.0.13-r1.ebuild
+++ /dev/null
@@ -1,64 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=5
-inherit eutils libtool multilib toolchain-funcs multilib-minimal
-
-DESCRIPTION="a portable, high level programming interface to various calling conventions"
-HOMEPAGE="https://sourceware.org/libffi/"
-SRC_URI="ftp://sourceware.org/pub/${PN}/${P}.tar.gz"
-
-LICENSE="MIT"
-SLOT="0"
-KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-IUSE="debug pax_kernel static-libs test"
-
-RDEPEND="abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20130224-r1
-		!app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )"
-DEPEND="test? ( dev-util/dejagnu )"
-
-DOCS="ChangeLog* README"
-
-ECONF_SOURCE=${S}
-
-pkg_setup() {
-	# Check for orphaned libffi, see https://bugs.gentoo.org/354903 for example
-	if [[ ${ROOT} == "/" && ${EPREFIX} == "" ]] && ! has_version ${CATEGORY}/${PN}; then
-		local base="${T}"/conftest
-		echo 'int main() { }' > "${base}".c
-		$(tc-getCC) -o "${base}" "${base}".c -lffi >&/dev/null
-		if [ $? -eq 0 ]; then
-			eerror "The linker reported linking against -lffi to be working while it shouldn't have."
-			eerror "This is wrong and you should find and delete the old copy of libffi before continuing."
-			die "The system is in inconsistent state with unknown libffi installed."
-		fi
-	fi
-}
-
-src_prepare() {
-	sed -i 's:@toolexeclibdir@:$(libdir):g' Makefile.in || die #462814
-	epatch "${FILESDIR}"/${P}-emutramp_pax_proc.patch #457194
-	epatch_user
-	elibtoolize
-}
-
-multilib_src_configure() {
-	use userland_BSD && export HOST="${CHOST}"
-	econf \
-		$(use_enable static-libs static) \
-		$(use_enable pax_kernel pax_emutramp) \
-		$(use_enable debug)
-}
-
-multilib_src_install_all() {
-	prune_libtool_files
-	einstalldocs
-}
-
-pkg_preinst() {
-	preserve_old_lib /usr/$(get_libdir)/${PN}$(get_libname 5)
-}
-
-pkg_postinst() {
-	preserve_old_lib_notify /usr/$(get_libdir)/${PN}$(get_libname 5)
-}

diff --git a/dev-libs/libffi/libffi-3.1-r3.ebuild b/dev-libs/libffi/libffi-3.1-r3.ebuild
deleted file mode 100644
index 2b71c3a3e82..00000000000
--- a/dev-libs/libffi/libffi-3.1-r3.ebuild
+++ /dev/null
@@ -1,62 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=5
-inherit eutils libtool multilib multilib-minimal toolchain-funcs
-
-DESCRIPTION="a portable, high level programming interface to various calling conventions"
-HOMEPAGE="https://sourceware.org/libffi/"
-SRC_URI="ftp://sourceware.org/pub/${PN}/${P}.tar.gz"
-
-LICENSE="MIT"
-SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-IUSE="debug pax_kernel static-libs test"
-
-RDEPEND="abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20130224-r1
-		!app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )"
-DEPEND="test? ( dev-util/dejagnu )"
-
-DOCS="ChangeLog* README"
-
-ECONF_SOURCE=${S}
-
-pkg_setup() {
-	# Check for orphaned libffi, see https://bugs.gentoo.org/354903 for example
-	if [[ ${ROOT} == "/" && ${EPREFIX} == "" ]] && ! has_version ${CATEGORY}/${PN}; then
-		local base="${T}"/conftest
-		echo 'int main() { }' > "${base}".c
-		$(tc-getCC) -o "${base}" "${base}".c -lffi >&/dev/null
-		if [ $? -eq 0 ]; then
-			eerror "The linker reported linking against -lffi to be working while it shouldn't have."
-			eerror "This is wrong and you should find and delete the old copy of libffi before continuing."
-			die "The system is in inconsistent state with unknown libffi installed."
-		fi
-	fi
-}
-
-src_prepare() {
-	epatch \
-		"${FILESDIR}"/${P}-execstack.patch \
-		"${FILESDIR}"/${P}-typing_error.patch
-
-	sed -i -e 's:@toolexeclibdir@:$(libdir):g' Makefile.in || die #462814
-	# https://sourceware.org/ml/libffi-discuss/2014/msg00060.html
-	sed -i -e 's:@toolexeclibdir@:${libdir}:' libffi.pc.in || die #511726
-
-	epatch_user
-	elibtoolize
-}
-
-multilib_src_configure() {
-	use userland_BSD && export HOST="${CHOST}"
-	econf \
-		$(use_enable static-libs static) \
-		$(use_enable pax_kernel pax_emutramp) \
-		$(use_enable debug)
-}
-
-multilib_src_install_all() {
-	prune_libtool_files
-	einstalldocs
-}

diff --git a/dev-libs/libffi/libffi-3.2.ebuild b/dev-libs/libffi/libffi-3.2.ebuild
deleted file mode 100644
index 67c52e76584..00000000000
--- a/dev-libs/libffi/libffi-3.2.ebuild
+++ /dev/null
@@ -1,59 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=5
-inherit eutils libtool multilib multilib-minimal toolchain-funcs
-
-DESCRIPTION="a portable, high level programming interface to various calling conventions"
-HOMEPAGE="https://sourceware.org/libffi/"
-SRC_URI="ftp://sourceware.org/pub/${PN}/${P}.tar.gz"
-
-LICENSE="MIT"
-SLOT="0"
-# A number of people report python ctypes errors #529044
-#KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-IUSE="debug pax_kernel static-libs test"
-
-RDEPEND="abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20130224-r1
-		!app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )"
-DEPEND="test? ( dev-util/dejagnu )"
-
-DOCS="ChangeLog* README"
-
-ECONF_SOURCE=${S}
-
-pkg_setup() {
-	# Check for orphaned libffi, see https://bugs.gentoo.org/354903 for example
-	if [[ ${ROOT} == "/" && ${EPREFIX} == "" ]] && ! has_version ${CATEGORY}/${PN}; then
-		local base="${T}"/conftest
-		echo 'int main() { }' > "${base}".c
-		$(tc-getCC) -o "${base}" "${base}".c -lffi >&/dev/null
-		if [ $? -eq 0 ]; then
-			eerror "The linker reported linking against -lffi to be working while it shouldn't have."
-			eerror "This is wrong and you should find and delete the old copy of libffi before continuing."
-			die "The system is in inconsistent state with unknown libffi installed."
-		fi
-	fi
-}
-
-src_prepare() {
-	sed -i -e 's:@toolexeclibdir@:$(libdir):g' Makefile.in || die #462814
-
-	epatch "${FILESDIR}"/${PN}-3.1-darwin-x32.patch
-
-	epatch_user
-	elibtoolize
-}
-
-multilib_src_configure() {
-	use userland_BSD && export HOST="${CHOST}"
-	econf \
-		$(use_enable static-libs static) \
-		$(use_enable pax_kernel pax_emutramp) \
-		$(use_enable debug)
-}
-
-multilib_src_install_all() {
-	prune_libtool_files
-	einstalldocs
-}


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-libs/libffi/files/, dev-libs/libffi/
@ 2018-12-10 13:12 Fabian Groffen
  0 siblings, 0 replies; 10+ messages in thread
From: Fabian Groffen @ 2018-12-10 13:12 UTC (permalink / raw
  To: gentoo-commits

commit:     d572e261cc14127032df8cf5ed513ca5e1d27590
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 10 13:11:52 2018 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Mon Dec 10 13:11:52 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d572e261

dev-libs/libffi: fix compilation for ppc-macos

Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>
Package-Manager: Portage-2.3.51, Repoman-2.3.11

 .../libffi/files/libffi-3.3_rc0-ppc-macos-go.patch | 79 ++++++++++++++++++++++
 dev-libs/libffi/libffi-3.3_rc0.ebuild              |  1 +
 2 files changed, 80 insertions(+)

diff --git a/dev-libs/libffi/files/libffi-3.3_rc0-ppc-macos-go.patch b/dev-libs/libffi/files/libffi-3.3_rc0-ppc-macos-go.patch
new file mode 100644
index 00000000000..88f9b455765
--- /dev/null
+++ b/dev-libs/libffi/files/libffi-3.3_rc0-ppc-macos-go.patch
@@ -0,0 +1,79 @@
+ffi_darwin: use FFI_GO_CLOSURES guard to avoid unsolvable dependencies
+
+The go calls depend on compilation and link-time signatures and symbols
+which are missing because they aren't build due to FFO_GO_CLOSURES not
+being set.
+
+Signed-off-by: Fabian Groffen <grobian@gentoo.org>
+
+--- a/src/powerpc/ffi_darwin.c	2018-04-02 14:21:51.000000000 +0200
++++ b/src/powerpc/ffi_darwin.c	2018-12-10 13:57:26.000000000 +0100
+@@ -909,8 +909,10 @@
+ extern void ffi_call_AIX(extended_cif *, long, unsigned, unsigned *,
+ 			 void (*fn)(void), void (*fn2)(void));
+ 
++#if FFI_GO_CLOSURES
+ extern void ffi_call_go_AIX(extended_cif *, long, unsigned, unsigned *,
+ 			    void (*fn)(void), void (*fn2)(void), void *closure);
++#endif
+ 
+ extern void ffi_call_DARWIN(extended_cif *, long, unsigned, unsigned *,
+ 			    void (*fn)(void), void (*fn2)(void), ffi_type*);
+@@ -950,6 +952,7 @@
+     }
+ }
+ 
++#if FFI_GO_CLOSURES
+ void
+ ffi_call_go (ffi_cif *cif, void (*fn) (void), void *rvalue, void **avalue,
+ 	     void *closure)
+@@ -981,6 +984,7 @@
+       break;
+     }
+ }
++#endif
+ 
+ static void flush_icache(char *);
+ static void flush_range(char *, int);
+@@ -1110,6 +1114,7 @@
+   return FFI_OK;
+ }
+ 
++#if FFI_GO_CLOSURES
+ ffi_status
+ ffi_prep_go_closure (ffi_go_closure* closure,
+ 		     ffi_cif* cif,
+@@ -1133,6 +1138,7 @@
+     }
+   return FFI_OK;
+ }
++#endif
+ 
+ static void
+ flush_icache(char *addr)
+@@ -1168,9 +1174,11 @@
+ ffi_closure_helper_DARWIN (ffi_closure *, void *,
+ 			   unsigned long *, ffi_dblfl *);
+ 
++#if FFI_GO_CLOSURES
+ ffi_type *
+ ffi_go_closure_helper_DARWIN (ffi_go_closure*, void *,
+ 			      unsigned long *, ffi_dblfl *);
++#endif
+ 
+ /* Basically the trampoline invokes ffi_closure_ASM, and on
+    entry, r11 holds the address of the closure.
+@@ -1430,6 +1438,7 @@
+ 				    closure->user_data, rvalue, pgr, pfr);
+ }
+ 
++#if FFI_GO_CLOSURES
+ ffi_type *
+ ffi_go_closure_helper_DARWIN (ffi_go_closure *closure, void *rvalue,
+ 			      unsigned long *pgr, ffi_dblfl *pfr)
+@@ -1437,4 +1446,5 @@
+   return ffi_closure_helper_common (closure->cif, closure->fun,
+ 				    closure, rvalue, pgr, pfr);
+ }
++#endif
+ 

diff --git a/dev-libs/libffi/libffi-3.3_rc0.ebuild b/dev-libs/libffi/libffi-3.3_rc0.ebuild
index 0a31487e51f..5f56796bb87 100644
--- a/dev-libs/libffi/libffi-3.3_rc0.ebuild
+++ b/dev-libs/libffi/libffi-3.3_rc0.ebuild
@@ -25,6 +25,7 @@ DOCS="ChangeLog* README.md"
 PATCHES=(
 	"${FILESDIR}"/${PN}-3.2.1-o-tmpfile-eacces.patch #529044
 	"${FILESDIR}"/${PN}-3.3_rc0-hppa-no-TEXTREL.patch
+	"${FILESDIR}"/${PN}-3.3_rc0-ppc-macos-go.patch
 )
 
 S=${WORKDIR}/${MY_P}


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-libs/libffi/files/, dev-libs/libffi/
@ 2019-09-19  7:29 Sergei Trofimovich
  0 siblings, 0 replies; 10+ messages in thread
From: Sergei Trofimovich @ 2019-09-19  7:29 UTC (permalink / raw
  To: gentoo-commits

commit:     8cd14f3d80746f350e6ffd103cb1f4629c625f2f
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 19 07:29:10 2019 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Thu Sep 19 07:29:50 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8cd14f3d

dev-libs/libffi: backport emutramp fix to 3.2.1, bug #694916

Reported-by: spotlight <AT> joscomputing.space
Bug: https://bugs.gentoo.org/694916
Package-Manager: Portage-2.3.76, Repoman-2.3.17
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

 .../libffi/files/libffi-3.2.1-musl-emutramp.patch  | 31 ++++++++++
 dev-libs/libffi/libffi-3.2.1-r3.ebuild             | 70 ++++++++++++++++++++++
 2 files changed, 101 insertions(+)

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 00000000000..7c011d2b6d0
--- /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

diff --git a/dev-libs/libffi/libffi-3.2.1-r3.ebuild b/dev-libs/libffi/libffi-3.2.1-r3.ebuild
new file mode 100644
index 00000000000..45d1209a70d
--- /dev/null
+++ b/dev-libs/libffi/libffi-3.2.1-r3.ebuild
@@ -0,0 +1,70 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+inherit eutils libtool multilib multilib-minimal toolchain-funcs
+
+DESCRIPTION="a portable, high level programming interface to various calling conventions"
+HOMEPAGE="https://sourceware.org/libffi/"
+SRC_URI="ftp://sourceware.org/pub/${PN}/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="debug pax_kernel static-libs test"
+
+RDEPEND=""
+DEPEND="test? ( dev-util/dejagnu )"
+
+DOCS="ChangeLog* README"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-3.2.1-o-tmpfile-eacces.patch #529044
+	"${FILESDIR}"/${PN}-3.2.1-complex_alpha.patch
+	"${FILESDIR}"/${PN}-3.1-darwin-x32.patch
+	"${FILESDIR}"/${PN}-3.2.1-complex-ia64.patch
+	"${FILESDIR}"/${PN}-3.2.1-include-path.patch
+	"${FILESDIR}"/${PN}-3.2.1-include-path-autogen.patch
+	"${FILESDIR}"/${PN}-3.2.1-ia64-small-struct.patch #634190
+	"${FILESDIR}"/${PN}-3.2.1-musl-emutramp.patch #694916
+)
+
+ECONF_SOURCE=${S}
+
+pkg_setup() {
+	# Check for orphaned libffi, see https://bugs.gentoo.org/354903 for example
+	if [[ ${ROOT} == "/" && ${EPREFIX} == "" ]] && ! has_version ${CATEGORY}/${PN}; then
+		local base="${T}"/conftest
+		echo 'int main() { }' > "${base}".c
+		$(tc-getCC) -o "${base}" "${base}".c -lffi >&/dev/null
+		if [ $? -eq 0 ]; then
+			eerror "The linker reported linking against -lffi to be working while it shouldn't have."
+			eerror "This is wrong and you should find and delete the old copy of libffi before continuing."
+			die "The system is in inconsistent state with unknown libffi installed."
+		fi
+	fi
+}
+
+src_prepare() {
+	default
+
+	sed -i -e 's:@toolexeclibdir@:$(libdir):g' Makefile.in || die #462814
+	elibtoolize
+}
+
+multilib_src_configure() {
+	use userland_BSD && export HOST="${CHOST}"
+	# python does not like miltilib-wrapped headers: bug #643582
+	# thus we install includes into ABI-specific paths
+	local includes="${EPREFIX}"/usr/$(get_libdir)/${P}/include/
+	econf \
+		$(use_enable static-libs static) \
+		$(use_enable pax_kernel pax_emutramp) \
+		$(use_enable debug) \
+		--includedir="${includes}"
+}
+
+multilib_src_install_all() {
+	prune_libtool_files
+	einstalldocs
+}


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-libs/libffi/files/, dev-libs/libffi/
@ 2020-11-11 19:37 Sergei Trofimovich
  0 siblings, 0 replies; 10+ messages in thread
From: Sergei Trofimovich @ 2020-11-11 19:37 UTC (permalink / raw
  To: gentoo-commits

commit:     b64f44870960b1d321a911135687e332ab5d8ac5
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 11 19:36:51 2020 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Wed Nov 11 19:37:12 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b64f4487

dev-libs/libffi: fix vendor detection on 'dash' shell

Reported-by: Paolo Pedroni
Closes: https://bugs.gentoo.org/753299
Package-Manager: Portage-3.0.9, Repoman-3.0.2
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

 .../files/libffi-3.3-compiler-vendor-quote.patch   | 33 ++++++++++++++++++++++
 dev-libs/libffi/libffi-3.3-r2.ebuild               |  1 +
 2 files changed, 34 insertions(+)

diff --git a/dev-libs/libffi/files/libffi-3.3-compiler-vendor-quote.patch b/dev-libs/libffi/files/libffi-3.3-compiler-vendor-quote.patch
new file mode 100644
index 00000000000..db5b69ce2db
--- /dev/null
+++ b/dev-libs/libffi/files/libffi-3.3-compiler-vendor-quote.patch
@@ -0,0 +1,33 @@
+https://bugs.gentoo.org/753299
+--- a/testsuite/lib/libffi.exp
++++ b/testsuite/lib/libffi.exp
+@@ -287,9 +287,6 @@ proc libffi-init { args } {
+     verbose "libffi $blddirffi"
+ 
+     # Which compiler are we building with?
+-    set tmp [grep "$blddirffi/config.log" "^ax_cv_c_compiler_vendor.*$"]
+-    regexp -- {^[^=]*=(.*)$} $tmp nil compiler_vendor
+-
+     if { [string match $compiler_vendor "gnu"] } {
+         set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a]
+         if {$gccdir != ""} {
+--- a/configure.ac
++++ b/configure.ac
+@@ -59,6 +59,7 @@ fi
+ cat > local.exp <<EOF
+ set CC_FOR_TARGET "$CC"
+ set CXX_FOR_TARGET "$CXX"
++set compiler_vendor "$ax_cv_c_compiler_vendor"
+ EOF
+ 
+ AM_MAINTAINER_MODE
+--- a/configure
++++ b/configure
+@@ -17402,6 +17402,7 @@ fi
+ cat > local.exp <<EOF
+ set CC_FOR_TARGET "$CC"
+ set CXX_FOR_TARGET "$CXX"
++set compiler_vendor "$ax_cv_c_compiler_vendor"
+ EOF
+ 
+ 

diff --git a/dev-libs/libffi/libffi-3.3-r2.ebuild b/dev-libs/libffi/libffi-3.3-r2.ebuild
index 0b379dac2a4..55138eb082d 100644
--- a/dev-libs/libffi/libffi-3.3-r2.ebuild
+++ b/dev-libs/libffi/libffi-3.3-r2.ebuild
@@ -32,6 +32,7 @@ PATCHES=(
 	"${FILESDIR}"/${PN}-3.3-power7-memcpy-2.patch
 	"${FILESDIR}"/${PN}-3.3-ppc-int128.patch
 	"${FILESDIR}"/${PN}-3.3-ppc-vector-offset.patch
+	"${FILESDIR}"/${PN}-3.3-compiler-vendor-quote.patch
 )
 
 S=${WORKDIR}/${MY_P}


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-libs/libffi/files/, dev-libs/libffi/
@ 2021-06-26 21:37 Sergei Trofimovich
  0 siblings, 0 replies; 10+ messages in thread
From: Sergei Trofimovich @ 2021-06-26 21:37 UTC (permalink / raw
  To: gentoo-commits

commit:     0b2c89773e0df20c0c770b6d8620564b76468578
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 26 21:16:34 2021 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Sat Jun 26 21:37:31 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0b2c8977

dev-libs/libffi: bump up to 3.4_rc1, SOVERSION=8

Package-Manager: Portage-3.0.20, Repoman-3.0.3
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

 dev-libs/libffi/Manifest                           |   1 +
 dev-libs/libffi/files/libffi-3.4_rc1-readelf.patch | 138 +++++++++++++++++++++
 dev-libs/libffi/libffi-3.4_rc1.ebuild              |  69 +++++++++++
 dev-libs/libffi/metadata.xml                       |   3 +-
 4 files changed, 210 insertions(+), 1 deletion(-)

diff --git a/dev-libs/libffi/Manifest b/dev-libs/libffi/Manifest
index a1c499b413f..9de05c9958f 100644
--- a/dev-libs/libffi/Manifest
+++ b/dev-libs/libffi/Manifest
@@ -1 +1,2 @@
 DIST libffi-3.3.tar.gz 1305466 BLAKE2B cddc40729a30a9bd34d675809f51f8d1b4ccaffa54bc6dd6f7e965f4e260edd34754719f9f6247c8957aeb7cf154d56ce1fe16a54c3f1ad39afbebdf41d23caa SHA512 61513801a156f11420f541d325de697131846487122d6bdcf5491b18b4da788589f5c0bb07e88e396495d3be5830d74e9135595e2b8ddbfe95c448d8597fbd6f
+DIST libffi-3.4-rc1.tar.gz 1346621 BLAKE2B 4a3560d9a5580748cb56d6da275d08f677a5e3895b4ddb8bf8bb085bad20e1e35eb31c48758dc0cd0fa14136c14a91a4d3596f5f716d561563f8d75eca7c6199 SHA512 130520c6de052015110c509b3b5ec5832c2bf989f95bec2c60a36fc2a57745af3f740381a7fa70e0c42b5a9dc610ea25e77849d50bea3bc197d04d23828fc4c0

diff --git a/dev-libs/libffi/files/libffi-3.4_rc1-readelf.patch b/dev-libs/libffi/files/libffi-3.4_rc1-readelf.patch
new file mode 100644
index 00000000000..f976f988c6b
--- /dev/null
+++ b/dev-libs/libffi/files/libffi-3.4_rc1-readelf.patch
@@ -0,0 +1,138 @@
+https://github.com/libffi/libffi/pull/646
+--- a/configure.ac
++++ b/configure.ac
+@@ -40,6 +40,7 @@ AM_PROG_AS
+ AM_PROG_CC_C_O
+ AC_PROG_LIBTOOL
+ AC_CONFIG_MACRO_DIR([m4])
++AC_CHECK_TOOL(READELF, readelf)
+ 
+ # Test for 64-bit build.
+ AC_CHECK_SIZEOF([size_t])
+@@ -271,7 +272,7 @@ if test "x$GCC" = "xyes"; then
+   	libffi_cv_ro_eh_frame=yes
+   	echo 'extern void foo (void); void bar (void) { foo (); foo (); }' > conftest.c
+   	if $CC $CFLAGS -c -fpic -fexceptions $libffi_cv_no_lto -o conftest.o conftest.c > /dev/null 2>&1; then
+-	    if readelf -WS conftest.o | grep -q -n 'eh_frame .* WA'; then
++	    if $READELF -WS conftest.o | grep -q -n 'eh_frame .* WA'; then
+ 	        libffi_cv_ro_eh_frame=no
+ 	    fi
+   	fi
+--- a/configure
++++ b/configure
+@@ -667,6 +667,7 @@ MAINT
+ MAINTAINER_MODE_FALSE
+ MAINTAINER_MODE_TRUE
+ PRTDIAG
++READELF
+ CXXCPP
+ CPP
+ LT_SYS_LIBRARY_PATH
+@@ -16380,6 +16393,98 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
+ 
+ 
+ 
++if test -n "$ac_tool_prefix"; then
++  # Extract the first word of "${ac_tool_prefix}readelf", so it can be a program name with args.
++set dummy ${ac_tool_prefix}readelf; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if ${ac_cv_prog_READELF+:} false; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$READELF"; then
++  ac_cv_prog_READELF="$READELF" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++    ac_cv_prog_READELF="${ac_tool_prefix}readelf"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++READELF=$ac_cv_prog_READELF
++if test -n "$READELF"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $READELF" >&5
++$as_echo "$READELF" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++fi
++if test -z "$ac_cv_prog_READELF"; then
++  ac_ct_READELF=$READELF
++  # Extract the first word of "readelf", so it can be a program name with args.
++set dummy readelf; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if ${ac_cv_prog_ac_ct_READELF+:} false; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$ac_ct_READELF"; then
++  ac_cv_prog_ac_ct_READELF="$ac_ct_READELF" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
++    ac_cv_prog_ac_ct_READELF="readelf"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++ac_ct_READELF=$ac_cv_prog_ac_ct_READELF
++if test -n "$ac_ct_READELF"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_READELF" >&5
++$as_echo "$ac_ct_READELF" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++  if test "x$ac_ct_READELF" = x; then
++    READELF=""
++  else
++    case $cross_compiling:$ac_tool_warned in
++yes:)
++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
++ac_tool_warned=yes ;;
++esac
++    READELF=$ac_ct_READELF
++  fi
++else
++  READELF="$ac_cv_prog_READELF"
++fi
++
+ 
+ # Test for 64-bit build.
+ # The cast to long int works around a bug in the HP C Compiler
+@@ -18651,7 +18756,7 @@ else
+   	libffi_cv_ro_eh_frame=yes
+   	echo 'extern void foo (void); void bar (void) { foo (); foo (); }' > conftest.c
+   	if $CC $CFLAGS -c -fpic -fexceptions $libffi_cv_no_lto -o conftest.o conftest.c > /dev/null 2>&1; then
+-	    if readelf -WS conftest.o | grep -q -n 'eh_frame .* WA'; then
++	    if $READELF -WS conftest.o | grep -q -n 'eh_frame .* WA'; then
+ 	        libffi_cv_ro_eh_frame=no
+ 	    fi
+   	fi

diff --git a/dev-libs/libffi/libffi-3.4_rc1.ebuild b/dev-libs/libffi/libffi-3.4_rc1.ebuild
new file mode 100644
index 00000000000..dcf2f22db5b
--- /dev/null
+++ b/dev-libs/libffi/libffi-3.4_rc1.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+inherit multilib-minimal
+
+MY_PV=${PV/_rc/-rc}
+MY_P=${PN}-${MY_PV}
+
+DESCRIPTION="a portable, high level programming interface to various calling conventions"
+HOMEPAGE="https://sourceware.org/libffi/"
+SRC_URI="https://github.com/libffi/libffi/releases/download/v${MY_PV}/${MY_P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0/8" # SONAME=libffi.so.8
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="debug pax-kernel pax_kernel static-libs test"
+
+RESTRICT="!test? ( test )"
+# If you are USE=pax_kernel user you really want USE=pax-kernel as well.
+# That's a flag rename: https://archives.gentoo.org/gentoo-dev/message/273f5ec9ebc8075f6ee8d8cdda9e759e
+REQUIRED_USE="pax_kernel? ( pax-kernel )"
+
+RDEPEND=""
+DEPEND=""
+BDEPEND="test? ( dev-util/dejagnu )"
+
+DOCS="ChangeLog* README.md"
+
+PATCHES=("${FILESDIR}"/${PN}-3.4_rc1-readelf.patch)
+
+S=${WORKDIR}/${MY_P}
+
+ECONF_SOURCE=${S}
+
+src_prepare() {
+	default
+	if [[ ${CHOST} == arm64-*-darwin* ]] ; then
+		# ensure we use aarch64 asm, not x86 on arm64
+		sed -i -e 's/aarch64\*-\*-\*/arm64*-*-*|&/' \
+			configure configure.host || die
+	fi
+}
+
+multilib_src_configure() {
+	use userland_BSD && export HOST="${CHOST}"
+	# --includedir= path maintains a few properties:
+	# 1. have stable name across libffi versions: some packages like
+	#    dev-lang/ghc or kde-frameworks/networkmanager-qt embed
+	#    ${includedir} at build-time. Don't require those to be
+	#    rebuilt unless SONAME changes. bug #695788
+	#
+	#    We use /usr/.../${PN} (instead of former /usr/.../${P}).
+	#
+	# 2. have ${ABI}-specific location as ffi.h is target-dependent.
+	#
+	#    We use /usr/$(get_libdir)/... to have ABI identifier.
+	econf \
+		--includedir="${EPREFIX}"/usr/$(get_libdir)/${PN}/include \
+		--disable-multi-os-directory \
+		$(use_enable static-libs static) \
+		$(use_enable pax-kernel pax_emutramp) \
+		$(use_enable debug)
+}
+
+multilib_src_install_all() {
+	find "${ED}" -name "*.la" -delete || die
+	einstalldocs
+}

diff --git a/dev-libs/libffi/metadata.xml b/dev-libs/libffi/metadata.xml
index 6e9a28c5ac8..ac6b16a1be9 100644
--- a/dev-libs/libffi/metadata.xml
+++ b/dev-libs/libffi/metadata.xml
@@ -34,7 +34,8 @@
 		between the two languages.
 	</longdescription>
 	<use>
-		<flag name="pax_kernel">Use PaX emulated trampolines, for we can't use PROT_EXEC</flag>
+		<flag name="pax-kernel">Use PaX emulated trampolines, for we can't use PROT_EXEC.</flag>
+		<flag name="pax_kernel">Use PaX emulated trampolines, for we can't use PROT_EXEC. (use 'pax-kernel' instead)</flag>
 	</use>
 	<upstream>
 		<remote-id type="cpe">cpe:/a:libffi_project:libffi</remote-id>


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-libs/libffi/files/, dev-libs/libffi/
@ 2021-06-26 22:15 Sergei Trofimovich
  0 siblings, 0 replies; 10+ messages in thread
From: Sergei Trofimovich @ 2021-06-26 22:15 UTC (permalink / raw
  To: gentoo-commits

commit:     d6aa9fe3cceee84adeb555d4ac4e053228ffc9d4
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 26 22:14:30 2021 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Sat Jun 26 22:15:19 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d6aa9fe3

dev-libs/libffi: revert "bump up to 3.4_rc1, SOVERSION=8"

This reverts commit 0b2c89773e0df20c0c770b6d8620564b76468578.

Not everyone is happy about this release. No real issues presented though.

Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

 dev-libs/libffi/Manifest                           |   1 -
 dev-libs/libffi/files/libffi-3.4_rc1-readelf.patch | 138 ---------------------
 dev-libs/libffi/libffi-3.4_rc1.ebuild              |  69 -----------
 dev-libs/libffi/metadata.xml                       |   3 +-
 4 files changed, 1 insertion(+), 210 deletions(-)

diff --git a/dev-libs/libffi/Manifest b/dev-libs/libffi/Manifest
index 9de05c9958f..a1c499b413f 100644
--- a/dev-libs/libffi/Manifest
+++ b/dev-libs/libffi/Manifest
@@ -1,2 +1 @@
 DIST libffi-3.3.tar.gz 1305466 BLAKE2B cddc40729a30a9bd34d675809f51f8d1b4ccaffa54bc6dd6f7e965f4e260edd34754719f9f6247c8957aeb7cf154d56ce1fe16a54c3f1ad39afbebdf41d23caa SHA512 61513801a156f11420f541d325de697131846487122d6bdcf5491b18b4da788589f5c0bb07e88e396495d3be5830d74e9135595e2b8ddbfe95c448d8597fbd6f
-DIST libffi-3.4-rc1.tar.gz 1346621 BLAKE2B 4a3560d9a5580748cb56d6da275d08f677a5e3895b4ddb8bf8bb085bad20e1e35eb31c48758dc0cd0fa14136c14a91a4d3596f5f716d561563f8d75eca7c6199 SHA512 130520c6de052015110c509b3b5ec5832c2bf989f95bec2c60a36fc2a57745af3f740381a7fa70e0c42b5a9dc610ea25e77849d50bea3bc197d04d23828fc4c0

diff --git a/dev-libs/libffi/files/libffi-3.4_rc1-readelf.patch b/dev-libs/libffi/files/libffi-3.4_rc1-readelf.patch
deleted file mode 100644
index f976f988c6b..00000000000
--- a/dev-libs/libffi/files/libffi-3.4_rc1-readelf.patch
+++ /dev/null
@@ -1,138 +0,0 @@
-https://github.com/libffi/libffi/pull/646
---- a/configure.ac
-+++ b/configure.ac
-@@ -40,6 +40,7 @@ AM_PROG_AS
- AM_PROG_CC_C_O
- AC_PROG_LIBTOOL
- AC_CONFIG_MACRO_DIR([m4])
-+AC_CHECK_TOOL(READELF, readelf)
- 
- # Test for 64-bit build.
- AC_CHECK_SIZEOF([size_t])
-@@ -271,7 +272,7 @@ if test "x$GCC" = "xyes"; then
-   	libffi_cv_ro_eh_frame=yes
-   	echo 'extern void foo (void); void bar (void) { foo (); foo (); }' > conftest.c
-   	if $CC $CFLAGS -c -fpic -fexceptions $libffi_cv_no_lto -o conftest.o conftest.c > /dev/null 2>&1; then
--	    if readelf -WS conftest.o | grep -q -n 'eh_frame .* WA'; then
-+	    if $READELF -WS conftest.o | grep -q -n 'eh_frame .* WA'; then
- 	        libffi_cv_ro_eh_frame=no
- 	    fi
-   	fi
---- a/configure
-+++ b/configure
-@@ -667,6 +667,7 @@ MAINT
- MAINTAINER_MODE_FALSE
- MAINTAINER_MODE_TRUE
- PRTDIAG
-+READELF
- CXXCPP
- CPP
- LT_SYS_LIBRARY_PATH
-@@ -16380,6 +16393,98 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
- 
- 
- 
-+if test -n "$ac_tool_prefix"; then
-+  # Extract the first word of "${ac_tool_prefix}readelf", so it can be a program name with args.
-+set dummy ${ac_tool_prefix}readelf; ac_word=$2
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-+$as_echo_n "checking for $ac_word... " >&6; }
-+if ${ac_cv_prog_READELF+:} false; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  if test -n "$READELF"; then
-+  ac_cv_prog_READELF="$READELF" # Let the user override the test.
-+else
-+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+  IFS=$as_save_IFS
-+  test -z "$as_dir" && as_dir=.
-+    for ac_exec_ext in '' $ac_executable_extensions; do
-+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-+    ac_cv_prog_READELF="${ac_tool_prefix}readelf"
-+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    break 2
-+  fi
-+done
-+  done
-+IFS=$as_save_IFS
-+
-+fi
-+fi
-+READELF=$ac_cv_prog_READELF
-+if test -n "$READELF"; then
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $READELF" >&5
-+$as_echo "$READELF" >&6; }
-+else
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+fi
-+
-+
-+fi
-+if test -z "$ac_cv_prog_READELF"; then
-+  ac_ct_READELF=$READELF
-+  # Extract the first word of "readelf", so it can be a program name with args.
-+set dummy readelf; ac_word=$2
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-+$as_echo_n "checking for $ac_word... " >&6; }
-+if ${ac_cv_prog_ac_ct_READELF+:} false; then :
-+  $as_echo_n "(cached) " >&6
-+else
-+  if test -n "$ac_ct_READELF"; then
-+  ac_cv_prog_ac_ct_READELF="$ac_ct_READELF" # Let the user override the test.
-+else
-+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-+for as_dir in $PATH
-+do
-+  IFS=$as_save_IFS
-+  test -z "$as_dir" && as_dir=.
-+    for ac_exec_ext in '' $ac_executable_extensions; do
-+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-+    ac_cv_prog_ac_ct_READELF="readelf"
-+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-+    break 2
-+  fi
-+done
-+  done
-+IFS=$as_save_IFS
-+
-+fi
-+fi
-+ac_ct_READELF=$ac_cv_prog_ac_ct_READELF
-+if test -n "$ac_ct_READELF"; then
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_READELF" >&5
-+$as_echo "$ac_ct_READELF" >&6; }
-+else
-+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-+$as_echo "no" >&6; }
-+fi
-+
-+  if test "x$ac_ct_READELF" = x; then
-+    READELF=""
-+  else
-+    case $cross_compiling:$ac_tool_warned in
-+yes:)
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-+ac_tool_warned=yes ;;
-+esac
-+    READELF=$ac_ct_READELF
-+  fi
-+else
-+  READELF="$ac_cv_prog_READELF"
-+fi
-+
- 
- # Test for 64-bit build.
- # The cast to long int works around a bug in the HP C Compiler
-@@ -18651,7 +18756,7 @@ else
-   	libffi_cv_ro_eh_frame=yes
-   	echo 'extern void foo (void); void bar (void) { foo (); foo (); }' > conftest.c
-   	if $CC $CFLAGS -c -fpic -fexceptions $libffi_cv_no_lto -o conftest.o conftest.c > /dev/null 2>&1; then
--	    if readelf -WS conftest.o | grep -q -n 'eh_frame .* WA'; then
-+	    if $READELF -WS conftest.o | grep -q -n 'eh_frame .* WA'; then
- 	        libffi_cv_ro_eh_frame=no
- 	    fi
-   	fi

diff --git a/dev-libs/libffi/libffi-3.4_rc1.ebuild b/dev-libs/libffi/libffi-3.4_rc1.ebuild
deleted file mode 100644
index dcf2f22db5b..00000000000
--- a/dev-libs/libffi/libffi-3.4_rc1.ebuild
+++ /dev/null
@@ -1,69 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-inherit multilib-minimal
-
-MY_PV=${PV/_rc/-rc}
-MY_P=${PN}-${MY_PV}
-
-DESCRIPTION="a portable, high level programming interface to various calling conventions"
-HOMEPAGE="https://sourceware.org/libffi/"
-SRC_URI="https://github.com/libffi/libffi/releases/download/v${MY_PV}/${MY_P}.tar.gz"
-
-LICENSE="MIT"
-SLOT="0/8" # SONAME=libffi.so.8
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-IUSE="debug pax-kernel pax_kernel static-libs test"
-
-RESTRICT="!test? ( test )"
-# If you are USE=pax_kernel user you really want USE=pax-kernel as well.
-# That's a flag rename: https://archives.gentoo.org/gentoo-dev/message/273f5ec9ebc8075f6ee8d8cdda9e759e
-REQUIRED_USE="pax_kernel? ( pax-kernel )"
-
-RDEPEND=""
-DEPEND=""
-BDEPEND="test? ( dev-util/dejagnu )"
-
-DOCS="ChangeLog* README.md"
-
-PATCHES=("${FILESDIR}"/${PN}-3.4_rc1-readelf.patch)
-
-S=${WORKDIR}/${MY_P}
-
-ECONF_SOURCE=${S}
-
-src_prepare() {
-	default
-	if [[ ${CHOST} == arm64-*-darwin* ]] ; then
-		# ensure we use aarch64 asm, not x86 on arm64
-		sed -i -e 's/aarch64\*-\*-\*/arm64*-*-*|&/' \
-			configure configure.host || die
-	fi
-}
-
-multilib_src_configure() {
-	use userland_BSD && export HOST="${CHOST}"
-	# --includedir= path maintains a few properties:
-	# 1. have stable name across libffi versions: some packages like
-	#    dev-lang/ghc or kde-frameworks/networkmanager-qt embed
-	#    ${includedir} at build-time. Don't require those to be
-	#    rebuilt unless SONAME changes. bug #695788
-	#
-	#    We use /usr/.../${PN} (instead of former /usr/.../${P}).
-	#
-	# 2. have ${ABI}-specific location as ffi.h is target-dependent.
-	#
-	#    We use /usr/$(get_libdir)/... to have ABI identifier.
-	econf \
-		--includedir="${EPREFIX}"/usr/$(get_libdir)/${PN}/include \
-		--disable-multi-os-directory \
-		$(use_enable static-libs static) \
-		$(use_enable pax-kernel pax_emutramp) \
-		$(use_enable debug)
-}
-
-multilib_src_install_all() {
-	find "${ED}" -name "*.la" -delete || die
-	einstalldocs
-}

diff --git a/dev-libs/libffi/metadata.xml b/dev-libs/libffi/metadata.xml
index ac6b16a1be9..6e9a28c5ac8 100644
--- a/dev-libs/libffi/metadata.xml
+++ b/dev-libs/libffi/metadata.xml
@@ -34,8 +34,7 @@
 		between the two languages.
 	</longdescription>
 	<use>
-		<flag name="pax-kernel">Use PaX emulated trampolines, for we can't use PROT_EXEC.</flag>
-		<flag name="pax_kernel">Use PaX emulated trampolines, for we can't use PROT_EXEC. (use 'pax-kernel' instead)</flag>
+		<flag name="pax_kernel">Use PaX emulated trampolines, for we can't use PROT_EXEC</flag>
 	</use>
 	<upstream>
 		<remote-id type="cpe">cpe:/a:libffi_project:libffi</remote-id>


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-libs/libffi/files/, dev-libs/libffi/
@ 2023-01-21  1:05 Sam James
  0 siblings, 0 replies; 10+ messages in thread
From: Sam James @ 2023-01-21  1:05 UTC (permalink / raw
  To: gentoo-commits

commit:     8673cb04060bb988c798fe103ce71ea6bff0e784
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Jan 21 01:00:37 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Jan 21 01:00:48 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8673cb04

dev-libs/libffi: drop 3.3-r2, 3.4.2-r2

Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-libs/libffi/Manifest                           |  3 -
 .../files/libffi-3.2.1-o-tmpfile-eacces.patch      | 17 -----
 .../files/libffi-3.3-compiler-vendor-quote.patch   | 33 --------
 .../libffi/files/libffi-3.3-power7-memcpy-2.patch  | 28 -------
 .../libffi/files/libffi-3.3-power7-memcpy.patch    | 42 -----------
 dev-libs/libffi/files/libffi-3.3-power7.patch      | 39 ----------
 dev-libs/libffi/files/libffi-3.3-ppc-int128.patch  | 63 ----------------
 .../files/libffi-3.3-ppc-vector-offset.patch       | 53 -------------
 .../libffi/files/libffi-3.3_rc0-ppc-macos-go.patch | 79 -------------------
 .../files/libffi-3.4.2-backport-pr-722.patch       | 88 ----------------------
 dev-libs/libffi/libffi-3.3-r2.ebuild               | 74 ------------------
 dev-libs/libffi/libffi-3.4.2-r2.ebuild             | 80 --------------------
 dev-libs/libffi/metadata.xml                       |  1 -
 13 files changed, 600 deletions(-)

diff --git a/dev-libs/libffi/Manifest b/dev-libs/libffi/Manifest
index da3ba58c225c..85514adcd060 100644
--- a/dev-libs/libffi/Manifest
+++ b/dev-libs/libffi/Manifest
@@ -1,4 +1 @@
-DIST libffi-3.3.tar.gz 1305466 BLAKE2B cddc40729a30a9bd34d675809f51f8d1b4ccaffa54bc6dd6f7e965f4e260edd34754719f9f6247c8957aeb7cf154d56ce1fe16a54c3f1ad39afbebdf41d23caa SHA512 61513801a156f11420f541d325de697131846487122d6bdcf5491b18b4da788589f5c0bb07e88e396495d3be5830d74e9135595e2b8ddbfe95c448d8597fbd6f
-DIST libffi-3.4.2-loongarch64-20220428.patch.xz 64932 BLAKE2B d144dc28a7fce008bc5cd43d9e04125ea8e972324d77951d42039d46e818014079c871f87a0cdbec758b55320c02dff718cf2449f9c630cc899e8e1610784a60 SHA512 33715b21fe027692cc584d6524c03510af7876cc35f318221e1b2b91644cf165c02979c8b426228a8cc6c471e6a59d0435e761b6b7aef589c41a4f28caa36e62
-DIST libffi-3.4.2.tar.gz 1351355 BLAKE2B a8137bc895b819f949fd7705e405be627219c6d1fdef280253330f7407d4a548bb057d7bb0e9225d1767d42f9bf5f0ab3c455db1c3470d7cc876bb7b7d55d308 SHA512 31bad35251bf5c0adb998c88ff065085ca6105cf22071b9bd4b5d5d69db4fadf16cadeec9baca944c4bb97b619b035bb8279de8794b922531fddeb0779eb7fb1
 DIST libffi-3.4.4.tar.gz 1362394 BLAKE2B 189fe1ffe9507f204581b0ab09995dc7e7b761bb4eac7e338e9f5ff81431aebcef6c182c1839c9f9acb2706697a260c67e6d1351cf7e2aed7c4eb5d694f6f8fd SHA512 88680aeb0fa0dc0319e5cd2ba45b4b5a340bc9b4bcf20b1e0613b39cd898f177a3863aa94034d8e23a7f6f44d858a53dcd36d1bb8dee13b751ef814224061889

diff --git a/dev-libs/libffi/files/libffi-3.2.1-o-tmpfile-eacces.patch b/dev-libs/libffi/files/libffi-3.2.1-o-tmpfile-eacces.patch
deleted file mode 100644
index 92a733cbe823..000000000000
--- a/dev-libs/libffi/files/libffi-3.2.1-o-tmpfile-eacces.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-https://bugs.gentoo.org/529044
-
-deploy this workaround until newer versions of the kernel/C library/libsandbox
-are rolled out into general circulation
-
---- a/src/closures.c
-+++ b/src/closures.c
-@@ -301,7 +301,8 @@ open_temp_exec_file_dir (const char *dir)
- #ifdef O_TMPFILE
-   fd = open (dir, flags | O_RDWR | O_EXCL | O_TMPFILE, 0700);
-   /* If the running system does not support the O_TMPFILE flag then retry without it. */
--  if (fd != -1 || (errno != EINVAL && errno != EISDIR && errno != EOPNOTSUPP)) {
-+  if (fd != -1 || (errno != EINVAL && errno != EISDIR && errno != EOPNOTSUPP &&
-+		   errno != EACCES)) {
-     return fd;
-   } else {
-     errno = 0;

diff --git a/dev-libs/libffi/files/libffi-3.3-compiler-vendor-quote.patch b/dev-libs/libffi/files/libffi-3.3-compiler-vendor-quote.patch
deleted file mode 100644
index db5b69ce2db9..000000000000
--- a/dev-libs/libffi/files/libffi-3.3-compiler-vendor-quote.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-https://bugs.gentoo.org/753299
---- a/testsuite/lib/libffi.exp
-+++ b/testsuite/lib/libffi.exp
-@@ -287,9 +287,6 @@ proc libffi-init { args } {
-     verbose "libffi $blddirffi"
- 
-     # Which compiler are we building with?
--    set tmp [grep "$blddirffi/config.log" "^ax_cv_c_compiler_vendor.*$"]
--    regexp -- {^[^=]*=(.*)$} $tmp nil compiler_vendor
--
-     if { [string match $compiler_vendor "gnu"] } {
-         set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a]
-         if {$gccdir != ""} {
---- a/configure.ac
-+++ b/configure.ac
-@@ -59,6 +59,7 @@ fi
- cat > local.exp <<EOF
- set CC_FOR_TARGET "$CC"
- set CXX_FOR_TARGET "$CXX"
-+set compiler_vendor "$ax_cv_c_compiler_vendor"
- EOF
- 
- AM_MAINTAINER_MODE
---- a/configure
-+++ b/configure
-@@ -17402,6 +17402,7 @@ fi
- cat > local.exp <<EOF
- set CC_FOR_TARGET "$CC"
- set CXX_FOR_TARGET "$CXX"
-+set compiler_vendor "$ax_cv_c_compiler_vendor"
- EOF
- 
- 

diff --git a/dev-libs/libffi/files/libffi-3.3-power7-memcpy-2.patch b/dev-libs/libffi/files/libffi-3.3-power7-memcpy-2.patch
deleted file mode 100644
index d9d47acb618f..000000000000
--- a/dev-libs/libffi/files/libffi-3.3-power7-memcpy-2.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 6663047f56c2932a6b10a790f4ac6666dd181326 Mon Sep 17 00:00:00 2001
-From: Anthony Green <green@moxielogic.com>
-Date: Fri, 29 Nov 2019 07:00:35 -0500
-Subject: [PATCH] Address platforms with no __int128.
-
----
- src/powerpc/ffi_linux64.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/src/powerpc/ffi_linux64.c b/src/powerpc/ffi_linux64.c
-index de0d033..7364770 100644
---- a/src/powerpc/ffi_linux64.c
-+++ b/src/powerpc/ffi_linux64.c
-@@ -547,9 +547,9 @@ ffi_prep_args64 (extended_cif *ecif, unsigned long *const stack)
-               if (next_arg.ul == gpr_end.ul)
-                 next_arg.ul = rest.ul;
-               if (vecarg_count < NUM_VEC_ARG_REGISTERS64 && i < nfixedargs)
--                *vec_base.f128++ = **p_argv.f128;
-+		memcpy (vec_base.f128++, *p_argv.f128, sizeof (float128));
-               else
--                *next_arg.f128 = **p_argv.f128;
-+		memcpy (next_arg.f128, *p_argv.f128, sizeof (float128));
-               if (++next_arg.f128 == gpr_end.f128)
-                 next_arg.f128 = rest.f128;
-               vecarg_count++;
--- 
-2.26.0
-

diff --git a/dev-libs/libffi/files/libffi-3.3-power7-memcpy.patch b/dev-libs/libffi/files/libffi-3.3-power7-memcpy.patch
deleted file mode 100644
index 91f9a6f60fae..000000000000
--- a/dev-libs/libffi/files/libffi-3.3-power7-memcpy.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From e50b9ef8b910fa642ef158f6642e60d54d7ad740 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Sat, 7 Dec 2019 02:34:14 -0800
-Subject: [PATCH] powerpc64: Use memcpy to help platforms with no __int128.
- (#534)
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- src/powerpc/ffi_linux64.c | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/src/powerpc/ffi_linux64.c b/src/powerpc/ffi_linux64.c
-index 7364770..4d50878 100644
---- a/src/powerpc/ffi_linux64.c
-+++ b/src/powerpc/ffi_linux64.c
-@@ -680,9 +680,9 @@ ffi_prep_args64 (extended_cif *ecif, unsigned long *const stack)
-                     {
-                       if (vecarg_count < NUM_VEC_ARG_REGISTERS64
-                           && i < nfixedargs)
--                        *vec_base.f128++ = *arg.f128++;
-+		        memcpy (vec_base.f128++, arg.f128, sizeof (float128));
-                       else
--                        *next_arg.f128 = *arg.f128++;
-+		        memcpy (next_arg.f128, arg.f128++, sizeof (float128));
-                       if (++next_arg.f128 == gpr_end.f128)
-                         next_arg.f128 = rest.f128;
-                       vecarg_count++;
-@@ -986,9 +986,9 @@ ffi_closure_helper_LINUX64 (ffi_cif *cif,
-                   do
-                     {
-                       if (pvec < end_pvec && i < nfixedargs)
--                        *to.f128 = *pvec++;
-+		        memcpy (to.f128, pvec++, sizeof (float128));
-                       else
--                        *to.f128 = *from.f128;
-+		        memcpy (to.f128, from.f128, sizeof (float128));
-                       to.f128++;
-                       from.f128++;
-                     }
--- 
-2.26.0
-

diff --git a/dev-libs/libffi/files/libffi-3.3-power7.patch b/dev-libs/libffi/files/libffi-3.3-power7.patch
deleted file mode 100644
index 83f518f4c2e3..000000000000
--- a/dev-libs/libffi/files/libffi-3.3-power7.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-https://bugs.gentoo.org/701128
-
-From 2138adb2a5b6a0bc2fe3518e0645eacc89b6f392 Mon Sep 17 00:00:00 2001
-From: Sergei Trofimovich <slyfox@gentoo.org>
-Date: Thu, 28 Nov 2019 00:02:42 +0000
-Subject: [PATCH] powerpc: fix build failure on power7 and older
-
-Build failure looks as:
-```
-libtool: compile:  powerpc-unknown-linux-gnu-gcc \
-    -O2 -mcpu=powerpc -mtune=powerpc -pipe ... -c src/powerpc/ffi.c ...
-In file included from src/powerpc/ffi.c:33:
-src/powerpc/ffi_powerpc.h:65:9: error: '__int128' is not supported on this target
-   65 | typedef __int128 float128;
-      |         ^~~~~~~~
-```
-
-The fix avoids using __int128 in favour of aligned char[16].
-
-Closes: https://github.com/libffi/libffi/issues/531
-Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
----
- src/powerpc/ffi_powerpc.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/src/powerpc/ffi_powerpc.h
-+++ b/src/powerpc/ffi_powerpc.h
-@@ -62,7 +62,7 @@ typedef _Float128 float128;
- #elif defined(__FLOAT128__)
- typedef __float128 float128;
- #else
--typedef __int128 float128;
-+typedef char float128[16] __attribute__((aligned(16)));
- #endif
- 
- void FFI_HIDDEN ffi_closure_SYSV (void);
--- 
-2.24.0
-

diff --git a/dev-libs/libffi/files/libffi-3.3-ppc-int128.patch b/dev-libs/libffi/files/libffi-3.3-ppc-int128.patch
deleted file mode 100644
index ed53ae99902f..000000000000
--- a/dev-libs/libffi/files/libffi-3.3-ppc-int128.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-From 4f9e20ac51ce13d46fed3c869e1deb6d9bb89444 Mon Sep 17 00:00:00 2001
-From: Andrew Geissler <geissonator@users.noreply.github.com>
-Date: Fri, 1 May 2020 06:58:30 -0500
-Subject: [PATCH] ffi_powerpc.h: fix build failure with powerpc7 (#561)
-
-This is a patch pulled down from the following:
-https://github.com/buildroot/buildroot/blob/78926f610b1411b03464152472fd430012deb9ac/package/libffi/0004-ffi_powerpc.h-fix-build-failure-with-powerpc7.patch
-
-This issue is being hit on OpenBMC code when pulling the latest
-libffi tag and building on a P8 ppc64le machine. I verified this
-patch fixes the issue we are seeing.
-
-Below is the original commit message:
-
-Sicne commit 73dd43afc8a447ba98ea02e9aad4c6898dc77fb0, build on powerpc7
-fails on:
-
-In file included from ../src/powerpc/ffi.c:33:0:
-../src/powerpc/ffi_powerpc.h:61:9: error: '_Float128' is not supported on this target
- typedef _Float128 float128;
-         ^~~~~~~~~
-
-Fix this build failure by checking for __HAVE_FLOAT128 before using
-_Float128, as _Float128 is enabled only on specific conditions, see
-output/host/powerpc64-buildroot-linux-gnu/sysroot/usr/include/bits/floatn.h:
-
- /* Defined to 1 if the current compiler invocation provides a
-    floating-point type with the IEEE 754 binary128 format, and this glibc
-    includes corresponding *f128 interfaces for it.  */
- #if defined _ARCH_PWR8 && defined __LITTLE_ENDIAN__ && (_CALL_ELF == 2) \
-     && defined __FLOAT128__ && !defined __NO_LONG_DOUBLE_MATH
- # define __HAVE_FLOAT128 1
- #else
- # define __HAVE_FLOAT128 0
- #endif
-
-Fixes:
- - http://autobuild.buildroot.org/results/5c9dd8fb3b6a128882b6250f197c80232d8a3b53
-
-Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
-Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
-
-Co-authored-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
----
- src/powerpc/ffi_powerpc.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/powerpc/ffi_powerpc.h b/src/powerpc/ffi_powerpc.h
-index 8e2f2f0..960a5c4 100644
---- a/src/powerpc/ffi_powerpc.h
-+++ b/src/powerpc/ffi_powerpc.h
-@@ -57,7 +57,7 @@ typedef union
-   double d;
- } ffi_dblfl;
- 
--#if defined(__FLOAT128_TYPE__)
-+#if defined(__FLOAT128_TYPE__) && defined(__HAVE_FLOAT128)
- typedef _Float128 float128;
- #elif defined(__FLOAT128__)
- typedef __float128 float128;
--- 
-2.27.0
-

diff --git a/dev-libs/libffi/files/libffi-3.3-ppc-vector-offset.patch b/dev-libs/libffi/files/libffi-3.3-ppc-vector-offset.patch
deleted file mode 100644
index 4bcd27e4f152..000000000000
--- a/dev-libs/libffi/files/libffi-3.3-ppc-vector-offset.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-From 4d6d2866ae43e55325e8ee96561221804602cd7a Mon Sep 17 00:00:00 2001
-From: Samuel Holland <samuel@sholland.org>
-Date: Fri, 21 Feb 2020 21:06:15 -0600
-Subject: [PATCH] Update powerpc sysv assembly for ffi_powerpc.h changes (#541)
-
-Some of the flag bits were moved when adding powerpc64 vector support.
-
-Fixes #536
----
- src/powerpc/sysv.S | 12 +++++-------
- 1 file changed, 5 insertions(+), 7 deletions(-)
-
-diff --git a/src/powerpc/sysv.S b/src/powerpc/sysv.S
-index 1474ce7..df97734 100644
---- a/src/powerpc/sysv.S
-+++ b/src/powerpc/sysv.S
-@@ -104,17 +104,16 @@ ENTRY(ffi_call_SYSV)
- 	bctrl
- 
- 	/* Now, deal with the return value.  */
--	mtcrf	0x01,%r31 /* cr7  */
-+	mtcrf	0x03,%r31 /* cr6-cr7  */
- 	bt-	31,L(small_struct_return_value)
- 	bt-	30,L(done_return_value)
- #ifndef __NO_FPRS__
- 	bt-	29,L(fp_return_value)
- #endif
- 	stw	%r3,0(%r30)
--	bf+	28,L(done_return_value)
-+	bf+	27,L(done_return_value)
- 	stw	%r4,4(%r30)
--	mtcrf	0x02,%r31 /* cr6  */
--	bf	27,L(done_return_value)
-+	bf	26,L(done_return_value)
- 	stw     %r5,8(%r30)
- 	stw	%r6,12(%r30)
- 	/* Fall through...  */
-@@ -145,10 +144,9 @@ L(done_return_value):
- #ifndef __NO_FPRS__
- L(fp_return_value):
- 	.cfi_restore_state
--	bf	28,L(float_return_value)
-+	bf	27,L(float_return_value)
- 	stfd	%f1,0(%r30)
--	mtcrf   0x02,%r31 /* cr6  */
--	bf	27,L(done_return_value)
-+	bf	26,L(done_return_value)
- 	stfd	%f2,8(%r30)
- 	b	L(done_return_value)
- L(float_return_value):
--- 
-2.27.0
-

diff --git a/dev-libs/libffi/files/libffi-3.3_rc0-ppc-macos-go.patch b/dev-libs/libffi/files/libffi-3.3_rc0-ppc-macos-go.patch
deleted file mode 100644
index 88f9b4557657..000000000000
--- a/dev-libs/libffi/files/libffi-3.3_rc0-ppc-macos-go.patch
+++ /dev/null
@@ -1,79 +0,0 @@
-ffi_darwin: use FFI_GO_CLOSURES guard to avoid unsolvable dependencies
-
-The go calls depend on compilation and link-time signatures and symbols
-which are missing because they aren't build due to FFO_GO_CLOSURES not
-being set.
-
-Signed-off-by: Fabian Groffen <grobian@gentoo.org>
-
---- a/src/powerpc/ffi_darwin.c	2018-04-02 14:21:51.000000000 +0200
-+++ b/src/powerpc/ffi_darwin.c	2018-12-10 13:57:26.000000000 +0100
-@@ -909,8 +909,10 @@
- extern void ffi_call_AIX(extended_cif *, long, unsigned, unsigned *,
- 			 void (*fn)(void), void (*fn2)(void));
- 
-+#if FFI_GO_CLOSURES
- extern void ffi_call_go_AIX(extended_cif *, long, unsigned, unsigned *,
- 			    void (*fn)(void), void (*fn2)(void), void *closure);
-+#endif
- 
- extern void ffi_call_DARWIN(extended_cif *, long, unsigned, unsigned *,
- 			    void (*fn)(void), void (*fn2)(void), ffi_type*);
-@@ -950,6 +952,7 @@
-     }
- }
- 
-+#if FFI_GO_CLOSURES
- void
- ffi_call_go (ffi_cif *cif, void (*fn) (void), void *rvalue, void **avalue,
- 	     void *closure)
-@@ -981,6 +984,7 @@
-       break;
-     }
- }
-+#endif
- 
- static void flush_icache(char *);
- static void flush_range(char *, int);
-@@ -1110,6 +1114,7 @@
-   return FFI_OK;
- }
- 
-+#if FFI_GO_CLOSURES
- ffi_status
- ffi_prep_go_closure (ffi_go_closure* closure,
- 		     ffi_cif* cif,
-@@ -1133,6 +1138,7 @@
-     }
-   return FFI_OK;
- }
-+#endif
- 
- static void
- flush_icache(char *addr)
-@@ -1168,9 +1174,11 @@
- ffi_closure_helper_DARWIN (ffi_closure *, void *,
- 			   unsigned long *, ffi_dblfl *);
- 
-+#if FFI_GO_CLOSURES
- ffi_type *
- ffi_go_closure_helper_DARWIN (ffi_go_closure*, void *,
- 			      unsigned long *, ffi_dblfl *);
-+#endif
- 
- /* Basically the trampoline invokes ffi_closure_ASM, and on
-    entry, r11 holds the address of the closure.
-@@ -1430,6 +1438,7 @@
- 				    closure->user_data, rvalue, pgr, pfr);
- }
- 
-+#if FFI_GO_CLOSURES
- ffi_type *
- ffi_go_closure_helper_DARWIN (ffi_go_closure *closure, void *rvalue,
- 			      unsigned long *pgr, ffi_dblfl *pfr)
-@@ -1437,4 +1446,5 @@
-   return ffi_closure_helper_common (closure->cif, closure->fun,
- 				    closure, rvalue, pgr, pfr);
- }
-+#endif
- 

diff --git a/dev-libs/libffi/files/libffi-3.4.2-backport-pr-722.patch b/dev-libs/libffi/files/libffi-3.4.2-backport-pr-722.patch
deleted file mode 100644
index 41821e89140c..000000000000
--- a/dev-libs/libffi/files/libffi-3.4.2-backport-pr-722.patch
+++ /dev/null
@@ -1,88 +0,0 @@
-From f4d413725030b35ec2f01733b154489d0b4c6e1d Mon Sep 17 00:00:00 2001
-From: matoro <matoro@users.noreply.github.com>
-Date: Sun, 26 Jun 2022 23:19:00 -0400
-Subject: [PATCH] Move FFI_TYPE definitions above <ffitarget.h> include
-
-For powerpc at least, these definitions are referenced in the
-target-specific ffitarget.h.  Discovered in the jffi project.  Should
-close https://github.com/libffi/libffi/issues/637.  Downstream jffi bug
-https://github.com/jnr/jffi/issues/107.  Downstream distro bug
-https://bugs.gentoo.org/827215.
-
-Testing - both libffi and jffi test suites pass with this patch applied,
-at least on ppc64le linux.  I did not see any warnings about
-redefinitions.
-
-Tested versions - libffi 3.4.2, jffi 1.3.6 and 1.3.9.
----
- include/ffi.h.in | 50 ++++++++++++++++++++++++------------------------
- 1 file changed, 25 insertions(+), 25 deletions(-)
-
-diff --git a/include/ffi.h.in b/include/ffi.h.in
-index d16f307e..6cd19baa 100644
---- a/include/ffi.h.in
-+++ b/include/ffi.h.in
-@@ -56,6 +56,31 @@ extern "C" {
- 
- /* ---- System configuration information --------------------------------- */
- 
-+/* If these change, update src/mips/ffitarget.h. */
-+#define FFI_TYPE_VOID       0
-+#define FFI_TYPE_INT        1
-+#define FFI_TYPE_FLOAT      2
-+#define FFI_TYPE_DOUBLE     3
-+#if @HAVE_LONG_DOUBLE@
-+#define FFI_TYPE_LONGDOUBLE 4
-+#else
-+#define FFI_TYPE_LONGDOUBLE FFI_TYPE_DOUBLE
-+#endif
-+#define FFI_TYPE_UINT8      5
-+#define FFI_TYPE_SINT8      6
-+#define FFI_TYPE_UINT16     7
-+#define FFI_TYPE_SINT16     8
-+#define FFI_TYPE_UINT32     9
-+#define FFI_TYPE_SINT32     10
-+#define FFI_TYPE_UINT64     11
-+#define FFI_TYPE_SINT64     12
-+#define FFI_TYPE_STRUCT     13
-+#define FFI_TYPE_POINTER    14
-+#define FFI_TYPE_COMPLEX    15
-+
-+/* This should always refer to the last type code (for sanity checks).  */
-+#define FFI_TYPE_LAST       FFI_TYPE_COMPLEX
-+
- #include <ffitarget.h>
- 
- #ifndef LIBFFI_ASM
-@@ -496,31 +521,6 @@ ffi_status ffi_get_struct_offsets (ffi_abi abi, ffi_type *struct_type,
- 
- #endif
- 
--/* If these change, update src/mips/ffitarget.h. */
--#define FFI_TYPE_VOID       0
--#define FFI_TYPE_INT        1
--#define FFI_TYPE_FLOAT      2
--#define FFI_TYPE_DOUBLE     3
--#if @HAVE_LONG_DOUBLE@
--#define FFI_TYPE_LONGDOUBLE 4
--#else
--#define FFI_TYPE_LONGDOUBLE FFI_TYPE_DOUBLE
--#endif
--#define FFI_TYPE_UINT8      5
--#define FFI_TYPE_SINT8      6
--#define FFI_TYPE_UINT16     7
--#define FFI_TYPE_SINT16     8
--#define FFI_TYPE_UINT32     9
--#define FFI_TYPE_SINT32     10
--#define FFI_TYPE_UINT64     11
--#define FFI_TYPE_SINT64     12
--#define FFI_TYPE_STRUCT     13
--#define FFI_TYPE_POINTER    14
--#define FFI_TYPE_COMPLEX    15
--
--/* This should always refer to the last type code (for sanity checks).  */
--#define FFI_TYPE_LAST       FFI_TYPE_COMPLEX
--
- #ifdef __cplusplus
- }
- #endif

diff --git a/dev-libs/libffi/libffi-3.3-r2.ebuild b/dev-libs/libffi/libffi-3.3-r2.ebuild
deleted file mode 100644
index 3d1f2530f8fe..000000000000
--- a/dev-libs/libffi/libffi-3.3-r2.ebuild
+++ /dev/null
@@ -1,74 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-inherit multilib-minimal
-
-MY_PV=${PV/_rc/-rc}
-MY_P=${PN}-${MY_PV}
-
-DESCRIPTION="a portable, high level programming interface to various calling conventions"
-HOMEPAGE="https://sourceware.org/libffi/"
-SRC_URI="https://github.com/libffi/libffi/releases/download/v${MY_PV}/${MY_P}.tar.gz"
-
-LICENSE="MIT"
-SLOT="0/7" # SONAME=libffi.so.7
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-IUSE="debug pax-kernel static-libs test"
-
-RESTRICT="!test? ( test )"
-
-RDEPEND=""
-DEPEND=""
-BDEPEND="test? ( dev-util/dejagnu )"
-
-DOCS="ChangeLog* README.md"
-
-PATCHES=(
-	"${FILESDIR}"/${PN}-3.2.1-o-tmpfile-eacces.patch #529044
-	"${FILESDIR}"/${PN}-3.3_rc0-ppc-macos-go.patch
-	"${FILESDIR}"/${PN}-3.3-power7.patch
-	"${FILESDIR}"/${PN}-3.3-power7-memcpy.patch
-	"${FILESDIR}"/${PN}-3.3-power7-memcpy-2.patch
-	"${FILESDIR}"/${PN}-3.3-ppc-int128.patch
-	"${FILESDIR}"/${PN}-3.3-ppc-vector-offset.patch
-	"${FILESDIR}"/${PN}-3.3-compiler-vendor-quote.patch
-)
-
-S=${WORKDIR}/${MY_P}
-
-ECONF_SOURCE=${S}
-
-src_prepare() {
-	default
-	if [[ ${CHOST} == arm64-*-darwin* ]] ; then
-		# ensure we use aarch64 asm, not x86 on arm64
-		sed -i -e 's/aarch64\*-\*-\*/arm64*-*-*|&/' \
-			configure configure.host || die
-	fi
-}
-
-multilib_src_configure() {
-	# --includedir= path maintains a few properties:
-	# 1. have stable name across libffi versions: some packages like
-	#    dev-lang/ghc or kde-frameworks/networkmanager-qt embed
-	#    ${includedir} at build-time. Don't require those to be
-	#    rebuilt unless SONAME changes. bug #695788
-	#
-	#    We use /usr/.../${PN} (instead of former /usr/.../${P}).
-	#
-	# 2. have ${ABI}-specific location as ffi.h is target-dependent.
-	#
-	#    We use /usr/$(get_libdir)/... to have ABI identifier.
-	econf \
-		--includedir="${EPREFIX}"/usr/$(get_libdir)/${PN}/include \
-		--disable-multi-os-directory \
-		$(use_enable static-libs static) \
-		$(use_enable pax-kernel pax_emutramp) \
-		$(use_enable debug)
-}
-
-multilib_src_install_all() {
-	find "${ED}" -name "*.la" -delete || die
-	einstalldocs
-}

diff --git a/dev-libs/libffi/libffi-3.4.2-r2.ebuild b/dev-libs/libffi/libffi-3.4.2-r2.ebuild
deleted file mode 100644
index b74e671f7328..000000000000
--- a/dev-libs/libffi/libffi-3.4.2-r2.ebuild
+++ /dev/null
@@ -1,80 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit multilib-minimal preserve-libs
-
-MY_PV=${PV/_rc/-rc}
-MY_P=${PN}-${MY_PV}
-
-DESCRIPTION="a portable, high level programming interface to various calling conventions"
-HOMEPAGE="https://sourceware.org/libffi/"
-SRC_URI="https://github.com/libffi/libffi/releases/download/v${MY_PV}/${MY_P}.tar.gz
-	experimental-loong? ( https://dev.gentoo.org/~xen0n/distfiles/${MY_P}-loongarch64-20220428.patch.xz )"
-S="${WORKDIR}"/${MY_P}
-
-LICENSE="MIT"
-# This is a core package which is depended on by e.g. Python
-# Please use preserve-libs.eclass in pkg_{pre,post}inst to cover users
-# with FEATURES="-preserved-libs" or another package manager if SONAME
-# changes.
-SLOT="0/8" # SONAME=libffi.so.8
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-IUSE="debug exec-static-trampoline experimental-loong pax-kernel static-libs test"
-
-RESTRICT="!test? ( test )"
-BDEPEND="test? ( dev-util/dejagnu )"
-
-DOCS="ChangeLog* README.md"
-
-ECONF_SOURCE=${S}
-
-PATCHES=( "${FILESDIR}/libffi-3.4.2-backport-pr-722.patch" ) # bug 827215
-
-src_prepare() {
-	if use experimental-loong; then
-		PATCHES+=( "${WORKDIR}/${MY_P}-loongarch64-20220428.patch" )
-	fi
-
-	default
-	if [[ ${CHOST} == arm64-*-darwin* ]] ; then
-		# ensure we use aarch64 asm, not x86 on arm64
-		sed -i -e 's/aarch64\*-\*-\*/arm64*-*-*|&/' \
-			configure configure.host || die
-	fi
-}
-
-multilib_src_configure() {
-	# --includedir= path maintains a few properties:
-	# 1. have stable name across libffi versions: some packages like
-	#    dev-lang/ghc or kde-frameworks/networkmanager-qt embed
-	#    ${includedir} at build-time. Don't require those to be
-	#    rebuilt unless SONAME changes. bug #695788
-	#
-	#    We use /usr/.../${PN} (instead of former /usr/.../${P}).
-	#
-	# 2. have ${ABI}-specific location as ffi.h is target-dependent.
-	#
-	#    We use /usr/$(get_libdir)/... to have ABI identifier.
-	econf \
-		--includedir="${EPREFIX}"/usr/$(get_libdir)/${PN}/include \
-		--disable-multi-os-directory \
-		$(use_enable static-libs static) \
-		$(use_enable exec-static-trampoline exec-static-tramp) \
-		$(use_enable pax-kernel pax_emutramp) \
-		$(use_enable debug)
-}
-
-multilib_src_install_all() {
-	find "${ED}" -name "*.la" -delete || die
-	einstalldocs
-}
-
-pkg_preinst() {
-	preserve_old_lib /usr/$(get_libdir)/libffi.so.7
-}
-
-pkg_postinst() {
-	preserve_old_lib_notify /usr/$(get_libdir)/libffi.so.7
-}

diff --git a/dev-libs/libffi/metadata.xml b/dev-libs/libffi/metadata.xml
index 01f91694bb53..aa5aa78f433f 100644
--- a/dev-libs/libffi/metadata.xml
+++ b/dev-libs/libffi/metadata.xml
@@ -35,7 +35,6 @@
 	</longdescription>
 	<use>
 		<flag name="exec-static-trampoline">Don't rely on dynamic code generation for trampolines.</flag>
-		<flag name="experimental-loong">Add experimental LoongArch patchset</flag>
 		<flag name="pax-kernel">Use PaX emulated trampolines, for we can't use PROT_EXEC</flag>
 	</use>
 	<upstream>


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-libs/libffi/files/, dev-libs/libffi/
@ 2023-04-03  6:40 Sam James
  0 siblings, 0 replies; 10+ messages in thread
From: Sam James @ 2023-04-03  6:40 UTC (permalink / raw
  To: gentoo-commits

commit:     109f9a231cf497b2869191aa884c573da5816059
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Apr  3 06:38:46 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Apr  3 06:39:51 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=109f9a23

dev-libs/libffi: backport HPPA improvements

Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../libffi-3.4.4-hppa-closure-function-ptrs.patch  | 170 ++++++++++++
 .../files/libffi-3.4.4-hppa-jump-table.patch       | 289 +++++++++++++++++++++
 .../files/libffi-3.4.4-hppa-large-struct.patch     |  36 +++
 dev-libs/libffi/libffi-3.4.4-r1.ebuild             |  76 ++++++
 4 files changed, 571 insertions(+)

diff --git a/dev-libs/libffi/files/libffi-3.4.4-hppa-closure-function-ptrs.patch b/dev-libs/libffi/files/libffi-3.4.4-hppa-closure-function-ptrs.patch
new file mode 100644
index 000000000000..065f35e7c4c2
--- /dev/null
+++ b/dev-libs/libffi/files/libffi-3.4.4-hppa-closure-function-ptrs.patch
@@ -0,0 +1,170 @@
+https://github.com/libffi/libffi/commit/e58e22b22386ed0e0a95e97eb8eed016e3f01b02
+
+From e58e22b22386ed0e0a95e97eb8eed016e3f01b02 Mon Sep 17 00:00:00 2001
+From: Anthony Green <green@moxielogic.com>
+Date: Thu, 2 Feb 2023 07:02:53 -0500
+Subject: [PATCH] From Dave Anglin:
+
+A couple of years ago the 32-bit hppa targets were converted from using a trampoline executed on the stack to the function descriptor technique used by ia64. This is more efficient and avoids having to have an executable stack. However, function pointers on 32-bit need the PLABEL bit set in the pointer. It distinguishes between pointers that point directly to the executable code and pointer that point to a function descriptor. We need the later for libffi. But as a result, it is not possible to convert using casts data pointers to function pointers.
+
+The solution at the time was to set the PLABEL bit in hppa closure pointers using FFI_CLOSURE_PTR. However, I realized recently that this was a bad choice. Packages like python-cffi allocate their own closure pointers, so this isn't going to work well there.
+
+A better solution is to leave closure pointers unchanged and only set the PLABEL bit in pointers used to point to executable code.
+
+The attached patch drops the FFI_CLOSURE_PTR and FFI_RESTORE_PTR defines. This allows some cleanup in the hppa closure routines. The FFI_FN define is now used to set the PLABEL bit on hppa. ffi_closure_alloc is modified to set the PLABEL bit in the value set in *code.
+
+I also added a FFI_CL define to convert a function pointer to a closure pointer. It is only used in one test case.
+--- a/include/ffi.h.in
++++ b/include/ffi.h.in
+@@ -361,14 +361,6 @@ typedef struct {
+ FFI_API void *ffi_closure_alloc (size_t size, void **code);
+ FFI_API void ffi_closure_free (void *);
+ 
+-#if defined(PA_LINUX) || defined(PA_HPUX)
+-#define FFI_CLOSURE_PTR(X) ((void *)((unsigned int)(X) | 2))
+-#define FFI_RESTORE_PTR(X) ((void *)((unsigned int)(X) & ~3))
+-#else
+-#define FFI_CLOSURE_PTR(X) (X)
+-#define FFI_RESTORE_PTR(X) (X)
+-#endif
+-
+ FFI_API ffi_status
+ ffi_prep_closure (ffi_closure*,
+ 		  ffi_cif *,
+@@ -515,8 +507,14 @@ FFI_API
+ ffi_status ffi_get_struct_offsets (ffi_abi abi, ffi_type *struct_type,
+ 				   size_t *offsets);
+ 
+-/* Useful for eliminating compiler warnings.  */
++/* Convert between closure and function pointers.  */
++#if defined(PA_LINUX) || defined(PA_HPUX)
++#define FFI_FN(f) ((void (*)(void))((unsigned int)(f) | 2))
++#define FFI_CL(f) ((void *)((unsigned int)(f) & ~3))
++#else
+ #define FFI_FN(f) ((void (*)(void))f)
++#define FFI_CL(f) ((void *)(f))
++#endif
+ 
+ /* ---- Definitions shared with assembly code ---------------------------- */
+ 
+--- a/src/closures.c
++++ b/src/closures.c
+@@ -993,23 +993,23 @@ ffi_closure_alloc (size_t size, void **code)
+   if (!code)
+     return NULL;
+ 
+-  ptr = FFI_CLOSURE_PTR (dlmalloc (size));
++  ptr = dlmalloc (size);
+ 
+   if (ptr)
+     {
+       msegmentptr seg = segment_holding (gm, ptr);
+ 
+-      *code = add_segment_exec_offset (ptr, seg);
++      *code = FFI_FN (add_segment_exec_offset (ptr, seg));
+       if (!ffi_tramp_is_supported ())
+         return ptr;
+ 
+       ftramp = ffi_tramp_alloc (0);
+       if (ftramp == NULL)
+       {
+-        dlfree (FFI_RESTORE_PTR (ptr));
++        dlfree (ptr);
+         return NULL;
+       }
+-      *code = ffi_tramp_get_addr (ftramp);
++      *code = FFI_FN (ffi_tramp_get_addr (ftramp));
+       ((ffi_closure *) ptr)->ftramp = ftramp;
+     }
+ 
+@@ -1050,7 +1050,7 @@ ffi_closure_free (void *ptr)
+   if (ffi_tramp_is_supported ())
+     ffi_tramp_free (((ffi_closure *) ptr)->ftramp);
+ 
+-  dlfree (FFI_RESTORE_PTR (ptr));
++  dlfree (ptr);
+ }
+ 
+ int
+@@ -1070,16 +1070,20 @@ ffi_tramp_is_present (void *ptr)
+ void *
+ ffi_closure_alloc (size_t size, void **code)
+ {
++  void *c;
++
+   if (!code)
+     return NULL;
+ 
+-  return *code = FFI_CLOSURE_PTR (malloc (size));
++  c = malloc (size);
++  *code = FFI_FN (c);
++  return c;
+ }
+ 
+ void
+ ffi_closure_free (void *ptr)
+ {
+-  free (FFI_RESTORE_PTR (ptr));
++  free (ptr);
+ }
+ 
+ void *
+--- a/src/pa/ffi.c
++++ b/src/pa/ffi.c
+@@ -445,7 +445,6 @@ ffi_status ffi_closure_inner_pa32(ffi_closure *closure, UINT32 *stack)
+   int i, avn;
+   unsigned int slot = FIRST_ARG_SLOT;
+   register UINT32 r28 asm("r28");
+-  ffi_closure *c = (ffi_closure *)FFI_RESTORE_PTR (closure);
+ 
+   cif = closure->cif;
+ 
+@@ -548,7 +547,7 @@ ffi_status ffi_closure_inner_pa32(ffi_closure *closure, UINT32 *stack)
+     }
+ 
+   /* Invoke the closure.  */
+-  (c->fun) (cif, rvalue, avalue, c->user_data);
++  (closure->fun) (cif, rvalue, avalue, closure->user_data);
+ 
+   debug(3, "after calling function, ret[0] = %08x, ret[1] = %08x\n", u.ret[0],
+ 	u.ret[1]);
+@@ -649,8 +648,6 @@ ffi_prep_closure_loc (ffi_closure* closure,
+ 		      void *user_data,
+ 		      void *codeloc)
+ {
+-  ffi_closure *c = (ffi_closure *)FFI_RESTORE_PTR (closure);
+-
+   /* The layout of a function descriptor.  A function pointer with the PLABEL
+      bit set points to a function descriptor.  */
+   struct pa32_fd
+@@ -676,14 +673,14 @@ ffi_prep_closure_loc (ffi_closure* closure,
+   fd = (struct pa32_fd *)((UINT32)ffi_closure_pa32 & ~3);
+ 
+   /* Setup trampoline.  */
+-  tramp = (struct ffi_pa32_trampoline_struct *)c->tramp;
++  tramp = (struct ffi_pa32_trampoline_struct *)closure->tramp;
+   tramp->code_pointer = fd->code_pointer;
+   tramp->fake_gp = (UINT32)codeloc & ~3;
+   tramp->real_gp = fd->gp;
+ 
+-  c->cif  = cif;
+-  c->user_data = user_data;
+-  c->fun  = fun;
++  closure->cif  = cif;
++  closure->user_data = user_data;
++  closure->fun  = fun;
+ 
+   return FFI_OK;
+ }
+--- a/testsuite/libffi.closures/closure_loc_fn0.c
++++ b/testsuite/libffi.closures/closure_loc_fn0.c
+@@ -85,7 +85,7 @@ int main (void)
+ 
+ #ifndef FFI_EXEC_STATIC_TRAMP
+   /* With static trampolines, the codeloc does not point to closure */
+-  CHECK(memcmp(pcl, codeloc, sizeof(*pcl)) == 0);
++  CHECK(memcmp(pcl, FFI_CL(codeloc), sizeof(*pcl)) == 0);
+ #endif
+ 
+   res = (*((closure_loc_test_type0)codeloc))
+

diff --git a/dev-libs/libffi/files/libffi-3.4.4-hppa-jump-table.patch b/dev-libs/libffi/files/libffi-3.4.4-hppa-jump-table.patch
new file mode 100644
index 000000000000..822a7eb893ec
--- /dev/null
+++ b/dev-libs/libffi/files/libffi-3.4.4-hppa-jump-table.patch
@@ -0,0 +1,289 @@
+https://github.com/libffi/libffi/commit/222abd0c65babe2174b21753217145f5031a8b91
+
+From 222abd0c65babe2174b21753217145f5031a8b91 Mon Sep 17 00:00:00 2001
+From: Anthony Green <green@moxielogic.com>
+Date: Thu, 2 Feb 2023 07:04:55 -0500
+Subject: [PATCH] From Dave Anglin:
+
+This patch is derived from the work done in implementing libffi for 64-bit hppa64-hpux target. Currently, the 32-bit hppa targets do a linear search for the return type of an ffi_call. This is slow and inefficient. A jump table can used to jump directly to the code used to process the return value. In most common cases, the return value can be processed in the jump table itself.
+
+The patch also fixes return handling for FFI_TYPE_UINT8, FFI_TYPE_SINT8, FFI_TYPE_UINT16 and FFI_TYPE_SINT16.
+--- a/src/pa/ffi.c
++++ b/src/pa/ffi.c
+@@ -56,27 +56,12 @@ static inline int ffi_struct_type(ffi_type *t)
+   size_t sz = t->size;
+ 
+   /* Small structure results are passed in registers,
+-     larger ones are passed by pointer.  Note that
+-     small structures of size 2, 4 and 8 differ from
+-     the corresponding integer types in that they have
+-     different alignment requirements.  */
+-
+-  if (sz <= 1)
+-    return FFI_TYPE_UINT8;
+-  else if (sz == 2)
+-    return FFI_TYPE_SMALL_STRUCT2;
+-  else if (sz == 3)
+-    return FFI_TYPE_SMALL_STRUCT3;
+-  else if (sz == 4)
+-    return FFI_TYPE_SMALL_STRUCT4;
+-  else if (sz == 5)
+-    return FFI_TYPE_SMALL_STRUCT5;
+-  else if (sz == 6)
+-    return FFI_TYPE_SMALL_STRUCT6;
+-  else if (sz == 7)
+-    return FFI_TYPE_SMALL_STRUCT7;
+-  else if (sz <= 8)
+-    return FFI_TYPE_SMALL_STRUCT8;
++     larger ones are passed by pointer.  Note that small
++     structures differ from the corresponding integer
++     types in that they have different alignment requirements.  */
++
++  if (sz <= 8)
++    return -sz;
+   else
+     return FFI_TYPE_STRUCT; /* else, we pass it by pointer.  */
+ }
+@@ -556,16 +541,16 @@ ffi_status ffi_closure_inner_pa32(ffi_closure *closure, UINT32 *stack)
+   switch (cif->flags)
+     {
+     case FFI_TYPE_UINT8:
+-      *(stack - FIRST_ARG_SLOT) = (UINT8)(u.ret[0] >> 24);
++      *(stack - FIRST_ARG_SLOT) = (UINT8)u.ret[0];
+       break;
+     case FFI_TYPE_SINT8:
+-      *(stack - FIRST_ARG_SLOT) = (SINT8)(u.ret[0] >> 24);
++      *(stack - FIRST_ARG_SLOT) = (SINT8)u.ret[0];
+       break;
+     case FFI_TYPE_UINT16:
+-      *(stack - FIRST_ARG_SLOT) = (UINT16)(u.ret[0] >> 16);
++      *(stack - FIRST_ARG_SLOT) = (UINT16)u.ret[0];
+       break;
+     case FFI_TYPE_SINT16:
+-      *(stack - FIRST_ARG_SLOT) = (SINT16)(u.ret[0] >> 16);
++      *(stack - FIRST_ARG_SLOT) = (SINT16)u.ret[0];
+       break;
+     case FFI_TYPE_INT:
+     case FFI_TYPE_SINT32:
+@@ -590,6 +575,7 @@ ffi_status ffi_closure_inner_pa32(ffi_closure *closure, UINT32 *stack)
+       /* Don't need a return value, done by caller.  */
+       break;
+ 
++    case FFI_TYPE_SMALL_STRUCT1:
+     case FFI_TYPE_SMALL_STRUCT2:
+     case FFI_TYPE_SMALL_STRUCT3:
+     case FFI_TYPE_SMALL_STRUCT4:
+--- a/src/pa/ffitarget.h
++++ b/src/pa/ffitarget.h
+@@ -73,11 +73,22 @@ typedef enum ffi_abi {
+ #define FFI_TRAMPOLINE_SIZE 12
+ #endif
+ 
+-#define FFI_TYPE_SMALL_STRUCT2 -1
+-#define FFI_TYPE_SMALL_STRUCT3 -2
+-#define FFI_TYPE_SMALL_STRUCT4 -3
+-#define FFI_TYPE_SMALL_STRUCT5 -4
+-#define FFI_TYPE_SMALL_STRUCT6 -5
+-#define FFI_TYPE_SMALL_STRUCT7 -6
+-#define FFI_TYPE_SMALL_STRUCT8 -7
++#define FFI_TYPE_SMALL_STRUCT1 -1
++#define FFI_TYPE_SMALL_STRUCT2 -2
++#define FFI_TYPE_SMALL_STRUCT3 -3
++#define FFI_TYPE_SMALL_STRUCT4 -4
++#define FFI_TYPE_SMALL_STRUCT5 -5
++#define FFI_TYPE_SMALL_STRUCT6 -6
++#define FFI_TYPE_SMALL_STRUCT7 -7
++#define FFI_TYPE_SMALL_STRUCT8 -8
++
++/* linux.S and hpux32.S expect FFI_TYPE_COMPLEX is the last generic type.  */
++#define FFI_PA_TYPE_LAST FFI_TYPE_COMPLEX
++
++/* If new generic types are added, the jump tables in linux.S and hpux32.S
++   likely need updating.  */
++#if FFI_TYPE_LAST != FFI_PA_TYPE_LAST
++# error "You likely have broken jump tables"
++#endif
++
+ #endif
+
+--- a/src/pa/linux.S
++++ b/src/pa/linux.S
+@@ -103,51 +103,103 @@ ffi_call_pa32:
+ 
+ 	/* Prepare to store the result; we need to recover flags and rvalue.  */
+ 	ldw -48(%r3), %r21                      /* r21 <- flags */
+-	ldw -52(%r3), %r20                      /* r20 <- rvalue */
+ 
+-	/* Store the result according to the return type.  */
++	/* Adjust flags range from [-8, 15] to  [0, 23].  */
++	addi 8, %r21, %r21
+ 
+-.Lcheckint:
+-	comib,<>,n FFI_TYPE_INT, %r21, .Lcheckint8
+-	b	.Ldone
+-	stw	%ret0, 0(%r20)
++	blr %r21, %r0
++	ldw -52(%r3), %r20                      /* r20 <- rvalue */
+ 
+-.Lcheckint8:
+-	comib,<>,n FFI_TYPE_UINT8, %r21, .Lcheckint16
++	/* Giant jump table */
++	/* 8-byte small struct */
++	b,n	.Lsmst8
++	nop
++	/* 7-byte small struct */
++	b,n	.Lsmst7
++	nop
++	/* 6-byte small struct */
++	b,n	.Lsmst6
++	nop
++	/* 5-byte small struct */
++	b,n	.Lsmst5
++	nop
++	/* 4-byte small struct */
++	b,n	.Lsmst4
++	nop
++	/* 3-byte small struct */
++	b,n	.Lsmst3
++	nop
++	/* 2-byte small struct */
++	b,n	.Lsmst2
++	nop
++	/* 1-byte small struct */
+ 	b	.Ldone
+ 	stb	%ret0, 0(%r20)
+-
+-.Lcheckint16:
+-	comib,<>,n FFI_TYPE_UINT16, %r21, .Lcheckdbl
++	/* void */
++	b,n	.Ldone
++	nop
++	/* int */
+ 	b	.Ldone
+-	sth	%ret0, 0(%r20)
+-
+-.Lcheckdbl:
+-	comib,<>,n FFI_TYPE_DOUBLE, %r21, .Lcheckfloat
++	stw	%ret0, 0(%r20)
++	/* float */
++	b	.Ldone
++	fstw	%fr4L,0(%r20)
++	/* double */
+ 	b	.Ldone
+ 	fstd	%fr4,0(%r20)
+-
+-.Lcheckfloat:
+-	comib,<>,n FFI_TYPE_FLOAT, %r21, .Lcheckll
++	/* long double */
+ 	b	.Ldone
+-	fstw	%fr4L,0(%r20)
++	fstd	%fr4,0(%r20)
++	/* unsigned int8 */
++	b	.Ldone
++	stw	%ret0, 0(%r20)
++	/* sint8 */
++	b	.Ldone
++	stw	%ret0, 0(%r20)
++	/* unsigned int16 */
++	b	.Ldone
++	stw	%ret0, 0(%r20)
++	/* sint16 */
++	b	.Ldone
++	stw	%ret0, 0(%r20)
++	/* unsigned int32 */
++	b	.Ldone
++	stw	%ret0, 0(%r20)
++	/* sint32 */
++	b	.Ldone
++	stw	%ret0, 0(%r20)
++	/* unsigned int64 */
++	b,n	.Luint64
++	nop
++	/* signed int64 */
++	b,n	.Lsint64
++	nop
++	/* large struct */
++	b,n	.Ldone
++	nop
++	/* pointer */
++	b	.Ldone
++	stw	%ret0, 0(%r20)
++	/* complex */
++	b,n	.Ldone
++	nop
++
++	/* Store the result according to the return type.  */
+ 
+-.Lcheckll:
+-	comib,<>,n FFI_TYPE_UINT64, %r21, .Lchecksmst2
++.Luint64:
++.Lsint64:
+ 	stw	%ret0, 0(%r20)
+ 	b	.Ldone
+ 	stw	%ret1, 4(%r20)
+ 
+-.Lchecksmst2:
+-	comib,<>,n FFI_TYPE_SMALL_STRUCT2, %r21, .Lchecksmst3
++.Lsmst2:
+ 	/* 2-byte structs are returned in ret0 as ????xxyy.  */
+ 	extru	%ret0, 23, 8, %r22
+ 	stbs,ma	%r22, 1(%r20)
+ 	b	.Ldone
+ 	stb	%ret0, 0(%r20)
+ 
+-.Lchecksmst3:
+-	comib,<>,n FFI_TYPE_SMALL_STRUCT3, %r21, .Lchecksmst4
++.Lsmst3:
+ 	/* 3-byte structs are returned in ret0 as ??xxyyzz.  */
+ 	extru	%ret0, 15, 8, %r22
+ 	stbs,ma	%r22, 1(%r20)
+@@ -156,8 +208,7 @@ ffi_call_pa32:
+ 	b	.Ldone
+ 	stb	%ret0, 0(%r20)
+ 
+-.Lchecksmst4:
+-	comib,<>,n FFI_TYPE_SMALL_STRUCT4, %r21, .Lchecksmst5
++.Lsmst4:
+ 	/* 4-byte structs are returned in ret0 as wwxxyyzz.  */
+ 	extru	%ret0, 7, 8, %r22
+ 	stbs,ma	%r22, 1(%r20)
+@@ -168,8 +219,7 @@ ffi_call_pa32:
+ 	b	.Ldone
+ 	stb	%ret0, 0(%r20)
+ 
+-.Lchecksmst5:
+-	comib,<>,n FFI_TYPE_SMALL_STRUCT5, %r21, .Lchecksmst6
++.Lsmst5:
+ 	/* 5 byte values are returned right justified:
+ 	      ret0     ret1
+ 	   5: ??????aa bbccddee */
+@@ -183,8 +233,7 @@ ffi_call_pa32:
+ 	b	.Ldone
+ 	stb	%ret1, 0(%r20)
+ 
+-.Lchecksmst6:
+-	comib,<>,n FFI_TYPE_SMALL_STRUCT6, %r21, .Lchecksmst7
++.Lsmst6:
+ 	/* 6 byte values are returned right justified:
+ 	      ret0     ret1
+ 	   6: ????aabb ccddeeff */
+@@ -200,8 +249,7 @@ ffi_call_pa32:
+ 	b	.Ldone
+ 	stb	%ret1, 0(%r20)
+ 
+-.Lchecksmst7:
+-	comib,<>,n FFI_TYPE_SMALL_STRUCT7, %r21, .Lchecksmst8
++.Lsmst7:
+ 	/* 7 byte values are returned right justified:
+ 	      ret0     ret1
+ 	   7: ??aabbcc ddeeffgg */
+@@ -219,8 +267,7 @@ ffi_call_pa32:
+ 	b	.Ldone
+ 	stb	%ret1, 0(%r20)
+ 
+-.Lchecksmst8:
+-	comib,<>,n FFI_TYPE_SMALL_STRUCT8, %r21, .Ldone
++.Lsmst8:
+ 	/* 8 byte values are returned right justified:
+ 	      ret0     ret1
+ 	   8: aabbccdd eeffgghh */

diff --git a/dev-libs/libffi/files/libffi-3.4.4-hppa-large-struct.patch b/dev-libs/libffi/files/libffi-3.4.4-hppa-large-struct.patch
new file mode 100644
index 000000000000..aaf4af368432
--- /dev/null
+++ b/dev-libs/libffi/files/libffi-3.4.4-hppa-large-struct.patch
@@ -0,0 +1,36 @@
+https://github.com/libffi/libffi/commit/c50c16d0bcb58952840184aa83e62c6d912bf779
+
+From c50c16d0bcb58952840184aa83e62c6d912bf779 Mon Sep 17 00:00:00 2001
+From: Anthony Green <green@moxielogic.com>
+Date: Sun, 20 Nov 2022 12:20:40 -0500
+Subject: [PATCH] Fix large struct passing on PA-RISC
+
+--- a/src/pa/ffi.c
++++ b/src/pa/ffi.c
+@@ -376,10 +376,26 @@ extern void ffi_call_pa32(void (*)(UINT32 *, extended_cif *, unsigned),
+ void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
+ {
+   extended_cif ecif;
++  size_t i, nargs = cif->nargs;
++  ffi_type **arg_types = cif->arg_types;
+ 
+   ecif.cif = cif;
+   ecif.avalue = avalue;
+ 
++  /* If we have any large structure arguments, make a copy so we are passing
++     by value.  */
++  for (i = 0; i < nargs; i++)
++    {
++      ffi_type *at = arg_types[i];
++      int size = at->size;
++      if (at->type == FFI_TYPE_STRUCT && size > 8)
++	{
++	  char *argcopy = alloca (size);
++	  memcpy (argcopy, avalue[i], size);
++	  avalue[i] = argcopy;
++	}
++    }
++
+   /* If the return value is a struct and we don't have a return
+      value address then we need to make one.  */
+ 

diff --git a/dev-libs/libffi/libffi-3.4.4-r1.ebuild b/dev-libs/libffi/libffi-3.4.4-r1.ebuild
new file mode 100644
index 000000000000..8d8ab583df15
--- /dev/null
+++ b/dev-libs/libffi/libffi-3.4.4-r1.ebuild
@@ -0,0 +1,76 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit multilib-minimal preserve-libs
+
+MY_PV=${PV/_rc/-rc}
+MY_P=${PN}-${MY_PV}
+
+DESCRIPTION="a portable, high level programming interface to various calling conventions"
+HOMEPAGE="https://sourceware.org/libffi/"
+SRC_URI="https://github.com/libffi/libffi/releases/download/v${MY_PV}/${MY_P}.tar.gz"
+S="${WORKDIR}"/${MY_P}
+
+LICENSE="MIT"
+# This is a core package which is depended on by e.g. Python
+# Please use preserve-libs.eclass in pkg_{pre,post}inst to cover users
+# with FEATURES="-preserved-libs" or another package manager if SONAME
+# changes.
+SLOT="0/8" # SONAME=libffi.so.8
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="debug exec-static-trampoline pax-kernel static-libs test"
+
+RESTRICT="!test? ( test )"
+BDEPEND="test? ( dev-util/dejagnu )"
+
+PATCHES=(
+	"${FILESDIR}"/${P}-hppa-large-struct.patch
+	"${FILESDIR}"/${P}-hppa-closure-function-ptrs.patch
+	"${FILESDIR}"/${P}-hppa-jump-table.patch
+)
+
+src_prepare() {
+	default
+
+	if [[ ${CHOST} == arm64-*-darwin* ]] ; then
+		# ensure we use aarch64 asm, not x86 on arm64
+		sed -i -e 's/aarch64\*-\*-\*/arm64*-*-*|&/' \
+			configure configure.host || die
+	fi
+}
+
+multilib_src_configure() {
+	# --includedir= path maintains a few properties:
+	# 1. have stable name across libffi versions: some packages like
+	#    dev-lang/ghc or kde-frameworks/networkmanager-qt embed
+	#    ${includedir} at build-time. Don't require those to be
+	#    rebuilt unless SONAME changes. bug #695788
+	#
+	#    We use /usr/.../${PN} (instead of former /usr/.../${P}).
+	#
+	# 2. have ${ABI}-specific location as ffi.h is target-dependent.
+	#
+	#    We use /usr/$(get_libdir)/... to have ABI identifier.
+	ECONF_SOURCE="${S}" econf \
+		--includedir="${EPREFIX}"/usr/$(get_libdir)/${PN}/include \
+		--disable-multi-os-directory \
+		$(use_enable static-libs static) \
+		$(use_enable exec-static-trampoline exec-static-tramp) \
+		$(use_enable pax-kernel pax_emutramp) \
+		$(use_enable debug)
+}
+
+multilib_src_install_all() {
+	einstalldocs
+	find "${ED}" -name "*.la" -delete || die
+}
+
+pkg_preinst() {
+	preserve_old_lib /usr/$(get_libdir)/libffi.so.7
+}
+
+pkg_postinst() {
+	preserve_old_lib_notify /usr/$(get_libdir)/libffi.so.7
+}


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-libs/libffi/files/, dev-libs/libffi/
@ 2024-10-16  3:11 Sam James
  0 siblings, 0 replies; 10+ messages in thread
From: Sam James @ 2024-10-16  3:11 UTC (permalink / raw
  To: gentoo-commits

commit:     6521e1f5d4cceb00f082def621d7e28b7788b7f5
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Oct 16 03:08:22 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Oct 16 03:08:22 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6521e1f5

dev-libs/libffi: backport several patches to 3.4.6

Backport first a fix for arm64 CFI which fixes build w/ the macOS
assembler (reported by olfway on IRC when looking at https://github.com/gentoo/prefix/pull/34).

While here, backport a few more fixes:
* runtime: sparc: struct args
* runtime: x86: sse
* tests: fix dg-* typo

Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-libs/libffi/files/libffi-3.4.6-arm64-cfi.patch |  44 ++++++++
 .../files/libffi-3.4.6-sparc-struct-targs.patch    |  46 ++++++++
 dev-libs/libffi/files/libffi-3.4.6-test-typo.patch |  19 ++++
 dev-libs/libffi/files/libffi-3.4.6-x86-sse.patch   | 124 +++++++++++++++++++++
 dev-libs/libffi/libffi-3.4.6-r1.ebuild             |  80 +++++++++++++
 5 files changed, 313 insertions(+)

diff --git a/dev-libs/libffi/files/libffi-3.4.6-arm64-cfi.patch b/dev-libs/libffi/files/libffi-3.4.6-arm64-cfi.patch
new file mode 100644
index 000000000000..0eb4cf807f3b
--- /dev/null
+++ b/dev-libs/libffi/files/libffi-3.4.6-arm64-cfi.patch
@@ -0,0 +1,44 @@
+https://github.com/libffi/libffi/pull/857
+https://github.com/libffi/libffi/commit/8308bed5b2423878aa20d7884a99cf2e30b8daf7
+
+From 3065c530d3aa50c2b5ee9c01f88a9c0b61732805 Mon Sep 17 00:00:00 2001
+From: Ivan Tadeu Ferreira Antunes Filho <antunesi@google.com>
+Date: Mon, 16 Sep 2024 16:10:39 -0400
+Subject: [PATCH] Move cfi_startproc after CNAME(label)
+
+This is a fix for https://github.com/libffi/libffi/issues/852: error: invalid CFI advance_loc expression on apple targets.
+
+The CFI for darwin arm64 was broken because the CNAME macro was being used after the
+cfi_startproc macro.
+--- a/src/aarch64/sysv.S
++++ b/src/aarch64/sysv.S
+@@ -89,8 +89,8 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  */
+    x5 closure
+ */
+ 
+-	cfi_startproc
+ CNAME(ffi_call_SYSV):
++	cfi_startproc
+ 	BTI_C
+ 	PAC_CFI_WINDOW_SAVE
+ 	/* Sign the lr with x1 since that is the CFA which is the modifer used in auth instructions */
+@@ -348,8 +348,8 @@ CNAME(ffi_closure_SYSV_V):
+ #endif
+ 
+ 	.align	4
+-	cfi_startproc
+ CNAME(ffi_closure_SYSV):
++	cfi_startproc
+ 	BTI_C
+ 	SIGN_LR
+ 	PAC_CFI_WINDOW_SAVE
+@@ -647,8 +647,8 @@ CNAME(ffi_go_closure_SYSV_V):
+ #endif
+ 
+ 	.align	4
+-	cfi_startproc
+ CNAME(ffi_go_closure_SYSV):
++	cfi_startproc
+ 	BTI_C
+ 	SIGN_LR_LINUX_ONLY
+ 	PAC_CFI_WINDOW_SAVE

diff --git a/dev-libs/libffi/files/libffi-3.4.6-sparc-struct-targs.patch b/dev-libs/libffi/files/libffi-3.4.6-sparc-struct-targs.patch
new file mode 100644
index 000000000000..f5eebad9edd7
--- /dev/null
+++ b/dev-libs/libffi/files/libffi-3.4.6-sparc-struct-targs.patch
@@ -0,0 +1,46 @@
+https://github.com/libffi/libffi/commit/8e3ef965c2d0015ed129a06d0f11f30c2120a413
+
+From 8e3ef965c2d0015ed129a06d0f11f30c2120a413 Mon Sep 17 00:00:00 2001
+From: Anthony Green <green@moxielogic.com>
+Date: Fri, 28 Jun 2024 04:07:09 -0400
+Subject: [PATCH] Fix struct args (Rainer Orth)
+
+---
+ src/sparc/ffi.c | 16 ++++++++++++++++
+ 1 file changed, 16 insertions(+)
+
+diff --git a/src/sparc/ffi.c b/src/sparc/ffi.c
+index 9e406d0af..cf819ee67 100644
+--- a/src/sparc/ffi.c
++++ b/src/sparc/ffi.c
+@@ -286,6 +286,8 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue,
+ 	      void **avalue, void *closure)
+ {
+   size_t bytes = cif->bytes;
++  size_t i, nargs = cif->nargs;
++  ffi_type **arg_types = cif->arg_types;
+ 
+   FFI_ASSERT (cif->abi == FFI_V8);
+ 
+@@ -295,6 +297,20 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue,
+       && (cif->flags & SPARC_FLAG_RET_MASK) == SPARC_RET_STRUCT)
+     bytes += FFI_ALIGN (cif->rtype->size, 8);
+ 
++  /* If we have any structure arguments, make a copy so we are passing
++     by value.  */
++  for (i = 0; i < nargs; i++)
++    {
++      ffi_type *at = arg_types[i];
++      int size = at->size;
++      if (at->type == FFI_TYPE_STRUCT)
++        {
++          char *argcopy = alloca (size);
++          memcpy (argcopy, avalue[i], size);
++          avalue[i] = argcopy;
++        }
++    }
++
+   ffi_call_v8(cif, fn, rvalue, avalue, -bytes, closure);
+ }
+ 
+

diff --git a/dev-libs/libffi/files/libffi-3.4.6-test-typo.patch b/dev-libs/libffi/files/libffi-3.4.6-test-typo.patch
new file mode 100644
index 000000000000..78beab646470
--- /dev/null
+++ b/dev-libs/libffi/files/libffi-3.4.6-test-typo.patch
@@ -0,0 +1,19 @@
+https://github.com/libffi/libffi/commit/f7e4992789fa563b4cc74521c37ff703555da21c
+
+From f7e4992789fa563b4cc74521c37ff703555da21c Mon Sep 17 00:00:00 2001
+From: Sam James <sam@cmpct.info>
+Date: Fri, 20 Sep 2024 10:58:06 +0100
+Subject: [PATCH] testsuite: fix dejagnu directive typo (#859)
+
+--- a/testsuite/libffi.complex/complex_int.c
++++ b/testsuite/libffi.complex/complex_int.c
+@@ -76,7 +76,7 @@ int main (void)
+ 
+   printf ("%d,%di %d,%di, x %d 1234, y %d 11110\n",
+ 	  (int)tc_result, (int)(tc_result * -I), 2, 8, tc_int_arg_x, tc_y);
+-  /* dg-output "-2,8i 2,8i, x 1234 1234, y 11110 11110" */
++  /* { dg-output "-2,8i 2,8i, x 1234 1234, y 11110 11110" } */
+   CHECK (creal (tc_result) == -2);
+   CHECK (cimag (tc_result) == 8);
+   CHECK (tc_int_arg_x == 1234);
+

diff --git a/dev-libs/libffi/files/libffi-3.4.6-x86-sse.patch b/dev-libs/libffi/files/libffi-3.4.6-x86-sse.patch
new file mode 100644
index 000000000000..75c0e892ef3a
--- /dev/null
+++ b/dev-libs/libffi/files/libffi-3.4.6-x86-sse.patch
@@ -0,0 +1,124 @@
+https://github.com/libffi/libffi/commit/d21881f55ed4a44d464c9091871e69b0bb47611a
+
+From d21881f55ed4a44d464c9091871e69b0bb47611a Mon Sep 17 00:00:00 2001
+From: kellda <59569234+kellda@users.noreply.github.com>
+Date: Sun, 15 Sep 2024 13:29:42 +0200
+Subject: [PATCH] Fix x86/ffi64 calls with 6 gp and some sse registers (#848)
+
+* Fix x86/ffi64 calls with 6 gp and some sse registers
+
+* Add test demonstating issue when mixing gp and sse registers
+---
+ src/x86/ffi64.c                          |  2 +-
+ testsuite/libffi.call/struct_int_float.c | 88 ++++++++++++++++++++++++
+ 2 files changed, 89 insertions(+), 1 deletion(-)
+ create mode 100644 testsuite/libffi.call/struct_int_float.c
+
+diff --git a/src/x86/ffi64.c b/src/x86/ffi64.c
+index 6a8e37fc5..39f0bfd33 100644
+--- a/src/x86/ffi64.c
++++ b/src/x86/ffi64.c
+@@ -651,7 +651,7 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue,
+ 		      break;
+ 		    default:
+ 		      reg_args->gpr[gprcount] = 0;
+-		      memcpy (&reg_args->gpr[gprcount], a, size);
++		      memcpy (&reg_args->gpr[gprcount], a, sizeof(UINT64));
+ 		    }
+ 		  gprcount++;
+ 		  break;
+diff --git a/testsuite/libffi.call/struct_int_float.c b/testsuite/libffi.call/struct_int_float.c
+new file mode 100644
+index 000000000..dab1d1fed
+--- /dev/null
++++ b/testsuite/libffi.call/struct_int_float.c
+@@ -0,0 +1,88 @@
++/* Area:	ffi_call
++   Purpose:	Demonstrate structures with integers corrupting earlier floats
++   Limitations:	none.
++   PR:		#848
++   Originator:	kellda  */
++
++/* { dg-do run } */
++#include "ffitest.h"
++
++typedef struct
++{
++  unsigned long i;
++  float f;
++} test_structure_int_float;
++
++static float ABI_ATTR struct_int_float(test_structure_int_float ts1,
++                                       test_structure_int_float ts2,
++                                       test_structure_int_float ts3,
++                                       test_structure_int_float ts4,
++                                       test_structure_int_float ts5,
++                                       test_structure_int_float ts6)
++{
++  return ts1.f;
++}
++
++int main (void)
++{
++  ffi_cif cif;
++  ffi_type *args[MAX_ARGS];
++  void *values[MAX_ARGS];
++  ffi_type ts_type;
++  ffi_type *ts_type_elements[3];
++  float rfloat;
++
++  test_structure_int_float ts_arg[6];
++
++  ts_type.size = 0;
++  ts_type.alignment = 0;
++  ts_type.type = FFI_TYPE_STRUCT;
++  ts_type.elements = ts_type_elements;
++  ts_type_elements[0] = &ffi_type_ulong;
++  ts_type_elements[1] = &ffi_type_float;
++  ts_type_elements[2] = NULL;
++
++  args[0] = &ts_type;
++  values[0] = &ts_arg[0];
++  args[1] = &ts_type;
++  values[1] = &ts_arg[1];
++  args[2] = &ts_type;
++  values[2] = &ts_arg[2];
++  args[3] = &ts_type;
++  values[3] = &ts_arg[3];
++  args[4] = &ts_type;
++  values[4] = &ts_arg[4];
++  args[5] = &ts_type;
++  values[5] = &ts_arg[5];
++  
++  /* Initialize the cif */
++  CHECK(ffi_prep_cif(&cif, ABI_NUM, 6, &ffi_type_float, args) == FFI_OK);
++  
++  ts_arg[0].i = 1;
++  ts_arg[0].f = 1.11f;
++  ts_arg[1].i = 2;
++  ts_arg[1].f = 2.22f;
++  ts_arg[2].i = 3;
++  ts_arg[2].f = 3.33f;
++  ts_arg[3].i = 4;
++  ts_arg[3].f = 4.44f;
++  ts_arg[4].i = 5;
++  ts_arg[4].f = 5.55f;
++  ts_arg[5].i = 6;
++  ts_arg[5].f = 6.66f;
++  
++  printf ("%g\n", ts_arg[0].f);
++  printf ("%g\n", ts_arg[1].f);
++  printf ("%g\n", ts_arg[2].f);
++  printf ("%g\n", ts_arg[3].f);
++  printf ("%g\n", ts_arg[4].f);
++  printf ("%g\n", ts_arg[5].f);
++  
++  ffi_call(&cif, FFI_FN(struct_int_float), &rfloat, values);
++
++  printf ("%g\n", rfloat);
++  
++  CHECK(rfloat == 1.11f);
++
++  exit(0);
++}
+

diff --git a/dev-libs/libffi/libffi-3.4.6-r1.ebuild b/dev-libs/libffi/libffi-3.4.6-r1.ebuild
new file mode 100644
index 000000000000..5ac383d4cbeb
--- /dev/null
+++ b/dev-libs/libffi/libffi-3.4.6-r1.ebuild
@@ -0,0 +1,80 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit multilib-minimal preserve-libs
+
+MY_PV=${PV/_rc/-rc}
+MY_P=${PN}-${MY_PV}
+
+DESCRIPTION="Portable, high level programming interface to various calling conventions"
+HOMEPAGE="https://sourceware.org/libffi/"
+SRC_URI="https://github.com/libffi/libffi/releases/download/v${MY_PV}/${MY_P}.tar.gz"
+S="${WORKDIR}"/${MY_P}
+
+LICENSE="MIT"
+# This is a core package which is depended on by e.g. Python.
+# Please use preserve-libs.eclass in pkg_{pre,post}inst to cover users
+# with FEATURES="-preserved-libs" or another package manager if SONAME changes.
+SLOT="0/8" # SONAME=libffi.so.8
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
+IUSE="debug exec-static-trampoline pax-kernel static-libs test"
+
+RESTRICT="!test? ( test )"
+BDEPEND="test? ( dev-util/dejagnu )"
+
+PATCHES=(
+	"${FILESDIR}"/${P}-arm64-cfi.patch
+	"${FILESDIR}"/${P}-sparc-struct-targs.patch
+	"${FILESDIR}"/${P}-test-typo.patch
+	"${FILESDIR}"/${P}-x86-sse.patch
+)
+
+src_prepare() {
+	default
+
+	if [[ ${CHOST} == arm64-*-darwin* ]] ; then
+		# ensure we use aarch64 asm, not x86 on arm64
+		sed -i -e 's/aarch64\*-\*-\*/arm64*-*-*|&/' \
+			configure configure.host || die
+	fi
+}
+
+multilib_src_configure() {
+	# --includedir= path maintains a few properties:
+	# 1. have stable name across libffi versions: some packages like
+	#    dev-lang/ghc or kde-frameworks/networkmanager-qt embed
+	#    ${includedir} at build-time. Don't require those to be
+	#    rebuilt unless SONAME changes. bug #695788
+	#
+	#    We use /usr/.../${PN} (instead of former /usr/.../${P}).
+	#
+	# 2. have ${ABI}-specific location as ffi.h is target-dependent.
+	#
+	#    We use /usr/$(get_libdir)/... to have ABI identifier.
+	ECONF_SOURCE="${S}" econf \
+		--includedir="${EPREFIX}"/usr/$(get_libdir)/${PN}/include \
+		--disable-multi-os-directory \
+		$(use_enable static-libs static) \
+		$(use_enable exec-static-trampoline exec-static-tramp) \
+		$(use_enable pax-kernel pax_emutramp) \
+		$(use_enable debug)
+}
+
+multilib_src_test() {
+	emake -Onone check
+}
+
+multilib_src_install_all() {
+	einstalldocs
+	find "${ED}" -name "*.la" -delete || die
+}
+
+pkg_preinst() {
+	preserve_old_lib /usr/$(get_libdir)/libffi.so.7
+}
+
+pkg_postinst() {
+	preserve_old_lib_notify /usr/$(get_libdir)/libffi.so.7
+}


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-libs/libffi/files/, dev-libs/libffi/
@ 2024-11-17  5:28 Sam James
  0 siblings, 0 replies; 10+ messages in thread
From: Sam James @ 2024-11-17  5:28 UTC (permalink / raw
  To: gentoo-commits

commit:     338780980540b326ee810f1a03e85b9ea446e17e
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Nov 17 05:27:59 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Nov 17 05:28:12 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=33878098

dev-libs/libffi: fix tests w/ C23

Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-libs/libffi/files/libffi-3.4.6-c23-tests.patch | 38 ++++++++++++++++++++++
 dev-libs/libffi/libffi-3.4.6-r2.ebuild             |  1 +
 2 files changed, 39 insertions(+)

diff --git a/dev-libs/libffi/files/libffi-3.4.6-c23-tests.patch b/dev-libs/libffi/files/libffi-3.4.6-c23-tests.patch
new file mode 100644
index 000000000000..dc53b120cd90
--- /dev/null
+++ b/dev-libs/libffi/files/libffi-3.4.6-c23-tests.patch
@@ -0,0 +1,38 @@
+https://github.com/libffi/libffi/commit/0859f8431242d5adff21420b9cab538d2af527b5
+
+From 0859f8431242d5adff21420b9cab538d2af527b5 Mon Sep 17 00:00:00 2001
+From: Joseph Myers <jsm@polyomino.org.uk>
+Date: Thu, 24 Oct 2024 18:26:58 +0000
+Subject: [PATCH] Fix testsuite for C23 `va_start` (#861)
+
+In the C23 revision of the C standard, `va_start` ignores its second
+argument, which is no longer required (previously the last named
+function parameter - which the compiler knows anyway, so it's
+redundant information).
+
+This has the consequence for the libffi testsuite, when making GCC
+default to `-std=gnu23`, of making two tests fail with warnings about
+an unused function argument (only passed to `va_start` and not
+otherwise used).  Fix those test failures by explicitly casting the
+argument to `void`.
+--- a/testsuite/libffi.call/va_struct2.c
++++ b/testsuite/libffi.call/va_struct2.c
+@@ -33,6 +33,7 @@ test_fn (int n, ...)
+   struct small_tag s2;
+   struct large_tag l;
+ 
++  (void) n;
+   va_start (ap, n);
+   s1 = va_arg (ap, struct small_tag);
+   l = va_arg (ap, struct large_tag);
+--- a/testsuite/libffi.call/va_struct3.c
++++ b/testsuite/libffi.call/va_struct3.c
+@@ -33,6 +33,7 @@ test_fn (int n, ...)
+   struct small_tag s2;
+   struct large_tag l;
+ 
++  (void) n;
+   va_start (ap, n);
+   s1 = va_arg (ap, struct small_tag);
+   l = va_arg (ap, struct large_tag);
+

diff --git a/dev-libs/libffi/libffi-3.4.6-r2.ebuild b/dev-libs/libffi/libffi-3.4.6-r2.ebuild
index 2235dc0d702f..61fa9d5ad843 100644
--- a/dev-libs/libffi/libffi-3.4.6-r2.ebuild
+++ b/dev-libs/libffi/libffi-3.4.6-r2.ebuild
@@ -44,6 +44,7 @@ PATCHES=(
 	"${FILESDIR}"/${P}-asan.patch
 	"${FILESDIR}"/${P}-tests.patch
 	"${FILESDIR}"/${P}-regenerate-autotools.patch
+	"${FILESDIR}"/${P}-c23-tests.patch
 )
 
 src_prepare() {


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-11-17  5:28 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-16  3:11 [gentoo-commits] repo/gentoo:master commit in: dev-libs/libffi/files/, dev-libs/libffi/ Sam James
  -- strict thread matches above, loose matches on Subject: below --
2024-11-17  5:28 Sam James
2023-04-03  6:40 Sam James
2023-01-21  1:05 Sam James
2021-06-26 22:15 Sergei Trofimovich
2021-06-26 21:37 Sergei Trofimovich
2020-11-11 19:37 Sergei Trofimovich
2019-09-19  7:29 Sergei Trofimovich
2018-12-10 13:12 Fabian Groffen
2017-06-21 21:51 Matthias Maier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox