From patchwork Wed Oct 19 08:22:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 4548 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp204290wrs; Wed, 19 Oct 2022 01:45:42 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5eTlOMZW0A2c4g2wAAXMMmCx+QQP6bd0VDEgIfwNH5MbeV+UyPYZXYK8zfuPgP4tlLlkFj X-Received: by 2002:a17:902:d510:b0:185:4b76:6277 with SMTP id b16-20020a170902d51000b001854b766277mr7254980plg.82.1666169142388; Wed, 19 Oct 2022 01:45:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666169142; cv=none; d=google.com; s=arc-20160816; b=eZ7LpHATOTF70+1N2neIItBCr9vBJMdp7MgWuthRLKS+HH/kTEpkWMhp0Ur7HarEmf ca3jVrCmiT2sXA8tWHpV+bHvV7E/dgEeY8kylhR+4s90VNoShdAx0Qvr6PYU+NHmcqW0 0cn0DVcUn3XrTExxbrgAbxdk4dPR9Jpci9FmrORIQUTmE4wLfo72mmVGd2EMMaF97xvv wYtLmaWNUTt+Niu0ck6LnTId9X2koICJyYgKg3wzFHfJCFCPyxZ0x88ZMubaPh8CCM1Y rQyqqv0KtlSNxcFWGoeWVQ6IUpR59EdMW4AHZImXLxrdh7YVTViL6m6q1prNYN0loMm4 X1Sg== 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=Ht1cQkQQF5x0S8owk+ugFuUtiqGHhRBhDdViN9dW/Q3owsNYnTu7tb4TAIsCPKCDN/ WgZBmA7sbYnuptS7p9domj+uMh8NKmz0UdxOKp855psyKfysNk7XigfRf+1MkT+WWlHY NJwsi2nM9yZs73IsPn25xyf0P+wVEGoPcVA07wessIpqkzqeNQl87SV6ZZ35Gu7wV5hg 0eJmUdRciJxcgf+0lHrCUfOyFOJmns4ZVgHJ9Q8jujBPd+RTqNa6m4cEifcAa6aqqSEo 0jzDTRQEXf8Vk1smtlOXnWcEgi/MiNzoVSjzJj7Z3bjlktLMTaXy5phwl05pafH/iHR4 F5SA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0Sop+Wj5; 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 f10-20020a056a00238a00b0051bbbc5f0aasi18213636pfc.261.2022.10.19.01.45.27; Wed, 19 Oct 2022 01:45:42 -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=0Sop+Wj5; 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 S231377AbiJSIpI (ORCPT + 99 others); Wed, 19 Oct 2022 04:45:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231327AbiJSIn7 (ORCPT ); Wed, 19 Oct 2022 04:43:59 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E02335A3F3; Wed, 19 Oct 2022 01:41:40 -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 4672D617E9; Wed, 19 Oct 2022 08:40:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 109DFC433D6; Wed, 19 Oct 2022 08:40:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666168826; bh=c4NL67WudStCz85yeweG+NkIyETz6hxWtl4wxLcqfqE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0Sop+Wj5AZSZiWkbEtCX5TIj4uM2YRS1aK+HX8goYsUNkxSbFqmRPOJZRk73VEpo/ wzcPaiT3+vv96Asujdqecf18hqE35WEGSgEAGF2vxI8GOr473VBud2MBL2wWXDbXYb C1oCwYCtwQ7Cr5tP/PCSM+NTJF8BP9sgHhEDOBuQ= 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 6.0 065/862] riscv: Pass -mno-relax only on lld < 15.0.0 Date: Wed, 19 Oct 2022 10:22:32 +0200 Message-Id: <20221019083252.805123179@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 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?1747104974936270296?= X-GMAIL-MSGID: =?utf-8?q?1747104974936270296?= 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