OpenJDK / jdk / jdk10
changeset 36615:c744e3b0f8c5
Merge
line wrap: on
line diff
--- a/.hgtags Tue Mar 15 14:48:45 2016 -0700 +++ b/.hgtags Tue Mar 22 10:43:58 2016 +0000 @@ -352,3 +352,4 @@ 1c076468bf7dad5b8f2ee5dcf66e2279caa3e208 jdk-9+107 257b579d813201682931d6b42f0445ffe5b4210d jdk-9+108 c870cb782aca71093d2584376f27f0cfbfec0e3a jdk-9+109 +4a95f4b1bd8bfce85dc02a593896749feab96c34 jdk-9+110
--- a/.hgtags-top-repo Tue Mar 15 14:48:45 2016 -0700 +++ b/.hgtags-top-repo Tue Mar 22 10:43:58 2016 +0000 @@ -352,3 +352,4 @@ 4d65eba233a8730f913734a6804910b842d2cb54 jdk-9+107 c7be2a78c31b3b6132f2f5e9e4b3d3bb1c20245c jdk-9+108 1787bdaabb2b6f4193406e25a50cb0419ea8e8f3 jdk-9+109 +925be13b3740d07a5958ccb5ab3c0ae1baba7055 jdk-9+110
--- a/common/autoconf/basics.m4 Tue Mar 15 14:48:45 2016 -0700 +++ b/common/autoconf/basics.m4 Tue Mar 22 10:43:58 2016 +0000 @@ -843,6 +843,8 @@ AC_CONFIG_FILES([$OUTPUT_ROOT/hotspot-spec.gmk:$AUTOCONF_DIR/hotspot-spec.gmk.in]) # The bootcycle-spec.gmk file contains support for boot cycle builds. AC_CONFIG_FILES([$OUTPUT_ROOT/bootcycle-spec.gmk:$AUTOCONF_DIR/bootcycle-spec.gmk.in]) + # The buildjdk-spec.gmk file contains support for building a buildjdk when cross compiling. + AC_CONFIG_FILES([$OUTPUT_ROOT/buildjdk-spec.gmk:$AUTOCONF_DIR/buildjdk-spec.gmk.in]) # The compare.sh is used to compare the build output to other builds. AC_CONFIG_FILES([$OUTPUT_ROOT/compare.sh:$AUTOCONF_DIR/compare.sh.in]) # The generated Makefile knows where the spec.gmk is and where the source is.
--- a/common/autoconf/boot-jdk.m4 Tue Mar 15 14:48:45 2016 -0700 +++ b/common/autoconf/boot-jdk.m4 Tue Mar 22 10:43:58 2016 +0000 @@ -304,6 +304,18 @@ # When compiling code to be executed by the Boot JDK, force jdk8 compatibility. BOOT_JDK_SOURCETARGET="-source 8 -target 8" AC_SUBST(BOOT_JDK_SOURCETARGET) + + ADD_JVM_ARG_IF_OK([-Xpatch:], dummy, [$JAVA]) + AC_MSG_CHECKING([if Boot JDK supports modules]) + if test "x$JVM_ARG_OK" = "xtrue"; then + AC_MSG_RESULT([yes]) + BOOT_JDK_MODULAR="true" + else + AC_MSG_RESULT([no]) + BOOT_JDK_MODULAR="false" + fi + AC_SUBST(BOOT_JDK_MODULAR) + AC_SUBST(JAVAC_FLAGS) # Check if the boot jdk is 32 or 64 bit @@ -397,3 +409,100 @@ done AC_SUBST(JAVA_TOOL_FLAGS_SMALL) ]) + +# BUILD_JDK: the location of the latest JDK that can run +# on the host system and supports the target class file version +# generated in this JDK build. This variable should only be +# used after the launchers are built. +# + +# Execute the check given as argument, and verify the result. +# If the JDK was previously found, do nothing. +# $1 A command line (typically autoconf macro) to execute +AC_DEFUN([BOOTJDK_CHECK_BUILD_JDK], +[ + if test "x$BUILD_JDK_FOUND" = xno; then + # Execute the test + $1 + + # If previous step claimed to have found a JDK, check it to see if it seems to be valid. + if test "x$BUILD_JDK_FOUND" = xmaybe; then + # Do we have a bin/java? + if test ! -x "$BUILD_JDK/bin/java"; then + AC_MSG_NOTICE([Potential Build JDK found at $BUILD_JDK did not contain bin/java; ignoring]) + BUILD_JDK_FOUND=no + elif test ! -x "$BUILD_JDK/bin/jlink"; then + AC_MSG_NOTICE([Potential Build JDK found at $BUILD_JDK did not contain bin/jlink; ignoring]) + BUILD_JDK_FOUND=no + elif test ! -x "$BUILD_JDK/bin/javac"; then + # Do we have a bin/javac? + AC_MSG_NOTICE([Potential Build JDK found at $BUILD_JDK did not contain bin/javac; ignoring]) + AC_MSG_NOTICE([(This might be a JRE instead of an JDK)]) + BUILD_JDK_FOUND=no + else + # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version? + BUILD_JDK_VERSION=`"$BUILD_JDK/bin/java" -version 2>&1 | head -n 1` + + # Extra M4 quote needed to protect [] in grep expression. + [FOUND_CORRECT_VERSION=`echo $BUILD_JDK_VERSION | grep '\"1\.[9]\.'`] + if test "x$FOUND_CORRECT_VERSION" = x; then + AC_MSG_NOTICE([Potential Boot JDK found at $BUILD_JDK is incorrect JDK version ($BUILD_JDK_VERSION); ignoring]) + AC_MSG_NOTICE([(Your Build JDK must be version 9)]) + BUILD_JDK_FOUND=no + else + # We're done! + BUILD_JDK_FOUND=yes + BASIC_FIXUP_PATH(BUILD_JDK) + AC_MSG_CHECKING([for Build JDK]) + AC_MSG_RESULT([$BUILD_JDK]) + AC_MSG_CHECKING([Build JDK version]) + BUILD_JDK_VERSION=`"$BUILD_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '` + AC_MSG_RESULT([$BUILD_JDK_VERSION]) + fi # end check jdk version + fi # end check java + fi # end check build jdk found + fi +]) + +# By default the BUILD_JDK is the JDK_OUTPUTDIR. If the target architecture +# is different than the host system doing the build (e.g. cross-compilation), +# a special BUILD_JDK is built as part of the build process. An external +# prebuilt BUILD_JDK can also be supplied. +AC_DEFUN([BOOTJDK_SETUP_BUILD_JDK], +[ + AC_ARG_WITH(build-jdk, [AS_HELP_STRING([--with-build-jdk], + [path to JDK of same version as is being built@<:@the newly built JDK@:>@])]) + + CREATE_BUILDJDK_FOR_HOST=false + BUILD_JDK_FOUND="no" + if test "x$with_build_jdk" != "x"; then + BOOTJDK_CHECK_BUILD_JDK([ + if test "x$with_build_jdk" != x; then + BUILD_JDK=$with_build_jdk + BUILD_JDK_FOUND=maybe + AC_MSG_NOTICE([Found potential Build JDK using configure arguments]) + fi]) + else + if test "x$COMPILE_TYPE" = "xcross"; then + BUILD_JDK="\$(BUILDJDK_OUTPUTDIR)/jdk" + BUILD_JDK_FOUND=yes + CREATE_BUILDJDK=true + AC_MSG_CHECKING([for Build JDK]) + AC_MSG_RESULT([yes, will build it for the host platform]) + else + BUILD_JDK="\$(JDK_OUTPUTDIR)" + BUILD_JDK_FOUND=yes + AC_MSG_CHECKING([for Build JDK]) + AC_MSG_RESULT([yes, will use output dir]) + fi + fi + + if test "x$BUILD_JDK_FOUND" != "xyes"; then + AC_MSG_CHECKING([for Build JDK]) + AC_MSG_RESULT([no]) + AC_MSG_ERROR([Could not find a suitable Build JDK]) + fi + + AC_SUBST(CREATE_BUILDJDK) + AC_SUBST(BUILD_JDK) +])
--- a/common/autoconf/bootcycle-spec.gmk.in Tue Mar 15 14:48:45 2016 -0700 +++ b/common/autoconf/bootcycle-spec.gmk.in Tue Mar 22 10:43:58 2016 +0000 @@ -25,6 +25,8 @@ # Support for building boot cycle builds +BOOT_JDK_MODULAR := true + # First include the real base spec.gmk file include @SPEC@
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/common/autoconf/buildjdk-spec.gmk.in Tue Mar 22 10:43:58 2016 +0000 @@ -0,0 +1,148 @@ +# +# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# This spec file is used to compile a BUILD_JDK while cross compiling. The +# BUILD_JDK runs on the build/host platform and is of the same version as +# the main build. + +# First include the real base spec.gmk file +include @SPEC@ + +CC := @BUILD_CC@ +CXX := @BUILD_CXX@ +LD := @BUILD_LD@ +AS := @BUILD_AS@ +NM := @BUILD_NM@ +AR := @BUILD_AR@ +OBJCOPY := @BUILD_OBJCOPY@ +STRIP := @BUILD_STRIP@ +SYSROOT_CFLAGS := @BUILD_SYSROOT_CFLAGS@ +SYSROOT_LDFLAGS := @BUILD_SYSROOT_LDFLAGS@ + +# 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)) + +OPENJDK_BUILD_CPU_LEGACY := @OPENJDK_BUILD_CPU_LEGACY@ +OPENJDK_BUILD_CPU_LEGACY_LIB := @OPENJDK_BUILD_CPU_LEGACY_LIB@ +OPENJDK_BUILD_CPU_LIBDIR := @OPENJDK_BUILD_CPU_LIBDIR@ +OPENJDK_TARGET_CPU_LIBDIR := @OPENJDK_BUILD_CPU_LIBDIR@ +OPENJDK_TARGET_CPU := @OPENJDK_BUILD_CPU@ +OPENJDK_TARGET_CPU_ARCH := @OPENJDK_BUILD_CPU_ARCH@ +OPENJDK_TARGET_CPU_BITS := @OPENJDK_BUILD_CPU_BITS@ +OPENJDK_TARGET_CPU_ENDIAN := @OPENJDK_BUILD_CPU_ENDIAN@ +OPENJDK_TARGET_CPU_LEGACY := @OPENJDK_BUILD_CPU_LEGACY@ + +CFLAGS_JDKLIB := @OPENJDK_BUILD_CFLAGS_JDKLIB@ +CXXFLAGS_JDKLIB := @OPENJDK_BUILD_CXXFLAGS_JDKLIB@ +LDFLAGS_JDKLIB := @OPENJDK_BUILD_LDFLAGS_JDKLIB@ +CFLAGS_JDKEXE := @OPENJDK_BUILD_CFLAGS_JDKEXE@ +CXXFLAGS_JDKEXE := @OPENJDK_BUILD_CXXFLAGS_JDKEXE@ +LDFLAGS_JDKEXE := @OPENJDK_BUILD_LDFLAGS_JDKEXE@ +OPENJDK_TARGET_CPU_JLI_CFLAGS := @OPENJDK_BUILD_CPU_JLI_CFLAGS@ + +# The compiler for the build platform is likely not warning compatible with the official +# compiler. +WARNINGS_AS_ERRORS := false +DISABLE_WARNING_PREFIX := @BUILD_CC_DISABLE_WARNING_PREFIX@ + +# Save speed and disk space by not enabling debug symbols for the buildjdk +ENABLE_DEBUG_SYMBOLS := false + +#################################################### +# +# Legacy Hotspot support + +# Legacy setting: OPT or DBG +VARIANT := OPT +# Legacy setting: true or false +FASTDEBUG := false +# Legacy setting: debugging the class files? +DEBUG_CLASSFILES := false + +# Some users still set EXTRA_*FLAGS on the make command line. Must +# make sure to override that when building buildjdk. +override EXTRA_CFLAGS := +override EXTRA_CXXFLAGS := +override EXTRA_LDFLAGS := + +# The HOSTCC/HOSTCXX is Hotspot terminology for the BUILD_CC/BUILD_CXX, i.e. the +# compiler that produces code that can be run on the build platform. +HOSTCC := $(BUILD_CC) +HOSTCXX := $(BUILD_CXX) + +# Old name for OPENJDK_TARGET_OS (aix,bsd,hpux,linux,macosx,solaris,windows etc) +PLATFORM := $(OPENJDK_BUILD_OS) +# 32 or 64 bit +ARCH_DATA_MODEL := $(OPENJDK_BUILD_CPU_BITS) + +ALT_BOOTDIR := $(BOOT_JDK) +# Yet another name for arch used for an extra subdir below the jvm lib. +# Uses i386 and amd64, instead of x86 and x86_64. +LIBARCH := @OPENJDK_BUILD_CPU_LEGACY_LIB@ +# Set the cpu architecture. Some users still set ARCH on the make command line. Must +# make sure to override that when building buildjdk. +override ARCH := $(OPENJDK_BUILD_CPU_ARCH) +# Legacy setting for building for a 64 bit machine. +# If yes then this expands to _LP64 := 1 +ifeq ($(OPENJDK_BUILD_CPU_BITS), 64) + _LP64 := 1 +endif + +ALT_OUTPUTDIR := $(HOTSPOT_OUTPUTDIR) +ALT_EXPORT_PATH := $(HOTSPOT_DIST) + +JVM_INTERPRETER := @JVM_INTERPRETER@ +ifeq ($(JVM_INTERPRETER), cpp) + CC_INTERP=true +endif + +HOTSPOT_MAKE_ARGS := product docs export_product +# Control wether Hotspot runs Queens test after building +TEST_IN_BUILD := false + +USE_PRECOMPILED_HEADER := @USE_PRECOMPILED_HEADER@ + +# Hotspot expects the variable FULL_DEBUG_SYMBOLS=1/0 to control debug symbols +# creation. +FULL_DEBUG_SYMBOLS := 0 +ZIP_DEBUGINFO_FILES := 0 +# Disable stripping +STRIP_POLICY := none + +JVM_VARIANTS := server +JVM_VARIANT_SERVER := true +JVM_VARIANT_CLIENT := false +JVM_VARIANT_MINIMAL1 := false +JVM_VARIANT_KERNEL := false +JVM_VARIANT_ZERO := false +JVM_VARIANT_ZEROSHARK := false +JVM_VARIANT_CORE := false + +# Sneak this in via the spec.gmk file, since we don't want to mess around too much with the Hotspot make files. +# This is needed to get the LOG setting to work properly. +include $(SRC_ROOT)/make/common/MakeBase.gmk
--- a/common/autoconf/configure.ac Tue Mar 15 14:48:45 2016 -0700 +++ b/common/autoconf/configure.ac Tue Mar 22 10:43:58 2016 +0000 @@ -134,6 +134,7 @@ # We need build & target for this. JDKOPT_SETUP_JDK_OPTIONS +JDKOPT_SETUP_JLINK_OPTIONS HOTSPOT_SETUP_HOTSPOT_OPTIONS JDKVER_SETUP_JDK_VERSION_NUMBERS @@ -144,6 +145,7 @@ ############################################################################### BOOTJDK_SETUP_BOOT_JDK +BOOTJDK_SETUP_BUILD_JDK ############################################################################### # @@ -155,6 +157,8 @@ SRCDIRS_SETUP_ALTERNATIVE_TOPDIRS SRCDIRS_SETUP_OUTPUT_DIRS +SRCDIRS_SETUP_IMPORT_MODULES + ############################################################################### # # Setup the toolchain (compilers etc), i.e. tools used to compile and process
--- a/common/autoconf/flags.m4 Tue Mar 15 14:48:45 2016 -0700 +++ b/common/autoconf/flags.m4 Tue Mar 22 10:43:58 2016 +0000 @@ -689,9 +689,6 @@ ;; esac - # Setup LP64 - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK $ADD_LP64" - # Set some common defines. These works for all compilers, but assume # -D is universally accepted. @@ -722,7 +719,12 @@ COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D$OPENJDK_TARGET_OS_UPPERCASE" # Setup target CPU - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DARCH='\"$OPENJDK_TARGET_CPU_LEGACY\"' -D$OPENJDK_TARGET_CPU_LEGACY" + OPENJDK_TARGET_CCXXFLAGS_JDK="$OPENJDK_TARGET_CCXXFLAGS_JDK \ + $ADD_LP64 \ + -DARCH='\"$OPENJDK_TARGET_CPU_LEGACY\"' -D$OPENJDK_TARGET_CPU_LEGACY" + OPENJDK_BUILD_CCXXFLAGS_JDK="$OPENJDK_BUILD_CCXXFLAGS_JDK \ + $OPENJDK_BUILD_ADD_LP64 \ + -DARCH='\"$OPENJDK_BUILD_CPU_LEGACY\"' -D$OPENJDK_BUILD_CPU_LEGACY" # Setup debug/release defines if test "x$DEBUG_LEVEL" = xrelease; then @@ -766,17 +768,35 @@ -I${JDK_TOPDIR}/src/java.base/$OPENJDK_TARGET_OS_TYPE/native/libjava" # The shared libraries are compiled using the picflag. - CFLAGS_JDKLIB="$COMMON_CCXXFLAGS_JDK $CFLAGS_JDK $PICFLAG $CFLAGS_JDKLIB_EXTRA" - CXXFLAGS_JDKLIB="$COMMON_CCXXFLAGS_JDK $CXXFLAGS_JDK $PICFLAG $CXXFLAGS_JDKLIB_EXTRA" + CFLAGS_JDKLIB="$COMMON_CCXXFLAGS_JDK $OPENJDK_TARGET_CCXXFLAGS_JDK \ + $CFLAGS_JDK $EXTRA_CFLAGS_JDK $PICFLAG $CFLAGS_JDKLIB_EXTRA" + CXXFLAGS_JDKLIB="$COMMON_CCXXFLAGS_JDK $OPENJDK_TARGET_CCXXFLAGS_JDK \ + $CXXFLAGS_JDK $EXTRA_CXXFLAGS_JDK $PICFLAG $CXXFLAGS_JDKLIB_EXTRA" # Executable flags - CFLAGS_JDKEXE="$COMMON_CCXXFLAGS_JDK $CFLAGS_JDK" - CXXFLAGS_JDKEXE="$COMMON_CCXXFLAGS_JDK $CXXFLAGS_JDK" + CFLAGS_JDKEXE="$COMMON_CCXXFLAGS_JDK $OPENJDK_TARGET_CCXXFLAGS_JDK \ + $CFLAGS_JDK $EXTRA_CFLAGS_JDK" + CXXFLAGS_JDKEXE="$COMMON_CCXXFLAGS_JDK $OPENJDK_TARGET_CCXXFLAGS_JDK \ + $C