Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
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
Summary: app-emulation/open-vm-tools-12.0.5_p19716617 fails to compile (MUSL): asyncso...
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Mike Gilbert
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2022-08-01 10:55 UTC by Agostino Sarubbo
Modified: 2022-08-01 23:50 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,94.83 KB, text/plain)
2022-08-01 10:55 UTC, Agostino Sarubbo
Details
Do not assume that linux and gnu libc are the same thing (01_11.2.5-not-glibc.patch,1.06 KB, patch)
2022-08-01 20:30 UTC, CFuga
Details | Diff
Use configure test for struct timespec (02_11.2.5-struct-timespec.patch,1.51 KB, patch)
2022-08-01 20:30 UTC, CFuga
Details | Diff
Fix definition of ALLPERMS and ACCESSPERMS (03_11.2.5-ALLPERMS-ACCESSPERMS.patch,1.98 KB, patch)
2022-08-01 20:31 UTC, CFuga
Details | Diff
Use configure to test for feature instead of platform (04_11.2.5-configure.patch,4.52 KB, patch)
2022-08-01 20:32 UTC, CFuga
Details | Diff
Use configure test for sys/stat.h include (05_11.2.5-sys_stat_h.patch,818 bytes, patch)
2022-08-01 20:32 UTC, CFuga
Details | Diff
Rename poll.h to vm_poll.h (06_11.2.5-rename-poll_h.patch,3.20 KB, patch)
2022-08-01 20:33 UTC, CFuga
Details | Diff
use off64_t instead of loff_t (07_11.2.5-off64_t.patch,3.91 KB, patch)
2022-08-01 20:33 UTC, CFuga
Details | Diff
Add musl-compatible definitions for res_ninit() and res_nclose() (08_11.2.5-resolv_compat.patch,1.51 KB, patch)
2022-08-01 20:36 UTC, CFuga
Details | Diff
remove <sys/unistd.h> includes (09_11.2.5-unistd.patch,778 bytes, patch)
2022-08-01 20:37 UTC, CFuga
Details | Diff
fix uint definitions for musl libc (10_11.2.5-uint.patch,568 bytes, patch)
2022-08-01 20:38 UTC, CFuga
Details | Diff
app-emulation/open-vm-tools: support for musl libc (open-vm-tools-support-for-musl-libc.patch,27.47 KB, patch)
2022-08-01 20:56 UTC, CFuga
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2022-08-01 10:55:02 UTC
https://blogs.gentoo.org/ago/2020/07/04/gentoo-tinderbox/

Issue: app-emulation/open-vm-tools-12.0.5_p19716617 fails to compile (MUSL).
Discovered on: amd64 (internal ref: tinderbox_musl)

NOTE:
This machine uses MUSL libc
Comment 1 Agostino Sarubbo gentoo-dev 2022-08-01 10:55:05 UTC
Created attachment 796549 [details]
build.log

build log and emerge --info
Comment 2 Larry the Git Cow gentoo-dev 2022-08-01 16:05:42 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=18e535510c92807c48cf04d8a2a0475fa1ed5e36

commit 18e535510c92807c48cf04d8a2a0475fa1ed5e36
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2022-08-01 16:05:09 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2022-08-01 16:05:09 +0000

    app-emulation/open-vm-tools: fix build error on musl
    
    Closes: https://bugs.gentoo.org/862795
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 .../files/open-vm-tools-rename-poll.h.patch        | 126 +++++++++++++++++++++
 .../open-vm-tools-12.0.5_p19716617.ebuild          |   1 +
 2 files changed, 127 insertions(+)
Comment 3 Larry the Git Cow gentoo-dev 2022-08-01 16:22:04 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=02f23d6cc0c1c5b3757bde216673416da1228027

commit 02f23d6cc0c1c5b3757bde216673416da1228027
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2022-08-01 16:20:48 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2022-08-01 16:21:36 +0000

    Revert "app-emulation/open-vm-tools: fix build error on musl"
    
    Bug: https://bugs.gentoo.org/862795
    Reverts: 18e535510c92807c48cf04d8a2a0475fa1ed5e36.
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 .../files/open-vm-tools-rename-poll.h.patch        | 126 ---------------------
 .../open-vm-tools-12.0.5_p19716617.ebuild          |   1 -
 2 files changed, 127 deletions(-)

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=28a782dbeb2c6c1de0853d307a63164635da4ba9

commit 28a782dbeb2c6c1de0853d307a63164635da4ba9
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2022-08-01 16:19:48 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2022-08-01 16:21:25 +0000

    profiles/features/musl: mask app-emulation/open-vm-tools
    
    Bug: https://bugs.gentoo.org/862795
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 profiles/features/musl/package.mask | 4 ++++
 1 file changed, 4 insertions(+)
Comment 4 CFuga 2022-08-01 20:28:19 UTC
Please, don't close this bug. I was able to compile app-emulation/open-vm-tools for both versions in the Gentoo tree.

I'll attach 10 patches. Patches 1-7 come from this pull:
https://github.com/vmware/open-vm-tools/pull/557

I wrote patches 8-10.
Comment 5 CFuga 2022-08-01 20:30:11 UTC
Created attachment 796687 [details, diff]
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.
Comment 6 CFuga 2022-08-01 20:30:50 UTC
Created attachment 796690 [details, diff]
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.
Comment 7 CFuga 2022-08-01 20:31:30 UTC
Created attachment 796693 [details, diff]
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.
Comment 8 CFuga 2022-08-01 20:32:16 UTC
Created attachment 796696 [details, diff]
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
Comment 9 CFuga 2022-08-01 20:32:41 UTC
Created attachment 796699 [details, diff]
Use configure test for sys/stat.h include
Comment 10 CFuga 2022-08-01 20:33:23 UTC
Created attachment 796702 [details, diff]
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.
Comment 11 CFuga 2022-08-01 20:33:51 UTC
Created attachment 796705 [details, diff]
use off64_t instead of loff_t
Comment 13 CFuga 2022-08-01 20:37:40 UTC
Created attachment 796711 [details, diff]
remove <sys/unistd.h> includes
Comment 14 CFuga 2022-08-01 20:38:35 UTC
Created attachment 796714 [details, diff]
fix uint definitions for musl libc
Comment 15 CFuga 2022-08-01 20:56:18 UTC
Created attachment 796720 [details, diff]
app-emulation/open-vm-tools: support for musl libc

This patch is ready to apply to the Gentoo tree. It contains all the previously attached patches and the modified ebuilds.
Comment 16 Mike Gilbert gentoo-dev 2022-08-01 23:50:29 UTC
Sorry, but I'm not interested in carrying all those patches in Gentoo.

Please let me know if/when upstream merges most of the necessary patches, and we can revisit it.