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,30 +509,32 @@ compare_zip_file() {
| $CUT -f 2 -d ' ' | $SED "s|$OTHER_UNZIPDIR/||g") | $CUT -f 2 -d ' ' | $SED "s|$OTHER_UNZIPDIR/||g")
fi fi
$RM -f $WORK_DIR/$ZIP_FILE.diffs if [ "$CMP_ZIPS_CONTENTS" = "true" ]; then
for file in $DIFFING_FILES; do $RM -f $WORK_DIR/$ZIP_FILE.diffs
if [[ "$ACCEPTED_JARZIP_CONTENTS $EXCEPTIONS" != *"$file"* ]]; then for file in $DIFFING_FILES; do
diff_text $OTHER_UNZIPDIR/$file $THIS_UNZIPDIR/$file >> $WORK_DIR/$ZIP_FILE.diffs if [[ "$ACCEPTED_JARZIP_CONTENTS $EXCEPTIONS" != *"$file"* ]]; then
fi diff_text $OTHER_UNZIPDIR/$file $THIS_UNZIPDIR/$file >> $WORK_DIR/$ZIP_FILE.diffs
done fi
done
if [ -s "$WORK_DIR/$ZIP_FILE.diffs" ]; then if [ -s "$WORK_DIR/$ZIP_FILE.diffs" ]; then
return_value=1 return_value=1
echo " Differing files in $ZIP_FILE" echo " Differing files in $ZIP_FILE"
$CAT $WORK_DIR/$ZIP_FILE.diffs | $GREP 'differ$' | cut -f 2 -d ' ' | \ $CAT $WORK_DIR/$ZIP_FILE.diffs | $GREP 'differ$' | cut -f 2 -d ' ' | \
$SED "s|$OTHER_UNZIPDIR| |g" > $WORK_DIR/$ZIP_FILE.difflist $SED "s|$OTHER_UNZIPDIR| |g" > $WORK_DIR/$ZIP_FILE.difflist
$CAT $WORK_DIR/$ZIP_FILE.difflist $CAT $WORK_DIR/$ZIP_FILE.difflist
if [ -n "$SHOW_DIFFS" ]; then if [ -n "$SHOW_DIFFS" ]; then
for i in $(cat $WORK_DIR/$ZIP_FILE.difflist) ; do for i in $(cat $WORK_DIR/$ZIP_FILE.difflist) ; do
if [ -f "${OTHER_UNZIPDIR}/$i.javap" ]; then if [ -f "${OTHER_UNZIPDIR}/$i.javap" ]; then
LC_ALL=C $DIFF ${OTHER_UNZIPDIR}/$i.javap ${THIS_UNZIPDIR}/$i.javap LC_ALL=C $DIFF ${OTHER_UNZIPDIR}/$i.javap ${THIS_UNZIPDIR}/$i.javap
elif [ -f "${OTHER_UNZIPDIR}/$i.cleaned" ]; then elif [ -f "${OTHER_UNZIPDIR}/$i.cleaned" ]; then
LC_ALL=C $DIFF ${OTHER_UNZIPDIR}/$i.cleaned ${THIS_UNZIPDIR}/$i LC_ALL=C $DIFF ${OTHER_UNZIPDIR}/$i.cleaned ${THIS_UNZIPDIR}/$i
else else
LC_ALL=C $DIFF ${OTHER_UNZIPDIR}/$i ${THIS_UNZIPDIR}/$i LC_ALL=C $DIFF ${OTHER_UNZIPDIR}/$i ${THIS_UNZIPDIR}/$i
fi fi
done done
fi
fi fi
fi fi
@ -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 "-perms Compare the permission bits on all files and directories"
echo "-types Compare the output of the file command on all files" echo "-types Compare the output of the file command on all files"
echo "-general Compare the files not convered by the specialized comparisons" 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 "-jars Compare the contents of all jar files"
echo "-libs Compare all native libraries" echo "-libs Compare all native libraries"
echo "-execs Compare all executables" echo "-execs Compare all executables"
@ -1100,6 +1103,7 @@ CMP_PERMS=false
CMP_TYPES=false CMP_TYPES=false
CMP_GENERAL=false CMP_GENERAL=false
CMP_ZIPS=false CMP_ZIPS=false
CMP_ZIPS_CONTENTS=true
CMP_JARS=false CMP_JARS=false
CMP_LIBS=false CMP_LIBS=false
CMP_EXECS=false CMP_EXECS=false
@ -1143,6 +1147,11 @@ while [ -n "$1" ]; do
;; ;;
-zips) -zips)
CMP_ZIPS=true CMP_ZIPS=true
CMP_ZIPS_CONTENTS=true
;;
-zips-names)
CMP_ZIPS=true
CMP_ZIPS_CONTENTS=false
;; ;;
-jars) -jars)
CMP_JARS=true CMP_JARS=true

View File

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

View File

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

View File

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