On Fri, 22 Mar 2024 14:53:17 GMT, Martin Doerr <mdo...@openjdk.org> wrote:

> Only the Java developer can select the right member.

Right, and I think this problem is isomporphic to the problem we have in Linux 
distros of selecting between libclang.so.1 and libclang.so.2. 
`System::loadLibrary` cannot do it. So, I think it would feel odd if, say AIX 
was able to load precise version of a library using the member syntax, but in 
all other platforms that would not be possible. For better or worse, the story 
for now is: if you want version, use `System::load`.

In this case, the problem might be that `System::load` doesn't work out of the 
box, as the path doesn't really exist. But this doesn't seem different to 
loading non-existing framework paths in MacOS - e.g. it is a special case that 
can be added for AIX (when using `System::load`).

All that said, if one is doing `System::load/loadLibrary` just because they 
want to use FFM and `Linker`, a better way to do that is to just use 
`SymbolLookup::libraryLookup` directly, which gives you direct access to 
whatever string `dlopen` accepts in your system. Now, I realize that `jextract` 
is currently using `SymbolLookup::loaderLookup`, but I believe we can change 
that, which in turn will make adding support for AIX a bit easier.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/17945#issuecomment-2015299960

Reply via email to