Set -mfloat-abi=hard not only for thumb targets

master
Paolo Teti 2018-02-11 21:17:42 +01:00
parent 63de7c62c1
commit e15ab79173
1 changed files with 6 additions and 4 deletions

View File

@ -103,7 +103,9 @@ mod c {
let target_env = env::var("CARGO_CFG_TARGET_ENV").unwrap();
let target_os = env::var("CARGO_CFG_TARGET_OS").unwrap();
let target_vendor = env::var("CARGO_CFG_TARGET_VENDOR").unwrap();
let target_arch_arm =
target_arch.contains("arm") ||
target_arch.contains("thumb");
let cfg = &mut cc::Build::new();
cfg.warnings(false);
@ -137,10 +139,10 @@ mod c {
// the implementation is not valid for the arch, then gcc will error when compiling it.
if llvm_target[0].starts_with("thumb") {
cfg.flag("-mthumb");
}
if llvm_target.last() == Some(&"eabihf") {
cfg.flag("-mfloat-abi=hard");
}
if target_arch_arm && llvm_target.last() == Some(&"eabihf") {
cfg.flag("-mfloat-abi=hard");
}
if llvm_target[0] == "thumbv6m" {