Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp871263imj; Fri, 15 Feb 2019 08:10:01 -0800 (PST) X-Google-Smtp-Source: AHgI3Ia3Mm1noh3BZQktrfYgkpnpWzq3/2OwAV7tU7qMWLajkC1mOWL4z3wmtE+5V6RD5Kc+y47s X-Received: by 2002:a63:4b12:: with SMTP id y18mr6145136pga.340.1550247001150; Fri, 15 Feb 2019 08:10:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550247001; cv=none; d=google.com; s=arc-20160816; b=KkbuGh4AwztyDJYH6ZQH5/Dyz0QJZkhG0oUd33DgS9gPqqZXHqZqAfyJRVRI6H1xrJ isi5PvBhRU42/4svjav3CqxmrnEoFB7Hau0KYFVclMayKAMdgvsV0waANZ/G0oVs+7pB a3/rQDbCqdA1uOWWraczyZ+zxNu1lfBhEPoLpc9drXDEFPcNPJuztR3xj2UP1mN43YPe EGbsPGw0TbNJ/6hrW2FmiG1XG6NpXZEhQNP/+7Z1v2j0EvZwYpUjiDM/lFz+k52DJ/HZ 41hpVN0KWd5MFOB+0I9ki0aAPeasxsFt9i6YUVqDieMtZHOp0WnIz2badTyFn8SwZ4r+ lpvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=VJ1w0R223NOFMFs8jprELV7OmTbW2Ho0cuabQNPRrxs=; b=RklzGHAP+/iFp9Z1fBM8MaiIf4Y3vufKOvzlCX6Dd3eGgX0r3UfiRjTwJ0Q3lD+YFt HpkszYSpxetmuASudCweY2K2B9pDIXOTJbboFJM6Taa1gNiG/CSiQTgv6VUOZgal2UcD 1AXFW9p9F1zl0mPHrBpwoRleWwsIIbc+zedbeD67UFvVJiOIFrX94h5dNfQbAm4KSryl 93sKy/SxBZKtd/ne9dBP5wnFC5WRggi7lg4rFTezzCAEJ+tmtu51UXLQJh/fr1qtxl2l 40gAVTgaI0ldFc1iLo78Ioe5Y3sjHyDlbD2G1b7OAzdeAonIeG+sKArBBaMZJDEQ3TWb GFyA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l16si5753929pfb.68.2019.02.15.08.09.44; Fri, 15 Feb 2019 08:10:01 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389867AbfBOLAR (ORCPT + 99 others); Fri, 15 Feb 2019 06:00:17 -0500 Received: from mail-ot1-f68.google.com ([209.85.210.68]:45157 "EHLO mail-ot1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726160AbfBOLAR (ORCPT ); Fri, 15 Feb 2019 06:00:17 -0500 Received: by mail-ot1-f68.google.com with SMTP id 32so15765466ota.12 for ; Fri, 15 Feb 2019 03:00:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=VJ1w0R223NOFMFs8jprELV7OmTbW2Ho0cuabQNPRrxs=; b=NOPJRbLNLTpZqE3iDWg/fKVoWOSS7zoj45lzMRWDvgcffcd90Qa7a0fFDpKztYBVWG Su4S9AXlTNdwY1h0+HzAnUZvnnBLhEy6lqg8bJP4k4RlGa7yXCXZ72r3QAmIxU3nMRqD S9icKbZRLfhHgzg1cyDUSb/zpnYS+bIJ4JlQqLsMcw//WtKpT7e/W5SEVodxnlxSOufp WtEYred5LGm5mLo1KboTIYHKR9Wo1NpLbLE4/990aFGyYTBr9ivp2opD7sInyS7gQFTA PFBk2ZWFX0FflvyPX027Hgh38ODCtiagsXe2DgEdTRW0OP48YFZA1LKxCFc7BAdDJ9Gc vUng== X-Gm-Message-State: AHQUAuZHKeqpZd8478CjcPMic9lIysHNWhTWF5kifpIBNDcY/5Q+gN4X mZ+I8xIoXKghAwyOICYppppm2CwCc2xKNTZlt5p1gTeQ X-Received: by 2002:a9d:6acc:: with SMTP id m12mr5051127otq.300.1550228415864; Fri, 15 Feb 2019 03:00:15 -0800 (PST) MIME-Version: 1.0 References: <1550223519-18290-1-git-send-email-yamada.masahiro@socionext.com> In-Reply-To: <1550223519-18290-1-git-send-email-yamada.masahiro@socionext.com> From: Mathieu Malaterre Date: Fri, 15 Feb 2019 12:00:04 +0100 Message-ID: Subject: Re: [PATCH] powerpc: use $(origin ARCH) to select KBUILD_DEFCONFIG To: Masahiro Yamada Cc: linuxppc-dev , Michael Ellerman , Paul Mackerras , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 15, 2019 at 10:41 AM Masahiro Yamada wrote: > > I often test all Kconfig commands for all architectures. To ease my > workflow, I want 'make defconfig' at least working without any cross > compiler. > > Currently, arch/powerpc/Makefile checks CROSS_COMPILE to decide the > default defconfig source. > > If CROSS_COMPILE is unset, it is likely to be the native build, so > 'uname -m' is useful to choose the defconfig. If CROSS_COMPILE is set, > the user is cross-building (i.e. 'uname -m' is probably x86_64), so > it falls back to ppc64_defconfig. Yup, make sense. > > However, I want to run 'make ARCH=* defconfig' without setting > CROSS_COMPILE for each architecture. > > My suggestion is to check $(origin ARCH). > > When you cross-compile the kernel, you need to set ARCH from your > environment or from the command line. > > For the native build, you do not need to set ARCH. The default in > the top Makefile is used: > > ARCH ?= $(SUBARCH) > > Hence, $(origin ARCH) returns 'file'. > > Before this commit, 'make ARCH=powerpc defconfig' failed: In case you have not seen it, please check: http://patchwork.ozlabs.org/patch/1037835/ > $ make ARCH=powerpc defconfig > *** Default configuration is based on target 'x86_64_defconfig' > *** > *** Can't find default configuration "arch/powerpc/configs/x86_64_defconfig"! > *** > > After this commit, it will succeed: > > $ make ARCH=powerpc defconfig > *** Default configuration is based on 'ppc64_defconfig' > # > # configuration written to .config > # > > Signed-off-by: Masahiro Yamada > --- > > arch/powerpc/Makefile | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile > index ac03334..f989979 100644 > --- a/arch/powerpc/Makefile > +++ b/arch/powerpc/Makefile > @@ -34,7 +34,7 @@ ifdef CONFIG_PPC_BOOK3S_32 > KBUILD_CFLAGS += -mcpu=powerpc > endif > > -ifeq ($(CROSS_COMPILE),) > +ifeq ($(origin ARCH), file) > KBUILD_DEFCONFIG := $(shell uname -m)_defconfig > else > KBUILD_DEFCONFIG := ppc64_defconfig > -- > 2.7.4 >