Skip to content

Bring several fixes for broader musl compatibility - #793

Open
Itxaka wants to merge 11 commits into
vmware:masterfrom
Itxaka:master
Open

Bring several fixes for broader musl compatibility#793
Itxaka wants to merge 11 commits into
vmware:masterfrom
Itxaka:master

Conversation

@Itxaka

@Itxaka Itxaka commented May 26, 2026

Copy link
Copy Markdown

Currently, open-vm-tools cannot be built under musl without carrying a number of small compatibility patches. Several downstream projects already maintain patches for this, which suggests there is existing interest in making musl builds work out of the box.

In particular, Alpine has done a lot of work in this area, especially @ncopa, who put together and maintained fixes for many of the compatibility issues. There was also an earlier PR for this work: #557. Unfortunately, that PR did not get merged and is now quite outdated.

Rather than having downstreams continue to carry separate patch sets, I think it would be valuable to bring this work upstream and make open-vm-tools build cleanly under musl by default. This would improve the developer and user experience for musl-based distributions and make the maintenance burden smaller for everyone involved.

Given that musl-based environments are still actively used and supported by distributions such as Alpine, it would be great to make this a first-class upstream-supported build target instead of requiring downstream patch stacks.

Open to changes, redoing and resend of this patches. Let me know and I am willing to rework any part of this PR, send in smaller batches and whatnot so we can get this in :D

Itxaka added 11 commits May 26, 2026 14:51
- Introduced `--disable-werror` option to control the use of -Werror during compilation
- Default behavior remains to enable -Werror for stricter error checking
- This change allows users to disable -Werror if they prefer to compile with warnings

Authored-by: Natanael Copa <ncopa@alpinelinux.org>
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.

Authored-by: Natanael Copa <ncopa@alpinelinux.org>
Use the configure script to test for struct time spec instead of trying to keep track of what platforms has it.

Authored-by: Natanael Copa <ncopa@alpinelinux.org>
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.

Authored-by: Natanael Copa <ncopa@alpinelinux.org>
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.

Authored-by: Natanael Copa <ncopa@alpinelinux.org>
This is needed for musl libc.

Authored-by: Natanael Copa <ncopa@alpinelinux.org>
This is needed for musl libc.

Authored-by: Natanael Copa <ncopa@alpinelinux.org>
- Added <stdio.h> to errPosix.c to ensure proper error handling functionality
- Changed the error handling mechanism to use strerror_r only for non-GLIBC systems
- This ensures compatibility with platforms that do not support GLIBC, improving portability
- Undefine g_free to provide a stub symbol for GLib versions >= 2.78
- This change ensures compatibility with fortify macros in newer GLib versions
- Introduced `resolv_compat.h` to provide GLIBC-like functionality for `res_ninit()` and `res_nclose()` when using musl libc.
- Updated `nicInfoPosix.c` to include this compatibility header conditionally based on the libc being used.
@steve-goddard-brcm

Copy link
Copy Markdown

Thanks for reporting. I have filed an internal PR for this, and will see where it goes.

@Itxaka

Itxaka commented Jun 22, 2026

Copy link
Copy Markdown
Author

Hey @steve-goddard-brcm is there any update on this? Any changes needed or any idea if this can be merged at some point?

Thanks!

@legal-compliance-bot

Copy link
Copy Markdown

🛑 Legal Compliance Check Failed

Hi @Itxaka, thank you for your contribution!

To merge this Pull Request, you must sign our CLA.

Note: Even if you signed off your commits locally (using git commit -s), you must post the comment below to register your signature with our automated system.
Note: This is a one-time process. Once signed, future contributions to this repository will be verified automatically.

1. Read the Document: Click here to read the CLA
2. Sign via Comment: Copy and paste the exact line below into a new comment on this Pull Request:

I have read the CLA Document and I hereby sign the CLA for this and all future contributions.

⏳ Processing Schedule:
Our 'Compliance Sweeper' runs automatically approximately every 15-20 minutes.
After you post the comment, your status will update automatically during the next scheduled run.
You do not need to take any further action.

@Itxaka Itxaka closed this Aug 3, 2026
@Itxaka Itxaka reopened this Aug 3, 2026
@vmware vmware deleted a comment from legal-compliance-bot Bot Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants