From vladimir.kozlov at oracle.com Tue Aug 25 16:38:56 2020 From: vladimir.kozlov at oracle.com (Vladimir Kozlov) Date: Tue, 25 Aug 2020 09:38:56 -0700 Subject: Metropolis repository was updated to JDK 15 Message-ID: <64243041-c745-8507-e872-e6374bfd7ae4@oracle.com> I just update Metropolis repository to JDK 15. And updated Graal code up to [1] to be able build libgraal with JDK 15 plus fix [2]. Thanks, Vladimir [1] [GR-24572] JDK15 java.lang.invoke.MemberName is reachable. https://github.com/oracle/graal/commit/b0735cd5fb384cfdb522488edf1d83b013507d72 [2] [GR-25120] Fixed leaked indirect java constants on jdk15. https://github.com/oracle/graal/commit/e82d1090c23493a6d665e579cacad8241ea75318 From vladimir.kozlov at oracle.com Wed Aug 26 01:43:03 2020 From: vladimir.kozlov at oracle.com (Vladimir Kozlov) Date: Tue, 25 Aug 2020 18:43:03 -0700 Subject: How to build libgraal for latest JDK (in theory) Message-ID: <937777b2-ea09-51aa-8b5b-15b81d14fcef@oracle.com> Hi, There was this question few months ago and I did not answered because it was "complicated" then and it still is. I just updated Metropolis repo to JDK 15 and build libgraal for it. So I decided share the process. But first, if you want to try libgraal - use GraalVM CE [1] which is more stable and more tested. There are Java 8 and Java 11 based GraalVM releases. They use libgraal by default and based on latest Graal sources. Back to Metropolis. The main complication is that libgraal build requires several components to be in sync: JDK libraries (Java API), Graal, SubstrateVM and JVMCI. But because GraalVM development is concentrated mostly on LTS JDK releases (8 and 11) it has issues building with latest JDK (SVM is "good" example). So you may need to apply few patches there and there which greatly complicate the process. In theory current process of building libgraal with latest JDK is next (linux-x64 only): 1. Clone mx, graal, JDK: git clone git at github.com:graalvm/mx.git git clone git at github.com:oracle/graal.git git clone git at github.com:openjdk/jdk.git 2. Set environment. - make sure the same C++ is used to build JDK and libgraal (use PATH to point compiler) - add your //mx/ to PATH 3. Build your JDK and set JAVA_HOME cd //jdk bash ./configure make jdk-image export JAVA_HOME=//jdk/build/linux-x86_64-server-release/images/jdk 4. Update your JDK to latest Graal (16 is current JDK version) and rename packages/dirs in Graal to match JDK cd //graal/compiler mx updategraalinopenjdk --pretty PRETTY --metro //jdk 16 mx renamegraalpackages 16 5. Rebuild your JDK with updated Graal and build static libraries for libgraal cd //jdk make clean make jdk-image make static-libs-image cp build/linux-x86_64-server-release/images/static-libs/lib/* build/linux-x86_64-server-release/images/jdk/lib/ 6. Build libgraal cd //graal/vm mx --env libgraal build If successful it will create copy of JDK you build with libgraal in it: //graal/sdk/mxbuild/linux-amd64/GRAALVM_LIBGRAAL_JAVA16/graalvm-libgraal-java16-20.3.0-dev/bin/java Or you can copy libgraal into your JDK: cp //graal/sdk/mxbuild/linux-amd64/libjvmcicompiler.so.image/libjvmcicompiler.so $JAVA_HOME/lib I would suggest to use GRAALVM_LIBGRAAL_JAVA16 because all JVMCI flags are product. In $JAVA_HOME you have to add -XX:+UnlockExperimentalVMOptions when use JVMCI flags since JVMCI and Graal are experimental features in JDK. ------------------------------------- Unfortunately step 6 fail currently (August 25, 2020) because JDK misses JVMCI part of 8209961 fix [2] which is used by latest Graal which already have that fix. Regards, Vladimir [1] https://github.com/graalvm/graalvm-ce-builds/releases/tag/vm-20.2.0 [2] https://bugs.openjdk.java.net/browse/JDK-8209961 From vladimir.kozlov at oracle.com Thu Aug 27 16:33:44 2020 From: vladimir.kozlov at oracle.com (Vladimir Kozlov) Date: Thu, 27 Aug 2020 09:33:44 -0700 Subject: New EA Metropolis build Message-ID: The build at the Project Metropolis Early Access page [1] has been refreshed. It was updated to JDK 15. Binaries are based on Metropolis repository [2] which was synced with jdk-15+36 (JDK 15 build 36). Graal in Metropolis is based on GraalVM CE version of Graal [3]. It was updated up to GR-24572 commit [4] and additional patch was applied [5] to enable libgraal build with JDK 15. Regards, Vladimir Kozlov [1] https://jdk.java.net/metropolis/ [2] https://github.com/openjdk/metropolis [3] https://github.com/oracle/graal [4] [GR-24572] JDK15 java.lang.invoke.MemberName is reachable. https://github.com/oracle/graal/commit/b0735cd5fb384cfdb522488edf1d83b013507d72 [5] [GR-25120] Fixed leaked indirect java constants on jdk15. https://github.com/oracle/graal/commit/e82d1090c23493a6d665e579cacad8241ea75318