From 9f80fcd74e1b5d438c7b4459c93ba98943af884c Mon Sep 17 00:00:00 2001 From: Fernando Seiti Furusato Date: Mon, 26 Mar 2018 12:26:10 +0000 Subject: [PATCH] Corrected endianness detection on ppc64el. In common/arch.h, the endianness detection considers all powerpc architectures as big endian. Since that is not true for ppc64el, I added a verification that checks other preprocessor macros, only for ppc cases. Signed-off-by: Fernando Seiti Furusato --- common/arch.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/common/arch.h b/common/arch.h index ce3137a7..ccccfa5a 100644 --- a/common/arch.h +++ b/common/arch.h @@ -63,8 +63,10 @@ typedef int bool_t; #endif #if !(defined(L_ENDIAN) || defined(B_ENDIAN)) -#if defined(__sparc__) || defined(__PPC__) || defined(__ppc__) || \ - defined(__hppa__) +#if defined(__sparc__) || \ + defined(__hppa__) || \ + (defined(__PPC__) && defined(__BIG_ENDIAN__)) || \ + (defined(__ppc__) && defined(__BIG_ENDIAN__)) #define B_ENDIAN #else #define L_ENDIAN @@ -75,8 +77,10 @@ typedef int bool_t; /* check if we need to align data */ #if !(defined(NEED_ALIGN) || defined(NO_NEED_ALIGN)) #if defined(__sparc__) || defined(__alpha__) || defined(__hppa__) || \ - defined(__AIX__) || defined(__PPC__) || defined(__mips__) || \ - defined(__ia64__) || defined(__ppc__) || defined(__arm__) + defined(__AIX__) || defined(__mips__) || \ + defined(__ia64__) || defined(__arm__) || \ + (defined(__PPC__) && defined(__BIG_ENDIAN__)) || \ + (defined(__ppc__) && defined(__BIG_ENDIAN__)) #define NEED_ALIGN #elif defined(__x86__) || defined(__x86_64__) || \ defined(__AMD64__) || defined(_M_IX86) || defined (_M_AMD64) || \