8170878: JDK 9 fails to build when enabling Hotspot code coverage

Reviewed-by: ihse
This commit is contained in:
Erik Joelsson 2016-12-13 12:31:43 +01:00
parent d1dd5b972c
commit 11166cddfd
4 changed files with 100 additions and 77 deletions

View File

@ -509,6 +509,7 @@ compare_zip_file() {
| $CUT -f 2 -d ' ' | $SED "s|$OTHER_UNZIPDIR/||g")
fi
if [ "$CMP_ZIPS_CONTENTS" = "true" ]; then
$RM -f $WORK_DIR/$ZIP_FILE.diffs
for file in $DIFFING_FILES; do
if [[ "$ACCEPTED_JARZIP_CONTENTS $EXCEPTIONS" != *"$file"* ]]; then
@ -535,6 +536,7 @@ compare_zip_file() {
done
fi
fi
fi
return $return_value
}
@ -1072,7 +1074,8 @@ if [ -z "$1" ] || [ "$1" = "-h" ] || [ "$1" = "-?" ] || [ "$1" = "/h" ] || [ "$1
echo "-perms Compare the permission bits on all files and directories"
echo "-types Compare the output of the file command on all files"
echo "-general Compare the files not convered by the specialized comparisons"
echo "-zips Compare the contents of all zip files"
echo "-zips Compare the contents of all zip files and files in them"
echo "-zips-names Compare the file names inside all zip files"
echo "-jars Compare the contents of all jar files"
echo "-libs Compare all native libraries"
echo "-execs Compare all executables"
@ -1100,6 +1103,7 @@ CMP_PERMS=false
CMP_TYPES=false
CMP_GENERAL=false
CMP_ZIPS=false
CMP_ZIPS_CONTENTS=true
CMP_JARS=false
CMP_LIBS=false
CMP_EXECS=false
@ -1143,6 +1147,11 @@ while [ -n "$1" ]; do
;;
-zips)
CMP_ZIPS=true
CMP_ZIPS_CONTENTS=true
;;
-zips-names)
CMP_ZIPS=true
CMP_ZIPS_CONTENTS=false
;;
-jars)
CMP_JARS=true

View File

