Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp2230163imw; Sun, 10 Jul 2022 00:57:33 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vI1MB/cx+QzA5dQGBPqeXyyr/Gz4Ta48nNYBWMqjWi5Lm45PZAGL6qeaAMgIhjsV9zulbW X-Received: by 2002:a17:906:49:b0:6f3:bb5e:54a8 with SMTP id 9-20020a170906004900b006f3bb5e54a8mr12049504ejg.534.1657439853738; Sun, 10 Jul 2022 00:57:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657439853; cv=none; d=google.com; s=arc-20160816; b=UfbMfckirPtub16W2taYczK2hyah11woXM6CgTwInf0DlI65HfWOBJ1YC7SNSPqK0g j7xGwqxvernP+hUGIE6/m6ceDIw+e38+2luQeUSUWxojJ+Qqon75P8ATqBTM+FBdURxv A2CfIULLjWgEEZS45M9oJsRRBj2MAmSx229B/JAaI6AQHdsXQwGS380SNfe6kmMx97l5 OUh1YfUwpflAnatlb8zDlrt2f/QP3P/0ivlqrzU5XWGB+BJDiy7j9UFA5KwSFntoWOD/ bNkL0k7MlUx8ok+YBtC9whzR892d2Zwn9P5lgF1eeKGE0bj9qHhq+GwemooDAe+7GgCS CV1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:mime-version:message-id:date :dkim-signature; bh=yAMjD7bFyIwsVP6jYrt8xQond+JqwS9zkIdAHuIkxN4=; b=M54TvhZovn3I9wyqls/Dg0xbWdE3X9RkQPTmNLLfyq+ukyEcN8JUnzkZrQVXt+9R8G TFRQSCGtV3CzC8vkMwHCzkGHd3pOn/on6WwXoiko3nEkMFLT2WOFRFmrf/QpUas+Wbpp NyZlieyTc4VymMitivRRyP9GBgaopwwtU4785bTsXj82w5/N/3sKAqG/FdvL6/Aky2kT p3shFAtoo9cVtm/YwXhxyIutkQNB0dLwkqrRl9BpQH/PW9QXDQrL7vD9EAEkp4vtoHVL akHofFSzsv+OK9xVtyL7b5j6k4IdoAXg50KoxZlqclzoKNyPgflv6g45pQN8JotYz5+y mYMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=liUn+rKX; 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 n11-20020a17090695cb00b0072ac9846988si4127980ejy.478.2022.07.10.00.57.09; Sun, 10 Jul 2022 00:57:33 -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=liUn+rKX; 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 S229552AbiGJHLX (ORCPT + 99 others); Sun, 10 Jul 2022 03:11:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229469AbiGJHLW (ORCPT ); Sun, 10 Jul 2022 03:11:22 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20606DEA1 for ; Sun, 10 Jul 2022 00:11:21 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id r6-20020a5b06c6000000b006693f6a6d67so1795389ybq.7 for ; Sun, 10 Jul 2022 00:11:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:message-id:mime-version:subject:from:to:cc; bh=yAMjD7bFyIwsVP6jYrt8xQond+JqwS9zkIdAHuIkxN4=; b=liUn+rKXpXfrSoXvO27l9hLOj7oo5CX3m8yhnF3O8Uo0ba67YaoDhrup80Hbcz/pZt 3kEuSGbXJ20Wjh0GYHTqFpZtKEZTJfIOo6ThgYoOEp2lTm2OD1kiiQOE5AlkPCIb7FhR Tgr1uBsd4QNXfMDjRN98RrNJXH2RxHP4DsVvOShzHxsugmZFmGMPWkmfqWEUF6RLrBlh cvl2b5KOOrsYKyDUTpPB8jei5OI4Mvz7jOa92WwuRm+EyFtKNtzWbal3Xi9gB2ZoXySc /UwtJaMhzidFnMAMzLeSU447Q7mJxgTTUU8bSkvqarH+A4jBk0DqFjmT0m4eHC3F5Kka kbrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=yAMjD7bFyIwsVP6jYrt8xQond+JqwS9zkIdAHuIkxN4=; b=1uXfxSt1b1NB0HGJgHISQhpOapwZ2Hb99ebIGjh7oZEFncOjMcvgJPvJiuQv5ORdcO +TqaxYaz1oycDtcsVNGdOSTSSmqIemoPT/KakZUogD60wia1182tMUFZKVScWuZl2iJg Jv1m8Dd/z3czC2aoYJjy9c08JQIIzba5QTMHt3UJihgiV0bpiKE0YPFTidBxvtGpsA3N ycL2WwZpyLgVcYnCvILjdPjNG/thEV8jJ484UPx3JPLUjWY3Hl58b5WSNdtyVNfOu/33 j2E9P+0vNP/Y6brrCYXxtOn1zos2DZAwXVSgJwttc0zMWim63/8k1oXOL9fP+EYBWl+Q RLrA== X-Gm-Message-State: AJIora8eY9b/pdq5+jK+5Epy+I9b0SRoWfgqlJxssvm7529PVsEWPhxb XOIsCwIhiw7nGk19sz6DIZJt+6NGw9zA X-Received: from maskray1.svl.corp.google.com ([2620:15c:2ce:200:1844:d82b:e1a:5303]) (user=maskray job=sendgmr) by 2002:a05:6902:706:b0:66e:ef10:1f7 with SMTP id k6-20020a056902070600b0066eef1001f7mr5952684ybt.610.1657437080152; Sun, 10 Jul 2022 00:11:20 -0700 (PDT) Date: Sun, 10 Jul 2022 00:11:17 -0700 Message-Id: <20220710071117.446112-1-maskray@google.com> Mime-Version: 1.0 Subject: [PATCH] riscv: Pass -mno-relax only on lld < 15.0.0 From: Fangrui Song To: Paul Walmsley , Palmer Dabbelt , Albert Ou , linux-riscv@lists.infradead.org Cc: Khem Raj , linux-kernel@vger.kernel.org, llvm@lists.linux.dev, Fangrui Song Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_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 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 --- 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