aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-05-30 16:48:38 -0400
committerMasahiro Yamada <yamada.masahiro@socionext.com>2018-05-31 22:36:58 -0400
commit1f2f01b122d7c78a9e842a126ef168afb279552b (patch)
tree1b1732ed86d8ff44efe1ee7812b26ee1741939b3 /Makefile
parent145167650b96967d6b726efef978c74831e6b2bd (diff)
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 <luc.vanoostenryck@gmail.com> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile3
1 files changed, 3 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 68982ba7bc2f..2626de329e5f 100644
--- a/Makefile
+++ b/Makefile
@@ -877,6 +877,9 @@ endif
877# insure the checker run with the right endianness 877# insure the checker run with the right endianness
878CHECKFLAGS += $(if $(CONFIG_CPU_BIG_ENDIAN),-mbig-endian,-mlittle-endian) 878CHECKFLAGS += $(if $(CONFIG_CPU_BIG_ENDIAN),-mbig-endian,-mlittle-endian)
879 879
880# the checker needs the correct machine size
881CHECKFLAGS += $(if $(CONFIG_64BIT),-m64,-m32)
882
880# Default kernel image to build when no specific target is given. 883# Default kernel image to build when no specific target is given.
881# KBUILD_IMAGE may be overruled on the command line or 884# KBUILD_IMAGE may be overruled on the command line or
882# set in the environment 885# set in the environment