public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] RISC-V: Add the option "-mdisable-multilib-check" to avoid multilib checks breaking the compilation.
@ 2023-05-23  4:42 Jin Ma
  2023-05-25 16:10 ` Kito Cheng
  2023-05-26 13:19 ` Maciej W. Rozycki
  0 siblings, 2 replies; 9+ messages in thread
From: Jin Ma @ 2023-05-23  4:42 UTC (permalink / raw)
  To: gcc-patches
  Cc: jeffreyalaw, kito.cheng, christoph.muellner, jinma.contrib, Jin Ma

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=<string>	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().
-- 
2.17.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-05-30 23:39 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-23  4:42 [PATCH] RISC-V: Add the option "-mdisable-multilib-check" to avoid multilib checks breaking the compilation Jin Ma
2023-05-25 16:10 ` Kito Cheng
2023-05-26 13:19 ` Maciej W. Rozycki
2023-05-29  2:53   ` Jin Ma
2023-05-29  3:14     ` Kito Cheng
2023-05-29  3:46       ` Jin Ma
2023-05-29 13:02         ` Jeff Law
2023-05-30 14:48     ` Maciej W. Rozycki
2023-05-30 23:39       ` Jeff Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).