-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libc: Don't use --whole-archive for libc common and picolibc hooks
Removing these from the set of libraries linked with --whole-archive means that functionality not explicitly referenced by the application won't be included in the linker output. This is done by splitting ZEPHYR_LIBS_PROPERTY into two lists, ZEPHYR_LIBS_WHOLE and ZEPHYR_LIBS_PARTIAL. Linkers supporting this operation can place only the ZEPHYR_LIBS_WHOLE list under the --whole-archive mode while placing the ZEPHYR_LIBS_PARTIAL list under --start-group with the kernel (ensuring that circular references will be resolved). So that any nested dependency libraries are also included in that group, compute the transitive set of libraries and stick those into the explicit link command. To make sure any OS functions used by the toolchain are included, LIBC_LINK_LIBRARIES is included in this set, which required handling that value inside of the linker code instead of in the general code. A new global variable, LIBC_LINK_LIBRARIES_SKIP, has been added that tells the top level CMakeLists.txt to not call zephyr_link_libraries in this case. Support for arcmwdt, ld, lld and xt-ld linkers is added; other linkers will continue to use ZEPHYR_LIBS_PROPERTY unchanged. Signed-off-by: Keith Packard <[email protected]>
- Loading branch information
1 parent
dc4b9b4
commit 471daef
Showing
8 changed files
with
100 additions
and
10 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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