Gentoo Archives: gentoo-commits

From: Georgy Yakovlev <gyakovlev@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-cpp/abseil-cpp/files/, dev-cpp/abseil-cpp/
Date: Fri, 02 Apr 2021 03:04:29
Message-Id: 1617332619.619cfe3daec298493d31030008efc12e5ebbf7ec.gyakovlev@gentoo
1 commit: 619cfe3daec298493d31030008efc12e5ebbf7ec
2 Author: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
3 AuthorDate: Mon Mar 29 18:00:00 2021 +0000
4 Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
5 CommitDate: Fri Apr 2 03:03:39 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=619cfe3d
7
8 dev-cpp/abseil-cpp: Fix building on ARM{32,64} CPUs without crypto extension.
9
10 Closes: https://bugs.gentoo.org/778926
11 Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache.Org>
12 Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
13
14 dev-cpp/abseil-cpp/abseil-cpp-20200923.2.ebuild | 14 ++++++++++++--
15 .../files/abseil-cpp-20200923-arm_no_crypto.patch | 16 ++++++++++++++++
16 2 files changed, 28 insertions(+), 2 deletions(-)
17
18 diff --git a/dev-cpp/abseil-cpp/abseil-cpp-20200923.2.ebuild b/dev-cpp/abseil-cpp/abseil-cpp-20200923.2.ebuild
19 index 8e62b032d05..90be485e13a 100644
20 --- a/dev-cpp/abseil-cpp/abseil-cpp-20200923.2.ebuild
21 +++ b/dev-cpp/abseil-cpp/abseil-cpp-20200923.2.ebuild
22 @@ -1,11 +1,11 @@
23 -# Copyright 2020 Gentoo Authors
24 +# Copyright 2020-2021 Gentoo Authors
25 # Distributed under the terms of the GNU General Public License v2
26
27 EAPI=7
28
29 PYTHON_COMPAT=( python3_{7,8,9} )
30
31 -inherit cmake python-any-r1
32 +inherit cmake python-any-r1 toolchain-funcs
33
34 # yes, it needs SOURCE, not just installed one
35 GTEST_COMMIT="aee0f9d9b5b87796ee8a0ab26b7587ec30e8858e"
36 @@ -34,6 +34,10 @@ BDEPEND="
37
38 RESTRICT="!test? ( test )"
39
40 +PATCHES=(
41 + "${FILESDIR}/${PN}-20200923-arm_no_crypto.patch"
42 +)
43 +
44 src_prepare() {
45 cmake_src_prepare
46
47 @@ -53,6 +57,12 @@ src_prepare() {
48 }
49
50 src_configure() {
51 + if use arm || use arm64; then
52 + if [[ $($(tc-getCXX) ${CXXFLAGS} -E -P - <<<$'#if defined(__ARM_FEATURE_CRYPTO)\nHAVE_ARM_FEATURE_CRYPTO\n#endif') != *HAVE_ARM_FEATURE_CRYPTO* ]]; then
53 + append-cxxflags -DABSL_ARCH_ARM_NO_CRYPTO
54 + fi
55 + fi
56 +
57 local mycmakeargs=(
58 -DABSL_ENABLE_INSTALL=TRUE
59 -DABSL_LOCAL_GOOGLETEST_DIR="${WORKDIR}/googletest-${GTEST_COMMIT}"
60
61 diff --git a/dev-cpp/abseil-cpp/files/abseil-cpp-20200923-arm_no_crypto.patch b/dev-cpp/abseil-cpp/files/abseil-cpp-20200923-arm_no_crypto.patch
62 new file mode 100644
63 index 00000000000..b74a6c70e90
64 --- /dev/null
65 +++ b/dev-cpp/abseil-cpp/files/abseil-cpp-20200923-arm_no_crypto.patch
66 @@ -0,0 +1,16 @@
67 +--- /absl/random/internal/randen_hwaes.cc
68 ++++ /absl/random/internal/randen_hwaes.cc
69 +@@ -50,8 +50,11 @@
70 + (defined(__ARM_NEON) && defined(__ARM_FEATURE_CRYPTO))
71 + #define ABSL_RANDEN_HWAES_IMPL 1
72 +
73 +-#elif ABSL_RANDOM_INTERNAL_AES_DISPATCH && !defined(__APPLE__) && \
74 +- (defined(__GNUC__) && __GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__ > 9)
75 ++// When ABSL_ARCH_ARM_NO_CRYPTO is defined, then ARM CPU without
76 ++// crypto extension is assumed.
77 ++#elif !defined(ABSL_ARCH_ARM_NO_CRYPTO) && \
78 ++ (ABSL_RANDOM_INTERNAL_AES_DISPATCH && !defined(__APPLE__) && \
79 ++ (defined(__GNUC__) && __GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__ > 9))
80 + // ...or, on GCC, we can use an ASM directive to
81 + // instruct the assember to allow crypto instructions.
82 + #define ABSL_RANDEN_HWAES_IMPL 1