Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 796696 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]
Use configure to test for feature instead of platform
04_11.2.5-configure.patch (text/plain), 4.52 KB, created by
CFuga
on 2022-08-01 20:32:16 UTC
(
hide
)
Description:
Use configure to test for feature instead of platform
Filename:
MIME Type:
Creator:
CFuga
Created:
2022-08-01 20:32:16 UTC
Size:
4.52 KB
patch
obsolete
>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)
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