[PATCH] arm64: pass machine size to sparse

Luc Van Oostenryck luc.vanoostenryck at gmail.com
Wed Jun 21 09:54:32 PDT 2017


On Wed, Jun 21, 2017 at 05:12:54PM +0100, Will Deacon wrote:
> On Tue, Jun 20, 2017 at 09:07:40PM +0200, Luc Van Oostenryck wrote:
> > Well, currently sparse is arch agnostic and I think it's a good thing.
> > For the few arch specifities you have to use some of the '-m' flags
> > (like -m32/-m64, -msize-long). So, for the moment the '-m64' flag
> > is needed, thus the patch.
> 
> Ok, I'll pick your patch up then. The endianness case is more interesting,
> because I don't think __BIG_ENDIAN__ and __LITTLE_ENDIAN__ are the defines
> to use; the kernel seems to omit the trailing underscores afaict.

I just checked, it's a bit messy.
The kernel seems to rely, at least partly, maybe mostly, on
CONFIG_CPU_{BIG,LITTLE}_ENDIAN and then __{BIG,LITTLE}_ENDIAN is
defined via include/uapi/linux/byteorder/{big,little}_endian.h

Otherwise, from the compiler side it seems that __BYTE_ORDER__ &
__ORDER_{BIG,LITTLE}_ENDIAN__ is defined consistently.
But, for example for arm64, 'gcc -mlittle-endian' gives
	#define __LITTLE_ENDIAN__ 1
while 'gcc -mbig-endian' doesn't define __BIG_ENDIAN__ but
	#define __ARM_BIG_ENDIAN 1

*shrugh*

I've added support for the -m{big,little}-endian flag to sparse
but it seems it will be more complicated for the defines.

-- Luc



More information about the linux-arm-kernel mailing list