提交 673cab5c 编写于 作者: R Rich Felker

align x32 pthread type sizes to be common with 32-bit archs

previously, commit e7b9887e aligned
the sizes with the glibc ABI. subsequent discussion during the merge
of the aarch64 port reached a conclusion that we should reject larger
arch-specific sizes, which have significant cost and no benefit, and
stick with the existing common 32-bit sizes for all 32-bit/ILP32 archs
and the x86_64 sizes for 64-bit archs.

one peculiarity of this change is that x32 pthread_attr_t is now
larger in musl than in the glibc x32 ABI, making it unsafe to call
pthread_attr_init from x32 code that was compiled against glibc. with
all the ABI issues of x32, it's not clear that ABI compatibility will
ever work, but if it's needed, pthread_attr_init and related functions
could be modified not to write to the last slot of the object.

this is not a regression versus previous releases, since on previous
releases the x32 pthread type sizes were all severely oversized
already (due to incorrectly using the x86_64 LP64 definitions).
moreover, x32 is still considered experimental and not ABI-stable.
上级 01ef3dd9
......@@ -22,10 +22,10 @@ TYPEDEF struct { long long __ll; long double __ld; } max_align_t;
TYPEDEF long long time_t;
TYPEDEF long long suseconds_t;
TYPEDEF struct { union { int __i[8]; volatile int __vi[8]; unsigned long __s[8]; } __u; } pthread_attr_t;
TYPEDEF struct { union { int __i[8]; volatile int __vi[8]; volatile void *volatile __p[8]; } __u; } pthread_mutex_t;
TYPEDEF struct { union { int __i[8]; volatile int __vi[8]; volatile void *volatile __p[8]; } __u; } mtx_t;
TYPEDEF struct { union { int __i[9]; volatile int __vi[9]; unsigned __s[9]; } __u; } pthread_attr_t;
TYPEDEF struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } pthread_mutex_t;
TYPEDEF struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } mtx_t;
TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } pthread_cond_t;
TYPEDEF struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } cnd_t;
TYPEDEF struct { union { int __i[11]; volatile int __vi[11]; void *__p[11]; } __u; } pthread_rwlock_t;
TYPEDEF struct { union { int __i[8]; volatile int __vi[8]; void *__p[8]; } __u; } pthread_rwlock_t;
TYPEDEF struct { union { int __i[5]; volatile int __vi[5]; void *__p[5]; } __u; } pthread_barrier_t;
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册