-
Notifications
You must be signed in to change notification settings - Fork 157
Fix fp ABI for C guest #1192
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
Fix fp ABI for C guest #1192
Conversation
760b5d9 to
306feb1
Compare
b665e69 to
282eb21
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes the float ABI mismatch in the C guest path by switching the guest C API build to use cargo hyperlight build (which selects the correct target/ABI), and re-enables the previously ignored float roundtrip test with comparisons that tolerate FlatBuffers’ -0.0 behavior.
Changes:
- Build
hyperlight_guest_capiviacargo hyperlight buildand update artifact paths tox86_64-hyperlight-none. - Re-enable
float_roundtripand adjust float comparisons to handle-0.0andNaN. - Update a test guest lockfile dependency (
quote1.0.43 → 1.0.44).
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/tests/rust_guests/witguest/Cargo.lock | Bumps quote dependency version/checksum in the witguest lockfile. |
| src/hyperlight_host/tests/sandbox_host_tests.rs | Un-ignores float_roundtrip and adjusts float equality checks for -0.0/NaN. |
| src/hyperlight_guest_capi/.cargo/config.toml | Removes hardcoded target/profile panic settings so builds are driven by cargo-hyperlight. |
| c.just | Switches C API build to cargo hyperlight build and updates link search path to the new target dir. |
| Justfile | Updates packaged static lib paths to target/x86_64-hyperlight-none/.... |
8e67f8e to
ee7312d
Compare
Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
ee7312d to
9b2429f
Compare
Great find! I've was wondering why this was still failing. Specifically this means that it was using C was using xxm registers and rust was using soft-float because it was built in no std? With Cargo hyperlight the rust code will use the xxm registers which aligns with the c code. |
dblnz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Good catch!
Update guest C api to use
cargo hyperlight buildwhich will use the right target. This fixes the previous ABI mismatch where clang used fp registers to pass floats, but rust didn't.Note: To compile simpleguest/main.c, we're still using clang's
x86_64-unknown-linux-nonetargetCloses #179
** For the curious, a small repro can be found here https://github.com/ludfjig/float-abi-test