Skip to content

Commit

Permalink
cmake: deprecate toolchain_ld_<base|baremetal|cpp> macros
Browse files Browse the repository at this point in the history
Remove the toolchain_ld_<base|baremetal|cpp> macro as all the macro
handling is now done through the use of linker properties.

Keep support for calling the old macros for out of tree toolchains
which have not been updated to the new property approach.

Signed-off-by: Torsten Rasmussen <[email protected]>
  • Loading branch information
tejlmand committed Sep 2, 2024
1 parent 6b36e3c commit 460508d
Show file tree
Hide file tree
Showing 12 changed files with 3 additions and 64 deletions.
9 changes: 3 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,7 @@ zephyr_compile_options(
$<$<COMPILE_LANGUAGE:ASM>:-D_ASMLANGUAGE>
)

# @Intent: Set fundamental linker specific flags
toolchain_ld_base()
find_package(Deprecated COMPONENTS toolchain_ld_base)

if(DEFINED TOOLCHAIN_LD_FLAGS)
zephyr_ld_options(${TOOLCHAIN_LD_FLAGS})
Expand All @@ -383,8 +382,7 @@ toolchain_ld_force_undefined_symbols(
)

if(NOT CONFIG_NATIVE_BUILD)
# @Intent: Set linker specific flags for bare metal target
toolchain_ld_baremetal()
find_package(Deprecated COMPONENTS toolchain_ld_baremetal)

zephyr_link_libraries(PROPERTY baremetal)

Expand All @@ -411,8 +409,7 @@ endif()

if(CONFIG_CPP)
if(NOT CONFIG_MINIMAL_LIBCPP AND NOT CONFIG_NATIVE_LIBRARY)
# @Intent: Set linker specific flags for C++
toolchain_ld_cpp()
find_package(Deprecated COMPONENTS toolchain_ld_cpp)
endif()

zephyr_link_libraries(PROPERTY cpp_base)
Expand Down
7 changes: 0 additions & 7 deletions cmake/linker/armlink/target.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,12 @@ find_program(CMAKE_LINKER ${CROSS_COMPILE}armlink PATHS ${TOOLCHAIN_HOME} NO_DEF

add_custom_target(armlink)

macro(toolchain_ld_base)
endmacro()

function(toolchain_ld_force_undefined_symbols)
foreach(symbol ${ARGN})
zephyr_link_libraries(--undefined=${symbol})
endforeach()
endfunction()

macro(toolchain_ld_baremetal)
endmacro()

macro(configure_linker_script linker_script_gen linker_pass_define)
set(STEERING_FILE)
set(STEERING_C)
Expand Down Expand Up @@ -114,6 +108,5 @@ function(toolchain_ld_link_elf)
)
endfunction(toolchain_ld_link_elf)

include(${ZEPHYR_BASE}/cmake/linker/ld/target_cpp.cmake)
include(${ZEPHYR_BASE}/cmake/linker/ld/target_relocation.cmake)
include(${ZEPHYR_BASE}/cmake/linker/ld/target_configure.cmake)
3 changes: 0 additions & 3 deletions cmake/linker/ld/target.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,5 @@ function(toolchain_ld_link_elf)
endfunction(toolchain_ld_link_elf)

# Load toolchain_ld-family macros
include(${ZEPHYR_BASE}/cmake/linker/${LINKER}/target_base.cmake)
include(${ZEPHYR_BASE}/cmake/linker/${LINKER}/target_baremetal.cmake)
include(${ZEPHYR_BASE}/cmake/linker/${LINKER}/target_cpp.cmake)
include(${ZEPHYR_BASE}/cmake/linker/${LINKER}/target_relocation.cmake)
include(${ZEPHYR_BASE}/cmake/linker/${LINKER}/target_configure.cmake)
6 changes: 0 additions & 6 deletions cmake/linker/ld/target_baremetal.cmake

This file was deleted.

6 changes: 0 additions & 6 deletions cmake/linker/ld/target_base.cmake

This file was deleted.

6 changes: 0 additions & 6 deletions cmake/linker/ld/target_cpp.cmake

This file was deleted.

3 changes: 0 additions & 3 deletions cmake/linker/lld/target.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,5 @@ endfunction(toolchain_ld_link_elf)


# Load toolchain_ld-family macros
include(${ZEPHYR_BASE}/cmake/linker/${LINKER}/target_base.cmake)
include(${ZEPHYR_BASE}/cmake/linker/${LINKER}/target_baremetal.cmake)
include(${ZEPHYR_BASE}/cmake/linker/${LINKER}/target_cpp.cmake)
include(${ZEPHYR_BASE}/cmake/linker/ld/target_relocation.cmake)
include(${ZEPHYR_BASE}/cmake/linker/ld/target_configure.cmake)
6 changes: 0 additions & 6 deletions cmake/linker/lld/target_baremetal.cmake

This file was deleted.

6 changes: 0 additions & 6 deletions cmake/linker/lld/target_base.cmake

This file was deleted.

6 changes: 0 additions & 6 deletions cmake/linker/lld/target_cpp.cmake

This file was deleted.

3 changes: 0 additions & 3 deletions cmake/linker/xt-ld/target.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,5 @@ endfunction(toolchain_ld_link_elf)

# xt-ld is Xtensa's own version of binutils' ld.
# So we can reuse most of the ld configurations.
include(${ZEPHYR_BASE}/cmake/linker/${LINKER}/target_base.cmake)
include(${ZEPHYR_BASE}/cmake/linker/ld/target_baremetal.cmake)
include(${ZEPHYR_BASE}/cmake/linker/ld/target_cpp.cmake)
include(${ZEPHYR_BASE}/cmake/linker/ld/target_relocation.cmake)
include(${ZEPHYR_BASE}/cmake/linker/ld/target_configure.cmake)
6 changes: 0 additions & 6 deletions cmake/linker/xt-ld/target_base.cmake

This file was deleted.

0 comments on commit 460508d

Please sign in to comment.