From 8fe323c057f271e55a11798999cafc0f1b7fbd6f Mon Sep 17 00:00:00 2001 From: Antoni Boucher Date: Fri, 9 May 2025 07:53:15 -0400 Subject: [PATCH] Implement soft floats --- src/base.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/base.rs b/src/base.rs index 9b495174a3f..d8cd2e14fc3 100644 --- a/src/base.rs +++ b/src/base.rs @@ -135,6 +135,17 @@ pub fn compile_codegen_unit( // NOTE: Rust relies on LLVM doing wrapping on overflow. context.add_command_line_option("-fwrapv"); + let soft_float_enabled = tcx.global_backend_features(()) + .iter() + .any(|feature| { + feature == "soft-float" || feature == "+soft-float" + }); + + if soft_float_enabled { + /*context.add_command_line_option("-msoft-float"); + context.add_driver_option("-msoft-float");*/ + } + if let Some(model) = tcx.sess.code_model() { use rustc_target::spec::CodeModel;