Support Android

I'll send a PR after https://github.com/rust-lang/libc/pull/1622 is merged and released
This commit is contained in:
Yuji Yamamoto
2019-12-19 11:08:43 +09:00
committed by YAMAMOTO Yuji
parent 704c34283f
commit 0df0a1cccb
7 changed files with 36 additions and 9 deletions

View File

@ -78,7 +78,7 @@ pub extern "C" fn nearbyintf64(x: f64) -> f64 {
// FIXME: Is there a replacement on AArch64?
#[cfg(all(
any(target_os = "freebsd", target_os = "linux"),
any(target_os = "freebsd", target_os = "linux", target_os = "android"),
target_arch = "aarch64"
))]
#[no_mangle]

View File

@ -229,7 +229,10 @@ unsafe fn get_faulting_addr_and_ip(
(si_addr, rip as _)
}
#[cfg(all(target_os = "linux", target_arch = "aarch64"))]
#[cfg(all(
any(target_os = "linux", target_os = "android"),
target_arch = "aarch64"
))]
unsafe fn get_faulting_addr_and_ip(
_siginfo: *const c_void,
_ucontext: *const c_void,
@ -237,7 +240,10 @@ unsafe fn get_faulting_addr_and_ip(
(::std::ptr::null(), ::std::ptr::null())
}
#[cfg(all(target_os = "linux", target_arch = "x86_64"))]
#[cfg(all(
any(target_os = "linux", target_os = "android"),
target_arch = "x86_64"
))]
unsafe fn get_faulting_addr_and_ip(
siginfo: *const c_void,
ucontext: *const c_void,
@ -332,5 +338,7 @@ unsafe fn get_faulting_addr_and_ip(
all(target_os = "macos", target_arch = "x86_64"),
all(target_os = "linux", target_arch = "x86_64"),
all(target_os = "linux", target_arch = "aarch64"),
all(target_os = "android", target_arch = "x86_64"),
all(target_os = "android", target_arch = "aarch64"),
)))]
compile_error!("This crate doesn't yet support compiling on operating systems other than linux and macos and architectures other than x86_64");