2019-04-06 21:08:09 +08:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
2020-09-19 06:53:28 +08:00
|
|
|
if(CONFIG_ARM64)
|
|
|
|
set(CROSS_COMPILE_TARGET_arm aarch64-zephyr-elf)
|
|
|
|
else()
|
|
|
|
set(CROSS_COMPILE_TARGET_arm arm-zephyr-eabi)
|
|
|
|
endif()
|
2018-12-13 23:32:07 +08:00
|
|
|
set(CROSS_COMPILE_TARGET_nios2 nios2-zephyr-elf)
|
2019-10-08 16:09:11 +08:00
|
|
|
set(CROSS_COMPILE_TARGET_riscv riscv64-zephyr-elf)
|
2018-12-13 23:32:07 +08:00
|
|
|
set(CROSS_COMPILE_TARGET_mips mipsel-zephyr-elf)
|
|
|
|
set(CROSS_COMPILE_TARGET_xtensa xtensa-zephyr-elf)
|
|
|
|
set(CROSS_COMPILE_TARGET_arc arc-zephyr-elf)
|
2019-10-08 02:34:29 +08:00
|
|
|
set(CROSS_COMPILE_TARGET_x86 x86_64-zephyr-elf)
|
2020-10-17 02:55:04 +08:00
|
|
|
set(CROSS_COMPILE_TARGET_sparc sparc-zephyr-elf)
|
2018-12-13 23:32:07 +08:00
|
|
|
|
|
|
|
set(CROSS_COMPILE_TARGET ${CROSS_COMPILE_TARGET_${ARCH}})
|
|
|
|
set(SYSROOT_TARGET ${CROSS_COMPILE_TARGET})
|
|
|
|
|
2019-10-08 02:34:29 +08:00
|
|
|
if("${ARCH}" STREQUAL "xtensa")
|
|
|
|
set(SYSROOT_DIR ${TOOLCHAIN_HOME}/xtensa/${SOC_NAME}/${SYSROOT_TARGET})
|
|
|
|
set(CROSS_COMPILE ${TOOLCHAIN_HOME}/xtensa/${SOC_NAME}/${CROSS_COMPILE_TARGET}/bin/${CROSS_COMPILE_TARGET}-)
|
|
|
|
else()
|
|
|
|
set(SYSROOT_DIR ${TOOLCHAIN_HOME}/${SYSROOT_TARGET}/${SYSROOT_TARGET})
|
|
|
|
set(CROSS_COMPILE ${TOOLCHAIN_HOME}/${CROSS_COMPILE_TARGET}/bin/${CROSS_COMPILE_TARGET}-)
|
|
|
|
endif()
|
2019-10-08 16:14:02 +08:00
|
|
|
|
|
|
|
if("${ARCH}" STREQUAL "x86")
|
|
|
|
if(CONFIG_X86_64)
|
|
|
|
list(APPEND TOOLCHAIN_C_FLAGS -m64)
|
|
|
|
list(APPEND TOOLCHAIN_LD_FLAGS -m64)
|
|
|
|
else()
|
|
|
|
list(APPEND TOOLCHAIN_C_FLAGS -m32)
|
|
|
|
list(APPEND TOOLCHAIN_LD_FLAGS -m32)
|
|
|
|
endif()
|
|
|
|
endif()
|