ibmruntimes / openj9-openjdk-jdk8

Extensions for OpenJDK8 for Eclipse OpenJ9
GNU General Public License v2.0
53 stars 115 forks source link

AO8/J9 s390x builds do not work out of the box #23

Closed sxa closed 6 years ago

sxa commented 6 years ago

I presume this is somewhere around the redirector.c code within openj9

if you download the s390x AO8/J9 builds from www.AdoptOpenJDK.net and try to run it you get this error:

jcktest@csz25074:/dev/shm/jdk8u152-b16/bin$ ./java -version
Error: missing `server' JVM at `/dev/shm/jdk8u152-b16/jre/lib/s390x/server/libjvm.so'.
Please install or use the JRE or JDK that contains these missing components.
jcktest@csz25074:/dev/shm/jdk8u152-b16/bin$ 

Creating a symbolic link from jre/lib/s390x/server to jre/lib/s390x/j9vm allows the JVM to start up, so somewhere along the lines in the build it's still looking for libjvm.so in HotSpot's location.

pshipton commented 6 years ago

Its caused by the jvm.cfg file, which needs to contain

-j9vm KNOWN
-server IGNORE
sxa commented 6 years ago

The one in jdk/src/solaris/bin/s390x looks correct, but that isn't the one that's in the final distribution

sxa commented 6 years ago

I think this is because default (non-OpenJ9) build on s390x is zero not server, which means JVMCFG_ARCH in CopyFiles.gmk ends up as zero instead of s390x so it doesn't copy the correct file. @pshipton I'm not sure where the fix for this needs to be. I'm happy to do it, but want it in the "correct" repo wherever that is.

We could just modify the zero/jvm.cfg in this repository to include the j9vm options for now, since that's what we'll always be building but that doesn't feel ideal. The other option would be to add extra logic into jdk/make/CopyFiles.gmk (Or can it be done using a change in jdk/make/CopyFiles.gmk?)

pshipton commented 6 years ago

Strangely when we do builds they don't have the same issue, it picks up a jvm.cfg with -j9vm KNOWN and the build runs. We don't seem to be doing any special i.e. bash ./configure --with-boot-jdk=/sdk/openjdk7/linux_390-64_cmprssptrs --enable-cuda --with-freemarker-jar=/tools/freemarker-2.3.8/lib/freemarker.jar && make images.

We don't want to have modifications to OpenJDK so modifying jdk/make/CopyFiles.gmk is not ideal, unless the modifications can be contributed to OpenJDK.

sxa commented 6 years ago

Agreed - so my PR does what we've done for the other platforms -modify the jvm.cfg that is copied so that it copies the "correct" one that the build system is trying to pick up. Of course it might be sensible to delete the s390x on to avoid confusion, but if it works in some environments that may not be the sensible solution.

Is it definitely working for you on openjdk8 (as opposed to openjdk9?)

pshipton commented 6 years ago

Is it definitely working for you on openjdk8 (as opposed to openjdk9?)

Yes.

openjdk version "1.8.0-internal"
OpenJDK Runtime Environment (build 1.8.0-internal-openj9_2018_01_10_03_06-b00)
Eclipse OpenJ9 VM (build 2.9, JRE 1.8.0 Linux s390x-64 Compressed References 20180110_375557 (JIT enabled, AOT enabled)
OpenJ9   - f1ccd6b
OMR      - 7a770d6
OpenJDK  - 00e69f9 based on Java8_SR5_FP7_20171215_1234_B373586)
pshipton commented 6 years ago

Note OpenJDK - 00e69f9 based on Java8_SR5_FP7_20171215_1234_B373586 is a bug, see #22

DanHeidinga commented 6 years ago

JVMCFG_ARCH in CopyFiles.gmk ends up as zero instead of s390x

Is there a way to control the default such that our existing changes to the closed/ directory can ensure the OpenJ9 build uses s390x?

sxa commented 6 years ago

I'm not sure there's an easy way without modifying the common files in the AdoptOpenJDK repositories, but if you know of one (I'm not an expert in the openjdk build system) that would likely be preferable. If JVM_VARIANTS can be overridden to have SERVER in there then that would presumably work (although I can't comment on side effects of that approach ...)

sxa commented 6 years ago

OK so makejdk-any-platform.sh in the openjdk-build repo is what sets JVM_VARIANT to zero on s390x.

sxa commented 6 years ago

OK I believe the PR I've just submitted to openjdk-build will resolve this in a more satisfactory way assuming it doesn't have any side effects. Assuming that fix is ok we won't need this PR

sxa commented 6 years ago

Merged and I've kicked off a new bulid so hopefully we'll have a good nightly build available in the next couple of hours

sxa commented 6 years ago

Fixed in https://github.com/AdoptOpenJDK/openjdk8-openj9-nightly/releases/download/jdk8u152-b16-20181001/OpenJDK8-OPENJ9_s390x_Linux_20181001.tar.gz and later builds. Closing