diff options
author | James Le Cuirot <chewi@gentoo.org> | 2016-01-03 21:07:57 +0000 |
---|---|---|
committer | James Le Cuirot <chewi@gentoo.org> | 2016-01-03 21:16:25 +0000 |
commit | 878e7d8b49d822f9f80ba0f3671b87b8cef19980 (patch) | |
tree | 8a592c7a17695537bceed8877ab85f6010861fac /dev-java/icedtea/files | |
parent | mail-client/alot: Depend on python-magic instead of file[python] (diff) | |
download | gentoo-878e7d8b49d822f9f80ba0f3671b87b8cef19980.tar.gz gentoo-878e7d8b49d822f9f80ba0f3671b87b8cef19980.tar.bz2 gentoo-878e7d8b49d822f9f80ba0f3671b87b8cef19980.zip |
dev-java/icedtea: Allow newer icedtea-web and update CACAO patch
Although the previous dynamic max heap patch helped, there were still
major issues with the value being stored in a signed 32-bit int. The
patch series has been submitted upstream to both IcedTea and CACAO.
Package-Manager: portage-2.2.26
Diffstat (limited to 'dev-java/icedtea/files')
-rw-r--r-- | dev-java/icedtea/files/6-cacao-dynmaxheap.patch | 42 | ||||
-rw-r--r-- | dev-java/icedtea/files/6-cacao-pr-157.patch | 143 | ||||
-rw-r--r-- | dev-java/icedtea/files/7-cacao-dynmaxheap.patch | 42 | ||||
-rw-r--r-- | dev-java/icedtea/files/7-cacao-pr-157.patch | 139 |
4 files changed, 282 insertions, 84 deletions
diff --git a/dev-java/icedtea/files/6-cacao-dynmaxheap.patch b/dev-java/icedtea/files/6-cacao-dynmaxheap.patch deleted file mode 100644 index 33b98183769e..000000000000 --- a/dev-java/icedtea/files/6-cacao-dynmaxheap.patch +++ /dev/null @@ -1,42 +0,0 @@ -# HG changeset patch -# User James Le Cuirot <chewi@gentoo.org> -# Date 1441543564 -3600 -# Sun Sep 06 13:46:04 2015 +0100 -# Node ID d0224f4490d6694e77dcb0ff7eae8e2297b822bf -# Parent e215e36be9fc2b7dfe43ff10ec1afe639b289aa5 -Dynamically set the maximum heap size on Linux - -diff -r e215e36be9fc -r d0224f4490d6 src/vm/vm.cpp ---- cacao/cacao/src/vm/vm.cpp Mon Feb 11 19:31:28 2013 +0100 -+++ cacao/cacao/src/vm/vm.cpp Sun Sep 06 13:46:04 2015 +0100 -@@ -33,6 +33,10 @@ - #include <errno.h> - #include <stdlib.h> - -+#if defined(__LINUX__) -+#include <unistd.h> -+#endif -+ - #include "vm/types.h" - - #include "arch.h" -@@ -702,6 +706,19 @@ - opt_heapstartsize = HEAP_STARTSIZE; - opt_stacksize = STACK_SIZE; - -+#if defined(__LINUX__) -+ // Calculate 1/4 of the physical memory. -+ uint64_t qmem = sysconf(_SC_PHYS_PAGES) * sysconf(_SC_PAGESIZE) / 4; -+ -+ if (qmem > INT32_MAX) { -+ // More than 2GB will overflow so cap it. -+ opt_heapmaxsize = 2047 * 1024 * 1024; -+ } else if (qmem > HEAP_MAXSIZE) { -+ // Otherwise use this if greater than default (128MB). -+ opt_heapmaxsize = (s4) qmem; -+ } -+#endif -+ - // First of all, parse the -XX options. - - #if defined(ENABLE_VMLOG) diff --git a/dev-java/icedtea/files/6-cacao-pr-157.patch b/dev-java/icedtea/files/6-cacao-pr-157.patch new file mode 100644 index 000000000000..3419b8f12be8 --- /dev/null +++ b/dev-java/icedtea/files/6-cacao-pr-157.patch @@ -0,0 +1,143 @@ +diff -Naur cacao/cacao/src/vm/options.c cacao/cacao/src/vm/options.c +--- cacao/cacao/src/vm/options.c 2013-01-10 16:45:14.000000000 +0000 ++++ cacao/cacao/src/vm/options.c 2016-01-03 11:48:06.439004345 +0000 +@@ -26,6 +26,7 @@ + #include "config.h" + + #include <limits.h> ++#include <stddef.h> + #include <stdint.h> + #include <stdio.h> + #include <stdlib.h> +@@ -56,9 +57,9 @@ + + bool opt_run = true; + +-s4 opt_heapmaxsize = 0; /* maximum heap size */ +-s4 opt_heapstartsize = 0; /* initial heap size */ +-s4 opt_stacksize = 0; /* thread stack size */ ++size_t opt_heapmaxsize = 0; /* maximum heap size */ ++size_t opt_heapstartsize = 0; /* initial heap size */ ++size_t opt_stacksize = 0; /* thread stack size */ + + bool opt_verbose = false; + bool opt_debugcolor = false; /* use ANSI terminal sequences */ +diff -Naur cacao/cacao/src/vm/options.h cacao/cacao/src/vm/options.h +--- cacao/cacao/src/vm/options.h 2013-01-10 16:45:14.000000000 +0000 ++++ cacao/cacao/src/vm/options.h 2016-01-03 11:48:55.397204706 +0000 +@@ -32,6 +32,7 @@ + extern "C" { + #endif + ++#include <stddef.h> + #include <stdint.h> + + #include "vm/types.h" +@@ -82,9 +83,9 @@ + extern bool opt_jar; + extern bool opt_run; + +-extern s4 opt_heapmaxsize; +-extern s4 opt_heapstartsize; +-extern s4 opt_stacksize; ++extern size_t opt_heapmaxsize; ++extern size_t opt_heapstartsize; ++extern size_t opt_stacksize; + + extern bool opt_verbose; + extern bool opt_debugcolor; +diff -Naur cacao/cacao/src/vm/vm.cpp cacao/cacao/src/vm/vm.cpp +--- cacao/cacao/src/vm/vm.cpp 2013-01-10 16:45:14.000000000 +0000 ++++ cacao/cacao/src/vm/vm.cpp 2016-01-03 11:50:15.779891441 +0000 +@@ -25,6 +25,7 @@ + + #include "config.h" + ++#include <stddef.h> + #include <stdint.h> + + #include <exception> +@@ -33,6 +34,10 @@ + #include <errno.h> + #include <stdlib.h> + ++#if defined(__LINUX__) ++#include <unistd.h> ++#endif ++ + #include "vm/types.h" + + #include "arch.h" +@@ -699,6 +704,19 @@ + opt_heapstartsize = HEAP_STARTSIZE; + opt_stacksize = STACK_SIZE; + ++#if defined(__LINUX__) ++ // Calculate 1/4 of the physical memory. ++ size_t qmem = sysconf(_SC_PHYS_PAGES) * sysconf(_SC_PAGESIZE) / 4; ++ ++ if (qmem > INT32_MAX) { ++ // Allocate no more than 2GB. ++ opt_heapmaxsize = INT32_MAX; ++ } else if (qmem > HEAP_MAXSIZE) { ++ // Otherwise use this if greater than default (128MB). ++ opt_heapmaxsize = qmem; ++ } ++#endif ++ + // First of all, parse the -XX options. + + #if defined(ENABLE_VMLOG) +@@ -914,18 +932,33 @@ + case OPT_SS: + { + char c; +- int j; ++ size_t j; + ++ errno = 0; + c = opt_arg[strlen(opt_arg) - 1]; ++ j = strtoul(opt_arg, NULL, 10); ++ ++ if (errno) ++ break; // Invalid. + + if ((c == 'k') || (c == 'K')) { +- j = atoi(opt_arg) * 1024; ++ if (j > SIZE_MAX / 1024) ++ break; // Overflow. ++ else ++ j *= 1024; + + } else if ((c == 'm') || (c == 'M')) { +- j = atoi(opt_arg) * 1024 * 1024; +- +- } else +- j = atoi(opt_arg); ++ if (j > SIZE_MAX / 1024 / 1024) ++ break; // Overflow. ++ else ++ j *= 1024 * 1024; ++ ++ } else if ((c == 'g') || (c == 'G')) { ++ if (j > SIZE_MAX / 1024 / 1024 / 1024) ++ break; // Overflow. ++ else ++ j *= 1024 * 1024 * 1024; ++ } + + if (opt == OPT_MX) + opt_heapmaxsize = j; +@@ -1525,9 +1558,9 @@ + void VM::print_run_time_config() + { + puts("Run-time variables:\n"); +- printf(" maximum heap size : %d\n", opt_heapmaxsize); +- printf(" initial heap size : %d\n", opt_heapstartsize); +- printf(" stack size : %d\n", opt_stacksize); ++ printf(" maximum heap size : %lu\n", opt_heapmaxsize); ++ printf(" initial heap size : %lu\n", opt_heapstartsize); ++ printf(" stack size : %lu\n", opt_stacksize); + + #if defined(WITH_JAVA_RUNTIME_LIBRARY_GNU_CLASSPATH) + printf(" gnu.classpath.boot.library.path: %s\n", _properties.get("gnu.classpath.boot.library.path")); diff --git a/dev-java/icedtea/files/7-cacao-dynmaxheap.patch b/dev-java/icedtea/files/7-cacao-dynmaxheap.patch deleted file mode 100644 index edce1e85234a..000000000000 --- a/dev-java/icedtea/files/7-cacao-dynmaxheap.patch +++ /dev/null @@ -1,42 +0,0 @@ -# HG changeset patch -# User James Le Cuirot <chewi@gentoo.org> -# Date 1441541110 -3600 -# Sun Sep 06 13:05:10 2015 +0100 -# Node ID 80e5553df66e3abb3680f747cbb8e32b394b4211 -# Parent 468081e3e037df27b6427aa298dfaaa20f4ba4bf -Dynamically set the maximum heap size on Linux - -diff -r 468081e3e037 -r 80e5553df66e src/vm/vm.cpp ---- cacao/cacao/src/vm/vm.cpp Wed Jun 10 19:52:58 2015 +0200 -+++ cacao/cacao/src/vm/vm.cpp Sun Sep 06 13:05:10 2015 +0100 -@@ -32,6 +32,10 @@ - #include <stdint.h> - #include <inttypes.h> - -+#if defined(__LINUX__) -+#include <unistd.h> -+#endif -+ - #include "md-abi.hpp" - - #include "mm/codememory.hpp" -@@ -690,6 +694,19 @@ - opt_heapstartsize = HEAP_STARTSIZE; - opt_stacksize = STACK_SIZE; - -+#if defined(__LINUX__) -+ // Calculate 1/4 of the physical memory. -+ uint64_t qmem = sysconf(_SC_PHYS_PAGES) * sysconf(_SC_PAGESIZE) / 4; -+ -+ if (qmem > INT32_MAX) { -+ // More than 2GB will overflow so cap it. -+ opt_heapmaxsize = 2047 * 1024 * 1024; -+ } else if (qmem > HEAP_MAXSIZE) { -+ // Otherwise use this if greater than default (128MB). -+ opt_heapmaxsize = (s4) qmem; -+ } -+#endif -+ - // First of all, parse the -XX options. - options_xx(vm_args); - diff --git a/dev-java/icedtea/files/7-cacao-pr-157.patch b/dev-java/icedtea/files/7-cacao-pr-157.patch new file mode 100644 index 000000000000..0701363cf38a --- /dev/null +++ b/dev-java/icedtea/files/7-cacao-pr-157.patch @@ -0,0 +1,139 @@ +diff -Naur cacao/cacao/src/vm/options.cpp cacao/cacao/src/vm/options.cpp +--- cacao/cacao/src/vm/options.cpp 2014-12-12 21:14:45.000000000 +0000 ++++ cacao/cacao/src/vm/options.cpp 2015-12-23 21:01:37.644275263 +0000 +@@ -26,6 +26,7 @@ + #include "config.h" + + #include <limits.h> ++#include <stddef.h> + #include <stdint.h> + #include <stdio.h> + #include <stdlib.h> +@@ -60,9 +61,9 @@ + + bool opt_run = true; + +-s4 opt_heapmaxsize = 0; /* maximum heap size */ +-s4 opt_heapstartsize = 0; /* initial heap size */ +-s4 opt_stacksize = 0; /* thread stack size */ ++size_t opt_heapmaxsize = 0; /* maximum heap size */ ++size_t opt_heapstartsize = 0; /* initial heap size */ ++size_t opt_stacksize = 0; /* thread stack size */ + + bool opt_verbose = false; + bool opt_debugcolor = false; /* use ANSI terminal sequences */ +diff -Naur cacao/cacao/src/vm/options.hpp cacao/cacao/src/vm/options.hpp +--- cacao/cacao/src/vm/options.hpp 2014-12-12 21:14:45.000000000 +0000 ++++ cacao/cacao/src/vm/options.hpp 2015-12-23 21:01:37.645275246 +0000 +@@ -26,6 +26,7 @@ + #ifndef OPTIONS_HPP_ + #define OPTIONS_HPP_ 1 + ++#include <stddef.h> // for size_t + #include <stdint.h> // for int64_t + #include <stdio.h> // for FILE + #include "config.h" // for ENABLE_DEBUG_FILTER, etc +@@ -77,9 +78,9 @@ + extern bool opt_jar; + extern bool opt_run; + +-extern s4 opt_heapmaxsize; +-extern s4 opt_heapstartsize; +-extern s4 opt_stacksize; ++extern size_t opt_heapmaxsize; ++extern size_t opt_heapstartsize; ++extern size_t opt_stacksize; + + extern bool opt_verbose; + extern bool opt_debugcolor; +diff -Naur cacao/cacao/src/vm/vm.cpp cacao/cacao/src/vm/vm.cpp +--- cacao/cacao/src/vm/vm.cpp 2014-12-12 21:14:45.000000000 +0000 ++++ cacao/cacao/src/vm/vm.cpp 2015-12-23 21:01:38.046268504 +0000 +@@ -29,9 +29,14 @@ + #include <cerrno> + #include <cstdlib> + #include <exception> ++#include <stddef.h> + #include <stdint.h> + #include <inttypes.h> + ++#if defined(__LINUX__) ++#include <unistd.h> ++#endif ++ + #include "md-abi.hpp" + + #include "mm/codememory.hpp" +@@ -690,6 +695,19 @@ + opt_heapstartsize = HEAP_STARTSIZE; + opt_stacksize = STACK_SIZE; + ++#if defined(__LINUX__) ++ // Calculate 1/4 of the physical memory. ++ size_t qmem = sysconf(_SC_PHYS_PAGES) * sysconf(_SC_PAGESIZE) / 4; ++ ++ if (qmem > INT32_MAX) { ++ // Allocate no more than 2GB. ++ opt_heapmaxsize = INT32_MAX; ++ } else if (qmem > HEAP_MAXSIZE) { ++ // Otherwise use this if greater than default (128MB). ++ opt_heapmaxsize = qmem; ++ } ++#endif ++ + // First of all, parse the -XX options. + options_xx(vm_args); + +@@ -896,18 +914,33 @@ + case OPT_SS: + { + char c; +- int j; ++ size_t j; + ++ errno = 0; + c = opt_arg[strlen(opt_arg) - 1]; ++ j = strtoul(opt_arg, NULL, 10); ++ ++ if (errno) ++ break; // Invalid. + + if ((c == 'k') || (c == 'K')) { +- j = atoi(opt_arg) * 1024; ++ if (j > SIZE_MAX / 1024) ++ break; // Overflow. ++ else ++ j *= 1024; + + } else if ((c == 'm') || (c == 'M')) { +- j = atoi(opt_arg) * 1024 * 1024; +- +- } else +- j = atoi(opt_arg); ++ if (j > SIZE_MAX / 1024 / 1024) ++ break; // Overflow. ++ else ++ j *= 1024 * 1024; ++ ++ } else if ((c == 'g') || (c == 'G')) { ++ if (j > SIZE_MAX / 1024 / 1024 / 1024) ++ break; // Overflow. ++ else ++ j *= 1024 * 1024 * 1024; ++ } + + if (opt == OPT_MX) + opt_heapmaxsize = j; +@@ -1498,9 +1531,9 @@ + void VM::print_run_time_config() + { + puts("Run-time variables:\n"); +- printf(" maximum heap size : %d\n", opt_heapmaxsize); +- printf(" initial heap size : %d\n", opt_heapstartsize); +- printf(" stack size : %d\n", opt_stacksize); ++ printf(" maximum heap size : %lu\n", opt_heapmaxsize); ++ printf(" initial heap size : %lu\n", opt_heapstartsize); ++ printf(" stack size : %lu\n", opt_stacksize); + + #if defined(WITH_JAVA_RUNTIME_LIBRARY_GNU_CLASSPATH) + printf(" gnu.classpath.boot.library.path: %s\n", _properties.get("gnu.classpath.boot.library.path")); |