Skip to content

Arm backend: Use executorch_target_link_options_shared_lib()#17779

Merged
zingo merged 1 commit intopytorch:mainfrom
zingo:Arm-backend-Use-executorch_target_link_options_shared_lib()
Mar 3, 2026
Merged

Arm backend: Use executorch_target_link_options_shared_lib()#17779
zingo merged 1 commit intopytorch:mainfrom
zingo:Arm-backend-Use-executorch_target_link_options_shared_lib()

Conversation

@zingo
Copy link
Collaborator

@zingo zingo commented Mar 2, 2026

Summary

Use the cmake macro in the project for link options to include the whole archive instead of hardcode it.

Deprecates: executorch_delegate_EthosUBackend_registered() Use cmake rule instead:
executorch_target_link_options_shared_lib(executorch_delegate_ethos_u)

cc @digantdesai @SS-JIA @freddan80 @per @oscarandersson8218 @mansnils @Sebastian-Larsson @robell

Copilot AI review requested due to automatic review settings March 2, 2026 11:59
@pytorch-bot
Copy link

pytorch-bot bot commented Mar 2, 2026

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/17779

Note: Links to docs will display an error until the docs builds have been completed.

❌ 2 New Failures, 1 Pending

As of commit 4d9c704 with merge base dae7a02 (image):

NEW FAILURES - The following jobs have failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 2, 2026
@zingo zingo added partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm release notes: arm Changes to the ARM backend delegate labels Mar 2, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates Arm example build/link logic to use the project-provided CMake whole-archive helper instead of hardcoded linker flags / force-link hooks, and deprecates the legacy Ethos-U “registered” linker hook function.

Changes:

  • Replaces hardcoded --whole-archive/--no-whole-archive usage with executorch_target_link_options_shared_lib(...) in Arm example CMake files.
  • Removes Ethos-U force-link helper code paths (C++ link hook file and runtime “registration check” call sites).
  • Deprecates executorch_delegate_EthosUBackend_registered() and updates top-level executor_runner linking to whole-archive the Ethos-U delegate when enabled.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
examples/arm/zephyr/src/arm_executor_runner.cpp Removes the Ethos-U registration check call path.
examples/arm/zephyr/CMakeLists.txt Includes Utils.cmake and applies whole-archive helper to relevant Arm libraries when targets exist.
examples/arm/image_classification_example/runtime/CMakeLists.txt Switches Ethos-U whole-archive linking to the shared helper.
examples/arm/executor_runner/ethosu_link_helper.cpp Deletes the C++ force-link hook.
examples/arm/executor_runner/CMakeLists.txt Replaces explicit whole-archive flags with helper calls for Arm runner link inputs.
backends/arm/runtime/EthosUBackend.cpp Deprecates the linker-hook function and changes its return behavior.
CMakeLists.txt Updates executor_runner linking: scopes libraries as PRIVATE and whole-archives Ethos-U delegate on ARM Ethos-U Linux builds.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@rascani rascani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just a minor nit.

Use the cmake macro in the project for link options to include the
whole archive instead of hardcode it.

Deprecates: executorch_delegate_EthosUBackend_registered()
Use cmake rule instead:
  executorch_target_link_options_shared_lib(executorch_delegate_ethos_u)

Signed-off-by: Zingo Andersen <Zingo.Andersen@arm.com>
Change-Id: I650201cb97332a806236ea1cfb56494936e76200
@zingo zingo force-pushed the Arm-backend-Use-executorch_target_link_options_shared_lib() branch from 2320453 to 4d9c704 Compare March 3, 2026 09:30
@zingo zingo merged commit 9dc7ab0 into pytorch:main Mar 3, 2026
410 of 415 checks passed
@zingo zingo deleted the Arm-backend-Use-executorch_target_link_options_shared_lib() branch March 4, 2026 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm release notes: arm Changes to the ARM backend delegate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants