b64cfe9832
As of today MWDT toolchain in case of Zephyr may use few tools from GNU toolchain - GNU compiler for DTS preprocessing and objcopy for section renaming. Currently we were trying to find any GNU compiler & objcopy which start to cause compatibility issues for new targets - i.e. not every objcopy knows new ARC targets. Let's use ARC GNU tools from Zephyr SDK as we still usually require it when building with MWDT for other tools like DTC (device tree compiler) Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com> Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
29 lines
1.7 KiB
CMake
29 lines
1.7 KiB
CMake
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
# Configures binary tools as mwdt binutils
|
|
|
|
find_program(CMAKE_ELF2BIN ${CROSS_COMPILE}elf2bin PATHS ${TOOLCHAIN_HOME} NO_DEFAULT_PATH)
|
|
find_program(CMAKE_OBJDUMP ${CROSS_COMPILE}elfdumpac PATHS ${TOOLCHAIN_HOME} NO_DEFAULT_PATH)
|
|
find_program(CMAKE_AS ${CROSS_COMPILE}ccac PATHS ${TOOLCHAIN_HOME} NO_DEFAULT_PATH)
|
|
find_program(CMAKE_AR ${CROSS_COMPILE}arac PATHS ${TOOLCHAIN_HOME} NO_DEFAULT_PATH)
|
|
find_program(CMAKE_RANLIB ${CROSS_COMPILE}arac PATHS ${TOOLCHAIN_HOME} NO_DEFAULT_PATH)
|
|
find_program(CMAKE_READELF ${CROSS_COMPILE}elfdumpac PATHS ${TOOLCHAIN_HOME} NO_DEFAULT_PATH)
|
|
find_program(CMAKE_NM ${CROSS_COMPILE}nmac PATHS ${TOOLCHAIN_HOME} NO_DEFAULT_PATH)
|
|
find_program(CMAKE_STRIP ${CROSS_COMPILE}stripac PATHS ${TOOLCHAIN_HOME} NO_DEFAULT_PATH)
|
|
find_program(CMAKE_SIZE ${CROSS_COMPILE}sizeac PATHS ${TOOLCHAIN_HOME} NO_DEFAULT_PATH)
|
|
find_program(CMAKE_ELF2HEX ${CROSS_COMPILE}elf2hex PATHS ${TOOLCHAIN_HOME} NO_DEFAULT_PATH)
|
|
|
|
SET(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> -rq <TARGET> <LINK_FLAGS> <OBJECTS>")
|
|
SET(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> -rq <TARGET> <LINK_FLAGS> <OBJECTS>")
|
|
SET(CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_AR> -sq <TARGET>")
|
|
SET(CMAKE_C_ARCHIVE_FINISH "<CMAKE_AR> -sq <TARGET>")
|
|
|
|
find_program(CMAKE_GDB ${CROSS_COMPILE}mdb PATHS ${TOOLCHAIN_HOME} NO_DEFAULT_PATH)
|
|
|
|
# MWDT binutils don't support required features like section renaming, so we
|
|
# temporarily had to use GNU objcopy instead
|
|
find_program(CMAKE_OBJCOPY ${ZEPHYR_SDK_CROSS_COMPILE}objcopy PATHS ${ZEPHYR_SDK_INSTALL_DIR} NO_DEFAULT_PATH)
|
|
message(STATUS "Found GNU objcopy helper for MWDT: ${CMAKE_OBJCOPY} (Zephyr SDK ${SDK_VERSION})")
|
|
|
|
include(${ZEPHYR_BASE}/cmake/bintools/arcmwdt/target_bintools.cmake)
|