Gentoo Archives: gentoo-commits

From: James Le Cuirot <chewi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-java/icedtea/files/, dev-java/icedtea/
Date: Sun, 03 Jan 2016 21:16:38
Message-Id: 1451855785.878e7d8b49d822f9f80ba0f3671b87b8cef19980.chewi@gentoo
1 commit: 878e7d8b49d822f9f80ba0f3671b87b8cef19980
2 Author: James Le Cuirot <chewi <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jan 3 21:07:57 2016 +0000
4 Commit: James Le Cuirot <chewi <AT> gentoo <DOT> org>
5 CommitDate: Sun Jan 3 21:16:25 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=878e7d8b
7
8 dev-java/icedtea: Allow newer icedtea-web and update CACAO patch
9
10 Although the previous dynamic max heap patch helped, there were still
11 major issues with the value being stored in a signed 32-bit int. The
12 patch series has been submitted upstream to both IcedTea and CACAO.
13
14 Package-Manager: portage-2.2.26
15
16 dev-java/icedtea/files/6-cacao-dynmaxheap.patch | 42 ------
17 dev-java/icedtea/files/6-cacao-pr-157.patch | 143 +++++++++++++++++++++
18 dev-java/icedtea/files/7-cacao-dynmaxheap.patch | 42 ------
19 dev-java/icedtea/files/7-cacao-pr-157.patch | 139 ++++++++++++++++++++
20 ...1.13.9-r1.ebuild => icedtea-6.1.13.9-r2.ebuild} | 4 +-
21 ...7.2.6.3-r2.ebuild => icedtea-7.2.6.3-r3.ebuild} | 8 +-
22 6 files changed, 288 insertions(+), 90 deletions(-)
23
24 diff --git a/dev-java/icedtea/files/6-cacao-dynmaxheap.patch b/dev-java/icedtea/files/6-cacao-dynmaxheap.patch
25 deleted file mode 100644
26 index 33b9818..0000000
27 --- a/dev-java/icedtea/files/6-cacao-dynmaxheap.patch
28 +++ /dev/null
29 @@ -1,42 +0,0 @@
30 -# HG changeset patch
31 -# User James Le Cuirot <chewi@g.o>
32 -# Date 1441543564 -3600
33 -# Sun Sep 06 13:46:04 2015 +0100
34 -# Node ID d0224f4490d6694e77dcb0ff7eae8e2297b822bf
35 -# Parent e215e36be9fc2b7dfe43ff10ec1afe639b289aa5
36 -Dynamically set the maximum heap size on Linux
37 -
38 -diff -r e215e36be9fc -r d0224f4490d6 src/vm/vm.cpp
39 ---- cacao/cacao/src/vm/vm.cpp Mon Feb 11 19:31:28 2013 +0100
40 -+++ cacao/cacao/src/vm/vm.cpp Sun Sep 06 13:46:04 2015 +0100
41 -@@ -33,6 +33,10 @@
42 - #include <errno.h>
43 - #include <stdlib.h>
44 -
45 -+#if defined(__LINUX__)
46 -+#include <unistd.h>
47 -+#endif
48 -+
49 - #include "vm/types.h"
50 -
51 - #include "arch.h"
52 -@@ -702,6 +706,19 @@
53 - opt_heapstartsize = HEAP_STARTSIZE;
54 - opt_stacksize = STACK_SIZE;
55 -
56 -+#if defined(__LINUX__)
57 -+ // Calculate 1/4 of the physical memory.
58 -+ uint64_t qmem = sysconf(_SC_PHYS_PAGES) * sysconf(_SC_PAGESIZE) / 4;
59 -+
60 -+ if (qmem > INT32_MAX) {
61 -+ // More than 2GB will overflow so cap it.
62 -+ opt_heapmaxsize = 2047 * 1024 * 1024;
63 -+ } else if (qmem > HEAP_MAXSIZE) {
64 -+ // Otherwise use this if greater than default (128MB).
65 -+ opt_heapmaxsize = (s4) qmem;
66 -+ }
67 -+#endif
68 -+
69 - // First of all, parse the -XX options.
70 -
71 - #if defined(ENABLE_VMLOG)
72
73 diff --git a/dev-java/icedtea/files/6-cacao-pr-157.patch b/dev-java/icedtea/files/6-cacao-pr-157.patch
74 new file mode 100644
75 index 0000000..3419b8f
76 --- /dev/null
77 +++ b/dev-java/icedtea/files/6-cacao-pr-157.patch
78 @@ -0,0 +1,143 @@
79 +diff -Naur cacao/cacao/src/vm/options.c cacao/cacao/src/vm/options.c
80 +--- cacao/cacao/src/vm/options.c 2013-01-10 16:45:14.000000000 +0000
81 ++++ cacao/cacao/src/vm/options.c 2016-01-03 11:48:06.439004345 +0000
82 +@@ -26,6 +26,7 @@
83 + #include "config.h"
84 +
85 + #include <limits.h>
86 ++#include <stddef.h>
87 + #include <stdint.h>
88 + #include <stdio.h>
89 + #include <stdlib.h>
90 +@@ -56,9 +57,9 @@
91 +
92 + bool opt_run = true;
93 +
94 +-s4 opt_heapmaxsize = 0; /* maximum heap size */
95 +-s4 opt_heapstartsize = 0; /* initial heap size */
96 +-s4 opt_stacksize = 0; /* thread stack size */
97 ++size_t opt_heapmaxsize = 0; /* maximum heap size */
98 ++size_t opt_heapstartsize = 0; /* initial heap size */
99 ++size_t opt_stacksize = 0; /* thread stack size */
100 +
101 + bool opt_verbose = false;
102 + bool opt_debugcolor = false; /* use ANSI terminal sequences */
103 +diff -Naur cacao/cacao/src/vm/options.h cacao/cacao/src/vm/options.h
104 +--- cacao/cacao/src/vm/options.h 2013-01-10 16:45:14.000000000 +0000
105 ++++ cacao/cacao/src/vm/options.h 2016-01-03 11:48:55.397204706 +0000
106 +@@ -32,6 +32,7 @@
107 + extern "C" {
108 + #endif
109 +
110 ++#include <stddef.h>
111 + #include <stdint.h>
112 +
113 + #include "vm/types.h"
114 +@@ -82,9 +83,9 @@
115 + extern bool opt_jar;
116 + extern bool opt_run;
117 +
118 +-extern s4 opt_heapmaxsize;
119 +-extern s4 opt_heapstartsize;
120 +-extern s4 opt_stacksize;
121 ++extern size_t opt_heapmaxsize;
122 ++extern size_t opt_heapstartsize;
123 ++extern size_t opt_stacksize;
124 +
125 + extern bool opt_verbose;
126 + extern bool opt_debugcolor;
127 +diff -Naur cacao/cacao/src/vm/vm.cpp cacao/cacao/src/vm/vm.cpp
128 +--- cacao/cacao/src/vm/vm.cpp 2013-01-10 16:45:14.000000000 +0000
129 ++++ cacao/cacao/src/vm/vm.cpp 2016-01-03 11:50:15.779891441 +0000
130 +@@ -25,6 +25,7 @@
131 +
132 + #include "config.h"
133 +
134 ++#include <stddef.h>
135 + #include <stdint.h>
136 +
137 + #include <exception>
138 +@@ -33,6 +34,10 @@
139 + #include <errno.h>
140 + #include <stdlib.h>
141 +
142 ++#if defined(__LINUX__)
143 ++#include <unistd.h>
144 ++#endif
145 ++
146 + #include "vm/types.h"
147 +
148 + #include "arch.h"
149 +@@ -699,6 +704,19 @@
150 + opt_heapstartsize = HEAP_STARTSIZE;
151 + opt_stacksize = STACK_SIZE;
152 +
153 ++#if defined(__LINUX__)
154 ++ // Calculate 1/4 of the physical memory.
155 ++ size_t qmem = sysconf(_SC_PHYS_PAGES) * sysconf(_SC_PAGESIZE) / 4;
156 ++
157 ++ if (qmem > INT32_MAX) {
158 ++ // Allocate no more than 2GB.
159 ++ opt_heapmaxsize = INT32_MAX;
160 ++ } else if (qmem > HEAP_MAXSIZE) {
161 ++ // Otherwise use this if greater than default (128MB).
162 ++ opt_heapmaxsize = qmem;
163 ++ }
164 ++#endif
165 ++
166 + // First of all, parse the -XX options.
167 +
168 + #if defined(ENABLE_VMLOG)
169 +@@ -914,18 +932,33 @@
170 + case OPT_SS:
171 + {
172 + char c;
173 +- int j;
174 ++ size_t j;
175 +
176 ++ errno = 0;
177 + c = opt_arg[strlen(opt_arg) - 1];
178 ++ j = strtoul(opt_arg, NULL, 10);
179 ++
180 ++ if (errno)
181 ++ break; // Invalid.
182 +
183 + if ((c == 'k') || (c == 'K')) {
184 +- j = atoi(opt_arg) * 1024;
185 ++ if (j > SIZE_MAX / 1024)
186 ++ break; // Overflow.
187 ++ else
188 ++ j *= 1024;
189 +
190 + } else if ((c == 'm') || (c == 'M')) {
191 +- j = atoi(opt_arg) * 1024 * 1024;
192 +-
193 +- } else
194 +- j = atoi(opt_arg);
195 ++ if (j > SIZE_MAX / 1024 / 1024)
196 ++ break; // Overflow.
197 ++ else
198 ++ j *= 1024 * 1024;
199 ++
200 ++ } else if ((c == 'g') || (c == 'G')) {
201 ++ if (j > SIZE_MAX / 1024 / 1024 / 1024)
202 ++ break; // Overflow.
203 ++ else
204 ++ j *= 1024 * 1024 * 1024;
205 ++ }
206 +
207 + if (opt == OPT_MX)
208 + opt_heapmaxsize = j;
209 +@@ -1525,9 +1558,9 @@
210 + void VM::print_run_time_config()
211 + {
212 + puts("Run-time variables:\n");
213 +- printf(" maximum heap size : %d\n", opt_heapmaxsize);
214 +- printf(" initial heap size : %d\n", opt_heapstartsize);
215 +- printf(" stack size : %d\n", opt_stacksize);
216 ++ printf(" maximum heap size : %lu\n", opt_heapmaxsize);
217 ++ printf(" initial heap size : %lu\n", opt_heapstartsize);
218 ++ printf(" stack size : %lu\n", opt_stacksize);
219 +
220 + #if defined(WITH_JAVA_RUNTIME_LIBRARY_GNU_CLASSPATH)
221 + printf(" gnu.classpath.boot.library.path: %s\n", _properties.get("gnu.classpath.boot.library.path"));
222
223 diff --git a/dev-java/icedtea/files/7-cacao-dynmaxheap.patch b/dev-java/icedtea/files/7-cacao-dynmaxheap.patch
224 deleted file mode 100644
225 index edce1e8..0000000
226 --- a/dev-java/icedtea/files/7-cacao-dynmaxheap.patch
227 +++ /dev/null
228 @@ -1,42 +0,0 @@
229 -# HG changeset patch
230 -# User James Le Cuirot <chewi@g.o>
231 -# Date 1441541110 -3600
232 -# Sun Sep 06 13:05:10 2015 +0100
233 -# Node ID 80e5553df66e3abb3680f747cbb8e32b394b4211
234 -# Parent 468081e3e037df27b6427aa298dfaaa20f4ba4bf
235 -Dynamically set the maximum heap size on Linux
236 -
237 -diff -r 468081e3e037 -r 80e5553df66e src/vm/vm.cpp
238 ---- cacao/cacao/src/vm/vm.cpp Wed Jun 10 19:52:58 2015 +0200
239 -+++ cacao/cacao/src/vm/vm.cpp Sun Sep 06 13:05:10 2015 +0100
240 -@@ -32,6 +32,10 @@
241 - #include <stdint.h>
242 - #include <inttypes.h>
243 -
244 -+#if defined(__LINUX__)
245 -+#include <unistd.h>
246 -+#endif
247 -+
248 - #include "md-abi.hpp"
249 -
250 - #include "mm/codememory.hpp"
251 -@@ -690,6 +694,19 @@
252 - opt_heapstartsize = HEAP_STARTSIZE;
253 - opt_stacksize = STACK_SIZE;
254 -
255 -+#if defined(__LINUX__)
256 -+ // Calculate 1/4 of the physical memory.
257 -+ uint64_t qmem = sysconf(_SC_PHYS_PAGES) * sysconf(_SC_PAGESIZE) / 4;
258 -+
259 -+ if (qmem > INT32_MAX) {
260 -+ // More than 2GB will overflow so cap it.
261 -+ opt_heapmaxsize = 2047 * 1024 * 1024;
262 -+ } else if (qmem > HEAP_MAXSIZE) {
263 -+ // Otherwise use this if greater than default (128MB).
264 -+ opt_heapmaxsize = (s4) qmem;
265 -+ }
266 -+#endif
267 -+
268 - // First of all, parse the -XX options.
269 - options_xx(vm_args);
270 -
271
272 diff --git a/dev-java/icedtea/files/7-cacao-pr-157.patch b/dev-java/icedtea/files/7-cacao-pr-157.patch
273 new file mode 100644
274 index 0000000..0701363
275 --- /dev/null
276 +++ b/dev-java/icedtea/files/7-cacao-pr-157.patch
277 @@ -0,0 +1,139 @@
278 +diff -Naur cacao/cacao/src/vm/options.cpp cacao/cacao/src/vm/options.cpp
279 +--- cacao/cacao/src/vm/options.cpp 2014-12-12 21:14:45.000000000 +0000
280 ++++ cacao/cacao/src/vm/options.cpp 2015-12-23 21:01:37.644275263 +0000
281 +@@ -26,6 +26,7 @@
282 + #include "config.h"
283 +
284 + #include <limits.h>
285 ++#include <stddef.h>
286 + #include <stdint.h>
287 + #include <stdio.h>
288 + #include <stdlib.h>
289 +@@ -60,9 +61,9 @@
290 +
291 + bool opt_run = true;
292 +
293 +-s4 opt_heapmaxsize = 0; /* maximum heap size */
294 +-s4 opt_heapstartsize = 0; /* initial heap size */
295 +-s4 opt_stacksize = 0; /* thread stack size */
296 ++size_t opt_heapmaxsize = 0; /* maximum heap size */
297 ++size_t opt_heapstartsize = 0; /* initial heap size */
298 ++size_t opt_stacksize = 0; /* thread stack size */
299 +
300 + bool opt_verbose = false;
301 + bool opt_debugcolor = false; /* use ANSI terminal sequences */
302 +diff -Naur cacao/cacao/src/vm/options.hpp cacao/cacao/src/vm/options.hpp
303 +--- cacao/cacao/src/vm/options.hpp 2014-12-12 21:14:45.000000000 +0000
304 ++++ cacao/cacao/src/vm/options.hpp 2015-12-23 21:01:37.645275246 +0000
305 +@@ -26,6 +26,7 @@
306 + #ifndef OPTIONS_HPP_
307 + #define OPTIONS_HPP_ 1
308 +
309 ++#include <stddef.h> // for size_t
310 + #include <stdint.h> // for int64_t
311 + #include <stdio.h> // for FILE
312 + #include "config.h" // for ENABLE_DEBUG_FILTER, etc
313 +@@ -77,9 +78,9 @@
314 + extern bool opt_jar;
315 + extern bool opt_run;
316 +
317 +-extern s4 opt_heapmaxsize;
318 +-extern s4 opt_heapstartsize;
319 +-extern s4 opt_stacksize;
320 ++extern size_t opt_heapmaxsize;
321 ++extern size_t opt_heapstartsize;
322 ++extern size_t opt_stacksize;
323 +
324 + extern bool opt_verbose;
325 + extern bool opt_debugcolor;
326 +diff -Naur cacao/cacao/src/vm/vm.cpp cacao/cacao/src/vm/vm.cpp
327 +--- cacao/cacao/src/vm/vm.cpp 2014-12-12 21:14:45.000000000 +0000
328 ++++ cacao/cacao/src/vm/vm.cpp 2015-12-23 21:01:38.046268504 +0000
329 +@@ -29,9 +29,14 @@
330 + #include <cerrno>
331 + #include <cstdlib>
332 + #include <exception>
333 ++#include <stddef.h>
334 + #include <stdint.h>
335 + #include <inttypes.h>
336 +
337 ++#if defined(__LINUX__)
338 ++#include <unistd.h>
339 ++#endif
340 ++
341 + #include "md-abi.hpp"
342 +
343 + #include "mm/codememory.hpp"
344 +@@ -690,6 +695,19 @@
345 + opt_heapstartsize = HEAP_STARTSIZE;
346 + opt_stacksize = STACK_SIZE;
347 +
348 ++#if defined(__LINUX__)
349 ++ // Calculate 1/4 of the physical memory.
350 ++ size_t qmem = sysconf(_SC_PHYS_PAGES) * sysconf(_SC_PAGESIZE) / 4;
351 ++
352 ++ if (qmem > INT32_MAX) {
353 ++ // Allocate no more than 2GB.
354 ++ opt_heapmaxsize = INT32_MAX;
355 ++ } else if (qmem > HEAP_MAXSIZE) {
356 ++ // Otherwise use this if greater than default (128MB).
357 ++ opt_heapmaxsize = qmem;
358 ++ }
359 ++#endif
360 ++
361 + // First of all, parse the -XX options.
362 + options_xx(vm_args);
363 +
364 +@@ -896,18 +914,33 @@
365 + case OPT_SS:
366 + {
367 + char c;
368 +- int j;
369 ++ size_t j;
370 +
371 ++ errno = 0;
372 + c = opt_arg[strlen(opt_arg) - 1];
373 ++ j = strtoul(opt_arg, NULL, 10);
374 ++
375 ++ if (errno)
376 ++ break; // Invalid.
377 +
378 + if ((c == 'k') || (c == 'K')) {
379 +- j = atoi(opt_arg) * 1024;
380 ++ if (j > SIZE_MAX / 1024)
381 ++ break; // Overflow.
382 ++ else
383 ++ j *= 1024;
384 +
385 + } else if ((c == 'm') || (c == 'M')) {
386 +- j = atoi(opt_arg) * 1024 * 1024;
387 +-
388 +- } else
389 +- j = atoi(opt_arg);
390 ++ if (j > SIZE_MAX / 1024 / 1024)
391 ++ break; // Overflow.
392 ++ else
393 ++ j *= 1024 * 1024;
394 ++
395 ++ } else if ((c == 'g') || (c == 'G')) {
396 ++ if (j > SIZE_MAX / 1024 / 1024 / 1024)
397 ++ break; // Overflow.
398 ++ else
399 ++ j *= 1024 * 1024 * 1024;
400 ++ }
401 +
402 + if (opt == OPT_MX)
403 + opt_heapmaxsize = j;
404 +@@ -1498,9 +1531,9 @@
405 + void VM::print_run_time_config()
406 + {
407 + puts("Run-time variables:\n");
408 +- printf(" maximum heap size : %d\n", opt_heapmaxsize);
409 +- printf(" initial heap size : %d\n", opt_heapstartsize);
410 +- printf(" stack size : %d\n", opt_stacksize);
411 ++ printf(" maximum heap size : %lu\n", opt_heapmaxsize);
412 ++ printf(" initial heap size : %lu\n", opt_heapstartsize);
413 ++ printf(" stack size : %lu\n", opt_stacksize);
414 +
415 + #if defined(WITH_JAVA_RUNTIME_LIBRARY_GNU_CLASSPATH)
416 + printf(" gnu.classpath.boot.library.path: %s\n", _properties.get("gnu.classpath.boot.library.path"));
417
418 diff --git a/dev-java/icedtea/icedtea-6.1.13.9-r1.ebuild b/dev-java/icedtea/icedtea-6.1.13.9-r2.ebuild
419 similarity index 98%
420 rename from dev-java/icedtea/icedtea-6.1.13.9-r1.ebuild
421 rename to dev-java/icedtea/icedtea-6.1.13.9-r2.ebuild
422 index 403ef6b..552d4aa 100644
423 --- a/dev-java/icedtea/icedtea-6.1.13.9-r1.ebuild
424 +++ b/dev-java/icedtea/icedtea-6.1.13.9-r2.ebuild
425 @@ -1,4 +1,4 @@
426 -# Copyright 1999-2015 Gentoo Foundation
427 +# Copyright 1999-2016 Gentoo Foundation
428 # Distributed under the terms of the GNU General Public License v2
429 # $Id$
430 # Build written by Andrew John Hughes (gnu_andrew@××××××××××.org)
431 @@ -206,7 +206,7 @@ src_configure() {
432 cacao_config="--enable-cacao"
433
434 # http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=2611
435 - export DISTRIBUTION_PATCHES="${SLOT}-cacao-dynmaxheap.patch"
436 + export DISTRIBUTION_PATCHES="${SLOT}-cacao-pr-157.patch"
437 ln -snf "${FILESDIR}/${DISTRIBUTION_PATCHES}" || die
438 fi
439
440
441 diff --git a/dev-java/icedtea/icedtea-7.2.6.3-r2.ebuild b/dev-java/icedtea/icedtea-7.2.6.3-r3.ebuild
442 similarity index 98%
443 rename from dev-java/icedtea/icedtea-7.2.6.3-r2.ebuild
444 rename to dev-java/icedtea/icedtea-7.2.6.3-r3.ebuild
445 index 684c6e8..d32b642 100644
446 --- a/dev-java/icedtea/icedtea-7.2.6.3-r2.ebuild
447 +++ b/dev-java/icedtea/icedtea-7.2.6.3-r3.ebuild
448 @@ -1,4 +1,4 @@
449 -# Copyright 1999-2015 Gentoo Foundation
450 +# Copyright 1999-2016 Gentoo Foundation
451 # Distributed under the terms of the GNU General Public License v2
452 # $Id$
453 # Build written by Andrew John Hughes (gnu_andrew@××××××××××.org)
454 @@ -152,8 +152,8 @@ DEPEND="${COMMON_DEP} ${ALSA_COMMON_DEP} ${CUPS_COMMON_DEP} ${X_COMMON_DEP} ${X_
455 virtual/pkgconfig
456 pax_kernel? ( sys-apps/elfix )"
457
458 -PDEPEND="webstart? ( dev-java/icedtea-web:0[icedtea7] )
459 - nsplugin? ( dev-java/icedtea-web:0[icedtea7,nsplugin] )
460 +PDEPEND="webstart? ( dev-java/icedtea-web:0[icedtea7(+)] )
461 + nsplugin? ( dev-java/icedtea-web:0[icedtea7(+),nsplugin] )
462 pulseaudio? ( dev-java/icedtea-sound )"
463
464 S="${WORKDIR}"/${ICEDTEA_PKG}
465 @@ -266,7 +266,7 @@ src_configure() {
466 cacao_config="--enable-cacao"
467
468 # http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=2612
469 - export DISTRIBUTION_PATCHES="${SLOT}-cacao-dynmaxheap.patch"
470 + export DISTRIBUTION_PATCHES="${SLOT}-cacao-pr-157.patch"
471 ln -snf "${FILESDIR}/${DISTRIBUTION_PATCHES}" || die
472 fi