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 435ae7c70c4da8c2d18d75312c441dd3924a193a
Author: zhangyuan29 <[email protected]>
AuthorDate: Tue Mar 4 16:03:26 2025 +0800

    arch/tricore: modify tasking compiler and link config
    
    Link through the ltc linker directly instead of driving it with
    cctc, and override the C link command so the generated include
    directory is passed to the linker.  Link against libc_fpu instead
    of disabling the default libraries, select the core with
    --core=mpe:vtc and emit a link map through --map-file when
    CONFIG_DEBUG_LINK_MAP is enabled.
    
    Signed-off-by: zhangyuan29 <[email protected]>
---
 arch/tricore/src/cmake/tasking.cmake | 23 ++++++++++++++++++-----
 1 file changed, 18 insertions(+), 5 deletions(-)

diff --git a/arch/tricore/src/cmake/tasking.cmake 
b/arch/tricore/src/cmake/tasking.cmake
index 50abd5dbaab..daf69a2295a 100644
--- a/arch/tricore/src/cmake/tasking.cmake
+++ b/arch/tricore/src/cmake/tasking.cmake
@@ -34,8 +34,8 @@ set(CMAKE_STRIP strip --strip-unneeded)
 set(CMAKE_OBJCOPY echo)
 set(CMAKE_OBJDUMP ${TOOLCHAIN_PREFIX}elfdump)
 
-set(CMAKE_LINKER ${TOOLCHAIN_PREFIX}cctc)
-set(CMAKE_LD ${TOOLCHAIN_PREFIX}cctc)
+set(CMAKE_LINKER ${TOOLCHAIN_PREFIX}ltc)
+set(CMAKE_LD ${TOOLCHAIN_PREFIX}ltc)
 set(CMAKE_AR ${TOOLCHAIN_PREFIX}artc -r)
 set(CMAKE_NM nm)
 set(CMAKE_RANLIB ranlib)
@@ -59,6 +59,13 @@ set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> rcs <TARGET> 
<LINK_FLAGS> <OBJECTS>")
 set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> rcs <TARGET> <LINK_FLAGS> <OBJECTS>")
 set(CMAKE_ASM_ARCHIVE_CREATE "<CMAKE_AR> rcs <TARGET> <LINK_FLAGS> <OBJECTS>")
 
+# override the LINK command
+
+add_link_options(-I${CMAKE_BINARY_DIR}/include)
+set(CMAKE_C_LINK_EXECUTABLE
+    "<CMAKE_LINKER> <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o 
<TARGET> <LINK_LIBRARIES>"
+)
+
 # Architecture flags
 
 add_compile_options(--lsl-core=vtc)
@@ -83,6 +90,12 @@ add_compile_options(--integer-enumeration)
 
 add_compile_options(--tradeoff=2)
 
+# Debug link map
+
+if(CONFIG_DEBUG_LINK_MAP)
+  add_link_options(--map-file=nuttx.map)
+endif()
+
 # enable symbolic debug information
 
 if(CONFIG_DEBUG_SYMBOLS)
@@ -113,11 +126,11 @@ add_compile_options(--branch-target-align)
 # cmake-format: on
 
 add_compile_options(--fp-model=2)
-add_link_options(--no-default-libraries)
-add_link_options(--fp-model=2)
+add_link_options(-lc_fpu)
 add_link_options(-lfp_fpu)
 
-add_link_options(--hex-format=s -Wl-OtxYcL -Wl-mcrfiklsmnoduq)
+add_link_options(--core=mpe:vtc)
+add_link_options(--hex-format=s -OtxYcL -mcrfiklsmnoduq)
 add_link_options(-lrt)
 
 # cmake-format: off

Reply via email to