Commit 197197a5 authored by Mark Ruvald Pedersen's avatar Mark Ruvald Pedersen Committed by Anas Nashif
Browse files

cmake: Toolchain abstraction: Introduce toolchain_ld_configure_files



No functional change expected.

This is motivated by the wish to abstract Zephyr's usage of toolchains,
permitting non-intrusive porting to other (commercial) toolchains.

Signed-off-by: default avatarMark Ruvald Pedersen <mped@oticon.com>
parent f483e5b5
Loading
Loading
Loading
Loading
+2 −15
Original line number Diff line number Diff line
@@ -1029,21 +1029,8 @@ zephyr_compile_options(
  $<$<COMPILE_LANGUAGE:C>:-std=${CSTD}>
)

configure_file(
     $ENV{ZEPHYR_BASE}/include/arch/common/app_data_alignment.ld
     ${PROJECT_BINARY_DIR}/include/generated/app_data_alignment.ld)

configure_file(
     $ENV{ZEPHYR_BASE}/include/linker/app_smem.ld
     ${PROJECT_BINARY_DIR}/include/generated/app_smem.ld)

configure_file(
     $ENV{ZEPHYR_BASE}/include/linker/app_smem_aligned.ld
     ${PROJECT_BINARY_DIR}/include/generated/app_smem_aligned.ld)

configure_file(
     $ENV{ZEPHYR_BASE}/include/linker/app_smem_unaligned.ld
     ${PROJECT_BINARY_DIR}/include/generated/app_smem_unaligned.ld)
# @Intent: Configure linker scripts, i.e. generate linker scripts with variables substituted
toolchain_ld_configure_files()

if(CONFIG_USERSPACE)
  set(APP_SMEM_ALIGNED_LD "${PROJECT_BINARY_DIR}/include/generated/app_smem_aligned.ld")
+1 −0
Original line number Diff line number Diff line
@@ -58,3 +58,4 @@ 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)
+21 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: Apache-2.0

# See root CMakeLists.txt for description and expectations of these macros

macro(toolchain_ld_configure_files)
  configure_file(
       $ENV{ZEPHYR_BASE}/include/arch/common/app_data_alignment.ld
       ${PROJECT_BINARY_DIR}/include/generated/app_data_alignment.ld)

  configure_file(
       $ENV{ZEPHYR_BASE}/include/linker/app_smem.ld
       ${PROJECT_BINARY_DIR}/include/generated/app_smem.ld)

  configure_file(
       $ENV{ZEPHYR_BASE}/include/linker/app_smem_aligned.ld
       ${PROJECT_BINARY_DIR}/include/generated/app_smem_aligned.ld)

  configure_file(
       $ENV{ZEPHYR_BASE}/include/linker/app_smem_unaligned.ld
       ${PROJECT_BINARY_DIR}/include/generated/app_smem_unaligned.ld)
endmacro()