Skip to content

Commit ca8ad3c

Browse files
committed
8189094: Change required boot jdk to JDK 9
Reviewed-by: ihse, mchung
1 parent d84d8f1 commit ca8ad3c

19 files changed

+287
-264
lines changed

Diff for: make/BuildNashorn.gmk

+6-11
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,12 @@ $(eval $(call SetupJavaCompilation, BUILD_NASGEN, \
6969
NASHORN_CLASSES_DIR := $(JDK_OUTPUTDIR)/modules/jdk.scripting.nashorn
7070
NASGEN_RUN_FILE := $(NASHORN_CLASSES_DIR)/_the.nasgen.run
7171

72-
ifeq ($(BOOT_JDK_MODULAR), true)
73-
NASGEN_OPTIONS := \
74-
-cp $(BUILDTOOLS_OUTPUTDIR)/nasgen_classes \
75-
--patch-module java.base=$(BUILDTOOLS_OUTPUTDIR)/nasgen_classes \
76-
--add-exports java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED \
77-
--add-exports java.base/jdk.internal.org.objectweb.asm.util=ALL-UNNAMED \
78-
#
79-
else
80-
NASGEN_OPTIONS := \
81-
-Xbootclasspath/p:$(BUILDTOOLS_OUTPUTDIR)/nasgen_classes
82-
endif
72+
NASGEN_OPTIONS := \
73+
-cp $(BUILDTOOLS_OUTPUTDIR)/nasgen_classes \
74+
--patch-module java.base=$(BUILDTOOLS_OUTPUTDIR)/nasgen_classes \
75+
--add-exports java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED \
76+
--add-exports java.base/jdk.internal.org.objectweb.asm.util=ALL-UNNAMED \
77+
#
8378

8479
# Copy classes to final classes dir and run nasgen to modify classes in jdk.nashorn.internal.objects package
8580
$(NASGEN_RUN_FILE): $(BUILD_NASGEN) $(jdk.scripting.nashorn)

Diff for: make/CompileInterimLangtools.gmk

+44-20
Original file line numberDiff line numberDiff line change
@@ -30,39 +30,63 @@ include $(SPEC)
3030
include MakeBase.gmk
3131
include JavaCompilation.gmk
3232
include SetupJavaCompilers.gmk
33+
include Modules.gmk
34+
35+
################################################################################
36+
# Generate interim versions of the module-info.java files for the interim
37+
# langtools modules. Each interim module has ".interim" added as suffix to the
38+
# original module name.
39+
40+
INTERIM_MODULEINFO_PATTERN := \
41+
$(foreach m, $(INTERIM_LANGTOOLS_BASE_MODULES), -e 's/$m\([,; ]\)/$m.interim\1/g')
42+
43+
$(BUILDTOOLS_OUTPUTDIR)/gensrc/%.interim/module-info.java: \
44+
$(TOPDIR)/src/%/share/classes/module-info.java
45+
$(call LogInfo, Generating module-info.java for $*.interim)
46+
$(call MakeDir, $(@D))
47+
$(SED) $(INTERIM_MODULEINFO_PATTERN) $< > $@
48+
49+
TARGETS += $(patsubst %, $(BUILDTOOLS_OUTPUTDIR)/gensrc/%/module-info.java, \
50+
$(INTERIM_LANGTOOLS_MODULES))
3351

3452
################################################################################
3553
# Setup the rules to build interim langtools, which is compiled by the boot
36-
# javac and can be run on the boot jdk. This will be used to compile
37-
# the rest of the product. Each module is compiled separately to allow a modular
38-
# boot jdk to override system classes using -Xoverride:.
54+
# javac and can be run on the boot jdk. This will be used to compile the rest of
55+
# the product. Each module is compiled separately because a multi module setup
56+
# would require the source files to be copied into directories named after the
57+
# actual interim modules.
3958

4059
# Param 1 - Name of module to compile
41-
# Param 2 - Name of modules to depend on
4260
define SetupInterimModule
43-
$$(eval $$(call SetupJavaCompilation,BUILD_INTERIM_$(strip $1), \
61+
$$(eval $$(call SetupJavaCompilation, BUILD_$1.interim, \
4462
SETUP := BOOT_JAVAC, \
4563
DISABLE_SJAVAC := true, \
46-
SRC := $(TOPDIR)/src/$(strip $1)/share/classes \
47-
$$(wildcard $(SUPPORT_OUTPUTDIR)/gensrc/$(strip $1)), \
48-
EXCLUDES := sun com/sun/tools/jdeps com/sun/tools/javap \
49-
com/sun/tools/jdeprscan, \
50-
EXCLUDE_FILES := module-info.java JavacToolProvider.java \
51-
JavadocToolProvider.java Standard.java, \
64+
SRC := $(BUILDTOOLS_OUTPUTDIR)/gensrc/$1.interim \
65+
$$(wildcard $(SUPPORT_OUTPUTDIR)/gensrc/$1) \
66+
$(TOPDIR)/src/$1/share/classes, \
67+
EXCLUDES := sun, \
68+
EXCLUDE_FILES := $(TOPDIR)/src/$1/share/classes/module-info.java \
69+
Standard.java, \
70+
EXTRA_FILES := $(BUILDTOOLS_OUTPUTDIR)/gensrc/$1.interim/module-info.java, \
5271
COPY := .gif .png .xml .css .js javax.tools.JavaCompilerTool, \
53-
BIN := $(BUILDTOOLS_OUTPUTDIR)/override_modules/$(strip $1), \
54-
ADD_JAVAC_FLAGS := -Xbootclasspath/p:$$(call PathList, \
55-
$$(foreach m, $2, $(BUILDTOOLS_OUTPUTDIR)/override_modules/$$m)), \
72+
BIN := $(BUILDTOOLS_OUTPUTDIR)/interim_modules/$1.interim, \
73+
ADD_JAVAC_FLAGS := --module-path $(BUILDTOOLS_OUTPUTDIR)/interim_modules \
74+
$$(INTERIM_LANGTOOLS_ADD_EXPORTS) \
75+
-Xlint:-module, \
5676
))
5777

58-
$$(BUILD_INTERIM_$(strip $1)): $$(foreach m, $2, $$(BUILD_INTERIM_$(strip $$m)))
78+
$1_DEPS_INTERIM := $$(addsuffix .interim, $$(filter \
79+
$$(INTERIM_LANGTOOLS_BASE_MODULES), $$(call FindTransitiveDepsForModule, $1)))
80+
81+
$$(BUILD_$1.interim): $$(foreach d, $$($1_DEPS_INTERIM), $$(BUILD_$$d))
5982

60-
TARGETS += $$(BUILD_INTERIM_$(strip $1))
83+
TARGETS += $$(BUILD_$1.interim)
6184
endef
6285

63-
$(eval $(call SetupInterimModule, java.compiler))
64-
$(eval $(call SetupInterimModule, jdk.compiler, java.compiler))
65-
$(eval $(call SetupInterimModule, jdk.jdeps, jdk.compiler java.compiler))
66-
$(eval $(call SetupInterimModule, jdk.javadoc, java.compiler jdk.compiler))
86+
$(foreach m, $(INTERIM_LANGTOOLS_BASE_MODULES), \
87+
$(eval $(call SetupInterimModule,$m)) \
88+
)
89+
90+
################################################################################
6791

6892
all: $(TARGETS)

Diff for: make/CompileInterimRmic.gmk

+34-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,25 @@ include MakeBase.gmk
3030
include JavaCompilation.gmk
3131
include SetupJavaCompilers.gmk
3232

33-
##########################################################################################
33+
################################################################################
34+
# Generate interim versions of the module-info.java files for the interim
35+
# langtools modules. Each interim module has ".interim" added as suffix to the
36+
# original module name.
37+
38+
INTERIM_MODULEINFO_PATTERN := \
39+
$(foreach m, $(INTERIM_RMIC_BASE_MODULES), -e 's/$m\([,; ]\)/$m.interim\1/g') \
40+
-e '/ToolProvider[,; ]/d'
41+
42+
$(BUILDTOOLS_OUTPUTDIR)/gensrc/%.interim/module-info.java: \
43+
$(TOPDIR)/src/%/share/classes/module-info.java
44+
$(call LogInfo, Generating module-info.java for $*.interim)
45+
$(call MakeDir, $(@D))
46+
$(SED) $(INTERIM_MODULEINFO_PATTERN) $< > $@
47+
48+
TARGETS += $(patsubst %, $(BUILDTOOLS_OUTPUTDIR)/gensrc/%/module-info.java, \
49+
$(INTERIM_RMIC_MODULES))
50+
51+
################################################################################
3452

3553
RMIC_PKGS := \
3654
sun/rmi/rmic \
@@ -41,14 +59,23 @@ RMIC_PKGS := \
4159
sun/tools/util \
4260
#
4361

44-
$(eval $(call SetupJavaCompilation,BUILD_INTERIM_RMIC, \
62+
$(eval $(call SetupJavaCompilation, BUILD_jdk.rmic.interim, \
4563
SETUP := GENERATE_OLDBYTECODE, \
4664
SRC := $(TOPDIR)/src/jdk.rmic/share/classes, \
47-
EXCLUDE_FILES := module-info.java, \
65+
EXCLUDE_FILES := $(TOPDIR)/src/jdk.rmic/share/classes/module-info.java, \
66+
EXTRA_FILES := $(BUILDTOOLS_OUTPUTDIR)/gensrc/jdk.rmic.interim/module-info.java, \
4867
INCLUDES := $(RMIC_PKGS), \
49-
BIN := $(BUILDTOOLS_OUTPUTDIR)/override_modules/jdk.rmic, \
50-
COPY := .properties))
68+
BIN := $(BUILDTOOLS_OUTPUTDIR)/interim_modules/jdk.rmic.interim, \
69+
COPY := .properties, \
70+
ADD_JAVAC_FLAGS := \
71+
--module-path $(BUILDTOOLS_OUTPUTDIR)/interim_modules \
72+
--add-modules java.corba \
73+
--add-exports java.corba/com.sun.corba.se.impl.util=jdk.rmic.interim \
74+
$(INTERIM_RMIC_ADD_EXPORTS), \
75+
))
76+
77+
TARGETS += $(BUILD_jdk.rmic.interim)
5178

5279
##########################################################################################
5380

54-
all: $(BUILD_INTERIM_RMIC)
81+
all: $(TARGETS)

Diff for: make/CompileToolsJdk.gmk

+14-5
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,22 @@ BUILD_TOOLS_SRC_DIRS += \
4242
$(BUILDTOOLS_OUTPUTDIR)/interim_cldrconverter_classes \
4343
#
4444

45-
$(eval $(call SetupJavaCompilation,BUILD_TOOLS_JDK, \
45+
$(eval $(call SetupJavaCompilation, BUILD_TOOLS_JDK, \
4646
SETUP := GENERATE_OLDBYTECODE, \
4747
SRC := $(BUILD_TOOLS_SRC_DIRS), \
48-
EXCLUDES := build/tools/deps \
49-
build/tools/docs \
50-
build/tools/jigsaw, \
51-
BIN := $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes))
48+
EXCLUDES := \
49+
build/tools/deps \
50+
build/tools/docs \
51+
build/tools/jigsaw \
52+
, \
53+
BIN := $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes, \
54+
ADD_JAVAC_FLAGS := \
55+
--add-modules java.xml.bind \
56+
--add-exports java.desktop/sun.awt=ALL-UNNAMED \
57+
--add-exports java.xml.bind/javax.xml.bind.annotation=ALL-UNNAMED \
58+
--add-exports java.base/sun.text=ALL-UNNAMED \
59+
, \
60+
))
5261

5362
TARGETS += $(BUILD_TOOLS_JDK)
5463

Diff for: make/JrtfsJar.gmk

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -47,7 +47,7 @@ JIMAGE_PKGS := \
4747
#
4848

4949
$(eval $(call SetupJavaCompilation, BUILD_JRTFS, \
50-
SETUP := GENERATE_OLDBYTECODE, \
50+
SETUP := GENERATE_8_BYTECODE, \
5151
SRC := $(TOPDIR)/src/java.base/share/classes, \
5252
EXCLUDE_FILES := module-info.java, \
5353
INCLUDES := $(JIMAGE_PKGS), \

Diff for: make/Main.gmk

+3-1
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ ifneq ($(CREATING_BUILDJDK), true)
122122
$(foreach m, $(GENSRC_MODULES), $(eval $m-gensrc: $m-gensrc-src))
123123

124124
LANGTOOLS_GENSRC_TARGETS := $(filter $(addsuffix -%, $(LANGTOOLS_MODULES)), $(GENSRC_TARGETS))
125+
INTERIM_LANGTOOLS_GENSRC_TARGETS := $(filter $(addsuffix -%, \
126+
$(INTERIM_LANGTOOLS_BASE_MODULES)), $(GENSRC_TARGETS))
125127
CORBA_GENSRC_TARGETS := $(filter $(addsuffix -%, $(CORBA_MODULES)), $(GENSRC_TARGETS))
126128
HOTSPOT_GENSRC_TARGETS := $(filter $(addsuffix -%, $(HOTSPOT_MODULES)), $(GENSRC_TARGETS))
127129
JDK_GENSRC_TARGETS := $(filter-out $(LANGTOOLS_GENSRC_TARGETS) \
@@ -602,7 +604,7 @@ ifneq ($(findstring -only, $(MAKECMDGOALS)), )
602604
else
603605
$(LANGTOOLS_GENSRC_TARGETS): buildtools-langtools
604606

605-
interim-langtools: $(LANGTOOLS_GENSRC_TARGETS)
607+
interim-langtools: $(INTERIM_LANGTOOLS_GENSRC_TARGETS)
606608

607609
buildtools-jdk: interim-langtools interim-cldrconverter
608610

Diff for: make/ToolsJdk.gmk

+2-11
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,8 @@ BUILD_TOOLS_JDK := $(call SetupJavaCompilationCompileTarget, \
4040

4141
################################################################################
4242

43-
ifeq ($(BOOT_JDK_MODULAR), true)
44-
COMPILEFONTCONFIG_ADD_EXPORTS := --add-exports java.desktop/sun.awt=ALL-UNNAMED
45-
endif
46-
4743
TOOL_COMPILEFONTCONFIG = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
48-
$(COMPILEFONTCONFIG_ADD_EXPORTS) \
44+
--add-exports java.desktop/sun.awt=ALL-UNNAMED \
4945
build.tools.compilefontconfig.CompileFontConfig
5046

5147
TOOL_COMPILEPROPERTIES = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
@@ -95,13 +91,8 @@ TOOL_CHARSETMAPPING = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classe
9591
TOOL_SPP = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes build.tools.spp.Spp
9692

9793
# Nimbus is used somewhere in the swing build.
98-
99-
ifeq ($(BOOT_JDK_MODULAR), true)
100-
COMPILENIMBUS_ADD_MODS := --add-modules java.xml.bind
101-
endif
102-
10394
TOOL_GENERATENIMBUS = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
104-
$(COMPILENIMBUS_ADD_MODS) \
95+
--add-modules java.xml.bind \
10596
build.tools.generatenimbus.Generator
10697

10798
TOOL_WRAPPERGENERATOR = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \

Diff for: make/autoconf/boot-jdk.m4

+5-14
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@ AC_DEFUN([BOOTJDK_DO_CHECK],
7777
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
7878
7979
# Extra M4 quote needed to protect [] in grep expression.
80-
[FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"|(1\.[89]\.)'`]
80+
[FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'`]
8181
if test "x$FOUND_CORRECT_VERSION" = x; then
8282
AC_MSG_NOTICE([Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring])
83-
AC_MSG_NOTICE([(Your Boot JDK must be version 8, 9 or 10)])
83+
AC_MSG_NOTICE([(Your Boot JDK must be version 9 or 10)])
8484
BOOT_JDK_FOUND=no
8585
else
8686
# We're done! :-)
@@ -301,20 +301,11 @@ AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK],
301301
302302
# Finally, set some other options...
303303
304-
# When compiling code to be executed by the Boot JDK, force jdk8 compatibility.
305-
BOOT_JDK_SOURCETARGET="-source 8 -target 8"
304+
# When compiling code to be executed by the Boot JDK, force compatibility with the
305+
# oldest supported bootjdk.
306+
BOOT_JDK_SOURCETARGET="-source 9 -target 9"
306307
AC_SUBST(BOOT_JDK_SOURCETARGET)
307308
308-
AC_MSG_CHECKING([if Boot JDK supports modules])
309-
if "$JAVA" --list-modules > /dev/null 2>&1; then
310-
AC_MSG_RESULT([yes])
311-
BOOT_JDK_MODULAR="true"
312-
else
313-
AC_MSG_RESULT([no])
314-
BOOT_JDK_MODULAR="false"
315-
fi
316-
AC_SUBST(BOOT_JDK_MODULAR)
317-
318309
AC_SUBST(JAVAC_FLAGS)
319310
320311
# Check if the boot jdk is 32 or 64 bit

Diff for: make/autoconf/bootcycle-spec.gmk.in

-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525

2626
# Support for building boot cycle builds
2727

28-
BOOT_JDK_MODULAR := true
29-
3028
# First include the real base spec.gmk file
3129
include @SPEC@
3230

0 commit comments

Comments
 (0)