-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
Description
Describe GraalVM and your environment :
- GraalVM version: master, 998163d
- CE
- Build Time or run time failure: build time
- JDK version: 11.0.6+10
$ java -version
openjdk version "11.0.6" 2020-01-14
OpenJDK Runtime Environment 18.9 (build 11.0.6+10)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.6+10, mixed mode)
I've got latest OpenJDK 11.0.6+10 release retrieved from the upstream project[1]. It would be nice if there was a supported way to use a built-from-source JDK to build graal ce with native-image. Currently I'm getting this:
Building GraalVM with native-image in /disk/graal/upstream-sources/graal/sdk/mxbuild/linux-amd64/GRAALVM_LIBGRAAL_JAVA11_BNATIVE-IMAGE_BNATIVE-IMAGE-CONFIGURE_LLP_MJDKSL_NI_NIC_NIL_NJU_SJVMCICOMPILER_SNATIVE-IMAGE-AGENT/graalvm-libgraal-java11-20.1.0-dev
build: Checking SubstrateVM requirements for building ...
Could not find any unresolved JVM_* symbols in static JDK libraries
Here is my build script:
$ OPENJDK="/path/to/openjdk-11.0.6+10"
$ MX="/path/to/mx --java-home=$OPENJDK"
$ rm -rf substratevm/svmbuild
$ pushd substratevm
$ cat > HelloWorld.java <<EOF
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}
EOF
$ JAVAC="$OPENJDK/bin/javac"
$ $JAVAC HelloWorld.java
$ $MX clean
[...]
$ $MX native-image -H:+ReportExceptionStackTraces HelloWorld testme-helloworld
[...]
Building GraalVM with native-image in /somepath/GRAALVM_LIBGRAAL_JAVA11_BNATIVE-IMAGE_BNATIVE-IMAGE-CONFIGURE_LLP_MJDKSL_NI_NIC_NIL_NJU_SJVMCICOMPILER_SNATIVE-IMAGE-AGENT/graalvm-libgraal-java11-20.1.0-dev
build: Checking SubstrateVM requirements for building ...
Could not find any unresolved JVM_* symbols in static JDK libraries
One needs to get a JDK 11 from [2], but that's a black box and Graal CE should support a clean build-from-source bootstrap approach.
[1] https://adoptopenjdk.net/upstream.html?variant=openjdk11&jvmVariant=hotspot
[2] https://github.com/graalvm/labs-openjdk-11/releases
mirabilos and OlegPliss