Stream: git-wasmtime

Topic: wasmtime / issue #8895 Cranelift: jit: "region" "2.2.0" d...


view this post on Zulip Wasmtime GitHub notifications bot (Jul 02 2024 at 12:16):

FrankReh added the bug label to Issue #8895.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 02 2024 at 12:16):

FrankReh added the cranelift label to Issue #8895.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 02 2024 at 12:16):

FrankReh opened issue #8895:

region 2.2.0 is from four years ago. Don't know if it was intended to compile on OpenBSD back then but it doesn't today.

The most recent version is 3.0.2 and it does compile for OpenBSD 7.5. But some things about the API have changed and trying to call cargo test --release on wasmtime fails to compile:

   Compiling cranelift-jit v0.110.0 (/home/frank/forks/wasmtime/cranelift/jit)
error[E0308]: mismatched types
  --> cranelift/jit/src/memory.rs:39:45
   |
39 |         let alloc_size = region::page::ceil(size);
   |                          ------------------ ^^^^ expected `*const _`, found `usize`
   |                          |
   |                          arguments to this function are incorrect
   |
   = note: expected raw pointer `*const _`
                     found type `usize`
note: function defined here
  --> /home/frank/.cargo/registry/src/index.crates.io-6f17d22bba15001f/region-3.0.2/src/page.rs:54:8
   |
54 | pub fn ceil<T>(address: *const T) -> *const T {
   |        ^^^^

error[E0308]: mismatched types
   --> cranelift/jit/src/memory.rs:40:27
    |
40  |         MmapMut::map_anon(alloc_size).map(|mut mmap| {
    |         ----------------- ^^^^^^^^^^ expected `usize`, found `*const _`
    |         |
    |         arguments to this function are incorrect
    |
    = note:     expected type `usize`
            found raw pointer `*const _`
note: associated function defined here
   --> /home/frank/.cargo/registry/src/index.crates.io-6f17d22bba15001f/memmap2-0.2.3/src/lib.rs:658:12
    |
658 |     pub fn map_anon(length: usize) -> Result<MmapMut> {
    |            ^^^^^^^^

error[E0308]: mismatched types
  --> cranelift/jit/src/memory.rs:46:22
   |
46 |                 len: alloc_size,
   |                      ^^^^^^^^^^ expected `usize`, found `*const _`
   |
   = note:     expected type `usize`
           found raw pointer `*const _`

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

FrankReh commented on issue #8895:

The change may be as simple as changing the type. Seems to be what occurred in the 02a1d481 commit to region.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 02 2024 at 21:34):

FrankReh commented on issue #8895:

This seems to make the compiler happy. Still working out other test issues on OpenBSD so am not sure.

-        let alloc_size = region::page::ceil(size);
+        let alloc_size = region::page::ceil(size as *const ()) as usize;


Last updated: Nov 22 2024 at 16:03 UTC