cmake: new global property for generated files
Introduce a new global property for source files that are generated from the initial Zephyr link (app_smem_unaligned_prebuilt). This source list is used for files which will introduce address shifts into the final binary, which need to be present in `zephyr_prebuilt.elf` for `CONFIG_USERSPACE` scripts to correctly generate `zephyr.elf`. This resolves #38836. Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
This commit is contained in:
parent
c03e658369
commit
8d93217af4
2 changed files with 11 additions and 2 deletions
|
@ -955,6 +955,7 @@ if(CONFIG_USERSPACE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Read global variables into local variables
|
# Read global variables into local variables
|
||||||
|
get_property(GASF GLOBAL PROPERTY GENERATED_APP_SOURCE_FILES)
|
||||||
get_property(GKOF GLOBAL PROPERTY GENERATED_KERNEL_OBJECT_FILES)
|
get_property(GKOF GLOBAL PROPERTY GENERATED_KERNEL_OBJECT_FILES)
|
||||||
get_property(GKSF GLOBAL PROPERTY GENERATED_KERNEL_SOURCE_FILES)
|
get_property(GKSF GLOBAL PROPERTY GENERATED_KERNEL_SOURCE_FILES)
|
||||||
|
|
||||||
|
@ -1226,7 +1227,7 @@ set_property(TARGET
|
||||||
)
|
)
|
||||||
|
|
||||||
# FIXME: Is there any way to get rid of empty_file.c?
|
# FIXME: Is there any way to get rid of empty_file.c?
|
||||||
add_executable( ${ZEPHYR_PREBUILT_EXECUTABLE} misc/empty_file.c)
|
add_executable( ${ZEPHYR_PREBUILT_EXECUTABLE} misc/empty_file.c ${GASF})
|
||||||
toolchain_ld_link_elf(
|
toolchain_ld_link_elf(
|
||||||
TARGET_ELF ${ZEPHYR_PREBUILT_EXECUTABLE}
|
TARGET_ELF ${ZEPHYR_PREBUILT_EXECUTABLE}
|
||||||
OUTPUT_MAP ${PROJECT_BINARY_DIR}/${ZEPHYR_PREBUILT_EXECUTABLE}.map
|
OUTPUT_MAP ${PROJECT_BINARY_DIR}/${ZEPHYR_PREBUILT_EXECUTABLE}.map
|
||||||
|
@ -1275,7 +1276,7 @@ else()
|
||||||
${ZEPHYR_INCLUDE_DIRS}
|
${ZEPHYR_INCLUDE_DIRS}
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable( ${ZEPHYR_FINAL_EXECUTABLE} misc/empty_file.c ${GKSF})
|
add_executable( ${ZEPHYR_FINAL_EXECUTABLE} misc/empty_file.c ${GASF} ${GKSF})
|
||||||
toolchain_ld_link_elf(
|
toolchain_ld_link_elf(
|
||||||
TARGET_ELF ${ZEPHYR_FINAL_EXECUTABLE}
|
TARGET_ELF ${ZEPHYR_FINAL_EXECUTABLE}
|
||||||
OUTPUT_MAP ${PROJECT_BINARY_DIR}/${ZEPHYR_FINAL_EXECUTABLE}.map
|
OUTPUT_MAP ${PROJECT_BINARY_DIR}/${ZEPHYR_FINAL_EXECUTABLE}.map
|
||||||
|
|
|
@ -50,6 +50,14 @@ define_property(GLOBAL PROPERTY ZEPHYR_INTERFACE_LIBS
|
||||||
zephyr_interface_library_named() appends libs to this list.")
|
zephyr_interface_library_named() appends libs to this list.")
|
||||||
set_property(GLOBAL PROPERTY ZEPHYR_INTERFACE_LIBS "")
|
set_property(GLOBAL PROPERTY ZEPHYR_INTERFACE_LIBS "")
|
||||||
|
|
||||||
|
define_property(GLOBAL PROPERTY GENERATED_APP_SOURCE_FILES
|
||||||
|
BRIEF_DOCS "Source files that are generated after Zephyr has been linked once."
|
||||||
|
FULL_DOCS "\
|
||||||
|
Source files that are generated after Zephyr has been linked once.\
|
||||||
|
May include dev_handles.c etc."
|
||||||
|
)
|
||||||
|
set_property(GLOBAL PROPERTY GENERATED_APP_SOURCE_FILES "")
|
||||||
|
|
||||||
define_property(GLOBAL PROPERTY GENERATED_KERNEL_OBJECT_FILES
|
define_property(GLOBAL PROPERTY GENERATED_KERNEL_OBJECT_FILES
|
||||||
BRIEF_DOCS "Object files that are generated after symbol addresses are fixed."
|
BRIEF_DOCS "Object files that are generated after symbol addresses are fixed."
|
||||||
FULL_DOCS "\
|
FULL_DOCS "\
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue