From f3a39218c04218c6e919b7b88adcaef715235181 Mon Sep 17 00:00:00 2001 From: Anghelo Carvajal Date: Thu, 6 Jun 2024 10:32:13 -0400 Subject: [PATCH] `-mabi=` pseudo support and pass `-irix-symtab` to gas (#2) * make cc1 to not choke with the -mabi flag * Make gcc pass -mabi to gas * Make gcc pass -irix-symtab to gas * fix --- gcc/config/mips/mips.c | 4 ++-- gcc/config/mips/mips.h | 1 + gcc/gcc.c | 12 ++++++------ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index 8b20fc5..f2268b4 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -4094,8 +4094,8 @@ override_options () error ("The -mabi=32 support does not work yet."); #else - if (mips_abi_string) - error ("This target does not support the -mabi switch."); + //if (mips_abi_string) + // error ("This target does not support the -mabi switch."); #endif #ifdef MIPS_CPU_STRING_DEFAULT diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h index 27256e5..cdb29ed 100644 --- a/gcc/config/mips/mips.h +++ b/gcc/config/mips/mips.h @@ -562,6 +562,7 @@ extern void mips_select_section (); SUBTARGET_TARGET_OPTIONS \ { "cpu=", &mips_cpu_string }, \ { "ips", &mips_isa_string }, \ + { "abi=", &mips_abi_string }, \ { "entry", &mips_entry_string }, \ { "no-mips16", &mips_no_mips16_string } \ } diff --git a/gcc/gcc.c b/gcc/gcc.c index 06a688f..72a9500 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -653,7 +653,7 @@ static struct compiler default_compilers[] = %{g*} %{O*} %{W*} %{w} %{pedantic*} %{ansi} \ %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\ %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\ - %{!S:as %a %Y\ + %{!S:as %a %Y %{mabi*} %{irix-symtab}\ %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}\ %{!pipe:%g.s} %A\n }}}}" }}, @@ -677,7 +677,7 @@ static struct compiler default_compilers[] = %{--help:--help} \ %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\ %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\ - %{!S:as %a %Y\ + %{!S:as %a %Y %{mabi*} %{irix-symtab}\ %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}\ %{!pipe:%g.s} %A\n }}}}" }}, @@ -716,7 +716,7 @@ static struct compiler default_compilers[] = %{aux-info*}\ %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\ %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\ - %{!S:as %a %Y\ + %{!S:as %a %Y %{mabi*} %{irix-symtab}\ %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}\ %{!pipe:%g.s} %A\n }}}}"}}, {".h", {"@c-header"}}, @@ -741,12 +741,12 @@ static struct compiler default_compilers[] = %{aux-info*}\ %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\ %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%g.s}} |\n\ - %{!S:as %a %Y\ + %{!S:as %a %Y %{mabi*} %{irix-symtab}\ %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}\ %{!pipe:%g.s} %A\n }}}}"}}, {".s", {"@assembler"}}, {"@assembler", - {"%{!M:%{!MM:%{!E:%{!S:as %a %Y\ + {"%{!M:%{!MM:%{!E:%{!S:as %a %Y %{mabi*} %{irix-symtab}\ %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}\ %i %A\n }}}}"}}, {".S", {"@assembler-with-cpp"}}, @@ -760,7 +760,7 @@ static struct compiler default_compilers[] = %{traditional-cpp:-traditional}\ %{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\ %i %{!M:%{!MM:%{!E:%{!pipe:%g.s}}}}%{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}} |\n", - "%{!M:%{!MM:%{!E:%{!S:as %a %Y\ + "%{!M:%{!MM:%{!E:%{!S:as %a %Y %{mabi*} %{irix-symtab}\ %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}\ %{!pipe:%g.s} %A\n }}}}"}}, #include "specs.h"