Stream: general

Topic: wasm2obj for Wasm SIMD


view this post on Zulip Sambit Nayak (May 26 2021 at 15:32):

Hi,

I'm failing to get the native object using "wasm2obj" on a Wasm bytecode with SIMD.
The Wasm (with SIMD) was generated from C source compiled with WASI-SDK, and I can check the WAT with Wasm SIMD type/ops.

Anything I'm doing wrong here?

Wasmtime version: 0.27.0

$ wasmtime wasm2obj --cranelift --wasm-features simd sample.wasm sample.o
Error: WebAssembly failed to compile

Caused by:
0: WebAssembly translation error
1: Invalid input WebAssembly code at offset 14731: SIMD support is not enabled

Thanks & Regards,
Sambit

view this post on Zulip Alex Crichton (May 26 2021 at 15:37):

I think this is a bug in the wasm2obj command, it goes through different configuration infrastructure than wasmtime itself, and we haven't gotten around to unifying them. I think you can get this working with the deprecated --enable-simd flag, but wasm2obj isn't intended for production use right now per se

view this post on Zulip Sambit Nayak (May 26 2021 at 15:54):

Thanks @Alex Crichton - that flag worked.
Just trying to experiment/understand more with the assembly etc. so not a production situation.


Last updated: Dec 23 2024 at 12:05 UTC