Fixed compilation on aarch64.

This commit is contained in:
losfair 2019-09-15 18:32:02 +08:00
parent 9b77677e4b
commit 2af69f6710
2 changed files with 11 additions and 1 deletions

View File

@ -7,6 +7,11 @@ pub mod raw {
pub fn register_preservation_trampoline(); // NOT safe to call directly pub fn register_preservation_trampoline(); // NOT safe to call directly
} }
#[cfg(not(target_arch = "x86_64"))]
pub extern "C" fn register_preservation_trampoline() {
unimplemented!("register_preservation_trampoline");
}
extern "C" { extern "C" {
pub fn setjmp(env: *mut c_void) -> i32; pub fn setjmp(env: *mut c_void) -> i32;
pub fn longjmp(env: *mut c_void, val: i32) -> !; pub fn longjmp(env: *mut c_void, val: i32) -> !;
@ -34,6 +39,11 @@ pub(crate) unsafe fn run_on_alternative_stack(stack_end: *mut u64, stack_begin:
raw::run_on_alternative_stack(stack_end, stack_begin) raw::run_on_alternative_stack(stack_end, stack_begin)
} }
#[cfg(not(target_arch = "x86_64"))]
pub(crate) unsafe fn run_on_alternative_stack(stack_end: *mut u64, stack_begin: *mut u64) -> u64 {
unimplemented!("run_on_alternative_stack");
}
const TRAP_STACK_SIZE: usize = 1048576; // 1MB const TRAP_STACK_SIZE: usize = 1048576; // 1MB
const SETJMP_BUFFER_LEN: usize = 128; const SETJMP_BUFFER_LEN: usize = 128;

View File

@ -1,7 +1,7 @@
#![deny( #![deny(
dead_code, dead_code,
nonstandard_style, nonstandard_style,
unused_imports, // unused_imports,
unused_mut, unused_mut,
unused_variables, unused_variables,
unused_unsafe, unused_unsafe,