Stream: git-wasmtime

Topic: wasmtime / issue #8768 riscv32imac no-std support for was...


view this post on Zulip Wasmtime GitHub notifications bot (Jun 10 2024 at 23:12):

theoparis opened issue #8768:

error[E0425]: cannot find value `NEXT_OLDER_FP_FROM_FP_OFFSET` in module `arch`
   --> C:\Users\theo\.cargo\registry\src\index.crates.io-6f17d22bba15001f\wasmtime-21.0.1\src\runtime\vm\traphandlers\backtrace.rs:248:63
    |
248 |             let next_older_fp = *(fp as *mut usize).add(arch::NEXT_OLDER_FP_FROM_FP_OFFSET);
    |                                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in `arch`

error[E0425]: cannot find function `reached_entry_sp` in module `arch`
   --> C:\Users\theo\.cargo\registry\src\index.crates.io-6f17d22bba15001f\wasmtime-21.0.1\src\runtime\vm\traphandlers\backtrace.rs:249:22
    |
249 |             if arch::reached_entry_sp(next_older_fp, trampoline_sp) {
    |                      ^^^^^^^^^^^^^^^^ not found in `arch`

error[E0277]: the trait bound `u128: From<&v128::V128>` is not satisfied
   --> C:\Users\theo\.cargo\registry\src\index.crates.io-6f17d22bba15001f\wasmtime-21.0.1\src\runtime\externals\global.rs:190:63
    |
190 |                 Val::V128(i) => *definition.as_u128_mut() = i.into(),
    |                                                               ^^^^ the trait `From<&v128::V128>` is not implemented for `u128`, which is required by `&v128::V128: Into<_>`
    |
    = help: the following other types implement trait `From<T>`:
              <u128 as From<Ipv6Addr>>
              <u128 as From<bool>>
              <u128 as From<char>>
              <u128 as From<core::ascii::Char>>
              <u128 as From<u16>>
              <u128 as From<u32>>
              <u128 as From<u64>>
              <u128 as From<u8>>
              <u128 as From<v128::V128>>
    = note: required for `&v128::V128` to implement `Into<u128>`

error[E0277]: the trait bound `u128: From<&v128::V128>` is not satisfied
  --> C:\Users\theo\.cargo\registry\src\index.crates.io-6f17d22bba15001f\wasmtime-21.0.1\src\runtime\trampoline\global.rs:37:55
   |
37 |             Val::V128(x) => *global.as_u128_mut() = x.into(),
   |                                                       ^^^^ the trait `From<&v128::V128>` is not implemented for `u128`, which is required by `&v128::V128: Into<_>`
   |
   = help: the following other types implement trait `From<T>`:
             <u128 as From<Ipv6Addr>>
             <u128 as From<bool>>
             <u128 as From<char>>
             <u128 as From<core::ascii::Char>>
             <u128 as From<u16>>
             <u128 as From<u32>>
             <u128 as From<u64>>
             <u128 as From<u8>>
             <u128 as From<v128::V128>>
   = note: required for `&v128::V128` to implement `Into<u128>`

error[E0599]: the method `expect` exists for enum `Option<V128>`, but its trait bounds were not satisfied
   --> C:\Users\theo\.cargo\registry\src\index.crates.io-6f17d22bba15001f\wasmtime-21.0.1\src\runtime\values.rs:74:25
    |
74  |               self.$get().expect(concat!("expected ", stringify!($ty)))
    |                           ^^^^^^ method cannot be called on `Option<V128>` due to unsatisfied trait bounds
...
275 | /     accessors! {
276 | |         e
277 | |         (I32(i32) i32 unwrap_i32 *e)
278 | |         (I64(i64) i64 unwrap_i64 *e)
...   |
284 | |         (V128(V128) v128 unwrap_v128 *e)
285 | |     }
    | |_____- in this macro invocation

view this post on Zulip Wasmtime GitHub notifications bot (Jun 10 2024 at 23:13):

theoparis edited issue #8768:

error: Wasmtime is being compiled for an architecture that it does not support. If this architecture is one you would like to see supported you may file an issue on Wasmtime's issue tracker: https://github.com/byt
ecodealliance/wasmtime/issues/new
  --> C:\Users\theo\.cargo\registry\src\index.crates.io-6f17d22bba15001f\wasmtime-21.0.1\src\runtime\vm\arch\mod.rs:24:9
   |
24 | /         compile_error!(
25 | |             "Wasmtime is being compiled for an architecture \
26 | |              that it does not support. If this architecture is \
27 | |              one you would like to see supported you may file an \
28 | |              issue on Wasmtime's issue tracker: \
29 | |              https://github.com/bytecodealliance/wasmtime/issues/new\
30 | |         ");
   | |__________^

error[E0432]: unresolved import `core::sync::atomic::AtomicU64`
   --> C:\Users\theo\.cargo\registry\src\index.crates.io-6f17d22bba15001f\wasmtime-21.0.1\src\runtime\store.rs:104:5
    |
104 | use core::sync::atomic::AtomicU64;
    |     ^^^^^^^^^^^^^^^^^^^^---------
    |     |                   |
    |     |                   help: a similar name exists in the module: `AtomicU32`
    |     no `AtomicU64` in `sync::atomic`

error[E0432]: unresolved import `core::sync::atomic::AtomicU64`
 --> C:\Users\theo\.cargo\registry\src\index.crates.io-6f17d22bba15001f\wasmtime-21.0.1\src\runtime\store\data.rs:8:26
  |
8 | use core::sync::atomic::{AtomicU64, Ordering::Relaxed};
  |                          ^^^^^^^^^
  |                          |
  |                          no `AtomicU64` in `sync::atomic`
  |                          help: a similar name exists in the module: `AtomicU32`
  |
  = help: consider importing this unresolved item through its public re-export instead:
          crate::store::AtomicU64

error[E0432]: unresolved import `core::sync::atomic::AtomicU64`
  --> C:\Users\theo\.cargo\registry\src\index.crates.io-6f17d22bba15001f\wasmtime-21.0.1\src\runtime\vm.rs:10:26
   |
10 | use core::sync::atomic::{AtomicU64, AtomicUsize, Ordering};
   |                          ^^^^^^^^^

...

error[E0425]: cannot find value `NEXT_OLDER_FP_FROM_FP_OFFSET` in module `arch`
   --> C:\Users\theo\.cargo\registry\src\index.crates.io-6f17d22bba15001f\wasmtime-21.0.1\src\runtime\vm\traphandlers\backtrace.rs:248:63
    |
248 |             let next_older_fp = *(fp as *mut usize).add(arch::NEXT_OLDER_FP_FROM_FP_OFFSET);
    |                                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in `arch`

error[E0425]: cannot find function `reached_entry_sp` in module `arch`
   --> C:\Users\theo\.cargo\registry\src\index.crates.io-6f17d22bba15001f\wasmtime-21.0.1\src\runtime\vm\traphandlers\backtrace.rs:249:22
    |
249 |             if arch::reached_entry_sp(next_older_fp, trampoline_sp) {
    |                      ^^^^^^^^^^^^^^^^ not found in `arch`

error[E0277]: the trait bound `u128: From<&v128::V128>` is not satisfied
   --> C:\Users\theo\.cargo\registry\src\index.crates.io-6f17d22bba15001f\wasmtime-21.0.1\src\runtime\externals\global.rs:190:63
    |
190 |                 Val::V128(i) => *definition.as_u128_mut() = i.into(),
    |                                                               ^^^^ the trait `From<&v128::V128>` is not implemented for `u128`, which is required by `&v128::V128: Into<_>`
    |
    = help: the following other types implement trait `From<T>`:
              <u128 as From<Ipv6Addr>>
              <u128 as From<bool>>
              <u128 as From<char>>
              <u128 as From<core::ascii::Char>>
              <u128 as From<u16>>
              <u128 as From<u32>>
              <u128 as From<u64>>
              <u128 as From<u8>>
              <u128 as From<v128::V128>>
    = note: required for `&v128::V128` to implement `Into<u128>`
...

view this post on Zulip Wasmtime GitHub notifications bot (Jun 10 2024 at 23:15):

theoparis commented on issue #8768:

These issues are not present with riscv64imac, however that target results in

error[E0433]: failed to resolve: use of undeclared crate or module `std`
  --> C:\Users\theo\.cargo\registry\src\index.crates.io-6f17d22bba15001f\wasmtime-21.0.1\src\runtime\vm\arch\riscv64.rs:15:9
   |
15 |         std::arch::asm!(
   |         ^^^ use of undeclared crate or module `std`

For more information about this error, try `rustc --explain E0433`.
error: could not compile `wasmtime` (lib) due to 1 previous error

view this post on Zulip Wasmtime GitHub notifications bot (Jun 10 2024 at 23:15):

theoparis edited a comment on issue #8768:

These issues are not present with riscv64imac, however that target results in the following despite having the std feature disabled.

error[E0433]: failed to resolve: use of undeclared crate or module `std`
  --> C:\Users\theo\.cargo\registry\src\index.crates.io-6f17d22bba15001f\wasmtime-21.0.1\src\runtime\vm\arch\riscv64.rs:15:9
   |
15 |         std::arch::asm!(
   |         ^^^ use of undeclared crate or module `std`

For more information about this error, try `rustc --explain E0433`.
error: could not compile `wasmtime` (lib) due to 1 previous error

view this post on Zulip Wasmtime GitHub notifications bot (Jun 10 2024 at 23:25):

cfallin commented on issue #8768:

Hi @theoparis -- as you can see here

error: Wasmtime is being compiled for an architecture that it does not support

Wasmtime doesn't (yet?) support riscv32 (of any variant). The implementation of a Cranelift backend will be the major hurdle here: as discussed in a few places, this is a pretty large (several month) project. We're happy to keep around tracking issues for currently unsupported ISAs, and I can't find one for riscv32 at the moment, so if you'd like to open one for that, feel free! However given the lack of support at this time this build error is not a bug: it's correctly reporting the lack of support.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 10 2024 at 23:29):

alexcrichton added the wasmtime:platform-support label to Issue #8768.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 16 2024 at 22:06):

xpbowler commented on issue #8768:

Hi @theoparis -- as you can see here

error: Wasmtime is being compiled for an architecture that it does not support

Wasmtime doesn't (yet?) support riscv32 (of any variant). The implementation of a Cranelift backend will be the major hurdle here: as discussed in a few places, this is a pretty large (several month) project. We're happy to keep around tracking issues for currently unsupported ISAs, and I can't find one for riscv32 at the moment, so if you'd like to open one for that, feel free! However given the lack of support at this time this build error is not a bug: it's correctly reporting the lack of support.

Hi! I'm interested on working to support RISCV32. Is this issue still open?

view this post on Zulip Wasmtime GitHub notifications bot (Sep 16 2024 at 22:22):

bjorn3 commented on issue #8768:

Yes, riscv32 hasn't been implemented yet.


Last updated: Dec 23 2024 at 12:05 UTC