Merge
authorduke
Wed, 05 Jul 2017 22:16:41 +0200
changeset 41194 220b3e1a7c07
parent 41193 9e274c9c3047 (current diff)
parent 41172 1de8867db5a3 (diff)
child 41233 ff3d92eb6e14
Merge
--- a/.hgtags-top-repo	Fri Sep 30 09:06:02 2016 +0200
+++ b/.hgtags-top-repo	Wed Jul 05 22:16:41 2017 +0200
@@ -380,3 +380,4 @@
 82b94cb5f342319d2cda77f9fa59703ad7fde576 jdk-9+135
 3ec350f5f32af249b59620d7e37b54bdcd77b233 jdk-9+136
 d7f519b004254b19e384131d9f0d0e40e31a0fd3 jdk-9+137
+67c4388142bdf58aec8fefa4475faaa8a5d7380c jdk-9+138
--- a/common/autoconf/buildjdk-spec.gmk.in	Fri Sep 30 09:06:02 2016 +0200
+++ b/common/autoconf/buildjdk-spec.gmk.in	Wed Jul 05 22:16:41 2017 +0200
@@ -33,6 +33,7 @@
 CC := @BUILD_CC@
 CXX := @BUILD_CXX@
 LD := @BUILD_LD@
+LDCXX := @BUILD_LDCXX@
 AS := @BUILD_AS@
 NM := @BUILD_NM@
 AR := @BUILD_AR@
--- a/common/autoconf/generated-configure.sh	Fri Sep 30 09:06:02 2016 +0200
+++ b/common/autoconf/generated-configure.sh	Wed Jul 05 22:16:41 2017 +0200
@@ -687,7 +687,6 @@
 MSVCP_DLL
 MSVCR_DLL
 LIBCXX
-STATIC_CXX_SETTING
 FIXPATH_DETACH_FLAG
 FIXPATH
 BUILD_GTEST
@@ -5092,7 +5091,7 @@
 #CUSTOM_AUTOCONF_INCLUDE
 
 # Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1474894604
+DATE_WHEN_GENERATED=1475218974
 
 ###############################################################################
 #
@@ -53087,49 +53086,10 @@
 
 
   if test "x$OPENJDK_TARGET_OS" = xlinux; then
-    # Test if -lstdc++ works.
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if dynamic link of stdc++ is possible" >&5
-$as_echo_n "checking if dynamic link of stdc++ is possible... " >&6; }
-    ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
-    OLD_CXXFLAGS="$CXXFLAGS"
-    CXXFLAGS="$CXXFLAGS -lstdc++"
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-return 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
-  has_dynamic_libstdcxx=yes
-else
-  has_dynamic_libstdcxx=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-    CXXFLAGS="$OLD_CXXFLAGS"
-    ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $has_dynamic_libstdcxx" >&5
-$as_echo "$has_dynamic_libstdcxx" >&6; }
-
     # Test if stdc++ can be linked statically.
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking if static link of stdc++ is possible" >&5
 $as_echo_n "checking if static link of stdc++ is possible... " >&6; }
-    STATIC_STDCXX_FLAGS="-Wl,-Bstatic -lstdc++ -lgcc -Wl,-Bdynamic"
+    STATIC_STDCXX_FLAGS="-static-libstdc++ -static-libgcc"
     ac_ext=cpp
 ac_cpp='$CXXCPP $CPPFLAGS'
 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -53137,9 +53097,7 @@
 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
 
     OLD_LIBS="$LIBS"
-    OLD_CXX="$CXX"
     LIBS="$STATIC_STDCXX_FLAGS"
-    CXX="$CC"
     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -53159,7 +53117,6 @@
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
     LIBS="$OLD_LIBS"
-    CXX="$OLD_CXX"
     ac_ext=cpp
 ac_cpp='$CXXCPP $CPPFLAGS'
 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -53169,59 +53126,34 @@
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $has_static_libstdcxx" >&5
 $as_echo "$has_static_libstdcxx" >&6; }
 
-    if test "x$has_static_libstdcxx" = xno && test "x$has_dynamic_libstdcxx" = xno; then
-      as_fn_error $? "Cannot link to stdc++, neither dynamically nor statically!" "$LINENO" 5
-    fi
-
     if test "x$with_stdc__lib" = xstatic && test "x$has_static_libstdcxx" = xno; then
       as_fn_error $? "Static linking of libstdc++ was not possible!" "$LINENO" 5
     fi
 
