Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp5031115pxb; Wed, 26 Jan 2022 03:22:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJznAQFo07cHo5VFT/FQ5SWfeJdVmQ3uocjOkUxmStAseVArwtCp23LOdJ1EE21YEOBATU6r X-Received: by 2002:a17:902:ed85:b0:14a:2471:e11d with SMTP id e5-20020a170902ed8500b0014a2471e11dmr22194741plj.77.1643196165272; Wed, 26 Jan 2022 03:22:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643196165; cv=none; d=google.com; s=arc-20160816; b=TOEVL53xIaoFi5tzRqKiUYreIEeLSz6KQhwB8ztU+qCLD8Zc8NjxTfawNMTP380Fmv iUE83V5d5KT+dFJ31OBBTyZTW4SBRj6rc/VUuWytqAvRlgHXO405Yyh8RzqD5GeKVAm4 slZnZR7meUb5r/lwynfIkwEtOr3hKE8Zer4of+83mjpXT7txpjtEjO+pGPV/Ikh2k6bC QxKPJUwrV/QuOgrsk7UgAx6pbcYvxEO/9BftcNibZCPFK0lLR3XYl1AxcD93y3o56kQi hj981I8pqSsljd91xD31+MLaooafo+HQQgS/gBlDht1gHQ/Wp6xaOQWurjqdbc987ee7 iHjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=RUdsBeKUScGfr8DGH5ZprDvL4WgbQSwIAmoh0IL6Xds=; b=cjFf8uPAYkKM6Eb0sJY4CqCJ8NjGadkAGNursxU/UXf+uHSNneKbHWIGBMixUghIvS uJGiDwPCzukxWHmLwqoin2iaLF+pbt5tfSTnn8pzLpsjs/9R3OYy57ixJlsiRlAZeCVV bpONiGRO1eWJadzSUxmVR3veKDERINbp6ZGPMutJVnEyhNtY2Mjw/FhvQ9CMFVKhMfln 9KnjxOjphZi/wNjZTiFR2yur+GvGOn4L7Ta09+YVm+KUynbPHo/PPEp5/LgJq0dI1uNK tBLcbUfxxQlajYlquuEbV5TGMref86wDne3FKfYYC5+Jsau0zNIdG0t2sOsqHUnXqDrx d6eQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=i2k5WHPu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x38si1461858pfh.310.2022.01.26.03.22.33; Wed, 26 Jan 2022 03:22:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=i2k5WHPu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233704AbiAYWT4 (ORCPT + 99 others); Tue, 25 Jan 2022 17:19:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233734AbiAYWTt (ORCPT ); Tue, 25 Jan 2022 17:19:49 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F2E9C06173B; Tue, 25 Jan 2022 14:19:49 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 4A815B81062; Tue, 25 Jan 2022 22:19:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 58C45C340E6; Tue, 25 Jan 2022 22:19:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643149186; bh=w68DEAUNHKhXspFgbyIygYSBDiRFMAt8ZTY71GPUW64=; h=From:To:Cc:Subject:Date:From; b=i2k5WHPuCnb/+W2eJT5mSdz9jfaw7bGg8R9bMvi46PioHZzHElsnND6ZLbgW++2w+ kOLFA0mHtuE1h4NpnDtGG9yNXaYQnjEu/tJ9EHOUWRntSIo+L4PCeCcMdb0Rx8l38/ 5b/wdPmvGnWpYnVrivtYtAb9kWgNZf4IXVOO1Bwjs6ItwEjqL1uztO6cnwZPwkjEl9 gJFrdEOmD/RGXBE6CP1DM1JOQBCsBSaoggpVcFx9fmt40NM3W1G5f/nUfXKolNXrNY KWhuF99bvR322V3BcrcG5kRq+KQ1VyWywbaSK+BVjzxJ68gw7VfU6ZfJRV34SuG1s5 EhuZ08AGqkoJg== From: Nathan Chancellor To: Huacai Chen , Jiaxun Yang , Thomas Bogendoerfer Cc: Nick Desaulniers , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, Nathan Chancellor Subject: [PATCH v2 1/2] MIPS: Loongson64: Clean up use of cc-ifversion Date: Tue, 25 Jan 2022 15:19:24 -0700 Message-Id: <20220125221925.3547683-1-nathan@kernel.org> X-Mailer: git-send-email 2.35.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This Makefile checks that GCC is 4.9 or newer, which is redundant after commit 76ae847497bc ("Documentation: raise minimum supported version of GCC to 5.1"), so cc-option can be removed. Clang does not support -march=loongson3a so it needs to continue to use -march=mips64r2, which no longer needs cc-option because all supported clang versions recognize this flag. -march=loonson3a can be used unconditionally with GCC because the minimum supported GCC version has been bumped past 4.9.0, which won't have the bug mentioned in the comment. The _MIPS_ISA macro redefinition can be removed at the same time for the same reason. Suggested-by: Jiaxun Yang Suggested-by: Nick Desaulniers Signed-off-by: Nathan Chancellor --- v1 -> v2: https://lore.kernel.org/r/20220120214001.1879469-1-nathan@kernel.org/ * Eliminate ld-option call (Jiaxun). * Eliminate _MIPS_ISA macro redefinitions (Nick). arch/mips/loongson64/Platform | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/arch/mips/loongson64/Platform b/arch/mips/loongson64/Platform index 3e660d6d3c2b..f2a08a185ee2 100644 --- a/arch/mips/loongson64/Platform +++ b/arch/mips/loongson64/Platform @@ -5,24 +5,9 @@ cflags-$(CONFIG_CPU_LOONGSON64) += -Wa,--trap -# -# binutils from v2.25 on and gcc starting from v4.9.0 treat -march=loongson3a -# as MIPS64 R2; older versions as just R1. This leaves the possibility open -# that GCC might generate R2 code for -march=loongson3a which then is rejected -# by GAS. The cc-option can't probe for this behaviour so -march=loongson3a -# can't easily be used safely within the kbuild framework. -# -ifeq ($(call cc-ifversion, -ge, 0409, y), y) - ifeq ($(call ld-ifversion, -ge, 22500, y), y) - cflags-$(CONFIG_CPU_LOONGSON64) += \ - $(call cc-option,-march=loongson3a -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS64) - else - cflags-$(CONFIG_CPU_LOONGSON64) += \ - $(call cc-option,-march=mips64r2,-mips64r2 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS64) - endif -else - cflags-$(CONFIG_CPU_LOONGSON64) += \ - $(call cc-option,-march=mips64r2,-mips64r2 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS64) +ifdef CONFIG_CPU_LOONGSON64 +cflags-$(CONFIG_CC_IS_GCC) += -march=loongson3a +cflags-$(CONFIG_CC_IS_CLANG) += -march=mips64r2 endif # Some -march= flags enable MMI instructions, and GCC complains about that base-commit: e783362eb54cd99b2cac8b3a9aeac942e6f6ac07 -- 2.35.0