RISC-V/ch32v003/clang.mk

24 lines
702 B
Makefile
Raw Normal View History

2024-02-29 12:22:16 +01:00
# Use clang / llvm toolchain
2024-03-02 15:44:43 +01:00
# Zatím není podporováno - problém :
# E: RV32I subset, only 16 general-purpose registers supported
# v clang není korektně implementováno.
#
2024-02-29 12:22:16 +01:00
CC = clang
CXX = clang++
LD = ld.lld
#LD = riscv64-unknown-elf-gcc
SIZE = llvm-size
DUMP = riscv64-unknown-elf-objdump
COPY = riscv64-unknown-elf-objcopy
OBJS += startup.o system.o
CCPU = -march=rv32ec -mabi=ilp32e
MCPU = $(CCPU)
TRIP = riscv32-unknown-none-elf
CFLAGS+= -Oz -flto
#CFLAGS+= -fconstexpr-steps=2097152
CFLAGS+= --target=$(TRIP) -mllvm -mattr=+c,+e -mno-relax
LFLAGS+= --Map=$(@:%.elf=%.map) --gc-sections -mllvm -mattr=+c
LFLAGS+= -lto-O3 -nostdlib
LDLIBS+= -L./$(TARGET) -T generated_ch32v003.ld