Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp364523imm; Thu, 31 May 2018 01:40:45 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLRcY7WwQUK3fZk4zS4z4DW/y0VMB7BwsF1ty0kf015t7b9YdTRCQzNYY8qNeXDBsgsgnKJ X-Received: by 2002:a62:1c43:: with SMTP id c64-v6mr5899835pfc.176.1527756045769; Thu, 31 May 2018 01:40:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527756045; cv=none; d=google.com; s=arc-20160816; b=XCLWpZfdchZfIHVBALyL0aQoeO3rwXy2pRSpjf/eL5Ixme8taWNAHdTpt9qUsK+vJ5 8K1C9pC6KjFlwCTUyyTnKkNHCpxWf+tRaclKbLZak413nPHpJK5FjJ+h/EJWKYvs5+w6 eq1XPO8b86GcbhjhiJP9aTvqKZD7ohJJzjp3Tmyo5e/olKSBSjxHLS7L8fFPkLCzfdFl oIvCdERfiqepTvEytrefkUf4S2vBbTR5zpjxXcpQwKSmxfsB3j9v6DSPO4Vwwq54UClF ZvkmNGgJW6/iVgwTBu4l7q9t5HqQdij2AhEbOSqYFsVbxbEzV5j/Z9C3ks5WkcKJSJOy 8ChA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=ztsPvYEWARJUvJ1opa/XEvLAXjZYFHe/8IpWVNHQtPY=; b=NlJWOdMQ1FWHOLmlcV4OVb3CSQLgxuJRqStC/tjm99kaEA0rko+gfrkaxaDQCrDNDY Z8s9rGpx1hIGxJ1T9orHJ7ZthJeAmRqe13Z0uU9VXAgKS/lB9ttv2/2opybhc0ZLSl91 Di5tlIFLLqkr2D3X7JOBAaijhnMQR+FbyBBc9y8Eb89x9YowQaTfI5ynG/JWIIkCvQ6Y YzoJuR5petb5Fja4PA1RPcTYdY3RSIK1oMXM96Y+Actdv3Vk+RQdU167SFx2xUpI6xHb 43BvqmTIfKE04Oni9S2FUL8BKC2tA3MgiGp+ArUvzkfCMKrYSfd2EgrAwnxrv5tlTdM0 iIHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MwIaSl0d; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c10-v6si8094300pll.275.2018.05.31.01.40.30; Thu, 31 May 2018 01:40:45 -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=@linaro.org header.s=google header.b=MwIaSl0d; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754156AbeEaIio (ORCPT + 99 others); Thu, 31 May 2018 04:38:44 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:38115 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754071AbeEaIii (ORCPT ); Thu, 31 May 2018 04:38:38 -0400 Received: by mail-wm0-f68.google.com with SMTP id m129-v6so52347388wmb.3 for ; Thu, 31 May 2018 01:38:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ztsPvYEWARJUvJ1opa/XEvLAXjZYFHe/8IpWVNHQtPY=; b=MwIaSl0dCU4IZEyYOgV0jAdSmiJy+/btG2ob9D57Ufv9820x6qsumBRBX8oawI7R15 JXAQQAmgYAQvT6RzdEjASjtStuaOsQSkvOIYfQRD5cES8nVYhnxZ6tcKKt2izHtpNa+N WgnCEC3vqzcB3F+AEnJSuO8HMbwWq1kPoDyss= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=ztsPvYEWARJUvJ1opa/XEvLAXjZYFHe/8IpWVNHQtPY=; b=TH7Yhu19a27ebqYUknN2N3I/sqzxLsOQu720+q3tUWwoqjhVgCMpsgP7nf6t7F2Cbu RalcqlFqmMxrXUgDIQ88fJxvNwy1Hcn3uooYgA2hNWeIa5YhG7RhFnQv0CaLzzxBiXzM O+4W2tv4x1Xv4sRJbyrbHNGbl9F0ddrlobXBcqrTi08m4WFB20I9LJ26zad9d0PqIKAA 16jrAEkqkQMKRlbi4ZoDjtT+8XkhQiS5ZhkDtkww32CjaQV/f67H7MIchVZC5yruLU4R QnKI391EL3IgtCndKj8I3eEFwoWzqs85gfRDh+DCxuHGbppEglDXKyae6msfLu++DxbA 0MkQ== X-Gm-Message-State: ALKqPwe2YLYG2XQwUTzqweMyyuYeDF/uUMUuXVMFZsMe5/E0UT/jA39/ eEmVGacx4KmEsZF3dkUP9g/+PQ== X-Received: by 2002:a1c:4518:: with SMTP id s24-v6mr3977549wma.50.1527755916375; Thu, 31 May 2018 01:38:36 -0700 (PDT) Received: from holly.lan (cpc141214-aztw34-2-0-cust773.18-1.cable.virginm.net. [86.9.19.6]) by smtp.gmail.com with ESMTPSA id d90-v6sm810547wmi.26.2018.05.31.01.38.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 31 May 2018 01:38:35 -0700 (PDT) Date: Thu, 31 May 2018 09:38:32 +0100 From: Daniel Thompson To: Luc Van Oostenryck Cc: Masahiro Yamada , 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@kernel.org, Brendan Higgins , Martin Blumenstingl , Cao jin , Nicolas Pitre , Andreas =?utf-8?Q?F=C3=A4rber?= , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, linux-mips@linux-mips.org, linux-parisc@vger.kernel.org, sparclinux@vger.kernel.org, Randy Dunlap , Christoph Hellwig , Rob Landley Subject: Re: [PATCH] kbuild: add machine size to CHEKCFLAGS Message-ID: <20180531083832.glzcj23cgucev77v@holly.lan> References: <20180530204838.22079-1-luc.vanoostenryck@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180530204838.22079-1-luc.vanoostenryck@gmail.com> User-Agent: NeoMutt/20180512 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 30, 2018 at 10:48:38PM +0200, Luc Van Oostenryck wrote: > 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 Looks like a good clean up to me. However the typo in the Subject: line did attract my attention. Daniel. > --- > 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 >