Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp304195rwa; Sat, 20 Aug 2022 04:12:58 -0700 (PDT) X-Google-Smtp-Source: AA6agR7TmxaoF2D5Qn/WAJERpx4V8fpctJ8+9/ZMUbUv2wVIMBAR/cVtTKrD2R6fJR7WP+ySWdjt X-Received: by 2002:a17:90a:ad45:b0:1fa:f352:4522 with SMTP id w5-20020a17090aad4500b001faf3524522mr5782170pjv.176.1660993978187; Sat, 20 Aug 2022 04:12:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660993978; cv=none; d=google.com; s=arc-20160816; b=wstcmt6mZLoIiGRFY4MsAtc/icB1TZmVHZVZBcjwePs2yYK5Rq0OtG3QL5I+xpH3BQ VLvBhwIBHcPAe68+U2UMNel+lhHGxosEXa8xlGqJKvmkK0kWNX0G6ogdBzbtVc+n+pUw 0f1b78mKonQM3ybyLHcK3sp2m9gVXMKZu1KjewMIb7GpMGInFyhe76KBVLbNXQXTbjZw Vck03aNX3jFyAI2pzj/HUeSfDZsitoyg7IgBus5q7ss7y+B3wB+MTDhE0q82o9MaSZzt IghNnaFEqsPgr/cLMulOd+za6WF2kI2bvBf7ViBpJah/m+QyfFnFwjFlV4uhsPPTinp/ r2CQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=u9OLl/wbUdFSOcC2477jtGo/AL1HaS+VbUbJe0DQu6s=; b=xIjhlqmNFVi7ohknsSXXSRUpOJij9GA4lx265x1xCXl1UQvIK6kk+SSSoajkSnpvF8 WFaL6g0xplh2A8u9WcHEg01JMjBWZ9tnTfz8sDjjvI8/1YJPH8Vp2eALFNtiFGmzkfTe Vbsm4GcZufbvWm0S0+FzndS4/UVpPRc5u9GsQgejdn1hwSDEHueaOo0/PwvmXTl4ARVX HwiSEUhiOjQa8BZdjfZ0fekW/CLKyrZnTbe3Rjy5gYkD93ziA4gUXobtqV26+Xg7b2qy gEt6Qcft1zddjG+TLxN7UEFkDhaM2PokGLtDGiXgrB5djiV7TXugsE69/KzpwGJKzItd mrYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mN+Ksxc2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n65-20020a632744000000b0041cacade866si4816213pgn.503.2022.08.20.04.12.46; Sat, 20 Aug 2022 04:12:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mN+Ksxc2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345408AbiHTKzW (ORCPT + 99 others); Sat, 20 Aug 2022 06:55:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344182AbiHTKzR (ORCPT ); Sat, 20 Aug 2022 06:55:17 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF1B39AF94 for ; Sat, 20 Aug 2022 03:55:15 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 5F6B4B8013A for ; Sat, 20 Aug 2022 10:55:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DB381C433D6; Sat, 20 Aug 2022 10:55:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1660992913; bh=3N+NDI2cJKh99li5pLUDKXcxy68n6z1/LP/ToJrkZTg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=mN+Ksxc2YnQIljxsn1KYA946GXSecuBUHJZgu9vmtUcaRpOCEvidcVsRanc/EYlAZ zvSM4RhT6UxCWmLHN3BQE2dSwWHdV70BUZFY6uJ9F0g5l5VZ6+maBCkngsl5hVNyy+ 8KFe94cU9OjV/d57FF4HJ6X30Bn+phJPA861qYCidDPfhWpSdACNDvbwSmmNMkKyJl CcibQczNDY+20GaJlKgQUHd3xWgYHaLBZ1cEYiSriA4vRFjuiS00IwTq/Z7vPTPtFB HxidjPFAI1dgYmtaKjwAmf5fO/l5hDHTA6+UEFb3lIrVAloCNOI00S449zcXRoOAWV 3LW0t29D6lvnQ== Received: by pali.im (Postfix) id 3FEF75D0; Sat, 20 Aug 2022 12:55:10 +0200 (CEST) Date: Sat, 20 Aug 2022 12:55:10 +0200 From: Pali =?utf-8?B?Um9ow6Fy?= To: Christophe Leroy Cc: Michael Ellerman , Nicholas Piggin , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Arnd Bergmann , Segher Boessenkool Subject: Re: [PATCH v1 2/5] powerpc/32: Don't always pass -mcpu=powerpc to the compiler Message-ID: <20220820105510.psagglbbfyve53fc@pali> References: <8abab4888da69ff78b73a56f64d9678a7bf684e9.1657549153.git.christophe.leroy@csgroup.eu> <20220818174634.6nkzcztzn6uqcrzg@pali> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220818174634.6nkzcztzn6uqcrzg@pali> User-Agent: NeoMutt/20180716 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thursday 18 August 2022 19:46:34 Pali Rohár wrote: > On Monday 11 July 2022 16:19:30 Christophe Leroy wrote: > > Since commit 4bf4f42a2feb ("powerpc/kbuild: Set default generic > > machine type for 32-bit compile"), when building a 32 bits kernel > > with a bi-arch version of GCC, or when building a book3s/32 kernel, > > the option -mcpu=powerpc is passed to GCC at all time, relying on it > > being eventually overriden by a subsequent -mcpu=xxxx. > > > > But when building the same kernel with a 32 bits only version of GCC, > > that is not done, relying on gcc being built with the expected default > > CPU. > > > > This logic has two problems. First, it is a bit fragile to rely on > > whether the GCC version is bi-arch or not, because today we can have > > bi-arch versions of GCC configured with a 32 bits default. Second, > > there are some versions of GCC which don't support -mcpu=powerpc, > > for instance for e500 SPE-only versions. > > > > So, stop relying on this approximative logic and allow the user to > > decide whether he/she wants to use the toolchain's default CPU or if > > he/she wants to set one, and allow only possible CPUs based on the > > selected target. > > Hello! Exactly same issue is still in file arch/powerpc/boot/Makefile: > > ifdef CONFIG_PPC64_BOOT_WRAPPER > ifdef CONFIG_CPU_LITTLE_ENDIAN > BOOTCFLAGS += -m64 -mcpu=powerpc64le > else > BOOTCFLAGS += -m64 -mcpu=powerpc64 > endif > else > BOOTCFLAGS += -m32 -mcpu=powerpc > endif > > It cause compile error: > > make ARCH=powerpc CROSS_COMPILE=powerpc-linux-gnuspe- mpc85xx_smp_defconfig uImage > ... > BOOTAS arch/powerpc/boot/crt0.o > powerpc-linux-gnuspe-gcc: error: unrecognized argument in option ‘-mcpu=powerpc’ > powerpc-linux-gnuspe-gcc: note: valid arguments to ‘-mcpu=’ are: 8540 8548 native > make[1]: *** [arch/powerpc/boot/Makefile:231: arch/powerpc/boot/crt0.o] Error 1 Now I have sent patch for this issue: https://patchwork.ozlabs.org/project/linuxppc-dev/patch/20220820105200.30425-1-pali@kernel.org/ > > Reported-by: Pali Rohár > > Tested-by: Pali Rohár > > Reviewed-by: Arnd Bergmann > > Cc: Segher Boessenkool > > Signed-off-by: Christophe Leroy > > --- > > arch/powerpc/Makefile | 26 +------------------------- > > arch/powerpc/platforms/Kconfig.cputype | 21 ++++++++++++++++++--- > > 2 files changed, 19 insertions(+), 28 deletions(-)