From patchwork Thu Oct 13 22:06:37 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: loic.minier@linaro.org X-Patchwork-Id: 4677 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 5B72823DEE for ; Fri, 14 Oct 2011 09:58:56 +0000 (UTC) Received: from mail-ey0-f180.google.com (mail-ey0-f180.google.com [209.85.215.180]) by fiordland.canonical.com (Postfix) with ESMTP id 4F986A1878C for ; Fri, 14 Oct 2011 09:58:56 +0000 (UTC) Received: by mail-ey0-f180.google.com with SMTP id 5so1327263eyg.11 for ; Fri, 14 Oct 2011 02:58:56 -0700 (PDT) Received: by 10.223.85.139 with SMTP id o11mr3106655fal.0.1318586336106; Fri, 14 Oct 2011 02:58:56 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.24.41 with SMTP id r9cs8248laf; Fri, 14 Oct 2011 02:58:55 -0700 (PDT) Received: by 10.216.133.219 with SMTP id q69mr2524348wei.79.1318586333385; Fri, 14 Oct 2011 02:58:53 -0700 (PDT) Received: from pig2.dooz.org (pig2.dooz.org. [88.191.118.219]) by mx.google.com with ESMTPS id p50si2538930weq.53.2011.10.14.02.58.53 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 14 Oct 2011 02:58:53 -0700 (PDT) Received-SPF: pass (google.com: domain of lool@dooz.org designates 88.191.118.219 as permitted sender) client-ip=88.191.118.219; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lool@dooz.org designates 88.191.118.219 as permitted sender) smtp.mail=lool@dooz.org Received: from bee.dooz.org (unknown [IPv6:2a01:e35:8a6e:5e80:224:7eff:fe14:65c3]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "bee.dooz.org", Issuer "dooz.org CA" (verified OK)) by pig2.dooz.org (Postfix) with ESMTPS id D0364C011F for ; Fri, 14 Oct 2011 11:58:52 +0200 (CEST) Received: by bee.dooz.org (Postfix, from userid 1000) id 3A1BA15D2; Fri, 14 Oct 2011 11:58:51 +0200 (CEST) Resent-From: =?iso-8859-1?Q?Lo=EFc?= Minier Resent-Date: Fri, 14 Oct 2011 11:58:51 +0200 Resent-Message-ID: <20111014095851.GD27642@bee.dooz.org> Resent-To: patches@linaro.org X-Spam-Checker-Version: SpamAssassin 3.1.4 (2006-07-26) on pig.dooz.org X-Spam-Level: X-Spam-Status: No, score=-102.6 required=3.0 tests=BAYES_00, USER_IN_WHITELIST autolearn=disabled version=3.1.4 X-Original-To: lool@dooz.org Received: from mail-wy0-f179.google.com (mail-wy0-f179.google.com [74.125.82.179]) by pig.dooz.org (Postfix) with ESMTP id 470D74C0A9 for ; Fri, 14 Oct 2011 00:06:51 +0200 (CEST) Received: by wyg36 with SMTP id 36so3087291wyg.24 for ; Thu, 13 Oct 2011 15:06:51 -0700 (PDT) Received: by 10.227.137.210 with SMTP id x18mr1855984wbt.57.1318543610956; Thu, 13 Oct 2011 15:06:50 -0700 (PDT) X-Forwarded-To: lool@dooz.org X-X-Forwarded-For: loic.minier@linaro.org lool@dooz.org Received: by 10.180.105.167 with SMTP id gn7cs168668wib; Thu, 13 Oct 2011 15:06:50 -0700 (PDT) Received: by 10.204.136.131 with SMTP id r3mr4466879bkt.60.1318543610032; Thu, 13 Oct 2011 15:06:50 -0700 (PDT) Received: from pig2.dooz.org (pig2.dooz.org. [88.191.118.219]) by mx.google.com with ESMTPS id 2si3701453bka.146.2011.10.13.15.06.49 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 13 Oct 2011 15:06:49 -0700 (PDT) Received-SPF: pass (google.com: domain of lool@bee.dooz.org designates 88.191.118.219 as permitted sender) client-ip=88.191.118.219; Received: from bee.dooz.org (unknown [IPv6:2a01:e35:8a6e:5e80:224:7eff:fe14:65c3]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "bee.dooz.org", Issuer "dooz.org CA" (verified OK)) by pig2.dooz.org (Postfix) with ESMTPS id 76253C04F4; Fri, 14 Oct 2011 00:06:48 +0200 (CEST) Received: by bee.dooz.org (Postfix, from userid 1000) id 612933991; Fri, 14 Oct 2011 00:06:47 +0200 (CEST) From: =?UTF-8?q?Lo=C3=AFc=20Minier?= To: barebox@lists.infradead.org Cc: =?UTF-8?q?Lo=C3=AFc=20Minier?= Subject: [PATCH 1/5] Only pass -P to cpp when generating ld scripts Date: Fri, 14 Oct 2011 00:06:37 +0200 Message-Id: <1318543601-20819-2-git-send-email-loic.minier@linaro.org> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1318543601-20819-1-git-send-email-loic.minier@linaro.org> References: <1318543601-20819-1-git-send-email-loic.minier@linaro.org> MIME-Version: 1.0 When building sandbox with ccache, one would hit warnings such as: warning: 'struct mmsghdr' declared inside parameter list on random files; a way to reproduce this issue is to build a simple file doing just: #include int main(void) { return 0; } gcc -Wall -P -c -o foo foo.c But actually the -P flag is only useful when generating non-C files, such as linker scripts in the case of barebox. Removing the -P flag from all the gcc invocations, except when generating .lds files makes the warning go away. It turns out that this is what linux/scripts/Makefile.build also does nowadays. Signed-off-by: Loïc Minier --- Makefile | 2 +- arch/arm/Makefile | 2 +- arch/blackfin/Makefile | 2 +- arch/ppc/Makefile | 2 +- arch/sandbox/Makefile | 1 - arch/sandbox/os/Makefile | 1 - arch/x86/Makefile | 2 +- scripts/Makefile.build | 2 +- 8 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 5414e63..10d5780 100644 --- a/Makefile +++ b/Makefile @@ -825,7 +825,7 @@ prepare prepare-all: prepare0 # Leave this as default for preprocessing barebox.lds.S, which is now # done in arch/$(ARCH)/kernel/Makefile -export CPPFLAGS_barebox.lds += -P -C -U$(ARCH) +export CPPFLAGS_barebox.lds += -C -U$(ARCH) # FIXME: The asm symlink changes when $(ARCH) changes. That's # hard to detect, but I suppose "make mrproper" is a good idea diff --git a/arch/arm/Makefile b/arch/arm/Makefile index d25412d..0c42f3d 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -121,7 +121,7 @@ endif TEXT_BASE = $(CONFIG_TEXT_BASE) -CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE) -P +CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE) ifndef CONFIG_MODULES # Add cleanup flags diff --git a/arch/blackfin/Makefile b/arch/blackfin/Makefile index 902268d..a0b87f7 100644 --- a/arch/blackfin/Makefile +++ b/arch/blackfin/Makefile @@ -7,7 +7,7 @@ cpu-$(CONFIG_BF561) := bf561 TEXT_BASE = $(CONFIG_TEXT_BASE) -CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE) -P +CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE) CFLAGS += -D__blackfin__ # -Ttext $(TEXT_BASE) KALLSYMS += --symbol-prefix=_ diff --git a/arch/ppc/Makefile b/arch/ppc/Makefile index 46d64e5..c7bf863 100644 --- a/arch/ppc/Makefile +++ b/arch/ppc/Makefile @@ -14,7 +14,7 @@ cpu-$(CONFIG_ARCH_MPC5200) := mpc5xxx TEXT_BASE = $(CONFIG_TEXT_BASE) -CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE) -P +CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE) # Add cleanup flags ifndef CONFIG_MODULES diff --git a/arch/sandbox/Makefile b/arch/sandbox/Makefile index 4ca17ed..73c06db 100644 --- a/arch/sandbox/Makefile +++ b/arch/sandbox/Makefile @@ -10,7 +10,6 @@ lds-y := $(BOARD)/barebox.lds TEXT_BASE = $(CONFIG_TEXT_BASE) -CPPFLAGS += -P CFLAGS += -Dmalloc=barebox_malloc \ -Dfree=barebox_free -Drealloc=barebox_realloc \ -Dread=barebox_read -Dwrite=barebox_write \ diff --git a/arch/sandbox/os/Makefile b/arch/sandbox/os/Makefile index 2980301..dc211d9 100644 --- a/arch/sandbox/os/Makefile +++ b/arch/sandbox/os/Makefile @@ -8,7 +8,6 @@ else CPPFLAGS = $(patsubst %,-I$(srctree)/%include,$(machdirs)) endif -CPPFLAGS += -P CFLAGS := -Wall NOSTDINC_FLAGS := diff --git a/arch/x86/Makefile b/arch/x86/Makefile index 3b034c0..db4180b 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile @@ -5,7 +5,7 @@ machine-y := i386 TEXT_BASE = $(CONFIG_TEXT_BASE) -CPPFLAGS += -march=i386 -m32 -DTEXT_BASE=$(TEXT_BASE) -P +CPPFLAGS += -march=i386 -m32 -DTEXT_BASE=$(TEXT_BASE) LDFLAGS += -m elf_i386 ifndef CONFIG_MODULES diff --git a/scripts/Makefile.build b/scripts/Makefile.build index c2bab5c..f70e2b9 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -244,7 +244,7 @@ targets += $(extra-y) $(MAKECMDGOALS) $(always) # Linker scripts preprocessor (.lds.S -> .lds) # --------------------------------------------------------------------------- quiet_cmd_cpp_lds_S = LDS $@ - cmd_cpp_lds_S = $(CPP) $(cpp_flags) -D__ASSEMBLY__ -o $@ $< + cmd_cpp_lds_S = $(CPP) $(cpp_flags) -P -D__ASSEMBLY__ -o $@ $< %.lds: %.lds.S FORCE $(call if_changed_dep,cpp_lds_S)