[lkml]   [2018]   [Apr]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH AUTOSEL for 4.4 072/162] arm64: pass endianness info to sparse
From: Luc Van Oostenryck <>

[ Upstream commit bcde519e8c325f3cc1fcf443eb6466e6bb3a3aca ]

ARM64 depends on the macro __AARCH64EB__ being defined or not
to correctly select or define endian-specific macros, structures
or pieces of code.

This macro is predefined by the compiler but sparse knows nothing
about it and thus may pre-process files differently from what
gcc would.

Fix this by passing '-D__AARCH64EL__' or '-D__AARCH64EB__' to
sparse depending of the endianness of the kernel, like defined
by GCC.

Note: In most case it won't change anything since most arm64 use
little-endian (but an allyesconfig would use big-endian!).

CC: Catalin Marinas <>
CC: Will Deacon <>
Signed-off-by: Luc Van Oostenryck <>
Signed-off-by: Will Deacon <>
Signed-off-by: Sasha Levin <>
arch/arm64/Makefile | 2 ++
1 file changed, 2 insertions(+)

diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index 119d1885a3c0..95c667328b5d 100644
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
@@ -32,10 +32,12 @@ KBUILD_AFLAGS += $(lseinstr)

KBUILD_CPPFLAGS += -mbig-endian
AS += -EB
LD += -EB
KBUILD_CPPFLAGS += -mlittle-endian
AS += -EL
LD += -EL
 \ /
  Last update: 2018-04-09 03:25    [W:0.464 / U:22.328 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site