Open jperedadnr opened 3 years ago
@jperedadnr thanks for reporting the issue I tried, but I got another error:
ative-image -H:+SharedLibrary -H:-DeadlockWatchdogExitOnTimeout -H:DeadlockWatchdogInterval=0 -H:+RemoveSaturatedTypeFlows -H:+ExitAfterRelocatableImageWrite --features=org.graalvm.home.HomeFinderFeature -H:CompilerBackend=llvm -H:-SpawnIsolates -H:PageSize=16384 -Dsvm.targetName=iOS -Dsvm.targetArch=arm64 -Dsvm.platform=org.graalvm.nativeimage.Platform$IOS_AARCH64 -cp target/classes -H:LLVMMaxFunctionsPerBatch=1 hello.HelloWorld
Exception in thread "main" com.oracle.svm.core.util.UserError$UserException: Could not instantiate platform class org.graalvm.nativeimage.Platform. Ensure the class is not abstract and has a no-argument constructor.
at com.oracle.svm.core.util.UserError.abort(UserError.java:82)
at com.oracle.svm.hosted.NativeImageGenerator.loadPlatform(NativeImageGenerator.java:329)
at com.oracle.svm.hosted.NativeImageGenerator.getTargetPlatform(NativeImageGenerator.java:359)
at com.oracle.svm.hosted.NativeImageGeneratorRunner.installNativeImageClassLoader(NativeImageGeneratorRunner.java:176)
at com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:118)
at com.oracle.svm.hosted.NativeImageGeneratorRunner$JDK9Plus.main(NativeImageGeneratorRunner.java:561)
Caused by: java.lang.NoSuchMethodException: org.graalvm.nativeimage.Platform.<init>()
at java.base/java.lang.Class.getConstructor0(Class.java:3349)
at java.base/java.lang.Class.getDeclaredConstructor(Class.java:2553)
at com.oracle.svm.util.ReflectionUtil.lookupConstructor(ReflectionUtil.java:69)
at com.oracle.svm.util.ReflectionUtil.newInstance(ReflectionUtil.java:80)
at com.oracle.svm.hosted.NativeImageGenerator.loadPlatform(NativeImageGenerator.java:327)
... 4 more
Error: Image build request failed with exit status 1
You probably need to escape the $
in
svm.platform=org.graalvm.nativeimage.Platform$IOS_AARCH64
@jperedadnr The problem happens when calling a method returning a WordBase
type through reflection. I'm trying to see how I can get this to work. However I'm surprised to see this method being registered for reflection, are you using a reflection configuration file somewhere?
Yes, we use reflection with the usual Java classes.
Find attached the config files:
Describe the issue
Running native-image with
-Dsvm.platform=org.graalvm.nativeimage.Platform$IOS_AARCH64
and a simple class that contains:fails with:
Steps to reproduce the issue Please include both build steps as well as run steps
Describe GraalVM and your environment:
More details
Native-image log:
Running
opt
with the failing bc file (see attached):the relevant parts of f2101.ll are:
File: f2101.bc.zip