@@ -35,7 +35,7 @@ use crate::back::profiling::{
35
35
selfprofile_after_pass_callback, selfprofile_before_pass_callback, LlvmSelfProfiler ,
36
36
} ;
37
37
use crate :: errors:: {
38
- CopyBitcode , FromLlvmDiag , FromLlvmOptimizationDiag , LlvmError , UnknownCompression ,
38
+ self , CopyBitcode , FromLlvmDiag , FromLlvmOptimizationDiag , LlvmError , UnknownCompression ,
39
39
WithLlvmError , WriteBytecode ,
40
40
} ;
41
41
use crate :: llvm:: diagnostic:: OptimizationDiagnosticKind ;
@@ -185,7 +185,16 @@ pub(crate) fn target_machine_factory(
185
185
let reloc_model = to_llvm_relocation_model ( sess. relocation_model ( ) ) ;
186
186
187
187
let ( opt_level, _) = to_llvm_opt_settings ( optlvl) ;
188
- let use_softfp = sess. opts . cg . soft_float ;
188
+ let use_softfp = if sess. target . arch == "arm" && sess. target . abi == "eabihf" {
189
+ sess. opts . cg . soft_float
190
+ } else {
191
+ // All `use_softfp` does is the equivalent of `-mfloat-abi` in GCC/clang, which only exists on ARM targets.
192
+ // We document this flag to only affect `*eabihf` targets, so let's show a warning for all other targets.
193
+ if sess. opts . cg . soft_float {
194
+ sess. dcx ( ) . emit_warn ( errors:: SoftFloatIgnored ) ;
195
+ }
196
+ false
197
+ } ;
189
198
190
199
let ffunction_sections =
191
200
sess. opts . unstable_opts . function_sections . unwrap_or ( sess. target . function_sections ) ;
0 commit comments