Skip to content

wasmtime-runtime fails with no_std #75

Closed

Description

@boomshroom

The wasmtime-runtime crate (which wasmtime-jit depends on) has a crate feature specifying that it can be built without std, but attempting to do so fails. Looking at the code, it does appear to reference the std crate without any guards or reexports, but the bigger issue is trying to build the signal handlers, which require compiling for a target OS, something which doesn't work when using no_std.

As mentioned earlier, wasmtime-jit has wasmtime-runtime as a direct dependency, and it also provides a no_std feature.

Activity

  1. sunfishcode commented on Mar 28, 2019

    @sunfishcode
    Member

    Yes, I started adding no_std support a while ago because it's something I'm interested in, however signal handling and mmap/mprotect are two things that Wasmtime currently uses which aren't available in no_std.

    One thing we could do is have an option to disable the mmap/signal-based linear memory sandboxing, and to just tell Cranelift to do linear-memory sandboxing with bounds checking, which would fix some of the problem.

    However, the other problem is that we need mmap/mprotect to allocate JIT code and make it executable. It's not clear how we should do that in no_std code.

  2. boomshroom commented on Apr 12, 2019

    @boomshroom
    Author

    How about using a trait and asking the caller to supply implementations that would normally be handled by the host? For example, a kernel embedding would implement the linear memory allocations with direct page mapping, while the default std implementation uses mmap and mprotect.

  3. alexcrichton commented on Feb 1, 2020

    @alexcrichton
    Member

    I don't think this is relevant any more after #554, so I'm going to close this

  4. added a commit that references this issue on Dec 20, 2023
  5. added a commit that references this issue on Jan 11, 2024
  6. added a commit that references this issue on Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions