This commit is contained in:
J. Duke 2017-07-05 21:35:07 +02:00
commit a7933e0cd1
25 changed files with 451 additions and 175 deletions

View File

@ -356,3 +356,4 @@ c7be2a78c31b3b6132f2f5e9e4b3d3bb1c20245c jdk-9+108
f900d5afd9c83a0df8f36161c27c5e4c86a66f4c jdk-9+111
03543a758cd5890f2266e4b9678378a925dde22a jdk-9+112
55b6d550828d1223b364e6ead4a56e56411c56df jdk-9+113
1d992540870ff33fe6cc550443388588df9b9e4f jdk-9+114

View File

@ -305,7 +305,7 @@ AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK],
BOOT_JDK_SOURCETARGET="-source 8 -target 8"
AC_SUBST(BOOT_JDK_SOURCETARGET)
ADD_JVM_ARG_IF_OK([-Xpatch:], dummy, [$JAVA])
ADD_JVM_ARG_IF_OK([-Xpatch:foo=bar], dummy, [$JAVA])
AC_MSG_CHECKING([if Boot JDK supports modules])
if test "x$JVM_ARG_OK" = "xtrue"; then
AC_MSG_RESULT([yes])
@ -444,9 +444,9 @@ AC_DEFUN([BOOTJDK_CHECK_BUILD_JDK],
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]\.'`]
[FOUND_CORRECT_VERSION=`echo $BUILD_JDK_VERSION | $EGREP '\"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([Potential Build 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

View File

@ -454,7 +454,7 @@ AC_DEFUN_ONCE([BPERF_SETUP_SMART_JAVAC],
AC_MSG_RESULT([$ENABLE_JAVAC_SERVER])
AC_SUBST(ENABLE_JAVAC_SERVER)
if test "x$ENABLE_JAVAC_SERVER" = "xyes" || "x$ENABLE_SJAVAC" = "xyes"; then
if test "x$ENABLE_JAVAC_SERVER" = "xyes" || test "x$ENABLE_SJAVAC" = "xyes"; then
# When using a server javac, the small client instances do not need much
# resources.
JAVA_FLAGS_JAVAC="$JAVA_FLAGS_SMALL"

View File

@ -227,6 +227,7 @@ LIB_SETUP_LIBRARIES
HOTSPOT_SETUP_BUILD_TWEAKS
JDKOPT_DETECT_INTREE_EC
JDKOPT_ENABLE_DISABLE_FAILURE_HANDLER
###############################################################################
#

View File

@ -650,6 +650,7 @@ TEST_JOBS
JOBS
MEMORY_SIZE
NUM_CORES
BUILD_FAILURE_HANDLER
ENABLE_INTREE_EC
HOTSPOT_MAKE_ARGS
LIBZIP_CAN_USE_MMAP
@ -1172,6 +1173,7 @@ with_lcms
with_dxsdk
with_dxsdk_lib
with_dxsdk_include
enable_jtreg_failure_handler
with_num_cores
with_memory_size
with_jobs
@ -1940,6 +1942,12 @@ Optional Features:
disable bundling of the freetype library with the
build result [enabled on Windows or when using
--with-freetype, disabled otherwise]
--enable-jtreg-failure-handler
forces build of the jtreg failure handler to be
enabled, missing dependencies become fatal errors.
Default is auto, where the failure handler is built
if all dependencies are present and otherwise just
disabled.
--enable-sjavac use sjavac to do fast incremental compiles
[disabled]
--disable-javac-server disable javac server [enabled]
@ -4274,6 +4282,12 @@ pkgadd_help() {
#
################################################################################
#
# Check if building of the jtreg failure handler should be enabled.
#
#
# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@ -4950,7 +4964,7 @@ VS_SDK_PLATFORM_NAME_2013=
#CUSTOM_AUTOCONF_INCLUDE
# Do not change or remove the following line, it is needed for consistency checks:
DATE_WHEN_GENERATED=1458755892
DATE_WHEN_GENERATED=1460963400
###############################################################################
#
@ -29770,13 +29784,13 @@ $as_echo "$tool_specified" >&6; }
$ECHO "Check if jvm arg is ok: -Xpatch:" >&5
$ECHO "Command: $JAVA -Xpatch: -version" >&5
OUTPUT=`$JAVA -Xpatch: -version 2>&1`
$ECHO "Check if jvm arg is ok: -Xpatch:foo=bar" >&5
$ECHO "Command: $JAVA -Xpatch:foo=bar -version" >&5
OUTPUT=`$JAVA -Xpatch:foo=bar -version 2>&1`
FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn`
FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""`
if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then
dummy="$dummy -Xpatch:"
dummy="$dummy -Xpatch:foo=bar"
JVM_ARG_OK=true
else
$ECHO "Arg failed:" >&5
@ -29856,10 +29870,10 @@ $as_echo "$as_me: (This might be a JRE instead of an JDK)" >&6;}
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]\.'`
FOUND_CORRECT_VERSION=`echo $BUILD_JDK_VERSION | $EGREP '\"9([\.+-].*)?\"'`
if test "x$FOUND_CORRECT_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BUILD_JDK is incorrect JDK version ($BUILD_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Boot JDK found at $BUILD_JDK is incorrect JDK version ($BUILD_JDK_VERSION); ignoring" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: Potential Build JDK found at $BUILD_JDK is incorrect JDK version ($BUILD_JDK_VERSION); ignoring" >&5
$as_echo "$as_me: Potential Build JDK found at $BUILD_JDK is incorrect JDK version ($BUILD_JDK_VERSION); ignoring" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: (Your Build JDK must be version 9)" >&5
$as_echo "$as_me: (Your Build JDK must be version 9)" >&6;}
BUILD_JDK_FOUND=no
@ -62037,6 +62051,45 @@ $as_echo "no" >&6; }
# Check whether --enable-jtreg-failure-handler was given.
if test "${enable_jtreg_failure_handler+set}" = set; then :
enableval=$enable_jtreg_failure_handler;
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if jtreg failure handler should be built" >&5
$as_echo_n "checking if jtreg failure handler should be built... " >&6; }
if test "x$enable_jtreg_failure_handler" = "xyes"; then
if test "x$JT_HOME" = "x"; then
as_fn_error $? "Cannot enable jtreg failure handler without jtreg." "$LINENO" 5
else
BUILD_FAILURE_HANDLER=true
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, forced" >&5
$as_echo "yes, forced" >&6; }
fi
elif test "x$enable_jtreg_failure_handler" = "xno"; then
BUILD_FAILURE_HANDLER=false
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no, forced" >&5
$as_echo "no, forced" >&6; }
elif test "x$enable_jtreg_failure_handler" = "xauto" \
|| test "x$enable_jtreg_failure_handler" = "x"; then
if test "x$JT_HOME" = "x"; then
BUILD_FAILURE_HANDLER=false
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no, missing jtreg" >&5
$as_echo "no, missing jtreg" >&6; }
else
BUILD_FAILURE_HANDLER=true
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, jtreg present" >&5
$as_echo "yes, jtreg present" >&6; }
fi
else
as_fn_error $? "Invalid value for --enable-jtreg-failure-handler: $enable_jtreg_failure_handler" "$LINENO" 5
fi
###############################################################################
#
# Configure parts of the build that only affect the build performance,
@ -62510,7 +62563,7 @@ $as_echo_n "checking whether to use javac server... " >&6; }
$as_echo "$ENABLE_JAVAC_SERVER" >&6; }
if test "x$ENABLE_JAVAC_SERVER" = "xyes" || "x$ENABLE_SJAVAC" = "xyes"; then
if test "x$ENABLE_JAVAC_SERVER" = "xyes" || test "x$ENABLE_SJAVAC" = "xyes"; then
# When using a server javac, the small client instances do not need much
# resources.
JAVA_FLAGS_JAVAC="$JAVA_FLAGS_SMALL"

View File

@ -433,3 +433,42 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JLINK_OPTIONS],
AC_SUBST(JLINK_KEEP_PACKAGED_MODULES)
])
################################################################################
#
# Check if building of the jtreg failure handler should be enabled.
#
AC_DEFUN_ONCE([JDKOPT_ENABLE_DISABLE_FAILURE_HANDLER],
[
AC_ARG_ENABLE([jtreg-failure-handler], [AS_HELP_STRING([--enable-jtreg-failure-handler],
[forces build of the jtreg failure handler to be enabled, missing dependencies
become fatal errors. Default is auto, where the failure handler is built if all
dependencies are present and otherwise just disabled.])])
AC_MSG_CHECKING([if jtreg failure handler should be built])
if test "x$enable_jtreg_failure_handler" = "xyes"; then
if test "x$JT_HOME" = "x"; then
AC_MSG_ERROR([Cannot enable jtreg failure handler without jtreg.])
else
BUILD_FAILURE_HANDLER=true
AC_MSG_RESULT([yes, forced])
fi
elif test "x$enable_jtreg_failure_handler" = "xno"; then
BUILD_FAILURE_HANDLER=false
AC_MSG_RESULT([no, forced])
elif test "x$enable_jtreg_failure_handler" = "xauto" \
|| test "x$enable_jtreg_failure_handler" = "x"; then
if test "x$JT_HOME" = "x"; then
BUILD_FAILURE_HANDLER=false
AC_MSG_RESULT([no, missing jtreg])
else
BUILD_FAILURE_HANDLER=true
AC_MSG_RESULT([yes, jtreg present])
fi
else
AC_MSG_ERROR([Invalid value for --enable-jtreg-failure-handler: $enable_jtreg_failure_handler])
fi
AC_SUBST(BUILD_FAILURE_HANDLER)
])

View File

@ -260,6 +260,8 @@ HOTSPOT_DIST=@HOTSPOT_DIST@
BUILD_HOTSPOT=@BUILD_HOTSPOT@
BUILD_FAILURE_HANDLER := @BUILD_FAILURE_HANDLER@
# The boot jdk to use. This is overridden in bootcycle-spec.gmk. Make sure to keep
# it in sync.
BOOT_JDK:=@BOOT_JDK@

View File

