Re: Best practice for linking against libatomic?

Florian Weimer via Gcc-help <[email protected]> Tue, 13 Jan 2026 11:41:06 +0100
Newsgroups gmane.comp.gcc.help
Message-ID <[email protected]>
* David Abdurachmanov:

> 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

Oh, right.  So that's why there are only sizes 1 & 2.  This suggests
that there are outdated binaries in the link.

Thanks,
Florian