changeset 2421:e7c91db2cd25

Merge
author jwilhelm
date Thu, 08 Dec 2016 16:18:03 +0100
parents 66b770c85156 8664e4ad5303
children 05ac48290793
files common/autoconf/buildjdk-spec.gmk.in common/autoconf/flags.m4 common/autoconf/generated-configure.sh common/autoconf/source-dirs.m4 common/autoconf/spec.gmk.in make/Main.gmk
diffstat 11 files changed, 172 insertions(+), 117 deletions(-) [+]
line wrap: on
line diff
--- a/common/autoconf/bootcycle-spec.gmk.in	Wed Dec 07 16:08:23 2016 +0100
+++ b/common/autoconf/bootcycle-spec.gmk.in	Thu Dec 08 16:18:03 2016 +0100
@@ -50,9 +50,6 @@
 # The bootcycle build has a different output directory
 OLD_BUILD_OUTPUT:=@BUILD_OUTPUT@
 BUILD_OUTPUT:=$(OLD_BUILD_OUTPUT)/bootcycle-build
-# The HOTSPOT_DIST dir is not defined relative to BUILD_OUTPUT in spec.gmk. Must not
-# use space in this patsubst to avoid leading space in HOTSPOT_DIST.
-HOTSPOT_DIST:=$(patsubst $(OLD_BUILD_OUTPUT)%,$(BUILD_OUTPUT)%,$(HOTSPOT_DIST))
 SJAVAC_SERVER_DIR:=$(patsubst $(OLD_BUILD_OUTPUT)%, $(BUILD_OUTPUT)%, $(SJAVAC_SERVER_DIR))
 
 JAVA_CMD:=$(BOOT_JDK)/bin/java
--- a/common/autoconf/buildjdk-spec.gmk.in	Wed Dec 07 16:08:23 2016 +0100
+++ b/common/autoconf/buildjdk-spec.gmk.in	Thu Dec 08 16:18:03 2016 +0100
@@ -44,7 +44,6 @@
 
 # These directories should not be moved to BUILDJDK_OUTPUTDIR
 HOTSPOT_OUTPUTDIR := $(patsubst $(BUILD_OUTPUT)%,$(BUILDJDK_OUTPUTDIR)%,$(HOTSPOT_OUTPUTDIR))
-HOTSPOT_DIST := $(patsubst $(BUILD_OUTPUT)%,$(BUILDJDK_OUTPUTDIR)%,$(HOTSPOT_DIST))
 SUPPORT_OUTPUTDIR := $(patsubst $(BUILD_OUTPUT)%,$(BUILDJDK_OUTPUTDIR)%,$(SUPPORT_OUTPUTDIR))
 JDK_OUTPUTDIR := $(patsubst $(BUILD_OUTPUT)%,$(BUILDJDK_OUTPUTDIR)%,$(JDK_OUTPUTDIR))
 IMAGES_OUTPUTDIR := $(patsubst $(BUILD_OUTPUT)%,$(BUILDJDK_OUTPUTDIR)%,$(IMAGES_OUTPUTDIR))
@@ -90,6 +89,7 @@
 BUILD_GTEST := false
 
 JVM_VARIANTS := server
+JVM_VARIANT_MAIN := server
 
 # Some users still set EXTRA_*FLAGS on the make command line. Must
 # make sure to override that when building buildjdk.
--- a/common/autoconf/flags.m4	Wed Dec 07 16:08:23 2016 +0100
+++ b/common/autoconf/flags.m4	Thu Dec 08 16:18:03 2016 +0100
@@ -1163,19 +1163,18 @@
         -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_$1_CPU_LIBDIR)"
 
     if test "x$1" = "xTARGET"; then
-    # On some platforms (mac) the linker warns about non existing -L dirs.
-    # Add server first if available. Linking aginst client does not always produce the same results.
-      # Only add client/minimal dir if client/minimal is being built.
-    # Default to server for other variants.
-      if HOTSPOT_CHECK_JVM_VARIANT(server); then
-        $2JAVA_BASE_LDFLAGS="${$2JAVA_BASE_LDFLAGS} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_$1_CPU_LIBDIR)/server"
-      elif HOTSPOT_CHECK_JVM_VARIANT(client); then
-        $2JAVA_BASE_LDFLAGS="${$2JAVA_BASE_LDFLAGS} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_$1_CPU_LIBDIR)/client"
-      elif HOTSPOT_CHECK_JVM_VARIANT(minimal); then
-        $2JAVA_BASE_LDFLAGS="${$2JAVA_BASE_LDFLAGS} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_$1_CPU_LIBDIR)/minimal"
-    else
-        $2JAVA_BASE_LDFLAGS="${$2JAVA_BASE_LDFLAGS} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_$1_CPU_LIBDIR)/server"
-    fi
+      # On some platforms (mac) the linker warns about non existing -L dirs.
+      # For any of the variants server, client or minimal, the dir matches the
+      # variant name. The "main" variant should be used for linking. For the
+      # rest, the dir is just server.
+      if HOTSPOT_CHECK_JVM_VARIANT(server) || HOTSPOT_CHECK_JVM_VARIANT(client) \
+          || HOTSPOT_CHECK_JVM_VARIANT(minimal); then
+        $2JAVA_BASE_LDFLAGS="${$2JAVA_BASE_LDFLAGS} \
+            -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_$1_CPU_LIBDIR)/$JVM_VARIANT_MAIN"
+      else
+        $2JAVA_BASE_LDFLAGS="${$2JAVA_BASE_LDFLAGS} \
+            -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_$1_CPU_LIBDIR)/server"
+      fi
     elif test "x$1" = "xBUILD"; then
       # When building a buildjdk, it's always only the server variant
       $2JAVA_BASE_LDFLAGS="${$2JAVA_BASE_LDFLAGS} \
--- a/common/autoconf/generated-configure.sh	Wed Dec 07 16:08:23 2016 +0100
+++ b/common/autoconf/generated-configure.sh	Thu Dec 08 16:18:03 2016 +0100
@@ -867,8 +867,6 @@
 IMPORT_MODULES_LIBS
 IMPORT_MODULES_CMDS
 IMPORT_MODULES_CLASSES
-BUILD_HOTSPOT
-HOTSPOT_DIST
 BUILD_OUTPUT
 JDK_TOPDIR
 NASHORN_TOPDIR
@@ -961,6 +959,7 @@
 SPEC
 SDKROOT
 XCODEBUILD
+JVM_VARIANT_MAIN
 VALID_JVM_VARIANTS
 JVM_VARIANTS
 DEBUG_LEVEL
@@ -2097,9 +2096,8 @@
                           compatibility and is ignored
   --with-override-jdk     Deprecated. Option is kept for backwards
                           compatibility and is ignored
-  --with-import-hotspot   import hotspot binaries from this jdk image or
-                          hotspot build dist dir instead of building from
-                          source
+  --with-import_hotspot   Deprecated. Option is kept for backwards
+                          compatibility and is ignored
   --with-import-modules   import a set of prebuilt modules either as a zip
                           file or an exploded directory
   --with-toolchain-type   the toolchain type (or family) to use, use '--help'
@@ -5088,7 +5086,7 @@
 #CUSTOM_AUTOCONF_INCLUDE
 
 # Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1481104795
+DATE_WHEN_GENERATED=1481210228
 
 ###############################################################################
 #
@@ -16750,6 +16748,21 @@
     as_fn_error $? "You cannot build multiple variants with anything else than $VALID_MULTIPLE_JVM_VARIANTS." "$LINENO" 5
   fi
 
+  # The "main" variant is the one used by other libs to link against during the
+  # build.
+  if test "x$BUILDING_MULTIPLE_JVM_VARIANTS" = "xtrue"; then
+    MAIN_VARIANT_PRIO_ORDER="server client minimal"
+    for variant in $MAIN_VARIANT_PRIO_ORDER; do
+      if   [[ " $JVM_VARIANTS " =~ " $variant " ]]  ; then
+        JVM_VARIANT_MAIN="$variant"
+        break
+      fi
+    done
+  else
+    JVM_VARIANT_MAIN="$JVM_VARIANTS"
+  fi
+
+
 
 
 
@@ -30992,33 +31005,17 @@
 
   BUILD_OUTPUT="$OUTPUT_ROOT"
 
-
-  HOTSPOT_DIST="$OUTPUT_ROOT/hotspot/dist"
-  BUILD_HOTSPOT=true
-
-
-
-# Check whether --with-import-hotspot was given.
+  JDK_OUTPUTDIR="$OUTPUT_ROOT/jdk"
+
+
+
+# Check whether --with-import_hotspot was given.
 if test "${with_import_hotspot+set}" = set; then :
-  withval=$with_import_hotspot;
-fi
-
-  if test "x$with_import_hotspot" != x; then
-    CURDIR="$PWD"
-    cd "$with_import_hotspot"
-    HOTSPOT_DIST="`pwd`"
-    cd "$CURDIR"
-    if ! (test -d $HOTSPOT_DIST/lib && test -d $HOTSPOT_DIST/jre/lib); then
-      as_fn_error $? "You have to import hotspot from a full jdk image or hotspot build dist dir!" "$LINENO" 5
-    fi
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if hotspot should be imported" >&5
-$as_echo_n "checking if hotspot should be imported... " >&6; }
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes from $HOTSPOT_DIST" >&5
-$as_echo "yes from $HOTSPOT_DIST" >&6; }
-    BUILD_HOTSPOT=false
-  fi
-
-  JDK_OUTPUTDIR="$OUTPUT_ROOT/jdk"
+  withval=$with_import_hotspot; { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Option --with-import_hotspot is deprecated and will be ignored." >&5
+$as_echo "$as_me: WARNING: Option --with-import_hotspot is deprecated and will be ignored." >&2;}
+fi
+
+
 
 
 
@@ -50382,19 +50379,18 @@
         -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_TARGET_CPU_LIBDIR)"
 
     if test "xTARGET" = "xTARGET"; then
-    # On some platforms (mac) the linker warns about non existing -L dirs.
-    # Add server first if available. Linking aginst client does not always produce the same results.
-      # Only add client/minimal dir if client/minimal is being built.
-    # Default to server for other variants.
-      if   [[ " $JVM_VARIANTS " =~ " server " ]]  ; then
-        JAVA_BASE_LDFLAGS="${JAVA_BASE_LDFLAGS} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_TARGET_CPU_LIBDIR)/server"
-      elif   [[ " $JVM_VARIANTS " =~ " client " ]]  ; then
-        JAVA_BASE_LDFLAGS="${JAVA_BASE_LDFLAGS} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_TARGET_CPU_LIBDIR)/client"
-      elif   [[ " $JVM_VARIANTS " =~ " minimal " ]]  ; then
-        JAVA_BASE_LDFLAGS="${JAVA_BASE_LDFLAGS} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_TARGET_CPU_LIBDIR)/minimal"
-    else
-        JAVA_BASE_LDFLAGS="${JAVA_BASE_LDFLAGS} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_TARGET_CPU_LIBDIR)/server"
-    fi
+      # On some platforms (mac) the linker warns about non existing -L dirs.
+      # For any of the variants server, client or minimal, the dir matches the
+      # variant name. The "main" variant should be used for linking. For the
+      # rest, the dir is just server.
+      if   [[ " $JVM_VARIANTS " =~ " server " ]]   ||   [[ " $JVM_VARIANTS " =~ " client " ]]   \
+          ||   [[ " $JVM_VARIANTS " =~ " minimal " ]]  ; then
+        JAVA_BASE_LDFLAGS="${JAVA_BASE_LDFLAGS} \
+            -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_TARGET_CPU_LIBDIR)/$JVM_VARIANT_MAIN"
+      else
+        JAVA_BASE_LDFLAGS="${JAVA_BASE_LDFLAGS} \
+            -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_TARGET_CPU_LIBDIR)/server"
+      fi
     elif test "xTARGET" = "xBUILD"; then
       # When building a buildjdk, it's always only the server variant
       JAVA_BASE_LDFLAGS="${JAVA_BASE_LDFLAGS} \
@@ -51205,19 +51201,18 @@
         -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_BUILD_CPU_LIBDIR)"
 
     if test "xBUILD" = "xTARGET"; then
