Skip to content

Commit

Permalink
armv8m/clang.cmake: add armv8m clang config
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
W-M-R authored and xiaoxiang781216 committed Oct 24, 2024
1 parent 1af82ba commit d007193
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions arch/arm/src/cmake/armv8-m.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d007193

Please sign in to comment.