Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp3408263rwb; Sun, 9 Oct 2022 04:48:12 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6LtoTDqRhdTGxQC7dvWKKj064glM8aPYHWn0ca+UMo+lb4LpW4nhEk04AMAq31gm/zBUZT X-Received: by 2002:a05:6402:3551:b0:45c:360:bfd5 with SMTP id f17-20020a056402355100b0045c0360bfd5mr2014992edd.136.1665316091775; Sun, 09 Oct 2022 04:48:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665316091; cv=none; d=google.com; s=arc-20160816; b=vqMMQBX94WbePs7uKPpu5YAKABJezAOrSF7Ewra5LP8hQRI+TBo8CMPf5VDtTXfjdU PbnmTExIs4Lg2NxgU8h/nOOps1y7QZJ+ETB5MNflkzqs4yHkZGqUwrSHOTHiVTu+4dUO R9aVQc3J/Yk/u1qHZhN56FVzr94t6bzmy3JAZ+xBkbgqSEgmDydjV67X+mVwpOiEZzxW 9Navgf+ChOdevpRFvJe1t5Y5JRs3QaEjRNKYsjaLcReRpagjvMgg5OY7qLssJwH+MqsO 4CodR60T3L9fipeOD4HlFgf4kfgnE0TmUtKqqgj6nxuYeLZ4mpSYWdLAc1r/50L+H/DI EdXQ== 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=zrApj03wXjVNeNP2yeOQQb4IM09C7J7xHq5XFv7FV+s=; b=y4QBi7HD8quWZngPyITNHK1NfhwTLx41+S8uTgWlrWCX1NBpfhgiu7KZSAM/jKrgeW DJheeUuYP0V6F9FB6CRbFx2SiN48nxLWn3VNzg9rt9CGqwCp9zcQgoifZtTcRezo6ziG lG0zKXO0/Y48KeounETv1+C5hQyI5Bq/3Kqdvb6YBiVEPKyxv+5OFJlAMQJhcIaoTF97 PfkN0TuL+YakK7zBAEbJOWSweHHhYqunI0+mM9vvLHOjVLMxV40zLGBTkKuxfMZglczi oE8FnM/495ogRK1/CsSuDeFbxvaAf/i2D7aaA8UvWvG+4lKVO/tvYr1tVImYw4S5oVoz xwyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Lh6KNRlM; 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 gn24-20020a1709070d1800b0078b88453306si8151636ejc.285.2022.10.09.04.47.46; Sun, 09 Oct 2022 04:48:11 -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=Lh6KNRlM; 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 S229623AbiJILHB (ORCPT + 99 others); Sun, 9 Oct 2022 07:07:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229446AbiJILG5 (ORCPT ); Sun, 9 Oct 2022 07:06:57 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A79AD28733 for ; Sun, 9 Oct 2022 04:06:56 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 4214660AE9 for ; Sun, 9 Oct 2022 11:06:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 78E01C433C1; Sun, 9 Oct 2022 11:06:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665313615; bh=bDQO5nPf+lVMNKr0A9V63/VARoFUePFNmz0paVann+U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Lh6KNRlMUBJMDhKijORUgTjeqq0c1vtkL5x0vLvbTNwERqVEdWnCGu2FxlEkBGcn+ xjiiFHa+CJx9o7faJ1WRwSTfYSQ7wQsHG7b70vo1BVmv6kdMZAlOwXNzkQ0rIxMTLa boh8I6USg2O6ZZFNH5rzTt7ozAbyRWsyu3UliSlaXhG6/EP9MnB/qf7XnEhZ3WrbTN 73iMNQ8c9V389d6Do3fGdUG8a4Lttp4rwHfOQliOAz9wyt/9bhX9AB2NM0MUv9SXPP bSmnI4zfT58B0fmLz7ozMrVvAaQ7RgQy0Keyq4I1pPNbwLyYFEoIj5GveAT/nPVB7n ZPcx0pvvZm0vQ== Received: by pali.im (Postfix) id 52B8A7C1; Sun, 9 Oct 2022 13:06:52 +0200 (CEST) Date: Sun, 9 Oct 2022 13:06:52 +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 v3] powerpc/boot: Don't always pass -mcpu=powerpc when building 32-bit uImage Message-ID: <20221009110652.h7senqesk7nabxmn@pali> References: <20220820105200.30425-1-pali@kernel.org> <20220828095659.4061-1-pali@kernel.org> <20220828174135.rcql4uiunqbnn5gh@pali> <20220829085451.upubyo5e7uop72lb@pali> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220829085451.upubyo5e7uop72lb@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 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 Monday 29 August 2022 10:54:51 Pali Rohár wrote: > On Sunday 28 August 2022 17:43:53 Christophe Leroy wrote: > > Le 28/08/2022 à 19:41, Pali Rohár a écrit : > > > On Sunday 28 August 2022 17:39:25 Christophe Leroy wrote: > > >> Le 28/08/2022 à 19:33, Christophe Leroy a écrit : > > >>> > > >>> > > >>> Le 28/08/2022 à 11:56, Pali Rohár a écrit : > > >>>> When CONFIG_TARGET_CPU is specified then pass its value to the compiler > > >>>> -mcpu option. This fixes following build error when building kernel with > > >>>> powerpc e500 SPE capable cross compilers: > > >>>> > > >>>>      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 > > >>> > > >>> corenet64_smp_defconfig : > > >>> > > >>>   BOOTAS  arch/powerpc/boot/crt0.o > > >>> powerpc64-linux-gcc: error: missing argument to '-mcpu=' > > >>> make[1]: *** [arch/powerpc/boot/Makefile:237 : arch/powerpc/boot/crt0.o] > > >>> Erreur 1 > > >>> make: *** [arch/powerpc/Makefile:253 : uImage] Erreur 2 > > >>> > > >>> > > >> > > >> Seems like in fact, E5500_CPU and E6500_CPU are not taken into account > > >> in CONFIG_TARGET_CPU, and get special treatment directly in > > >> arch/powerpc/Makefile. > > >> > > >> This goes unnoticed because of CFLAGS-$(CONFIG_TARGET_CPU_BOOL) += > > >> $(call cc-option,-mcpu=$(CONFIG_TARGET_CPU)) > > >> > > >> I think we need to fix that prior to your patch. > > > > > > It looks like that CONFIG_TARGET_CPU is broken. > > > > > > $ make ARCH=powerpc corenet64_smp_defconfig CROSS_COMPILE=powerpc64-linux-gnu- > > > ... > > > # configuration written to .config > > > > > > $ grep CONFIG_TARGET_CPU .config > > > CONFIG_TARGET_CPU_BOOL=y > > > > > > CONFIG_TARGET_CPU_BOOL is set but CONFIG_TARGET_CPU not! > > > > Yes, because there is no default value for E5500_CPU and E6500_CPU. We > > need to add one for each. > > I see... Will you prepare this fixup for your previous patch? > > And I think that following construct > > $(call cc-option,-mcpu=$(CONFIG_TARGET_CPU)) > > should be changed just to > > -mcpu=$(CONFIG_TARGET_CPU) > > Because if user specified that want build for specific target CPU, it > should not be silently ignored. Christophe, should I do something in this area?