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 /scripts | |
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 'scripts')
-rw-r--r-- | scripts/Makefile.build | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build index c2bab5cb13..f70e2b946d 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) |