Skip to content

Commit b1d2762

Browse files
Merge branch 'master' into JDK-8333664
2 parents cf25e97 + b2da0d3 commit b1d2762

File tree

1,312 files changed

+51083
-36145
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,312 files changed

+51083
-36145
lines changed

doc/hotspot-style.html

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -207,23 +207,31 @@ <h3 id="source-files">Source Files</h3>
207207
<ul>
208208
<li><p>All source files must have a globally unique basename. The build
209209
system depends on this uniqueness.</p></li>
210+
<li><p>Keep the include lines within a section alphabetically sorted.</p></li>
211+
<li><p>Put conditional inclusions (`#if ...`) at the end of the section of HotSpot
212+
include lines. This also applies to macro-expanded includes of platform
213+
dependent files.</p></li>
214+
<li><p>Put system includes in a section after the HotSpot include lines with a blank
215+
line separating the two sections.</p></li>
210216
<li><p>Do not put non-trivial function implementations in .hpp files. If
211-
the implementation depends on other .hpp files, put it in a .cpp or a
212-
.inline.hpp file.</p></li>
217+
the implementation depends on other .hpp files, put it in a .cpp or
218+
a .inline.hpp file.</p></li>
213219
<li><p>.inline.hpp files should only be included in .cpp or .inline.hpp
214220
files.</p></li>
215-
<li><p>All .inline.hpp files should include their corresponding .hpp
216-
file as the first include line. Declarations needed by other files
217-
should be put in the .hpp file, and not in the .inline.hpp file. This
218-
rule exists to resolve problems with circular dependencies between
219-
.inline.hpp files.</p></li>
221+
<li><p>All .inline.hpp files should include their corresponding .hpp file as
222+
the first include line with a blank line separating it from the rest of the
223+
include lines. Declarations needed by other files should be put in the .hpp
224+
file, and not in the .inline.hpp file. This rule exists to resolve problems
225+
with circular dependencies between .inline.hpp files.</p></li>
226+
<li><p>Do not include a .hpp file if the corresponding .inline.hpp file is included.</p></li>
227+
<li><p>Use include guards for .hpp and .inline.hpp files. The name of the defined
228+
guard should be derived from the full search path of the file relative to the
229+
hotspot source directory. The guard should be all upper case with all paths
230+
separators and periods replaced by underscores.</p></li>
220231
<li><p>Some build configurations use precompiled headers to speed up the
221232
build times. The precompiled headers are included in the precompiled.hpp
222233
file. Note that precompiled.hpp is just a build time optimization, so
223234
don't rely on it to resolve include problems.</p></li>
224-
<li><p>Keep the include lines alphabetically sorted.</p></li>
225-
<li><p>Put conditional inclusions (<code>#if ...</code>) at the end of
226-
the include list.</p></li>
227235
</ul>
228236
<h3 id="jtreg-tests">JTReg Tests</h3>
229237
<ul>

doc/hotspot-style.md

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,18 @@ change should be done with a "setter" accessor matched to the simple
135135

136136
### Source Files
137137

138-
* All source files must have a globally unique basename. The build
138+
* All source files must have a globally unique basename. The build
139139
system depends on this uniqueness.
140140

141+
* Keep the include lines within a section alphabetically sorted.
142+
143+
* Put conditional inclusions (`#if ...`) at the end of the section of HotSpot
144+
include lines. This also applies to macro-expanded includes of platform
145+
dependent files.
146+
147+
* Put system includes in a section after the HotSpot include lines with a blank
148+
line separating the two sections.
149+
141150
* Do not put non-trivial function implementations in .hpp files. If
142151
the implementation depends on other .hpp files, put it in a .cpp or
143152
a .inline.hpp file.
@@ -146,19 +155,23 @@ a .inline.hpp file.
146155
files.
147156

148157
* All .inline.hpp files should include their corresponding .hpp file as
149-
the first include line. Declarations needed by other files should be put
150-
in the .hpp file, and not in the .inline.hpp file. This rule exists to
151-
resolve problems with circular dependencies between .inline.hpp files.
158+
the first include line with a blank line separating it from the rest of the
159+
include lines. Declarations needed by other files should be put in the .hpp
160+
file, and not in the .inline.hpp file. This rule exists to resolve problems
161+
with circular dependencies between .inline.hpp files.
162+
163+
* Do not include a .hpp file if the corresponding .inline.hpp file is included.
164+
165+
* Use include guards for .hpp and .inline.hpp files. The name of the defined
166+
guard should be derived from the full search path of the file relative to the
167+
hotspot source directory. The guard should be all upper case with all paths
168+
separators and periods replaced by underscores.
152169

153170
* Some build configurations use precompiled headers to speed up the
154171
build times. The precompiled headers are included in the precompiled.hpp
155172
file. Note that precompiled.hpp is just a build time optimization, so
156173
don't rely on it to resolve include problems.
157174

158-
* Keep the include lines alphabetically sorted.
159-
160-
* Put conditional inclusions (`#if ...`) at the end of the include list.
161-
162175
### JTReg Tests
163176

164177
* JTReg tests should have meaningful names.

make/Main.gmk

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,10 +1321,7 @@ endif
13211321
################################################################################
13221322

13231323
# all-images builds all our deliverables as images.
1324-
all-images: product-images test-image all-docs-images
1325-
ifeq ($(call isTargetOs, linux macosx windows), true)
1326-
all-images: static-jdk-image
1327-
endif
1324+
all-images: product-images static-jdk-image test-image all-docs-images
13281325

13291326
# all-bundles packages all our deliverables as tar.gz bundles.
13301327
all-bundles: product-bundles test-bundles docs-bundles static-libs-bundles

make/RunTests.gmk

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -543,8 +543,8 @@ define SetupRunGtestTestBody
543543
print arr[0]; \
544544
found=1; \
545545
} \
546-
if (!found) { print 0; } \
547-
}' \
546+
} \
547+
END { if (!found) print 0; }' \
548548
$$($1_RESULT_FILE))) \
549549
$$(eval $1_FAILED := $$(shell $$(AWK) '/\[ FAILED \] .* tests?, \
550550
listed below/ { print $$$$4 }' $$($1_RESULT_FILE))) \
@@ -732,14 +732,16 @@ endef
732732
#
733733
SetupAOT = $(NamedParamsMacroTemplate)
734734
define SetupAOTBody
735-
$1_AOT_JDK_CONF := $$($1_TEST_SUPPORT_DIR)/aot/jdk.aotconf
736-
$1_AOT_JDK_CACHE := $$($1_TEST_SUPPORT_DIR)/aot/jdk.aotcache
737-
$1_AOT_JDK_LOG := $$($1_TEST_SUPPORT_DIR)/aot/TestSetupAOT.log
735+
$1_AOT_JDK_OUTPUT_DIR := $$($1_TEST_SUPPORT_DIR)/aot
736+
$1_AOT_JDK_CONF := $$($1_AOT_JDK_OUTPUT_DIR)/jdk.aotconf
737+
$1_AOT_JDK_CACHE := $$($1_AOT_JDK_OUTPUT_DIR)/jdk.aotcache
738+
$1_AOT_JDK_LOG := $$($1_AOT_JDK_OUTPUT_DIR)/TestSetupAOT.log
738739

739-
# We execute the training run with $(TEST_IMAGE_DIR)/setup_aot/TestSetupAOT.class
740+
# We execute the training run with the TestSetupAOT class from $(TEST_IMAGE_DIR)/setup_aot/TestSetupAOT.jar
740741
# to touch a fair number of classes inside the JDK. Note that we can't specify a classpath,
741742
# or else the AOT cache cannot be used with jtreg test cases that use a different value
742-
# for their classpaths. Instead, we run in the $(TEST_IMAGE_DIR)/setup_aot/ directory.
743+
# for their classpaths. Instead, we cd in the $$($1_AOT_JDK_OUTPUT_DIR) directory,
744+
# extract the TestSetupAOT.jar there, and run in that directory without specifying a classpath.
743745
# The "java" launcher will have an implicit classpath of ".", so it can pick up the TestSetupAOT
744746
# class from the JVM's current directory.
745747
#
@@ -748,19 +750,20 @@ define SetupAOTBody
748750
# only classes from the JDK.
749751

750752
$$($1_AOT_JDK_CACHE): $$(JDK_IMAGE_DIR)/release
751-
$$(call MakeDir, $$($1_TEST_SUPPORT_DIR)/aot)
753+
$$(call MakeDir, $$($1_AOT_JDK_OUTPUT_DIR))
752754

753755
$$(call LogWarn, AOT: Create cache configuration) \
754-
$$(call ExecuteWithLog, $$($1_TEST_SUPPORT_DIR)/aot, ( \
755-
$(CD) $(TEST_IMAGE_DIR)/setup_aot; \
756+
$$(call ExecuteWithLog, $$($1_AOT_JDK_OUTPUT_DIR), ( \
757+
cd $$($1_AOT_JDK_OUTPUT_DIR); \
758+
$(JAR) --extract --file $(TEST_IMAGE_DIR)/setup_aot/TestSetupAOT.jar; \
756759
$$(FIXPATH) $(JDK_UNDER_TEST)/bin/java $$($1_VM_OPTIONS) \
757-
-Xlog:cds,cds+class=debug:file=$$($1_AOT_JDK_CONF).log -Xlog:cds*=error \
760+
-Xlog:class+load,cds,cds+class=debug:file=$$($1_AOT_JDK_CONF).log -Xlog:cds*=error \
758761
-XX:AOTMode=record -XX:AOTConfiguration=$$($1_AOT_JDK_CONF) \
759-
TestSetupAOT > $$($1_AOT_JDK_LOG) \
762+
TestSetupAOT $$($1_AOT_JDK_OUTPUT_DIR) > $$($1_AOT_JDK_LOG) \
760763
))
761764

762765
$$(call LogWarn, AOT: Generate AOT cache $$($1_AOT_JDK_CACHE) with flags: $$($1_VM_OPTIONS))
763-
$$(call ExecuteWithLog, $$($1_TEST_SUPPORT_DIR)/aot, ( \
766+
$$(call ExecuteWithLog, $$($1_AOT_JDK_OUTPUT_DIR), ( \
764767
$$(FIXPATH) $(JDK_UNDER_TEST)/bin/java \
765768
$$($1_VM_OPTIONS) -Xlog:cds,cds+class=debug:file=$$($1_AOT_JDK_CACHE).log -Xlog:cds*=error \
766769
-XX:ExtraSharedClassListFile=$(JDK_UNDER_TEST)/lib/classlist \

make/StaticLibs.gmk

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ include CopyFiles.gmk
3131
include DebugInfoUtils.gmk
3232
include Modules.gmk
3333
include modules/LauncherCommon.gmk
34+
include Execute.gmk
3435

3536
################################################################################
3637
#
@@ -68,6 +69,10 @@ else ifeq ($(call isTargetOs, windows), true)
6869
BROKEN_STATIC_LIBS += sspi_bridge
6970
# dt_shmem define jdwpTransport_OnLoad which conflict with dt_socket
7071
BROKEN_STATIC_LIBS += dt_shmem
72+
else ifeq ($(call isTargetOs, aix), true)
73+
# libsplashscreen has a name conflict with libawt in the function
74+
# BitmapToYXBandedRectangles, so we exclude it for now.
75+
BROKEN_STATIC_LIBS += splashscreen
7176
endif
7277

7378
$(foreach module, $(STATIC_LIB_MODULES), \
@@ -99,6 +104,18 @@ else ifeq ($(call isTargetOs, linux), true)
99104
STATIC_LIBS := -Wl,--export-dynamic -Wl,--whole-archive $(STATIC_LIB_FILES) -Wl,--no-whole-archive
100105
else ifeq ($(call isTargetOs, windows), true)
101106
STATIC_LIBS := $(addprefix -wholearchive:, $(STATIC_LIB_FILES))
107+
else ifeq ($(call isTargetOs, aix), true)
108+
# on AIX we have to generate export files for all static libs, because we have no whole-archive linker flag
109+
$(foreach lib, $(STATIC_LIB_FILES), \
110+
$(eval $(call SetupExecute, generate_export_list_$(notdir $(lib)), \
111+
INFO := Generating export list for $(notdir $(lib)), \
112+
DEPS := $(lib), \
113+
OUTPUT_FILE := $(lib).exp, \
114+
COMMAND := ( $(AR) $(ARFLAGS) -w $(lib) | $(GREP) -v '^\.' | $(AWK) '{print $$1}' | $(SORT) -u > $(lib).exp ), \
115+
)) \
116+
$(eval STATIC_LIB_EXPORT_FILES += $(lib).exp) \
117+
)
118+
STATIC_LIBS := -Wl,-bexpfull $(STATIC_LIB_FILES) $(addprefix -Wl$(COMMA)-bE:, $(STATIC_LIB_EXPORT_FILES))
102119
else
103120
$(error Unsupported platform)
104121
endif
@@ -118,6 +135,9 @@ $(eval $(call SetupBuildLauncher, java, \
118135
))
119136

120137
$(java): $(STATIC_LIB_FILES)
138+
ifeq ($(call isTargetOs, aix), true)
139+
$(java): $(STATIC_LIB_EXPORT_FILES)
140+
endif
121141

122142
TARGETS += $(java)
123143

make/autoconf/basic.m4

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -624,10 +624,4 @@ AC_DEFUN_ONCE([BASIC_POST_CONFIG_OUTPUT],
624624
625625
# Make the compare script executable
626626
$CHMOD +x $OUTPUTDIR/compare.sh
627-
628-
# Copy the linker wrapper script for clang on AIX and make it executable
629-
if test "x$TOOLCHAIN_TYPE" = xclang && test "x$OPENJDK_TARGET_OS" = xaix; then
630-
$CP -f "$TOPDIR/make/scripts/aix/ld.sh" "$OUTPUTDIR/ld.sh"
631-
$CHMOD +x "$OUTPUTDIR/ld.sh"
632-
fi
633627
])

make/autoconf/flags-ldflags.m4

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
7878
fi
7979
fi
8080
if test "x$OPENJDK_TARGET_OS" = xaix; then
81-
BASIC_LDFLAGS="-Wl,-b64 -Wl,-brtl -Wl,-bnorwexec -Wl,-bnolibpath -Wl,-bnoexpall \
82-
-Wl,-bernotok -Wl,-bdatapsize:64k -Wl,-btextpsize:64k -Wl,-bstackpsize:64k -fuse-ld=$OUTPUTDIR/ld.sh"
81+
BASIC_LDFLAGS="-Wl,-b64 -Wl,-brtl -Wl,-bnorwexec -Wl,-blibpath:/usr/lib:lib -Wl,-bnoexpall \
82+
-Wl,-bernotok -Wl,-bdatapsize:64k -Wl,-btextpsize:64k -Wl,-bstackpsize:64k"
8383
BASIC_LDFLAGS_JVM_ONLY="$BASIC_LDFLAGS_JVM_ONLY -Wl,-lC_r -Wl,-bbigtoc"
8484
fi
8585
@@ -100,7 +100,7 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
100100
if test "x$OPENJDK_TARGET_OS" = xmacosx && test "x$TOOLCHAIN_TYPE" = xclang; then
101101
# FIXME: We should really generalize SET_SHARED_LIBRARY_ORIGIN instead.
102102
OS_LDFLAGS_JVM_ONLY="-Wl,-rpath,@loader_path/. -Wl,-rpath,@loader_path/.."
103-
OS_LDFLAGS="-mmacosx-version-min=$MACOSX_VERSION_MIN"
103+
OS_LDFLAGS="-mmacosx-version-min=$MACOSX_VERSION_MIN -Wl,-reproducible"
104104
fi
105105
106106
# Setup debug level-dependent LDFLAGS

make/autoconf/libraries.m4

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBRARIES],
139139
140140
# Threading library
141141
if test "x$OPENJDK_TARGET_OS" = xlinux || test "x$OPENJDK_TARGET_OS" = xaix; then
142-
BASIC_JVM_LIBS="$BASIC_JVM_LIBS -lpthread"
142+
BASIC_JVM_LIBS="$BASIC_JVM_LIBS $LIBPTHREAD"
143143
fi
144144
145145
# librt for legacy clock_gettime
@@ -197,6 +197,28 @@ AC_DEFUN_ONCE([LIB_SETUP_MISC_LIBS],
197197
AC_SUBST(LIBDL)
198198
LIBS="$save_LIBS"
199199
200+
# Setup posix pthread support
201+
if test "x$OPENJDK_TARGET_OS" != "xwindows"; then
202+
LIBPTHREAD="-lpthread"
203+
else
204+
LIBPTHREAD=""
205+
fi
206+
AC_SUBST(LIBPTHREAD)
207+
208+
# Setup libiconv flags and library
209+
if test "x$OPENJDK_TARGET_OS" == "xaix" || test "x$OPENJDK_TARGET_OS" == "xmacosx"; then
210+
ICONV_CFLAGS=
211+
ICONV_LDFLAGS=
212+
ICONV_LIBS=-liconv
213+
else
214+
ICONV_CFLAGS=
215+
ICONV_LDFLAGS=
216+
ICONV_LIBS=
217+
fi
218+
AC_SUBST(ICONV_CFLAGS)
219+
AC_SUBST(ICONV_LDFLAGS)
220+
AC_SUBST(ICONV_LIBS)
221+
200222
# Control if libzip can use mmap. Available for purposes of overriding.
201223
LIBZIP_CAN_USE_MMAP=true
202224
AC_SUBST(LIBZIP_CAN_USE_MMAP)

make/autoconf/spec.gmk.template

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ endif
144144

145145
LIBM := @LIBM@
146146
LIBDL := @LIBDL@
147+
LIBPTHREAD := @LIBPTHREAD@
147148

148149
WINENV_ROOT := @WINENV_ROOT@
149150
WINENV_PREFIX := @WINENV_PREFIX@
@@ -426,6 +427,9 @@ LIBFFI_LIBS := @LIBFFI_LIBS@
426427
LIBFFI_CFLAGS := @LIBFFI_CFLAGS@
427428
ENABLE_LIBFFI_BUNDLING := @ENABLE_LIBFFI_BUNDLING@
428429
LIBFFI_LIB_FILE := @LIBFFI_LIB_FILE@
430+
ICONV_CFLAGS := @ICONV_CFLAGS@
431+
ICONV_LDFLAGS := @ICONV_LDFLAGS@
432+
ICONV_LIBS := @ICONV_LIBS@
429433
FILE_MACRO_CFLAGS := @FILE_MACRO_CFLAGS@
430434
REPRODUCIBLE_CFLAGS := @REPRODUCIBLE_CFLAGS@
431435

make/common/TestFilesCompilation.gmk

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ include JdkNativeCompilation.gmk
4343
# OUTPUT_DIR Where to put the resulting files
4444
# EXCLUDE A list of filenames to exclude from compilation
4545
# EXTRA_FILES List of extra files not in SOURCE_DIRS
46+
# CFLAGS List of extra CFLAGS to pass on for each test
47+
# LDFLAGS List of extra LDFLAGS to pass on for each test
48+
# LIBS List of extra LIBS to pass on for each test
4649
SetupTestFilesCompilation = $(NamedParamsMacroTemplate)
4750
define SetupTestFilesCompilationBody
4851

@@ -108,7 +111,7 @@ define SetupTestFilesCompilationBody
108111
CFLAGS := $$(TEST_CFLAGS) $$($1_CFLAGS) $$($1_CFLAGS_$$(name)), \
109112
CXXFLAGS := $$(TEST_CFLAGS) $$($1_CFLAGS) $$($1_CFLAGS_$$(name)), \
110113
LD_SET_ORIGIN := $$($1_LD_SET_ORIGIN), \
111-
LDFLAGS := $$($1_LDFLAGS_$$(name)), \
114+
LDFLAGS := $$($1_LDFLAGS) $$($1_LDFLAGS_$$(name)), \
112115
DISABLED_WARNINGS_gcc := format undef unused-but-set-variable \
113116
unused-const-variable unused-function unused-value \
114117
unused-variable, \
@@ -117,7 +120,7 @@ define SetupTestFilesCompilationBody
117120
unused-but-set-variable unused-function unused-variable, \
118121
DEFAULT_LIBCXX := false, \
119122
JDK_LIBS := $$($1_JDK_LIBS_$$(name)), \
120-
LIBS := $$($1_LIBS_$$(name)), \
123+
LIBS := $$($1_LIBS) $$($1_LIBS_$$(name)), \
121124
DEFAULT_VERSIONINFO_RESOURCE := false, \
122125
OPTIMIZATION := $$(if $$($1_OPTIMIZATION_$$(name)), $$($1_OPTIMIZATION_$$(name)), LOW), \
123126
COPY_DEBUG_SYMBOLS := $$($1_COPY_DEBUG_SYMBOLS), \

0 commit comments

Comments
 (0)