From patchwork Sat Oct 22 07:18:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7180 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1088810wrr; Sat, 22 Oct 2022 00:41:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7SYBf3RjmvB0o0JSbMQ4JgoDh74dmPw4v3f4d5Y5BJT1alye9zg56cehCUwq6NFF/fY8sc X-Received: by 2002:a17:902:b589:b0:179:f8c5:7212 with SMTP id a9-20020a170902b58900b00179f8c57212mr22960085pls.174.1666424478662; Sat, 22 Oct 2022 00:41:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666424478; cv=none; d=google.com; s=arc-20160816; b=qHsP3FhMc03vbEp8c2hLSvudMGhc9f0AbIYgJkKZ2WF1fcSsqKKdOuqob2wi6h1Kn4 TR3Mi2RxK+Fdos6gMheLZaiAopIY+AYexoe+zNy5c+bbbHv0I2/oBLEdkH5SoIj0J9PY 9Mcevj22XlCiDo3J5zK8lJbifE3YptVdQCKzflNXYFkWoYn6/LrDN4+SmTQstGbJ2HJY m8PYiPnVGKwa0dlB4mumHBEGW/H/lTcvGWzBnqczQZLlJ8sXZQ/gD/CGcg+EJhTVZG9x zqD/iwe6jjGMBTkOJ5eZLkl+Wwd42Ro//MEFtWaa339A0vqjW4sTcRaokK3xzHRSzaMv 4xug== 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=BIEPF+MSQ7lRp5vPBmB173yzLDRtzFdBFRo9ldmDQDY=; b=OXOG1FZKL4lJl5VEdJD7S4tOM/eRvWq7EpGfszJTKCn0fHb/vmdqilN9gsni4EgyNM nth+2dL00TVE1SaCSH8sKY6/cZZ9agdf7YrzeNE23hIti9SCN/qKkfin7LlKtYL7iO8b 8dtuZschfAgTIYvP72uaO5nWu8gReHzU2WgREmQtUeCFZCeergokr7sQPmcFiTpRA060 0hDieVfl4MsMIZXhOrbRakZBCVbKAQ0CIzHFQDwmzoaovnVPMfAPTrZkLgDPuCqKl2uh Bc51E0LLWZWHgDWDUlsidjmJGFCPqE+QKXA/EvvjUuyjF5sLLqrWL99mcwu6QW/HzIBi VrPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LCxp9o1s; 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 n8-20020a1709026a8800b00176841aa2e3si5221316plk.93.2022.10.22.00.41.06; Sat, 22 Oct 2022 00:41:18 -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=LCxp9o1s; 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 S230440AbiJVHkt (ORCPT + 99 others); Sat, 22 Oct 2022 03:40:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231160AbiJVHjy (ORCPT ); Sat, 22 Oct 2022 03:39:54 -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 77817625CD; Sat, 22 Oct 2022 00:37:23 -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 7921060ADA; Sat, 22 Oct 2022 07:36:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3485CC433D7; Sat, 22 Oct 2022 07:36:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666424201; bh=c4NL67WudStCz85yeweG+NkIyETz6hxWtl4wxLcqfqE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LCxp9o1sNHdT6CpnIIlsNjTynAzOOuyaSAHQ/gWrotgOAijsQozen2QaEim1WfWSx yuVoT/2EUuu/u+migblgmsbwyS2JGkqcQMeEv7Ynz7nHL16hcTDL73xOQZS2kflnRM XlLmRv/DL4og84eWgyjFOmwoT1SuPjAddEY9KWYE= 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.19 059/717] riscv: Pass -mno-relax only on lld < 15.0.0 Date: Sat, 22 Oct 2022 09:18:58 +0200 Message-Id: <20221022072425.506432681@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 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?1747372714139843220?= X-GMAIL-MSGID: =?utf-8?q?1747372714139843220?= 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 ifndef CONFIG_AS_IS_LLVM @@ -44,6 +45,7 @@ ifndef CONFIG_AS_IS_LLVM KBUILD_AFLAGS += -Wa,-mno-relax endif endif +endif # ISA string setting riscv-march-$(CONFIG_ARCH_RV32I) := rv32ima