From 07a914f5bd4b01b95047dc1239152fb8937d4b57 Mon Sep 17 00:00:00 2001 From: Erik Joelsson Date: Tue, 28 Jun 2016 14:20:17 +0200 Subject: [PATCH] 8160285: Bootcycle builds are broken on jdk9/hs for windows i586 Reviewed-by: dholmes --- common/autoconf/boot-jdk.m4 | 52 +++++++++++++++-------- common/autoconf/bootcycle-spec.gmk.in | 2 + common/autoconf/generated-configure.sh | 57 ++++++++++++++++++-------- 3 files changed, 78 insertions(+), 33 deletions(-) diff --git a/common/autoconf/boot-jdk.m4 b/common/autoconf/boot-jdk.m4 index 77b5b38f4b6..1aded9e4486 100644 --- a/common/autoconf/boot-jdk.m4 +++ b/common/autoconf/boot-jdk.m4 @@ -359,25 +359,32 @@ AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS], # Starting amount of heap memory. ADD_JVM_ARG_IF_OK([-Xms64M],boot_jdk_jvmargs_big,[$JAVA]) + BOOTCYCLE_JVM_ARGS_BIG=-Xms64M + + # Maximum amount of heap memory and stack size. + JVM_HEAP_LIMIT_32="1100" + # Running a 64 bit JVM allows for and requires a bigger heap + JVM_HEAP_LIMIT_64="1600" + STACK_SIZE_32=768 + STACK_SIZE_64=1536 + JVM_HEAP_LIMIT_GLOBAL=`expr $MEMORY_SIZE / 2` + if test "$JVM_HEAP_LIMIT_GLOBAL" -lt "$JVM_HEAP_LIMIT_32"; then + JVM_HEAP_LIMIT_32=$JVM_HEAP_LIMIT_GLOBAL + fi + if test "$JVM_HEAP_LIMIT_GLOBAL" -lt "$JVM_HEAP_LIMIT_64"; then + JVM_HEAP_LIMIT_64=$JVM_HEAP_LIMIT_GLOBAL + fi + if test "$JVM_HEAP_LIMIT_GLOBAL" -lt "512"; then + JVM_HEAP_LIMIT_32=512 + JVM_HEAP_LIMIT_64=512 + fi - # Maximum amount of heap memory. - # Maximum stack size. - JVM_MAX_HEAP=`expr $MEMORY_SIZE / 2` if test "x$BOOT_JDK_BITS" = "x32"; then - if test "$JVM_MAX_HEAP" -gt "1100"; then - JVM_MAX_HEAP=1100 - elif test "$JVM_MAX_HEAP" -lt "512"; then - JVM_MAX_HEAP=512 - fi - STACK_SIZE=768 + STACK_SIZE=$STACK_SIZE_32 + JVM_MAX_HEAP=$JVM_HEAP_LIMIT_32 else - # Running a 64 bit JVM allows for and requires a bigger heap - if test "$JVM_MAX_HEAP" -gt "1600"; then - JVM_MAX_HEAP=1600 - elif test "$JVM_MAX_HEAP" -lt "512"; then - JVM_MAX_HEAP=512 - fi - STACK_SIZE=1536 + STACK_SIZE=$STACK_SIZE_64 + JVM_MAX_HEAP=$JVM_HEAP_LIMIT_64 fi ADD_JVM_ARG_IF_OK([-Xmx${JVM_MAX_HEAP}M],boot_jdk_jvmargs_big,[$JAVA]) ADD_JVM_ARG_IF_OK([-XX:ThreadStackSize=$STACK_SIZE],boot_jdk_jvmargs_big,[$JAVA]) @@ -387,6 +394,19 @@ AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS], JAVA_FLAGS_BIG=$boot_jdk_jvmargs_big AC_SUBST(JAVA_FLAGS_BIG) + if test "x$OPENJDK_TARGET_CPU_BITS" = "x32"; then + BOOTCYCLE_MAX_HEAP=$JVM_HEAP_LIMIT_32 + BOOTCYCLE_STACK_SIZE=$STACK_SIZE_32 + else + BOOTCYCLE_MAX_HEAP=$JVM_HEAP_LIMIT_64 + BOOTCYCLE_STACK_SIZE=$STACK_SIZE_64 + fi + BOOTCYCLE_JVM_ARGS_BIG="$BOOTCYCLE_JVM_ARGS_BIG -Xmx${BOOTCYCLE_MAX_HEAP}M" + BOOTCYCLE_JVM_ARGS_BIG="$BOOTCYCLE_JVM_ARGS_BIG -XX:ThreadStackSize=$BOOTCYCLE_STACK_SIZE" + AC_MSG_CHECKING([flags for bootcycle boot jdk java command for big workloads]) + AC_MSG_RESULT([$BOOTCYCLE_JVM_ARGS_BIG]) + AC_SUBST(BOOTCYCLE_JVM_ARGS_BIG) + # By default, the main javac compilations use big JAVA_FLAGS_JAVAC="$JAVA_FLAGS_BIG" AC_SUBST(JAVA_FLAGS_JAVAC) diff --git a/common/autoconf/bootcycle-spec.gmk.in b/common/autoconf/bootcycle-spec.gmk.in index c37097d1b1d..aa722761939 100644 --- a/common/autoconf/bootcycle-spec.gmk.in +++ b/common/autoconf/bootcycle-spec.gmk.in @@ -66,3 +66,5 @@ SJAVAC_SERVER_JAVA_CMD:=$(JAVA_CMD) ifeq ($(OPENJDK_TARGET_CPU_BITS), 32) SJAVAC_SERVER_JAVA_FLAGS:= -Xms256M -Xmx1500M endif +# The bootcycle JVM arguments may differ from the original boot jdk. +JAVA_FLAGS_BIG := @BOOTCYCLE_JVM_ARGS_BIG@ diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh index 525a890bae3..049b8936829 100644 --- a/common/autoconf/generated-configure.sh +++ b/common/autoconf/generated-configure.sh @@ -644,6 +644,7 @@ SJAVAC_SERVER_JAVA JAVA_TOOL_FLAGS_SMALL JAVA_FLAGS_SMALL JAVA_FLAGS_JAVAC +BOOTCYCLE_JVM_ARGS_BIG JAVA_FLAGS_BIG JAVA_FLAGS TEST_JOBS @@ -5094,7 +5095,7 @@ VS_SDK_PLATFORM_NAME_2013= #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1467039751 +DATE_WHEN_GENERATED=1467116399 ############################################################################### # @@ -65118,25 +65119,32 @@ $as_echo_n "checking flags for boot jdk java command for big workloads... " >&6; JVM_ARG_OK=false fi + BOOTCYCLE_JVM_ARGS_BIG=-Xms64M + + # Maximum amount of heap memory and stack size. + JVM_HEAP_LIMIT_32="1100" + # Running a 64 bit JVM allows for and requires a bigger heap + JVM_HEAP_LIMIT_64="1600" + STACK_SIZE_32=768 + STACK_SIZE_64=1536 + JVM_HEAP_LIMIT_GLOBAL=`expr $MEMORY_SIZE / 2` + if test "$JVM_HEAP_LIMIT_GLOBAL" -lt "$JVM_HEAP_LIMIT_32"; then + JVM_HEAP_LIMIT_32=$JVM_HEAP_LIMIT_GLOBAL + fi + if test "$JVM_HEAP_LIMIT_GLOBAL" -lt "$JVM_HEAP_LIMIT_64"; then + JVM_HEAP_LIMIT_64=$JVM_HEAP_LIMIT_GLOBAL + fi + if test "$JVM_HEAP_LIMIT_GLOBAL" -lt "512"; then + JVM_HEAP_LIMIT_32=512 + JVM_HEAP_LIMIT_64=512 + fi - # Maximum amount of heap memory. - # Maximum stack size. - JVM_MAX_HEAP=`expr $MEMORY_SIZE / 2` if test "x$BOOT_JDK_BITS" = "x32"; then - if test "$JVM_MAX_HEAP" -gt "1100"; then - JVM_MAX_HEAP=1100 - elif test "$JVM_MAX_HEAP" -lt "512"; then - JVM_MAX_HEAP=512 - fi - STACK_SIZE=768 + STACK_SIZE=$STACK_SIZE_32 + JVM_MAX_HEAP=$JVM_HEAP_LIMIT_32 else - # Running a 64 bit JVM allows for and requires a bigger heap - if test "$JVM_MAX_HEAP" -gt "1600"; then - JVM_MAX_HEAP=1600 - elif test "$JVM_MAX_HEAP" -lt "512"; then - JVM_MAX_HEAP=512 - fi - STACK_SIZE=1536 + STACK_SIZE=$STACK_SIZE_64 + JVM_MAX_HEAP=$JVM_HEAP_LIMIT_64 fi $ECHO "Check if jvm arg is ok: -Xmx${JVM_MAX_HEAP}M" >&5 @@ -65175,6 +65183,21 @@ $as_echo "$boot_jdk_jvmargs_big" >&6; } JAVA_FLAGS_BIG=$boot_jdk_jvmargs_big + if test "x$OPENJDK_TARGET_CPU_BITS" = "x32"; then + BOOTCYCLE_MAX_HEAP=$JVM_HEAP_LIMIT_32 + BOOTCYCLE_STACK_SIZE=$STACK_SIZE_32 + else + BOOTCYCLE_MAX_HEAP=$JVM_HEAP_LIMIT_64 + BOOTCYCLE_STACK_SIZE=$STACK_SIZE_64 + fi + BOOTCYCLE_JVM_ARGS_BIG="$BOOTCYCLE_JVM_ARGS_BIG -Xmx${BOOTCYCLE_MAX_HEAP}M" + BOOTCYCLE_JVM_ARGS_BIG="$BOOTCYCLE_JVM_ARGS_BIG -XX:ThreadStackSize=$BOOTCYCLE_STACK_SIZE" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking flags for bootcycle boot jdk java command for big workloads" >&5 +$as_echo_n "checking flags for bootcycle boot jdk java command for big workloads... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOTCYCLE_JVM_ARGS_BIG" >&5 +$as_echo "$BOOTCYCLE_JVM_ARGS_BIG" >&6; } + + # By default, the main javac compilations use big JAVA_FLAGS_JAVAC="$JAVA_FLAGS_BIG"