From nobody Mon Sep 8 09:01:27 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1BB7BEB64DA for ; Tue, 18 Jul 2023 14:37:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232797AbjGROhh (ORCPT ); Tue, 18 Jul 2023 10:37:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232884AbjGROhb (ORCPT ); Tue, 18 Jul 2023 10:37:31 -0400 Received: from angie.orcam.me.uk (angie.orcam.me.uk [78.133.224.34]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 928D6EC; Tue, 18 Jul 2023 07:37:28 -0700 (PDT) Received: by angie.orcam.me.uk (Postfix, from userid 500) id CE56592009D; Tue, 18 Jul 2023 16:37:27 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id CB4C492009C; Tue, 18 Jul 2023 15:37:27 +0100 (BST) Date: Tue, 18 Jul 2023 15:37:27 +0100 (BST) From: "Maciej W. Rozycki" To: Thomas Bogendoerfer cc: Jan-Benedict Glaw , Guillaume Tucker , Huacai Chen , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] Revert MIPS: Loongson: Fix build error when make modules_install In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Revert commit 531b3d1195d0 ("MIPS: Loongson: Fix build error when make=20 modules_install"), which made `-march=3Dloongson2e', `-march=3Dloongson2f',=20 and `-march=3Dloongson3a' compilation options probed for even though GCC=20 has supported them since 4.4.0, 4.4.0, and 4.6.0 respectively, which is=20 below our current minimum requirement of 5.1, in an attempt to work=20 around for the `cc-option' `make' function being undefined with `make'=20 targets that do not use the compiler. The workaround has now been made=20 obsolete, by querying the `need-compiler' variable instead so as to make=20 sure the compiler isn't called for non-build targets. Verified with `fuloong2e_defconfig' and the `modules_install' target. Signed-off-by: Maciej W. Rozycki --- arch/mips/Makefile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) Index: linux-macro/arch/mips/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- linux-macro.orig/arch/mips/Makefile +++ linux-macro/arch/mips/Makefile @@ -181,12 +181,16 @@ endif cflags-$(CONFIG_CAVIUM_CN63XXP1) +=3D -Wa,-mfix-cn63xxp1 cflags-$(CONFIG_CPU_BMIPS) +=3D -march=3Dmips32 -Wa,-mips32 -Wa,--trap =20 -cflags-$(CONFIG_CPU_LOONGSON2E) +=3D $(call cc-option,-march=3Dloongson2e)= -Wa,--trap -cflags-$(CONFIG_CPU_LOONGSON2F) +=3D $(call cc-option,-march=3Dloongson2f)= -Wa,--trap -cflags-$(CONFIG_CPU_LOONGSON64) +=3D $(call cc-option,-march=3Dloongson3a,= -march=3Dmips64r2) -Wa,--trap +cflags-$(CONFIG_CPU_LOONGSON2E) +=3D -march=3Dloongson2e -Wa,--trap +cflags-$(CONFIG_CPU_LOONGSON2F) +=3D -march=3Dloongson2f -Wa,--trap # Some -march=3D flags enable MMI instructions, and GCC complains about th= at # support being enabled alongside -msoft-float. Thus explicitly disable MM= I. cflags-$(CONFIG_CPU_LOONGSON2EF) +=3D $(call cc-option,-mno-loongson-mmi) +ifdef CONFIG_CPU_LOONGSON64 +cflags-$(CONFIG_CPU_LOONGSON64) +=3D -Wa,--trap +cflags-$(CONFIG_CC_IS_GCC) +=3D -march=3Dloongson3a +cflags-$(CONFIG_CC_IS_CLANG) +=3D -march=3Dmips64r2 +endif cflags-$(CONFIG_CPU_LOONGSON64) +=3D $(call cc-option,-mno-loongson-mmi) =20 cflags-$(CONFIG_CPU_R4000_WORKAROUNDS) +=3D $(call cc-option,-mfix-r4000,)