Gentoo Archives: gentoo-commits

From: Conrad Kostecki <conikost@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-benchmarks/stress-ng/files/, app-benchmarks/stress-ng/
Date: Wed, 02 Sep 2020 12:39:33
Message-Id: 1599050297.285d1df0bf8f3e4208def7b36974e72b9b929f7e.conikost@gentoo
1 commit: 285d1df0bf8f3e4208def7b36974e72b9b929f7e
2 Author: Conrad Kostecki <conikost <AT> gentoo <DOT> org>
3 AuthorDate: Wed Sep 2 12:38:17 2020 +0000
4 Commit: Conrad Kostecki <conikost <AT> gentoo <DOT> org>
5 CommitDate: Wed Sep 2 12:38:17 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=285d1df0
7
8 app-benchmarks/stress-ng: fix compilation due optimization
9
10 Closes: https://bugs.gentoo.org/739830
11 Package-Manager: Portage-3.0.4, Repoman-3.0.1
12 Signed-off-by: Conrad Kostecki <conikost <AT> gentoo.org>
13
14 .../stress-ng-0.11.19-optimization-checks.patch | 87 ++++++++++++++++++++++
15 app-benchmarks/stress-ng/stress-ng-0.11.19.ebuild | 5 +-
16 2 files changed, 91 insertions(+), 1 deletion(-)
17
18 diff --git a/app-benchmarks/stress-ng/files/stress-ng-0.11.19-optimization-checks.patch b/app-benchmarks/stress-ng/files/stress-ng-0.11.19-optimization-checks.patch
19 new file mode 100644
20 index 00000000000..18bd02ae9d5
21 --- /dev/null
22 +++ b/app-benchmarks/stress-ng/files/stress-ng-0.11.19-optimization-checks.patch
23 @@ -0,0 +1,87 @@
24 +From 70acc386b6afb726d4576a3d4368b51114e92530 Mon Sep 17 00:00:00 2001
25 +From: Colin Ian King <colin.king@×××××××××.com>
26 +Date: Tue, 1 Sep 2020 12:54:19 +0100
27 +Subject: [PATCH] stress-ng.h: build in target clone types if gcc supports the
28 + feature
29 +
30 +Add in more build time optimization checks, try to build smarter with
31 +various gcc compatibility support checks.
32 +
33 +Signed-off-by: Colin Ian King <colin.king@×××××××××.com>
34 +---
35 + stress-ng.h | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
36 + 1 file changed, 61 insertions(+), 1 deletion(-)
37 +
38 +diff --git a/stress-ng.h b/stress-ng.h
39 +index 3803bc71..6ce7d72e 100644
40 +--- a/stress-ng.h
41 ++++ b/stress-ng.h
42 +@@ -1686,7 +1686,67 @@ extern void pr_dbg_lock(bool *locked, const char *fmt, ...) FORMAT(printf, 2, 3
43 +
44 + /* GCC5.0+ target_clones attribute */
45 + #if defined(HAVE_TARGET_CLONES) && defined(STRESS_ARCH_X86)
46 +-#define TARGET_CLONES __attribute__((target_clones("mmx","sse","sse2","ssse3", "sse4.1", "sse4a", "avx", "avx2", "arch=skylake-avx512", "default")))
47 ++#if defined(__MMX_WITH_SSE__)
48 ++#define TARGET_CLONE_MMX "mmx",
49 ++#else
50 ++#define TARGET_CLONE_MMX
51 ++#endif
52 ++
53 ++#if defined(__AVX__)
54 ++#define TARGET_CLONE_AVX "avx",
55 ++#else
56 ++#define TARGET_CLONE_AVX
57 ++#endif
58 ++
59 ++#if defined(__AVX2__)
60 ++#define TARGET_CLONE_AVX2 "avx2",
61 ++#else
62 ++#define TARGET_CLONE_AVX2
63 ++#endif
64 ++
65 ++#if defined(__SSE__)
66 ++#define TARGET_CLONE_SSE "sse",
67 ++#else
68 ++#define TARGET_CLONE_SSE
69 ++#endif
70 ++
71 ++#if defined(__SSE2__)
72 ++#define TARGET_CLONE_SSE2 "sse2",
73 ++#else
74 ++#define TARGET_CLONE_SSE2
75 ++#endif
76 ++
77 ++#if defined(__SSE3__)
78 ++#define TARGET_CLONE_SSE3 "sse3",
79 ++#else
80 ++#define TARGET_CLONE_SSE3
81 ++#endif
82 ++
83 ++#if defined(__SSSE3__)
84 ++#define TARGET_CLONE_SSSE3 "ssse3",
85 ++#else
86 ++#define TARGET_CLONE_SSSE3
87 ++#endif
88 ++
89 ++#if defined(__SSE4_1__)
90 ++#define TARGET_CLONE_SSE4_1 "sse4.1",
91 ++#else
92 ++#define TARGET_CLONE_SSE4_1
93 ++#endif
94 ++
95 ++#if defined(__SSE4_2__)
96 ++#define TARGET_CLONE_SSE4_2 "sse4.2",
97 ++#else
98 ++#define TARGET_CLONE_SSE4_2
99 ++#endif
100 ++
101 ++#if defined(__AVX512F__)
102 ++#define TARGET_CLONE_SKYLAKE_AVX512 "arch=skylake-avx512",
103 ++#else
104 ++#define TARGET_CLONE_SKYLAKE_AVX512
105 ++#endif
106 ++
107 ++#define TARGET_CLONES __attribute__((target_clones(TARGET_CLONE_AVX TARGET_CLONE_AVX2 TARGET_CLONE_MMX TARGET_CLONE_SSE TARGET_CLONE_SSE2 TARGET_CLONE_SSE3 TARGET_CLONE_SSSE3 TARGET_CLONE_SSE4_1 TARGET_CLONE_SSE4_2 TARGET_CLONE_SKYLAKE_AVX512 "default")))
108 + #elif defined(HAVE_TARGET_CLONES) && defined(STRESS_ARCH_PPC64)
109 + #define TARGET_CLONES __attribute__((target_clones("cpu=power9,default")))
110 + #else
111
112 diff --git a/app-benchmarks/stress-ng/stress-ng-0.11.19.ebuild b/app-benchmarks/stress-ng/stress-ng-0.11.19.ebuild
113 index 4c88cc73a96..cadf668aef4 100644
114 --- a/app-benchmarks/stress-ng/stress-ng-0.11.19.ebuild
115 +++ b/app-benchmarks/stress-ng/stress-ng-0.11.19.ebuild
116 @@ -27,7 +27,10 @@ RDEPEND="${DEPEND}"
117
118 DOCS=( "README" "README.Android" "TODO" "syscalls.txt" )
119
120 -PATCHES=( "${FILESDIR}/${PN}-0.11.17-makefile.patch" )
121 +PATCHES=(
122 + "${FILESDIR}/${PN}-0.11.17-makefile.patch"
123 + "${FILESDIR}/${PN}-0.11.19-optimization-checks.patch"
124 +)
125
126 src_compile() {
127 tc-export CC