1 |
commit: e0851dfe8e3bc56f435fc0a71fdf562794df903d |
2 |
Author: Alon Bar-Lev <alonbl <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Feb 23 22:20:39 2019 +0000 |
4 |
Commit: Alon Bar-Lev <alonbl <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Feb 23 22:21:28 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e0851dfe |
7 |
|
8 |
app-crypt/dieharder: resolve undefined symbols |
9 |
|
10 |
Closes: https://bugs.gentoo.org/show_bug.cgi?id=678300 |
11 |
Thanks: Ben Kohler |
12 |
Signed-off-by: Alon Bar-Lev <alonbl <AT> gentoo.org> |
13 |
Package-Manager: Portage-2.3.51, Repoman-2.3.11 |
14 |
|
15 |
...3.31.1-r2.ebuild => dieharder-3.31.1-r3.ebuild} | 2 +- |
16 |
.../dieharder/files/dieharder-3.31.1-build.patch | 158 +++++++++++++++++++++ |
17 |
2 files changed, 159 insertions(+), 1 deletion(-) |
18 |
|
19 |
diff --git a/app-crypt/dieharder/dieharder-3.31.1-r2.ebuild b/app-crypt/dieharder/dieharder-3.31.1-r3.ebuild |
20 |
similarity index 97% |
21 |
rename from app-crypt/dieharder/dieharder-3.31.1-r2.ebuild |
22 |
rename to app-crypt/dieharder/dieharder-3.31.1-r3.ebuild |
23 |
index 5a949f9d035..8fd1209bd49 100644 |
24 |
--- a/app-crypt/dieharder/dieharder-3.31.1-r2.ebuild |
25 |
+++ b/app-crypt/dieharder/dieharder-3.31.1-r3.ebuild |
26 |
@@ -11,7 +11,7 @@ LICENSE="GPL-2" |
27 |
SLOT="0" |
28 |
KEYWORDS="~alpha ~amd64 ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86" |
29 |
IUSE="doc" |
30 |
-RESTRICT="test" |
31 |
+RESTRICT="test" # Way too long |
32 |
|
33 |
RDEPEND="sci-libs/gsl" |
34 |
DEPEND="${RDEPEND} |
35 |
|
36 |
diff --git a/app-crypt/dieharder/files/dieharder-3.31.1-build.patch b/app-crypt/dieharder/files/dieharder-3.31.1-build.patch |
37 |
index 4cbd5021c77..50e2119030c 100644 |
38 |
--- a/app-crypt/dieharder/files/dieharder-3.31.1-build.patch |
39 |
+++ b/app-crypt/dieharder/files/dieharder-3.31.1-build.patch |
40 |
@@ -25,3 +25,161 @@ index 2138ebf..f6d471b 100644 |
41 |
#include <math.h> |
42 |
#include <limits.h> |
43 |
#include <gsl/gsl_rng.h> |
44 |
+From aee56b67080a5a8732c12216ef4415f315f35e4a Mon Sep 17 00:00:00 2001 |
45 |
+From: Alon Bar-Lev <alon.barlev@×××××.com> |
46 |
+Date: Sun, 24 Feb 2019 00:04:55 +0200 |
47 |
+Subject: [PATCH 1/2] rgb_operm: convert to noop as implementation missing |
48 |
+ |
49 |
+--- |
50 |
+ include/dieharder/rgb_operm.h | 2 ++ |
51 |
+ 1 file changed, 2 insertions(+) |
52 |
+ |
53 |
+diff --git a/include/dieharder/rgb_operm.h b/include/dieharder/rgb_operm.h |
54 |
+index c48fa37..f33fc1f 100644 |
55 |
+--- a/include/dieharder/rgb_operm.h |
56 |
++++ b/include/dieharder/rgb_operm.h |
57 |
+@@ -1,3 +1,4 @@ |
58 |
++#if 0 |
59 |
+ /* |
60 |
+ * rgb_operm test header. |
61 |
+ */ |
62 |
+@@ -36,3 +37,4 @@ static Dtest rgb_operm_dtest __attribute__((unused)) = { |
63 |
+ * a data stream of rands from x_i to x_{i+k} to compute c[][]. |
64 |
+ */ |
65 |
+ unsigned int rgb_operm_k; |
66 |
++#endif |
67 |
+-- |
68 |
+2.19.2 |
69 |
+ |
70 |
+From b1140059cab9a5b2847dd312087d44d58fe61263 Mon Sep 17 00:00:00 2001 |
71 |
+From: Alon Bar-Lev <alon.barlev@×××××.com> |
72 |
+Date: Sun, 24 Feb 2019 00:10:00 +0200 |
73 |
+Subject: [PATCH 2/2] dab_filltree2: inline cannot have prototype nor can it be |
74 |
+ non static |
75 |
+ |
76 |
+--- |
77 |
+ libdieharder/dab_filltree.c | 37 ++++++++++++++------------- |
78 |
+ libdieharder/dab_filltree2.c | 48 +++++++++++++++++------------------- |
79 |
+ 2 files changed, 41 insertions(+), 44 deletions(-) |
80 |
+ |
81 |
+diff --git a/libdieharder/dab_filltree.c b/libdieharder/dab_filltree.c |
82 |
+index 9cc5ce7..3ed6b00 100644 |
83 |
+--- a/libdieharder/dab_filltree.c |
84 |
++++ b/libdieharder/dab_filltree.c |
85 |
+@@ -34,7 +34,24 @@ static double targetData[] = { |
86 |
+ 0.0, 0.0, 0.0, 0.0, 0.13333333, 0.20000000, 0.20634921, 0.17857143, 0.13007085, 0.08183633, 0.04338395, 0.01851828, 0.00617270, 0.00151193, 0.00023520, 0.00001680, 0.00000000, 0.00000000, 0.00000000, 0.00000000 |
87 |
+ }; |
88 |
+ |
89 |
+-inline int insert(double x, double *array, unsigned int startVal); |
90 |
++static inline int insert(double x, double *array, unsigned int startVal) { |
91 |
++ uint d = (startVal + 1) / 2; |
92 |
++ uint i = startVal; |
93 |
++ while (d > 0) { |
94 |
++ if (array[i] == 0) { |
95 |
++ array[i] = x; |
96 |
++ return -1; |
97 |
++ } |
98 |
++ if (array[i] < x) { |
99 |
++ i += d; |
100 |
++ } else { |
101 |
++ i -= d; |
102 |
++ } |
103 |
++ d /= 2; |
104 |
++ } |
105 |
++ return i; |
106 |
++} |
107 |
++ |
108 |
+ |
109 |
+ int dab_filltree(Test **test,int irun) { |
110 |
+ int size = (ntuple == 0) ? 32 : ntuple; |
111 |
+@@ -105,24 +122,6 @@ int dab_filltree(Test **test,int irun) { |
112 |
+ } |
113 |
+ |
114 |
+ |
115 |
+-inline int insert(double x, double *array, unsigned int startVal) { |
116 |
+- uint d = (startVal + 1) / 2; |
117 |
+- uint i = startVal; |
118 |
+- while (d > 0) { |
119 |
+- if (array[i] == 0) { |
120 |
+- array[i] = x; |
121 |
+- return -1; |
122 |
+- } |
123 |
+- if (array[i] < x) { |
124 |
+- i += d; |
125 |
+- } else { |
126 |
+- i -= d; |
127 |
+- } |
128 |
+- d /= 2; |
129 |
+- } |
130 |
+- return i; |
131 |
+-} |
132 |
+- |
133 |
+ #include<time.h> |
134 |
+ |
135 |
+ int main_filltree(int argc, char **argv) { |
136 |
+diff --git a/libdieharder/dab_filltree2.c b/libdieharder/dab_filltree2.c |
137 |
+index 1e33af2..7102d3c 100644 |
138 |
+--- a/libdieharder/dab_filltree2.c |
139 |
++++ b/libdieharder/dab_filltree2.c |
140 |
+@@ -92,7 +92,29 @@ static double targetData[128] = { // size=128, generated from 6e9 samples |
141 |
+ 0.00000000000e+00,0.00000000000e+00,0.00000000000e+00,0.00000000000e+00, |
142 |
+ }; |
143 |
+ |
144 |
+-inline int insertBit(uint x, uchar *array, uint *i, uint *d); |
145 |
++/* |
146 |
++ * Insert a bit into the tree, represented by an array. |
147 |
++ * A value of one is marked; zero is unmarked. |
148 |
++ * The function returns -2 is still on the path. |
149 |
++ * The function returns -1 if the path ends by marking a node. |
150 |
++ * The function returns >= 0 if the path went too deep; the |
151 |
++ * returned value is the last position of the path. |
152 |
++ */ |
153 |
++static inline int insertBit(uint x, uchar *array, uint *i, uint *d) { |
154 |
++ if (x != 0) { |
155 |
++ *i += *d; |
156 |
++ } else { |
157 |
++ *i -= *d; |
158 |
++ } |
159 |
++ *d /= 2; |
160 |
++ |
161 |
++ if (array[*i] == 0) { |
162 |
++ array[*i] = 1; |
163 |
++ return -1; |
164 |
++ } |
165 |
++ if (*d == 0) return *i; |
166 |
++ else return -2; |
167 |
++} |
168 |
+ |
169 |
+ int dab_filltree2(Test **test, int irun) { |
170 |
+ int size = (ntuple == 0) ? 128 : ntuple; |
171 |
+@@ -173,27 +195,3 @@ int dab_filltree2(Test **test, int irun) { |
172 |
+ return(0); |
173 |
+ } |
174 |
+ |
175 |
+-/* |
176 |
+- * Insert a bit into the tree, represented by an array. |
177 |
+- * A value of one is marked; zero is unmarked. |
178 |
+- * The function returns -2 is still on the path. |
179 |
+- * The function returns -1 if the path ends by marking a node. |
180 |
+- * The function returns >= 0 if the path went too deep; the |
181 |
+- * returned value is the last position of the path. |
182 |
+- */ |
183 |
+-inline int insertBit(uint x, uchar *array, uint *i, uint *d) { |
184 |
+- if (x != 0) { |
185 |
+- *i += *d; |
186 |
+- } else { |
187 |
+- *i -= *d; |
188 |
+- } |
189 |
+- *d /= 2; |
190 |
+- |
191 |
+- if (array[*i] == 0) { |
192 |
+- array[*i] = 1; |
193 |
+- return -1; |
194 |
+- } |
195 |
+- if (*d == 0) return *i; |
196 |
+- else return -2; |
197 |
+-} |
198 |
+- |
199 |
+-- |
200 |
+2.19.2 |
201 |
+ |