@@ -1140,10 +1140,6 @@ handle_VFP_move (ARMul_State * state, ARMword instr)
/* EMULATION of ARM6. */
-/* The PC pipeline value depends on whether ARM
- or Thumb instructions are being executed. */
-ARMword isize;
-
ARMword
#ifdef MODE32
ARMul_Emulate32 (ARMul_State * state)
@@ -40,6 +40,10 @@ unsigned ARMul_MultTable[32] =
ARMword ARMul_ImmedTable[4096]; /* immediate DP LHS values */
char ARMul_BitList[256]; /* number of bits in a byte table */
+/* The PC pipeline value depends on whether ARM
+ or Thumb instructions are being executed. */
+ARMword isize;
+
/***************************************************************************\
* Call this routine once to set up the emulator's tables. *
\***************************************************************************/
@@ -129,9 +129,9 @@ union maverick_acc_regs
long double ld; /* Acc registers are 72-bits. */
};
-struct maverick_regs DSPregs[16];
-union maverick_acc_regs DSPacc[4];
-ARMword DSPsc;
+extern struct maverick_regs DSPregs[16];
+extern union maverick_acc_regs DSPacc[4];
+extern ARMword DSPsc;
static void
init (void)
@@ -236,7 +236,7 @@ sim_create_inferior (SIM_DESC sd ATTRIBUTE_UNUSED,
{
int argvlen = 0;
int mach;
- char **arg;
+ char * const *arg;
init ();
@@ -867,7 +867,7 @@ sim_open (SIM_OPEN_KIND kind,
sim_callback = cb;
- sim_target_parse_arg_array (argv);
+ sim_target_parse_arg_array ((char **) argv);
if (argv[1] != NULL)
{
Newer GCC's have switched to -fno-common by default, and this breaks the build for the ARM sim, like this: binutils-gdb.git~gdb-8.3-release/sim/arm/maverick.c:65: multiple definition of `DSPsc'; libsim.a(wrapper.o):binutils-gdb.git~gdb-8.3-release/sim/arm/wrapper.c:134: first defined here binutils-gdb.git~gdb-8.3-release/sim/arm/maverick.c:64: multiple definition of `DSPacc'; libsim.a(wrapper.o):binutils-gdb.git~gdb-8.3-release/sim/arm/wrapper.c:133: first defined here binutils-gdb.git~gdb-8.3-release/sim/arm/maverick.c:63: multiple definition of `DSPregs'; libsim.a(wrapper.o):binutils-gdb.git~gdb-8.3-release/sim/arm/wrapper.c:132: first defined here I also noticed a few warnings due to mismatching types, as follows: binutils-gdb/sim/arm/wrapper.c:870:31: warning: passing argument 1 of ‘sim_target_parse_arg_array’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] sim_target_parse_arg_array (argv); binutils-gdb/sim/arm/wrapper.c:775:1: note: expected ‘char **’ but argument is of type ‘char * const*’ sim_target_parse_arg_array (char ** argv) The following patch fixes both of the above. OK for trunk? sim/arm/ChangeLog: 2019-11-26 Luis Machado <luis.machado@linaro.org> * armemu.c (isize): Move this declaration ... * arminit.c (isize): ... here. * wrapper.c (DSPregs): Make extern. (DSPacc): Likewise. (DSPsc): Likewise. (sim_create_inferior): Cast variables to proper type. Signed-off-by: Luis Machado <luis.machado@linaro.org> Change-Id: I21db699d3b61b2de8c44053e47be4387285af28f --- sim/arm/armemu.c | 4 ---- sim/arm/arminit.c | 4 ++++ sim/arm/wrapper.c | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) -- 2.17.1