This is an automated email from the ASF dual-hosted git repository.
archer pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 80cde18f07a arch/tricore: Align Makefile with Cmake for tasking linker
script preprocessing
80cde18f07a is described below
commit 80cde18f07a2cb3355dd9794158d95ec18648364
Author: wangchengdong <[email protected]>
AuthorDate: Tue Sep 23 17:39:40 2025 +0800
arch/tricore: Align Makefile with Cmake for tasking linker script
preprocessing
Provide linker script preprocessing function porting for
tasking compiler
Signed-off-by: Chengdong Wang <[email protected]>
---
arch/tricore/src/Makefile | 17 ++++-------------
arch/tricore/src/common/Toolchain.defs | 9 +++++++++
arch/tricore/src/common/ToolchainTasking.defs | 5 ++++-
3 files changed, 17 insertions(+), 14 deletions(-)
diff --git a/arch/tricore/src/Makefile b/arch/tricore/src/Makefile
index 6cea88c56f2..be04fce8697 100644
--- a/arch/tricore/src/Makefile
+++ b/arch/tricore/src/Makefile
@@ -105,12 +105,10 @@ else
LIBRARY_OPT = -l
endif
-ifeq ($(CONFIG_TRICORE_TOOLCHAIN_TASKING),y)
- LDFLAGS += $(addprefix $(SCRIPT_OPT),$(call CONVERT_PATH,$(ARCHSCRIPT)))
$(EXTRALINKCMDS)
-else
- ARCHSCRIPT := $(call CONVERT_PATH,$(ARCHSCRIPT))
- LDFLAGS += $(addprefix $(SCRIPT_OPT),$(addsuffix .tmp,$(ARCHSCRIPT)))
$(EXTRALINKCMDS)
+ARCHSCRIPT := $(call CONVERT_PATH,$(ARCHSCRIPT))
+LDFLAGS += $(addprefix $(SCRIPT_OPT),$(addsuffix .tmp,$(ARCHSCRIPT)))
$(EXTRALINKCMDS)
+ifeq ($(CONFIG_TRICORE_TOOLCHAIN_TASKING),)
LDSTARTGROUP ?= -Wl,--start-group
LDENDGROUP ?= -Wl,--end-group
endif
@@ -166,16 +164,11 @@ define LINK_ALLSYMS
$(Q) $(call DELFILE, allsyms.tmp allsyms$(OBJEXT))
endef
-ifeq ($(CONFIG_TRICORE_TOOLCHAIN_TASKING),)
$(addsuffix .tmp,$(ARCHSCRIPT)): $(ARCHSCRIPT)
$(call PREPROCESS, $(patsubst %.tmp,%,$@), $@)
-endif
-ifeq ($(CONFIG_TRICORE_TOOLCHAIN_TASKING),y)
-nuttx$(EXEEXT): $(HEAD_COBJ) board$(DELIM)libboard$(LIBEXT) $(ARCHSCRIPT)
$(EXTRA_LIBS)
-else
nuttx$(EXEEXT): $(HEAD_COBJ) board$(DELIM)libboard$(LIBEXT) $(EXTRA_LIBS)
$(addsuffix .tmp,$(ARCHSCRIPT))
-endif
+
$(Q) echo "LD: nuttx"
ifneq ($(CONFIG_ALLSYMS),y)
$(Q) $(LD) $(LDFLAGS) $(LIBPATHS) $(EXTRA_LIBPATHS) \
@@ -194,9 +187,7 @@ ifneq ($(CONFIG_WINDOWS_NATIVE),y)
grep -v '\(compiled\)\|\(\$(OBJEXT)$$\)\|\( [aUw]
\)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
sort > $(TOPDIR)$(DELIM)System.map
endif
-ifeq ($(CONFIG_TRICORE_TOOLCHAIN_TASKING),)
$(Q) $(call DELFILE, $(addsuffix .tmp,$(ARCHSCRIPT)))
-endif
# This is part of the top-level export target
# Note that there may not be a head object if layout is handled
diff --git a/arch/tricore/src/common/Toolchain.defs
b/arch/tricore/src/common/Toolchain.defs
index ec43c28fbfc..b58f486284b 100644
--- a/arch/tricore/src/common/Toolchain.defs
+++ b/arch/tricore/src/common/Toolchain.defs
@@ -25,3 +25,12 @@ ifeq ($(CONFIG_TRICORE_TOOLCHAIN_TASKING),y)
else
include $(TOPDIR)/arch/tricore/src/common/ToolchainGnuc.defs
endif
+
+ifeq ($(CONFIG_TRICORE_TOOLCHAIN_TASKING),y)
+ undefine PREPROCESS
+ define PREPROCESS
+ $(ECHO_BEGIN)"CPP: $1->$2 "
+ $(CPP) $(CPPFLAGS) $1 > $2
+ $(ECHO_END)
+ endef
+endif
\ No newline at end of file
diff --git a/arch/tricore/src/common/ToolchainTasking.defs
b/arch/tricore/src/common/ToolchainTasking.defs
index 816fd26a3d9..26bf4c43c41 100644
--- a/arch/tricore/src/common/ToolchainTasking.defs
+++ b/arch/tricore/src/common/ToolchainTasking.defs
@@ -44,9 +44,12 @@ endif
# Tasking toolchain
+TASKING_COMPILER_PATH := $(shell which ctc)
+C_COMPILER_DIR := $(dir $(TASKING_COMPILER_PATH))
+
CC = cctc
CXX = cctc
-CPP = cctc $(ARCHOPTIMIZATION)
+CPP = ctc -E -I$(C_COMPILER_DIR)/../include.lsl
LD = cctc
STRIP = strip --strip-unneeded
AR = artc -r