Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp7843652ybl; Thu, 16 Jan 2020 06:33:21 -0800 (PST) X-Google-Smtp-Source: APXvYqzmuKRES/+NnFOHspvdEt7SiLxFQpok+LdW8BHfsNWJeT2y22Bogsrx+7+7LO1c+khRohFW X-Received: by 2002:aca:cc87:: with SMTP id c129mr4139285oig.13.1579185201540; Thu, 16 Jan 2020 06:33:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579185201; cv=none; d=google.com; s=arc-20160816; b=ZxacH5MI+b3kkAaprY3ZP7eZe8DLdYt9Y5VqY+ZekuRyHh2LacmrfgIi4Uit51I0Mb ojdSPBJjPou6qr+dTrO74fvRDWL6udKcjLK+HIGW5/y0B9bziokbKJI3ElfPqw473THp h1tk016NCc9RHlfcXrZWVOzRRc31HdAkM2tRDd+mKgNQPYpGj7K5zCPvoRaNWYtdNRut n+beD5SDruBlbv8VpSFZcQSl/I4kBTNN84hhGNfsAWZ/0rb9xOLJsBXv6rLxeTjBqpFf K+D9+/H4HsED2dygCAMhcyqZgVG1nDqd+089v6SkIW1ONtdT0rrQSU6Eh8Op45Bo344o Zo4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=DaPzoMm7KZBMPsZyKZQh0mFlHtyj+i+L8LNb9gY1LbM=; b=VdxVcAw87FKudK16L90NXJDjVYj/k4/i04REFigCNUg6fepmJC+KEAq/dGVAGVgjS6 C2ogObLk3lI+5HS2k0ZHx4BP7+B1ISYlVU9NLlCi98alPLVWOs8Q58uokFFKLISiJ7vE uoJ5VU9D2/+I/YjgaccQs6nbm/83hzxRXCNIwVcla2GJCIYZ005Gan1hSwWybF+AEex2 PTBWp1Ogt0yoDrivy9hX6D6uAkQ9v4Rk7YOhJoTjkS/z4iTW06WJ83A94BDxOw5dcOV/ 11YYXCMDF17CLQVaK0wJ0l3scICIhVqwnFYZdW66bHsxPGr3HXqyTmgH5oFDdDPFWVmX vQ8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QHeMZKre; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s19si13786576otd.9.2020.01.16.06.33.08; Thu, 16 Jan 2020 06:33:21 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=QHeMZKre; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726827AbgAPOa7 (ORCPT + 99 others); Thu, 16 Jan 2020 09:30:59 -0500 Received: from mail.kernel.org ([198.145.29.99]:54824 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726088AbgAPOa7 (ORCPT ); Thu, 16 Jan 2020 09:30:59 -0500 Received: from localhost.localdomain (unknown [223.93.147.148]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C9A742051A; Thu, 16 Jan 2020 14:30:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579185058; bh=YnoMx65waDlqCAWBp+HLYyjnIwPrVPKKVblM5KJe+Og=; h=From:To:Cc:Subject:Date:From; b=QHeMZKrecedwDEUTE0C+T0YhnJRr1m/SU4lsRwIy0nw9A8DavtqtVig1FIjwbbQXy GMICkkhgHeh8sAfdi4yn4exsOghSx1N8AZRtlw4oeaJBldcoVojVVrp1/CX2hGrtrT /eSJEBmLESxQ5Wx7HGK0I8q5YuQk6DFMzQ1uAfQ0= From: guoren@kernel.org To: paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, Anup.Patel@wdc.com, vincent.chen@sifive.com, zong.li@sifive.com, greentime.hu@sifive.com, bmeng.cn@gmail.com, atish.patra@wdc.com, schwab@linux-m68k.org Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, arnd@arndb.de, linux-csky@vger.kernel.org, linux-riscv@lists.infradead.org, Guo Ren Subject: [PATCH V2 1/4] riscv: Separate patch for cflags and aflags Date: Thu, 16 Jan 2020 22:30:26 +0800 Message-Id: <20200116143029.31441-1-guoren@kernel.org> X-Mailer: git-send-email 2.17.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Guo Ren Use "subst fd" in Makefile is a hack way and it's not convenient to add new ISA feature. Just separate them into riscv-march-cflags and riscv-march-aflags. Signed-off-by: Guo Ren Cc: Anup Patel --- arch/riscv/Makefile | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile index b9009a2fbaf5..6d09b53cf106 100644 --- a/arch/riscv/Makefile +++ b/arch/riscv/Makefile @@ -35,12 +35,18 @@ else endif # ISA string setting -riscv-march-$(CONFIG_ARCH_RV32I) := rv32ima -riscv-march-$(CONFIG_ARCH_RV64I) := rv64ima -riscv-march-$(CONFIG_FPU) := $(riscv-march-y)fd -riscv-march-$(CONFIG_RISCV_ISA_C) := $(riscv-march-y)c -KBUILD_CFLAGS += -march=$(subst fd,,$(riscv-march-y)) -KBUILD_AFLAGS += -march=$(riscv-march-y) +riscv-march-cflags-$(CONFIG_ARCH_RV32I) := rv32ima +riscv-march-cflags-$(CONFIG_ARCH_RV64I) := rv64ima +riscv-march-$(CONFIG_FPU) := $(riscv-march-y)fd +riscv-march-cflags-$(CONFIG_RISCV_ISA_C) := $(riscv-march-cflags-y)c + +riscv-march-aflags-$(CONFIG_ARCH_RV32I) := rv32ima +riscv-march-aflags-$(CONFIG_ARCH_RV64I) := rv64ima +riscv-march-aflags-$(CONFIG_FPU) := $(riscv-march-aflags-y)fd +riscv-march-aflags-$(CONFIG_RISCV_ISA_C) := $(riscv-march-aflags-y)c + +KBUILD_CFLAGS += -march=$(riscv-march-cflags-y) +KBUILD_AFLAGS += -march=$(riscv-march-aflags-y) KBUILD_CFLAGS += -mno-save-restore KBUILD_CFLAGS += -DCONFIG_PAGE_OFFSET=$(CONFIG_PAGE_OFFSET) -- 2.17.0