Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1673223imm; Wed, 8 Aug 2018 23:28:25 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxOQksDQLLs+eJzstEi0oksCnevr7nrNG24AaPm3K0KW7yNzcTMZ89BBH3clhYbQMfW3HVe X-Received: by 2002:a63:ed07:: with SMTP id d7-v6mr817213pgi.429.1533796105328; Wed, 08 Aug 2018 23:28:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533796105; cv=none; d=google.com; s=arc-20160816; b=czozDkWH3cJr4fMCGWvigmNwiPyrxMAUtech9zfn0u6Jtk/O7p8l42s6siJoa3I+Sw 09KM0uBEM+d2fbQ1Q5TNfm5qyipNve4YI0Yxo/+vdLYgL1Px4dY7GX5SubUP7ChAPNt3 Eh8JIpftG9YbOt+Uy7lv0k8vFrOUoVETci9GzI/jbsRezaPh/fDDycc0m+cZl7Pczti4 mboHSON1xAeuxO6QW78ewpzU8g8D/f+YGxoq7BYP4kqmuj/OOzBK/XWn5fsGOoVsAqwY SqrVszfVl8IOhckkWDKwaUXiTggNhnM6Q868K1PHEkucxlnnapLpyVMvDkzaT+z8rVnQ N79g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=RQyOJizjeA9T5ktoRUlQJgdHTx8+bT8AUwBqx/4Nh7A=; b=pHCb0zCPGYC2s3dxlocouJcenPZINuTaxDwePsOTryImXOawsMuBNolkiB7oRnVHQC lqt++NgRg2kc0b8GRLWvzIKH/lnZnsptfBr52R5KcQR/VuESUdjb3xuP8DGBPuMSMYXc A+7RgFdppIMI48V2yRvKCSJak41vcItBu7fHQ4OSMlAr/53xJlpq8LaFue2fj/b7lhhu flxYhqLxbQZhHYsZslgUiT9aRUfc//zeV8uSRNaJFnY+gFxNcLncC0kIQvgmx3jNQv7T CIpL+203Ii0U74s97JihmdL2JBdX3VUnWO19jmdTRrOXExtvvlu6WZunye9KnkrDzo/u 5c6A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z137-v6si5269419pgz.144.2018.08.08.23.28.10; Wed, 08 Aug 2018 23:28:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728267AbeHIIuc (ORCPT + 99 others); Thu, 9 Aug 2018 04:50:32 -0400 Received: from exmail.andestech.com ([59.124.169.137]:59458 "EHLO ATCSQR.andestech.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728175AbeHIIuc (ORCPT ); Thu, 9 Aug 2018 04:50:32 -0400 Received: from mail.andestech.com (atcpcs16.andestech.com [10.0.1.222]) by ATCSQR.andestech.com with ESMTP id w796QAo2087879; Thu, 9 Aug 2018 14:26:10 +0800 (GMT-8) (envelope-from alankao@andestech.com) Received: from atcsqa06.andestech.com (10.0.1.85) by ATCPCS16.andestech.com (10.0.1.222) with Microsoft SMTP Server id 14.3.123.3; Thu, 9 Aug 2018 14:27:04 +0800 From: Alan Kao To: , , "Palmer Dabbelt" , Albert Ou , Christoph Hellwig , Andrew Waterman , Arnd Bergmann , Darius Rad CC: , , , , Alan Kao Subject: [PATCH v5 3/5] Cleanup ISA string setting Date: Thu, 9 Aug 2018 14:26:41 +0800 Message-ID: <1533796003-680-4-git-send-email-alankao@andestech.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1533796003-680-1-git-send-email-alankao@andestech.com> References: <1533796003-680-1-git-send-email-alankao@andestech.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.0.1.85] X-DNSRBL: X-MAIL: ATCSQR.andestech.com w796QAo2087879 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Just a side note: (Assume that atomic and compressed is on) Before this patch, assembler was always given the riscv64imafdc MARCH string because there are fld/fsd's in entry.S; compiler was always given riscv64imac because kernel doesn't need floating point code generation. After this, the MARCH string in AFLAGS and CFLAGS become the same. Signed-off-by: Alan Kao Cc: Greentime Hu Cc: Vincent Chen Cc: Zong Li Cc: Nick Hu Reviewed-by: Christoph Hellwig --- arch/riscv/Makefile | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile index 6d4a5f6c3f4f..e0fe6790624f 100644 --- a/arch/riscv/Makefile +++ b/arch/riscv/Makefile @@ -26,7 +26,6 @@ ifeq ($(CONFIG_ARCH_RV64I),y) KBUILD_CFLAGS += -mabi=lp64 KBUILD_AFLAGS += -mabi=lp64 - KBUILD_MARCH = rv64im LDFLAGS += -melf64lriscv else BITS := 32 @@ -34,22 +33,20 @@ else KBUILD_CFLAGS += -mabi=ilp32 KBUILD_AFLAGS += -mabi=ilp32 - KBUILD_MARCH = rv32im LDFLAGS += -melf32lriscv endif KBUILD_CFLAGS += -Wall -ifeq ($(CONFIG_RISCV_ISA_A),y) - KBUILD_ARCH_A = a -endif -ifeq ($(CONFIG_RISCV_ISA_C),y) - KBUILD_ARCH_C = c -endif - -KBUILD_AFLAGS += -march=$(KBUILD_MARCH)$(KBUILD_ARCH_A)fd$(KBUILD_ARCH_C) +# ISA string setting +riscv-march-$(CONFIG_ARCH_RV32I) := rv32im +riscv-march-$(CONFIG_ARCH_RV64I) := rv64im +riscv-march-$(CONFIG_RISCV_ISA_A) := $(riscv-march-y)a +riscv-march-y := $(riscv-march-y)fd +riscv-march-$(CONFIG_RISCV_ISA_C) := $(riscv-march-y)c +KBUILD_CFLAGS += -march=$(riscv-march-y) +KBUILD_AFLAGS += -march=$(riscv-march-y) -KBUILD_CFLAGS += -march=$(KBUILD_MARCH)$(KBUILD_ARCH_A)$(KBUILD_ARCH_C) KBUILD_CFLAGS += -mno-save-restore KBUILD_CFLAGS += -DCONFIG_PAGE_OFFSET=$(CONFIG_PAGE_OFFSET) -- 2.18.0