linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] MIPS: generic: Do not select CPUs that are unsupported in clang
@ 2023-04-06 20:09 Nathan Chancellor
  2023-04-06 20:59 ` Jiaxun Yang
  0 siblings, 1 reply; 6+ messages in thread
From: Nathan Chancellor @ 2023-04-06 20:09 UTC (permalink / raw)
  To: tsbogend, jiaxun.yang; +Cc: linux-mips, llvm, patches, Nathan Chancellor

When building allnoconfig with clang after commit de34007751aa ("MIPS:
generic: Enable all CPUs supported by virt board in Kconfig"), the
following error occurs:

  error: unknown target CPU 'r4600'
  note: valid target CPU values are: mips1, mips2, mips3, mips4, mips5, mips32, mips32r2, mips32r3, mips32r5, mips32r6, mips64, mips64r2, mips64r3, mips64r5, mips64r6, octeon, octeon+, p5600

Working around that, there are similar errors for 'loongson2e' and
'loongson2f'.

These CPUs are not supported in clang/LLVM, so do not select support for
them in MIPS_GENERIC_KERNEL when building with clang.

Fixes: de34007751aa ("MIPS: generic: Enable all CPUs supported by virt board in Kconfig")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 arch/mips/Kconfig | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index a975f140ae82..84de20f48b59 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -154,15 +154,15 @@ config MIPS_GENERIC_KERNEL
 	select SMP_UP if SMP
 	select SWAP_IO_SPACE
 	select SYS_HAS_CPU_CAVIUM_OCTEON
-	select SYS_HAS_CPU_LOONGSON2E
-	select SYS_HAS_CPU_LOONGSON2F
+	select SYS_HAS_CPU_LOONGSON2E if !CC_IS_CLANG
+	select SYS_HAS_CPU_LOONGSON2F if !CC_IS_CLANG
 	select SYS_HAS_CPU_MIPS32_R1
 	select SYS_HAS_CPU_MIPS32_R2
 	select SYS_HAS_CPU_MIPS32_R6
 	select SYS_HAS_CPU_MIPS64_R1
 	select SYS_HAS_CPU_MIPS64_R2
 	select SYS_HAS_CPU_MIPS64_R6
-	select SYS_HAS_CPU_R4X00
+	select SYS_HAS_CPU_R4X00 if !CC_IS_CLANG
 	select SYS_SUPPORTS_32BIT_KERNEL
 	select SYS_SUPPORTS_64BIT_KERNEL
 	select SYS_SUPPORTS_BIG_ENDIAN

---
base-commit: 045c340c86f8a9d7cb675e179dc6297caa6ebc01
change-id: 20230406-mips-clang-generic-selects-fix-a2f7b3216d18

Best regards,
-- 
Nathan Chancellor <nathan@kernel.org>


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

end of thread, other threads:[~2023-04-06 21:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-06 20:09 [PATCH] MIPS: generic: Do not select CPUs that are unsupported in clang Nathan Chancellor
2023-04-06 20:59 ` Jiaxun Yang
2023-04-06 21:09   ` Nathan Chancellor
2023-04-06 21:19     ` Jiaxun Yang
2023-04-06 21:30       ` Jiaxun Yang
2023-04-06 21:39         ` Nathan Chancellor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).