[Skiboot] [RFC] Add support for glibc style endianess detection

Akshay Adiga akshay.adiga at linux.vnet.ibm.com
Thu May 4 12:43:58 AEST 2017


On 05/04/2017 03:26 AM, Benjamin Herrenschmidt wrote:
> On Thu, 2017-05-04 at 01:37 +0530, Akshay Adiga wrote:
> > CCAN defines HAVE_LITTLE_ENDIAN or HAVE_BIG_ENDIAN to endianess of the
> > system and code developed on top of glibc expect __BYTE_ORDER to
> > tell the endianess.
> >
> > Suggested-by: Benjamin Herrenschmidt <benh at kernel.crashing.org>
> > Signed-off-by: Akshay Adiga <akshay.adiga at linux.vnet.ibm.com>
> > ---
> > Other attempt:
> > 1) when named as include/endian.h, conflicted with host include
> > files (gcov build failed).
>
> I'd rather we fix the host include problem by using the proper
> guards in that file for example if we can and call it "endian.h"

I can do that.

[snip..]
> > --- a/include/skiboot.h
> > +++ b/include/skiboot.h
> > @@ -27,13 +27,13 @@
> >  #include <errno.h>
> >  #include <bitutils.h>
> >  #include <types.h>
> > +#include <glibc_endian.h>

I can rename "glibc_endian.h" to "endian.h" and change include to :
+#include "endian.h"

Thanks Ben it works. posting it as patch now.



More information about the Skiboot mailing list