From d63020712f7bad61445af5d3c9748c6888d89eed Mon Sep 17 00:00:00 2001 From: Esben Haabendal <esben.haabendal@huawei.com> Date: Mon, 14 Mar 2022 09:07:04 +0100 Subject: [PATCH] musl: Remove OpenHarmony hack for struct sockaddr_storage With openharmony-linux-user.patch, we were modifying sys/socket.h header so that struct sockaddr_storage was coming from linux/socket.h header instead of being defined directly. But upstream linux/socket.h does not do that. It seems like some kind of Android convention, that have been applied to kernel headers in OpenHarmony, and as we now are using kernel headers from Oniro, we don't have that. As part of the reason for using third party from Oniro, we really do want to use upstream kernel headers, so we need to drop this change. Note that this difference can be seen as an API change compared to OpenHarmony. Code that would be relying on linux/socket.h defining struct sockaddr_storage will not work without changes. But the sensible API is to include sys/socket.h, and in that case, compatibility is preserved. Signed-off-by: Esben Haabendal <esben.haabendal@huawei.com> --- .../musl/files/openharmony-linux-user.patch | 29 ------------------- 1 file changed, 29 deletions(-) diff --git a/recipes-core/musl/files/openharmony-linux-user.patch b/recipes-core/musl/files/openharmony-linux-user.patch index 189a2b86..5c4c6038 100644 --- a/recipes-core/musl/files/openharmony-linux-user.patch +++ b/recipes-core/musl/files/openharmony-linux-user.patch @@ -100,35 +100,6 @@ index 984db6806418..73793e47ef53 100644 #define __NEED_time_t #define __NEED_clockid_t #define __NEED_struct_timespec -diff --git a/include/sys/socket.h b/include/sys/socket.h -index 38f5bb17b3b8..fe3c46841693 100644 ---- a/include/sys/socket.h -+++ b/include/sys/socket.h -@@ -19,6 +19,10 @@ extern "C" { - - #include <bits/socket.h> - -+#ifdef __MUSL__ -+#include <linux/socket.h> -+#endif -+ - struct msghdr { - void *msg_name; - socklen_t msg_namelen; -@@ -369,11 +373,13 @@ struct sockaddr { - char sa_data[14]; - }; - -+#ifndef __MUSL__ - struct sockaddr_storage { - sa_family_t ss_family; - char __ss_padding[128-sizeof(long)-sizeof(sa_family_t)]; - unsigned long __ss_align; - }; -+#endif - - int socket (int, int, int); - int socketpair (int, int, int, int [2]); diff --git a/include/sys/sysinfo.h b/include/sys/sysinfo.h index 6a3931e52010..9b095ffb500b 100644 --- a/include/sys/sysinfo.h -- GitLab