Skip to content

Commit

Permalink
cmake: Toolchain abstraction: move symbol sorting into toolchain_ld_base
Browse files Browse the repository at this point in the history
No functional change expected.

This is motivated by the wish to abstract Zephyr's usage of toolchains,
permitting non-intrusive porting to other (commercial) toolchains.

Signed-off-by: Mark Ruvald Pedersen <mped@oticon.com>
  • Loading branch information
mped-oticon authored and nashif committed May 2, 2019
1 parent 173c953 commit b14b59c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 0 additions & 8 deletions CMakeLists.txt
Expand Up @@ -376,14 +376,6 @@ if(CONFIG_USERSPACE)
endif()
endif()

# Sort the common symbols and each input section by alignment
# in descending order to minimize padding between these symbols.
zephyr_ld_option_ifdef(
CONFIG_LINKER_SORT_BY_ALIGNMENT
${LINKERFLAGPREFIX},--sort-common=descending
${LINKERFLAGPREFIX},--sort-section=alignment
)

get_property(TOPT GLOBAL PROPERTY TOPT)
set_ifndef( TOPT -Wl,-T) # clang doesn't pick -T for some reason and complains,
# while -Wl,-T works for both, gcc and clang
Expand Down
8 changes: 8 additions & 0 deletions cmake/linker/ld/target_base.cmake
Expand Up @@ -12,4 +12,12 @@ macro(toolchain_ld_base)
${LINKERFLAGPREFIX},--build-id=none
)

# Sort the common symbols and each input section by alignment
# in descending order to minimize padding between these symbols.
zephyr_ld_option_ifdef(
CONFIG_LINKER_SORT_BY_ALIGNMENT
${LINKERFLAGPREFIX},--sort-common=descending
${LINKERFLAGPREFIX},--sort-section=alignment
)

endmacro()

0 comments on commit b14b59c

Please sign in to comment.