cmake: add MIPS support

This commit defines the toolchain command line options for the
Zephyr MIPS architectural port.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Remy Luisant <remy@luisant.ca>
This commit is contained in:
Antony Pavlov 2021-12-05 22:47:41 +00:00 committed by Anas Nashif
commit 436066e3c4
2 changed files with 21 additions and 0 deletions

View file

@ -59,6 +59,8 @@ elseif("${ARCH}" STREQUAL "x86")
include(${CMAKE_CURRENT_LIST_DIR}/target_x86.cmake)
elseif("${ARCH}" STREQUAL "sparc")
include(${CMAKE_CURRENT_LIST_DIR}/target_sparc.cmake)
elseif("${ARCH}" STREQUAL "mips")
include(${CMAKE_CURRENT_LIST_DIR}/target_mips.cmake)
endif()
# This libgcc code is partially duplicated in compiler/*/target.cmake

View file

@ -0,0 +1,19 @@
# Copyright (c) 2021 Antony Pavlov <antonynpavlov@gmail.com>
# Copyright (c) 2021 Remy Luisant <remy@luisant.ca>
#
# SPDX-License-Identifier: Apache-2.0
if(CONFIG_BIG_ENDIAN)
list(APPEND TOOLCHAIN_C_FLAGS -EB)
list(APPEND TOOLCHAIN_LD_FLAGS -EB)
else()
list(APPEND TOOLCHAIN_C_FLAGS -EL)
list(APPEND TOOLCHAIN_LD_FLAGS -EL)
endif()
list(APPEND TOOLCHAIN_C_FLAGS -msoft-float)
list(APPEND TOOLCHAIN_LD_FLAGS -msoft-float)
list(APPEND TOOLCHAIN_C_FLAGS -G0 -mno-gpopt -fno-pic)
list(APPEND TOOLCHAIN_C_FLAGS -pipe)