Skip to content

Commit e65b031

Browse files
committed
Use C add impl for arm-gnueabi
1 parent 6d6dbdc commit e65b031

File tree

5 files changed

+11
-8
lines changed

5 files changed

+11
-8
lines changed

build.rs

+4
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,10 @@ fn main() {
360360

361361
}
362362

363+
if llvm_target.last().unwrap().ends_with("gnueabi") {
364+
sources.extend(&["addsf3.c", "adddf3.c"]);
365+
}
366+
363367
if target_arch == "aarch64" {
364368
sources.extend(&["comparetf2.c",
365369
"extenddftf2.c",

src/arm.rs

+2
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,13 @@ pub unsafe fn __aeabi_ldivmod() {
5858
}
5959

6060
// TODO: These aeabi_* functions should be defined as aliases
61+
#[cfg(not(gnueabi))]
6162
#[cfg_attr(not(test), no_mangle)]
6263
pub extern "C" fn __aeabi_dadd(a: f64, b: f64) -> f64 {
6364
::float::add::__adddf3(a, b)
6465
}
6566

67+
#[cfg(not(gnueabi))]
6668
#[cfg_attr(not(test), no_mangle)]
6769
pub extern "C" fn __aeabi_fadd(a: f32, b: f32) -> f32 {
6870
::float::add::__addsf3(a, b)

src/float/add.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -181,14 +181,10 @@ macro_rules! add {
181181
}
182182
}
183183

184-
// NOTE(cfg) These are disabled for gnueabihf due to
185-
// https://github.com/rust-lang-nursery/compiler-builtins/issues/90
186-
#[cfg(not(gnueabi))]
187184
add!(__addsf3: f32);
188-
#[cfg(not(gnueabi))]
189185
add!(__adddf3: f64);
190186

191-
#[cfg(all(test, not(gnueabi)))]
187+
#[cfg(test)]
192188
mod tests {
193189
use core::{f32, f64};
194190
use qc::{F32, F64};

src/float/mod.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
use core::mem;
2-
#[cfg(test)]
3-
use core::fmt;
42

3+
// NOTE(cfg) add is disabled for gnueabi due to
4+
// https://github.com/rust-lang-nursery/compiler-builtins/issues/90
5+
6+
#[cfg(not(gnueabi))]
57
pub mod add;
68
pub mod pow;
79

src/float/pow.rs

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ pow!(__powidf2: f64, i32);
3131

3232
#[cfg(test)]
3333
mod tests {
34-
use float::{Float};
3534
use qc::{I32, F32, F64};
3635

3736
check! {

0 commit comments

Comments
 (0)