On Wed, 6 Mar 2024 15:02:07 GMT, Jan Lahoda <jlah...@openjdk.org> wrote:
>>> Many of these modules do not need native access in the current >>> implementation. >> >> In addition this will eventually need jlink support. I view the change to >> ModuleBootstrap initialiser to use ModuleLoaderMap.nativeAccessModules() as >> very temporary. It may include many standard/JDK modules that aren't in the >> image. In addition we'll need some way to grant native access at link-time. >> The workaround for the latter right now is to configure default options. > >> Many of these modules do not need native access in the current >> implementation. Should this list be trimmed to list the ones that need >> native access in the current implementation? > > Not sure if I know enough to do the pruning, so I was hoping that could be > done separately (I'd file a bug as Alan suggests). But I can try to prune the > list, if you prefer. Native access is needed for modules which calls restricted methods [1]. AFAICT, java.base, java.desktop and jdk.incubator.vector use java.lang.foreign but I don't know if they call restricted methods or not. https://download.java.net/java/early_access/jdk23/docs/api/java.base/java/lang/foreign/package-summary.html#restricted ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/18106#discussion_r1514932944