[patch] link libjvm with -latomic

Magnus Ihse Bursie magnus.ihse.bursie at oracle.com
Fri Dec 11 10:29:09 UTC 2020


If we need -latomic on certain platforms we should add it on those 
platforms, but I would prefer not to add it unconditionally. But then 
again, if you want to add it for a bunch of system which are only 
supported on zero, I will not argue hard against it.

(Also, build-dev is the proper list to discuss changes in the build system)

/Magnus

On 2020-12-09 16:19, Matthias Klose wrote:
> seen with 16+27, zero needs to be linked with -latomic for a few more
> architectures.  Instead of hard-coding these architectures, would it be possible
> to link with -latomic unconditionally? It's the last library on the link
> command, so linking with -Wl,--as-needed -latomic should be do no harm.  Even
> better link with
>
>    -Wl,--push-state,--as-needed -latomic -Wl,--pop-state
>
> --push-state/--pop-state are implemented in binutils 2.28, released in 2017.
>
> It also looks like zero also build on ARM32 again.
>
> Matthias
>
>
> --- a/make/autoconf/libraries.m4
> +++ b/make/autoconf/libraries.m4
> @@ -127,9 +127,13 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBRARIES],
>     # Libatomic library
>     # 32-bit MIPS needs fallback library for 8-byte atomic ops
>     if test "x$OPENJDK_TARGET_OS" = xlinux &&
> -      (test "x$OPENJDK_TARGET_CPU" = xmips ||
> -       test "x$OPENJDK_TARGET_CPU" = xmipsel); then
> -    BASIC_JVM_LIBS="$BASIC_JVM_LIBS -latomic"
> +      (test "x$OPENJDK_TARGET_CPU" = xarm ||
> +       test "x$OPENJDK_TARGET_CPU" = xm68k ||
> +       test "x$OPENJDK_TARGET_CPU" = xmips ||
> +       test "x$OPENJDK_TARGET_CPU" = xmipsel ||
> +       test "x$OPENJDK_TARGET_CPU" = xppc ||
> +       test "x$OPENJDK_TARGET_CPU" = xsh); then
> +    BASIC_JVM_LIBS="$BASIC_JVM_LIBS -Wl,--push-state,--as-needed -latomic
> -Wl,--pop-state"
>     fi
>
>     # perfstat lib




More information about the build-dev mailing list