From d007193eef478a2150cc52d30936081f093070fd Mon Sep 17 00:00:00 2001 From: wangmingrong1 Date: Thu, 24 Oct 2024 16:10:33 +0800 Subject: [PATCH] armv8m/clang.cmake: add armv8m clang config Its makefile is implemented in arch/arm/src/armv8-m/Toolchain.defs as follows: ifeq ($(CONFIG_ARM_TOOLCHAIN_CLANG),y) ifeq ($(CONFIG_ARCH_CORTEXM23),y) TOOLCHAIN_CLANG_CONFIG = armv8m.main_soft_nofp else ifeq ($(CONFIG_ARCH_CORTEXM33),y) ifeq ($(CONFIG_ARCH_FPU),y) TOOLCHAIN_CLANG_CONFIG = armv8m.main_hard_fp else TOOLCHAIN_CLANG_CONFIG = armv8m.main_soft_nofp endif else ifeq ($(CONFIG_ARCH_CORTEXM35P),y) ifeq ($(CONFIG_ARCH_FPU),y) TOOLCHAIN_CLANG_CONFIG = armv8m.main_hard_fp else TOOLCHAIN_CLANG_CONFIG = armv8m.main_soft_nofp endif else ifeq ($(CONFIG_ARCH_CORTEXM55),y) ifeq ($(CONFIG_ARCH_FPU),y) TOOLCHAIN_CLANG_CONFIG = armv8.1m.main_hard_fp else TOOLCHAIN_CLANG_CONFIG = armv8.1m.main_soft_nofp_nomve endif else ifeq ($(CONFIG_ARCH_CORTEXM85),y) ifeq ($(CONFIG_ARCH_FPU),y) TOOLCHAIN_CLANG_CONFIG = armv8.1m.main_hard_fp else TOOLCHAIN_CLANG_CONFIG = armv8.1m.main_soft_nofp_nomve endif endif Signed-off-by: wangmingrong1 --- arch/arm/src/cmake/armv8-m.cmake | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/arch/arm/src/cmake/armv8-m.cmake b/arch/arm/src/cmake/armv8-m.cmake index 514006f5afac1..3c9d515965862 100644 --- a/arch/arm/src/cmake/armv8-m.cmake +++ b/arch/arm/src/cmake/armv8-m.cmake @@ -24,6 +24,36 @@ if(CONFIG_ARM_DSP) set(EXTCPUFLAGS +dsp) endif() +if(CONFIG_ARM_TOOLCHAIN_CLANG) + if(CONFIG_ARCH_CORTEXM23) + set(TOOLCHAIN_CLANG_CONFIG armv8m.main_soft_nofp) + elseif(CONFIG_ARCH_CORTEXM33) + if(CONFIG_ARCH_FPU) + set(TOOLCHAIN_CLANG_CONFIG armv8m.main_hard_fp) + else() + set(TOOLCHAIN_CLANG_CONFIG armv8m.main_soft_nofp) + endif() + elseif(CONFIG_ARCH_CORTEXM35P) + if(CONFIG_ARCH_FPU) + set(TOOLCHAIN_CLANG_CONFIG armv8m.main_hard_fp) + else() + set(TOOLCHAIN_CLANG_CONFIG armv8m.main_soft_nofp) + endif() + elseif(CONFIG_ARCH_CORTEXM55) + if(CONFIG_ARCH_FPU) + set(TOOLCHAIN_CLANG_CONFIG armv8.1m.main_hard_fp) + else() + set(TOOLCHAIN_CLANG_CONFIG armv8.1m.main_soft_nofp_nomve) + endif() + elseif(CONFIG_ARCH_CORTEXM85) + if(CONFIG_ARCH_FPU) + set(TOOLCHAIN_CLANG_CONFIG armv8.1m.main_hard_fp) + else() + set(TOOLCHAIN_CLANG_CONFIG armv8.1m.main_soft_nofp_nomve) + endif() + endif() +endif() + if(CONFIG_ARCH_CORTEXM23) list(APPEND PLATFORM_FLAGS -mtune=cortex-m23 -march=armv8-m.main -mfloat-abi=soft)