Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ucontext_t is missing on aarch64-unknown-freebsd #3217

Open
jbeich opened this issue Apr 23, 2023 · 0 comments
Open

ucontext_t is missing on aarch64-unknown-freebsd #3217

jbeich opened this issue Apr 23, 2023 · 0 comments
Labels
C-API-request Category: API request

Comments

@jbeich
Copy link

jbeich commented Apr 23, 2023

2e3999d added mcontext_t but not ucontext_t. FreeBSD ucontext_t is machine-independent but libc crate limits it by target_arch.

See ucontext_t definition vs. mcontext_t definition

error[E0412]: cannot find type `ucontext_t` in crate `libc`
   --> veloren-4b6c5f57e3a9/cargo-crates/wasmer-vm-2.3.0/src/trap/traphandlers.rs:219:57
    |
219 |               let ucontext = &mut *(context as *mut libc::ucontext_t);
    |                                                           ^^^^^^^^^^ help: a struct with a similar name exists: `mcontext_t`
    |
   ::: veloren-4b6c5f57e3a9/cargo-crates/libc-0.2.133/src/unix/bsd/freebsdlike/freebsd/aarch64.rs:20:1
    |
20  | / s_no_extra_traits! {
21  | |     pub struct gpregs {
22  | |         pub gp_x: [::register_t; 30],
23  | |         pub gp_lr: ::register_t,
..   |
44  | |     }
45  | | }
    | |_- similarly named struct `mcontext_t` defined here

error[E0412]: cannot find type `ucontext_t` in crate `libc`
   --> veloren-4b6c5f57e3a9/cargo-crates/wasmer-vm-2.3.0/src/trap/traphandlers.rs:259:45
    |
259 |           unsafe fn get_pc_sp(context: &libc::ucontext_t) -> (usize, usize) {
    |                                               ^^^^^^^^^^ help: a struct with a similar name exists: `mcontext_t`
    |
   ::: veloren-4b6c5f57e3a9/cargo-crates/libc-0.2.133/src/unix/bsd/freebsdlike/freebsd/aarch64.rs:20:1
    |
20  | / s_no_extra_traits! {
21  | |     pub struct gpregs {
22  | |         pub gp_x: [::register_t; 30],
23  | |         pub gp_lr: ::register_t,
..   |
44  | |     }
45  | | }
    | |_- similarly named struct `mcontext_t` defined here

error[E0412]: cannot find type `ucontext_t` in crate `libc`
   --> veloren-4b6c5f57e3a9/cargo-crates/wasmer-vm-2.3.0/src/trap/traphandlers.rs:314:54
    |
314 |           unsafe fn update_context(context: &mut libc::ucontext_t, regs: TrapHandlerRegs) {
    |                                                        ^^^^^^^^^^ help: a struct with a similar name exists: `mcontext_t`
    |
   ::: veloren-4b6c5f57e3a9/cargo-crates/libc-0.2.133/src/unix/bsd/freebsdlike/freebsd/aarch64.rs:20:1
    |
20  | / s_no_extra_traits! {
21  | |     pub struct gpregs {
22  | |         pub gp_x: [::register_t; 30],
23  | |         pub gp_lr: ::register_t,
..   |
44  | |     }
45  | | }
    | |_- similarly named struct `mcontext_t` defined here

error[E0425]: cannot find value `pc` in this scope
   --> veloren-4b6c5f57e3a9/cargo-crates/wasmer-vm-2.3.0/src/trap/traphandlers.rs:420:59
    |
420 |                     context.uc_mcontext.mc_gpregs.gp_pc = pc as libc::register_t;
    |                                                           ^^ not found in this scope

error[E0425]: cannot find value `sp` in this scope
   --> veloren-4b6c5f57e3a9/cargo-crates/wasmer-vm-2.3.0/src/trap/traphandlers.rs:421:59
    |
421 |                     context.uc_mcontext.mc_gpregs.gp_sp = sp as libc::register_t;
    |                                                           ^^ not found in this scope

error[E0425]: cannot find value `x0` in this scope
   --> veloren-4b6c5f57e3a9/cargo-crates/wasmer-vm-2.3.0/src/trap/traphandlers.rs:422:61
    |
422 |                     context.uc_mcontext.mc_gpregs.gp_x[0] = x0 as libc::register_t;
    |                                                             ^^ not found in this scope

error[E0425]: cannot find value `x1` in this scope
   --> veloren-4b6c5f57e3a9/cargo-crates/wasmer-vm-2.3.0/src/trap/traphandlers.rs:423:61
    |
423 |                     context.uc_mcontext.mc_gpregs.gp_x[1] = x1 as libc::register_t;
    |                                                             ^^ not found in this scope

error[E0425]: cannot find value `x29` in this scope
   --> veloren-4b6c5f57e3a9/cargo-crates/wasmer-vm-2.3.0/src/trap/traphandlers.rs:424:62
    |
424 |                     context.uc_mcontext.mc_gpregs.gp_x[29] = x29 as libc::register_t;
    |                                                              ^^^ not found in this scope

error[E0425]: cannot find value `lr` in this scope
   --> veloren-4b6c5f57e3a9/cargo-crates/wasmer-vm-2.3.0/src/trap/traphandlers.rs:425:62
    |
425 |                     context.uc_mcontext.mc_gpregs.gp_x[30] = lr as libc::register_t;
    |                                                              ^^ not found in this scope

Some errors have detailed explanations: E0412, E0425.
For more information about an error, try `rustc --explain E0412`.
error: could not compile `wasmer-vm` due to 9 previous errors
@jbeich jbeich added the C-API-request Category: API request label Apr 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-API-request Category: API request
Projects
None yet
Development

No branches or pull requests

1 participant