[PATCH v3] Revert __HAVE_64B_ATOMICS configure check
Adhemerval Zanella Netto
adhemerval.zanella@linaro.org
Fri Nov 14 16:31:16 GMT 2025
On 14/11/25 11:50, Wilco Dijkstra wrote:
> Hi Adhemerval,
>
>>>> - Enable USE_64B_ATOMICS for x32.
>>>
>>> That's incorrect. There is no guarantee that unaligned accesses are
>>> atomic even on x86.
>>
>> I tend to agree, but this was it was historical done and I prefer to
>> *not* change now (and H.J already raised this as well).
>
> That's fine - it also needs a bugreport for x32 and backports. We likely
> don't care about 68000...
>
>> I think it would be better to disable a 64-bit atomic on x32 on a
>> subsequent patch with a explanation on where it fails (since now
>> x32 glibc deployments are using it anyway).
>
> Also this needs to add a static assert that the alignments of sem_t and
> new_sem are compatible - such a check would have shown this issue
> immediately, including on x32 (and it should stop people turning it on
> again). The only case that was safe was ILP32 on AArch64.
>
> Now I'm wondering whether there are more dangerous casts like that in
> nptl that all the sanitizer tools seem to miss... Eventually we should clean
> up this code and remove all these defines and special casing -
> HAVE_64B_ATOMICS always seemed weird.
Agree, I think we haven't seem it because these ABIs are not extensively
tested. I will check if my ubsan branch would catch this on x32.
>
> Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
Thanks.
>
> Cheers,
> Wilco
>
More information about the Libc-alpha
mailing list