From patchwork Mon Apr 25 15:55:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Ferre X-Patchwork-Id: 8930221 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id EDF0DBF29F for ; Mon, 25 Apr 2016 15:54:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 10D2F201EC for ; Mon, 25 Apr 2016 15:54:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8A731201C7 for ; Mon, 25 Apr 2016 15:54:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932833AbcDYPyh (ORCPT ); Mon, 25 Apr 2016 11:54:37 -0400 Received: from eusmtp01.atmel.com ([212.144.249.242]:51114 "EHLO eusmtp01.atmel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932723AbcDYPyg (ORCPT ); Mon, 25 Apr 2016 11:54:36 -0400 Received: from tenerife.corp.atmel.com (10.161.101.13) by eusmtp01.atmel.com (10.161.101.30) with Microsoft SMTP Server id 14.3.235.1; Mon, 25 Apr 2016 17:54:32 +0200 From: Nicolas Ferre To: , , , CC: , Nicolas Ferre , Rusty Russell Subject: [PATCH] kbuild: fix call to adjust_autoksyms.sh when output directory specified Date: Mon, 25 Apr 2016 17:55:08 +0200 Message-ID: <1461599708-1397-1-git-send-email-nicolas.ferre@atmel.com> X-Mailer: git-send-email 2.1.3 MIME-Version: 1.0 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Fixes: 23121ca2b56b ("kbuild: create/adjust generated/autoksyms.h") Cc: Nicolas Pitre Cc: Rusty Russell --- Hi Nicolas, I found this issue while running on today's Linux-next with my ARM cross-compiler. I suspect it's the proper way to fix the issue but I may miss some of the details of the top kernel Makefile. It does work for my separated output directory setup and I verified it still compiles an in-sources setup as well (even if it's obvious...). Bye, Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index c3937c5ae3b8..1c26b410ba7b 100644 --- a/Makefile +++ b/Makefile @@ -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 @@ -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