From ac98d0e3507dfe26b3fc1b0df17b5d4ad288351e Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Fri, 11 Oct 2024 13:24:24 -0700 Subject: [PATCH] cmake: xcc: remove TOOLCHAIN_LIBS Following the footstep of GCC/Clang cmake code to remove TOOLCHAIN_LIBS, xcc also has it removed and utilizes something similar to c_library to link the HAL library. Signed-off-by: Daniel Leung --- cmake/compiler/xcc/target.cmake | 6 ------ cmake/linker/xt-ld/linker_libraries.cmake | 3 ++- cmake/linker/xt-ld/target.cmake | 1 - 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/cmake/compiler/xcc/target.cmake b/cmake/compiler/xcc/target.cmake index a23c9d5bde68cf..db965e715a839e 100644 --- a/cmake/compiler/xcc/target.cmake +++ b/cmake/compiler/xcc/target.cmake @@ -40,12 +40,6 @@ foreach(file_name include/stddef.h include-fixed/limits.h) list(APPEND NOSTDINC ${_OUTPUT}) endforeach() -list(APPEND TOOLCHAIN_LIBS - gcc - hal - ) - - # For CMake to be able to test if a compiler flag is supported by the # toolchain we need to give CMake the necessary flags to compile and # link a dummy C file. diff --git a/cmake/linker/xt-ld/linker_libraries.cmake b/cmake/linker/xt-ld/linker_libraries.cmake index 64c185c74b42ca..f4fedfc4f0d46e 100644 --- a/cmake/linker/xt-ld/linker_libraries.cmake +++ b/cmake/linker/xt-ld/linker_libraries.cmake @@ -5,4 +5,5 @@ set_linker_property(NO_CREATE PROPERTY c_library "-lc") set_linker_property(NO_CREATE PROPERTY rt_library "-lgcc") set_linker_property(NO_CREATE PROPERTY c++_library "-lstdc++") -set_linker_property(PROPERTY link_order_library "c;rt") +set_linker_property(NO_CREATE PROPERTY hal_library "-lhal") +set_linker_property(PROPERTY link_order_library "c;rt;hal") diff --git a/cmake/linker/xt-ld/target.cmake b/cmake/linker/xt-ld/target.cmake index 3546881cc718e7..9a6b76cda621e2 100644 --- a/cmake/linker/xt-ld/target.cmake +++ b/cmake/linker/xt-ld/target.cmake @@ -130,7 +130,6 @@ function(toolchain_ld_link_elf) ${NO_WHOLE_ARCHIVE_LIBS} $ -L${PROJECT_BINARY_DIR} - ${TOOLCHAIN_LIBS} ${TOOLCHAIN_LD_LINK_ELF_DEPENDENCIES} )