Skip to content

Allow hyperlight-host to build with x86_64-unknown-linux-musl target #601

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 12, 2025

Conversation

simongdavies
Copy link
Contributor

This pull request introduces support for building with the musl libc target, updates syscall handling for compatibility, and adds conditional compilation for thread ID initialization. Below is a summary of the most important changes:

Build System Enhancements:

  • Added a new build-with-musl-libc target in the Justfile to enable building with the musl libc target (x86_64-unknown-linux-musl). This includes adding the required Rust target and building with the appropriate profile.

Conditional Compilation for musl:

  • Updated the LinuxInterruptHandle initialization in HypervLinuxDriver to conditionally define the tid field based on whether the target is musl or not. This ensures compatibility with the musl libc environment.
  • Applied the same conditional logic for the tid field in the KVMDriver to maintain consistency across hypervisor implementations.

Syscall Handling:

  • Modified the syscalls_allowlist function to use try_into() for converting libc::TCGETS to ensure type safety and compatibility with stricter environments.

ludfjig
ludfjig previously approved these changes Jun 11, 2025
@simongdavies simongdavies force-pushed the build-with-musl branch 2 times, most recently from b58fa76 to 60c5b35 Compare June 11, 2025 19:55
Copy link
Contributor

@dblnz dblnz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@simongdavies simongdavies merged commit 0e0f38f into hyperlight-dev:main Jun 12, 2025
45 of 114 checks passed
ludfjig pushed a commit that referenced this pull request Jun 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bugfix For PRs that fix bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants