Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp3086480rwi; Tue, 1 Nov 2022 15:55:41 -0700 (PDT) X-Google-Smtp-Source: AMsMyM41dV67Om8K/bG5k7LxEQDp75E9pNyEzjEW4czMvO0Ow/Q+jwouLB34/7/u0SCx7NTtdquO X-Received: by 2002:a63:5d18:0:b0:462:f77b:cd29 with SMTP id r24-20020a635d18000000b00462f77bcd29mr19115551pgb.9.1667343341077; Tue, 01 Nov 2022 15:55:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667343341; cv=none; d=google.com; s=arc-20160816; b=EKJaDNQz40yEmviMZLcLyUONFK3i9KvL+wltGhL7kyi2R9ok9Prj7KmIegEr66ijz+ 6dbUwXvn9qSIfzMKeiKKYOlgHrITsx5gZbkrQL9F9Po9C8otwJE/qxypUUftKhYAgLQq mI0n8FnOoOIEs8bjls+2wxprMrE+XkIiJV0GaBfUfDo3kLTtWaikpb7x2y5Wipcfamal 00h7I4wb7hJqrt/LnJm5me/BWm7YN615fjUuCQtZbhGKNf+/mO/cvBxyJREzH0V4PEeP p8YPhxIJbyYSorh6Wox9eX/bCIEImL2lHIZQ/Efo7b7huSjOmJc5Rp71zUL0C2J+dgza u8Dg== 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=engYDaDnB6MHov125oW8qr4c5EaF+FDIkku92WWHUxw=; b=g94TmduBEZKy3j4FyU/7z0PH6O6KX3z8VCWK/AFhyBMqgZpWqyLer29IRb5HLL8eZF 6CJzoEe9PRlR6T5ZDfeKLHD2oORwWMvTnM4psXA76jU6kLphJ0Buk7IYHjjgPCXU/P4z tVjasEHe2QzOVg02JIBZWmHBNLu0bgK6wkOiEhIKrl/bUULal2YlEQorwBWQOZbM9jCM 3R56FI+jC1ZMB8/6K00IhgGbMfS4dYDoKXBqCqeqXPwq7lVmHsEtM8NdQIrt70lwLLa6 rhTUcTSCTLhUmWDjxxnFCVYxMT1DN/v/pXLkSYkjrzlLo82WQv8uIuo/Az2SeD1SXkpi BJCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eOehF0CZ; 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 s25-20020aa78d59000000b0055214e179d5si11447303pfe.63.2022.11.01.15.55.28; Tue, 01 Nov 2022 15:55:41 -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=eOehF0CZ; 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 S230301AbiKAWND (ORCPT + 96 others); Tue, 1 Nov 2022 18:13:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229516AbiKAWNA (ORCPT ); Tue, 1 Nov 2022 18:13:00 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9432719299 for ; Tue, 1 Nov 2022 15:12: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 dfw.source.kernel.org (Postfix) with ESMTPS id 2F0CE61454 for ; Tue, 1 Nov 2022 22:12:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 66646C433D6; Tue, 1 Nov 2022 22:12:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667340778; bh=DJ1JcmtSbSKo7xCh5b9tMUpHLUGxmlH3Pq2uSJeaHe0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=eOehF0CZp7GN9e9cscYGm9DnWkXzGOH8LglCe3H9rNaxp3o0ut7egQDaeXigEdyee 955hT17IOLAzdR/0FyTdfYFb0HiM5joQatWr6od3hVfF/nz9KKyQDnO7n9oUQeipPR CYqyBS4bxqS5e5R5aZhA6gyPYH7cp8P6QPKMmHWXOZx7S4bGXik+9NJ57nZTDTotav K1N+5T2uWHqSwMLFgJuFEiH1IrBhCCzR9hNhRMUKSY/OoUPwm9CdGrQob0PN3z2kup JI5ghoDWQhsPetW/AYqKmjMVg8LrzrjvJEvbkNAQ9tJ/XXpvxmd4ncRWi0cY+PDRXa HMgkM7K6mHbKQ== Received: by pali.im (Postfix) id 7C9A37F8; Tue, 1 Nov 2022 23:12:55 +0100 (CET) Date: Tue, 1 Nov 2022 23:12:55 +0100 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: <20221101221255.gwaem6w7upv545fw@pali> References: <20220820105200.30425-1-pali@kernel.org> <20220828095659.4061-1-pali@kernel.org> <20220828174135.rcql4uiunqbnn5gh@pali> <20220829085451.upubyo5e7uop72lb@pali> <20221009110652.h7senqesk7nabxmn@pali> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20221009110652.h7senqesk7nabxmn@pali> User-Agent: NeoMutt/20180716 X-Spam-Status: No, score=-8.2 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 Sunday 09 October 2022 13:06:52 Pali Rohár wrote: > 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? Christophe, any input from your side?