From c4b61b12dfb9305234a27a3401a9a4f461bcf200 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Thu, 10 Aug 2023 11:45:11 +0800 Subject: [PATCH] loongarch: kernel: Disable relaxation for building a module Link: https://git.kernel.org/torvalds/c/03c53eb90c0c --- chapter10/kernel.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/chapter10/kernel.xml b/chapter10/kernel.xml index a633f7c46..51c1d2cce 100644 --- a/chapter10/kernel.xml +++ b/chapter10/kernel.xml @@ -291,6 +291,14 @@ configuration menus and create the kernel configuration from scratch. + Fix an issue causing all kernel modules built with Binutils-2.41 + or later not loadable: + +cat >> arch/loongarch/Makefile << EOF +KBUILD_AFLAGS_MODULE += -Wa,-mno-relax +KBUILD_CFLAGS_MODULE += -Wa,-mno-relax +EOF + Compile the kernel image and modules: make