On Tue, 11 Feb 2025 06:26:19 GMT, David Holmes <dhol...@openjdk.org> wrote:

> I am at a loss to understand how the initial change built and tested with no 
> problem even though `-ldl` was missing. Maybe there is some way to set a 
> default set of libraries to check and the toolchain include libdl.so in that. 
> ??

@dholmes-ora I just added a comment at 
https://bugs.openjdk.org/browse/JDK-8349752?focusedId=14751058&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-14751058,
 duplicating below:

I had to refresh my memory on this (I now recall that I've run into related 
issue in the past), but I know the reason now why the build is successfully 
even without `-ldl`. `--allow-shlib-undefined` is the default on gnu linker. I 
linked "binutils/docs-2.18/ld/" below. Is `--no-allow-shlib-undefined` or 
`--no-undefined` specified for the linker in the closed test environment?

https://sourceware.org/binutils/docs-2.18/ld/Options.html#:~:text=The%20reason%20that%20%2D%2Dallow,be%20resolvable%20at%20load%20time:

> --allow-shlib-undefined
> --no-allow-shlib-undefined
>
> Allows (the default) or disallows undefined symbols in shared libraries. This 
> switch is similar to --no-undefined except that it determines the behaviour 
> when the undefined symbols are in a shared library rather than a regular 
> object file. It does not affect how undefined symbols in regular object files 
> are handled.
> The reason that --allow-shlib-undefined is the default is that the shared 
> library being specified at link time may not be the same as the one that is 
> available at load time, so the symbols might actually be resolvable at load 
> time. Plus there are some systems, (eg BeOS) where undefined symbols in 
> shared libraries is normal. (The kernel patches them at load time to select 
> which function is most appropriate for the current architecture. This is used 
> for example to dynamically select an appropriate memset function). Apparently 
> it is also normal for HPPA shared libraries to have undefined symbols.

Following is the `gcc` & `ld` from the github build machine 
(https://github.com/jianglizhou/jdk/actions/runs/13124407248/job/36617644281). 
The linker is `2.38 [GNU ld (GNU Binutils for Ubuntu) 2.38]`.


configure: Using gcc C compiler version 10.5.0 [gcc (Ubuntu 
10.5.0-1ubuntu1~22.04) 10.5.0]
...
checking resolved symbolic links for CXX... /usr/bin/x86_64-linux-gnu-g++-10
configure: Using gcc C++ compiler version 10.5.0 [g++ (Ubuntu 
10.5.0-1ubuntu1~22.04) 10.5.0]
...
configure: Using gcc linker version 2.38 [GNU ld (GNU Binutils for Ubuntu) 2.38]
configure: comparing linker version to minimum version 2.25

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

PR Comment: https://git.openjdk.org/jdk/pull/23544#issuecomment-2651314171

Reply via email to