diff mbox series

[3/3] arm: add predefine __ARMEL__ or __ARMEB__

Message ID 20200708215329.56404-4-luc.vanoostenryck@gmail.com (mailing list archive)
State Mainlined, archived
Headers show
Series add the predefines for endianness | expand

Commit Message

Luc Van Oostenryck July 8, 2020, 9:53 p.m. UTC
Depending on the endianness, predefine '__ARMEL__' or '__ARMEB__'.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 target-arm.c | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/target-arm.c b/target-arm.c
index 0d7c6134795f..382bd3decfe1 100644
--- a/target-arm.c
+++ b/target-arm.c
@@ -19,6 +19,11 @@  static void predefine_arm(const struct target *self)
 		predefine("__ARM_PCS", 1, "1");
 		break;
 	}
+
+	if (arch_big_endian)
+		predefine("__ARMEB__", 0, "1");
+	else
+		predefine("__ARMEL__", 0, "1");
 }
 
 const struct target target_arm = {