Skip to content
Permalink
Browse files

cmake: Toolchain abstraction: move LINKERFLAGPREFIX under GNU ld

* LINKERFLAGPREFIX's value is GNU ld specific, and
* LINKERFLAGPREFIX is not a convention always honored by all linkers.

Thus we shall not set it from the common root CMakeList.txt.
So we move to linker/ld/target.cmake.

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 02122bc commit 4080818300f3b1c1cdad561e1ccc794ba3036340
Showing with 2 additions and 2 deletions.
  1. +0 −2 CMakeLists.txt
  2. +2 −0 cmake/linker/ld/target.cmake
@@ -379,8 +379,6 @@ if(CONFIG_USERSPACE)
endif()
endif()

set_ifndef(LINKERFLAGPREFIX -Wl)

if(NOT CONFIG_NATIVE_APPLICATION)
zephyr_ld_options(
${LINKERFLAGPREFIX},-X
@@ -2,5 +2,7 @@

find_program(CMAKE_LINKER ${CROSS_COMPILE}ld PATH ${TOOLCHAIN_HOME} NO_DEFAULT_PATH)

set_ifndef(LINKERFLAGPREFIX -Wl)

# Load toolchain_ld-family macros
include(${ZEPHYR_BASE}/cmake/linker/${LINKER}/target_base.cmake)

0 comments on commit 4080818

Please sign in to comment.
You can’t perform that action at this time.