Skip to content

Commit 1839894

Browse files
committed
cmake: gcc: target_arm: Force FP hard ABI for DCLS
When Dual-redundant Core Lock-step (DCLS) topology is used, the VFP registers across the two redundant cores must be manually initialised and synchronised, and this requires the `-mfloat-abi=hard` option to be specified. This commit forces the use of FP "hard" ABI on the VFP-equipped cores that are configured in DCLS topology. Signed-off-by: Stephanos Ioannidis <[email protected]>
1 parent 6d4bce8 commit 1839894

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

cmake/compiler/gcc/target_arm.cmake

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,19 @@ if(CONFIG_FPU)
1414
list(APPEND TOOLCHAIN_C_FLAGS -mfpu=${GCC_M_FPU})
1515
list(APPEND TOOLCHAIN_LD_FLAGS -mfpu=${GCC_M_FPU})
1616

17-
if (CONFIG_FP_SOFTABI)
18-
list(APPEND TOOLCHAIN_C_FLAGS -mfloat-abi=softfp)
19-
list(APPEND TOOLCHAIN_LD_FLAGS -mfloat-abi=softfp)
20-
elseif(CONFIG_FP_HARDABI)
17+
if(CONFIG_CPU_HAS_DCLS AND NOT CONFIG_FP_HARDABI)
18+
# If the processor is equipped with VFP and configured in DCLS topology,
19+
# the FP "hard" ABI must be used in order to facilitate the FP register
20+
# initialisation and synchronisation.
21+
set(FORCE_FP_HARDABI TRUE)
22+
endif()
23+
24+
if (CONFIG_FP_HARDABI OR FORCE_FP_HARDABI)
2125
list(APPEND TOOLCHAIN_C_FLAGS -mfloat-abi=hard)
2226
list(APPEND TOOLCHAIN_LD_FLAGS -mfloat-abi=hard)
27+
elseif(CONFIG_FP_SOFTABI)
28+
list(APPEND TOOLCHAIN_C_FLAGS -mfloat-abi=softfp)
29+
list(APPEND TOOLCHAIN_LD_FLAGS -mfloat-abi=softfp)
2330
endif()
2431
endif()
2532

0 commit comments

Comments
 (0)