blob: 0bf1bef2c99c664a90f87867fcdacef1e34e6c8e [file] [log] [blame]
Andrew Geissler95ac1b82021-03-31 14:34:31 -05001From 66dfe0fa886f6289add06d1af8642ce2b5302852 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 9 Feb 2021 16:40:12 -0800
4Subject: [PATCH] riscv32: Use double-float ABI for rv32
5
6So it can use libgcc built with OE toolchain
7Fixes
8error: "can't link hard-float modules with soft-float modules"
9
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11Upstream-Status: Inappropriate [embedded specific]
12---
13 arch/riscv/Makefile | 6 ++++--
14 1 file changed, 4 insertions(+), 2 deletions(-)
15
Andrew Geissler95ac1b82021-03-31 14:34:31 -050016--- a/arch/riscv/Makefile
17+++ b/arch/riscv/Makefile
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000018@@ -5,11 +5,15 @@
19
20 ifeq ($(CONFIG_ARCH_RV64I),y)
21 ARCH_BASE = rv64im
22- ABI = lp64
23+ ABI = lp64d
24+ ARCH_D = d
25+ ARCH_F = f
Andrew Geissler95ac1b82021-03-31 14:34:31 -050026 endif
27 ifeq ($(CONFIG_ARCH_RV32I),y)
28 ARCH_BASE = rv32im
29- ABI = ilp32
30+ ABI = ilp32d
31+ ARCH_D = d
32+ ARCH_F = f
33 endif
34 ifeq ($(CONFIG_RISCV_ISA_A),y)
35 ARCH_A = a
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000036@@ -24,7 +28,7 @@ ifeq ($(CONFIG_CMODEL_MEDANY),y)
Andrew Geissler95ac1b82021-03-31 14:34:31 -050037 CMODEL = medany
38 endif
39
40-ARCH_FLAGS = -march=$(ARCH_BASE)$(ARCH_A)$(ARCH_C) -mabi=$(ABI) \
41+ARCH_FLAGS = -march=$(ARCH_BASE)$(ARCH_A)$(ARCH_F)$(ARCH_D)$(ARCH_C) -mabi=$(ABI) \
42 -mcmodel=$(CMODEL)
43
44 PLATFORM_CPPFLAGS += $(ARCH_FLAGS)