On Tue, Oct 31, 2017 at 06:22:08PM +0100, Luc Van Oostenryck wrote: > s390 is big-endian only but sparse assumes the same endianness > as the building machine. > This is problematic for code which expect __BYTE_ORDER__ being > correctly predefined by the compiler which sparse can then > pre-process differently from what gcc would, depending on the > building machine endianness. > > Fix this by letting sparse know about the architecture endianness. > > Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx> > --- > arch/s390/Makefile | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/s390/Makefile b/arch/s390/Makefile > index dac821cfc..64c2fe9dc 100644 > --- a/arch/s390/Makefile > +++ b/arch/s390/Makefile > @@ -21,7 +21,7 @@ KBUILD_CFLAGS += -m64 > KBUILD_AFLAGS += -m64 > UTS_MACHINE := s390x > STACK_SIZE := 16384 > -CHECKFLAGS += -D__s390__ -D__s390x__ > +CHECKFLAGS += -D__s390__ -D__s390x__ -mbig-endian Applied, thanks! However something similar is required for _all_ architectures, e.g. setting -mlittle-endian for the same reason on big endian build machines. Therefore I would have expected to add the -m flag in the top-level Makefile depending on CONFIG_CPU_BIG_ENDIAN or CONFIG_CPU_KITTLE_ENDIAN. However it seems that not all architectures set any of these config options at all. If I remember correctly Arnd Bergmann was looking into this a couple of months ago(?)... -- To unsubscribe from this list: send the line "unsubscribe linux-s390" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html