Graal Native Image for JDK 24 has experimental support for the FFM API: https://www.graalvm.org/jdk24/reference-manual/native-image/native-code-interoperability/foreign-interface/
It would be nice if java-gi would support this. To make it work, the java-gi bindings generator must generate a GraalVM “ForeignRegistrationFeature” class that registers all downcall and upcall FunctionDescriptiors used in the module.
Notes:
- Use command-line arguments
-H:+UnlockExperimentalVMOptions and -H:+ForeignAPISupport
- Upcalls in Native Image currently only work on Linux.
- Custom GObject class registration uses reflection intensively, so that will probably not work.
Graal Native Image for JDK 24 has experimental support for the FFM API: https://www.graalvm.org/jdk24/reference-manual/native-image/native-code-interoperability/foreign-interface/
It would be nice if java-gi would support this. To make it work, the java-gi bindings generator must generate a GraalVM “ForeignRegistrationFeature” class that registers all downcall and upcall FunctionDescriptiors used in the module.
Notes:
-H:+UnlockExperimentalVMOptionsand-H:+ForeignAPISupport