Skip to content
This repository was archived by the owner on Sep 2, 2022. It is now read-only.
/ jdk17 Public archive

Commit 408bc48

Browse files
committed
8244036: Refresh SetupJavaCompilation, and remove support for sjavac
Reviewed-by: erikj
1 parent 0783dd6 commit 408bc48

29 files changed

+229
-511
lines changed

make/CompileDemos.gmk

+1-5
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ include $(SPEC)
3333
include MakeBase.gmk
3434
include JavaCompilation.gmk
3535
include NativeCompilation.gmk
36-
include SetupJavaCompilers.gmk
3736
include TextFileProcessing.gmk
3837
include ZipArchive.gmk
3938

@@ -93,7 +92,6 @@ COPY_TO_IMAGE := *.html *.txt *.png *.xml README*
9392
# EXTRA_COPY_TO_IMAGE Additional files to copy to images (as wildcards)
9493
# EXTRA_MANIFEST_ATTR Extra manifest attribute
9594
# SKIP_COMPILATION Skip Java compilation iff true
96-
# DISABLE_SJAVAC Passed to SetupJavaCompilation
9795
# DISABLED_WARNINGS Additional disabled warnings
9896
SetupBuildDemo = $(NamedParamsMacroTemplate)
9997
define SetupBuildDemoBody
@@ -126,7 +124,7 @@ define SetupBuildDemoBody
126124

127125
ifneq ($$($1_SKIP_COMPILATION), true)
128126
$$(eval $$(call SetupJavaCompilation, BUILD_DEMO_$1, \
129-
SETUP := GENERATE_USINGJDKBYTECODE, \
127+
TARGET_RELEASE := $(TARGET_RELEASE_NEWJDK_UPGRADED), \
130128
SRC := $$($1_MAIN_SRC) $$($1_EXTRA_SRC_DIR), \
131129
BIN := $(SUPPORT_OUTPUTDIR)/demos/classes/$$($1_DEMO_SUBDIR)/$1, \
132130
COPY := $(COPY_TO_JAR) $$($1_EXTRA_COPY_TO_JAR), \
@@ -137,7 +135,6 @@ define SetupBuildDemoBody
137135
SRCZIP := $(SUPPORT_OUTPUTDIR)/demos/image/$$($1_DEMO_SUBDIR)/$1/src.zip, \
138136
EXCLUDE_FILES := $$($1_EXCLUDE_FILES), \
139137
DISABLED_WARNINGS := $$($1_DISABLED_WARNINGS), \
140-
DISABLE_SJAVAC := $$($1_DISABLE_SJAVAC), \
141138
))
142139

143140
$1 += $$(BUILD_DEMO_$1)
@@ -183,7 +180,6 @@ $(eval $(call SetupBuildDemo, SwingSet2, \
183180
EXTRA_COPY_TO_JAR := .java, \
184181
EXTRA_MANIFEST_ATTR := SplashScreen-Image: resources/images/splash.png, \
185182
DISABLED_WARNINGS := rawtypes deprecation unchecked static serial cast, \
186-
DISABLE_SJAVAC := true, \
187183
))
188184

189185
$(eval $(call SetupBuildDemo, Font2DTest, \

make/CompileInterimLangtools.gmk

+5-5
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ default: all
2929
include $(SPEC)
3030
include MakeBase.gmk
3131
include JavaCompilation.gmk
32-
include SetupJavaCompilers.gmk
3332
include Modules.gmk
3433

3534
################################################################################
@@ -66,8 +65,8 @@ TARGETS += $(COPY_PREVIEW_FEATURES)
6665
# Param 1 - Name of module to compile
6766
define SetupInterimModule
6867
$$(eval $$(call SetupJavaCompilation, BUILD_$1.interim, \
69-
SETUP := BOOT_JAVAC, \
70-
DISABLE_SJAVAC := true, \
68+
COMPILER := bootjdk, \
69+
TARGET_RELEASE := $$(TARGET_RELEASE_BOOTJDK), \
7170
SRC := $(BUILDTOOLS_OUTPUTDIR)/gensrc/$1.interim \
7271
$$(wildcard $(SUPPORT_OUTPUTDIR)/gensrc/$1) \
7372
$(TOPDIR)/src/$1/share/classes, \
@@ -77,8 +76,9 @@ define SetupInterimModule
7776
EXTRA_FILES := $(BUILDTOOLS_OUTPUTDIR)/gensrc/$1.interim/module-info.java, \
7877
COPY := .gif .png .xml .css .js javax.tools.JavaCompilerTool, \
7978
BIN := $(BUILDTOOLS_OUTPUTDIR)/interim_langtools_modules/$1.interim, \
80-
DISABLED_WARNINGS := module, \
81-
ADD_JAVAC_FLAGS := --module-path $(BUILDTOOLS_OUTPUTDIR)/interim_langtools_modules \
79+
DISABLED_WARNINGS := module options, \
80+
JAVAC_FLAGS := \
81+
--module-path $(BUILDTOOLS_OUTPUTDIR)/interim_langtools_modules \
8282
$$(INTERIM_LANGTOOLS_ADD_EXPORTS) \
8383
--patch-module java.base=$(BUILDTOOLS_OUTPUTDIR)/gensrc/java.base.interim \
8484
--add-exports java.base/jdk.internal=java.compiler.interim \

make/CompileJavaModules.gmk

+11-12
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ include $(SPEC)
3030
include MakeBase.gmk
3131
include Modules.gmk
3232
include JavaCompilation.gmk
33-
include SetupJavaCompilers.gmk
3433

3534
# Hook to include the corresponding custom file, if present.
3635
$(eval $(call IncludeCustomExtension, CompileJavaModules.gmk))
@@ -40,7 +39,7 @@ $(eval $(call IncludeCustomExtension, CompileJavaModules.gmk))
4039

4140
java.base_DOCLINT += -Xdoclint:all/protected,-reference,-accessibility \
4241
'-Xdoclint/package:java.*,javax.*'
43-
java.base_ADD_JAVAC_FLAGS += -XDstringConcat=inline
42+
java.base_JAVAC_FLAGS += -XDstringConcat=inline
4443
java.base_COPY += .icu .dat .spp .nrm content-types.properties \
4544
hijrah-config-Hijrah-umalqura_islamic-umalqura.properties
4645
java.base_CLEAN += intrinsic.properties
@@ -86,7 +85,6 @@ java.datatransfer_COPY += flavormap.properties
8685

8786
java.desktop_DOCLINT += -Xdoclint:all/protected,-reference \
8887
'-Xdoclint/package:java.*,javax.*'
89-
java.desktop_ADD_JAVAC_FLAGS += --doclint-format html4
9088
java.desktop_COPY += .gif .png .wav .txt .xml .css .pf
9189
java.desktop_CLEAN += iio-plugin.properties cursors.properties
9290

@@ -315,7 +313,7 @@ jdk.charsets_COPY += .dat
315313

316314
jdk.compiler_DOCLINT += -Xdoclint:all/protected \
317315
'-Xdoclint/package:-com.sun.tools.*,-jdk.internal.*,sun.tools.serialver.resources.*'
318-
jdk.compiler_ADD_JAVAC_FLAGS += -XDstringConcat=inline
316+
jdk.compiler_JAVAC_FLAGS += -XDstringConcat=inline
319317
jdk.compiler_CLEAN_FILES += $(wildcard \
320318
$(patsubst %, $(TOPDIR)/src/jdk.compiler/share/classes/%/*.properties, \
321319
sun/tools/serialver/resources))
@@ -356,7 +354,7 @@ jdk.javadoc_COPY += .xml .css .js .png
356354

357355
################################################################################
358356

359-
jdk.jartool_ADD_JAVAC_FLAGS += -XDstringConcat=inline
357+
jdk.jartool_JAVAC_FLAGS += -XDstringConcat=inline
360358

361359
################################################################################
362360

@@ -436,11 +434,11 @@ jdk.internal.jvmstat_COPY += aliasmap
436434
# The exports are needed since JVMCI is dynamically exported (see
437435
# jdk.vm.ci.services.internal.ReflectionAccessJDK::openJVMCITo).
438436

439-
jdk.internal.vm.ci_ADD_JAVAC_FLAGS += -parameters -XDstringConcat=inline
437+
jdk.internal.vm.ci_JAVAC_FLAGS += -parameters -XDstringConcat=inline
440438

441439
################################################################################
442440

443-
jdk.internal.vm.compiler_ADD_JAVAC_FLAGS += -parameters -XDstringConcat=inline \
441+
jdk.internal.vm.compiler_JAVAC_FLAGS += -parameters -XDstringConcat=inline \
444442
--add-exports jdk.internal.vm.ci/jdk.vm.ci.aarch64=jdk.internal.vm.compiler \
445443
--add-exports jdk.internal.vm.ci/jdk.vm.ci.amd64=jdk.internal.vm.compiler \
446444
--add-exports jdk.internal.vm.ci/jdk.vm.ci.code=jdk.internal.vm.compiler \
@@ -509,7 +507,7 @@ jdk.internal.vm.compiler_EXCLUDES += \
509507
# The exports are needed since JVMCI is dynamically exported (see
510508
# jdk.vm.ci.services.internal.ReflectionAccessJDK::openJVMCITo).
511509

512-
jdk.aot_ADD_JAVAC_FLAGS += -parameters -XDstringConcat=inline \
510+
jdk.aot_JAVAC_FLAGS += -parameters -XDstringConcat=inline \
513511
--add-exports jdk.internal.vm.ci/jdk.vm.ci.aarch64=jdk.internal.vm.compiler,jdk.aot \
514512
--add-exports jdk.internal.vm.ci/jdk.vm.ci.amd64=jdk.internal.vm.compiler,jdk.aot \
515513
--add-exports jdk.internal.vm.ci/jdk.vm.ci.code=jdk.internal.vm.compiler,jdk.aot \
@@ -544,7 +542,7 @@ jdk.localedata_KEEP_ALL_TRANSLATIONS := true
544542

545543
jdk.jfr_DISABLED_WARNINGS += exports
546544
jdk.jfr_COPY := .xsd .xml .dtd
547-
jdk.jfr_ADD_JAVAC_FLAGS := -XDstringConcat=inline
545+
jdk.jfr_JAVAC_FLAGS := -XDstringConcat=inline
548546

549547
################################################################################
550548
# If this is an imported module that has prebuilt classes, only compile
@@ -607,16 +605,17 @@ ifeq ($(MODULE), jdk.aot)
607605
endif
608606

609607
$(eval $(call SetupJavaCompilation, $(MODULE), \
610-
SETUP := $(if $($(MODULE)_SETUP), $($(MODULE)_SETUP), GENERATE_JDKBYTECODE), \
608+
SMALL_JAVA := false, \
611609
MODULE := $(MODULE), \
612610
SRC := $(wildcard $(MODULE_SRC_DIRS)), \
613611
INCLUDES := $(JDK_USER_DEFINED_FILTER), \
614612
FAIL_NO_SRC := $(FAIL_NO_SRC), \
615613
BIN := $(if $($(MODULE)_BIN), $($(MODULE)_BIN), $(JDK_OUTPUTDIR)/modules), \
616614
HEADERS := $(SUPPORT_OUTPUTDIR)/headers, \
617615
CREATE_API_DIGEST := true, \
618-
ADD_JAVAC_FLAGS := \
619-
$($(MODULE)_ADD_JAVAC_FLAGS) \
616+
JAVAC_FLAGS := \
617+
$($(MODULE)_DOCLINT) \
618+
$($(MODULE)_JAVAC_FLAGS) \
620619
--module-source-path $(MODULESOURCEPATH) \
621620
--module-path $(MODULEPATH) \
622621
--system none, \

make/CompileModuleTools.gmk

+4-5
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,24 @@ default: all
2828
include $(SPEC)
2929
include MakeBase.gmk
3030
include JavaCompilation.gmk
31-
include SetupJavaCompilers.gmk
3231

3332
################################################################################
3433

3534
TOOLS_CLASSES_DIR := $(BUILDTOOLS_OUTPUTDIR)/tools_jigsaw_classes
3635

37-
$(eval $(call SetupJavaCompilation,BUILD_JIGSAW_TOOLS, \
38-
SETUP := GENERATE_USINGJDKBYTECODE, \
36+
$(eval $(call SetupJavaCompilation, BUILD_JIGSAW_TOOLS, \
37+
TARGET_RELEASE := $(TARGET_RELEASE_NEWJDK_UPGRADED), \
3938
SRC := $(TOPDIR)/make/jdk/src/classes, \
4039
INCLUDES := build/tools/deps \
4140
build/tools/docs \
4241
build/tools/jigsaw, \
4342
COPY := .properties .html, \
4443
BIN := $(TOOLS_CLASSES_DIR), \
4544
DISABLED_WARNINGS := fallthrough, \
46-
ADD_JAVAC_FLAGS := \
45+
JAVAC_FLAGS := \
4746
--add-modules jdk.jdeps \
4847
--add-exports java.base/jdk.internal.module=ALL-UNNAMED \
49-
--add-exports jdk.jdeps/com.sun.tools.jdeps=ALL-UNNAMED \
48+
--add-exports jdk.jdeps/com.sun.tools.jdeps=ALL-UNNAMED, \
5049
))
5150

5251
TARGETS += $(BUILD_JIGSAW_TOOLS)

make/CompileToolsHotspot.gmk

+11-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2016, 2020, 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,6 @@ include $(SPEC)
3030
include MakeBase.gmk
3131

3232
include JavaCompilation.gmk
33-
include SetupJavaCompilers.gmk
3433

3534
TARGETS :=
3635

@@ -45,36 +44,39 @@ ifeq ($(INCLUDE_GRAAL), true)
4544
##############################################################################
4645
# Compile the annotation processors
4746
$(eval $(call SetupJavaCompilation, BUILD_VM_COMPILER_MATCH_PROCESSOR, \
48-
SETUP := GENERATE_OLDBYTECODE, \
47+
TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \
4948
SRC := \
5049
$(SRC_DIR)/org.graalvm.compiler.processor/src \
5150
$(SRC_DIR)/org.graalvm.compiler.core.match.processor/src \
5251
, \
5352
EXCLUDE_FILES := $(EXCLUDE_FILES), \
5453
BIN := $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.compiler.match.processor, \
5554
JAR := $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.compiler.match.processor.jar, \
55+
DISABLED_WARNINGS := options, \
5656
))
5757

5858
TARGETS += $(BUILD_VM_COMPILER_MATCH_PROCESSOR)
5959

6060
##############################################################################
6161

6262
$(eval $(call SetupJavaCompilation, BUILD_VM_COMPILER_NODEINFO_PROCESSOR, \
63-
SETUP := GENERATE_OLDBYTECODE, \
63+
TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \
6464
SRC := \
6565
$(SRC_DIR)/org.graalvm.compiler.processor/src \
6666
$(SRC_DIR)/org.graalvm.compiler.nodeinfo.processor/src \
6767
, \
6868
BIN := $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.compiler.nodeinfo.processor, \
6969
JAR := $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.compiler.nodeinfo.processor.jar, \
70+
DISABLED_WARNINGS := options, \
7071
))
7172

7273
TARGETS += $(BUILD_VM_COMPILER_NODEINFO_PROCESSOR)
7374

7475
##############################################################################
7576

7677
$(eval $(call SetupJavaCompilation, BUILD_VM_COMPILER_OPTIONS_PROCESSOR, \
77-
SETUP := GENERATE_OLDBYTECODE, \
78+
TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \
79+
DISABLED_WARNINGS := options, \
7880
SRC := \
7981
$(SRC_DIR)/org.graalvm.compiler.processor/src \
8082
$(SRC_DIR)/org.graalvm.compiler.options.processor/src \
@@ -88,29 +90,31 @@ ifeq ($(INCLUDE_GRAAL), true)
8890
##############################################################################
8991

9092
$(eval $(call SetupJavaCompilation, BUILD_VM_COMPILER_REPLACEMENTS_PROCESSOR, \
91-
SETUP := GENERATE_OLDBYTECODE, \
93+
TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \
9294
SRC := \
9395
$(SRC_DIR)/org.graalvm.compiler.processor/src \
9496
$(SRC_DIR)/org.graalvm.compiler.replacements.processor/src \
9597
, \
9698
EXCLUDE_FILES := $(EXCLUDE_FILES), \
9799
BIN := $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.compiler.replacements.verifier, \
98100
JAR := $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.compiler.replacements.verifier.jar, \
101+
DISABLED_WARNINGS := options, \
99102
))
100103

101104
TARGETS += $(BUILD_VM_COMPILER_REPLACEMENTS_PROCESSOR)
102105

103106
##############################################################################
104107

105108
$(eval $(call SetupJavaCompilation, BUILD_VM_COMPILER_SERVICEPROVIDER_PROCESSOR, \
106-
SETUP := GENERATE_OLDBYTECODE, \
109+
TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \
107110
SRC := \
108111
$(SRC_DIR)/org.graalvm.compiler.processor/src \
109112
$(SRC_DIR)/org.graalvm.compiler.serviceprovider.processor/src \
110113
, \
111114
EXCLUDE_FILES := $(EXCLUDE_FILES), \
112115
BIN := $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.compiler.serviceprovider.processor, \
113116
JAR := $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.compiler.serviceprovider.processor.jar, \
117+
DISABLED_WARNINGS := options, \
114118
))
115119

116120
TARGETS += $(BUILD_VM_COMPILER_SERVICEPROVIDER_PROCESSOR)

make/CompileToolsJdk.gmk

+6-6
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ default: all
2828
include $(SPEC)
2929
include MakeBase.gmk
3030
include JavaCompilation.gmk
31-
include SetupJavaCompilers.gmk
3231
include TextFileProcessing.gmk
3332

3433
################################################################################
@@ -44,7 +43,7 @@ BUILD_TOOLS_SRC_DIRS += \
4443
#
4544

4645
$(eval $(call SetupJavaCompilation, BUILD_TOOLS_JDK, \
47-
SETUP := GENERATE_OLDBYTECODE, \
46+
TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \
4847
SRC := $(BUILD_TOOLS_SRC_DIRS), \
4948
EXCLUDES := \
5049
build/tools/classlist \
@@ -54,10 +53,10 @@ $(eval $(call SetupJavaCompilation, BUILD_TOOLS_JDK, \
5453
build/tools/depend \
5554
, \
5655
BIN := $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes, \
57-
ADD_JAVAC_FLAGS := \
56+
DISABLED_WARNINGS := options, \
57+
JAVAC_FLAGS := \
5858
--add-exports java.desktop/sun.awt=ALL-UNNAMED \
59-
--add-exports java.base/sun.text=ALL-UNNAMED \
60-
, \
59+
--add-exports java.base/sun.text=ALL-UNNAMED, \
6160
))
6261

6362
TARGETS += $(BUILD_TOOLS_JDK)
@@ -72,10 +71,11 @@ TARGETS += $(COPY_NIMBUS_TEMPLATES)
7271
################################################################################
7372

7473
$(eval $(call SetupJavaCompilation, COMPILE_DEPEND, \
75-
SETUP := GENERATE_OLDBYTECODE, \
74+
TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \
7675
SRC := $(TOPDIR)/make/jdk/src/classes, \
7776
INCLUDES := build/tools/depend, \
7877
BIN := $(BUILDTOOLS_OUTPUTDIR)/depend, \
78+
DISABLED_WARNINGS := options, \
7979
))
8080

8181
DEPEND_SERVICE_PROVIDER := $(BUILDTOOLS_OUTPUTDIR)/depend/META-INF/services/com.sun.source.util.Plugin

make/GenerateLinkOptData.gmk

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ default: all
3131

3232
include $(SPEC)
3333
include MakeBase.gmk
34-
include SetupJavaCompilers.gmk
34+
include JavaCompilation.gmk
3535

3636
################################################################################
3737
# Create a jar with our generator class. Using a jar is intentional since it
3838
# will load more classes
3939

4040
$(eval $(call SetupJavaCompilation, CLASSLIST_JAR, \
41-
SETUP := GENERATE_JDKBYTECODE, \
41+
SMALL_JAVA := false, \
4242
SRC := $(TOPDIR)/make/jdk/src/classes, \
4343
INCLUDES := build/tools/classlist, \
4444
BIN := $(BUILDTOOLS_OUTPUTDIR)/classlist_classes, \

make/JrtfsJar.gmk

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2014, 2020, 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
@@ -27,8 +27,8 @@ default: all
2727

2828
include $(SPEC)
2929
include MakeBase.gmk
30+
include JavaCompilation.gmk
3031
include JarArchive.gmk
31-
include SetupJavaCompilers.gmk
3232
include TextFileProcessing.gmk
3333

3434
# This rule will be depended on due to the MANIFEST line
@@ -47,11 +47,13 @@ JIMAGE_PKGS := \
4747
#
4848

4949
$(eval $(call SetupJavaCompilation, BUILD_JRTFS, \
50-
SETUP := GENERATE_8_BYTECODE, \
50+
COMPILER := bootjdk, \
51+
TARGET_RELEASE := $(TARGET_RELEASE_JDK8), \
5152
SRC := $(TOPDIR)/src/java.base/share/classes, \
5253
EXCLUDE_FILES := module-info.java, \
5354
INCLUDES := $(JIMAGE_PKGS), \
54-
BIN := $(SUPPORT_OUTPUTDIR)/jrtfs_classes))
55+
BIN := $(SUPPORT_OUTPUTDIR)/jrtfs_classes, \
56+
))
5557

5658
# Because of the explicit INCLUDES in the compilation setup above, the service provider
5759
# file will not be copied unless META-INF/services would also be added to the INCLUDES.
@@ -62,7 +64,7 @@ $(eval $(call SetupCopyFiles, COPY_JIMAGE_SERVICE_PROVIDER, \
6264
DEST := $(SUPPORT_OUTPUTDIR)/jrtfs_classes, \
6365
FILES := META-INF/services/java.nio.file.spi.FileSystemProvider))
6466

65-
$(eval $(call SetupJarArchive,BUILD_JRTFS_JAR, \
67+
$(eval $(call SetupJarArchive, BUILD_JRTFS_JAR, \
6668
DEPENDENCIES := $(BUILD_JRTFS) $(COPY_JIMAGE_SERVICE_PROVIDER), \
6769
SRCS := $(SUPPORT_OUTPUTDIR)/jrtfs_classes, \
6870
JAR := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/jrt-fs.jar, \

0 commit comments

Comments
 (0)