Skip to content

Commit

Permalink
-mabi= pseudo support (#6)
Browse files Browse the repository at this point in the history
* Pass the mabi option to gas

* Prevent cc1 from choking with -mabi option

* gitingore and settings.json

* pass mabi on every as invokation
  • Loading branch information
AngheloAlf authored Nov 4, 2023
1 parent 7b00be2 commit 8c900d1
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 6 deletions.
46 changes: 46 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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++
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"editor.detectIndentation": false,
"editor.indentSize": 2,
"editor.tabSize": 8
}
1 change: 1 addition & 0 deletions config/mips/mips.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ int mips_isa;
/* Strings to hold which cpu and instruction set architecture to use. */
char *mips_cpu_string; /* for -mcpu=<xxx> */
char *mips_isa_string; /* for -mips{1,2,3,4} */
char *mips_abi_string; /* for -mabi=<xxx> */

/* Generating calls to position independent functions? */
enum mips_abicalls_type mips_abicalls;
Expand Down
4 changes: 3 additions & 1 deletion config/mips/mips.h
Original file line number Diff line number Diff line change
Expand Up @@ -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=<xxx> */
extern char *mips_isa_string; /* for -mips{1,2,3,4} */
extern char *mips_abi_string; /* for -mabi=<xxx> */
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 */
Expand Down Expand Up @@ -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,
Expand Down
10 changes: 5 additions & 5 deletions gcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}}}"},
{"-",
Expand Down Expand Up @@ -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"},
Expand All @@ -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"},
Expand All @@ -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"
Expand Down

0 comments on commit 8c900d1

Please sign in to comment.