All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sh: pass endianness info to sparse
@ 2017-10-31 17:22 Luc Van Oostenryck
  0 siblings, 0 replies; only message in thread
From: Luc Van Oostenryck @ 2017-10-31 17:22 UTC (permalink / raw)
  To: linux-sh

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: Yoshinori Sato <ysato@users.sourceforge.jp>
To: Rich Felker <dalias@libc.org>
CC: linux-sh@vger.kernel.org
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 arch/sh/Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/sh/Makefile b/arch/sh/Makefile
index 280bbff12..93639dd5e 100644
--- a/arch/sh/Makefile
+++ b/arch/sh/Makefile
@@ -119,10 +119,12 @@ ifdef CONFIG_CPU_LITTLE_ENDIAN
 ld-bfd			:= elf32-$(UTS_MACHINE)-linux
 LDFLAGS_vmlinux		+= --defsym jiffies=jiffies_64 --oformat $(ld-bfd)
 LDFLAGS			+= -EL
+CHECKFLAGS		+= -mlittle-endian
 else
 ld-bfd			:= elf32-$(UTS_MACHINE)big-linux
 LDFLAGS_vmlinux		+= --defsym jiffies=jiffies_64+4 --oformat $(ld-bfd)
 LDFLAGS			+= -EB
+CHECKFLAGS		+= -mbig-endian
 endif
 
 export ld-bfd BITS
-- 
2.14.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-10-31 17:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-31 17:22 [PATCH] sh: pass endianness info to sparse Luc Van Oostenryck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.