RFR: 8367913: LIBDL dependency seems to be not needed for some jdk libs
Jorn Vernee
jvernee at openjdk.org
Mon Sep 22 15:06:09 UTC 2025
On Fri, 19 Sep 2025 09:08:07 GMT, Magnus Ihse Bursie <ihse at openjdk.org> 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
More information about the serviceability-dev
mailing list