armclang: Fix building cortex-m4 w/o floating point

When we build for a SoC that has a cortex-m4 w/o a FPU that
utilizes CMSIS headers with armclang (like mec1501modular_assy6885)
we get the following warning:

modules/hal/cmsis/CMSIS/Core/Include/core_cm4.h:93:8: warning:
   "Compiler generates FPU instructions for a device without
    an FPU (check __FPU_PRESENT)" [-W#warnings]
   #warning "Compiler generates FPU instructions for a device
   without an FPU (check __FPU_PRESENT)"

Fix the by setting -mfloat-abi=soft for such cases that don't have FPU
enabled.

Fixes #56068

Signed-off-by: Kumar Gala <kumar.gala@intel.com>
This commit is contained in:
Kumar Gala 2023-03-21 20:07:04 +00:00 committed by Carles Cufí
commit 32a48f2f55

View file

@ -38,6 +38,8 @@ else()
elseif(CONFIG_FP_HARDABI) elseif(CONFIG_FP_HARDABI)
list(APPEND TOOLCHAIN_C_FLAGS -mfloat-abi=hard) list(APPEND TOOLCHAIN_C_FLAGS -mfloat-abi=hard)
endif() endif()
else()
list(APPEND TOOLCHAIN_C_FLAGS -mfloat-abi=soft)
endif() endif()
endif() endif()