소스 검색

Merge pull request #256 from jordanrh1/windows-arm

Support windows/arm target
Alex Crichton 6 년 전
부모
커밋
4bbfb7e266
4개의 변경된 파일7개의 추가작업 그리고 4개의 파일을 삭제
  1. 1 1
      build.rs
  2. 1 1
      src/arm.rs
  3. 3 2
      src/int/sdiv.rs
  4. 2 0
      src/int/udiv.rs

+ 1 - 1
build.rs

@@ -299,7 +299,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",

+ 1 - 1
src/arm.rs

@@ -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() {

+ 3 - 2
src/int/sdiv.rs

@@ -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))

+ 2 - 0
src/int/udiv.rs

@@ -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 {