mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Marco Felsch <m.felsch@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 2/3] RISC-V: Makefile: align the isa string setting with the kernel
Date: Thu,  2 Feb 2023 14:26:11 +0100	[thread overview]
Message-ID: <20230202132612.691206-2-m.felsch@pengutronix.de> (raw)
In-Reply-To: <20230202132612.691206-1-m.felsch@pengutronix.de>

Factor out the isa string setting. This is in preparation of adding
support for binutils-2.38 [1] furthermore it aligns the makefile with the
kernel. The commit is based on kernel commit:

  | commit e8be5302330281bd9f77834600f63e8cc4560d3d
  | Author: Alan Kao <alankao@andestech.com>
  | Date:   Tue Oct 9 10:18:32 2018 +0800
  |
  |     Cleanup ISA string setting
  |
  |     This patch cleanup the MARCH string passing to both compiler and
  |     assembler.  Note that the CFLAGS should not contain "fd" before we
  |     have mechnisms like kernel_fpu_begin/end in other architectures.
  |
  |     Signed-off-by: Alan Kao <alankao@andestech.com>
  |     Cc: Greentime Hu <greentime@andestech.com>
  |     Cc: Vincent Chen <vincentc@andestech.com>
  |     Cc: Zong Li <zong@andestech.com>
  |     Cc: Nick Hu <nickhu@andestech.com>
  |     Signed-off-by: Palmer Dabbelt <palmer@sifive.com>

[1] https://lore.kernel.org/linux-riscv/20221015111856.3869148-1-conor@kernel.org/

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
---
 arch/riscv/Makefile | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile
index b4cf5983a2..d1b689b493 100644
--- a/arch/riscv/Makefile
+++ b/arch/riscv/Makefile
@@ -5,15 +5,19 @@ KBUILD_DEFCONFIG := rv64i_defconfig
 KBUILD_CPPFLAGS += -fno-strict-aliasing
 
 ifeq ($(CONFIG_ARCH_RV32I),y)
-	KBUILD_CPPFLAGS += -march=rv32im -mabi=ilp32
+	KBUILD_CPPFLAGS += -mabi=ilp32
 	riscv-ldflags-y += -melf32lriscv
 else
-	KBUILD_CPPFLAGS += -march=rv64im -mabi=lp64
+	KBUILD_CPPFLAGS += -mabi=lp64
 	riscv-ldflags-y += -melf64lriscv
 endif
 
+# ISA string setting
+riscv-march-$(CONFIG_ARCH_RV32I)	:= rv32im
+riscv-march-$(CONFIG_ARCH_RV64I)	:= rv64im
 
 
+KBUILD_CPPFLAGS += -march=$(riscv-march-y)
 KBUILD_CPPFLAGS += -Wstrict-prototypes -mcmodel=medany -fpic
 riscv-ldflags-y += -pie -static
 
-- 
2.39.1




  reply	other threads:[~2023-02-02 13:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-02 13:26 [PATCH 1/3] RISC-V: Makefile: cleanup layout Marco Felsch
2023-02-02 13:26 ` Marco Felsch [this message]
2023-02-02 13:26 ` [PATCH 3/3] RISC-V: Makefile: fix build with binutils 2.38 Marco Felsch
2023-02-03  8:04 ` [PATCH 1/3] RISC-V: Makefile: cleanup layout Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230202132612.691206-2-m.felsch@pengutronix.de \
    --to=m.felsch@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox