-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
craneliftIssues related to the Cranelift code generatorIssues related to the Cranelift code generatorcranelift:area:aarch64Issues related to AArch64 backend.Issues related to AArch64 backend.
Description
Feature
JIT for arm64
Benefit
x86 works and it would be nice to be able to use it on M1 mac as well
Implementation
it currently panics here:
wasmtime/cranelift/jit/src/backend.rs
Lines 183 to 195 in 5fecdfa
| unsafe fn write_plt_entry_bytes(plt_ptr: *mut [u8; 16], got_ptr: *mut *const u8) { | |
| assert!( | |
| cfg!(target_arch = "x86_64"), | |
| "PLT is currently only supported on x86_64" | |
| ); | |
| // jmp *got_ptr; ud2; ud2; ud2; ud2; ud2 | |
| let mut plt_val = [ | |
| 0xff, 0x25, 0, 0, 0, 0, 0x0f, 0x0b, 0x0f, 0x0b, 0x0f, 0x0b, 0x0f, 0x0b, 0x0f, 0x0b, | |
| ]; | |
| let what = got_ptr as isize - 4; | |
| let at = plt_ptr as isize + 2; | |
| plt_val[2..6].copy_from_slice(&i32::to_ne_bytes(i32::try_from(what - at).unwrap())); | |
| std::ptr::write(plt_ptr, plt_val); |
Alternatives
only make JIT available on x86
ricochet1k, Dimchikkk, theoparis and Somfic
Metadata
Metadata
Assignees
Labels
craneliftIssues related to the Cranelift code generatorIssues related to the Cranelift code generatorcranelift:area:aarch64Issues related to AArch64 backend.Issues related to AArch64 backend.