changeset 2963:4692b5e8bfec

Merge
author mr
date Thu, 12 Jan 2017 18:05:11 -0800
parents 6bdef88dea24 b3be0a26a5e5
children a94d381899f6
files .hgtags
diffstat 34 files changed, 2041 insertions(+), 557 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Thu Jan 12 17:46:35 2017 -0800
+++ b/.hgtags	Thu Jan 12 18:05:11 2017 -0800
@@ -393,3 +393,5 @@
 3ffc3e886c74736e387f3685e86b557cdea706c8 jdk-9+148
 b119012d1c2ab2570fe8718633840d0c1f1f441d jdk-9+149
 88094de8a4cc24c13fc662a265f93c2e687c66c7 jpms-edr
+6234069ff9789f7582e1faa32cb6283cbd1a5a2d jdk-9+150
+71a766d4c18041a7f833ee22823125b02e1a7f1e jdk-9+151
--- a/common/autoconf/boot-jdk.m4	Thu Jan 12 17:46:35 2017 -0800
+++ b/common/autoconf/boot-jdk.m4	Thu Jan 12 18:05:11 2017 -0800
@@ -305,9 +305,8 @@
   BOOT_JDK_SOURCETARGET="-source 8 -target 8"
   AC_SUBST(BOOT_JDK_SOURCETARGET)
 
-  ADD_JVM_ARG_IF_OK([--patch-module foo=bar], dummy, [$JAVA])
   AC_MSG_CHECKING([if Boot JDK supports modules])
-  if test "x$JVM_ARG_OK" = "xtrue"; then
+  if "$JAVA" --list-modules > /dev/null 2>&1; then
     AC_MSG_RESULT([yes])
     BOOT_JDK_MODULAR="true"
   else
--- a/common/autoconf/buildjdk-spec.gmk.in	Thu Jan 12 17:46:35 2017 -0800
+++ b/common/autoconf/buildjdk-spec.gmk.in	Thu Jan 12 18:05:11 2017 -0800
@@ -50,8 +50,6 @@
 
 OPENJDK_BUILD_CPU_LEGACY := @OPENJDK_BUILD_CPU_LEGACY@
 OPENJDK_BUILD_CPU_LEGACY_LIB := @OPENJDK_BUILD_CPU_LEGACY_LIB@
-OPENJDK_BUILD_CPU_LIBDIR := @OPENJDK_BUILD_CPU_LIBDIR@
-OPENJDK_TARGET_CPU_LIBDIR := @OPENJDK_BUILD_CPU_LIBDIR@
 OPENJDK_TARGET_CPU := @OPENJDK_BUILD_CPU@
 OPENJDK_TARGET_CPU_ARCH := @OPENJDK_BUILD_CPU_ARCH@
 OPENJDK_TARGET_CPU_BITS := @OPENJDK_BUILD_CPU_BITS@
--- a/common/autoconf/compare.sh.in	Thu Jan 12 17:46:35 2017 -0800
+++ b/common/autoconf/compare.sh.in	Thu Jan 12 18:05:11 2017 -0800
@@ -33,7 +33,6 @@
 
 export OPENJDK_TARGET_OS="@OPENJDK_TARGET_OS@"
 export OPENJDK_TARGET_CPU="@OPENJDK_TARGET_CPU@"
-export OPENJDK_TARGET_CPU_LIBDIR="@OPENJDK_TARGET_CPU_LIBDIR@"
 export DEBUG_LEVEL="@DEBUG_LEVEL@"
 
 export AWK="@AWK@"
--- a/common/autoconf/configure.ac	Thu Jan 12 17:46:35 2017 -0800
+++ b/common/autoconf/configure.ac	Thu Jan 12 18:05:11 2017 -0800
@@ -205,7 +205,7 @@
 
 # Need toolchain to setup dtrace
 HOTSPOT_SETUP_DTRACE
-HOTSPOT_SETUP_JVM_FEATURES
+HOTSPOT_ENABLE_DISABLE_AOT
 HOTSPOT_ENABLE_DISABLE_GTEST
 
 ###############################################################################
@@ -220,6 +220,10 @@
 LIB_DETERMINE_DEPENDENCIES
 LIB_SETUP_LIBRARIES
 
+# Hotspot setup depends on lib checks (AOT needs libelf).
+
+HOTSPOT_SETUP_JVM_FEATURES
+
 ###############################################################################
 #
 # We need to do some final tweaking, when everything else is done.
--- a/common/autoconf/flags.m4	Thu Jan 12 17:46:35 2017 -0800
+++ b/common/autoconf/flags.m4	Thu Jan 12 18:05:11 2017 -0800
@@ -23,6 +23,101 @@
 # questions.
 #
 
+################################################################################
+#
+# Setup ABI profile (for arm)
+#
+AC_DEFUN([FLAGS_SETUP_ABI_PROFILE],
+[
+  AC_ARG_WITH(abi-profile, [AS_HELP_STRING([--with-abi-profile],
+      [specify ABI profile for ARM builds (arm-vfp-sflt,arm-vfp-hflt,arm-sflt, armv5-vfp-sflt,armv6-vfp-hflt,arm64,aarch64) @<:@toolchain dependent@:>@ ])])
+
+  if test "x$with_abi_profile" != x; then
+    if test "x$OPENJDK_TARGET_CPU" != xarm && \
+        test "x$OPENJDK_TARGET_CPU" != xaarch64; then
+      AC_MSG_ERROR([--with-abi-profile only available on arm/aarch64])
+    fi
+
+    OPENJDK_TARGET_ABI_PROFILE=$with_abi_profile
+    AC_MSG_CHECKING([for ABI profle])
+    AC_MSG_RESULT([$OPENJDK_TARGET_ABI_PROFILE])
+
+    if test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm-vfp-sflt; then
+      ARM_FLOAT_TYPE=vfp-sflt
+      ARM_ARCH_TYPE_FLAGS='-march=armv7-a -mthumb'
+    elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm-vfp-hflt; then
+      ARM_FLOAT_TYPE=vfp-hflt
+      ARM_ARCH_TYPE_FLAGS='-march=armv7-a -mthumb'
+    elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm-sflt; then
+      ARM_FLOAT_TYPE=sflt
+      ARM_ARCH_TYPE_FLAGS='-march=armv5t -marm'
+    elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarmv5-vfp-sflt; then
+      ARM_FLOAT_TYPE=vfp-sflt
+      ARM_ARCH_TYPE_FLAGS='-march=armv5t -marm'
+    elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarmv6-vfp-hflt; then
+      ARM_FLOAT_TYPE=vfp-hflt
+      ARM_ARCH_TYPE_FLAGS='-march=armv6 -marm'
+    elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm64; then
+      # No special flags, just need to trigger setting JDK_ARCH_ABI_PROP_NAME
+      ARM_FLOAT_TYPE=
+      ARM_ARCH_TYPE_FLAGS=
+    elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xaarch64; then
+      # No special flags, just need to trigger setting JDK_ARCH_ABI_PROP_NAME
+      ARM_FLOAT_TYPE=
+      ARM_ARCH_TYPE_FLAGS=
+    else
+      AC_MSG_ERROR([Invalid ABI profile: "$OPENJDK_TARGET_ABI_PROFILE"])
+    fi
+
+    if test "x$ARM_FLOAT_TYPE" = xvfp-sflt; then
+      ARM_FLOAT_TYPE_FLAGS='-mfloat-abi=softfp -mfpu=vfp -DFLOAT_ARCH=-vfp-sflt'
+    elif test "x$ARM_FLOAT_TYPE" = xvfp-hflt; then
+      ARM_FLOAT_TYPE_FLAGS='-mfloat-abi=hard -mfpu=vfp -DFLOAT_ARCH=-vfp-hflt'
+    elif test "x$ARM_FLOAT_TYPE" = xsflt; then
+      ARM_FLOAT_TYPE_FLAGS='-msoft-float -mfpu=vfp'
+    fi
+    AC_MSG_CHECKING([for $ARM_FLOAT_TYPE floating point flags])
+    AC_MSG_RESULT([$ARM_FLOAT_TYPE_FLAGS])
+
+    AC_MSG_CHECKING([for arch type flags])
+    AC_MSG_RESULT([$ARM_ARCH_TYPE_FLAGS])
+
+    # Now set JDK_ARCH_ABI_PROP_NAME. This is equivalent to the last part of the
+    # autoconf target triplet.
+    [ JDK_ARCH_ABI_PROP_NAME=`$ECHO $OPENJDK_TARGET_AUTOCONF_NAME | $SED -e 's/.*-\([^-]*\)$/\1/'` ]
+    # Sanity check that it is a known ABI.
+    if test "x$JDK_ARCH_ABI_PROP_NAME" != xgnu && \
+        test "x$JDK_ARCH_ABI_PROP_NAME" != xgnueabi  && \
+        test "x$JDK_ARCH_ABI_PROP_NAME" != xgnueabihf; then
+          AC_MSG_WARN([Unknown autoconf target triplet ABI: "$JDK_ARCH_ABI_PROP_NAME"])
+    fi
+    AC_MSG_CHECKING([for ABI property name])
+    AC_MSG_RESULT([$JDK_ARCH_ABI_PROP_NAME])
+    AC_SUBST(JDK_ARCH_ABI_PROP_NAME)
+
+    # Pass these on to the open part of configure as if they were set using
+    # --with-extra-c[xx]flags.
+    EXTRA_CFLAGS="$EXTRA_CFLAGS $ARM_ARCH_TYPE_FLAGS $ARM_FLOAT_TYPE_FLAGS"
+    EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS $ARM_ARCH_TYPE_FLAGS $ARM_FLOAT_TYPE_FLAGS"
+    # Get rid of annoying "note: the mangling of 'va_list' has changed in GCC 4.4"
+    # FIXME: This should not really be set using extra_cflags.
+    if test "x$OPENJDK_TARGET_CPU" = xarm; then
+        EXTRA_CFLAGS="$EXTRA_CFLAGS -Wno-psabi"
+        EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS -Wno-psabi"
+    fi
+    # Also add JDK_ARCH_ABI_PROP_NAME define, but only to CFLAGS.
+    EXTRA_CFLAGS="$EXTRA_CFLAGS -DJDK_ARCH_ABI_PROP_NAME='\"\$(JDK_ARCH_ABI_PROP_NAME)\"'"
+    # And pass the architecture flags to the linker as well
+    EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ARM_ARCH_TYPE_FLAGS $ARM_FLOAT_TYPE_FLAGS"
+  fi
+
+  # When building with an abi profile, the name of that profile is appended on the
+  # bundle platform, which is used in bundle names.
+  if test "x$OPENJDK_TARGET_ABI_PROFILE" != x; then
+    OPENJDK_TARGET_BUNDLE_PLATFORM="$OPENJDK_TARGET_OS_BUNDLE-$OPENJDK_TARGET_ABI_PROFILE"
+  fi
+])
+
 # Reset the global CFLAGS/LDFLAGS variables and initialize them with the
 # corresponding configure arguments instead
 AC_DEFUN_ONCE([FLAGS_SETUP_USER_SUPPLIED_FLAGS],
@@ -306,9 +401,17 @@
       PICFLAG='-fPIC'
       SHARED_LIBRARY_FLAGS='-shared'
       SET_EXECUTABLE_ORIGIN='-Wl,-rpath,\$$ORIGIN[$]1'
-      SET_SHARED_LIBRARY_ORIGIN="-Wl,-z,origin $SET_EXECUTABLE_ORIGIN"
       SET_SHARED_LIBRARY_NAME='-Wl,-soname=[$]1'
       SET_SHARED_LIBRARY_MAPFILE='-Wl,-version-script=[$]1'
+
+      # arm specific settings
+      if test "x$OPENJDK_TARGET_CPU" = "xarm"; then
+        # '-Wl,-z,origin' isn't used on arm.
+        SET_SHARED_LIBRARY_ORIGIN='-Wl,-rpath,\$$$$ORIGIN[$]1'
+      else
+        SET_SHARED_LIBRARY_ORIGIN="-Wl,-z,origin $SET_EXECUTABLE_ORIGIN"
+      fi
+
     fi
   elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
     if test "x$OPENJDK_TARGET_CPU" = xsparcv9; then
@@ -669,6 +772,7 @@
 AC_DEFUN([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
 [
 
+  FLAGS_SETUP_ABI_PROFILE
   FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK_HELPER([TARGET])
   FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK_HELPER([BUILD], [OPENJDK_BUILD_])
 
@@ -758,6 +862,7 @@
       arm )
         # on arm we don't prevent gcc to omit frame pointer but do prevent strict aliasing
         $2CFLAGS_JDK="${$2CFLAGS_JDK} -fno-strict-aliasing"
+        $2COMMON_CCXXFLAGS_JDK="${$2COMMON_CCXXFLAGS_JDK} -fsigned-char"
         ;;
       ppc )
         # on ppc we don't prevent gcc to omit frame pointer but do prevent strict aliasing
@@ -1160,7 +1265,7 @@
     $2JDKLIB_LIBS=""
   else
     $2JAVA_BASE_LDFLAGS="${$2JAVA_BASE_LDFLAGS} \
-        -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_$1_CPU_LIBDIR)"
+        -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base"
 
     if test "x$1" = "xTARGET"; then
       # On some platforms (mac) the linker warns about non existing -L dirs.
@@ -1170,15 +1275,15 @@
       if HOTSPOT_CHECK_JVM_VARIANT(server) || HOTSPOT_CHECK_JVM_VARIANT(client) \
           || HOTSPOT_CHECK_JVM_VARIANT(minimal); then
         $2JAVA_BASE_LDFLAGS="${$2JAVA_BASE_LDFLAGS} \
-            -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_$1_CPU_LIBDIR)/$JVM_VARIANT_MAIN"
+            -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$JVM_VARIANT_MAIN"
       else
         $2JAVA_BASE_LDFLAGS="${$2JAVA_BASE_LDFLAGS} \
-            -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_$1_CPU_LIBDIR)/server"
+            -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/server"
       fi
     elif test "x$1" = "xBUILD"; then
       # When building a buildjdk, it's always only the server variant
       $2JAVA_BASE_LDFLAGS="${$2JAVA_BASE_LDFLAGS} \
-          -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_$1_CPU_LIBDIR)/server"
+          -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/server"
     fi
 
     $2JDKLIB_LIBS="-ljava -ljvm"
--- a/common/autoconf/generated-configure.sh	Thu Jan 12 17:46:35 2017 -0800
+++ b/common/autoconf/generated-configure.sh	Thu Jan 12 18:05:11 2017 -0800
@@ -654,6 +654,17 @@
 ENABLE_GENERATE_CLASSLIST
 BUILD_FAILURE_HANDLER
 ENABLE_INTREE_EC
+VALID_JVM_FEATURES
+JVM_FEATURES_custom
+JVM_FEATURES_zeroshark
+JVM_FEATURES_zero
+JVM_FEATURES_minimal
+JVM_FEATURES_core
+JVM_FEATURES_client
+JVM_FEATURES_server
+INCLUDE_GRAAL
+ELF_LIBS
+ELF_CFLAGS
 STLPORT_LIB
 LIBZIP_CAN_USE_MMAP
 LIBDL
@@ -692,14 +703,7 @@
 FIXPATH_DETACH_FLAG
 FIXPATH
 BUILD_GTEST
-VALID_JVM_FEATURES
-JVM_FEATURES_custom
-JVM_FEATURES_zeroshark
-JVM_FEATURES_zero
-JVM_FEATURES_minimal
-JVM_FEATURES_core
-JVM_FEATURES_client
-JVM_FEATURES_server
+ENABLE_AOT
 INCLUDE_DTRACE
 GCOV_ENABLED
 ZIP_EXTERNAL_DEBUG_SYMBOLS
@@ -749,6 +753,7 @@
 CFLAGS_JDKLIB
 MACOSX_VERSION_MIN
 CXXSTD_CXXFLAG
+JDK_ARCH_ABI_PROP_NAME
 CXX_O_FLAG_SIZE
 CXX_O_FLAG_NONE
 CXX_O_FLAG_DEBUG
@@ -863,6 +868,8 @@
 STATIC_BUILD
 IMPORT_MODULES_MAKE
 IMPORT_MODULES_SRC
+IMPORT_MODULES_MAN
+IMPORT_MODULES_LEGAL
 IMPORT_MODULES_CONF
 IMPORT_MODULES_LIBS
 IMPORT_MODULES_CMDS
@@ -980,10 +987,8 @@
 OPENJDK_BUILD_CPU_BUNDLE
 OPENJDK_BUILD_OS_BUNDLE
 OPENJDK_BUILD_OS_EXPORT_DIR
-OPENJDK_BUILD_CPU_JLI_CFLAGS
 OPENJDK_BUILD_CPU_OSARCH
 OPENJDK_BUILD_CPU_ISADIR
-OPENJDK_BUILD_CPU_LIBDIR
 OPENJDK_BUILD_CPU_LEGACY_LIB
 OPENJDK_BUILD_CPU_LEGACY
 HOTSPOT_TARGET_CPU_DEFINE
@@ -997,10 +1002,8 @@
 OPENJDK_TARGET_CPU_BUNDLE
 OPENJDK_TARGET_OS_BUNDLE
 OPENJDK_TARGET_OS_EXPORT_DIR
-OPENJDK_TARGET_CPU_JLI_CFLAGS
 OPENJDK_TARGET_CPU_OSARCH
 OPENJDK_TARGET_CPU_ISADIR
-OPENJDK_TARGET_CPU_LIBDIR
 OPENJDK_TARGET_CPU_LEGACY_LIB
 OPENJDK_TARGET_CPU_LEGACY
 REQUIRED_OS_VERSION
@@ -1134,6 +1137,7 @@
 enable_debug
 with_debug_level
 with_jvm_variants
+with_cpu_port
 with_devkit
 with_sys_root
 with_sysroot
@@ -1183,14 +1187,14 @@
 with_toolchain_version
 with_build_devkit
 with_jtreg
+with_abi_profile
 enable_warnings_as_errors
 with_native_debug_symbols
 enable_debug_symbols
 enable_zip_debug_info
 enable_native_coverage
 enable_dtrace
-with_jvm_features
-with_jvm_interpreter
+enable_aot
 enable_hotspot_gtest
 with_stdc__lib
 with_msvcr_dll
@@ -1218,6 +1222,11 @@
 with_dxsdk
 with_dxsdk_lib
 with_dxsdk_include
+with_libelf
+with_libelf_include
+with_libelf_lib
+with_jvm_features
+with_jvm_interpreter
 enable_jtreg_failure_handler
 enable_generate_classlist
 with_num_cores
@@ -1342,6 +1351,8 @@
 PNG_LIBS
 LCMS_CFLAGS
 LCMS_LIBS
+ELF_CFLAGS
+ELF_LIBS
 ICECC_CMD
 ICECC_CREATE_ENV
 ICECC_WRAPPER
@@ -1987,6 +1998,10 @@
   --enable-dtrace[=yes/no/auto]
                           enable dtrace. Default is auto, where dtrace is
                           enabled if all dependencies are present.
+  --enable-aot[=yes/no/auto]
+                          enable ahead of time compilation feature. Default is
+                          auto, where aot is enabled if all dependencies are
+                          present.
   --disable-hotspot-gtest Disables building of the Hotspot unit tests
   --disable-freetype-bundling
                           disable bundling of the freetype library with the
@@ -2029,6 +2044,8 @@
   --with-jvm-variants     JVM variants (separated by commas) to build
                           (server,client,minimal,core,zero,zeroshark,custom)
                           [server]
+  --with-cpu-port         specify sources to use for Hotspot 64-bit ARM port
+                          (arm64,aarch64) [aarch64]
   --with-devkit           use this devkit for compilers, tools and resources
   --with-sys-root         alias for --with-sysroot for backwards compatability
   --with-sysroot          use this directory as sysroot
@@ -2111,13 +2128,13 @@
                           dependent]
   --with-build-devkit     Devkit to use for the build platform toolchain
   --with-jtreg            Regression Test Harness [probed]
+  --with-abi-profile      specify ABI profile for ARM builds
+                          (arm-vfp-sflt,arm-vfp-hflt,arm-sflt,
+                          armv5-vfp-sflt,armv6-vfp-hflt,arm64,aarch64)
+                          [toolchain dependent]
   --with-native-debug-symbols
                           set the native debug symbol configuration (none,
                           internal, external, zipped) [varying]
-  --with-jvm-features     additional JVM features to enable (separated by
-                          comma), use '--help' to show possible values [none]
-  --with-jvm-interpreter  Deprecated. Option is kept for backwards
-                          compatibility and is ignored
   --with-stdc++lib=<static>,<dynamic>,<default>
                           force linking of the C++ runtime on Linux to either
                           static or dynamic, default is static with dynamic as
@@ -2164,6 +2181,15 @@
                           compatibility and is ignored
   --with-dxsdk-include    Deprecated. Option is kept for backwards
                           compatibility and is ignored
+  --with-libelf           specify prefix directory for the libelf package
+                          (expecting the libraries under PATH/lib and the
+                          headers under PATH/include)
+  --with-libelf-include   specify directory for the libelf include files
+  --with-libelf-lib       specify directory for the libelf library
+  --with-jvm-features     additional JVM features to enable (separated by
+                          comma), use '--help' to show possible values [none]
+  --with-jvm-interpreter  Deprecated. Option is kept for backwards
+                          compatibility and is ignored
   --with-num-cores        number of cores in the build system, e.g.
                           --with-num-cores=8 [probed]
   --with-memory-size      memory (in MB) available in the build system, e.g.
@@ -2293,6 +2319,8 @@
   PNG_LIBS    linker flags for PNG, overriding pkg-config
   LCMS_CFLAGS C compiler flags for LCMS, overriding pkg-config
   LCMS_LIBS   linker flags for LCMS, overriding pkg-config
+  ELF_CFLAGS  C compiler flags for ELF, overriding pkg-config
+  ELF_LIBS    linker flags for ELF, overriding pkg-config
   ICECC_CMD   Override default value for ICECC_CMD
   ICECC_CREATE_ENV
               Override default value for ICECC_CREATE_ENV
@@ -3995,6 +4023,12 @@
 # questions.
 #
 
+################################################################################
+#
+# Setup ABI profile (for arm)
+#
+
+
 # Reset the global CFLAGS/LDFLAGS variables and initialize them with the
 # corresponding configure arguments instead
 
@@ -4180,6 +4214,8 @@
       PKGHANDLER_COMMAND="sudo apt-get install ccache" ;;
     dtrace)
       PKGHANDLER_COMMAND="sudo apt-get install systemtap-sdt-dev" ;;
