Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp15569093rwd; Sun, 25 Jun 2023 20:44:35 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7oVDii4LMET69tFkQ5EfgOAAXJ5aINi9hC/W1CSJlLyrrkpTSTIPrLOX+VDGgNw9GafkSM X-Received: by 2002:a05:620a:4144:b0:765:740f:4897 with SMTP id k4-20020a05620a414400b00765740f4897mr5285035qko.64.1687751075121; Sun, 25 Jun 2023 20:44:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687751075; cv=none; d=google.com; s=arc-20160816; b=EYQB2idcFcWFKWQsNzBNGSMcq6lj7OfXYwvHd2C4Ewttbpz4r7gi3MOtUrpnTrEQeJ lo+z75s2ahEg1Pz2wnBUwYg8lvRaDE2Vk3WSt12cs1IWWkzb6ZdsmQgWDBAXWqydwJbN Z+Ldsaxw/3XkvQMSJDYTR2yS0dzz7UzliWhzeFGdm1Bclal0/vgojp2qQ9Dh/12rds3R r6iV8Lq3kmrcGVQVqIQWXCmJlRp6yPTCqicNu/3DyxEAuwDrJ9J9qG4Di7nWDv9xSg23 F+hv3YfKFLQQff8x0X8X1nq8sdwl5+aHaXObezK5LxS+HVs3/MDu9OietL9oulby4cZG UKIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=MrcmBsDlgMPoS0QIRN+/f9kbJkYgwcTXhauaznaTKEU=; fh=WEOfjEmEs4yps97lHN7UI2rXu/2OtFQtRLMHbbSqUZ8=; b=WpA8GxILUCyoOBb2Q3Nnvk5OVzYZ3Fp1AVlTPBK+3/qeQ3GndW6+/5HJL38ABqThyN 560eIBM4rZhaMDIBLK9r+rMZHWN7FTy5/ogVYr0FfxCRyheISQ3BvgmgbAXBxT245SCs dyNMEPS4iDGpZhD+i+MEx0rVjFc88kRB2tzxZSuHHgQScUPA/L2EJKqVAvxEfJ70XYCK YnUwyU+DnZhqo72iD6oCawv5+2Hba9EYIURPxVpZAELrTmOcK0+einhJcAKv0vR39mEe itKDUtKnWaHobRHS0dNZMUpmtxZdYVbmAtoBOwHo4UUEg7sOfcN+BtnIqLAFT2YXnhRd Ffdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=U1rakJdK; 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 q9-20020a631f49000000b0053eee173733si4289375pgm.227.2023.06.25.20.44.23; Sun, 25 Jun 2023 20:44:35 -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=U1rakJdK; 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 S230362AbjFZDMO (ORCPT + 99 others); Sun, 25 Jun 2023 23:12:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230157AbjFZDMK (ORCPT ); Sun, 25 Jun 2023 23:12: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 E1A0F1AD; Sun, 25 Jun 2023 20:12:05 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6714B60C76; Mon, 26 Jun 2023 03:12:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C842AC433C0; Mon, 26 Jun 2023 03:12:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687749124; bh=wWBs10Ysex4s8hvKQS9fyjF9aZurVb4Ni2hIgn1/qBE=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=U1rakJdKEGgjf5w/H2VXLdl5yU94lilMmayksH/AcUiTeDioPAKv1HLxjC6TL90Je uizaD/i81fNrpMfYk53GEwj2789GCQIoTFFYOxRsrW5OZHSHBJUSm7LSiLPs8sYLAZ Zekm9a6s6d4e65F5rDP9WLKyW7Lf89DmuGgi0PJCD+jQ0eenNoK3N4QdhrLkIY3k6y 27gXMPLyXxHxvjxq85p3DJTcGqkyzERWYx16+Tr2nWshOnPfLlEpIKmjwOCUl86YOm NIFhqNjjg9ob/tJ3Kakqp3rd+WPtA1ITJoE2dfA4KDiTmU2c11I2E118Hpd6AVbyJR sZPeTNWRb3Fqg== Received: by mail-oa1-f44.google.com with SMTP id 586e51a60fabf-1aa34b210c9so2853532fac.0; Sun, 25 Jun 2023 20:12:04 -0700 (PDT) X-Gm-Message-State: AC+VfDwXxQ+ZmXchOZrLHGLWimFBSnoLHx3NtIR5ok/GT0sTVc1m7mCh kcb95jJNrlcNE0poaYrgfSbgCQYhnohmZzL0JAI= X-Received: by 2002:a05:6870:7342:b0:1b0:2bff:b9b5 with SMTP id r2-20020a056870734200b001b02bffb9b5mr3183440oal.47.1687749124047; Sun, 25 Jun 2023 20:12:04 -0700 (PDT) MIME-Version: 1.0 References: <20230119082250.151485-1-masahiroy@kernel.org> In-Reply-To: From: Masahiro Yamada Date: Mon, 26 Jun 2023 12:11:27 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] powerpc: remove checks for binutils older than 2.25 To: Nicholas Piggin Cc: Joel Stanley , Michael Ellerman , linuxppc-dev@lists.ozlabs.org, linux-kbuild@vger.kernel.org, Christophe Leroy , Nathan Chancellor , Nick Desaulniers , linux-kernel@vger.kernel.org, Nicolas Schier Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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 Mon, Jun 26, 2023 at 10:58=E2=80=AFAM Nicholas Piggin wrote: > > On Sun Jun 25, 2023 at 6:02 PM AEST, Masahiro Yamada wrote: > > On Thu, Jan 19, 2023 at 9:37=E2=80=AFPM Masahiro Yamada wrote: > > > > > > On Thu, Jan 19, 2023 at 9:12 PM Joel Stanley wrote: > > > > > > > > On Thu, 19 Jan 2023 at 08:24, Masahiro Yamada wrote: > > > > > > > > > > Commit e4412739472b ("Documentation: raise minimum supported vers= ion of > > > > > binutils to 2.25") allows us to remove the checks for old binutil= s. > > > > > > > > > > There is no more user for ld-ifversion. Remove it as well. > > > > > > > > ppc kernels fail to link with 2.27 under some configurations: > > > > > > > > https://github.com/linuxppc/issues/issues/388 > > > > > > > > We may want to use ld-ifversion to exclude that version. > > > > > > > > > > > > Ping? > > > > > > > > > > > > > > For LLD, CONFIG option is directly checked. > > Yeah, doesn't seem too difficult to add new linker version tests if neede= d. > > > > > > > > > > masahiro@zoe:~/ref/linux(master)$ git grep CONFIG_LLD_VERSION > > > Makefile:ifeq ($(call test-lt, $(CONFIG_LLD_VERSION), 130000),y) > > > arch/riscv/Makefile:ifeq ($(call test-lt, $(CONFIG_LLD_VERSION), 1500= 00),y) > > > arch/x86/Makefile:ifeq ($(call test-lt, $(CONFIG_LLD_VERSION), 130000= ),y) > > > scripts/Kbuild.include:# Usage: $(call test-lt, $(CONFIG_LLD_VERSION)= , 150000) > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Signed-off-by: Masahiro Yamada > > > > > --- > > > > > > > > > > arch/powerpc/Makefile | 22 +--------------------- > > > > > arch/powerpc/lib/Makefile | 2 +- > > > > > scripts/Makefile.compiler | 4 ---- > > > > > 3 files changed, 2 insertions(+), 26 deletions(-) > > > > > > > > > > diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile > > > > > index dc4cbf0a5ca9..3d265b16c0ae 100644 > > > > > --- a/arch/powerpc/Makefile > > > > > +++ b/arch/powerpc/Makefile > > > > > @@ -42,18 +42,13 @@ machine-$(CONFIG_PPC64) +=3D 64 > > > > > machine-$(CONFIG_CPU_LITTLE_ENDIAN) +=3D le > > > > > UTS_MACHINE :=3D $(subst $(space),,$(machine-y)) > > > > > > > > > > -# XXX This needs to be before we override LD below > > > > > -ifdef CONFIG_PPC32 > > > > > -KBUILD_LDFLAGS_MODULE +=3D arch/powerpc/lib/crtsavres.o > > > > > -else > > > > > -ifeq ($(call ld-ifversion, -ge, 22500, y),y) > > > > > +ifeq ($(CONFIG_PPC64)$(CONFIG_LD_IS_BFD),yy) > > > > > # Have the linker provide sfpr if possible. > > > > > # There is a corresponding test in arch/powerpc/lib/Makefile > > > > > KBUILD_LDFLAGS_MODULE +=3D --save-restore-funcs > > > > > else > > > > > KBUILD_LDFLAGS_MODULE +=3D arch/powerpc/lib/crtsavres.o > > > > > endif > > > > > -endif > > > > > > > > > > ifdef CONFIG_CPU_LITTLE_ENDIAN > > > > > KBUILD_CFLAGS +=3D -mlittle-endian > > > > > @@ -389,8 +384,6 @@ vdso_prepare: prepare0 > > > > > $(build)=3Darch/powerpc/kernel/vdso include/gener= ated/vdso64-offsets.h) > > > > > endif > > > > > > > > > > -archprepare: checkbin > > > > > - > > > > > archheaders: > > > > > $(Q)$(MAKE) $(build)=3Darch/powerpc/kernel/syscalls all > > > > > > > > > > @@ -405,16 +398,3 @@ else > > > > > $(eval KBUILD_CFLAGS +=3D -mstack-protector-guard-offset= =3D$(shell awk '{if ($$2 =3D=3D "TASK_CANARY") print $$3;}' include/generat= ed/asm-offsets.h)) > > > > > endif > > > > > endif > > > > > - > > > > > -PHONY +=3D checkbin > > > > > -# Check toolchain versions: > > > > > -# - gcc-4.6 is the minimum kernel-wide version so nothing requir= ed. > > > > > -checkbin: > > > > > - @if test "x${CONFIG_LD_IS_LLD}" !=3D "xy" -a \ > > > > > - "x$(call ld-ifversion, -le, 22400, y)" =3D "xy" ;= then \ > > > > > - echo -n '*** binutils 2.24 miscompiles weak symbo= ls ' ; \ > > > > > - echo 'in some circumstances.' ; \ > > > > > - echo '*** binutils 2.23 do not define the TOC = symbol ' ; \ > > > > > - echo -n '*** Please use a different binutils vers= ion.' ; \ > > > > > - false ; \ > > > > > - fi > > > > > diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefil= e > > > > > index 4de71cbf6e8e..c53618c34b70 100644 > > > > > --- a/arch/powerpc/lib/Makefile > > > > > +++ b/arch/powerpc/lib/Makefile > > > > > @@ -42,7 +42,7 @@ obj-$(CONFIG_FUNCTION_ERROR_INJECTION) += =3D error-inject.o > > > > > # 64-bit linker creates .sfpr on demand for final link (vmlinux)= , > > > > > # so it is only needed for modules, and only for older linkers w= hich > > > > > # do not support --save-restore-funcs > > > > > -ifeq ($(call ld-ifversion, -lt, 22500, y),y) > > > > > +ifndef CONFIG_LD_IS_BFD > > > > > extra-$(CONFIG_PPC64) +=3D crtsavres.o > > > > > endif > > This test got inverted for LLD now AFAIKS? In my understanding, For a BFD linker, use --save-restore-funcs. Otherwise (i.e. CONFIG_LD_IS_BFD is unset), link crtsavres.o to modules. I hope I did not change the logic. > > Does LLVM support --save-restore-funcs and supply .sfpr already I > wonder? We could remove this stuff entirely. I don't know. If LLVM 11.0.0 (the minimum supported LLVM version) supports --save-restore-funcs, you can remove this check entirely. Even so, it should be done in a follow-up patch. This patch is just dropping dead code for BFD linker < 2.25, which is now unsupported. Nothing else has changed (I believe). --=20 Best Regards Masahiro Yamada