diff --git a/srcpkgs/openjdk10-bootstrap/patches/aarch64.patch b/srcpkgs/openjdk10-bootstrap/patches/aarch64.patch index a19f5fac486..74dcdcc97d3 100644 --- a/srcpkgs/openjdk10-bootstrap/patches/aarch64.patch +++ b/srcpkgs/openjdk10-bootstrap/patches/aarch64.patch @@ -1,6 +1,6 @@ ---- jdk10u-jdk-10.0.2+13/src/hotspot/cpu/aarch64/interp_masm_aarch64.hpp.orig -+++ jdk10u-jdk-10.0.2+13/src/hotspot/cpu/aarch64/interp_masm_aarch64.hpp -@@ -39,8 +39,6 @@ +--- a/src/hotspot/cpu/aarch64/interp_masm_aarch64.hpp ++++ b/src/hotspot/cpu/aarch64/interp_masm_aarch64.hpp +@@ -39,8 +39,6 @@ class InterpreterMacroAssembler: public protected: protected: diff --git a/srcpkgs/openjdk10-bootstrap/patches/fix-compiler-version-10+.patch b/srcpkgs/openjdk10-bootstrap/patches/fix-compiler-version-10+.patch index 88d2784869c..626af2fb884 100644 --- a/srcpkgs/openjdk10-bootstrap/patches/fix-compiler-version-10+.patch +++ b/srcpkgs/openjdk10-bootstrap/patches/fix-compiler-version-10+.patch @@ -1,6 +1,6 @@ ---- a/make/autoconf/generated-configure.sh 2018-06-24 16:07:06.000000000 +0200 -+++ b/make/autoconf/generated-configure.sh 2020-08-18 23:58:41.459262000 +0200 -@@ -34373,7 +34373,7 @@ +--- a/make/autoconf/generated-configure.sh ++++ b/make/autoconf/generated-configure.sh +@@ -34373,7 +34373,7 @@ $as_echo "$as_me: The result from runnin COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT | \ $SED -e 's/ *[Uu]sage:.*//'` COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \ @@ -9,7 +9,7 @@ elif test "x$TOOLCHAIN_TYPE" = xxlc; then # xlc -qversion output typically looks like # IBM XL C/C++ for AIX, V11.1 (5724-X13) -@@ -34434,7 +34434,7 @@ +@@ -34434,7 +34434,7 @@ $as_echo "$as_me: The result from runnin COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT | \ $SED -e 's/ *Copyright .*//'` COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \ @@ -18,9 +18,9 @@ elif test "x$TOOLCHAIN_TYPE" = xclang; then # clang --version output typically looks like # Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn) ---- a/make/autoconf/toolchain.m4 2018-06-24 16:07:06.000000000 +0200 -+++ b/make/autoconf/toolchain.m4 2020-08-19 00:01:30.294255268 +0200 -@@ -424,7 +424,7 @@ +--- a/make/autoconf/toolchain.m4 ++++ b/make/autoconf/toolchain.m4 +@@ -424,7 +424,7 @@ AC_DEFUN([TOOLCHAIN_EXTRACT_COMPILER_VER # Collapse compiler output into a single line COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT` COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \ diff --git a/srcpkgs/openjdk10-bootstrap/patches/fix-path-exception-glibc.patch b/srcpkgs/openjdk10-bootstrap/patches/fix-path-exception-glibc.patch index 292f527318a..49fa30b6c64 100644 --- a/srcpkgs/openjdk10-bootstrap/patches/fix-path-exception-glibc.patch +++ b/srcpkgs/openjdk10-bootstrap/patches/fix-path-exception-glibc.patch @@ -16,11 +16,9 @@ Reviewed-by: iveresov, ecaspole src/hotspot/cpu/x86/globals_x86.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/src/hotspot/cpu/x86/globals_x86.hpp b/src/hotspot/cpu/x86/globals_x86.hpp -index 423e1b1e478..49073f1834a 100644 --- a/src/hotspot/cpu/x86/globals_x86.hpp +++ b/src/hotspot/cpu/x86/globals_x86.hpp -@@ -119,7 +119,7 @@ define_pd_global(bool, ThreadLocalHandshakes, false); +@@ -118,7 +118,7 @@ define_pd_global(bool, ThreadLocalHandsh product(bool, UseStoreImmI16, true, \ "Use store immediate 16-bits value instruction on x86") \ \ diff --git a/srcpkgs/openjdk10-bootstrap/patches/fix-pointer-comparison-gcc12.patch b/srcpkgs/openjdk10-bootstrap/patches/fix-pointer-comparison-gcc12.patch index f2d2ef926b1..cedb64a2f18 100644 --- a/srcpkgs/openjdk10-bootstrap/patches/fix-pointer-comparison-gcc12.patch +++ b/srcpkgs/openjdk10-bootstrap/patches/fix-pointer-comparison-gcc12.patch @@ -13,11 +13,9 @@ Reviewed-by: bobv, stuefe 4 files changed, 135 insertions(+), 71 deletions(-) create mode 100644 test/hotspot/jtreg/runtime/containers/cgroup/PlainRead.java -diff --git a/src/hotspot/os/linux/osContainer_linux.cpp b/src/hotspot/os/linux/osContainer_linux.cpp -index c2f135a9e2c7..0b35bb32c5d1 100644 --- a/src/hotspot/os/linux/osContainer_linux.cpp +++ b/src/hotspot/os/linux/osContainer_linux.cpp -@@ -414,9 +414,9 @@ void OSContainer::init() { +@@ -397,9 +397,9 @@ void OSContainer::init() { } @@ -29,8 +27,6 @@ index c2f135a9e2c7..0b35bb32c5d1 100644 } else { return NULL; } -diff --git a/src/hotspot/os/linux/osContainer_linux.hpp b/src/hotspot/os/linux/osContainer_linux.hpp -index 5ace80165d92..0a81364fc8d9 100644 --- a/src/hotspot/os/linux/osContainer_linux.hpp +++ b/src/hotspot/os/linux/osContainer_linux.hpp @@ -40,7 +40,7 @@ class OSContainer: AllStatic { @@ -42,11 +38,9 @@ index 5ace80165d92..0a81364fc8d9 100644 static jlong memory_limit_in_bytes(); static jlong memory_and_swap_limit_in_bytes(); -diff --git a/src/hotspot/os/linux/os_linux.cpp b/src/hotspot/os/linux/os_linux.cpp -index 4544baa8f762..6d530afcc30a 100644 --- a/src/hotspot/os/linux/os_linux.cpp +++ b/src/hotspot/os/linux/os_linux.cpp -@@ -177,20 +177,17 @@ julong os::Linux::available_memory() { +@@ -178,20 +178,17 @@ julong os::Linux::available_memory() { if (OSContainer::is_containerized()) { jlong mem_limit, mem_usage; @@ -78,7 +72,7 @@ index 4544baa8f762..6d530afcc30a 100644 } } -@@ -201,22 +198,18 @@ julong os::Linux::available_memory() { +@@ -202,22 +199,18 @@ julong os::Linux::available_memory() { } julong os::physical_memory() { @@ -106,23 +100,22 @@ index 4544baa8f762..6d530afcc30a 100644 log_trace(os)("total system memory: " JLONG_FORMAT, phys_mem); return phys_mem; } -@@ -2135,63 +2128,54 @@ void os::Linux::print_full_memory_info(outputStream* st) { +@@ -2136,63 +2129,54 @@ void os::Linux::print_full_memory_info(o } void os::Linux::print_container_info(outputStream* st) { - if (OSContainer::is_containerized()) { - st->print("container (cgroup) information:\n"); -+ if (!OSContainer::is_containerized()) { -+ return; -+ } - +- - char *p = OSContainer::container_type(); - if (p == NULL) - st->print("container_type() failed\n"); - else { - st->print("container_type: %s\n", p); - } -+ st->print("container (cgroup) information:\n"); ++ if (!OSContainer::is_containerized()) { ++ return; ++ } - p = OSContainer::cpu_cpuset_cpus(); - if (p == NULL) @@ -131,8 +124,7 @@ index 4544baa8f762..6d530afcc30a 100644 - st->print("cpu_cpuset_cpus: %s\n", p); - free(p); - } -+ const char *p_ct = OSContainer::container_type(); -+ st->print("container_type: %s\n", p_ct != NULL ? p_ct : "failed"); ++ st->print("container (cgroup) information:\n"); - p = OSContainer::cpu_cpuset_memory_nodes(); - if (p < 0) @@ -141,21 +133,22 @@ index 4544baa8f762..6d530afcc30a 100644 - st->print("cpu_memory_nodes: %s\n", p); - free(p); - } -+ char *p = OSContainer::cpu_cpuset_cpus(); -+ st->print("cpu_cpuset_cpus: %s\n", p != NULL ? p : "failed"); -+ free(p); ++ const char *p_ct = OSContainer::container_type(); ++ st->print("container_type: %s\n", p_ct != NULL ? p_ct : "failed"); - int i = OSContainer::active_processor_count(); - if (i < 0) - st->print("active_processor_count() failed\n"); - else - st->print("active_processor_count: %d\n", i); ++ char *p = OSContainer::cpu_cpuset_cpus(); ++ st->print("cpu_cpuset_cpus: %s\n", p != NULL ? p : "failed"); ++ free(p); ++ + p = OSContainer::cpu_cpuset_memory_nodes(); + st->print("cpu_memory_nodes: %s\n", p != NULL ? p : "failed"); + free(p); - -- i = OSContainer::cpu_quota(); -- st->print("cpu_quota: %d\n", i); ++ + int i = OSContainer::active_processor_count(); + if (i > 0) { + st->print("active_processor_count: %d\n", i); @@ -163,52 +156,51 @@ index 4544baa8f762..6d530afcc30a 100644 + st->print("active_processor_count: failed\n"); + } -- i = OSContainer::cpu_period(); -- st->print("cpu_period: %d\n", i); +- i = OSContainer::cpu_quota(); +- st->print("cpu_quota: %d\n", i); + i = OSContainer::cpu_quota(); + st->print("cpu_quota: %d\n", i); -- i = OSContainer::cpu_shares(); -- st->print("cpu_shares: %d\n", i); +- i = OSContainer::cpu_period(); +- st->print("cpu_period: %d\n", i); + i = OSContainer::cpu_period(); + st->print("cpu_period: %d\n", i); -- jlong j = OSContainer::memory_limit_in_bytes(); -- st->print("memory_limit_in_bytes: " JLONG_FORMAT "\n", j); +- i = OSContainer::cpu_shares(); +- st->print("cpu_shares: %d\n", i); + i = OSContainer::cpu_shares(); + st->print("cpu_shares: %d\n", i); -- j = OSContainer::memory_and_swap_limit_in_bytes(); -- st->print("memory_and_swap_limit_in_bytes: " JLONG_FORMAT "\n", j); +- jlong j = OSContainer::memory_limit_in_bytes(); +- st->print("memory_limit_in_bytes: " JLONG_FORMAT "\n", j); + jlong j = OSContainer::memory_limit_in_bytes(); + st->print("memory_limit_in_bytes: " JLONG_FORMAT "\n", j); -- j = OSContainer::memory_soft_limit_in_bytes(); -- st->print("memory_soft_limit_in_bytes: " JLONG_FORMAT "\n", j); +- j = OSContainer::memory_and_swap_limit_in_bytes(); +- st->print("memory_and_swap_limit_in_bytes: " JLONG_FORMAT "\n", j); + j = OSContainer::memory_and_swap_limit_in_bytes(); + st->print("memory_and_swap_limit_in_bytes: " JLONG_FORMAT "\n", j); -- j = OSContainer::OSContainer::memory_usage_in_bytes(); -- st->print("memory_usage_in_bytes: " JLONG_FORMAT "\n", j); +- j = OSContainer::memory_soft_limit_in_bytes(); +- st->print("memory_soft_limit_in_bytes: " JLONG_FORMAT "\n", j); + j = OSContainer::memory_soft_limit_in_bytes(); + st->print("memory_soft_limit_in_bytes: " JLONG_FORMAT "\n", j); +- j = OSContainer::OSContainer::memory_usage_in_bytes(); +- st->print("memory_usage_in_bytes: " JLONG_FORMAT "\n", j); ++ j = OSContainer::OSContainer::memory_usage_in_bytes(); ++ st->print("memory_usage_in_bytes: " JLONG_FORMAT "\n", j); + - j = OSContainer::OSContainer::memory_max_usage_in_bytes(); - st->print("memory_max_usage_in_bytes: " JLONG_FORMAT "\n", j); - st->cr(); - } -+ j = OSContainer::OSContainer::memory_usage_in_bytes(); -+ st->print("memory_usage_in_bytes: " JLONG_FORMAT "\n", j); -+ + j = OSContainer::OSContainer::memory_max_usage_in_bytes(); + st->print("memory_max_usage_in_bytes: " JLONG_FORMAT "\n", j); + st->cr(); } void os::print_memory_info(outputStream* st) { -diff --git a/test/hotspot/jtreg/runtime/containers/cgroup/PlainRead.java b/test/hotspot/jtreg/runtime/containers/cgroup/PlainRead.java -new file mode 100644 -index 000000000000..be16dab76b7a --- /dev/null +++ b/test/hotspot/jtreg/runtime/containers/cgroup/PlainRead.java @@ -0,0 +1,80 @@ diff --git a/srcpkgs/openjdk10-bootstrap/patches/make-4.3.patch b/srcpkgs/openjdk10-bootstrap/patches/make-4.3.patch index f60441070c5..6be16d34444 100644 --- a/srcpkgs/openjdk10-bootstrap/patches/make-4.3.patch +++ b/srcpkgs/openjdk10-bootstrap/patches/make-4.3.patch @@ -3,8 +3,6 @@ Upstream: Yes Upstream-Url: https://bugs.openjdk.java.net/browse/JDK-8237879 Author: Simon Frankenberger -diff --git a/make/common/MakeBase.gmk b/make/common/MakeBase.gmk -index 170c3ed..697f9d2 100644 --- a/make/common/MakeBase.gmk +++ b/make/common/MakeBase.gmk @@ -967,7 +967,9 @@ DependOnVariableHelper = \ diff --git a/srcpkgs/openjdk10-bootstrap/patches/xxx-fix-mem-limit.patch b/srcpkgs/openjdk10-bootstrap/patches/xxx-fix-mem-limit.patch new file mode 100644 index 00000000000..92a9444e2e3 --- /dev/null +++ b/srcpkgs/openjdk10-bootstrap/patches/xxx-fix-mem-limit.patch @@ -0,0 +1,11 @@ +--- a/src/hotspot/os/linux/os_linux.cpp ++++ b/src/hotspot/os/linux/os_linux.cpp +@@ -204,7 +204,7 @@ julong os::physical_memory() { + jlong mem_limit; + if ((mem_limit = OSContainer::memory_limit_in_bytes()) > 0) { + log_trace(os)("total container memory: " JLONG_FORMAT, mem_limit); +- return phys_mem; ++ return mem_limit; + } + log_debug(os, container)("container memory limit %s: " JLONG_FORMAT ", using host value", + mem_limit == OSCONTAINER_ERROR ? "failed" : "unlimited", mem_limit); diff --git a/srcpkgs/openjdk10-bootstrap/template b/srcpkgs/openjdk10-bootstrap/template index 4776e4b1904..7b7d36355cb 100644 --- a/srcpkgs/openjdk10-bootstrap/template +++ b/srcpkgs/openjdk10-bootstrap/template @@ -2,7 +2,7 @@ _final_jdk_home="usr/lib/jvm/java-10-openjdk" pkgname=openjdk10-bootstrap version=10.0.2p13 -revision=3 +revision=4 _repo_ver=${version/p/+} archs="x86_64* i686* aarch64* arm* ppc64*" build_style=gnu-configure