[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1533188391-5932-4-git-send-email-alankao@andestech.com>
Date: Thu, 2 Aug 2018 13:39:50 +0800
From: Alan Kao <alankao@...estech.com>
To: <linux-kernel@...r.kernel.org>, <linux-riscv@...ts.infradead.org>,
"Palmer Dabbelt" <palmer@...ive.com>,
Albert Ou <albert@...ive.com>,
Christoph Hellwig <hch@...radead.org>,
Andrew Waterman <andrew@...ive.com>,
Arnd Bergmann <arnd@...db.de>, Darius Rad <darius@...espec.com>
CC: Alan Kao <alankao@...estech.com>,
Greentime Hu <greentime@...estech.com>,
Vincent Chen <vincentc@...estech.com>,
Zong Li <zong@...estech.com>, Nick Hu <nickhu@...estech.com>
Subject: [PATCH v3 3/4] Cleanup ISA string setting
The reason that we cannot follow the review's suggestion in
https://lkml.org/lkml/2018/6/21/39 is because using "+=" as the
connector in Makefile introduces blanks bewteen the left-hand
side alphabets.
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 <alankao@...estech.com>
Cc: Greentime Hu <greentime@...estech.com>
Cc: Vincent Chen <vincentc@...estech.com>
Cc: Zong Li <zong@...estech.com>
Cc: Nick Hu <nickhu@...estech.com>
---
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
Powered by blists - more mailing lists