diff --git a/cmake/compiler/gcc/target.cmake b/cmake/compiler/gcc/target.cmake index 2b90c5d2eff..2bd1ffa47c2 100644 --- a/cmake/compiler/gcc/target.cmake +++ b/cmake/compiler/gcc/target.cmake @@ -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 diff --git a/cmake/compiler/gcc/target_mips.cmake b/cmake/compiler/gcc/target_mips.cmake new file mode 100644 index 00000000000..e9dacbf3de1 --- /dev/null +++ b/cmake/compiler/gcc/target_mips.cmake @@ -0,0 +1,19 @@ +# Copyright (c) 2021 Antony Pavlov +# Copyright (c) 2021 Remy Luisant +# +# 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)