On Wed, 8 Oct 2025 02:44:42 GMT, David Holmes <[email protected]> wrote:

> > So, this dot logic should be lifted to JVM_LoadLibrary?
> 
> Possibly, but I still want to understand this change as it is now proposed. 
> The whole thing has been about symlinks till now, so now what exactly is the 
> problem and solution?

It's been a windy path. As the PR description says, the problem appeared after 
JDK-8003887, which was a symlink-related change. JDK-8003887 looks be correct, 
though, and the regression was due to it exposing underlying problems in the 
native library loading code. Specifically, `JVM_LoadLibrary` on Windows does 
not work as expected when given a file without a `.dll` extension. We can make 
`JVM_LoadLibrary` work with the dot appending trick (current version of the 
PR), or apply the dot-appending trick in `NativeLibraries` (previous version of 
the PR).

> You just want a way to load an arbitrarily-named file as if it were a dll?

That sounds generally desirable. My use case is narrower. The file presented to 
`System.loadLibrary` does end with `.dll`. But after the path canonicalization 
done by `NativeLibraries`, the final path does not end with `.dll`.

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

PR Comment: https://git.openjdk.org/jdk/pull/24694#issuecomment-3379394592

Reply via email to