From patchwork Tue May 23 04:42:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jin Ma X-Patchwork-Id: 97723 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1891829vqo; Mon, 22 May 2023 21:43:08 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ45B1X0gEJ49I46AeFLim4HWd91KhWbopKQQ7ig4n8ue1J98E1Tu4SCTtv9naENjUtj8Fow X-Received: by 2002:a17:907:9712:b0:96f:e622:6865 with SMTP id jg18-20020a170907971200b0096fe6226865mr4723634ejc.57.1684816987972; Mon, 22 May 2023 21:43:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684816987; cv=none; d=google.com; s=arc-20160816; b=u5ya/LarvkjVTOqqOTi9NuDuvYareyY2IWFWKppB2Et5JsGVyi9CAjBvHqpqnBKhM5 jXEe95Af0QJy6n2nxmYx9GJVP5xJLQcIL5xsOWuuAN1tYkJj3WMLQBdjxaptrDN+0V9r ZgjP/IltYXq8hZGTg+Is2dw5K4KcEpFvH1PbHmbYXWCIHyKeTZQk/OcwCwCuBSmYiCWl zT1TQ7NCrQLg6Lx2Syzu8Yi5EaTsf32JlIAhhFzCeLC11CnbGZuFceBSxTfT0tECwcqT F6FI7/tIH/IZitgGv75ma4tb19Lz76u3MD6G7Ez3Pef2R5ma9Z0z3KjLqx6J1nUf9ESG P7/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=qpXZ/d+zEfEyZwO8rE4KBhBtXYuNt+qggcBRfu8HJmQ=; b=Pt5YK10CmC+mX1mNvnOKvX3NezmBrwu24mVsBgCyiQgzYYRpGGFEK1/gCN/ABGXMb2 NjCyG3spD/iH5vwJycZyLRcjAU6uXdTfC6qhQl9WSqL2siHlfcbXIsC/e8isAT1PoJTN 0DnaDGRhgFws3qDswssCr/iH/F0v7C5L2ZMi/dzybyl0QxomKuGWSle61w4EfUbve5Ht j9vG2X1mYDAg+2djWW5rgr4+K6ZV28C1Oeb4YMrZ3W5hC6EAm3nX5BLhahQlB04CiPYw ogkvZRsh1Y1WSTF8p0r3iqaOvCSSKzxb9X/fXOWhbodFGmZoE2GZQFcQThd5v7oL21Oz 6nIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=rfHpMqEz; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id jo12-20020a170906f6cc00b0096f8ffdc5d9si130901ejb.628.2023.05.22.21.43.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 May 2023 21:43:07 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=rfHpMqEz; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E058D3858426 for ; Tue, 23 May 2023 04:43:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E058D3858426 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684816986; bh=qpXZ/d+zEfEyZwO8rE4KBhBtXYuNt+qggcBRfu8HJmQ=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=rfHpMqEzw0XDscpWsFXDrKa1A42i8BbmGZf7TJR/vQ5kRPP5AInTHxpj3vxD+Ic9q 8GptuvxjM4r91I3Wf7b0nZbZpCZk/ALsgKQb8vHBgCpLUrr5yLZLkSg0Tuvv+urE5V xGnqdkkaFP9ElTDnqEaWY3GH6dTWENT1o7N0YyO8= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from out30-111.freemail.mail.aliyun.com (out30-111.freemail.mail.aliyun.com [115.124.30.111]) by sourceware.org (Postfix) with ESMTPS id 1C0113858D35 for ; Tue, 23 May 2023 04:42:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1C0113858D35 X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R561e4; CH=green; DM=||false|; DS=||; FP=0|-1|-1|-1|0|-1|-1|-1; HT=ay29a033018045168; MF=jinma@linux.alibaba.com; NM=1; PH=DS; RN=6; SR=0; TI=SMTPD_---0VjIdiIM_1684816932; Received: from localhost.localdomain(mailfrom:jinma@linux.alibaba.com fp:SMTPD_---0VjIdiIM_1684816932) by smtp.aliyun-inc.com; Tue, 23 May 2023 12:42:15 +0800 To: gcc-patches@gcc.gnu.org Cc: jeffreyalaw@gmail.com, kito.cheng@gmail.com, christoph.muellner@vrull.eu, jinma.contrib@gmail.com, Jin Ma Subject: [PATCH] RISC-V: Add the option "-mdisable-multilib-check" to avoid multilib checks breaking the compilation. Date: Tue, 23 May 2023 12:42:02 +0800 Message-Id: <20230523044202.1201-1-jinma@linux.alibaba.com> X-Mailer: git-send-email 2.38.1.windows.1 MIME-Version: 1.0 X-Spam-Status: No, score=-21.1 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY, 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 server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jin Ma via Gcc-patches From: Jin Ma Reply-To: Jin Ma Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766658657791336462?= X-GMAIL-MSGID: =?utf-8?q?1766658657791336462?= When testing a extension, it is often necessary for a certain program not to need some kind of extension, such as the bitmanip extension, to evaluate the performance or codesize of the extension. However, the current multilib rules will report an error when it is not a superset of the MULTILIB_REQUIRED list, which will cause the program to be unable to link normally, thus failing to achieve the expected purpose. Therefore, the compilation option is added to avoid riscv_multi_lib_check() interruption of compilation. gcc/ChangeLog: * config/riscv/elf.h (LIB_SPEC): Do not run riscv_multi_lib_check() when -mdisable-multilib-check. * config/riscv/riscv.opt: New. --- gcc/config/riscv/elf.h | 2 +- gcc/config/riscv/riscv.opt | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gcc/config/riscv/elf.h b/gcc/config/riscv/elf.h index 4b7e5c988ca..afde1b12d36 100644 --- a/gcc/config/riscv/elf.h +++ b/gcc/config/riscv/elf.h @@ -29,7 +29,7 @@ along with GCC; see the file COPYING3. If not see #undef LIB_SPEC #define LIB_SPEC \ "--start-group -lc %{!specs=nosys.specs:-lgloss} --end-group " \ - "%{!nostartfiles:%{!nodefaultlibs:%{!nolibc:%{!nostdlib:%:riscv_multi_lib_check()}}}}" + "%{!mdisable-multilib-check:%{!nostartfiles:%{!nodefaultlibs:%{!nolibc:%{!nostdlib:%:riscv_multi_lib_check()}}}}}" #undef STARTFILE_SPEC #define STARTFILE_SPEC "crt0%O%s crtbegin%O%s" diff --git a/gcc/config/riscv/riscv.opt b/gcc/config/riscv/riscv.opt index 63d4710cb15..9940a24a7f9 100644 --- a/gcc/config/riscv/riscv.opt +++ b/gcc/config/riscv/riscv.opt @@ -295,3 +295,7 @@ Enum(riscv_autovec_lmul) String(m8) Value(RVV_M8) -param=riscv-autovec-lmul= Target RejectNegative Joined Enum(riscv_autovec_lmul) Var(riscv_autovec_lmul) Init(RVV_M1) -param=riscv-autovec-lmul= Set the RVV LMUL of auto-vectorization in the RISC-V port. + +mdisable-multilib-check +Target Bool Var(riscv_disable_multilib_check) Init(0) +Disable multilib checking by riscv_multi_lib_check().