During make modules_install, the need-compiler variable becomes null, so Makefile.compiler isn't included. This results in call cc-option-yn returning nothing. To get rid of spurious "CONFIG_CPU_DADDI_WORKAROUNDS unsupported without -msym32" error, just wrap it into `ifdef need-compiler'. Link: https://lore.kernel.org/all/alpine.DEB.2.21.2502120612000.65342@xxxxxxxxxxxxxxxxx/ Link: https://lore.kernel.org/all/alpine.DEB.2.21.2307180025120.62448@xxxxxxxxxxxxxxxxx/ Fixes: 805b2e1d427a ("kbuild: include Makefile.compiler only when compiler is needed") Fixes: 18ca63a2e23c ("MIPS: Probe toolchain support of -msym32") Reported-by: Maciej W. Rozycki <macro@xxxxxxxxxxx> Closes: https://lore.kernel.org/all/alpine.DEB.2.21.2501030535080.49841@xxxxxxxxxxxxxxxxx/ Co-developed-by: Chen Linxuan <chenlinxuan@xxxxxxxxxxxxx> Signed-off-by: Chen Linxuan <chenlinxuan@xxxxxxxxxxxxx> Signed-off-by: WangYuli <wangyuli@xxxxxxxxxxxxx> --- arch/mips/Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/mips/Makefile b/arch/mips/Makefile index be8cb44a89fd..4d8339d2f20f 100644 --- a/arch/mips/Makefile +++ b/arch/mips/Makefile @@ -304,8 +304,12 @@ ifdef CONFIG_64BIT ifeq ($(KBUILD_SYM32), y) cflags-$(KBUILD_SYM32) += -msym32 -DKBUILD_64BIT_SYM32 else - ifeq ($(CONFIG_CPU_DADDI_WORKAROUNDS), y) - $(error CONFIG_CPU_DADDI_WORKAROUNDS unsupported without -msym32) +# Do not fiddle with the compilation flags when no compiler is +# going to be used. To get rid of spurious errors. + ifdef need-compiler + ifeq ($(CONFIG_CPU_DADDI_WORKAROUNDS), y) + $(error CONFIG_CPU_DADDI_WORKAROUNDS unsupported without -msym32) + endif endif endif endif -- 2.47.2