-    if test "x$with_stdc__lib" = xdynamic && test "x$has_dynamic_libstdcxx" = xno; then
-      as_fn_error $? "Dynamic linking of libstdc++ was not possible!" "$LINENO" 5
-    fi
-
     # If dynamic was requested, it's available since it would fail above otherwise.
     # If dynamic wasn't requested, go with static unless it isn't available.
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libstdc++" >&5
 $as_echo_n "checking how to link with libstdc++... " >&6; }
-    if test "x$with_stdc__lib" = xdynamic || test "x$has_static_libstdcxx" = xno ||   [[ " $JVM_VARIANTS " =~ " zeroshark " ]]  ; then
-      LIBCXX="$LIBCXX -lstdc++"
-      # To help comparisons with old build, put stdc++ first in JVM_LIBS
-      JVM_LIBS="-lstdc++ $JVM_LIBS"
-      # Ideally, we should test stdc++ for the BUILD toolchain separately. For now
-      # just use the same setting as for the TARGET toolchain.
-      OPENJDK_BUILD_JVM_LIBS="-lstdc++ $OPENJDK_BUILD_JVM_LIBS"
-      LDCXX="$CXX"
-      STATIC_CXX_SETTING="STATIC_CXX=false"
+    if test "x$with_stdc__lib" = xdynamic || test "x$has_static_libstdcxx" = xno \
+        ||   [[ " $JVM_VARIANTS " =~ " zeroshark " ]]  ; then
       { $as_echo "$as_me:${as_lineno-$LINENO}: result: dynamic" >&5
 $as_echo "dynamic" >&6; }
     else
       LIBCXX="$LIBCXX $STATIC_STDCXX_FLAGS"
-      JVM_LDFLAGS="$JVM_LDFLAGS -static-libgcc"
-      # To help comparisons with old build, put stdc++ first in JVM_LIBS
-      JVM_LIBS="-Wl,-Bstatic -lstdc++ -Wl,-Bdynamic $JVM_LIBS"
+      JVM_LDFLAGS="$JVM_LDFLAGS $STATIC_STDCXX_FLAGS"
       # Ideally, we should test stdc++ for the BUILD toolchain separately. For now
       # just use the same setting as for the TARGET toolchain.
-      OPENJDK_BUILD_JVM_LDFLAGS="$OPENJDK_BUILD_JVM_LDFLAGS -static-libgcc"
-      OPENJDK_BUILD_JVM_LIBS="-Wl,-Bstatic -lstdc++ -Wl,-Bdynamic $OPENJDK_BUILD_JVM_LIBS"
-      LDCXX="$CC"
-      STATIC_CXX_SETTING="STATIC_CXX=true"
+      OPENJDK_BUILD_JVM_LDFLAGS="$OPENJDK_BUILD_JVM_LDFLAGS $STATIC_STDCXX_FLAGS"
       { $as_echo "$as_me:${as_lineno-$LINENO}: result: static" >&5
 $as_echo "static" >&6; }
     fi
   fi
 
-
   # libCrun is the c++ runtime-library with SunStudio (roughly the equivalent of gcc's libstdc++.so)
   if test "x$TOOLCHAIN_TYPE" = xsolstudio && test "x$LIBCXX" = x; then
     LIBCXX="${SYSROOT}/usr/lib${OPENJDK_TARGET_CPU_ISADIR}/libCrun.so.1"
   fi
 
-  # TODO better (platform agnostic) test
-  if test "x$OPENJDK_TARGET_OS" = xmacosx && test "x$LIBCXX" = x && test "x$TOOLCHAIN_TYPE" = xgcc; then
-    LIBCXX="-lstdc++"
-  fi
 
 
   # Setup Windows runtime dlls
--- a/common/autoconf/lib-std.m4	Fri Sep 30 09:06:02 2016 +0200
+++ b/common/autoconf/lib-std.m4	Wed Jul 05 22:16:41 2017 +0200
@@ -45,84 +45,44 @@
   )
 
   if test "x$OPENJDK_TARGET_OS" = xlinux; then
