From patchwork Thu Oct 15 06:05:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Ellerman X-Patchwork-Id: 7401961 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 84F3E9F1B9 for ; Thu, 15 Oct 2015 06:06:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A4B20209E6 for ; Thu, 15 Oct 2015 06:06:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AB637209E5 for ; Thu, 15 Oct 2015 06:06:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932449AbbJOGFz (ORCPT ); Thu, 15 Oct 2015 02:05:55 -0400 Received: from ozlabs.org ([103.22.144.67]:37357 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755142AbbJOGFy (ORCPT ); Thu, 15 Oct 2015 02:05:54 -0400 Received: by ozlabs.org (Postfix, from userid 1034) id 699111402D5; Thu, 15 Oct 2015 17:05:53 +1100 (AEDT) From: Michael Ellerman To: Cc: Olof Johannsson , , linux-kbuild@vger.kernel.org, yann.morin.1998@free.fr, mmarek@suse.com Subject: [PATCH] scripts/kconfig/Makefile: Fix KBUILD_DEFCONFIG check when building with O= Date: Thu, 15 Oct 2015 17:05:50 +1100 Message-Id: <1444889150-23609-1-git-send-email-mpe@ellerman.id.au> X-Mailer: git-send-email 2.1.4 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_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 My recent commit d2036f30cfe1 ("scripts/kconfig/Makefile: Allow KBUILD_DEFCONFIG to be a target"), contained a bug in that when it checks if KBUILD_DEFCONFIG is a file it forgets to prepend $(srctree) to the path. This causes the build to fail when building out of tree (with O=), and when the value of KBUILD_DEFCONFIG is 'defconfig'. In that case we will fail to find the 'defconfig' file, because we look in the build directory not $(srctree), and so we will call Make again with 'defconfig' as the target. From there we loop infinitely calling 'make defconfig' again and again. The fix is simple, we need to look for the file under $(srctree). Fixes: d2036f30cfe1 ("scripts/kconfig/Makefile: Allow KBUILD_DEFCONFIG to be a target") Reported-by: Olof Johansson Signed-off-by: Michael Ellerman Acked-by: Michal Marek --- scripts/kconfig/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) This works for me and is a minimal fix. I'll merge this into the powerpc#next branch unless anyone yells. diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index b2b9c87cec50..3043d6b0b51d 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -96,7 +96,7 @@ savedefconfig: $(obj)/conf defconfig: $(obj)/conf ifeq ($(KBUILD_DEFCONFIG),) $< $(silent) --defconfig $(Kconfig) -else ifneq ($(wildcard arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)),) +else ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)),) @$(kecho) "*** Default configuration is based on '$(KBUILD_DEFCONFIG)'" $(Q)$< $(silent) --defconfig=arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) $(Kconfig) else