Getting "UnsatisfiedLinkError" in io_uring for methods that were defined as "static inline" in the header

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Wed Sep 21 23:23:56 UTC 2022


On 21/09/2022 23:39, Gavin Ray wrote:
> That makes sense -- I will look at patching liburing with a dirty 
> one-liner that strips "static inline" from the definitions that have 
> them then, ty =)

Sorry, hit send too fast, and forgot to reply to this.

There are few approaches that can be tried.

First, you could define another shared library that depends on io_uring 
- e.g. a C file which includes the io_uring header. This new file would 
contain _new_ exported symbols for all the static inline functions, 
whose implementation just delegates to the underlying static inline 
functions (in the included io_uring header). Then you load up the 
library with Panama and, if you have set up things correctly, you will 
see both the static inlines and the exported symbols in IO uring. (in 
fact, we do a similar trick to expose system library symbols like 
"printf" on Windows, which implements them as macros).

Another (more fun?) option would be to just keep the original library, 
and implement the static inline functions in Java directly, using the 
FFM API. Most of the functions I see have only 2-3 lines in them, so it 
shouldn't be hard.

Maurizio



More information about the panama-dev mailing list