Skip to content

Commit 4bbfb7e

Browse files
authored
Merge pull request #256 from jordanrh1/windows-arm
Support windows/arm target
2 parents 0703bfa + 0a87c71 commit 4bbfb7e

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

build.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ mod c {
299299
}
300300
}
301301

302-
if target_arch == "arm" && target_os != "ios" {
302+
if target_arch == "arm" && target_os != "ios" && target_env != "msvc" {
303303
sources.extend(
304304
&[
305305
"arm/aeabi_div0.c",

src/arm.rs

+1-1
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

+3-2
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

+2
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)