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
This commit is contained in:
parent
266ea0740a
commit
280012b1df
5
build.rs
5
build.rs
|
@ -423,13 +423,8 @@ mod c {
|
||||||
if llvm_target[0] == "thumbv6m" {
|
if llvm_target[0] == "thumbv6m" {
|
||||||
sources.remove(
|
sources.remove(
|
||||||
&[
|
&[
|
||||||
"aeabi_cdcmp",
|
|
||||||
"aeabi_cfcmp",
|
|
||||||
"aeabi_dcmp",
|
|
||||||
"aeabi_fcmp",
|
|
||||||
"clzdi2",
|
"clzdi2",
|
||||||
"clzsi2",
|
"clzsi2",
|
||||||
"comparesf2",
|
|
||||||
"divmodsi4",
|
"divmodsi4",
|
||||||
"modsi3",
|
"modsi3",
|
||||||
"switch16",
|
"switch16",
|
||||||
|
|
|
@ -72,7 +72,9 @@ intrinsics! {
|
||||||
a.div(b)
|
a.div(b)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[use_c_shim_if(all(target_arch = "arm", not(target_os = "ios")))]
|
#[use_c_shim_if(all(target_arch = "arm",
|
||||||
|
not(target_os = "ios")),
|
||||||
|
not(thumbv6m))]
|
||||||
pub extern "C" fn __modsi3(a: i32, b: i32) -> i32 {
|
pub extern "C" fn __modsi3(a: i32, b: i32) -> i32 {
|
||||||
a.mod_(b)
|
a.mod_(b)
|
||||||
}
|
}
|
||||||
|
@ -87,7 +89,8 @@ intrinsics! {
|
||||||
a.mod_(b)
|
a.mod_(b)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[use_c_shim_if(all(target_arch = "arm", not(target_os = "ios")))]
|
#[use_c_shim_if(all(target_arch = "arm",
|
||||||
|
not(target_os = "ios"), not(thumbv6m)))]
|
||||||
pub extern "C" fn __divmodsi4(a: i32, b: i32, rem: &mut i32) -> i32 {
|
pub extern "C" fn __divmodsi4(a: i32, b: i32, rem: &mut i32) -> i32 {
|
||||||
a.divmod(b, rem, |a, b| __divsi3(a, b))
|
a.divmod(b, rem, |a, b| __divsi3(a, b))
|
||||||
}
|
}
|
||||||
|
|
|
@ -209,7 +209,9 @@ intrinsics! {
|
||||||
(q << 1) | carry
|
(q << 1) | carry
|
||||||
}
|
}
|
||||||
|
|
||||||
#[use_c_shim_if(all(target_arch = "arm", not(target_os = "ios")))]
|
#[use_c_shim_if(all(target_arch = "arm",
|
||||||
|
not(target_os = "ios"),
|
||||||
|
not(thumbv6m)))]
|
||||||
/// Returns `n % d`
|
/// Returns `n % d`
|
||||||
pub extern "C" fn __umodsi3(n: u32, d: u32) -> u32 {
|
pub extern "C" fn __umodsi3(n: u32, d: u32) -> u32 {
|
||||||
let q = __udivsi3(n, d);
|
let q = __udivsi3(n, d);
|
||||||
|
|
Loading…
Reference in New Issue