Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1445016imm; Sat, 2 Jun 2018 00:57:10 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLxqU5EURKzsae2TFouE1s7yD/h7tLK1WB0vsvKmNxJBA/cpJKbWtO3NjxwKt8rEm1j/f9V X-Received: by 2002:a17:902:22cc:: with SMTP id o12-v6mr14597324plg.38.1527926230667; Sat, 02 Jun 2018 00:57:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527926230; cv=none; d=google.com; s=arc-20160816; b=Wme8E0xLQka56Jye62nhOpNigpiBMuRzZg4G2KKTPWJJiJiD/ejZOtE66NfsBYs2K5 KXf2VGaFiCZsmFnrQvKOfWvEWZgFPIdaU2Mtk9ijKp99gFpq9BssNAWjkjVqpvzLery+ sndZEXKY59calmp+gTeCqxKxwkRCaFpXYgEnSISvoHh4Dduyz/hvVleM3HC+6Ow6VOst A3Kf8w3aleyGYrF9EuLRn7IxbhisaKvKz/VxBT9WdlrOlM0bYkhhRA/l7iqC/syWrT2W lgc0+irAsYGDS0UeTHPBbUJpHJKl7PXYpaCl1atBeW3wCtd0f4THhDuvWweB+gBknqD3 o85w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature:dkim-filter :arc-authentication-results; bh=5A9S+PR/n9S7v5bfEEHf0oEK5Kh+aYqMilWTOt+7sF8=; b=FN7D2bO0OKR5UslFAH6kHaF7Bn4hF7oOksmZ5S0IIjFfG6vJcq0JHRW1RDNP6ct8dX +XHiRWYMcKRDaj3Pe2JIH0aQ7Ya/RbmUXgJATuZ+kSsZQYQnny1tD+TU1fZyV+CmhNc+ ZkWvg7eQ/8GSM5JIxkt0P/IKs+7heTREW80XYTiDBgMFivq2zcR2umA+xpSUfs8wDaXj JV49rhEpOv0AmPfSVyD7tEYTpkohS1bc+z2IV/ugTY5L6pQyPxmbjc9XEUrM1WlYKiav oxayG9hxxY3gxgmbem30U/TaJyl01HOwpEYnRp4VYSSeUTAvIr9+ODQd7EUrmfc3GJhM mHUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=IyWbu3wZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c24-v6si41268220plo.489.2018.06.02.00.56.56; Sat, 02 Jun 2018 00:57:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=IyWbu3wZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751558AbeFBHyl (ORCPT + 99 others); Sat, 2 Jun 2018 03:54:41 -0400 Received: from conssluserg-06.nifty.com ([210.131.2.91]:18824 "EHLO conssluserg-06.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751498AbeFBHyj (ORCPT ); Sat, 2 Jun 2018 03:54:39 -0400 Received: from mail-ua0-f173.google.com (mail-ua0-f173.google.com [209.85.217.173]) (authenticated) by conssluserg-06.nifty.com with ESMTP id w527sVB4000328; Sat, 2 Jun 2018 16:54:31 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-06.nifty.com w527sVB4000328 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1527926072; bh=5A9S+PR/n9S7v5bfEEHf0oEK5Kh+aYqMilWTOt+7sF8=; h=In-Reply-To:References:From:Date:Subject:To:Cc:From; b=IyWbu3wZ6no/W5S7j9YdP3Zk4gB3Tft/lYfpKfDP9jZ7qavSh8FZGVPcooX5DqRoN 4YfYKZ6IMhMFtWULsktJICbpN8vIeMK/PIxPPaJjSaUwY0/gek3N8ZX2G9Salp6BCb JPv1A2pIfzFsG1BuW9oIhcdmCUvMsCen0FU88BUuEXRgYQg1pTtlRwaESc9iNgovdg XUT18SOW/t2mbrBcvlVfIHqCXyHjCFr0jCaYHdDGGS4KFAfr3EGXjSRFQG3uGdnwq7 drKonXlVQ2KNdf9sGJBh5foEzRVXiQSb7vojdiL6p4xb24YJ/kR23oNB9A0sVmmnEO pa+7H3GpBSxwA== X-Nifty-SrcIP: [209.85.217.173] Received: by mail-ua0-f173.google.com with SMTP id y8-v6so18878229ual.5; Sat, 02 Jun 2018 00:54:31 -0700 (PDT) X-Gm-Message-State: APt69E2RuQtWBJ6WuE9owrnIc9iRfXwTKoPzXkwEhA6YYuWw/gvAwNny envSPyJH1tERh/PmBRph0i7x+uuVIUVdym3Fijo= X-Received: by 2002:ab0:5061:: with SMTP id z30-v6mr5577236uaz.82.1527926068831; Sat, 02 Jun 2018 00:54:28 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ab0:20ab:0:0:0:0:0 with HTTP; Sat, 2 Jun 2018 00:53:48 -0700 (PDT) In-Reply-To: <20180530204838.22079-1-luc.vanoostenryck@gmail.com> References: <20180530204838.22079-1-luc.vanoostenryck@gmail.com> From: Masahiro Yamada Date: Sat, 2 Jun 2018 16:53:48 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] kbuild: add machine size to CHEKCFLAGS To: Luc Van Oostenryck Cc: Michal Marek , Richard Henderson , Ivan Kokshaysky , Matt Turner , Russell King , Catalin Marinas , Will Deacon , Tony Luck , Fenghua Yu , Ralf Baechle , James Hogan , "James E . J . Bottomley" , Helge Deller , "David S . Miller" , Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , X86 ML , Brendan Higgins , Martin Blumenstingl , Cao jin , Nicolas Pitre , =?UTF-8?Q?Andreas_F=C3=A4rber?= , Linux Kbuild mailing list , Linux Kernel Mailing List , linux-alpha@vger.kernel.org, linux-arm-kernel , linux-ia64@vger.kernel.org, Linux-MIPS , linux-parisc@vger.kernel.org, sparclinux , Randy Dunlap , Christoph Hellwig , Rob Landley Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2018-05-31 5:48 GMT+09:00 Luc Van Oostenryck : > 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 > --- Fixed CHEKCFLAGS -> CHECKFLAGS and applied to linux-kbuild. Thanks! > Makefile | 3 +++ > arch/alpha/Makefile | 2 +- > arch/arm/Makefile | 2 +- > arch/arm64/Makefile | 2 +- > arch/ia64/Makefile | 2 +- > arch/mips/Makefile | 3 --- > arch/parisc/Makefile | 2 +- > arch/sparc/Makefile | 2 +- > arch/x86/Makefile | 2 +- > 9 files changed, 10 insertions(+), 10 deletions(-) > > diff --git a/Makefile b/Makefile > index 6c6610913..18379987c 100644 > --- a/Makefile > +++ b/Makefile > @@ -881,6 +881,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 > diff --git a/arch/alpha/Makefile b/arch/alpha/Makefile > index 2cc3cc519..c5ec8c09c 100644 > --- a/arch/alpha/Makefile > +++ b/arch/alpha/Makefile > @@ -11,7 +11,7 @@ > NM := $(NM) -B > > LDFLAGS_vmlinux := -static -N #-relax > -CHECKFLAGS += -D__alpha__ -m64 > +CHECKFLAGS += -D__alpha__ > cflags-y := -pipe -mno-fp-regs -ffixed-8 > cflags-y += $(call cc-option, -fno-jump-tables) > > diff --git a/arch/arm/Makefile b/arch/arm/Makefile > index e4e537f27..f32a5468d 100644 > --- a/arch/arm/Makefile > +++ b/arch/arm/Makefile > @@ -135,7 +135,7 @@ endif > KBUILD_CFLAGS +=$(CFLAGS_ABI) $(CFLAGS_ISA) $(arch-y) $(tune-y) $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) -msoft-float -Uarm > KBUILD_AFLAGS +=$(CFLAGS_ABI) $(AFLAGS_ISA) $(arch-y) $(tune-y) -include asm/unified.h -msoft-float > > -CHECKFLAGS += -D__arm__ -m32 > +CHECKFLAGS += -D__arm__ > > #Default value > head-y := arch/arm/kernel/head$(MMUEXT).o > diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile > index 87f7d2f9f..3c353b471 100644 > --- a/arch/arm64/Makefile > +++ b/arch/arm64/Makefile > @@ -78,7 +78,7 @@ LDFLAGS += -maarch64linux > UTS_MACHINE := aarch64 > endif > > -CHECKFLAGS += -D__aarch64__ -m64 > +CHECKFLAGS += -D__aarch64__ > > ifeq ($(CONFIG_ARM64_MODULE_PLTS),y) > KBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/arm64/kernel/module.lds > diff --git a/arch/ia64/Makefile b/arch/ia64/Makefile > index 2dd7f519a..45f59808b 100644 > --- a/arch/ia64/Makefile > +++ b/arch/ia64/Makefile > @@ -18,7 +18,7 @@ READELF := $(CROSS_COMPILE)readelf > > export AWK > > -CHECKFLAGS += -m64 -D__ia64=1 -D__ia64__=1 -D_LP64 -D__LP64__ > +CHECKFLAGS += -D__ia64=1 -D__ia64__=1 -D_LP64 -D__LP64__ > > OBJCOPYFLAGS := --strip-all > LDFLAGS_vmlinux := -static > diff --git a/arch/mips/Makefile b/arch/mips/Makefile > index 5e9fce076..e2122cca4 100644 > --- a/arch/mips/Makefile > +++ b/arch/mips/Makefile > @@ -309,9 +309,6 @@ ifdef CONFIG_MIPS > CHECKFLAGS += $(shell $(CC) $(KBUILD_CFLAGS) -dM -E -x c /dev/null | \ > egrep -vw '__GNUC_(|MINOR_|PATCHLEVEL_)_' | \ > sed -e "s/^\#define /-D'/" -e "s/ /'='/" -e "s/$$/'/" -e 's/\$$/&&/g') > -ifdef CONFIG_64BIT > -CHECKFLAGS += -m64 > -endif > endif > > OBJCOPYFLAGS += --remove-section=.reginfo > diff --git a/arch/parisc/Makefile b/arch/parisc/Makefile > index 348ae4779..714284ea6 100644 > --- a/arch/parisc/Makefile > +++ b/arch/parisc/Makefile > @@ -28,7 +28,7 @@ export LIBGCC > > ifdef CONFIG_64BIT > UTS_MACHINE := parisc64 > -CHECKFLAGS += -D__LP64__=1 -m64 > +CHECKFLAGS += -D__LP64__=1 > CC_ARCHES = hppa64 > LD_BFD := elf64-hppa-linux > else # 32-bit > diff --git a/arch/sparc/Makefile b/arch/sparc/Makefile > index edac927e4..966a13d2b 100644 > --- a/arch/sparc/Makefile > +++ b/arch/sparc/Makefile > @@ -39,7 +39,7 @@ else > # sparc64 > # > > -CHECKFLAGS += -D__sparc__ -D__sparc_v9__ -D__arch64__ -m64 > +CHECKFLAGS += -D__sparc__ -D__sparc_v9__ -D__arch64__ > LDFLAGS := -m elf64_sparc > export BITS := 64 > UTS_MACHINE := sparc64 > diff --git a/arch/x86/Makefile b/arch/x86/Makefile > index 60135cbd9..f0a6ea224 100644 > --- a/arch/x86/Makefile > +++ b/arch/x86/Makefile > @@ -94,7 +94,7 @@ ifeq ($(CONFIG_X86_32),y) > else > BITS := 64 > UTS_MACHINE := x86_64 > - CHECKFLAGS += -D__x86_64__ -m64 > + CHECKFLAGS += -D__x86_64__ > > biarch := -m64 > KBUILD_AFLAGS += -m64 > -- > 2.17.0 > -- Best Regards Masahiro Yamada