undefined symbols in libjvm.so

Magnus Ihse Bursie magnus.ihse.bursie at oracle.com
Tue May 7 10:36:17 UTC 2024


Undefined symbols in libjvm.so is no good, and it should not be allowed. 
However, I am unsure about your analysis. This flag only affect linking 
of executables, not shared libraries. We do set "-Wl,-z,defs" when 
linking shared libraries, and this should complain about undefined symbols.

/Magnus

On 2024-05-06 21:57, Vladimir Petko wrote:
> Hi,
>
> I have recently encountered bugs caused by undefined symbols in
> libjvm.so[1][2]. The root cause of those issues is the expression in
> make/autoconf/flags-ldflags.m4:
>
> ---
> if test "x$TOOLCHAIN_TYPE" = xgcc; then
> EXECUTABLE_LDFLAGS="$EXECUTABLE_LDFLAGS -Wl,--allow-shlib-undefined"
> ...
> --
>
> OpenJDK master builds fine after fixing[1] on the following
> architectures:  amd64, i386, armhf, arm64, s390, ppc64el and riscv64.
>
> Would it be possible to consider removing -Wl,--allow-shlib-undefined
> from the build flags?
>
> Best Regards,
>   Vladimir.
>
> [1] https://bugs.openjdk.org/browse/JDK-8331541
> [2] https://bugs.openjdk.org/browse/JDK-8329983


More information about the build-dev mailing list