I've been unable to get OpenJDK to build on one box because of this message:
[0.013s][error][cds] Unable to map CDS archive -- os::vm_allocation_granularity() expected: 4096 actual: 65536 The problem is that this box is using 64kb pages, and the boostrap Java was built on a machine with 4k pages. It shouldn't really be a problem, but this happens: build/linux-aarch64-server-slowdebug/support/gensrc/java.desktop/sun/awt/AWTIcon32_java_icon16_png.java: package sun.awt; public class AWTIcon32_java_icon16_png { public static int[] java_icon16_png = { [0.013s][error][cds] Unable to map CDS archive -- os::vm_allocation_granularity() expected: 4096 actual: 65536 16,16, 0x689fb5c9, 0xcc9fb5c8, 0xff9fb5c8, 0xff9fb5c8, 0xff9fb5c8, 0xff9fb5c8, 0xff9fb5c8, 0xff9fb5c8, 0xff9fb5c8, 0xff9fb5c8, 0xff9fb5c8, 0xff9fb5c8, 0xff9fb5c8, 0xff9fb5c8, 0xcc9fb5c8, 0x689fb5c9, 0xcc9bb2c4, 0xffd5dade, 0xfff5f5f5, 0xfff7f7f7, 0xfff7f7f7, As you can see, the generated AWTIcon32_java_icon16_png.java has the error message mixed in with the Java source code, so bootstrap fails. I've tried a bunch of ways to get around this problem, but nothing works. I did this: diff --git a/make/autoconf/boot-jdk.m4 b/make/autoconf/boot-jdk.m4 index 1d82f7c79b9..5c26be68fe4 100644 --- a/make/autoconf/boot-jdk.m4 +++ b/make/autoconf/boot-jdk.m4 @@ -413,7 +413,7 @@ AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS], UTIL_ADD_JVM_ARG_IF_OK([$boot_jdk_cds_args -Xshare:auto],boot_jdk_jvmargs,[$JAVA]) else # Otherwise optimistically use the system-wide one, if one is present - UTIL_ADD_JVM_ARG_IF_OK([-Xshare:auto],boot_jdk_jvmargs,[$JAVA]) + UTIL_ADD_JVM_ARG_IF_OK([-Xshare:off],boot_jdk_jvmargs,[$JAVA]) fi # Finally append user provided options to allow them to override. @@ -427,6 +427,9 @@ AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS], AC_MSG_CHECKING([flags for boot jdk java command for big workloads]) + # Disable UseSharedSpaces in case the boot JVM was built on another system + UTIL_ADD_JVM_ARG_IF_OK([-XX:-UseSharedSpaces],boot_jdk_jvmargs,[$JAVA]) + # Starting amount of heap memory. UTIL_ADD_JVM_ARG_IF_OK([-Xms64M],boot_jdk_jvmargs_big,[$JAVA]) BOOTCYCLE_JVM_ARGS_BIG=-Xms64M I also tried --with-boot-jdk-jvmargs='-Xshare:off -XX:-UseSharedSpaces' but that doesn't work either. Any ideas? I'm really stuck. -- Andrew Haley (he/him) Java Platform Lead Engineer Red Hat UK Ltd. <https://www.redhat.com> https://keybase.io/andrewhaley EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671