--- old/common/autoconf/hotspot.m4 2016-12-02 11:14:39.793148072 -0500 +++ new/common/autoconf/hotspot.m4 2016-12-02 11:14:38.217058694 -0500 @@ -25,7 +25,8 @@ # All valid JVM features, regardless of platform VALID_JVM_FEATURES="compiler1 compiler2 zero shark minimal dtrace jvmti jvmci \ - fprof vm-structs jni-check services management all-gcs nmt cds static-build" + fprof vm-structs jni-check services management all-gcs nmt cds \ + static-build link-time-opt" # All valid JVM variants VALID_JVM_VARIANTS="server client minimal core zero zeroshark custom" @@ -69,6 +70,8 @@ AC_ARG_WITH([jvm-variants], [AS_HELP_STRING([--with-jvm-variants], [JVM variants (separated by commas) to build (server,client,minimal,core,zero,zeroshark,custom) @<:@server@:>@])]) + SETUP_HOTSPOT_TARGET_CPU_PORT + if test "x$with_jvm_variants" = x; then with_jvm_variants="server" fi @@ -204,6 +207,19 @@ AC_MSG_RESULT([$JVM_FEATURES]) fi + # Override hotspot cpu definitions for ARM platforms + if test "x$OPENJDK_TARGET_CPU" = xarm; then + HOTSPOT_TARGET_CPU=arm_32 + HOTSPOT_TARGET_CPU_DEFINE="ARM32" + JVM_LDFLAGS="$JVM_LDFLAGS -fsigned-char" + JVM_CFLAGS="$JVM_CFLAGS -DARM -fsigned-char" + elif test "x$OPENJDK_TARGET_CPU" = xaarch64 && test "x$with_cpu_port" = xarm64; then + HOTSPOT_TARGET_CPU=arm_64 + HOTSPOT_TARGET_CPU_ARCH=arm + JVM_LDFLAGS="$JVM_LDFLAGS -fsigned-char" + JVM_CFLAGS="$JVM_CFLAGS -DARM -fsigned-char" + fi + # Verify that dependencies are met for explicitly set features. if HOTSPOT_CHECK_JVM_FEATURE(jvmti) && ! HOTSPOT_CHECK_JVM_FEATURE(services); then AC_MSG_ERROR([Specified JVM feature 'jvmti' requires feature 'services']) @@ -263,6 +279,13 @@ JVM_FEATURES_jvmci="" fi + if test "x$OPENJDK_TARGET_CPU" = xarm ; then + # Default to use link time optimizations on minimal on arm + JVM_FEATURES_link_time_opt="link-time-opt" + else + JVM_FEATURES_link_time_opt="" + fi + # All variants but minimal (and custom) get these features NON_MINIMAL_FEATURES="$NON_MINIMAL_FEATURES jvmti fprof vm-structs jni-check services management all-gcs nmt cds" @@ -270,7 +293,7 @@ JVM_FEATURES_server="compiler1 compiler2 $NON_MINIMAL_FEATURES $JVM_FEATURES $JVM_FEATURES_jvmci" JVM_FEATURES_client="compiler1 $NON_MINIMAL_FEATURES $JVM_FEATURES $JVM_FEATURES_jvmci" JVM_FEATURES_core="$NON_MINIMAL_FEATURES $JVM_FEATURES" - JVM_FEATURES_minimal="compiler1 minimal $JVM_FEATURES" + JVM_FEATURES_minimal="compiler1 minimal $JVM_FEATURES $JVM_FEATURES_link_time_opt" JVM_FEATURES_zero="zero $NON_MINIMAL_FEATURES $JVM_FEATURES" JVM_FEATURES_zeroshark="zero shark $NON_MINIMAL_FEATURES $JVM_FEATURES" JVM_FEATURES_custom="$JVM_FEATURES" @@ -320,6 +343,33 @@ ]) ################################################################################ +# +# Specify which sources will be used to build the 64-bit ARM port +# +# --with-cpu-port=arm64 will use hotspot/src/cpu/arm +# --with-cpu-port=aarch64 will use hotspot/src/cpu/aarch64 +# +AC_DEFUN([SETUP_HOTSPOT_TARGET_CPU_PORT], +[ + AC_ARG_WITH(cpu-port, [AS_HELP_STRING([--with-cpu-port], + [specify sources to use for Hotspot 64-bit ARM port (arm64,aarch64) @<:@aarch64@:>@ ])]) + + if test "x$with_cpu_port" != x; then + if test "x$OPENJDK_TARGET_CPU" != xaarch64; then + AC_MSG_ERROR([--with-cpu-port only available on aarch64]) + fi + + if test "x$with_cpu_port" != x; then + if test "x$with_cpu_port" != xarm64 && \ + test "x$with_cpu_port" != xaarch64; then + AC_MSG_ERROR([--with-cpu-port must specify arm64 or aarch64]) + fi + fi + fi +]) + + +################################################################################ # Check if gtest should be built # AC_DEFUN_ONCE([HOTSPOT_ENABLE_DISABLE_GTEST],