Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp853048imj; Fri, 15 Feb 2019 07:53:41 -0800 (PST) X-Google-Smtp-Source: AHgI3Ia97i9Q8os4957cZEA96PYjg3bW5pSWOPcPIp+npEZRI+0bhjVMKw2kIFL/BIEveS0Rh8m3 X-Received: by 2002:a62:ed15:: with SMTP id u21mr10413565pfh.38.1550246021879; Fri, 15 Feb 2019 07:53:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550246021; cv=none; d=google.com; s=arc-20160816; b=bZGpaEZxm5/zchKRk10xLOzoSZTiPYIlrCmKtessk5/BJHtDPw0l+43RYNm4uuKddK hnhBQ7VisWqKcBSRWKBGgcDdgFj6yBgsLlSsWnmup/MSVsvegf3wDx/4HpmG1YNwNl4y GFlfuzUMklCOLPnqzu8Z4T4xg+q3aVwdR1rryGiGmeMEBMUbvjtbxKvTqJEEBhBNzxrn dgVY6+7SCQguf1jbwB5V4eiKLnG/v27+7FNd2lpwErwFOjrpQBtgfufhk66vDMvQy311 7zkyxG6CKiVGuHvNJ0M2P950rHK9KabaGW1ltDBpYkfKHZdeFkWuS+EvOqfg9gTp8kQG lm/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=CBamstatH6SEE8PkWAfApJMSUCvf06iKMWQVXEv6Ou4=; b=AYpcs1pYM2E+76rn9nDEMVeieweJrdYkqSfqfvrc1h8WBWJ4k+Pjfech6d5f+DTuz4 7F+ANxwhhnnkyxqLq/sd7sGWed1HfBKfVITXwl08dLAq9sW6yDUSe5yUOeNKuf0dd8Kr lcdQoWliQM4EVcYcHdnedxgT0/bGfVbrbYjZpn1eZ04FPKWMhvuByBMe7UvdZxzdNFFZ VAZpodhA0O9NAUqzB+HtIaYk8VG+Dx2TH6kpYTbjK4v4KfoCe21dsQ+Khb+Ice0MSi85 4khHfVNBXEeydJFRnEGwtYJnNy1eUcKwXff8FzAdelqsO/RfwPevkTBcuznq5VWVkKr9 pY6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=F46UDRvV; 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 e3si5761047pfe.203.2019.02.15.07.53.26; Fri, 15 Feb 2019 07:53:41 -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; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=F46UDRvV; 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 S2405089AbfBOJkE (ORCPT + 99 others); Fri, 15 Feb 2019 04:40:04 -0500 Received: from conuserg-12.nifty.com ([210.131.2.79]:28898 "EHLO conuserg-12.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405074AbfBOJkD (ORCPT ); Fri, 15 Feb 2019 04:40:03 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-12.nifty.com with ESMTP id x1F9cjfD023550; Fri, 15 Feb 2019 18:38:45 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com x1F9cjfD023550 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1550223525; bh=CBamstatH6SEE8PkWAfApJMSUCvf06iKMWQVXEv6Ou4=; h=From:To:Cc:Subject:Date:From; b=F46UDRvVm7YksAnE4Oui19Xld7f5miS164qgKp5ux/DJJOv8ypGdOg8waEhgdRm01 CA00J8OR8WADqiOGzzFfDIfz4QsEa4QA86HFEnxmkNOok2mI0CWDOXnUrt4lgFpnPs PEl3CfjKBdQma0RWR/6N5+zvxL/cmR9EzDUAg9Frar4oo6FBVl5W54CZgNh5aulO/U vYW1w7LPYuuj8nr6qx/f2pbPMPN9+7aanLbHdx0rWUxoxRq15bQEOWRvJn3ckSZM3b NfnAbrk3v4M6cPfrIti68xhAh9wfq6ryLQfNL30JesTZQAPQ8KNQ4FXCSNtM6Oi+CB VwrZEIBe2w8JA== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linuxppc-dev@lists.ozlabs.org, Michael Ellerman Cc: Masahiro Yamada , Paul Mackerras , Benjamin Herrenschmidt , linux-kernel@vger.kernel.org Subject: [PATCH] powerpc: use $(origin ARCH) to select KBUILD_DEFCONFIG Date: Fri, 15 Feb 2019 18:38:39 +0900 Message-Id: <1550223519-18290-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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: $ 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