[PATCH] Link static C++ tests against libatomic.a if needed

Sam James sam@gentoo.org
Tue May 5 01:42:12 GMT 2026


"H.J. Lu" <hjl.tools@gmail.com> writes:

> On Mon, May 4, 2026 at 10:33 AM H.J. Lu <hjl.tools@gmail.com> wrote:
>>
>> Define cxx-static-link-libatomic to -latomic if DT_NEEDED entries in
>> libstdc++.so include libatomic.so.  Update link-extra-libs-static to
>> include $(cxx-static-link-libatomic) if -lstdc++ is used.
>>
>> Tested with sparcv8-linux-gnu-leon3 and sparcv9-linux-gnu using
>> uild-many-glibcs.py.  This fixes BZ #34121.
>>
>
> FWIW, sparc g++ does pass -latomic_asneeded to ld.  But glibc tests
> are built with -nostdlib -nostartfiles using gcc, not g++.

https://inbox.sourceware.org/gcc-patches/CACb0b4m+ex47Tpyp1qvW9+0p4onyEvsfXeXE_4zZrteMO5q5EQ@mail.gmail.com/

I don't remember what happened with that, there were a few issues with
the libatomic autolinking so I lost track.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 418 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/libc-alpha/attachments/20260505/f73a9f26/attachment.sig>


More information about the Libc-alpha mailing list