Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3560974imw; Mon, 11 Jul 2022 10:55:51 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tG0nLH3rsbBakVT8otKYtQzxAF9ACu4+X5Dn0RIQs57wGGS8FTXKlmkj5RMR7R+gbM2r4n X-Received: by 2002:a05:6402:400a:b0:43a:40e4:af89 with SMTP id d10-20020a056402400a00b0043a40e4af89mr27048300eda.383.1657562151103; Mon, 11 Jul 2022 10:55:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657562151; cv=none; d=google.com; s=arc-20160816; b=MMrO6vxqz3iR5WALfIhZPd02LgjsTAAxSF4ozYZ2B/JoiRCStKmYkOJGhDWEwd2zWy F43GPSFyRctzm+CbwxwbWaDR/KzSKepOdH/9HaZB5uOJxFevqz1XHYLRoGgdTFBJbDxC TkEl7YrHAA63XxdhDRp/kQdpn+jPcpDgUDr2seygdyJq0Q8U3/MHMIst1BlnCFWKGYS1 HkXkJEJXwiP6WJOsHaOIQjysCJ3KYsthhcSiOOPwCLMMKHHJw+o5aaF4wONyv0LRM5ft DBu1c015i5XPUT6XIObeFsbWkTI03omKn9KNdF7PHZWY6jeCDUk2rh8vDAvkoBy4zfCI yczw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=gDBZ3WjTlTpA5Aean0LYY4GAnTd3bmsiPghI2pD8WrA=; b=0z8gS2izNB1cQasOzSejg3ArbL/kwI7GDzHyMyrWvO5DWsqilncTHVMAlAYcb+AaXv egJZf/biooHdRxVuusTFdQGtEzmCDgDxAK/WtoYrLjY2TwnHxlc1oZqXoclDDVr7fpnV vLuS3uO0dRXKkYGwFHdnnGd3+6t9jrRV9PRKkhAifzaGcgtOEEsOeGkAq8WmnE978mjL hOTOztjKqUrAHdi1sohMhAgV7lINSfyC4FQcNoWh3d/FvE+pXN0Z1/djVLsdCpEgctHa BtOETshMW84FmE7bVwCjlQ+LqePespwmhl6VRa8QJcZ7HxQ+N5hfiYsXHmxpmilRhtEo Rhqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BlYkvo3b; 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 w12-20020aa7d28c000000b0043a2348fea4si9049684edq.468.2022.07.11.10.55.26; Mon, 11 Jul 2022 10:55:51 -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=BlYkvo3b; 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 S230282AbiGKRgO (ORCPT + 99 others); Mon, 11 Jul 2022 13:36:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229517AbiGKRgM (ORCPT ); Mon, 11 Jul 2022 13:36:12 -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 AF70627B29 for ; Mon, 11 Jul 2022 10:36:11 -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 36A1A6136E for ; Mon, 11 Jul 2022 17:36:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 24210C34115; Mon, 11 Jul 2022 17:36:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657560970; bh=/JLD7aGPAUH2PlEjhKv8uoAqs8/TyZRWMWlU6+jVWgk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BlYkvo3bixwtbU6hCps4/5JfqYhJ5pR2zL0s9D0OlM2Jp2Dq/8xx2NK4NAJ3JQGpB gZKYcK/HJ0O/zdgNbOOQgmZ5FqPOB1TYqKj2ZSzQhXEleq4K1Yke3XCISkRbSBoKoF JnOWU17WoB5SRUA9UhoLCKQ5RumJqm0l3Sr44Q/44UZSp3aFVRGOWlFQlxjvItLSVB 3oSTQGA41U2Y6wP5oEEeiTT3/7HoXz48tkpb9ji8x++aED+S76Y3Xlz6ASpoyfUBDS dUz6dqIlSjUa5nNmaQ4hC0FAB9ViMDG+QJup58Hm5ldq8LeBjyJAkmGigAd8T8TAUC DDinQqc3d8l6Q== Date: Mon, 11 Jul 2022 10:36:08 -0700 From: Nathan Chancellor To: Fangrui Song Cc: Paul Walmsley , Palmer Dabbelt , Albert Ou , linux-riscv@lists.infradead.org, Khem Raj , linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: Re: [PATCH] riscv: Pass -mno-relax only on lld < 15.0.0 Message-ID: References: <20220710071117.446112-1-maskray@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220710071117.446112-1-maskray@google.com> X-Spam-Status: No, score=-7.7 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,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 Sun, Jul 10, 2022 at 12:11:17AM -0700, Fangrui Song wrote: > lld since > https://github.com/llvm/llvm-project/commit/6611d58f5bbcbec77262d392e2923e1d680f6985 > (milestone: 15.0.0) 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 ld.lld 14 and 15 both continue to link kernels and I have no issues booting them in QEMU. Tested-by: Nathan Chancellor > --- > arch/riscv/Makefile | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile > index 34cf8a598617..7e4ceb2a0981 100644 > --- 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 > -- > 2.37.0.144.g8ac04bfd2-goog > >