jnr / jnr-posix

Java Posix layer
Other
239 stars 91 forks source link

Search the default image for symbols to allow patching #148

Closed headius closed 4 years ago

headius commented 4 years ago

This addresses the issue in jruby/jruby#6202 where patch libraries loaded via LD_PRELOAD on Linux or DYLD_INSERT_LIBRARIES on MacOS would not be seen, since we go directly to the system libc and acquire all symbols from there. The patch utilizes the work in jnr/jnr-ffi#204 to unconditionally add a default search to the library bootstrapping.

This is part of work to implement #147.

Note that this does not provide a way to opt-out of searching the default image due to the static native of how the POSIX LibC library wrapper gets set up. A larger change will be needed to allow configuring this behavior.