Support windows/arm target

master
Jordan Rhee 2018-07-05 11:20:34 -07:00
parent f3a13eb238
commit 78f544f57d
4 changed files with 8 additions and 5 deletions

View File

@ -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(
&[
"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(
&[
"arm/sync_fetch_and_add_4.S",

View File

@ -4,7 +4,7 @@ use core::intrinsics;
// 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
// 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]
#[cfg_attr(not(feature = "mangled-names"), no_mangle)]
pub unsafe fn __aeabi_uidivmod() {

View File

@ -73,7 +73,8 @@ intrinsics! {
}
#[use_c_shim_if(all(target_arch = "arm",
not(target_os = "ios")),
not(target_os = "ios"),
not(target_env = "msvc")),
not(thumbv6m))]
pub extern "C" fn __modsi3(a: i32, b: i32) -> i32 {
a.mod_(b)
@ -89,7 +90,7 @@ intrinsics! {
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)))]
pub extern "C" fn __divmodsi4(a: i32, b: i32, rem: &mut i32) -> i32 {
a.divmod(b, rem, |a, b| __divsi3(a, b))

View File

@ -211,6 +211,7 @@ intrinsics! {
#[use_c_shim_if(all(target_arch = "arm",
not(target_os = "ios"),
not(target_env = "msvc"),
not(thumbv6m)))]
/// Returns `n % d`
pub extern "C" fn __umodsi3(n: u32, d: u32) -> u32 {
@ -220,6 +221,7 @@ intrinsics! {
#[use_c_shim_if(all(target_arch = "arm",
not(target_os = "ios"),
not(target_env = "msvc"),
not(thumbv6m)))]
/// Returns `n / d` and sets `*rem = n % d`
pub extern "C" fn __udivmodsi4(n: u32, d: u32, rem: Option<&mut u32>) -> u32 {