-    # On some platforms (mac) the linker warns about non existing -L dirs.
-    # Add server first if available. Linking aginst client does not always produce the same results.
-      # Only add client/minimal dir if client/minimal is being built.
-    # Default to server for other variants.
-      if   [[ " $JVM_VARIANTS " =~ " server " ]]  ; then
-        OPENJDK_BUILD_JAVA_BASE_LDFLAGS="${OPENJDK_BUILD_JAVA_BASE_LDFLAGS} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_BUILD_CPU_LIBDIR)/server"
-      elif   [[ " $JVM_VARIANTS " =~ " client " ]]  ; then
-        OPENJDK_BUILD_JAVA_BASE_LDFLAGS="${OPENJDK_BUILD_JAVA_BASE_LDFLAGS} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_BUILD_CPU_LIBDIR)/client"
-      elif   [[ " $JVM_VARIANTS " =~ " minimal " ]]  ; then
-        OPENJDK_BUILD_JAVA_BASE_LDFLAGS="${OPENJDK_BUILD_JAVA_BASE_LDFLAGS} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_BUILD_CPU_LIBDIR)/minimal"
-    else
-        OPENJDK_BUILD_JAVA_BASE_LDFLAGS="${OPENJDK_BUILD_JAVA_BASE_LDFLAGS} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_BUILD_CPU_LIBDIR)/server"
-    fi
+      # On some platforms (mac) the linker warns about non existing -L dirs.
+      # For any of the variants server, client or minimal, the dir matches the
+      # variant name. The "main" variant should be used for linking. For the
+      # rest, the dir is just server.
+      if   [[ " $JVM_VARIANTS " =~ " server " ]]   ||   [[ " $JVM_VARIANTS " =~ " client " ]]   \
+          ||   [[ " $JVM_VARIANTS " =~ " minimal " ]]  ; then
+        OPENJDK_BUILD_JAVA_BASE_LDFLAGS="${OPENJDK_BUILD_JAVA_BASE_LDFLAGS} \
+            -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_BUILD_CPU_LIBDIR)/$JVM_VARIANT_MAIN"
+      else
+        OPENJDK_BUILD_JAVA_BASE_LDFLAGS="${OPENJDK_BUILD_JAVA_BASE_LDFLAGS} \
+            -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_BUILD_CPU_LIBDIR)/server"
+      fi
     elif test "xBUILD" = "xBUILD"; then
       # When building a buildjdk, it's always only the server variant
       OPENJDK_BUILD_JAVA_BASE_LDFLAGS="${OPENJDK_BUILD_JAVA_BASE_LDFLAGS} \
--- a/common/autoconf/hotspot.m4	Wed Dec 07 16:08:23 2016 +0100
+++ b/common/autoconf/hotspot.m4	Thu Dec 08 16:18:03 2016 +0100
@@ -111,8 +111,23 @@
     AC_MSG_ERROR([You cannot build multiple variants with anything else than $VALID_MULTIPLE_JVM_VARIANTS.])
   fi
 
+  # The "main" variant is the one used by other libs to link against during the
+  # build.
+  if test "x$BUILDING_MULTIPLE_JVM_VARIANTS" = "xtrue"; then
+    MAIN_VARIANT_PRIO_ORDER="server client minimal"
+    for variant in $MAIN_VARIANT_PRIO_ORDER; do
+      if HOTSPOT_CHECK_JVM_VARIANT($variant); then
+        JVM_VARIANT_MAIN="$variant"
+        break
+      fi
+    done
+  else
+    JVM_VARIANT_MAIN="$JVM_VARIANTS"
+  fi
+
   AC_SUBST(JVM_VARIANTS)
   AC_SUBST(VALID_JVM_VARIANTS)
+  AC_SUBST(JVM_VARIANT_MAIN)
 
   if HOTSPOT_CHECK_JVM_VARIANT(zero) || HOTSPOT_CHECK_JVM_VARIANT(zeroshark); then
     # zero behaves as a platform and rewrites these values. This is really weird. :(
--- a/common/autoconf/source-dirs.m4	Wed Dec 07 16:08:23 2016 +0100
+++ b/common/autoconf/source-dirs.m4	Thu Dec 08 16:18:03 2016 +0100
@@ -62,27 +62,9 @@
 [
   BUILD_OUTPUT="$OUTPUT_ROOT"
   AC_SUBST(BUILD_OUTPUT)
+  JDK_OUTPUTDIR="$OUTPUT_ROOT/jdk"
 
-  HOTSPOT_DIST="$OUTPUT_ROOT/hotspot/dist"
-  BUILD_HOTSPOT=true
-  AC_SUBST(HOTSPOT_DIST)
-  AC_SUBST(BUILD_HOTSPOT)
-  AC_ARG_WITH(import-hotspot, [AS_HELP_STRING([--with-import-hotspot],
-  [import hotspot binaries from this jdk image or hotspot build dist dir instead of building from source])])
-  if test "x$with_import_hotspot" != x; then
-    CURDIR="$PWD"
-    cd "$with_import_hotspot"
-    HOTSPOT_DIST="`pwd`"
-    cd "$CURDIR"
-    if ! (test -d $HOTSPOT_DIST/lib && test -d $HOTSPOT_DIST/jre/lib); then
-      AC_MSG_ERROR([You have to import hotspot from a full jdk image or hotspot build dist dir!])
-    fi
-    AC_MSG_CHECKING([if hotspot should be imported])
-    AC_MSG_RESULT([yes from $HOTSPOT_DIST])
-    BUILD_HOTSPOT=false
-  fi
-
-  JDK_OUTPUTDIR="$OUTPUT_ROOT/jdk"
+  BASIC_DEPRECATED_ARG_WITH(import_hotspot)
 ])
 
 ################################################################################
--- a/common/autoconf/spec.gmk.in	Wed Dec 07 16:08:23 2016 +0100
+++ b/common/autoconf/spec.gmk.in	Thu Dec 08 16:18:03 2016 +0100
@@ -220,6 +220,7 @@
 
 # Which JVM variants to build (space-separated list)
 JVM_VARIANTS := @JVM_VARIANTS@
+JVM_VARIANT_MAIN := @JVM_VARIANT_MAIN@
 
 # Lists of features per variant. Only relevant for the variants listed in
 # JVM_VARIANTS.
@@ -273,8 +274,6 @@
 CONFIGURESUPPORT_OUTPUTDIR:=@CONFIGURESUPPORT_OUTPUTDIR@
 BUILDJDK_OUTPUTDIR=$(BUILD_OUTPUT)/buildjdk
 
-HOTSPOT_DIST=@HOTSPOT_DIST@
-
 BUILD_HOTSPOT=@BUILD_HOTSPOT@
 
 BUILD_FAILURE_HANDLER := @BUILD_FAILURE_HANDLER@
