Gentoo Archives: gentoo-commits

From: WANG Xuerui <xen0n@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/libffi/, profiles/arch/base/
Date: Thu, 28 Apr 2022 22:24:12
Message-Id: 1651184595.ab775ee9e1080e3b81b007ebecbd0ce4c2c5940f.xen0n@gentoo
1 commit: ab775ee9e1080e3b81b007ebecbd0ce4c2c5940f
2 Author: WANG Xuerui <xen0n <AT> gentoo <DOT> org>
3 AuthorDate: Mon Apr 25 06:05:18 2022 +0000
4 Commit: WANG Xuerui <xen0n <AT> gentoo <DOT> org>
5 CommitDate: Thu Apr 28 22:23:15 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ab775ee9
7
8 dev-libs/libffi: add support for loong
9
10 The LoongArch patch is generated by diffing the original release
11 tarball with the dist tarball, made with the LoongArch support
12 PR [1] applied, not upstreamed yet but already reviewed by me.
13
14 Tests have passed on amd64; similar code has been inside
15 loongson-overlay for a while, no problems spotted so far.
16
17 [1]: https://github.com/libffi/libffi/pull/678
18
19 Closes: https://github.com/gentoo/gentoo/pull/25189
20 Signed-off-by: WANG Xuerui <xen0n <AT> gentoo.org>
21
22 dev-libs/libffi/Manifest | 1 +
23 dev-libs/libffi/libffi-3.4.2-r1.ebuild | 9 +++++++--
24 dev-libs/libffi/metadata.xml | 1 +
25 profiles/arch/base/package.use.mask | 1 +
26 4 files changed, 10 insertions(+), 2 deletions(-)
27
28 diff --git a/dev-libs/libffi/Manifest b/dev-libs/libffi/Manifest
29 index 6351b7c81d9d..022b0d07614b 100644
30 --- a/dev-libs/libffi/Manifest
31 +++ b/dev-libs/libffi/Manifest
32 @@ -1,2 +1,3 @@
33 DIST libffi-3.3.tar.gz 1305466 BLAKE2B cddc40729a30a9bd34d675809f51f8d1b4ccaffa54bc6dd6f7e965f4e260edd34754719f9f6247c8957aeb7cf154d56ce1fe16a54c3f1ad39afbebdf41d23caa SHA512 61513801a156f11420f541d325de697131846487122d6bdcf5491b18b4da788589f5c0bb07e88e396495d3be5830d74e9135595e2b8ddbfe95c448d8597fbd6f
34 +DIST libffi-3.4.2-loongarch64-20220428.patch.xz 64932 BLAKE2B d144dc28a7fce008bc5cd43d9e04125ea8e972324d77951d42039d46e818014079c871f87a0cdbec758b55320c02dff718cf2449f9c630cc899e8e1610784a60 SHA512 33715b21fe027692cc584d6524c03510af7876cc35f318221e1b2b91644cf165c02979c8b426228a8cc6c471e6a59d0435e761b6b7aef589c41a4f28caa36e62
35 DIST libffi-3.4.2.tar.gz 1351355 BLAKE2B a8137bc895b819f949fd7705e405be627219c6d1fdef280253330f7407d4a548bb057d7bb0e9225d1767d42f9bf5f0ab3c455db1c3470d7cc876bb7b7d55d308 SHA512 31bad35251bf5c0adb998c88ff065085ca6105cf22071b9bd4b5d5d69db4fadf16cadeec9baca944c4bb97b619b035bb8279de8794b922531fddeb0779eb7fb1
36
37 diff --git a/dev-libs/libffi/libffi-3.4.2-r1.ebuild b/dev-libs/libffi/libffi-3.4.2-r1.ebuild
38 index 492d9b34c625..057f31cb8e7f 100644
39 --- a/dev-libs/libffi/libffi-3.4.2-r1.ebuild
40 +++ b/dev-libs/libffi/libffi-3.4.2-r1.ebuild
41 @@ -10,7 +10,8 @@ MY_P=${PN}-${MY_PV}
42
43 DESCRIPTION="a portable, high level programming interface to various calling conventions"
44 HOMEPAGE="https://sourceware.org/libffi/"
45 -SRC_URI="https://github.com/libffi/libffi/releases/download/v${MY_PV}/${MY_P}.tar.gz"
46 +SRC_URI="https://github.com/libffi/libffi/releases/download/v${MY_PV}/${MY_P}.tar.gz
47 + experimental-loong? ( https://dev.gentoo.org/~xen0n/distfiles/${MY_P}-loongarch64-20220428.patch.xz )"
48 S="${WORKDIR}"/${MY_P}
49
50 LICENSE="MIT"
51 @@ -20,7 +21,7 @@ LICENSE="MIT"
52 # changes.
53 SLOT="0/8" # SONAME=libffi.so.8
54 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"
55 -IUSE="debug exec-static-trampoline pax-kernel static-libs test"
56 +IUSE="debug exec-static-trampoline experimental-loong pax-kernel static-libs test"
57
58 RESTRICT="!test? ( test )"
59 BDEPEND="test? ( dev-util/dejagnu )"
60 @@ -30,6 +31,10 @@ DOCS="ChangeLog* README.md"
61 ECONF_SOURCE=${S}
62
63 src_prepare() {
64 + if use experimental-loong; then
65 + PATCHES+=( "${WORKDIR}/${MY_P}-loongarch64-20220428.patch" )
66 + fi
67 +
68 default
69 if [[ ${CHOST} == arm64-*-darwin* ]] ; then
70 # ensure we use aarch64 asm, not x86 on arm64
71
72 diff --git a/dev-libs/libffi/metadata.xml b/dev-libs/libffi/metadata.xml
73 index 53754327cd3f..9a236f87a6a5 100644
74 --- a/dev-libs/libffi/metadata.xml
75 +++ b/dev-libs/libffi/metadata.xml
76 @@ -35,6 +35,7 @@
77 </longdescription>
78 <use>
79 <flag name="exec-static-trampoline">Don't rely on dynamic code generation for trampolines.</flag>
80 + <flag name="experimental-loong">Add experimental LoongArch patchset</flag>
81 <flag name="pax-kernel">Use PaX emulated trampolines, for we can't use PROT_EXEC</flag>
82 </use>
83 <upstream>
84
85 diff --git a/profiles/arch/base/package.use.mask b/profiles/arch/base/package.use.mask
86 index 8d22c623dfd8..ed839864b801 100644
87 --- a/profiles/arch/base/package.use.mask
88 +++ b/profiles/arch/base/package.use.mask
89 @@ -7,6 +7,7 @@
90 # In the meantime, force-enable on loong only.
91 # This is not inside use.mask, because crossdev toolchain packages would
92 # want to have the flag enabled without hassle.
93 +dev-libs/libffi experimental-loong
94 sys-kernel/linux-headers experimental-loong
95 sys-libs/glibc experimental-loong
96 sys-libs/libseccomp experimental-loong