changeset 1847:5a7e1695ac8c

8142907: Integration of minor fixes from the build-infra project Reviewed-by: erikj, dholmes
author ihse
date Tue, 15 Dec 2015 11:02:03 +0100
parents ca96c0c2104b
children e228916051dd
files common/autoconf/configure.ac common/autoconf/flags.m4 common/autoconf/generated-configure.sh common/autoconf/hotspot.m4 common/autoconf/jdk-options.m4 common/autoconf/spec.gmk.in common/autoconf/toolchain.m4 common/bin/compare.sh common/bin/compare_exceptions.sh.incl make/common/MakeBase.gmk make/common/NativeCompilation.gmk
diffstat 11 files changed, 796 insertions(+), 631 deletions(-) [+]
line wrap: on
line diff
--- a/common/autoconf/configure.ac	Tue Dec 15 15:45:53 2015 +0100
+++ b/common/autoconf/configure.ac	Tue Dec 15 11:02:03 2015 +0100
@@ -44,6 +44,7 @@
 m4_include([build-performance.m4])
 m4_include([flags.m4])
 m4_include([help.m4])
+m4_include([hotspot.m4])
 m4_include([jdk-options.m4])
 m4_include([jdk-version.m4])
 m4_include([libraries.m4])
@@ -94,9 +95,10 @@
 
 # These are needed to be able to create a configuration name (and thus the output directory)
 JDKOPT_SETUP_JDK_VARIANT
-JDKOPT_SETUP_JVM_INTERPRETER
-JDKOPT_SETUP_JVM_VARIANTS
+HOTSPOT_SETUP_JVM_INTERPRETER
+HOTSPOT_SETUP_JVM_VARIANTS
 JDKOPT_SETUP_DEBUG_LEVEL
+HOTSPOT_SETUP_DEBUG_LEVEL
 
 # With basic setup done, call the custom early hook.
 CUSTOM_EARLY_HOOK
@@ -132,6 +134,7 @@
 
 # We need build & target for this.
 JDKOPT_SETUP_JDK_OPTIONS
+HOTSPOT_SETUP_HOTSPOT_OPTIONS
 JDKVER_SETUP_JDK_VERSION_NUMBERS
 
 ###############################################################################
@@ -220,7 +223,7 @@
 #
 ###############################################################################
 
-JDKOPT_SETUP_BUILD_TWEAKS
+HOTSPOT_SETUP_BUILD_TWEAKS
 JDKOPT_DETECT_INTREE_EC
 
 ###############################################################################
--- a/common/autoconf/flags.m4	Tue Dec 15 15:45:53 2015 +0100
+++ b/common/autoconf/flags.m4	Tue Dec 15 11:02:03 2015 +0100
@@ -120,13 +120,17 @@
 
 AC_DEFUN_ONCE([FLAGS_SETUP_INIT_FLAGS],
 [
-  # Option used to tell the compiler whether to create 32- or 64-bit executables
+  # COMPILER_TARGET_BITS_FLAG  : option for selecting 32- or 64-bit output
+  # COMPILER_COMMAND_FILE_FLAG : option for passing a command file to the compiler
   if test "x$TOOLCHAIN_TYPE" = xxlc; then
     COMPILER_TARGET_BITS_FLAG="-q"
+    COMPILER_COMMAND_FILE_FLAG="-f"
   else
     COMPILER_TARGET_BITS_FLAG="-m"
+    COMPILER_COMMAND_FILE_FLAG="@"
   fi
   AC_SUBST(COMPILER_TARGET_BITS_FLAG)
+  AC_SUBST(COMPILER_COMMAND_FILE_FLAG)
 
   # FIXME: figure out if we should select AR flags depending on OS or toolchain.
   if test "x$OPENJDK_TARGET_OS" = xmacosx; then
@@ -226,37 +230,38 @@
       else
         SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 $PICFLAG"
       fi
-      SET_EXECUTABLE_ORIGIN='-Xlinker -rpath -Xlinker @loader_path/.'
+      SET_EXECUTABLE_ORIGIN='-Wl,-rpath,@loader_path/.'
       SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN"
-      SET_SHARED_LIBRARY_NAME='-Xlinker -install_name -Xlinker @rpath/[$]1'
+      SET_SHARED_LIBRARY_NAME='-Wl,-install_name,@rpath/[$]1'
       SET_SHARED_LIBRARY_MAPFILE=''
     else
       # Default works for linux, might work on other platforms as well.
       SHARED_LIBRARY_FLAGS='-shared'
-      SET_EXECUTABLE_ORIGIN='-Xlinker -rpath -Xlinker \$$$$ORIGIN[$]1'
-      SET_SHARED_LIBRARY_ORIGIN="-Xlinker -z -Xlinker origin $SET_EXECUTABLE_ORIGIN"
-      SET_SHARED_LIBRARY_NAME='-Xlinker -soname=[$]1'
-      SET_SHARED_LIBRARY_MAPFILE='-Xlinker -version-script=[$]1'
+      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'
     fi
   elif test "x$TOOLCHAIN_TYPE" = xclang; then
-    PICFLAG=''
     C_FLAG_REORDER=''
     CXX_FLAG_REORDER=''
 
     if test "x$OPENJDK_TARGET_OS" = xmacosx; then
       # Linking is different on MacOSX
+      PICFLAG=''
       SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 $PICFLAG"
-      SET_EXECUTABLE_ORIGIN='-Xlinker -rpath -Xlinker @loader_path/.'
+      SET_EXECUTABLE_ORIGIN='-Wl,-rpath,@loader_path/.'
       SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN"
-      SET_SHARED_LIBRARY_NAME='-Xlinker -install_name -Xlinker @rpath/[$]1'
+      SET_SHARED_LIBRARY_NAME='-Wl,-install_name,@rpath/[$]1'
       SET_SHARED_LIBRARY_MAPFILE=''
     else
       # Default works for linux, might work on other platforms as well.
+      PICFLAG='-fPIC'
       SHARED_LIBRARY_FLAGS='-shared'
-      SET_EXECUTABLE_ORIGIN='-Xlinker -rpath -Xlinker \$$$$ORIGIN[$]1'
-      SET_SHARED_LIBRARY_ORIGIN="-Xlinker -z -Xlinker origin $SET_EXECUTABLE_ORIGIN"
-      SET_SHARED_LIBRARY_NAME='-Xlinker -soname=[$]1'
-      SET_SHARED_LIBRARY_MAPFILE='-Xlinker -version-script=[$]1'
+      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'
     fi
   elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
     PICFLAG="-KPIC"
@@ -265,7 +270,7 @@
     SHARED_LIBRARY_FLAGS="-G"
     SET_EXECUTABLE_ORIGIN='-R\$$$$ORIGIN[$]1'
     SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN"
-    SET_SHARED_LIBRARY_NAME=''
+    SET_SHARED_LIBRARY_NAME='-h [$]1'
     SET_SHARED_LIBRARY_MAPFILE='-M[$]1'
   elif test "x$TOOLCHAIN_TYPE" = xxlc; then
     PICFLAG="-qpic=large"
@@ -280,7 +285,7 @@
     PICFLAG=""
     C_FLAG_REORDER=''
     CXX_FLAG_REORDER=''
-    SHARED_LIBRARY_FLAGS="-LD"
+    SHARED_LIBRARY_FLAGS="-dll"
     SET_EXECUTABLE_ORIGIN=''
     SET_SHARED_LIBRARY_ORIGIN=''
     SET_SHARED_LIBRARY_NAME=''
@@ -293,6 +298,7 @@
   AC_SUBST(SET_SHARED_LIBRARY_ORIGIN)
   AC_SUBST(SET_SHARED_LIBRARY_NAME)
   AC_SUBST(SET_SHARED_LIBRARY_MAPFILE)
+  AC_SUBST(SHARED_LIBRARY_FLAGS)
 
   if test "x$OPENJDK_TARGET_OS" = xsolaris; then
     CFLAGS_JDK="${CFLAGS_JDK} -D__solaris__"
@@ -573,6 +579,25 @@
         CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing"
         ;;
     esac
+  elif test "x$TOOLCHAIN_TYPE" = xclang; then
+    if test "x$OPENJDK_TARGET_OS" = xlinux; then
+	    if test "x$OPENJDK_TARGET_CPU" = xx86; then
+	      # Force compatibility with i586 on 32 bit intel platforms.
+	      COMMON_CCXXFLAGS="${COMMON_CCXXFLAGS} -march=i586"
+	    fi
+	    COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \
+	        -pipe -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE"
+	    case $OPENJDK_TARGET_CPU_ARCH in
+	      ppc )
+	        # on ppc 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 -fno-omit-frame-pointer"
+	        CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing"
+	        ;;
+	    esac
+    fi
   elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
     COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS"
     if test "x$OPENJDK_TARGET_CPU_ARCH" = xx86; then
@@ -748,17 +773,17 @@
     # If this is a --hash-style=gnu system, use --hash-style=both, why?
     # We have previously set HAS_GNU_HASH if this is the case
     if test -n "$HAS_GNU_HASH"; then
-      LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker --hash-style=both"
+      LDFLAGS_JDK="${LDFLAGS_JDK} -Wl,--hash-style=both"
     fi
     if test "x$OPENJDK_TARGET_OS" = xlinux; then
       # And since we now know that the linker is gnu, then add -z defs, to forbid
       # undefined symbols in object files.
-      LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -z -Xlinker defs"
+      LDFLAGS_JDK="${LDFLAGS_JDK} -Wl,-z,defs"
       case $DEBUG_LEVEL in
         release )
           # tell linker to optimize libraries.
           # Should this be supplied to the OSS linker as well?
-          LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -O1"
+          LDFLAGS_JDK="${LDFLAGS_JDK} -Wl,-O1"
           ;;
         slowdebug )
           if test "x$HAS_LINKER_NOW" = "xtrue"; then
@@ -785,7 +810,7 @@
         esac
     fi
   elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
-    LDFLAGS_JDK="$LDFLAGS_JDK -z defs -xildoff -ztext"
+    LDFLAGS_JDK="$LDFLAGS_JDK -Wl,-z,defs -xildoff -ztext"
     LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK -norunpath -xnolib"
   elif test "x$TOOLCHAIN_TYPE" = xxlc; then
     LDFLAGS_JDK="${LDFLAGS_JDK} -brtl -bnolibpath -bexpall -bernotok"
@@ -803,17 +828,19 @@
     fi
     LDFLAGS_JDKEXE="${LDFLAGS_JDKEXE} /STACK:$LDFLAGS_STACK_SIZE"
   elif test "x$OPENJDK_TARGET_OS" = xlinux; then
-    LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE -Xlinker --allow-shlib-undefined"
+    LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE -Wl,--allow-shlib-undefined"
   fi
 
   # Customize LDFLAGS for libs
   LDFLAGS_JDKLIB="${LDFLAGS_JDK}"
 
+  LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} ${SHARED_LIBRARY_FLAGS}"
   if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
-    LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -dll -libpath:${OUTPUT_ROOT}/support/modules_libs/java.base"
+    LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} \
+        -libpath:${OUTPUT_ROOT}/support/modules_libs/java.base"
     JDKLIB_LIBS=""
   else
-    LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB}  ${SHARED_LIBRARY_FLAGS} \
+    LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} \
         -L${OUTPUT_ROOT}/support/modules_libs/java.base${OPENJDK_TARGET_CPU_LIBDIR}"
 
     # On some platforms (mac) the linker warns about non existing -L dirs.
--- a/common/autoconf/generated-configure.sh	Tue Dec 15 15:45:53 2015 +0100
+++ b/common/autoconf/generated-configure.sh	Tue Dec 15 11:02:03 2015 +0100
@@ -651,7 +651,6 @@
 MEMORY_SIZE
 NUM_CORES
 ENABLE_INTREE_EC
-SALIB_NAME
 HOTSPOT_MAKE_ARGS
 LIBZIP_CAN_USE_MMAP
 LIBDL
@@ -730,6 +729,7 @@
 CFLAGS_DEBUG_SYMBOLS
 CXX_FLAG_DEPS
 C_FLAG_DEPS
+SHARED_LIBRARY_FLAGS
 SET_SHARED_LIBRARY_MAPFILE
 SET_SHARED_LIBRARY_NAME
 SET_SHARED_LIBRARY_ORIGIN
@@ -743,6 +743,7 @@
 CC_OUT_OPTION
 STRIPFLAGS
 ARFLAGS
+COMPILER_COMMAND_FILE_FLAG
 COMPILER_TARGET_BITS_FLAG
 JT_HOME
 JTREGEXE
@@ -754,6 +755,7 @@
 HOTSPOT_RC
 HOTSPOT_MT
 BUILD_AS
+BUILD_LDCXX
 BUILD_LD
 BUILD_AR
 BUILD_NM
@@ -800,6 +802,7 @@
 PROPER_COMPILER_CC
 TOOLCHAIN_PATH_CC
 POTENTIAL_CC
+TOOLCHAIN_VERSION
 VS_LIB
 VS_INCLUDE
 VS_PATH
@@ -858,11 +861,11 @@
 PRODUCT_SUFFIX
 PRODUCT_NAME
 LAUNCHER_NAME
+TEST_IN_BUILD
 COPYRIGHT_YEAR
 COMPRESS_JARS
 UNLIMITED_CRYPTO
 CACERTS_FILE
-TEST_IN_BUILD
 BUILD_HEADLESS
 SUPPORT_HEADFUL
 SUPPORT_HEADLESS
@@ -911,7 +914,6 @@
 JVM_VARIANT_CORE
 JVM_VARIANT_ZEROSHARK
 JVM_VARIANT_ZERO
-JVM_VARIANT_KERNEL
 JVM_VARIANT_MINIMAL1
 JVM_VARIANT_CLIENT
 JVM_VARIANT_SERVER
@@ -1074,10 +1076,10 @@
 with_output_sync
 with_default_make_target
 enable_headful
-enable_hotspot_test_in_build
 with_cacerts_file
 enable_unlimited_crypto
 with_copyright_year
+enable_hotspot_test_in_build
 with_milestone
 with_update_version
 with_user_release_suffix
@@ -1885,10 +1887,10 @@
                           --with-debug-level=fastdebug) [disabled]
   --disable-headful       disable building headful support (graphical UI
                           support) [enabled]
+  --enable-unlimited-crypto
+                          Enable unlimited crypto policy [disabled]
   --enable-hotspot-test-in-build
                           run the Queens test after Hotspot build [disabled]
-  --enable-unlimited-crypto
-                          Enable unlimited crypto policy [disabled]
   --enable-static-build   enable static library build [disabled]
   --disable-warnings-as-errors
                           do not consider native warnings to be an error
@@ -1925,8 +1927,7 @@
   --with-jdk-variant      JDK variant to build (normal) [normal]
   --with-jvm-interpreter  JVM interpreter to build (template, cpp) [template]
   --with-jvm-variants     JVM variants (separated by commas) to build (server,
-                          client, minimal1, kernel, zero, zeroshark, core)
-                          [server]
+                          client, minimal1, zero, zeroshark, core) [server]
   --with-debug-level      set the debug level (release, fastdebug, slowdebug,
                           optimized (HotSpot build only)) [release]
   --with-devkit           use this devkit for compilers, tools and resources
@@ -4043,16 +4044,83 @@
 # questions.
 #
 
-
-
-
-
-
-
-
-
-
 ###############################################################################
+# Check which interpreter of the JVM we want to build.
+# Currently we have:
+#    template: Template interpreter (the default)
+#    cpp     : C++ interpreter
+
+
+###############################################################################
+# Check which variants of the JVM that we want to build.
+# Currently we have:
+#    server: normal interpreter and a C2 or tiered C1/C2 compiler
+#    client: normal interpreter and C1 (no C2 compiler) (only 32-bit platforms)
+#    minimal1: reduced form of client with optional VM services and features stripped out
+#    zero: no machine code interpreter, no compiler
+#    zeroshark: zero interpreter and shark/llvm compiler backend
+#    core: interpreter only, no compiler (only works on some platforms)
+
+
+
+###############################################################################
+# Setup legacy vars/targets and new vars to deal with different debug levels.
+#
+#    release: no debug information, all optimizations, no asserts.
+#    optimized: no debug information, all optimizations, no asserts, HotSpot target is 'optimized'.
+#    fastdebug: debug information (-g), all optimizations, all asserts
+#    slowdebug: debug information (-g), no optimizations, all asserts
+#
+
+
+
+
+
+
+#
+# Copyright (c) 2011, 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.
+#
+
+###############################################################################
+# Check which variant of the JDK that we want to build.
+# Currently we have:
+#    normal:   standard edition
+# but the custom make system may add other variants
+#
+# Effectively the JDK variant gives a name to a specific set of
+# modules to compile into the JDK.
+
+
+###############################################################################
+# Set the debug level
+#    release: no debug information, all optimizations, no asserts.
+#    optimized: no debug information, all optimizations, no asserts, HotSpot target is 'optimized'.
+#    fastdebug: debug information (-g), all optimizations, all asserts
+#    slowdebug: debug information (-g), no optimizations, all asserts
+
+
+###############################################################################
 #
 # Should we build only OpenJDK even if closed sources are present?
 #
@@ -4060,8 +4128,6 @@
 
 
 
-
-
 ###############################################################################
 #
 # Enable or disable the elliptic curve crypto implementation
@@ -4070,7 +4136,6 @@
 
 
 
-
 ################################################################################
 #
 # Gcov coverage data for hotspot
@@ -4084,8 +4149,6 @@
 #
 
 
-
-
 #
 # Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -4734,7 +4797,7 @@
 #CUSTOM_AUTOCONF_INCLUDE
 
 # Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1450172823
+DATE_WHEN_GENERATED=1450206821
 
 ###############################################################################
 #
@@ -15613,17 +15676,6 @@
 
 # These are needed to be able to create a configuration name (and thus the output directory)
 
-  ###############################################################################
-  #
-  # Check which variant of the JDK that we want to build.
-  # Currently we have:
-  #    normal:   standard edition
-  # but the custom make system may add other variants
-  #
-  # Effectively the JDK variant gives a name to a specific set of
-  # modules to compile into the JDK. In the future, these modules
-  # might even be Jigsaw modules.
-  #
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of the JDK to build" >&5
 $as_echo_n "checking which variant of the JDK to build... " >&6; }
 
@@ -15645,14 +15697,6 @@
 $as_echo "$JDK_VARIANT" >&6; }
 
 
-###############################################################################
-#
-# Check which interpreter of the JVM we want to build.
-# Currently we have:
-#    template: Template interpreter (the default)
-#    cpp     : C++ interpreter
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which interpreter of the JVM to build" >&5
-$as_echo_n "checking which interpreter of the JVM to build... " >&6; }
 
 # Check whether --with-jvm-interpreter was given.
 if test "${with_jvm_interpreter+set}" = set; then :
@@ -15660,35 +15704,23 @@
 fi
 
 
-if test "x$with_jvm_interpreter" = x; then
-     with_jvm_interpreter="template"
-fi
-
-JVM_INTERPRETER="$with_jvm_interpreter"
-
-if test "x$JVM_INTERPRETER" != xtemplate && test "x$JVM_INTERPRETER" != xcpp; then
-   as_fn_error $? "The available JVM interpreters are: template, cpp" "$LINENO" 5
-fi
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_jvm_interpreter" >&5
-$as_echo "$with_jvm_interpreter" >&6; }
-
-
-
-  ###############################################################################
-  #
-  # Check which variants of the JVM that we want to build.
-  # Currently we have:
-  #    server: normal interpreter and a tiered C1/C2 compiler
-  #    client: normal interpreter and C1 (no C2 compiler) (only 32-bit platforms)
-  #    minimal1: reduced form of client with optional VM services and features stripped out
-  #    kernel: kernel footprint JVM that passes the TCK without major performance problems,
-  #             ie normal interpreter and C1, only the serial GC, kernel jvmti etc
-  #    zero: no machine code interpreter, no compiler
-  #    zeroshark: zero interpreter and shark/llvm compiler backend
-#    core: interpreter only, no compiler (only works on some platforms)
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking which interpreter of the JVM to build" >&5
+$as_echo_n "checking which interpreter of the JVM to build... " >&6; }
+  if test "x$with_jvm_interpreter" = x; then
+    JVM_INTERPRETER="template"
+  else
+    JVM_INTERPRETER="$with_jvm_interpreter"
+  fi
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JVM_INTERPRETER" >&5
+$as_echo "$JVM_INTERPRETER" >&6; }
+
+  if test "x$JVM_INTERPRETER" != xtemplate && test "x$JVM_INTERPRETER" != xcpp; then
+    as_fn_error $? "The available JVM interpreters are: template, cpp" "$LINENO" 5
+  fi
+
+
+
+
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variants of the JVM to build" >&5
 $as_echo_n "checking which variants of the JVM to build... " >&6; }
 
@@ -15703,10 +15735,10 @@
   fi
 
   JVM_VARIANTS=",$with_jvm_variants,"
-  TEST_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/server,//' -e 's/client,//'  -e 's/minimal1,//' -e 's/kernel,//' -e 's/zero,//' -e 's/zeroshark,//' -e 's/core,//'`
+  TEST_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/server,//' -e 's/client,//'  -e 's/minimal1,//' -e 's/zero,//' -e 's/zeroshark,//' -e 's/core,//'`
 
   if test "x$TEST_VARIANTS" != "x,"; then
-     as_fn_error $? "The available JVM variants are: server, client, minimal1, kernel, zero, zeroshark, core" "$LINENO" 5
+    as_fn_error $? "The available JVM variants are: server, client, minimal1, zero, zeroshark, core" "$LINENO" 5
   fi
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_jvm_variants" >&5
 $as_echo "$with_jvm_variants" >&6; }
@@ -15714,7 +15746,6 @@
   JVM_VARIANT_SERVER=`$ECHO "$JVM_VARIANTS" | $SED -e '/,server,/!s/.*/false/g' -e '/,server,/s/.*/true/g'`
   JVM_VARIANT_CLIENT=`$ECHO "$JVM_VARIANTS" | $SED -e '/,client,/!s/.*/false/g' -e '/,client,/s/.*/true/g'`
   JVM_VARIANT_MINIMAL1=`$ECHO "$JVM_VARIANTS" | $SED -e '/,minimal1,/!s/.*/false/g' -e '/,minimal1,/s/.*/true/g'`
-  JVM_VARIANT_KERNEL=`$ECHO "$JVM_VARIANTS" | $SED -e '/,kernel,/!s/.*/false/g' -e '/,kernel,/s/.*/true/g'`
   JVM_VARIANT_ZERO=`$ECHO "$JVM_VARIANTS" | $SED -e '/,zero,/!s/.*/false/g' -e '/,zero,/s/.*/true/g'`
   JVM_VARIANT_ZEROSHARK=`$ECHO "$JVM_VARIANTS" | $SED -e '/,zeroshark,/!s/.*/false/g' -e '/,zeroshark,/s/.*/true/g'`
   JVM_VARIANT_CORE=`$ECHO "$JVM_VARIANTS" | $SED -e '/,core,/!s/.*/false/g' -e '/,core,/s/.*/true/g'`
@@ -15724,11 +15755,6 @@
       as_fn_error $? "You cannot build a client JVM for a 64-bit machine." "$LINENO" 5
     fi
   fi
-  if test "x$JVM_VARIANT_KERNEL" = xtrue; then
-    if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
-      as_fn_error $? "You cannot build a kernel JVM for a 64-bit machine." "$LINENO" 5
-    fi
-  fi
   if test "x$JVM_VARIANT_MINIMAL1" = xtrue; then
     if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
       as_fn_error $? "You cannot build a minimal JVM for a 64-bit machine." "$LINENO" 5
@@ -15737,13 +15763,16 @@
 
   # Replace the commas with AND for use in the build directory name.
   ANDED_JVM_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/^,//' -e 's/,$//' -e 's/,/AND/g'`
-  COUNT_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/server,/1/' -e 's/client,/1/' -e 's/minimal1,/1/' -e 's/kernel,/1/' -e 's/zero,/1/' -e 's/zeroshark,/1/' -e 's/core,/1/'`
+  COUNT_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/server,/1/' -e 's/client,/1/' -e 's/minimal1,/1/' -e 's/zero,/1/' -e 's/zeroshark,/1/' -e 's/core,/1/'`
   if test "x$COUNT_VARIANTS" != "x,1"; then
     BUILDING_MULTIPLE_JVM_VARIANTS=yes
   else
     BUILDING_MULTIPLE_JVM_VARIANTS=no
   fi
 
+  if test "x$JVM_VARIANT_ZERO" = xtrue && test "x$BUILDING_MULTIPLE_JVM_VARIANTS" = xyes; then
+    as_fn_error $? "You cannot build multiple variants with zero." "$LINENO" 5
+  fi
 
 
 
@@ -15775,14 +15804,6 @@
 
 
 
-  ###############################################################################
-  #
-  # Set the debug level
-  #    release: no debug information, all optimizations, no asserts.
-  #    optimized: no debug information, all optimizations, no asserts, HotSpot target is 'optimized'.
-  #    fastdebug: debug information (-g), all optimizations, all asserts
-  #    slowdebug: debug information (-g), no optimizations, all asserts
-  #
   DEBUG_LEVEL="release"
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking which debug level to use" >&5
 $as_echo_n "checking which debug level to use... " >&6; }
@@ -15819,11 +15840,6 @@
   fi
 
 
-  ###############################################################################
-  #
-  # Setup legacy vars/targets and new vars to deal with different debug levels.
-  #
-
   case $DEBUG_LEVEL in
     release )
       VARIANT="OPT"
@@ -15893,10 +15909,6 @@
     HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}minimal1 "
   fi
 
-  if test "x$JVM_VARIANT_KERNEL" = xtrue; then
-    HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}kernel "
-  fi
-
   if test "x$JVM_VARIANT_ZERO" = xtrue; then
     HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}zero "
   fi
@@ -23128,12 +23140,8 @@
 
 # We need build & target for this.
 
-
-  ###############################################################################
-  #
   # Should we build a JDK/JVM with headful support (ie a graphical ui)?
   # We always build headless support.
-  #
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking headful support" >&5
 $as_echo_n "checking headful support... " >&6; }
   # Check whether --enable-headful was given.
@@ -23165,6 +23173,55 @@
 
 
 
+  # Choose cacerts source file
+
+# Check whether --with-cacerts-file was given.
+if test "${with_cacerts_file+set}" = set; then :
+  withval=$with_cacerts_file;
+fi
+
+  if test "x$with_cacerts_file" != x; then
+    CACERTS_FILE=$with_cacerts_file
+  fi
+
+
+  # Enable or disable unlimited crypto
+  # Check whether --enable-unlimited-crypto was given.
+if test "${enable_unlimited_crypto+set}" = set; then :
+  enableval=$enable_unlimited_crypto;
+else
+  enable_unlimited_crypto=no
+fi
+
+  if test "x$enable_unlimited_crypto" = "xyes"; then
+    UNLIMITED_CRYPTO=true
+  else
+    UNLIMITED_CRYPTO=false
+  fi
+
+
+  # Compress jars
+  COMPRESS_JARS=false
+
+
+
+  # Setup default copyright year. Mostly overridden when building close to a new year.
+
+# Check whether --with-copyright-year was given.
+if test "${with_copyright_year+set}" = set; then :
+  withval=$with_copyright_year;
+fi
+
+  if test "x$with_copyright_year" = xyes; then
+    as_fn_error $? "Copyright year must have a value" "$LINENO" 5
+  elif test "x$with_copyright_year" != x; then
+    COPYRIGHT_YEAR="$with_copyright_year"
+  else
+    COPYRIGHT_YEAR=`date +'%Y'`
+  fi
+
+
+
   # Control wether Hotspot runs Queens test after build.
   # Check whether --enable-hotspot-test-in-build was given.
 if test "${enable_hotspot_test_in_build+set}" = set; then :
@@ -23180,63 +23237,6 @@
   fi
 
 
-  ###############################################################################
-  #
-  # Choose cacerts source file
-  #
-
-# Check whether --with-cacerts-file was given.
-if test "${with_cacerts_file+set}" = set; then :
-  withval=$with_cacerts_file;
-fi
-
-  if test "x$with_cacerts_file" != x; then
-    CACERTS_FILE=$with_cacerts_file
-  fi
-
-
-  ###############################################################################
-  #
-  # Enable or disable unlimited crypto
-  #
-  # Check whether --enable-unlimited-crypto was given.
-if test "${enable_unlimited_crypto+set}" = set; then :
-  enableval=$enable_unlimited_crypto;
-else
-  enable_unlimited_crypto=no
-fi
-
-  if test "x$enable_unlimited_crypto" = "xyes"; then
-    UNLIMITED_CRYPTO=true
-  else
-    UNLIMITED_CRYPTO=false
-  fi
-
-
-  ###############################################################################
-  #
-  # Compress jars
-  #
-  COMPRESS_JARS=false
-
-
-
-  # Setup default copyright year. Mostly overridden when building close to a new year.
-
-# Check whether --with-copyright-year was given.
-if test "${with_copyright_year+set}" = set; then :
-  withval=$with_copyright_year;
-fi
-
-  if test "x$with_copyright_year" = xyes; then
-    as_fn_error $? "Copyright year must have a value" "$LINENO" 5
-  elif test "x$with_copyright_year" != x; then
-    COPYRIGHT_YEAR="$with_copyright_year"
-  else
-    COPYRIGHT_YEAR=`date +'%Y'`
-  fi
-
-
 
   # Warn user that old version arguments are deprecated.
 
@@ -31438,7 +31438,11 @@
     # The microsoft toolchain also requires INCLUDE and LIB to be set.
     export INCLUDE="$VS_INCLUDE"
     export LIB="$VS_LIB"
-  fi
+  else
+    # Currently we do not define this for other toolchains. This might change as the need arise.
+    TOOLCHAIN_VERSION=
+  fi
+
 
   # For solaris we really need solaris tools, and not the GNU equivalent.
   # The build tools on Solaris reside in /usr/ccs (C Compilation System),
@@ -45220,6 +45224,7 @@
     BUILD_AS="$BUILD_CC -c"
     # Just like for the target compiler, use the compiler as linker
     BUILD_LD="$BUILD_CC"
+    BUILD_LDCXX="$BUILD_CXX"
 
     PATH="$OLDPATH"
   else
@@ -45228,6 +45233,7 @@
     BUILD_CC="$CC"
     BUILD_CXX="$CXX"
     BUILD_LD="$LD"
+    BUILD_LDCXX="$LDCXX"
     BUILD_NM="$NM"
     BUILD_AS="$AS"
     BUILD_SYSROOT_CFLAGS="$SYSROOT_CFLAGS"
@@ -45245,6 +45251,7 @@
 
 
 
+
   if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
     # For hotspot, we need these in Windows mixed path,
     # so rewrite them all. Need added .exe suffix.
@@ -45404,7 +45411,7 @@
 
 
     # "-z relro" supported in GNU binutils 2.17 and later
-    LINKER_RELRO_FLAG="-Xlinker -z -Xlinker relro"
+    LINKER_RELRO_FLAG="-Wl,-z,relro"
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking if linker supports \"$LINKER_RELRO_FLAG\"" >&5
 $as_echo_n "checking if linker supports \"$LINKER_RELRO_FLAG\"... " >&6; }
@@ -45454,7 +45461,7 @@
 
 
     # "-z now" supported in GNU binutils 2.11 and later
-    LINKER_NOW_FLAG="-Xlinker -z -Xlinker now"
+    LINKER_NOW_FLAG="-Wl,-z,now"
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking if linker supports \"$LINKER_NOW_FLAG\"" >&5
 $as_echo_n "checking if linker supports \"$LINKER_NOW_FLAG\"... " >&6; }
@@ -45512,7 +45519,7 @@
 $as_echo_n "checking for broken SuSE 'ld' which only understands anonymous version tags in executables... " >&6; }
     $ECHO "SUNWprivate_1.1 { local: *; };" > version-script.map
     $ECHO "int main() { }" > main.c
-    if $CXX -Xlinker -version-script=version-script.map main.c 2>&5 >&5; then
+    if $CXX -Wl,-version-script=version-script.map main.c 2>&5 >&5; then
       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
       USING_BROKEN_SUSE_LD=no
@@ -45911,12 +45918,16 @@
 
 
 
-  # Option used to tell the compiler whether to create 32- or 64-bit executables
+  # COMPILER_TARGET_BITS_FLAG  : option for selecting 32- or 64-bit output
+  # COMPILER_COMMAND_FILE_FLAG : option for passing a command file to the compiler
   if test "x$TOOLCHAIN_TYPE" = xxlc; then
     COMPILER_TARGET_BITS_FLAG="-q"
+    COMPILER_COMMAND_FILE_FLAG="-f"
   else
     COMPILER_TARGET_BITS_FLAG="-m"
-  fi
+    COMPILER_COMMAND_FILE_FLAG="@"
+  fi
+
 
 
   # FIXME: figure out if we should select AR flags depending on OS or toolchain.
@@ -46652,37 +46663,38 @@
       else
         SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 $PICFLAG"
       fi
-      SET_EXECUTABLE_ORIGIN='-Xlinker -rpath -Xlinker @loader_path/.'
+      SET_EXECUTABLE_ORIGIN='-Wl,-rpath,@loader_path/.'
       SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN"
-      SET_SHARED_LIBRARY_NAME='-Xlinker -install_name -Xlinker @rpath/$1'
+      SET_SHARED_LIBRARY_NAME='-Wl,-install_name,@rpath/$1'
       SET_SHARED_LIBRARY_MAPFILE=''
     else
       # Default works for linux, might work on other platforms as well.
       SHARED_LIBRARY_FLAGS='-shared'
-      SET_EXECUTABLE_ORIGIN='-Xlinker -rpath -Xlinker \$$$$ORIGIN$1'
-      SET_SHARED_LIBRARY_ORIGIN="-Xlinker -z -Xlinker origin $SET_EXECUTABLE_ORIGIN"
-      SET_SHARED_LIBRARY_NAME='-Xlinker -soname=$1'
-      SET_SHARED_LIBRARY_MAPFILE='-Xlinker -version-script=$1'
+      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'
     fi
   elif test "x$TOOLCHAIN_TYPE" = xclang; then
-    PICFLAG=''
     C_FLAG_REORDER=''
     CXX_FLAG_REORDER=''
 
     if test "x$OPENJDK_TARGET_OS" = xmacosx; then
       # Linking is different on MacOSX
+      PICFLAG=''
       SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 $PICFLAG"
-      SET_EXECUTABLE_ORIGIN='-Xlinker -rpath -Xlinker @loader_path/.'
+      SET_EXECUTABLE_ORIGIN='-Wl,-rpath,@loader_path/.'
       SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN"
-      SET_SHARED_LIBRARY_NAME='-Xlinker -install_name -Xlinker @rpath/$1'
+      SET_SHARED_LIBRARY_NAME='-Wl,-install_name,@rpath/$1'
       SET_SHARED_LIBRARY_MAPFILE=''
     else
       # Default works for linux, might work on other platforms as well.
+      PICFLAG='-fPIC'
       SHARED_LIBRARY_FLAGS='-shared'
-      SET_EXECUTABLE_ORIGIN='-Xlinker -rpath -Xlinker \$$$$ORIGIN$1'
-      SET_SHARED_LIBRARY_ORIGIN="-Xlinker -z -Xlinker origin $SET_EXECUTABLE_ORIGIN"
-      SET_SHARED_LIBRARY_NAME='-Xlinker -soname=$1'
-      SET_SHARED_LIBRARY_MAPFILE='-Xlinker -version-script=$1'
+      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'
     fi
   elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
     PICFLAG="-KPIC"
@@ -46691,7 +46703,7 @@
     SHARED_LIBRARY_FLAGS="-G"
     SET_EXECUTABLE_ORIGIN='-R\$$$$ORIGIN$1'
     SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN"
-    SET_SHARED_LIBRARY_NAME=''
+    SET_SHARED_LIBRARY_NAME='-h $1'
     SET_SHARED_LIBRARY_MAPFILE='-M$1'
   elif test "x$TOOLCHAIN_TYPE" = xxlc; then
     PICFLAG="-qpic=large"
@@ -46706,7 +46718,7 @@
     PICFLAG=""
     C_FLAG_REORDER=''
     CXX_FLAG_REORDER=''
-    SHARED_LIBRARY_FLAGS="-LD"
+    SHARED_LIBRARY_FLAGS="-dll"
     SET_EXECUTABLE_ORIGIN=''
     SET_SHARED_LIBRARY_ORIGIN=''
     SET_SHARED_LIBRARY_NAME=''
@@ -46720,6 +46732,7 @@
 
 
 
+
   if test "x$OPENJDK_TARGET_OS" = xsolaris; then
     CFLAGS_JDK="${CFLAGS_JDK} -D__solaris__"
     CXXFLAGS_JDK="${CXXFLAGS_JDK} -D__solaris__"
@@ -47028,6 +47041,25 @@
         CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing"
         ;;
     esac
+  elif test "x$TOOLCHAIN_TYPE" = xclang; then
+    if test "x$OPENJDK_TARGET_OS" = xlinux; then
+	    if test "x$OPENJDK_TARGET_CPU" = xx86; then
+	      # Force compatibility with i586 on 32 bit intel platforms.
+	      COMMON_CCXXFLAGS="${COMMON_CCXXFLAGS} -march=i586"
+	    fi
+	    COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \
+	        -pipe -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE"
+	    case $OPENJDK_TARGET_CPU_ARCH in
+	      ppc )
+	        # on ppc 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 -fno-omit-frame-pointer"
+	        CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing"
+	        ;;
+	    esac
+    fi
   elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
     COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS"
     if test "x$OPENJDK_TARGET_CPU_ARCH" = xx86; then
@@ -47203,17 +47235,17 @@
     # If this is a --hash-style=gnu system, use --hash-style=both, why?
     # We have previously set HAS_GNU_HASH if this is the case
     if test -n "$HAS_GNU_HASH"; then
-      LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker --hash-style=both"
+      LDFLAGS_JDK="${LDFLAGS_JDK} -Wl,--hash-style=both"
     fi
     if test "x$OPENJDK_TARGET_OS" = xlinux; then
       # And since we now know that the linker is gnu, then add -z defs, to forbid
       # undefined symbols in object files.
-      LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -z -Xlinker defs"
+      LDFLAGS_JDK="${LDFLAGS_JDK} -Wl,-z,defs"
       case $DEBUG_LEVEL in
         release )
           # tell linker to optimize libraries.
           # Should this be supplied to the OSS linker as well?
-          LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -O1"
+          LDFLAGS_JDK="${LDFLAGS_JDK} -Wl,-O1"
           ;;
         slowdebug )
           if test "x$HAS_LINKER_NOW" = "xtrue"; then
@@ -47240,7 +47272,7 @@
         esac
     fi
   elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
-    LDFLAGS_JDK="$LDFLAGS_JDK -z defs -xildoff -ztext"
+    LDFLAGS_JDK="$LDFLAGS_JDK -Wl,-z,defs -xildoff -ztext"
     LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK -norunpath -xnolib"
   elif test "x$TOOLCHAIN_TYPE" = xxlc; then
     LDFLAGS_JDK="${LDFLAGS_JDK} -brtl -bnolibpath -bexpall -bernotok"
@@ -47258,17 +47290,19 @@
     fi
     LDFLAGS_JDKEXE="${LDFLAGS_JDKEXE} /STACK:$LDFLAGS_STACK_SIZE"
   elif test "x$OPENJDK_TARGET_OS" = xlinux; then
-    LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE -Xlinker --allow-shlib-undefined"
+    LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE -Wl,--allow-shlib-undefined"
   fi
 
   # Customize LDFLAGS for libs
   LDFLAGS_JDKLIB="${LDFLAGS_JDK}"
 
+  LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} ${SHARED_LIBRARY_FLAGS}"
   if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
-    LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -dll -libpath:${OUTPUT_ROOT}/support/modules_libs/java.base"
+    LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} \
+        -libpath:${OUTPUT_ROOT}/support/modules_libs/java.base"
     JDKLIB_LIBS=""
   else
-    LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB}  ${SHARED_LIBRARY_FLAGS} \
+    LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} \
         -L${OUTPUT_ROOT}/support/modules_libs/java.base${OPENJDK_TARGET_CPU_LIBDIR}"
 
     # On some platforms (mac) the linker warns about non existing -L dirs.
@@ -57091,13 +57125,6 @@
   HOTSPOT_MAKE_ARGS="$HOTSPOT_TARGET"
 
 
-  # The name of the Service Agent jar.
-  SALIB_NAME="${LIBRARY_PREFIX}saproc${SHARED_LIBRARY_SUFFIX}"
-  if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
-    SALIB_NAME="${LIBRARY_PREFIX}sawindbg${SHARED_LIBRARY_SUFFIX}"
-  fi
-
-
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking if elliptic curve crypto implementation is present" >&5
 $as_echo_n "checking if elliptic curve crypto implementation is present... " >&6; }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/autoconf/hotspot.m4	Tue Dec 15 11:02:03 2015 +0100
@@ -0,0 +1,268 @@
+#
+# Copyright (c) 2011, 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.
+#
+
+###############################################################################
+# Check which interpreter of the JVM we want to build.
+# Currently we have:
+#    template: Template interpreter (the default)
+#    cpp     : C++ interpreter
+AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_INTERPRETER],
+[
+  AC_ARG_WITH([jvm-interpreter], [AS_HELP_STRING([--with-jvm-interpreter],
+    [JVM interpreter to build (template, cpp) @<:@template@:>@])])
+
+  AC_MSG_CHECKING([which interpreter of the JVM to build])
+  if test "x$with_jvm_interpreter" = x; then
+    JVM_INTERPRETER="template"
+  else
+    JVM_INTERPRETER="$with_jvm_interpreter"
+  fi
+  AC_MSG_RESULT([$JVM_INTERPRETER])
+
+  if test "x$JVM_INTERPRETER" != xtemplate && test "x$JVM_INTERPRETER" != xcpp; then
+    AC_MSG_ERROR([The available JVM interpreters are: template, cpp])
+  fi
+
+  AC_SUBST(JVM_INTERPRETER)
+])
+
+###############################################################################
+# Check which variants of the JVM that we want to build.
+# Currently we have:
+#    server: normal interpreter and a C2 or tiered C1/C2 compiler
+#    client: normal interpreter and C1 (no C2 compiler) (only 32-bit platforms)
+#    minimal1: reduced form of client with optional VM services and features stripped out
+#    zero: no machine code interpreter, no compiler
+#    zeroshark: zero interpreter and shark/llvm compiler backend
+#    core: interpreter only, no compiler (only works on some platforms)
+AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_VARIANTS],
+[
+  AC_MSG_CHECKING([which variants of the JVM to build])
+  AC_ARG_WITH([jvm-variants], [AS_HELP_STRING([--with-jvm-variants],
+      [JVM variants (separated by commas) to build (server, client, minimal1, zero, zeroshark, core) @<:@server@:>@])])
+
+  if test "x$with_jvm_variants" = x; then
+    with_jvm_variants="server"
+  fi
+
+  JVM_VARIANTS=",$with_jvm_variants,"
+  TEST_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/server,//' -e 's/client,//'  -e 's/minimal1,//' -e 's/zero,//' -e 's/zeroshark,//' -e 's/core,//'`
+
+  if test "x$TEST_VARIANTS" != "x,"; then
+    AC_MSG_ERROR([The available JVM variants are: server, client, minimal1, zero, zeroshark, core])
+  fi
+  AC_MSG_RESULT([$with_jvm_variants])
+
+  JVM_VARIANT_SERVER=`$ECHO "$JVM_VARIANTS" | $SED -e '/,server,/!s/.*/false/g' -e '/,server,/s/.*/true/g'`
+  JVM_VARIANT_CLIENT=`$ECHO "$JVM_VARIANTS" | $SED -e '/,client,/!s/.*/false/g' -e '/,client,/s/.*/true/g'`
+  JVM_VARIANT_MINIMAL1=`$ECHO "$JVM_VARIANTS" | $SED -e '/,minimal1,/!s/.*/false/g' -e '/,minimal1,/s/.*/true/g'`
+  JVM_VARIANT_ZERO=`$ECHO "$JVM_VARIANTS" | $SED -e '/,zero,/!s/.*/false/g' -e '/,zero,/s/.*/true/g'`
+  JVM_VARIANT_ZEROSHARK=`$ECHO "$JVM_VARIANTS" | $SED -e '/,zeroshark,/!s/.*/false/g' -e '/,zeroshark,/s/.*/true/g'`
+  JVM_VARIANT_CORE=`$ECHO "$JVM_VARIANTS" | $SED -e '/,core,/!s/.*/false/g' -e '/,core,/s/.*/true/g'`
+
+  if test "x$JVM_VARIANT_CLIENT" = xtrue; then
+    if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
+      AC_MSG_ERROR([You cannot build a client JVM for a 64-bit machine.])
+    fi
+  fi
+  if test "x$JVM_VARIANT_MINIMAL1" = xtrue; then
+    if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
+      AC_MSG_ERROR([You cannot build a minimal JVM for a 64-bit machine.])
+    fi
+  fi
+
+  # Replace the commas with AND for use in the build directory name.
+  ANDED_JVM_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/^,//' -e 's/,$//' -e 's/,/AND/g'`
+  COUNT_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/server,/1/' -e 's/client,/1/' -e 's/minimal1,/1/' -e 's/zero,/1/' -e 's/zeroshark,/1/' -e 's/core,/1/'`
+  if test "x$COUNT_VARIANTS" != "x,1"; then
+    BUILDING_MULTIPLE_JVM_VARIANTS=yes
+  else
+    BUILDING_MULTIPLE_JVM_VARIANTS=no
+  fi
+
+  if test "x$JVM_VARIANT_ZERO" = xtrue && test "x$BUILDING_MULTIPLE_JVM_VARIANTS" = xyes; then
+    AC_MSG_ERROR([You cannot build multiple variants with zero.])
+  fi
+
+  AC_SUBST(JVM_VARIANTS)
+  AC_SUBST(JVM_VARIANT_SERVER)
+  AC_SUBST(JVM_VARIANT_CLIENT)
+  AC_SUBST(JVM_VARIANT_MINIMAL1)
+  AC_SUBST(JVM_VARIANT_ZERO)
+  AC_SUBST(JVM_VARIANT_ZEROSHARK)
+  AC_SUBST(JVM_VARIANT_CORE)
+
+  INCLUDE_SA=true
+  if test "x$JVM_VARIANT_ZERO" = xtrue ; then
+    INCLUDE_SA=false
+  fi
+  if test "x$JVM_VARIANT_ZEROSHARK" = xtrue ; then
+    INCLUDE_SA=false
+  fi
+  if test "x$OPENJDK_TARGET_OS" = xaix ; then
+    INCLUDE_SA=false
+  fi
+  if test "x$OPENJDK_TARGET_CPU" = xaarch64; then
+    INCLUDE_SA=false
+  fi
+  AC_SUBST(INCLUDE_SA)
+
+  if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
+    MACOSX_UNIVERSAL="true"
+  fi
+
+  AC_SUBST(MACOSX_UNIVERSAL)
+])
+
+
+###############################################################################
+# Setup legacy vars/targets and new vars to deal with different debug levels.
+#
+#    release: no debug information, all optimizations, no asserts.
+#    optimized: no debug information, all optimizations, no asserts, HotSpot target is 'optimized'.
+#    fastdebug: debug information (-g), all optimizations, all asserts
+#    slowdebug: debug information (-g), no optimizations, all asserts
+#
+AC_DEFUN_ONCE([HOTSPOT_SETUP_DEBUG_LEVEL],
+[
+  case $DEBUG_LEVEL in
+    release )
+      VARIANT="OPT"
+      FASTDEBUG="false"
+      DEBUG_CLASSFILES="false"
+      BUILD_VARIANT_RELEASE=""
+      HOTSPOT_DEBUG_LEVEL="product"
+      HOTSPOT_EXPORT="product"
+      ;;
+    fastdebug )
+      VARIANT="DBG"
+      FASTDEBUG="true"
+      DEBUG_CLASSFILES="true"
+      BUILD_VARIANT_RELEASE="-fastdebug"
+      HOTSPOT_DEBUG_LEVEL="fastdebug"
+      HOTSPOT_EXPORT="fastdebug"
+      ;;
+    slowdebug )
+      VARIANT="DBG"
+      FASTDEBUG="false"
+      DEBUG_CLASSFILES="true"
+      BUILD_VARIANT_RELEASE="-debug"
+      HOTSPOT_DEBUG_LEVEL="debug"
+      HOTSPOT_EXPORT="debug"
+      ;;
+    optimized )
+      VARIANT="OPT"
+      FASTDEBUG="false"
+      DEBUG_CLASSFILES="false"
+      BUILD_VARIANT_RELEASE="-optimized"
+      HOTSPOT_DEBUG_LEVEL="optimized"
+      HOTSPOT_EXPORT="optimized"
+      ;;
+  esac
+
+  # The debug level 'optimized' is a little special because it is currently only
+  # applicable to the HotSpot build where it means to build a completely
+  # optimized version of the VM without any debugging code (like for the
+  # 'release' debug level which is called 'product' in the HotSpot build) but
+  # with the exception that it can contain additional code which is otherwise
+  # protected by '#ifndef PRODUCT' macros. These 'optimized' builds are used to
+  # test new and/or experimental features which are not intended for customer
+  # shipment. Because these new features need to be tested and benchmarked in
+  # real world scenarios, we want to build the containing JDK at the 'release'
+  # debug level.
+  if test "x$DEBUG_LEVEL" = xoptimized; then
+    DEBUG_LEVEL="release"
+  fi
+
+  #####
+  # Generate the legacy makefile targets for hotspot.
+  # The hotspot api for selecting the build artifacts, really, needs to be improved.
+  # JDK-7195896 will fix this on the hotspot side by using the JVM_VARIANT_* variables to
+  # determine what needs to be built. All we will need to set here is all_product, all_fastdebug etc
+  # But until then ...
+  HOTSPOT_TARGET=""
+
+  if test "x$JVM_VARIANT_SERVER" = xtrue; then
+    HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL} "
+  fi
+
+  if test "x$JVM_VARIANT_CLIENT" = xtrue; then
+    HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}1 "
+  fi
+
+  if test "x$JVM_VARIANT_MINIMAL1" = xtrue; then
+    HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}minimal1 "
+  fi
+
+  if test "x$JVM_VARIANT_ZERO" = xtrue; then
+    HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}zero "
+  fi
+
+  if test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then
+    HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}shark "
+  fi
+
+  if test "x$JVM_VARIANT_CORE" = xtrue; then
+    HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}core "
+  fi
+
+  HOTSPOT_TARGET="$HOTSPOT_TARGET docs export_$HOTSPOT_EXPORT"
+
+  # On Macosx universal binaries are produced, but they only contain
+  # 64 bit intel. This invalidates control of which jvms are built
+  # from configure, but only server is valid anyway. Fix this
+  # when hotspot makefiles are rewritten.
+  if test "x$MACOSX_UNIVERSAL" = xtrue; then
+    HOTSPOT_TARGET=universal_${HOTSPOT_EXPORT}
+  fi
+
+  #####
+
+  AC_SUBST(DEBUG_LEVEL)
+  AC_SUBST(VARIANT)
+  AC_SUBST(FASTDEBUG)
+  AC_SUBST(DEBUG_CLASSFILES)
+  AC_SUBST(BUILD_VARIANT_RELEASE)
+])
+
+AC_DEFUN_ONCE([HOTSPOT_SETUP_HOTSPOT_OPTIONS],
+[
+  # Control wether Hotspot runs Queens test after build.
+  AC_ARG_ENABLE([hotspot-test-in-build], [AS_HELP_STRING([--enable-hotspot-test-in-build],
+      [run the Queens test after Hotspot build @<:@disabled@:>@])],,
+      [enable_hotspot_test_in_build=no])
+  if test "x$enable_hotspot_test_in_build" = "xyes"; then
+    TEST_IN_BUILD=true
+  else
+    TEST_IN_BUILD=false
+  fi
+  AC_SUBST(TEST_IN_BUILD)
+])
+
+AC_DEFUN_ONCE([HOTSPOT_SETUP_BUILD_TWEAKS],
+[
+  HOTSPOT_MAKE_ARGS="$HOTSPOT_TARGET"
+  AC_SUBST(HOTSPOT_MAKE_ARGS)
+])
--- a/common/autoconf/jdk-options.m4	Tue Dec 15 15:45:53 2015 +0100
+++ b/common/autoconf/jdk-options.m4	Tue Dec 15 11:02:03 2015 +0100
@@ -23,19 +23,16 @@
 # questions.
 #
 
+###############################################################################
+# Check which variant of the JDK that we want to build.
+# Currently we have:
+#    normal:   standard edition
+# but the custom make system may add other variants
+#
+# Effectively the JDK variant gives a name to a specific set of
+# modules to compile into the JDK.
 AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_VARIANT],
 [
-  ###############################################################################
-  #
-  # Check which variant of the JDK that we want to build.
-  # Currently we have:
-  #    normal:   standard edition
-  # but the custom make system may add other variants
-  #
-  # Effectively the JDK variant gives a name to a specific set of
-  # modules to compile into the JDK. In the future, these modules
-  # might even be Jigsaw modules.
-  #
   AC_MSG_CHECKING([which variant of the JDK to build])
   AC_ARG_WITH([jdk-variant], [AS_HELP_STRING([--with-jdk-variant],
       [JDK variant to build (normal) @<:@normal@:>@])])
@@ -51,138 +48,14 @@
   AC_MSG_RESULT([$JDK_VARIANT])
 ])
 
-AC_DEFUN_ONCE([JDKOPT_SETUP_JVM_INTERPRETER],
-[
 ###############################################################################
-#
-# Check which interpreter of the JVM we want to build.
-# Currently we have:
-#    template: Template interpreter (the default)
-#    cpp     : C++ interpreter
-AC_MSG_CHECKING([which interpreter of the JVM to build])
-AC_ARG_WITH([jvm-interpreter], [AS_HELP_STRING([--with-jvm-interpreter],
-	[JVM interpreter to build (template, cpp) @<:@template@:>@])])
-
-if test "x$with_jvm_interpreter" = x; then
-     with_jvm_interpreter="template"
-fi
-
-JVM_INTERPRETER="$with_jvm_interpreter"
-
-if test "x$JVM_INTERPRETER" != xtemplate && test "x$JVM_INTERPRETER" != xcpp; then
-   AC_MSG_ERROR([The available JVM interpreters are: template, cpp])
-fi
-
-AC_SUBST(JVM_INTERPRETER)
-
-AC_MSG_RESULT([$with_jvm_interpreter])
-])
-
-AC_DEFUN_ONCE([JDKOPT_SETUP_JVM_VARIANTS],
-[
-
-  ###############################################################################
-  #
-  # Check which variants of the JVM that we want to build.
-  # Currently we have:
-  #    server: normal interpreter and a tiered C1/C2 compiler
-  #    client: normal interpreter and C1 (no C2 compiler) (only 32-bit platforms)
-  #    minimal1: reduced form of client with optional VM services and features stripped out
-  #    kernel: kernel footprint JVM that passes the TCK without major performance problems,
-  #             ie normal interpreter and C1, only the serial GC, kernel jvmti etc
-  #    zero: no machine code interpreter, no compiler
-  #    zeroshark: zero interpreter and shark/llvm compiler backend
-#    core: interpreter only, no compiler (only works on some platforms)
-  AC_MSG_CHECKING([which variants of the JVM to build])
-  AC_ARG_WITH([jvm-variants], [AS_HELP_STRING([--with-jvm-variants],
-	[JVM variants (separated by commas) to build (server, client, minimal1, kernel, zero, zeroshark, core) @<:@server@:>@])])
-
-  if test "x$with_jvm_variants" = x; then
-    with_jvm_variants="server"
-  fi
-
-  JVM_VARIANTS=",$with_jvm_variants,"
-  TEST_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/server,//' -e 's/client,//'  -e 's/minimal1,//' -e 's/kernel,//' -e 's/zero,//' -e 's/zeroshark,//' -e 's/core,//'`
-
-  if test "x$TEST_VARIANTS" != "x,"; then
-     AC_MSG_ERROR([The available JVM variants are: server, client, minimal1, kernel, zero, zeroshark, core])
-  fi
-  AC_MSG_RESULT([$with_jvm_variants])
-
-  JVM_VARIANT_SERVER=`$ECHO "$JVM_VARIANTS" | $SED -e '/,server,/!s/.*/false/g' -e '/,server,/s/.*/true/g'`
-  JVM_VARIANT_CLIENT=`$ECHO "$JVM_VARIANTS" | $SED -e '/,client,/!s/.*/false/g' -e '/,client,/s/.*/true/g'`
-  JVM_VARIANT_MINIMAL1=`$ECHO "$JVM_VARIANTS" | $SED -e '/,minimal1,/!s/.*/false/g' -e '/,minimal1,/s/.*/true/g'`
-  JVM_VARIANT_KERNEL=`$ECHO "$JVM_VARIANTS" | $SED -e '/,kernel,/!s/.*/false/g' -e '/,kernel,/s/.*/true/g'`
-  JVM_VARIANT_ZERO=`$ECHO "$JVM_VARIANTS" | $SED -e '/,zero,/!s/.*/false/g' -e '/,zero,/s/.*/true/g'`
-  JVM_VARIANT_ZEROSHARK=`$ECHO "$JVM_VARIANTS" | $SED -e '/,zeroshark,/!s/.*/false/g' -e '/,zeroshark,/s/.*/true/g'`
-  JVM_VARIANT_CORE=`$ECHO "$JVM_VARIANTS" | $SED -e '/,core,/!s/.*/false/g' -e '/,core,/s/.*/true/g'`
-
-  if test "x$JVM_VARIANT_CLIENT" = xtrue; then
-    if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
-      AC_MSG_ERROR([You cannot build a client JVM for a 64-bit machine.])
-    fi
-  fi
-  if test "x$JVM_VARIANT_KERNEL" = xtrue; then
-    if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
-      AC_MSG_ERROR([You cannot build a kernel JVM for a 64-bit machine.])
-    fi
-  fi
-  if test "x$JVM_VARIANT_MINIMAL1" = xtrue; then
-    if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
-      AC_MSG_ERROR([You cannot build a minimal JVM for a 64-bit machine.])
-    fi
-  fi
-
-  # Replace the commas with AND for use in the build directory name.
-  ANDED_JVM_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/^,//' -e 's/,$//' -e 's/,/AND/g'`
-  COUNT_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/server,/1/' -e 's/client,/1/' -e 's/minimal1,/1/' -e 's/kernel,/1/' -e 's/zero,/1/' -e 's/zeroshark,/1/' -e 's/core,/1/'`
-  if test "x$COUNT_VARIANTS" != "x,1"; then
-    BUILDING_MULTIPLE_JVM_VARIANTS=yes
-  else
-    BUILDING_MULTIPLE_JVM_VARIANTS=no
-  fi
-
-  AC_SUBST(JVM_VARIANTS)
-  AC_SUBST(JVM_VARIANT_SERVER)
-  AC_SUBST(JVM_VARIANT_CLIENT)
-  AC_SUBST(JVM_VARIANT_MINIMAL1)
-  AC_SUBST(JVM_VARIANT_KERNEL)
-  AC_SUBST(JVM_VARIANT_ZERO)
-  AC_SUBST(JVM_VARIANT_ZEROSHARK)
-  AC_SUBST(JVM_VARIANT_CORE)
-
-  INCLUDE_SA=true
-  if test "x$JVM_VARIANT_ZERO" = xtrue ; then
-    INCLUDE_SA=false
-  fi
-  if test "x$JVM_VARIANT_ZEROSHARK" = xtrue ; then
-    INCLUDE_SA=false
-  fi
-  if test "x$OPENJDK_TARGET_OS" = xaix ; then
-    INCLUDE_SA=false
-  fi
-  if test "x$OPENJDK_TARGET_CPU" = xaarch64; then
-    INCLUDE_SA=false
-  fi
-  AC_SUBST(INCLUDE_SA)
-
-  if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
-    MACOSX_UNIVERSAL="true"
-  fi
-
-  AC_SUBST(MACOSX_UNIVERSAL)
-])
-
+# Set the debug level
+#    release: no debug information, all optimizations, no asserts.
+#    optimized: no debug information, all optimizations, no asserts, HotSpot target is 'optimized'.
+#    fastdebug: debug information (-g), all optimizations, all asserts
+#    slowdebug: debug information (-g), no optimizations, all asserts
 AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_LEVEL],
 [
-  ###############################################################################
-  #
-  # Set the debug level
-  #    release: no debug information, all optimizations, no asserts.
-  #    optimized: no debug information, all optimizations, no asserts, HotSpot target is 'optimized'.
-  #    fastdebug: debug information (-g), all optimizations, all asserts
-  #    slowdebug: debug information (-g), no optimizations, all asserts
-  #
   DEBUG_LEVEL="release"
   AC_MSG_CHECKING([which debug level to use])
   AC_ARG_ENABLE([debug], [AS_HELP_STRING([--enable-debug],
@@ -208,118 +81,8 @@
       test "x$DEBUG_LEVEL" != xslowdebug; then
     AC_MSG_ERROR([Allowed debug levels are: release, fastdebug and slowdebug])
   fi
-
-
-  ###############################################################################
-  #
-  # Setup legacy vars/targets and new vars to deal with different debug levels.
-  #
-
-  case $DEBUG_LEVEL in
-    release )
-      VARIANT="OPT"
-      FASTDEBUG="false"
-      DEBUG_CLASSFILES="false"
-      BUILD_VARIANT_RELEASE=""
-      HOTSPOT_DEBUG_LEVEL="product"
-      HOTSPOT_EXPORT="product"
-      ;;
-    fastdebug )
-      VARIANT="DBG"
-      FASTDEBUG="true"
-      DEBUG_CLASSFILES="true"
-      BUILD_VARIANT_RELEASE="-fastdebug"
-      HOTSPOT_DEBUG_LEVEL="fastdebug"
-      HOTSPOT_EXPORT="fastdebug"
-      ;;
-    slowdebug )
-      VARIANT="DBG"
-      FASTDEBUG="false"
-      DEBUG_CLASSFILES="true"
-      BUILD_VARIANT_RELEASE="-debug"
-      HOTSPOT_DEBUG_LEVEL="debug"
-      HOTSPOT_EXPORT="debug"
-      ;;
-    optimized )
-      VARIANT="OPT"
-      FASTDEBUG="false"
-      DEBUG_CLASSFILES="false"
-      BUILD_VARIANT_RELEASE="-optimized"
-      HOTSPOT_DEBUG_LEVEL="optimized"
-      HOTSPOT_EXPORT="optimized"
-      ;;
-  esac
-
-  # The debug level 'optimized' is a little special because it is currently only
-  # applicable to the HotSpot build where it means to build a completely
-  # optimized version of the VM without any debugging code (like for the
-  # 'release' debug level which is called 'product' in the HotSpot build) but
-  # with the exception that it can contain additional code which is otherwise
-  # protected by '#ifndef PRODUCT' macros. These 'optimized' builds are used to
-  # test new and/or experimental features which are not intended for customer
-  # shipment. Because these new features need to be tested and benchmarked in
-  # real world scenarios, we want to build the containing JDK at the 'release'
-  # debug level.
-  if test "x$DEBUG_LEVEL" = xoptimized; then
-    DEBUG_LEVEL="release"
-  fi
-
-  #####
-  # Generate the legacy makefile targets for hotspot.
-  # The hotspot api for selecting the build artifacts, really, needs to be improved.
-  # JDK-7195896 will fix this on the hotspot side by using the JVM_VARIANT_* variables to
-  # determine what needs to be built. All we will need to set here is all_product, all_fastdebug etc
-  # But until then ...
-  HOTSPOT_TARGET=""
-
-  if test "x$JVM_VARIANT_SERVER" = xtrue; then
-    HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL} "
-  fi
-
-  if test "x$JVM_VARIANT_CLIENT" = xtrue; then
-    HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}1 "
-  fi
-
-  if test "x$JVM_VARIANT_MINIMAL1" = xtrue; then
-    HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}minimal1 "
-  fi
-
-  if test "x$JVM_VARIANT_KERNEL" = xtrue; then
-    HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}kernel "
-  fi
-
-  if test "x$JVM_VARIANT_ZERO" = xtrue; then
-    HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}zero "
-  fi
-
-  if test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then
-    HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}shark "
-  fi
-
-  if test "x$JVM_VARIANT_CORE" = xtrue; then
-    HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}core "
-  fi
-
-  HOTSPOT_TARGET="$HOTSPOT_TARGET docs export_$HOTSPOT_EXPORT"
-
-  # On Macosx universal binaries are produced, but they only contain
-  # 64 bit intel. This invalidates control of which jvms are built
-  # from configure, but only server is valid anyway. Fix this
-  # when hotspot makefiles are rewritten.
-  if test "x$MACOSX_UNIVERSAL" = xtrue; then
-    HOTSPOT_TARGET=universal_${HOTSPOT_EXPORT}
-  fi
-
-  #####
-
-  AC_SUBST(DEBUG_LEVEL)
-  AC_SUBST(VARIANT)
-  AC_SUBST(FASTDEBUG)
-  AC_SUBST(DEBUG_CLASSFILES)
-  AC_SUBST(BUILD_VARIANT_RELEASE)
 ])
 
-
 ###############################################################################
 #
 # Should we build only OpenJDK even if closed sources are present?
@@ -367,12 +130,8 @@
 
 AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_OPTIONS],
 [
-
-  ###############################################################################
-  #
   # Should we build a JDK/JVM with headful support (ie a graphical ui)?
   # We always build headless support.
-  #
   AC_MSG_CHECKING([headful support])
   AC_ARG_ENABLE([headful], [AS_HELP_STRING([--disable-headful],
       [disable building headful support (graphical UI support) @<:@enabled@:>@])],
@@ -398,21 +157,7 @@
   AC_SUBST(SUPPORT_HEADFUL)
   AC_SUBST(BUILD_HEADLESS)
 
-  # Control wether Hotspot runs Queens test after build.
-  AC_ARG_ENABLE([hotspot-test-in-build], [AS_HELP_STRING([--enable-hotspot-test-in-build],
-      [run the Queens test after Hotspot build @<:@disabled@:>@])],,
-      [enable_hotspot_test_in_build=no])
-  if test "x$enable_hotspot_test_in_build" = "xyes"; then
-    TEST_IN_BUILD=true
-  else
-    TEST_IN_BUILD=false
-  fi
-  AC_SUBST(TEST_IN_BUILD)
-
-  ###############################################################################
-  #
   # Choose cacerts source file
-  #
   AC_ARG_WITH(cacerts-file, [AS_HELP_STRING([--with-cacerts-file],
       [specify alternative cacerts file])])
   if test "x$with_cacerts_file" != x; then
@@ -420,10 +165,7 @@
   fi
   AC_SUBST(CACERTS_FILE)
 
-  ###############################################################################
-  #
   # Enable or disable unlimited crypto
-  #
   AC_ARG_ENABLE(unlimited-crypto, [AS_HELP_STRING([--enable-unlimited-crypto],
       [Enable unlimited crypto policy @<:@disabled@:>@])],,
       [enable_unlimited_crypto=no])
@@ -434,10 +176,7 @@
   fi
   AC_SUBST(UNLIMITED_CRYPTO)
 
-  ###############################################################################
-  #
   # Compress jars
-  #
   COMPRESS_JARS=false
 
   AC_SUBST(COMPRESS_JARS)
@@ -455,19 +194,6 @@
   AC_SUBST(COPYRIGHT_YEAR)
 ])
 
-AC_DEFUN_ONCE([JDKOPT_SETUP_BUILD_TWEAKS],
-[
-  HOTSPOT_MAKE_ARGS="$HOTSPOT_TARGET"
-  AC_SUBST(HOTSPOT_MAKE_ARGS)
-
-  # The name of the Service Agent jar.
-  SALIB_NAME="${LIBRARY_PREFIX}saproc${SHARED_LIBRARY_SUFFIX}"
-  if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
-    SALIB_NAME="${LIBRARY_PREFIX}sawindbg${SHARED_LIBRARY_SUFFIX}"
-  fi
-  AC_SUBST(SALIB_NAME)
-])
-
 ###############################################################################
 #
 # Enable or disable the elliptic curve crypto implementation
@@ -487,7 +213,6 @@
   AC_SUBST(ENABLE_INTREE_EC)
 ])
 
-
 AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_SYMBOLS],
 [
   #
@@ -632,5 +357,3 @@
 
   AC_SUBST(STATIC_BUILD)
 ])
-
-
--- a/common/autoconf/spec.gmk.in	Tue Dec 15 15:45:53 2015 +0100
+++ b/common/autoconf/spec.gmk.in	Tue Dec 15 11:02:03 2015 +0100
@@ -204,13 +204,12 @@
 
 # These are the libjvms that we want to build.
 # The java launcher uses the default.
-# The others can be selected by specifying -client -server -minimal1 -kernel -zero or -zeroshark
+# The others can be selected by specifying -client -server -minimal1 -zero or -zeroshark
 # on the java launcher command line.
 JVM_VARIANTS:=@JVM_VARIANTS@
 JVM_VARIANT_SERVER:=@JVM_VARIANT_SERVER@
 JVM_VARIANT_CLIENT:=@JVM_VARIANT_CLIENT@
 JVM_VARIANT_MINIMAL1:=@JVM_VARIANT_MINIMAL1@
-JVM_VARIANT_KERNEL:=@JVM_VARIANT_KERNEL@
 JVM_VARIANT_ZERO:=@JVM_VARIANT_ZERO@
 JVM_VARIANT_ZEROSHARK:=@JVM_VARIANT_ZEROSHARK@
 JVM_VARIANT_CORE:=@JVM_VARIANT_CORE@
@@ -281,6 +280,8 @@
 CUPS_CFLAGS:=@CUPS_CFLAGS@
 ALSA_LIBS:=@ALSA_LIBS@
 ALSA_CFLAGS:=@ALSA_CFLAGS@
+LIBFFI_LIBS:=@LIBFFI_LIBS@
+LIBFFI_CFLAGS:=@LIBFFI_CFLAGS@
 
 PACKAGE_PATH=@PACKAGE_PATH@
 
@@ -301,11 +302,15 @@
 
 # Toolchain type: gcc, clang, solstudio, lxc, microsoft...
 TOOLCHAIN_TYPE:=@TOOLCHAIN_TYPE@
+TOOLCHAIN_VERSION := @TOOLCHAIN_VERSION@
 
 # Option used to tell the compiler whether to create 32- or 64-bit executables
 COMPILER_TARGET_BITS_FLAG:=@COMPILER_TARGET_BITS_FLAG@
 COMPILER_SUPPORTS_TARGET_BITS_FLAG=@COMPILER_SUPPORTS_TARGET_BITS_FLAG@
 
+# Option used to pass a command file to the compiler
+COMPILER_COMMAND_FILE_FLAG:=@COMPILER_COMMAND_FILE_FLAG@
+
 CC_OUT_OPTION:=@CC_OUT_OPTION@
 EXE_OUT_OPTION:=@EXE_OUT_OPTION@
 LD_OUT_OPTION:=@LD_OUT_OPTION@
@@ -389,6 +394,7 @@
 BUILD_CC:=@FIXPATH@ @BUILD_ICECC@ @BUILD_CC@
 BUILD_CXX:=@FIXPATH@ @BUILD_ICECC@ @BUILD_CXX@
 BUILD_LD:=@FIXPATH@ @BUILD_LD@
+BUILD_LDCXX:=@FIXPATH@ @BUILD_LDCXX@
 BUILD_AS:=@FIXPATH@ @BUILD_AS@
 BUILD_AR:=@FIXPATH@ @BUILD_AR@
 BUILD_NM:=@FIXPATH@ @BUILD_NM@
@@ -434,6 +440,8 @@
 # (Note absence of := assignment, because we do not want to evaluate the macro body here)
 SET_SHARED_LIBRARY_NAME=@SET_SHARED_LIBRARY_NAME@
 
+SHARED_LIBRARY_FLAGS=@SHARED_LIBRARY_FLAGS@
+
 # Set origin using the linker, ie use the relative path to the dependent library to find the dependees.
 # (Note absence of := assignment, because we do not want to evaluate the macro body here)
 SET_SHARED_LIBRARY_ORIGIN=@SET_SHARED_LIBRARY_ORIGIN@
@@ -651,9 +659,6 @@
 # Misc
 #
 
-# Name of Service Agent library
-SALIB_NAME=@SALIB_NAME@
-
 INCLUDE_SA=@INCLUDE_SA@
 
 OS_VERSION_MAJOR:=@OS_VERSION_MAJOR@
--- a/common/autoconf/toolchain.m4	Tue Dec 15 15:45:53 2015 +0100
+++ b/common/autoconf/toolchain.m4	Tue Dec 15 11:02:03 2015 +0100
@@ -216,7 +216,11 @@
     # The microsoft toolchain also requires INCLUDE and LIB to be set.
     export INCLUDE="$VS_INCLUDE"
     export LIB="$VS_LIB"
+  else
+    # Currently we do not define this for other toolchains. This might change as the need arise.
+    TOOLCHAIN_VERSION=
   fi
+  AC_SUBST(TOOLCHAIN_VERSION)
 
   # For solaris we really need solaris tools, and not the GNU equivalent.
   # The build tools on Solaris reside in /usr/ccs (C Compilation System),
@@ -731,6 +735,7 @@
     BUILD_AS="$BUILD_CC -c"
     # Just like for the target compiler, use the compiler as linker
     BUILD_LD="$BUILD_CC"
+    BUILD_LDCXX="$BUILD_CXX"
 
     PATH="$OLDPATH"
   else
@@ -739,6 +744,7 @@
     BUILD_CC="$CC"
     BUILD_CXX="$CXX"
     BUILD_LD="$LD"
+    BUILD_LDCXX="$LDCXX"
     BUILD_NM="$NM"
     BUILD_AS="$AS"
     BUILD_SYSROOT_CFLAGS="$SYSROOT_CFLAGS"
@@ -749,6 +755,7 @@
   AC_SUBST(BUILD_CC)
   AC_SUBST(BUILD_CXX)
   AC_SUBST(BUILD_LD)
+  AC_SUBST(BUILD_LDCXX)
   AC_SUBST(BUILD_NM)
   AC_SUBST(BUILD_AS)
   AC_SUBST(BUILD_SYSROOT_CFLAGS)
@@ -822,13 +829,13 @@
       [HAS_CFLAG_OPTIMIZE_DEBUG=false])
 
     # "-z relro" supported in GNU binutils 2.17 and later
-    LINKER_RELRO_FLAG="-Xlinker -z -Xlinker relro"
+    LINKER_RELRO_FLAG="-Wl,-z,relro"
     FLAGS_LINKER_CHECK_ARGUMENTS([$LINKER_RELRO_FLAG],
       [HAS_LINKER_RELRO=true],
       [HAS_LINKER_RELRO=false])
 
     # "-z now" supported in GNU binutils 2.11 and later
-    LINKER_NOW_FLAG="-Xlinker -z -Xlinker now"
+    LINKER_NOW_FLAG="-Wl,-z,now"
     FLAGS_LINKER_CHECK_ARGUMENTS([$LINKER_NOW_FLAG],
       [HAS_LINKER_NOW=true],
       [HAS_LINKER_NOW=false])
@@ -841,7 +848,7 @@
     AC_MSG_CHECKING([for broken SuSE 'ld' which only understands anonymous version tags in executables])
     $ECHO "SUNWprivate_1.1 { local: *; };" > version-script.map
     $ECHO "int main() { }" > main.c
-    if $CXX -Xlinker -version-script=version-script.map main.c 2>&AS_MESSAGE_LOG_FD >&AS_MESSAGE_LOG_FD; then
+    if $CXX -Wl,-version-script=version-script.map main.c 2>&AS_MESSAGE_LOG_FD >&AS_MESSAGE_LOG_FD; then
       AC_MSG_RESULT(no)
       USING_BROKEN_SUSE_LD=no
     else
--- a/common/bin/compare.sh	Tue Dec 15 15:45:53 2015 +0100
+++ b/common/bin/compare.sh	Tue Dec 15 11:02:03 2015 +0100
@@ -37,13 +37,18 @@
 if [ "$OPENJDK_TARGET_OS" = "macosx" ]; then
     FULLDUMP_CMD="$OTOOL -v -V -h -X -d"
     LDD_CMD="$OTOOL -L"
-    DIS_CMD="$OTOOL -v -t"
+    DIS_CMD="$OTOOL -v -V -t"
     STAT_PRINT_SIZE="-f %z"
 elif [ "$OPENJDK_TARGET_OS" = "windows" ]; then
     FULLDUMP_CMD="$DUMPBIN -all"
     LDD_CMD="$DUMPBIN -dependants | $GREP .dll"
     DIS_CMD="$DUMPBIN -disasm:nobytes"
     STAT_PRINT_SIZE="-c %s"
+elif [ "$OPENJDK_TARGET_OS" = "aix" ]; then
+    FULLDUMP_CMD="dump -h -r -t -n -X64"
+    LDD_CMD="$LDD"
+    DIS_CMD="$OBJDUMP -d"
+    STAT_PRINT_SIZE="-c %s"
 else
     FULLDUMP_CMD="$READELF -a"
     LDD_CMD="$LDD"
@@ -730,6 +735,9 @@
         # Some symbols get seemingly random 15 character prefixes. Filter them out.
         $NM -a $ORIG_OTHER_FILE 2> /dev/null | $GREP -v $NAME | $AWK '{print $2, $3, $4, $5}' | $SED 's/^\([a-zA-Z] [\.\$]\)[a-zA-Z0-9_\$]\{15,15\}\./\1./g' | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.other
         $NM -a $ORIG_THIS_FILE  2> /dev/null | $GREP -v $NAME | $AWK '{print $2, $3, $4, $5}' | $SED 's/^\([a-zA-Z] [\.\$]\)[a-zA-Z0-9_\$]\{15,15\}\./\1./g' | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.this
+    elif [ "$OPENJDK_TARGET_OS" = "aix" ]; then
+        $OBJDUMP -T $ORIG_OTHER_FILE 2> /dev/null | $GREP -v $NAME | $AWK '{print $2, $3, $4, $5}' | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.other
+        $OBJDUMP -T $ORIG_THIS_FILE  2> /dev/null | $GREP -v $NAME | $AWK '{print $2, $3, $4, $5}' | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.this
     else
         $NM -a $ORIG_OTHER_FILE 2> /dev/null | $GREP -v $NAME | $AWK '{print $2, $3, $4, $5}' | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.other
         $NM -a $ORIG_THIS_FILE  2> /dev/null | $GREP -v $NAME | $AWK '{print $2, $3, $4, $5}' | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.this
@@ -796,14 +804,21 @@
         DEP_MSG="    -    "
     fi
 
+    # Some linux compilers add a unique Build ID
+    if [ "$OPENJDK_TARGET_OS" = "linux" ]; then
+      BUILD_ID_FILTER="$SED -r 's/(Build ID:) [0-9a-f]{40}/\1/'"
+    else
+      BUILD_ID_FILTER="$CAT"
+    fi
+
     # Compare fulldump output
     if [ -n "$FULLDUMP_CMD" ] && [ -z "$SKIP_FULLDUMP_DIFF" ]; then
         if [ -z "$FULLDUMP_DIFF_FILTER" ]; then
             FULLDUMP_DIFF_FILTER="$CAT"
         fi
-        $FULLDUMP_CMD $OTHER_FILE | eval "$FULLDUMP_DIFF_FILTER" \
+        $FULLDUMP_CMD $OTHER_FILE | eval "$BUILD_ID_FILTER" | eval "$FULLDUMP_DIFF_FILTER" \
             > $WORK_FILE_BASE.fulldump.other 2>&1
-        $FULLDUMP_CMD $THIS_FILE  | eval "$FULLDUMP_DIFF_FILTER" \
+        $FULLDUMP_CMD $THIS_FILE  | eval "$BUILD_ID_FILTER" | eval "$FULLDUMP_DIFF_FILTER" \
             > $WORK_FILE_BASE.fulldump.this  2>&1
 
         LC_ALL=C $DIFF $WORK_FILE_BASE.fulldump.other $WORK_FILE_BASE.fulldump.this \
--- a/common/bin/compare_exceptions.sh.incl	Tue Dec 15 15:45:53 2015 +0100
+++ b/common/bin/compare_exceptions.sh.incl	Tue Dec 15 11:02:03 2015 +0100
@@ -57,14 +57,18 @@
 ./demo/jvmti/mtrace/lib/libmtrace.so
 ./demo/jvmti/versionCheck/lib/libversionCheck.so
 ./demo/jvmti/waiters/lib/libwaiters.so
+./lib/i386/client/libjsig.so
 ./lib/i386/client/libjvm.so
 ./lib/i386/libattach.so
 ./lib/i386/libdt_socket.so
 ./lib/i386/libinstrument.so
 ./lib/i386/libjsdt.so
+./lib/i386/libjsig.so
 ./lib/i386/libmanagement.so
+./lib/i386/libnet.so
 ./lib/i386/libnpt.so
 ./lib/i386/libverify.so
+./lib/i386/server/libjsig.so
 ./lib/i386/server/libjvm.so
 ./bin/appletviewer
 ./bin/idlj
@@ -105,6 +109,17 @@
 ./bin/xjc
 "
 
+# Issue with __FILE__ usage in generated header files prevent clean fulldump diff of
+# server jvm with old hotspot build.
+KNOWN_FULLDUMP_DIFF="
+./lib/i386/server/libjvm.so
+"
+KNOWN_DIS_DIFF="
+./lib/i386/server/libjvm.so
+"
+DIS_DIFF_FILTER="$SED \
+  -e 's/\(:\t\)\([0-9a-z]\{2,2\} \)\{1,7\}/\1<hex>/g' \
+  -e 's/0x[0-9a-z]\{2,9\}/<hex>/g'"
 fi
 
 if [ "$OPENJDK_TARGET_OS" = "linux" ] && [ "$OPENJDK_TARGET_CPU" = "x86_64" ]; then
@@ -135,6 +150,7 @@
 ./lib/amd64/libjsdt.so
 ./lib/amd64/libjsig.so
 ./lib/amd64/libmanagement.so
+./lib/amd64/libnet.so
 ./lib/amd64/libnpt.so
 ./lib/amd64/libsaproc.so
 ./lib/amd64/libverify.so
@@ -179,6 +195,12 @@
 ./bin/xjc
 "
 
+# Issue with __FILE__ usage in generated header files prevent clean fulldump diff of
+# server jvm with old hotspot build.
+KNOWN_FULLDUMP_DIFF="
+./lib/amd64/server/libjvm.so
+"
+
 fi
 
 if [ "$OPENJDK_TARGET_OS" = "solaris" ] && [ "$OPENJDK_TARGET_CPU" = "x86_64" ]; then
@@ -299,14 +321,13 @@
 
 # Filter random C++ symbol strings.
 # Some numbers differ randomly.
-# Can't use space in these expressions as the shell will mess with them.
 DIS_DIFF_FILTER="$SED \
-    -e 's/\.[a-zA-Z0-9_\$]\{15,15\}/<SYM>/g' \
-    -e 's/\([0-9a-f][0-9a-f].\)\{2,8\}[0-9a-f][0-9a-f]/<NUMS>/g' \
-    -e 's/\(0x\)[0-9a-f]*\([,(>]\)/\1<HEX>\2/g' \
-    -e 's/\(0x\)[0-9a-f]*$/\1<HEX>/g' \
-    -e 's/\(\#.\)[0-9a-f]*\(.<\)/\1<HEX>\2/g' \
-    -e 's/[\.A-Za-z0-9%]\{16,16\}$/<BIN>/g'"
+    -e 's/\.[a-zA-Z0-9_\$]\{15\}/<SYM>/g' \
+    -e 's/\(\# \)[0-9a-f]*\( <\)/\1<HEX>\2/g' \
+    -e 's/0x[0-9a-f]*$/<HEX>/g' \
+    -e 's/0x[0-9a-f]*\([,(>]\)/<HEX>\1/g' \
+    -e 's/:	[0-9a-f][0-9a-f]\( [0-9a-f][0-9a-f]\)\{2,10\}/:	<NUMS>/g' \
+    -e 's/     [\.A-Za-z0-9%@]\{16\}$/     <BIN>/g'"
 
 fi
 
@@ -425,18 +446,23 @@
 ./bin/xjc
 "
 
-# Filter random C++ symbol strings.
 # Some numbers differ randomly.
 DIS_DIFF_FILTER="$SED \
-    -e 's/\$[a-zA-Z0-9_\$]\{15,15\}/<SYM>/g' \
-    -e 's/[0-9a-f][0-9a-f].[0-9a-f][0-9a-f].[0-9a-f][0-9a-f].[0-9a-f][0-9a-f]/<NUMS>/g' \
-    -e 's/\(%g1,.0x\)[0-9a-f]*\(,.%g1\)/\1<HEX>\2/g' \
-    -e 's/\(!.\)[0-9a-f]*\(.<SUNWprivate_1.1+0x\)[0-9a-f]*/\1<NUM>\2<HEX>/g' \
-    -e 's/\!.[0-9a-f]\{1,4\} <_DYNAMIC+0x[0-9a-f]\{1,4\}>/<DYNAMIC>/g'"
+    -e 's/\$[a-zA-Z0-9_\$]\{15\}/<SYM>/g' \
+    -e 's/:	[0-9a-f][0-9a-f]\( [0-9a-f][0-9a-f]\)\{2,10\}/:	<NUMS>/g' \
+    -e 's/, [0-9a-fx\-]\{1,8\}/, <CONST>/g' \
+    -e 's/call  [0-9a-f]\{7\}/call  <ADDR>/g' \
+    -e 's/0x[0-9a-f]\{1,8\}/<HEX>/g' \
+    -e 's/\! [0-9a-f]\{1,8\} /! <ADDR> /g'"
 
-# Some xor instructions end up with different args in the lib but not in the object files.
-ACCEPTED_DIS_DIFF="
-./demo/jvmti/waiters/lib/libwaiters.so
+# libjvm.so
+# __FILE__ macro usage in debug.hpp causes differences between old and new
+# hotspot builds in ad_sparc.o and ad_sparc_clone.o. The .o files compare
+# equal when stripped, but at link time differences appear. Removing
+# __FILE__ from ShouldNotCallThis() and ShouldNotReachHere() removes
+# the differences.
+KNOWN_DIS_DIFF="
+./lib/sparcv9/server/libjvm.so
 "
 
 SKIP_FULLDUMP_DIFF="true"
@@ -634,11 +660,12 @@
 SORT_SYMBOLS="
 ./Contents/Home/lib/libsaproc.dylib
 ./lib/libsaproc.dylib
