sim: cr16/d10v: move storage out of header

These ports declare their State variable in a header and then include
multiple times.  This causes linker errors with newer gcc due to the
change in -fno-common behavior.  Move the storage to a C file so we
only have one instance of it in the final program.
This commit is contained in:
Mike Frysinger 2021-01-09 03:10:52 -05:00
parent f074c07d8d
commit 7eb99e5e27
6 changed files with 20 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2021-01-09 Mike Frysinger <vapier@gentoo.org>
* cr16_sim.h (State): Change to an extern.
* interp.c (State): Define.
2021-01-09 Mike Frysinger <vapier@gentoo.org>
* configure: Regenerate.

View File

@ -243,7 +243,9 @@ struct _state
enum _ins_type ins_type;
} State;
};
extern struct _state State;
extern uint32 OP[4];

View File

@ -33,6 +33,8 @@
#include "gdb/signals.h"
#include "opcode/cr16.h"
struct _state State;
int cr16_debug;
uint32 OP[4];

View File

@ -1,3 +1,8 @@
2021-01-09 Mike Frysinger <vapier@gentoo.org>
* d10v_sim.h (State): Change to an extern.
* interp.c (State): Define.
2021-01-09 Mike Frysinger <vapier@gentoo.org>
* configure: Regenerate.

View File

@ -270,7 +270,9 @@ struct _state
enum _ins_type ins_type;
} State;
};
extern struct _state State;
extern uint16 OP[4];

View File

@ -25,6 +25,8 @@
enum _leftright { LEFT_FIRST, RIGHT_FIRST };
struct _state State;
int d10v_debug;
/* Set this to true to get the previous segment layout. */