Skip to content

Commit

Permalink
8244036: Refresh SetupJavaCompilation, and remove support for sjavac
Browse files Browse the repository at this point in the history
Reviewed-by: erikj
  • Loading branch information
magicus committed Apr 29, 2020
1 parent 0783dd6 commit 408bc48
Show file tree
Hide file tree
Showing 29 changed files with 229 additions and 511 deletions.
6 changes: 1 addition & 5 deletions make/CompileDemos.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ include $(SPEC)
include MakeBase.gmk
include JavaCompilation.gmk
include NativeCompilation.gmk
include SetupJavaCompilers.gmk
include TextFileProcessing.gmk
include ZipArchive.gmk

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

ifneq ($$($1_SKIP_COMPILATION), true)
$$(eval $$(call SetupJavaCompilation, BUILD_DEMO_$1, \
SETUP := GENERATE_USINGJDKBYTECODE, \
TARGET_RELEASE := $(TARGET_RELEASE_NEWJDK_UPGRADED), \
SRC := $$($1_MAIN_SRC) $$($1_EXTRA_SRC_DIR), \
BIN := $(SUPPORT_OUTPUTDIR)/demos/classes/$$($1_DEMO_SUBDIR)/$1, \
COPY := $(COPY_TO_JAR) $$($1_EXTRA_COPY_TO_JAR), \
Expand All @@ -137,7 +135,6 @@ define SetupBuildDemoBody
SRCZIP := $(SUPPORT_OUTPUTDIR)/demos/image/$$($1_DEMO_SUBDIR)/$1/src.zip, \
EXCLUDE_FILES := $$($1_EXCLUDE_FILES), \
DISABLED_WARNINGS := $$($1_DISABLED_WARNINGS), \
DISABLE_SJAVAC := $$($1_DISABLE_SJAVAC), \
))

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

