toolchain: clang: arm: do not use fp instruction when CONFIG_FPU=n

Clang uses floating-point instructions by default, even if -mfpu is not
defined. Disable using FPU when CONFIG_FPU=n.

Using floating-point instructions when FPU is not enabled generates
Usage Fault.

Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
This commit is contained in:
Dawid Niedzwiecki 2024-06-14 13:32:01 +02:00 committed by Anas Nashif
parent 123f99c87b
commit b584e2c6d0
1 changed files with 4 additions and 0 deletions

View File

@ -25,6 +25,10 @@ if(CONFIG_FPU)
elseif(CONFIG_FP_SOFTABI)
list(APPEND ARM_C_FLAGS -mfloat-abi=softfp)
endif()
else()
list(APPEND ARM_C_FLAGS -mfpu=none)
# Disable usage of FPU registers
list(APPEND ARM_C_FLAGS -mfloat-abi=soft)
endif()
if(CONFIG_FP16)