cmake: Update the RISCV build to work with GCC 8.2.0

This commit is contained in:
Siwei Zhuang
2019-03-13 12:14:28 +11:00
parent c666820ea5
commit d52341df3c
2 changed files with 6 additions and 8 deletions

View File

@@ -72,11 +72,11 @@ if(KernelArchARM)
endif()
if(KernelArchRiscV)
if(Kernel64)
string(APPEND c_common_flags " -march=rv64imac")
string(APPEND c_common_flags " -mabi=lp64")
string(APPEND common_flags " -march=rv64imac")
string(APPEND common_flags " -mabi=lp64")
else()
string(APPEND c_common_flags " -march=rv32ima")
string(APPEND c_common_flags " -mabi=ilp32")
string(APPEND common_flags " -march=rv32imac")
string(APPEND common_flags " -mabi=ilp32")
endif()
endif()
string(APPEND common_flags " ${build_arch}")

View File

@@ -30,10 +30,8 @@ if("${CROSS_COMPILER_PREFIX}" STREQUAL "")
set(CROSS_COMPILER_PREFIX "arm-linux-gnueabihf-" CACHE INTERNAL "")
elseif(AARCH64)
set(CROSS_COMPILER_PREFIX "aarch64-linux-gnu-" CACHE INTERNAL "")
elseif(RISCV32)
set(CROSS_COMPILER_PREFIX "riscv32-unknown-elf-" CACHE INTERNAL "")
elseif(RISCV64)
set(CROSS_COMPILER_PREFIX "riscv64-unknown-elf-" CACHE INTERNAL "")
elseif(RISCV32 OR RISCV64)
set(CROSS_COMPILER_PREFIX "riscv64-unknown-linux-gnu-" CACHE INTERNAL "")
else()
# If we haven't set a target above we assume x86_64/ia32 target
if(APPLE)