mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Antony Pavlov <antonynpavlov@gmail.com>
To: barebox@lists.infradead.org
Cc: Masahiro Yamada <masahiroy@kernel.org>
Subject: [PATCH] riscv: Makefile: make it possible to use riscv64 compiler
Date: Wed,  5 Aug 2020 10:32:58 +0300	[thread overview]
Message-ID: <20200805073258.10973-2-antonynpavlov@gmail.com> (raw)
In-Reply-To: <20200805073258.10973-1-antonynpavlov@gmail.com>

At the moment riscv64 toolchain can't be used to build
barebox for riscv32, e.g.

  barebox$ make erizo_generic_defconfig
  ...
  barebox$ make
  ...
  riscv64-zephyr-elf-ld:
  common/memory.o: ABI is incompatible with that of the selected
  emulation:
    target emulation `elf32-littleriscv' does not match `elf64-littleriscv'

The patch fixes the problem by explicit riscv32 target options selection.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Cc: Masahiro Yamada <masahiroy@kernel.org>
---
 arch/riscv/Makefile | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile
index c71319507c..8cd5f51e30 100644
--- a/arch/riscv/Makefile
+++ b/arch/riscv/Makefile
@@ -3,7 +3,8 @@ KBUILD_DEFCONFIG := erizo_generic_defconfig
 KBUILD_CPPFLAGS += -fno-strict-aliasing
 
 ifeq ($(CONFIG_ARCH_RV32I),y)
-	cflags-y += -march=rv32im
+	cflags-y += -march=rv32im -mabi=ilp32
+	riscv-ldflags-y += -melf32lriscv
 endif
 
 cflags-y += -fno-pic -pipe
@@ -14,6 +15,8 @@ LDFLAGS_barebox += -nostdlib
 
 machine-$(CONFIG_MACH_ERIZO)	:= erizo
 
+LDFLAGS_barebox += $(riscv-ldflags-y)
+
 TEXT_BASE = $(CONFIG_TEXT_BASE)
 KBUILD_CPPFLAGS += -DTEXT_BASE=$(CONFIG_TEXT_BASE)
 
-- 
2.27.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2020-08-05  7:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-05  7:32 [PATCH] image: Convert the IH_... values to enums Antony Pavlov
2020-08-05  7:32 ` Antony Pavlov [this message]
2020-08-10  6:36 ` 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=20200805073258.10973-2-antonynpavlov@gmail.com \
    --to=antonynpavlov@gmail.com \
    --cc=barebox@lists.infradead.org \
    --cc=masahiroy@kernel.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