Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp2061520rwe; Sun, 28 Aug 2022 02:59:40 -0700 (PDT) X-Google-Smtp-Source: AA6agR485ch2zp+TAbWbUTTctd0lPGEOsjxXPNPzSeHbsVd6JMOzJdxYXhORkrvVOw1N74UreHoq X-Received: by 2002:a17:902:d2cf:b0:172:f084:7adf with SMTP id n15-20020a170902d2cf00b00172f0847adfmr11500774plc.76.1661680780710; Sun, 28 Aug 2022 02:59:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661680780; cv=none; d=google.com; s=arc-20160816; b=IXh+gOjNC2SKzEizsGg7Q+2lvcQreCSZrq8IloVJZTLU3gnJHpIA7eadxG5Xif0YY2 2W5wsUCDQuv00wtqfAeBOo9gZPXATcsUGOCARDBxu2VGpfCcjMOLxGyqtMQRFXXEYZoC zaVS4q4uZ2OTzSiBl97RRv/yFudW4AzKQ4/OzOOatLkBwH4ebj9B3HTYMgBDFLLdBJ2h Rh6pl9az3pdLYO3OE9SEjgnmED7VWEbxVyEYeKyEANGc9iMPixWl8icI2YFatP0XMsSc a4GRTd2mIKEfsqX4ZdCj/+j1nGZf0N+kMB4jJ2dd2U9TUK1S+6j5B+PWrN5W7UrZ88VA Q1rA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=DaxpS5OvC2wJJX1fSA4uyBWOQL6aQ3BbqWRC5dSnJKo=; b=PstFPCUmXvQ8DnkRcpJ8RjoujD0xi1xeBR9UsdAuI2Ynqe4lP3hDQO9Mz4jA+mopQh /EH2t3xOLzSHvpkfx//Rvc24rzr1tY+tJrxud43lTiLtE/di/0plGLgBsLix25BxOKrF MybzfUpxeDWW92h1yzjfVAT9ECWIpP56tCOcmT6qN/PyL3wVIg9DoPPg1onjfpTr7wo9 HP5ZVdIM+JHEIOiShZPNJL6oHl55M9+1AwCaw+srrCUXkxMWT/Dmcdw+HrRgybjJzmRq Xd+1iI3fkaIfq5y4AV6W5F6HYqYdFHcs/5+RT0beTXpjrMo5ans4mCgAvjGUJHpURrL4 YfGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=c8bo5YZV; 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 h18-20020a170902f55200b0015ec0b44cd1si6623507plf.199.2022.08.28.02.59.29; Sun, 28 Aug 2022 02:59:40 -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=c8bo5YZV; 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 S229542AbiH1J5L (ORCPT + 99 others); Sun, 28 Aug 2022 05:57:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229445AbiH1J5K (ORCPT ); Sun, 28 Aug 2022 05:57:10 -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 AFEF355090 for ; Sun, 28 Aug 2022 02:57:09 -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 4708D60FA0 for ; Sun, 28 Aug 2022 09:57:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8C789C433D6; Sun, 28 Aug 2022 09:57:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1661680628; bh=LlULD/IKynjpnLtSqXlGpYdUZVoQFXgtjS3/RSpKnMw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c8bo5YZVuhSDQnFndpW4iAzdcEMAVonsRehPOM8APZU70KhIk5ag74U515mXJa8/b S37xpSwEHmCoJt256XoXHz0K7Q0jtpmZaS4psVg4lrjVm5krHX1RrbkGzRu+hIOlHg uOOhfahroinEfwulmnCWcUksrD8gLpJ5xHITEkcDju5qcKMitrg7WYs+a+ihsrdz/u yXy90Hkfbjwb1TeONnRpuKhNTmMeLjv8DcrQ8T8nXHC6lj2cjs2JZQXC3k/180R75x 1zpYYFF8d9VDY778nPUL+7MUdjiXcfyqCRSvQ5qWArW3tGl4TTM8tzknQO1QeRfYo9 T9v+Ez9cSBUUw== Received: by pali.im (Postfix) id A47937B3; Sun, 28 Aug 2022 11:57:05 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Christophe Leroy , Michael Ellerman , Joel Stanley , Benjamin Herrenschmidt , Paul Mackerras Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH v3] powerpc/boot: Don't always pass -mcpu=powerpc when building 32-bit uImage Date: Sun, 28 Aug 2022 11:56:59 +0200 Message-Id: <20220828095659.4061-1-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220820105200.30425-1-pali@kernel.org> References: <20220820105200.30425-1-pali@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 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 Similar change was already introduced for the main powerpc Makefile in commit 446cda1b21d9 ("powerpc/32: Don't always pass -mcpu=powerpc to the compiler"). Fixes: 40a75584e526 ("powerpc/boot: Build wrapper for an appropriate CPU") Cc: stable@vger.kernel.org # 446cda1b21d9 ("powerpc/32: Don't always pass -mcpu=powerpc to the compiler") Signed-off-by: Pali Rohár --- arch/powerpc/boot/Makefile | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile index a9cd2ea4a861..1957a3de7a1c 100644 --- a/arch/powerpc/boot/Makefile +++ b/arch/powerpc/boot/Makefile @@ -38,13 +38,19 @@ BOOTCFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ $(LINUXINCLUDE) ifdef CONFIG_PPC64_BOOT_WRAPPER -ifdef CONFIG_CPU_LITTLE_ENDIAN -BOOTCFLAGS += -m64 -mcpu=powerpc64le +BOOTCFLAGS += -m64 else -BOOTCFLAGS += -m64 -mcpu=powerpc64 +BOOTCFLAGS += -m32 endif + +ifdef CONFIG_TARGET_CPU_BOOL +BOOTCFLAGS += -mcpu=$(CONFIG_TARGET_CPU) +else ifdef CONFIG_PPC64_BOOT_WRAPPER +ifdef CONFIG_CPU_LITTLE_ENDIAN +BOOTCFLAGS += -mcpu=powerpc64le else -BOOTCFLAGS += -m32 -mcpu=powerpc +BOOTCFLAGS += -mcpu=powerpc64 +endif endif BOOTCFLAGS += -isystem $(shell $(BOOTCC) -print-file-name=include) -- 2.20.1