+    elf)
+      PKGHANDLER_COMMAND="sudo apt-get install libelf-dev" ;;
   esac
 }
 
@@ -4199,6 +4235,8 @@
       PKGHANDLER_COMMAND="sudo yum install libXtst-devel libXt-devel libXrender-devel libXi-devel" ;;
     ccache)
       PKGHANDLER_COMMAND="sudo yum install ccache" ;;
+    elf)
+      PKGHANDLER_COMMAND="sudo yum install elfutils-libelf-devel" ;;
   esac
 }
 
@@ -4251,7 +4289,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"
+    graal fprof vm-structs jni-check services management all-gcs nmt cds \
+    static-build link-time-opt aot"
 
 # All valid JVM variants
 VALID_JVM_VARIANTS="server client minimal core zero zeroshark custom"
@@ -4295,6 +4334,11 @@
 #
 
 
+################################################################################
+# Check if AOT should be enabled
+#
+
+
 ###############################################################################
 # Set up all JVM features for each JVM variant.
 #
@@ -4306,6 +4350,16 @@
 
 
 ################################################################################
+#
+# 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
+#
+
+
+
+################################################################################
 # Check if gtest should be built
 #
 
@@ -4718,6 +4772,36 @@
 ################################################################################
 
 
+#
+# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+################################################################################
+# Setup libelf (ELF library)
+################################################################################
+
+
 
 ################################################################################
 # Determine which libraries are needed for this configuration
@@ -5086,7 +5170,7 @@
 #CUSTOM_AUTOCONF_INCLUDE
 
 # Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1481663811
+DATE_WHEN_GENERATED=1482828098
 
 ###############################################################################
 #
@@ -15788,15 +15872,6 @@
   fi
 
 
-  # This is the name of the cpu (but using i386 and amd64 instead of
-  # x86 and x86_64, respectively), preceeded by a /, to be used when
-  # locating libraries. On macosx, it's empty, though.
-  OPENJDK_TARGET_CPU_LIBDIR="/$OPENJDK_TARGET_CPU_LEGACY_LIB"
-  if test "x$OPENJDK_TARGET_OS" = xmacosx; then
-    OPENJDK_TARGET_CPU_LIBDIR=""
-  fi
-
-
   # OPENJDK_TARGET_CPU_ISADIR is normally empty. On 64-bit Solaris systems, it is set to
   # /amd64 or /sparcv9. This string is appended to some library paths, like this:
   # /usr/lib${OPENJDK_TARGET_CPU_ISADIR}/libexample.so
@@ -15828,16 +15903,6 @@
     # On all platforms except macosx, we replace x86_64 with amd64.
     OPENJDK_TARGET_CPU_JLI="amd64"
   fi
-  # Now setup the -D flags for building libjli.
-  OPENJDK_TARGET_CPU_JLI_CFLAGS="-DLIBARCHNAME='\"$OPENJDK_TARGET_CPU_JLI\"'"
-  if test "x$OPENJDK_TARGET_OS" = xsolaris; then
-    if test "x$OPENJDK_TARGET_CPU_ARCH" = xsparc; then
-      OPENJDK_TARGET_CPU_JLI_CFLAGS="$OPENJDK_TARGET_CPU_JLI_CFLAGS -DLIBARCH32NAME='\"sparc\"' -DLIBARCH64NAME='\"sparcv9\"'"
-    elif test "x$OPENJDK_TARGET_CPU_ARCH" = xx86; then
-      OPENJDK_TARGET_CPU_JLI_CFLAGS="$OPENJDK_TARGET_CPU_JLI_CFLAGS -DLIBARCH32NAME='\"i386\"' -DLIBARCH64NAME='\"amd64\"'"
-    fi
-  fi
-
 
   if test "x$OPENJDK_TARGET_OS" = xmacosx; then
       OPENJDK_TARGET_OS_EXPORT_DIR=macosx
@@ -15963,15 +16028,6 @@
   fi
 
 
-  # This is the name of the cpu (but using i386 and amd64 instead of
-  # x86 and x86_64, respectively), preceeded by a /, to be used when
-  # locating libraries. On macosx, it's empty, though.
-  OPENJDK_BUILD_CPU_LIBDIR="/$OPENJDK_BUILD_CPU_LEGACY_LIB"
-  if test "x$OPENJDK_BUILD_OS" = xmacosx; then
-    OPENJDK_BUILD_CPU_LIBDIR=""
-  fi
-
-
   # OPENJDK_BUILD_CPU_ISADIR is normally empty. On 64-bit Solaris systems, it is set to
   # /amd64 or /sparcv9. This string is appended to some library paths, like this:
   # /usr/lib${OPENJDK_BUILD_CPU_ISADIR}/libexample.so
@@ -16003,16 +16059,6 @@
     # On all platforms except macosx, we replace x86_64 with amd64.
     OPENJDK_BUILD_CPU_JLI="amd64"
   fi
-  # Now setup the -D flags for building libjli.
-  OPENJDK_BUILD_CPU_JLI_CFLAGS="-DLIBARCHNAME='\"$OPENJDK_BUILD_CPU_JLI\"'"
-  if test "x$OPENJDK_BUILD_OS" = xsolaris; then
-    if test "x$OPENJDK_BUILD_CPU_ARCH" = xsparc; then
-      OPENJDK_BUILD_CPU_JLI_CFLAGS="$OPENJDK_BUILD_CPU_JLI_CFLAGS -DLIBARCH32NAME='\"sparc\"' -DLIBARCH64NAME='\"sparcv9\"'"
-    elif test "x$OPENJDK_BUILD_CPU_ARCH" = xx86; then
-      OPENJDK_BUILD_CPU_JLI_CFLAGS="$OPENJDK_BUILD_CPU_JLI_CFLAGS -DLIBARCH32NAME='\"i386\"' -DLIBARCH64NAME='\"amd64\"'"
-    fi
-  fi
-
 
   if test "x$OPENJDK_BUILD_OS" = xmacosx; then
       OPENJDK_BUILD_OS_EXPORT_DIR=macosx
@@ -16703,6 +16749,26 @@
 fi
 
 
+
+
+# Check whether --with-cpu-port was given.
+if test "${with_cpu_port+set}" = set; then :
+  withval=$with_cpu_port;
+fi
+
+
+  if test "x$with_cpu_port" != x; then
+    if test "x$OPENJDK_TARGET_CPU" != xaarch64; then
+      as_fn_error $? "--with-cpu-port only available on aarch64" "$LINENO" 5
+    fi
+    if test "x$with_cpu_port" != xarm64 && \
+        test "x$with_cpu_port" != xaarch64; then
+      as_fn_error $? "--with-cpu-port must specify arm64 or aarch64" "$LINENO" 5
+    fi
+    HOTSPOT_TARGET_CPU_PORT="$with_cpu_port"
+  fi
+
+
   if test "x$with_jvm_variants" = x; then
     with_jvm_variants="server"
   fi
@@ -24611,7 +24677,7 @@
   else
     if test "x$NO_DEFAULT_VERSION_PARTS" != xtrue; then
       # Default is 0, if unspecified
-      VERSION_MINOR=0
+      VERSION_MINOR=$DEFAULT_VERSION_MINOR
     fi
   fi
 
@@ -24658,7 +24724,7 @@
   else
     if test "x$NO_DEFAULT_VERSION_PARTS" != xtrue; then
       # Default is 0, if unspecified
-      VERSION_SECURITY=0
+      VERSION_SECURITY=$DEFAULT_VERSION_SECURITY
     fi
   fi
 
@@ -24705,7 +24771,7 @@
   else
     if test "x$NO_DEFAULT_VERSION_PARTS" != xtrue; then
       # Default is 0, if unspecified
-      VERSION_PATCH=0
+      VERSION_PATCH=$DEFAULT_VERSION_PATCH
     fi
   fi
 
@@ -30599,24 +30665,9 @@
   BOOT_JDK_SOURCETARGET="-source 8 -target 8"
 
 
-
-  $ECHO "Check if jvm arg is ok: --patch-module foo=bar" >&5
-  $ECHO "Command: $JAVA --patch-module foo=bar -version" >&5
-  OUTPUT=`$JAVA --patch-module foo=bar -version 2>&1`
-  FOUND_WARN=`$ECHO "$OUTPUT" | $GREP -i warn`
-  FOUND_VERSION=`$ECHO $OUTPUT | $GREP " version \""`
-  if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then
-    dummy="$dummy --patch-module foo=bar"
-    JVM_ARG_OK=true
-  else
-    $ECHO "Arg failed:" >&5
-    $ECHO "$OUTPUT" >&5
-    JVM_ARG_OK=false
-  fi
-
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking if Boot JDK supports modules" >&5
 $as_echo_n "checking if Boot JDK supports modules... " >&6; }
-  if test "x$JVM_ARG_OK" = "xtrue"; then
+  if "$JAVA" --list-modules > /dev/null 2>&1; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
     BOOT_JDK_MODULAR="true"
@@ -31213,6 +31264,8 @@
 
 
 
+
+
 ###############################################################################
 #
 # Setup the toolchain (compilers etc), i.e. tools used to compile and process
@@ -49047,9 +49100,17 @@
       PICFLAG='-fPIC'
       SHARED_LIBRARY_FLAGS='-shared'
       SET_EXECUTABLE_ORIGIN='-Wl,-rpath,\$$ORIGIN$1'
-      SET_SHARED_LIBRARY_ORIGIN="-Wl,-z,origin $SET_EXECUTABLE_ORIGIN"
       SET_SHARED_LIBRARY_NAME='-Wl,-soname=$1'
       SET_SHARED_LIBRARY_MAPFILE='-Wl,-version-script=$1'
+
+      # arm specific settings
+      if test "x$OPENJDK_TARGET_CPU" = "xarm"; then
+        # '-Wl,-z,origin' isn't used on arm.
+        SET_SHARED_LIBRARY_ORIGIN='-Wl,-rpath,\$$$$ORIGIN$1'
+      else
+        SET_SHARED_LIBRARY_ORIGIN="-Wl,-z,origin $SET_EXECUTABLE_ORIGIN"
+      fi
+
     fi
   elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
     if test "x$OPENJDK_TARGET_CPU" = xsparcv9; then
@@ -49639,6 +49700,108 @@
 
 
 
+
+# Check whether --with-abi-profile was given.
+if test "${with_abi_profile+set}" = set; then :
+  withval=$with_abi_profile;
+fi
+
+
+  if test "x$with_abi_profile" != x; then
+    if test "x$OPENJDK_TARGET_CPU" != xarm && \
+        test "x$OPENJDK_TARGET_CPU" != xaarch64; then
+      as_fn_error $? "--with-abi-profile only available on arm/aarch64" "$LINENO" 5
+    fi
+
+    OPENJDK_TARGET_ABI_PROFILE=$with_abi_profile
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ABI profle" >&5
+$as_echo_n "checking for ABI profle... " >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OPENJDK_TARGET_ABI_PROFILE" >&5
+$as_echo "$OPENJDK_TARGET_ABI_PROFILE" >&6; }
+
+    if test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm-vfp-sflt; then
+      ARM_FLOAT_TYPE=vfp-sflt
+      ARM_ARCH_TYPE_FLAGS='-march=armv7-a -mthumb'
+    elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm-vfp-hflt; then
+      ARM_FLOAT_TYPE=vfp-hflt
+      ARM_ARCH_TYPE_FLAGS='-march=armv7-a -mthumb'
+    elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm-sflt; then
+      ARM_FLOAT_TYPE=sflt
+      ARM_ARCH_TYPE_FLAGS='-march=armv5t -marm'
+    elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarmv5-vfp-sflt; then
+      ARM_FLOAT_TYPE=vfp-sflt
+      ARM_ARCH_TYPE_FLAGS='-march=armv5t -marm'
+    elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarmv6-vfp-hflt; then
+      ARM_FLOAT_TYPE=vfp-hflt
+      ARM_ARCH_TYPE_FLAGS='-march=armv6 -marm'
+    elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm64; then
+      # No special flags, just need to trigger setting JDK_ARCH_ABI_PROP_NAME
+      ARM_FLOAT_TYPE=
+      ARM_ARCH_TYPE_FLAGS=
+    elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xaarch64; then
+      # No special flags, just need to trigger setting JDK_ARCH_ABI_PROP_NAME
+      ARM_FLOAT_TYPE=
+      ARM_ARCH_TYPE_FLAGS=
+    else
+      as_fn_error $? "Invalid ABI profile: \"$OPENJDK_TARGET_ABI_PROFILE\"" "$LINENO" 5
+    fi
+
+    if test "x$ARM_FLOAT_TYPE" = xvfp-sflt; then
+      ARM_FLOAT_TYPE_FLAGS='-mfloat-abi=softfp -mfpu=vfp -DFLOAT_ARCH=-vfp-sflt'
+    elif test "x$ARM_FLOAT_TYPE" = xvfp-hflt; then
+      ARM_FLOAT_TYPE_FLAGS='-mfloat-abi=hard -mfpu=vfp -DFLOAT_ARCH=-vfp-hflt'
+    elif test "x$ARM_FLOAT_TYPE" = xsflt; then
+      ARM_FLOAT_TYPE_FLAGS='-msoft-float -mfpu=vfp'
+    fi
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ARM_FLOAT_TYPE floating point flags" >&5
+$as_echo_n "checking for $ARM_FLOAT_TYPE floating point flags... " >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ARM_FLOAT_TYPE_FLAGS" >&5
+$as_echo "$ARM_FLOAT_TYPE_FLAGS" >&6; }
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for arch type flags" >&5
+$as_echo_n "checking for arch type flags... " >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ARM_ARCH_TYPE_FLAGS" >&5
+$as_echo "$ARM_ARCH_TYPE_FLAGS" >&6; }
+
+    # Now set JDK_ARCH_ABI_PROP_NAME. This is equivalent to the last part of the
+    # autoconf target triplet.
+     JDK_ARCH_ABI_PROP_NAME=`$ECHO $OPENJDK_TARGET_AUTOCONF_NAME | $SED -e 's/.*-\([^-]*\)$/\1/'`
+    # Sanity check that it is a known ABI.
+    if test "x$JDK_ARCH_ABI_PROP_NAME" != xgnu && \
+        test "x$JDK_ARCH_ABI_PROP_NAME" != xgnueabi  && \
+        test "x$JDK_ARCH_ABI_PROP_NAME" != xgnueabihf; then
+          { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unknown autoconf target triplet ABI: \"$JDK_ARCH_ABI_PROP_NAME\"" >&5
+$as_echo "$as_me: WARNING: Unknown autoconf target triplet ABI: \"$JDK_ARCH_ABI_PROP_NAME\"" >&2;}
+    fi
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ABI property name" >&5
+$as_echo_n "checking for ABI property name... " >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JDK_ARCH_ABI_PROP_NAME" >&5
+$as_echo "$JDK_ARCH_ABI_PROP_NAME" >&6; }
+
+
+    # Pass these on to the open part of configure as if they were set using
+    # --with-extra-c[xx]flags.
+    EXTRA_CFLAGS="$EXTRA_CFLAGS $ARM_ARCH_TYPE_FLAGS $ARM_FLOAT_TYPE_FLAGS"
+    EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS $ARM_ARCH_TYPE_FLAGS $ARM_FLOAT_TYPE_FLAGS"
+    # Get rid of annoying "note: the mangling of 'va_list' has changed in GCC 4.4"
+    # FIXME: This should not really be set using extra_cflags.
+    if test "x$OPENJDK_TARGET_CPU" = xarm; then
+        EXTRA_CFLAGS="$EXTRA_CFLAGS -Wno-psabi"
+        EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS -Wno-psabi"
+    fi
+    # Also add JDK_ARCH_ABI_PROP_NAME define, but only to CFLAGS.
+    EXTRA_CFLAGS="$EXTRA_CFLAGS -DJDK_ARCH_ABI_PROP_NAME='\"\$(JDK_ARCH_ABI_PROP_NAME)\"'"
+    # And pass the architecture flags to the linker as well
+    EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ARM_ARCH_TYPE_FLAGS $ARM_FLOAT_TYPE_FLAGS"
+  fi
+
+  # When building with an abi profile, the name of that profile is appended on the
+  # bundle platform, which is used in bundle names.
+  if test "x$OPENJDK_TARGET_ABI_PROFILE" != x; then
+    OPENJDK_TARGET_BUNDLE_PLATFORM="$OPENJDK_TARGET_OS_BUNDLE-$OPENJDK_TARGET_ABI_PROFILE"
+  fi
+
+
   # Special extras...
   if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
     if test "x$OPENJDK_TARGET_CPU_ARCH" = "xsparc"; then
@@ -49790,6 +49953,7 @@
       arm )
         # on arm we don't prevent gcc to omit frame pointer but do prevent strict aliasing
         CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing"
