[PATCH master 07/14] RISC-V: restrict GCC optimization some more

Ahmad Fatoum a.fatoum at pengutronix.de
Tue Apr 11 00:14:29 PDT 2023


Some of these we are already setting for ARM and all of them are already
in use by the Linux RISC-V arch Makefile.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 arch/riscv/Makefile | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile
index 1371f17e7c90..71ca82fe8dc0 100644
--- a/arch/riscv/Makefile
+++ b/arch/riscv/Makefile
@@ -22,6 +22,9 @@ toolchain-need-zicsr-zifencei := $(call cc-option-yn, -march=$(riscv-march-y)_zi
 riscv-march-$(toolchain-need-zicsr-zifencei) := $(riscv-march-y)_zicsr_zifencei
 
 KBUILD_CPPFLAGS += -march=$(riscv-march-y)
+KBUILD_CFLAGS += -mno-save-restore
+KBUILD_CFLAGS += -fno-asynchronous-unwind-tables -fno-unwind-tables
+KBUILD_CFLAGS += $(call cc-option,-mstrict-align)
 KBUILD_CPPFLAGS += -Wstrict-prototypes -mcmodel=medany -fpic
 riscv-ldflags-y += -pie -static
 
-- 
2.39.2




More information about the barebox mailing list