Friday, September 07, 2018

Building OpenJDK 10 on Solaris 11 x86_64

Well, as we all know Oracle are not allowing the release a binary version of Java 9,10 and may be 11 on Oracle Solaris x64 at this time (SPARC version downloadable). We can all guess why but I hope that they will release a x86 version soon.

Anyway, if you want to keep up with everyone else you can build the OpenJDK version. It builds under Oracle Solaris x64 and SPARC (saying that having problem with SPARC version at this time). Full build information is here
  • At this time you require Oracle Solaris Studio 12.4 and other versions will not work at this time, but again hopefully soon.
  • DO not build on a NFS drive, since will be very slow. 
  • UPDATE: 17/01/2019
    • Tested: new kernel zone running Solaris
    • virtual-cpu=8 & memory=12G
# cd /usr/tmp 
# pkg install developer/versioning/mercurial build/automake build/make \
java/jdk-8 assembler gnu-binutils x11/library/libxtst \
x11/library/libxcb x11/library/libxext x11/library/libxrender \
x11/library/toolkit/libxt print/cups build/pkg-config \
developer/gcc/gcc-c-7 developer/gcc/gcc-gobjc-7 developer/gcc-7 \
system/library/gcc/gcc-c-runtime-7 system/library/gcc/gcc-c-runtime \
library/mmheap build/autoconf

# export PATH=/opt/developerstudio124/bin:/usr/bin:/usr/sbin:/usr/gnu/bin:/usr/sfw/bin  
# cc -V
cc: Sun C 5.13 SunOS_i386 2014/10/20
# hg clone   
# cd jdk10   

# bash  
# Repositories: corba jaxp jaxws langtools jdk hotspot nashorn  
          jaxp:  hg clone jaxp  
         corba:  hg clone corba  
             .:  no changes found  
       nashorn:  no changes found  
           jdk:  no changes found  
       hotspot:  no changes found  
# bash configure   # Complete output if you want to check
configure: Configuration created at Thu Jan 17 15:20:42 GMT 2019.
configure: configure script generated at timestamp 1504441177.
checking for basename... /usr/bin/basename
checking for bash... /usr/bin/bash    
The existing configuration has been successfully updated in  
using default settings.  
Configuration summary:
* Debug level:    release
* HS debug level: product
* JDK variant:    normal
* JVM variants:   server
* OpenJDK target: OS: solaris, CPU architecture: x86, address length: 64
* Version string: 10-internal+0-adhoc.andrew.jdk10 (10-internal)

Tools summary:
* Boot JDK:       java version "1.8.0_181" Java(TM) SE Runtime Environment (build 1.8.0_181-b12) Java HotSpot(TM) 64-Bit Server VM (build 25.181-b12, mixed mode)  (at /usr/jdk/instances/jdk1.8.0)
* Toolchain:      solstudio (Oracle Solaris Studio)
* C Compiler:     Version 5.13 (at /opt/developerstudio124/bin/cc)
* C++ Compiler:   Version 5.13 (at /opt/developerstudio124/bin/CC)

Build performance summary:
* Cores to use:   8
* Memory limit:   12286 MB

# gmake clean
# gmake  # Complete output if you want to check
Building target 'default (exploded-image)' in configuration 'solaris-x86_64-normal-server-release'  
Creating support/modules_libs/java.base/ from 1 file(s)  
Compiling 8 files for BUILD_TOOLS_LANGTOOLS  
Creating hotspot/variant-server/tools/adlc/adlc from 13 file(s)  
Compiling 2 files for BUILD_JVMTI_TOOLS  
Creating support/modules_cmds/jdk.xml.bind/schemagen from 1 file(s)
Creating support/modules_cmds/jdk.xml.bind/xjc from 1 file(s)
Creating support/modules_cmds/ from 1 file(s)
Creating support/modules_cmds/ from 1 file(s)
/usr/bin/gobjcopy: /var/tmp/jdk10/build/solaris-x86_64-normal-server-release/support/modules_cmds/jdk.pack/unpack200.debuginfo: section .exception_ranges lma 0x51b620 adjusted to 0x51d0f0
Compiling 4 files for BUILD_JIGSAW_TOOLS
Stopping sjavac server
Finished building target 'default (exploded-image)' in configuration 'solaris-x86_64-normal-server-release'

# gmake images   # Complete output if you want to check  
Building target 'images' in configuration 'solaris-x86_64-normal-server-release'
Compiling 31 files for BUILD_JRTFS
Creating support/modules_libs/java.base/jrt-fs.jar
Updating support/
Updating images/
Creating support/classlist.jar
Creating images/jmods/jdk.jlink.jmod
Creating images/jmods/java.base.jmod
Creating jre jimage
Creating jdk jimage
WARNING: Using incubator modules: jdk.incubator.httpclient
WARNING: Using incubator modules: jdk.incubator.httpclient
Stopping sjavac server
Finished building target 'images' in configuration 'solaris-x86_64-normal-server-release'

# ./build/*/images/jdk/bin/java -version  
openjdk version "10-internal"
OpenJDK Runtime Environment (build 10-internal+0-adhoc.andrew.jdk10)
OpenJDK 64-Bit Server VM (build 10-internal+0-adhoc.andrew.jdk10, mixed mode)  

I will hopeful post updates on OpenJDK 11 later.

Formatting: I now use for code formatting.

No comments: