Support windows/arm target
This commit is contained in:
parent
f3a13eb238
commit
78f544f57d
4
build.rs
4
build.rs
|
@ -297,7 +297,7 @@ mod c {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if target_arch == "arm" && target_os != "ios" {
|
if target_arch == "arm" && target_os != "ios" && target_env != "msvc" {
|
||||||
sources.extend(
|
sources.extend(
|
||||||
&[
|
&[
|
||||||
"arm/aeabi_div0.c",
|
"arm/aeabi_div0.c",
|
||||||
|
@ -348,7 +348,7 @@ mod c {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if llvm_target[0] == "armv7" {
|
if llvm_target[0] == "armv7" && target_env != "msvc" {
|
||||||
sources.extend(
|
sources.extend(
|
||||||
&[
|
&[
|
||||||
"arm/sync_fetch_and_add_4.S",
|
"arm/sync_fetch_and_add_4.S",
|
||||||
|
|
|
@ -4,7 +4,7 @@ use core::intrinsics;
|
||||||
// calling convention which can't be implemented using a normal Rust function.
|
// calling convention which can't be implemented using a normal Rust function.
|
||||||
// NOTE The only difference between the iOS and non-iOS versions of those functions is that the iOS
|
// NOTE The only difference between the iOS and non-iOS versions of those functions is that the iOS
|
||||||
// versions use 3 leading underscores in the names of called functions instead of 2.
|
// versions use 3 leading underscores in the names of called functions instead of 2.
|
||||||
#[cfg(not(target_os = "ios"))]
|
#[cfg(not(any(target_os = "ios", target_env = "msvc")))]
|
||||||
#[naked]
|
#[naked]
|
||||||
#[cfg_attr(not(feature = "mangled-names"), no_mangle)]
|
#[cfg_attr(not(feature = "mangled-names"), no_mangle)]
|
||||||
pub unsafe fn __aeabi_uidivmod() {
|
pub unsafe fn __aeabi_uidivmod() {
|
||||||
|
|
|
@ -73,7 +73,8 @@ intrinsics! {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[use_c_shim_if(all(target_arch = "arm",
|
#[use_c_shim_if(all(target_arch = "arm",
|
||||||
not(target_os = "ios")),
|
not(target_os = "ios"),
|
||||||
|
not(target_env = "msvc")),
|
||||||
not(thumbv6m))]
|
not(thumbv6m))]
|
||||||
pub extern "C" fn __modsi3(a: i32, b: i32) -> i32 {
|
pub extern "C" fn __modsi3(a: i32, b: i32) -> i32 {
|
||||||
a.mod_(b)
|
a.mod_(b)
|
||||||
|
@ -89,7 +90,7 @@ intrinsics! {
|
||||||
a.mod_(b)
|
a.mod_(b)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[use_c_shim_if(all(target_arch = "arm",
|
#[use_c_shim_if(all(target_arch = "arm", not(target_env = "msvc"),
|
||||||
not(target_os = "ios"), not(thumbv6m)))]
|
not(target_os = "ios"), not(thumbv6m)))]
|
||||||
pub extern "C" fn __divmodsi4(a: i32, b: i32, rem: &mut i32) -> i32 {
|
pub extern "C" fn __divmodsi4(a: i32, b: i32, rem: &mut i32) -> i32 {
|
||||||
a.divmod(b, rem, |a, b| __divsi3(a, b))
|
a.divmod(b, rem, |a, b| __divsi3(a, b))
|
||||||
|
|
|
@ -211,6 +211,7 @@ intrinsics! {
|
||||||
|
|
||||||
#[use_c_shim_if(all(target_arch = "arm",
|
#[use_c_shim_if(all(target_arch = "arm",
|
||||||
not(target_os = "ios"),
|
not(target_os = "ios"),
|
||||||
|
not(target_env = "msvc"),
|
||||||
not(thumbv6m)))]
|
not(thumbv6m)))]
|
||||||
/// Returns `n % d`
|
/// Returns `n % d`
|
||||||
pub extern "C" fn __umodsi3(n: u32, d: u32) -> u32 {
|
pub extern "C" fn __umodsi3(n: u32, d: u32) -> u32 {
|
||||||
|
@ -220,6 +221,7 @@ intrinsics! {
|
||||||
|
|
||||||
#[use_c_shim_if(all(target_arch = "arm",
|
#[use_c_shim_if(all(target_arch = "arm",
|
||||||
not(target_os = "ios"),
|
not(target_os = "ios"),
|
||||||
|
not(target_env = "msvc"),
|
||||||
not(thumbv6m)))]
|
not(thumbv6m)))]
|
||||||
/// Returns `n / d` and sets `*rem = n % d`
|
/// Returns `n / d` and sets `*rem = n % d`
|
||||||
pub extern "C" fn __udivmodsi4(n: u32, d: u32, rem: Option<&mut u32>) -> u32 {
|
pub extern "C" fn __udivmodsi4(n: u32, d: u32, rem: Option<&mut u32>) -> u32 {
|
||||||
|
|
Loading…
Reference in New Issue