Skip to content

CMake: fix memory map generation #13985

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,18 @@ 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
INTERFACE
"--scatter=${mbed_target_linker_script}"
"--predefine=${_linker_preprocess_definitions}"
"--map"
)
endif()
add_custom_command(
Expand Down
4 changes: 0 additions & 4 deletions tools/cmake/toolchains/ARM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ function(mbed_set_toolchain_options target)
$<$<COMPILE_LANGUAGE:ASM>:--target=arm-arm-none-eabi -masm=auto>
)

list(APPEND link_options
"--map"
)

# Add linking time preprocessor macro for TFM targets
if(MBED_CPU_CORE MATCHES "\-NS$")
list(APPEND link_options
Expand Down
2 changes: 0 additions & 2 deletions tools/cmake/toolchains/GCC_ARM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down