Skip to content

Cleanup of win64 and alike ABI usage and MSVC legacy #499

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 12 commits into from
May 16, 2025

Conversation

danbugs
Copy link
Contributor

@danbugs danbugs commented May 16, 2025

See individual commit messages for more details.

@danbugs danbugs added the kind/refactor For PRs that restructure or remove code without adding new functionality. label May 16, 2025
danbugs added 12 commits May 15, 2025 19:39
Now, because we no longer support building the guest library for MSVC, we directly
specify to use 'x86_64-unknown-none' for it in the script. Otherwise, on Windows,
as is, we'd try to use MSVC.

Signed-off-by: danbugs <[email protected]>
Our implementations of setjmp and longjmp conformed to the win64 ABI. With removal of PE support, we can leverage
 musl's implementation instead.

Signed-off-by: danbugs <[email protected]>
chkstk was a dependency of the msvc toolchain. With PE support removed, we can get rid of it.

Signed-off-by: danbugs <[email protected]>
We used the sysv64 ABI for exception stuff. This ABI is not available for every target so having it there
unconditionally makes the hyperlight_guest lib not be compilable to said targets. This commit changes the ABI to "C"
(i.e., smt more commonly used) and gates it behind a x86_64 cfg as the assembly code is dependent on 64-bit
architectures.

Signed-off-by: danbugs <[email protected]>
Originally, because we only supported PE, our entrypoint used the win64 ABI. Now, with PE file support being
removed, we can use an ABI that wouldn't be restrictive in compiling the guest library to targets that don't
support the win64 ABI.

Signed-off-by: danbugs <[email protected]>
Similar to the entrypoint change in the previous commit, we can change the ABI of the dispatch function.

Signed-off-by: danbugs <[email protected]>
__CxxFrameHandler3 and _fltused were symbols only required by the msvc toolchain and can now be removed.

Signed-off-by: danbugs <[email protected]>
…of __security_cookie symbol

The __security_cookie symbol and its usage were only required by the MSVC toolchain. W/ the removal of PE support,
we can remove it from the guest lib.

Signed-off-by: danbugs <[email protected]>
…rgo/config.toml of test guests

W/ PE support removed, these are no longer needed or correct.

Signed-off-by: danbugs <[email protected]>
In particular, I am removing the instructions related to installing the msvc target to compile the guests to PE.

Signed-off-by: danbugs <[email protected]>
…container

W/ PE support removed, our .devcontainer no longer needs the msvc target installed.

Signed-off-by: danbugs <[email protected]>
@danbugs danbugs force-pushed the cleanup-abi-usage-and-msvc-legacy branch from 3f916aa to 43bcf6e Compare May 16, 2025 02:40
Copy link
Contributor

@ludfjig ludfjig left a comment

Choose a reason for hiding this comment

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

looks good to me

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

@danbugs danbugs merged commit 43bcf6e into hyperlight-dev:main May 16, 2025
27 checks passed
@danbugs danbugs deleted the cleanup-abi-usage-and-msvc-legacy branch May 16, 2025 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/refactor For PRs that restructure or remove code without adding new functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants