Repository navigation
Conversation
Merge .cold and .cold.literal sections in scripts/llext_merge_sections.ld
so cold functions emitted by Zephyr __cold attributes or Clang/LLVM
profile-guided section placement do not remain as orphan unmerged sections
in relocatable LLEXT ELFs.
Also forward --target=${CMAKE_C_COMPILER_TARGET} and --ld-path= (when
configured in CMAKE_EXE_LINKER_FLAGS) in sof_llext_build() so Clang-based
Xtensa LLEXT links use the configured target triple and lld linker rather
than falling back to the host linker.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
lgirdwood
marked this pull request as ready for review
December 2, 2026 21:56
lgirdwood
requested review from
abonislawski,
dbaluta,
iuliana-prodan,
kv2019i,
lbetlej,
lyakh,
mmaka1 and
plbossart
as code owners
December 2, 2026 21:56
Contributor
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
2 open issues
What changed in this PR
This PR improves relocatable LLEXT linking by consolidating Clang-generated “cold” sections in the linker script and ensuring Clang-based Xtensa LLEXT links honor the configured target triple and linker path.
Changes:
- Add forwarding of
--target=${CMAKE_C_COMPILER_TARGET}and--ld-path=...intosof_llext_build()linker parameters. - Merge
.coldand.cold.literalinput sections into a single output section inllext_merge_sections.ld.
| File | Description |
|---|---|
| zephyr/CMakeLists.txt | Propagates Clang target/linker selection into LLEXT link invocation. |
| scripts/llext_merge_sections.ld | Adds an output .cold section to merge .cold* and .cold.literal* inputs. |
Review effort: Lite
Comment on lines
+108
to
+110
| if(CMAKE_EXE_LINKER_FLAGS MATCHES "--ld-path=([^ ]+)") | ||
| list(APPEND EXTRA_LINKER_PARAMS --ld-path=${CMAKE_MATCH_1}) | ||
| endif() |
Comment on lines
+106
to
+111
| if(CMAKE_C_COMPILER_TARGET) | ||
| list(PREPEND EXTRA_LINKER_PARAMS --target=${CMAKE_C_COMPILER_TARGET}) | ||
| if(CMAKE_EXE_LINKER_FLAGS MATCHES "--ld-path=([^ ]+)") | ||
| list(APPEND EXTRA_LINKER_PARAMS --ld-path=${CMAKE_MATCH_1}) | ||
| endif() | ||
| endif() |
Copilot stopped reviewing on behalf of
lgirdwood due to an error
December 2, 2026 22:27
PR 11600: test resultsRun date: 2026-12-02 23:13 UTC Tested commit: 92897566619330a07342b1bc00e4219d876b2d65 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
.coldand.cold.literalsections inscripts/llext_merge_sections.ldso cold functions placed by__coldattributes or Clang/LLVM optimization do not remain unmerged in relocatable LLEXT ELFs.--target=${CMAKE_C_COMPILER_TARGET}and--ld-path=(when present inCMAKE_EXE_LINKER_FLAGS) insidesof_llext_build()inzephyr/CMakeLists.txtso Clang-based Xtensa LLEXT links invoke the configured target triple and linker rather than falling back to the host linker.Testing
intel_adsp/ace15_mtpmwith relocatable LLEXTs (llext_relocatable.conf+webrtc_overlay.conf).sof-llvmv0.7) relocatable LLEXT firmware on Intel ARL-S (Dragon Fly) and PTL (Aphid).