mirror of https://github.com/ARMmbed/mbed-os.git
Rebase linker script change properly, re-add external toolchain file support
parent
f07c0cd7e6
commit
0972738e46
|
@ -54,7 +54,6 @@ endif()
|
||||||
|
|
||||||
mbed_set_cpu_core_definitions(mbed-core)
|
mbed_set_cpu_core_definitions(mbed-core)
|
||||||
if(${MBED_TOOLCHAIN_FILE_USED})
|
if(${MBED_TOOLCHAIN_FILE_USED})
|
||||||
mbed_set_toolchain_options(mbed-core)
|
|
||||||
mbed_set_profile_options(mbed-core ${MBED_TOOLCHAIN})
|
mbed_set_profile_options(mbed-core ${MBED_TOOLCHAIN})
|
||||||
mbed_set_c_lib(mbed-core ${MBED_C_LIB})
|
mbed_set_c_lib(mbed-core ${MBED_C_LIB})
|
||||||
mbed_set_printf_lib(mbed-core ${MBED_PRINTF_LIB})
|
mbed_set_printf_lib(mbed-core ${MBED_PRINTF_LIB})
|
||||||
|
@ -134,7 +133,7 @@ function(mbed_set_mbed_target_linker_script target)
|
||||||
if(MBED_TOOLCHAIN STREQUAL "GCC_ARM")
|
if(MBED_TOOLCHAIN STREQUAL "GCC_ARM")
|
||||||
set(CMAKE_PRE_BUILD_COMMAND
|
set(CMAKE_PRE_BUILD_COMMAND
|
||||||
COMMAND "arm-none-eabi-cpp" ${_linker_preprocess_definitions} -x assembler-with-cpp -E -Wp,-P
|
COMMAND "arm-none-eabi-cpp" ${_linker_preprocess_definitions} -x assembler-with-cpp -E -Wp,-P
|
||||||
${mbed_target_linker_script} -o ${CMAKE_BINARY_DIR}/${APP_NAME}.link_script.ld
|
${mbed_target_linker_script} -o ${CMAKE_BINARY_DIR}/${target}.link_script.ld
|
||||||
|
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
BYPRODUCTS "${CMAKE_BINARY_DIR}/${target}.link_script.ld"
|
BYPRODUCTS "${CMAKE_BINARY_DIR}/${target}.link_script.ld"
|
||||||
|
|
|
@ -10,8 +10,10 @@ endif()
|
||||||
include(${MBED_CONFIG_PATH}/mbed_config.cmake)
|
include(${MBED_CONFIG_PATH}/mbed_config.cmake)
|
||||||
|
|
||||||
# Load toolchain file
|
# Load toolchain file
|
||||||
set(MBED_TOOLCHAIN_FILE_USED TRUE CACHE INTERNAL "")
|
if(NOT CMAKE_TOOLCHAIN_FILE OR MBED_TOOLCHAIN_FILE_USED)
|
||||||
include(${MBED_PATH}/tools/cmake/toolchain.cmake)
|
set(MBED_TOOLCHAIN_FILE_USED TRUE CACHE INTERNAL "")
|
||||||
|
include(${MBED_PATH}/tools/cmake/toolchain.cmake)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Specify available build profiles and add options for the selected build profile
|
# Specify available build profiles and add options for the selected build profile
|
||||||
include(${MBED_PATH}/tools/cmake/profile.cmake)
|
include(${MBED_PATH}/tools/cmake/profile.cmake)
|
||||||
|
|
|
@ -37,13 +37,11 @@ list(APPEND link_options
|
||||||
|
|
||||||
# Add linking time preprocessor macro for TFM targets
|
# Add linking time preprocessor macro for TFM targets
|
||||||
if(MBED_CPU_CORE MATCHES "-NS$")
|
if(MBED_CPU_CORE MATCHES "-NS$")
|
||||||
)
|
list(APPEND link_options
|
||||||
|
"--predefine=\"-DDOMAIN_NS=0x1\""
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
function(mbed_set_toolchain_options target)
|
|
||||||
# blank for ARMClang
|
|
||||||
endfunction()
|
|
||||||
|
|
||||||
# Configure the toolchain to select the selected C library
|
# Configure the toolchain to select the selected C library
|
||||||
function(mbed_set_c_lib target lib_type)
|
function(mbed_set_c_lib target lib_type)
|
||||||
if (${lib_type} STREQUAL "small")
|
if (${lib_type} STREQUAL "small")
|
||||||
|
|
|
@ -7,11 +7,6 @@ set(CMAKE_CXX_COMPILER "arm-none-eabi-g++")
|
||||||
set(GCC_ELF2BIN "arm-none-eabi-objcopy")
|
set(GCC_ELF2BIN "arm-none-eabi-objcopy")
|
||||||
set_property(GLOBAL PROPERTY ELF2BIN ${GCC_ELF2BIN})
|
set_property(GLOBAL PROPERTY ELF2BIN ${GCC_ELF2BIN})
|
||||||
|
|
||||||
# Sets toolchain options for a target
|
|
||||||
function(mbed_set_toolchain_options target)
|
|
||||||
|
|
||||||
endfunction(mbed_set_toolchain_options)
|
|
||||||
|
|
||||||
# build toolchain flags that get passed to everything (including CMake compiler checks)
|
# build toolchain flags that get passed to everything (including CMake compiler checks)
|
||||||
list(APPEND link_options
|
list(APPEND link_options
|
||||||
"-Wl,--start-group"
|
"-Wl,--start-group"
|
||||||
|
|
Loading…
Reference in New Issue