[PATCH v3] Revert __HAVE_64B_ATOMICS configure check
Wilco Dijkstra
Wilco.Dijkstra@arm.com
Fri Nov 14 14:50:28 GMT 2025
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.
Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
Cheers,
Wilco
More information about the Libc-alpha
mailing list