aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Kbuild.include27
-rw-r--r--scripts/basic/fixdep.c1
2 files changed, 28 insertions, 0 deletions
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index 80ca538bfba9..a09927e02713 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -258,12 +258,39 @@ if_changed_dep = $(if $(strip $(any-prereq) $(arg-check) ), \
258 @set -e; \ 258 @set -e; \
259 $(cmd_and_fixdep), @:) 259 $(cmd_and_fixdep), @:)
260 260
261ifndef CONFIG_TRIM_UNUSED_KSYMS
262
261cmd_and_fixdep = \ 263cmd_and_fixdep = \
262 $(echo-cmd) $(cmd_$(1)); \ 264 $(echo-cmd) $(cmd_$(1)); \
263 scripts/basic/fixdep $(depfile) $@ '$(make-cmd)' > $(dot-target).tmp;\ 265 scripts/basic/fixdep $(depfile) $@ '$(make-cmd)' > $(dot-target).tmp;\
264 rm -f $(depfile); \ 266 rm -f $(depfile); \
265 mv -f $(dot-target).tmp $(dot-target).cmd; 267 mv -f $(dot-target).tmp $(dot-target).cmd;
266 268
269else
270
271# Filter out exported kernel symbol names from the preprocessor output.
272# See also __KSYM_DEPS__ in include/linux/export.h.
273# We disable the depfile generation here, so as not to overwrite the existing
274# depfile while fixdep is parsing it.
275flags_nodeps = $(filter-out -Wp$(comma)-M%, $($(1)))
276ksym_dep_filter = \
277 case "$(1)" in \
278 cc_*_c) $(CPP) $(call flags_nodeps,c_flags) -D__KSYM_DEPS__ $< ;; \
279 as_*_S) $(CPP) $(call flags_nodeps,a_flags) -D__KSYM_DEPS__ $< ;; \
280 boot*|build*|*cpp_lds_S|dtc|host*|vdso*) : ;; \
281 *) echo "Don't know how to preprocess $(1)" >&2; false ;; \
282 esac | sed -rn 's/^.*=== __KSYM_(.*) ===.*$$/KSYM_\1/p'
283
284cmd_and_fixdep = \
285 $(echo-cmd) $(cmd_$(1)); \
286 $(ksym_dep_filter) | \
287 scripts/basic/fixdep -e $(depfile) $@ '$(make-cmd)' \
288 > $(dot-target).tmp; \
289 rm -f $(depfile); \
290 mv -f $(dot-target).tmp $(dot-target).cmd;
291
292endif
293
267# Usage: $(call if_changed_rule,foo) 294# Usage: $(call if_changed_rule,foo)
268# Will check if $(cmd_foo) or any of the prerequisites changed, 295# Will check if $(cmd_foo) or any of the prerequisites changed,
269# and if so will execute $(rule_foo). 296# and if so will execute $(rule_foo).
diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c
index 7e90a1f7de0f..746ec1ece614 100644
--- a/scripts/basic/fixdep.c
+++ b/scripts/basic/fixdep.c
@@ -358,6 +358,7 @@ static void parse_dep_file(void *map, size_t len)
358 358
359 /* Ignore certain dependencies */ 359 /* Ignore certain dependencies */
360 if (strrcmp(s, "include/generated/autoconf.h") && 360 if (strrcmp(s, "include/generated/autoconf.h") &&
361 strrcmp(s, "include/generated/autoksyms.h") &&
361 strrcmp(s, "arch/um/include/uml-config.h") && 362 strrcmp(s, "arch/um/include/uml-config.h") &&
362 strrcmp(s, "include/linux/kconfig.h") && 363 strrcmp(s, "include/linux/kconfig.h") &&
363 strrcmp(s, ".ver")) { 364 strrcmp(s, ".ver")) {