cmake: remove llvm runtime library selection from target_base.cmake

The selection of the runtime library when using LLVM has already been
done in llvm/target.cmake and passed to the toolchain_ld_base() function
through the global TOOLCHAIN_LD_FLAGS setting.

The only reason this haven't been noticed is because of CMake's built-in
symbol de-duplication feature.

Remove the redundant runtime library handling.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
This commit is contained in:
Torsten Rasmussen 2024-09-02 12:16:27 +02:00 committed by Carles Cufí
commit 22c45c9234
2 changed files with 0 additions and 22 deletions

View file

@ -28,18 +28,6 @@ macro(toolchain_ld_base)
)
endif()
if (CONFIG_LLVM_USE_LD)
if(CONFIG_LIBGCC_RTLIB)
set(runtime_lib "libgcc")
elseif(CONFIG_COMPILER_RT_RTLIB)
set(runtime_lib "compiler_rt")
endif()
zephyr_link_libraries(
--config ${ZEPHYR_BASE}/cmake/toolchain/llvm/clang_${runtime_lib}.cfg
)
endif()
if(CONFIG_CPP AND (CMAKE_C_COMPILER_ID STREQUAL "Clang"))
# GNU ld complains when used with llvm/clang:
# error: section: init_array is not contiguous with other relro sections

View file

@ -43,14 +43,4 @@ macro(toolchain_ld_base)
-Wl,-z,norelro
)
endif()
if(CONFIG_LIBGCC_RTLIB)
set(runtime_lib "libgcc")
elseif(CONFIG_COMPILER_RT_RTLIB)
set(runtime_lib "compiler_rt")
endif()
zephyr_link_libraries(
--config ${ZEPHYR_BASE}/cmake/toolchain/llvm/clang_${runtime_lib}.cfg
)
endmacro()