Skip to content

Commit

Permalink
Merge #2348
Browse files Browse the repository at this point in the history
2348: Copied trap handlers so this will compile for `aarch64-linux-android` r=syrusakbary a=dgrijalva-squire

Attempting to compile Wasmer for android fails with an 'unsupported platform' error. These two additional cases are copied from their neighbors, but properly match against the `aarch64-linux-android` target. I don't know enough about what this code is actually doing to know if this is 'right', but it does appear to work.

Co-authored-by: Dave Grijalva <[email protected]>
  • Loading branch information
bors[bot] and dgrijalva authored May 26, 2021
2 parents ea369c4 + cc3168b commit 50f48ff
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/vm/src/trap/traphandlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,15 @@ cfg_if::cfg_if! {
} 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(target_os = "android", 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(target_os = "linux", target_arch = "aarch64"))] {
let cx = &*(cx as *const libc::ucontext_t);
cx.uc_mcontext.pc as *const u8
} else if #[cfg(all(target_os = "android", target_arch = "aarch64"))] {
let cx = &*(cx as *const libc::ucontext_t);
cx.uc_mcontext.pc as *const u8
} else if #[cfg(all(target_os = "macos", target_arch = "x86_64"))] {
let cx = &*(cx as *const libc::ucontext_t);
(*cx.uc_mcontext).__ss.__rip as *const u8
Expand Down

0 comments on commit 50f48ff

Please sign in to comment.