1 |
commit: ce60155bc0c7232e4f19c6a71e312cc66549cf32 |
2 |
Author: stefson <herrtimson <AT> yahoo <DOT> de> |
3 |
AuthorDate: Wed Mar 8 09:27:52 2023 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Mar 15 05:52:56 2023 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ce60155b |
7 |
|
8 |
dev-cpp/highway: fix tests with neon optimization on armv7 |
9 |
|
10 |
Closes: https://bugs.gentoo.org/900352 |
11 |
|
12 |
Signed-off-by: Steffen Kuhn <nielson2 <AT> yandex.com> |
13 |
Closes: https://github.com/gentoo/gentoo/pull/29988 |
14 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
15 |
|
16 |
.../0002-fix-armv7-neon-detect-via-asm-hwcap.patch | 29 +++++++++++++++ |
17 |
dev-cpp/highway/highway-1.0.3-r1.ebuild | 42 ++++++++++++++++++++++ |
18 |
2 files changed, 71 insertions(+) |
19 |
|
20 |
diff --git a/dev-cpp/highway/files/0002-fix-armv7-neon-detect-via-asm-hwcap.patch b/dev-cpp/highway/files/0002-fix-armv7-neon-detect-via-asm-hwcap.patch |
21 |
new file mode 100644 |
22 |
index 000000000000..298b5a82f1c2 |
23 |
--- /dev/null |
24 |
+++ b/dev-cpp/highway/files/0002-fix-armv7-neon-detect-via-asm-hwcap.patch |
25 |
@@ -0,0 +1,29 @@ |
26 |
+https://github.com/google/highway/commit/f3a33e8204b69f9e21b5fbd8036c11128cec0d2e.patch |
27 |
+https://github.com/google/highway/issues/1199 |
28 |
+ |
29 |
+https://bugs.gentoo.org/900352 |
30 |
+ |
31 |
+From f3a33e8204b69f9e21b5fbd8036c11128cec0d2e Mon Sep 17 00:00:00 2001 |
32 |
+From: Jan Wassenberg <janwas@××××××.com> |
33 |
+Date: Tue, 7 Mar 2023 22:59:17 -0800 |
34 |
+Subject: [PATCH] fix arm7 NEON detect, thanks @stefson. Fixes #1199 |
35 |
+ |
36 |
+PiperOrigin-RevId: 514940076 |
37 |
+--- |
38 |
+ hwy/targets.cc | 3 +++ |
39 |
+ 1 file changed, 3 insertions(+) |
40 |
+ |
41 |
+diff --git a/hwy/targets.cc b/hwy/targets.cc |
42 |
+index dc4217c..24fcaf7 100644 |
43 |
+--- a/hwy/targets.cc |
44 |
++++ b/hwy/targets.cc |
45 |
+@@ -43,6 +43,9 @@ |
46 |
+ #endif // HWY_COMPILER_MSVC |
47 |
+ |
48 |
+ #elif HWY_ARCH_ARM && HWY_OS_LINUX && !defined(TOOLCHAIN_MISS_SYS_AUXV_H) |
49 |
++// sys/auxv.h does not always include asm/hwcap.h, or define HWCAP*, hence we |
50 |
++// still include this directly. See #1199. |
51 |
++#include <asm/hwcap.h> |
52 |
+ #include <sys/auxv.h> |
53 |
+ #endif // HWY_ARCH_* |
54 |
+ |
55 |
|
56 |
diff --git a/dev-cpp/highway/highway-1.0.3-r1.ebuild b/dev-cpp/highway/highway-1.0.3-r1.ebuild |
57 |
new file mode 100644 |
58 |
index 000000000000..348046c0239d |
59 |
--- /dev/null |
60 |
+++ b/dev-cpp/highway/highway-1.0.3-r1.ebuild |
61 |
@@ -0,0 +1,42 @@ |
62 |
+# Copyright 2021-2023 Gentoo Authors |
63 |
+# Distributed under the terms of the GNU General Public License v2 |
64 |
+ |
65 |
+EAPI=8 |
66 |
+ |
67 |
+inherit cmake-multilib |
68 |
+ |
69 |
+DESCRIPTION="Performance-portable, length-agnostic SIMD with runtime dispatch" |
70 |
+HOMEPAGE="https://github.com/google/highway" |
71 |
+ |
72 |
+if [[ "${PV}" == *9999* ]]; then |
73 |
+ inherit git-r3 |
74 |
+ EGIT_REPO_URI="https://github.com/google/highway.git" |
75 |
+else |
76 |
+ SRC_URI="https://github.com/google/highway/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz" |
77 |
+ KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86" |
78 |
+fi |
79 |
+ |
80 |
+LICENSE="Apache-2.0" |
81 |
+SLOT="0" |
82 |
+IUSE="cpu_flags_arm_neon test" |
83 |
+ |
84 |
+DEPEND="test? ( dev-cpp/gtest[${MULTILIB_USEDEP}] )" |
85 |
+ |
86 |
+RESTRICT="!test? ( test )" |
87 |
+ |
88 |
+PATCHES=( |
89 |
+ "${FILESDIR}"/0001-fix-compile-for-armv7-targets-with-vfp4-and-lower.patch |
90 |
+ "${FILESDIR}"/0002-fix-armv7-neon-detect-via-asm-hwcap.patch |
91 |
+) |
92 |
+ |
93 |
+multilib_src_configure() { |
94 |
+ local mycmakeargs=( |
95 |
+ -DHWY_CMAKE_ARM7=$(usex cpu_flags_arm_neon) |
96 |
+ -DBUILD_TESTING=$(usex test) |
97 |
+ -DHWY_WARNINGS_ARE_ERRORS=OFF |
98 |
+ ) |
99 |
+ |
100 |
+ use test && mycmakeargs+=( "-DHWY_SYSTEM_GTEST=ON" ) |
101 |
+ |
102 |
+ cmake_src_configure |
103 |
+} |