Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1845230pxb; Thu, 16 Sep 2021 17:41:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxlOs9BCm74UhtAMBHntKnQMRSds3Z+5zgyElrJEgRme4ep92bT7UK8HGfaXyTa5cqjAjp2 X-Received: by 2002:aa7:d895:: with SMTP id u21mr9448443edq.300.1631839269186; Thu, 16 Sep 2021 17:41:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631839269; cv=none; d=google.com; s=arc-20160816; b=gNdQRdg8ZoFEMMUOd1CEX40OwIq2AspLtLbTwDIZOi2MlLrteC2HCysXnaCVEkwRk2 I1jvPT309z6+0kt0uP3uXyDo8xDy4XZZMJ9AlDW7bqbnyjioNATEIf6f2m5I9akvy2l7 Zwf6ocF/3ESdQzntkTZodhQhfhUhgo9QJdD8jQ5QItRfMdUN1vCrJsSAF/sxqgFFqAtX 98s5W9jS7snaWzf4XAMWxVOzg+vIGnKgRUGRpLaskDZxv1j1uKHOPkgOrgF7pDj1nKNl 8vYWlA8qUTgcXGEzHiXV3iG/VwcNZlyBlQWlCRGxKR12zviipxS78kMeGlbGrbTINnKg JDzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=923c2owiorb7t5xP0IP7IMWd0gNdQJYcd2R6EuvOnHw=; b=ij4mSJ4rYnaeZeI+VJMBPPYu7BXu7OrviBaFKpntTzPsCzXuqm5tYMYZYrkoJikkcW uaNRlwuWgBJPuQjlv+JZhr4jKEpue8YRAsR+6AOedPxuP4zanCfC9FsZZYz/QQr1vbYR hRaz9ig1TRKWoZ8gvhO4OajwnQTiA/wIQ/+oriIjZlM0cjLPCvvv29uoZeki8+F4eTqe DAfwPReOonhndzkXEM4ig+8A4d0CRkyaaE/rWLmH1W5n+rnwo8auhzAJwS2Gn3x2y6Xd 8zIYgQ2vjcVRd0zQ6L9XSoKzb58YVNx8BGgplaoQoTF3EZc+rme5syUjI3sxMJmJLj4t UsEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GlkzpCrZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q5si5185470ejt.588.2021.09.16.17.40.45; Thu, 16 Sep 2021 17:41:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GlkzpCrZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349542AbhIPRGA (ORCPT + 99 others); Thu, 16 Sep 2021 13:06:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:34012 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347834AbhIPRAo (ORCPT ); Thu, 16 Sep 2021 13:00:44 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id EBB696187D; Thu, 16 Sep 2021 16:32:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631809964; bh=2FUurahQuMNoqoxElWAAqPLgyzavMl4Nm2d4EpBcabs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GlkzpCrZ8OrbZvmzV5h7RvxFOaeLz6w4bADw7cUmyeLsWT/VKQP5yvtcAAJ5vRMWz UFb0yvx5sTw997IZePV37aJGKGvPg0dc8rfZ7RfqoQKDWZ8F3b2EBTdmy+8+pBe3OI RNZizlkAZ4ry5JMVeqI9IYHfFykrXYc8A7VXXve8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Masahiro Yamada , Meelis Roos , Helge Deller Subject: [PATCH 5.13 347/380] parisc: Fix compile failure when building 64-bit kernel natively Date: Thu, 16 Sep 2021 18:01:44 +0200 Message-Id: <20210916155815.856052394@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155803.966362085@linuxfoundation.org> References: <20210916155803.966362085@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Masahiro Yamada commit 5f6e0fe01b6b33894cf6f61b359ab5a6d2b7674e upstream. Commit 23243c1ace9f ("arch: use cross_compiling to check whether it is a cross build or not") broke 64-bit parisc builds on 32-bit parisc systems. Helge mentioned: - 64-bit parisc userspace is not supported yet [1] - hppa gcc does not support "-m64" flag [2] That means, parisc developers working on a 32-bit parisc machine need to use hppa64-linux-gnu-gcc (cross compiler) for building the 64-bit parisc kernel. After the offending commit, gcc is used in such a case because both $(SRCARCH) and $(SUBARCH) are 'parisc', hence cross_compiling is unset. A correct way is to introduce ARCH=parisc64 because building the 64-bit parisc kernel on a 32-bit parisc system is not exactly a native build, but rather a semi-cross build. [1]: https://lore.kernel.org/linux-parisc/5dfd81eb-c8ca-b7f5-e80e-8632767c022d@gmx.de/#t [2]: https://lore.kernel.org/linux-parisc/89515325-fc21-31da-d238-6f7a9abbf9a0@gmx.de/ Fixes: 23243c1ace9f ("arch: use cross_compiling to check whether it is a cross build or not") Signed-off-by: Masahiro Yamada Reported-by: Meelis Roos Tested-by: Meelis Roos Cc: # v5.13+ Signed-off-by: Helge Deller Signed-off-by: Greg Kroah-Hartman --- Makefile | 5 +++++ arch/parisc/Makefile | 6 +++--- scripts/subarch.include | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) --- a/Makefile +++ b/Makefile @@ -404,6 +404,11 @@ ifeq ($(ARCH),sparc64) SRCARCH := sparc endif +# Additional ARCH settings for parisc +ifeq ($(ARCH),parisc64) + SRCARCH := parisc +endif + export cross_compiling := ifneq ($(SRCARCH),$(SUBARCH)) cross_compiling := 1 --- a/arch/parisc/Makefile +++ b/arch/parisc/Makefile @@ -25,18 +25,18 @@ CHECKFLAGS += -D__hppa__=1 ifdef CONFIG_64BIT UTS_MACHINE := parisc64 CHECKFLAGS += -D__LP64__=1 -CC_ARCHES = hppa64 LD_BFD := elf64-hppa-linux else # 32-bit -CC_ARCHES = hppa hppa2.0 hppa1.1 LD_BFD := elf32-hppa-linux endif # select defconfig based on actual architecture -ifeq ($(shell uname -m),parisc64) +ifeq ($(ARCH),parisc64) KBUILD_DEFCONFIG := generic-64bit_defconfig + CC_ARCHES := hppa64 else KBUILD_DEFCONFIG := generic-32bit_defconfig + CC_ARCHES := hppa hppa2.0 hppa1.1 endif export LD_BFD --- a/scripts/subarch.include +++ b/scripts/subarch.include @@ -7,7 +7,7 @@ SUBARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ \ -e s/sun4u/sparc64/ \ -e s/arm.*/arm/ -e s/sa110/arm/ \ - -e s/s390x/s390/ -e s/parisc64/parisc/ \ + -e s/s390x/s390/ \ -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \ -e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ \ -e s/riscv.*/riscv/)