From 66d52cf01d671ad1616f067702a585d2fa9e5f1a Mon Sep 17 00:00:00 2001 From: Paolo Teti Date: Sat, 8 Sep 2018 17:41:26 +0200 Subject: [PATCH 1/2] Remove superfluous cc flags Latest `cc-rs` already manage all arm/thumb flags, so We can safely remove this piece of code. --- library/compiler-builtins/build.rs | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/library/compiler-builtins/build.rs b/library/compiler-builtins/build.rs index fba4091124a9..48d11db7ccef 100644 --- a/library/compiler-builtins/build.rs +++ b/library/compiler-builtins/build.rs @@ -141,29 +141,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( &[ From 296f04fe6342430ff44207e149ac32e93b1f62d4 Mon Sep 17 00:00:00 2001 From: Paolo Teti Date: Sat, 8 Sep 2018 19:04:09 +0200 Subject: [PATCH 2/2] Remove unused variable target_arch_arm Previous commit makes this variable unused --- library/compiler-builtins/build.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/library/compiler-builtins/build.rs b/library/compiler-builtins/build.rs index 48d11db7ccef..1ace622bef42 100644 --- a/library/compiler-builtins/build.rs +++ b/library/compiler-builtins/build.rs @@ -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);