Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3560975imw; Mon, 11 Jul 2022 10:55:51 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vxQq2BBR+ktOGKHVTdx2Mf9OIteRpkK7silpbq5Z6K67bgUkx4zCT/YrsJE2UclBI7BcSA X-Received: by 2002:a17:907:97d0:b0:726:ccc3:e9d9 with SMTP id js16-20020a17090797d000b00726ccc3e9d9mr20063705ejc.154.1657562151191; 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=BfdyBCEfssJSzvKp5FJCjsYFgIgM8sBA7tOhAGITRiddTpTwJ0l4ctkmhaXZoPi7XS I0UrDAiJDaBz55W/Wrk0mMl/T0YF0H4LDW7R9ijsO+dZ8WmPE9FuKyxZcM3YcjPjlFWG tx48cOVHgeElfPwJO8ABJWSxHD+O40nmcscXqEWPYA1rRP+Xo1KvMpqcWQ+/YQFGgkx1 WYB6NBf0oVpsPBne9dTzLdpDjlYO0HYtOfW9WgRG/uJqKENQ5HIoGpLl1QhWoA7IZSXL jg2R3OcD+5oUTf8Ki0A0D4FWWZm49V8Qr3yMjHRdOfT25eyBd6LvwNQ7U8PD58JaILa/ eiuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=zQj9SC9LzzvOt29hChR7g7E0Lc7GX6Hy0KSuYXInGDE=; b=TpxY5A7MgP1lWVhLp3FueG4FtAB6DFcsaFDA9bzPrNlhcSBqYxJS9W5RviYSJ2J8uU A7S65m+vqJ/mg580meZ44VvQlIO/NgIHLxZtjr8e9+RZg9qmF0Rgk2l6UsILWAs2/OWx gaL6fr1rRbJ3uHg4NFJfRYZQ3GEoLjVnm1i/fUxzwfubX7mTD+JKBMC8oKkoslxLEiNo hshhvwWtv9WB6Ld24jtJ6K5VKvZuW1+tLdWKWkNNO03T/QWQ3OTEi1qxQlX2PTC3GePl KU/6AnKgTNEjFBBb0aymOEWkVXVn8aqym0T2eoNTNL6j1K4FRHvbA30iCY+UbMR+oUwV ZGVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=f1TD0jlj; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g6-20020a170906594600b00726abbc726csi9209695ejr.836.2022.07.11.10.55.25; 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=@google.com header.s=20210112 header.b=f1TD0jlj; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231478AbiGKRip (ORCPT + 99 others); Mon, 11 Jul 2022 13:38:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229660AbiGKRim (ORCPT ); Mon, 11 Jul 2022 13:38:42 -0400 Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBE106569 for ; Mon, 11 Jul 2022 10:38:40 -0700 (PDT) Received: by mail-lj1-x22e.google.com with SMTP id r9so7058704ljp.9 for ; Mon, 11 Jul 2022 10:38:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zQj9SC9LzzvOt29hChR7g7E0Lc7GX6Hy0KSuYXInGDE=; b=f1TD0jljg/IWNfS09CDUXQ2i7XWpMyLwkZYu7JGV2gzXGa2UVnksceghpfLAy/UQC6 AJ114v+NuGgFr7knklFFpz6ynue3oYETOfOm5R//r6OUBA7BELjDo5Wk3tlBs1wDb689 O923kaNhZUnHvdp476b/5NIklZmtWSPbnYd5u8VIpENd0nwqvMtIwuwospT0OuzRRfFD yM6dWj90pCYNGJRTDqlWUJo/Nu7KHUnfX0Dzn2Dj1MmFEQJwptkhESV4I+WFwN4PRbMS wIrYu07ulUmuOQggE46pqVEpy2So5a9Vp6pUcKuZ+2W31x+Drf9hUABiGkzYO5DfaZ+C dJVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zQj9SC9LzzvOt29hChR7g7E0Lc7GX6Hy0KSuYXInGDE=; b=OwNFnGOEOzq7RRnHRcdppk9CbjGHu0jQyqQ7Kwz9Qsg2JPUOvV+cwg1eJHwRlhLG2+ lk+mPyrdY4M8FiTouV2/3bv2RCERVp13LOuzxENjL6Daylq5P9SytmHSjWckv+a5fhDD dBxmMCaFK8ad5Bn5zZtu3PJap4XdliMcbonP9ce/5W22wlRWV18jwtJnYpV9kRIqdgGV gjD+sqEekASw/6GIQUWicYFm0Nov/GXhhn4MiBGTeIMz2nHYqgG8k7eUAPYhasf8wBRw E4uFGTLG6qpWOIiiDHzfTri2+1sVvfbde75BA6JHLE2iOZWNXCn3ZDHzDvGdaaXIv1wT dopg== X-Gm-Message-State: AJIora+Tok/+qy72VklFc/ooa2igLdNjgs5Jx7Dvsr3aZPfjbOI3A7u/ IbgDYd/TSRO1FT5ngFtbSJEUL7eTdYiUt6hwd6kczg== X-Received: by 2002:a05:651c:2104:b0:25b:f4ed:db93 with SMTP id a4-20020a05651c210400b0025bf4eddb93mr10900111ljq.295.1657561118922; Mon, 11 Jul 2022 10:38:38 -0700 (PDT) MIME-Version: 1.0 References: <20220710071117.446112-1-maskray@google.com> In-Reply-To: <20220710071117.446112-1-maskray@google.com> From: Nick Desaulniers Date: Mon, 11 Jul 2022 10:38:25 -0700 Message-ID: Subject: Re: [PATCH] riscv: Pass -mno-relax only on lld < 15.0.0 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 Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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 AM 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 Thanks for implementing relaxation in LLD for RISC-V! Reviewed-by: Nick Desaulniers Tested-by: Nick Desaulniers > --- > 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 > > -- Thanks, ~Nick Desaulniers