From 05dd3cb7fad3f09bf58250f43daf6400e589158b Mon Sep 17 00:00:00 2001 From: Ludvig Liljenberg Date: Fri, 31 Jan 2025 12:16:58 -0800 Subject: [PATCH] Only use general purpose registers, since clang otherwise will use XMM registers for passing floats to rust functions that don't expect it Signed-off-by: Ludvig Liljenberg --- c.just | 2 +- src/hyperlight_host/tests/sandbox_host_tests.rs | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/c.just b/c.just index 75aa3f904..73350633f 100644 --- a/c.just +++ b/c.just @@ -9,7 +9,7 @@ c-flags-release-pe := '/O2 /Gy' # Elf options # We don't support stack protectors at the moment, but Arch Linux clang auto-enables them for -linux platforms, so explicitly disable them. -c-compile-options-elf := '-nobuiltininc -H --target=x86_64-unknown-linux-none -fno-stack-protector -fstack-clash-protection -mstack-probe-size=4096' +c-compile-options-elf := '-mgeneral-regs-only -nobuiltininc -H --target=x86_64-unknown-none-elf -fPIC -fno-stack-protector -fstack-clash-protection -mstack-probe-size=4096' c-include-flags-elf := replace(c-include-flags-pe, '/I ', '-I ') c-linker-options-elf := '--entry "entrypoint" --nostdlib -pie' c-flags-debug-elf := '-O0' diff --git a/src/hyperlight_host/tests/sandbox_host_tests.rs b/src/hyperlight_host/tests/sandbox_host_tests.rs index cb8452cac..c2eba80f4 100644 --- a/src/hyperlight_host/tests/sandbox_host_tests.rs +++ b/src/hyperlight_host/tests/sandbox_host_tests.rs @@ -63,7 +63,6 @@ fn pass_byte_array() { } #[test] -#[ignore = "Fails with mismatched float only when c .exe guest?!"] #[cfg_attr(target_os = "windows", serial)] // using LoadLibrary requires serial tests fn float_roundtrip() { let doubles = [