From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vs1-xe2c.google.com (mail-vs1-xe2c.google.com [IPv6:2607:f8b0:4864:20::e2c]) by sourceware.org (Postfix) with ESMTPS id 3B46D3858D37 for ; Thu, 25 May 2023 16:10:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3B46D3858D37 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-vs1-xe2c.google.com with SMTP id ada2fe7eead31-4393c1b8d1cso363676137.0 for ; Thu, 25 May 2023 09:10:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685031045; x=1687623045; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=dmK6gb6Z1A3/TRS3XCeE7g1cAwXbTICrLg19DNAdhJE=; b=P6S4hPrQ9t2DO8+fd7TWO5GMRRbBb/yEAPIpt5NOsucqduPdRzPteuuCuKorDHoetS e6D21+y5nzIN2QGMeEHUNcDcuGOkWwE+sCpnH26iEELiufJWPSXpV+hpWO4S2ifQAgIp JuoPxnjsY3PlIn1uOVwWStTpWznHmXZ+ZvczF6EJbt1lc461b60CMexP21kDR//vFMj0 hO8Bb8De1BYO6zJSQKTIGwMa4uu7Ds+nd5Cv8H4oRHgB9DhMq0uMMpuyQEIB+BEugSkl wb+BrBIVbnYNveusDwtZgfiOYzJcZNT8vAzt1APhOjiEeV/qCqXF7/hu9IqaKJHMVTla Rkog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685031045; x=1687623045; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=dmK6gb6Z1A3/TRS3XCeE7g1cAwXbTICrLg19DNAdhJE=; b=DN0LJMgH1dPLOIec52ljWTm5lK/+5otrg5wZgC2fIvMEgLuL2pdLMUyh+PY9ONzxSu STPZ3llfaLa85MPS3l+D54xnNPTZKf5I6hdDrS9ySEjOahoxecIOEN45Txva0mLmu4qb l994CrJ1UVZiPs7QDZGBa2LXZ6J+bh4Q8OY8Cq0INkBLGmJmX487AMLD22jKhB6Ge8IB ljGaxpwZtDmNU+nY6iMHCXsl7v8CzbpZpzBp1xUCFpT4oPPowF+L32iUrAThvW3F3geV fjILO3U4vZRtm2p9wp5Gd5dFPomVeKopeJacX5JXZffe6Fsu81t+Dj8ay2pAYWQV0txE 7gtA== X-Gm-Message-State: AC+VfDzSBRKFW+euSUdsQaqHvWw19zyDFg5p4nT6s1OnpZFp2VnyJiBZ O1m5RB1A5e1DOMtk5rhRtM5udIHVhgLLX6eZZPg= X-Google-Smtp-Source: ACHHUZ4d7Jcfg+yXf2gJWk6Yrge4PFqyQKoc9hk6xXQgZiVyUJ+E8FwYT5mhB6e1waywWqhe23aGXd2IZ7vW3w1XmMo= X-Received: by 2002:a67:f594:0:b0:437:e137:3346 with SMTP id i20-20020a67f594000000b00437e1373346mr6366201vso.14.1685031045252; Thu, 25 May 2023 09:10:45 -0700 (PDT) MIME-Version: 1.0 References: <20230523044202.1201-1-jinma@linux.alibaba.com> In-Reply-To: <20230523044202.1201-1-jinma@linux.alibaba.com> From: Kito Cheng Date: Fri, 26 May 2023 00:10:34 +0800 Message-ID: Subject: Re: [PATCH] RISC-V: Add the option "-mdisable-multilib-check" to avoid multilib checks breaking the compilation. To: Jin Ma Cc: gcc-patches@gcc.gnu.org, jeffreyalaw@gmail.com, christoph.muellner@vrull.eu, jinma.contrib@gmail.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: > 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. I think it's dangerous to remove the check, but I can understand there are some cases where we really do not want the `security lock`, so I am OK with introducing a new option to disable that. but plz add documentation to the option into gcc/doc/invoke.texi and mention it will just use default multilib and MIGHT not be correct in some cases. > --- 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 I would like to rename that to mno-multilib-check since that is more like all other gcc option conventions. > +Target Bool Var(riscv_disable_multilib_check) Init(0) You don't need Var(riscv_disable_multilib_check) and Init(0) since no one check the value And you need RejectNegative to prevent gcc accept -mno-disable-multilib-check > +Disable multilib checking by riscv_multi_lib_check(). `riscv_multi_lib_check()` is meanless for users since it's implementation detail. `Disable multilib checking; use the default multilib if a compatible one is not found.`