[systemd-devel] [PATCH] architecture: fix building for big-endian PowerPC with gcc
Lennart Poettering
lennart at poettering.net
Thu Aug 14 17:06:20 PDT 2014
On Fri, 11.07.14 15:04, Michael Olbrich (m.olbrich at pengutronix.de) wrote:
> gcc does not define WORDS_BIGENDIAN for big-endian PowerPC. It defines
> __BIG_ENDIAN__ instead. So also check for __BIG_ENDIAN__ to determine if
> the system is big-endian.
A different patch doing more or less the same has since been applied.
Thanks anyway!
> ---
> src/shared/architecture.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/shared/architecture.h b/src/shared/architecture.h
> index 4821d5d..ba42761 100644
> --- a/src/shared/architecture.h
> +++ b/src/shared/architecture.h
> @@ -80,7 +80,7 @@ Architecture uname_architecture(void);
> # define native_architecture() ARCHITECTURE_X86
> # define LIB_ARCH_TUPLE "i386-linux-gnu"
> #elif defined(__powerpc64__)
> -# if defined(WORDS_BIGENDIAN)
> +# if defined(WORDS_BIGENDIAN) || defined(__BIG_ENDIAN__)
> # define native_architecture() ARCHITECTURE_PPC64
> # define LIB_ARCH_TUPLE "ppc64-linux-gnu"
> # else
> @@ -88,7 +88,7 @@ Architecture uname_architecture(void);
> # error "Missing LIB_ARCH_TUPLE for PPC64LE"
> # endif
> #elif defined(__powerpc__)
> -# if defined(WORDS_BIGENDIAN)
> +# if defined(WORDS_BIGENDIAN) || defined(__BIG_ENDIAN__)
> # define native_architecture() ARCHITECTURE_PPC
> # define LIB_ARCH_TUPLE "powerpc-linux-gnu"
> # else
Lennart
--
Lennart Poettering, Red Hat
More information about the systemd-devel
mailing list