On Thu, Apr 20, 2023 at 08:41:07PM +0100, Jiaxun Yang wrote: > > > > 2023年4月20日 00:01,Nick Desaulniers <ndesaulniers@xxxxxxxxxx> 写道: > > > > On Tue, Apr 18, 2023 at 6:13 AM Thomas Bogendoerfer > > <tsbogend@xxxxxxxxxxxxxxxx> wrote: > >> > >> On Fri, Apr 14, 2023 at 09:06:56AM +0100, Jiaxun Yang wrote: > >>> microMIPS smartMIPS kernel can only be compiled if they are supported > >>> by toolchain. > >>> > >>> Signed-off-by: Jiaxun Yang <jiaxun.yang@xxxxxxxxxxx> > >>> Reviewed-by: Nick Desaulniers <ndesaulniers@xxxxxxxxxx> > > > > Question: won't the lack of this (patch and rest of the series) hurt > > our ability to test randconfig builds of ARCH=mips with clang? See > > also the 0day report from Boris: > > https://lore.kernel.org/llvm/202304170748.Fg9VIgGd-lkp@xxxxxxxxx/ > > Kconfig experts, Is there any way to generate warning based on Kconfig options? > So we can let users know there are something went wrong but still allow build to happen. I do not think there is a way that this can be done within Kconfig itself but you could do something like arch/x86/Makefile does for RETPOLINE during archprepare and warn when an option is selected without a dependency. I envision something like the following but it has not even been compile tested: diff --git a/arch/mips/Makefile b/arch/mips/Makefile index 04e46ec24319..2c3be65ce3cc 100644 --- a/arch/mips/Makefile +++ b/arch/mips/Makefile @@ -399,6 +399,11 @@ ifdef CONFIG_MIPS32_O32 @$(kecho) ' Checking missing-syscalls for O32' $(Q)$(MAKE) $(build)=. missing-syscalls missing_syscalls_flags="-mabi=32" endif +ifdef CONFIG_CPU_HAS_SMARTMIPS +ifndef CC_HAS_SMARTMIPS + $(warning CONFIG_CPU_HAS_SMARTMIPS selected without supported compiler, build may not work) +endif +endif install: $(Q)install -D -m 755 vmlinux $(INSTALL_PATH)/vmlinux-$(KERNELRELEASE) You could also make that depend on !CONFIG_COMPILE_TEST, as that is a signal that the user does not intend to run this kernel. Masahiro might have other comments. Cheers, Nathan