Skip to content

Commit 280012b

Browse files
committed
Fix thumbv6m build (feature=c)
1. Avoid undefined references as: undefined reference to `__modsi3' undefined reference to `__umodsi3' 2. We can't remove assembly implementations that are not in the list
1 parent 266ea07 commit 280012b

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

build.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -423,13 +423,8 @@ mod c {
423423
if llvm_target[0] == "thumbv6m" {
424424
sources.remove(
425425
&[
426-
"aeabi_cdcmp",
427-
"aeabi_cfcmp",
428-
"aeabi_dcmp",
429-
"aeabi_fcmp",
430426
"clzdi2",
431427
"clzsi2",
432-
"comparesf2",
433428
"divmodsi4",
434429
"modsi3",
435430
"switch16",

src/int/sdiv.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ intrinsics! {
7272
a.div(b)
7373
}
7474

75-
#[use_c_shim_if(all(target_arch = "arm", not(target_os = "ios")))]
75+
#[use_c_shim_if(all(target_arch = "arm",
76+
not(target_os = "ios")),
77+
not(thumbv6m))]
7678
pub extern "C" fn __modsi3(a: i32, b: i32) -> i32 {
7779
a.mod_(b)
7880
}
@@ -87,7 +89,8 @@ intrinsics! {
8789
a.mod_(b)
8890
}
8991

90-
#[use_c_shim_if(all(target_arch = "arm", not(target_os = "ios")))]
92+
#[use_c_shim_if(all(target_arch = "arm",
93+
not(target_os = "ios"), not(thumbv6m)))]
9194
pub extern "C" fn __divmodsi4(a: i32, b: i32, rem: &mut i32) -> i32 {
9295
a.divmod(b, rem, |a, b| __divsi3(a, b))
9396
}

src/int/udiv.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,9 @@ intrinsics! {
209209
(q << 1) | carry
210210
}
211211

212-
#[use_c_shim_if(all(target_arch = "arm", not(target_os = "ios")))]
212+
#[use_c_shim_if(all(target_arch = "arm",
213+
not(target_os = "ios"),
214+
not(thumbv6m)))]
213215
/// Returns `n % d`
214216
pub extern "C" fn __umodsi3(n: u32, d: u32) -> u32 {
215217
let q = __udivsi3(n, d);

0 commit comments

Comments
 (0)