Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp541759rwe; Wed, 24 Aug 2022 05:29:01 -0700 (PDT) X-Google-Smtp-Source: AA6agR4fijdtzffKRYlw74+n9p2tZIhVtcjO8+KDL9lK/8URucoZrui4JDp2Dg15/0HZEtXHwSgx X-Received: by 2002:a63:5b4f:0:b0:426:9c52:a1f with SMTP id l15-20020a635b4f000000b004269c520a1fmr24246339pgm.511.1661344140961; Wed, 24 Aug 2022 05:29:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661344140; cv=none; d=google.com; s=arc-20160816; b=kk+IMSwyW0TApP32Plazbte+zyOYOKF8pw6SvC9Bhe4nBE8PgT/PaZxJWqGXF8e0as 8Mm0VyAdgUqOHASvO+njGwSLMyyIBr7WpQbehidBRNJdVW9mrPVUWRmWoAqG7Lus3ypB 4FV05FEESZezw37kexHtD3CFKxC6qxdZT0X0aYgTZjmlcoNII9OZICb2BVgDWanArlvp RpzFXI+TSavRgzpA6SIaIDL0qsxJyPHIaLW0kprYwoKaw+ZpIV4EyBBpC/jgryztXmL7 gw6FoBC4SpUwL9UmWgVp/18YjiOoMz0fagUwJl9QaoFzu6JOdoReovY9BK1zpsttAhZM 2+cQ== 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=kRkZokkWQai+hLJmgf4ev99B549oniDgaHQqmsOOVhQ=; b=FMTJDj8YvnUmOPiRU104ObnCrIrsVekx8g9Xw0xNvSD0HpTFl1KhPEMNW5eQAxXoKH SpHnemgi/3P+8CciD81bXNvpIdtkJ95c3FRlBfK33eWrAQV+Psq1m2uOf+p9QlsqNeuH VJNuQLcPEgxQ29/dA9WuHt000ARBHVxkA3qyhXstsj9ninSiZ6iy3OM08XgY9NQnL2/A 9vCQlPWUP2KkhxiszyynZDlZn1BcZgt9F1Kbyzw5MTxAkhZsZjkIXqEwmcuLNN5lzneU W+kl0Pm/wzHkhyb9wPcxWLpXYq20yk9R6wXMhK1HFWlNxMhZwyxSbx6Gfolq2RQbLENn Ic1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jPSj97YF; 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 i6-20020a170902cf0600b0016786f2d1d8si1934154plg.475.2022.08.24.05.28.47; Wed, 24 Aug 2022 05:29:00 -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=jPSj97YF; 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 S237066AbiHXMDB (ORCPT + 99 others); Wed, 24 Aug 2022 08:03:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236836AbiHXMC7 (ORCPT ); Wed, 24 Aug 2022 08:02:59 -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 204503343B for ; Wed, 24 Aug 2022 05:02:59 -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 D42C0B823F4 for ; Wed, 24 Aug 2022 12:02:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 76575C433D6; Wed, 24 Aug 2022 12:02:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1661342576; bh=JZ3hXAPlKWzmEXJh2Gr2Tdgic81AafQsDP5tJ7ywKaA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jPSj97YFr/FIN1QoDh+6vvTSKDgm6HE3BUroNwFr4hK8naAlEHAKUm4dCaAmaf+zq 1cH1EB+AEea5guwSOTSo54sz8pqXG44rJnoUUMqYXUflTHbRBD6UWKpOl9V9bGc6Pg bIQcpRoF4yaZdLxo5NiTYu7OlIG0g+KxjJgetpiqTOQcbKiU+v7VnIuU2poovb292G de2sJb1hYbj5KW34wNlJjn3yHi2icnswUdOyR5iwQtyhL90JzpIMqwjSroj7WFNJvz r8L8nXXcbdoFCzotzh+HFiHk+/np6DoL2REpmo2FkVFcsYpRLEG7h2V67wUb6+OQfL 2mq6duJD5gGYQ== Received: by pali.im (Postfix) id 570A07DA; Wed, 24 Aug 2022 14:02:53 +0200 (CEST) Date: Wed, 24 Aug 2022 14:02:53 +0200 From: Pali =?utf-8?B?Um9ow6Fy?= To: Christophe Leroy Cc: Michael Ellerman , Joel Stanley , Benjamin Herrenschmidt , Paul Mackerras , "linuxppc-dev@lists.ozlabs.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] powerpc/boot: Fix compilation of uImage for e500 platforms Message-ID: <20220824120253.ba46id2n765udzlo@pali> References: <20220820105200.30425-1-pali@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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 Tuesday 23 August 2022 16:57:34 Christophe Leroy wrote: > Le 20/08/2022 à 12:52, Pali Rohár a écrit : > > Commit 40a75584e526 ("powerpc/boot: Build wrapper for an appropriate CPU") > > broke compilation of uImage target for mpc85xx platforms by powerpc e500 > > SPE capable cross compilers. After that commit build process throws error: > > > > 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 > > > > Fix this issue by checking for CONFIG_PPC_E500MC / CONFIG_E500 options and > > applying appropriate -mcpu options for building uImage boot code. > > This is very specific to e500, could you instead do something using > CONFIG_TARGET_CPU, just like commit 446cda1b21d9 ("powerpc/32: Don't > always pass -mcpu=powerpc to the compiler") Ok, What about this change? diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile index a9cd2ea4a861..2247374c4e70 100644 --- a/arch/powerpc/boot/Makefile +++ b/arch/powerpc/boot/Makefile @@ -34,6 +34,7 @@ endif BOOTCFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ -fno-strict-aliasing -O2 -msoft-float -mno-altivec -mno-vsx \ + $(call cc-option,-mno-spe) $(call cc-option,-mspe=no) \ -pipe -fomit-frame-pointer -fno-builtin -fPIC -nostdinc \ $(LINUXINCLUDE) @@ -44,8 +45,16 @@ else BOOTCFLAGS += -m64 -mcpu=powerpc64 endif else +ifdef CONFIG_PPC32 +ifdef CONFIG_TARGET_CPU_BOOL +BOOTCFLAGS += -m32 -mcpu=$(CONFIG_TARGET_CPU) +else +BOOTCFLAGS += -m32 -mcpu=powerpc +endif +else BOOTCFLAGS += -m32 -mcpu=powerpc endif +endif BOOTCFLAGS += -isystem $(shell $(BOOTCC) -print-file-name=include) > Thanks > Christophe > > > > > > Fixes: 40a75584e526 ("powerpc/boot: Build wrapper for an appropriate CPU") > > Cc: stable@vger.kernel.org > > Signed-off-by: Pali Rohár > > --- > > arch/powerpc/boot/Makefile | 6 ++++++ > > 1 file changed, 6 insertions(+) > > > > diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile > > index a9cd2ea4a861..d7cf5d87e4bc 100644 > > --- a/arch/powerpc/boot/Makefile > > +++ b/arch/powerpc/boot/Makefile > > @@ -44,8 +44,14 @@ else > > BOOTCFLAGS += -m64 -mcpu=powerpc64 > > endif > > else > > +ifdef CONFIG_PPC_E500MC > > +BOOTCFLAGS += -m32 $(call cc-option,-mcpu=e500mc,-mcpu=powerpc) > > +else ifdef CONFIG_E500 > > +BOOTCFLAGS += -m32 $(call cc-option,-mcpu=8540 -msoft-float,-mcpu=powerpc) > > +else > > BOOTCFLAGS += -m32 -mcpu=powerpc > > endif > > +endif > > > > BOOTCFLAGS += -isystem $(shell $(BOOTCC) -print-file-name=include) > >