From patchwork Mon Oct 24 11:27:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 8993 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp439881wru; Mon, 24 Oct 2022 06:03:28 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4J2D4syf+ZU4Zm7sg3Dxqm9kJ/Xbuy9RCgubO2K+2pc6176e6nbMK1e6G4QuM86XxsqTN3 X-Received: by 2002:a17:902:8215:b0:178:6946:a282 with SMTP id x21-20020a170902821500b001786946a282mr33936475pln.162.1666616608113; Mon, 24 Oct 2022 06:03:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666616608; cv=none; d=google.com; s=arc-20160816; b=uRfC93ytMENg9jOL5QeqxYbrJf9tZ0tzYd54HUloK5SEk5zeECy+rlJzR5WHh7Fxhj tCO3oGBicZCEfCXet8M0MfVD8c1y/q/zO+EdlCpGSP+7/qlS1Jxr58GoLexszpQ7owZD AIL7vvgCH/58Ug8ViV7dzEI+EtKpZFPF+rBUBt23M4v20ptgezPZznp0FJSJUG6swI2S ZKocAjAKRAEP9zs7WyiPLFIChufe3fkFySNBurASJ5GuklqavQeuwpmq37pjCwwGBv6x LB3k3zp9Te69U3yuglWQgAPB3Fw1kDgbbv7n+fbKC2u0GcKRgM5bpXcoiOhNQF9VqfsX W0Fw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=2SKRsv0L00ej14tNzRc6CY10JuwzV6sL5p5Olv8OY+I=; b=uxhaPZo3qU5JLuoF++MBYoBpGPDrE/7SBcsT5hpUFO+DpawK5WjBZKzXHmOy5saOLm G15OREQAOTsgqiLMINomPHzPZ181BfbF5xGJFB6xrXutDvoJrNKZUfYFrAEpCahzD3zV gTgUTNfUlO6aLPI2kuJ0UC7xsa72WVXeIxDp8mlkN3YgOn0dkis1z16b+BvvPZZ+dAx/ 5dXcBv4cxhBCURCr3rLdpCgOxyzNkk+A2TiTixyRqWPKvMjmbdoaosAqG7jp15Wb9cCd /t4F2SA4RUtezLwlhdRDtRrXPohhGGeQ47YWoaRVVBhuOrBVRRlBl2vpP8sIIo3HeBe/ 5KKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="j8/hWM6+"; 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=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q85-20020a632a58000000b004394687b653si2137213pgq.253.2022.10.24.06.02.43; Mon, 24 Oct 2022 06:03:28 -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=@linuxfoundation.org header.s=korg header.b="j8/hWM6+"; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235001AbiJXNCD (ORCPT + 99 others); Mon, 24 Oct 2022 09:02:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235110AbiJXM7V (ORCPT ); Mon, 24 Oct 2022 08:59:21 -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 07E6E80F67; Mon, 24 Oct 2022 05:18:41 -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 DEC82612D6; Mon, 24 Oct 2022 12:17:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EB8A6C433C1; Mon, 24 Oct 2022 12:17:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666613847; bh=YgOEx818IrQxGo5DVu69YsFYIA0M4LK5XBmFFGCtB00=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j8/hWM6+emjNv2uIo4uBx8G64o6RUr3EJsYqO6pk1ipUwhNvp1y9pP2CI5mzqD2ah ZBZbdqqIv8m8i7UQM+oaVd8qxGhT4DNgazoG4YCBH37eeLXyiSop1JZ0EZ4w3Q3zgv XZBWLlbZfD5wAxoR2zTNohI50QduC0wuXB3TVHYE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Fangrui Song , Nick Desaulniers , Nathan Chancellor , Conor Dooley , Palmer Dabbelt Subject: [PATCH 5.10 036/390] riscv: Pass -mno-relax only on lld < 15.0.0 Date: Mon, 24 Oct 2022 13:27:13 +0200 Message-Id: <20221024113024.151598905@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113022.510008560@linuxfoundation.org> References: <20221024113022.510008560@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747574176138472957?= X-GMAIL-MSGID: =?utf-8?q?1747574176138472957?= From: Fangrui Song commit 3cebf80e9a0d3adcb174053be32c88a640b3344b upstream. lld since llvm:6611d58f5bbc ("[ELF] Relax R_RISCV_ALIGN"), which will be included in the 15.0.0 release, has implemented some RISC-V linker relaxation. -mno-relax is no longer needed in KBUILD_CFLAGS/KBUILD_AFLAGS to suppress R_RISCV_ALIGN which older lld can not handle: ld.lld: error: capability.c:(.fixup+0x0): relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax but the .o is already compiled with -mno-relax Signed-off-by: Fangrui Song Link: https://lore.kernel.org/r/20220710071117.446112-1-maskray@google.com/ Link: https://lore.kernel.org/r/20220918092933.19943-1-palmer@rivosinc.com Reviewed-by: Nick Desaulniers Tested-by: Nick Desaulniers Tested-by: Nathan Chancellor Tested-by: Conor Dooley Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt Signed-off-by: Greg Kroah-Hartman --- arch/riscv/Makefile | 2 ++ 1 file changed, 2 insertions(+) --- a/arch/riscv/Makefile +++ b/arch/riscv/Makefile @@ -37,6 +37,7 @@ else endif ifeq ($(CONFIG_LD_IS_LLD),y) +ifeq ($(shell test $(CONFIG_LLD_VERSION) -lt 150000; echo $$?),0) KBUILD_CFLAGS += -mno-relax KBUILD_AFLAGS += -mno-relax ifneq ($(LLVM_IAS),1) @@ -44,6 +45,7 @@ ifneq ($(LLVM_IAS),1) KBUILD_AFLAGS += -Wa,-mno-relax endif endif +endif # ISA string setting riscv-march-$(CONFIG_ARCH_RV32I) := rv32ima