From: Luís Marques Date: Sun, 31 Jan 2021 23:51:38 +0000 (+0000) Subject: [CMake][compiler-rt][RISCV] Support RISC-V cross-compilation X-Git-Tag: llvmorg-14-init~16478 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3203c968424193a519d1b52739047748038bb074;p=platform%2Fupstream%2Fllvm.git [CMake][compiler-rt][RISCV] Support RISC-V cross-compilation This seems to be a safe way to ensure that the Compiler-RT test compiler flags are properly set in all cross-compilation scenarios. Without this when `BUILTINS_TEST_TARGET_CFLAGS` is set in `compiler-rt/test/builtins/CMakeLists.txt` the other flags are cleared. Differential Revision: https://reviews.llvm.org/D92124 --- diff --git a/compiler-rt/cmake/config-ix.cmake b/compiler-rt/cmake/config-ix.cmake index 8135738..47039a3 100644 --- a/compiler-rt/cmake/config-ix.cmake +++ b/compiler-rt/cmake/config-ix.cmake @@ -219,7 +219,7 @@ endfunction() # specific architecture. When cross-compiling, this is controled via # COMPILER_RT_TEST_COMPILER and COMPILER_RT_TEST_COMPILER_CFLAGS. macro(get_test_cc_for_arch arch cc_out cflags_out) - if(ANDROID OR ${arch} MATCHES "arm|aarch64") + if(ANDROID OR ${arch} MATCHES "arm|aarch64|riscv32|riscv64") # This is only true if we are cross-compiling. # Build all tests with host compiler and use host tools. set(${cc_out} ${COMPILER_RT_TEST_COMPILER})