Commit d9df92e22aca939857c5bc9ecb130ef22307ccc1
1 parent
7d2d8fe0cb
Exists in
master
and in
7 other branches
kbuild: properly pass options to hostcc when doing make O=..
This fix a longstanding bug where proper options was not passed to hostcc in case of a make O=.. build. This bug showed up in (not yet merged) klibc, and is not known to have any counterpart in-kernel. Fixed by moving the flags macro to Kbuild.include so it can be used by both Makefile.lib and Makefile.host. Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Showing 2 changed files with 5 additions and 5 deletions Side-by-side Diff
scripts/Kbuild.include
... | ... | @@ -87,6 +87,11 @@ |
87 | 87 | # $(Q)$(MAKE) $(build)=dir |
88 | 88 | build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj |
89 | 89 | |
90 | +# Prefix -I with $(srctree) if it is not an absolute path | |
91 | +addtree = $(if $(filter-out -I/%,$(1)),$(patsubst -I%,-I$(srctree)/%,$(1))) $(1) | |
92 | +# Find all -I options and call addtree | |
93 | +flags = $(foreach o,$($(1)),$(if $(filter -I%,$(o)),$(call addtree,$(o)),$(o))) | |
94 | + | |
90 | 95 | # If quiet is set, only print short version of command |
91 | 96 | cmd = @$(echo-cmd) $(cmd_$(1)) |
92 | 97 |
scripts/Makefile.lib
... | ... | @@ -99,11 +99,6 @@ |
99 | 99 | __cpp_flags = $(_cpp_flags) |
100 | 100 | else |
101 | 101 | |
102 | -# Prefix -I with $(srctree) if it is not an absolute path | |
103 | -addtree = $(if $(filter-out -I/%,$(1)),$(patsubst -I%,-I$(srctree)/%,$(1))) $(1) | |
104 | -# Find all -I options and call addtree | |
105 | -flags = $(foreach o,$($(1)),$(if $(filter -I%,$(o)),$(call addtree,$(o)),$(o))) | |
106 | - | |
107 | 102 | # -I$(obj) locates generated .h files |
108 | 103 | # $(call addtree,-I$(obj)) locates .h files in srctree, from generated .c files |
109 | 104 | # and locates generated .h files |