Skip to content
Permalink
Browse files

cmake: Rename kernel_elf to zephyr_final

 * KERNEL_ELF was easily confused with KERNEL_ELF_NAME and KERNEL_NAME.
 * kernel_elf as the name of the binary indicates it somehow only
   contains the kernel, which is not correct.

Rename to zephyr_final as this is the reality: Zephyr elf has been
linked again (a number of times) due to generated kernel files.

Signed-off-by: Mark Ruvald Pedersen <mped@oticon.com>
  • Loading branch information...
mped-oticon authored and nashif committed May 7, 2019
1 parent 774d5e8 commit 37d494778e40d36316341eed20dad8bcc170d5da
Showing with 8 additions and 7 deletions.
  1. +8 −7 CMakeLists.txt
@@ -31,6 +31,7 @@ assert(toolchain_is_ok "The toolchain is unable to build a dummy C file. See CMa

set(CMAKE_EXECUTABLE_SUFFIX .elf)
set(ZEPHYR_PREBUILT_EXECUTABLE zephyr_prebuilt)
set(ZEPHYR_FINAL_EXECUTABLE zephyr_final)

# Set some phony targets to collect dependencies
set(OFFSETS_H_TARGET offsets_h)
@@ -1169,9 +1170,6 @@ if(NOT generated_kernel_files)
# generation stage.
set(logical_target_for_zephyr_elf ${ZEPHYR_PREBUILT_EXECUTABLE})
else()
set(KERNEL_ELF kernel_elf)
set(logical_target_for_zephyr_elf ${KERNEL_ELF})

# The second linker pass uses the same source linker script of the
# first pass (LINKER_SCRIPT), but this time with a different output
# file and preprocessed with the define LINKER_PASS2.
@@ -1196,10 +1194,13 @@ else()
${ZEPHYR_INCLUDE_DIRS}
)

add_executable( ${KERNEL_ELF} misc/empty_file.c ${GKSF})
target_link_libraries(${KERNEL_ELF} ${GKOF} ${TOPT} ${PROJECT_BINARY_DIR}/linker_pass_final.cmd ${zephyr_lnk} ${CODE_RELOCATION_DEP})
set_property(TARGET ${KERNEL_ELF} PROPERTY LINK_DEPENDS ${PROJECT_BINARY_DIR}/linker_pass_final.cmd)
add_dependencies( ${KERNEL_ELF} ${PRIV_STACK_DEP} ${LINKER_PASS_FINAL_SCRIPT_TARGET})
add_executable( ${ZEPHYR_FINAL_EXECUTABLE} misc/empty_file.c ${GKSF})
target_link_libraries(${ZEPHYR_FINAL_EXECUTABLE} ${GKOF} ${TOPT} ${PROJECT_BINARY_DIR}/linker_pass_final.cmd ${zephyr_lnk} ${CODE_RELOCATION_DEP})
set_property(TARGET ${ZEPHYR_FINAL_EXECUTABLE} PROPERTY LINK_DEPENDS ${PROJECT_BINARY_DIR}/linker_pass_final.cmd)
add_dependencies( ${ZEPHYR_FINAL_EXECUTABLE} ${PRIV_STACK_DEP} ${LINKER_PASS_FINAL_SCRIPT_TARGET})

# Use the pass2 elf as the final elf
set(logical_target_for_zephyr_elf ${ZEPHYR_FINAL_EXECUTABLE})
endif()

# Export the variable to the application's scope to allow the

0 comments on commit 37d4947

Please sign in to comment.
You can’t perform that action at this time.