diff mbox series

[5.4~6.6] MIPS: Probe toolchain support of -msym32

Message ID 183F7B3F0A07AC93+20241224060918.15199-1-wangyuli@uniontech.com (mailing list archive)
State New
Headers show
Series [5.4~6.6] MIPS: Probe toolchain support of -msym32 | expand

Commit Message

WangYuli Dec. 24, 2024, 6:09 a.m. UTC
From: Jiaxun Yang <jiaxun.yang@flygoat.com>

[ Upstream commit 18ca63a2e23c5e170d2d7552b64b1f5ad019cd9b ]

msym32 is not supported by LLVM toolchain.
Workaround by probe toolchain support of msym32 for KBUILD_SYM32
feature.

Link: https://github.com/ClangBuiltLinux/linux/issues/1544
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: WangYuli <wangyuli@uniontech.com>
---
 arch/mips/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Maciej W. Rozycki Jan. 2, 2025, 6:07 a.m. UTC | #1
On Tue, 24 Dec 2024, WangYuli wrote:

> From: Jiaxun Yang <jiaxun.yang@flygoat.com>
> 
> [ Upstream commit 18ca63a2e23c5e170d2d7552b64b1f5ad019cd9b ]
> 
> msym32 is not supported by LLVM toolchain.
> Workaround by probe toolchain support of msym32 for KBUILD_SYM32
> feature.

 Doesn't this reintroduce the failure fixed with commit a79a404e6c22 
("MIPS: Fix CONFIG_CPU_DADDI_WORKAROUNDS `modules_install' regression")?

 If this call to `cc-option-yn' does need to be made here, then this whole 
stuff has to be wrapped into a `need-compiler' check, see the discussion: 
<https://lore.kernel.org/r/alpine.DEB.2.21.2307180025120.62448@angie.orcam.me.uk/> 
and the other patches in the series.

  Maciej
WangYuli Jan. 2, 2025, 4:52 p.m. UTC | #2
Are you suggesting that a commit from v6.8 reintroduced a regression that
was fixed in v6.6?

If so, we should address this issue in the mainline first before backporting.

As a general rule, we avoid introducing out-of-tree commits to linux-stable
except for reverts.

For this patch, merging it into linux-stable is crucial, as it would prevent
certain configurations like loongson3_defconfig from building the kernel with
clang.

To fix follow error with clang-19:
	clang: error: unknown argument: '-msym32'

Thanks,
--
WangYuli
Maciej W. Rozycki Jan. 3, 2025, 5:49 a.m. UTC | #3
On Fri, 3 Jan 2025, WangYuli wrote:

> Are you suggesting that a commit from v6.8 reintroduced a regression that
> was fixed in v6.6?

 Correct.

> If so, we should address this issue in the mainline first before backporting.

 I do not disagree.

> As a general rule, we avoid introducing out-of-tree commits to linux-stable
> except for reverts.

 Understood.

> For this patch, merging it into linux-stable is crucial, as it would prevent
> certain configurations like loongson3_defconfig from building the kernel with
> clang.

 Conversely I don't think it's acceptable for -stable to merge a change 
that replaces one known bug with another; it violates our rule #2:

 - It must be obviously correct and tested.

 If you care about support for building with Clang, then please either fix 
your fix or fix the compiler to handle `-msym32' or an equivalent option 
(which seems a good idea for n64 MIPS performance anyway -- you're wasting 
a lot of cycles to explicitly put the sign-extension of bit 31 into the 
high order 32 bits where the CPU architecture does it for you already).  
And only then offer a backport of whatever you feel is needed to -stable.

  Maciej
diff mbox series

Patch

diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index f49807e1f19b..0888074f4dfe 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -299,7 +299,7 @@  drivers-$(CONFIG_PCI)		+= arch/mips/pci/
 ifdef CONFIG_64BIT
   ifndef KBUILD_SYM32
     ifeq ($(shell expr $(load-y) \< 0xffffffff80000000), 0)
-      KBUILD_SYM32 = y
+      KBUILD_SYM32 = $(call cc-option-yn, -msym32)
     endif
   endif