Add compiler cmake files for RISC-V (rv64gc) targets

This adds the basic support for riscv64-unknown-elf compiler amd rv64gc ISA

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
This commit is contained in:
Jukka Laitinen
2021-05-28 22:22:57 -04:00
committed by Daniel Agar
parent 935253357a
commit 34de392425
2 changed files with 55 additions and 0 deletions
@@ -0,0 +1,11 @@
if(CONFIG_ARCH_DPFPU)
message(STATUS "Enabling double FP precision hardware instructions")
set(cpu_flags "-march=rv64gc -mabi=lp64d -mcmodel=medany")
else()
set(cpu_flags "-march=rv64imac -mabi=lp64 -mcmodel=medany")
endif()
set(CMAKE_C_FLAGS "${cpu_flags}" CACHE STRING "" FORCE)
set(CMAKE_CXX_FLAGS "${cpu_flags}" CACHE STRING "" FORCE)
set(CMAKE_ASM_FLAGS "${cpu_flags} -D__ASSEMBLY__" CACHE STRING "" FORCE)