Skip to content

Commit fbb750c

Browse files
committed
OpenJDK - initial work
1 parent 05e56e4 commit fbb750c

File tree

276 files changed

+117720
-0
lines changed

Some content is hidden

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

276 files changed

+117720
-0
lines changed

OracleSolaris_OpenJDK/README.md

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# OracleSolaris OpenJDK
2+
3+
This project builds all OpenJDK versions from 9 till latest 17 for Solaris 11.4.
4+
5+
At this time only amd64 platform is expected to work (not SPARC).
6+
7+
You just need to have:
8+
- Oracle Solaris 11.4 (at least S11.4.24) with installed system header files
9+
- Mercurial
10+
- Git
11+
- JDK 8
12+
- GCC 10
13+
- Internet access for OpenJDK repositories
14+
15+
Alternatively you can use your OpenJDK repository mirrors and set them via
16+
environment variables JDK_REPO (for http://hg.openjdk.java.net/jdk-updates)
17+
and JDK_GITHUB_REPO (for JDK_GITHUB_REPO=https://github.com/openjdk).
18+
You will need both.
19+
20+
21+
Example:
22+
23+
git clone https://github.com/oracle/oraclesolaris-contrib.git
24+
cd oraclesolaris-contrib/OracleSolaris_OpenJDK/
25+
./build-all.sh
26+
Building Openjdk 9...
27+
Building Openjdk 10...
28+
Building Openjdk 11...
29+
Building Openjdk 12...
30+
Building Openjdk 13...
31+
Building Openjdk 14...
32+
Building Openjdk 16...
33+
Building Openjdk 17...
34+
Building Openjdk 18...
35+
36+
--
37+
38+
After the build you should inspect build_dir/ for your OpenJDK binaries.
39+
40+
Your build log files will be available in logs/ directory.

OracleSolaris_OpenJDK/build-all.sh

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
WS="`pwd`"
4+
LOG_DIR="$WS/logs"
5+
rm -rf $LOG_DIR
6+
mkdir -p $LOG_DIR
7+
8+
for VERSION in {9..17}; do
9+
echo "Building Openjdk $VERSION..."
10+
bash $WS/jdk-$VERSION.sh > $LOG_DIR/jdk-$VERSION.log 2>&1
11+
12+
# Check for expected sucesful build output.
13+
tail -1 $LOG_DIR/jdk-$VERSION.log \
14+
| grep "Finished building target \'bundles\' in configuration " > /dev/null
15+
if [ $? -ne 0 ] ; then
16+
echo "Build error. See: $LOG_DIR/jdk-$VERSION.log"
17+
exit 1
18+
fi
19+
done

OracleSolaris_OpenJDK/common.sh

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
WS="`pwd`"
2+
BUILD_DIR="$WS/build_dir"
3+
4+
if [ $VERSION -lt 16 ]; then
5+
SRC_DIR="jdk${VERSION}u"
6+
else
7+
SRC_DIR="jdk${VERSION}"
8+
fi
9+
10+
if [ `uname -p` = 'sparc' ] ; then
11+
JDK_PLATFORM="sparcv9"
12+
else
13+
JDK_PLATFORM="x86_64"
14+
fi
15+
16+
STUDIO="/opt/solarisstudio12.4/bin"
17+
18+
GCC=/usr/gcc/10/bin/gcc
19+
GXX=/usr/gcc/10/bin/g++
20+
21+
mkdir -p "$BUILD_DIR"
22+
rm -rf "$BUILD_DIR"/$SRC_DIR
23+
test -z $JDK_REPO && JDK_REPO=http://hg.openjdk.java.net/jdk-updates
24+
test -z $JDK_GITHUB_REPO && JDK_GITHUB_REPO=https://github.com/openjdk
25+
26+
function apply_patch_series {
27+
cat "$WS/patches-$VERSION/series" | while read patch args; do
28+
echo $patch | grep ^\# > /dev/null && continue
29+
gpatch --batch --forward --strip=1 $args -i "$WS/patches-$VERSION/$patch"
30+
done
31+
}

OracleSolaris_OpenJDK/jdk-10.sh

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
set -xe
2+
3+
VERSION=10
4+
5+
. common.sh
6+
7+
# S11.4.21 have updated CUPS version which causes problem to old Studio compiler
8+
function fix_cups_versioning {
9+
test `uname -v | cut -d . -f 3` -lt 21 && return
10+
gsed 's;_CUPS_NONNULL(...);_CUPS_NONNULL();' /usr/include/cups/versioning.h > my-cups-versioning.h
11+
FILE=CUPSfuncs.c
12+
for f in jdk/src/java.desktop/unix/native/common/awt/$FILE src/java.desktop/unix/native/common/awt/$FILE; do
13+
[ ! -f "$f" ] || gsed -i "/#include <dlfcn.h>/a#include \"`pwd`/my-cups-versioning.h\"" "$f"
14+
done
15+
}
16+
17+
BOOT_JDK="$BUILD_DIR/jdk9u/build/solaris-$JDK_PLATFORM-normal-server-release/jdk"
18+
PATH="$STUDIO:/usr/bin"
19+
20+
CONFIGURE_OPTIONS+=" --with-boot-jdk=$BOOT_JDK"
21+
22+
hg clone ${JDK_REPO}/$SRC_DIR "$BUILD_DIR"/$SRC_DIR
23+
cd "$BUILD_DIR"/$SRC_DIR
24+
25+
fix_cups_versioning
26+
apply_patch_series
27+
28+
PATH="$PATH" bash ./configure ${CONFIGURE_OPTIONS}
29+
gmake bundles

OracleSolaris_OpenJDK/jdk-11.sh

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
set -xe
2+
3+
VERSION=11
4+
5+
. common.sh
6+
7+
BOOT_JDK="$BUILD_DIR/jdk10u/build/solaris-$JDK_PLATFORM-normal-server-release/jdk"
8+
PATH="$STUDIO:/usr/bin"
9+
10+
CONFIGURE_OPTIONS+=" --with-boot-jdk=$BOOT_JDK"
11+
12+
hg clone ${JDK_REPO}/$SRC_DIR "$BUILD_DIR"/$SRC_DIR
13+
cd "$BUILD_DIR"/$SRC_DIR
14+
15+
apply_patch_series
16+
17+
PATH="$PATH" bash ./configure ${CONFIGURE_OPTIONS}
18+
gmake bundles

OracleSolaris_OpenJDK/jdk-12.sh

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
set -xe
2+
3+
VERSION=12
4+
5+
. common.sh
6+
7+
BOOT_JDK="$BUILD_DIR/jdk11u/build/solaris-$JDK_PLATFORM-normal-server-release/jdk"
8+
PATH="$STUDIO:/usr/bin"
9+
10+
CONFIGURE_OPTIONS+=" --with-boot-jdk=$BOOT_JDK"
11+
12+
# OpenJDK 12 has some issues:
13+
# - https://bugs.openjdk.java.net/browse/JDK-8211081
14+
# - shenandoahgc doesn't build on Solaris i386 (and is not supported on sparc)
15+
CONFIGURE_OPTIONS+=" --with-jvm-features=-shenandoahgc"
16+
CONFIGURE_OPTIONS+=" --disable-warnings-as-errors"
17+
18+
hg clone ${JDK_REPO}/$SRC_DIR "$BUILD_DIR"/$SRC_DIR
19+
cd "$BUILD_DIR"/$SRC_DIR
20+
21+
apply_patch_series
22+
23+
PATH="$PATH" bash ./configure ${CONFIGURE_OPTIONS}
24+
gmake bundles

OracleSolaris_OpenJDK/jdk-13.sh

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
set -xe
2+
3+
VERSION=13
4+
5+
. common.sh
6+
7+
BOOT_JDK="$BUILD_DIR/jdk12u/build/solaris-$JDK_PLATFORM-server-release/jdk"
8+
PATH="/usr/bin:/usr/gnu/bin"
9+
10+
CONFIGURE_OPTIONS+=" --enable-unlimited-crypto"
11+
CONFIGURE_OPTIONS+=" --with-boot-jdk=$BOOT_JDK"
12+
CONFIGURE_OPTIONS+=" --with-native-debug-symbols=none"
13+
CONFIGURE_OPTIONS+=" --with-toolchain-type=gcc"
14+
CONFIGURE_OPTIONS+=" --disable-hotspot-gtest"
15+
CONFIGURE_OPTIONS+=" --disable-dtrace"
16+
CONFIGURE_OPTIONS+=" --disable-warnings-as-errors"
17+
CONFIGURE_OPTIONS+=" AS=/usr/gnu/bin/as"
18+
CONFIGURE_OPTIONS+=" CC=$GCC"
19+
CONFIGURE_OPTIONS+=" CXX=$GXX"
20+
21+
hg clone ${JDK_REPO}/$SRC_DIR "$BUILD_DIR"/$SRC_DIR
22+
cd "$BUILD_DIR"/$SRC_DIR
23+
24+
apply_patch_series
25+
26+
PATH="$PATH" bash ./configure ${CONFIGURE_OPTIONS}
27+
gmake bundles

OracleSolaris_OpenJDK/jdk-14.sh

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
set -xe
2+
3+
VERSION=14
4+
5+
. common.sh
6+
7+
BOOT_JDK="$BUILD_DIR/jdk13u/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+
hg clone ${JDK_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

OracleSolaris_OpenJDK/jdk-15.sh

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
set -xe
2+
3+
VERSION=15
4+
5+
. common.sh
6+
7+
BOOT_JDK="$BUILD_DIR/jdk14u/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+
hg clone ${JDK_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

OracleSolaris_OpenJDK/jdk-16.sh

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
set -xe
2+
3+
VERSION=16
4+
5+
. common.sh
6+
7+
BOOT_JDK="$BUILD_DIR/jdk15u/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

OracleSolaris_OpenJDK/jdk-17.sh

+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

OracleSolaris_OpenJDK/jdk-9.sh

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
set -xe
2+
3+
VERSION=9
4+
5+
. common.sh
6+
7+
# S11.4.21 have updated CUPS version which causes problem to old Studio compiler
8+
function fix_cups_versioning {
9+
test `uname -v | cut -d . -f 3` -lt 21 && return
10+
gsed 's;_CUPS_NONNULL(...);_CUPS_NONNULL();' /usr/include/cups/versioning.h > my-cups-versioning.h
11+
FILE=CUPSfuncs.c
12+
for f in jdk/src/java.desktop/unix/native/common/awt/$FILE src/java.desktop/unix/native/common/awt/$FILE; do
13+
[ ! -f "$f" ] || gsed -i "/#include <dlfcn.h>/a#include \"`pwd`/my-cups-versioning.h\"" "$f"
14+
done
15+
}
16+
17+
BOOT_JDK="/usr/jdk/instances/jdk1.8.0"
18+
PATH="$STUDIO:/usr/bin"
19+
20+
CONFIGURE_OPTIONS+=" --with-boot-jdk=$BOOT_JDK"
21+
22+
hg clone ${JDK_REPO}/$SRC_DIR "$BUILD_DIR"/$SRC_DIR
23+
cd "$BUILD_DIR"/$SRC_DIR
24+
25+
# JDK 9 uses script to download nested repositories
26+
bash get_source.sh
27+
28+
fix_cups_versioning
29+
apply_patch_series
30+
31+
PATH="$PATH" bash ./configure ${CONFIGURE_OPTIONS}
32+
gmake bundles
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--- src/hotspot/os/solaris/os_solaris.cpp
2+
+++ src/hotspot/os/solaris/os_solaris.cpp
3+
@@ -1663,7 +1663,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,13 @@
1+
S11.4.24 renamed TRAPNO to REG32_TRAPNO.
2+
3+
--- src/hotspot/os_cpu/solaris_x86/os_solaris_x86.cpp
4+
+++ src/hotspot/os_cpu/solaris_x86/os_solaris_x86.cpp
5+
@@ -620,7 +620,7 @@
6+
// Furthermore, a false-positive should be harmless.
7+
if (UnguardOnExecutionViolation > 0 &&
8+
(sig == SIGSEGV || sig == SIGBUS) &&
9+
- uc->uc_mcontext.gregs[TRAPNO] == T_PGFLT) { // page fault
10+
+ uc->uc_mcontext.gregs[REG32_TRAPNO] == T_PGFLT) { // page fault
11+
int page_size = os::vm_page_size();
12+
address addr = (address) info->si_addr;
13+
address pc = (address) uc->uc_mcontext.gregs[REG_PC];
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
--- src/java.base/solaris/native/libnio/ch/DevPollArrayWrapper.c
2+
+++ src/java.base/solaris/native/libnio/ch/DevPollArrayWrapper.c
3+
@@ -36,7 +36,6 @@
4+
extern "C" {
5+
#endif
6+
7+
-typedef uint32_t caddr32_t;
8+
9+
/* /dev/poll ioctl */
10+
#define DPIOC (0xD0 << 8)
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Solaris11-EM_486.patch -p0
2+
Solaris11-TRAPNO.patch -p0
3+
Solaris11-caddr32.patch -p0
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--- src/hotspot/os/solaris/os_solaris.cpp
2+
+++ src/hotspot/os/solaris/os_solaris.cpp
3+
@@ -1663,7 +1663,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"},

0 commit comments

Comments
 (0)