CMake: GCC ARM linker script fix

Fixes https://github.com/ARMmbed/mbed-os/issues/13983
Move linker script to the function mbed_set_mbed_target_linker_script.

I also moved memmap as it is needed for an app. The location might not be the best fit,
we will address this in separate pull request.
pull/13985/head
Martin Kojtal 2020-11-30 11:21:53 +00:00
parent 33a7e66a07
commit f97c7bd957
2 changed files with 5 additions and 2 deletions

View File

@ -141,6 +141,11 @@ function(mbed_set_mbed_target_linker_script target)
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
BYPRODUCTS "${CMAKE_BINARY_DIR}/${target}.link_script.ld"
)
target_link_options(mbed-core
INTERFACE
"-T" "${CMAKE_BINARY_DIR}/${target}.link_script.ld"
"-Wl,-Map=${CMAKE_BINARY_DIR}/${target}.map"
)
elseif(MBED_TOOLCHAIN STREQUAL "ARM")
set(CMAKE_PRE_BUILD_COMMAND COMMAND "")
target_link_options(mbed-core

View File

@ -19,8 +19,6 @@ function(mbed_set_toolchain_options target)
"-lnosys"
"-Wl,--end-group"
"-specs=nosys.specs"
"-T" "${CMAKE_BINARY_DIR}/${APP_TARGET}.link_script.ld"
"-Wl,-Map=${CMAKE_BINARY_DIR}/${APP_TARGET}.map"
"-Wl,--cref"
)