Linux kernel -stable discussions
 help / color / mirror / Atom feed
* [PATCH for 6.1/6.6] LoongArch: Explicitly specify code model in Makefile
@ 2025-05-13  8:06 Huacai Chen
  2025-05-13  8:12 ` Greg Kroah-Hartman
  2025-05-13 18:49 ` Sasha Levin
  0 siblings, 2 replies; 3+ messages in thread
From: Huacai Chen @ 2025-05-13  8:06 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Sasha Levin, Huacai Chen
  Cc: Xuerui Wang, stable, loongarch, Huacai Chen, Haiyong Sun

LoongArch's toolchain may change the default code model from normal to
medium. This is unnecessary for kernel, and generates some relocations
which cannot be handled by the module loader. So explicitly specify the
code model to normal in Makefile (for Rust 'normal' is 'small').

Cc: stable@vger.kernel.org
Tested-by: Haiyong Sun <sunhaiyong@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
---
We may use new toolchain to build 6.1/6.6 LTS, backport it to avoid
problems.

 arch/loongarch/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/loongarch/Makefile b/arch/loongarch/Makefile
index a74bbcb05ee1..f2966745b058 100644
--- a/arch/loongarch/Makefile
+++ b/arch/loongarch/Makefile
@@ -55,7 +55,7 @@ endif
 
 ifdef CONFIG_64BIT
 ld-emul			= $(64bit-emul)
-cflags-y		+= -mabi=lp64s
+cflags-y		+= -mabi=lp64s -mcmodel=normal
 endif
 
 cflags-y			+= -pipe -msoft-float
-- 
2.47.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH for 6.1/6.6] LoongArch: Explicitly specify code model in Makefile
  2025-05-13  8:06 [PATCH for 6.1/6.6] LoongArch: Explicitly specify code model in Makefile Huacai Chen
@ 2025-05-13  8:12 ` Greg Kroah-Hartman
  2025-05-13 18:49 ` Sasha Levin
  1 sibling, 0 replies; 3+ messages in thread
From: Greg Kroah-Hartman @ 2025-05-13  8:12 UTC (permalink / raw)
  To: Huacai Chen
  Cc: Sasha Levin, Huacai Chen, Xuerui Wang, stable, loongarch,
	Haiyong Sun

On Tue, May 13, 2025 at 04:06:45PM +0800, Huacai Chen wrote:
> LoongArch's toolchain may change the default code model from normal to
> medium. This is unnecessary for kernel, and generates some relocations
> which cannot be handled by the module loader. So explicitly specify the
> code model to normal in Makefile (for Rust 'normal' is 'small').
> 
> Cc: stable@vger.kernel.org
> Tested-by: Haiyong Sun <sunhaiyong@loongson.cn>
> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
> ---
> We may use new toolchain to build 6.1/6.6 LTS, backport it to avoid
> problems.

What is the upstream git id for this commit?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH for 6.1/6.6] LoongArch: Explicitly specify code model in Makefile
  2025-05-13  8:06 [PATCH for 6.1/6.6] LoongArch: Explicitly specify code model in Makefile Huacai Chen
  2025-05-13  8:12 ` Greg Kroah-Hartman
@ 2025-05-13 18:49 ` Sasha Levin
  1 sibling, 0 replies; 3+ messages in thread
From: Sasha Levin @ 2025-05-13 18:49 UTC (permalink / raw)
  To: stable, chenhuacai; +Cc: Sasha Levin

[ Sasha's backport helper bot ]

Hi,

Summary of potential issues:
⚠️ Found matching upstream commit but patch is missing proper reference to it

Found matching upstream commit: e67e0eb6a98b261caf45048f9eb95fd7609289c0

Status in newer kernel trees:
6.14.y | Present (exact SHA1)
6.12.y | Present (different SHA1: 7b3a7918f10d)
6.6.y | Not found

Note: The patch differs from the upstream commit:
---
1:  e67e0eb6a98b2 ! 1:  fa2ca06c43c1a LoongArch: Explicitly specify code model in Makefile
    @@ arch/loongarch/Makefile: endif
     +cflags-y		+= -mabi=lp64s -mcmodel=normal
      endif
      
    - cflags-y			+= -pipe $(CC_FLAGS_NO_FPU)
    -@@ arch/loongarch/Makefile: ifdef CONFIG_OBJTOOL
    - KBUILD_CFLAGS			+= -fno-jump-tables
    - endif
    - 
    --KBUILD_RUSTFLAGS		+= --target=loongarch64-unknown-none-softfloat
    -+KBUILD_RUSTFLAGS		+= --target=loongarch64-unknown-none-softfloat -Ccode-model=small
    - KBUILD_RUSTFLAGS_KERNEL		+= -Zdirect-access-external-data=yes
    - KBUILD_RUSTFLAGS_MODULE		+= -Zdirect-access-external-data=no
    - 
    + cflags-y			+= -pipe -msoft-float
---

Results of testing on various branches:

| Branch                    | Patch Apply | Build Test |
|---------------------------|-------------|------------|
| stable/linux-6.1.y        |  Success    |  Success   |
| stable/linux-6.6.y        |  Success    |  Success   |

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-05-13 18:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-13  8:06 [PATCH for 6.1/6.6] LoongArch: Explicitly specify code model in Makefile Huacai Chen
2025-05-13  8:12 ` Greg Kroah-Hartman
2025-05-13 18:49 ` Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox