-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
wasmtime:platform-supportRelated to supporting a new platform in WasmtimeRelated to supporting a new platform in Wasmtime
Description
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.
wasmtime/crates/runtime/src/traphandlers.rs
Lines 158 to 172 in 0387169
| if #[cfg(all(target_os = "linux", target_arch = "x86_64"))] { | |
| let cx = &*(cx as *const libc::ucontext_t); | |
| cx.uc_mcontext.gregs[libc::REG_RIP as usize] as *const u8 | |
| } else if #[cfg(all(target_os = "linux", target_arch = "x86"))] { | |
| let cx = &*(cx as *const libc::ucontext_t); | |
| cx.uc_mcontext.gregs[libc::REG_EIP as usize] as *const u8 | |
| } else if #[cfg(all(any(target_os = "linux", target_os = "android"), target_arch = "aarch64"))] { | |
| let cx = &*(cx as *const libc::ucontext_t); | |
| cx.uc_mcontext.pc as *const u8 | |
| } else if #[cfg(target_os = "macos")] { | |
| let cx = &*(cx as *const libc::ucontext_t); | |
| (*cx.uc_mcontext).__ss.__rip as *const u8 | |
| } else { | |
| compile_error!("unsupported platform"); | |
| } |
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
jiayihu and victorpaleologueRochet2, stefson and RoyalIcing
Metadata
Metadata
Assignees
Labels
wasmtime:platform-supportRelated to supporting a new platform in WasmtimeRelated to supporting a new platform in Wasmtime