Stream: git-wasmtime

Topic: wasmtime / PR #12235 cranelift-assembler-x64: no_std support


view this post on Zulip Wasmtime GitHub notifications bot (Jan 01 2026 at 21:05):

the-ssd opened PR #12235 from the-ssd:cranelift-nostd-assembler to bytecodealliance:main:

Part of #12222, slightly refactored. Related to #1158.

Adds support for no_std compilation of cranelift-assmebler-x64. Required for cranelift-codegen to support no_std compilation.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 01 2026 at 21:05):

the-ssd requested fitzgen for a review on PR #12235.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 01 2026 at 21:05):

the-ssd requested wasmtime-default-reviewers for a review on PR #12235.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 01 2026 at 21:05):

the-ssd requested wasmtime-compiler-reviewers for a review on PR #12235.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 01 2026 at 21:05):

the-ssd updated PR #12235.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 01 2026 at 21:07):

the-ssd updated PR #12235.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 01 2026 at 21:13):

the-ssd submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 01 2026 at 21:13):

the-ssd created PR review comment:

--no-default-features can be removed

view this post on Zulip Wasmtime GitHub notifications bot (Jan 01 2026 at 21:19):

the-ssd commented on PR #12235:

I guess the CI is running cargo test with all features, should I change core feature to std, or can you help me fix the CI?

view this post on Zulip Wasmtime GitHub notifications bot (Jan 01 2026 at 21:21):

bjorn3 submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 01 2026 at 21:21):

bjorn3 created PR review comment:

Maybe just make this unconditionally #![no_std]?

view this post on Zulip Wasmtime GitHub notifications bot (Jan 01 2026 at 21:23):

bjorn3 submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 01 2026 at 21:23):

bjorn3 created PR review comment:

It should be fine to not add no_std support here I think. This binary is not meant to be compiled when building something that uses Cranelift or Wasmtime anyway. And it can't do anything useful with no_std.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 01 2026 at 21:23):

bjorn3 submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 01 2026 at 21:23):

bjorn3 created PR review comment:

view this post on Zulip Wasmtime GitHub notifications bot (Jan 01 2026 at 21:24):

bjorn3 submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 01 2026 at 21:24):

bjorn3 created PR review comment:

Maybe order these above the use crate::? stdlib -> extern dependencies -> local items is a common order for use items.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 01 2026 at 21:24):

bjorn3 submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 01 2026 at 21:24):

bjorn3 created PR review comment:

use core::fmt;
use alloc::{format, string::String};

view this post on Zulip Wasmtime GitHub notifications bot (Jan 01 2026 at 21:24):

bjorn3 edited PR review comment.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 01 2026 at 21:25):

bjorn3 submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 01 2026 at 21:25):

bjorn3 created PR review comment:

use core::num::NonZeroU8;

view this post on Zulip Wasmtime GitHub notifications bot (Jan 01 2026 at 21:41):

the-ssd updated PR #12235.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 01 2026 at 21:42):

the-ssd submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 01 2026 at 21:42):

the-ssd created PR review comment:

It breaks when using fuzz, because arbitrary uses std

view this post on Zulip Wasmtime GitHub notifications bot (Jan 01 2026 at 21:43):

the-ssd submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 01 2026 at 21:43):

the-ssd created PR review comment:

Yea, but the thing is I am not sure how to do it, cause it refuses to compile without this hack

view this post on Zulip Wasmtime GitHub notifications bot (Jan 01 2026 at 21:43):

the-ssd updated PR #12235.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 01 2026 at 21:43):

the-ssd updated PR #12235.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 01 2026 at 21:45):

the-ssd updated PR #12235.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 01 2026 at 21:47):

the-ssd submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 01 2026 at 21:47):

the-ssd created PR review comment:

Reordered in bb54410

view this post on Zulip Wasmtime GitHub notifications bot (Jan 01 2026 at 21:54):

bjorn3 submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 01 2026 at 21:54):

bjorn3 created PR review comment:

If you want to check compiling cranelift-assembler-x64 try cargo build -p cranelift-assembler-x64 --lib to skip building the binary.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 01 2026 at 21:56):

bjorn3 submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 01 2026 at 21:56):

bjorn3 created PR review comment:

You could add extern crate std; to fuzz.rs and add appropriate imports. It is only compiled when testing or fuzzing anyway.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 01 2026 at 22:08):

the-ssd updated PR #12235.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 01 2026 at 22:08):

the-ssd submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 01 2026 at 22:08):

the-ssd created PR review comment:

c374cc9

view this post on Zulip Wasmtime GitHub notifications bot (Jan 01 2026 at 22:10):

the-ssd updated PR #12235.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 01 2026 at 22:10):

the-ssd created PR review comment:

afd80f1

view this post on Zulip Wasmtime GitHub notifications bot (Jan 01 2026 at 22:10):

the-ssd submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 01 2026 at 22:14):

the-ssd updated PR #12235.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 01 2026 at 22:33):

the-ssd updated PR #12235.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 01 2026 at 22:34):

the-ssd submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 01 2026 at 22:34):

the-ssd created PR review comment:

removed

view this post on Zulip Wasmtime GitHub notifications bot (Jan 02 2026 at 00:21):

the-ssd updated PR #12235.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 05 2026 at 15:50):

alexcrichton submitted PR review:

Thanks for this!

view this post on Zulip Wasmtime GitHub notifications bot (Jan 05 2026 at 16:13):

alexcrichton merged PR #12235.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 05 2026 at 16:18):

the-ssd commented on PR #12235:

@alexcrichton Thank you too! This is almost everything needed for #12222. I still am not sure if the way I deal with OnceLock is good enough to be merged (because it just recomputes MachineEnv each time). And some architectures use powi which libm doesn't have (only x86 and arm compile with no_std).

view this post on Zulip Wasmtime GitHub notifications bot (Jan 05 2026 at 21:27):

alexcrichton commented on PR #12235:

Want to rebase that PR after the recent merges and we can brainstorm over there? Should in theory be a bit easier to think about with a smaller diff

view this post on Zulip Wasmtime GitHub notifications bot (Jan 05 2026 at 21:37):

the-ssd commented on PR #12235:

@alexcrichton I have already rebased it, a lot of it is just adding prelude, fixing hashmap usage (also FxHashMap on no_std now works). Really the only thing is OnceLock. I removed it, but now it is recomputed each time. I can try to find a no_std replacement or move some stuff around in order to use sync_nostd.rs similar to the old PR.

Also I accidentally formated Cargo.toml, so maybe I should revert it

view this post on Zulip Wasmtime GitHub notifications bot (Jan 05 2026 at 21:39):

the-ssd edited a comment on PR #12235:

@alexcrichton I have already rebased it, a lot of it is are one line changes like adding prelude, fixing hashmap import (also FxHashMap on no_std now works). Really the only thing is OnceLock. I removed it, but now it's recomputed each time. I can try to find a no_std replacement or move some stuff around in order to use sync_nostd.rs like suggested in the old PR.

Also I accidentally formated Cargo.toml, so maybe I should revert it


Last updated: Jan 09 2026 at 13:15 UTC