aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Ravnborg <sam@ravnborg.org>2008-12-03 15:22:21 -0500
committerSam Ravnborg <sam@ravnborg.org>2008-12-03 15:22:21 -0500
commit5b91c33cf295d9c235f587f29a8c0a7ae15a5320 (patch)
treebc20ee1e8c338e85aa4212385fd35d220aa3b767
parentf6f7b52e2f6149d2ee365717afff315b05720162 (diff)
kbuild: fix -I option expansion with O=... builds
When adding extra -I options with O=... we could end up in a situation where there were no parameters to -I. So we had a commandline that looked like this: ... -I -Wall ... This had the undesired side effect that gcc assumed "-Wall" was a path to look for include files so this options was effectively ignored. This happens only when we build the generated module.mod.c files as part of the final modules builds and is as such harmless with current kbuild. This bug was exposed when we rearranged the options to gcc. Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
-rw-r--r--scripts/Kbuild.include4
1 files changed, 3 insertions, 1 deletions
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index 982dcae7bbe2..936940b541f9 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -144,7 +144,9 @@ ld-option = $(call try-run,\
144build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj 144build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
145 145
146# Prefix -I with $(srctree) if it is not an absolute path. 146# Prefix -I with $(srctree) if it is not an absolute path.
147addtree = $(if $(filter-out -I/%,$(1)),$(patsubst -I%,-I$(srctree)/%,$(1))) $(1) 147# skip if -I has no parameter
148addtree = $(if $(patsubst -I%,%,$(1)), \
149$(if $(filter-out -I/%,$(1)),$(patsubst -I%,-I$(srctree)/%,$(1))) $(1))
148 150
149# Find all -I options and call addtree 151# Find all -I options and call addtree
150flags = $(foreach o,$($(1)),$(if $(filter -I%,$(o)),$(call addtree,$(o)),$(o))) 152flags = $(foreach o,$($(1)),$(if $(filter -I%,$(o)),$(call addtree,$(o)),$(o)))