[External] : Re: System.loadLibrary and CLinker.lookup exception

Sundararajan Athijegannathan sundararajan.athijegannathan at oracle.com
Tue Apr 26 12:00:24 UTC 2022


C runtime library may be needed panama user code loaded by different class loaders. But System.loadLibrary()  enforces that you can load a specific library from only one loader.

CLinker.systemCLinker()'s lookup() supports looking up (only) C runtime library symbols - without loading C runtime library by name or path.

PS. There are going to be further changes in the 'preview' phase.

-Sundar
________________________________
From: Jack Andrews <effbiae at gmail.com>
Sent: 26 April 2022 17:11
To: Sundararajan Athijegannathan <sundararajan.athijegannathan at oracle.com>
Cc: Radosław Smogura <mail at smogura.eu>; panama-dev at openjdk.java.net <panama-dev at openjdk.java.net>
Subject: [External] : Re: System.loadLibrary and CLinker.lookup exception

On Tue, 26 Apr 2022 at 21:36, Sundararajan Athijegannathan <sundararajan.athijegannathan at oracle.com<mailto:sundararajan.athijegannathan at oracle.com>> wrote:
systemCLinker() cannot see arbitrary symbols. It is meant only for C runtime library functions. You're loading your library "k" using System.loadLibrary and so only loader lookup can look at symbols from it.

that makes sense. but why are there two ways to lookup a symbol? surely that just introduces unneeded complexity?

python's FFI doesn't need 2 different symbol resolvers.

best,
jack


More information about the panama-dev mailing list