-    # Test if -lstdc++ works.
-    AC_MSG_CHECKING([if dynamic link of stdc++ is possible])
-    AC_LANG_PUSH(C++)
-    OLD_CXXFLAGS="$CXXFLAGS"
-    CXXFLAGS="$CXXFLAGS -lstdc++"
-    AC_LINK_IFELSE([AC_LANG_PROGRAM([], [return 0;])],
-        [has_dynamic_libstdcxx=yes],
-        [has_dynamic_libstdcxx=no])
-    CXXFLAGS="$OLD_CXXFLAGS"
-    AC_LANG_POP(C++)
-    AC_MSG_RESULT([$has_dynamic_libstdcxx])
-
     # Test if stdc++ can be linked statically.
     AC_MSG_CHECKING([if static link of stdc++ is possible])
-    STATIC_STDCXX_FLAGS="-Wl,-Bstatic -lstdc++ -lgcc -Wl,-Bdynamic"
+    STATIC_STDCXX_FLAGS="-static-libstdc++ -static-libgcc"
     AC_LANG_PUSH(C++)
     OLD_LIBS="$LIBS"
-    OLD_CXX="$CXX"
     LIBS="$STATIC_STDCXX_FLAGS"
-    CXX="$CC"
     AC_LINK_IFELSE([AC_LANG_PROGRAM([], [return 0;])],
         [has_static_libstdcxx=yes],
         [has_static_libstdcxx=no])
     LIBS="$OLD_LIBS"
-    CXX="$OLD_CXX"
     AC_LANG_POP(C++)
     AC_MSG_RESULT([$has_static_libstdcxx])
 
-    if test "x$has_static_libstdcxx" = xno && test "x$has_dynamic_libstdcxx" = xno; then
-      AC_MSG_ERROR([Cannot link to stdc++, neither dynamically nor statically!])
-    fi
-
     if test "x$with_stdc__lib" = xstatic && test "x$has_static_libstdcxx" = xno; then
       AC_MSG_ERROR([Static linking of libstdc++ was not possible!])
     fi
 
-    if test "x$with_stdc__lib" = xdynamic && test "x$has_dynamic_libstdcxx" = xno; then
-      AC_MSG_ERROR([Dynamic linking of libstdc++ was not possible!])
-    fi
-
     # If dynamic was requested, it's available since it would fail above otherwise.
     # If dynamic wasn't requested, go with static unless it isn't available.
     AC_MSG_CHECKING([how to link with libstdc++])
-    if test "x$with_stdc__lib" = xdynamic || test "x$has_static_libstdcxx" = xno || HOTSPOT_CHECK_JVM_VARIANT(zeroshark); then
-      LIBCXX="$LIBCXX -lstdc++"
-      # To help comparisons with old build, put stdc++ first in JVM_LIBS
-      JVM_LIBS="-lstdc++ $JVM_LIBS"
-      # Ideally, we should test stdc++ for the BUILD toolchain separately. For now
-      # just use the same setting as for the TARGET toolchain.
-      OPENJDK_BUILD_JVM_LIBS="-lstdc++ $OPENJDK_BUILD_JVM_LIBS"
-      LDCXX="$CXX"
-      STATIC_CXX_SETTING="STATIC_CXX=false"
+    if test "x$with_stdc__lib" = xdynamic || test "x$has_static_libstdcxx" = xno \
+        || HOTSPOT_CHECK_JVM_VARIANT(zeroshark); then
       AC_MSG_RESULT([dynamic])
     else
       LIBCXX="$LIBCXX $STATIC_STDCXX_FLAGS"
-      JVM_LDFLAGS="$JVM_LDFLAGS -static-libgcc"
-      # To help comparisons with old build, put stdc++ first in JVM_LIBS
-      JVM_LIBS="-Wl,-Bstatic -lstdc++ -Wl,-Bdynamic $JVM_LIBS"
+      JVM_LDFLAGS="$JVM_LDFLAGS $STATIC_STDCXX_FLAGS"
       # Ideally, we should test stdc++ for the BUILD toolchain separately. For now
       # just use the same setting as for the TARGET toolchain.
