RISC-V: Add the option "-mno-multilib-check" to disable multilib checks.
Checks
Commit Message
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(-)
@@ -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"
@@ -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=<string> 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.
@@ -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