fix(ulp): restore legacy LP-core child link behavior

Preserve all linker scripts passed to target_linker_script() so LP-core child builds keep the full esp32p4 LP ROM script set instead of only the first script.

Link the ULP runtime component as WHOLE_ARCHIVE for ULP child builds, matching the legacy helper behavior where runtime sources were added directly to the executable. This keeps strong runtime handlers such as ulp_lp_core_panic_handler from being skipped in favor of weak defaults from already-extracted archive objects.

Validated with the esp32p4 lp_core_hp_uart panic and LP-ROM pytest cases, plus the focused local/CI build_all shape for the app.
This commit is contained in:
Renz Bagaporo
2026-07-29 13:08:23 +09:00
parent e331c8e310
commit c925f6bcc6
2 changed files with 16 additions and 2 deletions
+5 -1
View File
@@ -193,7 +193,7 @@ endfunction()
with the ``PROCESS`` option, it is logical to provide only a single
``scriptfile`` as a template.
#]]
function(target_linker_script target deptype scriptfiles)
function(target_linker_script target deptype)
# The linker script files, templates, and their output filenames are stored
# only as component properties. The script files are generated and added to
# the library link interface in the idf_build_library function.
@@ -201,6 +201,10 @@ function(target_linker_script target deptype scriptfiles)
set(one_value PROCESS FLAGS)
set(multi_value)
cmake_parse_arguments(ARG "${options}" "${one_value}" "${multi_value}" ${ARGN})
set(scriptfiles ${ARG_UNPARSED_ARGUMENTS})
if(NOT scriptfiles)
message(FATAL_ERROR "target_linker_script requires at least one linker script file")
endif()
foreach(scriptfile ${scriptfiles})
get_filename_component(scriptfile "${scriptfile}" ABSOLUTE)
idf_msg("Adding linker script ${scriptfile}")