Skip to content

Provide official API for commonly used svm.jar implementation details #4862

@kristofdho

Description

@kristofdho

Copied from #4783 (comment):

We have some usages that I think are not yet covered by #4783 (workarounds are very welcome):

  1. com.oracle.svm.core.SubstrateOptions
    • Used to get the value of SubstrateOptions.Class, as we have multiple entrypoints within a module, and need to switch config based on which one is used.
  2. com.oracle.svm.core.jdk.NativeLibrarySupport, com.oracle.svm.hosted.c.NativeLibraries and com.oracle.svm.core.jdk.JNIRegistrationUtil
    • Used to write library support in a similar way to JNIRegistrationJava.
    • The JNIRegistrationUtil superclass can be substituted by our own implementation, but without the other classes we have no way to do the static linking ourselves.
  3. com.oracle.svm.core.jdk.Resources#registerResource(java.lang.String, java.lang.String, java.io.InputStream)
    • Used in our custom support for the fontmanager library, to add the fontconfig.bfc file to the resources, to be used from the substitution.
    • We can possibly work around this by loading the resource in a static byte array instead in our substitutions.
  4. com.oracle.svm.hosted.FeatureImpl.DuringSetupAccessImpl#registerClassReachabilityListener
    • Used to add reachability handlers based on conditions not currently available. For us specifically a listener that fires for all classes with a specific annotation.
  5. com.oracle.svm.hosted.classinitialization.ConfigurableClassInitialization
    • Hack to conditionally add resource bundles during analysis, used in the same way as here.
    • Any workaround suggestions to add simple resource-bundles on the fly would be much appreciated.

/cc @olpaw

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions