Skip to content

fix build on musl - #167

Open
clan wants to merge 2 commits into
intel:mainfrom
clan:musl
Open

clan wants to merge 2 commits into
intel:mainfrom
clan:musl

Conversation

@clan

@clan clan commented Nov 4, 2026

Copy link
Copy Markdown

fix build on musl

clan added 2 commits November 4, 2026 20:13
GLIBC_VERSION_AT_LEAST and __GLIBC_PREREQ are glibc-specific
macros and cause build failures on musl. Use HAVE_CLOCK_GETTIME
instead, which is already detected by Autotools.

TIMEVAL_TO_TIMESPEC is a GNU/BSD extension unavailable on musl.
Replace it with the equivalent inline conversion.

Include config.h in both source files to make the Autotools
feature-test macros available.

Signed-off-by: Z. Liu <zhixu.liu@gmail.com>
GLIBC_VERSION_AT_LEAST is glibc-specific and prevents the code from
using getrandom() when building against musl.

Use HAVE_GETRANDOM instead to detect the availability of getrandom()
through Autotools, allowing both glibc and musl builds to use the
system implementation when available.

Signed-off-by: Z. Liu <zhixu.liu@gmail.com>
@clan clan changed the title Musl fix build on musl Nov 4, 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.

1 participant