Merge pull request #259 from paoloteti/cc-rs

Remove superfluous cc flags
master
Alex Crichton 2018-09-09 10:44:02 -07:00 committed by GitHub
commit 7e1a1e9042
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 26 deletions

View File

@ -110,9 +110,6 @@ 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);
@ -141,29 +138,6 @@ mod c {
cfg.define("VISIBILITY_HIDDEN", None);
}
// NOTE Most of the ARM intrinsics are written in assembly. Tell gcc which arch we are going
// to target to make sure that the assembly implementations really work for the target. If
// 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 target_arch_arm && llvm_target.last() == Some(&"eabihf") {
cfg.flag("-mfloat-abi=hard");
}
if llvm_target[0] == "thumbv6m" {
cfg.flag("-march=armv6-m");
}
if llvm_target[0] == "thumbv7m" {
cfg.flag("-march=armv7-m");
}
if llvm_target[0] == "thumbv7em" {
cfg.flag("-march=armv7e-m");
}
let mut sources = Sources::new();
sources.extend(
&[