Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Huacai Chen <chenhuacai@loongson.cn>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Huacai Chen <chenhuacai@kernel.org>,
	linux-mips@vger.kernel.org, Jiaxun Yang <jiaxun.yang@flygoat.com>,
	stable@vger.kernel.org,
	Nick Desaulniers <ndesaulniers@google.com>
Subject: Re: [PATCH] MIPS: Loongson: Fix build error when make modules_install
Date: Mon, 26 Jun 2023 09:07:20 -0700	[thread overview]
Message-ID: <20230626160720.GA2174263@dev-arch.thelio-3990X> (raw)
In-Reply-To: <20230626075047.1872818-1-chenhuacai@loongson.cn>

On Mon, Jun 26, 2023 at 03:50:47PM +0800, Huacai Chen wrote:
> After commit 0e96ea5c3eb5904e5dc2f ("MIPS: Loongson64: Clean up use of
> cc-ifversion") we get a build error when make modules_install:
> 
> cc1: error: '-mloongson-mmi' must be used with '-mhard-float'
> 
> The reason is when make modules_install, 'call cc-option' doesn't work
> in $(KBUILD_CFLAGS) of 'CHECKFLAGS'. Then there is no -mno-loongson-mmi
> applied and -march=loongson3a enable MMI instructions.

The first sentence does not make much sense to me, specifically "in
$(KBUILD_CFLAGS) of 'CHECKFLAGS'". What configuration and build command
reproduces this? I do not see how '-mno-loongson-mmi' would fail to get
added to cflags-y after 0e96ea5c3eb5, which should have had no
functional change... I don't want to hang this change up since there is
real breakage but I want to make sure we fully understand why
0e96ea5c3eb5 broke things and why this patch resolves it.

> Fix this by partially reverting to the old logic, use 'call cc-option'
> to conditionally apply -march=loongson3a and -march=mips64r2.
> 
> Fixes: 0e96ea5c3eb5904e5dc2f ("MIPS: Loongson64: Clean up use of cc-ifversion")
> Cc: stable@vger.kernel.org
> Cc: Nathan Chancellor <nathan@kernel.org>
> Cc: Nick Desaulniers <ndesaulniers@google.com>
> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
> ---
>  arch/mips/Makefile | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/arch/mips/Makefile b/arch/mips/Makefile
> index a7a4ee66a9d3..7fb76d12829e 100644
> --- a/arch/mips/Makefile
> +++ b/arch/mips/Makefile
> @@ -186,11 +186,8 @@ cflags-$(CONFIG_CPU_LOONGSON2F) += -march=loongson2f -Wa,--trap
>  # Some -march= flags enable MMI instructions, and GCC complains about that
>  # support being enabled alongside -msoft-float. Thus explicitly disable MMI.
>  cflags-$(CONFIG_CPU_LOONGSON2EF) += $(call cc-option,-mno-loongson-mmi)
> -ifdef CONFIG_CPU_LOONGSON64
>  cflags-$(CONFIG_CPU_LOONGSON64)	+= -Wa,--trap
> -cflags-$(CONFIG_CC_IS_GCC) += -march=loongson3a
> -cflags-$(CONFIG_CC_IS_CLANG) += -march=mips64r2
> -endif
> +cflags-$(CONFIG_CPU_LOONGSON64) += $(call cc-option,-march=loongson3a,-march=mips64r2)
>  cflags-$(CONFIG_CPU_LOONGSON64) += $(call cc-option,-mno-loongson-mmi)
>  
>  cflags-$(CONFIG_CPU_R4000_WORKAROUNDS)	+= $(call cc-option,-mfix-r4000,)
> -- 
> 2.39.3
> 

  reply	other threads:[~2023-06-26 16:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-26  7:50 [PATCH] MIPS: Loongson: Fix build error when make modules_install Huacai Chen
2023-06-26 16:07 ` Nathan Chancellor [this message]
2023-06-27  3:11   ` Huacai Chen
2023-06-27 21:28     ` Nathan Chancellor
2023-06-28  7:36       ` Huacai Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230626160720.GA2174263@dev-arch.thelio-3990X \
    --to=nathan@kernel.org \
    --cc=chenhuacai@kernel.org \
    --cc=chenhuacai@loongson.cn \
    --cc=jiaxun.yang@flygoat.com \
    --cc=linux-mips@vger.kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=stable@vger.kernel.org \
    --cc=tsbogend@alpha.franken.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox