Commit ba79d401 authored by Nicolas Ferre's avatar Nicolas Ferre Committed by Michal Marek

kbuild: fix call to when output directory specified

When a different output directory is specified during the build process (with
O= or KBUILD_OUTPUT), the call to script fails with the
following error:
/bin/sh scripts/ \
	  "make KBUILD_MODULES=1 -f ../Makefile autoksyms_recursive"
	  /bin/sh: scripts/ No such file or directory
	  make[2]: *** [vmlinux] Error 127
	  make[1]: *** [sub-make] Error 2
	  make: *** [__sub-make] Error 2

Using the absolute path with $(srctree) variable solves the problem.

This is in case the CONFIG_TRIM_UNUSED_KSYMS option is specified.
Signed-off-by: default avatarNicolas Ferre <>
Fixes: 23121ca2 ("kbuild: create/adjust generated/autoksyms.h")
Cc: Nicolas Pitre <>
Cc: Rusty Russell <>
Signed-off-by: default avatarMichal Marek <>
parent b42841b7
......@@ -934,7 +934,7 @@ quiet_cmd_link-vmlinux = LINK $@
# execute if the rest of the kernel build went well.
vmlinux: scripts/ $(vmlinux-deps) FORCE
$(Q)$(CONFIG_SHELL) scripts/ \
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/ \
"$(MAKE) KBUILD_MODULES=1 -f $(srctree)/Makefile autoksyms_recursive"
......@@ -949,13 +949,13 @@ endif
+$(call if_changed,link-vmlinux)
autoksyms_recursive: $(vmlinux-deps)
$(Q)$(CONFIG_SHELL) scripts/ \
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/ \
"$(MAKE) KBUILD_MODULES=1 -f $(srctree)/Makefile autoksyms_recursive"
PHONY += autoksyms_recursive
# standalone target for easier testing
include/generated/autoksyms.h: FORCE
$(Q)$(CONFIG_SHELL) scripts/ true
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/ true
# Build samples along the rest of the kernel
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment