riscv: kexec: do not add '-mno-relax' flag if compiler doesn't support it

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: fba8a8674f ("RISC-V: Add kexec support")
Signed-off-by: Changbin Du <changbin.du@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
This commit is contained in:
Changbin Du 2021-07-22 10:17:15 +08:00 committed by Palmer Dabbelt
parent 867432bec1
commit 030d6dbf0c
No known key found for this signature in database
GPG Key ID: 2E1319F35FBB1889

View File

@ -11,7 +11,7 @@ endif
CFLAGS_syscall_table.o += $(call cc-option,-Wno-override-init,) CFLAGS_syscall_table.o += $(call cc-option,-Wno-override-init,)
ifdef CONFIG_KEXEC ifdef CONFIG_KEXEC
AFLAGS_kexec_relocate.o := -mcmodel=medany -mno-relax AFLAGS_kexec_relocate.o := -mcmodel=medany $(call cc-option,-mno-relax)
endif endif
extra-y += head.o extra-y += head.o