diff options
author | Antony Pavlov <antonynpavlov@gmail.com> | 2020-08-05 10:32:58 +0300 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2020-08-10 08:35:26 +0200 |
commit | ef297889c26468094ee4707cc92f92b577254618 (patch) | |
tree | 0d534f3a4c202b77bbd9c4ea05352698c5d76c6a | |
parent | 5211e428cbab9c9e45a905582e8fe5c30aef658c (diff) | |
download | barebox-ef297889c26468094ee4707cc92f92b577254618.tar.gz barebox-ef297889c26468094ee4707cc92f92b577254618.tar.xz |
riscv: Makefile: make it possible to use riscv64 compiler
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>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | arch/riscv/Makefile | 5 |
1 files changed, 4 insertions, 1 deletions
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) |