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

Lennart Poettering lennart at poettering.net
Fri Jul 11 07:01:32 PDT 2014


On Fri, 11.07.14 15:43, Dan Horák (dan at 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


More information about the systemd-devel mailing list