[PATCH 5.13 030/151] riscv: kexec: do not add -mno-relax flag if compiler doesnt support it

From
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date
2021-08-16 13:25:01
Also in
lkml
Reply to
Greg Kroah-Hartman, 2021-08-16
From: Changbin Du <redacted>

commit 030d6dbf0c2e5fdf23ad29557f0c87a882993e26 upstream.

The RISC-V special option '-mno-relax' which to disable linker relaxations
is supported by GCC8+. For GCC7 and lower versions do not support this
option.

Fixes: fba8a8674f68 ("RISC-V: Add kexec support")
Signed-off-by: Changbin Du <redacted>
Cc: <redacted>
Signed-off-by: Palmer Dabbelt <redacted>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 arch/riscv/kernel/Makefile |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--- a/arch/riscv/kernel/Makefile
+++ b/arch/riscv/kernel/Makefile
@@ -11,7 +11,7 @@ endif
 CFLAGS_syscall_table.o	+= $(call cc-option,-Wno-override-init,)
 
 ifdef CONFIG_KEXEC
-AFLAGS_kexec_relocate.o := -mcmodel=medany -mno-relax
+AFLAGS_kexec_relocate.o := -mcmodel=medany $(call cc-option,-mno-relax)
 endif
 
 extra-y += head.o

Thread (157 messages) 157 messages, 4 authors, last reply 2021-11-15
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help