Add riscv cross build - RISCV architecture support with gcc toolchain - Fix readme for support architecture list Change-Id: I5ed06362c435e5b1b472179297b3c8ea5ad56a85 Signed-off-by: Kwanghoon Son <kwangson@yahoo.com> (cherry picked from commit 48c0a5292b2170c81f4f5e3acedca5151f1696e6)
diff --git a/README.md b/README.md index 7af05af..0d51080 100644 --- a/README.md +++ b/README.md
@@ -165,6 +165,8 @@ - armv7-linux-gcc.cmake - armv7-mingw-gcc.cmake - armv7s-ios.cmake + - ppc-linux-gcc.cmake + - riscv-linux-gcc.cmake - x86-ios-simulator.cmake - x86-linux.cmake - x86-macos.cmake
diff --git a/build/cmake/toolchains/riscv-linux-gcc.cmake b/build/cmake/toolchains/riscv-linux-gcc.cmake new file mode 100644 index 0000000..21e7370 --- /dev/null +++ b/build/cmake/toolchains/riscv-linux-gcc.cmake
@@ -0,0 +1,35 @@ +# +# Copyright (c) 2022, Alliance for Open Media. All rights reserved +# +# This source code is subject to the terms of the BSD 2 Clause License and the +# Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License was +# not distributed with this source code in the LICENSE file, you can obtain it +# at www.aomedia.org/license/software. If the Alliance for Open Media Patent +# License 1.0 was not distributed with this source code in the PATENTS file, you +# can obtain it at www.aomedia.org/license/patent. +# +if(AOM_BUILD_CMAKE_TOOLCHAINS_RISCV_LINUX_GCC_CMAKE_) + return() +endif() # AOM_BUILD_CMAKE_TOOLCHAINS_RISCV_LINUX_GCC_CMAKE_ +set(AOM_BUILD_CMAKE_TOOLCHAINS_RISCV_LINUX_GCC_CMAKE_ 1) + +set(CMAKE_SYSTEM_NAME "Linux") + +if("${CROSS}" STREQUAL "") + + # Default the cross compiler prefix to something known to work. + set(CROSS riscv64-unknown-linux-gnu-) +endif() + +if(NOT CMAKE_C_COMPILER) + set(CMAKE_C_COMPILER ${CROSS}gcc) +endif() +if(NOT CMAKE_CXX_COMPILER) + set(CMAKE_CXX_COMPILER ${CROSS}g++) +endif() +if(NOT AS_EXECUTABLE) + set(AS_EXECUTABLE ${CROSS}as) +endif() +set(CMAKE_SYSTEM_PROCESSOR "riscv") + +set(CONFIG_RUNTIME_CPU_DETECT 0 CACHE STRING "")