From ca702da264bce69c687de3d3ba37d9215d39a587 Mon Sep 17 00:00:00 2001 From: Jia Yuan Lo Date: Mon, 18 Sep 2023 22:00:24 +0800 Subject: [PATCH] Allow building for x86_64-linux-android (#7055) --- crates/jit/Cargo.toml | 2 +- crates/jit/src/profiling.rs | 2 +- crates/runtime/src/traphandlers/unix.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/jit/Cargo.toml b/crates/jit/Cargo.toml index 25cf74bbb1d4..13fccaf9f769 100644 --- a/crates/jit/Cargo.toml +++ b/crates/jit/Cargo.toml @@ -37,7 +37,7 @@ features = [ "Win32_System_Diagnostics_Debug", ] -[target.'cfg(target_arch = "x86_64")'.dependencies] +[target.'cfg(all(target_arch = "x86_64", not(target_os = "android")))'.dependencies] ittapi = { version = "0.3.3", optional = true } [features] diff --git a/crates/jit/src/profiling.rs b/crates/jit/src/profiling.rs index d816d65f8ba5..5e24344ac915 100644 --- a/crates/jit/src/profiling.rs +++ b/crates/jit/src/profiling.rs @@ -33,7 +33,7 @@ cfg_if::cfg_if! { cfg_if::cfg_if! { // Note: VTune support is disabled on windows mingw because the ittapi crate doesn't compile // there; see also https://github.com/bytecodealliance/wasmtime/pull/4003 for rationale. - if #[cfg(all(feature = "vtune", target_arch = "x86_64", not(all(target_os = "windows", target_env = "gnu"))))] { + if #[cfg(all(feature = "vtune", target_arch = "x86_64", not(any(target_os = "android", all(target_os = "windows", target_env = "gnu")))))] { mod vtune; pub use vtune::new as new_vtune; } else { diff --git a/crates/runtime/src/traphandlers/unix.rs b/crates/runtime/src/traphandlers/unix.rs index 4a7e2027b679..613119af77c4 100644 --- a/crates/runtime/src/traphandlers/unix.rs +++ b/crates/runtime/src/traphandlers/unix.rs @@ -190,7 +190,7 @@ struct ucontext_t { unsafe fn get_pc_and_fp(cx: *mut libc::c_void, _signum: libc::c_int) -> (*const u8, usize) { cfg_if::cfg_if! { - if #[cfg(all(target_os = "linux", target_arch = "x86_64"))] { + if #[cfg(all(any(target_os = "linux", target_os = "android"), target_arch = "x86_64"))] { let cx = &*(cx as *const libc::ucontext_t); ( cx.uc_mcontext.gregs[libc::REG_RIP as usize] as *const u8,