Gentoo Archives: gentoo-commits

From: Sergei Trofimovich <slyfox@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/libffi/files/, dev-libs/libffi/
Date: Sat, 26 Jun 2021 21:37:36
Message-Id: 1624743451.0b2c89773e0df20c0c770b6d8620564b76468578.slyfox@gentoo
1 commit: 0b2c89773e0df20c0c770b6d8620564b76468578
2 Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
3 AuthorDate: Sat Jun 26 21:16:34 2021 +0000
4 Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
5 CommitDate: Sat Jun 26 21:37:31 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0b2c8977
7
8 dev-libs/libffi: bump up to 3.4_rc1, SOVERSION=8
9
10 Package-Manager: Portage-3.0.20, Repoman-3.0.3
11 Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>
12
13 dev-libs/libffi/Manifest | 1 +
14 dev-libs/libffi/files/libffi-3.4_rc1-readelf.patch | 138 +++++++++++++++++++++
15 dev-libs/libffi/libffi-3.4_rc1.ebuild | 69 +++++++++++
16 dev-libs/libffi/metadata.xml | 3 +-
17 4 files changed, 210 insertions(+), 1 deletion(-)
18
19 diff --git a/dev-libs/libffi/Manifest b/dev-libs/libffi/Manifest
20 index a1c499b413f..9de05c9958f 100644
21 --- a/dev-libs/libffi/Manifest
22 +++ b/dev-libs/libffi/Manifest
23 @@ -1 +1,2 @@
24 DIST libffi-3.3.tar.gz 1305466 BLAKE2B cddc40729a30a9bd34d675809f51f8d1b4ccaffa54bc6dd6f7e965f4e260edd34754719f9f6247c8957aeb7cf154d56ce1fe16a54c3f1ad39afbebdf41d23caa SHA512 61513801a156f11420f541d325de697131846487122d6bdcf5491b18b4da788589f5c0bb07e88e396495d3be5830d74e9135595e2b8ddbfe95c448d8597fbd6f
25 +DIST libffi-3.4-rc1.tar.gz 1346621 BLAKE2B 4a3560d9a5580748cb56d6da275d08f677a5e3895b4ddb8bf8bb085bad20e1e35eb31c48758dc0cd0fa14136c14a91a4d3596f5f716d561563f8d75eca7c6199 SHA512 130520c6de052015110c509b3b5ec5832c2bf989f95bec2c60a36fc2a57745af3f740381a7fa70e0c42b5a9dc610ea25e77849d50bea3bc197d04d23828fc4c0
26
27 diff --git a/dev-libs/libffi/files/libffi-3.4_rc1-readelf.patch b/dev-libs/libffi/files/libffi-3.4_rc1-readelf.patch
28 new file mode 100644
29 index 00000000000..f976f988c6b
30 --- /dev/null
31 +++ b/dev-libs/libffi/files/libffi-3.4_rc1-readelf.patch
32 @@ -0,0 +1,138 @@
33 +https://github.com/libffi/libffi/pull/646
34 +--- a/configure.ac
35 ++++ b/configure.ac
36 +@@ -40,6 +40,7 @@ AM_PROG_AS
37 + AM_PROG_CC_C_O
38 + AC_PROG_LIBTOOL
39 + AC_CONFIG_MACRO_DIR([m4])
40 ++AC_CHECK_TOOL(READELF, readelf)
41 +
42 + # Test for 64-bit build.
43 + AC_CHECK_SIZEOF([size_t])
44 +@@ -271,7 +272,7 @@ if test "x$GCC" = "xyes"; then
45 + libffi_cv_ro_eh_frame=yes
46 + echo 'extern void foo (void); void bar (void) { foo (); foo (); }' > conftest.c
47 + if $CC $CFLAGS -c -fpic -fexceptions $libffi_cv_no_lto -o conftest.o conftest.c > /dev/null 2>&1; then
48 +- if readelf -WS conftest.o | grep -q -n 'eh_frame .* WA'; then
49 ++ if $READELF -WS conftest.o | grep -q -n 'eh_frame .* WA'; then
50 + libffi_cv_ro_eh_frame=no
51 + fi
52 + fi
53 +--- a/configure
54 ++++ b/configure
55 +@@ -667,6 +667,7 @@ MAINT
56 + MAINTAINER_MODE_FALSE
57 + MAINTAINER_MODE_TRUE
58 + PRTDIAG
59 ++READELF
60 + CXXCPP
61 + CPP
62 + LT_SYS_LIBRARY_PATH
63 +@@ -16380,6 +16393,98 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
64 +
65 +
66 +
67 ++if test -n "$ac_tool_prefix"; then
68 ++ # Extract the first word of "${ac_tool_prefix}readelf", so it can be a program name with args.
69 ++set dummy ${ac_tool_prefix}readelf; ac_word=$2
70 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
71 ++$as_echo_n "checking for $ac_word... " >&6; }
72 ++if ${ac_cv_prog_READELF+:} false; then :
73 ++ $as_echo_n "(cached) " >&6
74 ++else
75 ++ if test -n "$READELF"; then
76 ++ ac_cv_prog_READELF="$READELF" # Let the user override the test.
77 ++else
78 ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
79 ++for as_dir in $PATH
80 ++do
81 ++ IFS=$as_save_IFS
82 ++ test -z "$as_dir" && as_dir=.
83 ++ for ac_exec_ext in '' $ac_executable_extensions; do
84 ++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
85 ++ ac_cv_prog_READELF="${ac_tool_prefix}readelf"
86 ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
87 ++ break 2
88 ++ fi
89 ++done
90 ++ done
91 ++IFS=$as_save_IFS
92 ++
93 ++fi
94 ++fi
95 ++READELF=$ac_cv_prog_READELF
96 ++if test -n "$READELF"; then
97 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $READELF" >&5
98 ++$as_echo "$READELF" >&6; }
99 ++else
100 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
101 ++$as_echo "no" >&6; }
102 ++fi
103 ++
104 ++
105 ++fi
106 ++if test -z "$ac_cv_prog_READELF"; then
107 ++ ac_ct_READELF=$READELF
108 ++ # Extract the first word of "readelf", so it can be a program name with args.
109 ++set dummy readelf; ac_word=$2
110 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
111 ++$as_echo_n "checking for $ac_word... " >&6; }
112 ++if ${ac_cv_prog_ac_ct_READELF+:} false; then :
113 ++ $as_echo_n "(cached) " >&6
114 ++else
115 ++ if test -n "$ac_ct_READELF"; then
116 ++ ac_cv_prog_ac_ct_READELF="$ac_ct_READELF" # Let the user override the test.
117 ++else
118 ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
119 ++for as_dir in $PATH
120 ++do
121 ++ IFS=$as_save_IFS
122 ++ test -z "$as_dir" && as_dir=.
123 ++ for ac_exec_ext in '' $ac_executable_extensions; do
124 ++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
125 ++ ac_cv_prog_ac_ct_READELF="readelf"
126 ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
127 ++ break 2
128 ++ fi
129 ++done
130 ++ done
131 ++IFS=$as_save_IFS
132 ++
133 ++fi
134 ++fi
135 ++ac_ct_READELF=$ac_cv_prog_ac_ct_READELF
136 ++if test -n "$ac_ct_READELF"; then
137 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_READELF" >&5
138 ++$as_echo "$ac_ct_READELF" >&6; }
139 ++else
140 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
141 ++$as_echo "no" >&6; }
142 ++fi
143 ++
144 ++ if test "x$ac_ct_READELF" = x; then
145 ++ READELF=""
146 ++ else
147 ++ case $cross_compiling:$ac_tool_warned in
148 ++yes:)
149 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
150 ++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
151 ++ac_tool_warned=yes ;;
152 ++esac
153 ++ READELF=$ac_ct_READELF
154 ++ fi
155 ++else
156 ++ READELF="$ac_cv_prog_READELF"
157 ++fi
158 ++
159 +
160 + # Test for 64-bit build.
161 + # The cast to long int works around a bug in the HP C Compiler
162 +@@ -18651,7 +18756,7 @@ else
163 + libffi_cv_ro_eh_frame=yes
164 + echo 'extern void foo (void); void bar (void) { foo (); foo (); }' > conftest.c
165 + if $CC $CFLAGS -c -fpic -fexceptions $libffi_cv_no_lto -o conftest.o conftest.c > /dev/null 2>&1; then
166 +- if readelf -WS conftest.o | grep -q -n 'eh_frame .* WA'; then
167 ++ if $READELF -WS conftest.o | grep -q -n 'eh_frame .* WA'; then
168 + libffi_cv_ro_eh_frame=no
169 + fi
170 + fi
171
172 diff --git a/dev-libs/libffi/libffi-3.4_rc1.ebuild b/dev-libs/libffi/libffi-3.4_rc1.ebuild
173 new file mode 100644
174 index 00000000000..dcf2f22db5b
175 --- /dev/null
176 +++ b/dev-libs/libffi/libffi-3.4_rc1.ebuild
177 @@ -0,0 +1,69 @@
178 +# Copyright 1999-2021 Gentoo Authors
179 +# Distributed under the terms of the GNU General Public License v2
180 +
181 +EAPI=7
182 +inherit multilib-minimal
183 +
184 +MY_PV=${PV/_rc/-rc}
185 +MY_P=${PN}-${MY_PV}
186 +
187 +DESCRIPTION="a portable, high level programming interface to various calling conventions"
188 +HOMEPAGE="https://sourceware.org/libffi/"
189 +SRC_URI="https://github.com/libffi/libffi/releases/download/v${MY_PV}/${MY_P}.tar.gz"
190 +
191 +LICENSE="MIT"
192 +SLOT="0/8" # SONAME=libffi.so.8
193 +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"
194 +IUSE="debug pax-kernel pax_kernel static-libs test"
195 +
196 +RESTRICT="!test? ( test )"
197 +# If you are USE=pax_kernel user you really want USE=pax-kernel as well.
198 +# That's a flag rename: https://archives.gentoo.org/gentoo-dev/message/273f5ec9ebc8075f6ee8d8cdda9e759e
199 +REQUIRED_USE="pax_kernel? ( pax-kernel )"
200 +
201 +RDEPEND=""
202 +DEPEND=""
203 +BDEPEND="test? ( dev-util/dejagnu )"
204 +
205 +DOCS="ChangeLog* README.md"
206 +
207 +PATCHES=("${FILESDIR}"/${PN}-3.4_rc1-readelf.patch)
208 +
209 +S=${WORKDIR}/${MY_P}
210 +
211 +ECONF_SOURCE=${S}
212 +
213 +src_prepare() {
214 + default
215 + if [[ ${CHOST} == arm64-*-darwin* ]] ; then
216 + # ensure we use aarch64 asm, not x86 on arm64
217 + sed -i -e 's/aarch64\*-\*-\*/arm64*-*-*|&/' \
218 + configure configure.host || die
219 + fi
220 +}
221 +
222 +multilib_src_configure() {
223 + use userland_BSD && export HOST="${CHOST}"
224 + # --includedir= path maintains a few properties:
225 + # 1. have stable name across libffi versions: some packages like
226 + # dev-lang/ghc or kde-frameworks/networkmanager-qt embed
227 + # ${includedir} at build-time. Don't require those to be
228 + # rebuilt unless SONAME changes. bug #695788
229 + #
230 + # We use /usr/.../${PN} (instead of former /usr/.../${P}).
231 + #
232 + # 2. have ${ABI}-specific location as ffi.h is target-dependent.
233 + #
234 + # We use /usr/$(get_libdir)/... to have ABI identifier.
235 + econf \
236 + --includedir="${EPREFIX}"/usr/$(get_libdir)/${PN}/include \
237 + --disable-multi-os-directory \
238 + $(use_enable static-libs static) \
239 + $(use_enable pax-kernel pax_emutramp) \
240 + $(use_enable debug)
241 +}
242 +
243 +multilib_src_install_all() {
244 + find "${ED}" -name "*.la" -delete || die
245 + einstalldocs
246 +}
247
248 diff --git a/dev-libs/libffi/metadata.xml b/dev-libs/libffi/metadata.xml
249 index 6e9a28c5ac8..ac6b16a1be9 100644
250 --- a/dev-libs/libffi/metadata.xml
251 +++ b/dev-libs/libffi/metadata.xml
252 @@ -34,7 +34,8 @@
253 between the two languages.
254 </longdescription>
255 <use>
256 - <flag name="pax_kernel">Use PaX emulated trampolines, for we can't use PROT_EXEC</flag>
257 + <flag name="pax-kernel">Use PaX emulated trampolines, for we can't use PROT_EXEC.</flag>
258 + <flag name="pax_kernel">Use PaX emulated trampolines, for we can't use PROT_EXEC. (use 'pax-kernel' instead)</flag>
259 </use>
260 <upstream>
261 <remote-id type="cpe">cpe:/a:libffi_project:libffi</remote-id>