From 1f2f01b122d7c78a9e842a126ef168afb279552b Mon Sep 17 00:00:00 2001 From: Luc Van Oostenryck Date: Wed, 30 May 2018 22:48:38 +0200 Subject: kbuild: add machine size to CHECKFLAGS By default, sparse assumes a 64bit machine when compiled on x86-64 and 32bit when compiled on anything else. This can of course create all sort of problems for the other archs, like issuing false warnings ('shift too big (32) for type unsigned long'), or worse, failing to emit legitimate warnings. Fix this by adding the -m32/-m64 flag, depending on CONFIG_64BIT, to CHECKFLAGS in the main Makefile (and so for all archs). Also, remove the now unneeded -m32/-m64 in arch specific Makefiles. Signed-off-by: Luc Van Oostenryck Signed-off-by: Masahiro Yamada --- Makefile | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 68982ba7bc2f7..2626de329e5f3 100644 --- a/Makefile +++ b/Makefile @@ -877,6 +877,9 @@ endif # insure the checker run with the right endianness CHECKFLAGS += $(if $(CONFIG_CPU_BIG_ENDIAN),-mbig-endian,-mlittle-endian) +# the checker needs the correct machine size +CHECKFLAGS += $(if $(CONFIG_64BIT),-m64,-m32) + # Default kernel image to build when no specific target is given. # KBUILD_IMAGE may be overruled on the command line or # set in the environment -- cgit v1.2.3