From patchwork Sat Jul 7 12:13:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 10512865 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C64DD603D7 for ; Sat, 7 Jul 2018 12:41:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B227828874 for ; Sat, 7 Jul 2018 12:41:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A411D28880; Sat, 7 Jul 2018 12:41:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3A38528874 for ; Sat, 7 Jul 2018 12:41:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753529AbeGGMlP (ORCPT ); Sat, 7 Jul 2018 08:41:15 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:43825 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753316AbeGGMlP (ORCPT ); Sat, 7 Jul 2018 08:41:15 -0400 Received: by mail-pf0-f193.google.com with SMTP id y8-v6so10500612pfm.10 for ; Sat, 07 Jul 2018 05:41:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kOjSgIx2zjhNSuHo2oVFLQRByPu6bWNJLFho66k8fv0=; b=bwC1/4NeGpzbJLggNPxQUtDtoB7YHuSO2bzoB2lW2xip/HNjlp9TSeAj3zqOImM6N0 49pxBqrlljo94vx+sUweKk2Gs1KhZ6rS00q3tLQCAw3r7s1MxfmEQsZBCWQY+8ADi+pd EtEa2iEG9Xax8LNFD0pVO2kFkDJsxOvqNWUBLV0TPTT72vil/ltjwl69EcJ+wtWYD6KA so3oxWtqS2Q/t410OPY3Vho1FzaJq4+//0I7pqg/XkYNRto+WEIoqcZ5Afg7omwAhfzE z74ggAoP3tL33OTNYkZsq31KssnCC97hK/q8m+ovm2/hdfSyDZktCLazZPYhetJwsFKx IThg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kOjSgIx2zjhNSuHo2oVFLQRByPu6bWNJLFho66k8fv0=; b=YCfzjCXYWFBbs90YG2K+e6+h6zd+BM4P24Ou3m8gWuAwrnpCzZd91emp8xsskDoa4F xiV90p7PYsKGjvoZFEq2nS2w1h86iGWGoZGyAnjCIhWBpzCWxVCqNSDvMiVd4aSn1tLx FdGWtA193n9FavNTtEj/2xyhf29laSaJocXZWQ4N5rJuDtcfWFrUYP4wz6nLCtAwe83b KQEIu44kl4n/+Ma/YRBCF5HOefi+N0rntP1nnYjSF64Wsv36tLR0bPgJK/r9ixWl06NQ vrUMJd8zXN0EHkFIUTILhs7+4oOS31aMPDQAxJ3LyfPDAMaXBDXpvmbNn4t+SmxszovU +y+Q== X-Gm-Message-State: APt69E2WLSYtPKEZD2PgHC7KZPdgFUayVFUKV/OukaQsBJL0WBEF0yv7 ZLSEicxk3oQzvt9oK3jV+JY= X-Google-Smtp-Source: AAOMgpfEj2RaYbXfsPNz3wPeaDw3gI1hUCLLTUQGSsEePRQoDI5n+LWA91Nob79vEl//UoJAzzUILA== X-Received: by 2002:a62:c699:: with SMTP id x25-v6mr14370092pfk.16.1530965603119; Sat, 07 Jul 2018 05:13:23 -0700 (PDT) Received: from roar.ozlabs.ibm.com (ppp121-45-208-163.bras1.cbr2.internode.on.net. [121.45.208.163]) by smtp.gmail.com with ESMTPSA id c72-v6sm21850556pga.69.2018.07.07.05.13.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 07 Jul 2018 05:13:22 -0700 (PDT) Date: Sat, 7 Jul 2018 22:13:16 +1000 From: Nicholas Piggin To: Randy Dunlap Cc: Benjamin Herrenschmidt , linux-kbuild , Paul Mackerras , linuxppc-dev@lists.ozlabs.org, Stephen Rothwell Subject: Re: powerpc: 32BIT vs. 64BIT (PPC32 vs. PPC64) Message-ID: <20180707221316.5b75e075@roar.ozlabs.ibm.com> In-Reply-To: <4f3a5969-88d5-134d-508d-7617947c588c@infradead.org> References: <3f906b03-98ff-c081-4e19-b490f0b35c51@infradead.org> <4f3a5969-88d5-134d-508d-7617947c588c@infradead.org> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Fri, 6 Jul 2018 21:58:29 -0700 Randy Dunlap wrote: > On 07/06/2018 06:45 PM, Benjamin Herrenschmidt wrote: > > On Thu, 2018-07-05 at 14:30 -0700, Randy Dunlap wrote: > >> Hi, > >> > >> Is there a good way (or a shortcut) to do something like: > >> > >> $ make ARCH=powerpc O=PPC32 [other_options] allmodconfig > >> to get a PPC32/32BIT allmodconfig > >> > >> and also be able to do: > >> > >> $make ARCH=powerpc O=PPC64 [other_options] allmodconfig > >> to get a PPC64/64BIT allmodconfig? > > > > Hrm... O= is for the separate build dir, so there much be something > > else. > > > > You mean having ARCH= aliases like ppc/ppc32 and ppc64 ? > > Yes. > > > That would be a matter of overriding some .config defaults I suppose, I > > don't know how this is done on other archs. > > > > I see the aliasing trick in the Makefile but that's about it. > > > >> Note that arch/x86, arch/sh, and arch/sparc have ways to do > >> some flavor(s) of this (from Documentation/kbuild/kbuild.txt; > >> sh and sparc based on a recent "fix" patch from me): > > > > I fail to see what you are actually talking about here ... sorry. Do > > you have concrete examples on x86 or sparc ? From what I can tell the > > "i386" or "sparc32/sparc64" aliases just change SRCARCH in Makefile and > > 32 vs 64-bit is just a Kconfig option... > > Yes, your summary is mostly correct. > > I'm just looking for a way to do cross-compile builds that are close to > ppc32 allmodconfig and ppc64 allmodconfig. Would there a problem with adding ARCH=ppc32 / ppc64 matching? This seems to work... Thanks, Nick --- Makefile | 8 ++++++++ arch/powerpc/Kconfig | 9 +++++++++ arch/powerpc/platforms/Kconfig.cputype | 8 -------- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index c5ce55cbc543..f97204aed17a 100644 --- a/Makefile +++ b/Makefile @@ -345,6 +345,14 @@ ifeq ($(ARCH),sh64) SRCARCH := sh endif +# Additional ARCH settings for powerpc +ifeq ($(ARCH),ppc32) + SRCARCH := powerpc +endif +ifeq ($(ARCH),ppc64) + SRCARCH := powerpc +endif + KCONFIG_CONFIG ?= .config export KCONFIG_CONFIG diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 9f2b75fe2c2d..3405b1b122be 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -1,4 +1,13 @@ # SPDX-License-Identifier: GPL-2.0 + +config PPC64 + bool "64-bit kernel" if "$(ARCH)" = "powerpc" + default "$(ARCH)" != "ppc32" + select ZLIB_DEFLATE + help + This option selects whether a 32-bit or a 64-bit kernel + will be built. + source "arch/powerpc/platforms/Kconfig.cputype" config PPC32 diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype index e6a1de521319..f6e5d6ef9782 100644 --- a/arch/powerpc/platforms/Kconfig.cputype +++ b/arch/powerpc/platforms/Kconfig.cputype @@ -1,12 +1,4 @@ # SPDX-License-Identifier: GPL-2.0 -config PPC64 - bool "64-bit kernel" - default n - select ZLIB_DEFLATE - help - This option selects whether a 32-bit or a 64-bit kernel - will be built. - menu "Processor support" choice prompt "Processor Type"