From patchwork Mon Oct 24 11:26:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 10159 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp640112wru; Mon, 24 Oct 2022 13:31:46 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6ZwOUp29Xn9fb8pwuqwhu4T6uT3yIuas3P+gK1+DzaxCGEdEdl8uAMlxKXCzZQedlKkMrD X-Received: by 2002:a63:d845:0:b0:44b:d074:97d with SMTP id k5-20020a63d845000000b0044bd074097dmr30173249pgj.32.1666643506372; Mon, 24 Oct 2022 13:31:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666643506; cv=none; d=google.com; s=arc-20160816; b=IbXwmeAyoNq6a+EFLNSnuW/V1RaiDYeCED5abZXOe5QVO0IeW4VdqVXYMEKvqrWVuw Dmu8PGFcY/zjxdPisIvF8Ur7ZSro20gbMLiLoLH+AipQC8aMecuALcPaVOHBp1RDWCHC z9oCxUNOqEccihBipQoGuLR0lZEeXR0h0hPz8DOWUqmcye9Wrt8RGei3wv1KspO6eUgV 5XJO2fB9eq67chOjgpki3Kedct4rzUPMl7UdwgrEIV1mZsqtXQc2SWC2sCm2EElB2EgW l/AEAfgC1zFaEZswL6vM8dvjdTv9O7JFnw0mjD38bJEZz+zS5WO6x+Tsw+MBco5YEVbY AY7A== 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=PUEUVogPFqUAYTr3eiOkDiD/5s5BXsnMg8aoVT5stdY=; b=YGoqBS4BdmJ0fZDxROnHuWQXP1cHfTPbgiRNMVJYwcVeNowZlnJY4vxfrK8/PTAE/g VfJz5/HDl63qicL9BxwxiyvIFvjWX9YyTqmG9rqi4mcftBjbkkzCmP/CJErGpNM2UNhr ddd1/eFfXgw9XPTWBDSmFylw/z2FhTp4xKUHk/bl3oaGFVGiU+BnJ2kn+0mk6WPeFW/v FAHFNV0QMMXLBJ5UwSLPq1V4bmdCjxiR2uInDiW+e+LFVBUQHuBYc6w+/BhCcqrdufUO /TMS1tqtgMa9lu8cXPE7vzXR+3dTlUSXL6SL09wGd/6Wr3TfaM1l3STWgM4BpU/uMQ+X Qctw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="NBNS/TxY"; 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 v8-20020a1709028d8800b0017d6ffda9e3si435775plo.369.2022.10.24.13.31.31; Mon, 24 Oct 2022 13:31:46 -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="NBNS/TxY"; 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 S230116AbiJXUVl (ORCPT + 99 others); Mon, 24 Oct 2022 16:21:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233604AbiJXUVA (ORCPT ); Mon, 24 Oct 2022 16:21:00 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0596EE52CB; Mon, 24 Oct 2022 11:37:38 -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 ams.source.kernel.org (Postfix) with ESMTPS id 845D7B81190; Mon, 24 Oct 2022 12:34:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E1DC4C433D6; Mon, 24 Oct 2022 12:34:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666614896; bh=j/LOpBXDmZRJQVdeQyAT0GuWFgo4jVHD9tLtPcE6Lm4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NBNS/TxYFaY8+l2DaxrT+4Lr5WAtejh1/znENrX5f05mYqoEHhJtUEIdaysuPEYt9 oY0uNdtZsrwxsEKZSuSsTJEZn7oPW3azSjAOaOnbEqQDuj/hj6VA1c1e4tWlfRkcnV LSaWce9lkLuXF57Zl+ubhZyR0hVklb5cwmRHMKNE= 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.15 045/530] riscv: Pass -mno-relax only on lld < 15.0.0 Date: Mon, 24 Oct 2022 13:26:29 +0200 Message-Id: <20221024113047.055726393@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113044.976326639@linuxfoundation.org> References: <20221024113044.976326639@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 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?1747602381542011784?= X-GMAIL-MSGID: =?utf-8?q?1747602381542011784?= 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 @@ -39,6 +39,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 @@ -46,6 +47,7 @@ ifndef CONFIG_AS_IS_LLVM KBUILD_AFLAGS += -Wa,-mno-relax endif endif +endif # ISA string setting riscv-march-$(CONFIG_ARCH_RV32I) := rv32ima