8334598: Default classlist in JDK is not deterministic after JDK-8293980
Reviewed-by: ccheung, dholmes, stuefe, erikj
This commit is contained in:
parent
9c89f0861c
commit
7429c37e63
@ -62,14 +62,14 @@ ifeq ($(EXTERNAL_BUILDJDK), true)
|
|||||||
INTERIM_IMAGE_DIR := $(BUILD_JDK)
|
INTERIM_IMAGE_DIR := $(BUILD_JDK)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# These are needed for deterministic classlist:
|
# To make the classlist deterministic:
|
||||||
# - The classlist can be influenced by locale. Always set it to en/US.
|
# - The classlist can be influenced by locale. Always set it to en/US.
|
||||||
# - Run with -Xint, as the compiler can speculatively resolve constant pool entries.
|
# - Concurrency in the core libraries can cause constant pool resolution
|
||||||
# - ForkJoinPool parallelism can cause constant pool resolution to be non-deterministic.
|
# to be non-deterministic. Since the benefits of resolved CP references in the
|
||||||
|
# default classlist is minimal, let's filter out the '@cp' lines until we can
|
||||||
|
# find a proper solution.
|
||||||
CLASSLIST_FILE_VM_OPTS = \
|
CLASSLIST_FILE_VM_OPTS = \
|
||||||
-Duser.language=en -Duser.country=US \
|
-Duser.language=en -Duser.country=US
|
||||||
-Xint \
|
|
||||||
-Djava.util.concurrent.ForkJoinPool.common.parallelism=0
|
|
||||||
|
|
||||||
# Save the stderr output of the command and print it along with stdout in case
|
# Save the stderr output of the command and print it along with stdout in case
|
||||||
# something goes wrong.
|
# something goes wrong.
|
||||||
@ -101,9 +101,10 @@ $(CLASSLIST_FILE): $(INTERIM_IMAGE_DIR)/bin/java$(EXECUTABLE_SUFFIX) $(CLASSLIST
|
|||||||
exit $$exitcode \
|
exit $$exitcode \
|
||||||
)
|
)
|
||||||
$(GREP) -v HelloClasslist $@.raw.2 > $@.raw.3
|
$(GREP) -v HelloClasslist $@.raw.2 > $@.raw.3
|
||||||
|
$(GREP) -v @cp $@.raw.3 > $@.raw.4
|
||||||
$(FIXPATH) $(INTERIM_IMAGE_DIR)/bin/java \
|
$(FIXPATH) $(INTERIM_IMAGE_DIR)/bin/java \
|
||||||
-cp $(SUPPORT_OUTPUTDIR)/classlist.jar \
|
-cp $(SUPPORT_OUTPUTDIR)/classlist.jar \
|
||||||
build.tools.classlist.SortClasslist $@.raw.3 > $@
|
build.tools.classlist.SortClasslist $@.raw.4 > $@
|
||||||
|
|
||||||
# The jli trace is created by the same recipe as classlist. By declaring these
|
# The jli trace is created by the same recipe as classlist. By declaring these
|
||||||
# dependencies, make will correctly rebuild both jli trace and classlist
|
# dependencies, make will correctly rebuild both jli trace and classlist
|
||||||
|
Loading…
Reference in New Issue
Block a user