[patch] link libjvm with -latomic

Matthias Klose doko at ubuntu.com
Wed Dec 9 15:19:26 UTC 2020


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 hotspot-dev mailing list