@ -41,7 +41,7 @@ if [ "$OPENJDK_TARGET_OS" = "macosx" ]; then
STAT_PRINT_SIZE="-f %z"
elif [ "$OPENJDK_TARGET_OS" = "windows" ]; then
FULLDUMP_CMD="$DUMPBIN -all"
LDD_CMD="$DUMPBIN -dependants | $GREP .dll"
LDD_CMD="$DUMPBIN -dependents"
DIS_CMD="$DUMPBIN -disasm:nobytes"
STAT_PRINT_SIZE="-c %s"
elif [ "$OPENJDK_TARGET_OS" = "aix" ]; then
@ -824,12 +824,25 @@ compare_bin_file() {
# Check dependencies
if [ -n "$LDD_CMD" ]; then
(cd $FILE_WORK_DIR && $CP $OTHER_FILE . && $LDD_CMD $NAME 2>/dev/null | $AWK '{ print $1;}' | $SORT | $TEE $WORK_FILE_BASE.deps.other | $UNIQ > $WORK_FILE_BASE.deps.other.uniq)
(cd $FILE_WORK_DIR && $CP $THIS_FILE . && $LDD_CMD $NAME 2</dev/null | $AWK '{ print $1;}' | $SORT | $TEE $WORK_FILE_BASE.deps.this | $UNIQ > $WORK_FILE_BASE.deps.this.uniq)
if [ "$OPENJDK_TARGET_OS" = "windows" ]; then
LDD_FILTER="$GREP \.dll"
else
LDD_FILTER="$CAT"
fi
(cd $FILE_WORK_DIR && $CP $OTHER_FILE . && $LDD_CMD $NAME 2>/dev/null \
| $LDD_FILTER | $AWK '{ print $1;}' | $SORT \
| $TEE $WORK_FILE_BASE.deps.other \
| $UNIQ > $WORK_FILE_BASE.deps.other.uniq)
(cd $FILE_WORK_DIR && $CP $THIS_FILE . && $LDD_CMD $NAME 2</dev/null \
| $LDD_FILTER | $AWK '{ print $1;}' | $SORT \
| $TEE $WORK_FILE_BASE.deps.this \
| $UNIQ > $WORK_FILE_BASE.deps.this.uniq)
(cd $FILE_WORK_DIR && $RM -f $NAME)
LC_ALL=C $DIFF $WORK_FILE_BASE.deps.other $WORK_FILE_BASE.deps.this > $WORK_FILE_BASE.deps.diff
LC_ALL=C $DIFF $WORK_FILE_BASE.deps.other.uniq $WORK_FILE_BASE.deps.this.uniq > $WORK_FILE_BASE.deps.diff.uniq
LC_ALL=C $DIFF $WORK_FILE_BASE.deps.other $WORK_FILE_BASE.deps.this \
> $WORK_FILE_BASE.deps.diff
LC_ALL=C $DIFF $WORK_FILE_BASE.deps.other.uniq $WORK_FILE_BASE.deps.this.uniq \
> $WORK_FILE_BASE.deps.diff.uniq
if [ -s $WORK_FILE_BASE.deps.diff ]; then
if [ -s $WORK_FILE_BASE.deps.diff.uniq ]; then

View File

@ -214,7 +214,7 @@ var getJibProfiles = function (input) {
var getJibProfilesCommon = function (input) {
var common = {
dependencies: ["boot_jdk", "gnumake", "jtreg"],
configure_args: ["--with-default-make-target=all"],
configure_args: ["--with-default-make-target=all", "--enable-jtreg-failure-handler"],
configure_args_32bit: ["--with-target-bits=32", "--with-jvm-variants=client,server"],
configure_args_debug: ["--enable-debug"],
configure_args_slowdebug: ["--with-debug-level=slowdebug"],

View File

@ -469,32 +469,7 @@ jdk.localedata_EXCLUDE_FILES += sun/text/resources/th/BreakIteratorRules_th.java
################################################################################
# Setup the compilation for the module
#
# Order src dirs in order of override with the most important first. Generated
# source before static source and platform specific source before shared.
#
GENERATED_SRC_DIRS += \
$(SUPPORT_OUTPUTDIR)/gensrc \
#
TOP_SRC_DIRS += \
$(HOTSPOT_TOPDIR)/src \
$(CORBA_TOPDIR)/src \
$(JDK_TOPDIR)/src \
$(LANGTOOLS_TOPDIR)/src \
$(JAXP_TOPDIR)/src \
$(JAXWS_TOPDIR)/src \
$(NASHORN_TOPDIR)/src \
#
SRC_SUBDIRS += $(OPENJDK_TARGET_OS)/classes
ifneq ($(OPENJDK_TARGET_OS), $(OPENJDK_TARGET_OS_TYPE))
SRC_SUBDIRS += $(OPENJDK_TARGET_OS_TYPE)/classes
endif
SRC_SUBDIRS += share/classes
MODULE_SRC_DIRS := $(strip \
$(addsuffix /$(MODULE), $(GENERATED_SRC_DIRS) $(IMPORT_MODULES_SRC)) \
$(foreach sub, $(SRC_SUBDIRS), $(addsuffix /$(MODULE)/$(sub), $(TOP_SRC_DIRS))))
MODULE_SRC_DIRS := $(call FindModuleSrcDirs, $(MODULE))
# The JDK_USER_DEFINED_FILTER is a poor man's incremental build: by specifying
# JDK_FILTER at the make command line, only a subset of the JDK java files will
@ -502,27 +477,20 @@ MODULE_SRC_DIRS := $(strip \
# space separated list.
JDK_USER_DEFINED_FILTER := $(strip $(subst $(COMMA),$(SPACE), $(JDK_FILTER)))
# Rewrite the MODULE_SRC_DIRS with a wildcard for the module so that all module
# source dirs are available on the path.
MODULESOURCEPATH := $(subst $(SPACE),$(PATH_SEP),$(subst $(MODULE),*,$(MODULE_SRC_DIRS)))
# Get the complete module source path.
MODULESOURCEPATH := $(call GetModuleSrcPath)
# Add imported modules to the moduleclasspath
MODULECLASSPATH := $(subst $(SPACE),$(PATH_SEP), $(IMPORT_MODULES_CLASSES))
# Add imported modules to the modulepath
MODULEPATH := $(call PathList, $(IMPORT_MODULES_CLASSES))
ifeq ($(MODULE), jdk.vm.ci)
## WORKAROUND jdk.vm.ci source structure issue
JVMCI_MODULESOURCEPATH := $(MODULESOURCEPATH) \
$(subst /$(MODULE)/,/*/, $(filter-out %processor/src, \
$(wildcard $(HOTSPOT_TOPDIR)/src/jdk.vm.ci/share/classes/*/src)))
MODULESOURCEPATH := $(subst $(SPACE),$(PATH_SEP), $(JVMCI_MODULESOURCEPATH))
MODULESOURCEPATH := $(call PathList, $(JVMCI_MODULESOURCEPATH))
endif
# Make sure the generated source base dirs exist. Not all modules have generated
# source in all of these directories and because of timing, all of them might not
# exist at the time this makefile gets called. Javac will complain if there are
# missing directories in the moduleclasspath.
$(call MakeDir, $(GENERATED_SRC_DIRS))
$(eval $(call SetupJavaCompilation, $(MODULE), \
SETUP := $(if $($(MODULE)_SETUP), $($(MODULE)_SETUP), GENERATE_JDKBYTECODE), \
MODULE := $(MODULE), \
@ -532,8 +500,8 @@ $(eval $(call SetupJavaCompilation, $(MODULE), \
HEADERS := $(SUPPORT_OUTPUTDIR)/headers, \
ADD_JAVAC_FLAGS := \
$($(MODULE)_ADD_JAVAC_FLAGS) \
-modulesourcepath "$(MODULESOURCEPATH)" \
$(if $(MODULECLASSPATH), -modulepath "$(MODULECLASSPATH)") \
-modulesourcepath $(MODULESOURCEPATH) \
-modulepath $(MODULEPATH) \
-system none, \
))
@ -574,8 +542,9 @@ endif
ifneq ($(wildcard $(IMPORT_MODULES_CLASSES)/$(MODULE)), )
$(JDK_OUTPUTDIR)/modules/$(MODULE)/_imported.marker: \
$(call CacheFind, $(IMPORT_MODULES_CLASSES)/$(MODULE))
$(RM) -r $(@D)
$(MKDIR) -p $(@D)
$(call MakeDir, $(@D))
# Do not delete marker and build meta data files
$(RM) -r $(filter-out $(@D)/_%, $(wildcard $(@D)/*))
$(CP) -R $(IMPORT_MODULES_CLASSES)/$(MODULE)/* $(@D)/
$(TOUCH) $@

View File

@ -49,7 +49,6 @@ default: all
include $(SPEC)
include MakeBase.gmk
include Modules.gmk
#include TextFileProcessing.gmk
################################################################################
# Define this here since jdk/make/Tools.gmk cannot be included from the top
@ -64,25 +63,8 @@ TOOL_GENMODULEINFOSOURCE = $(JAVA_SMALL) \
# Name of data file. Keep module-info.java.ext until javafx has changed.
MOD_FILENAME := module-info.java.extra module-info.java.ext
# List all the possible sub directories inside a module source directory where
# data might be stored.
CLASSES_SUBDIRS += $(OPENJDK_TARGET_OS)/classes
ifneq ($(OPENJDK_TARGET_OS), $(OPENJDK_TARGET_OS_TYPE))
CLASSES_SUBDIRS += $(OPENJDK_TARGET_OS_TYPE)/classes
endif
CLASSES_SUBDIRS += share/classes
# TODO: When the deploy build is better integrated, this will get added globally
# but for now need to add it here.
ifeq ($(BUILD_DEPLOY), true)
ALL_TOP_SRC_DIRS += $(DEPLOY_TOPDIR)/src
endif
# Construct all possible src directories for the module.
MODULE_CLASSES_DIRS := $(strip \
$(foreach sub, $(CLASSES_SUBDIRS), \
$(addsuffix /$(MODULE)/$(sub), $(ALL_TOP_SRC_DIRS))) \
$(addsuffix /$(MODULE), $(IMPORT_MODULES_SRC)))
MODULE_CLASSES_DIRS := $(call FindModuleSrcDirs, $(MODULE))
# Find all the .extra files in the src dirs.
MOD_FILES := $(wildcard $(foreach f, $(MOD_FILENAME), $(addsuffix /$(f), \
@ -125,20 +107,6 @@ ifneq ($(MOD_FILES), )
TARGETS += $(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/module-info.java
endif
# This doesn't work because javac only accepts one single exports line per
# exported package.
# Restore the modifications to separate lines with spaces
# MODIFICATIONS := $(subst /,$(SPACE),$(MODIFICATIONS))
# ifneq ($(MODIFICATIONS), )
# $(eval $(call SetupTextFileProcessing, PROCESS_MODULE_INFO, \
# SOURCE_FILES := $(firstword $(call FindAllModuleInfos, $(MODULE))), \
# OUTPUT_FILE := $(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/module-info.java, \
# REPLACEMENTS := } => $(MODIFICATIONS) }, \
# ))
# TARGETS += $(PROCESS_MODULE_INFO)
# endif
endif
# If no modifications are found for this module, remove any module-info.java

View File

@ -235,6 +235,11 @@ JDK_API_DOCSDIR = $(DOCSDIR)/jdk/api
JRE_API_DOCSDIR = $(DOCSDIR)/jre/api
PLATFORM_DOCSDIR = $(DOCSDIR)/platform
JAVADOC_ARCHIVE_NAME := jdk-$(VERSION_STRING)-docs.zip
JAVADOC_ARCHIVE_ASSEMBLY_DIR := $(DOCSTMPDIR)/zip-docs
JAVADOC_ARCHIVE_DIR := $(OUTPUT_ROOT)/bundles
JAVADOC_ARCHIVE := $(JAVADOC_ARCHIVE_DIR)/$(JAVADOC_ARCHIVE_NAME)
# The core api index file is the target for the core api javadocs rule
# and needs to be defined early so that all other javadoc rules may
# depend on it.
@ -378,6 +383,13 @@ $(eval $(call IncludeCustomExtension, , Javadoc.gmk))
all: docs
docs: coredocs otherdocs
#
# Optional target which bundles all generated javadocs into a zip archive.
# The dependency on docs is handled in Main.gmk.
#
zip-docs: $(JAVADOC_ARCHIVE)
#############################################################
#
# coredocs
@ -1671,6 +1683,28 @@ $(JLINK_PLUGIN_PACKAGES_FILE): $(call PackageDependencies,$(JLINK_PLUGIN_PKGS))
otherdocs: $(ALL_OTHER_TARGETS)
#
# Add the core docs as prerequisite to the archive to trigger a rebuild
# if the core docs were rebuilt. Ideally any doc rebuild should trigger
# this, but the way prerequisites are currently setup in this file, that
# is hard to achieve.
#
$(JAVADOC_ARCHIVE): $(COREAPI_INDEX_FILE)
$(call LogInfo, Compressing javadoc to single $(JAVADOC_ARCHIVE_NAME))
$(MKDIR) -p $(JAVADOC_ARCHIVE_DIR)
$(RM) -r $(JAVADOC_ARCHIVE_ASSEMBLY_DIR)
$(MKDIR) -p $(JAVADOC_ARCHIVE_ASSEMBLY_DIR)
all_roots=`$(FIND) $(DOCSDIR) | $(GREP) index.html | grep -v old/doclet`; \
pushd $(JAVADOC_ARCHIVE_ASSEMBLY_DIR); \
for index_file in $${all_roots} ; do \
target_dir=`dirname $${index_file}`; \
name=`$(ECHO) $${target_dir} | $(SED) "s;/spec;;" | $(SED) "s;.*/;;"`; \
$(LN) -s $${target_dir} $${name}; \
done; \
$(ZIP) -q -r $(JAVADOC_ARCHIVE) * ; \
popd ;
#############################################################
.PHONY: all docs coredocs otherdocs \
$(ALL_OTHER_TARGETS)
$(ALL_OTHER_TARGETS) zip-docs

View File

@ -333,6 +333,9 @@ docs-javadoc:
docs-jvmtidoc:
+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk jvmtidocs)
zip-docs: docs-javadoc docs-jvmtidoc
+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk zip-docs)
ALL_TARGETS += docs-javadoc docs-jvmtidoc
################################################################################
@ -385,9 +388,27 @@ test-image-jdk-jtreg-native:
build-test-lib:
+($(CD) $(TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f BuildTestLib.gmk)
ifeq ($(BUILD_FAILURE_HANDLER), true)
# Builds the failure handler jtreg extension
build-test-failure-handler:
+($(CD) $(TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) \
-f BuildFailureHandler.gmk build)
# Runs the tests for the failure handler jtreg extension
test-failure-handler:
+($(CD) $(TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) \
-f BuildFailureHandler.gmk test)
# Copies the failure handler jtreg extension into the test image
test-image-failure-handler:
+($(CD) $(TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) \
-f BuildFailureHandler.gmk images)
endif
ALL_TARGETS += prepare-test-image build-test-hotspot-jtreg-native \
test-image-hotspot-jtreg-native build-test-jdk-jtreg-native \
test-image-jdk-jtreg-native build-test-lib
test-image-jdk-jtreg-native build-test-lib build-test-failure-handler \
test-failure-handler test-image-failure-handler
################################################################################
# Run tests
@ -582,6 +603,12 @@ else
build-test-lib: java
build-test-failure-handler: interim-langtools
test-failure-handler: build-test-failure-handler
test-image-failure-handler: build-test-failure-handler
build-test-hotspot-jtreg-native: buildtools-jdk
build-test-jdk-jtreg-native: buildtools-jdk
@ -667,11 +694,11 @@ ifeq ($(OPENJDK_TARGET_OS), macosx)
endif
# This target builds the documentation image
docs-image: docs-javadoc docs-jvmtidoc
docs-image: zip-docs
# This target builds the test image
test-image: prepare-test-image test-image-hotspot-jtreg-native \
test-image-jdk-jtreg-native
test-image-jdk-jtreg-native test-image-failure-handler
# all-images is the top-most target, it builds all our deliverables ("images").
all-images: product-images test-image docs-image
@ -691,7 +718,7 @@ images: product-images
docs: docs-image
all: all-images
ALL_TARGETS += default jdk images docs all
ALL_TARGETS += default jdk images docs all zip-docs
################################################################################
################################################################################

View File

@ -104,6 +104,7 @@ define Clean-docs
@$(PRINTF) "\n" $(LOG_DEBUG)
$(RM) -r $(SUPPORT_OUTPUTDIR)/docs
$(RM) -r $(IMAGES_OUTPUTDIR)/docs
$(RM) $(OUTPUT_ROOT)/bundles/jdk-*-docs.zip
@$(PRINTF) " done\n"
endef

View File

@ -723,12 +723,13 @@ else
endif
################################################################################
# Return a string suitable for use after a -classpath option. It will correct and safe to use
# on all platforms. Arguments are given as space separate classpath entries.
# Return a string suitable for use after a -classpath or -modulepath option. It
# will be correct and safe to use on all platforms. Arguments are given as space
# separate classpath entries. Safe for multiple nested calls.
# param 1 : A space separated list of classpath entries
# The surrounding strip is needed to keep additional whitespace out
PathList = \
"$(subst $(SPACE),$(PATH_SEP),$(strip $1))"
"$(subst $(SPACE),$(PATH_SEP),$(strip $(subst $(DQUOTE),,$1)))"
################################################################################

View File

@ -138,26 +138,35 @@ endif
################################################################################
# Module list macros
# Use append so that the custom extension may add to this variable
# Use append so that the custom extension may add to these variables
ALL_TOP_SRC_DIRS += \
GENERATED_SRC_DIRS += \
$(SUPPORT_OUTPUTDIR)/gensrc \
#
TOP_SRC_DIRS += \
$(CORBA_TOPDIR)/src \
$(HOTSPOT_TOPDIR)/src \
$(JDK_TOPDIR)/src \
$(LANGTOOLS_TOPDIR)/src \
$(CORBA_TOPDIR)/src \
$(JAXP_TOPDIR)/src \
$(JAXWS_TOPDIR)/src \
$(NASHORN_TOPDIR)/src \
#
SRC_SUBDIRS += $(OPENJDK_TARGET_OS)/classes
ifneq ($(OPENJDK_TARGET_OS), $(OPENJDK_TARGET_OS_TYPE))
SRC_SUBDIRS += $(OPENJDK_TARGET_OS_TYPE)/classes
endif
SRC_SUBDIRS += share/classes
# Find all module-info.java files for the current build target platform and
# configuration.
# Param 1 - Module to find for, set to * for finding all
FindAllModuleInfos = \
$(wildcard \
$(patsubst %,%/$(strip $1)/$(OPENJDK_TARGET_OS)/classes/module-info.java, $(ALL_TOP_SRC_DIRS)) \
$(patsubst %,%/$(strip $1)/$(OPENJDK_TARGET_OS_TYPE)/classes/module-info.java, $(ALL_TOP_SRC_DIRS)) \
$(patsubst %,%/$(strip $1)/share/classes/module-info.java, $(ALL_TOP_SRC_DIRS)) \
$(foreach sub, $(SRC_SUBDIRS), \
$(patsubst %,%/$(strip $1)/$(sub)/module-info.java, $(TOP_SRC_DIRS))) \
$(patsubst %,%/$(strip $1)/module-info.java, $(IMPORT_MODULES_SRC)))
# Extract the module names from the paths of module-info.java files. The
@ -178,6 +187,19 @@ FindAllModules = \
FindImportedModules = \
$(if $(IMPORT_MODULES_CLASSES), $(notdir $(wildcard $(IMPORT_MODULES_CLASSES)/*)))
# Find all source dirs for a particular module
# $1 - Module to find source dirs for
FindModuleSrcDirs = \
$(strip $(wildcard \
$(addsuffix /$(strip $1), $(GENERATED_SRC_DIRS) $(IMPORT_MODULES_SRC)) \
$(foreach sub, $(SRC_SUBDIRS), $(addsuffix /$(strip $1)/$(sub), $(TOP_SRC_DIRS)))))
# Construct the complete module source path
GetModuleSrcPath = \
$(call PathList, \
$(addsuffix /*, $(GENERATED_SRC_DIRS) $(IMPORT_MODULES_SRC)) \
$(foreach sub, $(SRC_SUBDIRS), $(addsuffix /*/$(sub), $(TOP_SRC_DIRS))))
################################################################################
# Extract module dependencies from module-info.java files.

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2006, 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
@ -346,18 +346,15 @@ my.test.targets.hotspot.solaris.x64= \
solaris_x64_5.11-{product|fastdebug}-c2-GCBasher_G1
my.test.targets.hotspot.linux.i586= \
linux_i586_3.8-{product|fastdebug}-{c1|c2}-jvm98, \
linux_i586_3.8-{product|fastdebug}-c2-jvm98, \
linux_i586_3.8-{product|fastdebug}-c2-jvm98_nontiered, \
linux_i586_3.8-{product|fastdebug}-{c1|c2}-scimark, \
linux_i586_3.8-product-c1-runThese8_Xcomp_lang, \
linux_i586_3.8-product-c1-runThese8_Xcomp_vm, \
linux_i586_3.8-fastdebug-c1-runThese8_Xshare, \
linux_i586_3.8-{product|fastdebug}-c2-scimark, \
linux_i586_3.8-fastdebug-c2-runThese8_Xcomp_lang, \
linux_i586_3.8-fastdebug-c2-runThese8_Xcomp_vm, \
linux_i586_3.8-{product|fastdebug}-{c1|c2}-GCBasher_SerialGC, \
linux_i586_3.8-{product|fastdebug}-{c1|c2}-GCBasher_ParallelGC, \
linux_i586_3.8-{product|fastdebug}-{c1|c2}-GCBasher_CMS, \
linux_i586_3.8-{product|fastdebug}-{c1|c2}-GCBasher_G1
linux_i586_3.8-{product|fastdebug}-c2-GCBasher_SerialGC, \
linux_i586_3.8-{product|fastdebug}-c2-GCBasher_ParallelGC, \
linux_i586_3.8-{product|fastdebug}-c2-GCBasher_CMS, \
linux_i586_3.8-{product|fastdebug}-c2-GCBasher_G1
my.test.targets.hotspot.linux.x64= \
linux_x64_3.8-{product|fastdebug}-c2-jvm98, \
@ -378,17 +375,16 @@ my.test.targets.hotspot.macosx.x64= \
macosx_x64_10.9-{product|fastdebug}-c2-GCBasher_G1
my.test.targets.hotspot.windows.i586= \
windows_i586_6.3-{product|fastdebug}-{c1|c2}-jvm98, \
windows_i586_6.3-{product|fastdebug}-c2-jvm98, \
windows_i586_6.3-{product|fastdebug}-c2-jvm98_nontiered, \
windows_i586_6.3-{product|fastdebug}-{c1|c2}-scimark, \
windows_i586_6.3-product-{c1|c2}-runThese8, \
windows_i586_6.3-product-{c1|c2}-runThese8_Xcomp_lang, \
windows_i586_6.3-product-{c1|c2}-runThese8_Xcomp_vm, \
windows_i586_6.3-fastdebug-c1-runThese8_Xshare, \
windows_i586_6.3-{product|fastdebug}-{c1|c2}-GCBasher_SerialGC, \
windows_i586_6.3-{product|fastdebug}-{c1|c2}-GCBasher_ParallelGC, \
windows_i586_6.3-{product|fastdebug}-{c1|c2}-GCBasher_CMS, \
windows_i586_6.3-{product|fastdebug}-{c1|c2}-GCBasher_G1
windows_i586_6.3-{product|fastdebug}-c2-scimark, \
windows_i586_6.3-product-c2-runThese8, \
windows_i586_6.3-product-c2-runThese8_Xcomp_lang, \
windows_i586_6.3-product-c2-runThese8_Xcomp_vm, \
windows_i586_6.3-{product|fastdebug}-c2-GCBasher_SerialGC, \
windows_i586_6.3-{product|fastdebug}-c2-GCBasher_ParallelGC, \
windows_i586_6.3-{product|fastdebug}-c2-GCBasher_CMS, \
windows_i586_6.3-{product|fastdebug}-c2-GCBasher_G1
my.test.targets.hotspot.windows.x64= \
windows_x64_6.3-{product|fastdebug}-c2-jvm98, \
@ -443,21 +439,20 @@ my.make.rule.test.targets.hotspot.reg.group= \
linux_x64_3.8-fastdebug-c2-GROUP, \
macosx_x64_10.9-fastdebug-c2-GROUP, \
windows_i586_6.3-fastdebug-c2-GROUP, \
windows_x64_6.3-fastdebug-c2-GROUP, \
linux_i586_3.8-fastdebug-c1-GROUP, \
windows_i586_6.3-fastdebug-c1-GROUP
windows_x64_6.3-fastdebug-c2-GROUP
# Hotspot jtreg tests
my.make.rule.test.targets.hotspot.reg= \
${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_compiler_1}, \
${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_compiler_2}, \
${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_compiler_3}, \
${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_compiler_closed}, \
${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_gc}, \
${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_gc_closed}, \
${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_gc_gcold}, \
${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_runtime}, \
${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_serviceability}, \
${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_fast_compiler_1}, \
${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_fast_compiler_2}, \
${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_fast_compiler_3}, \
${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_fast_compiler_closed}, \
${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_fast_gc_1}, \
${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_fast_gc_2}, \
${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_fast_gc_closed}, \
${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_fast_gc_gcold}, \
${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_fast_runtime}, \
${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_fast_serviceability}, \
${my.make.rule.test.targets.hotspot.reg.group:GROUP=jdk_svc_sanity}, \
${my.additional.make.rule.test.targets.hotspot.reg}

View File

@ -0,0 +1,128 @@
#
# 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.
#
default: build
include $(SPEC)
include MakeBase.gmk
include JavaCompilation.gmk
include SetupJavaCompilers.gmk
include NativeCompilation.gmk
TARGETS :=
################################################################################
FH_BASEDIR := $(SRC_ROOT)/test/failure_handler
FH_SUPPORT := $(SUPPORT_OUTPUTDIR)/test/failure_handler
FH_JAR := $(FH_SUPPORT)/jtregFailureHandler.jar
JTREG_JAR := $(JT_HOME)/lib/jtreg.jar
ifeq ($(wildcard $(JTREG_JAR)), )
$(error Cannot build failure handler without jtreg)
endif
# tools.jar is only needed if it exists in the boot jdk
TOOLS_JAR := $(wildcard $(BOOT_JDK)/lib/tools.jar)
FH_CLASSPATH := $(call PathList, $(JTREG_JAR) $(TOOLS_JAR))
$(eval $(call SetupJavaCompilation, BUILD_FAILURE_HANDLER, \
SETUP := GENERATE_OLDBYTECODE, \
SRC := $(FH_BASEDIR)/src/share/classes $(FH_BASEDIR)/src/share/conf, \
BIN := $(FH_SUPPORT)/classes, \
COPY := .properties, \
CLASSPATH := $(JTREG_JAR) $(TOOLS_JAR), \
JAR := $(FH_JAR), \
))
TARGETS += $(BUILD_FAILURE_HANDLER)
################################################################################
ifeq ($(OPENJDK_TARGET_OS), windows)
$(eval $(call SetupNativeCompilation, BUILD_LIBTIMEOUT_HANDLER, \
LIBRARY := timeoutHandler, \
SRC := $(FH_BASEDIR)/src/windows/native/libtimeoutHandler, \
OBJECT_DIR := $(FH_SUPPORT)/libtimeoutHandler, \
OUTPUT_DIR := $(FH_SUPPORT), \
CFLAGS := $(CFLAGS_JDKLIB), \
LDFLAGS := $(LDFLAGS_JDKLIB), \
OPTIMIZATION := LOW, \
))
TARGETS += $(BUILD_LIBTIMEOUT_HANDLER)
endif
################################################################################
# Targets for building test-image.
################################################################################
# Copy to hotspot jtreg test image
$(eval $(call SetupCopyFiles, COPY_FH, \
SRC := $(FH_SUPPORT), \
DEST := $(TEST_IMAGE_DIR)/failure_handler, \
FILES := $(FH_JAR) $(BUILD_LIBTIMEOUT_HANDLER), \
))
IMAGES_TARGETS += $(COPY_FH)
################################################################################
# Test the failure handler itself
################################################################################
#
# Use JTREG_TEST_OPTS for test VM options
# Use JTREG_TESTS for jtreg tests parameter
#
RUN_DIR := $(FH_SUPPORT)/test
# Add the dir of the dll to the path on windows
ifeq ($(OPENJDK_TARGET_OS), windows)
export PATH := $(PATH);$(FH_SUPPORT)
endif
test:
$(RM) -r $(RUN_DIR)
$(MKDIR) -p $(RUN_DIR)
$(CD) $(FH_BASEDIR)/test && JT_JAVA=$(BOOT_JDK) $(JTREGEXE) \
-jdk:$(BOOT_JDK) \
$(JTREG_TEST_OPTS) \
-timeout:0.1 -va -retain:all \
-noreport \
-agentvm \
-thd:$(FH_JAR) \
-th:jdk.test.failurehandler.jtreg.GatherProcessInfoTimeoutHandler \
-od:$(FH_JAR) \
-o:jdk.test.failurehandler.jtreg.GatherDiagnosticInfoObserver \
-w:$(RUN_DIR)/JTwork -r:$(RUN_DIR)/JTreport \
$(if $(JTREG_TESTS), $(JTREG_TESTS), .) \
|| true
################################################################################
build: $(TARGETS)
images: $(IMAGES_TARGETS)
.PHONY: all images test

View File

@ -29,7 +29,7 @@ BUILD_DIR := $(shell pwd)/build
CLASSES_DIR := ${BUILD_DIR}/classes
IMAGE_DIR := ${BUILD_DIR}/image
RUN_DIR := $(shell pwd)/run
CLASSPATH := ${JTREG_HOME}/lib/jtreg.jar:${JAVA_HOME}/lib/tools.jar
SRC_DIR := src/share/classes/
SOURCES := ${SRC_DIR}/jdk/test/failurehandler/*.java \
${SRC_DIR}/jdk/test/failurehandler/action/*.java \
@ -47,9 +47,12 @@ OS_NAME := $(shell uname -o 2>&1)
ifeq ("${OS_NAME}", "Cygwin")
BUILD_DIR := $(shell cygpath -m "${BUILD_DIR}")
CLASSES_DIR := $(shell cygpath -m "${CLASSES_DIR}")
IMAGE_DIR := $(shell cygpath -m "${IMAGE_DIR}") RUN_DIR := $(shell cygpath -m "${RUN_DIR}")
IMAGE_DIR := $(shell cygpath -m "${IMAGE_DIR}")
RUN_DIR := $(shell cygpath -m "${RUN_DIR}")
SRC_DIR := $(shell cygpath -m "${SRC_DIR}")
JAVA_HOME := $(shell cygpath -m "${JAVA_HOME}")
JTREG_HOME := $(shell cygpath -m "${JTREG_HOME}")
CLASSPATH := $(shell cygpath -pm "${CLASSPATH}")
CC := "cl.exe"
endif
@ -58,9 +61,9 @@ all: clean test
native: require_env
ifeq ("${OS_NAME}", "Cygwin")
"${CC}" src/windows/native/jdk/test/failurehandler/jtreg/*.c \
-I"$(shell cygpath -w ${JAVA_HOME}/include)" \
-I"$(shell cygpath -w ${JAVA_HOME}/include/win32)" \
/link /MACHINE:X64 /DLL /OUT:timeoutHandler.dll
-I"$(shell cygpath -w "${JAVA_HOME}/include")" \
-I"$(shell cygpath -w "${JAVA_HOME}/include/win32")" \
/link /DLL /OUT:timeoutHandler.dll
endif
check_defined = $(foreach 1,$1,$(__check_defined))
@ -69,20 +72,20 @@ __check_defined = $(if $(value $1),, $(error $1 is not set))
classes: require_env
mkdir -p ${IMAGE_DIR}/bin ${IMAGE_DIR}/lib ${CLASSES_DIR}
"${JAVA_HOME}"/bin/javac -target ${JAVA_RELEASE} -source ${JAVA_RELEASE} \
-sourcepath $(shell pwd) \
-classpath ${JTREG_HOME}/lib/jtreg.jar:${JAVA_HOME}/lib/tools.jar \
-sourcepath "$(shell pwd)" \
-cp "${CLASSPATH}" \
-d ${CLASSES_DIR} \
${SOURCES}
"${JAVA_HOME}"/bin/jar cf ${TARGET_JAR} -C ${CLASSES_DIR} .
"${JAVA_HOME}"/bin/jar uf ${TARGET_JAR} -C ${CONF_DIR} .
"${JAVA_HOME}"/bin/jar cf "${TARGET_JAR}" -C "${CLASSES_DIR}" .
"${JAVA_HOME}"/bin/jar uf "${TARGET_JAR}" -C "${CONF_DIR}" .
#
# Use JTREG_TEST_OPTS for test VM options
# Use JTREG_TESTS for jtreg tests parameter
#
test: require_env build
rm -rf ${RUN_DIR}
mkdir -p ${RUN_DIR}
rm -rf "${RUN_DIR}"
mkdir -p "${RUN_DIR}"
"${JTREG_HOME}"/bin/jtreg \
-jdk:"${JAVA_HOME}" \
${JTREG_TEST_OPTS} \
@ -93,7 +96,8 @@ test: require_env build
-th:jdk.test.failurehandler.jtreg.GatherProcessInfoTimeoutHandler \
-od:"${TARGET_JAR}" \
-o:jdk.test.failurehandler.jtreg.GatherDiagnosticInfoObserver \
-w:${RUN_DIR}/JTwork -r:${RUN_DIR}/JTreport \
-w:"${RUN_DIR}/JTwork" \
-r:"${RUN_DIR}/JTreport" \
$(if ${JTREG_TESTS}, ${JTREG_TESTS}, test) \
&& false || true

View File

@ -36,11 +36,9 @@ The library requires jtreg 4b13+ and JDK 7+.
BUILDING
To build a library, one should simply run make with 'JTREG_HOME' and
'JAVA_HOME' environment variables set. 'JAVA_HOME' should contain path to JDK,
'JTREG_HOME' -- path to jtreg.
'image/lib/jtregFailureHandler.jar' is created on successful build.
The library is built using the top level build-test-failure-handler target and
is automatically included in the test image and picked up by hotspot and jdk
test makefiles.
CONFIGURATION

View File

@ -39,12 +39,16 @@ import java.nio.file.Path;
* process and its children.
*/
public class GatherProcessInfoTimeoutHandler extends TimeoutHandler {
private static final boolean HAS_NATIVE_LIBRARY;
static {
boolean value = true;
try {
System.loadLibrary("timeoutHandler");
} catch (UnsatisfiedLinkError ignore) {
// not all os need timeoutHandler native-library
value = false;
}
HAS_NATIVE_LIBRARY = value;
}
private static final String LOG_FILENAME = "processes.log";
private static final String OUTPUT_FILENAME = "processes.html";
@ -105,7 +109,7 @@ public class GatherProcessInfoTimeoutHandler extends TimeoutHandler {
if (result == 0L) {
/* jtreg didn't find pid, most probably we are on JDK < 9
there is no Process::getPid */
if ("windows".equals(OS.current().family)) {
if (HAS_NATIVE_LIBRARY && "windows".equals(OS.current().family)) {
try {
Field field = process.getClass().getDeclaredField("handle");
boolean old = field.isAccessible();

View File

@ -30,7 +30,7 @@ extern "C" {
JNIEXPORT jlong JNICALL Java_jdk_test_failurehandler_jtreg_GatherProcessInfoTimeoutHandler_getWin32Pid
(JNIEnv* env, jobject o, jlong handle) {
return GetProcessId(handle);
return GetProcessId((HANDLE) handle);
}
#ifdef __cplusplus
}

View File

@ -28,7 +28,7 @@ import java.lang.management.ManagementFactory;
/*
* @test
* @summary Suicide test
* @run main/othervm Crash
* @run main/othervm Suicide
*/
public class Suicide {
public static void main(String[] args) {

View File

@ -344,7 +344,13 @@ public class WhiteBox {
}
public native Object[] getCodeBlob(long addr);
public native void clearInlineCaches();
private native void clearInlineCaches0(boolean preserve_static_stubs);
public void clearInlineCaches() {
clearInlineCaches0(false);
}
public void clearInlineCaches(boolean preserve_static_stubs) {
clearInlineCaches0(preserve_static_stubs);
}
// Intered strings
public native boolean isInStringTable(String str);

View File

@ -254,4 +254,14 @@ ifneq ($(call sequence, 5, 15), 5 6 7 8 9 10 11 12 13 14 15)
but was $(call sequence, 5, 15))
endif
################################################################################
# Test that PathList is safe when called multiple nested times.
PATHLIST_INPUT := foo bar baz
$(eval $(call assert-equals, \
$(call PathList, $(call PathList, $(PATHLIST_INPUT))), \
$(call PathList, $(PATHLIST_INPUT)), \
PathList call not safe for calling twice))
all: $(TEST_TARGETS)