Skip to content

Commit

Permalink
arm/clang: replace deprecated parameter
Browse files Browse the repository at this point in the history
In LLVM Clang 17.0.1, the `--config` parameter has been deprecated and replaced by the `-target` parameter

Signed-off-by: chao an <[email protected]>
  • Loading branch information
anchao committed Nov 28, 2023
1 parent e39ef85 commit 0a0e35d
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 17 deletions.
2 changes: 1 addition & 1 deletion arch/arm/src/armv6-m/Toolchain.defs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ LLVM_CPUTYPE := cortex-m0
# Clang Configuration files

ifeq ($(CONFIG_ARM_TOOLCHAIN_CLANG),y)
TOOLCHAIN_CLANG_CONFIG = --config armv6m_soft_nofp
TOOLCHAIN_CLANG_CONFIG = armv6m_soft_nofp
else ifeq ($(CONFIG_ARM_TOOLCHAIN_ARMCLANG),y)
LDFLAGS += --cpu=Cortex-M0
endif
Expand Down
10 changes: 5 additions & 5 deletions arch/arm/src/armv7-m/Toolchain.defs
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,18 @@ ifeq ($(CONFIG_ARM_TOOLCHAIN_CLANG),y)

ifeq ($(CONFIG_ARCH_CORTEXM4),y)
ifeq ($(CONFIG_ARCH_FPU),y)
TOOLCHAIN_CLANG_CONFIG = --config armv7em_hard_fpv4_sp_d16
TOOLCHAIN_CLANG_CONFIG = armv7em_hard_fpv4_sp_d16
else
TOOLCHAIN_CLANG_CONFIG = --config armv7em_soft_nofp
TOOLCHAIN_CLANG_CONFIG = armv7em_soft_nofp
endif
else ifeq ($(CONFIG_ARCH_CORTEXM7),y)
ifeq ($(CONFIG_ARCH_FPU),y)
TOOLCHAIN_CLANG_CONFIG = --config armv7em_hard_fpv5_d16
TOOLCHAIN_CLANG_CONFIG = armv7em_hard_fpv5_d16
else
TOOLCHAIN_CLANG_CONFIG = --config armv7em_soft_nofp
TOOLCHAIN_CLANG_CONFIG = armv7em_soft_nofp
endif
else # ifeq ($(CONFIG_ARCH_CORTEXM3),y)
TOOLCHAIN_CLANG_CONFIG = --config armv7m_soft_nofp
TOOLCHAIN_CLANG_CONFIG = armv7m_soft_nofp
endif

else ifeq ($(CONFIG_ARM_TOOLCHAIN_ARMCLANG),y)
Expand Down
18 changes: 9 additions & 9 deletions arch/arm/src/armv8-m/Toolchain.defs
Original file line number Diff line number Diff line change
Expand Up @@ -109,30 +109,30 @@ endif
ifeq ($(CONFIG_ARM_TOOLCHAIN_CLANG),y)

ifeq ($(CONFIG_ARCH_CORTEXM23),y)
TOOLCHAIN_CLANG_CONFIG = --config armv8m.main_soft_nofp
TOOLCHAIN_CLANG_CONFIG = armv8m.main_soft_nofp
else ifeq ($(CONFIG_ARCH_CORTEXM33),y)
ifeq ($(CONFIG_ARCH_FPU),y)
TOOLCHAIN_CLANG_CONFIG = --config armv8m.main_hard_fp
TOOLCHAIN_CLANG_CONFIG = armv8m.main_hard_fp
else
TOOLCHAIN_CLANG_CONFIG = --config armv8m.main_soft_nofp
TOOLCHAIN_CLANG_CONFIG = armv8m.main_soft_nofp
endif
else ifeq ($(CONFIG_ARCH_CORTEXM35P),y)
ifeq ($(CONFIG_ARCH_FPU),y)
TOOLCHAIN_CLANG_CONFIG = --config armv8m.main_hard_fp
TOOLCHAIN_CLANG_CONFIG = armv8m.main_hard_fp
else
TOOLCHAIN_CLANG_CONFIG = --config armv8m.main_soft_nofp
TOOLCHAIN_CLANG_CONFIG = armv8m.main_soft_nofp
endif
else ifeq ($(CONFIG_ARCH_CORTEXM55),y)
ifeq ($(CONFIG_ARCH_FPU),y)
TOOLCHAIN_CLANG_CONFIG = --config armv8.1m.main_hard_fp
TOOLCHAIN_CLANG_CONFIG = armv8.1m.main_hard_fp
else
TOOLCHAIN_CLANG_CONFIG = --config armv8.1m.main_soft_nofp_nomve
TOOLCHAIN_CLANG_CONFIG = armv8.1m.main_soft_nofp_nomve
endif
else ifeq ($(CONFIG_ARCH_CORTEXM85),y)
ifeq ($(CONFIG_ARCH_FPU),y)
TOOLCHAIN_CLANG_CONFIG = --config armv8.1m.main_hard_fp
TOOLCHAIN_CLANG_CONFIG = armv8.1m.main_hard_fp
else
TOOLCHAIN_CLANG_CONFIG = --config armv8.1m.main_soft_nofp_nomve
TOOLCHAIN_CLANG_CONFIG = armv8.1m.main_soft_nofp_nomve
endif
endif

Expand Down
8 changes: 7 additions & 1 deletion arch/arm/src/common/Toolchain.defs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,13 @@ ifeq ($(CONFIG_ARM_TOOLCHAIN_CLANG),y)
TOOLCHAIN_CLANG_CONFIG := $(TOOLCHAIN_CLANG_CONFIG)_nosys
endif

ARCHCPUFLAGS += $(TOOLCHAIN_CLANG_CONFIG).cfg
ifeq ($(CLANGVER),17.0)
TOOLCHAIN_CLANG_OPTION = -target
else
TOOLCHAIN_CLANG_OPTION = --config
endif

ARCHCPUFLAGS += $(TOOLCHAIN_CLANG_OPTION) $(TOOLCHAIN_CLANG_CONFIG).cfg
endif

# ARM Compiler Clang toolchain
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/src/tlsr82/Toolchain.defs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# Clang Configuration files

ifeq ($(CONFIG_ARM_TOOLCHAIN_CLANG),y)
TOOLCHAIN_CLANG_CONFIG = --config armv6m_soft_nofp
TOOLCHAIN_CLANG_CONFIG = armv6m_soft_nofp
endif

# Generic GNU EABI toolchain
Expand Down

0 comments on commit 0a0e35d

Please sign in to comment.