Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp1390212rwe; Sat, 27 Aug 2022 07:08:33 -0700 (PDT) X-Google-Smtp-Source: AA6agR5eSmUzMxqCa5Mc6z22SrMyV88x6y90S6oAsgnMMowF60sUpKbFTZMQp0q+78Hm7pIXvWSb X-Received: by 2002:a17:902:904b:b0:172:cd04:a3d3 with SMTP id w11-20020a170902904b00b00172cd04a3d3mr8532549plz.173.1661609313472; Sat, 27 Aug 2022 07:08:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661609313; cv=none; d=google.com; s=arc-20160816; b=TppZGlGWQ2RyN6MLS4ofxiO/aDdhwvztXS4bJCwhx7Se52pdhGXY+cvvYdq0hZVtFe iNf4UumUIt6mzihLs+sFUeFXyB/Y1s3Ugr5ZkcPZRw+LbqpucVxL176LK6QKhA95EwV1 BnRrXlgaWIrBkg3fDWUBYLjgJCFvORBTLl2XNnM1pilg9EnJ5Luf6/ORLaxUP1p0brhk ZIpKuH9nDk8PwpqQsZytrgv1JkAQxJyXbv8W1FieBdSH4qv3uks1GSSy9cynps/r0Ctv nPG9LVorBJwE1HVzwmUQeYtx96EC2xZ9ijVtREIl35iXTH+ZT0OBTFDeqTZrjwm/Iwjh ghWQ== 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=La5l41NW16bQdD/zndwZvjF+95jFXEOnx5MkWx6sMro=; b=BLJX2U+lwOF415LzMiWz/ndV47Yp6bJpAEFOfxmQBZ2dI0NaDcZzFc7YUVuLL93XIT gYJLBOZCK1s/mz/ndZzTNjBhfMdP+p25nOsTjFgObZxmJ6hnJTbZn1C/JEVic3C1w92/ OFQlk5WtwvSC0iQCB3somMQhVtZ/k9WZ1WtOMf6SsXH6+T7RnqMPIoxwZiwvAq/Z0I94 N82MGL8HYYUhKeJ9iWCF+A3mQ9k26COFYkAX8OPXGIAF7F0835oUNFVCL/BkZWGK1Trr /i20OHuxFidNph213E4JWNfm1GXeVUgntA/avD/1vB75IiYPHDX/u1Tu4pXFZjv6sP4o Pk/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GbnCrUrh; 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 bm4-20020a656e84000000b00429cd0df384si4386808pgb.520.2022.08.27.07.08.21; Sat, 27 Aug 2022 07:08:33 -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=GbnCrUrh; 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 S233171AbiH0Njy (ORCPT + 99 others); Sat, 27 Aug 2022 09:39:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233049AbiH0Nju (ORCPT ); Sat, 27 Aug 2022 09:39:50 -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 9EF18C3D for ; Sat, 27 Aug 2022 06:39:48 -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 35394B80108 for ; Sat, 27 Aug 2022 13:39:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A3E6CC433D6; Sat, 27 Aug 2022 13:39:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1661607585; bh=WpVdubWclY2UMHlcAsADqLj3KpeQOgXN4jbUOblbBQk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GbnCrUrhQ7FWd0XKQtnR0RZ1wAKCkv9XM5JBDTtTJq6j1jcmGUkVTrrc3NKM3ZNKa Yhs2QadSfAP0ZnCrIPCR4G6kf84K9KhBv/d2bP3UZbz03Lke2mAAKcZmWa0iPKQBIk iv3BDBidEAjZPirYGZn0t+0Off0jJhUymt24PenMb+lsawQ1zZHaVqAMHcgoXsJcO2 U+7cDY3SBtqs7qxA3IaP0O0e6+0fyqf0EiIilyQGwKgzLMlNOf6x0LEqDmUacY6/E1 iLwcK40zDTueJuA0wsPR8kedQfWgbaO20IJtKPC/fTfSVcZojZTgB+dNRb50jwY3Rx wGTc20x1q2nMw== Received: by pali.im (Postfix) id 1BDEEC7A; Sat, 27 Aug 2022 15:39:43 +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 v2] powerpc/boot: Don't always pass -mcpu=powerpc when building 32-bit uImage Date: Sat, 27 Aug 2022 15:39:00 +0200 Message-Id: <20220827133900.16634-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 For 32-bit uImage try to use CONFIG_TARGET_CPU option for -mcpu. This fixes following compiler 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 For 64-bit uImage and 64-bit kernels with 32-bit uImage wrapper there is no change. 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 Signed-off-by: Pali Rohár --- arch/powerpc/boot/Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile index a9cd2ea4a861..f56a5f90a5d8 100644 --- a/arch/powerpc/boot/Makefile +++ b/arch/powerpc/boot/Makefile @@ -44,8 +44,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) -- 2.20.1