Re: Best practice for linking against libatomic?

David Abdurachmanov via Gcc-help <[email protected]> Tue, 13 Jan 2026 11:11:53 +0200
Newsgroups gmane.comp.gcc.help
Message-ID <CAEn-LTpdBcKGBrgyCwbuRXyWRxUom7Tx+18ow_D2FuFcVSi_ww@mail.gmail.com>
On Tue, Jan 13, 2026 at 10:59 AM Florian Weimer via Gcc-help
<[email protected]> wrote:
>
> >
> > so for LTO, there seems to be an error path that can find the version,
> > but then does not resolve the symbol -- these are fairly seldom
> > though.
>
> I think those call should never happen if you are targeting CPUs with
> the A extension.  If you are not doing that, some parts of the build are
> misconfigured.

Unless I forgot something, A extension can only do word and double
word atomics. Anything smaller than a world will generate a call to a
libatomic.

The sub-word atomics are implemented in the Zabha extension (ratified
~mid-2024) IIRC. I don't think there is any SoC/SBC in public that
supports it

Wasn't this issue resolved when libatomic calls started to be inlined
(GCC 13)? See:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104338

Cheers,
david