Skip to contentSkip to conversation

m32r: pass endianness info to sparse

PATCH New Luc Van Oostenryck 1 participant 1 message Oct 31, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 m32r: pass endianness info to sparse

m32r 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.

To: [email protected]

---
 arch/m32r/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/m32r/Makefile +1 -1
index def8dd0b6..fbdaf03a6 100644
@@ -29,7 +29,7 @@ aflags-$(CONFIG_ISA_M32R)	+= -DNO_FPU -O2 -Wa,-no-bitinst
 KBUILD_CFLAGS += $(cflags-y)
 KBUILD_AFLAGS += $(aflags-y)
 
-CHECKFLAGS	+= -D__m32r__ -D__BIG_ENDIAN__=1
+CHECKFLAGS	+= -D__m32r__ -D__BIG_ENDIAN__=1 -mbig-endian
 
 head-y	:= arch/m32r/kernel/head.o
 
Signature · 1 line
2.14.0