diff options
author | Loïc Minier <loic.minier@linaro.org> | 2011-10-14 00:06:37 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2011-10-18 09:18:41 +0200 |
commit | 4e26fba6803b0b4820875df50ed733eeb4980d60 (patch) | |
tree | 6c88ff0a3b11b1308097a856431d1452ce3f9ad7 /arch | |
parent | 2b5d8792ac7c95f41f3d5fced553450eea9b40f8 (diff) | |
download | barebox-4e26fba6803b0b4820875df50ed733eeb4980d60.tar.gz barebox-4e26fba6803b0b4820875df50ed733eeb4980d60.tar.xz |
Only pass -P to cpp when generating ld scripts
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 <sys/socket.h>
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 <loic.minier@linaro.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/Makefile | 2 | ||||
-rw-r--r-- | arch/blackfin/Makefile | 2 | ||||
-rw-r--r-- | arch/ppc/Makefile | 2 | ||||
-rw-r--r-- | arch/sandbox/Makefile | 1 | ||||
-rw-r--r-- | arch/sandbox/os/Makefile | 1 | ||||
-rw-r--r-- | arch/x86/Makefile | 2 |
6 files changed, 4 insertions, 6 deletions
diff --git a/arch/arm/Makefile b/arch/arm/Makefile index d25412d11f..0c42f3d1ea 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 902268da70..a0b87f77d7 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 46d64e5bc6..c7bf863747 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 4ca17ed839..73c06db09c 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 2980301e15..dc211d94cd 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 3b034c0516..db4180b32b 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 |