2019-09-19 02:41:37 +02:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
2022-10-21 00:09:50 +02:00
|
|
|
|
|
|
|
set(ARM_C_FLAGS)
|
|
|
|
|
|
|
|
list(APPEND ARM_C_FLAGS -mcpu=${GCC_M_CPU})
|
2020-04-21 09:52:57 +02:00
|
|
|
|
2021-03-25 11:56:15 +01:00
|
|
|
if(CONFIG_COMPILER_ISA_THUMB2)
|
2022-10-21 00:09:50 +02:00
|
|
|
list(APPEND ARM_C_FLAGS -mthumb)
|
2021-03-25 11:56:15 +01:00
|
|
|
endif()
|
2019-09-19 02:41:37 +02:00
|
|
|
|
2022-10-21 00:09:50 +02:00
|
|
|
list(APPEND ARM_C_FLAGS -mabi=aapcs)
|
2020-04-09 11:00:29 +02:00
|
|
|
|
2021-03-25 11:56:15 +01:00
|
|
|
if(CONFIG_FPU)
|
2022-10-21 00:09:50 +02:00
|
|
|
list(APPEND ARM_C_FLAGS -mfpu=${GCC_M_FPU})
|
2020-03-30 03:10:32 +02:00
|
|
|
|
2022-06-18 18:09:49 +02:00
|
|
|
if(CONFIG_DCLS AND NOT CONFIG_FP_HARDABI)
|
2020-03-31 03:06:32 +02: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)
|
2022-10-21 00:09:50 +02:00
|
|
|
list(APPEND ARM_C_FLAGS -mfloat-abi=hard)
|
2020-03-31 03:06:32 +02:00
|
|
|
elseif(CONFIG_FP_SOFTABI)
|
2022-10-21 00:09:50 +02:00
|
|
|
list(APPEND ARM_C_FLAGS -mfloat-abi=softfp)
|
2019-09-19 02:41:37 +02:00
|
|
|
endif()
|
|
|
|
endif()
|
2021-08-18 14:04:45 +02:00
|
|
|
|
|
|
|
if(CONFIG_FP16)
|
|
|
|
if (CONFIG_FP16_IEEE)
|
2022-10-21 00:09:50 +02:00
|
|
|
list(APPEND ARM_C_FLAGS -mfp16-format=ieee)
|
2021-08-18 14:04:45 +02:00
|
|
|
elseif(CONFIG_FP16_ALT)
|
2022-10-21 00:09:50 +02:00
|
|
|
list(APPEND ARM_C_FLAGS -mfp16-format=alternative)
|
2021-08-18 14:04:45 +02:00
|
|
|
endif()
|
|
|
|
endif()
|
2023-07-27 10:42:34 +02:00
|
|
|
|
|
|
|
if(CONFIG_THREAD_LOCAL_STORAGE)
|
|
|
|
list(APPEND ARM_C_FLAGS -mtp=soft)
|
|
|
|
endif()
|
|
|
|
|
2022-10-21 00:09:50 +02:00
|
|
|
list(APPEND TOOLCHAIN_C_FLAGS ${ARM_C_FLAGS})
|
|
|
|
list(APPEND TOOLCHAIN_LD_FLAGS NO_SPLIT ${ARM_C_FLAGS})
|
2024-01-19 13:00:38 +01:00
|
|
|
|
|
|
|
# Flags not supported by llext linker
|
|
|
|
# (regexps are supported and match whole word)
|
|
|
|
set(LLEXT_REMOVE_FLAGS
|
|
|
|
-fno-pic
|
|
|
|
-fno-pie
|
|
|
|
-ffunction-sections
|
|
|
|
-fdata-sections
|
|
|
|
-g.*
|
|
|
|
-Os
|
|
|
|
)
|
|
|
|
|
|
|
|
# Flags to be added to llext code compilation
|
|
|
|
set(LLEXT_APPEND_FLAGS
|
|
|
|
-mlong-calls
|
|
|
|
-mthumb
|
|
|
|
)
|