Skip to content

Commit f97c7bd

Browse files
committed
CMake: GCC ARM linker script fix
Fixes ARMmbed#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.
1 parent 33a7e66 commit f97c7bd

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,11 @@ function(mbed_set_mbed_target_linker_script target)
141141
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
142142
BYPRODUCTS "${CMAKE_BINARY_DIR}/${target}.link_script.ld"
143143
)
144+
target_link_options(mbed-core
145+
INTERFACE
146+
"-T" "${CMAKE_BINARY_DIR}/${target}.link_script.ld"
147+
"-Wl,-Map=${CMAKE_BINARY_DIR}/${target}.map"
148+
)
144149
elseif(MBED_TOOLCHAIN STREQUAL "ARM")
145150
set(CMAKE_PRE_BUILD_COMMAND COMMAND "")
146151
target_link_options(mbed-core

tools/cmake/toolchains/GCC_ARM.cmake

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ function(mbed_set_toolchain_options target)
1919
"-lnosys"
2020
"-Wl,--end-group"
2121
"-specs=nosys.specs"
22-
"-T" "${CMAKE_BINARY_DIR}/${APP_TARGET}.link_script.ld"
23-
"-Wl,-Map=${CMAKE_BINARY_DIR}/${APP_TARGET}.map"
2422
"-Wl,--cref"
2523
)
2624

0 commit comments

Comments
 (0)