Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp3454869imc; Wed, 13 Mar 2019 19:27:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqwzmZhhVYY22Mzra8GzUo22fQrvBm2wGmEnBMoDxyVfttV1WYHvu7UEOMw01qvNPOsXan4z X-Received: by 2002:a17:902:7b90:: with SMTP id w16mr49884197pll.228.1552530453081; Wed, 13 Mar 2019 19:27:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552530453; cv=none; d=google.com; s=arc-20160816; b=0poJz58r4XBbi6ivyHiZYWQOLSwfIFKqa+QNkNuXxWkpsPZEgLurID6T/pMRm+yW27 aPOHPsqn8fe6U1ZEeFx7f5VpcMBzbKr1SaGZRIis4g0Tqk8hit3Kr3bFVJ9uyMlejTgz tmClGPLumVqLMgYvX3aj4DcEmVJyUc+KraxTc2//MxZj3Z9ZNPkacLYoOp2mXwLeujWA QpyU5+t+RXjPT2Oj7tZPRwyBl+EUqzFLW0sbc0OR8RNAIgvkJMryx+rdp7kucBLOs6+t Sh7iiedYmb21baGw41/KyCxjzLUDsmr6YsHr+B/pfr6FInhRjxRjF5RE0j6U9mIlxxLk 5Fog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=rm9warFCcyvslrbnKZTKFaVAnXLTzZ9JqEPGwzpr9f4=; b=yYuRJk2sTlzIPvg6RF1XZjzwNGAjpcnrI7H4YfqGdA8Tdw2uHCefRr/4BblM4+TU/9 SwOuxo0lk0lQ8YCY735xqhkWFpSEedpZ4STK9FDDBE/e0l34ebYHxvuatPT9xJb2R+r1 034Hvgz6EvPz9uU502JSFcgmRyeRHr1XTXmdibn6zFODIAlLXwN35oF8xJ+dFynGT5kq NLWxclf5DNDJEcf0SQzMR0qdIueYHPzQa1ZaYYlEAlpJ5uoxto8F0qWPPYEJhxNqQ98i SNjBGPrDFItW/drqLO+R8WZp/vJpsoDPs+DBqYVpe+7e5RnAw/+g5cTzmTcNo8PTA2+z FoJg== 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 s8si3532035plr.165.2019.03.13.19.27.16; Wed, 13 Mar 2019 19:27:33 -0700 (PDT) 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 S1727076AbfCNCYJ (ORCPT + 99 others); Wed, 13 Mar 2019 22:24:09 -0400 Received: from ozlabs.org ([203.11.71.1]:53551 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726530AbfCNCYI (ORCPT ); Wed, 13 Mar 2019 22:24:08 -0400 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 44KXZt2snjz9s70; Thu, 14 Mar 2019 13:24:06 +1100 (AEDT) From: Michael Ellerman To: Mathieu Malaterre Cc: Masahiro Yamada , linuxppc-dev , Paul Mackerras , LKML Subject: Re: [PATCH] powerpc: use $(origin ARCH) to select KBUILD_DEFCONFIG In-Reply-To: References: <1550223519-18290-1-git-send-email-yamada.masahiro@socionext.com> Date: Thu, 14 Mar 2019 13:24:03 +1100 Message-ID: <87y35i9osc.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Mathieu Malaterre writes: > On Sat, Feb 16, 2019 at 3:26 AM Masahiro Yamada > wrote: >> >> On Sat, Feb 16, 2019 at 1:11 AM Mathieu Malaterre wrote: >> > >> > 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/ >> >> I did not know that because I do not subscribe to ppc ML. >> >> Michael's patch looks good to me. > > OK > >> >> If you mimic x86, the following will work: >> > > Nice! Michael do you have a preference ? Yeah I don't like playing games with ARCH. Doing so means auto builders and other build scripts need to learn about the special rules for ARCH, which is a pain. So I'll merge my patch, which I think will also work for Masahiro's case. cheers