Skip to content

Commit

Permalink
kbuild: fix call to adjust_autoksyms.sh when output directory specified
Browse files Browse the repository at this point in the history
When a different output directory is specified during the build process (with
O= or KBUILD_OUTPUT), the call to adjust_autoksyms.sh script fails with the
following error:
/bin/sh scripts/adjust_autoksyms.sh \
	  "make KBUILD_MODULES=1 -f ../Makefile autoksyms_recursive"
	  /bin/sh: scripts/adjust_autoksyms.sh: 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: Nicolas Ferre <[email protected]>
Fixes: 23121ca ("kbuild: create/adjust generated/autoksyms.h")
Cc: Nicolas Pitre <[email protected]>
Cc: Rusty Russell <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
  • Loading branch information
Nicolas Ferre authored and Michal Marek committed Apr 26, 2016
1 parent b42841b commit ba79d40
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,7 @@ quiet_cmd_link-vmlinux = LINK $@
# execute if the rest of the kernel build went well.
vmlinux: scripts/link-vmlinux.sh $(vmlinux-deps) FORCE
ifdef CONFIG_TRIM_UNUSED_KSYMS
$(Q)$(CONFIG_SHELL) scripts/adjust_autoksyms.sh \
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/adjust_autoksyms.sh \
"$(MAKE) KBUILD_MODULES=1 -f $(srctree)/Makefile autoksyms_recursive"
endif
ifdef CONFIG_HEADERS_CHECK
Expand All @@ -949,13 +949,13 @@ endif
+$(call if_changed,link-vmlinux)

autoksyms_recursive: $(vmlinux-deps)
$(Q)$(CONFIG_SHELL) scripts/adjust_autoksyms.sh \
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/adjust_autoksyms.sh \
"$(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/adjust_autoksyms.sh true
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/adjust_autoksyms.sh true

# Build samples along the rest of the kernel
ifdef CONFIG_SAMPLES
Expand Down

0 comments on commit ba79d40

Please sign in to comment.