* [PATCH] arm64: pass endianness info to sparse
@ 2017-06-24 15:42 Luc Van Oostenryck
2017-06-26 9:15 ` Will Deacon
0 siblings, 1 reply; 2+ messages in thread
From: Luc Van Oostenryck @ 2017-06-24 15:42 UTC (permalink / raw)
To: linux-arm-kernel
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 <catalin.marinas@arm.com>
CC: Will Deacon <will.deacon@arm.com>
CC: linux-arm-kernel at lists.infradead.org
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
arch/arm64/Makefile | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index 15d6c1476..8ed11b94a 100644
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
@@ -52,11 +52,13 @@ KBUILD_AFLAGS += $(lseinstr) $(brokengasinst)
ifeq ($(CONFIG_CPU_BIG_ENDIAN), y)
KBUILD_CPPFLAGS += -mbig-endian
+CHECKFLAGS += -D__AARCH64EB__
AS += -EB
LD += -EB
UTS_MACHINE := aarch64_be
else
KBUILD_CPPFLAGS += -mlittle-endian
+CHECKFLAGS += -D__AARCH64EL__
AS += -EL
LD += -EL
UTS_MACHINE := aarch64
--
2.13.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] arm64: pass endianness info to sparse
2017-06-24 15:42 [PATCH] arm64: pass endianness info to sparse Luc Van Oostenryck
@ 2017-06-26 9:15 ` Will Deacon
0 siblings, 0 replies; 2+ messages in thread
From: Will Deacon @ 2017-06-26 9:15 UTC (permalink / raw)
To: linux-arm-kernel
On Sat, Jun 24, 2017 at 05:42:11PM +0200, Luc Van Oostenryck wrote:
> 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 <catalin.marinas@arm.com>
> CC: Will Deacon <will.deacon@arm.com>
> CC: linux-arm-kernel at lists.infradead.org
> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
> ---
> arch/arm64/Makefile | 2 ++
> 1 file changed, 2 insertions(+)
Thanks, I'll pick this up.
Will
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-06-26 9:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-24 15:42 [PATCH] arm64: pass endianness info to sparse Luc Van Oostenryck
2017-06-26 9:15 ` Will Deacon
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.