+        COMMON_CCXXFLAGS_JDK="${COMMON_CCXXFLAGS_JDK} -fsigned-char"
         ;;
       ppc )
         # on ppc we don't prevent gcc to omit frame pointer but do prevent strict aliasing
@@ -50382,7 +50546,7 @@
     JDKLIB_LIBS=""
   else
     JAVA_BASE_LDFLAGS="${JAVA_BASE_LDFLAGS} \
-        -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_TARGET_CPU_LIBDIR)"
+        -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base"
 
     if test "xTARGET" = "xTARGET"; then
       # On some platforms (mac) the linker warns about non existing -L dirs.
@@ -50392,15 +50556,15 @@
       if   [[ " $JVM_VARIANTS " =~ " server " ]]   ||   [[ " $JVM_VARIANTS " =~ " client " ]]   \
           ||   [[ " $JVM_VARIANTS " =~ " minimal " ]]  ; then
         JAVA_BASE_LDFLAGS="${JAVA_BASE_LDFLAGS} \
-            -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_TARGET_CPU_LIBDIR)/$JVM_VARIANT_MAIN"
+            -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$JVM_VARIANT_MAIN"
       else
         JAVA_BASE_LDFLAGS="${JAVA_BASE_LDFLAGS} \
-            -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_TARGET_CPU_LIBDIR)/server"
+            -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/server"
       fi
     elif test "xTARGET" = "xBUILD"; then
       # When building a buildjdk, it's always only the server variant
       JAVA_BASE_LDFLAGS="${JAVA_BASE_LDFLAGS} \
-          -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_TARGET_CPU_LIBDIR)/server"
+          -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/server"
     fi
 
     JDKLIB_LIBS="-ljava -ljvm"
@@ -50612,6 +50776,7 @@
       arm )
         # on arm we don't prevent gcc to omit frame pointer but do prevent strict aliasing
         OPENJDK_BUILD_CFLAGS_JDK="${OPENJDK_BUILD_CFLAGS_JDK} -fno-strict-aliasing"
+        OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK="${OPENJDK_BUILD_COMMON_CCXXFLAGS_JDK} -fsigned-char"
         ;;
       ppc )
         # on ppc we don't prevent gcc to omit frame pointer but do prevent strict aliasing
@@ -51204,7 +51369,7 @@
     OPENJDK_BUILD_JDKLIB_LIBS=""
   else
     OPENJDK_BUILD_JAVA_BASE_LDFLAGS="${OPENJDK_BUILD_JAVA_BASE_LDFLAGS} \
-        -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_BUILD_CPU_LIBDIR)"
+        -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base"
 
     if test "xBUILD" = "xTARGET"; then
       # On some platforms (mac) the linker warns about non existing -L dirs.
@@ -51214,15 +51379,15 @@
       if   [[ " $JVM_VARIANTS " =~ " server " ]]   ||   [[ " $JVM_VARIANTS " =~ " client " ]]   \
           ||   [[ " $JVM_VARIANTS " =~ " minimal " ]]  ; then
         OPENJDK_BUILD_JAVA_BASE_LDFLAGS="${OPENJDK_BUILD_JAVA_BASE_LDFLAGS} \
-            -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_BUILD_CPU_LIBDIR)/$JVM_VARIANT_MAIN"
+            -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$JVM_VARIANT_MAIN"
       else
         OPENJDK_BUILD_JAVA_BASE_LDFLAGS="${OPENJDK_BUILD_JAVA_BASE_LDFLAGS} \
-            -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_BUILD_CPU_LIBDIR)/server"
+            -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/server"
       fi
     elif test "xBUILD" = "xBUILD"; then
       # When building a buildjdk, it's always only the server variant
       OPENJDK_BUILD_JAVA_BASE_LDFLAGS="${OPENJDK_BUILD_JAVA_BASE_LDFLAGS} \
-          -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_BUILD_CPU_LIBDIR)/server"
+          -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/server"
     fi
 
     OPENJDK_BUILD_JDKLIB_LIBS="-ljava -ljvm"
@@ -52741,112 +52906,51 @@
 
 
 
-  # The user can in some cases supply additional jvm features. For the custom
-  # variant, this defines the entire variant.
-
-# Check whether --with-jvm-features was given.
-if test "${with_jvm_features+set}" = set; then :
-  withval=$with_jvm_features;
-fi
-
-  if test "x$with_jvm_features" != x; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking additional JVM features" >&5
-$as_echo_n "checking additional JVM features... " >&6; }
-    JVM_FEATURES=`$ECHO $with_jvm_features | $SED -e 's/,/ /g'`
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JVM_FEATURES" >&5
-$as_echo "$JVM_FEATURES" >&6; }
-  fi
-
-  # Verify that dependencies are met for explicitly set features.
-  if   [[ " $JVM_FEATURES " =~ " jvmti " ]]   && !   [[ " $JVM_FEATURES " =~ " services " ]]  ; then
-    as_fn_error $? "Specified JVM feature 'jvmti' requires feature 'services'" "$LINENO" 5
-  fi
-
-  if   [[ " $JVM_FEATURES " =~ " management " ]]   && !   [[ " $JVM_FEATURES " =~ " nmt " ]]  ; then
-    as_fn_error $? "Specified JVM feature 'management' requires feature 'nmt'" "$LINENO" 5
-  fi
-
-  if   [[ " $JVM_FEATURES " =~ " jvmci " ]]   && ! (  [[ " $JVM_FEATURES " =~ " compiler1 " ]]   ||   [[ " $JVM_FEATURES " =~ " compiler2 " ]]  ); then
-    as_fn_error $? "Specified JVM feature 'jvmci' requires feature 'compiler2' or 'compiler1'" "$LINENO" 5
-  fi
-
-  if   [[ " $JVM_FEATURES " =~ " compiler2 " ]]   && !   [[ " $JVM_FEATURES " =~ " all-gcs " ]]  ; then
-    as_fn_error $? "Specified JVM feature 'compiler2' requires feature 'all-gcs'" "$LINENO" 5
-  fi
-
-  if   [[ " $JVM_FEATURES " =~ " vm-structs " ]]   && !   [[ " $JVM_FEATURES " =~ " all-gcs " ]]  ; then
-    as_fn_error $? "Specified JVM feature 'vm-structs' requires feature 'all-gcs'" "$LINENO" 5
-  fi
-
-  # Turn on additional features based on other parts of configure
-  if test "x$INCLUDE_DTRACE" = "xtrue"; then
-    JVM_FEATURES="$JVM_FEATURES dtrace"
-  else
-    if   [[ " $JVM_FEATURES " =~ " dtrace " ]]  ; then
-      as_fn_error $? "To enable dtrace, you must use --enable-dtrace" "$LINENO" 5
-    fi
-  fi
-
-  if test "x$STATIC_BUILD" = "xtrue"; then
-    JVM_FEATURES="$JVM_FEATURES static-build"
-  else
-    if   [[ " $JVM_FEATURES " =~ " static-build " ]]  ; then
-      as_fn_error $? "To enable static-build, you must use --enable-static-build" "$LINENO" 5
-    fi
-  fi
-
-  if !   [[ " $JVM_VARIANTS " =~ " zero " ]]   && !   [[ " $JVM_VARIANTS " =~ " zeroshark " ]]  ; then
-    if   [[ " $JVM_FEATURES " =~ " zero " ]]  ; then
-      as_fn_error $? "To enable zero/zeroshark, you must use --with-jvm-variants=zero/zeroshark" "$LINENO" 5
-    fi
-  fi
-
-  if !   [[ " $JVM_VARIANTS " =~ " zeroshark " ]]  ; then
-    if   [[ " $JVM_FEATURES " =~ " shark " ]]  ; then
-      as_fn_error $? "To enable shark, you must use --with-jvm-variants=zeroshark" "$LINENO" 5
-    fi
-  fi
-
-  # Only enable jvmci on x86_64, sparcv9 and aarch64.
-  if test "x$OPENJDK_TARGET_CPU" = "xx86_64" || \
-      test "x$OPENJDK_TARGET_CPU" = "xsparcv9" || \
-      test "x$OPENJDK_TARGET_CPU" = "xaarch64" ; then
-    JVM_FEATURES_jvmci="jvmci"
-  else
-    JVM_FEATURES_jvmci=""
-  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"
-
-  # Enable features depending on variant.
-  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_zero="zero $NON_MINIMAL_FEATURES $JVM_FEATURES"
-  JVM_FEATURES_zeroshark="zero shark $NON_MINIMAL_FEATURES $JVM_FEATURES"
-  JVM_FEATURES_custom="$JVM_FEATURES"
-
-
-
-
-
-
-
-
-
-  # Used for verification of Makefiles by check-jvm-feature
-
-
-  # We don't support --with-jvm-interpreter anymore, use zero instead.
-
-
-# Check whether --with-jvm-interpreter was given.
-if test "${with_jvm_interpreter+set}" = set; then :
-  withval=$with_jvm_interpreter; { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Option --with-jvm-interpreter is deprecated and will be ignored." >&5
-$as_echo "$as_me: WARNING: Option --with-jvm-interpreter is deprecated and will be ignored." >&2;}
-fi
+  # Check whether --enable-aot was given.
+if test "${enable_aot+set}" = set; then :
+  enableval=$enable_aot;
+fi
+
+
+  if test "x$enable_aot" = "x" || test "x$enable_aot" = "xauto"; then
+    ENABLE_AOT="true"
+  elif test "x$enable_aot" = "xyes"; then
+    ENABLE_AOT="true"
+  elif test "x$enable_aot" = "xno"; then
+    ENABLE_AOT="false"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if aot should be enabled" >&5
+$as_echo_n "checking if aot should be enabled... " >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, forced" >&5
+$as_echo "no, forced" >&6; }
+  else
+    as_fn_error $? "Invalid value for --enable-aot: $enable_aot" "$LINENO" 5
+  fi
+
+  if test "x$ENABLE_AOT" = "xtrue"; then
+    # Only enable AOT on linux-X64.
+    if test "x$OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU" = "xlinux-x86_64"; then
+      if test -e "$HOTSPOT_TOPDIR/src/jdk.aot"; then
+        if test -e "$HOTSPOT_TOPDIR/src/jdk.vm.compiler"; then
+          ENABLE_AOT="true"
+        else
+          ENABLE_AOT="false"
+          if test "x$enable_aot" = "xyes"; then
+            as_fn_error $? "Cannot build AOT without hotspot/src/jdk.vm.compiler sources. Remove --enable-aot." "$LINENO" 5
+          fi
+        fi
+      else
+        ENABLE_AOT="false"
+        if test "x$enable_aot" = "xyes"; then
+          as_fn_error $? "Cannot build AOT without hotspot/src/jdk.aot sources. Remove --enable-aot." "$LINENO" 5
+        fi
+      fi
+    else
+      ENABLE_AOT="false"
+      if test "x$enable_aot" = "xyes"; then
+        as_fn_error $? "AOT is currently only supported on Linux-x86_64. Remove --enable-aot." "$LINENO" 5
+      fi
+    fi
+  fi
 
 
 
@@ -63815,13 +63919,470 @@
 
 
 
