1 # 2 # Copyright (c) 2017, Alliance for Open Media. All rights reserved 3 # 4 # This source code is subject to the terms of the BSD 2 Clause License and the 5 # Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License was 6 # not distributed with this source code in the LICENSE file, you can obtain it 7 # at www.aomedia.org/license/software. If the Alliance for Open Media Patent 8 # License 1.0 was not distributed with this source code in the PATENTS file, you 9 # can obtain it at www.aomedia.org/license/patent. 10 # 11 if(AOM_BUILD_CMAKE_TOOLCHAINS_MIPS64_LINUX_GCC_CMAKE_) 12 return() 13 endif() # AOM_BUILD_CMAKE_TOOLCHAINS_MIPS64_LINUX_GCC_CMAKE_ 14 set(AOM_BUILD_CMAKE_TOOLCHAINS_MIPS64_LINUX_GCC_CMAKE_ 1) 15 16 set(CMAKE_SYSTEM_NAME "Linux") 17 18 if("${CROSS}" STREQUAL "") 19 20 # TODO(tomfinegan): Make it possible to turn this off. The $CROSS prefix won't 21 # be desired on a mips host. 22 # 23 # Default the cross compiler prefix to something known to work. 24 set(CROSS mips-img-linux-gnu-) 25 endif() 26 27 if(ENABLE_MSA) 28 set(HAVE_MSA 1 CACHE BOOL "" FORCE) 29 set(MIPS_CFLAGS "-mmsa") 30 set(MIPS_CXXFLAGS "-mmsa") 31 endif() 32 33 if("${MIPS_CPU}" STREQUAL "i6400" OR "${MIPS_CPU}" STREQUAL "p6600") 34 set(MIPS_CPU_FLAGS "-mips64r6 -mabi=64 -mload-store-pairs -msched-weight") 35 set(MIPS_CPU_FLAGS "${MIPS_CPU_FLAGS} -mhard-float -mfp64") 36 set(MIPS_CFLAGS "${MIPS_CFLAGS} ${MIPS_CPU_FLAGS}") 37 set(MIPS_CXXFLAGS "${MIPS_CXXFLAGS} ${MIPS_CPU_FLAGS}") 38 set(CMAKE_EXE_LINKER_FLAGS 39 "-mips64r6 -mabi64 -mfp64 ${CMAKE_EXE_LINKER_FLAGS}") 40 endif() 41 42 set(CMAKE_C_COMPILER ${CROSS}gcc) 43 set(CMAKE_CXX_COMPILER ${CROSS}g++) 44 set(AS_EXECUTABLE ${CROSS}as) 45 set(CMAKE_C_COMPILER_ARG1 "-EL ${MIPS_CFLAGS}") 46 set(CMAKE_CXX_COMPILER_ARG1 "-EL ${MIPS_CXXFLAGS}") 47 set(CMAKE_SYSTEM_PROCESSOR "mips64") 48 49 # No runtime cpu detect for mips64-linux-gcc. 50 if(CONFIG_RUNTIME_CPU_DETECT) 51 message("--- CONFIG_RUNTIME_CPU_DETECT not supported for mips64 targets.") 52 endif() 53 54 set(CONFIG_RUNTIME_CPU_DETECT 0 CACHE NUMBER "" FORCE) 55