diff --git a/sdk_container/src/third_party/portage-stable/dev-libs/libffi/Manifest b/sdk_container/src/third_party/portage-stable/dev-libs/libffi/Manifest index 8500e7a471..25ec05a4fe 100644 --- a/sdk_container/src/third_party/portage-stable/dev-libs/libffi/Manifest +++ b/sdk_container/src/third_party/portage-stable/dev-libs/libffi/Manifest @@ -1,2 +1,3 @@ DIST libffi-3.4.4.tar.gz 1362394 BLAKE2B 189fe1ffe9507f204581b0ab09995dc7e7b761bb4eac7e338e9f5ff81431aebcef6c182c1839c9f9acb2706697a260c67e6d1351cf7e2aed7c4eb5d694f6f8fd SHA512 88680aeb0fa0dc0319e5cd2ba45b4b5a340bc9b4bcf20b1e0613b39cd898f177a3863aa94034d8e23a7f6f44d858a53dcd36d1bb8dee13b751ef814224061889 DIST libffi-3.4.6.tar.gz 1391684 BLAKE2B af8402a09bdbd59b4e9400d2d71bd5ce98f6f1d981d35d1ab40d77a831b13b32c5bd34ca54ff75999e39f0d8a9c066381fae7a8d6c5216d955e064f929f08b88 SHA512 033d2600e879b83c6bce0eb80f69c5f32aa775bf2e962c9d39fbd21226fa19d1e79173d8eaa0d0157014d54509ea73315ad86842356fc3a303c0831c94c6ab39 +DIST libffi-3.4.7.tar.gz 1393979 BLAKE2B 0dd17b4fd358beb9842889168437443137445a5dba1f0a7e8669ae420d8efb927815c08602c1b1b141acfdfdbaa12b417863402a5c8df5f36519fd3e772d3f37 SHA512 d19f59a5b5d61bd7d9e8a7a74b8bf2e697201a19c247c410c789e93ca8678a4eb9f13c9bee19f129be80ade8514f6b1acb38d66f44d86edd32644ed7bbe31dd6 diff --git a/sdk_container/src/third_party/portage-stable/dev-libs/libffi/files/libffi-3.4.7-Revert-Fix-x86-ffi64-calls-with-6-gp-and-some-sse-re.patch b/sdk_container/src/third_party/portage-stable/dev-libs/libffi/files/libffi-3.4.7-Revert-Fix-x86-ffi64-calls-with-6-gp-and-some-sse-re.patch new file mode 100644 index 0000000000..a8958b2fef --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/dev-libs/libffi/files/libffi-3.4.7-Revert-Fix-x86-ffi64-calls-with-6-gp-and-some-sse-re.patch @@ -0,0 +1,38 @@ +From 4354fe1434a37b781ff19f5a6be51ec4e982ad5a Mon Sep 17 00:00:00 2001 +Message-ID: <4354fe1434a37b781ff19f5a6be51ec4e982ad5a.1739062746.git.sam@gentoo.org> +From: Sam James +Date: Sun, 9 Feb 2025 00:54:28 +0000 +Subject: [PATCH] Revert "Fix x86/ffi64 calls with 6 gp and some sse registers + (#848)" + +This reverts commit d21881f55ed4a44d464c9091871e69b0bb47611a. + +Bug: https://github.com/libffi/libffi/issues/879 +Bug: https://bugs.gentoo.org/949051 +Signed-off-by: Sam James +--- a/src/x86/ffi64.c ++++ b/src/x86/ffi64.c +@@ -654,7 +654,7 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue, + break; + default: + reg_args->gpr[gprcount] = 0; +- memcpy (®_args->gpr[gprcount], a, sizeof(UINT64)); ++ memcpy (®_args->gpr[gprcount], a, size); + } + gprcount++; + break; +--- a/testsuite/libffi.call/struct_int_float.c ++++ b/testsuite/libffi.call/struct_int_float.c +@@ -5,6 +5,7 @@ + Originator: kellda */ + + /* { dg-do run } */ ++/* { dg-skip-if "libffi bug #879" { *-*-* } { "*" } } */ + #include "ffitest.h" + + typedef struct + +base-commit: 1716f81e9a115d340429504563bc8e7fb2eeef2b +-- +2.48.1 + diff --git a/sdk_container/src/third_party/portage-stable/dev-libs/libffi/libffi-3.4.6-r3.ebuild b/sdk_container/src/third_party/portage-stable/dev-libs/libffi/libffi-3.4.6-r3.ebuild new file mode 100644 index 0000000000..91b74d8b3c --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/dev-libs/libffi/libffi-3.4.6-r3.ebuild @@ -0,0 +1,94 @@ +# Copyright 1999-2025 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/" + +if [[ ${PV} == 9999 ]] ; then + EGIT_REPO_URI="https://github.com/libffi/libffi" + inherit git-r3 +else + SRC_URI="https://github.com/libffi/libffi/releases/download/v${MY_PV}/${MY_P}.tar.gz" + + 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" +fi + +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 +IUSE="debug exec-static-trampoline pax-kernel static-libs test" + +RESTRICT="!test? ( test )" +BDEPEND="test? ( dev-util/dejagnu )" + +PATCHES=( + "${FILESDIR}"/${P}-arm64-bti.patch + "${FILESDIR}"/${P}-arm64-bti-spelling.patch + "${FILESDIR}"/${P}-arm64-support-pac.patch + "${FILESDIR}"/${P}-arm64-fix-build.patch + "${FILESDIR}"/${P}-sparc-struct-targs.patch + "${FILESDIR}"/${P}-test-typo.patch + "${FILESDIR}"/${P}-arm64-cfi.patch + "${FILESDIR}"/${P}-asan.patch + "${FILESDIR}"/${P}-regenerate-autotools.patch + "${FILESDIR}"/${P}-c23-tests.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 +} diff --git a/sdk_container/src/third_party/portage-stable/dev-libs/libffi/libffi-3.4.7.ebuild b/sdk_container/src/third_party/portage-stable/dev-libs/libffi/libffi-3.4.7.ebuild new file mode 100644 index 0000000000..072cb92af7 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/dev-libs/libffi/libffi-3.4.7.ebuild @@ -0,0 +1,87 @@ +# Copyright 1999-2025 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/" + +if [[ ${PV} == 9999 ]] ; then + EGIT_REPO_URI="https://github.com/libffi/libffi" + inherit autotools git-r3 +else + SRC_URI="https://github.com/libffi/libffi/releases/download/v${MY_PV}/${MY_P}.tar.gz" + + 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" +fi + +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 +IUSE="debug +exec-static-trampoline pax-kernel static-libs test" + +RESTRICT="!test? ( test )" +BDEPEND="test? ( dev-util/dejagnu )" + +PATCHES=( + "${FILESDIR}"/${PN}-3.4.7-Revert-Fix-x86-ffi64-calls-with-6-gp-and-some-sse-re.patch +) + +src_prepare() { + default + + [[ ${PV} == 9999 ]] && eautoreconf + + 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 +} diff --git a/sdk_container/src/third_party/portage-stable/dev-libs/libffi/libffi-9999.ebuild b/sdk_container/src/third_party/portage-stable/dev-libs/libffi/libffi-9999.ebuild index 51d1f5c466..072cb92af7 100644 --- a/sdk_container/src/third_party/portage-stable/dev-libs/libffi/libffi-9999.ebuild +++ b/sdk_container/src/third_party/portage-stable/dev-libs/libffi/libffi-9999.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2024 Gentoo Authors +# Copyright 1999-2025 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 @@ -13,7 +13,7 @@ HOMEPAGE="https://sourceware.org/libffi/" if [[ ${PV} == 9999 ]] ; then EGIT_REPO_URI="https://github.com/libffi/libffi" - inherit git-r3 + inherit autotools git-r3 else SRC_URI="https://github.com/libffi/libffi/releases/download/v${MY_PV}/${MY_P}.tar.gz" @@ -27,14 +27,20 @@ LICENSE="MIT" # 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 -IUSE="debug exec-static-trampoline pax-kernel static-libs test" +IUSE="debug +exec-static-trampoline pax-kernel static-libs test" RESTRICT="!test? ( test )" BDEPEND="test? ( dev-util/dejagnu )" +PATCHES=( + "${FILESDIR}"/${PN}-3.4.7-Revert-Fix-x86-ffi64-calls-with-6-gp-and-some-sse-re.patch +) + src_prepare() { default + [[ ${PV} == 9999 ]] && eautoreconf + if [[ ${CHOST} == arm64-*-darwin* ]] ; then # ensure we use aarch64 asm, not x86 on arm64 sed -i -e 's/aarch64\*-\*-\*/arm64*-*-*|&/' \