Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 796720 Details for
Bug 862795
app-emulation/open-vm-tools-12.0.5_p19716617 fails to compile (MUSL): asyncsocket.c:2846:13: error: invalid use of undefined type struct pollfd
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
app-emulation/open-vm-tools: support for musl libc
open-vm-tools-support-for-musl-libc.patch (text/plain), 27.47 KB, created by
CFuga
on 2022-08-01 20:56:18 UTC
(
hide
)
Description:
app-emulation/open-vm-tools: support for musl libc
Filename:
MIME Type:
Creator:
CFuga
Created:
2022-08-01 20:56:18 UTC
Size:
27.47 KB
patch
obsolete
>From b7d20231ccf23aa5e395c1846ac89299b20f075b Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Cristian=20Oth=C3=B3n=20Mart=C3=ADnez=20Vera?= > <cfuga@cfuga.mx> >Date: Mon, 1 Aug 2022 15:46:39 -0500 >Subject: [PATCH] app-emulation/open-vm-tools: support for musl libc >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > > Patches 1-7 come from https://github.com/vmware/open-vm-tools/pull/557 > Patch 8 based on https://github.com/Xilinx/meta-browser/blob/0439f9cb86f7966b17950b9bd093bf657064b2c8/recipes-browser/chromium/files/musl-support/0010-Define-res_ninit-and-res_nclose-for-non-glibc-platfo.patch > Patch 9-10 written by me > >Signed-off-by: Cristian Othón MartÃnez Vera <cfuga@cfuga.mx> >--- > .../files/01_11.2.5-not-glibc.patch | 28 ++++ > .../files/02_11.2.5-struct-timespec.patch | 45 ++++++ > .../03_11.2.5-ALLPERMS-ACCESSPERMS.patch | 58 +++++++ > .../files/04_11.2.5-configure.patch | 147 ++++++++++++++++++ > .../files/05_11.2.5-sys_stat_h.patch | 25 +++ > .../files/06_11.2.5-rename-poll_h.patch | 88 +++++++++++ > .../files/07_11.2.5-off64_t.patch | 107 +++++++++++++ > .../files/08_11.2.5-resolv_compat.patch | 46 ++++++ > .../files/09_11.2.5-unistd.patch | 21 +++ > .../open-vm-tools/files/10_11.2.5-uint.patch | 19 +++ > .../open-vm-tools-11.3.5_p18557794.ebuild | 12 ++ > .../open-vm-tools-12.0.5_p19716617.ebuild | 12 ++ > 12 files changed, 608 insertions(+) > create mode 100644 app-emulation/open-vm-tools/files/01_11.2.5-not-glibc.patch > create mode 100644 app-emulation/open-vm-tools/files/02_11.2.5-struct-timespec.patch > create mode 100644 app-emulation/open-vm-tools/files/03_11.2.5-ALLPERMS-ACCESSPERMS.patch > create mode 100644 app-emulation/open-vm-tools/files/04_11.2.5-configure.patch > create mode 100644 app-emulation/open-vm-tools/files/05_11.2.5-sys_stat_h.patch > create mode 100644 app-emulation/open-vm-tools/files/06_11.2.5-rename-poll_h.patch > create mode 100644 app-emulation/open-vm-tools/files/07_11.2.5-off64_t.patch > create mode 100644 app-emulation/open-vm-tools/files/08_11.2.5-resolv_compat.patch > create mode 100644 app-emulation/open-vm-tools/files/09_11.2.5-unistd.patch > create mode 100644 app-emulation/open-vm-tools/files/10_11.2.5-uint.patch > >diff --git a/app-emulation/open-vm-tools/files/01_11.2.5-not-glibc.patch b/app-emulation/open-vm-tools/files/01_11.2.5-not-glibc.patch >new file mode 100644 >index 00000000000..05de4ad75f8 >--- /dev/null >+++ b/app-emulation/open-vm-tools/files/01_11.2.5-not-glibc.patch >@@ -0,0 +1,28 @@ >+From 3d6dad8c9202f449bbdff90da5463c1994198883 Mon Sep 17 00:00:00 2001 >+From: Natanael Copa <ncopa@alpinelinux.org> >+Date: Tue, 17 Nov 2015 10:39:01 +0000 >+Subject: [PATCH] Do not assume that linux and gnu libc are the same thing >+ >+Use __GLIBC__ when testing for GNU libc specific things instead of >+assuming that __linux__ is GNU libc. >+ >+This is needed for building with musl libc. >+ >+Signed-off-by: Natanael Copa <ncopa@alpinelinux.org> >+--- >+ open-vm-tools/lib/file/fileIOPosix.c | 2 +- >+ 1 file changed, 1 insertion(+), 1 deletion(-) >+ >+diff --git a/open-vm-tools/lib/file/fileIOPosix.c b/open-vm-tools/lib/file/fileIOPosix.c >+index 82c0aa18e..47dc41379 100644 >+--- a/open-vm-tools/lib/file/fileIOPosix.c >++++ b/open-vm-tools/lib/file/fileIOPosix.c >+@@ -198,7 +198,7 @@ static AlignedPool alignedPool; >+ * are not available in any header file. >+ */ >+ >+-#if defined(__linux__) && !defined(__ANDROID__) >++#if defined(__linux__) && defined(__GLIBC__) >+ #if defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64) >+ /* >+ * We want preadv/pwritev. But due to FOB=64, the symbols are -64. >diff --git a/app-emulation/open-vm-tools/files/02_11.2.5-struct-timespec.patch b/app-emulation/open-vm-tools/files/02_11.2.5-struct-timespec.patch >new file mode 100644 >index 00000000000..5336f8b5d8d >--- /dev/null >+++ b/app-emulation/open-vm-tools/files/02_11.2.5-struct-timespec.patch >@@ -0,0 +1,45 @@ >+From f587e80663afed5d189f2dd185dea7e4b2bbb105 Mon Sep 17 00:00:00 2001 >+From: Natanael Copa <ncopa@alpinelinux.org> >+Date: Wed, 18 Nov 2015 09:03:00 +0000 >+Subject: [PATCH] Use configure test for struct timespec >+ >+Use the configure script to test for struct time spec instead of trying >+to keep track of what platforms has it. >+ >+Signed-off-by: Natanael Copa <ncopa@alpinelinux.org> >+--- >+ open-vm-tools/configure.ac | 1 + >+ open-vm-tools/lib/include/hgfsUtil.h | 8 +------- >+ 2 files changed, 2 insertions(+), 7 deletions(-) >+ >+diff --git a/open-vm-tools/configure.ac b/open-vm-tools/configure.ac >+index 6c94649a4..dd7badc3c 100644 >+--- a/open-vm-tools/configure.ac >++++ b/open-vm-tools/configure.ac >+@@ -1212,6 +1212,7 @@ AC_TYPE_OFF_T >+ AC_TYPE_PID_T >+ AC_TYPE_SIZE_T >+ AC_CHECK_MEMBERS([struct stat.st_rdev]) >++AC_CHECK_MEMBERS([struct timespec.tv_sec],[],[],[[#include <time.h>]]) >+ AC_HEADER_TIME >+ AC_STRUCT_TM >+ AC_C_VOLATILE >+diff --git a/open-vm-tools/lib/include/hgfsUtil.h b/open-vm-tools/lib/include/hgfsUtil.h >+index 609f4c000..a3a022d42 100644 >+--- a/open-vm-tools/lib/include/hgfsUtil.h >++++ b/open-vm-tools/lib/include/hgfsUtil.h >+@@ -53,13 +53,7 @@ >+ # include <time.h> >+ # endif >+ # include "vm_basic_types.h" >+-# if !defined _STRUCT_TIMESPEC && \ >+- !defined _TIMESPEC_DECLARED && \ >+- !defined __timespec_defined && \ >+- !defined sun && \ >+- !defined __FreeBSD__ && \ >+- !__APPLE__ && \ >+- !defined _WIN32 >++# if !defined HAVE_STRUCT_TIMESPEC_TV_SEC >+ struct timespec { >+ time_t tv_sec; >+ long tv_nsec; >diff --git a/app-emulation/open-vm-tools/files/03_11.2.5-ALLPERMS-ACCESSPERMS.patch b/app-emulation/open-vm-tools/files/03_11.2.5-ALLPERMS-ACCESSPERMS.patch >new file mode 100644 >index 00000000000..f89fb62f399 >--- /dev/null >+++ b/app-emulation/open-vm-tools/files/03_11.2.5-ALLPERMS-ACCESSPERMS.patch >@@ -0,0 +1,58 @@ >+From 81da70dccfd03e6089be9ec509e43e697b8a58b3 Mon Sep 17 00:00:00 2001 >+From: Natanael Copa <ncopa@alpinelinux.org> >+Date: Wed, 18 Nov 2015 09:10:14 +0000 >+Subject: [PATCH] Fix definition of ALLPERMS and ACCESSPERMS >+ >+The ALLPERMS and ACCESSPERMS defines are not specified in POSIX so >+assume it is not there instead of testing for specific implementations. >+ >+This is needed for musl libc. >+ >+Signed-off-by: Natanael Copa <ncopa@alpinelinux.org> >+--- >+ open-vm-tools/lib/hgfsServer/hgfsServerLinux.c | 8 +++++--- >+ open-vm-tools/services/plugins/dndcp/dnd/dndLinux.c | 3 +-- >+ 2 files changed, 6 insertions(+), 5 deletions(-) >+ >+diff --git a/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c b/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c >+index 63c4e65f0..87d419a7b 100644 >+--- a/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c >++++ b/open-vm-tools/lib/hgfsServer/hgfsServerLinux.c >+@@ -105,11 +105,13 @@ typedef struct DirectoryEntry { >+ #endif >+ >+ /* >+- * ALLPERMS (mode 07777) and ACCESSPERMS (mode 0777) are not defined in the >+- * Solaris version of <sys/stat.h>. >++ * ALLPERMS (mode 07777) and ACCESSPERMS (mode 0777) are not specified in >++ * POSIX. >+ */ >+-#ifdef sun >++#ifndef ACCESSPERMS >+ # define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO) >++#endif >++#ifndef ALLPERMS >+ # define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO) >+ #endif >+ >+diff --git a/open-vm-tools/services/plugins/dndcp/dnd/dndLinux.c b/open-vm-tools/services/plugins/dndcp/dnd/dndLinux.c >+index 219065f74..b5b7e6203 100644 >+--- a/open-vm-tools/services/plugins/dndcp/dnd/dndLinux.c >++++ b/open-vm-tools/services/plugins/dndcp/dnd/dndLinux.c >+@@ -53,7 +53,7 @@ >+ >+ #define DND_ROOTDIR_PERMS (S_IRWXU | S_IRWXG | S_IRWXO) >+ #define DND_STAGINGDIR_PERMS (S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) >+-#ifdef sun >++#ifndef ACCESSPERMS >+ #define ACCESSPERMS (S_IRWXU | S_IRWXG | S_IRWXO) >+ #endif >+ #ifdef __ANDROID__ >+@@ -62,7 +62,6 @@ >+ */ >+ #define NO_SETMNTENT >+ #define NO_ENDMNTENT >+-#define ACCESSPERMS (S_IRWXU | S_IRWXG | S_IRWXO) >+ #endif >+ >+ >diff --git a/app-emulation/open-vm-tools/files/04_11.2.5-configure.patch b/app-emulation/open-vm-tools/files/04_11.2.5-configure.patch >new file mode 100644 >index 00000000000..e36c874d593 >--- /dev/null >+++ b/app-emulation/open-vm-tools/files/04_11.2.5-configure.patch >@@ -0,0 +1,147 @@ >+From da7d7951c3b4f11485accf54e8e925c04709ed78 Mon Sep 17 00:00:00 2001 >+From: Natanael Copa <ncopa@alpinelinux.org> >+Date: Wed, 18 Nov 2015 10:05:07 +0000 >+Subject: [PATCH] Use configure to test for feature instead of platform >+ >+Test for various functions instead of trying to keep track of what >+platform and what version of the given platform has support for what. >+ >+This should make it easier to port to currently unknown platforms and >+will solve the issue if a platform add support for a missing feature in >+the future. >+ >+The features we test for are: >+- getifaddrs >+- getauxval >+- issetugid >+- __secure_getenv >+ >+This is needed for musl libc. >+ >+Signed-off-by: Natanael Copa <ncopa@alpinelinux.org> >+--- >+ open-vm-tools/configure.ac | 4 ++++ >+ open-vm-tools/lib/misc/idLinux.c | 30 +++++++++++------------- >+ open-vm-tools/lib/nicInfo/nicInfoPosix.c | 11 +++++---- >+ 3 files changed, 24 insertions(+), 21 deletions(-) >+ >+diff --git a/open-vm-tools/configure.ac b/open-vm-tools/configure.ac >+index dd7badc3c..dba033b1a 100644 >+--- a/open-vm-tools/configure.ac >++++ b/open-vm-tools/configure.ac >+@@ -940,6 +940,7 @@ AC_CHECK_FUNCS( >+ >+ AC_CHECK_FUNCS([ecvt]) >+ AC_CHECK_FUNCS([fcvt]) >++AC_CHECK_FUNCS([getifaddrs getauxval issetugid __secure_getenv]) >+ >+ AC_CHECK_FUNC([mkdtemp], [have_mkdtemp=yes]) >+ >+@@ -1149,10 +1150,13 @@ fi >+ ### >+ >+ AC_CHECK_HEADERS([crypt.h]) >++AC_CHECK_HEADERS([ifaddrs.h]) >+ AC_CHECK_HEADERS([inttypes.h]) >+ AC_CHECK_HEADERS([stdint.h]) >+ AC_CHECK_HEADERS([stdlib.h]) >+ AC_CHECK_HEADERS([wchar.h]) >++AC_CHECK_HEADERS([net/if.h]) >++AC_CHECK_HEADERS([sys/auxv.h]) >+ AC_CHECK_HEADERS([sys/inttypes.h]) >+ AC_CHECK_HEADERS([sys/io.h]) >+ AC_CHECK_HEADERS([sys/param.h]) # Required to make the sys/user.h check work correctly on FreeBSD >+diff --git a/open-vm-tools/lib/misc/idLinux.c b/open-vm-tools/lib/misc/idLinux.c >+index 1bb86f483..41c670cfc 100644 >+--- a/open-vm-tools/lib/misc/idLinux.c >++++ b/open-vm-tools/lib/misc/idLinux.c >+@@ -27,12 +27,9 @@ >+ #include <sys/syscall.h> >+ #include <string.h> >+ #include <unistd.h> >+-#ifdef __linux__ >+-#if defined(__GLIBC__) && \ >+- (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 16)) >++#ifdef HAVE_SYS_AUXV_H >+ #include <sys/auxv.h> >+ #endif >+-#endif >+ #ifdef __APPLE__ >+ #include <sys/socket.h> >+ #include <TargetConditionals.h> >+@@ -1025,31 +1022,32 @@ Id_EndSuperUser(uid_t uid) // IN: >+ static Bool >+ IdIsSetUGid(void) >+ { >+-#if defined(__ANDROID__) >+- /* Android does not have a secure_getenv, so be conservative. */ >+- return TRUE; >+-#else >+ /* >+ * We use __secure_getenv, which returns NULL if the binary is >+- * setuid or setgid. Alternatives include, >++ * setuid or setgid, when issetugid or getauxval(AT_SECURE) is not >++ * available. Alternatives include, >+ * >+- * a) getauxval(AT_SECURE); not available until glibc 2.16. >+- * b) __libc_enable_secure; may not be exported. >++ * a) issetugid(); not (yet?) available in glibc. >++ * b) getauxval(AT_SECURE); not available until glibc 2.16. >++ * c) __libc_enable_secure; may not be exported. >+ * >+- * Use (a) when we are based on glibc 2.16, or newer. >++ * Use (b) when we are based on glibc 2.16, or newer. >+ */ >+ >+-#if defined(__GLIBC__) && \ >+- (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 16)) >++#if HAVE_ISSETUGID >++ return issetugid(); >++#elif HAVE_GETAUXVAL >+ return getauxval(AT_SECURE) != 0; >+-#else >++#elif HAVE___SECURE_GETENV >+ static const char envName[] = "VMW_SETUGID_TEST"; >+ >+ if (setenv(envName, "1", TRUE) == -1) { >+ return TRUE; /* Conservative */ >+ } >+ return __secure_getenv(envName) == NULL; >+-#endif >++#else >++ /* Android does not have a secure_getenv, so be conservative. */ >++ return TRUE; >+ #endif >+ } >+ #endif >+diff --git a/open-vm-tools/lib/nicInfo/nicInfoPosix.c b/open-vm-tools/lib/nicInfo/nicInfoPosix.c >+index de57a4a90..7a132eee7 100644 >+--- a/open-vm-tools/lib/nicInfo/nicInfoPosix.c >++++ b/open-vm-tools/lib/nicInfo/nicInfoPosix.c >+@@ -35,9 +35,13 @@ >+ #include <sys/stat.h> >+ #include <errno.h> >+ #include <limits.h> >+-#if defined(__FreeBSD__) || defined(__APPLE__) >++#if HAVE_SYS_SYSCTL_H >+ # include <sys/sysctl.h> >++#endif >++#if HAVE_IFADDRS_H >+ # include <ifaddrs.h> >++#endif >++#if HAVE_NET_IF_H >+ # include <net/if.h> >+ #endif >+ #ifndef NO_DNET >+@@ -499,10 +503,7 @@ GuestInfoGetNicInfo(unsigned int maxIPv4Routes, >+ * >+ ****************************************************************************** >+ */ >+-#if defined(__FreeBSD__) || \ >+- defined(__APPLE__) || \ >+- defined(USERWORLD) || \ >+- (defined(__linux__) && defined(NO_DNET)) >++#if defined(NO_DNET) && defined(HAVE_GETIFADDRS) >+ >+ char * >+ GuestInfoGetPrimaryIP(void) >diff --git a/app-emulation/open-vm-tools/files/05_11.2.5-sys_stat_h.patch b/app-emulation/open-vm-tools/files/05_11.2.5-sys_stat_h.patch >new file mode 100644 >index 00000000000..49558b3f743 >--- /dev/null >+++ b/app-emulation/open-vm-tools/files/05_11.2.5-sys_stat_h.patch >@@ -0,0 +1,25 @@ >+From 716d1d77bf8199e694c71edcb9e0144d74ba7977 Mon Sep 17 00:00:00 2001 >+From: Natanael Copa <ncopa@alpinelinux.org> >+Date: Wed, 18 Nov 2015 10:41:01 +0000 >+Subject: [PATCH] Use configure test for sys/stat.h include >+ >+This is needed for musl libc. >+ >+Signed-off-by: Natanael Copa <ncopa@alpinelinux.org> >+--- >+ open-vm-tools/services/plugins/vix/vixTools.c | 2 +- >+ 1 file changed, 1 insertion(+), 1 deletion(-) >+ >+diff --git a/open-vm-tools/services/plugins/vix/vixTools.c b/open-vm-tools/services/plugins/vix/vixTools.c >+index 103ed10dc..bde740218 100644 >+--- a/open-vm-tools/services/plugins/vix/vixTools.c >++++ b/open-vm-tools/services/plugins/vix/vixTools.c >+@@ -66,7 +66,7 @@ >+ #include <unistd.h> >+ #endif >+ >+-#if defined(sun) || defined(__FreeBSD__) || defined(__APPLE__) >++#ifdef HAVE_SYS_STAT_H >+ #include <sys/stat.h> >+ #endif >+ >diff --git a/app-emulation/open-vm-tools/files/06_11.2.5-rename-poll_h.patch b/app-emulation/open-vm-tools/files/06_11.2.5-rename-poll_h.patch >new file mode 100644 >index 00000000000..67e9cc673de >--- /dev/null >+++ b/app-emulation/open-vm-tools/files/06_11.2.5-rename-poll_h.patch >@@ -0,0 +1,88 @@ >+From 5b45a812a5a3e9509021043f83529cccc13af26a Mon Sep 17 00:00:00 2001 >+From: Natanael Copa <ncopa@alpinelinux.org> >+Date: Tue, 17 Nov 2015 10:57:31 +0000 >+Subject: [PATCH] Rename poll.h to vm_poll.h >+ >+musl libc's system headers pulls in open-vm-tools' poll.h. To avoid this >+we rename poll.h to vm_poll.h. >+ >+Signed-off-by: Natanael Copa <ncopa@alpinelinux.org> >+--- >+ open-vm-tools/lib/asyncsocket/asyncsocket.c | 2 +- >+ open-vm-tools/lib/hgfsServer/hgfsServer.c | 2 +- >+ open-vm-tools/lib/include/asyncsocket.h | 2 +- >+ open-vm-tools/lib/include/pollImpl.h | 2 +- >+ open-vm-tools/lib/include/{poll.h => vm_poll.h} | 0 >+ open-vm-tools/lib/rpcIn/rpcin.c | 2 +- >+ 6 files changed, 5 insertions(+), 5 deletions(-) >+ rename open-vm-tools/lib/include/{poll.h => vm_poll.h} (100%) >+ >+diff --git a/open-vm-tools/lib/asyncsocket/asyncsocket.c b/open-vm-tools/lib/asyncsocket/asyncsocket.c >+index 05147d2e5..493824af8 100644 >+--- a/open-vm-tools/lib/asyncsocket/asyncsocket.c >++++ b/open-vm-tools/lib/asyncsocket/asyncsocket.c >+@@ -87,7 +87,7 @@ >+ #include "random.h" >+ #include "asyncsocket.h" >+ #include "asyncSocketBase.h" >+-#include "poll.h" >++#include "vm_poll.h" >+ #include "log.h" >+ #include "err.h" >+ #include "hostinfo.h" >+diff --git a/open-vm-tools/lib/hgfsServer/hgfsServer.c b/open-vm-tools/lib/hgfsServer/hgfsServer.c >+index 98f5b3f06..b436f0c7e 100644 >+--- a/open-vm-tools/lib/hgfsServer/hgfsServer.c >++++ b/open-vm-tools/lib/hgfsServer/hgfsServer.c >+@@ -51,7 +51,7 @@ >+ #include "hgfsDirNotify.h" >+ #include "hgfsThreadpool.h" >+ #include "userlock.h" >+-#include "poll.h" >++#include "vm_poll.h" >+ #include "mutexRankLib.h" >+ #include "vm_basic_asm.h" >+ #include "unicodeOperations.h" >+diff --git a/open-vm-tools/lib/include/asyncsocket.h b/open-vm-tools/lib/include/asyncsocket.h >+index 47b5b873f..b8b0149e7 100644 >+--- a/open-vm-tools/lib/include/asyncsocket.h >++++ b/open-vm-tools/lib/include/asyncsocket.h >+@@ -171,7 +171,7 @@ typedef struct AsyncSocket AsyncSocket; >+ * Or the client can specify its favorite poll class and locking behavior. >+ * Use of IVmdbPoll is only supported for regular sockets and for Attach. >+ */ >+-#include "poll.h" >++#include "vm_poll.h" >+ struct IVmdbPoll; >+ typedef struct AsyncSocketPollParams { >+ int flags; /* Default 0, only POLL_FLAG_NO_BULL is valid */ >+diff --git a/open-vm-tools/lib/include/pollImpl.h b/open-vm-tools/lib/include/pollImpl.h >+index 46442e556..8bc669970 100644 >+--- a/open-vm-tools/lib/include/pollImpl.h >++++ b/open-vm-tools/lib/include/pollImpl.h >+@@ -44,7 +44,7 @@ >+ #define INCLUDE_ALLOW_USERLEVEL >+ #include "includeCheck.h" >+ >+-#include "poll.h" >++#include "vm_poll.h" >+ #include "vm_basic_asm.h" >+ >+ #if defined(__cplusplus) >+diff --git a/open-vm-tools/lib/include/poll.h b/open-vm-tools/lib/include/vm_poll.h >+similarity index 100% >+rename from open-vm-tools/lib/include/poll.h >+rename to open-vm-tools/lib/include/vm_poll.h >+diff --git a/open-vm-tools/lib/rpcIn/rpcin.c b/open-vm-tools/lib/rpcIn/rpcin.c >+index 8b1fe759d..f22fcd402 100644 >+--- a/open-vm-tools/lib/rpcIn/rpcin.c >++++ b/open-vm-tools/lib/rpcIn/rpcin.c >+@@ -57,7 +57,7 @@ >+ >+ #if defined(VMTOOLS_USE_VSOCKET) >+ # include <glib.h> >+-# include "poll.h" >++# include "vm_poll.h" >+ # include "asyncsocket.h" >+ # include "vmci_defs.h" >+ #include "dataMap.h" >diff --git a/app-emulation/open-vm-tools/files/07_11.2.5-off64_t.patch b/app-emulation/open-vm-tools/files/07_11.2.5-off64_t.patch >new file mode 100644 >index 00000000000..d401cff189c >--- /dev/null >+++ b/app-emulation/open-vm-tools/files/07_11.2.5-off64_t.patch >@@ -0,0 +1,107 @@ >+From f3b2411990290c55a48a81c7deaf3733404f6cce Mon Sep 17 00:00:00 2001 >+From: Natanael Copa <ncopa@alpinelinux.org> >+Date: Mon, 2 Jan 2017 15:25:32 +0000 >+Subject: [PATCH] use off64_t instead of loff_t >+ >+--- >+ open-vm-tools/vmhgfs-fuse/file.c | 12 ++++++------ >+ open-vm-tools/vmhgfs-fuse/fsutil.c | 2 +- >+ open-vm-tools/vmhgfs-fuse/fsutil.h | 8 ++------ >+ 3 files changed, 9 insertions(+), 13 deletions(-) >+ >+diff --git a/open-vm-tools/vmhgfs-fuse/file.c b/open-vm-tools/vmhgfs-fuse/file.c >+index e56d621db..43259cf6f 100644 >+--- a/open-vm-tools/vmhgfs-fuse/file.c >++++ b/open-vm-tools/vmhgfs-fuse/file.c >+@@ -547,7 +547,7 @@ static int >+ HgfsDoRead(HgfsHandle handle, // IN: Handle for this file >+ char *buf, // OUT: Buffer to copy data into >+ size_t count, // IN: Number of bytes to read >+- loff_t offset) // IN: Offset at which to read >++ off64_t offset) // IN: Offset at which to read >+ { >+ HgfsReq *req; >+ HgfsOp opUsed; >+@@ -708,11 +708,11 @@ ssize_t >+ HgfsRead(struct fuse_file_info *fi, // IN: File info struct >+ char *buf, // OUT: User buffer to copy data into >+ size_t count, // IN: Number of bytes to read >+- loff_t offset) // IN: Offset at which to read >++ off64_t offset) // IN: Offset at which to read >+ { >+ int result = 0; >+ char *buffer = buf; >+- loff_t curOffset = offset; >++ off64_t curOffset = offset; >+ size_t nextCount, remainingCount = count; >+ uint32 maxIOSize = HgfsMaxIOSize(); >+ >+@@ -769,7 +769,7 @@ static int >+ HgfsDoWrite(HgfsHandle handle, // IN: Handle for the file >+ const char *buf, // IN: Buffer containing data >+ size_t count, // IN: Number of bytes to write >+- loff_t offset) // IN: Offset to begin writing at >++ off64_t offset) // IN: Offset to begin writing at >+ { >+ HgfsReq *req; >+ int result = 0; >+@@ -893,11 +893,11 @@ ssize_t >+ HgfsWrite(struct fuse_file_info *fi, // IN: File info structure >+ const char *buf, // OUT: User buffer to copy data into >+ size_t count, // IN: Number of bytes to read >+- loff_t offset) // IN: Offset at which to read >++ off64_t offset) // IN: Offset at which to read >+ { >+ int result; >+ const char *buffer = buf; >+- loff_t curOffset = offset; >++ off64_t curOffset = offset; >+ size_t nextCount, remainingCount = count; >+ ssize_t bytesWritten = 0; >+ uint32 maxIOSize = HgfsMaxIOSize(); >+diff --git a/open-vm-tools/vmhgfs-fuse/fsutil.c b/open-vm-tools/vmhgfs-fuse/fsutil.c >+index fe4e4e83a..ccc755d75 100644 >+--- a/open-vm-tools/vmhgfs-fuse/fsutil.c >++++ b/open-vm-tools/vmhgfs-fuse/fsutil.c >+@@ -694,7 +694,7 @@ HgfsStatusConvertToLinux(HgfsStatus hgfsStatus) // IN: Status code to convert >+ unsigned long >+ HgfsCalcBlockSize(uint64 tsize) >+ { >+- loff_t used = (tsize + 511) >> 9; >++ off64_t used = (tsize + 511) >> 9; >+ return (used > ULONG_MAX) ? ULONG_MAX : used; >+ } >+ >+diff --git a/open-vm-tools/vmhgfs-fuse/fsutil.h b/open-vm-tools/vmhgfs-fuse/fsutil.h >+index 34b6d489a..a75cff82f 100644 >+--- a/open-vm-tools/vmhgfs-fuse/fsutil.h >++++ b/open-vm-tools/vmhgfs-fuse/fsutil.h >+@@ -32,10 +32,6 @@ >+ #include "hgfsProto.h" >+ #include <fuse.h> >+ >+-#if defined(__FreeBSD__) || defined(__SOLARIS__) || defined(__APPLE__) >+-typedef long long loff_t; >+-#endif >+- >+ /* >+ * Struct used to pass around attributes. >+ * These aren't just the attributes seen in HgfsAttr[V2]; we add a filename >+@@ -73,7 +69,7 @@ ssize_t >+ HgfsWrite(struct fuse_file_info *fi, >+ const char *buf, >+ size_t count, >+- loff_t offset); >++ off64_t offset); >+ >+ int >+ HgfsRename(const char* from, const char* to); >+@@ -93,7 +89,7 @@ ssize_t >+ HgfsRead(struct fuse_file_info *fi, >+ char *buf, >+ size_t count, >+- loff_t offset); >++ off64_t offset); >+ >+ int >+ HgfsSetattr(const char* path, >diff --git a/app-emulation/open-vm-tools/files/08_11.2.5-resolv_compat.patch b/app-emulation/open-vm-tools/files/08_11.2.5-resolv_compat.patch >new file mode 100644 >index 00000000000..7283b17a2ed >--- /dev/null >+++ b/app-emulation/open-vm-tools/files/08_11.2.5-resolv_compat.patch >@@ -0,0 +1,46 @@ >+diff -uNr a/open-vm-tools/lib/nicInfo/nicInfoPosix.c b/open-vm-tools/lib/nicInfo/nicInfoPosix.c >+--- a/open-vm-tools/lib/nicInfo/nicInfoPosix.c 2020-12-17 14:11:31.000000000 -0600 >++++ b/open-vm-tools/lib/nicInfo/nicInfoPosix.c 2022-01-05 09:51:45.000000000 -0600 >+@@ -61,6 +61,9 @@ >+ #include <netinet/in.h> >+ #include <arpa/nameser.h> >+ #include <resolv.h> >++#if defined(__linux__) && !defined(__GLIBC__) >++# include "resolv_compat.h" >++#endif >+ >+ #ifdef __linux__ >+ # include <net/if.h> >+diff -uNr a/open-vm-tools/lib/nicInfo/resolv_compat.h b/open-vm-tools/lib/nicInfo/resolv_compat.h >+--- a/open-vm-tools/lib/nicInfo/resolv_compat.h 1969-12-31 18:00:00.000000000 -0600 >++++ b/open-vm-tools/lib/nicInfo/resolv_compat.h 2022-01-05 09:47:05.000000000 -0600 >+@@ -0,0 +1,29 @@ >++#if !defined(__GLIBC__) >++/*************************************************************************** >++ * resolv_compat.h >++ * >++ * Mimick GLIBC's res_ninit() and res_nclose() for musl libc >++ * Note: res_init() is actually deprecated according to >++ * http://docs.oracle.com/cd/E36784_01/html/E36875/res-nclose-3resolv.html >++ **************************************************************************/ >++#include <string.h> >++ >++static inline int res_ninit(res_state statp) >++{ >++ int rc = res_init(); >++ if (statp != &_res) { >++ memcpy(statp, &_res, sizeof(*statp)); >++ } >++ return rc; >++} >++ >++static inline int res_nclose(res_state statp) >++{ >++ if (!statp) >++ return -1; >++ if (statp != &_res) { >++ memset(statp, 0, sizeof(*statp)); >++ } >++ return 0; >++} >++#endif >diff --git a/app-emulation/open-vm-tools/files/09_11.2.5-unistd.patch b/app-emulation/open-vm-tools/files/09_11.2.5-unistd.patch >new file mode 100644 >index 00000000000..af4f279c68c >--- /dev/null >+++ b/app-emulation/open-vm-tools/files/09_11.2.5-unistd.patch >@@ -0,0 +1,21 @@ >+diff -uNr a/open-vm-tools/vgauth/lib/netPosix.c b/open-vm-tools/vgauth/lib/netPosix.c >+--- a/open-vm-tools/vgauth/lib/netPosix.c 2020-12-17 14:11:31.000000000 -0600 >++++ b/open-vm-tools/vgauth/lib/netPosix.c 2022-01-05 10:06:43.000000000 -0600 >+@@ -27,7 +27,6 @@ >+ #include <sys/socket.h> >+ #include <sys/stat.h> >+ #include <unistd.h> >+-#include <sys/unistd.h> >+ #include <sys/un.h> >+ #include <netinet/in.h> >+ #include <arpa/inet.h> >+--- a/open-vm-tools/vgauth/serviceImpl/netPosix.c 2020-12-17 14:11:31.000000000 -0600 >++++ b/open-vm-tools/vgauth/serviceImpl/netPosix.c 2022-01-05 10:13:27.000000000 -0600 >+@@ -27,7 +27,6 @@ >+ #include <sys/socket.h> >+ #include <sys/stat.h> >+ #include <unistd.h> >+-#include <sys/unistd.h> >+ #include <sys/un.h> >+ #include <netinet/in.h> >+ #include <arpa/inet.h> >diff --git a/app-emulation/open-vm-tools/files/10_11.2.5-uint.patch b/app-emulation/open-vm-tools/files/10_11.2.5-uint.patch >new file mode 100644 >index 00000000000..d755cb5e925 >--- /dev/null >+++ b/app-emulation/open-vm-tools/files/10_11.2.5-uint.patch >@@ -0,0 +1,19 @@ >+diff -uNr a/open-vm-tools/vgauth/common/vmxlog.c b/open-vm-tools/vgauth/common/vmxlog.c >+--- a/open-vm-tools/vgauth/common/vmxlog.c 2020-12-17 14:11:31.000000000 -0600 >++++ b/open-vm-tools/vgauth/common/vmxlog.c 2022-01-05 10:41:41.000000000 -0600 >+@@ -77,13 +77,12 @@ >+ typedef unsigned __int64 uint64; >+ >+ #endif >+-#ifdef __linux__ >++#if defined(__linux__) && defined(__GLIBC__) >+ typedef __uint32_t uint32; >+ typedef __uint64_t uint64; >+ >+ #define SOCKET int >+-#endif >+-#ifdef sun >++#elif defined(__linux__) || defined(sun) >+ typedef uint32_t uint32; >+ typedef uint64_t uint64; >+ >diff --git a/app-emulation/open-vm-tools/open-vm-tools-11.3.5_p18557794.ebuild b/app-emulation/open-vm-tools/open-vm-tools-11.3.5_p18557794.ebuild >index 02e927c472d..ddb3c33c7f6 100644 >--- a/app-emulation/open-vm-tools/open-vm-tools-11.3.5_p18557794.ebuild >+++ b/app-emulation/open-vm-tools/open-vm-tools-11.3.5_p18557794.ebuild >@@ -83,6 +83,18 @@ pkg_setup() { > > src_prepare() { > eapply -p2 "${PATCHES[@]}" >+ if use elibc_musl; then >+ eapply -p2 "${FILESDIR}/01_11.2.5-not-glibc.patch" >+ eapply -p2 "${FILESDIR}/02_11.2.5-struct-timespec.patch" >+ eapply -p2 "${FILESDIR}/03_11.2.5-ALLPERMS-ACCESSPERMS.patch" >+ eapply -p2 "${FILESDIR}/04_11.2.5-configure.patch" >+ eapply -p2 "${FILESDIR}/05_11.2.5-sys_stat_h.patch" >+ eapply -p2 "${FILESDIR}/06_11.2.5-rename-poll_h.patch" >+ eapply -p2 "${FILESDIR}/07_11.2.5-off64_t.patch" >+ eapply -p2 "${FILESDIR}/08_11.2.5-resolv_compat.patch" >+ eapply -p2 "${FILESDIR}/09_11.2.5-unistd.patch" >+ eapply -p2 "${FILESDIR}/10_11.2.5-uint.patch" >+ fi > eapply_user > eautoreconf > } >diff --git a/app-emulation/open-vm-tools/open-vm-tools-12.0.5_p19716617.ebuild b/app-emulation/open-vm-tools/open-vm-tools-12.0.5_p19716617.ebuild >index 29730afa69b..7ca155e7e41 100644 >--- a/app-emulation/open-vm-tools/open-vm-tools-12.0.5_p19716617.ebuild >+++ b/app-emulation/open-vm-tools/open-vm-tools-12.0.5_p19716617.ebuild >@@ -83,6 +83,18 @@ pkg_setup() { > > src_prepare() { > eapply -p2 "${PATCHES[@]}" >+ if use elibc_musl; then >+ eapply -p2 "${FILESDIR}/01_11.2.5-not-glibc.patch" >+ eapply -p2 "${FILESDIR}/02_11.2.5-struct-timespec.patch" >+ eapply -p2 "${FILESDIR}/03_11.2.5-ALLPERMS-ACCESSPERMS.patch" >+ eapply -p2 "${FILESDIR}/04_11.2.5-configure.patch" >+ eapply -p2 "${FILESDIR}/05_11.2.5-sys_stat_h.patch" >+ eapply -p2 "${FILESDIR}/06_11.2.5-rename-poll_h.patch" >+ eapply -p2 "${FILESDIR}/07_11.2.5-off64_t.patch" >+ eapply -p2 "${FILESDIR}/08_11.2.5-resolv_compat.patch" >+ eapply -p2 "${FILESDIR}/09_11.2.5-unistd.patch" >+ eapply -p2 "${FILESDIR}/10_11.2.5-uint.patch" >+ fi > eapply_user > eautoreconf > } >-- >2.35.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 862795
:
796549
|
796687
|
796690
|
796693
|
796696
|
796699
|
796702
|
796705
|
796708
|
796711
|
796714
| 796720