[PATCH v3] x32: Align sem_t to 8 bytes [BZ #33632]

H.J. Lu hjl.tools@gmail.com
Thu Nov 20 23:53:34 GMT 2025


On Wed, Nov 19, 2025 at 8:44 PM Adhemerval Zanella Netto
<adhemerval.zanella@linaro.org> wrote:
>
>
>
> On 19/11/25 08:10, Wilco Dijkstra wrote:
> > Hi HJ,
> >
> >>> That's an ABI break. Also I don't see how the behaviour of existing x32 binaries
> >>> is unchanged - they use unaligned sem_t and thus reintroduce the bug.
> >>
> >> The current x32 binaires use 64-bit atomic operations on unaligned
> >> 64-bit sem_t.   My patch doesn't change that.   It doesn't reintroduce
> >> the bug.
> >
> > But it doesn't fix it either and it introduces new ABI bugs...

There is NO NEW ABI bug.   The size of sem_t is unchanged.  The only
change is its alignment.   The old x32 binaries run exactly the same as
before.

> >
> > If breaking the ABI was acceptable, it could have been done many years ago.
>
> Do we really need to use 64 bit atomics on x32? I can't say about performance
> implications, but taken that ILP32 architectures are not that wildly used
> I don't think it should be a pressing issue.

It goes both ways.   If we weren't requiring updating and rebuilding
all released x32
glibc,  we should change sem_t alignment for future x32 glibc.

-- 
H.J.


More information about the Libc-alpha mailing list