[v2,3/5] RISC-V: Update soft-fp config for big-endian

Message ID 20210221000903.32039-4-marcus@mc.pp.se
State Superseded
Headers show
Series
  • RISC-V big endian support
Related show

Commit Message

Marcus Comstedt Feb. 21, 2021, 12:09 a.m.
libgcc/
	* config/riscv/sfp-machine.h (__BYTE_ORDER): Set according
	to __BYTE_ORDER__.
---
 libgcc/config/riscv/sfp-machine.h | 4 ++++
 1 file changed, 4 insertions(+)

-- 
2.26.2

Patch

diff --git a/libgcc/config/riscv/sfp-machine.h b/libgcc/config/riscv/sfp-machine.h
index db2697157ce..8adbf4b8b2e 100644
--- a/libgcc/config/riscv/sfp-machine.h
+++ b/libgcc/config/riscv/sfp-machine.h
@@ -128,7 +128,11 @@  do {								\
 #define	__LITTLE_ENDIAN	1234
 #define	__BIG_ENDIAN	4321
 
+#if defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
+#define __BYTE_ORDER __BIG_ENDIAN
+#else
 #define __BYTE_ORDER __LITTLE_ENDIAN
+#endif
 
 
 /* Define ALIASNAME as a strong alias for NAME.  */