From patchwork Mon Oct 24 11:29:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 10216 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp642620wru; Mon, 24 Oct 2022 13:39:01 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6bgNZC4b5GS6r8hJ7AQpseKXVQ1SvEeuDCV+HoziE5oRImk6tGC+gctq7xJ7ImRsfH6+EL X-Received: by 2002:a17:902:dac3:b0:186:a437:f4b8 with SMTP id q3-20020a170902dac300b00186a437f4b8mr7728533plx.70.1666643941581; Mon, 24 Oct 2022 13:39:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666643941; cv=none; d=google.com; s=arc-20160816; b=Xq1SJFQxZhzrYSg7DxL/84InJJd6JedYpfzDCypcmRQrO4LKqBZAEJX2pkGE5XhCD0 KowavOM7ZxZDDUBkcRcmRMvXDteD8R3zW8wBCYGHeeyJy8G+cJdpFih47Q/B2X3+zsng R53eOhuexJtHuGQcLMVzzo3arkE0NC7PKKQ6njUSonME28qKn1aeBM47f2/noTQehXEX 6HUJyAjZhkakoax9OzTcyOOLGKGCEuz3cWTZQzJ/NfLZvIU2QIgqmPop63RIR2iqjhsU Y7c/NavErrv8zOTUp+9BzOPhPMcznmPXFp4yqXfvEhk4/RN9MpPiIYTP46QWBTs1F7lT xhRA== 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=rOnf+DLt5wlVwiBLSeJfnmo+zGFnBRojGhJ6iPvP7jE=; b=jIDv+Xf1T2KtJpHOXYPChdhnaLVCxvKG+K9hh1OtWE4lrwtl0tfCs4KHZP4Wm7V/rN b40855RaS2s5Q0/iVXNH2okmc0VdEB5Uq8x6FIe2U8Gtp/QTPuJvbhhSSeFVHGKzNP+e eDeCeeLGOaOkAM5mPCBFR60jpA1yHHr7BUlF+6qf/VMI1czmxpO7+1c3dl8snUn4akGV a61ieFkVba366eYMFIsGZQOnueDLiTF7MNHIaebg/WS/fqS3xjKnoNLmKqfcf7NuRY+H OddGx+57T6PmvD/bouxu+X1BN62UQmM0sIxyZPiUONxN6PEtRlLiYjdoyzHvTh47kL2n WBiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qqtLZBOr; 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 w186-20020a6382c3000000b0041cd5c0295esi470926pgd.852.2022.10.24.13.38.48; Mon, 24 Oct 2022 13:39:01 -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=qqtLZBOr; 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 S234505AbiJXUhn (ORCPT + 99 others); Mon, 24 Oct 2022 16:37:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234391AbiJXUgg (ORCPT ); Mon, 24 Oct 2022 16:36:36 -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 13F3D1D346A; Mon, 24 Oct 2022 11:48:30 -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 70C77B81219; Mon, 24 Oct 2022 12:07:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BF06EC433C1; Mon, 24 Oct 2022 12:07:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666613235; bh=YzygpU2lqHazfot/AtqlQuUcuIafh1+pkMPgAoMjJ4Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qqtLZBOrSu3dPOxOhHisPPgHgXh28kLdl62TP49XdqMud2qfA1ThcYFr/W+jOqJvk FObH/x6UodmZyej2eRrdQ/D0614sQ+MthJmcnEIf544rDjU1bfftOlEgwyytUBuNn4 D9bS+NF72MJsVKJi7Vh8GV7EYCRxqdkzo0DM/R30= 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.4 030/255] riscv: Pass -mno-relax only on lld < 15.0.0 Date: Mon, 24 Oct 2022 13:29:00 +0200 Message-Id: <20221024113003.450495044@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113002.471093005@linuxfoundation.org> References: <20221024113002.471093005@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?1747602837750924322?= X-GMAIL-MSGID: =?utf-8?q?1747602837750924322?= 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 @@ -35,6 +35,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) @@ -42,6 +43,7 @@ ifneq ($(LLVM_IAS),1) KBUILD_AFLAGS += -Wa,-mno-relax endif endif +endif # ISA string setting riscv-march-$(CONFIG_ARCH_RV32I) := rv32ima