summaryrefslogtreecommitdiff
path: root/lang/openjdk7/patches
diff options
context:
space:
mode:
authorjoerg <joerg@pkgsrc.org>2012-11-02 22:28:54 +0000
committerjoerg <joerg@pkgsrc.org>2012-11-02 22:28:54 +0000
commit7ac17b6dd8e4b3450f20c0cf9adc5cb46d5be68e (patch)
tree9a7949aa5bd7b20fb73b63e2ae5e70ab9be2c79f /lang/openjdk7/patches
parent7ae6cd5e9a312a514af1c0fe2508b82705179af8 (diff)
downloadpkgsrc-7ac17b6dd8e4b3450f20c0cf9adc5cb46d5be68e.tar.gz
Use hw.usermem64 when available to truncation to less than 4GB on 64bit
architectures. Honour data and address space limits on all BSDs. Explicitly limit the heap size during bootstrap to 256MB. This fixes e.g. my bulk build, which is run with an AS limit of 2GB. Since hw.usermem would tell the bootstrap JVM that > 3GB are available, initialisation would fail. Bump revision.
Diffstat (limited to 'lang/openjdk7/patches')
-rw-r--r--lang/openjdk7/patches/patch-aa58
1 files changed, 54 insertions, 4 deletions
diff --git a/lang/openjdk7/patches/patch-aa b/lang/openjdk7/patches/patch-aa
index ee08dee06c5..ebeaea2c0f4 100644
--- a/lang/openjdk7/patches/patch-aa
+++ b/lang/openjdk7/patches/patch-aa
@@ -1,4 +1,4 @@
-$NetBSD: patch-aa,v 1.5 2012/05/12 21:01:47 marino Exp $
+$NetBSD: patch-aa,v 1.6 2012/11/02 22:28:54 joerg Exp $
--- hotspot/src/os/bsd/vm/os_bsd.cpp.orig 2012-05-12 08:57:44.793207000 +0000
+++ hotspot/src/os/bsd/vm/os_bsd.cpp
@@ -15,7 +15,57 @@ $NetBSD: patch-aa,v 1.5 2012/05/12 21:01:47 marino Exp $
#endif
#ifdef __APPLE__
-@@ -2039,7 +2042,9 @@ void * os::dll_load(const char *filename
+@@ -335,7 +338,12 @@ void os::Bsd::initialize_system_info() {
+ int mib[2];
+ size_t len;
+ int cpu_val;
++#ifdef HW_USERMEM64
++ uint64_t mem_val;
++#else
+ u_long mem_val;
++#endif
++ struct rlimit limits;
+
+ /* get processors count via hw.ncpus sysctl */
+ mib[0] = CTL_HW;
+@@ -352,21 +360,26 @@ void os::Bsd::initialize_system_info() {
+ * instead of hw.physmem because we need size of allocatable memory
+ */
+ mib[0] = CTL_HW;
++#ifdef HW_USERMEM64
++ mib[1] = HW_USERMEM64;
++#else
+ mib[1] = HW_USERMEM;
++#endif
+ len = sizeof(mem_val);
+- if (sysctl(mib, 2, &mem_val, &len, NULL, 0) != -1)
++ if (sysctl(mib, 2, &mem_val, &len, NULL, 0) != -1) {
+ _physical_memory = mem_val;
+- else
++#ifdef HW_USERMEM64
++ if (_physical_memory < mem_val)
++ _physical_memory = (julong)-1;
++#endif
++ } else
+ _physical_memory = 256*1024*1024; // fallback (XXXBSD?)
+
+-#ifdef __OpenBSD__
+- {
+- // limit _physical_memory memory view on OpenBSD since
+- // datasize rlimit restricts us anyway.
+- struct rlimit limits;
+- getrlimit(RLIMIT_DATA, &limits);
+- _physical_memory = MIN2(_physical_memory, (julong)limits.rlim_cur);
+- }
++ getrlimit(RLIMIT_DATA, &limits);
++ _physical_memory = MIN2(_physical_memory, (julong)limits.rlim_cur);
++#if defined(RLIMIT_AS)
++ getrlimit(RLIMIT_DATA, &limits);
++ _physical_memory = MIN2(_physical_memory, (julong)limits.rlim_cur);
+ #endif
+ }
+ #else
+@@ -2039,7 +2052,9 @@ void * os::dll_load(const char *filename
{EM_PPC, EM_PPC, ELFCLASS32, ELFDATA2MSB, (char*)"Power PC 32"},
{EM_PPC64, EM_PPC64, ELFCLASS64, ELFDATA2MSB, (char*)"Power PC 64"},
{EM_ARM, EM_ARM, ELFCLASS32, ELFDATA2LSB, (char*)"ARM"},
@@ -25,7 +75,7 @@ $NetBSD: patch-aa,v 1.5 2012/05/12 21:01:47 marino Exp $
{EM_ALPHA, EM_ALPHA, ELFCLASS64, ELFDATA2LSB, (char*)"Alpha"},
{EM_MIPS_RS3_LE, EM_MIPS_RS3_LE, ELFCLASS32, ELFDATA2LSB, (char*)"MIPSel"},
{EM_MIPS, EM_MIPS, ELFCLASS32, ELFDATA2MSB, (char*)"MIPS"},
-@@ -3559,7 +3564,7 @@ OSReturn os::set_native_priority(Thread*
+@@ -3559,7 +3574,7 @@ OSReturn os::set_native_priority(Thread*
#ifdef __OpenBSD__
// OpenBSD pthread_setprio starves low priority threads
return OS_OK;
@@ -34,7 +84,7 @@ $NetBSD: patch-aa,v 1.5 2012/05/12 21:01:47 marino Exp $
int ret = pthread_setprio(thread->osthread()->pthread_id(), newpri);
#elif defined(__APPLE__) || defined(__NetBSD__)
struct sched_param sp;
-@@ -3587,7 +3592,7 @@ OSReturn os::get_native_priority(const T
+@@ -3587,7 +3602,7 @@ OSReturn os::get_native_priority(const T
}
errno = 0;