$(eval $(call SetupBuildDemo, Font2DTest, \
Expand Down
10 changes: 5 additions & 5 deletions make/CompileInterimLangtools.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ default: all
include $(SPEC)
include MakeBase.gmk
include JavaCompilation.gmk
include SetupJavaCompilers.gmk
include Modules.gmk

################################################################################
Expand Down Expand Up @@ -66,8 +65,8 @@ TARGETS += $(COPY_PREVIEW_FEATURES)
# Param 1 - Name of module to compile
define SetupInterimModule
$$(eval $$(call SetupJavaCompilation, BUILD_$1.interim, \
SETUP := BOOT_JAVAC, \
DISABLE_SJAVAC := true, \
COMPILER := bootjdk, \
TARGET_RELEASE := $$(TARGET_RELEASE_BOOTJDK), \
SRC := $(BUILDTOOLS_OUTPUTDIR)/gensrc/$1.interim \
$$(wildcard $(SUPPORT_OUTPUTDIR)/gensrc/$1) \
$(TOPDIR)/src/$1/share/classes, \
Expand All @@ -77,8 +76,9 @@ define SetupInterimModule
EXTRA_FILES := $(BUILDTOOLS_OUTPUTDIR)/gensrc/$1.interim/module-info.java, \
COPY := .gif .png .xml .css .js javax.tools.JavaCompilerTool, \
BIN := $(BUILDTOOLS_OUTPUTDIR)/interim_langtools_modules/$1.interim, \
DISABLED_WARNINGS := module, \
ADD_JAVAC_FLAGS := --module-path $(BUILDTOOLS_OUTPUTDIR)/interim_langtools_modules \
DISABLED_WARNINGS := module options, \
JAVAC_FLAGS := \
--module-path $(BUILDTOOLS_OUTPUTDIR)/interim_langtools_modules \
$$(INTERIM_LANGTOOLS_ADD_EXPORTS) \
--patch-module java.base=$(BUILDTOOLS_OUTPUTDIR)/gensrc/java.base.interim \
--add-exports java.base/jdk.internal=java.compiler.interim \
Expand Down
23 changes: 11 additions & 12 deletions make/CompileJavaModules.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ include $(SPEC)
include MakeBase.gmk
include Modules.gmk
include JavaCompilation.gmk
include SetupJavaCompilers.gmk

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

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

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

Expand Down Expand Up @@ -315,7 +313,7 @@ jdk.charsets_COPY += .dat

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

################################################################################

jdk.jartool_ADD_JAVAC_FLAGS += -XDstringConcat=inline
jdk.jartool_JAVAC_FLAGS += -XDstringConcat=inline

################################################################################

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

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

################################################################################

jdk.internal.vm.compiler_ADD_JAVAC_FLAGS += -parameters -XDstringConcat=inline \
jdk.internal.vm.compiler_JAVAC_FLAGS += -parameters -XDstringConcat=inline \
--add-exports jdk.internal.vm.ci/jdk.vm.ci.aarch64=jdk.internal.vm.compiler \
--add-exports jdk.internal.vm.ci/jdk.vm.ci.amd64=jdk.internal.vm.compiler \
--add-exports jdk.internal.vm.ci/jdk.vm.ci.code=jdk.internal.vm.compiler \
Expand Down Expand Up @@ -509,7 +507,7 @@ jdk.internal.vm.compiler_EXCLUDES += \
# The exports are needed since JVMCI is dynamically exported (see
# jdk.vm.ci.services.internal.ReflectionAccessJDK::openJVMCITo).

jdk.aot_ADD_JAVAC_FLAGS += -parameters -XDstringConcat=inline \
jdk.aot_JAVAC_FLAGS += -parameters -XDstringConcat=inline \
--add-exports jdk.internal.vm.ci/jdk.vm.ci.aarch64=jdk.internal.vm.compiler,jdk.aot \
--add-exports jdk.internal.vm.ci/jdk.vm.ci.amd64=jdk.internal.vm.compiler,jdk.aot \
--add-exports jdk.internal.vm.ci/jdk.vm.ci.code=jdk.internal.vm.compiler,jdk.aot \
Expand Down Expand Up @@ -544,7 +542,7 @@ jdk.localedata_KEEP_ALL_TRANSLATIONS := true

jdk.jfr_DISABLED_WARNINGS += exports
jdk.jfr_COPY := .xsd .xml .dtd
jdk.jfr_ADD_JAVAC_FLAGS := -XDstringConcat=inline
jdk.jfr_JAVAC_FLAGS := -XDstringConcat=inline

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

$(eval $(call SetupJavaCompilation, $(MODULE), \
SETUP := $(if $($(MODULE)_SETUP), $($(MODULE)_SETUP), GENERATE_JDKBYTECODE), \
SMALL_JAVA := false, \
MODULE := $(MODULE), \
SRC := $(wildcard $(MODULE_SRC_DIRS)), \
INCLUDES := $(JDK_USER_DEFINED_FILTER), \
FAIL_NO_SRC := $(FAIL_NO_SRC), \
BIN := $(if $($(MODULE)_BIN), $($(MODULE)_BIN), $(JDK_OUTPUTDIR)/modules), \
HEADERS := $(SUPPORT_OUTPUTDIR)/headers, \
CREATE_API_DIGEST := true, \
ADD_JAVAC_FLAGS := \
$($(MODULE)_ADD_JAVAC_FLAGS) \
JAVAC_FLAGS := \
$($(MODULE)_DOCLINT) \
$($(MODULE)_JAVAC_FLAGS) \
--module-source-path $(MODULESOURCEPATH) \
--module-path $(MODULEPATH) \
--system none, \
Expand Down
9 changes: 4 additions & 5 deletions make/CompileModuleTools.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,24 @@ default: all
include $(SPEC)
include MakeBase.gmk
include JavaCompilation.gmk
include SetupJavaCompilers.gmk

################################################################################

TOOLS_CLASSES_DIR := $(BUILDTOOLS_OUTPUTDIR)/tools_jigsaw_classes

$(eval $(call SetupJavaCompilation,BUILD_JIGSAW_TOOLS, \
SETUP := GENERATE_USINGJDKBYTECODE, \
$(eval $(call SetupJavaCompilation, BUILD_JIGSAW_TOOLS, \
TARGET_RELEASE := $(TARGET_RELEASE_NEWJDK_UPGRADED), \
SRC := $(TOPDIR)/make/jdk/src/classes, \
INCLUDES := build/tools/deps \
build/tools/docs \
build/tools/jigsaw, \
COPY := .properties .html, \
BIN := $(TOOLS_CLASSES_DIR), \
DISABLED_WARNINGS := fallthrough, \
ADD_JAVAC_FLAGS := \
JAVAC_FLAGS := \
--add-modules jdk.jdeps \
--add-exports java.base/jdk.internal.module=ALL-UNNAMED \
--add-exports jdk.jdeps/com.sun.tools.jdeps=ALL-UNNAMED \
--add-exports jdk.jdeps/com.sun.tools.jdeps=ALL-UNNAMED, \
))

TARGETS += $(BUILD_JIGSAW_TOOLS)
Expand Down
18 changes: 11 additions & 7 deletions make/CompileToolsHotspot.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2016, 2020, 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
Expand Down Expand Up @@ -30,7 +30,6 @@ include $(SPEC)
include MakeBase.gmk

include JavaCompilation.gmk
include SetupJavaCompilers.gmk

TARGETS :=

Expand All @@ -45,36 +44,39 @@ ifeq ($(INCLUDE_GRAAL), true)
##############################################################################
# Compile the annotation processors
$(eval $(call SetupJavaCompilation, BUILD_VM_COMPILER_MATCH_PROCESSOR, \
SETUP := GENERATE_OLDBYTECODE, \
TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \
SRC := \
$(SRC_DIR)/org.graalvm.compiler.processor/src \
$(SRC_DIR)/org.graalvm.compiler.core.match.processor/src \
, \
EXCLUDE_FILES := $(EXCLUDE_FILES), \
BIN := $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.compiler.match.processor, \
JAR := $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.compiler.match.processor.jar, \
DISABLED_WARNINGS := options, \
))

TARGETS += $(BUILD_VM_COMPILER_MATCH_PROCESSOR)

##############################################################################

$(eval $(call SetupJavaCompilation, BUILD_VM_COMPILER_NODEINFO_PROCESSOR, \
SETUP := GENERATE_OLDBYTECODE, \
TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \
SRC := \
$(SRC_DIR)/org.graalvm.compiler.processor/src \
$(SRC_DIR)/org.graalvm.compiler.nodeinfo.processor/src \
, \
BIN := $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.compiler.nodeinfo.processor, \
JAR := $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.compiler.nodeinfo.processor.jar, \
DISABLED_WARNINGS := options, \
))

TARGETS += $(BUILD_VM_COMPILER_NODEINFO_PROCESSOR)

##############################################################################

$(eval $(call SetupJavaCompilation, BUILD_VM_COMPILER_OPTIONS_PROCESSOR, \
SETUP := GENERATE_OLDBYTECODE, \
TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \
DISABLED_WARNINGS := options, \
SRC := \
$(SRC_DIR)/org.graalvm.compiler.processor/src \
$(SRC_DIR)/org.graalvm.compiler.options.processor/src \
Expand All @@ -88,29 +90,31 @@ ifeq ($(INCLUDE_GRAAL), true)
##############################################################################

$(eval $(call SetupJavaCompilation, BUILD_VM_COMPILER_REPLACEMENTS_PROCESSOR, \
SETUP := GENERATE_OLDBYTECODE, \
TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \
SRC := \
$(SRC_DIR)/org.graalvm.compiler.processor/src \
$(SRC_DIR)/org.graalvm.compiler.replacements.processor/src \
, \
EXCLUDE_FILES := $(EXCLUDE_FILES), \
BIN := $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.compiler.replacements.verifier, \
JAR := $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.compiler.replacements.verifier.jar, \
DISABLED_WARNINGS := options, \
))

TARGETS += $(BUILD_VM_COMPILER_REPLACEMENTS_PROCESSOR)

##############################################################################

$(eval $(call SetupJavaCompilation, BUILD_VM_COMPILER_SERVICEPROVIDER_PROCESSOR, \
SETUP := GENERATE_OLDBYTECODE, \
TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \
SRC := \
$(SRC_DIR)/org.graalvm.compiler.processor/src \
$(SRC_DIR)/org.graalvm.compiler.serviceprovider.processor/src \
, \
EXCLUDE_FILES := $(EXCLUDE_FILES), \
BIN := $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.compiler.serviceprovider.processor, \
JAR := $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.compiler.serviceprovider.processor.jar, \
DISABLED_WARNINGS := options, \
))

TARGETS += $(BUILD_VM_COMPILER_SERVICEPROVIDER_PROCESSOR)
Expand Down
12 changes: 6 additions & 6 deletions make/CompileToolsJdk.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ default: all
include $(SPEC)
include MakeBase.gmk
include JavaCompilation.gmk
include SetupJavaCompilers.gmk
include TextFileProcessing.gmk

################################################################################
Expand All @@ -44,7 +43,7 @@ BUILD_TOOLS_SRC_DIRS += \
#

$(eval $(call SetupJavaCompilation, BUILD_TOOLS_JDK, \
SETUP := GENERATE_OLDBYTECODE, \
TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \
SRC := $(BUILD_TOOLS_SRC_DIRS), \
EXCLUDES := \
build/tools/classlist \
Expand All @@ -54,10 +53,10 @@ $(eval $(call SetupJavaCompilation, BUILD_TOOLS_JDK, \
build/tools/depend \
, \
BIN := $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes, \
ADD_JAVAC_FLAGS := \
DISABLED_WARNINGS := options, \
JAVAC_FLAGS := \
--add-exports java.desktop/sun.awt=ALL-UNNAMED \
--add-exports java.base/sun.text=ALL-UNNAMED \
, \
--add-exports java.base/sun.text=ALL-UNNAMED, \
))

TARGETS += $(BUILD_TOOLS_JDK)
Expand All @@ -72,10 +71,11 @@ TARGETS += $(COPY_NIMBUS_TEMPLATES)
################################################################################

$(eval $(call SetupJavaCompilation, COMPILE_DEPEND, \
SETUP := GENERATE_OLDBYTECODE, \
TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \
SRC := $(TOPDIR)/make/jdk/src/classes, \
INCLUDES := build/tools/depend, \
BIN := $(BUILDTOOLS_OUTPUTDIR)/depend, \
DISABLED_WARNINGS := options, \
))

DEPEND_SERVICE_PROVIDER := $(BUILDTOOLS_OUTPUTDIR)/depend/META-INF/services/com.sun.source.util.Plugin
Expand Down
4 changes: 2 additions & 2 deletions make/GenerateLinkOptData.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ default: all

include $(SPEC)
include MakeBase.gmk
include SetupJavaCompilers.gmk
include JavaCompilation.gmk

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

$(eval $(call SetupJavaCompilation, CLASSLIST_JAR, \
SETUP := GENERATE_JDKBYTECODE, \
SMALL_JAVA := false, \
SRC := $(TOPDIR)/make/jdk/src/classes, \
INCLUDES := build/tools/classlist, \
BIN := $(BUILDTOOLS_OUTPUTDIR)/classlist_classes, \
Expand Down
12 changes: 7 additions & 5 deletions make/JrtfsJar.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2014, 2020, 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
Expand Down Expand Up @@ -27,8 +27,8 @@ default: all

include $(SPEC)
include MakeBase.gmk
include JavaCompilation.gmk
include JarArchive.gmk
include SetupJavaCompilers.gmk
include TextFileProcessing.gmk

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

$(eval $(call SetupJavaCompilation, BUILD_JRTFS, \
SETUP := GENERATE_8_BYTECODE, \
COMPILER := bootjdk, \
TARGET_RELEASE := $(TARGET_RELEASE_JDK8), \
SRC := $(TOPDIR)/src/java.base/share/classes, \
EXCLUDE_FILES := module-info.java, \
INCLUDES := $(JIMAGE_PKGS), \
BIN := $(SUPPORT_OUTPUTDIR)/jrtfs_classes))
BIN := $(SUPPORT_OUTPUTDIR)/jrtfs_classes, \
))

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

$(eval $(call SetupJarArchive,BUILD_JRTFS_JAR, \
$(eval $(call SetupJarArchive, BUILD_JRTFS_JAR, \
DEPENDENCIES := $(BUILD_JRTFS) $(COPY_JIMAGE_SERVICE_PROVIDER), \
SRCS := $(SUPPORT_OUTPUTDIR)/jrtfs_classes, \
JAR := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/jrt-fs.jar, \
Expand Down
Loading

0 comments on commit 408bc48

Please sign in to comment.