Stream: git-wasmtime

Topic: wasmtime / PR #11860 Rewrite `wasmtime_fiber_init` in Rust


view this post on Zulip Wasmtime GitHub notifications bot (Oct 15 2025 at 00:57):

alexcrichton opened PR #11860 from alexcrichton:rewrite-wasmtime-fiber-init to bytecodealliance:main:

This commit updates all implementations of wasmtime_fiber_init to be defined in Rust rather than purely in inline assembly. There was never a need to define this function in inline assembly and as far as I can remember I did this originally for consistency with the other functions. The motivation for this PR is to avoid the need to figure out how to do PIC-relative addressing in wasmtime_fiber_init to get the symbol address of wasmtime_fiber_start. This has apparently never worked on i686 platforms and this is now becoming a problem on nightly Rust where LLD complains about this (and presumably the default linker didn't?).

In rewriting these functions I additionally fixed a few minor issues:

<!--
Please make sure you include the following information:

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->

view this post on Zulip Wasmtime GitHub notifications bot (Oct 15 2025 at 00:57):

alexcrichton requested dicej for a review on PR #11860.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 15 2025 at 00:57):

alexcrichton requested wasmtime-core-reviewers for a review on PR #11860.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 15 2025 at 00:59):

alexcrichton commented on PR #11860:

Specifically this assembly sequence is not how to do PIC addressing on i686. Somehow the default bfd linker papered over this but LLD does not like this. Rather than figuring out the inline assembly, which I always dread, I instead rewrote all the functions in Rust to make them easier to understand (and also force rustc to figure out PIC for me)

view this post on Zulip Wasmtime GitHub notifications bot (Oct 15 2025 at 13:29):

dicej submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 15 2025 at 13:29):

dicej created PR review comment:

Are the // rdi, // rsi, and // rdx comments relevant any more given this is no longer a naked function?

view this post on Zulip Wasmtime GitHub notifications bot (Oct 15 2025 at 14:35):

alexcrichton updated PR #11860.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 15 2025 at 14:35):

alexcrichton created PR review comment:

Oops, nope forgot to remove them

view this post on Zulip Wasmtime GitHub notifications bot (Oct 15 2025 at 14:35):

alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 15 2025 at 14:36):

alexcrichton has enabled auto merge for PR #11860.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 15 2025 at 15:21):

alexcrichton merged PR #11860.


Last updated: Dec 06 2025 at 07:03 UTC