Stream: git-wasmtime

Topic: wasmtime / Issue #2133 Build fails for target aarch64-unk...


view this post on Zulip Wasmtime GitHub notifications bot (Aug 16 2020 at 10:31):

ifreund opened Issue #2133:

I am currently in the process of packaging wasmtime for void linux, a distribution which supports multiple architectures and musl as an alternative to glibc.

Reading the following code, it looks like wasmtime is intended to support aarch64 on linux.

https://github.com/bytecodealliance/wasmtime/blob/0387169934e91722b8b6819773eacc6893718296/crates/runtime/src/traphandlers.rs#L158-L172

It builds fine for aarch64-unknown-linux-gnu but fails for aarch64-unknown-linux-musl with the following error:

error[E0412]: cannot find type `ucontext_t` in crate `libc`

   --> crates/runtime/src/traphandlers.rs:165:52
    |
165 |                     let cx = &*(cx as *const libc::ucontext_t);
    |                                                    ^^^^^^^^^^ not found in `libc`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0412`.
error: could not compile `wasmtime-runtime`.

Building for x86_64-unknown-linux-musl works fine.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 16 2020 at 10:31):

ifreund labeled Issue #2133:

I am currently in the process of packaging wasmtime for void linux, a distribution which supports multiple architectures and musl as an alternative to glibc.

Reading the following code, it looks like wasmtime is intended to support aarch64 on linux.

https://github.com/bytecodealliance/wasmtime/blob/0387169934e91722b8b6819773eacc6893718296/crates/runtime/src/traphandlers.rs#L158-L172

It builds fine for aarch64-unknown-linux-gnu but fails for aarch64-unknown-linux-musl with the following error:

error[E0412]: cannot find type `ucontext_t` in crate `libc`

   --> crates/runtime/src/traphandlers.rs:165:52
    |
165 |                     let cx = &*(cx as *const libc::ucontext_t);
    |                                                    ^^^^^^^^^^ not found in `libc`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0412`.
error: could not compile `wasmtime-runtime`.

Building for x86_64-unknown-linux-musl works fine.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 16 2020 at 10:40):

ifreund edited Issue #2133:

I am currently in the process of packaging wasmtime for void linux, a distribution which supports multiple architectures and musl as an alternative to glibc.

Reading the following code, it looks like wasmtime is intended to support aarch64 on linux.

https://github.com/bytecodealliance/wasmtime/blob/0387169934e91722b8b6819773eacc6893718296/crates/runtime/src/traphandlers.rs#L158-L172

It builds fine for aarch64-unknown-linux-gnu but fails for aarch64-unknown-linux-musl with the following error:

error[E0412]: cannot find type `ucontext_t` in crate `libc`

   --> crates/runtime/src/traphandlers.rs:165:52
    |
165 |                     let cx = &*(cx as *const libc::ucontext_t);
    |                                                    ^^^^^^^^^^ not found in `libc`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0412`.
error: could not compile `wasmtime-runtime`.

Building for x86_64-unknown-linux-musl works fine.

This failure occurred with rust 1.44.1 and wasmtime 0.19.0

view this post on Zulip Wasmtime GitHub notifications bot (Aug 16 2020 at 11:37):

bjorn3 commented on Issue #2133:

libc misses ucontext_t on aarch64-unknown-linux-musl.

glibc: https://github.com/rust-lang/libc/blob/035a4809428d319e72ff1aaae5c5335f18623836/src/unix/linux_like/linux/gnu/b64/aarch64/align.rs
musl: https://github.com/rust-lang/libc/blob/035a4809428d319e72ff1aaae5c5335f18623836/src/unix/linux_like/linux/musl/b64/aarch64/align.rs

view this post on Zulip Wasmtime GitHub notifications bot (Sep 25 2020 at 20:01):

pmengelbert commented on Issue #2133:

I see that the issue has been patched and is resolved if I upgrade to the latest version of the libc crate, but then I come across this issue here:
I tried building wasmtime for aarch64-unknown-linux-musl and I came across the following issue:

error[E0609]: no field `pc` on type `libc::mcontext_t`
   --> crates/runtime/src/traphandlers.rs:166:36
    |
166 |                     cx.uc_mcontext.pc as *const u8
    |                                    ^^ unknown field

error: aborting due to previous error

Like @ifreund, building for the x86_64-unknown-linux-musl target works just fine. Any pointers on where to look? Thanks

view this post on Zulip Wasmtime GitHub notifications bot (Sep 25 2020 at 20:02):

pmengelbert edited a comment on Issue #2133:

I see that the issue has been patched and is resolved if I upgrade to the latest version of the libc crate, but then I come across this issue here:

error[E0609]: no field `pc` on type `libc::mcontext_t`
   --> crates/runtime/src/traphandlers.rs:166:36
    |
166 |                     cx.uc_mcontext.pc as *const u8
    |                                    ^^ unknown field

error: aborting due to previous error

Like @ifreund, building for the x86_64-unknown-linux-musl target works just fine. Any pointers on where to look? Thanks

view this post on Zulip Wasmtime GitHub notifications bot (Sep 25 2020 at 20:12):

bjorn3 commented on Issue #2133:

On aarch64-unknown-linux-musl libc doesn't expose any fields for mcontext_t: https://github.com/rust-lang/libc/blob/c9ff3e9b4e49b1a1c8482fc409177615dce6b84c/src/unix/linux_like/linux/musl/b64/aarch64/align.rs#L19 This will require a change to the libc crate.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 18 2020 at 01:50):

jiayihu commented on Issue #2133:

I'm having the same issue of @pmengelbert, is there any way to workaround for now? For instance fork libc and apply some patch. I'd test and open the PR myself if anyone can point me what to write. Should I just copy over this lines?

https://github.com/rust-lang/libc/blob/c9ff3e9b4e49b1a1c8482fc409177615dce6b84c/src/unix/linux_like/linux/gnu/b64/aarch64/align.rs#L19-L27

view this post on Zulip Wasmtime GitHub notifications bot (Dec 18 2020 at 13:01):

lu-zero commented on Issue #2133:

something along https://gist.github.com/lu-zero/e770b7c3c01277a7ccac51b2af692632 should fix it.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 31 2021 at 14:26):

jiayihu commented on Issue #2133:

https://github.com/rust-lang/libc/pull/2000 has been merged, @bjorn3 would be possible to update the libc version in wasmtime so that we can avoid patching it?

view this post on Zulip Wasmtime GitHub notifications bot (Jan 31 2021 at 14:28):

jiayihu deleted a comment on Issue #2133:

https://github.com/rust-lang/libc/pull/2000 has been merged, @bjorn3 would be possible to update the libc version in wasmtime so that we can avoid patching it?


Last updated: Dec 23 2024 at 12:05 UTC