2019-09-18 19:41:37 -05:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
2021-03-25 11:56:15 +01:00
|
|
|
list(APPEND TOOLCHAIN_C_FLAGS -mcpu=${GCC_M_CPU})
|
|
|
|
list(APPEND TOOLCHAIN_LD_FLAGS -mcpu=${GCC_M_CPU})
|
2020-04-21 16:52:57 +09:00
|
|
|
|
2021-03-25 11:56:15 +01:00
|
|
|
if(CONFIG_COMPILER_ISA_THUMB2)
|
|
|
|
list(APPEND TOOLCHAIN_C_FLAGS -mthumb)
|
|
|
|
list(APPEND TOOLCHAIN_LD_FLAGS -mthumb)
|
|
|
|
endif()
|
2019-09-18 19:41:37 -05:00
|
|
|
|
2021-03-25 11:56:15 +01:00
|
|
|
list(APPEND TOOLCHAIN_C_FLAGS -mabi=aapcs)
|
|
|
|
list(APPEND TOOLCHAIN_LD_FLAGS -mabi=aapcs)
|
2020-04-09 18:00:29 +09:00
|
|
|
|
2021-03-25 11:56:15 +01:00
|
|
|
if(CONFIG_FPU)
|
2020-03-30 10:10:32 +09:00
|
|
|
list(APPEND TOOLCHAIN_C_FLAGS -mfpu=${GCC_M_FPU})
|
|
|
|
list(APPEND TOOLCHAIN_LD_FLAGS -mfpu=${GCC_M_FPU})
|
|
|
|
|
2022-06-18 23:09:49 +07:00
|
|
|
if(CONFIG_DCLS AND NOT CONFIG_FP_HARDABI)
|
2020-03-31 10:06:32 +09:00
|
|
|
# If the processor is equipped with VFP and configured in DCLS topology,
|
|
|
|
# the FP "hard" ABI must be used in order to facilitate the FP register
|
|
|
|
# initialisation and synchronisation.
|
|
|
|
set(FORCE_FP_HARDABI TRUE)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (CONFIG_FP_HARDABI OR FORCE_FP_HARDABI)
|
2021-03-25 11:56:15 +01:00
|
|
|
list(APPEND TOOLCHAIN_C_FLAGS -mfloat-abi=hard)
|
|
|
|
list(APPEND TOOLCHAIN_LD_FLAGS -mfloat-abi=hard)
|
2020-03-31 10:06:32 +09:00
|
|
|
elseif(CONFIG_FP_SOFTABI)
|
|
|
|
list(APPEND TOOLCHAIN_C_FLAGS -mfloat-abi=softfp)
|
|
|
|
list(APPEND TOOLCHAIN_LD_FLAGS -mfloat-abi=softfp)
|
2019-09-18 19:41:37 -05:00
|
|
|
endif()
|
|
|
|
endif()
|
2021-08-18 21:04:45 +09:00
|
|
|
|
|
|
|
if(CONFIG_FP16)
|
|
|
|
if (CONFIG_FP16_IEEE)
|
|
|
|
list(APPEND TOOLCHAIN_C_FLAGS -mfp16-format=ieee)
|
|
|
|
list(APPEND TOOLCHAIN_LD_FLAGS -mfp16-format=ieee)
|
|
|
|
elseif(CONFIG_FP16_ALT)
|
|
|
|
list(APPEND TOOLCHAIN_C_FLAGS -mfp16-format=alternative)
|
|
|
|
list(APPEND TOOLCHAIN_LD_FLAGS -mfp16-format=alternative)
|
|
|
|
endif()
|
|
|
|
endif()
|