From patchwork Fri Feb 15 09:38:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 1042688 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4417YP6KtBz9s7h for ; Fri, 15 Feb 2019 20:40:57 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=socionext.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=nifty.com header.i=@nifty.com header.b="F46UDRvV"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4417YP5JhXzDq9V for ; Fri, 15 Feb 2019 20:40:57 +1100 (AEDT) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=softfail (mailfrom) smtp.mailfrom=socionext.com (client-ip=210.131.2.79; helo=conuserg-12.nifty.com; envelope-from=yamada.masahiro@socionext.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=socionext.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=nifty.com header.i=@nifty.com header.b="F46UDRvV"; dkim-atps=neutral Received: from conuserg-12.nifty.com (conuserg-12.nifty.com [210.131.2.79]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4417Wj6XbnzDqfB for ; Fri, 15 Feb 2019 20:39:29 +1100 (AEDT) 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 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 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masahiro Yamada , Paul Mackerras , linux-kernel@vger.kernel.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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