OpenJDK 11.0.2 cannot build on Solaris 11.4

Erik Joelsson erik.joelsson at oracle.com
Fri Jan 18 17:23:36 UTC 2019


Hello Rob,

On 2019-01-17 13:57, Rob Petti wrote:
> Hey Folks,
>
> I've discovered that OpenJDK 11 cannot be built on Solaris 11.4. Normally
> we would just try to rebuild our system as 11.1, but that's not possible
> since media for that base release is no longer available.
>
> Are there plans to support compilation on Oracle's latest and greatest, or
> at least provide a proper method of building in such an environment?

I can't speak for all OpenJDK contributors, but Oracle has no current 
plans for this. We are required to build on the oldest supported Solaris 
version to produce binaries that are compatible with that version. We do 
not produce different binaries for different versions of an OS. Also, as 
I understand it, Oracle is no longer involved in open support of 11u. 
Perhaps the new maintainer will accept contributions for fixing the issue.

> For the record, here are the errors I'm getting. This is with solarisstudio
> 12.4 (which BTW wouldn't install on Solaris 11.4 without unfreezing the
> python version):
>
> # bash configure --with-boot-jdk=<path to jdk10>
> --with-devkit=/opt/solarisstudio12.4
> # gmake bootcycle-images
> ...
> Compiling 163 files for jdk.jfr
> "/root/jdk11/jdk11u/src/hotspot/os/solaris/os_solaris.cpp", line 1580:
> Error: EM_486 is not defined.
> "/root/jdk11/jdk11u/src/hotspot/os/solaris/os_solaris.cpp", line 1618:
> Error: The type "const arch_t[]" is incomplete.
> 2 Error(s) detected.
> gmake[3]: *** [lib/CompileJvm.gmk:151:
> /root/jdk11/jdk11u/build/solaris-sparcv9-normal-server-release/hotspot/variant-server/libjvm/objs/os_solaris.o]
> Error 2
>
> After patching with http://robpetti.com/files/jdk11-sol114.patch to fix
> https://bugs.openjdk.java.net/browse/JDK-8182035, it gets a bit further,
> but still fails:
>
> Compiling 64 files for jdk.jconsole
> "/opt/solarisstudio12.4/lib/compilers/include/CC/stlport4/stl/_stdio_file.h",
> line 161: Error: __pad is not a member of const __FILE.
> "/opt/solarisstudio12.4/lib/compilers/include/CC/stlport4/stl/_stdio_file.h",
> line 163: Error: __pad is not a member of const __FILE.
> "/opt/solarisstudio12.4/lib/compilers/include/CC/stlport4/stl/_stdio_file.h",
> line 165: Error: __pad is not a member of const __FILE.
> "/opt/solarisstudio12.4/lib/compilers/include/CC/stlport4/stl/_stdio_file.h",
> line 165: Error: __pad is not a member of const __FILE.
> "/opt/solarisstudio12.4/lib/compilers/include/CC/stlport4/stl/_stdio_file.h",
> line 167: Error: __pad is not a member of const __FILE.
> "/opt/solarisstudio12.4/lib/compilers/include/CC/stlport4/stl/_stdio_file.h",
> line 170: Error: __pad is not a member of __FILE.
> "/opt/solarisstudio12.4/lib/compilers/include/CC/stlport4/stl/_stdio_file.h",
> line 170: Error: __pad is not a member of __FILE.
> "/opt/solarisstudio12.4/lib/compilers/include/CC/stlport4/stl/_stdio_file.h",
> line 172: Error: __pad is not a member of __FILE.
> "/opt/solarisstudio12.4/lib/compilers/include/CC/stlport4/stl/_stdio_file.h",
> line 172: Error: __pad is not a member of __FILE.
> "/opt/solarisstudio12.4/lib/compilers/include/CC/stlport4/stl/_stdio_file.h",
> line 174: Error: __pad is not a member of __FILE.
> "/opt/solarisstudio12.4/lib/compilers/include/CC/stlport4/stl/_stdio_file.h",
> line 174: Error: __pad is not a member of __FILE.
> "/opt/solarisstudio12.4/lib/compilers/include/CC/stlport4/stl/_stdio_file.h",
> line 176: Error: __pad is not a member of __FILE.
> "/opt/solarisstudio12.4/lib/compilers/include/CC/stlport4/stl/_stdio_file.h",
> line 176: Error: __pad is not a member of __FILE.
> "/opt/solarisstudio12.4/lib/compilers/include/CC/stlport4/stl/_stdio_file.h",
> line 178: Error: __pad is not a member of __FILE.
> "/opt/solarisstudio12.4/lib/compilers/include/CC/stlport4/stl/_stdio_file.h",
> line 178: Error: __pad is not a member of __FILE.
> "/opt/solarisstudio12.4/lib/compilers/include/CC/stlport4/stl/_stdio_file.h",
> line 182: Error: __pad is not a member of __FILE.
> "/opt/solarisstudio12.4/lib/compilers/include/CC/stlport4/stl/_stdio_file.h",
> line 183: Error: __pad is not a member of __FILE.
> "/opt/solarisstudio12.4/lib/compilers/include/CC/stlport4/stl/_stdio_file.h",
> line 184: Error: __pad is not a member of __FILE.
> 18 Error(s) detected.
>
> It seems the "right" way to do this would be to create a sysroot with older
> 11.1 headers and libraries, and compile against that. Unfortunately the
> --with-sysroot configure option does not completely work correctly. The
> compiler still tries to include /usr/include instead of the sysroot
> headers, and that just results in more build errors. The only way it seems
> to truly get it to use the sysroot was to physically replace /usr/include
> on the machine with the version from the sysroot. This is obviously less
> than ideal.
We have tried to get sysroot working on Solaris, and we are using it 
internally, against the recommendation of the Solaris team. It's not 
working perfectly though. According to the Solaris team, Solaris Studio 
does not support the concept of a sysroot. Their recommendation is to 
create zones with the OS version you need and build in those, which I 
find incredibly annoying. 11u should build fine on either 11.2 or 11.3 
though.
> Is the --with-sysroot issue already known? Is there any other way around it
> aside from manually replacing headers in the system just to compile the JDK?
>
For includes, I thought we had sysroot working pretty OK at this point. 
We use -I-xbuiltin to fool CC into thinking our $SYSROOT/usr/include is 
the actual /usr/include. Though, I have only tried it and seen it work 
with certain combinations of host OS versions and sysroots, and 11.4 is 
not in that list.

You could try the open/make/devkit/createSolarisDevkit12.4.sh script and 
see if that helps you build something that works better. That's what we 
use at Oracle.

/Erik




More information about the build-dev mailing list