public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] MIPS: use arch_32/64 instead of default_mips_arch
@ 2023-02-03  9:05 YunQiang Su
  2023-02-03 12:28 ` Richard Sandiford
  0 siblings, 1 reply; 6+ messages in thread
From: YunQiang Su @ 2023-02-03  9:05 UTC (permalink / raw)
  To: gcc-patches; +Cc: macro, syq, jiaxun.yang, YunQiang Su

The value of default_mips_arch will be always used for -march by default,
no matter what value is given to -mabi.
It will produce abnormal elf file like:
 ELF 32-bit LSB relocatable, MIPS, MIPS64 rel2 version 1 (SYSV)

So we use with_arch_32 and with_arch_64 instead of default_mips_arch
for all mipsisa[32,64]rN triples.

gcc/ChangeLog:
	* config.gcc: use with_arch_32 and with_arch_64 instead of
	default_mips_arch for mipsisa[32,64]rN triples.
---
 gcc/config.gcc | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/gcc/config.gcc b/gcc/config.gcc
index f0958e1c959..0b6d093d847 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -2518,13 +2518,16 @@ mips*-*-linux*)				# Linux MIPS, either endian.
 	extra_options="${extra_options} linux-android.opt"
 	case ${target} in
 		mipsisa32r6*)
-			default_mips_arch=mips32r6
+			with_arch_32="mips32r6"
+			with_arch_64="mips64r6"
 			;;
 		mipsisa32r2*)
-			default_mips_arch=mips32r2
+			with_arch_32="mips32r2"
+			with_arch_64="mips64r2"
 			;;
 		mipsisa32*)
-			default_mips_arch=mips32
+			with_arch_32="mips32"
+			with_arch_64="mips64"
 			;;
 		mips64el-st-linux-gnu)
 			default_mips_abi=n32
@@ -2540,22 +2543,26 @@ mips*-*-linux*)				# Linux MIPS, either endian.
 			;;
 		mipsisa64r6*-*-linux-gnuabi64)
 			default_mips_abi=64
-			default_mips_arch=mips64r6
+			with_arch_32="mips32r6"
+			with_arch_64="mips64r6"
 			enable_mips_multilibs="yes"
 			;;
 		mipsisa64r6*-*-linux*)
 			default_mips_abi=n32
-			default_mips_arch=mips64r6
+			with_arch_32="mips32r6"
+			with_arch_64="mips64r6"
 			enable_mips_multilibs="yes"
 			;;
 		mipsisa64r2*-*-linux-gnuabi64)
 			default_mips_abi=64
-			default_mips_arch=mips64r2
+			with_arch_32="mips32r2"
+			with_arch_64="mips64r2"
 			enable_mips_multilibs="yes"
 			;;
 		mipsisa64r2*-*-linux*)
 			default_mips_abi=n32
-			default_mips_arch=mips64r2
+			with_arch_32="mips32r2"
+			with_arch_64="mips64r2"
 			enable_mips_multilibs="yes"
 			;;
 		mips64*-*-linux-gnuabi64 | mipsisa64*-*-linux-gnuabi64)
-- 
2.30.2


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

end of thread, other threads:[~2023-02-03 15:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-03  9:05 [PATCH] MIPS: use arch_32/64 instead of default_mips_arch YunQiang Su
2023-02-03 12:28 ` Richard Sandiford
2023-02-03 13:23   ` YunQiang Su
2023-02-03 14:08     ` Richard Sandiford
2023-02-03 14:34       ` Xi Ruoyao
2023-02-03 15:22         ` YunQiang Su

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).