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@xxxxxxxxxx> --- 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@xxxxxxxxxx>