On Thu, Jun 15, 2023 at 08:10:38PM +0800, Xiaotian Wu wrote:
> A working grub cannot be built with upcoming binutils and gcc, because linker
> relaxation was added [1] causing new unsupported relocations to appear in 
> modules.
>
> So we pass -mno-relax to gcc if it is supported, to disable relaxation and 
> make
> grub forward-compatible with new toolchains.
>
> While similar code already exists for sparc64 in configure.ac, sparc64 sets
> LDFLAGS while loongarch requires CFLAGS to be set. If we only set LDFLAGS on
> loongarch, gcc will still generate relaxation relocations in the .o files, so
> the sparc64 code cannot be reused.
>
> [1]: 
> https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=56576f4a722b7398d35802ecf7d4185c27d6d69b
>
> Signed-off-by: Xiaotian Wu <wuxiaot...@loongson.cn>

Reviewed-by: Daniel Kiper <daniel.ki...@oracle.com>

Daniel

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to