Skip to contentSkip to conversation

riscv: don't specify -mno-save-restore when building with clang

PATCH Superseded Tobias Klauser 1 participant 1 message Jul 8, 2020 RISC-V

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 riscv: don't specify -mno-save-restore when building with clang

Clang doesn't support -msave-restore and -mno-save-restore. This avoids the following message emitted by clang:

'-save-restore' is not a recognized feature for this target (ignoring feature)

---
 arch/riscv/Makefile | 2 ++
 1 file changed, 2 insertions(+)
arch/riscv/Makefile +2 -0
index fb6e37db836d..cd3720bc45e8 100644
@@ -44,7 +44,9 @@ riscv-march-$(CONFIG_RISCV_ISA_C)	:= $(riscv-march-y)c
 KBUILD_CFLAGS += -march=$(subst fd,,$(riscv-march-y))
 KBUILD_AFLAGS += -march=$(riscv-march-y)
 
+ifndef CONFIG_CC_IS_CLANG
 KBUILD_CFLAGS += -mno-save-restore
+endif
 KBUILD_CFLAGS += -DCONFIG_PAGE_OFFSET=$(CONFIG_PAGE_OFFSET)
 
 ifeq ($(CONFIG_CMODEL_MEDLOW),y)
Signature · 7 lines
2.27.0


_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv