Re: [systemd-devel] [PATCH] architecture: fix building for big-endian PowerPC with gcc

2014-08-14 Thread Lennart Poettering
On Fri, 11.07.14 15:04, Michael Olbrich (m.olbr...@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
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH] architecture: fix building for big-endian PowerPC with gcc

2014-07-11 Thread Michael Olbrich
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.
---
 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
-- 
2.0.1

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] architecture: fix building for big-endian PowerPC with gcc

2014-07-11 Thread Lennart Poettering
On Fri, 11.07.14 15:04, Michael Olbrich (m.olbr...@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.

Hmm, the sources currently use three different ways to detect endianess:

1) WORDS_BIGENDIAN (which appears to be an autoconf thing actually,
   enabled via AC_C_BIGENDIAN, which we never call currently)
2) __BTYE_ORDER == __BIG_ENDIAN which appears to be be defined in
   endian.h always by glibc
3) __BIG_ENDIAN__ appears to be quite common too? gcc thing?

Also this:

http://sourceforge.net/p/predef/wiki/Endianness/

We should probably stick to one of these things. Probably #2 or #3...

I can't find any normative documentation about these things. Given that
the #2 is at least unconditional part of glibc, I'd say to convert
everything to that. Would that work for you on ppc-be too?

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] architecture: fix building for big-endian PowerPC with gcc

2014-07-11 Thread Dan Horák
On Fri, 11 Jul 2014 15:27:56 +0200
Lennart Poettering lenn...@poettering.net wrote:

 On Fri, 11.07.14 15:04, Michael Olbrich (m.olbr...@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.
 
 Hmm, the sources currently use three different ways to detect
 endianess:
 
 1) WORDS_BIGENDIAN (which appears to be an autoconf thing actually,
enabled via AC_C_BIGENDIAN, which we never call currently)
 2) __BTYE_ORDER == __BIG_ENDIAN which appears to be be defined in
endian.h always by glibc
 3) __BIG_ENDIAN__ appears to be quite common too? gcc thing?
 
 Also this:
 
 http://sourceforge.net/p/predef/wiki/Endianness/
 
 We should probably stick to one of these things. Probably #2 or #3...
 
 I can't find any normative documentation about these things. Given
 that the #2 is at least unconditional part of glibc, I'd say to
 convert everything to that. Would that work for you on ppc-be too?

Jakub explained us endianity checks with GCC in
https://bugzilla.redhat.com/show_bug.cgi?id=962091#c48


Dan
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] architecture: fix building for big-endian PowerPC with gcc

2014-07-11 Thread Lennart Poettering
On Fri, 11.07.14 15:43, Dan Horák (d...@danny.cz) wrote:

  Hmm, the sources currently use three different ways to detect
  endianess:
  
  1) WORDS_BIGENDIAN (which appears to be an autoconf thing actually,
 enabled via AC_C_BIGENDIAN, which we never call currently)
  2) __BTYE_ORDER == __BIG_ENDIAN which appears to be be defined in
 endian.h always by glibc
  3) __BIG_ENDIAN__ appears to be quite common too? gcc thing?
  
  Also this:
  
  http://sourceforge.net/p/predef/wiki/Endianness/
  
  We should probably stick to one of these things. Probably #2 or #3...
  
  I can't find any normative documentation about these things. Given
  that the #2 is at least unconditional part of glibc, I'd say to
  convert everything to that. Would that work for you on ppc-be too?
 
 Jakub explained us endianity checks with GCC in
 https://bugzilla.redhat.com/show_bug.cgi?id=962091#c48

Apparently #2 is and OK check according to that.

I have now changed git to use that for all its checks. Michael, check if
this now makes things work for you correctly.

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] architecture: fix building for big-endian PowerPC with gcc

2014-07-11 Thread Michael Olbrich
On Fri, Jul 11, 2014 at 03:27:56PM +0200, Lennart Poettering wrote:
 On Fri, 11.07.14 15:04, Michael Olbrich (m.olbr...@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.
 
 Hmm, the sources currently use three different ways to detect endianess:
 
 1) WORDS_BIGENDIAN (which appears to be an autoconf thing actually,
enabled via AC_C_BIGENDIAN, which we never call currently)
 2) __BTYE_ORDER == __BIG_ENDIAN which appears to be be defined in
endian.h always by glibc
 3) __BIG_ENDIAN__ appears to be quite common too? gcc thing?
 
 Also this:
 
 http://sourceforge.net/p/predef/wiki/Endianness/
 
 We should probably stick to one of these things. Probably #2 or #3...
 
 I can't find any normative documentation about these things. Given that
 the #2 is at least unconditional part of glibc, I'd say to convert
 everything to that. Would that work for you on ppc-be too?

Yes that's defined correctly.

Michael

-- 
Pengutronix e.K.   | |
Industrial Linux Solutions | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] architecture: fix building for big-endian PowerPC with gcc

2014-07-11 Thread Michael Olbrich
On Fri, Jul 11, 2014 at 04:01:32PM +0200, Lennart Poettering wrote:
 On Fri, 11.07.14 15:43, Dan Horák (d...@danny.cz) wrote:
   Hmm, the sources currently use three different ways to detect
   endianess:
   
   1) WORDS_BIGENDIAN (which appears to be an autoconf thing actually,
  enabled via AC_C_BIGENDIAN, which we never call currently)
   2) __BTYE_ORDER == __BIG_ENDIAN which appears to be be defined in
  endian.h always by glibc
   3) __BIG_ENDIAN__ appears to be quite common too? gcc thing?
   
   Also this:
   
   http://sourceforge.net/p/predef/wiki/Endianness/
   
   We should probably stick to one of these things. Probably #2 or #3...
   
   I can't find any normative documentation about these things. Given
   that the #2 is at least unconditional part of glibc, I'd say to
   convert everything to that. Would that work for you on ppc-be too?
  
  Jakub explained us endianity checks with GCC in
  https://bugzilla.redhat.com/show_bug.cgi?id=962091#c48
 
 Apparently #2 is and OK check according to that.
 
 I have now changed git to use that for all its checks. Michael, check if
 this now makes things work for you correctly.

It compiles again for me. But i noticed, that endian.h is not explicitly
included. Are you sure that it's always included indirectly?

Michael

-- 
Pengutronix e.K.   | |
Industrial Linux Solutions | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] architecture: fix building for big-endian PowerPC with gcc

2014-07-11 Thread Lennart Poettering
On Fri, 11.07.14 16:10, Michael Olbrich (m.olbr...@pengutronix.de) wrote:

 It compiles again for me. But i noticed, that endian.h is not explicitly
 included. Are you sure that it's always included indirectly?

Oh, indeed! Fxied now!

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel