From patchwork Fri May 26 06:13:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jin Ma X-Patchwork-Id: 99298 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp258845vqr; Thu, 25 May 2023 23:15:06 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5LbPhwO3YeejJzXVZDo5IMkLjEM4nf7xpFd9Lrrx1wcQ/ZO2kEdRlFfaiDbGhddzDmi4gl X-Received: by 2002:aa7:c38c:0:b0:510:dd3e:86cd with SMTP id k12-20020aa7c38c000000b00510dd3e86cdmr506553edq.20.1685081705968; Thu, 25 May 2023 23:15:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685081705; cv=none; d=google.com; s=arc-20160816; b=JTiwcnY+/we+YednSlHu55ZPyXjYkETqB40u1PMT6bXXC9Q0tgnfUQoH8iJSE3WhrZ nEUtC8WD8BmcOB9umRj0UFYBrBURlJaJxQyTrI8rJC9JWqLvDUR4Ph0dhrv+lutJqF8G x3m/fte5ifh69aE5lpNPBVEnhLHFyOJCbsmUmTEY7NKIfY+MIw4dl+T7XDwXBFWBWIdA T8EDhSnXM22UtjI6UAUteR1lOrfsQfkf1/w7UHl5UbA0IgMQGbnz9GCLV7KqRkSM2/XC USWlkbY6ZeuL3QHJpjpQS8juHLEwpCOV0DlLnA56OrCA68fET4iMAt7CiiC5yBBtBCgU l6xw== 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=VgDS6Ya0kYcxO+o1wmb4JSJkhFtxxJE0zYko/1UbT6s=; b=LXP9VzUir9/awbcjAdORXuCmz7xBM2BL2IxrIJVq6qtp5Z8wjrdz5OcXyPhlCgOcXK g4ILhXdjkem+b5YmpKXnAAV5khpOuC6rcMitw6iQ/0YAeGS6+q5MgQP9rb+89vQ8h7on dkVhhuAaZrfm08IXk7OU/K+j4eb+JJkapsQoL1opLAJE5mKscDOugVb2AuCmWSzAWXGe qwQkrARF4xcHd6+PuRpG60zFSWGMgdMgcutVZ2V/npMoWGacZv35RmEaE8i2k/2nZKQd TqAxeuAzbYAVS6Nq/WKzoLgrL8cyTS73+OK7RDsYbnu/3DdSq1EMSlJdUS9dFkCgWTrj 7bHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=oKUQZQxl; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c 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 (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id d12-20020aa7c1cc000000b00504b18d24f8si597977edp.362.2023.05.25.23.15.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 May 2023 23:15:05 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=oKUQZQxl; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c 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 9AE34385843A for ; Fri, 26 May 2023 06:15:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9AE34385843A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685081704; bh=VgDS6Ya0kYcxO+o1wmb4JSJkhFtxxJE0zYko/1UbT6s=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=oKUQZQxltG8mvNgvE3zxCbPesmZiYjKXNpOywJlg8M9qC3oM2QIACLq0xBL6hgXYw AEaqK8J5qsiSrycpLEKCzUDqyt0iRBGwuCqztiN4LN93YyYNxzLCK3D86DmhOCtisq W/AeupLWMJBZoBBcG5R0IL18OSRh7DAMuf6W0wiQ= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from out30-113.freemail.mail.aliyun.com (out30-113.freemail.mail.aliyun.com [115.124.30.113]) by sourceware.org (Postfix) with ESMTPS id 209B93858D39 for ; Fri, 26 May 2023 06:14:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 209B93858D39 X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R141e4; CH=green; DM=||false|; DS=||; FP=0|-1|-1|-1|0|-1|-1|-1; HT=ay29a033018046056; MF=jinma@linux.alibaba.com; NM=1; PH=DS; RN=7; SR=0; TI=SMTPD_---0VjV4VNX_1685081646; Received: from localhost.localdomain(mailfrom:jinma@linux.alibaba.com fp:SMTPD_---0VjV4VNX_1685081646) by smtp.aliyun-inc.com; Fri, 26 May 2023 14:14:08 +0800 To: gcc-patches@gcc.gnu.org Cc: jeffreyalaw@gmail.com, richard.sandiford@arm.com, kito.cheng@gmail.com, christoph.muellner@vrull.eu, jinma.contrib@gmail.com, Jin Ma Subject: [PATCH] RISC-V: Add the option "-mno-multilib-check" to disable multilib checks. Date: Fri, 26 May 2023 14:13:54 +0800 Message-Id: <20230526061354.282-1-jinma@linux.alibaba.com> X-Mailer: git-send-email 2.38.1.windows.1 MIME-Version: 1.0 X-Spam-Status: No, score=-20.6 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?1766936234446876695?= X-GMAIL-MSGID: =?utf-8?q?1766936234446876695?= 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 avoi interruption of compilation by multilib checks. gcc/ChangeLog: * config/riscv/elf.h (LIB_SPEC): Do not run riscv_multi_lib_check() when -mno-multilib-check * config/riscv/riscv.opt: New. * doc/invoke.texi: New. --- gcc/config/riscv/elf.h | 2 +- gcc/config/riscv/riscv.opt | 5 +++++ gcc/doc/invoke.texi | 9 ++++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/gcc/config/riscv/elf.h b/gcc/config/riscv/elf.h index 4b7e5c988ca..cb3ac903a3d 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()}}}}" + "%{!mno-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..41a817eb774 100644 --- a/gcc/config/riscv/riscv.opt +++ b/gcc/config/riscv/riscv.opt @@ -295,3 +295,8 @@ 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. + +mno-multilib-check +Target RejectNegative +Disable multilib checking; use the default multilib if a compatible +one is not found. diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index ee78591c73e..bc1ab34d5a7 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -1228,7 +1228,8 @@ See RS/6000 and PowerPC Options. -mstack-protector-guard=@var{guard} -mstack-protector-guard-reg=@var{reg} -mstack-protector-guard-offset=@var{offset} -mcsr-check -mno-csr-check --minline-atomics -mno-inline-atomics} +-minline-atomics -mno-inline-atomics +-mno-multilib-check} @emph{RL78 Options} @gccoptlist{-msim -mmul=none -mmul=g13 -mmul=g14 -mallregs @@ -29131,6 +29132,12 @@ which register to use as base register for reading the canary, and from what offset from that base register. There is no default register or offset as this is entirely for use within the Linux kernel. + +@opindex mno-multilib-check +@item -mno-multilib-check +Disable the check on the correctness of multilib. When the correct multilib +is notmatched, the default multilib will be used. This has certain risks +and is not recommended in a production environment. @end table @node RL78 Options