mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-07-22 18:55:29 +03:00
Use the generic gcc/clang/suncc __BYTE_ORDER__ macro to detect platform byte order instead of hard-coded architecture detection which is wrong for ppc64le (always assumes POWER is big-endian) and lacks any knowledge of mips*. This change covers s390x too so remove s390x-support.patch.
34 lines
1.1 KiB
Diff
34 lines
1.1 KiB
Diff
--- a/common/dynamips_common.h
|
|
+++ b/common/dynamips_common.h
|
|
@@ -50,21 +50,17 @@
|
|
#define ARCH_BIG_ENDIAN 0x4321
|
|
#define ARCH_LITTLE_ENDIAN 0x1234
|
|
|
|
-#if defined(PPC) || defined(__powerpc__) || defined(__ppc__)
|
|
-#define ARCH_BYTE_ORDER ARCH_BIG_ENDIAN
|
|
-#elif defined(__sparc) || defined(__sparc__)
|
|
-#define ARCH_BYTE_ORDER ARCH_BIG_ENDIAN
|
|
-#elif defined(__alpha) || defined(__alpha__)
|
|
-#define ARCH_BYTE_ORDER ARCH_LITTLE_ENDIAN
|
|
-#elif defined(__i386) || defined(__i386__) || defined(i386)
|
|
-#define ARCH_BYTE_ORDER ARCH_LITTLE_ENDIAN
|
|
+
|
|
+#ifdef __BYTE_ORDER__
|
|
+#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
|
|
+#define ARCH_BYTE_ORDER ARCH_BIG_ENDIAN
|
|
+#else
|
|
+#define ARCH_BYTE_ORDER ARCH_LITTLE_ENDIAN
|
|
+#endif
|
|
+#endif
|
|
+
|
|
+#if defined(__i386) || defined(__i386__) || defined(i386)
|
|
#define ARCH_REGPARM_SUPPORTED 1
|
|
-#elif defined(__x86_64__)
|
|
-#define ARCH_BYTE_ORDER ARCH_LITTLE_ENDIAN
|
|
-#elif defined(__ia64__)
|
|
-#define ARCH_BYTE_ORDER ARCH_LITTLE_ENDIAN
|
|
-#elif defined(__arm__) || defined (__aarch64__)
|
|
-#define ARCH_BYTE_ORDER ARCH_LITTLE_ENDIAN
|
|
#endif
|
|
|
|
#ifndef ARCH_BYTE_ORDER
|