From 8c900d1e48979d504609dcfa03a40750537a66f9 Mon Sep 17 00:00:00 2001 From: Anghelo Carvajal Date: Sat, 4 Nov 2023 14:38:09 -0300 Subject: [PATCH] `-mabi=` pseudo support (#6) * Pass the mabi option to gas * Prevent cc1 from choking with -mabi option * gitingore and settings.json * pass mabi on every as invokation --- .gitignore | 46 +++++++++++++++++++++++++++++++++++++++++++ .vscode/settings.json | 5 +++++ config/mips/mips.c | 1 + config/mips/mips.h | 4 +++- gcc.c | 10 +++++----- 5 files changed, 60 insertions(+), 6 deletions(-) create mode 100644 .gitignore create mode 100644 .vscode/settings.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a90c415 --- /dev/null +++ b/.gitignore @@ -0,0 +1,46 @@ +*.o + +/cp/include +/cp/Makefile +/cp/stage1 +/cp/stage2 +/cp/stage3 +/cp/stage4 + +/bc-arity.h +/bc-opcode.h +/bc-opname.h +/bc-arity.h +/bi-arity +/bi-opcode +/bi-opname +/config.h +/config.status +/hconfig.h +/Makefile +/options.h +/specs.h +/tconfig.h +/tm.h +/stamp-* +/insn-* + +/genattr +/genattrtab +/gencodes +/genemit +/genextract +/genflags +/genconfig +/genopinit +/genoutput +/genpeep +/genrecog +/multilib.h + +/cccp +/cpp +/cc1 +/xgcc +/cc1plus +/g++ diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..e7fd6c6 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "editor.detectIndentation": false, + "editor.indentSize": 2, + "editor.tabSize": 8 +} \ No newline at end of file diff --git a/config/mips/mips.c b/config/mips/mips.c index d025b3b..1846213 100644 --- a/config/mips/mips.c +++ b/config/mips/mips.c @@ -195,6 +195,7 @@ int mips_isa; /* Strings to hold which cpu and instruction set architecture to use. */ char *mips_cpu_string; /* for -mcpu= */ char *mips_isa_string; /* for -mips{1,2,3,4} */ +char *mips_abi_string; /* for -mabi= */ /* Generating calls to position independent functions? */ enum mips_abicalls_type mips_abicalls; diff --git a/config/mips/mips.h b/config/mips/mips.h index df90ce3..3c039a0 100644 --- a/config/mips/mips.h +++ b/config/mips/mips.h @@ -119,6 +119,7 @@ extern enum mips_abicalls_type mips_abicalls;/* for svr4 abi pic calls */ extern int mips_isa; /* architectural level */ extern char *mips_cpu_string; /* for -mcpu= */ extern char *mips_isa_string; /* for -mips{1,2,3,4} */ +extern char *mips_abi_string; /* for -mabi= */ extern int dslots_load_total; /* total # load related delay slots */ extern int dslots_load_filled; /* # filled load delay slots */ extern int dslots_jump_total; /* total # jump related delay slots */ @@ -451,7 +452,8 @@ extern char *mktemp (); #define TARGET_OPTIONS \ { \ { "cpu=", &mips_cpu_string }, \ - { "ips", &mips_isa_string } \ + { "ips", &mips_isa_string }, \ + { "abi=", &mips_abi_string } \ } /* Macros to decide whether certain features are available or not, diff --git a/gcc.c b/gcc.c index 564545b..905833c 100644 --- a/gcc.c +++ b/gcc.c @@ -628,7 +628,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*}\ %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}\ %{!pipe:%g.s} %A\n }}}}"}, {"-", @@ -663,7 +663,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*}\ %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}\ %{!pipe:%g.s} %A\n }}}}"}, {".h", "@c-header"}, @@ -687,12 +687,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*}\ %{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*}\ %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}\ %i %A\n }}}}"}, {".S", "@assembler-with-cpp"}, @@ -705,7 +705,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*}\ %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}\ %{!pipe:%g.s} %A\n }}}}"}, #include "specs.h"