void* is used to align to 32-bits or 64-bits on 32 and 64 bits archs. The pure-capability ABI breaks this assumption as the pointer size is different than the word size, which is where the alignment requirement comes from. Indeed, the pointer size, and so void *, is now 16 bytes whereas the expected alignment is still 8 bytes, as it is a different ABI but for a 64-bit arch.
Change it to an unsigned long. Musl uses the same type for its definition of struct sockaddr_storage.
Signed-off-by: Teo Couprie Diaz teo.coupriediaz@arm.com --- include/uapi/linux/socket.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/uapi/linux/socket.h b/include/uapi/linux/socket.h index 51d6bb2f6765..28ff6a4aebca 100644 --- a/include/uapi/linux/socket.h +++ b/include/uapi/linux/socket.h @@ -22,7 +22,7 @@ struct __kernel_sockaddr_storage { /* space to achieve desired size, */ /* _SS_MAXSIZE value minus size of ss_family */ }; - void *__align; /* implementation specific desired alignment */ + unsigned long __align; /* implementation specific desired alignment */ }; };
On 16/12/2022 11:26, Teo Couprie Diaz wrote:
void* is used to align to 32-bits or 64-bits on 32 and 64 bits archs. The pure-capability ABI breaks this assumption as the pointer size is different than the word size, which is where the alignment requirement comes from. Indeed, the pointer size, and so void *, is now 16 bytes whereas the expected alignment is still 8 bytes, as it is a different ABI but for a 64-bit arch.
Change it to an unsigned long. Musl uses the same type for its definition of struct sockaddr_storage.
Signed-off-by: Teo Couprie Diaz teo.coupriediaz@arm.com
include/uapi/linux/socket.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied on next with the small commit message change I suggested on v2. Thanks!
Kevin
diff --git a/include/uapi/linux/socket.h b/include/uapi/linux/socket.h index 51d6bb2f6765..28ff6a4aebca 100644 --- a/include/uapi/linux/socket.h +++ b/include/uapi/linux/socket.h @@ -22,7 +22,7 @@ struct __kernel_sockaddr_storage { /* space to achieve desired size, */ /* _SS_MAXSIZE value minus size of ss_family */ };
void *__align; /* implementation specific desired alignment */
};unsigned long __align; /* implementation specific desired alignment */
};
linux-morello@op-lists.linaro.org