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 <wangmingrong1@xiaomi.com>
This commit is contained in:
wangmingrong1 2024-10-24 16:10:33 +08:00 committed by Xiang Xiao
parent 1af82ba979
commit d007193eef

View file

@ -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)