From doko at ubuntu.com Wed Dec 9 15:19:26 2020 From: doko at ubuntu.com (Matthias Klose) Date: Wed, 9 Dec 2020 16:19:26 +0100 Subject: [patch] link libjvm with -latomic Message-ID: <90671a28-0464-37e7-fc3d-1372a1bf8a77@ubuntu.com> 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 From magnus.ihse.bursie at oracle.com Fri Dec 11 10:29:09 2020 From: magnus.ihse.bursie at oracle.com (Magnus Ihse Bursie) Date: Fri, 11 Dec 2020 11:29:09 +0100 Subject: [patch] link libjvm with -latomic In-Reply-To: <90671a28-0464-37e7-fc3d-1372a1bf8a77@ubuntu.com> References: <90671a28-0464-37e7-fc3d-1372a1bf8a77@ubuntu.com> Message-ID: <845e9d8c-d25c-b1d2-df62-e5130481d297@oracle.com> 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