This is an automated email from the ASF dual-hosted git repository. xiaoxiang781216 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit bfd713f5f886c5b10ff37ccfc97e5d5b9b70ea83 Author: zhangyu117 <[email protected]> AuthorDate: Thu Jul 16 18:30:45 2026 +0800 libc/tricore: select the assembly file extension per toolchain The GNU sources are .S and the TASKING sources are .asm, but the make build always listed the .S files, so a TASKING make build picked the GNU assembly. Define ASMEXT in the toolchain files (S for GNU, asm for TASKING) and use it for both the cmake and the make builds. Signed-off-by: zhangyu117 <[email protected]> --- arch/tricore/src/cmake/gcc.cmake | 4 ++++ arch/tricore/src/cmake/tasking.cmake | 4 ++++ arch/tricore/src/common/ToolchainGnuc.defs | 1 + arch/tricore/src/common/ToolchainTasking.defs | 1 + libs/libc/machine/tricore/CMakeLists.txt | 34 +++++++++++++-------------- libs/libc/machine/tricore/Make.defs | 32 ++++++++++++------------- 6 files changed, 42 insertions(+), 34 deletions(-) diff --git a/arch/tricore/src/cmake/gcc.cmake b/arch/tricore/src/cmake/gcc.cmake index 13955c535c1..91897f597db 100644 --- a/arch/tricore/src/cmake/gcc.cmake +++ b/arch/tricore/src/cmake/gcc.cmake @@ -52,6 +52,10 @@ set(CMAKE_AR ${TOOLCHAIN_PREFIX}-gcc-ar) set(CMAKE_NM ${TOOLCHAIN_PREFIX}-gcc-nm) set(CMAKE_RANLIB ${TOOLCHAIN_PREFIX}-gcc-ranlib) +set(ASMEXT + S + CACHE INTERNAL "") + # override the ARCHIVE command set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> rcs <TARGET> <LINK_FLAGS> <OBJECTS>") diff --git a/arch/tricore/src/cmake/tasking.cmake b/arch/tricore/src/cmake/tasking.cmake index 62f2cc24b6d..550fc2d2fb3 100644 --- a/arch/tricore/src/cmake/tasking.cmake +++ b/arch/tricore/src/cmake/tasking.cmake @@ -46,6 +46,10 @@ set(CMAKE_AR ${TOOLCHAIN_PREFIX}artc -r) set(CMAKE_NM nm) set(CMAKE_RANLIB ranlib) +set(ASMEXT + asm + CACHE INTERNAL "") + # override the ARCHIVE command set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> rcs <TARGET> <LINK_FLAGS> <OBJECTS>") diff --git a/arch/tricore/src/common/ToolchainGnuc.defs b/arch/tricore/src/common/ToolchainGnuc.defs index 1f169cf061c..e8dcd481dcd 100644 --- a/arch/tricore/src/common/ToolchainGnuc.defs +++ b/arch/tricore/src/common/ToolchainGnuc.defs @@ -117,6 +117,7 @@ UNAR = $(CROSSDEV)tricore-elf-gcc-ar x NM = $(CROSSDEV)tricore-elf-gcc-nm OBJCOPY = $(CROSSDEV)tricore-elf-objcopy OBJDUMP = $(CROSSDEV)tricore-elf-objdump +ASMEXT = S ARCHOPTIMIZATION += -fno-builtin diff --git a/arch/tricore/src/common/ToolchainTasking.defs b/arch/tricore/src/common/ToolchainTasking.defs index 9ea13cc3ca1..544e3b8f915 100644 --- a/arch/tricore/src/common/ToolchainTasking.defs +++ b/arch/tricore/src/common/ToolchainTasking.defs @@ -57,6 +57,7 @@ UNAR = artc -x NM = nm OBJCOPY = echo OBJDUMP = elfdump +ASMEXT = asm ARCHOPTIMIZATION += --lsl-core=vtc LDFLAGS += --lsl-core=vtc diff --git a/libs/libc/machine/tricore/CMakeLists.txt b/libs/libc/machine/tricore/CMakeLists.txt index 5ccba6d5d20..4f5d244739d 100644 --- a/libs/libc/machine/tricore/CMakeLists.txt +++ b/libs/libc/machine/tricore/CMakeLists.txt @@ -28,74 +28,72 @@ endif() if(CONFIG_TRICORE_TOOLCHAIN_TASKING) set(TRICORE_SUBDIR tasking) - set(ASM_EXT asm) else() set(TRICORE_SUBDIR gnu) - set(ASM_EXT S) endif() if(CONFIG_ARCH_SETJMP_H) - list(APPEND SRCS ${TRICORE_SUBDIR}/arch_setjmp.${ASM_EXT}) + list(APPEND SRCS ${TRICORE_SUBDIR}/arch_setjmp.${ASMEXT}) endif() if(CONFIG_LIBC_ARCH_MEMCPY) - list(APPEND SRCS ${TRICORE_SUBDIR}/arch_memcpy.${ASM_EXT}) + list(APPEND SRCS ${TRICORE_SUBDIR}/arch_memcpy.${ASMEXT}) endif() if(CONFIG_LIBC_ARCH_MEMSET) - list(APPEND SRCS ${TRICORE_SUBDIR}/arch_memset.${ASM_EXT}) + list(APPEND SRCS ${TRICORE_SUBDIR}/arch_memset.${ASMEXT}) endif() if(CONFIG_LIBC_ARCH_MEMMOVE) - list(APPEND SRCS ${TRICORE_SUBDIR}/arch_memmove.${ASM_EXT}) + list(APPEND SRCS ${TRICORE_SUBDIR}/arch_memmove.${ASMEXT}) endif() if(CONFIG_LIBC_ARCH_MEMCMP) - list(APPEND SRCS ${TRICORE_SUBDIR}/arch_memcmp.${ASM_EXT}) + list(APPEND SRCS ${TRICORE_SUBDIR}/arch_memcmp.${ASMEXT}) endif() if(CONFIG_LIBC_ARCH_MEMCHR) - list(APPEND SRCS ${TRICORE_SUBDIR}/arch_memchr.${ASM_EXT}) + list(APPEND SRCS ${TRICORE_SUBDIR}/arch_memchr.${ASMEXT}) endif() if(CONFIG_LIBC_ARCH_STRCPY) - list(APPEND SRCS ${TRICORE_SUBDIR}/arch_strcpy.${ASM_EXT}) + list(APPEND SRCS ${TRICORE_SUBDIR}/arch_strcpy.${ASMEXT}) endif() if(CONFIG_LIBC_ARCH_STRCMP) - list(APPEND SRCS ${TRICORE_SUBDIR}/arch_strcmp.${ASM_EXT}) + list(APPEND SRCS ${TRICORE_SUBDIR}/arch_strcmp.${ASMEXT}) endif() if(CONFIG_LIBC_ARCH_STRLEN) - list(APPEND SRCS ${TRICORE_SUBDIR}/arch_strlen.${ASM_EXT}) + list(APPEND SRCS ${TRICORE_SUBDIR}/arch_strlen.${ASMEXT}) endif() if(CONFIG_LIBC_ARCH_STRCHR) - list(APPEND SRCS ${TRICORE_SUBDIR}/arch_strchr.${ASM_EXT}) + list(APPEND SRCS ${TRICORE_SUBDIR}/arch_strchr.${ASMEXT}) endif() if(CONFIG_LIBC_ARCH_STRCHRNUL) - list(APPEND SRCS ${TRICORE_SUBDIR}/arch_strchrnul.${ASM_EXT}) + list(APPEND SRCS ${TRICORE_SUBDIR}/arch_strchrnul.${ASMEXT}) endif() if(CONFIG_LIBC_ARCH_STRNCMP) - list(APPEND SRCS ${TRICORE_SUBDIR}/arch_strncmp.${ASM_EXT}) + list(APPEND SRCS ${TRICORE_SUBDIR}/arch_strncmp.${ASMEXT}) endif() if(CONFIG_LIBC_ARCH_STRNLEN) - list(APPEND SRCS ${TRICORE_SUBDIR}/arch_strnlen.${ASM_EXT}) + list(APPEND SRCS ${TRICORE_SUBDIR}/arch_strnlen.${ASMEXT}) endif() if(CONFIG_LIBC_ARCH_STRRCHR) - list(APPEND SRCS ${TRICORE_SUBDIR}/arch_strrchr.${ASM_EXT}) + list(APPEND SRCS ${TRICORE_SUBDIR}/arch_strrchr.${ASMEXT}) endif() if(CONFIG_LIBC_ARCH_STRNCPY) - list(APPEND SRCS ${TRICORE_SUBDIR}/arch_strncpy.${ASM_EXT}) + list(APPEND SRCS ${TRICORE_SUBDIR}/arch_strncpy.${ASMEXT}) endif() if(CONFIG_LIBC_ARCH_STPCPY) - list(APPEND SRCS ${TRICORE_SUBDIR}/arch_stpcpy.${ASM_EXT}) + list(APPEND SRCS ${TRICORE_SUBDIR}/arch_stpcpy.${ASMEXT}) endif() target_include_directories(c PRIVATE ${CMAKE_CURRENT_LIST_DIR}) diff --git a/libs/libc/machine/tricore/Make.defs b/libs/libc/machine/tricore/Make.defs index ad3c778a9a5..295a47d5dc2 100644 --- a/libs/libc/machine/tricore/Make.defs +++ b/libs/libc/machine/tricore/Make.defs @@ -39,67 +39,67 @@ AFLAGS += ${INCDIR_PREFIX}$(TOPDIR)$(DELIM)libs$(DELIM)libc$(DELIM)machine$(DELI AFLAGS += -Wa,-mtc18 ifeq ($(CONFIG_ARCH_SETJMP_H),y) -ASRCS += arch_setjmp.S +ASRCS += arch_setjmp.$(ASMEXT) endif ifeq ($(CONFIG_LIBC_ARCH_MEMCPY),y) -ASRCS += arch_memcpy.S +ASRCS += arch_memcpy.$(ASMEXT) endif ifeq ($(CONFIG_LIBC_ARCH_MEMSET),y) -ASRCS += arch_memset.S +ASRCS += arch_memset.$(ASMEXT) endif ifeq ($(CONFIG_LIBC_ARCH_MEMMOVE),y) -ASRCS += arch_memmove.S +ASRCS += arch_memmove.$(ASMEXT) endif ifeq ($(CONFIG_LIBC_ARCH_MEMCMP),y) -ASRCS += arch_memcmp.S +ASRCS += arch_memcmp.$(ASMEXT) endif ifeq ($(CONFIG_LIBC_ARCH_MEMCHR),y) -ASRCS += arch_memchr.S +ASRCS += arch_memchr.$(ASMEXT) endif ifeq ($(CONFIG_LIBC_ARCH_STRCPY),y) -ASRCS += arch_strcpy.S +ASRCS += arch_strcpy.$(ASMEXT) endif ifeq ($(CONFIG_LIBC_ARCH_STRCMP),y) -ASRCS += arch_strcmp.S +ASRCS += arch_strcmp.$(ASMEXT) endif ifeq ($(CONFIG_LIBC_ARCH_STRLEN),y) -ASRCS += arch_strlen.S +ASRCS += arch_strlen.$(ASMEXT) endif ifeq ($(CONFIG_LIBC_ARCH_STRCHR),y) -ASRCS += arch_strchr.S +ASRCS += arch_strchr.$(ASMEXT) endif ifeq ($(CONFIG_LIBC_ARCH_STRCHRNUL),y) -ASRCS += arch_strchrnul.S +ASRCS += arch_strchrnul.$(ASMEXT) endif ifeq ($(CONFIG_LIBC_ARCH_STRNCMP),y) -ASRCS += arch_strncmp.S +ASRCS += arch_strncmp.$(ASMEXT) endif ifeq ($(CONFIG_LIBC_ARCH_STRNLEN),y) -ASRCS += arch_strnlen.S +ASRCS += arch_strnlen.$(ASMEXT) endif ifeq ($(CONFIG_LIBC_ARCH_STRRCHR),y) -ASRCS += arch_strrchr.S +ASRCS += arch_strrchr.$(ASMEXT) endif ifeq ($(CONFIG_LIBC_ARCH_STRNCPY),y) -ASRCS += arch_strncpy.S +ASRCS += arch_strncpy.$(ASMEXT) endif ifeq ($(CONFIG_LIBC_ARCH_STPCPY),y) -ASRCS += arch_stpcpy.S +ASRCS += arch_stpcpy.$(ASMEXT) endif DEPPATH += --dep-path machine/tricore/$(TRICORE_SUBDIR)
