On Fri, 19 Sep 2025 09:08:07 GMT, Magnus Ihse Bursie <[email protected]> wrote:

>  but it is not used

It is not used by the library itself, but we do dynamic `dlsym` calls on this 
library when a user tries to look up a symbol through 
`Linker.nativeLinker().defaultLookup().find(...)`. This is supposed to be able 
to find symbols from 'the standard library' which is an unspecified platform 
specific set of symbols. We link against `libdl` so that we can find symbols in 
that library as well (since `dlsym` recurses into a library's dependencies when 
looking up a symbol). We don't have a comprehensive test which tests that a 
certain set of symbols is available. Trying to look up a symbol from `libdl` 
might give a false positive if the symbol happens to be pulled in by another 
library that `libsyslookup` depends on, so testing this is unreliable.

Either way, I think we want to keep linking against `libdl` so that it keeps 
being a dependency of the `libsyslookup` library.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27358#discussion_r2368874988

Reply via email to