pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/lang openjdk{11,17}: fix build issues on earmv[67]hf



details:   https://anonhg.NetBSD.org/pkgsrc/rev/6d8bbc9b7752
branches:  trunk
changeset: 379906:6d8bbc9b7752
user:      tnn <tnn%pkgsrc.org@localhost>
date:      Wed May 25 06:05:34 2022 +0000

description:
openjdk{11,17}: fix build issues on earmv[67]hf

diffstat:

 lang/openjdk11/PLIST                                                         |   4 +-
 lang/openjdk11/distinfo                                                      |   5 +-
 lang/openjdk11/options.mk                                                    |   6 +-
 lang/openjdk11/patches/patch-make_autoconf_buildjdk-spec.gmk.in              |  20 ++++++
 lang/openjdk11/patches/patch-make_autoconf_hotspot.m4                        |  26 ++++++++
 lang/openjdk11/patches/patch-src_hotspot_os__cpu_bsd__zero_os__bsd__zero.cpp |  31 ++++++++++
 lang/openjdk17/distinfo                                                      |   4 +-
 lang/openjdk17/options.mk                                                    |   4 +-
 lang/openjdk17/patches/patch-make_autoconf_buildjdk-spec.gmk.in              |  21 ++++++
 lang/openjdk17/patches/patch-make_autoconf_hotspot.m4                        |  26 ++++++++
 10 files changed, 139 insertions(+), 8 deletions(-)

diffs (257 lines):

diff -r 765b0316b23a -r 6d8bbc9b7752 lang/openjdk11/PLIST
--- a/lang/openjdk11/PLIST      Tue May 24 21:36:19 2022 +0000
+++ b/lang/openjdk11/PLIST      Wed May 25 06:05:34 2022 +0000
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.11 2022/03/01 13:51:44 ryoon Exp $
+@comment $NetBSD: PLIST,v 1.12 2022/05/25 06:05:34 tnn Exp $
 bin/openjdk11-jar
 bin/openjdk11-jarsigner
 bin/openjdk11-java
@@ -546,7 +546,7 @@
 java/openjdk11/legal/jdk.zipfs/ADDITIONAL_LICENSE_INFO
 java/openjdk11/legal/jdk.zipfs/ASSEMBLY_EXCEPTION
 java/openjdk11/legal/jdk.zipfs/LICENSE
-java/openjdk11/lib/classlist
+${PLIST.hotspot}java/openjdk11/lib/classlist
 java/openjdk11/lib/ct.sym
 java/openjdk11/lib/fontconfig.bfc
 java/openjdk11/lib/fontconfig.properties.src
diff -r 765b0316b23a -r 6d8bbc9b7752 lang/openjdk11/distinfo
--- a/lang/openjdk11/distinfo   Tue May 24 21:36:19 2022 +0000
+++ b/lang/openjdk11/distinfo   Wed May 25 06:05:34 2022 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.31 2022/05/14 12:02:56 tnn Exp $
+$NetBSD: distinfo,v 1.32 2022/05/25 06:05:34 tnn Exp $
 
 BLAKE2s (bootstrap-jdk-1.11.0.5.8-netbsd-7-amd64-20190928.tar.xz) = b57b09661581b7dc6e3700a777f030dfa2fef6f953533456686bfd0dde9157d0
 SHA512 (bootstrap-jdk-1.11.0.5.8-netbsd-7-amd64-20190928.tar.xz) = 6e61996f7e3c3492b0c878644db30d72021dc4096639992e53b4440d4e2e18cd92e5630ecd4600d1917a1e63a7c814b63f74f811a40588febfe19ad8d3208a9d
@@ -12,7 +12,9 @@
 BLAKE2s (jdk11u-jdk-11.0.15-10-1.tar.gz) = 1ead16eff10210e68cd9c1407a9d729e248bb1ff075606d7fe3e5e62e4cde42d
 SHA512 (jdk11u-jdk-11.0.15-10-1.tar.gz) = f2d3b5cea79d737c7f4c5cdd2924aa7fd69fa6fb02fc8672f21060452f7483dc09157a7828642b3e43b033c26eaba0507ddd50491daceb6cf176cea47333857a
 Size (jdk11u-jdk-11.0.15-10-1.tar.gz) = 123036045 bytes
