Skip to content

Commit 78f544f

Browse files
committed
Support windows/arm target
1 parent f3a13eb commit 78f544f

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ mod c {
297297
}
298298
}
299299

300-
if target_arch == "arm" && target_os != "ios" {
300+
if target_arch == "arm" && target_os != "ios" && target_env != "msvc" {
301301
sources.extend(
302302
&[
303303
"arm/aeabi_div0.c",
@@ -348,7 +348,7 @@ mod c {
348348
}
349349
}
350350

351-
if llvm_target[0] == "armv7" {
351+
if llvm_target[0] == "armv7" && target_env != "msvc" {
352352
sources.extend(
353353
&[
354354
"arm/sync_fetch_and_add_4.S",

src/arm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use core::intrinsics;
44
// calling convention which can't be implemented using a normal Rust function.
55
// NOTE The only difference between the iOS and non-iOS versions of those functions is that the iOS
66
// versions use 3 leading underscores in the names of called functions instead of 2.
7-
#[cfg(not(target_os = "ios"))]
7+
#[cfg(not(any(target_os = "ios", target_env = "msvc")))]
88
#[naked]
99
#[cfg_attr(not(feature = "mangled-names"), no_mangle)]
1010
pub unsafe fn __aeabi_uidivmod() {

src/int/sdiv.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ intrinsics! {
7373
}
7474

7575
#[use_c_shim_if(all(target_arch = "arm",
76-
not(target_os = "ios")),
76+
not(target_os = "ios"),
77+
not(target_env = "msvc")),
7778
not(thumbv6m))]
7879
pub extern "C" fn __modsi3(a: i32, b: i32) -> i32 {
7980
a.mod_(b)
@@ -89,7 +90,7 @@ intrinsics! {
8990
a.mod_(b)
9091
}
9192

92-
#[use_c_shim_if(all(target_arch = "arm",
93+
#[use_c_shim_if(all(target_arch = "arm", not(target_env = "msvc"),
9394
not(target_os = "ios"), not(thumbv6m)))]
9495
pub extern "C" fn __divmodsi4(a: i32, b: i32, rem: &mut i32) -> i32 {
9596
a.divmod(b, rem, |a, b| __divsi3(a, b))

src/int/udiv.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ intrinsics! {
211211

212212
#[use_c_shim_if(all(target_arch = "arm",
213213
not(target_os = "ios"),
214+
not(target_env = "msvc"),
214215
not(thumbv6m)))]
215216
/// Returns `n % d`
216217
pub extern "C" fn __umodsi3(n: u32, d: u32) -> u32 {
@@ -220,6 +221,7 @@ intrinsics! {
220221

221222
#[use_c_shim_if(all(target_arch = "arm",
222223
not(target_os = "ios"),
224+
not(target_env = "msvc"),
223225
not(thumbv6m)))]
224226
/// Returns `n / d` and sets `*rem = n % d`
225227
pub extern "C" fn __udivmodsi4(n: u32, d: u32, rem: Option<&mut u32>) -> u32 {

0 commit comments

Comments
 (0)