Stream: git-wasmtime

Topic: wasmtime / issue #6177 Inline Assembly Error in helpers.c


view this post on Zulip Wasmtime GitHub notifications bot (Apr 07 2023 at 16:34):

mainini opened issue #6177:

Hi!

When building a Rust project which uses wasmtime::Engine to run WASM binaries, linking fails. Project is built as usual with cargo. The following error occurs in runtime/src/helpers.c:78: _undefined reference to `asm'_

To me, it looks like this should be an empty inline assembly statement, and effectively, replacing it with __asm(""); solves the issue.

I am unaware of the build process for helpers.c but happy to provide more details if required. OS: Linux 6.2.9, CC: GCC 12.2.1 20230201

view this post on Zulip Wasmtime GitHub notifications bot (Apr 10 2023 at 14:31):

alexcrichton commented on issue #6177:

Thanks for the report! Does https://github.com/bytecodealliance/wasmtime/pull/6188 fix compilation for you? Or is __asm required instead of __asm__?

view this post on Zulip Wasmtime GitHub notifications bot (Apr 10 2023 at 18:17):

alexcrichton closed issue #6177:

Hi!

When building a Rust project which uses wasmtime::Engine to run WASM binaries, linking fails. Project is built as usual with cargo. The following error occurs in runtime/src/helpers.c:78: _undefined reference to `asm'_

To me, it looks like this should be an empty inline assembly statement, and effectively, replacing it with __asm(""); solves the issue.

I am unaware of the build process for helpers.c but happy to provide more details if required. OS: Linux 6.2.9, CC: GCC 12.2.1 20230201

view this post on Zulip Wasmtime GitHub notifications bot (Apr 10 2023 at 20:05):

mainini commented on issue #6177:

Thanks for the quick action! Indeed, this fixes it.
As a sidenote, I've now understood why it failed in the first place: I forgot having CFLAGS="-std=c17 -Wall -Wextra -Wpedantic" in my environment by default...
Sorry for the noise - in any case it's standards compliant now ;-)


Last updated: Oct 23 2024 at 20:03 UTC