set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_SYSTEM_PROCESSOR riscv32)

set(triple riscv32-unknown-elf)

set(CMAKE_C_COMPILER riscv64-unknown-elf-gcc)
set(CMAKE_C_COMPILER_TARGET ${triple})
set(CMAKE_CXX_COMPILER riscv64-unknown-elf-g++)
set(CMAKE_CXX_COMPILER_TARGET ${triple})
set(CMAKE_ASM_COMPILER riscv64-unknown-elf-gcc)
set(CMAKE_ASM_COMPILER_TARGET ${triple})
# set(CMAKE_AR llvm-ar CACHE FILEPATH "Archiver")
set(CMAKE_OBJCOPY riscv64-unknown-elf-objcopy)
set(CMAKE_OBJDUMP riscv64-unknown-elf-objdump)

# set(CMAKE_C_FLAGS_INIT "-mno-relax")
# set(CMAKE_CXX_FLAGS_INIT "-mno-relax")
# set(CMAKE_ASM_FLAGS_INIT "-mno-relax")
set(CMAKE_EXE_LINKER_FLAGS_INIT "-nostdlib -static ")
set(CMAKE_MODULE_LINKER_FLAGS_INIT "-nostdlib -static")
set(CMAKE_SHARED_LINKER_FLAGS_INIT "-nostdlib -static")
