Skip to content
Permalink
Browse files

cmake: Toolchain abstraction: move symbol sorting into toolchain_ld_base

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 Apr 25, 2019
1 parent 173c953 commit b14b59c9e40eb3ed469d0a3fcca70e88ac528366
Showing with 8 additions and 8 deletions.
  1. +0 −8 CMakeLists.txt
  2. +8 −0 cmake/linker/ld/target_base.cmake
@@ -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
@@ -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.
You can’t perform that action at this time.