From bfd8e28cff2a62c7e40231f70f2391d81e4ede39 Mon Sep 17 00:00:00 2001 From: Huaqi Fang <578567190@qq.com> Date: Tue, 15 Oct 2024 12:04:06 +0800 Subject: [PATCH] Build: Add zicsr extension to all cpu when compiled with nuclei_llvm Signed-off-by: Huaqi Fang <578567190@qq.com> --- Build/toolchain/nuclei_llvm.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Build/toolchain/nuclei_llvm.mk b/Build/toolchain/nuclei_llvm.mk index fe376701..76766b31 100644 --- a/Build/toolchain/nuclei_llvm.mk +++ b/Build/toolchain/nuclei_llvm.mk @@ -93,6 +93,8 @@ endif COMMON_FLAGS += -march=$(RISCV_ARCH) -mabi=$(RISCV_ABI) -mcmodel=$(RISCV_CMODEL) # Enable some experimental extension for llvm clang COMMON_FLAGS += -menable-experimental-extensions +# Add zicsr extension to clang, since our cpu always has zicsr extension +COMMON_FLAGS += -Xclang -target-feature -Xclang +zicsr ## Append mtune options when RISCV_TUNE is defined ## It might be defined in SoC//build.mk, and can be overwritten by make ifneq ($(RISCV_TUNE),)