pytorch / pytorch/executorch

[CMake] Utils.cmake, function name kernel_link_options() and target_link_options_shared_lib() misleading

Open
#10,492 0 comments 0 reactions 3 assignees View on GitHub

@larryliu0820 is already working on this.

Since Apr 25, 2025.

module: build/install triaged
Dominant language
Python
Stars
5k
Forks
1.2k
Avg merge
2d 10h
Merged PRs (30d)
581

Description

🐛 Describe the bug

Seems that kernel_link_options really means whole-archive (keeping all symbols, don't prune due to no direct usage!) and target_link_options_shared_lib() is a wrapper for kernel_link_options().

Note that this is not accurate. For kernel, we need to whole-archive to prevent from missing symbol. For shared lib, most likely, we need to keep symbols, but not necessarily all of them (can depend on other dylib definition).

My suggestion is change the name a bit, like "link_options_whole".

Also would love to have some tool, to check if there is any duplicated symbol in our .a. And also .so.

Versions

1bd72607081ddc1e0f42eeb14b02b640395a598c

cc @larryliu0820 @jathu

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.