From: Mike Frysinger Date: Sat, 9 Jan 2021 08:10:52 +0000 (-0500) Subject: sim: cr16/d10v: move storage out of header X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7eb99e5e27eebaf4a4acd469ad0856c0b35d80b3;p=binutils-gdb.git 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. --- diff --git a/sim/cr16/ChangeLog b/sim/cr16/ChangeLog index 9e8a16d5300..14edee23c29 100644 --- a/sim/cr16/ChangeLog +++ b/sim/cr16/ChangeLog @@ -1,3 +1,8 @@ +2021-01-09 Mike Frysinger + + * cr16_sim.h (State): Change to an extern. + * interp.c (State): Define. + 2021-01-09 Mike Frysinger * configure: Regenerate. diff --git a/sim/cr16/cr16_sim.h b/sim/cr16/cr16_sim.h index 4d6f1b95077..8232f0743f7 100644 --- a/sim/cr16/cr16_sim.h +++ b/sim/cr16/cr16_sim.h @@ -243,7 +243,9 @@ struct _state enum _ins_type ins_type; -} State; +}; + +extern struct _state State; extern uint32 OP[4]; diff --git a/sim/cr16/interp.c b/sim/cr16/interp.c index 0adb68a7722..cff7b885718 100644 --- a/sim/cr16/interp.c +++ b/sim/cr16/interp.c @@ -33,6 +33,8 @@ #include "gdb/signals.h" #include "opcode/cr16.h" +struct _state State; + int cr16_debug; uint32 OP[4]; diff --git a/sim/d10v/ChangeLog b/sim/d10v/ChangeLog index b82ea095bc0..13abbb86147 100644 --- a/sim/d10v/ChangeLog +++ b/sim/d10v/ChangeLog @@ -1,3 +1,8 @@ +2021-01-09 Mike Frysinger + + * d10v_sim.h (State): Change to an extern. + * interp.c (State): Define. + 2021-01-09 Mike Frysinger * configure: Regenerate. diff --git a/sim/d10v/d10v_sim.h b/sim/d10v/d10v_sim.h index 86243c9f700..a3755bf3ccb 100644 --- a/sim/d10v/d10v_sim.h +++ b/sim/d10v/d10v_sim.h @@ -270,7 +270,9 @@ struct _state enum _ins_type ins_type; -} State; +}; + +extern struct _state State; extern uint16 OP[4]; diff --git a/sim/d10v/interp.c b/sim/d10v/interp.c index cb8c6cf61f5..5c70b38d9d8 100644 --- a/sim/d10v/interp.c +++ b/sim/d10v/interp.c @@ -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. */