+./lib/libjsig.dylib
 "
 
 ACCEPTED_SMALL_SIZE_DIFF="$ACCEPTED_BIN_DIFF"
 
-DIS_DIFF_FILTER="$SED \
-    -e 's/0x[0-9a-f]\{4,16\}/<HEXSTR>/g'"
+DIS_DIFF_FILTER="LANG=C $SED \
+    -e 's/0x[0-9a-f]\{3,16\}/<HEXSTR>/g' -e 's/^[0-9a-f]\{12,20\}/<ADDR>/'"
 
 fi
--- a/make/common/MakeBase.gmk	Tue Dec 15 15:45:53 2015 +0100
+++ b/make/common/MakeBase.gmk	Tue Dec 15 11:02:03 2015 +0100
@@ -151,16 +151,16 @@
   $(eval compress_paths = \
       $(strip $(shell $(CAT) $(SRC_ROOT)/make/common/support/ListPathsSafely-pre-compress.incl)))
   compress_paths += \
-$(subst $(SRC_ROOT),X97,\
-$(subst $(OUTPUT_ROOT),X98,\
-$(subst X,X00,\
+      $(subst $(SRC_ROOT),X97, \
+      $(subst $(OUTPUT_ROOT),X98, \
+      $(subst X,X00, \
       $(subst $(SPACE),\n,$(strip $1)))))
   $(eval compress_paths += \
       $(strip $(shell $(CAT) $(SRC_ROOT)/make/common/support/ListPathsSafely-post-compress.incl)))
 
   decompress_paths=$(SED) -f $(SRC_ROOT)/make/common/support/ListPathsSafely-uncompress.sed \
       -e 's|X99|\\n|g' \
-    -e 's|X98|$(OUTPUT_ROOT)|g' -e 's|X97|$(SRC_ROOT)|g' \
+      -e 's|X98|$(OUTPUT_ROOT)|g' -e 's|X97|$(SRC_ROOT)|g' \
       -e 's|X00|X|g'
 
   ListPathsSafely_IfPrintf = \
@@ -172,10 +172,10 @@
   # Param 1 - Name of variable containing paths/arguments to output
   # Param 2 - File to print to
   # Param 3 - Set to true to append to file instead of overwriting
-define ListPathsSafely
-  ifneq (,$$(word 10001,$$($1)))
-    $$(error Cannot list safely more than 10000 paths. $1 has $$(words $$($1)) paths!)
-  endif
+  define ListPathsSafely
+    ifneq (,$$(word 10001,$$($1)))
+      $$(error Cannot list safely more than 10000 paths. $1 has $$(words $$($1)) paths!)
+    endif
     $$(call MakeDir, $$(dir $2))
     ifneq ($$(strip $3), true)
       $$(shell $(RM) $$(strip $2))
@@ -230,7 +230,7 @@
     $$(call ListPathsSafely_IfPrintf,$1,$2,9251,9500)
     $$(call ListPathsSafely_IfPrintf,$1,$2,9501,9750)
     $$(call ListPathsSafely_IfPrintf,$1,$2,9751,10000)
-endef
+  endef
 endif # HAS_FILE_FUNCTION
 
 # The source tips can come from the Mercurial repository, or in the files
@@ -285,18 +285,24 @@
   # Never remove warning messages; this is just for completeness
   LOG_WARN :=
   ifneq ($$(findstring $$(LOG_LEVEL), info debug trace),)
+    LogInfo = $$(info $$(strip $$1))
     LOG_INFO :=
   else
+    LogInfo =
     LOG_INFO := > /dev/null
   endif
   ifneq ($$(findstring $$(LOG_LEVEL), debug trace),)
+    LogDebug = $$(info $$(strip $$1))
     LOG_DEBUG :=
   else
+    LogDebug =
     LOG_DEBUG := > /dev/null
   endif
   ifneq ($$(findstring $$(LOG_LEVEL), trace),)
+    LogTrace = $$(info $$(strip $$1))
     LOG_TRACE :=
   else
+    LogTrace =
     LOG_TRACE := > /dev/null
   endif
 endef
@@ -450,6 +456,23 @@
     $(strip $(if $1,$(patsubst $(firstword $1)%,%,\
       $(call remove-prefixes,$(filter-out $(firstword $1),$1),$2)),$2))
 
+# Convert the string given to upper case, without any $(shell)
+# Inspired by http://lists.gnu.org/archive/html/help-make/2013-09/msg00009.html
+uppercase_table := a,A b,B c,C d,D e,E f,F g,G h,H i,I j,J k,K l,L m,M n,N o,O \
+    p,P q,Q r,R s,S t,T u,U v,V w,W x,X y,Y z,Z
+
+uppercase_internal = \
+  $(if $(strip $1), $$(subst $(firstword $1), $(call uppercase_internal, \
+      $(wordlist 2, $(words $1), $1), $2)), $2)
+
+# Convert a string to upper case. Works only on a-z.
+# $1 - The string to convert
+uppercase = \
+  $(strip \
+    $(eval uppercase_result := $(call uppercase_internal, $(uppercase_table), $1)) \
+    $(uppercase_result) \
+  )
+
 ################################################################################
 
 ifneq ($(DISABLE_CACHE_FIND), true)
@@ -560,8 +583,9 @@
     $1_NAME_MACRO := identity
   endif
 
-  # Remove any trailing slash from SRC
+  # Remove any trailing slash from SRC and DEST
   $1_SRC := $$(patsubst %/,%,$$($1_SRC))
+  $1_DEST := $$(patsubst %/,%,$$($1_DEST))
 
   $$(foreach f, $$(patsubst $$($1_SRC)/%,%,$$($1_FILES)), \
       $$(eval $$(call AddFileToCopy, $$($1_SRC)/$$f, \
@@ -592,9 +616,9 @@
   WriteFile = \
       $(file >$2,$(strip $1))
 else
-# Use printf to get consistent behavior on all platforms.
-WriteFile = \
-    $(shell $(PRINTF) "%s" $(call ShellQuote, $1) > $2)
+  # Use printf to get consistent behavior on all platforms.
+  WriteFile = \
+      $(shell $(PRINTF) "%s" $(call ShellQuote, $1) > $2)
 endif
 
 ################################################################################
--- a/make/common/NativeCompilation.gmk	Tue Dec 15 15:45:53 2015 +0100
+++ b/make/common/NativeCompilation.gmk	Tue Dec 15 11:02:03 2015 +0100
@@ -129,6 +129,12 @@
     SYSROOT_LDFLAGS := $(BUILD_SYSROOT_LDFLAGS), \
 ))
 
+# BUILD toolchain with the C++ linker
+$(eval $(call DefineNativeToolchain, TOOLCHAIN_BUILD_LINK_CXX, \
+    EXTENDS := TOOLCHAIN_BUILD, \
+    LD := $(BUILD_LDCXX), \
+))
+
 ################################################################################
 
 # Extensions of files handled by this macro.
@@ -209,8 +215,8 @@
   $1_$2_OBJ := $3/$$(call replace_with_obj_extension, $$(notdir $2))
   # Only continue if this object file hasn't been processed already. This lets the first found
   # source file override any other with the same name.
-  ifeq (,$$(findstring $$($1_$2_OBJ),$$($1_ALL_OBJS)))
-    $1_ALL_OBJS+=$$($1_$2_OBJ)
+  ifeq (,$$(findstring $$($1_$2_OBJ),$$($1_OBJS_SO_FAR)))
+    $1_OBJS_SO_FAR+=$$($1_$2_OBJ)
     ifeq (,$$(filter %.s,$2))
       # And this is the dependency file for this obj file.
       $1_$2_DEP:=$$(patsubst %$(OBJ_SUFFIX),%.d,$$($1_$2_OBJ))
@@ -223,13 +229,18 @@
       -include $$($1_$2_DEP_TARGETS)
 
       ifeq ($(TOOLCHAIN_TYPE), microsoft)
-        $1_$2_DEBUG_OUT_FLAGS:=-Fd$$(patsubst %$(OBJ_SUFFIX),%.pdb,$$($1_$2_OBJ)) \
-            -Fm$$(patsubst %$(OBJ_SUFFIX),%.map,$$($1_$2_OBJ))
+        $1_$2_DEBUG_OUT_FLAGS:=-Fd$$(patsubst %$(OBJ_SUFFIX),%.pdb,$$($1_$2_OBJ))
       endif
     endif
 
-    $$($1_$2_OBJ) : $2 $$($1_COMPILE_VARDEPS_FILE) | $$($1_BUILD_INFO)
-	$(ECHO) $(LOG_INFO) "Compiling $$(notdir $2) (for $$(notdir $$($1_TARGET)))"
+    ifneq ($$($1_$(notdir $2)_CFLAGS)$$($1_$(notdir $2)_CXXFLAGS), )
+      $1_$2_VARDEPS := $$($1_$(notdir $2)_CFLAGS) $$($1_$(notdir $2)_CXXFLAGS)
+      $1_$2_VARDEPS_FILE := $$(call DependOnVariable, $1_$2_VARDEPS, \
+          $$(patsubst %$(OBJ_SUFFIX),%.vardeps,$$($1_$2_OBJ)))
+    endif
+
+    $$($1_$2_OBJ) : $2 $$($1_COMPILE_VARDEPS_FILE) $$($1_$2_VARDEPS_FILE) | $$($1_BUILD_INFO)
+	$$(call LogInfo, Compiling $$(notdir $2) (for $$(notdir $$($1_TARGET))))
         ifneq ($(TOOLCHAIN_TYPE), microsoft)
           ifeq ($(TOOLCHAIN_TYPE)$$(filter %.s,$2), solstudio)
             # The Solaris studio compiler doesn't output the full path to the object file in the
@@ -251,15 +262,17 @@
           # setting -showIncludes, all included files are printed. These are filtered out and
           # parsed into make dependences.
           # Keep as much as possible on one execution line for best performance on Windows
+	  $(RM) $$($1_$2_DEP).exitvalue ; \
 	  ($(call LogFailures, $$($1_$2_OBJ).log, $$($1_SAFE_NAME)_$$(notdir $2), \
 	      $$($1_$2_COMP) $$($1_$2_FLAGS) -showIncludes $$($1_$2_DEBUG_OUT_FLAGS) \
-	          $(CC_OUT_OPTION)$$($1_$2_OBJ) $2) ; echo $$$$? > $$($1_$2_DEP).exitvalue) \
+	          $(CC_OUT_OPTION)$$($1_$2_OBJ) $2) || echo $$$$? > $$($1_$2_DEP).exitvalue ) \
 	      | $(TEE) $$($1_$2_DEP).raw | $(GREP) -v -e "^Note: including file:" \
 	          -e "^$(notdir $2)$$$$" || test "$$$$?" = "1" ; \
-	      exit `cat $$($1_$2_DEP).exitvalue` ; \
-	  $(RM) $$($1_$2_DEP).exitvalue ; \\
+	      ( test -s $$($1_$2_DEP).exitvalue \
+	          && exit `$(CAT) $$($1_$2_DEP).exitvalue` || true ) ; \
 	  ($(ECHO) $$@: \\ ; \
-	  $(SED) $(WINDOWS_SHOWINCLUDE_SED_PATTERN) $$($1_$2_DEP).raw) | $(SORT) -u > $$($1_$2_DEP) ; \
+	      $(SED) $(WINDOWS_SHOWINCLUDE_SED_PATTERN) $$($1_$2_DEP).raw) \
+	      | $(SORT) -u > $$($1_$2_DEP) ; \
 	  $(SED) $(DEPENDENCY_TARGET_SED_PATTERN) $$($1_$2_DEP) > $$($1_$2_DEP_TARGETS)
         endif
   endif
@@ -286,7 +299,9 @@
 #   EXCLUDES do not pick source from these directories
 #   INCLUDE_FILES only compile exactly these files!
 #   EXCLUDE_FILES with these names
+#   EXCLUDE_PATTERN exclude files matching any of these substrings
 #   EXTRA_FILES List of extra files not in any of the SRC dirs
+#   EXTRA_OBJECT_FILES List of extra object files to include when linking
 #   VERSIONINFO_RESOURCE Input file for RC. Setting this implies that RC will be run
 #   RC_FLAGS flags for RC.
 #   MAPFILE mapfile
@@ -430,19 +445,29 @@
       $$(error SRC specified to SetupNativeCompilation $1 contains missing directory $$d)))
 
   # Find all files in the source trees. Sort to remove duplicates.
-  $1_ALL_SRCS := $$(sort $$(call CacheFind,$$($1_SRC)))
+  $1_SRCS := $$(sort $$(call CacheFind,$$($1_SRC)))
+  $1_SRCS := $$(filter $$(NATIVE_SOURCE_EXTENSIONS), $$($1_SRCS))
   # Extract the C/C++ files.
-  $1_EXCLUDE_FILES:=$$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$($1_EXCLUDE_FILES)))
-  $1_INCLUDE_FILES:=$$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$($1_INCLUDE_FILES)))
+  ifneq ($$($1_EXCLUDE_PATTERNS), )
+    # We must not match the exclude pattern against the src root(s).
+    $1_SRCS_WITHOUT_ROOTS := $$($1_SRCS)
+    $$(foreach i,$$($1_SRC),$$(eval $1_SRCS_WITHOUT_ROOTS := $$(patsubst \
+        $$i/%,%, $$($1_SRCS_WITHOUT_ROOTS))))
+    $1_ALL_EXCLUDE_FILES :=  $$(call containing, $$($1_EXCLUDE_PATTERNS), \
+        $$($1_SRCS_WITHOUT_ROOTS))
+  endif
   ifneq ($$($1_EXCLUDE_FILES),)
-    $1_EXCLUDE_FILES:=$$(addprefix %,$$($1_EXCLUDE_FILES))
+    $1_ALL_EXCLUDE_FILES += $$($1_EXCLUDE_FILES)
   endif
-  $1_SRCS := $$(filter-out $$($1_EXCLUDE_FILES),$$(filter $$(NATIVE_SOURCE_EXTENSIONS),$$($1_ALL_SRCS)))
-  ifneq (,$$(strip $$($1_INCLUDE_FILES)))
-    $1_SRCS := $$(filter $$($1_INCLUDE_FILES),$$($1_SRCS))
+  ifneq ($$($1_ALL_EXCLUDE_FILES),)
+    $1_EXCLUDE_FILES_PAT := $$($1_ALL_EXCLUDE_FILES) \
+        $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$($1_ALL_EXCLUDE_FILES)))
+    $1_EXCLUDE_FILES_PAT := $$(addprefix %,$$($1_EXCLUDE_FILES_PAT))
+    $1_SRCS := $$(filter-out $$($1_EXCLUDE_FILES_PAT),$$($1_SRCS))
   endif
-  ifeq (,$$($1_SRCS))
-    $$(error No sources found for $1 when looking inside the dirs $$($1_SRC))
+  ifneq ($$($1_INCLUDE_FILES), )
+    $1_INCLUDE_FILES_PAT := $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$($1_INCLUDE_FILES)))
+    $1_SRCS := $$(filter $$($1_INCLUDE_FILES_PAT),$$($1_SRCS))
   endif
   # There can be only a single bin dir root, no need to foreach over the roots.
   $1_BINS := $$(wildcard $$($1_OBJECT_DIR)/*$(OBJ_SUFFIX))
@@ -466,16 +491,17 @@
     $$(error No sources found for $1 when looking inside the dirs $$($1_SRC))
   endif
 
-  # Calculate the expected output from compiling the sources (sort to remove duplicates. Also provides
-  # a reproducable order on the input files to the linker).
+  # Calculate the expected output from compiling the sources
   $1_EXPECTED_OBJS_FILENAMES := $$(call replace_with_obj_extension, $$(notdir $$($1_SRCS)))
-  $1_EXPECTED_OBJS:=$$(sort $$(addprefix $$($1_OBJECT_DIR)/,$$($1_EXPECTED_OBJS_FILENAMES)))
+  $1_EXPECTED_OBJS := $$(addprefix $$($1_OBJECT_DIR)/,$$($1_EXPECTED_OBJS_FILENAMES))
   # Are there too many object files on disk? Perhaps because some source file was removed?
   $1_SUPERFLOUS_OBJS:=$$(sort $$(filter-out $$($1_EXPECTED_OBJS),$$($1_BINS)))
   # Clean out the superfluous object files.
   ifneq ($$($1_SUPERFLUOUS_OBJS),)
     $$(shell $(RM) -f $$($1_SUPERFLUOUS_OBJS))
   endif
+  # Sort to remove dupliates and provide a reproducable order on the input files to the linker.
+  $1_ALL_OBJS := $$(sort $$($1_EXPECTED_OBJS) $$($1_EXTRA_OBJECT_FILES))
 
   # Pickup extra OPENJDK_TARGET_OS_TYPE and/or OPENJDK_TARGET_OS dependent variables for CFLAGS.
   $1_EXTRA_CFLAGS:=$$($1_CFLAGS_$(OPENJDK_TARGET_OS_TYPE)) $$($1_CFLAGS_$(OPENJDK_TARGET_OS))
@@ -593,9 +619,7 @@
   # variables used in the call to add_native_source below.
   $1_COMPILE_VARDEPS := $$($1_CFLAGS) $$($1_EXTRA_CFLAGS) $$($1_SYSROOT_CFLAGS) \
       $$($1_CXXFLAGS) $$($1_EXTRA_CXXFLAGS) \
-      $$($1_CC) $$($1_CXX) $$($1_AS) $$($1_ASFLAGS) \
-      $$(foreach s, $$($1_SRCS), \
-          $$($1_$$(notdir $$s)_CFLAGS) $$($1_$$(notdir $$s)_CXXFLAGS))
+      $$($1_CC) $$($1_CXX) $$($1_AS) $$($1_ASFLAGS)
   $1_COMPILE_VARDEPS_FILE := $$(call DependOnVariable, $1_COMPILE_VARDEPS, \
       $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).comp.vardeps)
 
@@ -675,55 +699,62 @@
   ifeq ($$($1_STATIC_LIBRARY),)
     ifeq ($$($1_DEBUG_SYMBOLS), true)
       ifeq ($(ENABLE_DEBUG_SYMBOLS), true)
-        ifneq ($(OPENJDK_TARGET_OS), macosx) # no MacOS X support yet
-          ifneq ($$($1_OUTPUT_DIR),$$($1_OBJECT_DIR))
-            # The dependency on TARGET is needed on windows for debuginfo files
-            # to be rebuilt properly.
-            $$($1_OUTPUT_DIR)/% : $$($1_OBJECT_DIR)/% $$($1_TARGET)
+        ifneq ($$($1_OUTPUT_DIR), $$($1_OBJECT_DIR))
+          # The dependency on TARGET is needed on windows for debuginfo files
+          # to be rebuilt properly.
+          $$($1_OUTPUT_DIR)/% : $$($1_OBJECT_DIR)/% $$($1_TARGET)
 		$(CP) $$< $$@
-          endif
+        endif
 
-          # Generate debuginfo files.
-          ifeq ($(OPENJDK_TARGET_OS), windows)
-            $1_EXTRA_LDFLAGS += "-pdb:$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).pdb" \
-                "-map:$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).map"
-            $1_DEBUGINFO_FILES := $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).pdb \
-                $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).map
-            # No separate command is needed for debuginfo on windows, instead
-            # touch target to make sure it has a later time stamp than the debug
-            # symbol files to avoid unnecessary relinking on rebuild.
-            $1_CREATE_DEBUGINFO_CMDS := $(TOUCH) $$($1_TARGET)
+        # Generate debuginfo files.
+        ifeq ($(OPENJDK_TARGET_OS), windows)
+          $1_EXTRA_LDFLAGS += "-pdb:$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).pdb" \
+              "-map:$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).map"
+          $1_DEBUGINFO_FILES := $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).pdb \
+              $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).map
+          # No separate command is needed for debuginfo on windows, instead
+          # touch target to make sure it has a later time stamp than the debug
+          # symbol files to avoid unnecessary relinking on rebuild.
+          $1_CREATE_DEBUGINFO_CMDS := $(TOUCH) $$($1_TARGET)
 
-          else ifneq ($(findstring $(OPENJDK_TARGET_OS), linux solaris), )
-            $1_DEBUGINFO_FILES := $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).debuginfo
-            # Setup the command line creating debuginfo files, to be run after linking.
-            # It cannot be run separately since it updates the original target file
-            $1_CREATE_DEBUGINFO_CMDS := \
-                $(OBJCOPY) --only-keep-debug $$($1_TARGET) $$($1_DEBUGINFO_FILES) $$(NEWLINE) \
-                $(CD) $$($1_OUTPUT_DIR) && \
-                    $(OBJCOPY) --add-gnu-debuglink=$$($1_DEBUGINFO_FILES) $$($1_TARGET)
-          endif # No MacOS X support
+        else ifneq ($(findstring $(OPENJDK_TARGET_OS), linux solaris), )
+          $1_DEBUGINFO_FILES := $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).debuginfo
+          # Setup the command line creating debuginfo files, to be run after linking.
+          # It cannot be run separately since it updates the original target file
+          $1_CREATE_DEBUGINFO_CMDS := \
+              $(OBJCOPY) --only-keep-debug $$($1_TARGET) $$($1_DEBUGINFO_FILES) $$(NEWLINE) \
+              $(CD) $$($1_OUTPUT_DIR) && \
+                  $(OBJCOPY) --add-gnu-debuglink=$$($1_DEBUGINFO_FILES) $$($1_TARGET)
 
-          # This dependency dance ensures that debug info files get rebuilt
-          # properly if deleted.
-          $$($1_TARGET): $$($1_DEBUGINFO_FILES)
-          $$($1_DEBUGINFO_FILES): $$($1_EXPECTED_OBJS)
+        else ifeq ($(OPENJDK_TARGET_OS), macosx)
+          $1_DEBUGINFO_FILES := $$($1_OBJECT_DIR)/$$($1_BASENAME).dSYM
+          # On Macosx, the debuginfo generation doesn't touch the linked binary, but
+          # to avoid always relinking, touch it anyway to force a later timestamp than
+          # the dSYM files.
+          $1_CREATE_DEBUGINFO_CMDS := \
+              $(DSYMUTIL) --out $$($1_DEBUGINFO_FILES) $$($1_TARGET) $$(NEWLINE) \
+              $(TOUCH) $$($1_TARGET)
+        endif # OPENJDK_TARGET_OS
 
-          ifeq ($(ZIP_DEBUGINFO_FILES), true)
-            $1_DEBUGINFO_ZIP := $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).diz
-            $1 += $$(subst $$($1_OBJECT_DIR),$$($1_OUTPUT_DIR),$$($1_DEBUGINFO_ZIP))
+        # This dependency dance ensures that debug info files get rebuilt
+        # properly if deleted.
+        $$($1_TARGET): $$($1_DEBUGINFO_FILES)
+        $$($1_DEBUGINFO_FILES): $$($1_ALL_OBJS)
 
-            # The dependency on TARGET is needed for debuginfo files
-            # to be rebuilt properly.
-            $$($1_DEBUGINFO_ZIP): $$($1_DEBUGINFO_FILES) $$($1_TARGET)
+        ifeq ($(ZIP_DEBUGINFO_FILES), true)
+          $1_DEBUGINFO_ZIP := $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).diz
+          $1 += $$(subst $$($1_OBJECT_DIR),$$($1_OUTPUT_DIR),$$($1_DEBUGINFO_ZIP))
+
+          # The dependency on TARGET is needed for debuginfo files
+          # to be rebuilt properly.
+          $$($1_DEBUGINFO_ZIP): $$($1_DEBUGINFO_FILES) $$($1_TARGET)
 		$(CD) $$($1_OBJECT_DIR) \
 		&& $(ZIP) -q $$@ $$(notdir $$($1_DEBUGINFO_FILES))
 
-          else
-            $1 += $$(subst $$($1_OBJECT_DIR),$$($1_OUTPUT_DIR),$$($1_DEBUGINFO_FILES))
-          endif
+        else
+          $1 += $$(subst $$($1_OBJECT_DIR),$$($1_OUTPUT_DIR),$$($1_DEBUGINFO_FILES))
         endif
-      endif # !MacOS X
+      endif # $(ENABLE_DEBUG_SYMBOLS)
     endif # $1_DEBUG_SYMBOLS
   endif # !STATIC_LIBRARY
 
@@ -750,21 +781,34 @@
     $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
         $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).vardeps)
 
-    $$($1_TARGET): $$($1_EXPECTED_OBJS) $$($1_RES) $$($1_REAL_MAPFILE) \
+    $1_LD_OBJ_ARG := $$($1_ALL_OBJS)
+
+    # If there are many object files, use an @-file.
+    ifneq ($$(word 17, $$($1_ALL_OBJS)), )
+      $1_OBJ_FILE_LIST := $$($1_OBJECT_DIR)/_$1_objectfilenames.txt
+      ifneq ($(TOOLCHAIN_TYPE),solstudio)
+        $1_LD_OBJ_ARG := $(COMPILER_COMMAND_FILE_FLAG)$$($1_OBJ_FILE_LIST)
+      else
+        # The solstudio linker does not support @-files.
+        $1_LD_OBJ_ARG := `cat $$($1_OBJ_FILE_LIST)`
+      endif
+    endif
+
+    $$($1_TARGET): $$($1_ALL_OBJS) $$($1_RES) $$($1_REAL_MAPFILE) \
         $$($1_VARDEPS_FILE)
+                ifneq ($$($1_OBJ_FILE_LIST), )
+		  $$(eval $$(call ListPathsSafely, $1_ALL_OBJS, $$($1_OBJ_FILE_LIST)))
+                endif
+                # Keep as much as possible on one execution line for best performance
+                # on Windows
 		$(ECHO) $(LOG_INFO) "Linking $$($1_BASENAME)" ; \
 		$(call LogFailures, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_link.log, $$($1_SAFE_NAME)_link, \
 		    $$($1_LD) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $$($1_SYSROOT_LDFLAGS) \
 		    $(LD_OUT_OPTION)$$@ \
-		    $$($1_EXPECTED_OBJS) $$($1_RES) \
+		    $$($1_LD_OBJ_ARG) $$($1_RES) \
 		    $$($1_LIBS) $$($1_EXTRA_LIBS)) ; \
 		$$($1_CREATE_DEBUGINFO_CMDS)
 		$$($1_STRIP_CMD)
-                # Touch target to make sure it has a later time stamp than the debug
-                # symbol files to avoid unnecessary relinking on rebuild.
-                ifeq ($(OPENJDK_TARGET_OS), windows)
-		  $(TOUCH) $$@
-                endif
 
   endif
 
@@ -775,10 +819,10 @@
         $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).vardeps)
 
     # Generating a static library, ie object file archive.
-    $$($1_TARGET): $$($1_EXPECTED_OBJS) $$($1_RES) $$($1_VARDEPS_FILE)
+    $$($1_TARGET): $$($1_ALL_OBJS) $$($1_RES) $$($1_VARDEPS_FILE)
 	$(ECHO) $(LOG_INFO) "Archiving $$($1_STATIC_LIBRARY)"
 	$(call LogFailures, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_link.log, $$($1_SAFE_NAME)_link, \
-	    $$($1_AR) $$($1_ARFLAGS) $(AR_OUT_OPTION)$$($1_TARGET) $$($1_EXPECTED_OBJS) \
+	    $$($1_AR) $$($1_ARFLAGS) $(AR_OUT_OPTION)$$($1_TARGET) $$($1_ALL_OBJS) \
 	        $$($1_RES))
         ifeq ($(STATIC_BUILD), true)
 	  $(GetSymbols)
@@ -796,13 +840,13 @@
     $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
         $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).vardeps)
 
-    $$($1_TARGET): $$($1_EXPECTED_OBJS) $$($1_RES) $$($1_MANIFEST) \
+    $$($1_TARGET): $$($1_ALL_OBJS) $$($1_RES) $$($1_MANIFEST) \
         $$($1_VARDEPS_FILE)
 		$(ECHO) $(LOG_INFO) "Linking executable $$($1_BASENAME)" ; \
 		$(call LogFailures, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_link.log, $$($1_SAFE_NAME)_link, \
 		    $$($1_LD) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $$($1_SYSROOT_LDFLAGS) \
 		        $(EXE_OUT_OPTION)$$($1_TARGET) \
-		        $$($1_EXPECTED_OBJS) $$($1_RES) \
+		        $$($1_ALL_OBJS) $$($1_RES) \
 		        $$($1_LIBS) $$($1_EXTRA_LIBS))
                 ifeq ($(OPENJDK_TARGET_OS), windows)
                   ifneq ($$($1_MANIFEST), )
@@ -818,11 +862,6 @@
                 endif
 		$$($1_CREATE_DEBUGINFO_CMDS)
 		$$($1_STRIP_CMD)
-                # Touch target to make sure it has a later time stamp than the debug
-                # symbol files to avoid unnecessary relinking on rebuild.
-                ifeq ($(OPENJDK_TARGET_OS), windows)
-		  $(TOUCH) $$@
-                endif
 
   endif
 endef