+SHA1 (patch-make_autoconf_buildjdk-spec.gmk.in) = d0b600237853c17ecc2864604f0bd847ba6b0149
 SHA1 (patch-make_autoconf_flags-cflags.m4) = 3b37853298805e2ffb92d3babd700d0048f24d8d
+SHA1 (patch-make_autoconf_hotspot.m4) = 437c8b09114933cca22c4a847a90a415cd113e5a
 SHA1 (patch-make_autoconf_lib-alsa.m4) = 999fbf951363f6b49b22aad81537728f22d7c381
 SHA1 (patch-make_autoconf_lib-bundled.m4) = 8720c3f674955e8a51b2ab7dba80c36d34ba8594
 SHA1 (patch-make_autoconf_lib-freetype.m4) = 3dbdfea4011dc69593ab302626b9ec4dfc7a7d54
@@ -24,6 +26,7 @@
 SHA1 (patch-src_hotspot_cpu_arm_c1__LIRGenerator__arm.cpp) = cfaace9741b0b30daf827119127478a195f8374f
 SHA1 (patch-src_hotspot_os__cpu_bsd__arm_bsd__arm__32.s) = 474a66abfb25030d4e32134816c14b157d1ebe6a
 SHA1 (patch-src_hotspot_os__cpu_bsd__arm_vm__version__bsd__arm__32.cpp) = 8a99417711c4826490954d43f142afc0a0c68e9f
+SHA1 (patch-src_hotspot_os__cpu_bsd__zero_os__bsd__zero.cpp) = 384214d554db82dc9092ee8f975aa5a73aae67ab
 SHA1 (patch-src_hotspot_os_bsd_os__bsd.cpp) = 6322cbdda03dee528e89ac8b725f3df5e2165797
 SHA1 (patch-src_hotspot_os_bsd_os__perf__bsd.cpp) = 7bb57f82f3a93adc1970ed4215148fc02ecbcd5a
 SHA1 (patch-src_hotspot_os_posix_os__posix.cpp) = e70e8c1e59f0be184a7a1d6e9d11ac7b934ce4b2
diff -r 765b0316b23a -r 6d8bbc9b7752 lang/openjdk11/options.mk
--- a/lang/openjdk11/options.mk Tue May 24 21:36:19 2022 +0000
+++ b/lang/openjdk11/options.mk Wed May 25 06:05:34 2022 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: options.mk,v 1.7 2021/06/28 23:12:22 tnn Exp $
+# $NetBSD: options.mk,v 1.8 2022/05/25 06:05:34 tnn Exp $
 
 PKG_OPTIONS_VAR=               PKG_OPTIONS.openjdk11
 PKG_OPTIONS_OPTIONAL_GROUPS=   variant
@@ -6,7 +6,7 @@
 PKG_SUPPORTED_OPTIONS=         debug dtrace jre-jce x11 static-libstdcpp
 PKG_SUGGESTED_OPTIONS=         jre-jce x11
 
-.if ${MACHINE_ARCH} == "aarch64" || !empty(MACHINE_ARCH:M*arm*) || ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
+.if ${MACHINE_ARCH} == "aarch64" || ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
 PKG_OPTIONS_GROUP.variant+=    jdk-hotspot-vm
 PKG_SUGGESTED_OPTIONS+=                jdk-hotspot-vm
 .else
@@ -99,10 +99,12 @@
 #
 # Build variant. Zero VM builds a portable JVM without assembly optimization.
 #
+PLIST_VARS+=           hotspot
 .if !empty(PKG_OPTIONS:Mjdk-zero-vm)
 BUILD_VARIANT=         zero
 .include "../../devel/libffi/buildlink3.mk"
 .elif !empty(PKG_OPTIONS:Mjdk-hotspot-vm)
 BUILD_VARIANT=         server
+PLIST.hotspot=         yes
 .endif
 CONFIGURE_ARGS+=       --with-jvm-variants=${BUILD_VARIANT}
