From patchwork Thu May 10 05:16:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 10391147 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 A6CD66028E for ; Thu, 10 May 2018 05:17:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9642028867 for ; Thu, 10 May 2018 05:17:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8AEE628870; Thu, 10 May 2018 05:17:15 +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 2FB1A28866 for ; Thu, 10 May 2018 05:17:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756118AbeEJFRO (ORCPT ); Thu, 10 May 2018 01:17:14 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:35092 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756220AbeEJFRO (ORCPT ); Thu, 10 May 2018 01:17:14 -0400 Received: by mail-pf0-f196.google.com with SMTP id x9-v6so495238pfm.2 for ; Wed, 09 May 2018 22:17:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=FyO3bzMfEw25DeEsOTk+bg5WL2XofS1Dxm3ciQ4eolE=; b=SnMIlycGcL6+Yq+3y18qYBQfgtsStQ5Se6p4EVQ66xBoSvtPrgVRVdsYOkgBO1Zqae HRlJ8oiPqbiRv6MSoKLa3pArcEQgQ7bK19ZhVKW3cwvb4dz2dqG6LR9nSzT9SgVQJEiT YT6uDIRkJIj8VieNwehD1XeNcC3uBP1lz1WJ8GLBT6kbGxbhK1hbJuAqgcC2zxANueFr OFXj7k0QjGCemJXs3GTMJb8Tk1z1aXHkPzVkRHBJdnKd4Q9WWd3wr62F5OjBzU27DELs EuQ8DSLndnl/zrzb5/Qev8pQIYC1/EKxmYv4r+IlrPQs/J2DgebPGqylYXI7J3GyMNg7 Nptw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=FyO3bzMfEw25DeEsOTk+bg5WL2XofS1Dxm3ciQ4eolE=; b=AMM1066FpaPwomlVLx0L/YdDHPk7u46nEsEJwGkv+dxWsM/Yb8X9zJOW21ZfZxpbXF YOIWauZzwYzXOUfI1vpbmEdS+a3skuROTJkophk9Bhv2FABYfjBNTz0hABnVcwu1D97x d4bVqyiuIRQvqpxTg/g+FJ4WDSQGPEGnYGzZ4ZcMCJMAZT5m8hT23hmFM9wPn70yHzuX iocmGoT+KpQ4t0LNEXbR8lboEwz1jG4zHX20rTFsPYWpZQfgUPVvRlS2VQleRx0PYiiR CkJtbBe8QwrCkag1vaf2MBDMq1QfBW5vXCCcuYfs2jU9f5A1K4h01EbP0G8A0vJFc4Wi 9n+g== X-Gm-Message-State: ALQs6tCWxVpWXXSezceYorF1G6NkNclJ13mvkhs7hW6eMiTjisvGsaW/ L3ZGXFlUMJ06FXLpF6gT3PNEtA== X-Google-Smtp-Source: AB8JxZrNwngXjOISf0Bwb8a1+iLrqSRyJmns8eOD1VbH033qAtMjJbGNVD2g3BunNFnO9d3y0PTs3A== X-Received: by 10.98.253.18 with SMTP id p18mr27676192pfh.152.1525929433285; Wed, 09 May 2018 22:17:13 -0700 (PDT) Received: from roar.au.ibm.com (59-102-70-78.tpgi.com.au. [59.102.70.78]) by smtp.gmail.com with ESMTPSA id a7-v6sm8922265pgc.68.2018.05.09.22.17.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 May 2018 22:17:12 -0700 (PDT) From: Nicholas Piggin To: linux-kbuild@vger.kernel.org Cc: Nicholas Piggin , Masahiro Yamada , linuxppc-dev@lists.ozlabs.org Subject: [PATCH v2 1/5] powerpc/kbuild: set default generic machine type for 32-bit compile Date: Thu, 10 May 2018 15:16:55 +1000 Message-Id: <20180510051659.15356-2-npiggin@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180510051659.15356-1-npiggin@gmail.com> References: <20180510051659.15356-1-npiggin@gmail.com> 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 The 64-bit toolchain uses the wrong ISA variant for compiling 32-bit kernels, eve with -m32. Set -mcpu=powerpc which is the generic 32-bit powerpc machine type and scheduling model. 32-bit platforms and CPUs can override this with -mcpu= options that come later on the command line. This fixes a lot of build failures due to incompatible assembly when compiling 32-bit kernel with 64-bit toolchain. Signed-off-by: Nicholas Piggin --- arch/powerpc/Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index 95813df90801..7034b1ad50e0 100644 --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile @@ -27,6 +27,14 @@ KBUILD_ARFLAGS += --target=elf32-powerpc endif endif +ifdef CONFIG_PPC32 +# These options will be overridden by any -mcpu option that comes +# later on the command line, but they are needed to set a sane +# 32-bit cpu target for the 64-bit cross compiler. +KBUILD_CFLAGS += -mcpu=powerpc +KBUILD_AFLAGS += -mcpu=powerpc +endif + export CROSS32CC CROSS32AR ifeq ($(CROSS_COMPILE),)