mirror of
https://github.com/fluencelabs/wasmer
synced 2025-04-25 10:22:19 +00:00
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:
parent
704c34283f
commit
0df0a1cccb
@ -78,7 +78,7 @@ pub extern "C" fn nearbyintf64(x: f64) -> f64 {
|
|||||||
|
|
||||||
// FIXME: Is there a replacement on AArch64?
|
// FIXME: Is there a replacement on AArch64?
|
||||||
#[cfg(all(
|
#[cfg(all(
|
||||||
any(target_os = "freebsd", target_os = "linux"),
|
any(target_os = "freebsd", target_os = "linux", target_os = "android"),
|
||||||
target_arch = "aarch64"
|
target_arch = "aarch64"
|
||||||
))]
|
))]
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
|
@ -229,7 +229,10 @@ unsafe fn get_faulting_addr_and_ip(
|
|||||||
(si_addr, rip as _)
|
(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(
|
unsafe fn get_faulting_addr_and_ip(
|
||||||
_siginfo: *const c_void,
|
_siginfo: *const c_void,
|
||||||
_ucontext: *const c_void,
|
_ucontext: *const c_void,
|
||||||
@ -237,7 +240,10 @@ unsafe fn get_faulting_addr_and_ip(
|
|||||||
(::std::ptr::null(), ::std::ptr::null())
|
(::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(
|
unsafe fn get_faulting_addr_and_ip(
|
||||||
siginfo: *const c_void,
|
siginfo: *const c_void,
|
||||||
ucontext: *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 = "macos", target_arch = "x86_64"),
|
||||||
all(target_os = "linux", target_arch = "x86_64"),
|
all(target_os = "linux", target_arch = "x86_64"),
|
||||||
all(target_os = "linux", target_arch = "aarch64"),
|
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");
|
compile_error!("This crate doesn't yet support compiling on operating systems other than linux and macos and architectures other than x86_64");
|
||||||
|
@ -16,7 +16,8 @@ wasmparser = "0.51.3"
|
|||||||
parking_lot = "0.10.0"
|
parking_lot = "0.10.0"
|
||||||
lazy_static = "1.4"
|
lazy_static = "1.4"
|
||||||
errno = "0.2"
|
errno = "0.2"
|
||||||
libc = "0.2.60"
|
#libc = "0.2.60"
|
||||||
|
libc = { path = "../../../libc", version = "0.2.65" }
|
||||||
hex = "0.4"
|
hex = "0.4"
|
||||||
smallvec = "0.6"
|
smallvec = "0.6"
|
||||||
bincode = "1.1"
|
bincode = "1.1"
|
||||||
|
@ -37,7 +37,7 @@ fn main() {
|
|||||||
.file("image-loading-freebsd-x86-64.s")
|
.file("image-loading-freebsd-x86-64.s")
|
||||||
.compile("image-loading");
|
.compile("image-loading");
|
||||||
}
|
}
|
||||||
("linux", "x86_64") => {
|
("linux", "x86_64") | ("android", "x86_64") => {
|
||||||
cc::Build::new()
|
cc::Build::new()
|
||||||
.file("image-loading-linux-x86-64.s")
|
.file("image-loading-linux-x86-64.s")
|
||||||
.compile("image-loading");
|
.compile("image-loading");
|
||||||
|
@ -743,7 +743,10 @@ pub unsafe fn get_fault_info(siginfo: *const c_void, ucontext: *mut c_void) -> F
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(all(target_os = "linux", target_arch = "aarch64"))]
|
#[cfg(all(
|
||||||
|
any(target_os = "linux", target_os = "android"),
|
||||||
|
target_arch = "aarch64"
|
||||||
|
))]
|
||||||
/// Get fault info from siginfo and ucontext.
|
/// Get fault info from siginfo and ucontext.
|
||||||
pub unsafe fn get_fault_info(siginfo: *const c_void, ucontext: *mut c_void) -> FaultInfo {
|
pub unsafe fn get_fault_info(siginfo: *const c_void, ucontext: *mut c_void) -> FaultInfo {
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
@ -810,7 +813,10 @@ pub unsafe fn get_fault_info(siginfo: *const c_void, ucontext: *mut c_void) -> F
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(all(target_os = "linux", target_arch = "x86_64"))]
|
#[cfg(all(
|
||||||
|
any(target_os = "linux", target_os = "android"),
|
||||||
|
target_arch = "x86_64"
|
||||||
|
))]
|
||||||
/// Get fault info from siginfo and ucontext.
|
/// Get fault info from siginfo and ucontext.
|
||||||
pub unsafe fn get_fault_info(siginfo: *const c_void, ucontext: *mut c_void) -> FaultInfo {
|
pub unsafe fn get_fault_info(siginfo: *const c_void, ucontext: *mut c_void) -> FaultInfo {
|
||||||
use libc::{
|
use libc::{
|
||||||
|
@ -17,6 +17,8 @@
|
|||||||
all(target_os = "macos", target_arch = "x86_64"),
|
all(target_os = "macos", target_arch = "x86_64"),
|
||||||
all(target_os = "linux", target_arch = "x86_64"),
|
all(target_os = "linux", target_arch = "x86_64"),
|
||||||
all(target_os = "linux", target_arch = "aarch64"),
|
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 FreeBSD, linux and macos and architectures other than x86_64");
|
compile_error!("This crate doesn't yet support compiling on operating systems other than FreeBSD, linux and macos and architectures other than x86_64");
|
||||||
|
|
||||||
|
@ -1,6 +1,11 @@
|
|||||||
#![allow(unused, clippy::too_many_arguments)]
|
#![allow(unused, clippy::too_many_arguments)]
|
||||||
pub mod types;
|
pub mod types;
|
||||||
#[cfg(any(target_os = "freebsd", target_os = "linux", target_os = "macos"))]
|
#[cfg(any(
|
||||||
|
target_os = "freebsd",
|
||||||
|
target_os = "linux",
|
||||||
|
target_os = "android",
|
||||||
|
target_os = "macos"
|
||||||
|
))]
|
||||||
pub mod unix;
|
pub mod unix;
|
||||||
#[cfg(any(target_os = "windows"))]
|
#[cfg(any(target_os = "windows"))]
|
||||||
pub mod windows;
|
pub mod windows;
|
||||||
@ -23,7 +28,12 @@ use std::convert::{Infallible, TryInto};
|
|||||||
use std::io::{self, Read, Seek, Write};
|
use std::io::{self, Read, Seek, Write};
|
||||||
use wasmer_runtime_core::{memory::Memory, vm::Ctx};
|
use wasmer_runtime_core::{memory::Memory, vm::Ctx};
|
||||||
|
|
||||||
#[cfg(any(target_os = "freebsd", target_os = "linux", target_os = "macos"))]
|
#[cfg(any(
|
||||||
|
target_os = "freebsd",
|
||||||
|
target_os = "linux",
|
||||||
|
target_os = "android",
|
||||||
|
target_os = "macos"
|
||||||
|
))]
|
||||||
pub use unix::*;
|
pub use unix::*;
|
||||||
|
|
||||||
#[cfg(any(target_os = "windows"))]
|
#[cfg(any(target_os = "windows"))]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user