@ -43,16 +43,20 @@ endif
$(eval $(call IncludeCustomExtension, , Bundles-pre.gmk))
################################################################################
# BUNDLE : Name of bundle to create
# FILES : Files in BASE_DIR to add to bundle
# SPECIAL_INCLUDES : List of directories inside BASE_DIR to look for additional
# FILES : Files in BASE_DIRS to add to bundle
# SPECIAL_INCLUDES : List of directories inside BASE_DIRS to look for additional
# files in. These files will not get proper dependency handling. Use when
# files or directories may contain spaces.
# BASE_DIR : Base directory for the root dir in the bundle.
# BASE_DIRS : Base directories for the root dir in the bundle.
# SUBDIR : Optional name of root dir in bundle.
SetupBundleFile = $(NamedParamsMacroTemplate)
define SetupBundleFileBody
$1_RELATIVE_FILES := $$(patsubst $$($1_BASE_DIR)/%, %, $$($1_FILES))
$$(foreach d, $$($1_BASE_DIRS), \
$$(eval $1_$$d_RELATIVE_FILES := $$$$(patsubst $$d/%, %, \
$$$$(filter $$d/%, $$$$($1_FILES)))) \
$$(eval $1_$$d_LIST_FILE := $(SUPPORT_OUTPUTDIR)/bundles/_$1_$$$$(subst /,_,$$d_files)) \
)
ifneq ($$(filter %.tar.gz, $$($1_BUNDLE_NAME)), )
$1_TYPE := tar.gz
@ -65,31 +69,52 @@ define SetupBundleFileBody
$$(call SetIfEmpty, $1_UNZIP_DEBUGINFO, false)
$(BUNDLES_OUTPUTDIR)/$$($1_BUNDLE_NAME): $$($1_FILES)
$$(foreach d, $$($1_BASE_DIRS), \
$$(eval $$(call ListPathsSafely, \
$1_RELATIVE_FILES, \
$(SUPPORT_OUTPUTDIR)/bundles/_$1_files))
$1_$$d_RELATIVE_FILES, $$($1_$$d_LIST_FILE))) \
)
$$(call MakeDir, $$(@D))
ifneq ($$($1_SPECIAL_INCLUDES), )
$$(foreach i, $$($1_SPECIAL_INCLUDES), \
($(CD) $$($1_BASE_DIR) && $(FIND) $$i \
>> $(SUPPORT_OUTPUTDIR)/bundles/_$1_files ) ; )
$$(foreach d, $$d, \
($(CD) $$d && $(FIND) $$i \
>> $(SUPPORT_OUTPUTDIR)/bundles/_$1_files ) ; ))
endif
ifneq ($$($1_SUBDIR), )
ifeq ($$($1_TYPE)-$(TAR_SUPPORTS_TRANSFORM)-$$($1_UNZIP_DEBUGINFO), tar.gz-true-false)
$(CD) $$($1_BASE_DIR) \
ifeq ($$($1_SUBDIR)-$$($1_TYPE)-$$($1_UNZIP_DEBUGINFO), .-zip-false)
# If no subdir is specified, zip can be done directly from BASE_DIRS.
$$(foreach d, $$($1_BASE_DIRS), \
( $(CD) $$d \
&& $(ZIPEXE) -qru $$@ . -i@$$($1_$$d_LIST_FILE) \
|| test "$$$$?" = "12" )$$(NEWLINE))
else ifeq ($$($1_SUBDIR)-$$($1_TYPE)-$$($1_UNZIP_DEBUGINFO)-$$(words $$($1_BASE_DIRS)), \
.-tar.gz-false-1)
# If no subdir is specified and only one BASE_DIR, tar.gz can be done
# directly from BASE_DIR.
$(CD) $$($1_BASE_DIRS) \
&& ( $(TAR) cf - $(TAR_CREATE_EXTRA_PARAM) \
-$(TAR_INCLUDE_PARAM) $(SUPPORT_OUTPUTDIR)/bundles/_$1_files \
--transform 's|^|$$($1_SUBDIR)/|' $(TAR_IGNORE_EXIT_VALUE) ) \
-$(TAR_INCLUDE_PARAM) $$($1_$$($1_BASE_DIRS)_LIST_FILE) \
$(TAR_IGNORE_EXIT_VALUE) ) \
| $(GZIP) > $$@
else ifeq ($$($1_TYPE)-$(TAR_SUPPORTS_TRANSFORM)-$$($1_UNZIP_DEBUGINFO)-$$(words $$($1_BASE_DIRS)), \
tar.gz-true-false-1)
# If only one BASE_DIR, but with a SUBDIR set, tar.gz can use the
# transform option to create bundle directly from the BASE_DIR.
$(CD) $$($1_BASE_DIRS) \
&& ( $(TAR) cf - $(TAR_CREATE_EXTRA_PARAM) \
-$(TAR_INCLUDE_PARAM) $$($1_$$($1_BASE_DIRS)_LIST_FILE) \
$$(if $$($1_SUBDIR), --transform 's|^|$$($1_SUBDIR)/|') \
$(TAR_IGNORE_EXIT_VALUE) ) \
| $(GZIP) > $$@
else
# If a subdir has been specified, copy all files into a temporary
# location with this subdir before creating the tar file
# In all other cases, need to copy all files into a temporary location
# before creation bundle.
$(RM) -r $(SUPPORT_OUTPUTDIR)/bundles/$1/$$($1_SUBDIR)
$(MKDIR) -p $(SUPPORT_OUTPUTDIR)/bundles/$1/$$($1_SUBDIR)
( $(CD) $$($1_BASE_DIR) \
&& $(TAR) cf - -$(TAR_INCLUDE_PARAM) $(SUPPORT_OUTPUTDIR)/bundles/_$1_files \
$$(foreach d, $$($1_BASE_DIRS), \
( $(CD) $$d \
&& $(TAR) cf - -$(TAR_INCLUDE_PARAM) $$($1_$$d_LIST_FILE) \
$(TAR_IGNORE_EXIT_VALUE) ) \
| ( $(CD) $(SUPPORT_OUTPUTDIR)/bundles/$1/$$($1_SUBDIR) && $(TAR) xf - )
| ( $(CD) $(SUPPORT_OUTPUTDIR)/bundles/$1/$$($1_SUBDIR) && $(TAR) xf - )$$(NEWLINE) )
# Unzip any zipped debuginfo files
ifeq ($$($1_UNZIP_DEBUGINFO), true)
for f in `$(FIND) $(SUPPORT_OUTPUTDIR)/bundles/$1/$$($1_SUBDIR) -name "*.diz"`; do \
@ -98,24 +123,13 @@ define SetupBundleFileBody
endif
ifeq ($$($1_TYPE), tar.gz)
$(CD) $(SUPPORT_OUTPUTDIR)/bundles/$1 && \
( $(TAR) cf - $(TAR_CREATE_EXTRA_PARAM) $$($1_SUBDIR) $(TAR_IGNORE_EXIT_VALUE) ) \
( $(TAR) cf - $(TAR_CREATE_EXTRA_PARAM) \
$$(if $$($1_SUBDIR), $$($1_SUBDIR), .) $(TAR_IGNORE_EXIT_VALUE) ) \
| $(GZIP) > $$@
else ifeq ($$($1_TYPE), zip)
$(CD) $(SUPPORT_OUTPUTDIR)/bundles/$1 && $(ZIPEXE) -qr $$@ .
endif
endif
else
ifeq ($$($1_TYPE), tar.gz)
$(CD) $$($1_BASE_DIR) \
&& ( $(TAR) cf - $(TAR_CREATE_EXTRA_PARAM) \
-$(TAR_INCLUDE_PARAM) $(SUPPORT_OUTPUTDIR)/bundles/_$1_files \
$(TAR_IGNORE_EXIT_VALUE) ) \
| $(GZIP) > $$@
else ifeq ($$($1_TYPE), zip)
$(CD) $$($1_BASE_DIR) \
&& $(ZIPEXE) -qr $$@ . -i@$(SUPPORT_OUTPUTDIR)/bundles/_$1_files
endif
endif
$1 += $(BUNDLES_OUTPUTDIR)/$$($1_BUNDLE_NAME)
@ -219,7 +233,7 @@ ifneq ($(filter product-bundles, $(MAKECMDGOALS)), )
BUNDLE_NAME := $(JDK_BUNDLE_NAME), \
FILES := $(JDK_BUNDLE_FILES), \
SPECIAL_INCLUDES := $(JDK_SPECIAL_INCLUDES), \
BASE_DIR := $(JDK_IMAGE_DIR), \
BASE_DIRS := $(JDK_IMAGE_DIR), \
SUBDIR := $(JDK_BUNDLE_SUBDIR), \
))
@ -228,7 +242,7 @@ ifneq ($(filter product-bundles, $(MAKECMDGOALS)), )
$(eval $(call SetupBundleFile, BUILD_JRE_BUNDLE, \
BUNDLE_NAME := $(JRE_BUNDLE_NAME), \
FILES := $(JRE_BUNDLE_FILES), \
BASE_DIR := $(JRE_IMAGE_DIR), \
BASE_DIRS := $(JRE_IMAGE_DIR), \
SUBDIR := $(JRE_BUNDLE_SUBDIR), \
))
@ -237,7 +251,7 @@ ifneq ($(filter product-bundles, $(MAKECMDGOALS)), )
$(eval $(call SetupBundleFile, BUILD_JDK_SYMBOLS_BUNDLE, \
BUNDLE_NAME := $(JDK_SYMBOLS_BUNDLE_NAME), \
FILES := $(JDK_SYMBOLS_BUNDLE_FILES), \
BASE_DIR := $(JDK_IMAGE_DIR), \
BASE_DIRS := $(JDK_IMAGE_DIR) $(wildcard $(SYMBOLS_IMAGE_DIR)), \
SUBDIR := $(JDK_BUNDLE_SUBDIR), \
UNZIP_DEBUGINFO := true, \
))
@ -247,7 +261,7 @@ ifneq ($(filter product-bundles, $(MAKECMDGOALS)), )
$(eval $(call SetupBundleFile, BUILD_JRE_SYMBOLS_BUNDLE, \
BUNDLE_NAME := $(JRE_SYMBOLS_BUNDLE_NAME), \
FILES := $(JRE_SYMBOLS_BUNDLE_FILES), \
BASE_DIR := $(JRE_IMAGE_DIR), \
BASE_DIRS := $(JRE_IMAGE_DIR), \
SUBDIR := $(JRE_BUNDLE_SUBDIR), \
UNZIP_DEBUGINFO := true, \
))
@ -257,7 +271,7 @@ ifneq ($(filter product-bundles, $(MAKECMDGOALS)), )
$(eval $(call SetupBundleFile, BUILD_DEMOS_BUNDLE, \
BUNDLE_NAME := $(DEMOS_BUNDLE_NAME), \
FILES := $(DEMOS_BUNDLE_FILES), \
BASE_DIR := $(JDK_IMAGE_DIR), \
BASE_DIRS := $(JDK_IMAGE_DIR), \
SUBDIR := $(JDK_BUNDLE_SUBDIR), \
))
@ -272,7 +286,7 @@ ifneq ($(filter test-bundles, $(MAKECMDGOALS)), )
$(eval $(call SetupBundleFile, BUILD_TEST_BUNDLE, \
BUNDLE_NAME := $(TEST_BUNDLE_NAME), \
FILES := $(TEST_BUNDLE_FILES), \
BASE_DIR := $(TEST_IMAGE_DIR), \
BASE_DIRS := $(TEST_IMAGE_DIR), \
))
TEST_TARGETS += $(BUILD_TEST_BUNDLE)
@ -286,7 +300,7 @@ ifneq ($(filter docs-bundles, $(MAKECMDGOALS)), )
$(eval $(call SetupBundleFile, BUILD_DOCS_BUNDLE, \
BUNDLE_NAME := $(DOCS_BUNDLE_NAME), \
FILES := $(DOCS_BUNDLE_FILES), \
BASE_DIR := $(DOCS_IMAGE_DIR), \
BASE_DIRS := $(DOCS_IMAGE_DIR), \
SUBDIR := docs, \
))

View File

@ -81,7 +81,6 @@ ifeq ($(JPRT_TARGET), $(DEFAULT_MAKE_TARGET))
# Optional symbols bundle
ifeq ($(GCOV_ENABLED), true)
jprt_bundle: $(JPRT_ARCHIVE_SYMBOLS_BUNDLE)
zip-bundles: $(SYMBOLS_ZIP_BUNDLE)
$(JPRT_ARCHIVE_SYMBOLS_BUNDLE): product-images
$(call MakeDir, $(@D))

View File

@ -689,6 +689,7 @@ else
jdk-image: jmods zip-source demos samples release-file
jre-image: jmods release-file
symbols-image: $(LIBS_TARGETS) $(LAUNCHER_TARGETS)
profiles: jmods release-file