-
-
-
-
-
-
-
+# Check whether --with-libelf was given.
+if test "${with_libelf+set}" = set; then :
+  withval=$with_libelf;
+fi
+
+
+# Check whether --with-libelf-include was given.
+if test "${with_libelf_include+set}" = set; then :
+  withval=$with_libelf_include;
+fi
+
+
+# Check whether --with-libelf-lib was given.
+if test "${with_libelf_lib+set}" = set; then :
+  withval=$with_libelf_lib;
+fi
+
+
+  if test "x$ENABLE_AOT" = xfalse; then
+    if (test "x${with_libelf}" != x && test "x${with_libelf}" != xno) || \
+        (test "x${with_libelf_include}" != x && test "x${with_libelf_include}" != xno) || \
+        (test "x${with_libelf_lib}" != x && test "x${with_libelf_lib}" != xno); then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libelf is not used, so --with-libelf[-*] is ignored" >&5
+$as_echo "$as_me: WARNING: libelf is not used, so --with-libelf[-*] is ignored" >&2;}
+    fi
+    LIBELF_CFLAGS=
+    LIBELF_LIBS=
+  else
+    LIBELF_FOUND=no
+
+    if test "x${with_libelf}" = xno || test "x${with_libelf_include}" = xno || test "x${with_libelf_lib}" = xno; then
+      ENABLE_AOT="false"
+      if test "x${enable_aot}" = xyes; then
+        as_fn_error $? "libelf is explicitly disabled, cannot build AOT. Enable libelf or remove --enable-aot to disable AOT." "$LINENO" 5
+      fi
+    else
+      if test "x${with_libelf}" != x; then
+        ELF_LIBS="-L${with_libelf}/lib -lelf"
+        ELF_CFLAGS="-I${with_libelf}/include"
+        LIBELF_FOUND=yes
+      fi
+      if test "x${with_libelf_include}" != x; then
+        ELF_CFLAGS="-I${with_libelf_include}"
+        LIBELF_FOUND=yes
+      fi
+      if test "x${with_libelf_lib}" != x; then
+        ELF_LIBS="-L${with_libelf_lib} -lelf"
+        LIBELF_FOUND=yes
+      fi
+      # Do not try pkg-config if we have a sysroot set.
+      if test "x$SYSROOT" = x; then
+        if test "x$LIBELF_FOUND" = xno; then
+          # Figure out ELF_CFLAGS and ELF_LIBS
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ELF" >&5
+$as_echo_n "checking for ELF... " >&6; }
+
+if test -n "$ELF_CFLAGS"; then
+    pkg_cv_ELF_CFLAGS="$ELF_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libelf\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "libelf") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_ELF_CFLAGS=`$PKG_CONFIG --cflags "libelf" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$ELF_LIBS"; then
+    pkg_cv_ELF_LIBS="$ELF_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libelf\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "libelf") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_ELF_LIBS=`$PKG_CONFIG --libs "libelf" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+	        ELF_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libelf" 2>&1`
+        else
+	        ELF_PKG_ERRORS=`$PKG_CONFIG --print-errors "libelf" 2>&1`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$ELF_PKG_ERRORS" >&5
+
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+                LIBELF_FOUND=no
+elif test $pkg_failed = untried; then
+	LIBELF_FOUND=no
+else
+	ELF_CFLAGS=$pkg_cv_ELF_CFLAGS
+	ELF_LIBS=$pkg_cv_ELF_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+	LIBELF_FOUND=yes
+fi
+        fi
+      fi
+      if test "x$LIBELF_FOUND" = xno; then
+        for ac_header in libelf.h
+do :
+  ac_fn_cxx_check_header_mongrel "$LINENO" "libelf.h" "ac_cv_header_libelf_h" "$ac_includes_default"
+if test "x$ac_cv_header_libelf_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBELF_H 1
+_ACEOF
+
+              LIBELF_FOUND=yes
+              ELF_CFLAGS=
+              ELF_LIBS=-lelf
+
+else
+  LIBELF_FOUND=no
+
+fi
+
+done
+
+      fi
+      if test "x$LIBELF_FOUND" = xno; then
+        ENABLE_AOT="false"
+
+  # Print a helpful message on how to acquire the necessary build dependency.
+  # elf is the help tag: freetype, cups, alsa etc
+  MISSING_DEPENDENCY=elf
+
+  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+    cygwin_help $MISSING_DEPENDENCY
+  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    msys_help $MISSING_DEPENDENCY
+  else
+    PKGHANDLER_COMMAND=
+
+    case $PKGHANDLER in
+      apt-get)
+        apt_help     $MISSING_DEPENDENCY ;;
+      yum)
+        yum_help     $MISSING_DEPENDENCY ;;
+      port)
+        port_help    $MISSING_DEPENDENCY ;;
+      pkgutil)
+        pkgutil_help $MISSING_DEPENDENCY ;;
+      pkgadd)
+        pkgadd_help  $MISSING_DEPENDENCY ;;
+    esac
+
+    if test "x$PKGHANDLER_COMMAND" != x; then
+      HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
+    fi
+  fi
+
+        if test "x${enable_aot}" = xyes; then
+          as_fn_error $? "libelf not found, cannot build AOT. Remove --enable-aot to disable AOT or: $HELP_MSG" "$LINENO" 5
+        else
+          { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libelf not found, cannot build AOT. $HELP_MSG" >&5
+$as_echo "$as_me: WARNING: libelf not found, cannot build AOT. $HELP_MSG" >&2;}
+        fi
+      else
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libelf works" >&5
+$as_echo_n "checking if libelf works... " >&6; }
+        ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+        OLD_CFLAGS="$CFLAGS"
+        CFLAGS="$CFLAGS $ELF_CFLAGS"
+        OLD_LIBS="$LIBS"
+        LIBS="$LIBS $ELF_LIBS"
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <libelf.h>
+int
+main ()
+{
+
+              elf_version(0);
+              return 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  LIBELF_WORKS=yes
+else
+  LIBELF_WORKS=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+        CFLAGS="$OLD_CFLAGS"
+        LIBS="$OLD_LIBS"
+        ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBELF_WORKS" >&5
+$as_echo "$LIBELF_WORKS" >&6; }
+
+        if test "x$LIBELF_WORKS" = xno; then
+          ENABLE_AOT="false"
+
+  # Print a helpful message on how to acquire the necessary build dependency.
+  # elf is the help tag: freetype, cups, alsa etc
+  MISSING_DEPENDENCY=elf
+
+  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+    cygwin_help $MISSING_DEPENDENCY
+  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    msys_help $MISSING_DEPENDENCY
+  else
+    PKGHANDLER_COMMAND=
+
+    case $PKGHANDLER in
+      apt-get)
+        apt_help     $MISSING_DEPENDENCY ;;
+      yum)
+        yum_help     $MISSING_DEPENDENCY ;;
+      port)
+        port_help    $MISSING_DEPENDENCY ;;
+      pkgutil)
+        pkgutil_help $MISSING_DEPENDENCY ;;
+      pkgadd)
+        pkgadd_help  $MISSING_DEPENDENCY ;;
+    esac
+
+    if test "x$PKGHANDLER_COMMAND" != x; then
+      HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
+    fi
+  fi
+
+          if test "x$enable_aot" = "xyes"; then
+            as_fn_error $? "Found libelf but could not link and compile with it. Remove --enable-aot to disable AOT or: $HELP_MSG" "$LINENO" 5
+          else
+            { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Found libelf but could not link and compile with it. $HELP_MSG" >&5
+$as_echo "$as_me: WARNING: Found libelf but could not link and compile with it. $HELP_MSG" >&2;}
+          fi
+        fi
+      fi
+    fi
+  fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# Hotspot setup depends on lib checks (AOT needs libelf).
+
+
+  # The user can in some cases supply additional jvm features. For the custom
+  # variant, this defines the entire variant.
+
+# Check whether --with-jvm-features was given.
+if test "${with_jvm_features+set}" = set; then :
+  withval=$with_jvm_features;
+fi
+
+  if test "x$with_jvm_features" != x; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking additional JVM features" >&5
+$as_echo_n "checking additional JVM features... " >&6; }
+    JVM_FEATURES=`$ECHO $with_jvm_features | $SED -e 's/,/ /g'`
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JVM_FEATURES" >&5
+$as_echo "$JVM_FEATURES" >&6; }
+  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$HOTSPOT_TARGET_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   [[ " $JVM_FEATURES " =~ " jvmti " ]]   && !   [[ " $JVM_FEATURES " =~ " services " ]]  ; then
+    as_fn_error $? "Specified JVM feature 'jvmti' requires feature 'services'" "$LINENO" 5
+  fi
+
+  if   [[ " $JVM_FEATURES " =~ " management " ]]   && !   [[ " $JVM_FEATURES " =~ " nmt " ]]  ; then
+    as_fn_error $? "Specified JVM feature 'management' requires feature 'nmt'" "$LINENO" 5
+  fi
+
+  if   [[ " $JVM_FEATURES " =~ " jvmci " ]]   && ! (  [[ " $JVM_FEATURES " =~ " compiler1 " ]]   ||   [[ " $JVM_FEATURES " =~ " compiler2 " ]]  ); then
+    as_fn_error $? "Specified JVM feature 'jvmci' requires feature 'compiler2' or 'compiler1'" "$LINENO" 5
+  fi
+
+  if   [[ " $JVM_FEATURES " =~ " compiler2 " ]]   && !   [[ " $JVM_FEATURES " =~ " all-gcs " ]]  ; then
+    as_fn_error $? "Specified JVM feature 'compiler2' requires feature 'all-gcs'" "$LINENO" 5
+  fi
+
+  if   [[ " $JVM_FEATURES " =~ " vm-structs " ]]   && !   [[ " $JVM_FEATURES " =~ " all-gcs " ]]  ; then
+    as_fn_error $? "Specified JVM feature 'vm-structs' requires feature 'all-gcs'" "$LINENO" 5
+  fi
+
+  # Turn on additional features based on other parts of configure
+  if test "x$INCLUDE_DTRACE" = "xtrue"; then
+    JVM_FEATURES="$JVM_FEATURES dtrace"
+  else
+    if   [[ " $JVM_FEATURES " =~ " dtrace " ]]  ; then
+      as_fn_error $? "To enable dtrace, you must use --enable-dtrace" "$LINENO" 5
+    fi
+  fi
+
+  if test "x$STATIC_BUILD" = "xtrue"; then
+    JVM_FEATURES="$JVM_FEATURES static-build"
+  else
+    if   [[ " $JVM_FEATURES " =~ " static-build " ]]  ; then
+      as_fn_error $? "To enable static-build, you must use --enable-static-build" "$LINENO" 5
+    fi
+  fi
+
+  if !   [[ " $JVM_VARIANTS " =~ " zero " ]]   && !   [[ " $JVM_VARIANTS " =~ " zeroshark " ]]  ; then
+    if   [[ " $JVM_FEATURES " =~ " zero " ]]  ; then
+      as_fn_error $? "To enable zero/zeroshark, you must use --with-jvm-variants=zero/zeroshark" "$LINENO" 5
+    fi
+  fi
+
+  if !   [[ " $JVM_VARIANTS " =~ " zeroshark " ]]  ; then
+    if   [[ " $JVM_FEATURES " =~ " shark " ]]  ; then
+      as_fn_error $? "To enable shark, you must use --with-jvm-variants=zeroshark" "$LINENO" 5
+    fi
+  fi
+
+  # Only enable jvmci on x86_64, sparcv9 and aarch64.
+  if test "x$OPENJDK_TARGET_CPU" = "xx86_64" || \
+     test "x$OPENJDK_TARGET_CPU" = "xsparcv9" || \
+     test "x$OPENJDK_TARGET_CPU" = "xaarch64" ; then
+    JVM_FEATURES_jvmci="jvmci"
+  else
+    JVM_FEATURES_jvmci=""
+  fi
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if jdk.vm.compiler should be built" >&5
+$as_echo_n "checking if jdk.vm.compiler should be built... " >&6; }
+  if   [[ " $JVM_FEATURES " =~ " graal " ]]  ; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, forced" >&5
+$as_echo "yes, forced" >&6; }
+    if test "x$JVM_FEATURES_jvmci" != "xjvmci" ; then
+      as_fn_error $? "Specified JVM feature 'graal' requires feature 'jvmci'" "$LINENO" 5
+    fi
+    INCLUDE_GRAAL="true"
+  else
+    # By default enable graal build where AOT is available
+    if test "x$ENABLE_AOT" = "xtrue"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+      JVM_FEATURES_graal="graal"
+      INCLUDE_GRAAL="true"
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+      JVM_FEATURES_graal=""
+      INCLUDE_GRAAL="false"
+    fi
+  fi
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if aot should be enabled" >&5
+$as_echo_n "checking if aot should be enabled... " >&6; }
+  if test "x$ENABLE_AOT" = "xtrue"; then
+    if test "x$enable_aot" = "xyes"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, forced" >&5
+$as_echo "yes, forced" >&6; }
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+    fi
+    JVM_FEATURES_aot="aot"
+  else
+    if test "x$enable_aot" = "xno"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, forced" >&5
+$as_echo "no, forced" >&6; }
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+    fi
+    JVM_FEATURES_aot=""
+  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"
+
+  # Enable features depending on variant.
+  JVM_FEATURES_server="compiler1 compiler2 $NON_MINIMAL_FEATURES $JVM_FEATURES $JVM_FEATURES_jvmci $JVM_FEATURES_aot $JVM_FEATURES_graal"
+  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_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"
+
+
+
+
+
+
+
+
+
+  # Used for verification of Makefiles by check-jvm-feature
+
+
+  # We don't support --with-jvm-interpreter anymore, use zero instead.
+
+
+# Check whether --with-jvm-interpreter was given.
+if test "${with_jvm_interpreter+set}" = set; then :
+  withval=$with_jvm_interpreter; { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Option --with-jvm-interpreter is deprecated and will be ignored." >&5
+$as_echo "$as_me: WARNING: Option --with-jvm-interpreter is deprecated and will be ignored." >&2;}
+fi
 
 
 
--- a/common/autoconf/help.m4	Thu Jan 12 17:46:35 2017 -0800
+++ b/common/autoconf/help.m4	Thu Jan 12 18:05:11 2017 -0800
@@ -121,6 +121,8 @@
       PKGHANDLER_COMMAND="sudo apt-get install ccache" ;;
     dtrace)
       PKGHANDLER_COMMAND="sudo apt-get install systemtap-sdt-dev" ;;
+    elf)
+      PKGHANDLER_COMMAND="sudo apt-get install libelf-dev" ;;
   esac
 }
 
@@ -140,6 +142,8 @@
       PKGHANDLER_COMMAND="sudo yum install libXtst-devel libXt-devel libXrender-devel libXi-devel" ;;
     ccache)
       PKGHANDLER_COMMAND="sudo yum install ccache" ;;
+    elf)
+      PKGHANDLER_COMMAND="sudo yum install elfutils-libelf-devel" ;;
   esac
 }
 
--- a/common/autoconf/hotspot.m4	Thu Jan 12 17:46:35 2017 -0800
+++ b/common/autoconf/hotspot.m4	Thu Jan 12 18:05:11 2017 -0800
@@ -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"
+    graal fprof vm-structs jni-check services management all-gcs nmt cds \
+    static-build link-time-opt aot"
 
 # 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
@@ -189,6 +192,55 @@
   AC_SUBST(INCLUDE_DTRACE)
 ])
 
+################################################################################
+# Check if AOT should be enabled
+#
+AC_DEFUN_ONCE([HOTSPOT_ENABLE_DISABLE_AOT],
+[
+  AC_ARG_ENABLE([aot], [AS_HELP_STRING([--enable-aot@<:@=yes/no/auto@:>@],
+      [enable ahead of time compilation feature. Default is auto, where aot is enabled if all dependencies are present.])])
+
+  if test "x$enable_aot" = "x" || test "x$enable_aot" = "xauto"; then
+    ENABLE_AOT="true"
+  elif test "x$enable_aot" = "xyes"; then
+    ENABLE_AOT="true"
+  elif test "x$enable_aot" = "xno"; then
+    ENABLE_AOT="false"
+    AC_MSG_CHECKING([if aot should be enabled])
+    AC_MSG_RESULT([no, forced])
+  else
+    AC_MSG_ERROR([Invalid value for --enable-aot: $enable_aot])
+  fi
+
+  if test "x$ENABLE_AOT" = "xtrue"; then
+    # Only enable AOT on linux-X64.
+    if test "x$OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU" = "xlinux-x86_64"; then
+      if test -e "$HOTSPOT_TOPDIR/src/jdk.aot"; then
+        if test -e "$HOTSPOT_TOPDIR/src/jdk.vm.compiler"; then
+          ENABLE_AOT="true"
+        else
+          ENABLE_AOT="false"
+          if test "x$enable_aot" = "xyes"; then
+            AC_MSG_ERROR([Cannot build AOT without hotspot/src/jdk.vm.compiler sources. Remove --enable-aot.])
+          fi
+        fi
+      else
+        ENABLE_AOT="false"
+        if test "x$enable_aot" = "xyes"; then
+          AC_MSG_ERROR([Cannot build AOT without hotspot/src/jdk.aot sources. Remove --enable-aot.])
+        fi
+      fi
+    else
+      ENABLE_AOT="false"
+      if test "x$enable_aot" = "xyes"; then
+        AC_MSG_ERROR([AOT is currently only supported on Linux-x86_64. Remove --enable-aot.])
+      fi
+    fi
+  fi
+
+  AC_SUBST(ENABLE_AOT)
+])
+
 ###############################################################################
 # Set up all JVM features for each JVM variant.
 #
@@ -204,6 +256,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$HOTSPOT_TARGET_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'])
@@ -256,21 +321,67 @@
 
   # Only enable jvmci on x86_64, sparcv9 and aarch64.
   if test "x$OPENJDK_TARGET_CPU" = "xx86_64" || \
-      test "x$OPENJDK_TARGET_CPU" = "xsparcv9" || \
-      test "x$OPENJDK_TARGET_CPU" = "xaarch64" ; then
+     test "x$OPENJDK_TARGET_CPU" = "xsparcv9" || \
+     test "x$OPENJDK_TARGET_CPU" = "xaarch64" ; then
     JVM_FEATURES_jvmci="jvmci"
   else
     JVM_FEATURES_jvmci=""
   fi
 
+  AC_MSG_CHECKING([if jdk.vm.compiler should be built])
+  if HOTSPOT_CHECK_JVM_FEATURE(graal); then
+    AC_MSG_RESULT([yes, forced])
+    if test "x$JVM_FEATURES_jvmci" != "xjvmci" ; then
+      AC_MSG_ERROR([Specified JVM feature 'graal' requires feature 'jvmci'])
+    fi
+    INCLUDE_GRAAL="true"
+  else
+    # By default enable graal build where AOT is available
+    if test "x$ENABLE_AOT" = "xtrue"; then
+      AC_MSG_RESULT([yes])
+      JVM_FEATURES_graal="graal"
+      INCLUDE_GRAAL="true"
+    else
+      AC_MSG_RESULT([no])
+      JVM_FEATURES_graal=""
+      INCLUDE_GRAAL="false"
+    fi
+  fi
+
+  AC_SUBST(INCLUDE_GRAAL)
+
+  AC_MSG_CHECKING([if aot should be enabled])
+  if test "x$ENABLE_AOT" = "xtrue"; then
+    if test "x$enable_aot" = "xyes"; then
+      AC_MSG_RESULT([yes, forced])
+    else
+      AC_MSG_RESULT([yes])
+    fi
+    JVM_FEATURES_aot="aot"
+  else
+    if test "x$enable_aot" = "xno"; then
+      AC_MSG_RESULT([no, forced])
+    else
+      AC_MSG_RESULT([no])
+    fi
+    JVM_FEATURES_aot=""
+  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"
 
   # Enable features depending on variant.
-  JVM_FEATURES_server="compiler1 compiler2 $NON_MINIMAL_FEATURES $JVM_FEATURES $JVM_FEATURES_jvmci"
+  JVM_FEATURES_server="compiler1 compiler2 $NON_MINIMAL_FEATURES $JVM_FEATURES $JVM_FEATURES_jvmci $JVM_FEATURES_aot $JVM_FEATURES_graal"
   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 +431,31 @@
 ])
 
 ################################################################################
+#
+# 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" != xarm64 && \
+        test "x$with_cpu_port" != xaarch64; then
+      AC_MSG_ERROR([--with-cpu-port must specify arm64 or aarch64])
+    fi
+    HOTSPOT_TARGET_CPU_PORT="$with_cpu_port"
+  fi
+])
+
+
+################################################################################
 # Check if gtest should be built
 #
 AC_DEFUN_ONCE([HOTSPOT_ENABLE_DISABLE_GTEST],
@@ -345,7 +481,7 @@
     AC_MSG_RESULT([no, forced])
     BUILD_GTEST="false"
   elif test "x$enable_hotspot_gtest" = "x"; then
-    if test "x$GTEST_DIR_EXISTS" = "xtrue" && test "x$OPENJDK_TARGET_OS" != "xaix"; then
+    if test "x$GTEST_DIR_EXISTS" = "xtrue"; then
       AC_MSG_RESULT([yes])
       BUILD_GTEST="true"
     else
--- a/common/autoconf/jdk-version.m4	Thu Jan 12 17:46:35 2017 -0800
+++ b/common/autoconf/jdk-version.m4	Thu Jan 12 18:05:11 2017 -0800
@@ -226,7 +226,7 @@
   else
     if test "x$NO_DEFAULT_VERSION_PARTS" != xtrue; then
       # Default is 0, if unspecified
-      VERSION_MINOR=0
+      VERSION_MINOR=$DEFAULT_VERSION_MINOR
     fi
   fi
 
@@ -248,7 +248,7 @@
   else
     if test "x$NO_DEFAULT_VERSION_PARTS" != xtrue; then
       # Default is 0, if unspecified
-      VERSION_SECURITY=0
+      VERSION_SECURITY=$DEFAULT_VERSION_SECURITY
     fi
   fi
 
@@ -270,7 +270,7 @@
   else
     if test "x$NO_DEFAULT_VERSION_PARTS" != xtrue; then
       # Default is 0, if unspecified
-      VERSION_PATCH=0
+      VERSION_PATCH=$DEFAULT_VERSION_PATCH
     fi
   fi
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/autoconf/lib-elf.m4	Thu Jan 12 18:05:11 2017 -0800
@@ -0,0 +1,129 @@
+#
+# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+################################################################################
+# Setup libelf (ELF library)
+################################################################################
+AC_DEFUN_ONCE([LIB_SETUP_LIBELF],
+[
+  AC_ARG_WITH(libelf, [AS_HELP_STRING([--with-libelf],
+      [specify prefix directory for the libelf package
+      (expecting the libraries under PATH/lib and the headers under PATH/include)])])
+  AC_ARG_WITH(libelf-include, [AS_HELP_STRING([--with-libelf-include],
+      [specify directory for the libelf include files])])
+  AC_ARG_WITH(libelf-lib, [AS_HELP_STRING([--with-libelf-lib],
+      [specify directory for the libelf library])])
+
+  if test "x$ENABLE_AOT" = xfalse; then
+    if (test "x${with_libelf}" != x && test "x${with_libelf}" != xno) || \
+        (test "x${with_libelf_include}" != x && test "x${with_libelf_include}" != xno) || \
+        (test "x${with_libelf_lib}" != x && test "x${with_libelf_lib}" != xno); then
+      AC_MSG_WARN([[libelf is not used, so --with-libelf[-*] is ignored]])
+    fi
+    LIBELF_CFLAGS=
+    LIBELF_LIBS=
+  else
+    LIBELF_FOUND=no
+
+    if test "x${with_libelf}" = xno || test "x${with_libelf_include}" = xno || test "x${with_libelf_lib}" = xno; then
+      ENABLE_AOT="false"
+      if test "x${enable_aot}" = xyes; then
+        AC_MSG_ERROR([libelf is explicitly disabled, cannot build AOT. Enable libelf or remove --enable-aot to disable AOT.])
+      fi
+    else
+      if test "x${with_libelf}" != x; then
+        ELF_LIBS="-L${with_libelf}/lib -lelf"
+        ELF_CFLAGS="-I${with_libelf}/include"
+        LIBELF_FOUND=yes
+      fi
+      if test "x${with_libelf_include}" != x; then
+        ELF_CFLAGS="-I${with_libelf_include}"
+        LIBELF_FOUND=yes
+      fi
+      if test "x${with_libelf_lib}" != x; then
+        ELF_LIBS="-L${with_libelf_lib} -lelf"
+        LIBELF_FOUND=yes
+      fi
+      # Do not try pkg-config if we have a sysroot set.
+      if test "x$SYSROOT" = x; then
+        if test "x$LIBELF_FOUND" = xno; then
+          # Figure out ELF_CFLAGS and ELF_LIBS
+          PKG_CHECK_MODULES([ELF], [libelf], [LIBELF_FOUND=yes], [LIBELF_FOUND=no])
+        fi
+      fi
+      if test "x$LIBELF_FOUND" = xno; then
+        AC_CHECK_HEADERS([libelf.h],
+            [
+              LIBELF_FOUND=yes
+              ELF_CFLAGS=
+              ELF_LIBS=-lelf
+            ],
+            [LIBELF_FOUND=no]
+        )
+      fi
+      if test "x$LIBELF_FOUND" = xno; then
+        ENABLE_AOT="false"
+        HELP_MSG_MISSING_DEPENDENCY([elf])
+        if test "x${enable_aot}" = xyes; then
+          AC_MSG_ERROR([libelf not found, cannot build AOT. Remove --enable-aot to disable AOT or: $HELP_MSG])
+        else
+          AC_MSG_WARN([libelf not found, cannot build AOT. $HELP_MSG])
+        fi
+      else
+        AC_MSG_CHECKING([if libelf works])
+        AC_LANG_PUSH(C)
+        OLD_CFLAGS="$CFLAGS"
+        CFLAGS="$CFLAGS $ELF_CFLAGS"
+        OLD_LIBS="$LIBS"
+        LIBS="$LIBS $ELF_LIBS"
+        AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <libelf.h>],
+            [
+              elf_version(0);
+              return 0;
+            ])],
+            [LIBELF_WORKS=yes],
+            [LIBELF_WORKS=no]
+        )
+        CFLAGS="$OLD_CFLAGS"
+        LIBS="$OLD_LIBS"
+        AC_LANG_POP(C)
+        AC_MSG_RESULT([$LIBELF_WORKS])
+
+        if test "x$LIBELF_WORKS" = xno; then
+          ENABLE_AOT="false"
+          HELP_MSG_MISSING_DEPENDENCY([elf])
+          if test "x$enable_aot" = "xyes"; then
+            AC_MSG_ERROR([Found libelf but could not link and compile with it. Remove --enable-aot to disable AOT or: $HELP_MSG])
+          else
+            AC_MSG_WARN([Found libelf but could not link and compile with it. $HELP_MSG])
+          fi
+        fi
+      fi
+    fi
+  fi
+
+  AC_SUBST(ELF_CFLAGS)
+  AC_SUBST(ELF_LIBS)
+])
--- a/common/autoconf/libraries.m4	Thu Jan 12 17:46:35 2017 -0800
+++ b/common/autoconf/libraries.m4	Thu Jan 12 18:05:11 2017 -0800
@@ -31,6 +31,7 @@
 m4_include([lib-freetype.m4])
 m4_include([lib-std.m4])
 m4_include([lib-x11.m4])
+m4_include([lib-elf.m4])
 
 ################################################################################
 # Determine which libraries are needed for this configuration
@@ -90,6 +91,7 @@
   LIB_SETUP_BUNDLED_LIBS
   LIB_SETUP_MISC_LIBS
   LIB_SETUP_SOLARIS_STLPORT
+  LIB_SETUP_LIBELF
 ])
 
 ################################################################################
--- a/common/autoconf/platform.m4	Thu Jan 12 17:46:35 2017 -0800
+++ b/common/autoconf/platform.m4	Thu Jan 12 18:05:11 2017 -0800
@@ -308,15 +308,6 @@
   fi
   AC_SUBST(OPENJDK_$1_CPU_LEGACY_LIB)
 
-  # This is the name of the cpu (but using i386 and amd64 instead of
-  # x86 and x86_64, respectively), preceeded by a /, to be used when
-  # locating libraries. On macosx, it's empty, though.
-  OPENJDK_$1_CPU_LIBDIR="/$OPENJDK_$1_CPU_LEGACY_LIB"
-  if test "x$OPENJDK_$1_OS" = xmacosx; then
-    OPENJDK_$1_CPU_LIBDIR=""
-  fi
-  AC_SUBST(OPENJDK_$1_CPU_LIBDIR)
-
   # OPENJDK_$1_CPU_ISADIR is normally empty. On 64-bit Solaris systems, it is set to
   # /amd64 or /sparcv9. This string is appended to some library paths, like this:
   # /usr/lib${OPENJDK_$1_CPU_ISADIR}/libexample.so
@@ -348,16 +339,6 @@
     # On all platforms except macosx, we replace x86_64 with amd64.
     OPENJDK_$1_CPU_JLI="amd64"
   fi
-  # Now setup the -D flags for building libjli.
-  OPENJDK_$1_CPU_JLI_CFLAGS="-DLIBARCHNAME='\"$OPENJDK_$1_CPU_JLI\"'"
-  if test "x$OPENJDK_$1_OS" = xsolaris; then
-    if test "x$OPENJDK_$1_CPU_ARCH" = xsparc; then
-      OPENJDK_$1_CPU_JLI_CFLAGS="$OPENJDK_$1_CPU_JLI_CFLAGS -DLIBARCH32NAME='\"sparc\"' -DLIBARCH64NAME='\"sparcv9\"'"
-    elif test "x$OPENJDK_$1_CPU_ARCH" = xx86; then
-      OPENJDK_$1_CPU_JLI_CFLAGS="$OPENJDK_$1_CPU_JLI_CFLAGS -DLIBARCH32NAME='\"i386\"' -DLIBARCH64NAME='\"amd64\"'"
-    fi
-  fi
-  AC_SUBST(OPENJDK_$1_CPU_JLI_CFLAGS)
 
   if test "x$OPENJDK_$1_OS" = xmacosx; then
       OPENJDK_$1_OS_EXPORT_DIR=macosx
--- a/common/autoconf/source-dirs.m4	Thu Jan 12 17:46:35 2017 -0800
+++ b/common/autoconf/source-dirs.m4	Thu Jan 12 18:05:11 2017 -0800
@@ -128,6 +128,8 @@
   AC_SUBST(IMPORT_MODULES_CMDS)
   AC_SUBST(IMPORT_MODULES_LIBS)
   AC_SUBST(IMPORT_MODULES_CONF)
+  AC_SUBST(IMPORT_MODULES_LEGAL)
+  AC_SUBST(IMPORT_MODULES_MAN)
   AC_SUBST(IMPORT_MODULES_SRC)
   AC_SUBST(IMPORT_MODULES_MAKE)
 ])
--- a/common/autoconf/spec.gmk.in	Thu Jan 12 17:46:35 2017 -0800
+++ b/common/autoconf/spec.gmk.in	Thu Jan 12 18:05:11 2017 -0800
@@ -75,11 +75,9 @@
 
 # Legacy support
 OPENJDK_TARGET_CPU_ISADIR:=@OPENJDK_TARGET_CPU_ISADIR@
-OPENJDK_TARGET_CPU_LIBDIR:=@OPENJDK_TARGET_CPU_LIBDIR@
 OPENJDK_TARGET_CPU_LEGACY:=@OPENJDK_TARGET_CPU_LEGACY@
 OPENJDK_TARGET_CPU_LEGACY_LIB:=@OPENJDK_TARGET_CPU_LEGACY_LIB@
 OPENJDK_TARGET_CPU_OSARCH:=@OPENJDK_TARGET_CPU_OSARCH@
-OPENJDK_TARGET_CPU_JLI_CFLAGS:=@OPENJDK_TARGET_CPU_JLI_CFLAGS@
 OPENJDK_TARGET_OS_EXPORT_DIR:=@OPENJDK_TARGET_OS_EXPORT_DIR@
 
 HOTSPOT_TARGET_OS := @HOTSPOT_TARGET_OS@
@@ -687,6 +685,7 @@
 TAR_SUPPORTS_TRANSFORM:=@TAR_SUPPORTS_TRANSFORM@
 
 # Build setup
+ENABLE_AOT:=@ENABLE_AOT@
 ENABLE_JFR=@ENABLE_JFR@
 ENABLE_INTREE_EC=@ENABLE_INTREE_EC@
 USE_EXTERNAL_LIBJPEG:=@USE_EXTERNAL_LIBJPEG@
@@ -761,6 +760,8 @@
 PNG_LIBS:=@PNG_LIBS@
 PNG_CFLAGS:=@PNG_CFLAGS@
 
+ELF_CFLAGS:=@ELF_CFLAGS@
+ELF_LIBS:=@ELF_LIBS@
 
 ####################################################
 #
@@ -768,6 +769,7 @@
 #
 
 INCLUDE_SA=@INCLUDE_SA@
+INCLUDE_GRAAL=@INCLUDE_GRAAL@
 
 OS_VERSION_MAJOR:=@OS_VERSION_MAJOR@
 OS_VERSION_MINOR:=@OS_VERSION_MINOR@
--- a/common/autoconf/version-numbers	Thu Jan 12 17:46:35 2017 -0800
+++ b/common/autoconf/version-numbers	Thu Jan 12 18:05:11 2017 -0800
@@ -26,6 +26,9 @@
 # Default version numbers to use unless overridden by configure
 
 DEFAULT_VERSION_MAJOR=9
+DEFAULT_VERSION_MINOR=0
+DEFAULT_VERSION_SECURITY=0
+DEFAULT_VERSION_PATCH=0
 
 LAUNCHER_NAME=openjdk
 PRODUCT_NAME=OpenJDK
--- a/common/bin/compare_exceptions.sh.incl	Thu Jan 12 17:46:35 2017 -0800
+++ b/common/bin/compare_exceptions.sh.incl	Thu Jan 12 18:05:11 2017 -0800
@@ -57,21 +57,21 @@
       ./demo/jvmti/mtrace/lib/libmtrace.so
       ./demo/jvmti/versionCheck/lib/libversionCheck.so
       ./demo/jvmti/waiters/lib/libwaiters.so
-      ./lib$OPENJDK_TARGET_CPU_LIBDIR/client/libjsig.so
-      ./lib$OPENJDK_TARGET_CPU_LIBDIR/client/libjvm.so
-      ./lib$OPENJDK_TARGET_CPU_LIBDIR/libattach.so
-      ./lib$OPENJDK_TARGET_CPU_LIBDIR/libdt_socket.so
-      ./lib$OPENJDK_TARGET_CPU_LIBDIR/libinstrument.so
-      ./lib$OPENJDK_TARGET_CPU_LIBDIR/libjsdt.so
-      ./lib$OPENJDK_TARGET_CPU_LIBDIR/libjsig.so
-      ./lib$OPENJDK_TARGET_CPU_LIBDIR/libmanagement.so
-      ./lib$OPENJDK_TARGET_CPU_LIBDIR/libnet.so
-      ./lib$OPENJDK_TARGET_CPU_LIBDIR/libnpt.so
-      ./lib$OPENJDK_TARGET_CPU_LIBDIR/libverify.so
-      ./lib$OPENJDK_TARGET_CPU_LIBDIR/minimal/libjsig.so
-      ./lib$OPENJDK_TARGET_CPU_LIBDIR/minimal/libjvm.so
-      ./lib$OPENJDK_TARGET_CPU_LIBDIR/server/libjsig.so
-      ./lib$OPENJDK_TARGET_CPU_LIBDIR/server/libjvm.so
+      ./lib/client/libjsig.so
+      ./lib/client/libjvm.so
+      ./lib/libattach.so
+      ./lib/libdt_socket.so
+      ./lib/libinstrument.so
+      ./lib/libjsdt.so
+      ./lib/libjsig.so
+      ./lib/libmanagement.so
+      ./lib/libnet.so
+      ./lib/libnpt.so
+      ./lib/libverify.so
+      ./lib/minimal/libjsig.so
+      ./lib/minimal/libjvm.so
+      ./lib/server/libjsig.so
+      ./lib/server/libjvm.so
       ./bin/appletviewer
       ./bin/idlj
       ./bin/jar
@@ -122,12 +122,12 @@
     # So for now, accept the difference but put a limit on the size. The
     # different order of functions shouldn't result in a very big diff.
     KNOWN_FULLDUMP_DIFF="
-        ./lib$OPENJDK_TARGET_CPU_LIBDIR/minimal/libjvm.so
+        ./lib/minimal/libjvm.so
         "
 
     # Link time optimization adds random numbers to symbol names
     NEED_DIS_DIFF_FILTER="
-        ./lib$OPENJDK_TARGET_CPU_LIBDIR/minimal/libjvm.so
+        ./lib/minimal/libjvm.so
         "
     DIS_DIFF_FILTER="$SED -r \
         -e 's/\.[0-9]+/.X/g' \
@@ -135,12 +135,12 @@
         -e 's/\t[0-9a-f]{5,} /\t<HEX> /' \
         "
     KNOWN_DIS_DIFF="
-        ./lib$OPENJDK_TARGET_CPU_LIBDIR/minimal/libjvm.so
+        ./lib/minimal/libjvm.so
         "
     MAX_KNOWN_DIS_DIFF_SIZE="3000"
 
     NEED_SYMBOLS_DIFF_FILTER="
-        ./lib$OPENJDK_TARGET_CPU_LIBDIR/minimal/libjvm.so
+        ./lib/minimal/libjvm.so
         "
     SYMBOLS_DIFF_FILTER="$SED -r \
         -e 's/\.[0-9]+/.X/g'
@@ -163,11 +163,11 @@
       "
 
   SORT_SYMBOLS="
-      ./lib/amd64/server/libjvm.so
-      ./lib/amd64/libfontmanager.so
-      ./lib/amd64/libjimage.so
-      ./lib/amd64/libsaproc.so
-      ./lib/amd64/libunpack.so
+      ./lib/server/libjvm.so
+      ./lib/libfontmanager.so
+      ./lib/libjimage.so
+      ./lib/libsaproc.so
+      ./lib/libunpack.so
       ./bin/unpack200
       "
 
@@ -183,48 +183,48 @@
       ./demo/jvmti/mtrace/lib/libmtrace.so
       ./demo/jvmti/versionCheck/lib/libversionCheck.so
       ./demo/jvmti/waiters/lib/libwaiters.so
-      ./lib/amd64/jli/libjli.so
-      ./lib/amd64/jspawnhelper
-      ./lib/amd64/libJdbcOdbc.so
-      ./lib/amd64/libattach.so
-      ./lib/amd64/libawt.so
-      ./lib/amd64/libawt_headless.so
-      ./lib/amd64/libawt_xawt.so
-      ./lib/amd64/libdcpr.so
-      ./lib/amd64/libdt_socket.so
-      ./lib/amd64/libfontmanager.so
-      ./lib/amd64/libinstrument.so
-      ./lib/amd64/libj2gss.so
-      ./lib/amd64/libj2pcsc.so
-      ./lib/amd64/libj2pkcs11.so
-      ./lib/amd64/libj2ucrypto.so
-      ./lib/amd64/libjaas_unix.so
-      ./lib/amd64/libjava.so
-      ./lib/amd64/libjawt.so
-      ./lib/amd64/libjdwp.so
-      ./lib/amd64/libjpeg.so
-      ./lib/amd64/libjsdt.so
-      ./lib/amd64/libjsound.so
-      ./lib/amd64/libkcms.so
-      ./lib/amd64/liblcms.so
-      ./lib/amd64/libmanagement.so
-      ./lib/amd64/libmlib_image.so
-      ./lib/amd64/libnet.so
-      ./lib/amd64/libnio.so
-      ./lib/amd64/libnpt.so
-      ./lib/amd64/libsctp.so
-      ./lib/amd64/libsplashscreen.so
-      ./lib/amd64/libsunec.so
-      ./lib/amd64/libsunwjdga.so
-      ./lib/amd64/libt2k.so
-      ./lib/amd64/libunpack.so
-      ./lib/amd64/libverify.so
-      ./lib/amd64/libzip.so
-      ./lib/amd64/server/64/libjvm_db.so
-      ./lib/amd64/server/64/libjvm_dtrace.so
-      ./lib/amd64/server/libjvm.so
-      ./lib/amd64/server/libjvm_db.so
-      ./lib/amd64/server/libjvm_dtrace.so
+      ./lib/jli/libjli.so
+      ./lib/jspawnhelper
+      ./lib/libJdbcOdbc.so
+      ./lib/libattach.so
+      ./lib/libawt.so
+      ./lib/libawt_headless.so
+      ./lib/libawt_xawt.so
+      ./lib/libdcpr.so
+      ./lib/libdt_socket.so
+      ./lib/libfontmanager.so
+      ./lib/libinstrument.so
+      ./lib/libj2gss.so
+      ./lib/libj2pcsc.so
+      ./lib/libj2pkcs11.so
+      ./lib/libj2ucrypto.so
+      ./lib/libjaas_unix.so
+      ./lib/libjava.so
+      ./lib/libjawt.so
+      ./lib/libjdwp.so
+      ./lib/libjpeg.so
+      ./lib/libjsdt.so
+      ./lib/libjsound.so
+      ./lib/libkcms.so
+      ./lib/liblcms.so
+      ./lib/libmanagement.so
+      ./lib/libmlib_image.so
+      ./lib/libnet.so
+      ./lib/libnio.so
+      ./lib/libnpt.so
+      ./lib/libsctp.so
+      ./lib/libsplashscreen.so
+      ./lib/libsunec.so
+      ./lib/libsunwjdga.so
+      ./lib/libt2k.so
+      ./lib/libunpack.so
+      ./lib/libverify.so
+      ./lib/libzip.so
+      ./lib/server/64/libjvm_db.so
+      ./lib/server/64/libjvm_dtrace.so
+      ./lib/server/libjvm.so
+      ./lib/server/libjvm_db.so
+      ./lib/server/libjvm_dtrace.so
       ./bin/appletviewer
       ./bin/idlj
       ./bin/jar
@@ -292,13 +292,13 @@
 
   SORT_SYMBOLS="
       ./demo/jvmti/waiters/lib/libwaiters.so
-      ./lib/sparcv9/libjsig.so
-      ./lib/sparcv9/libfontmanager.so
-      ./lib/sparcv9/libjimage.so
-      ./lib/sparcv9/libsaproc.so
-      ./lib/sparcv9/libunpack.so
-      ./lib/sparcv9/server/libjvm.so
-      ./lib/sparcv9/server/libjvm_dtrace.so
+      ./lib/libjsig.so
+      ./lib/libfontmanager.so
+      ./lib/libjimage.so
+      ./lib/libsaproc.so
+      ./lib/libunpack.so
+      ./lib/server/libjvm.so
+      ./lib/server/libjvm_dtrace.so
       ./bin/unpack200
       "
 
@@ -314,46 +314,46 @@
       ./demo/jvmti/mtrace/lib/libmtrace.so
       ./demo/jvmti/versionCheck/lib/libversionCheck.so
       ./demo/jvmti/waiters/lib/libwaiters.so
-      ./lib/sparcv9/client/libjvm.so
-      ./lib/sparcv9/jli/libjli.so
-      ./lib/sparcv9/jspawnhelper
-      ./lib/sparcv9/libJdbcOdbc.so
-      ./lib/sparcv9/libattach.so
-      ./lib/sparcv9/libawt.so
-      ./lib/sparcv9/libawt_headless.so
-      ./lib/sparcv9/libawt_xawt.so
-      ./lib/sparcv9/libdcpr.so
-      ./lib/sparcv9/libdt_socket.so
-      ./lib/sparcv9/libfontmanager.so
-      ./lib/sparcv9/libinstrument.so
-      ./lib/sparcv9/libj2gss.so
-      ./lib/sparcv9/libj2pcsc.so
-      ./lib/sparcv9/libj2pkcs11.so
-      ./lib/sparcv9/libj2ucrypto.so
-      ./lib/sparcv9/libjaas_unix.so
-      ./lib/sparcv9/libjava.so
-      ./lib/sparcv9/libjawt.so
-      ./lib/sparcv9/libjdwp.so
-      ./lib/sparcv9/libjpeg.so
-      ./lib/sparcv9/libjsdt.so
-      ./lib/sparcv9/libjsound.so
-      ./lib/sparcv9/libkcms.so
-      ./lib/sparcv9/liblcms.so
-      ./lib/sparcv9/libmanagement.so
-      ./lib/sparcv9/libmlib_image.so
-      ./lib/sparcv9/libmlib_image_v.so
-      ./lib/sparcv9/libnet.so
-      ./lib/sparcv9/libnio.so
-      ./lib/sparcv9/libnpt.so
-      ./lib/sparcv9/libsctp.so
-      ./lib/sparcv9/libsplashscreen.so
-      ./lib/sparcv9/libsunec.so
-      ./lib/sparcv9/libsunwjdga.so
-      ./lib/sparcv9/libt2k.so
-      ./lib/sparcv9/libunpack.so
-      ./lib/sparcv9/libverify.so
-      ./lib/sparcv9/libzip.so
-      ./lib/sparcv9/server/libjvm.so
+      ./lib/client/libjvm.so
+      ./lib/jli/libjli.so
+      ./lib/jspawnhelper
+      ./lib/libJdbcOdbc.so
+      ./lib/libattach.so
+      ./lib/libawt.so
+      ./lib/libawt_headless.so
+      ./lib/libawt_xawt.so
+      ./lib/libdcpr.so
+      ./lib/libdt_socket.so
+      ./lib/libfontmanager.so
+      ./lib/libinstrument.so
+      ./lib/libj2gss.so
+      ./lib/libj2pcsc.so
+      ./lib/libj2pkcs11.so
+      ./lib/libj2ucrypto.so
+      ./lib/libjaas_unix.so
+      ./lib/libjava.so
+      ./lib/libjawt.so
+      ./lib/libjdwp.so
+      ./lib/libjpeg.so
+      ./lib/libjsdt.so
+      ./lib/libjsound.so
+      ./lib/libkcms.so
+      ./lib/liblcms.so
+      ./lib/libmanagement.so
+      ./lib/libmlib_image.so
+      ./lib/libmlib_image_v.so
+      ./lib/libnet.so
+      ./lib/libnio.so
+      ./lib/libnpt.so
+      ./lib/libsctp.so
+      ./lib/libsplashscreen.so
+      ./lib/libsunec.so
+      ./lib/libsunwjdga.so
+      ./lib/libt2k.so
+      ./lib/libunpack.so
+      ./lib/libverify.so
+      ./lib/libzip.so
+      ./lib/server/libjvm.so
       ./bin/appletviewer
       ./bin/idlj
       ./bin/jar
@@ -409,7 +409,7 @@
       "
 
   KNOWN_DIS_DIFF="
-      ./lib/sparcv9/libsaproc.so
+      ./lib/libsaproc.so
   "
 
   MAX_KNOWN_DIS_DIFF_SIZE="3000"
@@ -417,8 +417,8 @@
   # On slowdebug the disassembly can differ randomly.
   if [ "$DEBUG_LEVEL" = "slowdebug" ]; then
     ACCEPTED_DIS_DIFF="
-        ./lib/sparcv9/libfontmanager.so
-        ./lib/sparcv9/server/libjvm.so
+        ./lib/libfontmanager.so
+        ./lib/server/libjvm.so
     "
   fi
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/bin/print-config.js	Thu Jan 12 18:05:11 2017 -0800
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * This little utility can be used to expand the jib-profiles configuration
+ * files into plain json.
+ *
+ * Usage:
+ *
+ *   jjs -scripting print-config.js -- [<jib-profiles.js>]
+ *
+ */
+
+var file = $ARG[0];
+if (file == null) {
+    file = new java.io.File(__DIR__, "../conf/jib-profiles.js").getCanonicalPath();
+}
+load(file);
+var input = {};
+input.get = function(dependencyName, attribute) {
+    return "\${" + dependencyName + "." + attribute + "}";
+};
+print(JSON.stringify(getJibProfiles(input), null, 2));
--- a/common/bin/unshuffle_list.txt	Thu Jan 12 17:46:35 2017 -0800
+++ b/common/bin/unshuffle_list.txt	Thu Jan 12 18:05:11 2017 -0800
@@ -28,6 +28,11 @@
 corba/src/java.corba/share/classes/javax/rmi : corba/src/share/classes/javax/rmi
 corba/src/java.corba/share/classes/org/omg : corba/src/share/classes/org/omg
 corba/src/java.corba/share/classes/sun/corba : corba/src/share/classes/sun/corba
+corba/src/java.corba/share/classes/com/sun/jndi/cosnaming : jdk/src/share/classes/com/sun/jndi/cosnaming
+corba/src/java.corba/share/classes/com/sun/jndi/toolkit/corba : jdk/src/share/classes/com/sun/jndi/toolkit/corba
+corba/src/java.corba/share/classes/com/sun/jndi/url/corbaname : jdk/src/share/classes/com/sun/jndi/url/corbaname
+corba/src/java.corba/share/classes/com/sun/jndi/url/iiop : jdk/src/share/classes/com/sun/jndi/url/iiop
+corba/src/java.corba/share/classes/com/sun/jndi/url/iiopname : jdk/src/share/classes/com/sun/jndi/url/iiopname
 corba/src/jdk.rmic/share/classes/sun/rmi/rmic/iiop : corba/src/share/classes/sun/rmi/rmic/iiop
 jaxp/src/java.xml/share/classes/com/sun/java_cup/internal/runtime : jaxp/src/com/sun/java_cup/internal/runtime
 jaxp/src/java.xml/share/classes/com/sun/org/apache/bcel/internal : jaxp/src/com/sun/org/apache/bcel/internal
@@ -516,11 +521,6 @@
 jdk/src/java.base/windows/native/libnio/ch : jdk/src/windows/native/sun/nio/ch
 jdk/src/java.base/windows/native/libnio/fs : jdk/src/windows/native/sun/nio/fs
 jdk/src/java.base/windows/native/libnio/MappedByteBuffer.c : jdk/src/windows/native/java/nio/MappedByteBuffer.c
-jdk/src/java.corba/share/classes/com/sun/jndi/cosnaming : jdk/src/share/classes/com/sun/jndi/cosnaming
-jdk/src/java.corba/share/classes/com/sun/jndi/toolkit/corba : jdk/src/share/classes/com/sun/jndi/toolkit/corba
-jdk/src/java.corba/share/classes/com/sun/jndi/url/corbaname : jdk/src/share/classes/com/sun/jndi/url/corbaname
-jdk/src/java.corba/share/classes/com/sun/jndi/url/iiop : jdk/src/share/classes/com/sun/jndi/url/iiop
-jdk/src/java.corba/share/classes/com/sun/jndi/url/iiopname : jdk/src/share/classes/com/sun/jndi/url/iiopname
 jdk/src/java.desktop/aix/native/libawt : jdk/src/aix/porting
 jdk/src/java.desktop/linux/conf/oblique-fonts/fonts.dir : jdk/src/solaris/classes/sun/awt/motif/java.oblique-fonts.dir
 jdk/src/java.desktop/macosx/classes/com/apple/eawt/event/package.html : jdk/src/macosx/classes/com/apple/eawt/event/package.html
--- a/common/conf/jib-profiles.js	Thu Jan 12 17:46:35 2017 -0800
+++ b/common/conf/jib-profiles.js	Thu Jan 12 18:05:11 2017 -0800
@@ -55,6 +55,7 @@
  * be provided:
  *
  * input.profile
+ * input.build_id
  * input.target_os
  * input.target_cpu
  * input.build_os
@@ -181,11 +182,14 @@
 
     var data = {};
 
-    // Identifies the version of this format to the tool reading it
-    data.format_version = "1.0";
+    // Identifies the version of this format to the tool reading it.
+    // 1.1 signifies that the publish, publish-src and get-src features are usable.
+    data.format_version = "1.1";
 
-    // Organization is used when uploading/publishing build results
-    data.organization = "com.oracle.jpg.jdk";
+    // Organization, product and version are used when uploading/publishing build results
+    data.organization = "";
+    data.product = "jdk";
+    data.version = getVersion();
 
     // The base directory for the build output. JIB will assume that the
     // actual build directory will be <output_basedir>/<configuration>
@@ -195,12 +199,18 @@
     // The make argument to use to specify the name of the configuration
     data.configuration_make_arg = "CONF_NAME=";
 
+    // Exclude list to use when Jib creates a source bundle
+    data.src_bundle_excludes = "./build webrev .hg */.hg */*/.hg */*/*/.hg";
+    // Include list to use when creating a minimal jib source bundle which
+    // contains just the jib configuration files.
+    data.conf_bundle_includes = "*/conf/jib-profiles.* common/autoconf/version-numbers"
+
     // Define some common values
-    var common = getJibProfilesCommon(input);
+    var common = getJibProfilesCommon(input, data);
     // Generate the profiles part of the configuration
-    data.profiles = getJibProfilesProfiles(input, common);
+    data.profiles = getJibProfilesProfiles(input, common, data);
     // Generate the dependencies part of the configuration
-    data.dependencies = getJibProfilesDependencies(input, common);
+    data.dependencies = getJibProfilesDependencies(input, common, data);
 
     return data;
 };
@@ -211,18 +221,168 @@
  * @param input External data to use for generating the configuration
  * @returns Common values
  */
-var getJibProfilesCommon = function (input) {
+var getJibProfilesCommon = function (input, data) {
     var common = {};
 
-    common.dependencies = ["boot_jdk", "gnumake", "jtreg"],
-    common.default_make_targets = ["product-bundles", "test-bundles"],
-    common.default_make_targets_debug = common.default_make_targets;
-    common.default_make_targets_slowdebug = common.default_make_targets;
-    common.configure_args = ["--enable-jtreg-failure-handler"],
-    common.configure_args_32bit = ["--with-target-bits=32"],
-    common.configure_args_debug = ["--enable-debug"],
-    common.configure_args_slowdebug = ["--with-debug-level=slowdebug"],
-    common.organization = "jpg.infra.builddeps"
+    common.organization = "jpg.infra.builddeps";
+    common.build_id = getBuildId(input);
+    common.build_number = input.build_number != null ? input.build_number : "0";
+
+    // List of the main profile names used for iteration
+    common.main_profile_names = [
+        "linux-x64", "linux-x86", "macosx-x64", "solaris-x64",
+        "solaris-sparcv9", "windows-x64", "windows-x86"
+    ];
+
+    // These are the base setttings for all the main build profiles.
+    common.main_profile_base = {
+        dependencies: ["boot_jdk", "gnumake", "jtreg"],
+        default_make_targets: ["product-bundles", "test-bundles"],
+        configure_args: [
+            "--with-version-opt=" + common.build_id,
+            "--enable-jtreg-failure-handler",
+            "--with-version-build=" + common.build_number
+        ]
+    };
+    // Extra settings for debug profiles
+    common.debug_suffix = "-debug";
+    common.debug_profile_base = {
+        configure_args: ["--enable-debug"],
+        labels: "debug"
+    };
+    // Extra settings for slowdebug profiles
+    common.slowdebug_suffix = "-slowdebug";
+    common.slowdebug_profile_base = {
+        configure_args: ["--with-debug-level=slowdebug"],
+        labels: "slowdebug"
+    };
+    // Extra settings for openjdk only profiles
+    common.open_suffix = "-open";
+    common.open_profile_base = {
+        configure_args: ["--enable-openjdk-only"],
+        labels: "open"
+    };
+
+    common.configure_args_32bit = ["--with-target-bits=32"];
+
+    /**
+     * Define common artifacts template for all main profiles
+     * @param pf - Name of platform in bundle names
+     * @param demo_ext - Type of extension for demo bundle
+     */
+    common.main_profile_artifacts = function (pf, demo_ext) {
+        return {
+            artifacts: {
+                jdk: {
+                    local: "bundles/\\(jdk.*bin.tar.gz\\)",
+                    remote: [
+                        "bundles/" + pf + "/jdk-" + data.version + "_" + pf + "_bin.tar.gz",
+                        "bundles/" + pf + "/\\1"
+                    ],
+                    subdir: "jdk-" + data.version,
+                    exploded: "images/jdk"
+                },
+                jre: {
+                    local: "bundles/\\(jre.*bin.tar.gz\\)",
+                    remote: [
+                        "bundles/" + pf + "/jre-" + data.version + "_" + pf + "_bin.tar.gz",
+                        "bundles/" + pf + "/\\1"
+                    ],
+                    subdir: "jre-" + data.version,
+                    exploded: "images/jre"
+                },
+                test: {
+                    local: "bundles/\\(jdk.*bin-tests.tar.gz\\)",
+                    remote: [
+                        "bundles/" + pf + "/jdk-" + data.version + "_" + pf + "_bin-tests.tar.gz",
+                        "bundles/" + pf + "/\\1"
+                    ],
+                    exploded: "images/test"
+                },
+                jdk_symbols: {
+                    local: "bundles/\\(jdk.*bin-symbols.tar.gz\\)",
+                    remote: [
+                        "bundles/" + pf + "/jdk-" + data.version + "_" + pf + "_bin-symbols.tar.gz",
+                        "bundles/" + pf + "/\\1"
+                    ],
+                    subdir: "jdk-" + data.version,
+                    exploded: "images/jdk"
+                },
+                jre_symbols: {
+                    local: "bundles/\\(jre.*bin-symbols.tar.gz\\)",
+                    remote: [
+                        "bundles/" + pf + "/jre-" + data.version + "_" + pf + "_bin-symbols.tar.gz",
+                        "bundles/" + pf + "/\\1"
+                    ],
+                    subdir: "jre-" + data.version,
+                    exploded: "images/jre"
+                },
+                demo: {
+                    local: "bundles/\\(jdk.*demo." + demo_ext + "\\)",
+                    remote: [
+                        "bundles/" + pf + "/jdk-" + data.version + "_" + pf + "_demo." + demo_ext,
+                        "bundles/" + pf + "/\\1"
+                    ],
+                }
+            }
+        };
+    };
+
+
+    /**
+     * Define common artifacts template for all debug profiles
+     * @param pf - Name of platform in bundle names
+     */
+    common.debug_profile_artifacts = function (pf) {
+        return {
+            artifacts: {
+                jdk: {
+                    local: "bundles/\\(jdk.*bin-debug.tar.gz\\)",
+                    remote: [
+                        "bundles/" + pf + "/jdk-" + data.version + "_" + pf + "_bin-debug.tar.gz",
+                        "bundles/" + pf + "/\\1"
+                    ],
+                    subdir: "jdk-" + data.version,
+                    exploded: "images/jdk"
+                },
+                jre: {
+                    local: "bundles/\\(jre.*bin-debug.tar.gz\\)",
+                    remote: [
+                        "bundles/" + pf + "/jre-" + data.version + "_" + pf + "_bin-debug.tar.gz",
+                        "bundles/" + pf + "/\\1"
+                    ],
+                    subdir: "jre-" + data.version,
+                    exploded: "images/jre"
+                },
+                test: {
+                    local: "bundles/\\(jdk.*bin-tests-debug.tar.gz\\)",
+                    remote: [
+                        "bundles/" + pf + "/jdk-" + data.version + "_" + pf + "_bin-tests-debug.tar.gz",
+                        "bundles/" + pf + "/\\1"
+                    ],
+                    exploded: "images/test"
+                },
+                jdk_symbols: {
+                    local: "bundles/\\(jdk.*bin-debug-symbols.tar.gz\\)",
+                    remote: [
+                        "bundles/" + pf + "/jdk-" + data.version + "_" + pf + "_bin-debug-symbols.tar.gz",
+                        "bundles/" + pf + "/\\1"
+                    ],
+                    subdir: "jdk-" + data.version,
+                    exploded: "images/jdk"
+                },
+                jre_symbols: {
+                    local: "bundles/\\(jre.*bin-debug-symbols.tar.gz\\)",
+                    remote: [
+                        "bundles/" + pf + "/jre-" + data.version + "_" + pf + "_bin-debug-symbols.tar.gz",
+                        "bundles/" + pf + "/\\1"
+                    ],
+                    subdir: "jre-" + data.version,
+                    exploded: "images/jre"
+                }
+            }
+        };
+    };
 
     var boot_jdk_revision = "8";
     var boot_jdk_subdirpart = "1.8.0";
@@ -251,100 +411,105 @@
  * @param common The common values
  * @returns {{}} Profiles part of the configuration
  */
-var getJibProfilesProfiles = function (input, common) {
-    var profiles = {};
-
+var getJibProfilesProfiles = function (input, common, data) {
     // Main SE profiles
-    var mainProfiles = {
+    var profiles = {
 
         "linux-x64": {
             target_os: "linux",
             target_cpu: "x64",
-            dependencies: concat(common.dependencies, "devkit"),
-            configure_args: concat(common.configure_args, "--with-zlib=system"),
-            default_make_targets: concat(common.default_make_targets, "docs-bundles")
+            dependencies: ["devkit"],
+            configure_args: ["--with-zlib=system"],
+            default_make_targets: ["docs-bundles"],
         },
 
         "linux-x86": {
             target_os: "linux",
             target_cpu: "x86",
             build_cpu: "x64",
-            dependencies: concat(common.dependencies, "devkit"),
-            configure_args: concat(common.configure_args, common.configure_args_32bit,
+            dependencies: ["devkit"],
+            configure_args: concat(common.configure_args_32bit,
                 "--with-jvm-variants=minimal,server", "--with-zlib=system"),
-            default_make_targets: common.default_make_targets
         },
 
         "macosx-x64": {
             target_os: "macosx",
             target_cpu: "x64",
-            dependencies: concat(common.dependencies, "devkit"),
+            dependencies: ["devkit"],
             configure_args: concat(common.configure_args, "--with-zlib=system"),
-            default_make_targets: common.default_make_targets
         },
 
         "solaris-x64": {
             target_os: "solaris",
             target_cpu: "x64",
-            dependencies: concat(common.dependencies, "devkit", "cups"),
-            configure_args: concat(common.configure_args, "--with-zlib=system",
-                "--enable-dtrace"),
-            default_make_targets: common.default_make_targets
+            dependencies: ["devkit", "cups"],
+            configure_args: ["--with-zlib=system", "--enable-dtrace"],
         },
 
         "solaris-sparcv9": {
             target_os: "solaris",
             target_cpu: "sparcv9",
-            dependencies: concat(common.dependencies, "devkit", "cups"),
-            configure_args: concat(common.configure_args, "--with-zlib=system",
-                "--enable-dtrace"),
-            default_make_targets: common.default_make_targets
+            dependencies: ["devkit", "cups"],
+            configure_args: ["--with-zlib=system", "--enable-dtrace"],
         },
 
         "windows-x64": {
             target_os: "windows",
             target_cpu: "x64",
-            dependencies: concat(common.dependencies, "devkit", "freetype"),
-            configure_args: concat(common.configure_args),
-            default_make_targets: common.default_make_targets
+            dependencies: ["devkit", "freetype"],
         },
 
         "windows-x86": {
             target_os: "windows",
             target_cpu: "x86",
             build_cpu: "x64",
-            dependencies: concat(common.dependencies, "devkit", "freetype"),
-            configure_args: concat(common.configure_args, common.configure_args_32bit),
-            default_make_targets: common.default_make_targets
+            dependencies: ["devkit", "freetype"],
+            configure_args: concat(common.configure_args_32bit),
         }
     };
-    profiles = concatObjects(profiles, mainProfiles);
+    // Add the base settings to all the main profiles
+    common.main_profile_names.forEach(function (name) {
+        profiles[name] = concatObjects(common.main_profile_base, profiles[name]);
+    });
+
     // Generate debug versions of all the main profiles
-    profiles = concatObjects(profiles, generateDebugProfiles(common, mainProfiles));
+    common.main_profile_names.forEach(function (name) {
+        var debugName = name + common.debug_suffix;
+        profiles[debugName] = concatObjects(profiles[name],
+                                            common.debug_profile_base);
+    });
     // Generate slowdebug versions of all the main profiles
-    profiles = concatObjects(profiles, generateSlowdebugProfiles(common, mainProfiles));
+    common.main_profile_names.forEach(function (name) {
+        var debugName = name + common.slowdebug_suffix;
+        profiles[debugName] = concatObjects(profiles[name],
+                                            common.slowdebug_profile_base);
+    });
 
     // Generate open only profiles for all the main profiles for JPRT and reference
     // implementation builds.
-    var openOnlyProfiles = generateOpenOnlyProfiles(common, mainProfiles);
+    common.main_profile_names.forEach(function (name) {
+        var openName = name + common.open_suffix;
+        profiles[openName] = concatObjects(profiles[name],
+                                           common.open_profile_base);
+    });
     // The open only profiles on linux are used for reference builds and should
     // produce the compact profile images by default. This adds "profiles" as an
     // extra default target.
     var openOnlyProfilesExtra = {
-        "linux-x64-open": {
-            default_make_targets: "profiles"
-        },
-
         "linux-x86-open": {
             default_make_targets: "profiles",
             configure_args: "--with-jvm-variants=client,server"
         }
     };
-    var openOnlyProfiles = concatObjects(openOnlyProfiles, openOnlyProfilesExtra);
+    profiles = concatObjects(profiles, openOnlyProfilesExtra);
 
-    profiles = concatObjects(profiles, openOnlyProfiles);
-    // Generate debug profiles for the open jprt profiles
-    profiles = concatObjects(profiles, generateDebugProfiles(common, openOnlyProfiles));
+    // Generate debug profiles for the open only profiles
+    common.main_profile_names.forEach(function (name) {
+        var openName = name + common.open_suffix;
+        var openDebugName = openName + common.debug_suffix;
+        profiles[openDebugName] = concatObjects(profiles[openName],
+                                                common.debug_profile_base);
+    });
 
     // Profiles for building the zero jvm variant. These are used for verification
     // in JPRT.
@@ -352,31 +517,46 @@
         "linux-x64-zero": {
             target_os: "linux",
             target_cpu: "x64",
-            dependencies: concat(common.dependencies, "devkit"),
-            configure_args: concat(common.configure_args,
+            dependencies: ["devkit"],
+            configure_args: [
                 "--with-zlib=system",
                 "--with-jvm-variants=zero",
-                "--enable-libffi-bundling"),
-            default_make_targets: common.default_make_targets
+                "--enable-libffi-bundling"
+            ]
         },
 
         "linux-x86-zero": {
             target_os: "linux",
             target_cpu: "x86",
             build_cpu: "x64",
-            dependencies: concat(common.dependencies, "devkit"),
-            configure_args: concat(common.configure_args, common.configure_args_32bit,
+            dependencies: ["devkit"],
+            configure_args:  concat(common.configure_args_32bit, [
                 "--with-zlib=system",
                 "--with-jvm-variants=zero",
-                "--enable-libffi-bundling"),
-            default_make_targets: common.default_make_targets
-        },
+                "--enable-libffi-bundling"
+            ])
+        }
     }
     profiles = concatObjects(profiles, zeroProfiles);
-    profiles = concatObjects(profiles, generateDebugProfiles(common, zeroProfiles));
 
-    // Profiles used to run tests. Used in JPRT.
+    // Add the base settings to the zero profiles and generate debug profiles
+    Object.keys(zeroProfiles).forEach(function (name) {
+        var debugName = name + common.debug_suffix;
+        profiles[name] = concatObjects(common.main_profile_base, profiles[name]);
+        profiles[debugName] = concatObjects(profiles[name], common.debug_profile_base);
+    });
+
+    // Profiles used to run tests. Used in JPRT and Mach 5.
     var testOnlyProfiles = {
+        "run-test-jprt": {
+            target_os: input.build_os,
+            target_cpu: input.build_cpu,
+            dependencies: [ "jtreg", "gnumake", "boot_jdk" ],
+            labels: "test",
+            environment: {
+                "JT_JAVA": common.boot_jdk_home
+            }
+        },
 
         "run-test": {
             target_os: input.build_os,
@@ -390,6 +570,230 @@
     };
     profiles = concatObjects(profiles, testOnlyProfiles);
 
+    // Profiles used to run tests using Jib for internal dependencies.
+    var testedProfile = input.testedProfile;
+    if (testedProfile == null) {
+        testedProfile = input.build_os + "-" + input.build_cpu;
+    }
+    var testOnlyProfilesPrebuilt = {
+        "run-test-prebuilt": {
+            src: "src.conf",
+            dependencies: [ "jtreg", "gnumake", testedProfile + ".jdk",
+                testedProfile + ".test", "src.full"
+            ],
+            work_dir: input.get("src.full", "install_path") + "/test",
+            environment: {
+                "PRODUCT_HOME": input.get(testedProfile + ".jdk", "home_path"),
+                "TEST_IMAGE_DIR": input.get(testedProfile + ".test", "home_path"),
+                "TEST_OUTPUT_DIR": input.src_top_dir
+            },
+            labels: "test"
+        }
+    };
+    // If actually running the run-test-prebuilt profile, verify that the input
+    // variable is valid and if so, add the appropriate target_* values from
+    // the tested profile.
+    if (input.profile == "run-test-prebuilt") {
+        if (profiles[testedProfile] == null) {
+            error("testedProfile is not defined: " + testedProfile);
+        } else {
+            testOnlyProfilesPrebuilt["run-test-prebuilt"]["target_os"]
+                = profiles[testedProfile]["target_os"];
+            testOnlyProfilesPrebuilt["run-test-prebuilt"]["target_cpu"]
+                = profiles[testedProfile]["target_cpu"];
+        }
+    }
+    profiles = concatObjects(profiles, testOnlyProfilesPrebuilt);
+
+    //
+    // Define artifacts for profiles
+    //
+    // Macosx bundles are named osx and Windows demo bundles use zip instead of
+    // tar.gz.
+    var artifactData = {
+        "linux-x64": {
+            platform: "linux-x64",
+            demo_ext: "tar.gz"
+        },
+        "linux-x86": {
+            platform: "linux-x86",
+            demo_ext: "tar.gz"
+        },
+        "macosx-x64": {
+            platform: "osx-x64",
+            demo_ext: "tar.gz"
+        },
+        "solaris-x64": {
+            platform: "solaris-x64",
+            demo_ext: "tar.gz"
+        },
+        "solaris-sparcv9": {
+            platform: "solaris-sparcv9",
+            demo_ext: "tar.gz"
+        },
+        "windows-x64": {
+            platform: "windows-x64",
+            demo_ext: "zip"
+        },
+        "windows-x86": {
+            platform: "windows-x86",
+            demo_ext: "zip"
+        }
+    }
+    // Generate common artifacts for all main profiles
+    common.main_profile_names.forEach(function (name) {
+        profiles[name] = concatObjects(profiles[name],
+            common.main_profile_artifacts(artifactData[name].platform, artifactData[name].demo_ext));
+    });
+
+    // Generate common artifacts for all debug profiles
+    common.main_profile_names.forEach(function (name) {
+        var debugName = name + common.debug_suffix;
+        profiles[debugName] = concatObjects(profiles[debugName],
+            common.debug_profile_artifacts(artifactData[name].platform));
+    });
+
+    // Extra profile specific artifacts
+    profilesArtifacts = {
+        "linux-x64": {
+            artifacts: {
+                doc_api_spec: {
+                    local: "bundles/\\(jdk.*doc-api-spec.tar.gz\\)",
+                    remote: [
+                        "bundles/common/jdk-" + data.version + "_doc-api-spec.tar.gz",
+                        "bundles/linux-x64/\\1"
+                    ],
+                },
+            }
+        },
+
+        "linux-x64-open": {
+            artifacts: {
+                jdk: {
+                    local: "bundles/\\(jdk.*bin.tar.gz\\)",
+                    remote: "bundles/openjdk/GPL/linux-x64/\\1",
+                },
+                jre: {
+                    local: "bundles/\\(jre.*bin.tar.gz\\)",
+                    remote: "bundles/openjdk/GPL/linux-x64/\\1",
+                },
+                test: {
+                    local: "bundles/\\(jdk.*bin-tests.tar.gz\\)",
+                    remote: "bundles/openjdk/GPL/linux-x64/\\1",
+                },
+                jdk_symbols: {
+                    local: "bundles/\\(jdk.*bin-symbols.tar.gz\\)",
+                    remote: "bundles/openjdk/GPL/linux-x64/\\1",
+                },
+                jre_symbols: {
+                    local: "bundles/\\(jre.*bin-symbols.tar.gz\\)",
+                    remote: "bundles/openjdk/GPL/linux-x64/\\1",
+                },
+                demo: {
+                    local: "bundles/\\(jdk.*demo.tar.gz\\)",
+                    remote: "bundles/openjdk/GPL/linux-x64/\\1",
+                },
+                doc_api_spec: {
+                    local: "bundles/\\(jdk.*doc-api-spec.tar.gz\\)",
+                    remote: "bundles/openjdk/GPL/linux-x64/\\1",
+                },
+            }
+        },
+
+        "linux-x86-open": {
+            artifacts: {
+                jdk: {
+                    local: "bundles/\\(jdk.*bin.tar.gz\\)",
+                    remote: "bundles/openjdk/GPL/profile/linux-x86/\\1",
+                },
+                jre: {
+                    local: "bundles/\\(jre.*[0-9]_linux-x86_bin.tar.gz\\)",
+                    remote: "bundles/openjdk/GPL/profile/linux-x86/\\1",
+                },/* The build does not create these
+                jre_compact1: {
+                    local: "bundles/\\(jre.*-compact1_linux-x86_bin.tar.gz\\)",
+                    remote: "bundles/openjdk/GPL/profile/linux-x86/\\1",
+                },
+                jre_compact2: {
+                    local: "bundles/\\(jre.*-compact2_linux-x86_bin.tar.gz\\)",
+                    remote: "bundles/openjdk/GPL/profile/linux-x86/\\1",
+                },
+                jre_compact3: {
+                    local: "bundles/\\(jre.*-compact3_linux-x86_bin.tar.gz\\)",
+                    remote: "bundles/openjdk/GPL/profile/linux-x86/\\1",
+                },*/
+            }
+        },
+
+        "windows-x86-open": {
+            artifacts: {
+                jdk: {
+                    local: "bundles/\\(jdk.*bin.tar.gz\\)",
+                    remote: "bundles/openjdk/GPL/windows-x86/\\1",
+                },
+                jre: {
+                    local: "bundles/\\(jre.*bin.tar.gz\\)",
+                    remote: "bundles/openjdk/GPL/windows-x86/\\1"
+                },
+                test: {
+                    local: "bundles/\\(jdk.*bin-tests.tar.gz\\)",
+                    remote: "bundles/openjdk/GPL/windows-x86/\\1",
+                },
+                jdk_symbols: {
+                    local: "bundles/\\(jdk.*bin-symbols.tar.gz\\)",
+                    remote: "bundles/openjdk/GPL/windows-x86/\\1"
+                },
+                jre_symbols: {
+                    local: "bundles/\\(jre.*bin-symbols.tar.gz\\)",
+                    remote: "bundles/openjdk/GPL/windows-x86/\\1",
+                },
+                demo: {
+                    local: "bundles/\\(jdk.*demo.zip\\)",
+                    remote: "bundles/openjdk/GPL/windows-x86/\\1",
+                }
+            }
+        },
+
+        "linux-x86-open-debug": {
+            artifacts: {
+                jdk: {
+                    local: "bundles/\\(jdk.*bin-debug.tar.gz\\)",
+                    remote: "bundles/openjdk/GPL/profile/linux-x86/\\1",
+                },
+                jre: {
+                    local: "bundles/\\(jre.*bin-debug.tar.gz\\)",
+                    remote: "bundles/openjdk/GPL/profile/linux-x86/\\1",
+                },
+                jdk_symbols: {
+                    local: "bundles/\\(jdk.*bin-debug-symbols.tar.gz\\)",
+                    remote: "bundles/openjdk/GPL/profile/linux-x86/\\1",
+                },
+            }
+        },
+
+    };
+    profiles = concatObjects(profiles, profilesArtifacts);
+
+
+    // Define the reference implementation profiles. These are basically the same
+    // as the open profiles, but upload artifacts to a different location and
+    // are only defined for specific platforms.
+    profiles["linux-x64-ri"] = clone(profiles["linux-x64-open"]);
+    profiles["linux-x86-ri"] = clone(profiles["linux-x86-open"]);
+    profiles["linux-x86-ri-debug"] = clone(profiles["linux-x86-open-debug"]);
+    profiles["windows-x86-ri"] = clone(profiles["windows-x86-open"]);
+
+    // Generate artifacts for ri profiles
+    [ "linux-x64-ri", "linux-x86-ri", "linux-x86-ri-debug", "windows-x86-ri" ]
+        .forEach(function (name) {
+            // Rewrite all remote dirs to "bundles/openjdk/BCL/..."
+            for (artifactName in profiles[name].artifacts) {
+                var artifact = profiles[name].artifacts[artifactName];
+                artifact.remote = replaceAll("\/GPL\/", "/BCL/",
+                    (artifact.remote != null ? artifact.remote : artifact.local));
+            }
+        });
+
     // Generate the missing platform attributes
     profiles = generatePlatformAttributes(profiles);
     profiles = generateDefaultMakeTargetsConfigureArg(common, profiles);
@@ -514,78 +918,6 @@
 };
 
 /**
- * Generates debug versions of profiles. Clones the given profiles and adds
- * debug metadata.
- *
- * @param common Common values
- * @param profiles Profiles map to generate debug profiles for
- * @returns {{}} New map of profiles containing debug profiles
- */
-var generateDebugProfiles = function (common, profiles) {
-    var newProfiles = {};
-    for (var profile in profiles) {
-        var debugProfile = profile + "-debug";
-        newProfiles[debugProfile] = clone(profiles[profile]);
-        newProfiles[debugProfile].debug_level = "fastdebug";
-        newProfiles[debugProfile].default_make_targets
-            = common.default_make_targets_debug;
-        newProfiles[debugProfile].labels
-            = concat(newProfiles[debugProfile].labels || [], "debug"),
-            newProfiles[debugProfile].configure_args
-                = concat(newProfiles[debugProfile].configure_args,
-                common.configure_args_debug);
-    }
-    return newProfiles;
-};
-
-/**
- * Generates slowdebug versions of profiles. Clones the given profiles and adds
- * debug metadata.
- *
- * @param common Common values
- * @param profiles Profiles map to generate debug profiles for
- * @returns {{}} New map of profiles containing debug profiles
- */
-var generateSlowdebugProfiles = function (common, profiles) {
-    var newProfiles = {};
-    for (var profile in profiles) {
-        var debugProfile = profile + "-slowdebug";
-        newProfiles[debugProfile] = clone(profiles[profile]);
-        newProfiles[debugProfile].debug_level = "slowdebug";
-        newProfiles[debugProfile].default_make_targets
-            = common.default_make_targets_slowdebug;
-        newProfiles[debugProfile].labels
-            = concat(newProfiles[debugProfile].labels || [], "slowdebug"),
-            newProfiles[debugProfile].configure_args
-                = concat(newProfiles[debugProfile].configure_args,
-                common.configure_args_slowdebug);
-    }
-    return newProfiles;
-};
-
-/**
- * Generates open only versions of profiles. Clones the given profiles and adds
- * open metadata.
- *
- * @param common Common values
- * @param profiles Profiles map to generate open only profiles for
- * @returns {{}} New map of profiles containing open only profiles
- */
-var generateOpenOnlyProfiles = function (common, profiles) {
-    var newProfiles = {};
-    for (var profile in profiles) {
-        var openProfile = profile + "-open";
-        newProfiles[openProfile] = clone(profiles[profile]);
-        newProfiles[openProfile].labels
-            = concat(newProfiles[openProfile].labels || [], "open"),
-            newProfiles[openProfile].configure_args
-                = concat(newProfiles[openProfile].configure_args,
-                "--enable-openjdk-only");
-    }
-    return newProfiles;
-};
-
-/**
  * The default_make_targets attribute on a profile is not a real Jib attribute.
  * This function rewrites that attribute into the corresponding configure arg.
  * Calling this function multiple times on the same profiles object is safe.
@@ -602,10 +934,12 @@
             // Iterate over all configure args and see if --with-default-make-target
             // is already there and change it, otherwise add it.
             var found = false;
-            for (var arg in ret[profile].configure_args) {
-                if (arg.startsWith("--with-default-make-target")) {
+            for (var i in ret[profile].configure_args) {
+                var arg = ret[profile].configure_args[i];
+                if (arg != null && arg.startsWith("--with-default-make-target=")) {
                     found = true;
-                    arg.replace(/=.*/, "=" + targetsString);
+                    ret[profile].configure_args[i]
+                        = "--with-default-make-target=" + targetsString;
                 }
             }
             if (!found) {
@@ -618,6 +952,16 @@
     return ret;
 }
 
+var getBuildId = function (input) {
+    if (input.build_id != null) {
+        return input.build_id;
+    } else {
+        var topdir = new java.io.File(__DIR__, "../..").getCanonicalFile().getName();
+        var userName = java.lang.System.getProperty("user.name");
+        return userName + "." + topdir;
+    }
+}
+
 /**
  * Deep clones an object tree.
  *
@@ -638,25 +982,25 @@
 };
 
 /**
- * Copies all elements in an array into a new array but replacing all
- * occurrences of original with replacement.
+ * Takes a String or Array of Strings and does a replace operation on each
+ * of them.
  *
- * @param original Element to look for
- * @param replacement Element to replace with
- * @param a Array to copy
- * @returns {Array} New array with all occurrences of original replaced
- *                  with replacement
+ * @param pattern Pattern to look for
+ * @param replacement Replacement text to insert
+ * @param a String or Array of Strings to replace
+ * @returns {Array} Either a new array or a new string depending on the input
  */
-var replace = function (original, replacement, a) {
+var replaceAll = function (pattern, replacement, a) {
+    // If a is an array
+    if (Array === a.constructor) {
     var newA = [];
     for (var i in a) {
-        if (original == a[i]) {
-            newA.push(replacement);
+            newA.push(a[i].replace(pattern, replacement));
+        }
+        return newA;
         } else {
-            newA.push(a[i]);
-        }
+        return a.replace(pattern, replacement);
     }
-    return newA;
 };
 
 /**
@@ -669,20 +1013,26 @@
  * @returns {{}} New object tree containing the concatenation of o1 and o2
  */
 var concatObjects = function (o1, o2) {
+    if (o1 == null) {
+        return clone(o2);
+    }
+    if (o2 == null) {
+        return clone(o1);
+    }
     var ret = {};
     for (var a in o1) {
         if (o2[a] == null) {
-            ret[a] = o1[a];
+            ret[a] = clone(o1[a]);
         }
     }
     for (var a in o2) {
         if (o1[a] == null) {
-            ret[a] = o2[a];
+            ret[a] = clone(o2[a]);
         } else {
             if (typeof o1[a] == 'string') {
-                ret[a] = [o1[a]].concat(o2[a]);
+                ret[a] = clone([o1[a]].concat(o2[a]));
             } else if (Array.isArray(o1[a])) {
-                ret[a] = o1[a].concat(o2[a]);
+                ret[a] = clone(o1[a].concat(o2[a]));
             } else if (typeof o1[a] == 'object') {
                 ret[a] = concatObjects(o1[a], o2[a]);
             }
@@ -690,3 +1040,45 @@
     }
     return ret;
 };
+
+/**
+ * Constructs the numeric version string from reading the
+ * common/autoconf/version-numbers file and removing all trailing ".0".
+ *
+ * @param major Override major version
+ * @param minor Override minor version
+ * @param security Override security version
+ * @param patch Override patch version
+ * @returns {String} The numeric version string
+ */
+var getVersion = function (major, minor, security, patch) {
+    var version_numbers = getVersionNumbers();
+    var version = (major != null ? major : version_numbers.get("DEFAULT_VERSION_MAJOR"))
+        + "." + (minor != null ? minor : version_numbers.get("DEFAULT_VERSION_MINOR"))
+        + "." + (security != null ? security :  version_numbers.get("DEFAULT_VERSION_SECURITY"))
+        + "." + (patch != null ? patch : version_numbers.get("DEFAULT_VERSION_PATCH"));
+    while (version.match(".*\.0$")) {
+        version = version.substring(0, version.length - 2);
+    }
+    return version;
+};
+
+// Properties representation of the common/autoconf/version-numbers file. Lazily
+// initiated by the function below.
+var version_numbers;
+
+/**
+ * Read the common/autoconf/version-numbers file into a Properties object.
+ *
+ * @returns {java.utilProperties}
+ */
+var getVersionNumbers = function () {
+    // Read version information from common/autoconf/version-numbers
+    if (version_numbers == null) {
+        version_numbers = new java.util.Properties();
+        var stream = new java.io.FileInputStream(__DIR__ + "/../../common/autoconf/version-numbers");
+        version_numbers.load(stream);
+        stream.close();
+    }
+    return version_numbers;
+}
--- a/make/Bundles.gmk	Thu Jan 12 17:46:35 2017 -0800
+++ b/make/Bundles.gmk	Thu Jan 12 18:05:11 2017 -0800
@@ -103,7 +103,7 @@
 	  $(CD) $$($1_BASE_DIRS) \
 	      && ( $(TAR) cf - $(TAR_CREATE_EXTRA_PARAM) \
 	          -$(TAR_INCLUDE_PARAM) $$($1_$$($1_BASE_DIRS)_LIST_FILE) \
-	          $$(if $$($1_SUBDIR), --transform 's|^|$$($1_SUBDIR)/|') \
+	          $$(if $$($1_SUBDIR), --transform 's|^|$$($1_SUBDIR)/|S') \
 	          $(TAR_IGNORE_EXIT_VALUE) ) \
 	      | $(GZIP) > $$@
         else
--- a/make/CompileJavaModules.gmk	Thu Jan 12 17:46:35 2017 -0800
+++ b/make/CompileJavaModules.gmk	Thu Jan 12 18:05:11 2017 -0800
@@ -344,8 +344,6 @@
 
 ################################################################################
 
-jdk.accessibility_ADD_JAVAC_FLAGS := -Xlint:-exports
-
 ################################################################################
 
 jdk.compiler_ADD_JAVAC_FLAGS := -Xdoclint:all/protected '-Xdoclint/package:-com.sun.tools.*,-jdk.internal.*' \
@@ -365,6 +363,10 @@
 
 ################################################################################
 
+jdk.jshell_COPY := .jsh .properties
+
+################################################################################
+
 jdk.internal.le_COPY := .properties
 
 ################################################################################
@@ -448,7 +450,51 @@
 
 ################################################################################
 
-jdk.vm.ci_ADD_JAVAC_FLAGS := -Xlint:-exports
+# -parameters provides method's parameters information in class file,
+# JVMCI compilers make use of that information for various sanity checks.
+# Don't use Indy strings concatenation to have good JVMCI startup performance.
+
+jdk.vm.ci_ADD_JAVAC_FLAGS := -parameters -Xlint:-exports -XDstringConcat=inline
+
+################################################################################
+
+jdk.vm.compiler_ADD_JAVAC_FLAGS := -parameters -XDstringConcat=inline
+
+jdk.vm.compiler_EXCLUDES += \
+    org.graalvm.compiler.core.match.processor \
+    org.graalvm.compiler.nodeinfo.processor \
+    org.graalvm.compiler.options.processor \
+    org.graalvm.compiler.serviceprovider.processor \
+    org.graalvm.compiler.replacements.verifier \
+    org.graalvm.compiler.api.directives.test \
+    org.graalvm.compiler.api.test \
+    org.graalvm.compiler.asm.aarch64.test \
+    org.graalvm.compiler.asm.amd64.test \
+    org.graalvm.compiler.asm.sparc.test \
+    org.graalvm.compiler.asm.test \
+    org.graalvm.compiler.core.amd64.test \
+    org.graalvm.compiler.core.sparc.test \
+    org.graalvm.compiler.core.test \
+    org.graalvm.compiler.debug.test \
+    org.graalvm.compiler.graph.test \
+    org.graalvm.compiler.hotspot.amd64.test \
+    org.graalvm.compiler.hotspot.lir.test \
+    org.graalvm.compiler.hotspot.test \
+    org.graalvm.compiler.jtt \
+    org.graalvm.compiler.lir.jtt \
+    org.graalvm.compiler.lir.test \
+    org.graalvm.compiler.microbenchmarks \
+    org.graalvm.compiler.nodes.test \
+    org.graalvm.compiler.options.test \
+    org.graalvm.compiler.phases.common.test \
+    org.graalvm.compiler.replacements.test \
+    org.graalvm.compiler.test \
+    org.graalvm.compiler.virtual.bench \
+    #
+
+################################################################################
+
+jdk.aot_ADD_JAVAC_FLAGS := -parameters -XDstringConcat=inline
 
 ################################################################################
 
@@ -511,6 +557,22 @@
   MODULESOURCEPATH := $(call PathList, $(JVMCI_MODULESOURCEPATH))
 endif
 
+ifeq ($(MODULE), jdk.vm.compiler)
+  ## WORKAROUND jdk.vm.compiler source structure issue
+  VM_COMPILER_MODULESOURCEPATH := $(MODULESOURCEPATH) \
+      $(subst /$(MODULE)/,/*/, $(filter-out %processor/src %test/src %jtt/src %bench/src %microbenchmarks/src, \
+          $(wildcard $(HOTSPOT_TOPDIR)/src/$(MODULE)/share/classes/*/src)))
+  MODULESOURCEPATH := $(call PathList, $(VM_COMPILER_MODULESOURCEPATH))
+endif
+
+ifeq ($(MODULE), jdk.aot)
+  ## WORKAROUND jdk.aot source structure issue
+  AOT_MODULESOURCEPATH := $(MODULESOURCEPATH) \
+      $(subst /$(MODULE)/,/*/, $(filter-out %processor/src, \
+          $(wildcard $(HOTSPOT_TOPDIR)/src/$(MODULE)/share/classes/*/src)))
+  MODULESOURCEPATH := $(call PathList, $(AOT_MODULESOURCEPATH))
+endif
+
 $(eval $(call SetupJavaCompilation, $(MODULE), \
     SETUP := $(if $($(MODULE)_SETUP), $($(MODULE)_SETUP), GENERATE_JDKBYTECODE), \
     MODULE := $(MODULE), \
--- a/make/Images.gmk	Thu Jan 12 17:46:35 2017 -0800
+++ b/make/Images.gmk	Thu Jan 12 18:05:11 2017 -0800
@@ -343,11 +343,11 @@
 ################################################################################
 # src.zip
 
-$(JDK_IMAGE_DIR)/src.zip: $(SUPPORT_OUTPUTDIR)/src.zip
+$(JDK_IMAGE_DIR)/lib/src.zip: $(SUPPORT_OUTPUTDIR)/src.zip
 	$(call LogInfo, Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@))
 	$(install-file)
 
-JDK_TARGETS += $(JDK_IMAGE_DIR)/src.zip
+JDK_TARGETS += $(JDK_IMAGE_DIR)/lib/src.zip
 
 ################################################################################
 # /demo dir
--- a/make/Javadoc.gmk	Thu Jan 12 17:46:35 2017 -0800
+++ b/make/Javadoc.gmk	Thu Jan 12 18:05:11 2017 -0800
@@ -122,6 +122,7 @@
     org.w3c.dom.html \
     org.w3c.dom.stylesheets \
     org.w3c.dom.xpath \
+    org.graalvm.compiler.% \
     #
 
 CORE_PACKAGES := $(filter-out $(CORE_EXCLUDED_PACKAGES), \
@@ -147,10 +148,10 @@
 # arg 2: copyright url (optional)
 # arg 3: free-form text snippet (optional)
 define GenerateBottom
-  <font size="-1">$(if $(strip $3), $(strip $3))<br> $(if \
+  <span style="font-size:smaller">$(if $(strip $3), $(strip $3))<br> $(if \
       $(strip $2),<a href="$(strip $2)">Copyright</a>,Copyright) \
       &copy; $(strip $1), $(COPYRIGHT_YEAR), $(FULL_COMPANY_NAME). \
-      $(COMPANY_ADDRESS). All rights reserved.</font>
+      $(COMPANY_ADDRESS). All rights reserved.</span>
 endef
 
 # Speed up finding by filling cache
@@ -576,12 +577,13 @@
     PACKAGES := \
         jdk.jshell \
         jdk.jshell.spi \
-        jdk.jshell.execution, \
+        jdk.jshell.execution \
+        jdk.jshell.tool, \
     API_ROOT := jdk, \
     DEST_DIR := jshell, \
-    OVERVIEW := $(LANGTOOLS_TOPDIR)/src/jdk.jshell/share/classes/jdk/jshell/overview.html, \
     TITLE := JShell API, \
     FIRST_COPYRIGHT_YEAR := 2015, \
+    SPLIT_INDEX := TRUE, \
 ))
 
 TARGETS += $(jshellapi)
--- a/make/Main.gmk	Thu Jan 12 17:46:35 2017 -0800
+++ b/make/Main.gmk	Thu Jan 12 18:05:11 2017 -0800
@@ -85,10 +85,14 @@
 
   buildtools-modules:
 	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileModuleTools.gmk)
+
+  buildtools-hotspot:
+	+($(CD) $(HOTSPOT_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileTools.gmk)
 endif
 
 ALL_TARGETS += buildtools-langtools interim-langtools \
-    interim-rmic interim-cldrconverter buildtools-jdk buildtools-modules
+    interim-rmic interim-cldrconverter buildtools-jdk buildtools-modules \
+    buildtools-hotspot
 
 ################################################################################
 # Special targets for certain modules
@@ -547,11 +551,13 @@
 
   buildtools-jdk: interim-langtools interim-cldrconverter
 
+  buildtools-hotspot: interim-langtools
+
   buildtools-modules: exploded-image-base
 
   $(CORBA_GENSRC_TARGETS): interim-langtools
 
-  $(HOTSPOT_GENSRC_TARGETS): interim-langtools
+  $(HOTSPOT_GENSRC_TARGETS): interim-langtools buildtools-hotspot
 
   $(JDK_GENSRC_TARGETS): interim-langtools buildtools-jdk
 
@@ -628,6 +634,14 @@
   # current JDK.
   jdk.vm.ci-gensrc-hotspot: java.base-java
 
+  # The annotation processing for jdk.vm.compiler needs classes from the current JDK.
+  jdk.vm.compiler-gensrc-hotspot: java.base-java java.management-java \
+      jdk.management-java jdk.vm.ci-java jdk.unsupported-java
+
+  # For jdk.vm.compiler, the gensrc step is generating a module-info.java.extra
+  # file to be processed by the gensrc-moduleinfo target.
+  jdk.vm.compiler-gensrc-moduleinfo: jdk.vm.compiler-gensrc-hotspot
+
   # Explicitly add dependencies for special targets
   java.base-java: unpack-sec
 
@@ -792,7 +806,7 @@
 # Virtual targets without recipes
 
 buildtools: buildtools-langtools interim-langtools interim-rmic \
-    buildtools-jdk
+    buildtools-jdk buildtools-hotspot
 
 hotspot: $(HOTSPOT_VARIANT_TARGETS) hotspot-jsig
 
--- a/make/SourceRevision.gmk	Thu Jan 12 17:46:35 2017 -0800
+++ b/make/SourceRevision.gmk	Thu Jan 12 18:05:11 2017 -0800
@@ -105,7 +105,7 @@
     # We have a stored source revision (.src-rev)
 
     store-source-revision:
-	$(call LogWarn, Warning: No mercurial configuration present, not updating .src-rev)
+	$(call LogInfo, No mercurial configuration present$(COMMA) not updating .src-rev)
 
     $(SOURCE_REVISION_TRACKER): $(STORED_SOURCE_REVISION)
 	$(install-file)
@@ -115,7 +115,7 @@
     # We don't have a stored source revision. Can't do anything, really.
 
     store-source-revision:
-	$(call LogWarn, Error: No mercurial configuration present, cannot create .src-rev)
+	$(call LogWarn, Error: No mercurial configuration present$(COMMA) cannot create .src-rev)
 	exit 2
 
     create-source-revision-tracker:
--- a/make/common/MakeBase.gmk	Thu Jan 12 17:46:35 2017 -0800
+++ b/make/common/MakeBase.gmk	Thu Jan 12 18:05:11 2017 -0800
@@ -861,13 +861,8 @@
 ################################################################################
 # Find lib dir for module
 # Param 1 - module name
-ifeq ($(OPENJDK_TARGET_OS_TYPE), unix)
-  FindLibDirForModule = \
-      $(SUPPORT_OUTPUTDIR)/modules_libs/$(strip $1)$(OPENJDK_TARGET_CPU_LIBDIR)
-else
-  FindLibDirForModule = \
-      $(SUPPORT_OUTPUTDIR)/modules_libs/$(strip $1)
-endif
+FindLibDirForModule = \
+    $(SUPPORT_OUTPUTDIR)/modules_libs/$(strip $1)
 
 ################################################################################
 # Return a string suitable for use after a -classpath or --module-path option. It
--- a/make/common/Modules.gmk	Thu Jan 12 17:46:35 2017 -0800
+++ b/make/common/Modules.gmk	Thu Jan 12 18:05:11 2017 -0800
@@ -142,6 +142,20 @@
 endif
 
 ################################################################################
+# Filter out Graal specific modules if Graal build is disabled
+
+ifeq ($(INCLUDE_GRAAL), false)
+  MODULES_FILTER += jdk.vm.compiler
+endif
+
+################################################################################
+# Filter out aot specific modules if aot is disabled
+
+ifeq ($(ENABLE_AOT), false)
+  MODULES_FILTER += jdk.aot
+endif
+
+################################################################################
 # Module list macros
 
 # Use append so that the custom extension may add to these variables
--- a/make/common/NativeCompilation.gmk	Thu Jan 12 17:46:35 2017 -0800
+++ b/make/common/NativeCompilation.gmk	Thu Jan 12 18:05:11 2017 -0800
@@ -371,7 +371,8 @@
 #       when compiling C code
 #   DISABLED_WARNINGS_CXX_<toolchain> Disable the given warnings for the specified
 #       toolchain when compiling C++ code
-#   STRIP_SYMBOLS Set to true to strip the final binary if the toolchain allows for it
+#   STRIP_SYMBOLS Set to false to override global strip policy and always leave
+#       symbols in the binary, if the toolchain allows for it
 #   DEBUG_SYMBOLS Set to false to disable generation of debug symbols
 #   COPY_DEBUG_SYMBOLS Set to false to override global setting of debug symbol copying
 #   ZIP_EXTERNAL_DEBUG_SYMBOLS Set to false to override global setting of debug symbol
@@ -886,6 +887,10 @@
     endif # $1_DEBUG_SYMBOLS != false
   endif # COPY_DEBUG_SYMBOLS
 
+  # Unless specifically set, stripping should only happen if symbols are also
+  # being copied.
+  $$(call SetIfEmpty, $1_STRIP_SYMBOLS, $$($1_COPY_DEBUG_SYMBOLS))
+
   ifneq ($$($1_STRIP_SYMBOLS), false)
     ifneq ($$($1_STRIP), )
       # Default to using the global STRIPFLAGS. Allow for overriding with an empty value
--- a/make/jprt.properties	Thu Jan 12 17:46:35 2017 -0800
+++ b/make/jprt.properties	Thu Jan 12 18:05:11 2017 -0800
@@ -45,6 +45,7 @@
 jprt.build.use.jib=true
 jprt.test.use.jib=true
 jprt.jib.launcher=common/bin/jib.sh
+jprt.build.use.jib.publish=true
 
 # Clear out all the build needs as JIB handles this
 jprt.jdk9.build.needs=
@@ -124,7 +125,7 @@
 jprt.linux_i586.fastdebugZero.build.jib.profile=linux-x86-zero-debug
 jprt.linux_x64.fastdebugZero.build.jib.profile=linux-x64-zero-debug
 
-jprt.test.jib.profile=run-test
+jprt.test.jib.profile=run-test-jprt
 
 # Set make target to use for different build flavors
 jprt.build.flavor.fastdebugOpen.target=jprt_bundle
@@ -189,7 +190,7 @@
 jprt.build.configure.args=						\
     --with-output-sync=recurse						\
     --with-jobs=$ALT_PARALLEL_COMPILE_JOBS				\
-    --with-version-opt=$JPRT_JOB_ID					\
+    --with-version-opt=$JPRT_JOB_ID				 	\
     ${my.additional.build.configure.args.${jprt.test.set}}		\
     ${my.custom.build.configure.args}
 
--- a/test/failure_handler/src/share/conf/mac.properties	Thu Jan 12 17:46:35 2017 -0800
+++ b/test/failure_handler/src/share/conf/mac.properties	Thu Jan 12 18:05:11 2017 -0800
@@ -29,6 +29,7 @@
 # process info to gather
 ################################################################################
 onTimeout=\
+  native.DevToolsSecurity \
   native.vmmap native.heap native.leaks native.spindump \
   native.stack native.core
 ################################################################################
@@ -36,22 +37,34 @@
 native.javaOnly=false
 native.args=%p
 
-# Some of them require root privileges
-native.vmmap.app=vmmap
-native.heap.app=heap
-native.leaks.app=leaks
+native.DevToolsSecurity.app=DevToolsSecurity
+native.DevToolsSecurity.args=--status
+
+# spindump requires root privileges
 native.spindump.app=spindump
 native.spindump.args=%p -stdout
 
-native.stack.app=lldb
+native.vmmap.app=bash
+native.vmmap.delimiter=\0
+native.vmmap.args=-c\0DevToolsSecurity --status | grep -q enabled && vmmap %p
+
+native.leaks.app=bash
+native.leaks.delimiter=\0
+native.leaks.args=-c\0DevToolsSecurity --status | grep -q enabled && leaks %p
+
+native.heap.app=bash
+native.heap.delimiter=\0
+native.heap.args=-c\0DevToolsSecurity --status | grep -q enabled && heap %p
+
+native.stack.app=bash
 native.stack.delimiter=\0
 native.stack.params.repeat=6
-native.stack.args=-o\0attach %p\0-o\0thread backtrace all\0-o\0detach\0-o\0quit
+native.stack.args=-c\0DevToolsSecurity --status | grep -q enabled && lldb -o 'attach %p' -o 'thread backtrace all' -o 'detach' -o 'quit'
 
 native.core.app=bash
 native.core.delimiter=\0
 native.core.args=-c\0gcore -o ./core.%p %p || \
-  lldb -o 'attach %p' -o 'process save-core core.%p' -o 'detach' -o 'quit'
+  (DevToolsSecurity --status | grep -q enabled && lldb -o 'attach %p' -o 'process save-core core.%p' -o 'detach' -o 'quit')
 native.core.params.timeout=3600000
 ################################################################################
 # environment info to gather
@@ -89,7 +102,6 @@
 memory.vmstat.app=vm_stat
 memory.vmstat.args=-c 3 3
 
-
 netstat.app=netstat
 netstat.av.args=-av
 netstat.aL.args=-aL
--- a/test/lib/jdk/test/lib/hprof/parser/HprofReader.java	Thu Jan 12 17:46:35 2017 -0800
+++ b/test/lib/jdk/test/lib/hprof/parser/HprofReader.java	Thu Jan 12 18:05:11 2017 -0800
@@ -151,6 +151,10 @@
 
     private Snapshot snapshot;
 
+    public static boolean verifyMagicNumber(int numberRead) {
+        return (numberRead == MAGIC_NUMBER);
+    }
+
     public HprofReader(String fileName, PositionDataInputStream in,
                        int dumpNumber, boolean callStack, int debugLevel)
                        throws IOException {
@@ -737,6 +741,12 @@
         long id = readID();
         StackTrace stackTrace = getStackTraceFromSerial(in.readInt());
         long classID = readID();
+        JavaClass searchedClass = snapshot.findClass(
+                                  "0x" + Long.toHexString(classID));
+        if (searchedClass == null) {
+            throw new IOException(
+                "Class Record for 0x" + Long.toHexString(classID) + " not found");
+        }
         int bytesFollowing = in.readInt();
         int bytesRead = (2 * identifierSize) + 8 + bytesFollowing;
         JavaObject jobj = new JavaObject(classID, start);
--- a/test/lib/sun/hotspot/WhiteBox.java	Thu Jan 12 17:46:35 2017 -0800
+++ b/test/lib/sun/hotspot/WhiteBox.java	Thu Jan 12 18:05:11 2017 -0800
@@ -229,7 +229,7 @@
     return isMethodCompiled0(method, isOsr);
   }
   public        boolean isMethodCompilable(Executable method) {
-    return isMethodCompilable(method, -1 /*any*/);
+    return isMethodCompilable(method, -2 /*any*/);
   }
   public        boolean isMethodCompilable(Executable method, int compLevel) {
     return isMethodCompilable(method, compLevel, false /*not osr*/);
@@ -277,7 +277,7 @@
     return deoptimizeMethod0(method, isOsr);
   }
   public        void    makeMethodNotCompilable(Executable method) {
-    makeMethodNotCompilable(method, -1 /*any*/);
+    makeMethodNotCompilable(method, -2 /*any*/);
   }
   public        void    makeMethodNotCompilable(Executable method, int compLevel) {
     makeMethodNotCompilable(method, compLevel, false /*not osr*/);
@@ -301,7 +301,7 @@
     return testSetDontInlineMethod0(method, value);
   }
   public        int     getCompileQueuesSize() {
-    return getCompileQueueSize(-1 /*any*/);
+    return getCompileQueueSize(-2 /*any*/);
   }
   public native int     getCompileQueueSize(int compLevel);
   private native boolean testSetForceInlineMethod0(Executable method, boolean value);
--- a/test/lib/sun/hotspot/code/CodeBlob.java	Thu Jan 12 17:46:35 2017 -0800
+++ b/test/lib/sun/hotspot/code/CodeBlob.java	Thu Jan 12 18:05:11 2017 -0800
@@ -49,8 +49,13 @@
     assert obj.length == 4;
     name = (String) obj[0];
     size = (Integer) obj[1];
-    code_blob_type = BlobType.values()[(Integer) obj[2]];
-    assert code_blob_type.id == (Integer) obj[2];
+    int blob_type_index = (Integer) obj[2];
+    if (blob_type_index == -1) { // AOT
+      code_blob_type = null;
+    } else {
+      code_blob_type = BlobType.values()[blob_type_index];
+      assert code_blob_type.id == (Integer) obj[2];
+    }
     address = (Long) obj[3];
   }
   public final String name;