RFR: 8367913: LIBDL dependency seems to be not needed for some jdk libs

Magnus Ihse Bursie ihse at openjdk.org
Fri Sep 19 09:11:28 UTC 2025


On Fri, 19 Sep 2025 07:20:11 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:

>> make/modules/java.base/Lib.gmk line 165:
>> 
>>> 163:     LDFLAGS_linux := -Wl$(COMMA)--no-as-needed, \
>>> 164:     LDFLAGS_aix := -brtl -bexpfull, \
>>> 165:     LIBS_linux := $(LIBDL) $(LIBM), \
>> 
>> I know libsyslookup is special. It is a dummy library that does not really do anything. I wonder if "pulling in libdl" is one of the things it is there for. Iirc, it is not always used either, so you need to make sure you do testing where it is actually used.
>
>> I know libsyslookup is special. It is a dummy library that does not really do anything. I wonder if "pulling in libdl" is one of the things it is there for. Iirc, it is not always used either, so you need to make sure you do testing where it is actually used.
> 
> 
> Is there some test for this special functionality?
> 
> The comments in the C sources
> https://github.com/openjdk/jdk/blob/master/src/java.base/share/native/libsyslookup/syslookup.c
> 
> do not really help me to understand what functions from libdl we want to bring in this way.

@mcimadamore Can you help us here? libsyslookup has a dependency to libdl, but it is not used. Can we remove that from the linker command line, or would it somehow break libsyslookup? (I have just a very  fuzzy idea of the point of this library.) If we try to remove it, what tests do we need to run to make sure we do not break anything?

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

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


More information about the serviceability-dev mailing list