Add Apple visionOS support
This commit is contained in:
parent
24d4826719
commit
2fa55c4ef5
2 changed files with 17 additions and 26 deletions
|
|
@ -377,11 +377,7 @@ mod c {
|
|||
|
||||
// On iOS and 32-bit OSX these are all just empty intrinsics, no need to
|
||||
// include them.
|
||||
if target_os != "ios"
|
||||
&& target_os != "watchos"
|
||||
&& target_os != "tvos"
|
||||
&& (target_vendor != "apple" || target_arch != "x86")
|
||||
{
|
||||
if target_vendor != "apple" || target_arch != "x86" {
|
||||
sources.extend(&[
|
||||
("__absvti2", "absvti2.c"),
|
||||
("__addvti3", "addvti3.c"),
|
||||
|
|
@ -431,12 +427,7 @@ mod c {
|
|||
}
|
||||
}
|
||||
|
||||
if target_arch == "arm"
|
||||
&& target_os != "ios"
|
||||
&& target_os != "watchos"
|
||||
&& target_os != "tvos"
|
||||
&& target_env != "msvc"
|
||||
{
|
||||
if target_arch == "arm" && target_vendor != "apple" && target_env != "msvc" {
|
||||
sources.extend(&[
|
||||
("__aeabi_div0", "arm/aeabi_div0.c"),
|
||||
("__aeabi_drsub", "arm/aeabi_drsub.c"),
|
||||
|
|
|
|||
|
|
@ -3,14 +3,14 @@
|
|||
|
||||
use core::intrinsics;
|
||||
|
||||
// iOS symbols have a leading underscore.
|
||||
#[cfg(target_os = "ios")]
|
||||
// Apple symbols have a leading underscore.
|
||||
#[cfg(target_vendor = "apple")]
|
||||
macro_rules! bl {
|
||||
($func:literal) => {
|
||||
concat!("bl _", $func)
|
||||
};
|
||||
}
|
||||
#[cfg(not(target_os = "ios"))]
|
||||
#[cfg(not(target_vendor = "apple"))]
|
||||
macro_rules! bl {
|
||||
($func:literal) => {
|
||||
concat!("bl ", $func)
|
||||
|
|
@ -82,12 +82,12 @@ intrinsics! {
|
|||
|
||||
// FIXME: The `*4` and `*8` variants should be defined as aliases.
|
||||
|
||||
#[cfg(not(target_os = "ios"))]
|
||||
#[cfg(not(target_vendor = "apple"))]
|
||||
pub unsafe extern "aapcs" fn __aeabi_memcpy(dest: *mut u8, src: *const u8, n: usize) {
|
||||
crate::mem::memcpy(dest, src, n);
|
||||
}
|
||||
|
||||
#[cfg(not(target_os = "ios"))]
|
||||
#[cfg(not(target_vendor = "apple"))]
|
||||
pub unsafe extern "aapcs" fn __aeabi_memcpy4(dest: *mut u8, src: *const u8, n: usize) {
|
||||
// We are guaranteed 4-alignment, so accessing at u32 is okay.
|
||||
let mut dest = dest as *mut u32;
|
||||
|
|
@ -104,33 +104,33 @@ intrinsics! {
|
|||
__aeabi_memcpy(dest as *mut u8, src as *const u8, n);
|
||||
}
|
||||
|
||||
#[cfg(not(target_os = "ios"))]
|
||||
#[cfg(not(target_vendor = "apple"))]
|
||||
pub unsafe extern "aapcs" fn __aeabi_memcpy8(dest: *mut u8, src: *const u8, n: usize) {
|
||||
__aeabi_memcpy4(dest, src, n);
|
||||
}
|
||||
|
||||
#[cfg(not(target_os = "ios"))]
|
||||
#[cfg(not(target_vendor = "apple"))]
|
||||
pub unsafe extern "aapcs" fn __aeabi_memmove(dest: *mut u8, src: *const u8, n: usize) {
|
||||
crate::mem::memmove(dest, src, n);
|
||||
}
|
||||
|
||||
#[cfg(not(any(target_os = "ios", target_env = "msvc")))]
|
||||
#[cfg(not(any(target_vendor = "apple", target_env = "msvc")))]
|
||||
pub unsafe extern "aapcs" fn __aeabi_memmove4(dest: *mut u8, src: *const u8, n: usize) {
|
||||
__aeabi_memmove(dest, src, n);
|
||||
}
|
||||
|
||||
#[cfg(not(any(target_os = "ios", target_env = "msvc")))]
|
||||
#[cfg(not(any(target_vendor = "apple", target_env = "msvc")))]
|
||||
pub unsafe extern "aapcs" fn __aeabi_memmove8(dest: *mut u8, src: *const u8, n: usize) {
|
||||
__aeabi_memmove(dest, src, n);
|
||||
}
|
||||
|
||||
#[cfg(not(target_os = "ios"))]
|
||||
#[cfg(not(target_vendor = "apple"))]
|
||||
pub unsafe extern "aapcs" fn __aeabi_memset(dest: *mut u8, n: usize, c: i32) {
|
||||
// Note the different argument order
|
||||
crate::mem::memset(dest, c, n);
|
||||
}
|
||||
|
||||
#[cfg(not(target_os = "ios"))]
|
||||
#[cfg(not(target_vendor = "apple"))]
|
||||
pub unsafe extern "aapcs" fn __aeabi_memset4(dest: *mut u8, n: usize, c: i32) {
|
||||
let mut dest = dest as *mut u32;
|
||||
let mut n = n;
|
||||
|
|
@ -147,22 +147,22 @@ intrinsics! {
|
|||
__aeabi_memset(dest as *mut u8, n, byte as i32);
|
||||
}
|
||||
|
||||
#[cfg(not(target_os = "ios"))]
|
||||
#[cfg(not(target_vendor = "apple"))]
|
||||
pub unsafe extern "aapcs" fn __aeabi_memset8(dest: *mut u8, n: usize, c: i32) {
|
||||
__aeabi_memset4(dest, n, c);
|
||||
}
|
||||
|
||||
#[cfg(not(target_os = "ios"))]
|
||||
#[cfg(not(target_vendor = "apple"))]
|
||||
pub unsafe extern "aapcs" fn __aeabi_memclr(dest: *mut u8, n: usize) {
|
||||
__aeabi_memset(dest, n, 0);
|
||||
}
|
||||
|
||||
#[cfg(not(any(target_os = "ios", target_env = "msvc")))]
|
||||
#[cfg(not(any(target_vendor = "apple", target_env = "msvc")))]
|
||||
pub unsafe extern "aapcs" fn __aeabi_memclr4(dest: *mut u8, n: usize) {
|
||||
__aeabi_memset4(dest, n, 0);
|
||||
}
|
||||
|
||||
#[cfg(not(any(target_os = "ios", target_env = "msvc")))]
|
||||
#[cfg(not(any(target_vendor = "apple", target_env = "msvc")))]
|
||||
pub unsafe extern "aapcs" fn __aeabi_memclr8(dest: *mut u8, n: usize) {
|
||||
__aeabi_memset4(dest, n, 0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue