Browse Source

cmake: deprecate toolchain_ld_<base|baremetal|cpp> macros

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 <Torsten.Rasmussen@nordicsemi.no>
pull/78022/head
Torsten Rasmussen 10 months ago committed by Carles Cufí
parent
commit
5db1f1ae8f
  1. 9
      CMakeLists.txt
  2. 7
      cmake/linker/armlink/target.cmake
  3. 3
      cmake/linker/ld/target.cmake
  4. 6
      cmake/linker/ld/target_baremetal.cmake
  5. 6
      cmake/linker/ld/target_base.cmake
  6. 6
      cmake/linker/ld/target_cpp.cmake
  7. 3
      cmake/linker/lld/target.cmake
  8. 6
      cmake/linker/lld/target_baremetal.cmake
  9. 6
      cmake/linker/lld/target_base.cmake
  10. 6
      cmake/linker/lld/target_cpp.cmake
  11. 3
      cmake/linker/xt-ld/target.cmake
  12. 6
      cmake/linker/xt-ld/target_base.cmake

9
CMakeLists.txt

@ -360,8 +360,7 @@ zephyr_compile_options( @@ -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})
@ -383,8 +382,7 @@ toolchain_ld_force_undefined_symbols( @@ -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)
@ -411,8 +409,7 @@ endif() @@ -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)

7
cmake/linker/armlink/target.cmake

@ -6,18 +6,12 @@ find_program(CMAKE_LINKER ${CROSS_COMPILE}armlink PATHS ${TOOLCHAIN_HOME} NO_DEF @@ -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)
@ -114,6 +108,5 @@ function(toolchain_ld_link_elf) @@ -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
cmake/linker/ld/target.cmake

@ -146,8 +146,5 @@ function(toolchain_ld_link_elf) @@ -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
cmake/linker/ld/target_baremetal.cmake

@ -1,6 +0,0 @@ @@ -1,6 +0,0 @@
# SPDX-License-Identifier: Apache-2.0
# See root CMakeLists.txt for description and expectations of these macros
macro(toolchain_ld_baremetal)
endmacro()

6
cmake/linker/ld/target_base.cmake

@ -1,6 +0,0 @@ @@ -1,6 +0,0 @@
# SPDX-License-Identifier: Apache-2.0
# See root CMakeLists.txt for description and expectations of these macros
macro(toolchain_ld_base)
endmacro()

6
cmake/linker/ld/target_cpp.cmake

@ -1,6 +0,0 @@ @@ -1,6 +0,0 @@
# SPDX-License-Identifier: Apache-2.0
# See root CMakeLists.txt for description and expectations of these macros
macro(toolchain_ld_cpp)
endmacro()

3
cmake/linker/lld/target.cmake

@ -107,8 +107,5 @@ endfunction(toolchain_ld_link_elf) @@ -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
cmake/linker/lld/target_baremetal.cmake

@ -1,6 +0,0 @@ @@ -1,6 +0,0 @@
# SPDX-License-Identifier: Apache-2.0
# See root CMakeLists.txt for description and expectations of these macros
macro(toolchain_ld_baremetal)
endmacro()

6
cmake/linker/lld/target_base.cmake

@ -1,6 +0,0 @@ @@ -1,6 +0,0 @@
# SPDX-License-Identifier: Apache-2.0
# See root CMakeLists.txt for description and expectations of these macros
macro(toolchain_ld_base)
endmacro()

6
cmake/linker/lld/target_cpp.cmake

@ -1,6 +0,0 @@ @@ -1,6 +0,0 @@
# SPDX-License-Identifier: Apache-2.0
# See root CMakeLists.txt for description and expectations of these macros
macro(toolchain_ld_cpp)
endmacro()

3
cmake/linker/xt-ld/target.cmake

@ -139,8 +139,5 @@ endfunction(toolchain_ld_link_elf) @@ -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
cmake/linker/xt-ld/target_base.cmake

@ -1,6 +0,0 @@ @@ -1,6 +0,0 @@
# SPDX-License-Identifier: Apache-2.0
# See root CMakeLists.txt for description and expectations of these macros
macro(toolchain_ld_base)
endmacro()
Loading…
Cancel
Save