Skip to content

Commit 588c0e4

Browse files
committed
Adds support for --build-from= --boot-jdk= and creates OpenJDK 13 bootstrap archive.
1 parent 50d63fb commit 588c0e4

File tree

16 files changed

+97
-16
lines changed

16 files changed

+97
-16
lines changed

README.md

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Oracle Solaris OpenJDK Builder
22

3-
This project builds all OpenJDK versions from 9 till latest 17 for Solaris 11.4.
3+
This project builds all OpenJDK versions from 9 till latest 19 for Solaris 11.4.
44

55
Note that this was done based on great job of Peter Tribble:
66
https://ptribble.blogspot.com/2021/12/keeping-java-alive-on-illumos.html
@@ -10,9 +10,9 @@ At this time only amd64 platform is expected to work (not SPARC).
1010
You just need to have:
1111
- Oracle Solaris 11.4 (at least S11.4.24) with installed system header files
1212
- Git
13-
- JDK 8
13+
- JDK 8 [1]
1414
- GCC 10
15-
- Solaris Studio 12.4 (latest supported version! Release version isn't enough)
15+
- Solaris Studio 12.4 (latest supported version! Release version isn't enough) [1]
1616
- Internet access for OpenJDK repositories
1717

1818
Alternatively you can use your OpenJDK repository mirror and set it via
@@ -51,3 +51,35 @@ After the build you should inspect build_dir/ for your OpenJDK binaries.
5151
Your build log files will be available in logs/ directory.
5252

5353
You can use then archives.sh script which will create tar archives.
54+
55+
Note also archives-bootstrap.sh which currently creates minimal archive
56+
with OpenJDK 13 for bootstraping (can be used for version 13 and 14).
57+
This might be needed if you don't have required version of Studio
58+
compiler).
59+
60+
openjdk-13.0.11-bootstrap_SunOS-i386_bin.tar.xz should be available for
61+
download. The minimal OS version is Solaris 11.4 CBE release [2].
62+
63+
--
64+
65+
You can also build only newer OpenJDK versions. E.g. when you previously
66+
built older version and have them ready in your `build_dir` for
67+
bootstaping (at least when you have previous version).
68+
69+
70+
```
71+
./build-all.sh --build-from=17
72+
```
73+
74+
Alternately you can use your own bootstrap version.
75+
76+
```
77+
./build-all.sh --build-from=13 --boot-jdk=/export/home/build/jdk-13-bootstrap
78+
```
79+
80+
--
81+
82+
[1] JDK 8 is needed only for OpenJDK 9. Solaris Studio is needed only for
83+
OpenJDK 9, 10, 11 and 12. See example with `--build-from=[NUM]`.
84+
85+
[2] https://blogs.oracle.com/solaris/post/building-open-source-software-on-oracle-solaris-114-cbe-release

archives-bootstrap.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
3+
WS="`pwd`"
4+
ARCHIVE_DIR="$WS/archives"
5+
mkdir -p $ARCHIVE_DIR
6+
7+
if [ `uname -p` = 'sparc' ] ; then
8+
JDK_PLATFORM="sparcv9"
9+
else
10+
JDK_PLATFORM="x86_64"
11+
fi
12+
13+
for VERSION in 13; do
14+
if [ $VERSION -lt 12 ] ; then
15+
JAVADIR="./build_dir/jdk${VERSION}u/build/solaris-$JDK_PLATFORM-normal-server-release/jdk"
16+
else
17+
JAVADIR="./build_dir/jdk${VERSION}u/build/solaris-$JDK_PLATFORM-server-release/jdk"
18+
fi
19+
test -x "$JAVADIR/bin/java" || continue
20+
VERS=`"$JAVADIR/bin/java" --version | head -1 | gsed 's;-internal;-bootstrap;' | awk '{ print $1 "-" $2 }'`
21+
VERS="${VERS}_`uname -s`-`uname -p`_bin"
22+
echo "Creating archive $ARCHIVE_DIR/$VERS.tar.xz"
23+
gtar cfhJ "$ARCHIVE_DIR/$VERS.tar.xz" "$JAVADIR" --transform "s;$JAVADIR;jdk-$VERSION-bootstrap;"
24+
done

archives.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ WS="`pwd`"
44
ARCHIVE_DIR="$WS/archives"
55
mkdir -p $ARCHIVE_DIR
66

7-
. common.sh
7+
if [ `uname -p` = 'sparc' ] ; then
8+
JDK_PLATFORM="sparcv9"
9+
else
10+
JDK_PLATFORM="x86_64"
11+
fi
812

913
for VERSION in {9..19}; do
1014
if [ $VERSION -lt 12 ] ; then

build-all.sh

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,31 @@ LOG_DIR="$WS/logs"
55
rm -rf $LOG_DIR
66
mkdir -p $LOG_DIR
77

8+
BUILD_FROM_VER=0
9+
10+
for i in "$@"; do
11+
case "$i" in
12+
--build-from=*)
13+
BUILD_FROM_VER=$((0+"${i#*=}"))
14+
;;
15+
--boot-jdk=*)
16+
BOOT_JDK="${i#*=}"
17+
;;
18+
esac
19+
done
20+
821
for VERSION in {9..19}; do
22+
23+
if [ $VERSION -lt $BUILD_FROM_VER ] ; then
24+
echo "Skipping Openjdk $VERSION build."
25+
continue
26+
fi
27+
928
echo "Building Openjdk $VERSION..."
10-
bash $WS/jdk-$VERSION.sh > $LOG_DIR/jdk-$VERSION.log 2>&1
29+
BOOT_JDK="$BOOT_JDK" bash $WS/jdk-$VERSION.sh > $LOG_DIR/jdk-$VERSION.log 2>&1
30+
31+
# BOOT_JDK can be valid only for first version
32+
BOOT_JDK=
1133

1234
# Check for expected sucesful build output.
1335
tail -1 $LOG_DIR/jdk-$VERSION.log \

common.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@ else
88
JDK_PLATFORM="x86_64"
99
fi
1010

11+
if [ -z $BOOT_JDK ] ; then
12+
if [ $VERSION -eq 9 ] ; then
13+
BOOT_JDK="/usr/jdk/instances/jdk1.8.0"
14+
elif [ $VERSION -lt 13 ] ; then
15+
BOOT_JDK="$BUILD_DIR/jdk$(($VERSION-1))u/build/solaris-$JDK_PLATFORM-normal-server-release/jdk"
16+
else
17+
BOOT_JDK="$BUILD_DIR/jdk$(($VERSION-1))u/build/solaris-$JDK_PLATFORM-server-release/jdk"
18+
fi
19+
fi
20+
1121
TOOLS_DIR="${SRC_DIR}_tools"
1222

1323
STUDIO="/opt/solarisstudio12.4/bin"

jdk-10.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ function fix_cups_versioning {
1717
gsed -i 's;_CUPS_API_DEPRECATED(...);_CUPS_API_DEPRECATED();' my-cups-versioning.h
1818
}
1919

20-
BOOT_JDK="$BUILD_DIR/jdk9u/build/solaris-$JDK_PLATFORM-normal-server-release/jdk"
2120
PATH="$STUDIO:/usr/bin"
2221

2322
CONFIGURE_OPTIONS+=" --with-boot-jdk=$BOOT_JDK"

jdk-11.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ VERSION=11
44

55
. common.sh
66

7-
BOOT_JDK="$BUILD_DIR/jdk10u/build/solaris-$JDK_PLATFORM-normal-server-release/jdk"
87
PATH="$STUDIO:/usr/bin"
98

109
CONFIGURE_OPTIONS+=" --with-boot-jdk=$BOOT_JDK"

jdk-12.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ VERSION=12
44

55
. common.sh
66

7-
BOOT_JDK="$BUILD_DIR/jdk11u/build/solaris-$JDK_PLATFORM-normal-server-release/jdk"
87
PATH="$STUDIO:/usr/bin"
98

109
CONFIGURE_OPTIONS+=" --with-boot-jdk=$BOOT_JDK"

jdk-13.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ VERSION=13
44

55
. common.sh
66

7-
BOOT_JDK="$BUILD_DIR/jdk12u/build/solaris-$JDK_PLATFORM-server-release/jdk"
87
PATH="/usr/bin:/usr/gnu/bin"
98

109
CONFIGURE_OPTIONS+=" --enable-unlimited-crypto"

jdk-14.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ VERSION=14
44

55
. common.sh
66

7-
BOOT_JDK="$BUILD_DIR/jdk13u/build/solaris-$JDK_PLATFORM-server-release/jdk"
87
PATH="/usr/bin:/usr/gnu/bin"
98

109
CONFIGURE_OPTIONS+=" --enable-unlimited-crypto"

0 commit comments

Comments
 (0)