Skip to content

tools/export: prefix each linker script in toolchain.cmake - #20022

Open
r3wretrhy wants to merge 1 commit into
apache:masterfrom
r3wretrhy:tools-export-prefix-ldscripts
Open

tools/export: prefix each linker script in toolchain.cmake#20022
r3wretrhy wants to merge 1 commit into
apache:masterfrom
r3wretrhy:tools-export-prefix-ldscripts

Conversation

@r3wretrhy

Copy link
Copy Markdown

tools/export: prefix each linker script in toolchain.cmake.

Summary

Impact

  • Is new feature added? Is existing feature changed? NO. Fixes exported CMake toolchain files for boards with more than one linker script.
  • Impact on user (will user need to adapt to change)? NO
  • Impact on build (will build process change)? YES. Out-of-tree CMake apps that consume make export now receive a -T path for every LDNAME script.
  • Impact on hardware (will arch(s) / board(s) / driver(s) change)? NO
  • Impact on documentation (is update required / provided)? NO
  • Impact on security (any sort of implications)? NO
  • Impact on compatibility (backward/forward/interoperability)? NO. Single-script LDNAME still produces one -T argument.

Testing

I confirm that changes are verified on local setup and works as intended:

Testing logs before change:

OLD_RULE=-T/tmp/nuttx-export-13.0.0/scripts/../scripts/esp32s3_peripherals.ld esp32s3_rom_aliases.ld flat_memory.ld esp32s3_sections.ld

Testing logs after change:

NUTTX_PATH=/tmp/nuttx-export-13.0.0 NEW_RULE=-T/tmp/nuttx-export-13.0.0/scripts/esp32s3_peripherals.ld -T/tmp/nuttx-export-13.0.0/scripts/esp32s3_rom_aliases.ld -T/tmp/nuttx-export-13.0.0/scripts/flat_memory.ld -T/tmp/nuttx-export-13.0.0/scripts/esp32s3_sections.ld EXPORT_LDNAME_OK

PR verification Self-Check

  • This PR introduces only one functional change.
  • I have updated all required description fields above.
  • My PR adheres to Contributing Guidelines and Documentation (git commit title and message, coding standard, etc).
  • My PR is still work in progress (not ready for review).
  • My PR is ready for review and can be safely merged into a codebase.

make export writes several names into LDNAME for boards that use
more than one linker script. The exported toolchain.cmake only
prefixed the first file, so ld searched for the rest in the
application build directory.

Normalize NUTTX_PATH so the generated -T arguments do not keep
the scripts/../scripts form.

Fixes apache#19820.

Signed-off-by: Zhaoqi Xu <lzy00419@outlook.com>
@r3wretrhy
r3wretrhy force-pushed the tools-export-prefix-ldscripts branch from 4355688 to e84a3b7 Compare August 31, 2026 09:22
@github-actions github-actions Bot added Area: Tooling Size: S The size of the change in this PR is small labels Aug 31, 2026
@github-actions

Copy link
Copy Markdown

MemBrowse Memory Report

No memory changes detected for:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Tooling Size: S The size of the change in this PR is small

Projects

None yet

2 participants