Skip to content

Commit 6d87b7d

Browse files
committed
OpenJDK - restore version 17
1 parent 6482f87 commit 6d87b7d

Some content is hidden

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

50 files changed

+30945
-0
lines changed
+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
set -xe
2+
3+
VERSION=17
4+
5+
. common.sh
6+
7+
BOOT_JDK="$BUILD_DIR/jdk16/build/solaris-$JDK_PLATFORM-server-release/jdk"
8+
PATH="/usr/bin:/usr/gnu/bin"
9+
10+
CONFIGURE_OPTIONS+=" --enable-unlimited-crypto"
11+
CONFIGURE_OPTIONS+=" --enable-deprecated-ports=yes"
12+
CONFIGURE_OPTIONS+=" --with-boot-jdk=$BOOT_JDK"
13+
CONFIGURE_OPTIONS+=" --with-native-debug-symbols=none"
14+
CONFIGURE_OPTIONS+=" --with-toolchain-type=gcc"
15+
CONFIGURE_OPTIONS+=" --disable-hotspot-gtest"
16+
CONFIGURE_OPTIONS+=" --disable-dtrace"
17+
CONFIGURE_OPTIONS+=" --disable-warnings-as-errors"
18+
CONFIGURE_OPTIONS+=" AS=/usr/gnu/bin/as"
19+
CONFIGURE_OPTIONS+=" CC=$GCC"
20+
CONFIGURE_OPTIONS+=" CXX=$GXX"
21+
22+
git clone ${JDK_GITHUB_REPO}/$SRC_DIR "$BUILD_DIR"/$SRC_DIR
23+
cd "$BUILD_DIR"/$SRC_DIR
24+
25+
apply_patch_series
26+
27+
PATH="$PATH" bash ./configure ${CONFIGURE_OPTIONS}
28+
gmake bundles
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
15+24 was tagged after the solaris/sparc removal but didn't actually
2+
include it, it was based on a slightly earlier commit.
3+
4+
However, this is a set of notes on how the removal is being addressed
5+
http://cr.openjdk.java.net/~mikael/webrevs/8244224/webrev.final/open/webrev/
6+
it's therefore relatively trivial to revert the removal at this point
7+
8+
The patch there was:
9+
10+
wc java-solaris-sparc.patch
11+
143793 691143 5454385 java-solaris-sparc.patch
12+
13+
And there are 953 files affected by the patch
14+
15+
grep '^---' java-solaris-sparc.patch | awk '{print $2}' | wc -l
16+
953
17+
18+
297 of those are under test, we probably don't want them (for now, at
19+
any rate)
20+
21+
214 are sparc, which again we don't want
22+
23+
There are some mac/bsd/linux patches left after that
24+
25+
Overall, we want less that half the files in the patch, based on
26+
filename alone.
27+
28+
It turns out that gpatch couldn't cope with the original
29+
patch. Rebuilt it as 64-bit and it was much happier.
30+
31+
For 15+26, I've trimmed about 2/3 of java-solaris-sparc.patch
32+
This is mostly about not restoring SPARC, there's still quite a lot
33+
more cleanup we could do. Also, we shouldn't have to separately patch
34+
the files we created by applying the main patch.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,241 @@
1+
This is originally derived from the pkgsrc-joyent set for openjdk11,
2+
considerably modified. Cut from the jdk15 patches as of jdk15+32.
3+
4+
See also README-zero.txt for patches to build a project zero variant.
5+
6+
Most patches -p0
7+
8+
JDK17:
9+
10+
17-35
11+
12+
RC1, no changes
13+
14+
17-29,17-30,17-31,17-32,17-33,17-34
15+
16+
No changes
17+
18+
17-27,17-28
19+
20+
No changes. Packaged 17-28.
21+
22+
17-26
23+
24+
First from the jdk17 stabilisation repository. Same changes as in the
25+
first jdk18 tag.
26+
27+
Remove extended file io workaround, it's 32-bit only
28+
29+
17-25
30+
31+
SecurityManager deprecation. Added suppression annotations (the way it
32+
was done for Windows), and cleaned up the line number noise.
33+
34+
17-24
35+
36+
Line number noise.
37+
38+
Clean up some of the compiler warnings.
39+
40+
17-23
41+
42+
Line number noise.
43+
44+
os::os_exception_wrapper signature; last argument is a JavaThread not
45+
a Thread. No impact as we don't actually use it.
46+
47+
17-22
48+
49+
Signature of reserve_memory_special and pd_reserve_memory_special has
50+
changed to pass the page size. All we do is change the signature as
51+
it's a no-op on solaris.
52+
53+
17-21
54+
55+
Line number noise.
56+
57+
17-20
58+
59+
Quite a lot of changes this time around.
60+
61+
No more aot, so remove patches for that.
62+
63+
src/hotspot/share/cds/classListParser.cpp has moved to
64+
src/hotspot/share/cds/classListParser.cpp
65+
66+
suspend/resume has been essentially gutted
67+
68+
Assembler files are all .S not .s now; and the way it's called has
69+
changed, so we need to just forget about forcing the studio assembler
70+
71+
Other changes made:
72+
73+
Also removed solstudio, which also cleans up C_FLAG_REORDER
74+
75+
Cleared out some of the sparc pieces
76+
77+
Gutted ucrypto
78+
79+
17-19
80+
81+
.mx.jvmci has gone, we don't need it anyway
82+
83+
Boot jdk requirement bumped to 16.
84+
This triggers a lot of noisy
85+
"SIGSEGV happened inside stack but outside yellow and red zone."
86+
warnings during the build, but they appear harmless.
87+
88+
17-18
89+
90+
Don't patch jib-profiles.js. We don't use this, there aren't any AIX
91+
entries, so putting ours in is a waste of effort.
92+
93+
Remove the nbproject patches; they're either wrong or irrelevant, or both.
94+
95+
The boolAtPut flag stuff is no more. The whole JVMFlag machinery has
96+
been reworked. Renamed to set_bool.
97+
98+
Remove patching of JvmOverrideFiles.gmk when we then disable the
99+
patch later.
100+
101+
17-17
102+
103+
No significant changes
104+
105+
17-16
106+
107+
Some patch noise this time. Some of the SPARC-related noise simply
108+
removed.
109+
110+
17-15
111+
112+
No changes this time
113+
114+
17-14
115+
116+
Remove patch to c1_LIRAssembler.cpp as it's only for SPARC
117+
Maybe lir_pack/lir_unpack could go too?
118+
119+
Tidied up Awt2dLibraries.gmk
120+
121+
More centralization into os_posix: os::die() os::shutdown() os::abort()
122+
123+
Tidy up some of the format noise
124+
125+
17-13
126+
127+
Remove the patches for lib-X11.m4; they're actually for S10, so we
128+
don't want them anyway. And remove the patch to XRBackendNative.c
129+
related to it which is also an S10 fixup.
130+
131+
os::fork_and_exec has been centralized
132+
133+
MetaspaceShared::is_in_trampoline_frame() has been removed
134+
135+
17-12
136+
137+
Remove saved_rbp_address_offset() from thread_solaris_x86.hpp
138+
139+
There's also evidence of xattr support on some platforms having been
140+
added; it's not needed for the build so I've ignored it for now.
141+
142+
17-11
143+
144+
Fix memTracker.hpp; signature changed
145+
Don't patch deoptimization.cpp, it was SPARC-specific
146+
147+
17-10
148+
149+
No significant changes
150+
151+
17-9
152+
153+
No significant changes
154+
155+
17-8
156+
157+
Man os:: functions were centralized into os_posix.inline.hpp, so
158+
needed to remove our duplicates from os_solaris.inline.hpp and
159+
os_solaris.cpp. Mostly the central copy was identical, the only odd
160+
one was that the Solaris os::connect had some funky error handling
161+
162+
17-7
163+
164+
CLOCK_MONOTONIC is now just on.
165+
Needed to remove os::supports_monotonic_clock() from os_solaris.inline.hpp
166+
Remove javaTimeMillis() and javaTimeSystemUTC() and javaTimeNanos()
167+
and javaTimeNanos_info() from os_solaris.cpp
168+
Parker::park and Parker::unpark no longer compile, park.hpp has been
169+
modified so we need to make sure _counter is present in
170+
os_solaris.hpp; that makes it compile but it then crashes the jvm in there
171+
The posix variant removed the guarantee in PlatformParker; we need to
172+
do the same, fix the signature, and provide an implementation.
173+
(The PlatformParker piece took a lot of effort.)
174+
175+
17-6
176+
177+
we now have perfMemory_posix.cpp, so perfMemory_solaris.ccp should be
178+
removed or the build fails with multiply defined symbols
179+
180+
17-5
181+
182+
make/CompileJavaModules.gmk has mostly been gutted; ignore our patch
183+
as it seem to build fine without
184+
185+
os.cpp needs to include alloca.h, see illumos-port-11.patch
186+
187+
17-4
188+
189+
src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/asm/Disassembler.java
190+
has been refactored, but the new version appears to do the same thing
191+
as we need in a platform-independent manner, so drop our patch
192+
193+
17-3
194+
195+
make/common/Modules.gmk has been completely redone; remove our patch
196+
197+
17-2
198+
199+
More memory stuff; pd_uncommit_memory pd_reserve_memory
200+
pd_attempt_reserve_memory_at have changed signatures, with an extra
201+
bool argument (that appears to be unused, at least linux and aix
202+
don't make any use of it; this appears to be a Mac thing)
203+
204+
17-0/17-1
205+
206+
Quite a lot of refactoring of the toolchain stuff.
207+
208+
The page_size rework is really quite massive. The old _page_sizes was
209+
an array you manipulated directly. It's now a set. This needs various
210+
changes:
211+
212+
os::Solaris::is_valid_page_size() is just _page_sizes.contains()
213+
214+
Not strictly broken, but easy to fix: in mpss_sanity_check, we can
215+
simplify the getpagesizes() stuff as we know we're modern
216+
217+
Rework listing of valid page sizes
218+
219+
This is a bit ugly because we don't really end up using the new
220+
_page_sizes, but instead emulate the old array. Still, I can't find
221+
examples of how the new way is supposed to work on any other platform.
222+
223+
Also need to implement print_memory_mappings, as a no-op (like AIX is)
224+
225+
That's enough to make it compile; it blows up with an arithmetic
226+
exception, apparently inside apply_ergo(). In mpss_sanity_check, we
227+
need to make sure page_size (which is really a pointer to
228+
_large_page_size) is initialized to the largest valid page size.
229+
230+
Build:
231+
232+
env PATH=/usr/bin:/usr/sbin:/usr/sfw/bin:/usr/gnu/bin bash ./configure \
233+
--enable-unlimited-crypto --with-boot-jdk=/usr/jdk/instances/jdk16 \
234+
--with-native-debug-symbols=none \
235+
--with-toolchain-type=gcc \
236+
--disable-dtrace \
237+
--disable-warnings-as-errors \
238+
--enable-deprecated-ports=yes \
239+
--with-jobs=3
240+
241+
env PATH=/usr/bin:/usr/sbin:/usr/sfw/bin:/usr/gnu/bin gmake all
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--- openjdk14/src/hotspot/os/solaris/os_solaris.cpp.orig 2021-08-30 09:47:00.387082887 +0000
2+
+++ openjdk14/src/hotspot/os/solaris/os_solaris.cpp 2021-08-30 09:48:20.965475955 +0000
3+
@@ -1438,7 +1438,7 @@
4+
5+
static const arch_t arch_array[]={
6+
{EM_386, EM_386, ELFCLASS32, ELFDATA2LSB, (char*)"IA 32"},
7+
- {EM_486, EM_386, ELFCLASS32, ELFDATA2LSB, (char*)"IA 32"},
8+
+ {EM_IAMCU, EM_386, ELFCLASS32, ELFDATA2LSB, (char*)"IA 32"},
9+
{EM_IA_64, EM_IA_64, ELFCLASS64, ELFDATA2LSB, (char*)"IA 64"},
10+
{EM_X86_64, EM_X86_64, ELFCLASS64, ELFDATA2LSB, (char*)"AMD 64"},
11+
{EM_SPARC, EM_SPARC, ELFCLASS32, ELFDATA2MSB, (char*)"Sparc 32"},
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--- openjdk14/src/hotspot/os_cpu/solaris_x86/os_solaris_x86.cpp.orig 2021-08-30 09:50:25.617131295 +0000
2+
+++ openjdk14/src/hotspot/os_cpu/solaris_x86/os_solaris_x86.cpp 2021-08-30 09:54:16.121332502 +0000
3+
@@ -618,7 +618,7 @@
4+
// Furthermore, a false-positive should be harmless.
5+
if (UnguardOnExecutionViolation > 0 &&
6+
(sig == SIGSEGV || sig == SIGBUS) &&
7+
- uc->uc_mcontext.gregs[TRAPNO] == T_PGFLT) { // page fault
8+
+ uc->uc_mcontext.gregs[REG32_TRAPNO] == T_PGFLT) { // page fault
9+
int page_size = os::vm_page_size();
10+
address addr = (address) info->si_addr;
11+
address pc = (address) uc->uc_mcontext.gregs[REG_PC];
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
--- jdk16u-jdk-16.0.0-0/src/hotspot/os/solaris/os_solaris.cpp
2+
+++ jdk16u-jdk-16.0.0-0/src/hotspot/os/solaris/os_solaris.cpp
3+
@@ -168,12 +168,6 @@
4+
5+
os::Solaris::pthread_setname_np_func_t os::Solaris::_pthread_setname_np = NULL;
6+
7+
-// "default" initializers for missing libc APIs
8+
-extern "C" {
9+
- int memcntl(caddr_t, size_t, int, caddr_t, int, int);
10+
- int meminfo(const uint64_t *, int, const uint_t *, int, uint64_t *, uint_t *);
11+
-}
12+
-
13+
// "default" initializers for pthread-based synchronization
14+
extern "C" {
15+
static int pthread_mutex_default_init(mutex_t *mx, int scope, void *arg) { memset(mx, 0, sizeof(mutex_t)); return 0; }
16+
@@ -2242,7 +2236,7 @@
17+
mpss_struct.mha_pagesize = align;
18+
mpss_struct.mha_flags = 0;
19+
// Upon successful completion, memcntl() returns 0
20+
- if (memcntl(start, bytes, MC_HAT_ADVISE, (caddr_t) &mpss_struct, 0, 0)) {
21+
+ if (memcntl(start, bytes, MC_HAT_ADVISE, (void*) &mpss_struct, 0, 0)) {
22+
debug_only(warning("Attempt to use MPSS failed."));
23+
return false;
24+
}

0 commit comments

Comments
 (0)