diff -r 765b0316b23a -r 6d8bbc9b7752 lang/openjdk11/patches/patch-make_autoconf_buildjdk-spec.gmk.in
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/openjdk11/patches/patch-make_autoconf_buildjdk-spec.gmk.in   Wed May 25 06:05:34 2022 +0000
@@ -0,0 +1,20 @@
+$NetBSD: patch-make_autoconf_buildjdk-spec.gmk.in,v 1.1 2022/05/25 06:05:34 tnn Exp $
+
+Use the same variant for the buildjdk as the target jdk.
+This is needed for native builds on platforms where hotspot is broken or not
+supported. In that case the buildjdk can't be hardcoded to "server" but must
+use "zero". This is fine for pkgsrc since we only ever build one variant.
+
+--- make/autoconf/buildjdk-spec.gmk.in.orig    2022-05-03 03:11:37.000000000 +0000
++++ make/autoconf/buildjdk-spec.gmk.in
+@@ -88,8 +88,8 @@ ENABLE_DEBUG_SYMBOLS := false
+ # Control wether Hotspot builds gtest tests
+ BUILD_GTEST := false
+ 
+-JVM_VARIANTS := server
+-JVM_VARIANT_MAIN := server
++JVM_VARIANTS := @JVM_VARIANTS@
++JVM_VARIANT_MAIN := @JVM_VARIANT_MAIN@
+ 
+ # Some users still set EXTRA_*FLAGS on the make command line. Must
+ # make sure to override that when building buildjdk.
diff -r 765b0316b23a -r 6d8bbc9b7752 lang/openjdk11/patches/patch-make_autoconf_hotspot.m4
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/openjdk11/patches/patch-make_autoconf_hotspot.m4     Wed May 25 06:05:34 2022 +0000
@@ -0,0 +1,26 @@
+$NetBSD: patch-make_autoconf_hotspot.m4,v 1.1 2022/05/25 06:05:34 tnn Exp $
+
+Fix buildjdk targeting for 32-bit ARM.
+
+--- make/autoconf/hotspot.m4.orig      2022-05-03 03:11:37.000000000 +0000
++++ make/autoconf/hotspot.m4
+@@ -147,6 +147,8 @@ AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_VARIANT
+     # We are guaranteed that we do not build any other variants when building zero.
+     HOTSPOT_TARGET_CPU=zero
+     HOTSPOT_TARGET_CPU_ARCH=zero
++    HOTSPOT_BUILD_CPU=zero
++    HOTSPOT_BUILD_CPU_ARCH=zero
+   fi
+ ])
+ 
+@@ -337,6 +339,10 @@ AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_FEATURE
+     HOTSPOT_TARGET_CPU=arm_64
+     HOTSPOT_TARGET_CPU_ARCH=arm
+   fi
++  if test "x$OPENJDK_BUILD_CPU" = xarm; then
++    HOTSPOT_BUILD_CPU=arm_32
++    HOTSPOT_BUILD_CPU_DEFINE="ARM32"
++  fi
+ 
+   # Verify that dependencies are met for explicitly set features.
+   if HOTSPOT_CHECK_JVM_FEATURE(jvmti) && ! HOTSPOT_CHECK_JVM_FEATURE(services); then
diff -r 765b0316b23a -r 6d8bbc9b7752 lang/openjdk11/patches/patch-src_hotspot_os__cpu_bsd__zero_os__bsd__zero.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/openjdk11/patches/patch-src_hotspot_os__cpu_bsd__zero_os__bsd__zero.cpp      Wed May 25 06:05:34 2022 +0000
@@ -0,0 +1,31 @@
+$NetBSD: patch-src_hotspot_os__cpu_bsd__zero_os__bsd__zero.cpp,v 1.1 2022/05/25 06:05:34 tnn Exp $
+
+#if 0 functions already defined in os_bsd.cpp
+
+--- src/hotspot/os_cpu/bsd_zero/os_bsd_zero.cpp.orig   2022-05-03 03:11:37.000000000 +0000
++++ src/hotspot/os_cpu/bsd_zero/os_bsd_zero.cpp
+@@ -340,13 +340,16 @@ static void current_stack_region(address
+   *size = stack_top - stack_bottom;
+ }
+ 
++#if 0
+ address os::current_stack_base() {
+   address bottom;
+   size_t size;
+   current_stack_region(&bottom, &size);
+   return bottom + size;
+ }
++#endif
+ 
++#if 0
+ size_t os::current_stack_size() {
+   // stack size includes normal stack and HotSpot guard pages
+   address bottom;
+@@ -354,6 +357,7 @@ size_t os::current_stack_size() {
+   current_stack_region(&bottom, &size);
+   return size;
+ }
++#endif
+ 
+ /////////////////////////////////////////////////////////////////////////////
+ // helper functions for fatal error handler
diff -r 765b0316b23a -r 6d8bbc9b7752 lang/openjdk17/distinfo
--- a/lang/openjdk17/distinfo   Tue May 24 21:36:19 2022 +0000
+++ b/lang/openjdk17/distinfo   Wed May 25 06:05:34 2022 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.5 2022/05/15 22:30:49 tnn Exp $
+$NetBSD: distinfo,v 1.6 2022/05/25 06:05:34 tnn Exp $
 
 BLAKE2s (bootstrap-jdk-1.17.0.3.7-netbsd-9-aarch64-20220516.tar.xz) = b632092d25292e795a2d7567ec55d03f21021dbba27eab3e81a48aed5e5bdd68
 SHA512 (bootstrap-jdk-1.17.0.3.7-netbsd-9-aarch64-20220516.tar.xz) = fb86749d56be94cc1509f92d8fbdec481b0c7f6fdd5e731826098e6eaa668539052571ffd09125346c1920262b07857ea675799ab8476fcff53c03e158536c1d
@@ -12,7 +12,9 @@
 BLAKE2s (jdk17u-jdk-17.0.3-7-1.tar.gz) = d080a7513b3e1d431e24673fff10695adf0154b97fd45be7307be09e929e78a6
 SHA512 (jdk17u-jdk-17.0.3-7-1.tar.gz) = ddbe9c6e2c48c320247e023070de9f4b770a58d6eaf763f6331d6cccfd4bd5591445994174d5196392e5a4f0bb398d6b309e37dc5079c823458ac7fc4d9b6a9d
 Size (jdk17u-jdk-17.0.3-7-1.tar.gz) = 104898973 bytes
+SHA1 (patch-make_autoconf_buildjdk-spec.gmk.in) = 01b6ac6dae1a886949020b9d472aab1e357084b0
 SHA1 (patch-make_autoconf_flags-cflags.m4) = 0379aeecc6181cbd15f6f31518b73ca915f1f73b
+SHA1 (patch-make_autoconf_hotspot.m4) = 6370c6cb2a3f225c502e7916342104cf1288f4cf
 SHA1 (patch-make_autoconf_lib-alsa.m4) = 999fbf951363f6b49b22aad81537728f22d7c381
 SHA1 (patch-make_autoconf_lib-bundled.m4) = 8720c3f674955e8a51b2ab7dba80c36d34ba8594
 SHA1 (patch-make_autoconf_lib-freetype.m4) = bd791b99e4fd87f24432831fba1e814dd199445f
diff -r 765b0316b23a -r 6d8bbc9b7752 lang/openjdk17/options.mk
--- a/lang/openjdk17/options.mk Tue May 24 21:36:19 2022 +0000
+++ b/lang/openjdk17/options.mk Wed May 25 06:05:34 2022 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: options.mk,v 1.2 2022/05/16 12:29:33 tnn Exp $
+# $NetBSD: options.mk,v 1.3 2022/05/25 06:05:34 tnn Exp $
 
 PKG_OPTIONS_VAR=               PKG_OPTIONS.openjdk17
 PKG_OPTIONS_OPTIONAL_GROUPS=   variant
@@ -6,7 +6,7 @@
 PKG_SUPPORTED_OPTIONS=         debug dtrace jre-jce x11 static-libstdcpp
 PKG_SUGGESTED_OPTIONS=         jre-jce x11
 
-.if ${MACHINE_ARCH} == "aarch64" || !empty(MACHINE_ARCH:M*arm*) || ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
+.if ${MACHINE_ARCH} == "aarch64" || ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
 PKG_OPTIONS_GROUP.variant+=    jdk-hotspot-vm
 PKG_SUGGESTED_OPTIONS+=                jdk-hotspot-vm
 .else
diff -r 765b0316b23a -r 6d8bbc9b7752 lang/openjdk17/patches/patch-make_autoconf_buildjdk-spec.gmk.in
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/openjdk17/patches/patch-make_autoconf_buildjdk-spec.gmk.in   Wed May 25 06:05:34 2022 +0000
@@ -0,0 +1,21 @@
+$NetBSD: patch-make_autoconf_buildjdk-spec.gmk.in,v 1.1 2022/05/25 06:05:34 tnn Exp $
+
+Use the same variant for the buildjdk as the target jdk.
+This is needed for native builds on platforms where hotspot is broken or not
+supported. In that case the buildjdk can't be hardcoded to "server" but must
+use "zero". This is fine for pkgsrc since we only ever build one variant.
+
+--- make/autoconf/buildjdk-spec.gmk.in.orig    2022-04-23 02:25:56.000000000 +0000
++++ make/autoconf/buildjdk-spec.gmk.in
+@@ -94,8 +94,9 @@ DISABLE_WARNING_PREFIX := @BUILD_CC_DISA
+ # Save speed and disk space by not enabling debug symbols for the buildjdk
+ ENABLE_DEBUG_SYMBOLS := false
+ 
+-JVM_VARIANTS := server
+-JVM_VARIANT_MAIN := server
++JVM_VARIANTS :=  @JVM_VARIANTS@
++JVM_VARIANT_MAIN := @JVM_VARIANT_MAIN@
++JVM_FEATURES_zero := g1gc serialgc zero
+ JVM_FEATURES_server := cds compiler1 compiler2 g1gc serialgc
+ 
+ # Some users still set EXTRA_*FLAGS on the make command line. Must
diff -r 765b0316b23a -r 6d8bbc9b7752 lang/openjdk17/patches/patch-make_autoconf_hotspot.m4
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/openjdk17/patches/patch-make_autoconf_hotspot.m4     Wed May 25 06:05:34 2022 +0000
@@ -0,0 +1,26 @@
+$NetBSD: patch-make_autoconf_hotspot.m4,v 1.1 2022/05/25 06:05:34 tnn Exp $
+
+Fix buildjdk targeting for 32-bit ARM.
+
+--- make/autoconf/hotspot.m4.orig      2022-04-23 02:25:56.000000000 +0000
++++ make/autoconf/hotspot.m4
+@@ -121,6 +121,8 @@ AC_DEFUN_ONCE([HOTSPOT_SETUP_MISC],
+     # But when building zero, we never build any other variants so it works.
+     HOTSPOT_TARGET_CPU=zero
+     HOTSPOT_TARGET_CPU_ARCH=zero
++    HOTSPOT_BUILD_CPU=zero
++    HOTSPOT_BUILD_CPU_ARCH=zero
+   fi
+ 
+   AC_ARG_WITH([hotspot-build-time], [AS_HELP_STRING([--with-hotspot-build-time],
+@@ -137,6 +139,10 @@ AC_DEFUN_ONCE([HOTSPOT_SETUP_MISC],
+     HOTSPOT_TARGET_CPU=arm_32
+     HOTSPOT_TARGET_CPU_DEFINE="ARM32"
+   fi
++  if test "x$OPENJDK_BUILD_CPU" = xarm; then
++    HOTSPOT_BUILD_CPU=arm_32
++    HOTSPOT_BUILD_CPU_DEFINE="ARM32"
++  fi
+ 
+   # --with-cpu-port is no longer supported
+   UTIL_DEPRECATED_ARG_WITH(with-cpu-port)



Home | Main Index | Thread Index | Old Index