-      OPENJDK_BUILD_JVM_LDFLAGS="$OPENJDK_BUILD_JVM_LDFLAGS -static-libgcc"
-      OPENJDK_BUILD_JVM_LIBS="-Wl,-Bstatic -lstdc++ -Wl,-Bdynamic $OPENJDK_BUILD_JVM_LIBS"
-      LDCXX="$CC"
-      STATIC_CXX_SETTING="STATIC_CXX=true"
+      OPENJDK_BUILD_JVM_LDFLAGS="$OPENJDK_BUILD_JVM_LDFLAGS $STATIC_STDCXX_FLAGS"
       AC_MSG_RESULT([static])
     fi
   fi
-  AC_SUBST(STATIC_CXX_SETTING)
 
   # libCrun is the c++ runtime-library with SunStudio (roughly the equivalent of gcc's libstdc++.so)
   if test "x$TOOLCHAIN_TYPE" = xsolstudio && test "x$LIBCXX" = x; then
     LIBCXX="${SYSROOT}/usr/lib${OPENJDK_TARGET_CPU_ISADIR}/libCrun.so.1"
   fi
 
-  # TODO better (platform agnostic) test
-  if test "x$OPENJDK_TARGET_OS" = xmacosx && test "x$LIBCXX" = x && test "x$TOOLCHAIN_TYPE" = xgcc; then
-    LIBCXX="-lstdc++"
-  fi
   AC_SUBST(LIBCXX)
 
   # Setup Windows runtime dlls
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/ExplodedImageOptimize.gmk	Wed Jul 05 22:16:41 2017 +0200
@@ -0,0 +1,49 @@
+#
+# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+# Runs a tool on the exploded image to improve performance
+
+default: all
+
+include $(SPEC)
+include MakeBase.gmk
+include $(JDK_TOPDIR)/make/ModuleTools.gmk
+
+################################################################################
+
+PACKAGES_ATTRIBUTE_TARGET := $(JDK_OUTPUTDIR)/_packages_attribute.done
+ALL_MODULEINFO_CLASSES := $(wildcard $(JDK_OUTPUTDIR)/modules/*/module_info.class)
+
+$(PACKAGES_ATTRIBUTE_TARGET): $(ALL_MODULEINFO_CLASSES) $(BUILD_JIGSAW_CLASSES)
+	$(call LogInfo, Optimizing the exploded image)
+	$(TOOL_ADD_PACKAGES_ATTRIBUTE) $(JDK_OUTPUTDIR)
+
+TARGETS := $(PACKAGES_ATTRIBUTE_TARGET)
+
+################################################################################
+
+all: $(TARGETS)
+
+.PHONY: all default
--- a/make/Javadoc.gmk	Fri Sep 30 09:06:02 2016 +0200
+++ b/make/Javadoc.gmk	Wed Jul 05 22:16:41 2017 +0200
@@ -1575,7 +1575,7 @@
 $(JACCESSAPI_INDEX_HTML): $(JACCESSAPI_OPTIONS_FILE) $(JACCESSAPI_PACKAGES_FILE) $(COREAPI_INDEX_FILE)
 	$(prep-javadoc)
 	$(call JavadocSummary,$(JACCESSAPI_OPTIONS_FILE),$(JACCESSAPI_PACKAGES_FILE))
-	$(JAVADOC_CMD) -d $(@D) \
+	$(JAVADOC_CMD_SMALL) -d $(@D) \
 	    @$(JACCESSAPI_OPTIONS_FILE) @$(JACCESSAPI_PACKAGES_FILE)
 
 # Create file with javadoc options in it
--- a/make/Main.gmk	Fri Sep 30 09:06:02 2016 +0200
+++ b/make/Main.gmk	Wed Jul 05 22:16:41 2017 +0200
@@ -82,10 +82,13 @@
 
   buildtools-jdk:
 	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileTools.gmk)
+
+  buildtools-modules:
+	+($(CD) $(JDK_TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileModuleTools.gmk)
 endif
 
 ALL_TARGETS += buildtools-langtools interim-langtools \
-    interim-rmic interim-cldrconverter buildtools-jdk
+    interim-rmic interim-cldrconverter buildtools-jdk buildtools-modules
 
 ################################################################################
 # Special targets for certain modules
@@ -340,8 +343,12 @@
 mac-bundles-jdk:
 	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f MacBundles.gmk)
 
+exploded-image-optimize:
+	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f ExplodedImageOptimize.gmk)
+
 ALL_TARGETS += source-tips create-hgtip-files bootcycle-images zip-security \
-     zip-source jrtfs-jar jimages profiles mac-bundles-jdk
+    zip-source jrtfs-jar jimages profiles mac-bundles-jdk \
+    exploded-image-optimize
 
 ################################################################################
 # Docs targets
@@ -521,6 +528,8 @@
 
   buildtools-jdk: interim-langtools interim-cldrconverter
 
+  buildtools-modules: exploded-image-base
+
   $(CORBA_GENSRC_TARGETS): interim-langtools
 
   $(HOTSPOT_GENSRC_TARGETS): interim-langtools
@@ -646,6 +655,7 @@
     # Avoid calling create-buildjdk from within a create-buildjdk call
     ifneq ($(CREATING_BUILDJDK), true)
       $(JMOD_TARGETS): create-buildjdk
+      buildtools-modules: create-buildjdk
     endif
   endif
 
@@ -677,6 +687,8 @@
 
   mac-bundles-jdk: jimages
 
+  exploded-image-optimize: exploded-image-base buildtools-modules
+
   bootcycle-images: jimages
 
   docs-javadoc: $(GENSRC_TARGETS) rmic
@@ -728,7 +740,7 @@
 
   docs-bundles: docs-image
 
-  generate-summary: jmods
+  generate-summary: jmods buildtools-modules
 
 endif
 
@@ -774,7 +786,8 @@
 samples: samples-jdk
 
 # The "exploded image" is a locally runnable JDK in $(BUILD_OUTPUT)/jdk.
-exploded-image: $(ALL_MODULES)
+exploded-image-base: $(ALL_MODULES)
+exploded-image: exploded-image-base exploded-image-optimize
 
 create-buildjdk: create-buildjdk-copy create-buildjdk-interim-image
 
@@ -815,7 +828,8 @@
 all-bundles: product-bundles test-bundles docs-bundles
 
 ALL_TARGETS += buildtools gensrc gendata copy java rmic libs launchers jmods \
-    jdk.jdwp.agent-gensrc $(ALL_MODULES) demos samples exploded-image \
+    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 \
     all-bundles
 
--- a/make/MainSupport.gmk	Fri Sep 30 09:06:02 2016 +0200
+++ b/make/MainSupport.gmk	Wed Jul 05 22:16:41 2017 +0200
@@ -137,7 +137,6 @@
 define DeclareRecipeForModuleMakefile
   ifeq ($$($1_MULTIPLE_MAKEFILES), true)
     $2-$$($1_TARGET_SUFFIX): $2-$$($1_TARGET_SUFFIX)-$$(notdir $3)
-    $1 += $2-$$($1_TARGET_SUFFIX)-$$(notdir $3)
 
     $2-$$($1_TARGET_SUFFIX)-$$(notdir $3):
   else
@@ -173,6 +172,12 @@
 
   # Only declare recipes if there are makefiles to call
   ifneq ($$($1_$2_TOPDIRS), )
+    # Add the top dir specific target to target list regardless of if recipe
+    # generation is disabled.
+    ifeq ($$($1_MULTIPLE_MAKEFILES), true)
+      $$(foreach d, $$($1_$2_TOPDIRS), \
+        $$(eval $1 += $2-$$($1_TARGET_SUFFIX)-$$(notdir $$d)))
+    endif
     ifeq ($(NO_RECIPES),)
       $$(foreach d, $$($1_$2_TOPDIRS), \
           $$(eval $$(call DeclareRecipeForModuleMakefile,$1,$2,$$d)))
--- a/make/common/SetupJavaCompilers.gmk	Fri Sep 30 09:06:02 2016 +0200
+++ b/make/common/SetupJavaCompilers.gmk	Wed Jul 05 22:16:41 2017 +0200
@@ -38,7 +38,10 @@
 # and the interim javac, to be run by the boot jdk.
 $(eval $(call SetupJavaCompiler,BOOT_JAVAC, \
     JAVAC := $(JAVAC), \
-    FLAGS := $(BOOT_JDK_SOURCETARGET) -XDignore.symbol.file=true -g \
+    FLAGS := \
+        $(JAVA_TOOL_FLAGS_SMALL) \
+        $(BOOT_JDK_SOURCETARGET) \
+        -XDignore.symbol.file=true -g \
         -Xlint:all$(COMMA)-deprecation$(COMMA)-options -Werror, \
     DISABLE_SJAVAC := true, \
 ))