You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
"Unsupported ELF header" when running Go-compiled WASM #200
Modify examples/helloworld/main.rs to include the new test case:
fnmain() -> Result<()>{let tests = [("HelloWorld.aot","HelloWorld","Message from Rust Example to Wasm Function".to_string(),),("RunWasm.aot","Echo","Message from Rust Example to Wasm Function".to_string(),),// New test case (Go WASM)("testhyperlight-go.wasm","noReturnCal","Message from Rust Example to Wasm Function".to_string(),),];// ... (rest of the test logic)}
Run the example and observe the error:
Result from calling HelloWorld Function in Wasm Module test case 0) is: 0
Result from calling Echo Function in Wasm Module test case 1) is: Message from Rust Example to Wasm Function
Error: GuestError(GuestError, "Error: failed to parse precompiled artifact as an ELF\n\nCaused by:\n Unsupported ELF header")
Questions
Does hyperlight-wasm currently support WASM files compiled with another compiler?
Hyperlight provide wasm-clang-builder to compile C file , but does hyperlight compatible with Go-compiled WASM (with WASI support, such as GOOS=wasip1 GOARCH=wasm go build).
If not, are there any possible modifications that can make hyperlight-wasm work with Go-compiled WASM?
Activity
jsturtevant commentedon Sep 15, 2025
Hyperlight-wasm runs pre-compiled wasm. You will need to use the provided aot-compiler.
You can install it with
cargo install hyperlight-wasm-aotthen use it like:You then provide the
.cwasmto hyperlight. It looks like we need better docs on how to get this working. You can also see some of the steps here: https://github.com/hyperlight-dev/hyperlight-wasm-calculator-example