How to build libgraal for latest JDK (in theory)
Vladimir Kozlov
vladimir.kozlov at oracle.com
Mon Sep 21 19:44:33 UTC 2020
Hi Roland,
Glad to hear that you able to build libgraal with JDK 15u.
To fix issue you see you need next change
substratevm/mx.substratevm/mx_substratevm.py
@@ -1350,7 +1350,7 @@ class SubstrateCompilerFlagsBuilder(mx.ArchivableProject):
return file_path
def config_file_versions(self):
- versions = [8, 11, 13, 14, 15]
+ versions = [8, 11, 13, 14, 15, 16]
if svm_java8():
return versions[:1]
return versions
@@ -1433,6 +1433,7 @@ class SubstrateCompilerFlagsBuilder(mx.ArchivableProject):
graal_compiler_flags_map[13] = graal_compiler_flags_map[11]
graal_compiler_flags_map[14] = graal_compiler_flags_map[11]
graal_compiler_flags_map[15] = graal_compiler_flags_map[11]
+ graal_compiler_flags_map[16] = graal_compiler_flags_map[11]
graal_compiler_flags_base = [
'-XX:+UseParallelGC', # native image generation is a throughput-oriented task
But you will hit another issue after that:
Building libjvmcicompiler.so.image... [dependency GRAALVM_39063E534F_JAVA16_STAGE1 updated]
[libjvmcicompiler:16649] classlist: 1,946.65 ms, 0.96 GB
[libjvmcicompiler:16649] setup: 519.64 ms, 0.96 GB
Error: could not find target method: private static native com.oracle.svm.core.jdk.Target_java_lang_invoke_MemberName
com.oracle.svm.core.jdk.Target_java_lang_invoke_MethodHandleNatives.resolve(com.oracle.svm.core.jdk.Target_java_lang_invoke_MemberName,java.lang.Class,boolean)
throws java.lang.LinkageError,java.lang.ClassNotFoundException
com.oracle.svm.core.util.UserError$UserException: could not find target method: private static native
com.oracle.svm.core.jdk.Target_java_lang_invoke_MemberName
com.oracle.svm.core.jdk.Target_java_lang_invoke_MethodHandleNatives.resolve(com.oracle.svm.core.jdk.Target_java_lang_invoke_MemberName,java.lang.Class,boolean)
throws java.lang.LinkageError,java.lang.ClassNotFoundException
at com.oracle.svm.core.util.UserError.abort(UserError.java:68)
at
com.oracle.svm.hosted.substitute.AnnotationSubstitutionProcessor.findOriginalMethod(AnnotationSubstitutionProcessor.java:695)
at
com.oracle.svm.hosted.substitute.AnnotationSubstitutionProcessor.handleMethodInAliasClass(AnnotationSubstitutionProcessor.java:349)
As I said before you most likely fail to build libgraal with latest JDK until GraalVM (SubstrateVM) supports it.
Regards,
Vladimir K
On 9/4/20 1:52 AM, Roland Westrelin wrote:
>
> Hi Vladimir,
>
> Thanks for writing the steps down. I gave it a try but for step 6:
>
>> 6. Build libgraal
>>
>> cd /<my_dir>/graal/vm
>> mx --env libgraal build
>
> I get:
>
> Building libjvmcicompiler.so.image... [dependency GRAAL_HOTSPOT_LIBRARY updated]
> Error: Requirements for building native images are not fulfilled [cause: Image building not supported for Java version 16-internal in /mnt/ssd/rwestrel/metropolis/graal/sdk/mxbuild/linux-amd64/GRAALVM_39063E534F_JAVA16_STAGE1/graalvm-39063e534f-java16-20.3.0-dev with VM configuration "OpenJDK 64-Bit Server VM"]
>
> Building libjvmcicompiler.so.image failed
> 1 build tasks failed
>
> You said:
>
>> 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.
>
> but AFAICT 8209961 is fixed now.
>
> Any idea what could go wrong?
>
> Roland.
>
More information about the metropolis-dev
mailing list