--- a/make/Help.gmk	Wed Dec 07 16:08:23 2016 +0100
+++ b/make/Help.gmk	Thu Dec 08 16:18:03 2016 +0100
@@ -66,6 +66,12 @@
 	$(info $(_) make clean-<module>-<phase> # Remove all build results related to a certain)
 	$(info $(_)                        # module and phase)
 	$(info )
+	$(info Targets for Hotspot)
+	$(info $(_) make hotspot           # Build all of hotspot)
+	$(info $(_) make hotspot-<variant> # Build just the specified jvm variant)
+	$(info $(_) make hotspot-gensrc    # Only build the gensrc part of hotspot)
+	$(info $(_) make hotspot-<variant>-<phase> # Build the specified phase for the specified module)
+	$(info )
 	$(info Targets for specific modules)
 	$(info $(_) make <module>          # Build <module> and everything it depends on)
 	$(info $(_) make <module>-<phase>  # Compile the specified phase for the specified module)
--- a/make/Main.gmk	Wed Dec 07 16:08:23 2016 +0100
+++ b/make/Main.gmk	Thu Dec 08 16:18:03 2016 +0100
@@ -236,15 +236,35 @@
 ################################################################################
 # Build hotspot target
 
-ifeq ($(BUILD_HOTSPOT),true)
-  hotspot:
-	+($(CD) $(HOTSPOT_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f BuildHotspot.gmk)
-endif
+HOTSPOT_VARIANT_TARGETS := $(addprefix hotspot-, $(JVM_VARIANTS))
+HOTSPOT_VARIANT_GENSRC_TARGETS := $(addsuffix -gensrc, $(HOTSPOT_VARIANT_TARGETS))
+HOTSPOT_VARIANT_LIBS_TARGETS := $(addsuffix -libs, $(HOTSPOT_VARIANT_TARGETS))
+
+define DeclareHotspotGensrcRecipe
+  hotspot-$1-gensrc:
+	$$(call LogInfo, Building JVM variant '$1' with features '$(JVM_FEATURES_$1)')
+	+($(CD) $(HOTSPOT_TOPDIR)/make && $(MAKE) -f gensrc/GenerateSources.gmk \
+	    JVM_VARIANT=$1)
+endef
+
+$(foreach v, $(JVM_VARIANTS), $(eval $(call DeclareHotspotGensrcRecipe,$v)))
+
+define DeclareHotspotLibsRecipe
+  hotspot-$1-libs:
+	+($(CD) $(HOTSPOT_TOPDIR)/make && $(MAKE) -f lib/CompileLibraries.gmk \
+	    JVM_VARIANT=$1)
+endef
+
+$(foreach v, $(JVM_VARIANTS), $(eval $(call DeclareHotspotLibsRecipe,$v)))
+
+hotspot-jsig:
+	+($(CD) $(HOTSPOT_TOPDIR)/make && $(MAKE) -f lib/CompileLibjsig.gmk)
 
 hotspot-ide-project:
 	+($(CD) $(HOTSPOT_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f ide/CreateVSProject.gmk)
 
-ALL_TARGETS += hotspot hotspot-ide-project
+ALL_TARGETS += $(HOTSPOT_VARIANT_TARGETS) $(HOTSPOT_VARIANT_GENSRC_TARGETS) \
+    $(HOTSPOT_VARIANT_LIBS_TARGETS) hotspot-jsig hotspot-ide-project
 
 ################################################################################
 # Build demos and samples targets
@@ -545,11 +565,18 @@
 
   $(JAVA_TARGETS): interim-langtools
 
+  # Declare dependencies between hotspot-<variant>* targets
+  $(foreach v, $(JVM_VARIANTS), \
+      $(eval hotspot-$v: hotspot-$v-gensrc hotspot-$v-libs) \
+      $(eval hotspot-$v-libs: hotspot-$v-gensrc) \
+  )
+
   hotspot-ide-project: hotspot exploded-image
 
   generate-exported-symbols: java.base-libs jdk.jdwp.agent-libs
 
-  $(LIBS_TARGETS): hotspot
+  # Building one JVM variant is enough to start building the other libs
+  $(LIBS_TARGETS): hotspot-$(JVM_VARIANT_MAIN)-libs
 
   $(LAUNCHER_TARGETS): java.base-libs
 
@@ -615,6 +642,9 @@
         $(addsuffix -jmod, $(call FindAllUpgradeableModules)), $(JMOD_TARGETS))
   endif
 
+  # Building java.base-jmod requires all of hotspot to be built.
+  java.base-jmod: hotspot
+
   # Declare dependencies from <module>-jmod to all other module targets
   # When creating a BUILDJDK, the java compilation has already been done by the
   # normal build and copied in.
@@ -702,7 +732,7 @@
   docs-javadoc: $(GENSRC_TARGETS) rmic
 
   # The gensrc step for jdk.jdi creates an html file that is used by docs-copy.
-  docs-copy: hotspot jdk.jdi-gensrc
+  docs-copy: hotspot-$(JVM_VARIANT_MAIN)-gensrc jdk.jdi-gensrc
 
   docs-zip: docs-javadoc docs-copy
 
@@ -725,7 +755,8 @@
 
   test-image-failure-handler: build-test-failure-handler
 
-  build-test-hotspot-jtreg-native: buildtools-jdk hotspot
+  build-test-hotspot-jtreg-native: buildtools-jdk \
+      hotspot-$(JVM_VARIANT_MAIN)-libs
 
   build-test-jdk-jtreg-native: buildtools-jdk
 
@@ -759,6 +790,16 @@
 buildtools: buildtools-langtools interim-langtools interim-rmic \
     buildtools-jdk
 
+hotspot: $(HOTSPOT_VARIANT_TARGETS) hotspot-jsig
+
+hotspot-libs: hotspot-jsig
+
+# Create targets hotspot-libs and hotspot-gensrc.
+$(foreach v, $(JVM_VARIANTS), \
+  $(eval hotspot-libs: hotspot-$v-libs) \
+  $(eval hotspot-gensrc: hotspot-$v-gensrc) \
+)
+
 gensrc: $(GENSRC_TARGETS)
 
 gendata: $(GENDATA_TARGETS)
@@ -788,6 +829,10 @@
 $(foreach m, $(LIBS_MODULES), $(eval $m: $m-libs))
 $(foreach m, $(LAUNCHER_MODULES), $(eval $m: $m-launchers))
 $(foreach m, $(ALL_COPY_MODULES), $(eval $m: $m-copy))
+
+# Building java.base includes building all of hotspot.
+java.base: hotspot
+
 demos: demos-jdk
 
 samples: samples-jdk
@@ -843,7 +888,8 @@
 # all-bundles packages all our deliverables as tar.gz bundles.
 all-bundles: product-bundles test-bundles docs-bundles
 
-ALL_TARGETS += buildtools gensrc gendata copy java rmic libs launchers jmods \
+ALL_TARGETS += buildtools hotspot hotspot-libs hotspot-gensrc gensrc gendata \
+    copy java rmic libs launchers jmods \
     jdk.jdwp.agent-gensrc $(ALL_MODULES) demos samples \
     exploded-image-base exploded-image \
     create-buildjdk mac-bundles product-images docs-image test-image all-images \
--- a/test/jtreg-ext/requires/VMProps.java	Wed Dec 07 16:08:23 2016 +0100
+++ b/test/jtreg-ext/requires/VMProps.java	Thu Dec 08 16:18:03 2016 +0100
@@ -25,6 +25,7 @@
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Paths;
+import java.nio.file.StandardOpenOption;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -60,9 +61,10 @@
         map.put("vm.flightRecorder", vmFlightRecorder());
         map.put("vm.simpleArch", vmArch());
         map.put("vm.debug", vmDebug());
+        map.put("vm.jvmci", vmJvmci());
         vmGC(map); // vm.gc.X = true/false
 
-        dump(map);
+        VMProps.dump(map);
         return map;
     }
 
@@ -156,6 +158,14 @@
     }
 
     /**
+     * @return true if VM supports JVMCI and false otherwise
+     */
+    protected String vmJvmci() {
+        // builds with jvmci have this flag
+        return "" + (WB.getBooleanVMFlag("EnableJVMCI") != null);
+    }
+
+    /**
      * For all existing GC sets vm.gc.X property.
      * Example vm.gc.G1=true means:
      *    VM supports G1
@@ -180,7 +190,7 @@
      *
      * @param map
      */
-    protected void dump(Map<String, String> map) {
+    protected static void dump(Map<String, String> map) {
         String dumpFileName = System.getProperty("vmprops.dump");
         if (dumpFileName == null) {
             return;
@@ -188,7 +198,7 @@
         List<String> lines = new ArrayList<>();
         map.forEach((k, v) -> lines.add(k + ":" + v));
         try {
-            Files.write(Paths.get(dumpFileName), lines);
+            Files.write(Paths.get(dumpFileName), lines, StandardOpenOption.APPEND);
         } catch (IOException e) {
             throw new RuntimeException("Failed to dump properties into '"
                     + dumpFileName + "'", e);
--- a/test/lib/jdk/test/lib/Platform.java	Wed Dec 07 16:08:23 2016 +0100
+++ b/test/lib/jdk/test/lib/Platform.java	Thu Dec 08 16:18:03 2016 +0100
@@ -160,9 +160,8 @@
         return vmVersion;
     }
 
-    // Returns true for sparc and sparcv9.
-    public static boolean isSparc() {
-        return isArch("sparc.*");
+    public static boolean isAArch64() {
+        return isArch("aarch64");
     }
 
     public static boolean isARM() {
@@ -173,9 +172,14 @@
         return isArch("ppc.*");
     }
 
-    public static boolean isX86() {
-        // On Linux it's 'i386', Windows 'x86' without '_64' suffix.
-        return isArch("(i386)|(x86(?!_64))");
+    // Returns true for IBM z System running linux.
+    public static boolean isS390x() {
+        return isArch("s390.*") || isArch("s/390.*") || isArch("zArch_64");
+    }
+
+    // Returns true for sparc and sparcv9.
+    public static boolean isSparc() {
+        return isArch("sparc.*");
     }
 
     public static boolean isX64() {
@@ -183,8 +187,9 @@
         return isArch("(amd64)|(x86_64)");
     }
 
-    public static boolean isAArch64() {
-        return isArch("aarch64");
+    public static boolean isX86() {
+        // On Linux it's 'i386', Windows 'x86' without '_64' suffix.
+        return isArch("(i386)|(x86(?!_64))");
     }
 
     public static String getOsArch() {
@@ -200,6 +205,7 @@
         if (isAix()) {
             return false;   // SA not implemented.
         } else if (isLinux()) {
+            if (isS390x()) { return false; }   // SA not implemented.
             return canPtraceAttachLinux();
         } else if (isOSX()) {
             return canAttachOSX();